Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/files_videoplayer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2022-10-07 16:12:28 +0300
committerGitHub <noreply@github.com>2022-10-07 16:12:28 +0300
commit572c72a0737b07961ecc75071125c28634ac19be (patch)
tree7bff50b6b70cbe8b0e03f208190b6f79cb344023
parentcfd9423686b98f18ebe1e3516a481fa50131d834 (diff)
parentd035f2fb338b4a7f45e4d8a5ae48fbf7a84b6663 (diff)
Merge pull request #293 from nextcloud/backport/289/stable24v24.0.7rc1v24.0.7stable24
[stable24] Bump terser from 5.7.1 to 5.15.1
-rw-r--r--js/files_videoplayer-css_style_css.js.map2
-rw-r--r--js/files_videoplayer-main.js4
-rw-r--r--js/files_videoplayer-main.js.map2
-rw-r--r--js/files_videoplayer-vendors-node_modules_video_js_dist_video-js_css.js.map2
-rw-r--r--js/files_videoplayer-vendors-node_modules_video_js_dist_video_es_js.js4
-rw-r--r--js/files_videoplayer-vendors-node_modules_video_js_dist_video_es_js.js.map2
-rw-r--r--package-lock.json190
7 files changed, 165 insertions, 41 deletions
diff --git a/js/files_videoplayer-css_style_css.js.map b/js/files_videoplayer-css_style_css.js.map
index b4b6692..d217b68 100644
--- a/js/files_videoplayer-css_style_css.js.map
+++ b/js/files_videoplayer-css_style_css.js.map
@@ -1 +1 @@
-{"version":3,"file":"files_videoplayer-css_style_css.js?v=211b329b40ae32bf5d72","mappings":"+JAEIA,E,MAA0B,IAA4B,GAE1DA,EAAwBC,KAAK,CAACC,EAAOC,GAAI,y1KAA81K,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,2BAA2B,MAAQ,GAAG,SAAW,+nDAA+nD,eAAiB,CAAC,01KAA81K,WAAa,MAE/8Y,W,SCEAD,EAAOE,QAAU,SAAUC,GACzB,IAAIC,EAAO,GAuDX,OArDAA,EAAKC,SAAW,WACd,O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I7E,EAAI,EAAGA,EAAI4E,EAAgBvE,OAAQL,IAAK,CAC/C,IACIgC,EAAQR,EADKoD,EAAgB5E,IAEjCuB,EAAYS,GAAOI,aAKrB,IAFA,IAAI4C,EAAqBrD,EAAakD,EAAStE,GAEtCD,EAAK,EAAGA,EAAKsE,EAAgBvE,OAAQC,IAAM,CAClD,IAEI2E,EAASzD,EAFKoD,EAAgBtE,IAIK,IAAnCiB,EAAY0D,GAAQ7C,aACtBb,EAAY0D,GAAQ5C,UAEpBd,EAAY2D,OAAOD,EAAQ,IAI/BL,EAAkBI","sources":["webpack:///files_videoplayer/css/style.css","webpack:///files_videoplayer/node_modules/css-loader/dist/runtime/api.js","webpack://files_videoplayer/./css/style.css?da1f","webpack:///files_videoplayer/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"],"sourcesContent":["// Imports\nimport ___CSS_LOADER_API_IMPORT___ from \"../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(true);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \"#videoplayer_overlay video {\\n\\toutline: none;\\n}\\n\\n#videoplayer_overlay {\\n\\tposition: fixed;\\n\\ttop: 0px;\\n\\tbottom: 0px;\\n\\tleft: 0px;\\n\\tright: 0px;\\n\\tbackground-color: #4c4c4c;\\n\\tbackground-color: rgba(0, 0, 0, .7);\\n\\tz-index: 3000;\\n\\topacity: 0;\\n\\ttransition: opacity 250ms ease-in;\\n}\\n\\n#videoplayer_overlay.show {\\n\\topacity: 1;\\n}\\n\\n#videoplayer_outer_container {\\n\\tposition: fixed;\\n\\ttop: 50%;\\n\\tleft: 50%;\\n\\twidth: 95%;\\n\\tmax-width: 854px;\\n\\ttransform: translate(-50%, -50%);\\n}\\n\\n#videoplayer_container {\\n\\tposition: relative;\\n\\twidth: 95%;\\n\\tmax-width: 854px;\\n\\tmargin: 0 auto;\\n\\tcolor: #4d4d4d;\\n\\tbackground: #fff;\\n\\tbox-shadow: 0 0 20px #222;\\n\\tz-index: 3001;\\n}\\n\\n#videoplayer_container:before {\\n\\tcontent: \\\"\\\";\\n\\tdisplay: block;\\n\\tpadding-top: 56.25%;\\n}\\n\\n#videoplayer {\\n\\tposition: absolute;\\n\\ttop: 0;\\n\\tright: 0;\\n\\tbottom: 0;\\n\\tleft: 0;\\n}\\n\\n#box-close {\\n\\tposition: absolute;\\n\\ttop: 10px;\\n\\tright: 10px;\\n\\twidth: 30px;\\n\\theight: 30px;\\n\\topacity: .35;\\n\\tcursor: pointer;\\n}\\n\\n#box-close:hover {\\n\\topacity: .75;\\n}\\n\\n.vjs-sublime-skin.vjs-has-started.vjs-user-inactive.vjs-playing #box-close {\\n\\topacity: 0;\\n\\ttransition: opacity 1s cubic-bezier(.455,.03,.515,.955);\\n}\\n\\n\\n/* Video.js adjustments */\\n\\n.video-js .vjs-menu-button-inline.vjs-slider-active,.video-js .vjs-menu-button-inline:focus,.video-js .vjs-menu-button-inline:hover,.video-js.vjs-no-flex .vjs-menu-button-inline {\\n\\twidth: 10em\\n}\\n\\n.video-js .vjs-controls-disabled .vjs-big-play-button {\\n\\tdisplay: none!important\\n}\\n\\n.video-js .vjs-control {\\n\\twidth: 3em\\n}\\n\\n.video-js .vjs-menu-button-inline:before {\\n\\twidth: 1.5em\\n}\\n\\n.vjs-menu-button-inline .vjs-menu {\\n\\tleft: 3em\\n}\\n\\n.vjs-paused.vjs-has-started.video-js .vjs-big-play-button,.video-js.vjs-ended .vjs-big-play-button,.video-js.vjs-paused .vjs-big-play-button {\\n\\tdisplay: block\\n}\\n\\n.video-js .vjs-load-progress div,.vjs-seeking .vjs-big-play-button,.vjs-waiting .vjs-big-play-button {\\n\\tdisplay: none!important\\n}\\n\\n.video-js .vjs-mouse-display:after,.video-js .vjs-play-progress:after {\\n\\tpadding: 0 .4em .3em\\n}\\n\\n.video-js.vjs-ended .vjs-loading-spinner {\\n\\tdisplay: none;\\n}\\n\\n.video-js.vjs-ended .vjs-big-play-button {\\n\\tdisplay: block !important;\\n}\\n\\nvideo-js.vjs-ended .vjs-big-play-button,.video-js.vjs-paused .vjs-big-play-button,.vjs-paused.vjs-has-started.video-js .vjs-big-play-button {\\n\\tdisplay: block\\n}\\n\\n.video-js .vjs-big-play-button {\\n\\ttop: 50%;\\n\\tleft: 50%;\\n}\\n\\n.video-js.vjs-big-play-centered .vjs-big-play-button {\\n\\tbackground-color: rgba(0,0,0,0.35);\\n\\tfont-size: 3em;\\n\\tborder-radius: 50%;\\n\\theight: 2em !important;\\n\\tline-height: 2em !important;\\n\\tmargin-top: -1em !important;\\n\\tmargin-left: -1em !important;\\n}\\n\\n.video-js:hover .vjs-big-play-button,.video-js .vjs-big-play-button:focus,.video-js .vjs-big-play-button:active {\\n\\tbackground-color: rgba(0,0,0,0.35)\\n}\\n\\n.video-js .vjs-loading-spinner {\\n\\tborder-color: rgba(255,255,255,0.7)\\n}\\n\\n.video-js .vjs-control-bar2 {\\n\\tbackground-color: transparent\\n}\\n\\n.video-js .vjs-control-bar {\\n\\tbackground-color: rgba(0,0,0,0) !important;\\n\\tcolor: #ffffff;\\n\\tfont-size: 18px\\n}\\n\\n.video-js .vjs-play-progress,.video-js .vjs-volume-level {\\n\\tbackground-color: #2483d5\\n}\\n\\n.video-js .vjs-big-play-button {\\n\\theight: 2em !important;\\n\\twidth: 2em !important;\\n\\tline-height: 1.9em !important;\\n\\tmargin-top: -1em !important;\\n\\tmargin-left: -1em;\\n\\tborder-width: 3px\\n}\\n\\n.video-js .vjs-icon-play:before, .video-js .vjs-big-play-button:before {\\n\\tfont-size: 50px;\\n}\\n\\n.video-js .vjs-progress-holder {\\n\\tfont-size: 1.7em;\\n\\tborder-radius: 10px;\\n}\\n\\n.video-js .vjs-progress-holder .vjs-play-progress, .video-js .vjs-progress-holder .vjs-load-progress, .video-js .vjs-progress-holder .vjs-load-progress div, .video-js .vjs-slider,.vjs-volume-level {\\n\\tborder-radius: 10px;\\n}\\n\\n.video-js .vjs-load-progress {\\n\\tbackground: rgba(255,255,255,0.5);\\n}\\n\\n.video-js .vjs-big-play-button {\\n\\theight: 2em !important;\\n\\twidth: 2em !important;\\n\\tline-height: 1.9em !important;\\n\\tmargin-top: -1em !important;\\n\\tmargin-left: -1em;\\n\\tborder-width:3px\\n}\\n.video-js .vjs-icon-play:before, .video-js .vjs-big-play-button:before {\\n\\tfont-size: 50px;\\n}\\n.video-js .vjs-progress-holder {\\n\\tfont-size: 1.7em;\\n\\tborder-radius: 10px;\\n}\\n.video-js .vjs-progress-holder .vjs-play-progress, .video-js .vjs-progress-holder .vjs-load-progress, .video-js .vjs-progress-holder .vjs-load-progress div, .video-js .vjs-slider,.vjs-volume-level {\\n\\tborder-radius: 10px;\\n}\\n.video-js .vjs-load-progress {\\n\\tbackground: rgba(255,255,255,0.5);\\n}\\n\\n.video-js button:active {\\n\\tbackground: transparent !important;\\n\\tcolor: #fff !important;\\n}\\n\\n/* hide error icon */\\n.vjs-error .vjs-error-display::before {\\n\\tcontent: \\\"\\\" !important;\\n}\\n\\n/* fix for fluid size of the player */\\n#imgframe #videoplayer_view {\\n\\tdisplay: inline-block;\\n}\\n\\n/* public sharing view styles */\\n#imgframe .video-js .vjs-tech {\\n\\tposition: relative;\\n\\twidth: auto;\\n\\theight: auto;\\n}\\n\\n/* fullscreen public videos see https://github.com/nextcloud/files_videoplayer/issues/77 */\\n#imgframe .video-js.vjs-fullscreen .vjs-tech {\\n\\twidth:100%;\\n\\theight:100%;\\n}\\n\\n#imgframe .video-js:not(.vjs-fullscreen),\\n#imgframe .video-js:not(.vjs-fullscreen) .vjs-tech {\\n\\tmax-height: calc(100vh - 280px) !important;\\n\\tmin-width: 300px;\\n\\tmax-width: 100% !important;\\n}\\n\", \"\",{\"version\":3,\"sources\":[\"webpack://css/style.css\"],\"names\":[],\"mappings\":\"AAAA;CACC,aAAa;AACd;;AAEA;CACC,eAAe;CACf,QAAQ;CACR,WAAW;CACX,SAAS;CACT,UAAU;CACV,yBAAyB;CACzB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ClC;;AAEA;CACC,sBAAsB;CACtB,qBAAqB;CACrB,6BAA6B;CAC7B,2BAA2B;CAC3B,iBAAiB;CACjB;AACD;AACA;CACC,eAAe;AAChB;AACA;CACC,gBAAgB;CAChB,mBAAmB;AACpB;AACA;CACC,mBAAmB;AACpB;AACA;CACC,iCAAiC;AAClC;;AAEA;CACC,kCAAkC;CAClC,sBAAsB;AACvB;;AAEA,oBAAoB;AACpB;CACC,sBAAsB;AACvB;;AAEA,qCAAqC;AACrC;CACC,qBAAqB;AACtB;;AAEA,+BAA+B;AAC/B;CACC,kBAAkB;CAClB,WAAW;CACX,YAAY;AACb;;AAEA,0FAA0F;AAC1F;CACC,UAAU;CACV,WAAW;AACZ;;AAEA;;CAEC,0CAA0C;CAC1C,gBAAgB;CAChB,0BAA0B;AAC3B\",\"sourcesContent\":[\"#videoplayer_overlay video {\\n\\toutline: none;\\n}\\n\\n#videoplayer_overlay {\\n\\tposition: fixed;\\n\\ttop: 0px;\\n\\tbottom: 0px;\\n\\tleft: 0px;\\n\\tright: 0px;\\n\\tbackground-color: #4c4c4c;\\n\\tbackground-color: rgba(0, 0, 0, .7);\\n\\tz-index: 3000;\\n\\topacity: 0;\\n\\ttransition: opacity 250ms ease-in;\\n}\\n\\n#videoplayer_overlay.show {\\n\\topacity: 1;\\n}\\n\\n#videoplayer_outer_container {\\n\\tposition: fixed;\\n\\ttop: 50%;\\n\\tleft: 50%;\\n\\twidth: 95%;\\n\\tmax-width: 854px;\\n\\ttransform: translate(-50%, -50%);\\n}\\n\\n#videoplayer_container {\\n\\tposition: relative;\\n\\twidth: 95%;\\n\\tmax-width: 854px;\\n\\tmargin: 0 auto;\\n\\tcolor: #4d4d4d;\\n\\tbackground: #fff;\\n\\tbox-shadow: 0 0 20px #222;\\n\\tz-index: 3001;\\n}\\n\\n#videoplayer_container:before {\\n\\tcontent: \\\"\\\";\\n\\tdisplay: block;\\n\\tpadding-top: 56.25%;\\n}\\n\\n#videoplayer {\\n\\tposition: absolute;\\n\\ttop: 0;\\n\\tright: 0;\\n\\tbottom: 0;\\n\\tleft: 0;\\n}\\n\\n#box-close {\\n\\tposition: absolute;\\n\\ttop: 10px;\\n\\tright: 10px;\\n\\twidth: 30px;\\n\\theight: 30px;\\n\\topacity: .35;\\n\\tcursor: pointer;\\n}\\n\\n#box-close:hover {\\n\\topacity: .75;\\n}\\n\\n.vjs-sublime-skin.vjs-has-started.vjs-user-inactive.vjs-playing #box-close {\\n\\topacity: 0;\\n\\ttransition: opacity 1s cubic-bezier(.455,.03,.515,.955);\\n}\\n\\n\\n/* Video.js adjustments */\\n\\n.video-js .vjs-menu-button-inline.vjs-slider-active,.video-js .vjs-menu-button-inline:focus,.video-js .vjs-menu-button-inline:hover,.video-js.vjs-no-flex .vjs-menu-button-inline {\\n\\twidth: 10em\\n}\\n\\n.video-js .vjs-controls-disabled .vjs-big-play-button {\\n\\tdisplay: none!important\\n}\\n\\n.video-js .vjs-control {\\n\\twidth: 3em\\n}\\n\\n.video-js .vjs-menu-button-inline:before {\\n\\twidth: 1.5em\\n}\\n\\n.vjs-menu-button-inline .vjs-menu {\\n\\tleft: 3em\\n}\\n\\n.vjs-paused.vjs-has-started.video-js .vjs-big-play-button,.video-js.vjs-ended .vjs-big-play-button,.video-js.vjs-paused .vjs-big-play-button {\\n\\tdisplay: block\\n}\\n\\n.video-js .vjs-load-progress div,.vjs-seeking .vjs-big-play-button,.vjs-waiting .vjs-big-play-button {\\n\\tdisplay: none!important\\n}\\n\\n.video-js .vjs-mouse-display:after,.video-js .vjs-play-progress:after {\\n\\tpadding: 0 .4em .3em\\n}\\n\\n.video-js.vjs-ended .vjs-loading-spinner {\\n\\tdisplay: none;\\n}\\n\\n.video-js.vjs-ended .vjs-big-play-button {\\n\\tdisplay: block !important;\\n}\\n\\nvideo-js.vjs-ended .vjs-big-play-button,.video-js.vjs-paused .vjs-big-play-button,.vjs-paused.vjs-has-started.video-js .vjs-big-play-button {\\n\\tdisplay: block\\n}\\n\\n.video-js .vjs-big-play-button {\\n\\ttop: 50%;\\n\\tleft: 50%;\\n}\\n\\n.video-js.vjs-big-play-centered .vjs-big-play-button {\\n\\tbackground-color: rgba(0,0,0,0.35);\\n\\tfont-size: 3em;\\n\\tborder-radius: 50%;\\n\\theight: 2em !important;\\n\\tline-height: 2em !important;\\n\\tmargin-top: -1em !important;\\n\\tmargin-left: -1em !important;\\n}\\n\\n.video-js:hover .vjs-big-play-button,.video-js .vjs-big-play-button:focus,.video-js .vjs-big-play-button:active {\\n\\tbackground-color: rgba(0,0,0,0.35)\\n}\\n\\n.video-js .vjs-loading-spinner {\\n\\tborder-color: rgba(255,255,255,0.7)\\n}\\n\\n.video-js .vjs-control-bar2 {\\n\\tbackground-color: transparent\\n}\\n\\n.video-js .vjs-control-bar {\\n\\tbackground-color: rgba(0,0,0,0) !important;\\n\\tcolor: #ffffff;\\n\\tfont-size: 18px\\n}\\n\\n.video-js .vjs-play-progress,.video-js .vjs-volume-level {\\n\\tbackground-color: #2483d5\\n}\\n\\n.video-js .vjs-big-play-button {\\n\\theight: 2em !important;\\n\\twidth: 2em !important;\\n\\tline-height: 1.9em !important;\\n\\tmargin-top: -1em !important;\\n\\tmargin-left: -1em;\\n\\tborder-width: 3px\\n}\\n\\n.video-js .vjs-icon-play:before, .video-js .vjs-big-play-button:before {\\n\\tfont-size: 50px;\\n}\\n\\n.video-js .vjs-progress-holder {\\n\\tfont-size: 1.7em;\\n\\tborder-radius: 10px;\\n}\\n\\n.video-js .vjs-progress-holder .vjs-play-progress, .video-js .vjs-progress-holder .vjs-load-progress, .video-js .vjs-progress-holder .vjs-load-progress div, .video-js .vjs-slider,.vjs-volume-level {\\n\\tborder-radius: 10px;\\n}\\n\\n.video-js .vjs-load-progress {\\n\\tbackground: rgba(255,255,255,0.5);\\n}\\n\\n.video-js .vjs-big-play-button {\\n\\theight: 2em !important;\\n\\twidth: 2em !important;\\n\\tline-height: 1.9em !important;\\n\\tmargin-top: -1em !important;\\n\\tmargin-left: -1em;\\n\\tborder-width:3px\\n}\\n.video-js .vjs-icon-play:before, .video-js .vjs-big-play-button:before {\\n\\tfont-size: 50px;\\n}\\n.video-js .vjs-progress-holder {\\n\\tfont-size: 1.7em;\\n\\tborder-radius: 10px;\\n}\\n.video-js .vjs-progress-holder .vjs-play-progress, .video-js .vjs-progress-holder .vjs-load-progress, .video-js .vjs-progress-holder .vjs-load-progress div, .video-js .vjs-slider,.vjs-volume-level {\\n\\tborder-radius: 10px;\\n}\\n.video-js .vjs-load-progress {\\n\\tbackground: rgba(255,255,255,0.5);\\n}\\n\\n.video-js button:active {\\n\\tbackground: transparent !important;\\n\\tcolor: #fff !important;\\n}\\n\\n/* hide error icon */\\n.vjs-error .vjs-error-display::before {\\n\\tcontent: \\\"\\\" !important;\\n}\\n\\n/* fix for fluid size of the player */\\n#imgframe #videoplayer_view {\\n\\tdisplay: inline-block;\\n}\\n\\n/* public sharing view styles */\\n#imgframe .video-js .vjs-tech {\\n\\tposition: relative;\\n\\twidth: auto;\\n\\theight: auto;\\n}\\n\\n/* fullscreen public videos see https://github.com/nextcloud/files_videoplayer/issues/77 */\\n#imgframe .video-js.vjs-fullscreen .vjs-tech {\\n\\twidth:100%;\\n\\theight:100%;\\n}\\n\\n#imgframe .video-js:not(.vjs-fullscreen),\\n#imgframe .video-js:not(.vjs-fullscreen) .vjs-tech {\\n\\tmax-height: calc(100vh - 280px) !important;\\n\\tmin-width: 300px;\\n\\tmax-width: 100% !important;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\n// eslint-disable-next-line func-names\nmodule.exports = function (useSourceMap) {\n var list = []; // return the list of modules as css string\n\n list.toString = function toString() {\n return this.map(function (item) {\n var content = cssWithMappingToString(item, useSourceMap);\n\n if (item[2]) {\n return \"@media \".concat(item[2], \" {\").concat(content, \"}\");\n }\n\n return content;\n }).join('');\n }; // import a list of modules into the list\n // eslint-disable-next-line func-names\n\n\n list.i = function (modules, mediaQuery, dedupe) {\n if (typeof modules === 'string') {\n // eslint-disable-next-line no-param-reassign\n modules = [[null, modules, '']];\n }\n\n var alreadyImportedModules = {};\n\n if (dedupe) {\n for (var i = 0; i < this.length; i++) {\n // eslint-disable-next-line prefer-destructuring\n var id = this[i][0];\n\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n\n for (var _i = 0; _i < modules.length; _i++) {\n var item = [].concat(modules[_i]);\n\n if (dedupe && alreadyImportedModules[item[0]]) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n if (mediaQuery) {\n if (!item[2]) {\n item[2] = mediaQuery;\n } else {\n item[2] = \"\".concat(mediaQuery, \" and \").concat(item[2]);\n }\n }\n\n list.push(item);\n }\n };\n\n return list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n var content = item[1] || ''; // eslint-disable-next-line prefer-destructuring\n\n var cssMapping = item[3];\n\n if (!cssMapping) {\n return content;\n }\n\n if (useSourceMap && typeof btoa === 'function') {\n var sourceMapping = toComment(cssMapping);\n var sourceURLs = cssMapping.sources.map(function (source) {\n return \"/*# sourceURL=\".concat(cssMapping.sourceRoot || '').concat(source, \" */\");\n });\n return [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n }\n\n return [content].join('\\n');\n} // Adapted from convert-source-map (MIT)\n\n\nfunction toComment(sourceMap) {\n // eslint-disable-next-line no-undef\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n return \"/*# \".concat(data, \" */\");\n}","import api from \"!../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../node_modules/css-loader/dist/cjs.js!./style.css\";\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","\"use strict\";\n\nvar isOldIE = function isOldIE() {\n var memo;\n return function memorize() {\n if (typeof memo === 'undefined') {\n // Test for IE <= 9 as proposed by Browserhacks\n // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n // Tests for existence of standard globals is to allow style-loader\n // to operate correctly into non-standard environments\n // @see https://github.com/webpack-contrib/style-loader/issues/177\n memo = Boolean(window && document && document.all && !window.atob);\n }\n\n return memo;\n };\n}();\n\nvar getTarget = function getTarget() {\n var memo = {};\n return function memorize(target) {\n if (typeof memo[target] === 'undefined') {\n var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself\n\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n\n memo[target] = styleTarget;\n }\n\n return memo[target];\n };\n}();\n\nvar stylesInDom = [];\n\nfunction getIndexByIdentifier(identifier) {\n var result = -1;\n\n for (var i = 0; i < stylesInDom.length; i++) {\n if (stylesInDom[i].identifier === identifier) {\n result = i;\n break;\n }\n }\n\n return result;\n}\n\nfunction modulesToDom(list, options) {\n var idCountMap = {};\n var identifiers = [];\n\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var count = idCountMap[id] || 0;\n var identifier = \"\".concat(id, \" \").concat(count);\n idCountMap[id] = count + 1;\n var index = getIndexByIdentifier(identifier);\n var obj = {\n css: item[1],\n media: item[2],\n sourceMap: item[3]\n };\n\n if (index !== -1) {\n stylesInDom[index].references++;\n stylesInDom[index].updater(obj);\n } else {\n stylesInDom.push({\n identifier: identifier,\n updater: addStyle(obj, options),\n references: 1\n });\n }\n\n identifiers.push(identifier);\n }\n\n return identifiers;\n}\n\nfunction insertStyleElement(options) {\n var style = document.createElement('style');\n var attributes = options.attributes || {};\n\n if (typeof attributes.nonce === 'undefined') {\n var nonce = typeof __webpack_nonce__ !== 'undefined' ? __webpack_nonce__ : null;\n\n if (nonce) {\n attributes.nonce = nonce;\n }\n }\n\n Object.keys(attributes).forEach(function (key) {\n style.setAttribute(key, attributes[key]);\n });\n\n if (typeof options.insert === 'function') {\n options.insert(style);\n } else {\n var target = getTarget(options.insert || 'head');\n\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n\n target.appendChild(style);\n }\n\n return style;\n}\n\nfunction removeStyleElement(style) {\n // istanbul ignore if\n if (style.parentNode === null) {\n return false;\n }\n\n style.parentNode.removeChild(style);\n}\n/* istanbul ignore next */\n\n\nvar replaceText = function replaceText() {\n var textStore = [];\n return function replace(index, replacement) {\n textStore[index] = replacement;\n return textStore.filter(Boolean).join('\\n');\n };\n}();\n\nfunction applyToSingletonTag(style, index, remove, obj) {\n var css = remove ? '' : obj.media ? \"@media \".concat(obj.media, \" {\").concat(obj.css, \"}\") : obj.css; // For old IE\n\n /* istanbul ignore if */\n\n if (style.styleSheet) {\n style.styleSheet.cssText = replaceText(index, css);\n } else {\n var cssNode = document.createTextNode(css);\n var childNodes = style.childNodes;\n\n if (childNodes[index]) {\n style.removeChild(childNodes[index]);\n }\n\n if (childNodes.length) {\n style.insertBefore(cssNode, childNodes[index]);\n } else {\n style.appendChild(cssNode);\n }\n }\n}\n\nfunction applyToTag(style, options, obj) {\n var css = obj.css;\n var media = obj.media;\n var sourceMap = obj.sourceMap;\n\n if (media) {\n style.setAttribute('media', media);\n } else {\n style.removeAttribute('media');\n }\n\n if (sourceMap && typeof btoa !== 'undefined') {\n css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n } // For old IE\n\n /* istanbul ignore if */\n\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n while (style.firstChild) {\n style.removeChild(style.firstChild);\n }\n\n style.appendChild(document.createTextNode(css));\n }\n}\n\nvar singleton = null;\nvar singletonCounter = 0;\n\nfunction addStyle(obj, options) {\n var style;\n var update;\n var remove;\n\n if (options.singleton) {\n var styleIndex = singletonCounter++;\n style = singleton || (singleton = insertStyleElement(options));\n update = applyToSingletonTag.bind(null, style, styleIndex, false);\n remove = applyToSingletonTag.bind(null, style, styleIndex, true);\n } else {\n style = insertStyleElement(options);\n update = applyToTag.bind(null, style, options);\n\n remove = function remove() {\n removeStyleElement(style);\n };\n }\n\n update(obj);\n return function updateStyle(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {\n return;\n }\n\n update(obj = newObj);\n } else {\n remove();\n }\n };\n}\n\nmodule.exports = function (list, options) {\n options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>\n // tags it will allow on a page\n\n if (!options.singleton && typeof options.singleton !== 'boolean') {\n options.singleton = isOldIE();\n }\n\n list = list || [];\n var lastIdentifiers = modulesToDom(list, options);\n return function update(newList) {\n newList = newList || [];\n\n if (Object.prototype.toString.call(newList) !== '[object Array]') {\n return;\n }\n\n for (var i = 0; i < lastIdentifiers.length; i++) {\n var identifier = lastIdentifiers[i];\n var index = getIndexByIdentifier(identifier);\n stylesInDom[index].references--;\n }\n\n var newLastIdentifiers = modulesToDom(newList, options);\n\n for (var _i = 0; _i < lastIdentifiers.length; _i++) {\n var _identifier = lastIdentifiers[_i];\n\n var _index = getIndexByIdentifier(_identifier);\n\n if (stylesInDom[_index].references === 0) {\n stylesInDom[_index].updater();\n\n stylesInDom.splice(_index, 1);\n }\n }\n\n lastIdentifiers = newLastIdentifiers;\n };\n};"],"names":["___CSS_LOADER_EXPORT___","push","module","id","exports","useSourceMap","list","toString","this","map","item","content","cssMapping","btoa","sourceMapping","sourceMap","base64","unescape","encodeURIComponent","JSON","stringify","data","concat","sourceURLs","sources","source","sourceRoot","join","cssWithMappingToString","i","modules","mediaQuery","dedupe","alreadyImportedModules","length","_i","options","memo","isOldIE","Boolean","window","document","all","atob","getTarget","target","styleTarget","querySelector","HTMLIFrameElement","contentDocument","head","e","stylesInDom","getIndexByIdentifier","identifier","result","modulesToDom","idCountMap","identifiers","base","count","index","obj","css","media","references","updater","addStyle","insertStyleElement","style","createElement","attributes","nonce","Object","keys","forEach","key","setAttribute","insert","Error","appendChild","textStore","replaceText","replacement","filter","applyToSingletonTag","remove","styleSheet","cssText","cssNode","createTextNode","childNodes","removeChild","insertBefore","applyToTag","removeAttribute","firstChild","singleton","singletonCounter","update","styleIndex","bind","parentNode","removeStyleElement","newObj","lastIdentifiers","newList","prototype","call","newLastIdentifiers","_index","splice"],"sourceRoot":""} \ No newline at end of file
+{"version":3,"file":"files_videoplayer-css_style_css.js?v=211b329b40ae32bf5d72","mappings":"+JAEIA,E,MAA0B,IAA4B,GAE1DA,EAAwBC,KAAK,CAACC,EAAOC,GAAI,y1KAA81K,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,2BAA2B,MAAQ,GAAG,SAAW,+nDAA+nD,eAAiB,CAAC,01KAA81K,WAAa,MAE/8Y,S,WCEAD,EAAOE,QAAU,SAAUC,GACzB,IAAIC,EAAO,GAuDX,OArDAA,EAAKC,SAAW,WACd,OAAOC,KAAKC,KAAI,SAAUC,GACxB,IAAIC,EAsDV,SAAgCD,EAAML,GACpC,IAAIM,EAAUD,EAAK,IAAM,GAErBE,EAAaF,EAAK,GAEtB,IAAKE,EACH,OAAOD,EAGT,GAAIN,GAAgC,mBAATQ,KAAqB,CAC9C,IAAIC,GAWWC,EAXeH,EAa5BI,EAASH,KAAKI,SAASC,mBAAmBC,KAAKC,UAAUL,MACzDM,EAAO,+DAA+DC,OAAON,GAC1E,OAAOM,OAAOD,EAAM,QAdrBE,EAAaX,EAAWY,QAAQf,KAAI,SAAUgB,GAChD,MAAO,iBAAiBH,OAAOV,EAAWc,YAAc,IAAIJ,OAAOG,EAAQ,MAC7E,IACA,MAAO,CAACd,GAASW,OAAOC,GAAYD,OAAO,CAACR,IAAgBa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,EAAY0D,GAAQ7C,aACtBb,EAAY0D,GAAQ5C,UAEpBd,EAAY2D,OAAOD,EAAQ,GAE/B,CAEAL,EAAkBI,CAtBlB,CAuBF,CACF,C","sources":["webpack:///files_videoplayer/css/style.css","webpack:///files_videoplayer/node_modules/css-loader/dist/runtime/api.js","webpack://files_videoplayer/./css/style.css?da1f","webpack:///files_videoplayer/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"],"sourcesContent":["// Imports\nimport ___CSS_LOADER_API_IMPORT___ from \"../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(true);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \"#videoplayer_overlay video {\\n\\toutline: none;\\n}\\n\\n#videoplayer_overlay {\\n\\tposition: fixed;\\n\\ttop: 0px;\\n\\tbottom: 0px;\\n\\tleft: 0px;\\n\\tright: 0px;\\n\\tbackground-color: #4c4c4c;\\n\\tbackground-color: rgba(0, 0, 0, .7);\\n\\tz-index: 3000;\\n\\topacity: 0;\\n\\ttransition: opacity 250ms ease-in;\\n}\\n\\n#videoplayer_overlay.show {\\n\\topacity: 1;\\n}\\n\\n#videoplayer_outer_container {\\n\\tposition: fixed;\\n\\ttop: 50%;\\n\\tleft: 50%;\\n\\twidth: 95%;\\n\\tmax-width: 854px;\\n\\ttransform: translate(-50%, -50%);\\n}\\n\\n#videoplayer_container {\\n\\tposition: relative;\\n\\twidth: 95%;\\n\\tmax-width: 854px;\\n\\tmargin: 0 auto;\\n\\tcolor: #4d4d4d;\\n\\tbackground: #fff;\\n\\tbox-shadow: 0 0 20px #222;\\n\\tz-index: 3001;\\n}\\n\\n#videoplayer_container:before {\\n\\tcontent: \\\"\\\";\\n\\tdisplay: block;\\n\\tpadding-top: 56.25%;\\n}\\n\\n#videoplayer {\\n\\tposition: absolute;\\n\\ttop: 0;\\n\\tright: 0;\\n\\tbottom: 0;\\n\\tleft: 0;\\n}\\n\\n#box-close {\\n\\tposition: absolute;\\n\\ttop: 10px;\\n\\tright: 10px;\\n\\twidth: 30px;\\n\\theight: 30px;\\n\\topacity: .35;\\n\\tcursor: pointer;\\n}\\n\\n#box-close:hover {\\n\\topacity: .75;\\n}\\n\\n.vjs-sublime-skin.vjs-has-started.vjs-user-inactive.vjs-playing #box-close {\\n\\topacity: 0;\\n\\ttransition: opacity 1s cubic-bezier(.455,.03,.515,.955);\\n}\\n\\n\\n/* Video.js adjustments */\\n\\n.video-js .vjs-menu-button-inline.vjs-slider-active,.video-js .vjs-menu-button-inline:focus,.video-js .vjs-menu-button-inline:hover,.video-js.vjs-no-flex .vjs-menu-button-inline {\\n\\twidth: 10em\\n}\\n\\n.video-js .vjs-controls-disabled .vjs-big-play-button {\\n\\tdisplay: none!important\\n}\\n\\n.video-js .vjs-control {\\n\\twidth: 3em\\n}\\n\\n.video-js .vjs-menu-button-inline:before {\\n\\twidth: 1.5em\\n}\\n\\n.vjs-menu-button-inline .vjs-menu {\\n\\tleft: 3em\\n}\\n\\n.vjs-paused.vjs-has-started.video-js .vjs-big-play-button,.video-js.vjs-ended .vjs-big-play-button,.video-js.vjs-paused .vjs-big-play-button {\\n\\tdisplay: block\\n}\\n\\n.video-js .vjs-load-progress div,.vjs-seeking .vjs-big-play-button,.vjs-waiting .vjs-big-play-button {\\n\\tdisplay: none!important\\n}\\n\\n.video-js .vjs-mouse-display:after,.video-js .vjs-play-progress:after {\\n\\tpadding: 0 .4em .3em\\n}\\n\\n.video-js.vjs-ended .vjs-loading-spinner {\\n\\tdisplay: none;\\n}\\n\\n.video-js.vjs-ended .vjs-big-play-button {\\n\\tdisplay: block !important;\\n}\\n\\nvideo-js.vjs-ended .vjs-big-play-button,.video-js.vjs-paused .vjs-big-play-button,.vjs-paused.vjs-has-started.video-js .vjs-big-play-button {\\n\\tdisplay: block\\n}\\n\\n.video-js .vjs-big-play-button {\\n\\ttop: 50%;\\n\\tleft: 50%;\\n}\\n\\n.video-js.vjs-big-play-centered .vjs-big-play-button {\\n\\tbackground-color: rgba(0,0,0,0.35);\\n\\tfont-size: 3em;\\n\\tborder-radius: 50%;\\n\\theight: 2em !important;\\n\\tline-height: 2em !important;\\n\\tmargin-top: -1em !important;\\n\\tmargin-left: -1em !important;\\n}\\n\\n.video-js:hover .vjs-big-play-button,.video-js .vjs-big-play-button:focus,.video-js .vjs-big-play-button:active {\\n\\tbackground-color: rgba(0,0,0,0.35)\\n}\\n\\n.video-js .vjs-loading-spinner {\\n\\tborder-color: rgba(255,255,255,0.7)\\n}\\n\\n.video-js .vjs-control-bar2 {\\n\\tbackground-color: transparent\\n}\\n\\n.video-js .vjs-control-bar {\\n\\tbackground-color: rgba(0,0,0,0) !important;\\n\\tcolor: #ffffff;\\n\\tfont-size: 18px\\n}\\n\\n.video-js .vjs-play-progress,.video-js .vjs-volume-level {\\n\\tbackground-color: #2483d5\\n}\\n\\n.video-js .vjs-big-play-button {\\n\\theight: 2em !important;\\n\\twidth: 2em !important;\\n\\tline-height: 1.9em !important;\\n\\tmargin-top: -1em !important;\\n\\tmargin-left: -1em;\\n\\tborder-width: 3px\\n}\\n\\n.video-js .vjs-icon-play:before, .video-js .vjs-big-play-button:before {\\n\\tfont-size: 50px;\\n}\\n\\n.video-js .vjs-progress-holder {\\n\\tfont-size: 1.7em;\\n\\tborder-radius: 10px;\\n}\\n\\n.video-js .vjs-progress-holder .vjs-play-progress, .video-js .vjs-progress-holder .vjs-load-progress, .video-js .vjs-progress-holder .vjs-load-progress div, .video-js .vjs-slider,.vjs-volume-level {\\n\\tborder-radius: 10px;\\n}\\n\\n.video-js .vjs-load-progress {\\n\\tbackground: rgba(255,255,255,0.5);\\n}\\n\\n.video-js .vjs-big-play-button {\\n\\theight: 2em !important;\\n\\twidth: 2em !important;\\n\\tline-height: 1.9em !important;\\n\\tmargin-top: -1em !important;\\n\\tmargin-left: -1em;\\n\\tborder-width:3px\\n}\\n.video-js .vjs-icon-play:before, .video-js .vjs-big-play-button:before {\\n\\tfont-size: 50px;\\n}\\n.video-js .vjs-progress-holder {\\n\\tfont-size: 1.7em;\\n\\tborder-radius: 10px;\\n}\\n.video-js .vjs-progress-holder .vjs-play-progress, .video-js .vjs-progress-holder .vjs-load-progress, .video-js .vjs-progress-holder .vjs-load-progress div, .video-js .vjs-slider,.vjs-volume-level {\\n\\tborder-radius: 10px;\\n}\\n.video-js .vjs-load-progress {\\n\\tbackground: rgba(255,255,255,0.5);\\n}\\n\\n.video-js button:active {\\n\\tbackground: transparent !important;\\n\\tcolor: #fff !important;\\n}\\n\\n/* hide error icon */\\n.vjs-error .vjs-error-display::before {\\n\\tcontent: \\\"\\\" !important;\\n}\\n\\n/* fix for fluid size of the player */\\n#imgframe #videoplayer_view {\\n\\tdisplay: inline-block;\\n}\\n\\n/* public sharing view styles */\\n#imgframe .video-js .vjs-tech {\\n\\tposition: relative;\\n\\twidth: auto;\\n\\theight: auto;\\n}\\n\\n/* fullscreen public videos see https://github.com/nextcloud/files_videoplayer/issues/77 */\\n#imgframe .video-js.vjs-fullscreen .vjs-tech {\\n\\twidth:100%;\\n\\theight:100%;\\n}\\n\\n#imgframe .video-js:not(.vjs-fullscreen),\\n#imgframe .video-js:not(.vjs-fullscreen) .vjs-tech {\\n\\tmax-height: calc(100vh - 280px) !important;\\n\\tmin-width: 300px;\\n\\tmax-width: 100% !important;\\n}\\n\", \"\",{\"version\":3,\"sources\":[\"webpack://css/style.css\"],\"names\":[],\"mappings\":\"AAAA;CACC,aAAa;AACd;;AAEA;CACC,eAAe;CACf,QAAQ;CACR,WAAW;CACX,SAAS;CACT,UAAU;CACV,yBAAyB;CACzB,mCAAmC;CACnC,aAAa;CACb,UAAU;CACV,iCAAiC;AAClC;;AAEA;CACC,UAAU;AACX;;AAEA;CACC,eAAe;CACf,QAAQ;CACR,SAAS;CACT,UAAU;CACV,gBAAgB;CAChB,gCAAgC;AACjC;;AAEA;CACC,kBAAkB;CAClB,UAAU;CACV,gBAAgB;CAChB,cAAc;CACd,cAAc;CACd,gB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B;AACvB;;AAEA,oBAAoB;AACpB;CACC,sBAAsB;AACvB;;AAEA,qCAAqC;AACrC;CACC,qBAAqB;AACtB;;AAEA,+BAA+B;AAC/B;CACC,kBAAkB;CAClB,WAAW;CACX,YAAY;AACb;;AAEA,0FAA0F;AAC1F;CACC,UAAU;CACV,WAAW;AACZ;;AAEA;;CAEC,0CAA0C;CAC1C,gBAAgB;CAChB,0BAA0B;AAC3B\",\"sourcesContent\":[\"#videoplayer_overlay video {\\n\\toutline: none;\\n}\\n\\n#videoplayer_overlay {\\n\\tposition: fixed;\\n\\ttop: 0px;\\n\\tbottom: 0px;\\n\\tleft: 0px;\\n\\tright: 0px;\\n\\tbackground-color: #4c4c4c;\\n\\tbackground-color: rgba(0, 0, 0, .7);\\n\\tz-index: 3000;\\n\\topacity: 0;\\n\\ttransition: opacity 250ms ease-in;\\n}\\n\\n#videoplayer_overlay.show {\\n\\topacity: 1;\\n}\\n\\n#videoplayer_outer_container {\\n\\tposition: fixed;\\n\\ttop: 50%;\\n\\tleft: 50%;\\n\\twidth: 95%;\\n\\tmax-width: 854px;\\n\\ttransform: translate(-50%, -50%);\\n}\\n\\n#videoplayer_container {\\n\\tposition: relative;\\n\\twidth: 95%;\\n\\tmax-width: 854px;\\n\\tmargin: 0 auto;\\n\\tcolor: #4d4d4d;\\n\\tbackground: #fff;\\n\\tbox-shadow: 0 0 20px #222;\\n\\tz-index: 3001;\\n}\\n\\n#videoplayer_container:before {\\n\\tcontent: \\\"\\\";\\n\\tdisplay: block;\\n\\tpadding-top: 56.25%;\\n}\\n\\n#videoplayer {\\n\\tposition: absolute;\\n\\ttop: 0;\\n\\tright: 0;\\n\\tbottom: 0;\\n\\tleft: 0;\\n}\\n\\n#box-close {\\n\\tposition: absolute;\\n\\ttop: 10px;\\n\\tright: 10px;\\n\\twidth: 30px;\\n\\theight: 30px;\\n\\topacity: .35;\\n\\tcursor: pointer;\\n}\\n\\n#box-close:hover {\\n\\topacity: .75;\\n}\\n\\n.vjs-sublime-skin.vjs-has-started.vjs-user-inactive.vjs-playing #box-close {\\n\\topacity: 0;\\n\\ttransition: opacity 1s cubic-bezier(.455,.03,.515,.955);\\n}\\n\\n\\n/* Video.js adjustments */\\n\\n.video-js .vjs-menu-button-inline.vjs-slider-active,.video-js .vjs-menu-button-inline:focus,.video-js .vjs-menu-button-inline:hover,.video-js.vjs-no-flex .vjs-menu-button-inline {\\n\\twidth: 10em\\n}\\n\\n.video-js .vjs-controls-disabled .vjs-big-play-button {\\n\\tdisplay: none!important\\n}\\n\\n.video-js .vjs-control {\\n\\twidth: 3em\\n}\\n\\n.video-js .vjs-menu-button-inline:before {\\n\\twidth: 1.5em\\n}\\n\\n.vjs-menu-button-inline .vjs-menu {\\n\\tleft: 3em\\n}\\n\\n.vjs-paused.vjs-has-started.video-js .vjs-big-play-button,.video-js.vjs-ended .vjs-big-play-button,.video-js.vjs-paused .vjs-big-play-button {\\n\\tdisplay: block\\n}\\n\\n.video-js .vjs-load-progress div,.vjs-seeking .vjs-big-play-button,.vjs-waiting .vjs-big-play-button {\\n\\tdisplay: none!important\\n}\\n\\n.video-js .vjs-mouse-display:after,.video-js .vjs-play-progress:after {\\n\\tpadding: 0 .4em .3em\\n}\\n\\n.video-js.vjs-ended .vjs-loading-spinner {\\n\\tdisplay: none;\\n}\\n\\n.video-js.vjs-ended .vjs-big-play-button {\\n\\tdisplay: block !important;\\n}\\n\\nvideo-js.vjs-ended .vjs-big-play-button,.video-js.vjs-paused .vjs-big-play-button,.vjs-paused.vjs-has-started.video-js .vjs-big-play-button {\\n\\tdisplay: block\\n}\\n\\n.video-js .vjs-big-play-button {\\n\\ttop: 50%;\\n\\tleft: 50%;\\n}\\n\\n.video-js.vjs-big-play-centered .vjs-big-play-button {\\n\\tbackground-color: rgba(0,0,0,0.35);\\n\\tfont-size: 3em;\\n\\tborder-radius: 50%;\\n\\theight: 2em !important;\\n\\tline-height: 2em !important;\\n\\tmargin-top: -1em !important;\\n\\tmargin-left: -1em !important;\\n}\\n\\n.video-js:hover .vjs-big-play-button,.video-js .vjs-big-play-button:focus,.video-js .vjs-big-play-button:active {\\n\\tbackground-color: rgba(0,0,0,0.35)\\n}\\n\\n.video-js .vjs-loading-spinner {\\n\\tborder-color: rgba(255,255,255,0.7)\\n}\\n\\n.video-js .vjs-control-bar2 {\\n\\tbackground-color: transparent\\n}\\n\\n.video-js .vjs-control-bar {\\n\\tbackground-color: rgba(0,0,0,0) !important;\\n\\tcolor: #ffffff;\\n\\tfont-size: 18px\\n}\\n\\n.video-js .vjs-play-progress,.video-js .vjs-volume-level {\\n\\tbackground-color: #2483d5\\n}\\n\\n.video-js .vjs-big-play-button {\\n\\theight: 2em !important;\\n\\twidth: 2em !important;\\n\\tline-height: 1.9em !important;\\n\\tmargin-top: -1em !important;\\n\\tmargin-left: -1em;\\n\\tborder-width: 3px\\n}\\n\\n.video-js .vjs-icon-play:before, .video-js .vjs-big-play-button:before {\\n\\tfont-size: 50px;\\n}\\n\\n.video-js .vjs-progress-holder {\\n\\tfont-size: 1.7em;\\n\\tborder-radius: 10px;\\n}\\n\\n.video-js .vjs-progress-holder .vjs-play-progress, .video-js .vjs-progress-holder .vjs-load-progress, .video-js .vjs-progress-holder .vjs-load-progress div, .video-js .vjs-slider,.vjs-volume-level {\\n\\tborder-radius: 10px;\\n}\\n\\n.video-js .vjs-load-progress {\\n\\tbackground: rgba(255,255,255,0.5);\\n}\\n\\n.video-js .vjs-big-play-button {\\n\\theight: 2em !important;\\n\\twidth: 2em !important;\\n\\tline-height: 1.9em !important;\\n\\tmargin-top: -1em !important;\\n\\tmargin-left: -1em;\\n\\tborder-width:3px\\n}\\n.video-js .vjs-icon-play:before, .video-js .vjs-big-play-button:before {\\n\\tfont-size: 50px;\\n}\\n.video-js .vjs-progress-holder {\\n\\tfont-size: 1.7em;\\n\\tborder-radius: 10px;\\n}\\n.video-js .vjs-progress-holder .vjs-play-progress, .video-js .vjs-progress-holder .vjs-load-progress, .video-js .vjs-progress-holder .vjs-load-progress div, .video-js .vjs-slider,.vjs-volume-level {\\n\\tborder-radius: 10px;\\n}\\n.video-js .vjs-load-progress {\\n\\tbackground: rgba(255,255,255,0.5);\\n}\\n\\n.video-js button:active {\\n\\tbackground: transparent !important;\\n\\tcolor: #fff !important;\\n}\\n\\n/* hide error icon */\\n.vjs-error .vjs-error-display::before {\\n\\tcontent: \\\"\\\" !important;\\n}\\n\\n/* fix for fluid size of the player */\\n#imgframe #videoplayer_view {\\n\\tdisplay: inline-block;\\n}\\n\\n/* public sharing view styles */\\n#imgframe .video-js .vjs-tech {\\n\\tposition: relative;\\n\\twidth: auto;\\n\\theight: auto;\\n}\\n\\n/* fullscreen public videos see https://github.com/nextcloud/files_videoplayer/issues/77 */\\n#imgframe .video-js.vjs-fullscreen .vjs-tech {\\n\\twidth:100%;\\n\\theight:100%;\\n}\\n\\n#imgframe .video-js:not(.vjs-fullscreen),\\n#imgframe .video-js:not(.vjs-fullscreen) .vjs-tech {\\n\\tmax-height: calc(100vh - 280px) !important;\\n\\tmin-width: 300px;\\n\\tmax-width: 100% !important;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\n// eslint-disable-next-line func-names\nmodule.exports = function (useSourceMap) {\n var list = []; // return the list of modules as css string\n\n list.toString = function toString() {\n return this.map(function (item) {\n var content = cssWithMappingToString(item, useSourceMap);\n\n if (item[2]) {\n return \"@media \".concat(item[2], \" {\").concat(content, \"}\");\n }\n\n return content;\n }).join('');\n }; // import a list of modules into the list\n // eslint-disable-next-line func-names\n\n\n list.i = function (modules, mediaQuery, dedupe) {\n if (typeof modules === 'string') {\n // eslint-disable-next-line no-param-reassign\n modules = [[null, modules, '']];\n }\n\n var alreadyImportedModules = {};\n\n if (dedupe) {\n for (var i = 0; i < this.length; i++) {\n // eslint-disable-next-line prefer-destructuring\n var id = this[i][0];\n\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n\n for (var _i = 0; _i < modules.length; _i++) {\n var item = [].concat(modules[_i]);\n\n if (dedupe && alreadyImportedModules[item[0]]) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n if (mediaQuery) {\n if (!item[2]) {\n item[2] = mediaQuery;\n } else {\n item[2] = \"\".concat(mediaQuery, \" and \").concat(item[2]);\n }\n }\n\n list.push(item);\n }\n };\n\n return list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n var content = item[1] || ''; // eslint-disable-next-line prefer-destructuring\n\n var cssMapping = item[3];\n\n if (!cssMapping) {\n return content;\n }\n\n if (useSourceMap && typeof btoa === 'function') {\n var sourceMapping = toComment(cssMapping);\n var sourceURLs = cssMapping.sources.map(function (source) {\n return \"/*# sourceURL=\".concat(cssMapping.sourceRoot || '').concat(source, \" */\");\n });\n return [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n }\n\n return [content].join('\\n');\n} // Adapted from convert-source-map (MIT)\n\n\nfunction toComment(sourceMap) {\n // eslint-disable-next-line no-undef\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n return \"/*# \".concat(data, \" */\");\n}","import api from \"!../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../node_modules/css-loader/dist/cjs.js!./style.css\";\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","\"use strict\";\n\nvar isOldIE = function isOldIE() {\n var memo;\n return function memorize() {\n if (typeof memo === 'undefined') {\n // Test for IE <= 9 as proposed by Browserhacks\n // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n // Tests for existence of standard globals is to allow style-loader\n // to operate correctly into non-standard environments\n // @see https://github.com/webpack-contrib/style-loader/issues/177\n memo = Boolean(window && document && document.all && !window.atob);\n }\n\n return memo;\n };\n}();\n\nvar getTarget = function getTarget() {\n var memo = {};\n return function memorize(target) {\n if (typeof memo[target] === 'undefined') {\n var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself\n\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n\n memo[target] = styleTarget;\n }\n\n return memo[target];\n };\n}();\n\nvar stylesInDom = [];\n\nfunction getIndexByIdentifier(identifier) {\n var result = -1;\n\n for (var i = 0; i < stylesInDom.length; i++) {\n if (stylesInDom[i].identifier === identifier) {\n result = i;\n break;\n }\n }\n\n return result;\n}\n\nfunction modulesToDom(list, options) {\n var idCountMap = {};\n var identifiers = [];\n\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var count = idCountMap[id] || 0;\n var identifier = \"\".concat(id, \" \").concat(count);\n idCountMap[id] = count + 1;\n var index = getIndexByIdentifier(identifier);\n var obj = {\n css: item[1],\n media: item[2],\n sourceMap: item[3]\n };\n\n if (index !== -1) {\n stylesInDom[index].references++;\n stylesInDom[index].updater(obj);\n } else {\n stylesInDom.push({\n identifier: identifier,\n updater: addStyle(obj, options),\n references: 1\n });\n }\n\n identifiers.push(identifier);\n }\n\n return identifiers;\n}\n\nfunction insertStyleElement(options) {\n var style = document.createElement('style');\n var attributes = options.attributes || {};\n\n if (typeof attributes.nonce === 'undefined') {\n var nonce = typeof __webpack_nonce__ !== 'undefined' ? __webpack_nonce__ : null;\n\n if (nonce) {\n attributes.nonce = nonce;\n }\n }\n\n Object.keys(attributes).forEach(function (key) {\n style.setAttribute(key, attributes[key]);\n });\n\n if (typeof options.insert === 'function') {\n options.insert(style);\n } else {\n var target = getTarget(options.insert || 'head');\n\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n\n target.appendChild(style);\n }\n\n return style;\n}\n\nfunction removeStyleElement(style) {\n // istanbul ignore if\n if (style.parentNode === null) {\n return false;\n }\n\n style.parentNode.removeChild(style);\n}\n/* istanbul ignore next */\n\n\nvar replaceText = function replaceText() {\n var textStore = [];\n return function replace(index, replacement) {\n textStore[index] = replacement;\n return textStore.filter(Boolean).join('\\n');\n };\n}();\n\nfunction applyToSingletonTag(style, index, remove, obj) {\n var css = remove ? '' : obj.media ? \"@media \".concat(obj.media, \" {\").concat(obj.css, \"}\") : obj.css; // For old IE\n\n /* istanbul ignore if */\n\n if (style.styleSheet) {\n style.styleSheet.cssText = replaceText(index, css);\n } else {\n var cssNode = document.createTextNode(css);\n var childNodes = style.childNodes;\n\n if (childNodes[index]) {\n style.removeChild(childNodes[index]);\n }\n\n if (childNodes.length) {\n style.insertBefore(cssNode, childNodes[index]);\n } else {\n style.appendChild(cssNode);\n }\n }\n}\n\nfunction applyToTag(style, options, obj) {\n var css = obj.css;\n var media = obj.media;\n var sourceMap = obj.sourceMap;\n\n if (media) {\n style.setAttribute('media', media);\n } else {\n style.removeAttribute('media');\n }\n\n if (sourceMap && typeof btoa !== 'undefined') {\n css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n } // For old IE\n\n /* istanbul ignore if */\n\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n while (style.firstChild) {\n style.removeChild(style.firstChild);\n }\n\n style.appendChild(document.createTextNode(css));\n }\n}\n\nvar singleton = null;\nvar singletonCounter = 0;\n\nfunction addStyle(obj, options) {\n var style;\n var update;\n var remove;\n\n if (options.singleton) {\n var styleIndex = singletonCounter++;\n style = singleton || (singleton = insertStyleElement(options));\n update = applyToSingletonTag.bind(null, style, styleIndex, false);\n remove = applyToSingletonTag.bind(null, style, styleIndex, true);\n } else {\n style = insertStyleElement(options);\n update = applyToTag.bind(null, style, options);\n\n remove = function remove() {\n removeStyleElement(style);\n };\n }\n\n update(obj);\n return function updateStyle(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {\n return;\n }\n\n update(obj = newObj);\n } else {\n remove();\n }\n };\n}\n\nmodule.exports = function (list, options) {\n options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>\n // tags it will allow on a page\n\n if (!options.singleton && typeof options.singleton !== 'boolean') {\n options.singleton = isOldIE();\n }\n\n list = list || [];\n var lastIdentifiers = modulesToDom(list, options);\n return function update(newList) {\n newList = newList || [];\n\n if (Object.prototype.toString.call(newList) !== '[object Array]') {\n return;\n }\n\n for (var i = 0; i < lastIdentifiers.length; i++) {\n var identifier = lastIdentifiers[i];\n var index = getIndexByIdentifier(identifier);\n stylesInDom[index].references--;\n }\n\n var newLastIdentifiers = modulesToDom(newList, options);\n\n for (var _i = 0; _i < lastIdentifiers.length; _i++) {\n var _identifier = lastIdentifiers[_i];\n\n var _index = getIndexByIdentifier(_identifier);\n\n if (stylesInDom[_index].references === 0) {\n stylesInDom[_index].updater();\n\n stylesInDom.splice(_index, 1);\n }\n }\n\n lastIdentifiers = newLastIdentifiers;\n };\n};"],"names":["___CSS_LOADER_EXPORT___","push","module","id","exports","useSourceMap","list","toString","this","map","item","content","cssMapping","btoa","sourceMapping","sourceMap","base64","unescape","encodeURIComponent","JSON","stringify","data","concat","sourceURLs","sources","source","sourceRoot","join","cssWithMappingToString","i","modules","mediaQuery","dedupe","alreadyImportedModules","length","_i","options","memo","isOldIE","Boolean","window","document","all","atob","getTarget","target","styleTarget","querySelector","HTMLIFrameElement","contentDocument","head","e","stylesInDom","getIndexByIdentifier","identifier","result","modulesToDom","idCountMap","identifiers","base","count","index","obj","css","media","references","updater","addStyle","insertStyleElement","style","createElement","attributes","nonce","Object","keys","forEach","key","setAttribute","insert","Error","appendChild","textStore","replaceText","replacement","filter","applyToSingletonTag","remove","styleSheet","cssText","cssNode","createTextNode","childNodes","removeChild","insertBefore","applyToTag","removeAttribute","firstChild","singleton","singletonCounter","update","styleIndex","bind","parentNode","removeStyleElement","newObj","lastIdentifiers","newList","prototype","call","newLastIdentifiers","_index","splice"],"sourceRoot":""} \ No newline at end of file
diff --git a/js/files_videoplayer-main.js b/js/files_videoplayer-main.js
index 0ebea1b..940a12c 100644
--- a/js/files_videoplayer-main.js
+++ b/js/files_videoplayer-main.js
@@ -1,3 +1,3 @@
/*! For license information please see files_videoplayer-main.js.LICENSE.txt */
-(()=>{var t,e,r={6453:(t,e,r)=>{"use strict";e.j=function(t,e,r){var n=document.querySelector("#initial-state-".concat(t,"-").concat(e));if(null===n){if(void 0!==r)return r;throw new Error("Could not find initial state ".concat(e," of ").concat(t))}try{return JSON.parse(atob(n.value))}catch(r){throw new Error("Could not parse initial state ".concat(e," of ").concat(t))}},r(2222)},9282:(t,e,r)=>{"use strict";var n=r(4155),o=r(5108);function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var a,c,u=r(2136).codes,l=u.ERR_AMBIGUOUS_ARGUMENT,f=u.ERR_INVALID_ARG_TYPE,s=u.ERR_INVALID_ARG_VALUE,p=u.ERR_INVALID_RETURN_VALUE,y=u.ERR_MISSING_ARGS,d=r(5961),g=r(9539).inspect,v=r(9539).types,b=v.isPromise,h=v.isRegExp,m=Object.assign?Object.assign:r(8091).assign,w=Object.is?Object.is:r(609);new Map;function O(){var t=r(9158);a=t.isDeepEqual,c=t.isDeepStrictEqual}var j=!1,S=t.exports=P,E={};function A(t){if(t.message instanceof Error)throw t.message;throw new d(t)}function x(t,e,r,n){if(!r){var o=!1;if(0===e)o=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var i=new d({actual:r,expected:!0,message:n,operator:"==",stackStartFn:t});throw i.generatedMessage=o,i}}function P(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];x.apply(void 0,[P,e.length].concat(e))}S.fail=function t(e,r,i,a,c){var u,l=arguments.length;if(0===l)u="Failed";else if(1===l)i=e,e=void 0;else{if(!1===j){j=!0;var f=n.emitWarning?n.emitWarning:o.warn.bind(o);f("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}2===l&&(a="!=")}if(i instanceof Error)throw i;var s={actual:e,expected:r,operator:void 0===a?"fail":a,stackStartFn:c||t};void 0!==i&&(s.message=i);var p=new d(s);throw u&&(p.message=u,p.generatedMessage=!0),p},S.AssertionError=d,S.ok=P,S.equal=function t(e,r,n){if(arguments.length<2)throw new y("actual","expected");e!=r&&A({actual:e,expected:r,message:n,operator:"==",stackStartFn:t})},S.notEqual=function t(e,r,n){if(arguments.length<2)throw new y("actual","expected");e==r&&A({actual:e,expected:r,message:n,operator:"!=",stackStartFn:t})},S.deepEqual=function t(e,r,n){if(arguments.length<2)throw new y("actual","expected");void 0===a&&O(),a(e,r)||A({actual:e,expected:r,message:n,operator:"deepEqual",stackStartFn:t})},S.notDeepEqual=function t(e,r,n){if(arguments.length<2)throw new y("actual","expected");void 0===a&&O(),a(e,r)&&A({actual:e,expected:r,message:n,operator:"notDeepEqual",stackStartFn:t})},S.deepStrictEqual=function t(e,r,n){if(arguments.length<2)throw new y("actual","expected");void 0===a&&O(),c(e,r)||A({actual:e,expected:r,message:n,operator:"deepStrictEqual",stackStartFn:t})},S.notDeepStrictEqual=function t(e,r,n){if(arguments.length<2)throw new y("actual","expected");void 0===a&&O();c(e,r)&&A({actual:e,expected:r,message:n,operator:"notDeepStrictEqual",stackStartFn:t})},S.strictEqual=function t(e,r,n){if(arguments.length<2)throw new y("actual","expected");w(e,r)||A({actual:e,expected:r,message:n,operator:"strictEqual",stackStartFn:t})},S.notStrictEqual=function t(e,r,n){if(arguments.length<2)throw new y("actual","expected");w(e,r)&&A({actual:e,expected:r,message:n,operator:"notStrictEqual",stackStartFn:t})};var k=function t(e,r,n){var o=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r.forEach((function(t){t in e&&(void 0!==n&&"string"==typeof n[t]&&h(e[t])&&e[t].test(n[t])?o[t]=n[t]:o[t]=e[t])}))};function _(t,e,r,n,o,i){if(!(r in t)||!c(t[r],e[r])){if(!n){var a=new k(t,o),u=new k(e,o,t),l=new d({actual:a,expected:u,operator:"deepStrictEqual",stackStartFn:i});throw l.actual=t,l.expected=e,l.operator=i.name,l}A({actual:t,expected:e,message:n,operator:i.name,stackStartFn:i})}}function T(t,e,r,n){if("function"!=typeof e){if(h(e))return e.test(t);if(2===arguments.length)throw new f("expected",["Function","RegExp"],e);if("object"!==i(t)||null===t){var o=new d({actual:t,expected:e,message:r,operator:"deepStrictEqual",stackStartFn:n});throw o.operator=n.name,o}var c=Object.keys(e);if(e instanceof Error)c.push("name","message");else if(0===c.length)throw new s("error",e,"may not be an empty object");return void 0===a&&O(),c.forEach((function(o){"string"==typeof t[o]&&h(e[o])&&e[o].test(t[o])||_(t,e,o,r,c,n)})),!0}return void 0!==e.prototype&&t instanceof e||!Error.isPrototypeOf(e)&&!0===e.call({},t)}function I(t){if("function"!=typeof t)throw new f("fn","Function",t);try{t()}catch(t){return t}return E}function F(t){return b(t)||null!==t&&"object"===i(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function R(t){return Promise.resolve().then((function(){var e;if("function"==typeof t){if(!F(e=t()))throw new p("instance of Promise","promiseFn",e)}else{if(!F(t))throw new f("promiseFn",["Function","Promise"],t);e=t}return Promise.resolve().then((function(){return e})).then((function(){return E})).catch((function(t){return t}))}))}function N(t,e,r,n){if("string"==typeof r){if(4===arguments.length)throw new f("error",["Object","Error","Function","RegExp"],r);if("object"===i(e)&&null!==e){if(e.message===r)throw new l("error/message",'The error message "'.concat(e.message,'" is identical to the message.'))}else if(e===r)throw new l("error/message",'The error "'.concat(e,'" is identical to the message.'));n=r,r=void 0}else if(null!=r&&"object"!==i(r)&&"function"!=typeof r)throw new f("error",["Object","Error","Function","RegExp"],r);if(e===E){var o="";r&&r.name&&(o+=" (".concat(r.name,")")),o+=n?": ".concat(n):".";var a="rejects"===t.name?"rejection":"exception";A({actual:void 0,expected:r,operator:t.name,message:"Missing expected ".concat(a).concat(o),stackStartFn:t})}if(r&&!T(e,r,n,t))throw e}function D(t,e,r,n){if(e!==E){if("string"==typeof r&&(n=r,r=void 0),!r||T(e,r)){var o=n?": ".concat(n):".",i="doesNotReject"===t.name?"rejection":"exception";A({actual:e,expected:r,operator:t.name,message:"Got unwanted ".concat(i).concat(o,"\n")+'Actual message: "'.concat(e&&e.message,'"'),stackStartFn:t})}throw e}}function U(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];x.apply(void 0,[U,e.length].concat(e))}S.throws=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];N.apply(void 0,[t,I(e)].concat(n))},S.rejects=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return R(e).then((function(e){return N.apply(void 0,[t,e].concat(n))}))},S.doesNotThrow=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];D.apply(void 0,[t,I(e)].concat(n))},S.doesNotReject=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return R(e).then((function(e){return D.apply(void 0,[t,e].concat(n))}))},S.ifError=function t(e){if(null!=e){var r="ifError got unwanted exception: ";"object"===i(e)&&"string"==typeof e.message?0===e.message.length&&e.constructor?r+=e.constructor.name:r+=e.message:r+=g(e);var n=new d({actual:e,expected:null,operator:"ifError",message:r,stackStartFn:t}),o=e.stack;if("string"==typeof o){var a=o.split("\n");a.shift();for(var c=n.stack.split("\n"),u=0;u<a.length;u++){var l=c.indexOf(a[u]);if(-1!==l){c=c.slice(0,l);break}}n.stack="".concat(c.join("\n"),"\n").concat(a.join("\n"))}throw n}},S.strict=m(U,S,{equal:S.strictEqual,deepEqual:S.deepStrictEqual,notEqual:S.notStrictEqual,notDeepEqual:S.notDeepStrictEqual}),S.strict.strict=S.strict},5961:(t,e,r)=>{"use strict";var n=r(4155);function o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function a(t,e){return!e||"object"!==y(e)&&"function"!=typeof e?c(t):e}function c(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function u(t){var e="function"==typeof Map?new Map:void 0;return(u=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return f(t,arguments,p(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),s(n,t)})(t)}function l(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function f(t,e,r){return(f=l()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&s(o,r.prototype),o}).apply(null,arguments)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function p(t){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function y(t){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var d=r(9539).inspect,g=r(2136).codes.ERR_INVALID_ARG_TYPE;function v(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}var b="",h="",m="",w="",O={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function j(t){var e=Object.keys(t),r=Object.create(Object.getPrototypeOf(t));return e.forEach((function(e){r[e]=t[e]})),Object.defineProperty(r,"message",{value:t.message}),r}function S(t){return d(t,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function E(t,e,r){var o="",i="",a=0,c="",u=!1,l=S(t),f=l.split("\n"),s=S(e).split("\n"),p=0,d="";if("strictEqual"===r&&"object"===y(t)&&"object"===y(e)&&null!==t&&null!==e&&(r="strictEqualObject"),1===f.length&&1===s.length&&f[0]!==s[0]){var g=f[0].length+s[0].length;if(g<=10){if(!("object"===y(t)&&null!==t||"object"===y(e)&&null!==e||0===t&&0===e))return"".concat(O[r],"\n\n")+"".concat(f[0]," !== ").concat(s[0],"\n")}else if("strictEqualObject"!==r){if(g<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;f[0][p]===s[0][p];)p++;p>2&&(d="\n ".concat(function(t,e){if(e=Math.floor(e),0==t.length||0==e)return"";var r=t.length*e;for(e=Math.floor(Math.log(e)/Math.log(2));e;)t+=t,e--;return t+t.substring(0,r-t.length)}(" ",p),"^"),p=0)}}}for(var j=f[f.length-1],E=s[s.length-1];j===E&&(p++<2?c="\n ".concat(j).concat(c):o=j,f.pop(),s.pop(),0!==f.length&&0!==s.length);)j=f[f.length-1],E=s[s.length-1];var A=Math.max(f.length,s.length);if(0===A){var x=l.split("\n");if(x.length>30)for(x[26]="".concat(b,"...").concat(w);x.length>27;)x.pop();return"".concat(O.notIdentical,"\n\n").concat(x.join("\n"),"\n")}p>3&&(c="\n".concat(b,"...").concat(w).concat(c),u=!0),""!==o&&(c="\n ".concat(o).concat(c),o="");var P=0,k=O[r]+"\n".concat(h,"+ actual").concat(w," ").concat(m,"- expected").concat(w),_=" ".concat(b,"...").concat(w," Lines skipped");for(p=0;p<A;p++){var T=p-a;if(f.length<p+1)T>1&&p>2&&(T>4?(i+="\n".concat(b,"...").concat(w),u=!0):T>3&&(i+="\n ".concat(s[p-2]),P++),i+="\n ".concat(s[p-1]),P++),a=p,o+="\n".concat(m,"-").concat(w," ").concat(s[p]),P++;else if(s.length<p+1)T>1&&p>2&&(T>4?(i+="\n".concat(b,"...").concat(w),u=!0):T>3&&(i+="\n ".concat(f[p-2]),P++),i+="\n ".concat(f[p-1]),P++),a=p,i+="\n".concat(h,"+").concat(w," ").concat(f[p]),P++;else{var I=s[p],F=f[p],R=F!==I&&(!v(F,",")||F.slice(0,-1)!==I);R&&v(I,",")&&I.slice(0,-1)===F&&(R=!1,F+=","),R?(T>1&&p>2&&(T>4?(i+="\n".concat(b,"...").concat(w),u=!0):T>3&&(i+="\n ".concat(f[p-2]),P++),i+="\n ".concat(f[p-1]),P++),a=p,i+="\n".concat(h,"+").concat(w," ").concat(F),o+="\n".concat(m,"-").concat(w," ").concat(I),P+=2):(i+=o,o="",1!==T&&0!==p||(i+="\n ".concat(F),P++))}if(P>20&&p<A-2)return"".concat(k).concat(_,"\n").concat(i,"\n").concat(b,"...").concat(w).concat(o,"\n")+"".concat(b,"...").concat(w)}return"".concat(k).concat(u?_:"","\n").concat(i).concat(o).concat(c).concat(d)}var A=function(t){function e(t){var r;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),"object"!==y(t)||null===t)throw new g("options","Object",t);var o=t.message,i=t.operator,u=t.stackStartFn,l=t.actual,f=t.expected,s=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=o)r=a(this,p(e).call(this,String(o)));else if(n.stderr&&n.stderr.isTTY&&(n.stderr&&n.stderr.getColorDepth&&1!==n.stderr.getColorDepth()?(b="",h="",w="",m=""):(b="",h="",w="",m="")),"object"===y(l)&&null!==l&&"object"===y(f)&&null!==f&&"stack"in l&&l instanceof Error&&"stack"in f&&f instanceof Error&&(l=j(l),f=j(f)),"deepStrictEqual"===i||"strictEqual"===i)r=a(this,p(e).call(this,E(l,f,i)));else if("notDeepStrictEqual"===i||"notStrictEqual"===i){var d=O[i],v=S(l).split("\n");if("notStrictEqual"===i&&"object"===y(l)&&null!==l&&(d=O.notStrictEqualObject),v.length>30)for(v[26]="".concat(b,"...").concat(w);v.length>27;)v.pop();r=1===v.length?a(this,p(e).call(this,"".concat(d," ").concat(v[0]))):a(this,p(e).call(this,"".concat(d,"\n\n").concat(v.join("\n"),"\n")))}else{var A=S(l),x="",P=O[i];"notDeepEqual"===i||"notEqual"===i?(A="".concat(O[i],"\n\n").concat(A)).length>1024&&(A="".concat(A.slice(0,1021),"...")):(x="".concat(S(f)),A.length>512&&(A="".concat(A.slice(0,509),"...")),x.length>512&&(x="".concat(x.slice(0,509),"...")),"deepEqual"===i||"equal"===i?A="".concat(P,"\n\n").concat(A,"\n\nshould equal\n\n"):x=" ".concat(i," ").concat(x)),r=a(this,p(e).call(this,"".concat(A).concat(x)))}return Error.stackTraceLimit=s,r.generatedMessage=!o,Object.defineProperty(c(r),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),r.code="ERR_ASSERTION",r.actual=l,r.expected=f,r.operator=i,Error.captureStackTrace&&Error.captureStackTrace(c(r),u),r.stack,r.name="AssertionError",a(r)}var r,u,l;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}(e,t),r=e,(u=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:d.custom,value:function(t,e){return d(this,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){o(t,e,r[e])}))}return t}({},e,{customInspect:!1,depth:0}))}}])&&i(r.prototype,u),l&&i(r,l),e}(u(Error));t.exports=A},2136:(t,e,r)=>{"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){return!e||"object"!==n(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function i(t){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function a(t,e){return(a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var c,u,l={};function f(t,e,r){r||(r=Error);var n=function(r){function n(r,a,c){var u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),(u=o(this,i(n).call(this,function(t,r,n){return"string"==typeof e?e:e(t,r,n)}(r,a,c)))).code=t,u}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&a(t,e)}(n,r),n}(r);l[t]=n}function s(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}f("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),f("ERR_INVALID_ARG_TYPE",(function(t,e,o){var i,a,u,l;if(void 0===c&&(c=r(9282)),c("string"==typeof t,"'name' must be a string"),"string"==typeof e&&(a="not ",e.substr(!u||u<0?0:+u,a.length)===a)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))l="The ".concat(t," ").concat(i," ").concat(s(e,"type"));else{var f=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";l='The "'.concat(t,'" ').concat(f," ").concat(i," ").concat(s(e,"type"))}return l+=". Received type ".concat(n(o))}),TypeError),f("ERR_INVALID_ARG_VALUE",(function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===u&&(u=r(9539));var o=u.inspect(e);return o.length>128&&(o="".concat(o.slice(0,128),"...")),"The argument '".concat(t,"' ").concat(n,". Received ").concat(o)}),TypeError,RangeError),f("ERR_INVALID_RETURN_VALUE",(function(t,e,r){var o;return o=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(t,' to be returned from the "').concat(e,'"')+" function but got ".concat(o,".")}),TypeError),f("ERR_MISSING_ARGS",(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];void 0===c&&(c=r(9282)),c(e.length>0,"At least one arg needs to be specified");var o="The ",i=e.length;switch(e=e.map((function(t){return'"'.concat(t,'"')})),i){case 1:o+="".concat(e[0]," argument");break;case 2:o+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:o+=e.slice(0,i-1).join(", "),o+=", and ".concat(e[i-1]," arguments")}return"".concat(o," must be specified")}),TypeError),t.exports.codes=l},9158:(t,e,r)=>{"use strict";function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(n=(a=c.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==c.return||c.return()}finally{if(o)throw i}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=void 0!==/a/g.flags,a=function(t){var e=[];return t.forEach((function(t){return e.push(t)})),e},c=function(t){var e=[];return t.forEach((function(t,r){return e.push([r,t])})),e},u=Object.is?Object.is:r(609),l=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},f=Number.isNaN?Number.isNaN:r(360);function s(t){return t.call.bind(t)}var p=s(Object.prototype.hasOwnProperty),y=s(Object.prototype.propertyIsEnumerable),d=s(Object.prototype.toString),g=r(9539).types,v=g.isAnyArrayBuffer,b=g.isArrayBufferView,h=g.isDate,m=g.isMap,w=g.isRegExp,O=g.isSet,j=g.isNativeError,S=g.isBoxedPrimitive,E=g.isNumberObject,A=g.isStringObject,x=g.isBooleanObject,P=g.isBigIntObject,k=g.isSymbolObject,_=g.isFloat32Array,T=g.isFloat64Array;function I(t){if(0===t.length||t.length>10)return!0;for(var e=0;e<t.length;e++){var r=t.charCodeAt(e);if(r<48||r>57)return!0}return 10===t.length&&t>=Math.pow(2,32)}function F(t){return Object.keys(t).filter(I).concat(l(t).filter(Object.prototype.propertyIsEnumerable.bind(t)))}function R(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0}function N(t,e,r,n){if(t===e)return 0!==t||(!r||u(t,e));if(r){if("object"!==o(t))return"number"==typeof t&&f(t)&&f(e);if("object"!==o(e)||null===t||null===e)return!1;if(Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1}else{if(null===t||"object"!==o(t))return(null===e||"object"!==o(e))&&t==e;if(null===e||"object"!==o(e))return!1}var a,c,l,s,p=d(t);if(p!==d(e))return!1;if(Array.isArray(t)){if(t.length!==e.length)return!1;var y=F(t),g=F(e);return y.length===g.length&&U(t,e,r,n,1,y)}if("[object Object]"===p&&(!m(t)&&m(e)||!O(t)&&O(e)))return!1;if(h(t)){if(!h(e)||Date.prototype.getTime.call(t)!==Date.prototype.getTime.call(e))return!1}else if(w(t)){if(!w(e)||(l=t,s=e,!(i?l.source===s.source&&l.flags===s.flags:RegExp.prototype.toString.call(l)===RegExp.prototype.toString.call(s))))return!1}else if(j(t)||t instanceof Error){if(t.message!==e.message||t.name!==e.name)return!1}else{if(b(t)){if(r||!_(t)&&!T(t)){if(!function(t,e){return t.byteLength===e.byteLength&&0===R(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}(t,e))return!1}else if(!function(t,e){if(t.byteLength!==e.byteLength)return!1;for(var r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0}(t,e))return!1;var I=F(t),N=F(e);return I.length===N.length&&U(t,e,r,n,0,I)}if(O(t))return!(!O(e)||t.size!==e.size)&&U(t,e,r,n,2);if(m(t))return!(!m(e)||t.size!==e.size)&&U(t,e,r,n,3);if(v(t)){if(c=e,(a=t).byteLength!==c.byteLength||0!==R(new Uint8Array(a),new Uint8Array(c)))return!1}else if(S(t)&&!function(t,e){return E(t)?E(e)&&u(Number.prototype.valueOf.call(t),Number.prototype.valueOf.call(e)):A(t)?A(e)&&String.prototype.valueOf.call(t)===String.prototype.valueOf.call(e):x(t)?x(e)&&Boolean.prototype.valueOf.call(t)===Boolean.prototype.valueOf.call(e):P(t)?P(e)&&BigInt.prototype.valueOf.call(t)===BigInt.prototype.valueOf.call(e):k(e)&&Symbol.prototype.valueOf.call(t)===Symbol.prototype.valueOf.call(e)}(t,e))return!1}return U(t,e,r,n,0)}function D(t,e){return e.filter((function(e){return y(t,e)}))}function U(t,e,r,n,o,i){if(5===arguments.length){i=Object.keys(t);var a=Object.keys(e);if(i.length!==a.length)return!1}for(var c=0;c<i.length;c++)if(!p(e,i[c]))return!1;if(r&&5===arguments.length){var u=l(t);if(0!==u.length){var f=0;for(c=0;c<u.length;c++){var s=u[c];if(y(t,s)){if(!y(e,s))return!1;i.push(s),f++}else if(y(e,s))return!1}var d=l(e);if(u.length!==d.length&&D(e,d).length!==f)return!1}else{var g=l(e);if(0!==g.length&&0!==D(e,g).length)return!1}}if(0===i.length&&(0===o||1===o&&0===t.length||0===t.size))return!0;if(void 0===n)n={val1:new Map,val2:new Map,position:0};else{var v=n.val1.get(t);if(void 0!==v){var b=n.val2.get(e);if(void 0!==b)return v===b}n.position++}n.val1.set(t,n.position),n.val2.set(e,n.position);var h=G(t,e,r,i,n,o);return n.val1.delete(t),n.val2.delete(e),h}function M(t,e,r,n){for(var o=a(t),i=0;i<o.length;i++){var c=o[i];if(N(e,c,r,n))return t.delete(c),!0}return!1}function B(t){switch(o(t)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":t=+t;case"number":if(f(t))return!1}return!0}function q(t,e,r){var n=B(r);return null!=n?n:e.has(n)&&!t.has(n)}function C(t,e,r,n,o){var i=B(r);if(null!=i)return i;var a=e.get(i);return!(void 0===a&&!e.has(i)||!N(n,a,!1,o))&&(!t.has(i)&&N(n,a,!1,o))}function L(t,e,r,n,o,i){for(var c=a(t),u=0;u<c.length;u++){var l=c[u];if(N(r,l,o,i)&&N(n,e.get(l),o,i))return t.delete(l),!0}return!1}function G(t,e,r,i,u,l){var f=0;if(2===l){if(!function(t,e,r,n){for(var i=null,c=a(t),u=0;u<c.length;u++){var l=c[u];if("object"===o(l)&&null!==l)null===i&&(i=new Set),i.add(l);else if(!e.has(l)){if(r)return!1;if(!q(t,e,l))return!1;null===i&&(i=new Set),i.add(l)}}if(null!==i){for(var f=a(e),s=0;s<f.length;s++){var p=f[s];if("object"===o(p)&&null!==p){if(!M(i,p,r,n))return!1}else if(!r&&!t.has(p)&&!M(i,p,r,n))return!1}return 0===i.size}return!0}(t,e,r,u))return!1}else if(3===l){if(!function(t,e,r,i){for(var a=null,u=c(t),l=0;l<u.length;l++){var f=n(u[l],2),s=f[0],p=f[1];if("object"===o(s)&&null!==s)null===a&&(a=new Set),a.add(s);else{var y=e.get(s);if(void 0===y&&!e.has(s)||!N(p,y,r,i)){if(r)return!1;if(!C(t,e,s,p,i))return!1;null===a&&(a=new Set),a.add(s)}}}if(null!==a){for(var d=c(e),g=0;g<d.length;g++){var v=n(d[g],2),b=(s=v[0],v[1]);if("object"===o(s)&&null!==s){if(!L(a,t,s,b,r,i))return!1}else if(!(r||t.has(s)&&N(t.get(s),b,!1,i)||L(a,t,s,b,!1,i)))return!1}return 0===a.size}return!0}(t,e,r,u))return!1}else if(1===l)for(;f<t.length;f++){if(!p(t,f)){if(p(e,f))return!1;for(var s=Object.keys(t);f<s.length;f++){var y=s[f];if(!p(e,y)||!N(t[y],e[y],r,u))return!1}return s.length===Object.keys(e).length}if(!p(e,f)||!N(t[f],e[f],r,u))return!1}for(f=0;f<i.length;f++){var d=i[f];if(!N(t[d],e[d],r,u))return!1}return!0}t.exports={isDeepEqual:function(t,e){return N(t,e,false)},isDeepStrictEqual:function(t,e){return N(t,e,true)}}},1924:(t,e,r)=>{"use strict";var n=r(210),o=r(5559),i=o(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&i(t,".prototype.")>-1?o(r):r}},5559:(t,e,r)=>{"use strict";var n=r(8612),o=r(210),i=o("%Function.prototype.apply%"),a=o("%Function.prototype.call%"),c=o("%Reflect.apply%",!0)||n.call(a,i),u=o("%Object.getOwnPropertyDescriptor%",!0),l=o("%Object.defineProperty%",!0),f=o("%Math.max%");if(l)try{l({},"a",{value:1})}catch(t){l=null}t.exports=function(t){var e=c(n,a,arguments);if(u&&l){var r=u(e,"length");r.configurable&&l(e,"length",{value:1+f(0,t.length-(arguments.length-1))})}return e};var s=function(){return c(n,i,arguments)};l?l(t.exports,"apply",{value:s}):t.exports.apply=s},5108:(t,e,r)=>{var n=r(9539),o=r(9282);function i(){return(new Date).getTime()}var a,c=Array.prototype.slice,u={};a=void 0!==r.g&&r.g.console?r.g.console:"undefined"!=typeof window&&window.console?window.console:{};for(var l=[[function(){},"log"],[function(){a.log.apply(a,arguments)},"info"],[function(){a.log.apply(a,arguments)},"warn"],[function(){a.warn.apply(a,arguments)},"error"],[function(t){u[t]=i()},"time"],[function(t){var e=u[t];if(!e)throw new Error("No such label: "+t);delete u[t];var r=i()-e;a.log(t+": "+r+"ms")},"timeEnd"],[function(){var t=new Error;t.name="Trace",t.message=n.format.apply(null,arguments),a.error(t.stack)},"trace"],[function(t){a.log(n.inspect(t)+"\n")},"dir"],[function(t){if(!t){var e=c.call(arguments,1);o.ok(!1,n.format.apply(null,e))}},"assert"]],f=0;f<l.length;f++){var s=l[f],p=s[0],y=s[1];a[y]||(a[y]=p)}t.exports=a},9662:(t,e,r)=>{var n=r(7854),o=r(614),i=r(6330),a=n.TypeError;t.exports=function(t){if(o(t))return t;throw a(i(t)+" is not a function")}},9670:(t,e,r)=>{var n=r(7854),o=r(111),i=n.String,a=n.TypeError;t.exports=function(t){if(o(t))return t;throw a(i(t)+" is not an object")}},1318:(t,e,r)=>{var n=r(5656),o=r(1400),i=r(6244),a=function(t){return function(e,r,a){var c,u=n(e),l=i(u),f=o(a,l);if(t&&r!=r){for(;l>f;)if((c=u[f++])!=c)return!0}else for(;l>f;f++)if((t||f in u)&&u[f]===r)return t||f||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},1194:(t,e,r)=>{var n=r(7293),o=r(5112),i=r(7392),a=o("species");t.exports=function(t){return i>=51||!n((function(){var e=[];return(e.constructor={})[a]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},7475:(t,e,r)=>{var n=r(7854),o=r(3157),i=r(4411),a=r(111),c=r(5112)("species"),u=n.Array;t.exports=function(t){var e;return o(t)&&(e=t.constructor,(i(e)&&(e===u||o(e.prototype))||a(e)&&null===(e=e[c]))&&(e=void 0)),void 0===e?u:e}},5417:(t,e,r)=>{var n=r(7475);t.exports=function(t,e){return new(n(t))(0===e?0:e)}},4326:(t,e,r)=>{var n=r(1702),o=n({}.toString),i=n("".slice);t.exports=function(t){return i(o(t),8,-1)}},648:(t,e,r)=>{var n=r(7854),o=r(1694),i=r(614),a=r(4326),c=r(5112)("toStringTag"),u=n.Object,l="Arguments"==a(function(){return arguments}());t.exports=o?a:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=u(t),c))?r:l?a(e):"Object"==(n=a(e))&&i(e.callee)?"Arguments":n}},9920:(t,e,r)=>{var n=r(2597),o=r(3887),i=r(1236),a=r(3070);t.exports=function(t,e,r){for(var c=o(e),u=a.f,l=i.f,f=0;f<c.length;f++){var s=c[f];n(t,s)||r&&n(r,s)||u(t,s,l(e,s))}}},8880:(t,e,r)=>{var n=r(9781),o=r(3070),i=r(9114);t.exports=n?function(t,e,r){return o.f(t,e,i(1,r))}:function(t,e,r){return t[e]=r,t}},9114:t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},6135:(t,e,r)=>{"use strict";var n=r(4948),o=r(3070),i=r(9114);t.exports=function(t,e,r){var a=n(e);a in t?o.f(t,a,i(0,r)):t[a]=r}},8052:(t,e,r)=>{var n=r(7854),o=r(614),i=r(8880),a=r(6339),c=r(3505);t.exports=function(t,e,r,u){var l=!!u&&!!u.unsafe,f=!!u&&!!u.enumerable,s=!!u&&!!u.noTargetGet,p=u&&void 0!==u.name?u.name:e;return o(r)&&a(r,p,u),t===n?(f?t[e]=r:c(e,r),t):(l?!s&&t[e]&&(f=!0):delete t[e],f?t[e]=r:i(t,e,r),t)}},9781:(t,e,r)=>{var n=r(7293);t.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},317:(t,e,r)=>{var n=r(7854),o=r(111),i=n.document,a=o(i)&&o(i.createElement);t.exports=function(t){return a?i.createElement(t):{}}},8113:(t,e,r)=>{var n=r(5005);t.exports=n("navigator","userAgent")||""},7392:(t,e,r)=>{var n,o,i=r(7854),a=r(8113),c=i.process,u=i.Deno,l=c&&c.versions||u&&u.version,f=l&&l.v8;f&&(o=(n=f.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!o&&a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(o=+n[1]),t.exports=o},748:t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2109:(t,e,r)=>{var n=r(7854),o=r(1236).f,i=r(8880),a=r(8052),c=r(3505),u=r(9920),l=r(4705);t.exports=function(t,e){var r,f,s,p,y,d=t.target,g=t.global,v=t.stat;if(r=g?n:v?n[d]||c(d,{}):(n[d]||{}).prototype)for(f in e){if(p=e[f],s=t.noTargetGet?(y=o(r,f))&&y.value:r[f],!l(g?f:d+(v?".":"#")+f,t.forced)&&void 0!==s){if(typeof p==typeof s)continue;u(p,s)}(t.sham||s&&s.sham)&&i(p,"sham",!0),a(r,f,p,t)}}},7293:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},4374:(t,e,r)=>{var n=r(7293);t.exports=!n((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},6916:(t,e,r)=>{var n=r(4374),o=Function.prototype.call;t.exports=n?o.bind(o):function(){return o.apply(o,arguments)}},6530:(t,e,r)=>{var n=r(9781),o=r(2597),i=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,c=o(i,"name"),u=c&&"something"===function(){}.name,l=c&&(!n||n&&a(i,"name").configurable);t.exports={EXISTS:c,PROPER:u,CONFIGURABLE:l}},1702:(t,e,r)=>{var n=r(4374),o=Function.prototype,i=o.bind,a=o.call,c=n&&i.bind(a,a);t.exports=n?function(t){return t&&c(t)}:function(t){return t&&function(){return a.apply(t,arguments)}}},5005:(t,e,r)=>{var n=r(7854),o=r(614),i=function(t){return o(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?i(n[t]):n[t]&&n[t][e]}},8173:(t,e,r)=>{var n=r(9662);t.exports=function(t,e){var r=t[e];return null==r?void 0:n(r)}},7854:(t,e,r)=>{var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||function(){return this}()||Function("return this")()},2597:(t,e,r)=>{var n=r(1702),o=r(7908),i=n({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return i(o(t),e)}},3501:t=>{t.exports={}},4664:(t,e,r)=>{var n=r(9781),o=r(7293),i=r(317);t.exports=!n&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},8361:(t,e,r)=>{var n=r(7854),o=r(1702),i=r(7293),a=r(4326),c=n.Object,u=o("".split);t.exports=i((function(){return!c("z").propertyIsEnumerable(0)}))?function(t){return"String"==a(t)?u(t,""):c(t)}:c},2788:(t,e,r)=>{var n=r(1702),o=r(614),i=r(5465),a=n(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return a(t)}),t.exports=i.inspectSource},9909:(t,e,r)=>{var n,o,i,a=r(8536),c=r(7854),u=r(1702),l=r(111),f=r(8880),s=r(2597),p=r(5465),y=r(6200),d=r(3501),g="Object already initialized",v=c.TypeError,b=c.WeakMap;if(a||p.state){var h=p.state||(p.state=new b),m=u(h.get),w=u(h.has),O=u(h.set);n=function(t,e){if(w(h,t))throw new v(g);return e.facade=t,O(h,t,e),e},o=function(t){return m(h,t)||{}},i=function(t){return w(h,t)}}else{var j=y("state");d[j]=!0,n=function(t,e){if(s(t,j))throw new v(g);return e.facade=t,f(t,j,e),e},o=function(t){return s(t,j)?t[j]:{}},i=function(t){return s(t,j)}}t.exports={set:n,get:o,has:i,enforce:function(t){return i(t)?o(t):n(t,{})},getterFor:function(t){return function(e){var r;if(!l(e)||(r=o(e)).type!==t)throw v("Incompatible receiver, "+t+" required");return r}}}},3157:(t,e,r)=>{var n=r(4326);t.exports=Array.isArray||function(t){return"Array"==n(t)}},614:t=>{t.exports=function(t){return"function"==typeof t}},4411:(t,e,r)=>{var n=r(1702),o=r(7293),i=r(614),a=r(648),c=r(5005),u=r(2788),l=function(){},f=[],s=c("Reflect","construct"),p=/^\s*(?:class|function)\b/,y=n(p.exec),d=!p.exec(l),g=function(t){if(!i(t))return!1;try{return s(l,f,t),!0}catch(t){return!1}},v=function(t){if(!i(t))return!1;switch(a(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return d||!!y(p,u(t))}catch(t){return!0}};v.sham=!0,t.exports=!s||o((function(){var t;return g(g.call)||!g(Object)||!g((function(){t=!0}))||t}))?v:g},4705:(t,e,r)=>{var n=r(7293),o=r(614),i=/#|\.prototype\./,a=function(t,e){var r=u[c(t)];return r==f||r!=l&&(o(e)?n(e):!!e)},c=a.normalize=function(t){return String(t).replace(i,".").toLowerCase()},u=a.data={},l=a.NATIVE="N",f=a.POLYFILL="P";t.exports=a},111:(t,e,r)=>{var n=r(614);t.exports=function(t){return"object"==typeof t?null!==t:n(t)}},1913:t=>{t.exports=!1},2190:(t,e,r)=>{var n=r(7854),o=r(5005),i=r(614),a=r(7976),c=r(3307),u=n.Object;t.exports=c?function(t){return"symbol"==typeof t}:function(t){var e=o("Symbol");return i(e)&&a(e.prototype,u(t))}},6244:(t,e,r)=>{var n=r(7466);t.exports=function(t){return n(t.length)}},6339:(t,e,r)=>{var n=r(7293),o=r(614),i=r(2597),a=r(3070).f,c=r(6530).CONFIGURABLE,u=r(2788),l=r(9909),f=l.enforce,s=l.get,p=!n((function(){return 8!==a((function(){}),"length",{value:8}).length})),y=String(String).split("String"),d=t.exports=function(t,e,r){"Symbol("===String(e).slice(0,7)&&(e="["+String(e).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!i(t,"name")||c&&t.name!==e)&&a(t,"name",{value:e,configurable:!0}),p&&r&&i(r,"arity")&&t.length!==r.arity&&a(t,"length",{value:r.arity});var n=f(t);return i(n,"source")||(n.source=y.join("string"==typeof e?e:"")),t};Function.prototype.toString=d((function(){return o(this)&&s(this).source||u(this)}),"toString")},133:(t,e,r)=>{var n=r(7392),o=r(7293);t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},8536:(t,e,r)=>{var n=r(7854),o=r(614),i=r(2788),a=n.WeakMap;t.exports=o(a)&&/native code/.test(i(a))},3070:(t,e,r)=>{var n=r(7854),o=r(9781),i=r(4664),a=r(3353),c=r(9670),u=r(4948),l=n.TypeError,f=Object.defineProperty,s=Object.getOwnPropertyDescriptor,p="enumerable",y="configurable",d="writable";e.f=o?a?function(t,e,r){if(c(t),e=u(e),c(r),"function"==typeof t&&"prototype"===e&&"value"in r&&d in r&&!r.writable){var n=s(t,e);n&&n.writable&&(t[e]=r.value,r={configurable:y in r?r.configurable:n.configurable,enumerable:p in r?r.enumerable:n.enumerable,writable:!1})}return f(t,e,r)}:f:function(t,e,r){if(c(t),e=u(e),c(r),i)try{return f(t,e,r)}catch(t){}if("get"in r||"set"in r)throw l("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},1236:(t,e,r)=>{var n=r(9781),o=r(6916),i=r(5296),a=r(9114),c=r(5656),u=r(4948),l=r(2597),f=r(4664),s=Object.getOwnPropertyDescriptor;e.f=n?s:function(t,e){if(t=c(t),e=u(e),f)try{return s(t,e)}catch(t){}if(l(t,e))return a(!o(i.f,t,e),t[e])}},8006:(t,e,r)=>{var n=r(6324),o=r(748).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return n(t,o)}},5181:(t,e)=>{e.f=Object.getOwnPropertySymbols},7976:(t,e,r)=>{var n=r(1702);t.exports=n({}.isPrototypeOf)},6324:(t,e,r)=>{var n=r(1702),o=r(2597),i=r(5656),a=r(1318).indexOf,c=r(3501),u=n([].push);t.exports=function(t,e){var r,n=i(t),l=0,f=[];for(r in n)!o(c,r)&&o(n,r)&&u(f,r);for(;e.length>l;)o(n,r=e[l++])&&(~a(f,r)||u(f,r));return f}},5296:(t,e)=>{"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,o=n&&!r.call({1:2},1);e.f=o?function(t){var e=n(this,t);return!!e&&e.enumerable}:r},2140:(t,e,r)=>{var n=r(7854),o=r(6916),i=r(614),a=r(111),c=n.TypeError;t.exports=function(t,e){var r,n;if("string"===e&&i(r=t.toString)&&!a(n=o(r,t)))return n;if(i(r=t.valueOf)&&!a(n=o(r,t)))return n;if("string"!==e&&i(r=t.toString)&&!a(n=o(r,t)))return n;throw c("Can't convert object to primitive value")}},3887:(t,e,r)=>{var n=r(5005),o=r(1702),i=r(8006),a=r(5181),c=r(9670),u=o([].concat);t.exports=n("Reflect","ownKeys")||function(t){var e=i.f(c(t)),r=a.f;return r?u(e,r(t)):e}},4488:(t,e,r)=>{var n=r(7854).TypeError;t.exports=function(t){if(null==t)throw n("Can't call method on "+t);return t}},3505:(t,e,r)=>{var n=r(7854),o=Object.defineProperty;t.exports=function(t,e){try{o(n,t,{value:e,configurable:!0,writable:!0})}catch(r){n[t]=e}return e}},6200:(t,e,r)=>{var n=r(2309),o=r(9711),i=n("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},5465:(t,e,r)=>{var n=r(7854),o=r(3505),i="__core-js_shared__",a=n[i]||o(i,{});t.exports=a},2309:(t,e,r)=>{var n=r(1913),o=r(5465);(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.22.4",mode:n?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.22.4/LICENSE",source:"https://github.com/zloirock/core-js"})},1400:(t,e,r)=>{var n=r(9303),o=Math.max,i=Math.min;t.exports=function(t,e){var r=n(t);return r<0?o(r+e,0):i(r,e)}},5656:(t,e,r)=>{var n=r(8361),o=r(4488);t.exports=function(t){return n(o(t))}},9303:t=>{var e=Math.ceil,r=Math.floor;t.exports=function(t){var n=+t;return n!=n||0===n?0:(n>0?r:e)(n)}},7466:(t,e,r)=>{var n=r(9303),o=Math.min;t.exports=function(t){return t>0?o(n(t),9007199254740991):0}},7908:(t,e,r)=>{var n=r(7854),o=r(4488),i=n.Object;t.exports=function(t){return i(o(t))}},7593:(t,e,r)=>{var n=r(7854),o=r(6916),i=r(111),a=r(2190),c=r(8173),u=r(2140),l=r(5112),f=n.TypeError,s=l("toPrimitive");t.exports=function(t,e){if(!i(t)||a(t))return t;var r,n=c(t,s);if(n){if(void 0===e&&(e="default"),r=o(n,t,e),!i(r)||a(r))return r;throw f("Can't convert object to primitive value")}return void 0===e&&(e="number"),u(t,e)}},4948:(t,e,r)=>{var n=r(7593),o=r(2190);t.exports=function(t){var e=n(t,"string");return o(e)?e:e+""}},1694:(t,e,r)=>{var n={};n[r(5112)("toStringTag")]="z",t.exports="[object z]"===String(n)},6330:(t,e,r)=>{var n=r(7854).String;t.exports=function(t){try{return n(t)}catch(t){return"Object"}}},9711:(t,e,r)=>{var n=r(1702),o=0,i=Math.random(),a=n(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++o+i,36)}},3307:(t,e,r)=>{var n=r(133);t.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},3353:(t,e,r)=>{var n=r(9781),o=r(7293);t.exports=n&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},5112:(t,e,r)=>{var n=r(7854),o=r(2309),i=r(2597),a=r(9711),c=r(133),u=r(3307),l=o("wks"),f=n.Symbol,s=f&&f.for,p=u?f:f&&f.withoutSetter||a;t.exports=function(t){if(!i(l,t)||!c&&"string"!=typeof l[t]){var e="Symbol."+t;c&&i(f,t)?l[t]=f[t]:l[t]=u&&s?s(e):p(e)}return l[t]}},2222:(t,e,r)=>{"use strict";var n=r(2109),o=r(7854),i=r(7293),a=r(3157),c=r(111),u=r(7908),l=r(6244),f=r(6135),s=r(5417),p=r(1194),y=r(5112),d=r(7392),g=y("isConcatSpreadable"),v=9007199254740991,b="Maximum allowed index exceeded",h=o.TypeError,m=d>=51||!i((function(){var t=[];return t[g]=!1,t.concat()[0]!==t})),w=p("concat"),O=function(t){if(!c(t))return!1;var e=t[g];return void 0!==e?!!e:a(t)};n({target:"Array",proto:!0,arity:1,forced:!m||!w},{concat:function(t){var e,r,n,o,i,a=u(this),c=s(a,0),p=0;for(e=-1,n=arguments.length;e<n;e++)if(O(i=-1===e?a:arguments[e])){if(p+(o=l(i))>v)throw h(b);for(r=0;r<o;r++,p++)r in i&&f(c,p,i[r])}else{if(p>=v)throw h(b);f(c,p++,i)}return c.length=p,c}})},4289:(t,e,r)=>{"use strict";var n=r(2215),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,c=Object.defineProperty,u=c&&function(){var t={};try{for(var e in c(t,"x",{enumerable:!1,value:t}),t)return!1;return t.x===t}catch(t){return!1}}(),l=function(t,e,r,n){var o;(!(e in t)||"function"==typeof(o=n)&&"[object Function]"===i.call(o)&&n())&&(u?c(t,e,{configurable:!0,enumerable:!1,value:r,writable:!0}):t[e]=r)},f=function(t,e){var r=arguments.length>2?arguments[2]:{},i=n(e);o&&(i=a.call(i,Object.getOwnPropertySymbols(e)));for(var c=0;c<i.length;c+=1)l(t,i[c],e[i[c]],r[i[c]])};f.supportsDescriptors=!!u,t.exports=f},8091:t=>{"use strict";function e(t,e){if(null==t)throw new TypeError("Cannot convert first argument to object");for(var r=Object(t),n=1;n<arguments.length;n++){var o=arguments[n];if(null!=o)for(var i=Object.keys(Object(o)),a=0,c=i.length;a<c;a++){var u=i[a],l=Object.getOwnPropertyDescriptor(o,u);void 0!==l&&l.enumerable&&(r[u]=o[u])}}return r}t.exports={assign:e,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:e})}}},5573:t=>{"use strict";var e=/["'&<>]/;t.exports=function(t){var r,n=""+t,o=e.exec(n);if(!o)return n;var i="",a=0,c=0;for(a=o.index;a<n.length;a++){switch(n.charCodeAt(a)){case 34:r="&quot;";break;case 38:r="&amp;";break;case 39:r="&#39;";break;case 60:r="&lt;";break;case 62:r="&gt;";break;default:continue}c!==a&&(i+=n.substring(c,a)),c=a+1,i+=r}return c!==a?i+n.substring(c,a):i}},9804:t=>{var e=Object.prototype.hasOwnProperty,r=Object.prototype.toString;t.exports=function(t,n,o){if("[object Function]"!==r.call(n))throw new TypeError("iterator must be a function");var i=t.length;if(i===+i)for(var a=0;a<i;a++)n.call(o,t[a],a,t);else for(var c in t)e.call(t,c)&&n.call(o,t[c],c,t)}},7648:t=>{"use strict";var e="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,o="[object Function]";t.exports=function(t){var i=this;if("function"!=typeof i||n.call(i)!==o)throw new TypeError(e+i);for(var a,c=r.call(arguments,1),u=function(){if(this instanceof a){var e=i.apply(this,c.concat(r.call(arguments)));return Object(e)===e?e:this}return i.apply(t,c.concat(r.call(arguments)))},l=Math.max(0,i.length-c.length),f=[],s=0;s<l;s++)f.push("$"+s);if(a=Function("binder","return function ("+f.join(",")+"){ return binder.apply(this,arguments); }")(u),i.prototype){var p=function(){};p.prototype=i.prototype,a.prototype=new p,p.prototype=null}return a}},8612:(t,e,r)=>{"use strict";var n=r(7648);t.exports=Function.prototype.bind||n},210:(t,e,r)=>{"use strict";var n,o=SyntaxError,i=Function,a=TypeError,c=function(t){try{return i('"use strict"; return ('+t+").constructor;")()}catch(t){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(t){u=null}var l=function(){throw new a},f=u?function(){try{return l}catch(t){try{return u(arguments,"callee").get}catch(t){return l}}}():l,s=r(1405)(),p=Object.getPrototypeOf||function(t){return t.__proto__},y={},d="undefined"==typeof Uint8Array?n:p(Uint8Array),g={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":s?p([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":y,"%AsyncGenerator%":y,"%AsyncGeneratorFunction%":y,"%AsyncIteratorPrototype%":y,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":y,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":s?p(p([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&s?p((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&s?p((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":s?p(""[Symbol.iterator]()):n,"%Symbol%":s?Symbol:n,"%SyntaxError%":o,"%ThrowTypeError%":f,"%TypedArray%":d,"%TypeError%":a,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},v=function t(e){var r;if("%AsyncFunction%"===e)r=c("async function () {}");else if("%GeneratorFunction%"===e)r=c("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=c("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&(r=p(o.prototype))}return g[e]=r,r},b={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},h=r(8612),m=r(7642),w=h.call(Function.call,Array.prototype.concat),O=h.call(Function.apply,Array.prototype.splice),j=h.call(Function.call,String.prototype.replace),S=h.call(Function.call,String.prototype.slice),E=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,A=/\\(\\)?/g,x=function(t){var e=S(t,0,1),r=S(t,-1);if("%"===e&&"%"!==r)throw new o("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new o("invalid intrinsic syntax, expected opening `%`");var n=[];return j(t,E,(function(t,e,r,o){n[n.length]=r?j(o,A,"$1"):e||t})),n},P=function(t,e){var r,n=t;if(m(b,n)&&(n="%"+(r=b[n])[0]+"%"),m(g,n)){var i=g[n];if(i===y&&(i=v(n)),void 0===i&&!e)throw new a("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new o("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new a('"allowMissing" argument must be a boolean');var r=x(t),n=r.length>0?r[0]:"",i=P("%"+n+"%",e),c=i.name,l=i.value,f=!1,s=i.alias;s&&(n=s[0],O(r,w([0,1],s)));for(var p=1,y=!0;p<r.length;p+=1){var d=r[p],v=S(d,0,1),b=S(d,-1);if(('"'===v||"'"===v||"`"===v||'"'===b||"'"===b||"`"===b)&&v!==b)throw new o("property names with quotes must have matching quotes");if("constructor"!==d&&y||(f=!0),m(g,c="%"+(n+="."+d)+"%"))l=g[c];else if(null!=l){if(!(d in l)){if(!e)throw new a("base intrinsic for "+t+" exists, but the property is not available.");return}if(u&&p+1>=r.length){var h=u(l,d);l=(y=!!h)&&"get"in h&&!("originalValue"in h.get)?h.get:l[d]}else y=m(l,d),l=l[d];y&&!f&&(g[c]=l)}}return l}},1405:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(5419);t.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&o())))}},5419:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},6410:(t,e,r)=>{"use strict";var n=r(5419);t.exports=function(){return n()&&!!Symbol.toStringTag}},7642:(t,e,r)=>{"use strict";var n=r(8612);t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},5717:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},2584:(t,e,r)=>{"use strict";var n=r(6410)(),o=r(1924)("Object.prototype.toString"),i=function(t){return!(n&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===o(t)},a=function(t){return!!i(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==o(t)&&"[object Function]"===o(t.callee)},c=function(){return i(arguments)}();i.isLegacyArguments=a,t.exports=c?i:a},8662:(t,e,r)=>{"use strict";var n,o=Object.prototype.toString,i=Function.prototype.toString,a=/^\s*(?:function)?\*/,c=r(6410)(),u=Object.getPrototypeOf;t.exports=function(t){if("function"!=typeof t)return!1;if(a.test(i.call(t)))return!0;if(!c)return"[object GeneratorFunction]"===o.call(t);if(!u)return!1;if(void 0===n){var e=function(){if(!c)return!1;try{return Function("return function*() {}")()}catch(t){}}();n=!!e&&u(e)}return u(t)===n}},8611:t=>{"use strict";t.exports=function(t){return t!=t}},360:(t,e,r)=>{"use strict";var n=r(5559),o=r(4289),i=r(8611),a=r(9415),c=r(3194),u=n(a(),Number);o(u,{getPolyfill:a,implementation:i,shim:c}),t.exports=u},9415:(t,e,r)=>{"use strict";var n=r(8611);t.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},3194:(t,e,r)=>{"use strict";var n=r(4289),o=r(9415);t.exports=function(){var t=o();return n(Number,{isNaN:t},{isNaN:function(){return Number.isNaN!==t}}),t}},5692:(t,e,r)=>{"use strict";var n=r(9804),o=r(3083),i=r(1924),a=i("Object.prototype.toString"),c=r(6410)(),u=o(),l=i("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r<t.length;r+=1)if(t[r]===e)return r;return-1},f=i("String.prototype.slice"),s={},p=r(882),y=Object.getPrototypeOf;c&&p&&y&&n(u,(function(t){var e=new r.g[t];if(!(Symbol.toStringTag in e))throw new EvalError("this engine has support for Symbol.toStringTag, but "+t+" does not have the property! Please report this.");var n=y(e),o=p(n,Symbol.toStringTag);if(!o){var i=y(n);o=p(i,Symbol.toStringTag)}s[t]=o.get}));t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(!c){var e=f(a(t),8,-1);return l(u,e)>-1}return!!p&&function(t){var e=!1;return n(s,(function(r,n){if(!e)try{e=r.call(t)===n}catch(t){}})),e}(t)}},4244:t=>{"use strict";var e=function(t){return t!=t};t.exports=function(t,r){return 0===t&&0===r?1/t==1/r:t===r||!(!e(t)||!e(r))}},609:(t,e,r)=>{"use strict";var n=r(4289),o=r(5559),i=r(4244),a=r(5624),c=r(2281),u=o(a(),Object);n(u,{getPolyfill:a,implementation:i,shim:c}),t.exports=u},5624:(t,e,r)=>{"use strict";var n=r(4244);t.exports=function(){return"function"==typeof Object.is?Object.is:n}},2281:(t,e,r)=>{"use strict";var n=r(5624),o=r(4289);t.exports=function(){var t=n();return o(Object,{is:t},{is:function(){return Object.is!==t}}),t}},8987:(t,e,r)=>{"use strict";var n;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=r(1414),c=Object.prototype.propertyIsEnumerable,u=!c.call({toString:null},"toString"),l=c.call((function(){}),"prototype"),f=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],s=function(t){var e=t.constructor;return e&&e.prototype===t},p={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!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},y=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!p["$"+t]&&o.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{s(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===i.call(t),n=a(t),c=e&&"[object String]"===i.call(t),p=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var d=l&&r;if(c&&t.length>0&&!o.call(t,0))for(var g=0;g<t.length;++g)p.push(String(g));if(n&&t.length>0)for(var v=0;v<t.length;++v)p.push(String(v));else for(var b in t)d&&"prototype"===b||!o.call(t,b)||p.push(String(b));if(u)for(var h=function(t){if("undefined"==typeof window||!y)return s(t);try{return s(t)}catch(t){return!1}}(t),m=0;m<f.length;++m)h&&"constructor"===f[m]||!o.call(t,f[m])||p.push(f[m]);return p}}t.exports=n},2215:(t,e,r)=>{"use strict";var n=Array.prototype.slice,o=r(1414),i=Object.keys,a=i?function(t){return i(t)}:r(8987),c=Object.keys;a.shim=function(){Object.keys?function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2)||(Object.keys=function(t){return o(t)?c(n.call(t)):c(t)}):Object.keys=a;return Object.keys||a},t.exports=a},1414:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},4155:t=>{var e,r,n=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(t){if(e===setTimeout)return setTimeout(t,0);if((e===o||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:o}catch(t){e=o}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(t){r=i}}();var c,u=[],l=!1,f=-1;function s(){l&&c&&(l=!1,c.length?u=c.concat(u):f=-1,u.length&&p())}function p(){if(!l){var t=a(s);l=!0;for(var e=u.length;e;){for(c=u,u=[];++f<e;)c&&c[f].run();f=-1,e=u.length}c=null,l=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function y(t,e){this.fun=t,this.array=e}function d(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new y(t,e)),1!==u.length||l||a(p)},y.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=d,n.addListener=d,n.once=d,n.off=d,n.removeListener=d,n.removeAllListeners=d,n.emit=d,n.prependListener=d,n.prependOnceListener=d,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},384:t=>{t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},5955:(t,e,r)=>{"use strict";var n=r(2584),o=r(8662),i=r(6430),a=r(5692);function c(t){return t.call.bind(t)}var u="undefined"!=typeof BigInt,l="undefined"!=typeof Symbol,f=c(Object.prototype.toString),s=c(Number.prototype.valueOf),p=c(String.prototype.valueOf),y=c(Boolean.prototype.valueOf);if(u)var d=c(BigInt.prototype.valueOf);if(l)var g=c(Symbol.prototype.valueOf);function v(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function b(t){return"[object Map]"===f(t)}function h(t){return"[object Set]"===f(t)}function m(t){return"[object WeakMap]"===f(t)}function w(t){return"[object WeakSet]"===f(t)}function O(t){return"[object ArrayBuffer]"===f(t)}function j(t){return"undefined"!=typeof ArrayBuffer&&(O.working?O(t):t instanceof ArrayBuffer)}function S(t){return"[object DataView]"===f(t)}function E(t){return"undefined"!=typeof DataView&&(S.working?S(t):t instanceof DataView)}e.isArgumentsObject=n,e.isGeneratorFunction=o,e.isTypedArray=a,e.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):a(t)||E(t)},e.isUint8Array=function(t){return"Uint8Array"===i(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===i(t)},e.isUint16Array=function(t){return"Uint16Array"===i(t)},e.isUint32Array=function(t){return"Uint32Array"===i(t)},e.isInt8Array=function(t){return"Int8Array"===i(t)},e.isInt16Array=function(t){return"Int16Array"===i(t)},e.isInt32Array=function(t){return"Int32Array"===i(t)},e.isFloat32Array=function(t){return"Float32Array"===i(t)},e.isFloat64Array=function(t){return"Float64Array"===i(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===i(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===i(t)},b.working="undefined"!=typeof Map&&b(new Map),e.isMap=function(t){return"undefined"!=typeof Map&&(b.working?b(t):t instanceof Map)},h.working="undefined"!=typeof Set&&h(new Set),e.isSet=function(t){return"undefined"!=typeof Set&&(h.working?h(t):t instanceof Set)},m.working="undefined"!=typeof WeakMap&&m(new WeakMap),e.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(m.working?m(t):t instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),e.isWeakSet=function(t){return w(t)},O.working="undefined"!=typeof ArrayBuffer&&O(new ArrayBuffer),e.isArrayBuffer=j,S.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&S(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=E;var A="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function x(t){return"[object SharedArrayBuffer]"===f(t)}function P(t){return void 0!==A&&(void 0===x.working&&(x.working=x(new A)),x.working?x(t):t instanceof A)}function k(t){return v(t,s)}function _(t){return v(t,p)}function T(t){return v(t,y)}function I(t){return u&&v(t,d)}function F(t){return l&&v(t,g)}e.isSharedArrayBuffer=P,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===f(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===f(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===f(t)},e.isGeneratorObject=function(t){return"[object Generator]"===f(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===f(t)},e.isNumberObject=k,e.isStringObject=_,e.isBooleanObject=T,e.isBigIntObject=I,e.isSymbolObject=F,e.isBoxedPrimitive=function(t){return k(t)||_(t)||T(t)||I(t)||F(t)},e.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(j(t)||P(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))},9539:(t,e,r)=>{var n=r(4155),o=r(5108),i=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++)r[e[n]]=Object.getOwnPropertyDescriptor(t,e[n]);return r},a=/%[sdj%]/g;e.format=function(t){if(!w(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(f(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,o=n.length,i=String(t).replace(a,(function(t){if("%%"===t)return"%";if(r>=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),c=n[r];r<o;c=n[++r])h(c)||!S(c)?i+=" "+c:i+=" "+f(c);return i},e.deprecate=function(t,r){if(void 0!==n&&!0===n.noDeprecation)return t;if(void 0===n)return function(){return e.deprecate(t,r).apply(this,arguments)};var i=!1;return function(){if(!i){if(n.throwDeprecation)throw new Error(r);n.traceDeprecation?o.trace(r):o.error(r),i=!0}return t.apply(this,arguments)}};var c={},u=/^$/;if(n.env.NODE_DEBUG){var l=n.env.NODE_DEBUG;l=l.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),u=new RegExp("^"+l+"$","i")}function f(t,r){var n={seen:[],stylize:p};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),b(r)?n.showHidden=r:r&&e._extend(n,r),O(n.showHidden)&&(n.showHidden=!1),O(n.depth)&&(n.depth=2),O(n.colors)&&(n.colors=!1),O(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=s),y(n,t,n.depth)}function s(t,e){var r=f.styles[e];return r?"["+f.colors[r][0]+"m"+t+"["+f.colors[r][1]+"m":t}function p(t,e){return t}function y(t,r,n){if(t.customInspect&&r&&x(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var o=r.inspect(n,t);return w(o)||(o=y(t,o,n)),o}var i=function(t,e){if(O(e))return t.stylize("undefined","undefined");if(w(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(m(e))return t.stylize(""+e,"number");if(b(e))return t.stylize(""+e,"boolean");if(h(e))return t.stylize("null","null")}(t,r);if(i)return i;var a=Object.keys(r),c=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(r)),A(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return d(r);if(0===a.length){if(x(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(j(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(E(r))return t.stylize(Date.prototype.toString.call(r),"date");if(A(r))return d(r)}var l,f="",s=!1,p=["{","}"];(v(r)&&(s=!0,p=["[","]"]),x(r))&&(f=" [Function"+(r.name?": "+r.name:"")+"]");return j(r)&&(f=" "+RegExp.prototype.toString.call(r)),E(r)&&(f=" "+Date.prototype.toUTCString.call(r)),A(r)&&(f=" "+d(r)),0!==a.length||s&&0!=r.length?n<0?j(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),l=s?function(t,e,r,n,o){for(var i=[],a=0,c=e.length;a<c;++a)I(e,String(a))?i.push(g(t,e,r,n,String(a),!0)):i.push("");return o.forEach((function(o){o.match(/^\d+$/)||i.push(g(t,e,r,n,o,!0))})),i}(t,r,n,c,a):a.map((function(e){return g(t,r,n,c,e,s)})),t.seen.pop(),function(t,e,r){if(t.reduce((function(t,e){return e.indexOf("\n")>=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(l,f,p)):p[0]+f+p[1]}function d(t){return"["+Error.prototype.toString.call(t)+"]"}function g(t,e,r,n,o,i){var a,c,u;if((u=Object.getOwnPropertyDescriptor(e,o)||{value:e[o]}).get?c=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(c=t.stylize("[Setter]","special")),I(n,o)||(a="["+o+"]"),c||(t.seen.indexOf(u.value)<0?(c=h(r)?y(t,u.value,null):y(t,u.value,r-1)).indexOf("\n")>-1&&(c=i?c.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+c.split("\n").map((function(t){return" "+t})).join("\n")):c=t.stylize("[Circular]","special")),O(a)){if(i&&o.match(/^\d+$/))return c;(a=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+c}function v(t){return Array.isArray(t)}function b(t){return"boolean"==typeof t}function h(t){return null===t}function m(t){return"number"==typeof t}function w(t){return"string"==typeof t}function O(t){return void 0===t}function j(t){return S(t)&&"[object RegExp]"===P(t)}function S(t){return"object"==typeof t&&null!==t}function E(t){return S(t)&&"[object Date]"===P(t)}function A(t){return S(t)&&("[object Error]"===P(t)||t instanceof Error)}function x(t){return"function"==typeof t}function P(t){return Object.prototype.toString.call(t)}function k(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(t=t.toUpperCase(),!c[t])if(u.test(t)){var r=n.pid;c[t]=function(){var n=e.format.apply(e,arguments);o.error("%s %d: %s",t,r,n)}}else c[t]=function(){};return c[t]},e.inspect=f,f.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},f.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=r(5955),e.isArray=v,e.isBoolean=b,e.isNull=h,e.isNullOrUndefined=function(t){return null==t},e.isNumber=m,e.isString=w,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=O,e.isRegExp=j,e.types.isRegExp=j,e.isObject=S,e.isDate=E,e.types.isDate=E,e.isError=A,e.types.isNativeError=A,e.isFunction=x,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(384);var _=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function T(){var t=new Date,e=[k(t.getHours()),k(t.getMinutes()),k(t.getSeconds())].join(":");return[t.getDate(),_[t.getMonth()],e].join(" ")}function I(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){o.log("%s - %s",T(),e.format.apply(e,arguments))},e.inherits=r(5717),e._extend=function(t,e){if(!e||!S(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var F="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function R(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(F&&t[F]){var e;if("function"!=typeof(e=t[F]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,F,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),o=[],i=0;i<arguments.length;i++)o.push(arguments[i]);o.push((function(t,n){t?r(t):e(n)}));try{t.apply(this,o)}catch(t){r(t)}return n}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),F&&Object.defineProperty(e,F,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,i(t))},e.promisify.custom=F,e.callbackify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function e(){for(var e=[],r=0;r<arguments.length;r++)e.push(arguments[r]);var o=e.pop();if("function"!=typeof o)throw new TypeError("The last argument must be of type Function");var i=this,a=function(){return o.apply(i,arguments)};t.apply(this,e).then((function(t){n.nextTick(a.bind(null,null,t))}),(function(t){n.nextTick(R.bind(null,t,a))}))}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Object.defineProperties(e,i(t)),e}},6430:(t,e,r)=>{"use strict";var n=r(9804),o=r(3083),i=r(1924),a=i("Object.prototype.toString"),c=r(6410)(),u=o(),l=i("String.prototype.slice"),f={},s=r(882),p=Object.getPrototypeOf;c&&s&&p&&n(u,(function(t){if("function"==typeof r.g[t]){var e=new r.g[t];if(!(Symbol.toStringTag in e))throw new EvalError("this engine has support for Symbol.toStringTag, but "+t+" does not have the property! Please report this.");var n=p(e),o=s(n,Symbol.toStringTag);if(!o){var i=p(n);o=s(i,Symbol.toStringTag)}f[t]=o.get}}));var y=r(5692);t.exports=function(t){return!!y(t)&&(c?function(t){var e=!1;return n(f,(function(r,n){if(!e)try{var o=r.call(t);o===n&&(e=o)}catch(t){}})),e}(t):l(a(t),8,-1))}},3083:(t,e,r)=>{"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"];t.exports=function(){for(var t=[],e=0;e<n.length;e++)"function"==typeof r.g[n[e]]&&(t[t.length]=n[e]);return t}},882:(t,e,r)=>{"use strict";var n=r(210)("%Object.getOwnPropertyDescriptor%");if(n)try{n([],"length")}catch(t){n=null}t.exports=n}},n={};function o(t){var e=n[t];if(void 0!==e)return e.exports;var i=n[t]={id:t,exports:{}};return r[t].call(i.exports,i,i.exports,o),i.exports}o.m=r,o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var r in e)o.o(e,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o.f={},o.e=t=>Promise.all(Object.keys(o.f).reduce(((e,r)=>(o.f[r](t,e),e)),[])),o.u=t=>"files_videoplayer-"+t+".js?v="+{"vendors-node_modules_video_js_dist_video_es_js":"1b6d9725c996f15df33f",_34aa:"ab777726a58732acd0d2",css_style_css:"211b329b40ae32bf5d72","vendors-node_modules_video_js_dist_video-js_css":"6813c23d9e5029c0233b"}[t],o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t={},e="files_videoplayer:",o.l=(r,n,i,a)=>{if(t[r])t[r].push(n);else{var c,u;if(void 0!==i)for(var l=document.getElementsByTagName("script"),f=0;f<l.length;f++){var s=l[f];if(s.getAttribute("src")==r||s.getAttribute("data-webpack")==e+i){c=s;break}}c||(u=!0,(c=document.createElement("script")).charset="utf-8",c.timeout=120,o.nc&&c.setAttribute("nonce",o.nc),c.setAttribute("data-webpack",e+i),c.src=r),t[r]=[n];var p=(e,n)=>{c.onerror=c.onload=null,clearTimeout(y);var o=t[r];if(delete t[r],c.parentNode&&c.parentNode.removeChild(c),o&&o.forEach((t=>t(n))),e)return e(n)},y=setTimeout(p.bind(null,void 0,{type:"timeout",target:c}),12e4);c.onerror=p.bind(null,c.onerror),c.onload=p.bind(null,c.onload),u&&document.head.appendChild(c)}},o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.p="/apps/files_videoplayer/js/",(()=>{var t={main:0};o.f.j=(e,r)=>{var n=o.o(t,e)?t[e]:void 0;if(0!==n)if(n)r.push(n[2]);else{var i=new Promise(((r,o)=>n=t[e]=[r,o]));r.push(n[2]=i);var a=o.p+o.u(e),c=new Error;o.l(a,(r=>{if(o.o(t,e)&&(0!==(n=t[e])&&(t[e]=void 0),n)){var i=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+i+": "+a+")",c.name="ChunkLoadError",c.type=i,c.request=a,n[1](c)}}),"chunk-"+e,e)}};var e=(e,r)=>{var n,i,[a,c,u]=r,l=0;for(n in c)o.o(c,n)&&(o.m[n]=c[n]);if(u)u(o);for(e&&e(r);l<a.length;l++)i=a[l],o.o(t,i)&&t[i]&&t[i][0](),t[a[l]]=0},r=self.webpackChunkfiles_videoplayer=self.webpackChunkfiles_videoplayer||[];r.forEach(e.bind(null,0)),r.push=e.bind(null,r.push.bind(r))})(),(()=>{"use strict";var t=o(5573),e=o.n(t),r=o(6453),n=o(5108);o.nc=btoa(OC.requestToken),o.p=OC.filePath("files_videoplayer","","js/");var i=null,a=-1!==(0,r.j)("files_downloadlimit","download_limit",{limit:-1}).limit,c={UI:{show:function(){var t=document.createElement("video");if(t.id="my_video_1",t.classList.add("video-js"),t.classList.add("vjs-fill"),t.classList.add("vjs-big-play-centered"),t.controls=!0,t.preload="auto",t.width="100%",t.height="100%",t.poster=OC.filePath("files_videoplayer","","img")+"/poster.png",t.setAttribute("data-setup",'{"techOrder": ["html5"]}'),!a){var r=document.createElement("source");r.src=e()(c.location).replace("&amp;","&"),c.mime&&(r.type=e()(c.mime)),t.appendChild(r)}if(null===c.inline){var n=document.createElement("div");n.id="videoplayer_overlay";var o=document.createElement("div");o.id="videoplayer_outerContainer";var u=document.createElement("div");u.id="videoplayer_container";var l=document.createElement("div");l.id="videoplayer",u.appendChild(l),o.appendChild(u),n.appendChild(o),l.appendChild(t),document.body.appendChild(n),n.addEventListener("click",(function(t){t.target===this&&c.hidePlayer()})),setTimeout((function(){n.className="show"}),0)}else{var f=document.createElement("div");f.id="videoplayer_view",f.appendChild(t),c.inline.appendChild(f)}i("my_video_1",{fill:!0}).ready((function(){if(c.player=this,null===c.inline){var t=document.createElement("a");t.className="icon-view-close",t.id="box-close",t.href="#",t.addEventListener("click",(function(){c.hidePlayer()})),document.getElementById("my_video_1").appendChild(t)}null===document.getElementById("body-public")&&c.player.play()}))},hide:function(){var t=document.getElementById("videoplayer_overlay");t.className="",setTimeout((function(){t.parentElement.removeChild(t)}),500)}},mime:null,file:null,location:null,player:null,inline:null,mimeTypes:["video/mp4","video/x-m4v","video/webm","video/x-flv","video/ogg","video/quicktime","video/x-matroska"],mimeTypeAliasses:{"video/x-matroska":"video/webm"},onView:function(t,e){c.file=t,c.dir=e.dir,c.location=e.fileList.getDownloadUrl(t,c.dir),c.mime=e.$file.attr("data-mime"),Object.prototype.hasOwnProperty.call(c.mimeTypeAliasses,c.mime)&&(c.mime=c.mimeTypeAliasses[c.mime]),c.showPlayer()},onViewInline:function(t,e,r){c.location=e,c.mime=r,Object.prototype.hasOwnProperty.call(c.mimeTypeAliasses,c.mime)&&(c.mime=c.mimeTypeAliasses[c.mime]),c.inline=t,c.showPlayer()},showPlayer:function(){Promise.all([o.e("vendors-node_modules_video_js_dist_video_es_js"),o.e("_34aa")]).then(o.bind(o,1272)).then((function(t){i=t.default,Promise.all([o.e("css_style_css").then(o.bind(o,5892)),o.e("vendors-node_modules_video_js_dist_video-js_css").then(o.bind(o,5054))]).then((function(){c.UI.show()}))}))},hidePlayer:function(){null!==c.player&&!1!==c.player&&null===c.inline&&(c.player.dispose(),c.player=!1,c.UI.hide())},log:function(t){n.log(t)}};document.addEventListener("DOMContentLoaded",(function(){if(document.addEventListener("keyup",(function(t){(void 0!==t.key&&"Escape"===t.key||void 0!==t.keyCode&&27===t.keyCode)&&c.hidePlayer()})),document.getElementById("body-public")&&document.getElementById("imgframe"))for(var t=document.getElementById("mimetype").value,e=0;e<c.mimeTypes.length;++e)if(c.mimeTypes[e]===t){var r=window.location.href.split("?")[0]+"/download";c.onViewInline(document.getElementById("imgframe"),r,t);break}}))})()})();
-//# sourceMappingURL=files_videoplayer-main.js.map?v=34a514faf95077aaeba1 \ No newline at end of file
+(()=>{var t,e,r={6453:(t,e,r)=>{"use strict";e.j=function(t,e,r){var n=document.querySelector("#initial-state-".concat(t,"-").concat(e));if(null===n){if(void 0!==r)return r;throw new Error("Could not find initial state ".concat(e," of ").concat(t))}try{return JSON.parse(atob(n.value))}catch(r){throw new Error("Could not parse initial state ".concat(e," of ").concat(t))}},r(2222)},9282:(t,e,r)=>{"use strict";var n=r(4155),o=r(5108);function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}var a,c,u=r(2136).codes,l=u.ERR_AMBIGUOUS_ARGUMENT,f=u.ERR_INVALID_ARG_TYPE,s=u.ERR_INVALID_ARG_VALUE,p=u.ERR_INVALID_RETURN_VALUE,y=u.ERR_MISSING_ARGS,d=r(5961),g=r(9539).inspect,v=r(9539).types,b=v.isPromise,h=v.isRegExp,m=Object.assign?Object.assign:r(8091).assign,w=Object.is?Object.is:r(609);new Map;function O(){var t=r(9158);a=t.isDeepEqual,c=t.isDeepStrictEqual}var j=!1,S=t.exports=P,E={};function A(t){if(t.message instanceof Error)throw t.message;throw new d(t)}function x(t,e,r,n){if(!r){var o=!1;if(0===e)o=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var i=new d({actual:r,expected:!0,message:n,operator:"==",stackStartFn:t});throw i.generatedMessage=o,i}}function P(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];x.apply(void 0,[P,e.length].concat(e))}S.fail=function t(e,r,i,a,c){var u,l=arguments.length;if(0===l)u="Failed";else if(1===l)i=e,e=void 0;else{if(!1===j){j=!0;var f=n.emitWarning?n.emitWarning:o.warn.bind(o);f("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}2===l&&(a="!=")}if(i instanceof Error)throw i;var s={actual:e,expected:r,operator:void 0===a?"fail":a,stackStartFn:c||t};void 0!==i&&(s.message=i);var p=new d(s);throw u&&(p.message=u,p.generatedMessage=!0),p},S.AssertionError=d,S.ok=P,S.equal=function t(e,r,n){if(arguments.length<2)throw new y("actual","expected");e!=r&&A({actual:e,expected:r,message:n,operator:"==",stackStartFn:t})},S.notEqual=function t(e,r,n){if(arguments.length<2)throw new y("actual","expected");e==r&&A({actual:e,expected:r,message:n,operator:"!=",stackStartFn:t})},S.deepEqual=function t(e,r,n){if(arguments.length<2)throw new y("actual","expected");void 0===a&&O(),a(e,r)||A({actual:e,expected:r,message:n,operator:"deepEqual",stackStartFn:t})},S.notDeepEqual=function t(e,r,n){if(arguments.length<2)throw new y("actual","expected");void 0===a&&O(),a(e,r)&&A({actual:e,expected:r,message:n,operator:"notDeepEqual",stackStartFn:t})},S.deepStrictEqual=function t(e,r,n){if(arguments.length<2)throw new y("actual","expected");void 0===a&&O(),c(e,r)||A({actual:e,expected:r,message:n,operator:"deepStrictEqual",stackStartFn:t})},S.notDeepStrictEqual=function t(e,r,n){if(arguments.length<2)throw new y("actual","expected");void 0===a&&O();c(e,r)&&A({actual:e,expected:r,message:n,operator:"notDeepStrictEqual",stackStartFn:t})},S.strictEqual=function t(e,r,n){if(arguments.length<2)throw new y("actual","expected");w(e,r)||A({actual:e,expected:r,message:n,operator:"strictEqual",stackStartFn:t})},S.notStrictEqual=function t(e,r,n){if(arguments.length<2)throw new y("actual","expected");w(e,r)&&A({actual:e,expected:r,message:n,operator:"notStrictEqual",stackStartFn:t})};var k=function t(e,r,n){var o=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r.forEach((function(t){t in e&&(void 0!==n&&"string"==typeof n[t]&&h(e[t])&&e[t].test(n[t])?o[t]=n[t]:o[t]=e[t])}))};function _(t,e,r,n,o,i){if(!(r in t)||!c(t[r],e[r])){if(!n){var a=new k(t,o),u=new k(e,o,t),l=new d({actual:a,expected:u,operator:"deepStrictEqual",stackStartFn:i});throw l.actual=t,l.expected=e,l.operator=i.name,l}A({actual:t,expected:e,message:n,operator:i.name,stackStartFn:i})}}function T(t,e,r,n){if("function"!=typeof e){if(h(e))return e.test(t);if(2===arguments.length)throw new f("expected",["Function","RegExp"],e);if("object"!==i(t)||null===t){var o=new d({actual:t,expected:e,message:r,operator:"deepStrictEqual",stackStartFn:n});throw o.operator=n.name,o}var c=Object.keys(e);if(e instanceof Error)c.push("name","message");else if(0===c.length)throw new s("error",e,"may not be an empty object");return void 0===a&&O(),c.forEach((function(o){"string"==typeof t[o]&&h(e[o])&&e[o].test(t[o])||_(t,e,o,r,c,n)})),!0}return void 0!==e.prototype&&t instanceof e||!Error.isPrototypeOf(e)&&!0===e.call({},t)}function I(t){if("function"!=typeof t)throw new f("fn","Function",t);try{t()}catch(t){return t}return E}function F(t){return b(t)||null!==t&&"object"===i(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function R(t){return Promise.resolve().then((function(){var e;if("function"==typeof t){if(!F(e=t()))throw new p("instance of Promise","promiseFn",e)}else{if(!F(t))throw new f("promiseFn",["Function","Promise"],t);e=t}return Promise.resolve().then((function(){return e})).then((function(){return E})).catch((function(t){return t}))}))}function N(t,e,r,n){if("string"==typeof r){if(4===arguments.length)throw new f("error",["Object","Error","Function","RegExp"],r);if("object"===i(e)&&null!==e){if(e.message===r)throw new l("error/message",'The error message "'.concat(e.message,'" is identical to the message.'))}else if(e===r)throw new l("error/message",'The error "'.concat(e,'" is identical to the message.'));n=r,r=void 0}else if(null!=r&&"object"!==i(r)&&"function"!=typeof r)throw new f("error",["Object","Error","Function","RegExp"],r);if(e===E){var o="";r&&r.name&&(o+=" (".concat(r.name,")")),o+=n?": ".concat(n):".";var a="rejects"===t.name?"rejection":"exception";A({actual:void 0,expected:r,operator:t.name,message:"Missing expected ".concat(a).concat(o),stackStartFn:t})}if(r&&!T(e,r,n,t))throw e}function D(t,e,r,n){if(e!==E){if("string"==typeof r&&(n=r,r=void 0),!r||T(e,r)){var o=n?": ".concat(n):".",i="doesNotReject"===t.name?"rejection":"exception";A({actual:e,expected:r,operator:t.name,message:"Got unwanted ".concat(i).concat(o,"\n")+'Actual message: "'.concat(e&&e.message,'"'),stackStartFn:t})}throw e}}function U(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];x.apply(void 0,[U,e.length].concat(e))}S.throws=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];N.apply(void 0,[t,I(e)].concat(n))},S.rejects=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return R(e).then((function(e){return N.apply(void 0,[t,e].concat(n))}))},S.doesNotThrow=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];D.apply(void 0,[t,I(e)].concat(n))},S.doesNotReject=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return R(e).then((function(e){return D.apply(void 0,[t,e].concat(n))}))},S.ifError=function t(e){if(null!=e){var r="ifError got unwanted exception: ";"object"===i(e)&&"string"==typeof e.message?0===e.message.length&&e.constructor?r+=e.constructor.name:r+=e.message:r+=g(e);var n=new d({actual:e,expected:null,operator:"ifError",message:r,stackStartFn:t}),o=e.stack;if("string"==typeof o){var a=o.split("\n");a.shift();for(var c=n.stack.split("\n"),u=0;u<a.length;u++){var l=c.indexOf(a[u]);if(-1!==l){c=c.slice(0,l);break}}n.stack="".concat(c.join("\n"),"\n").concat(a.join("\n"))}throw n}},S.strict=m(U,S,{equal:S.strictEqual,deepEqual:S.deepStrictEqual,notEqual:S.notStrictEqual,notDeepEqual:S.notDeepStrictEqual}),S.strict.strict=S.strict},5961:(t,e,r)=>{"use strict";var n=r(4155);function o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function a(t,e){return!e||"object"!==y(e)&&"function"!=typeof e?c(t):e}function c(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function u(t){var e="function"==typeof Map?new Map:void 0;return u=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return f(t,arguments,p(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),s(n,t)},u(t)}function l(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function f(t,e,r){return f=l()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&s(o,r.prototype),o},f.apply(null,arguments)}function s(t,e){return s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},s(t,e)}function p(t){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},p(t)}function y(t){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},y(t)}var d=r(9539).inspect,g=r(2136).codes.ERR_INVALID_ARG_TYPE;function v(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}var b="",h="",m="",w="",O={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function j(t){var e=Object.keys(t),r=Object.create(Object.getPrototypeOf(t));return e.forEach((function(e){r[e]=t[e]})),Object.defineProperty(r,"message",{value:t.message}),r}function S(t){return d(t,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function E(t,e,r){var o="",i="",a=0,c="",u=!1,l=S(t),f=l.split("\n"),s=S(e).split("\n"),p=0,d="";if("strictEqual"===r&&"object"===y(t)&&"object"===y(e)&&null!==t&&null!==e&&(r="strictEqualObject"),1===f.length&&1===s.length&&f[0]!==s[0]){var g=f[0].length+s[0].length;if(g<=10){if(!("object"===y(t)&&null!==t||"object"===y(e)&&null!==e||0===t&&0===e))return"".concat(O[r],"\n\n")+"".concat(f[0]," !== ").concat(s[0],"\n")}else if("strictEqualObject"!==r){if(g<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;f[0][p]===s[0][p];)p++;p>2&&(d="\n ".concat(function(t,e){if(e=Math.floor(e),0==t.length||0==e)return"";var r=t.length*e;for(e=Math.floor(Math.log(e)/Math.log(2));e;)t+=t,e--;return t+t.substring(0,r-t.length)}(" ",p),"^"),p=0)}}}for(var j=f[f.length-1],E=s[s.length-1];j===E&&(p++<2?c="\n ".concat(j).concat(c):o=j,f.pop(),s.pop(),0!==f.length&&0!==s.length);)j=f[f.length-1],E=s[s.length-1];var A=Math.max(f.length,s.length);if(0===A){var x=l.split("\n");if(x.length>30)for(x[26]="".concat(b,"...").concat(w);x.length>27;)x.pop();return"".concat(O.notIdentical,"\n\n").concat(x.join("\n"),"\n")}p>3&&(c="\n".concat(b,"...").concat(w).concat(c),u=!0),""!==o&&(c="\n ".concat(o).concat(c),o="");var P=0,k=O[r]+"\n".concat(h,"+ actual").concat(w," ").concat(m,"- expected").concat(w),_=" ".concat(b,"...").concat(w," Lines skipped");for(p=0;p<A;p++){var T=p-a;if(f.length<p+1)T>1&&p>2&&(T>4?(i+="\n".concat(b,"...").concat(w),u=!0):T>3&&(i+="\n ".concat(s[p-2]),P++),i+="\n ".concat(s[p-1]),P++),a=p,o+="\n".concat(m,"-").concat(w," ").concat(s[p]),P++;else if(s.length<p+1)T>1&&p>2&&(T>4?(i+="\n".concat(b,"...").concat(w),u=!0):T>3&&(i+="\n ".concat(f[p-2]),P++),i+="\n ".concat(f[p-1]),P++),a=p,i+="\n".concat(h,"+").concat(w," ").concat(f[p]),P++;else{var I=s[p],F=f[p],R=F!==I&&(!v(F,",")||F.slice(0,-1)!==I);R&&v(I,",")&&I.slice(0,-1)===F&&(R=!1,F+=","),R?(T>1&&p>2&&(T>4?(i+="\n".concat(b,"...").concat(w),u=!0):T>3&&(i+="\n ".concat(f[p-2]),P++),i+="\n ".concat(f[p-1]),P++),a=p,i+="\n".concat(h,"+").concat(w," ").concat(F),o+="\n".concat(m,"-").concat(w," ").concat(I),P+=2):(i+=o,o="",1!==T&&0!==p||(i+="\n ".concat(F),P++))}if(P>20&&p<A-2)return"".concat(k).concat(_,"\n").concat(i,"\n").concat(b,"...").concat(w).concat(o,"\n")+"".concat(b,"...").concat(w)}return"".concat(k).concat(u?_:"","\n").concat(i).concat(o).concat(c).concat(d)}var A=function(t){function e(t){var r;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),"object"!==y(t)||null===t)throw new g("options","Object",t);var o=t.message,i=t.operator,u=t.stackStartFn,l=t.actual,f=t.expected,s=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=o)r=a(this,p(e).call(this,String(o)));else if(n.stderr&&n.stderr.isTTY&&(n.stderr&&n.stderr.getColorDepth&&1!==n.stderr.getColorDepth()?(b="",h="",w="",m=""):(b="",h="",w="",m="")),"object"===y(l)&&null!==l&&"object"===y(f)&&null!==f&&"stack"in l&&l instanceof Error&&"stack"in f&&f instanceof Error&&(l=j(l),f=j(f)),"deepStrictEqual"===i||"strictEqual"===i)r=a(this,p(e).call(this,E(l,f,i)));else if("notDeepStrictEqual"===i||"notStrictEqual"===i){var d=O[i],v=S(l).split("\n");if("notStrictEqual"===i&&"object"===y(l)&&null!==l&&(d=O.notStrictEqualObject),v.length>30)for(v[26]="".concat(b,"...").concat(w);v.length>27;)v.pop();r=1===v.length?a(this,p(e).call(this,"".concat(d," ").concat(v[0]))):a(this,p(e).call(this,"".concat(d,"\n\n").concat(v.join("\n"),"\n")))}else{var A=S(l),x="",P=O[i];"notDeepEqual"===i||"notEqual"===i?(A="".concat(O[i],"\n\n").concat(A)).length>1024&&(A="".concat(A.slice(0,1021),"...")):(x="".concat(S(f)),A.length>512&&(A="".concat(A.slice(0,509),"...")),x.length>512&&(x="".concat(x.slice(0,509),"...")),"deepEqual"===i||"equal"===i?A="".concat(P,"\n\n").concat(A,"\n\nshould equal\n\n"):x=" ".concat(i," ").concat(x)),r=a(this,p(e).call(this,"".concat(A).concat(x)))}return Error.stackTraceLimit=s,r.generatedMessage=!o,Object.defineProperty(c(r),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),r.code="ERR_ASSERTION",r.actual=l,r.expected=f,r.operator=i,Error.captureStackTrace&&Error.captureStackTrace(c(r),u),r.stack,r.name="AssertionError",a(r)}var r,u,l;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}(e,t),r=e,u=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:d.custom,value:function(t,e){return d(this,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){o(t,e,r[e])}))}return t}({},e,{customInspect:!1,depth:0}))}}],u&&i(r.prototype,u),l&&i(r,l),e}(u(Error));t.exports=A},2136:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){return!e||"object"!==n(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function a(t,e){return a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},a(t,e)}var c,u,l={};function f(t,e,r){r||(r=Error);var n=function(r){function n(r,a,c){var u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),u=o(this,i(n).call(this,function(t,r,n){return"string"==typeof e?e:e(t,r,n)}(r,a,c))),u.code=t,u}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&a(t,e)}(n,r),n}(r);l[t]=n}function s(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}f("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),f("ERR_INVALID_ARG_TYPE",(function(t,e,o){var i,a,u,l;if(void 0===c&&(c=r(9282)),c("string"==typeof t,"'name' must be a string"),"string"==typeof e&&(a="not ",e.substr(!u||u<0?0:+u,a.length)===a)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))l="The ".concat(t," ").concat(i," ").concat(s(e,"type"));else{var f=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";l='The "'.concat(t,'" ').concat(f," ").concat(i," ").concat(s(e,"type"))}return l+=". Received type ".concat(n(o))}),TypeError),f("ERR_INVALID_ARG_VALUE",(function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===u&&(u=r(9539));var o=u.inspect(e);return o.length>128&&(o="".concat(o.slice(0,128),"...")),"The argument '".concat(t,"' ").concat(n,". Received ").concat(o)}),TypeError,RangeError),f("ERR_INVALID_RETURN_VALUE",(function(t,e,r){var o;return o=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(t,' to be returned from the "').concat(e,'"')+" function but got ".concat(o,".")}),TypeError),f("ERR_MISSING_ARGS",(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];void 0===c&&(c=r(9282)),c(e.length>0,"At least one arg needs to be specified");var o="The ",i=e.length;switch(e=e.map((function(t){return'"'.concat(t,'"')})),i){case 1:o+="".concat(e[0]," argument");break;case 2:o+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:o+=e.slice(0,i-1).join(", "),o+=", and ".concat(e[i-1]," arguments")}return"".concat(o," must be specified")}),TypeError),t.exports.codes=l},9158:(t,e,r)=>{"use strict";function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(n=(a=c.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==c.return||c.return()}finally{if(o)throw i}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}var i=void 0!==/a/g.flags,a=function(t){var e=[];return t.forEach((function(t){return e.push(t)})),e},c=function(t){var e=[];return t.forEach((function(t,r){return e.push([r,t])})),e},u=Object.is?Object.is:r(609),l=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},f=Number.isNaN?Number.isNaN:r(360);function s(t){return t.call.bind(t)}var p=s(Object.prototype.hasOwnProperty),y=s(Object.prototype.propertyIsEnumerable),d=s(Object.prototype.toString),g=r(9539).types,v=g.isAnyArrayBuffer,b=g.isArrayBufferView,h=g.isDate,m=g.isMap,w=g.isRegExp,O=g.isSet,j=g.isNativeError,S=g.isBoxedPrimitive,E=g.isNumberObject,A=g.isStringObject,x=g.isBooleanObject,P=g.isBigIntObject,k=g.isSymbolObject,_=g.isFloat32Array,T=g.isFloat64Array;function I(t){if(0===t.length||t.length>10)return!0;for(var e=0;e<t.length;e++){var r=t.charCodeAt(e);if(r<48||r>57)return!0}return 10===t.length&&t>=Math.pow(2,32)}function F(t){return Object.keys(t).filter(I).concat(l(t).filter(Object.prototype.propertyIsEnumerable.bind(t)))}function R(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0}function N(t,e,r,n){if(t===e)return 0!==t||(!r||u(t,e));if(r){if("object"!==o(t))return"number"==typeof t&&f(t)&&f(e);if("object"!==o(e)||null===t||null===e)return!1;if(Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1}else{if(null===t||"object"!==o(t))return(null===e||"object"!==o(e))&&t==e;if(null===e||"object"!==o(e))return!1}var a,c,l,s,p=d(t);if(p!==d(e))return!1;if(Array.isArray(t)){if(t.length!==e.length)return!1;var y=F(t),g=F(e);return y.length===g.length&&U(t,e,r,n,1,y)}if("[object Object]"===p&&(!m(t)&&m(e)||!O(t)&&O(e)))return!1;if(h(t)){if(!h(e)||Date.prototype.getTime.call(t)!==Date.prototype.getTime.call(e))return!1}else if(w(t)){if(!w(e)||(l=t,s=e,!(i?l.source===s.source&&l.flags===s.flags:RegExp.prototype.toString.call(l)===RegExp.prototype.toString.call(s))))return!1}else if(j(t)||t instanceof Error){if(t.message!==e.message||t.name!==e.name)return!1}else{if(b(t)){if(r||!_(t)&&!T(t)){if(!function(t,e){return t.byteLength===e.byteLength&&0===R(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}(t,e))return!1}else if(!function(t,e){if(t.byteLength!==e.byteLength)return!1;for(var r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0}(t,e))return!1;var I=F(t),N=F(e);return I.length===N.length&&U(t,e,r,n,0,I)}if(O(t))return!(!O(e)||t.size!==e.size)&&U(t,e,r,n,2);if(m(t))return!(!m(e)||t.size!==e.size)&&U(t,e,r,n,3);if(v(t)){if(c=e,(a=t).byteLength!==c.byteLength||0!==R(new Uint8Array(a),new Uint8Array(c)))return!1}else if(S(t)&&!function(t,e){return E(t)?E(e)&&u(Number.prototype.valueOf.call(t),Number.prototype.valueOf.call(e)):A(t)?A(e)&&String.prototype.valueOf.call(t)===String.prototype.valueOf.call(e):x(t)?x(e)&&Boolean.prototype.valueOf.call(t)===Boolean.prototype.valueOf.call(e):P(t)?P(e)&&BigInt.prototype.valueOf.call(t)===BigInt.prototype.valueOf.call(e):k(e)&&Symbol.prototype.valueOf.call(t)===Symbol.prototype.valueOf.call(e)}(t,e))return!1}return U(t,e,r,n,0)}function D(t,e){return e.filter((function(e){return y(t,e)}))}function U(t,e,r,n,o,i){if(5===arguments.length){i=Object.keys(t);var a=Object.keys(e);if(i.length!==a.length)return!1}for(var c=0;c<i.length;c++)if(!p(e,i[c]))return!1;if(r&&5===arguments.length){var u=l(t);if(0!==u.length){var f=0;for(c=0;c<u.length;c++){var s=u[c];if(y(t,s)){if(!y(e,s))return!1;i.push(s),f++}else if(y(e,s))return!1}var d=l(e);if(u.length!==d.length&&D(e,d).length!==f)return!1}else{var g=l(e);if(0!==g.length&&0!==D(e,g).length)return!1}}if(0===i.length&&(0===o||1===o&&0===t.length||0===t.size))return!0;if(void 0===n)n={val1:new Map,val2:new Map,position:0};else{var v=n.val1.get(t);if(void 0!==v){var b=n.val2.get(e);if(void 0!==b)return v===b}n.position++}n.val1.set(t,n.position),n.val2.set(e,n.position);var h=G(t,e,r,i,n,o);return n.val1.delete(t),n.val2.delete(e),h}function M(t,e,r,n){for(var o=a(t),i=0;i<o.length;i++){var c=o[i];if(N(e,c,r,n))return t.delete(c),!0}return!1}function B(t){switch(o(t)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":t=+t;case"number":if(f(t))return!1}return!0}function q(t,e,r){var n=B(r);return null!=n?n:e.has(n)&&!t.has(n)}function C(t,e,r,n,o){var i=B(r);if(null!=i)return i;var a=e.get(i);return!(void 0===a&&!e.has(i)||!N(n,a,!1,o))&&(!t.has(i)&&N(n,a,!1,o))}function L(t,e,r,n,o,i){for(var c=a(t),u=0;u<c.length;u++){var l=c[u];if(N(r,l,o,i)&&N(n,e.get(l),o,i))return t.delete(l),!0}return!1}function G(t,e,r,i,u,l){var f=0;if(2===l){if(!function(t,e,r,n){for(var i=null,c=a(t),u=0;u<c.length;u++){var l=c[u];if("object"===o(l)&&null!==l)null===i&&(i=new Set),i.add(l);else if(!e.has(l)){if(r)return!1;if(!q(t,e,l))return!1;null===i&&(i=new Set),i.add(l)}}if(null!==i){for(var f=a(e),s=0;s<f.length;s++){var p=f[s];if("object"===o(p)&&null!==p){if(!M(i,p,r,n))return!1}else if(!r&&!t.has(p)&&!M(i,p,r,n))return!1}return 0===i.size}return!0}(t,e,r,u))return!1}else if(3===l){if(!function(t,e,r,i){for(var a=null,u=c(t),l=0;l<u.length;l++){var f=n(u[l],2),s=f[0],p=f[1];if("object"===o(s)&&null!==s)null===a&&(a=new Set),a.add(s);else{var y=e.get(s);if(void 0===y&&!e.has(s)||!N(p,y,r,i)){if(r)return!1;if(!C(t,e,s,p,i))return!1;null===a&&(a=new Set),a.add(s)}}}if(null!==a){for(var d=c(e),g=0;g<d.length;g++){var v=n(d[g],2),b=(s=v[0],v[1]);if("object"===o(s)&&null!==s){if(!L(a,t,s,b,r,i))return!1}else if(!(r||t.has(s)&&N(t.get(s),b,!1,i)||L(a,t,s,b,!1,i)))return!1}return 0===a.size}return!0}(t,e,r,u))return!1}else if(1===l)for(;f<t.length;f++){if(!p(t,f)){if(p(e,f))return!1;for(var s=Object.keys(t);f<s.length;f++){var y=s[f];if(!p(e,y)||!N(t[y],e[y],r,u))return!1}return s.length===Object.keys(e).length}if(!p(e,f)||!N(t[f],e[f],r,u))return!1}for(f=0;f<i.length;f++){var d=i[f];if(!N(t[d],e[d],r,u))return!1}return!0}t.exports={isDeepEqual:function(t,e){return N(t,e,false)},isDeepStrictEqual:function(t,e){return N(t,e,true)}}},1924:(t,e,r)=>{"use strict";var n=r(210),o=r(5559),i=o(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&i(t,".prototype.")>-1?o(r):r}},5559:(t,e,r)=>{"use strict";var n=r(8612),o=r(210),i=o("%Function.prototype.apply%"),a=o("%Function.prototype.call%"),c=o("%Reflect.apply%",!0)||n.call(a,i),u=o("%Object.getOwnPropertyDescriptor%",!0),l=o("%Object.defineProperty%",!0),f=o("%Math.max%");if(l)try{l({},"a",{value:1})}catch(t){l=null}t.exports=function(t){var e=c(n,a,arguments);if(u&&l){var r=u(e,"length");r.configurable&&l(e,"length",{value:1+f(0,t.length-(arguments.length-1))})}return e};var s=function(){return c(n,i,arguments)};l?l(t.exports,"apply",{value:s}):t.exports.apply=s},5108:(t,e,r)=>{var n=r(9539),o=r(9282);function i(){return(new Date).getTime()}var a,c=Array.prototype.slice,u={};a=void 0!==r.g&&r.g.console?r.g.console:"undefined"!=typeof window&&window.console?window.console:{};for(var l=[[function(){},"log"],[function(){a.log.apply(a,arguments)},"info"],[function(){a.log.apply(a,arguments)},"warn"],[function(){a.warn.apply(a,arguments)},"error"],[function(t){u[t]=i()},"time"],[function(t){var e=u[t];if(!e)throw new Error("No such label: "+t);delete u[t];var r=i()-e;a.log(t+": "+r+"ms")},"timeEnd"],[function(){var t=new Error;t.name="Trace",t.message=n.format.apply(null,arguments),a.error(t.stack)},"trace"],[function(t){a.log(n.inspect(t)+"\n")},"dir"],[function(t){if(!t){var e=c.call(arguments,1);o.ok(!1,n.format.apply(null,e))}},"assert"]],f=0;f<l.length;f++){var s=l[f],p=s[0],y=s[1];a[y]||(a[y]=p)}t.exports=a},9662:(t,e,r)=>{var n=r(7854),o=r(614),i=r(6330),a=n.TypeError;t.exports=function(t){if(o(t))return t;throw a(i(t)+" is not a function")}},9670:(t,e,r)=>{var n=r(7854),o=r(111),i=n.String,a=n.TypeError;t.exports=function(t){if(o(t))return t;throw a(i(t)+" is not an object")}},1318:(t,e,r)=>{var n=r(5656),o=r(1400),i=r(6244),a=function(t){return function(e,r,a){var c,u=n(e),l=i(u),f=o(a,l);if(t&&r!=r){for(;l>f;)if((c=u[f++])!=c)return!0}else for(;l>f;f++)if((t||f in u)&&u[f]===r)return t||f||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},1194:(t,e,r)=>{var n=r(7293),o=r(5112),i=r(7392),a=o("species");t.exports=function(t){return i>=51||!n((function(){var e=[];return(e.constructor={})[a]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},7475:(t,e,r)=>{var n=r(7854),o=r(3157),i=r(4411),a=r(111),c=r(5112)("species"),u=n.Array;t.exports=function(t){var e;return o(t)&&(e=t.constructor,(i(e)&&(e===u||o(e.prototype))||a(e)&&null===(e=e[c]))&&(e=void 0)),void 0===e?u:e}},5417:(t,e,r)=>{var n=r(7475);t.exports=function(t,e){return new(n(t))(0===e?0:e)}},4326:(t,e,r)=>{var n=r(1702),o=n({}.toString),i=n("".slice);t.exports=function(t){return i(o(t),8,-1)}},648:(t,e,r)=>{var n=r(7854),o=r(1694),i=r(614),a=r(4326),c=r(5112)("toStringTag"),u=n.Object,l="Arguments"==a(function(){return arguments}());t.exports=o?a:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=u(t),c))?r:l?a(e):"Object"==(n=a(e))&&i(e.callee)?"Arguments":n}},9920:(t,e,r)=>{var n=r(2597),o=r(3887),i=r(1236),a=r(3070);t.exports=function(t,e,r){for(var c=o(e),u=a.f,l=i.f,f=0;f<c.length;f++){var s=c[f];n(t,s)||r&&n(r,s)||u(t,s,l(e,s))}}},8880:(t,e,r)=>{var n=r(9781),o=r(3070),i=r(9114);t.exports=n?function(t,e,r){return o.f(t,e,i(1,r))}:function(t,e,r){return t[e]=r,t}},9114:t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},6135:(t,e,r)=>{"use strict";var n=r(4948),o=r(3070),i=r(9114);t.exports=function(t,e,r){var a=n(e);a in t?o.f(t,a,i(0,r)):t[a]=r}},8052:(t,e,r)=>{var n=r(7854),o=r(614),i=r(8880),a=r(6339),c=r(3505);t.exports=function(t,e,r,u){var l=!!u&&!!u.unsafe,f=!!u&&!!u.enumerable,s=!!u&&!!u.noTargetGet,p=u&&void 0!==u.name?u.name:e;return o(r)&&a(r,p,u),t===n?(f?t[e]=r:c(e,r),t):(l?!s&&t[e]&&(f=!0):delete t[e],f?t[e]=r:i(t,e,r),t)}},9781:(t,e,r)=>{var n=r(7293);t.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},317:(t,e,r)=>{var n=r(7854),o=r(111),i=n.document,a=o(i)&&o(i.createElement);t.exports=function(t){return a?i.createElement(t):{}}},8113:(t,e,r)=>{var n=r(5005);t.exports=n("navigator","userAgent")||""},7392:(t,e,r)=>{var n,o,i=r(7854),a=r(8113),c=i.process,u=i.Deno,l=c&&c.versions||u&&u.version,f=l&&l.v8;f&&(o=(n=f.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!o&&a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(o=+n[1]),t.exports=o},748:t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2109:(t,e,r)=>{var n=r(7854),o=r(1236).f,i=r(8880),a=r(8052),c=r(3505),u=r(9920),l=r(4705);t.exports=function(t,e){var r,f,s,p,y,d=t.target,g=t.global,v=t.stat;if(r=g?n:v?n[d]||c(d,{}):(n[d]||{}).prototype)for(f in e){if(p=e[f],s=t.noTargetGet?(y=o(r,f))&&y.value:r[f],!l(g?f:d+(v?".":"#")+f,t.forced)&&void 0!==s){if(typeof p==typeof s)continue;u(p,s)}(t.sham||s&&s.sham)&&i(p,"sham",!0),a(r,f,p,t)}}},7293:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},4374:(t,e,r)=>{var n=r(7293);t.exports=!n((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},6916:(t,e,r)=>{var n=r(4374),o=Function.prototype.call;t.exports=n?o.bind(o):function(){return o.apply(o,arguments)}},6530:(t,e,r)=>{var n=r(9781),o=r(2597),i=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,c=o(i,"name"),u=c&&"something"===function(){}.name,l=c&&(!n||n&&a(i,"name").configurable);t.exports={EXISTS:c,PROPER:u,CONFIGURABLE:l}},1702:(t,e,r)=>{var n=r(4374),o=Function.prototype,i=o.bind,a=o.call,c=n&&i.bind(a,a);t.exports=n?function(t){return t&&c(t)}:function(t){return t&&function(){return a.apply(t,arguments)}}},5005:(t,e,r)=>{var n=r(7854),o=r(614),i=function(t){return o(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?i(n[t]):n[t]&&n[t][e]}},8173:(t,e,r)=>{var n=r(9662);t.exports=function(t,e){var r=t[e];return null==r?void 0:n(r)}},7854:(t,e,r)=>{var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||function(){return this}()||Function("return this")()},2597:(t,e,r)=>{var n=r(1702),o=r(7908),i=n({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return i(o(t),e)}},3501:t=>{t.exports={}},4664:(t,e,r)=>{var n=r(9781),o=r(7293),i=r(317);t.exports=!n&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},8361:(t,e,r)=>{var n=r(7854),o=r(1702),i=r(7293),a=r(4326),c=n.Object,u=o("".split);t.exports=i((function(){return!c("z").propertyIsEnumerable(0)}))?function(t){return"String"==a(t)?u(t,""):c(t)}:c},2788:(t,e,r)=>{var n=r(1702),o=r(614),i=r(5465),a=n(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return a(t)}),t.exports=i.inspectSource},9909:(t,e,r)=>{var n,o,i,a=r(8536),c=r(7854),u=r(1702),l=r(111),f=r(8880),s=r(2597),p=r(5465),y=r(6200),d=r(3501),g="Object already initialized",v=c.TypeError,b=c.WeakMap;if(a||p.state){var h=p.state||(p.state=new b),m=u(h.get),w=u(h.has),O=u(h.set);n=function(t,e){if(w(h,t))throw new v(g);return e.facade=t,O(h,t,e),e},o=function(t){return m(h,t)||{}},i=function(t){return w(h,t)}}else{var j=y("state");d[j]=!0,n=function(t,e){if(s(t,j))throw new v(g);return e.facade=t,f(t,j,e),e},o=function(t){return s(t,j)?t[j]:{}},i=function(t){return s(t,j)}}t.exports={set:n,get:o,has:i,enforce:function(t){return i(t)?o(t):n(t,{})},getterFor:function(t){return function(e){var r;if(!l(e)||(r=o(e)).type!==t)throw v("Incompatible receiver, "+t+" required");return r}}}},3157:(t,e,r)=>{var n=r(4326);t.exports=Array.isArray||function(t){return"Array"==n(t)}},614:t=>{t.exports=function(t){return"function"==typeof t}},4411:(t,e,r)=>{var n=r(1702),o=r(7293),i=r(614),a=r(648),c=r(5005),u=r(2788),l=function(){},f=[],s=c("Reflect","construct"),p=/^\s*(?:class|function)\b/,y=n(p.exec),d=!p.exec(l),g=function(t){if(!i(t))return!1;try{return s(l,f,t),!0}catch(t){return!1}},v=function(t){if(!i(t))return!1;switch(a(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return d||!!y(p,u(t))}catch(t){return!0}};v.sham=!0,t.exports=!s||o((function(){var t;return g(g.call)||!g(Object)||!g((function(){t=!0}))||t}))?v:g},4705:(t,e,r)=>{var n=r(7293),o=r(614),i=/#|\.prototype\./,a=function(t,e){var r=u[c(t)];return r==f||r!=l&&(o(e)?n(e):!!e)},c=a.normalize=function(t){return String(t).replace(i,".").toLowerCase()},u=a.data={},l=a.NATIVE="N",f=a.POLYFILL="P";t.exports=a},111:(t,e,r)=>{var n=r(614);t.exports=function(t){return"object"==typeof t?null!==t:n(t)}},1913:t=>{t.exports=!1},2190:(t,e,r)=>{var n=r(7854),o=r(5005),i=r(614),a=r(7976),c=r(3307),u=n.Object;t.exports=c?function(t){return"symbol"==typeof t}:function(t){var e=o("Symbol");return i(e)&&a(e.prototype,u(t))}},6244:(t,e,r)=>{var n=r(7466);t.exports=function(t){return n(t.length)}},6339:(t,e,r)=>{var n=r(7293),o=r(614),i=r(2597),a=r(3070).f,c=r(6530).CONFIGURABLE,u=r(2788),l=r(9909),f=l.enforce,s=l.get,p=!n((function(){return 8!==a((function(){}),"length",{value:8}).length})),y=String(String).split("String"),d=t.exports=function(t,e,r){"Symbol("===String(e).slice(0,7)&&(e="["+String(e).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!i(t,"name")||c&&t.name!==e)&&a(t,"name",{value:e,configurable:!0}),p&&r&&i(r,"arity")&&t.length!==r.arity&&a(t,"length",{value:r.arity});var n=f(t);return i(n,"source")||(n.source=y.join("string"==typeof e?e:"")),t};Function.prototype.toString=d((function(){return o(this)&&s(this).source||u(this)}),"toString")},133:(t,e,r)=>{var n=r(7392),o=r(7293);t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},8536:(t,e,r)=>{var n=r(7854),o=r(614),i=r(2788),a=n.WeakMap;t.exports=o(a)&&/native code/.test(i(a))},3070:(t,e,r)=>{var n=r(7854),o=r(9781),i=r(4664),a=r(3353),c=r(9670),u=r(4948),l=n.TypeError,f=Object.defineProperty,s=Object.getOwnPropertyDescriptor,p="enumerable",y="configurable",d="writable";e.f=o?a?function(t,e,r){if(c(t),e=u(e),c(r),"function"==typeof t&&"prototype"===e&&"value"in r&&d in r&&!r.writable){var n=s(t,e);n&&n.writable&&(t[e]=r.value,r={configurable:y in r?r.configurable:n.configurable,enumerable:p in r?r.enumerable:n.enumerable,writable:!1})}return f(t,e,r)}:f:function(t,e,r){if(c(t),e=u(e),c(r),i)try{return f(t,e,r)}catch(t){}if("get"in r||"set"in r)throw l("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},1236:(t,e,r)=>{var n=r(9781),o=r(6916),i=r(5296),a=r(9114),c=r(5656),u=r(4948),l=r(2597),f=r(4664),s=Object.getOwnPropertyDescriptor;e.f=n?s:function(t,e){if(t=c(t),e=u(e),f)try{return s(t,e)}catch(t){}if(l(t,e))return a(!o(i.f,t,e),t[e])}},8006:(t,e,r)=>{var n=r(6324),o=r(748).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return n(t,o)}},5181:(t,e)=>{e.f=Object.getOwnPropertySymbols},7976:(t,e,r)=>{var n=r(1702);t.exports=n({}.isPrototypeOf)},6324:(t,e,r)=>{var n=r(1702),o=r(2597),i=r(5656),a=r(1318).indexOf,c=r(3501),u=n([].push);t.exports=function(t,e){var r,n=i(t),l=0,f=[];for(r in n)!o(c,r)&&o(n,r)&&u(f,r);for(;e.length>l;)o(n,r=e[l++])&&(~a(f,r)||u(f,r));return f}},5296:(t,e)=>{"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,o=n&&!r.call({1:2},1);e.f=o?function(t){var e=n(this,t);return!!e&&e.enumerable}:r},2140:(t,e,r)=>{var n=r(7854),o=r(6916),i=r(614),a=r(111),c=n.TypeError;t.exports=function(t,e){var r,n;if("string"===e&&i(r=t.toString)&&!a(n=o(r,t)))return n;if(i(r=t.valueOf)&&!a(n=o(r,t)))return n;if("string"!==e&&i(r=t.toString)&&!a(n=o(r,t)))return n;throw c("Can't convert object to primitive value")}},3887:(t,e,r)=>{var n=r(5005),o=r(1702),i=r(8006),a=r(5181),c=r(9670),u=o([].concat);t.exports=n("Reflect","ownKeys")||function(t){var e=i.f(c(t)),r=a.f;return r?u(e,r(t)):e}},4488:(t,e,r)=>{var n=r(7854).TypeError;t.exports=function(t){if(null==t)throw n("Can't call method on "+t);return t}},3505:(t,e,r)=>{var n=r(7854),o=Object.defineProperty;t.exports=function(t,e){try{o(n,t,{value:e,configurable:!0,writable:!0})}catch(r){n[t]=e}return e}},6200:(t,e,r)=>{var n=r(2309),o=r(9711),i=n("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},5465:(t,e,r)=>{var n=r(7854),o=r(3505),i="__core-js_shared__",a=n[i]||o(i,{});t.exports=a},2309:(t,e,r)=>{var n=r(1913),o=r(5465);(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.22.4",mode:n?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.22.4/LICENSE",source:"https://github.com/zloirock/core-js"})},1400:(t,e,r)=>{var n=r(9303),o=Math.max,i=Math.min;t.exports=function(t,e){var r=n(t);return r<0?o(r+e,0):i(r,e)}},5656:(t,e,r)=>{var n=r(8361),o=r(4488);t.exports=function(t){return n(o(t))}},9303:t=>{var e=Math.ceil,r=Math.floor;t.exports=function(t){var n=+t;return n!=n||0===n?0:(n>0?r:e)(n)}},7466:(t,e,r)=>{var n=r(9303),o=Math.min;t.exports=function(t){return t>0?o(n(t),9007199254740991):0}},7908:(t,e,r)=>{var n=r(7854),o=r(4488),i=n.Object;t.exports=function(t){return i(o(t))}},7593:(t,e,r)=>{var n=r(7854),o=r(6916),i=r(111),a=r(2190),c=r(8173),u=r(2140),l=r(5112),f=n.TypeError,s=l("toPrimitive");t.exports=function(t,e){if(!i(t)||a(t))return t;var r,n=c(t,s);if(n){if(void 0===e&&(e="default"),r=o(n,t,e),!i(r)||a(r))return r;throw f("Can't convert object to primitive value")}return void 0===e&&(e="number"),u(t,e)}},4948:(t,e,r)=>{var n=r(7593),o=r(2190);t.exports=function(t){var e=n(t,"string");return o(e)?e:e+""}},1694:(t,e,r)=>{var n={};n[r(5112)("toStringTag")]="z",t.exports="[object z]"===String(n)},6330:(t,e,r)=>{var n=r(7854).String;t.exports=function(t){try{return n(t)}catch(t){return"Object"}}},9711:(t,e,r)=>{var n=r(1702),o=0,i=Math.random(),a=n(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++o+i,36)}},3307:(t,e,r)=>{var n=r(133);t.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},3353:(t,e,r)=>{var n=r(9781),o=r(7293);t.exports=n&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},5112:(t,e,r)=>{var n=r(7854),o=r(2309),i=r(2597),a=r(9711),c=r(133),u=r(3307),l=o("wks"),f=n.Symbol,s=f&&f.for,p=u?f:f&&f.withoutSetter||a;t.exports=function(t){if(!i(l,t)||!c&&"string"!=typeof l[t]){var e="Symbol."+t;c&&i(f,t)?l[t]=f[t]:l[t]=u&&s?s(e):p(e)}return l[t]}},2222:(t,e,r)=>{"use strict";var n=r(2109),o=r(7854),i=r(7293),a=r(3157),c=r(111),u=r(7908),l=r(6244),f=r(6135),s=r(5417),p=r(1194),y=r(5112),d=r(7392),g=y("isConcatSpreadable"),v=9007199254740991,b="Maximum allowed index exceeded",h=o.TypeError,m=d>=51||!i((function(){var t=[];return t[g]=!1,t.concat()[0]!==t})),w=p("concat"),O=function(t){if(!c(t))return!1;var e=t[g];return void 0!==e?!!e:a(t)};n({target:"Array",proto:!0,arity:1,forced:!m||!w},{concat:function(t){var e,r,n,o,i,a=u(this),c=s(a,0),p=0;for(e=-1,n=arguments.length;e<n;e++)if(O(i=-1===e?a:arguments[e])){if(p+(o=l(i))>v)throw h(b);for(r=0;r<o;r++,p++)r in i&&f(c,p,i[r])}else{if(p>=v)throw h(b);f(c,p++,i)}return c.length=p,c}})},4289:(t,e,r)=>{"use strict";var n=r(2215),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,c=Object.defineProperty,u=c&&function(){var t={};try{for(var e in c(t,"x",{enumerable:!1,value:t}),t)return!1;return t.x===t}catch(t){return!1}}(),l=function(t,e,r,n){var o;(!(e in t)||"function"==typeof(o=n)&&"[object Function]"===i.call(o)&&n())&&(u?c(t,e,{configurable:!0,enumerable:!1,value:r,writable:!0}):t[e]=r)},f=function(t,e){var r=arguments.length>2?arguments[2]:{},i=n(e);o&&(i=a.call(i,Object.getOwnPropertySymbols(e)));for(var c=0;c<i.length;c+=1)l(t,i[c],e[i[c]],r[i[c]])};f.supportsDescriptors=!!u,t.exports=f},8091:t=>{"use strict";function e(t,e){if(null==t)throw new TypeError("Cannot convert first argument to object");for(var r=Object(t),n=1;n<arguments.length;n++){var o=arguments[n];if(null!=o)for(var i=Object.keys(Object(o)),a=0,c=i.length;a<c;a++){var u=i[a],l=Object.getOwnPropertyDescriptor(o,u);void 0!==l&&l.enumerable&&(r[u]=o[u])}}return r}t.exports={assign:e,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:e})}}},5573:t=>{"use strict";var e=/["'&<>]/;t.exports=function(t){var r,n=""+t,o=e.exec(n);if(!o)return n;var i="",a=0,c=0;for(a=o.index;a<n.length;a++){switch(n.charCodeAt(a)){case 34:r="&quot;";break;case 38:r="&amp;";break;case 39:r="&#39;";break;case 60:r="&lt;";break;case 62:r="&gt;";break;default:continue}c!==a&&(i+=n.substring(c,a)),c=a+1,i+=r}return c!==a?i+n.substring(c,a):i}},9804:t=>{var e=Object.prototype.hasOwnProperty,r=Object.prototype.toString;t.exports=function(t,n,o){if("[object Function]"!==r.call(n))throw new TypeError("iterator must be a function");var i=t.length;if(i===+i)for(var a=0;a<i;a++)n.call(o,t[a],a,t);else for(var c in t)e.call(t,c)&&n.call(o,t[c],c,t)}},7648:t=>{"use strict";var e="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,o="[object Function]";t.exports=function(t){var i=this;if("function"!=typeof i||n.call(i)!==o)throw new TypeError(e+i);for(var a,c=r.call(arguments,1),u=function(){if(this instanceof a){var e=i.apply(this,c.concat(r.call(arguments)));return Object(e)===e?e:this}return i.apply(t,c.concat(r.call(arguments)))},l=Math.max(0,i.length-c.length),f=[],s=0;s<l;s++)f.push("$"+s);if(a=Function("binder","return function ("+f.join(",")+"){ return binder.apply(this,arguments); }")(u),i.prototype){var p=function(){};p.prototype=i.prototype,a.prototype=new p,p.prototype=null}return a}},8612:(t,e,r)=>{"use strict";var n=r(7648);t.exports=Function.prototype.bind||n},210:(t,e,r)=>{"use strict";var n,o=SyntaxError,i=Function,a=TypeError,c=function(t){try{return i('"use strict"; return ('+t+").constructor;")()}catch(t){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(t){u=null}var l=function(){throw new a},f=u?function(){try{return l}catch(t){try{return u(arguments,"callee").get}catch(t){return l}}}():l,s=r(1405)(),p=Object.getPrototypeOf||function(t){return t.__proto__},y={},d="undefined"==typeof Uint8Array?n:p(Uint8Array),g={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":s?p([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":y,"%AsyncGenerator%":y,"%AsyncGeneratorFunction%":y,"%AsyncIteratorPrototype%":y,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":y,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":s?p(p([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&s?p((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&s?p((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":s?p(""[Symbol.iterator]()):n,"%Symbol%":s?Symbol:n,"%SyntaxError%":o,"%ThrowTypeError%":f,"%TypedArray%":d,"%TypeError%":a,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},v=function t(e){var r;if("%AsyncFunction%"===e)r=c("async function () {}");else if("%GeneratorFunction%"===e)r=c("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=c("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&(r=p(o.prototype))}return g[e]=r,r},b={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},h=r(8612),m=r(7642),w=h.call(Function.call,Array.prototype.concat),O=h.call(Function.apply,Array.prototype.splice),j=h.call(Function.call,String.prototype.replace),S=h.call(Function.call,String.prototype.slice),E=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,A=/\\(\\)?/g,x=function(t){var e=S(t,0,1),r=S(t,-1);if("%"===e&&"%"!==r)throw new o("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new o("invalid intrinsic syntax, expected opening `%`");var n=[];return j(t,E,(function(t,e,r,o){n[n.length]=r?j(o,A,"$1"):e||t})),n},P=function(t,e){var r,n=t;if(m(b,n)&&(n="%"+(r=b[n])[0]+"%"),m(g,n)){var i=g[n];if(i===y&&(i=v(n)),void 0===i&&!e)throw new a("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new o("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new a('"allowMissing" argument must be a boolean');var r=x(t),n=r.length>0?r[0]:"",i=P("%"+n+"%",e),c=i.name,l=i.value,f=!1,s=i.alias;s&&(n=s[0],O(r,w([0,1],s)));for(var p=1,y=!0;p<r.length;p+=1){var d=r[p],v=S(d,0,1),b=S(d,-1);if(('"'===v||"'"===v||"`"===v||'"'===b||"'"===b||"`"===b)&&v!==b)throw new o("property names with quotes must have matching quotes");if("constructor"!==d&&y||(f=!0),m(g,c="%"+(n+="."+d)+"%"))l=g[c];else if(null!=l){if(!(d in l)){if(!e)throw new a("base intrinsic for "+t+" exists, but the property is not available.");return}if(u&&p+1>=r.length){var h=u(l,d);l=(y=!!h)&&"get"in h&&!("originalValue"in h.get)?h.get:l[d]}else y=m(l,d),l=l[d];y&&!f&&(g[c]=l)}}return l}},1405:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(5419);t.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&o())))}},5419:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},6410:(t,e,r)=>{"use strict";var n=r(5419);t.exports=function(){return n()&&!!Symbol.toStringTag}},7642:(t,e,r)=>{"use strict";var n=r(8612);t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},5717:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},2584:(t,e,r)=>{"use strict";var n=r(6410)(),o=r(1924)("Object.prototype.toString"),i=function(t){return!(n&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===o(t)},a=function(t){return!!i(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==o(t)&&"[object Function]"===o(t.callee)},c=function(){return i(arguments)}();i.isLegacyArguments=a,t.exports=c?i:a},8662:(t,e,r)=>{"use strict";var n,o=Object.prototype.toString,i=Function.prototype.toString,a=/^\s*(?:function)?\*/,c=r(6410)(),u=Object.getPrototypeOf;t.exports=function(t){if("function"!=typeof t)return!1;if(a.test(i.call(t)))return!0;if(!c)return"[object GeneratorFunction]"===o.call(t);if(!u)return!1;if(void 0===n){var e=function(){if(!c)return!1;try{return Function("return function*() {}")()}catch(t){}}();n=!!e&&u(e)}return u(t)===n}},8611:t=>{"use strict";t.exports=function(t){return t!=t}},360:(t,e,r)=>{"use strict";var n=r(5559),o=r(4289),i=r(8611),a=r(9415),c=r(3194),u=n(a(),Number);o(u,{getPolyfill:a,implementation:i,shim:c}),t.exports=u},9415:(t,e,r)=>{"use strict";var n=r(8611);t.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},3194:(t,e,r)=>{"use strict";var n=r(4289),o=r(9415);t.exports=function(){var t=o();return n(Number,{isNaN:t},{isNaN:function(){return Number.isNaN!==t}}),t}},5692:(t,e,r)=>{"use strict";var n=r(9804),o=r(3083),i=r(1924),a=i("Object.prototype.toString"),c=r(6410)(),u=o(),l=i("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r<t.length;r+=1)if(t[r]===e)return r;return-1},f=i("String.prototype.slice"),s={},p=r(882),y=Object.getPrototypeOf;c&&p&&y&&n(u,(function(t){var e=new r.g[t];if(!(Symbol.toStringTag in e))throw new EvalError("this engine has support for Symbol.toStringTag, but "+t+" does not have the property! Please report this.");var n=y(e),o=p(n,Symbol.toStringTag);if(!o){var i=y(n);o=p(i,Symbol.toStringTag)}s[t]=o.get}));t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(!c){var e=f(a(t),8,-1);return l(u,e)>-1}return!!p&&function(t){var e=!1;return n(s,(function(r,n){if(!e)try{e=r.call(t)===n}catch(t){}})),e}(t)}},4244:t=>{"use strict";var e=function(t){return t!=t};t.exports=function(t,r){return 0===t&&0===r?1/t==1/r:t===r||!(!e(t)||!e(r))}},609:(t,e,r)=>{"use strict";var n=r(4289),o=r(5559),i=r(4244),a=r(5624),c=r(2281),u=o(a(),Object);n(u,{getPolyfill:a,implementation:i,shim:c}),t.exports=u},5624:(t,e,r)=>{"use strict";var n=r(4244);t.exports=function(){return"function"==typeof Object.is?Object.is:n}},2281:(t,e,r)=>{"use strict";var n=r(5624),o=r(4289);t.exports=function(){var t=n();return o(Object,{is:t},{is:function(){return Object.is!==t}}),t}},8987:(t,e,r)=>{"use strict";var n;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=r(1414),c=Object.prototype.propertyIsEnumerable,u=!c.call({toString:null},"toString"),l=c.call((function(){}),"prototype"),f=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],s=function(t){var e=t.constructor;return e&&e.prototype===t},p={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!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},y=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!p["$"+t]&&o.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{s(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===i.call(t),n=a(t),c=e&&"[object String]"===i.call(t),p=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var d=l&&r;if(c&&t.length>0&&!o.call(t,0))for(var g=0;g<t.length;++g)p.push(String(g));if(n&&t.length>0)for(var v=0;v<t.length;++v)p.push(String(v));else for(var b in t)d&&"prototype"===b||!o.call(t,b)||p.push(String(b));if(u)for(var h=function(t){if("undefined"==typeof window||!y)return s(t);try{return s(t)}catch(t){return!1}}(t),m=0;m<f.length;++m)h&&"constructor"===f[m]||!o.call(t,f[m])||p.push(f[m]);return p}}t.exports=n},2215:(t,e,r)=>{"use strict";var n=Array.prototype.slice,o=r(1414),i=Object.keys,a=i?function(t){return i(t)}:r(8987),c=Object.keys;a.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return o(t)?c(n.call(t)):c(t)})}else Object.keys=a;return Object.keys||a},t.exports=a},1414:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},4155:t=>{var e,r,n=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(t){if(e===setTimeout)return setTimeout(t,0);if((e===o||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:o}catch(t){e=o}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(t){r=i}}();var c,u=[],l=!1,f=-1;function s(){l&&c&&(l=!1,c.length?u=c.concat(u):f=-1,u.length&&p())}function p(){if(!l){var t=a(s);l=!0;for(var e=u.length;e;){for(c=u,u=[];++f<e;)c&&c[f].run();f=-1,e=u.length}c=null,l=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function y(t,e){this.fun=t,this.array=e}function d(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new y(t,e)),1!==u.length||l||a(p)},y.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=d,n.addListener=d,n.once=d,n.off=d,n.removeListener=d,n.removeAllListeners=d,n.emit=d,n.prependListener=d,n.prependOnceListener=d,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},384:t=>{t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},5955:(t,e,r)=>{"use strict";var n=r(2584),o=r(8662),i=r(6430),a=r(5692);function c(t){return t.call.bind(t)}var u="undefined"!=typeof BigInt,l="undefined"!=typeof Symbol,f=c(Object.prototype.toString),s=c(Number.prototype.valueOf),p=c(String.prototype.valueOf),y=c(Boolean.prototype.valueOf);if(u)var d=c(BigInt.prototype.valueOf);if(l)var g=c(Symbol.prototype.valueOf);function v(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function b(t){return"[object Map]"===f(t)}function h(t){return"[object Set]"===f(t)}function m(t){return"[object WeakMap]"===f(t)}function w(t){return"[object WeakSet]"===f(t)}function O(t){return"[object ArrayBuffer]"===f(t)}function j(t){return"undefined"!=typeof ArrayBuffer&&(O.working?O(t):t instanceof ArrayBuffer)}function S(t){return"[object DataView]"===f(t)}function E(t){return"undefined"!=typeof DataView&&(S.working?S(t):t instanceof DataView)}e.isArgumentsObject=n,e.isGeneratorFunction=o,e.isTypedArray=a,e.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):a(t)||E(t)},e.isUint8Array=function(t){return"Uint8Array"===i(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===i(t)},e.isUint16Array=function(t){return"Uint16Array"===i(t)},e.isUint32Array=function(t){return"Uint32Array"===i(t)},e.isInt8Array=function(t){return"Int8Array"===i(t)},e.isInt16Array=function(t){return"Int16Array"===i(t)},e.isInt32Array=function(t){return"Int32Array"===i(t)},e.isFloat32Array=function(t){return"Float32Array"===i(t)},e.isFloat64Array=function(t){return"Float64Array"===i(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===i(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===i(t)},b.working="undefined"!=typeof Map&&b(new Map),e.isMap=function(t){return"undefined"!=typeof Map&&(b.working?b(t):t instanceof Map)},h.working="undefined"!=typeof Set&&h(new Set),e.isSet=function(t){return"undefined"!=typeof Set&&(h.working?h(t):t instanceof Set)},m.working="undefined"!=typeof WeakMap&&m(new WeakMap),e.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(m.working?m(t):t instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),e.isWeakSet=function(t){return w(t)},O.working="undefined"!=typeof ArrayBuffer&&O(new ArrayBuffer),e.isArrayBuffer=j,S.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&S(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=E;var A="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function x(t){return"[object SharedArrayBuffer]"===f(t)}function P(t){return void 0!==A&&(void 0===x.working&&(x.working=x(new A)),x.working?x(t):t instanceof A)}function k(t){return v(t,s)}function _(t){return v(t,p)}function T(t){return v(t,y)}function I(t){return u&&v(t,d)}function F(t){return l&&v(t,g)}e.isSharedArrayBuffer=P,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===f(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===f(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===f(t)},e.isGeneratorObject=function(t){return"[object Generator]"===f(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===f(t)},e.isNumberObject=k,e.isStringObject=_,e.isBooleanObject=T,e.isBigIntObject=I,e.isSymbolObject=F,e.isBoxedPrimitive=function(t){return k(t)||_(t)||T(t)||I(t)||F(t)},e.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(j(t)||P(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))},9539:(t,e,r)=>{var n=r(4155),o=r(5108),i=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++)r[e[n]]=Object.getOwnPropertyDescriptor(t,e[n]);return r},a=/%[sdj%]/g;e.format=function(t){if(!w(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(f(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,o=n.length,i=String(t).replace(a,(function(t){if("%%"===t)return"%";if(r>=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),c=n[r];r<o;c=n[++r])h(c)||!S(c)?i+=" "+c:i+=" "+f(c);return i},e.deprecate=function(t,r){if(void 0!==n&&!0===n.noDeprecation)return t;if(void 0===n)return function(){return e.deprecate(t,r).apply(this,arguments)};var i=!1;return function(){if(!i){if(n.throwDeprecation)throw new Error(r);n.traceDeprecation?o.trace(r):o.error(r),i=!0}return t.apply(this,arguments)}};var c={},u=/^$/;if(n.env.NODE_DEBUG){var l=n.env.NODE_DEBUG;l=l.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),u=new RegExp("^"+l+"$","i")}function f(t,r){var n={seen:[],stylize:p};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),b(r)?n.showHidden=r:r&&e._extend(n,r),O(n.showHidden)&&(n.showHidden=!1),O(n.depth)&&(n.depth=2),O(n.colors)&&(n.colors=!1),O(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=s),y(n,t,n.depth)}function s(t,e){var r=f.styles[e];return r?"["+f.colors[r][0]+"m"+t+"["+f.colors[r][1]+"m":t}function p(t,e){return t}function y(t,r,n){if(t.customInspect&&r&&x(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var o=r.inspect(n,t);return w(o)||(o=y(t,o,n)),o}var i=function(t,e){if(O(e))return t.stylize("undefined","undefined");if(w(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(m(e))return t.stylize(""+e,"number");if(b(e))return t.stylize(""+e,"boolean");if(h(e))return t.stylize("null","null")}(t,r);if(i)return i;var a=Object.keys(r),c=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(r)),A(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return d(r);if(0===a.length){if(x(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(j(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(E(r))return t.stylize(Date.prototype.toString.call(r),"date");if(A(r))return d(r)}var l,f="",s=!1,p=["{","}"];(v(r)&&(s=!0,p=["[","]"]),x(r))&&(f=" [Function"+(r.name?": "+r.name:"")+"]");return j(r)&&(f=" "+RegExp.prototype.toString.call(r)),E(r)&&(f=" "+Date.prototype.toUTCString.call(r)),A(r)&&(f=" "+d(r)),0!==a.length||s&&0!=r.length?n<0?j(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),l=s?function(t,e,r,n,o){for(var i=[],a=0,c=e.length;a<c;++a)I(e,String(a))?i.push(g(t,e,r,n,String(a),!0)):i.push("");return o.forEach((function(o){o.match(/^\d+$/)||i.push(g(t,e,r,n,o,!0))})),i}(t,r,n,c,a):a.map((function(e){return g(t,r,n,c,e,s)})),t.seen.pop(),function(t,e,r){if(t.reduce((function(t,e){return e.indexOf("\n")>=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(l,f,p)):p[0]+f+p[1]}function d(t){return"["+Error.prototype.toString.call(t)+"]"}function g(t,e,r,n,o,i){var a,c,u;if((u=Object.getOwnPropertyDescriptor(e,o)||{value:e[o]}).get?c=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(c=t.stylize("[Setter]","special")),I(n,o)||(a="["+o+"]"),c||(t.seen.indexOf(u.value)<0?(c=h(r)?y(t,u.value,null):y(t,u.value,r-1)).indexOf("\n")>-1&&(c=i?c.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+c.split("\n").map((function(t){return" "+t})).join("\n")):c=t.stylize("[Circular]","special")),O(a)){if(i&&o.match(/^\d+$/))return c;(a=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+c}function v(t){return Array.isArray(t)}function b(t){return"boolean"==typeof t}function h(t){return null===t}function m(t){return"number"==typeof t}function w(t){return"string"==typeof t}function O(t){return void 0===t}function j(t){return S(t)&&"[object RegExp]"===P(t)}function S(t){return"object"==typeof t&&null!==t}function E(t){return S(t)&&"[object Date]"===P(t)}function A(t){return S(t)&&("[object Error]"===P(t)||t instanceof Error)}function x(t){return"function"==typeof t}function P(t){return Object.prototype.toString.call(t)}function k(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(t=t.toUpperCase(),!c[t])if(u.test(t)){var r=n.pid;c[t]=function(){var n=e.format.apply(e,arguments);o.error("%s %d: %s",t,r,n)}}else c[t]=function(){};return c[t]},e.inspect=f,f.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},f.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=r(5955),e.isArray=v,e.isBoolean=b,e.isNull=h,e.isNullOrUndefined=function(t){return null==t},e.isNumber=m,e.isString=w,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=O,e.isRegExp=j,e.types.isRegExp=j,e.isObject=S,e.isDate=E,e.types.isDate=E,e.isError=A,e.types.isNativeError=A,e.isFunction=x,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(384);var _=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function T(){var t=new Date,e=[k(t.getHours()),k(t.getMinutes()),k(t.getSeconds())].join(":");return[t.getDate(),_[t.getMonth()],e].join(" ")}function I(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){o.log("%s - %s",T(),e.format.apply(e,arguments))},e.inherits=r(5717),e._extend=function(t,e){if(!e||!S(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var F="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function R(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(F&&t[F]){var e;if("function"!=typeof(e=t[F]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,F,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),o=[],i=0;i<arguments.length;i++)o.push(arguments[i]);o.push((function(t,n){t?r(t):e(n)}));try{t.apply(this,o)}catch(t){r(t)}return n}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),F&&Object.defineProperty(e,F,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,i(t))},e.promisify.custom=F,e.callbackify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function e(){for(var e=[],r=0;r<arguments.length;r++)e.push(arguments[r]);var o=e.pop();if("function"!=typeof o)throw new TypeError("The last argument must be of type Function");var i=this,a=function(){return o.apply(i,arguments)};t.apply(this,e).then((function(t){n.nextTick(a.bind(null,null,t))}),(function(t){n.nextTick(R.bind(null,t,a))}))}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Object.defineProperties(e,i(t)),e}},6430:(t,e,r)=>{"use strict";var n=r(9804),o=r(3083),i=r(1924),a=i("Object.prototype.toString"),c=r(6410)(),u=o(),l=i("String.prototype.slice"),f={},s=r(882),p=Object.getPrototypeOf;c&&s&&p&&n(u,(function(t){if("function"==typeof r.g[t]){var e=new r.g[t];if(!(Symbol.toStringTag in e))throw new EvalError("this engine has support for Symbol.toStringTag, but "+t+" does not have the property! Please report this.");var n=p(e),o=s(n,Symbol.toStringTag);if(!o){var i=p(n);o=s(i,Symbol.toStringTag)}f[t]=o.get}}));var y=r(5692);t.exports=function(t){return!!y(t)&&(c?function(t){var e=!1;return n(f,(function(r,n){if(!e)try{var o=r.call(t);o===n&&(e=o)}catch(t){}})),e}(t):l(a(t),8,-1))}},3083:(t,e,r)=>{"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"];t.exports=function(){for(var t=[],e=0;e<n.length;e++)"function"==typeof r.g[n[e]]&&(t[t.length]=n[e]);return t}},882:(t,e,r)=>{"use strict";var n=r(210)("%Object.getOwnPropertyDescriptor%");if(n)try{n([],"length")}catch(t){n=null}t.exports=n}},n={};function o(t){var e=n[t];if(void 0!==e)return e.exports;var i=n[t]={id:t,exports:{}};return r[t].call(i.exports,i,i.exports,o),i.exports}o.m=r,o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var r in e)o.o(e,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o.f={},o.e=t=>Promise.all(Object.keys(o.f).reduce(((e,r)=>(o.f[r](t,e),e)),[])),o.u=t=>"files_videoplayer-"+t+".js?v="+{"vendors-node_modules_video_js_dist_video_es_js":"f87ebe9feae884a73782",_34aa:"ab777726a58732acd0d2",css_style_css:"211b329b40ae32bf5d72","vendors-node_modules_video_js_dist_video-js_css":"6813c23d9e5029c0233b"}[t],o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t={},e="files_videoplayer:",o.l=(r,n,i,a)=>{if(t[r])t[r].push(n);else{var c,u;if(void 0!==i)for(var l=document.getElementsByTagName("script"),f=0;f<l.length;f++){var s=l[f];if(s.getAttribute("src")==r||s.getAttribute("data-webpack")==e+i){c=s;break}}c||(u=!0,(c=document.createElement("script")).charset="utf-8",c.timeout=120,o.nc&&c.setAttribute("nonce",o.nc),c.setAttribute("data-webpack",e+i),c.src=r),t[r]=[n];var p=(e,n)=>{c.onerror=c.onload=null,clearTimeout(y);var o=t[r];if(delete t[r],c.parentNode&&c.parentNode.removeChild(c),o&&o.forEach((t=>t(n))),e)return e(n)},y=setTimeout(p.bind(null,void 0,{type:"timeout",target:c}),12e4);c.onerror=p.bind(null,c.onerror),c.onload=p.bind(null,c.onload),u&&document.head.appendChild(c)}},o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.p="/apps/files_videoplayer/js/",(()=>{var t={main:0};o.f.j=(e,r)=>{var n=o.o(t,e)?t[e]:void 0;if(0!==n)if(n)r.push(n[2]);else{var i=new Promise(((r,o)=>n=t[e]=[r,o]));r.push(n[2]=i);var a=o.p+o.u(e),c=new Error;o.l(a,(r=>{if(o.o(t,e)&&(0!==(n=t[e])&&(t[e]=void 0),n)){var i=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+i+": "+a+")",c.name="ChunkLoadError",c.type=i,c.request=a,n[1](c)}}),"chunk-"+e,e)}};var e=(e,r)=>{var n,i,[a,c,u]=r,l=0;for(n in c)o.o(c,n)&&(o.m[n]=c[n]);if(u)u(o);for(e&&e(r);l<a.length;l++)i=a[l],o.o(t,i)&&t[i]&&t[i][0](),t[a[l]]=0},r=self.webpackChunkfiles_videoplayer=self.webpackChunkfiles_videoplayer||[];r.forEach(e.bind(null,0)),r.push=e.bind(null,r.push.bind(r))})(),(()=>{"use strict";var t=o(5573),e=o.n(t),r=o(6453),n=o(5108);o.nc=btoa(OC.requestToken),o.p=OC.filePath("files_videoplayer","","js/");var i=null,a=-1!==(0,r.j)("files_downloadlimit","download_limit",{limit:-1}).limit,c={UI:{show:function(){var t=document.createElement("video");if(t.id="my_video_1",t.classList.add("video-js"),t.classList.add("vjs-fill"),t.classList.add("vjs-big-play-centered"),t.controls=!0,t.preload="auto",t.width="100%",t.height="100%",t.poster=OC.filePath("files_videoplayer","","img")+"/poster.png",t.setAttribute("data-setup",'{"techOrder": ["html5"]}'),!a){var r=document.createElement("source");r.src=e()(c.location).replace("&amp;","&"),c.mime&&(r.type=e()(c.mime)),t.appendChild(r)}if(null===c.inline){var n=document.createElement("div");n.id="videoplayer_overlay";var o=document.createElement("div");o.id="videoplayer_outerContainer";var u=document.createElement("div");u.id="videoplayer_container";var l=document.createElement("div");l.id="videoplayer",u.appendChild(l),o.appendChild(u),n.appendChild(o),l.appendChild(t),document.body.appendChild(n),n.addEventListener("click",(function(t){t.target===this&&c.hidePlayer()})),setTimeout((function(){n.className="show"}),0)}else{var f=document.createElement("div");f.id="videoplayer_view",f.appendChild(t),c.inline.appendChild(f)}i("my_video_1",{fill:!0}).ready((function(){if(c.player=this,null===c.inline){var t=document.createElement("a");t.className="icon-view-close",t.id="box-close",t.href="#",t.addEventListener("click",(function(){c.hidePlayer()})),document.getElementById("my_video_1").appendChild(t)}null===document.getElementById("body-public")&&c.player.play()}))},hide:function(){var t=document.getElementById("videoplayer_overlay");t.className="",setTimeout((function(){t.parentElement.removeChild(t)}),500)}},mime:null,file:null,location:null,player:null,inline:null,mimeTypes:["video/mp4","video/x-m4v","video/webm","video/x-flv","video/ogg","video/quicktime","video/x-matroska"],mimeTypeAliasses:{"video/x-matroska":"video/webm"},onView:function(t,e){c.file=t,c.dir=e.dir,c.location=e.fileList.getDownloadUrl(t,c.dir),c.mime=e.$file.attr("data-mime"),Object.prototype.hasOwnProperty.call(c.mimeTypeAliasses,c.mime)&&(c.mime=c.mimeTypeAliasses[c.mime]),c.showPlayer()},onViewInline:function(t,e,r){c.location=e,c.mime=r,Object.prototype.hasOwnProperty.call(c.mimeTypeAliasses,c.mime)&&(c.mime=c.mimeTypeAliasses[c.mime]),c.inline=t,c.showPlayer()},showPlayer:function(){Promise.all([o.e("vendors-node_modules_video_js_dist_video_es_js"),o.e("_34aa")]).then(o.bind(o,1272)).then((function(t){i=t.default,Promise.all([o.e("css_style_css").then(o.bind(o,5892)),o.e("vendors-node_modules_video_js_dist_video-js_css").then(o.bind(o,5054))]).then((function(){c.UI.show()}))}))},hidePlayer:function(){null!==c.player&&!1!==c.player&&null===c.inline&&(c.player.dispose(),c.player=!1,c.UI.hide())},log:function(t){n.log(t)}};document.addEventListener("DOMContentLoaded",(function(){if(document.addEventListener("keyup",(function(t){(void 0!==t.key&&"Escape"===t.key||void 0!==t.keyCode&&27===t.keyCode)&&c.hidePlayer()})),document.getElementById("body-public")&&document.getElementById("imgframe"))for(var t=document.getElementById("mimetype").value,e=0;e<c.mimeTypes.length;++e)if(c.mimeTypes[e]===t){var r=window.location.href.split("?")[0]+"/download";c.onViewInline(document.getElementById("imgframe"),r,t);break}}))})()})();
+//# sourceMappingURL=files_videoplayer-main.js.map?v=a17396eb61277e3f2870 \ No newline at end of file
diff --git a/js/files_videoplayer-main.js.map b/js/files_videoplayer-main.js.map
index 2896324..a787f71 100644
--- a/js/files_videoplayer-main.js.map
+++ b/js/files_videoplayer-main.js.map
@@ -1 +1 @@
-{"version":3,"file":"files_videoplayer-main.js?v=34a514faf95077aaeba1","mappings":";UAAIA,EACAC,iCCIJC,EAAQ,EAUR,SAAmBC,EAAKC,EAAKC,GAC3B,IAAIC,EAAOC,SAASC,cAAc,kBAAkBC,OAAON,EAAK,KAAKM,OAAOL,IAE5E,GAAa,OAATE,EAAe,CACjB,QAAiBI,IAAbL,EACF,OAAOA,EAGT,MAAM,IAAIM,MAAM,gCAAgCF,OAAOL,EAAK,QAAQK,OAAON,IAG7E,IACE,OAAOS,KAAKC,MAAMC,KAAKR,EAAKS,QAC5B,MAAOC,GACP,MAAM,IAAIL,MAAM,iCAAiCF,OAAOL,EAAK,QAAQK,OAAON,MAtBhF,EAAQ,2DCgBR,SAASc,EAAQC,GAAwT,OAAtOD,EAArD,mBAAXE,QAAoD,iBAApBA,OAAOC,SAAmC,SAAiBF,GAAO,cAAcA,GAA2B,SAAiBA,GAAO,OAAOA,GAAyB,mBAAXC,QAAyBD,EAAIG,cAAgBF,QAAUD,IAAQC,OAAOG,UAAY,gBAAkBJ,IAAyBA,GAIxV,IAoBIK,EACAC,EApBAC,EADW,EAAQ,MACOC,MAC1BC,EAAyBF,EAAeE,uBACxCC,EAAuBH,EAAeG,qBACtCC,EAAwBJ,EAAeI,sBACvCC,EAA2BL,EAAeK,yBAC1CC,EAAmBN,EAAeM,iBAElCC,EAAiB,EAAQ,MAGzBC,EADY,EAAQ,MACAA,QAEpBC,EAAiB,cACjBC,EAAYD,EAAeC,UAC3BC,EAAWF,EAAeE,SAE1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AvBpB,EAAYiB,SAA0C,IAAvBjB,EAAYiB,QAA2C,OAAvBjB,EAAYa,SAC9Eb,EAAYiB,OAAO0B,UACnB3C,EAAYiB,QAAS,EACrBjB,EAAYC,GAAG2B,SAGjBlzB,IAlJmB,SAkJfnL,GAEHuB,EAAQ4J,IAAInL,KAId5C,SAASwgC,iBAAiB,oBAAoB,WAW7C,GARAxgC,SAASwgC,iBAAiB,SAAS,SAAS//B,SAC5BN,IAAVM,EAAEZ,KAA+B,WAAVY,EAAEZ,UACXM,IAAdM,EAAEwhC,SAAuC,KAAdxhC,EAAEwhC,UACjC5C,EAAYoB,gBAKVzgC,SAAS+gC,eAAe,gBAAkB/gC,SAAS+gC,eAAe,YAErE,IADA,IAAMmB,EAAWliC,SAAS+gC,eAAe,YAAYvgC,MAC5CwwB,EAAI,EAAGA,EAAIqO,EAAY+B,UAAU59B,SAAUwtB,EACnD,GAAIqO,EAAY+B,UAAUpQ,KAAOkR,EAAU,CAC1C,IAAMC,EAAWhoB,OAAO6lB,SAASc,KAAK14B,MAAM,KAAK,GAAK,YACtDi3B,EAAYuC,aAAa5hC,SAAS+gC,eAAe,YAAaoB,EAAUD,GACxE","sources":["webpack:///files_videoplayer/webpack/runtime/load script","webpack:///files_videoplayer/node_modules/@nextcloud/initial-state/dist/index.js","webpack:///files_videoplayer/node_modules/assert/build/assert.js","webpack:///files_videoplayer/node_modules/assert/build/internal/assert/assertion_error.js","webpack:///files_videoplayer/node_modules/assert/build/internal/errors.js","webpack:///files_videoplayer/node_modules/assert/build/internal/util/comparisons.js","webpack:///files_videoplayer/node_modules/call-bind/callBound.js","webpack:///files_videoplayer/node_modules/call-bind/index.js","webpack:///files_videoplayer/node_modules/console-browserify/index.js","webpack:///files_videoplayer/node_modules/core-js/internals/a-callable.js","webpack:///files_videoplayer/node_modules/core-js/internals/an-object.js","webpack:///files_videoplayer/node_modules/core-js/internals/array-includes.js","webpack:///files_videoplayer/node_modules/core-js/internals/array-method-has-species-support.js","webpack:///files_videoplayer/node_modules/core-js/internals/array-species-constructor.js","webpack:///files_videoplayer/node_modules/core-js/internals/array-species-create.js","webpack:///files_videoplayer/node_modules/core-js/internals/classof-raw.js","webpack:///files_videoplayer/node_modules/core-js/internals/classof.js","webpack:///files_videoplayer/node_modules/core-js/internals/copy-constructor-properties.js","webpack:///files_videoplayer/node_modules/core-js/internals/create-non-enumerable-property.js","webpack:///files_videoplayer/node_modules/core-js/internals/create-property-descriptor.js","webpack:///files_videoplayer/node_modules/core-js/internals/create-property.js","webpack:///files_videoplayer/node_modules/core-js/internals/define-built-in.js","webpack:///files_videoplayer/node_modules/core-js/internals/descriptors.js","webpack:///files_videoplayer/node_modules/core-js/internals/document-create-element.js","webpack:///files_videoplayer/node_modules/core-js/internals/engine-user-agent.js","webpack:///files_videoplayer/node_modules/core-js/internals/engine-v8-version.js","webpack:///files_videoplayer/node_modules/core-js/internals/enum-bug-keys.js","webpack:///files_videoplayer/node_modules/core-js/internals/export.js","webpack:///files_videoplayer/node_modules/core-js/internals/fails.js","webpack:///files_videoplayer/node_modules/core-js/internals/function-bind-native.js","webpack:///files_videoplayer/node_modules/core-js/internals/function-call.js","webpack:///files_videoplayer/node_modules/core-js/internals/function-name.js","webpack:///files_videoplayer/node_modules/core-js/internals/function-uncurry-this.js","webpack:///files_videoplayer/node_modules/core-js/internals/get-built-in.js","webpack:///files_videoplayer/node_modules/core-js/internals/get-method.js","webpack:///files_videoplayer/node_modules/core-js/internals/global.js","webpack:///files_videoplayer/node_modules/core-js/internals/has-own-property.js","webpack:///files_videoplayer/node_modules/core-js/internals/hidden-keys.js","webpack:///files_videoplayer/node_modules/core-js/internals/ie8-dom-define.js","webpack:///files_videoplayer/node_modules/core-js/internals/indexed-object.js","webpack:///files_videoplayer/node_modules/core-js/internals/inspect-source.js","webpack:///files_videoplayer/node_modules/core-js/internals/internal-state.js","webpack:///files_videoplayer/node_modules/core-js/internals/is-array.js","webpack:///files_videoplayer/node_modules/core-js/internals/is-callable.js","webpack:///files_videoplayer/node_modules/core-js/internals/is-constructor.js","webpack:///files_videoplayer/node_modules/core-js/internals/is-forced.js","webpack:///files_videoplayer/node_modules/core-js/internals/is-object.js","webpack:///files_videoplayer/node_modules/core-js/internals/is-pure.js","webpack:///files_videoplayer/node_modules/core-js/internals/is-symbol.js","webpack:///files_videoplayer/node_modules/core-js/internals/length-of-array-like.js","webpack:///files_videoplayer/node_modules/core-js/internals/make-built-in.js","webpack:///files_videoplayer/node_modules/core-js/internals/native-symbol.js","webpack:///files_videoplayer/node_modules/core-js/internals/native-weak-map.js","webpack:///files_videoplayer/node_modules/core-js/internals/object-define-property.js","webpack:///files_videoplayer/node_modules/core-js/internals/object-get-own-property-descriptor.js","webpack:///files_videoplayer/node_modules/core-js/internals/object-get-own-property-names.js","webpack:///files_videoplayer/node_modules/core-js/internals/object-get-own-property-symbols.js","webpack:///files_videoplayer/node_modules/core-js/internals/object-is-prototype-of.js","webpack:///files_videoplayer/node_modules/core-js/internals/object-keys-internal.js","webpack:///files_videoplayer/node_modules/core-js/internals/object-property-is-enumerable.js","webpack:///files_videoplayer/node_modules/core-js/internals/ordinary-to-primitive.js","webpack:///files_videoplayer/node_modules/core-js/internals/own-keys.js","webpack:///files_videoplayer/node_modules/core-js/internals/require-object-coercible.js","webpack:///files_videoplayer/node_modules/core-js/internals/set-global.js","webpack:///files_videoplayer/node_modules/core-js/internals/shared-key.js","webpack:///files_videoplayer/node_modules/core-js/internals/shared-store.js","webpack:///files_videoplayer/node_modules/core-js/internals/shared.js","webpack:///files_videoplayer/node_modules/core-js/internals/to-absolute-index.js","webpack:///files_videoplayer/node_modules/core-js/internals/to-indexed-object.js","webpack:///files_videoplayer/node_modules/core-js/internals/to-integer-or-infinity.js","webpack:///files_videoplayer/node_modules/core-js/internals/to-length.js","webpack:///files_videoplayer/node_modules/core-js/internals/to-object.js","webpack:///files_videoplayer/node_modules/core-js/internals/to-primitive.js","webpack:///files_videoplayer/node_modules/core-js/internals/to-property-key.js","webpack:///files_videoplayer/node_modules/core-js/internals/to-string-tag-support.js","webpack:///files_videoplayer/node_modules/core-js/internals/try-to-string.js","webpack:///files_videoplayer/node_modules/core-js/internals/uid.js","webpack:///files_videoplayer/node_modules/core-js/internals/use-symbol-as-uid.js","webpack:///files_videoplayer/node_modules/core-js/internals/v8-prototype-define-bug.js","webpack:///files_videoplayer/node_modules/core-js/internals/well-known-symbol.js","webpack:///files_videoplayer/node_modules/core-js/modules/es.array.concat.js","webpack:///files_videoplayer/node_modules/define-properties/index.js","webpack:///files_videoplayer/node_modules/es6-object-assign/index.js","webpack:///files_videoplayer/node_modules/escape-html/index.js","webpack:///files_videoplayer/node_modules/foreach/index.js","webpack:///files_videoplayer/node_modules/function-bind/implementation.js","webpack:///files_videoplayer/node_modules/function-bind/index.js","webpack:///files_videoplayer/node_modules/get-intrinsic/index.js","webpack:///files_videoplayer/node_modules/has-symbols/index.js","webpack:///files_videoplayer/node_modules/has-symbols/shams.js","webpack:///files_videoplayer/node_modules/has-tostringtag/shams.js","webpack:///files_videoplayer/node_modules/has/src/index.js","webpack:///files_videoplayer/node_modules/inherits/inherits_browser.js","webpack:///files_videoplayer/node_modules/is-arguments/index.js","webpack:///files_videoplayer/node_modules/is-generator-function/index.js","webpack:///files_videoplayer/node_modules/is-nan/implementation.js","webpack:///files_videoplayer/node_modules/is-nan/index.js","webpack:///files_videoplayer/node_modules/is-nan/polyfill.js","webpack:///files_videoplayer/node_modules/is-nan/shim.js","webpack:///files_videoplayer/node_modules/is-typed-array/index.js","webpack:///files_videoplayer/node_modules/object-is/implementation.js","webpack:///files_videoplayer/node_modules/object-is/index.js","webpack:///files_videoplayer/node_modules/object-is/polyfill.js","webpack:///files_videoplayer/node_modules/object-is/shim.js","webpack:///files_videoplayer/node_modules/object-keys/implementation.js","webpack:///files_videoplayer/node_modules/object-keys/index.js","webpack:///files_videoplayer/node_modules/object-keys/isArguments.js","webpack:///files_videoplayer/node_modules/process/browser.js","webpack:///files_videoplayer/node_modules/util/support/isBufferBrowser.js","webpack:///files_videoplayer/node_modules/util/support/types.js","webpack:///files_videoplayer/node_modules/util/util.js","webpack:///files_videoplayer/node_modules/which-typed-array/index.js","webpack:///files_videoplayer/javascript/dynamic|/home/runner/work/files_videoplayer/files_videoplayer/node_modules/available-typed-arrays/index.js","webpack:///files_videoplayer/javascript/dynamic|/home/runner/work/files_videoplayer/files_videoplayer/node_modules/es-abstract/helpers/getOwnPropertyDescriptor.js","webpack:///files_videoplayer/webpack/bootstrap","webpack:///files_videoplayer/webpack/runtime/compat get default export","webpack:///files_videoplayer/webpack/runtime/define property getters","webpack:///files_videoplayer/webpack/runtime/ensure chunk","webpack:///files_videoplayer/webpack/runtime/get javascript chunk filename","webpack:///files_videoplayer/webpack/runtime/global","webpack:///files_videoplayer/webpack/runtime/hasOwnProperty shorthand","webpack:///files_videoplayer/webpack/runtime/make namespace object","webpack:///files_videoplayer/webpack/runtime/publicPath","webpack:///files_videoplayer/webpack/runtime/jsonp chunk loading","webpack:///files_videoplayer/src/main.js"],"sourcesContent":["var inProgress = {};\nvar dataWebpackPrefix = \"files_videoplayer:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\t;\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.loadState = loadState;\n\nrequire(\"core-js/modules/es.array.concat.js\");\n\n/**\n * @param app app ID, e.g. \"mail\"\n * @param key name of the property\n * @param fallback optional parameter to use as default value\n * @throws if the key can't be found\n */\nfunction loadState(app, key, fallback) {\n var elem = document.querySelector(\"#initial-state-\".concat(app, \"-\").concat(key));\n\n if (elem === null) {\n if (fallback !== undefined) {\n return fallback;\n }\n\n throw new Error(\"Could not find initial state \".concat(key, \" of \").concat(app));\n }\n\n try {\n return JSON.parse(atob(elem.value));\n } catch (e) {\n throw new Error(\"Could not parse initial state \".concat(key, \" of \").concat(app));\n }\n}\n//# sourceMappingURL=index.js.map","// Currently in sync with Node.js lib/assert.js\n// https://github.com/nodejs/node/commit/2a51ae424a513ec9a6aa3466baa0cc1d55dd4f3b\n// Originally from narwhal.js (http://narwhaljs.org)\n// Copyright (c) 2009 Thomas Robinson <280north.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the 'Software'), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n'use strict';\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar _require = require('./internal/errors'),\n _require$codes = _require.codes,\n ERR_AMBIGUOUS_ARGUMENT = _require$codes.ERR_AMBIGUOUS_ARGUMENT,\n ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,\n ERR_INVALID_ARG_VALUE = _require$codes.ERR_INVALID_ARG_VALUE,\n ERR_INVALID_RETURN_VALUE = _require$codes.ERR_INVALID_RETURN_VALUE,\n ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS;\n\nvar AssertionError = require('./internal/assert/assertion_error');\n\nvar _require2 = require('util/'),\n inspect = _require2.inspect;\n\nvar _require$types = require('util/').types,\n isPromise = _require$types.isPromise,\n isRegExp = _require$types.isRegExp;\n\nvar objectAssign = Object.assign ? Object.assign : require('es6-object-assign').assign;\nvar objectIs = Object.is ? Object.is : require('object-is');\nvar errorCache = new Map();\nvar isDeepEqual;\nvar isDeepStrictEqual;\nvar parseExpressionAt;\nvar findNodeAround;\nvar decoder;\n\nfunction lazyLoadComparison() {\n var comparison = require('./internal/util/comparisons');\n\n isDeepEqual = comparison.isDeepEqual;\n isDeepStrictEqual = comparison.isDeepStrictEqual;\n} // Escape control characters but not \\n and \\t to keep the line breaks and\n// indentation intact.\n// eslint-disable-next-line no-control-regex\n\n\nvar escapeSequencesRegExp = /[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f]/g;\nvar meta = [\"\\\\u0000\", \"\\\\u0001\", \"\\\\u0002\", \"\\\\u0003\", \"\\\\u0004\", \"\\\\u0005\", \"\\\\u0006\", \"\\\\u0007\", '\\\\b', '', '', \"\\\\u000b\", '\\\\f', '', \"\\\\u000e\", \"\\\\u000f\", \"\\\\u0010\", \"\\\\u0011\", \"\\\\u0012\", \"\\\\u0013\", \"\\\\u0014\", \"\\\\u0015\", \"\\\\u0016\", \"\\\\u0017\", \"\\\\u0018\", \"\\\\u0019\", \"\\\\u001a\", \"\\\\u001b\", \"\\\\u001c\", \"\\\\u001d\", \"\\\\u001e\", \"\\\\u001f\"];\n\nvar escapeFn = function escapeFn(str) {\n return meta[str.charCodeAt(0)];\n};\n\nvar warned = false; // The assert module provides functions that throw\n// AssertionError's when particular conditions are not met. The\n// assert module must conform to the following interface.\n\nvar assert = module.exports = ok;\nvar NO_EXCEPTION_SENTINEL = {}; // All of the following functions must throw an AssertionError\n// when a corresponding condition is not met, with a message that\n// may be undefined if not provided. All assertion methods provide\n// both the actual and expected values to the assertion error for\n// display purposes.\n\nfunction innerFail(obj) {\n if (obj.message instanceof Error) throw obj.message;\n throw new AssertionError(obj);\n}\n\nfunction fail(actual, expected, message, operator, stackStartFn) {\n var argsLen = arguments.length;\n var internalMessage;\n\n if (argsLen === 0) {\n internalMessage = 'Failed';\n } else if (argsLen === 1) {\n message = actual;\n actual = undefined;\n } else {\n if (warned === false) {\n warned = true;\n var warn = process.emitWarning ? process.emitWarning : console.warn.bind(console);\n warn('assert.fail() with more than one argument is deprecated. ' + 'Please use assert.strictEqual() instead or only pass a message.', 'DeprecationWarning', 'DEP0094');\n }\n\n if (argsLen === 2) operator = '!=';\n }\n\n if (message instanceof Error) throw message;\n var errArgs = {\n actual: actual,\n expected: expected,\n operator: operator === undefined ? 'fail' : operator,\n stackStartFn: stackStartFn || fail\n };\n\n if (message !== undefined) {\n errArgs.message = message;\n }\n\n var err = new AssertionError(errArgs);\n\n if (internalMessage) {\n err.message = internalMessage;\n err.generatedMessage = true;\n }\n\n throw err;\n}\n\nassert.fail = fail; // The AssertionError is defined in internal/error.\n\nassert.AssertionError = AssertionError;\n\nfunction innerOk(fn, argLen, value, message) {\n if (!value) {\n var generatedMessage = false;\n\n if (argLen === 0) {\n generatedMessage = true;\n message = 'No value argument passed to `assert.ok()`';\n } else if (message instanceof Error) {\n throw message;\n }\n\n var err = new AssertionError({\n actual: value,\n expected: true,\n message: message,\n operator: '==',\n stackStartFn: fn\n });\n err.generatedMessage = generatedMessage;\n throw err;\n }\n} // Pure assertion tests whether a value is truthy, as determined\n// by !!value.\n\n\nfunction ok() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n innerOk.apply(void 0, [ok, args.length].concat(args));\n}\n\nassert.ok = ok; // The equality assertion tests shallow, coercive equality with ==.\n\n/* eslint-disable no-restricted-properties */\n\nassert.equal = function equal(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n } // eslint-disable-next-line eqeqeq\n\n\n if (actual != expected) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: '==',\n stackStartFn: equal\n });\n }\n}; // The non-equality assertion tests for whether two objects are not\n// equal with !=.\n\n\nassert.notEqual = function notEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n } // eslint-disable-next-line eqeqeq\n\n\n if (actual == expected) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: '!=',\n stackStartFn: notEqual\n });\n }\n}; // The equivalence assertion tests a deep equality relation.\n\n\nassert.deepEqual = function deepEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n\n if (isDeepEqual === undefined) lazyLoadComparison();\n\n if (!isDeepEqual(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'deepEqual',\n stackStartFn: deepEqual\n });\n }\n}; // The non-equivalence assertion tests for any deep inequality.\n\n\nassert.notDeepEqual = function notDeepEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n\n if (isDeepEqual === undefined) lazyLoadComparison();\n\n if (isDeepEqual(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'notDeepEqual',\n stackStartFn: notDeepEqual\n });\n }\n};\n/* eslint-enable */\n\n\nassert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n\n if (isDeepEqual === undefined) lazyLoadComparison();\n\n if (!isDeepStrictEqual(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'deepStrictEqual',\n stackStartFn: deepStrictEqual\n });\n }\n};\n\nassert.notDeepStrictEqual = notDeepStrictEqual;\n\nfunction notDeepStrictEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n\n if (isDeepEqual === undefined) lazyLoadComparison();\n\n if (isDeepStrictEqual(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'notDeepStrictEqual',\n stackStartFn: notDeepStrictEqual\n });\n }\n}\n\nassert.strictEqual = function strictEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n\n if (!objectIs(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'strictEqual',\n stackStartFn: strictEqual\n });\n }\n};\n\nassert.notStrictEqual = function notStrictEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n\n if (objectIs(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'notStrictEqual',\n stackStartFn: notStrictEqual\n });\n }\n};\n\nvar Comparison = function Comparison(obj, keys, actual) {\n var _this = this;\n\n _classCallCheck(this, Comparison);\n\n keys.forEach(function (key) {\n if (key in obj) {\n if (actual !== undefined && typeof actual[key] === 'string' && isRegExp(obj[key]) && obj[key].test(actual[key])) {\n _this[key] = actual[key];\n } else {\n _this[key] = obj[key];\n }\n }\n });\n};\n\nfunction compareExceptionKey(actual, expected, key, message, keys, fn) {\n if (!(key in actual) || !isDeepStrictEqual(actual[key], expected[key])) {\n if (!message) {\n // Create placeholder objects to create a nice output.\n var a = new Comparison(actual, keys);\n var b = new Comparison(expected, keys, actual);\n var err = new AssertionError({\n actual: a,\n expected: b,\n operator: 'deepStrictEqual',\n stackStartFn: fn\n });\n err.actual = actual;\n err.expected = expected;\n err.operator = fn.name;\n throw err;\n }\n\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: fn.name,\n stackStartFn: fn\n });\n }\n}\n\nfunction expectedException(actual, expected, msg, fn) {\n if (typeof expected !== 'function') {\n if (isRegExp(expected)) return expected.test(actual); // assert.doesNotThrow does not accept objects.\n\n if (arguments.length === 2) {\n throw new ERR_INVALID_ARG_TYPE('expected', ['Function', 'RegExp'], expected);\n } // Handle primitives properly.\n\n\n if (_typeof(actual) !== 'object' || actual === null) {\n var err = new AssertionError({\n actual: actual,\n expected: expected,\n message: msg,\n operator: 'deepStrictEqual',\n stackStartFn: fn\n });\n err.operator = fn.name;\n throw err;\n }\n\n var keys = Object.keys(expected); // Special handle errors to make sure the name and the message are compared\n // as well.\n\n if (expected instanceof Error) {\n keys.push('name', 'message');\n } else if (keys.length === 0) {\n throw new ERR_INVALID_ARG_VALUE('error', expected, 'may not be an empty object');\n }\n\n if (isDeepEqual === undefined) lazyLoadComparison();\n keys.forEach(function (key) {\n if (typeof actual[key] === 'string' && isRegExp(expected[key]) && expected[key].test(actual[key])) {\n return;\n }\n\n compareExceptionKey(actual, expected, key, msg, keys, fn);\n });\n return true;\n } // Guard instanceof against arrow functions as they don't have a prototype.\n\n\n if (expected.prototype !== undefined && actual instanceof expected) {\n return true;\n }\n\n if (Error.isPrototypeOf(expected)) {\n return false;\n }\n\n return expected.call({}, actual) === true;\n}\n\nfunction getActual(fn) {\n if (typeof fn !== 'function') {\n throw new ERR_INVALID_ARG_TYPE('fn', 'Function', fn);\n }\n\n try {\n fn();\n } catch (e) {\n return e;\n }\n\n return NO_EXCEPTION_SENTINEL;\n}\n\nfunction checkIsPromise(obj) {\n // Accept native ES6 promises and promises that are implemented in a similar\n // way. Do not accept thenables that use a function as `obj` and that have no\n // `catch` handler.\n // TODO: thenables are checked up until they have the correct methods,\n // but according to documentation, the `then` method should receive\n // the `fulfill` and `reject` arguments as well or it may be never resolved.\n return isPromise(obj) || obj !== null && _typeof(obj) === 'object' && typeof obj.then === 'function' && typeof obj.catch === 'function';\n}\n\nfunction waitForActual(promiseFn) {\n return Promise.resolve().then(function () {\n var resultPromise;\n\n if (typeof promiseFn === 'function') {\n // Return a rejected promise if `promiseFn` throws synchronously.\n resultPromise = promiseFn(); // Fail in case no promise is returned.\n\n if (!checkIsPromise(resultPromise)) {\n throw new ERR_INVALID_RETURN_VALUE('instance of Promise', 'promiseFn', resultPromise);\n }\n } else if (checkIsPromise(promiseFn)) {\n resultPromise = promiseFn;\n } else {\n throw new ERR_INVALID_ARG_TYPE('promiseFn', ['Function', 'Promise'], promiseFn);\n }\n\n return Promise.resolve().then(function () {\n return resultPromise;\n }).then(function () {\n return NO_EXCEPTION_SENTINEL;\n }).catch(function (e) {\n return e;\n });\n });\n}\n\nfunction expectsError(stackStartFn, actual, error, message) {\n if (typeof error === 'string') {\n if (arguments.length === 4) {\n throw new ERR_INVALID_ARG_TYPE('error', ['Object', 'Error', 'Function', 'RegExp'], error);\n }\n\n if (_typeof(actual) === 'object' && actual !== null) {\n if (actual.message === error) {\n throw new ERR_AMBIGUOUS_ARGUMENT('error/message', \"The error message \\\"\".concat(actual.message, \"\\\" is identical to the message.\"));\n }\n } else if (actual === error) {\n throw new ERR_AMBIGUOUS_ARGUMENT('error/message', \"The error \\\"\".concat(actual, \"\\\" is identical to the message.\"));\n }\n\n message = error;\n error = undefined;\n } else if (error != null && _typeof(error) !== 'object' && typeof error !== 'function') {\n throw new ERR_INVALID_ARG_TYPE('error', ['Object', 'Error', 'Function', 'RegExp'], error);\n }\n\n if (actual === NO_EXCEPTION_SENTINEL) {\n var details = '';\n\n if (error && error.name) {\n details += \" (\".concat(error.name, \")\");\n }\n\n details += message ? \": \".concat(message) : '.';\n var fnType = stackStartFn.name === 'rejects' ? 'rejection' : 'exception';\n innerFail({\n actual: undefined,\n expected: error,\n operator: stackStartFn.name,\n message: \"Missing expected \".concat(fnType).concat(details),\n stackStartFn: stackStartFn\n });\n }\n\n if (error && !expectedException(actual, error, message, stackStartFn)) {\n throw actual;\n }\n}\n\nfunction expectsNoError(stackStartFn, actual, error, message) {\n if (actual === NO_EXCEPTION_SENTINEL) return;\n\n if (typeof error === 'string') {\n message = error;\n error = undefined;\n }\n\n if (!error || expectedException(actual, error)) {\n var details = message ? \": \".concat(message) : '.';\n var fnType = stackStartFn.name === 'doesNotReject' ? 'rejection' : 'exception';\n innerFail({\n actual: actual,\n expected: error,\n operator: stackStartFn.name,\n message: \"Got unwanted \".concat(fnType).concat(details, \"\\n\") + \"Actual message: \\\"\".concat(actual && actual.message, \"\\\"\"),\n stackStartFn: stackStartFn\n });\n }\n\n throw actual;\n}\n\nassert.throws = function throws(promiseFn) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n expectsError.apply(void 0, [throws, getActual(promiseFn)].concat(args));\n};\n\nassert.rejects = function rejects(promiseFn) {\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n args[_key3 - 1] = arguments[_key3];\n }\n\n return waitForActual(promiseFn).then(function (result) {\n return expectsError.apply(void 0, [rejects, result].concat(args));\n });\n};\n\nassert.doesNotThrow = function doesNotThrow(fn) {\n for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {\n args[_key4 - 1] = arguments[_key4];\n }\n\n expectsNoError.apply(void 0, [doesNotThrow, getActual(fn)].concat(args));\n};\n\nassert.doesNotReject = function doesNotReject(fn) {\n for (var _len5 = arguments.length, args = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {\n args[_key5 - 1] = arguments[_key5];\n }\n\n return waitForActual(fn).then(function (result) {\n return expectsNoError.apply(void 0, [doesNotReject, result].concat(args));\n });\n};\n\nassert.ifError = function ifError(err) {\n if (err !== null && err !== undefined) {\n var message = 'ifError got unwanted exception: ';\n\n if (_typeof(err) === 'object' && typeof err.message === 'string') {\n if (err.message.length === 0 && err.constructor) {\n message += err.constructor.name;\n } else {\n message += err.message;\n }\n } else {\n message += inspect(err);\n }\n\n var newErr = new AssertionError({\n actual: err,\n expected: null,\n operator: 'ifError',\n message: message,\n stackStartFn: ifError\n }); // Make sure we actually have a stack trace!\n\n var origStack = err.stack;\n\n if (typeof origStack === 'string') {\n // This will remove any duplicated frames from the error frames taken\n // from within `ifError` and add the original error frames to the newly\n // created ones.\n var tmp2 = origStack.split('\\n');\n tmp2.shift(); // Filter all frames existing in err.stack.\n\n var tmp1 = newErr.stack.split('\\n');\n\n for (var i = 0; i < tmp2.length; i++) {\n // Find the first occurrence of the frame.\n var pos = tmp1.indexOf(tmp2[i]);\n\n if (pos !== -1) {\n // Only keep new frames.\n tmp1 = tmp1.slice(0, pos);\n break;\n }\n }\n\n newErr.stack = \"\".concat(tmp1.join('\\n'), \"\\n\").concat(tmp2.join('\\n'));\n }\n\n throw newErr;\n }\n}; // Expose a strict only variant of assert\n\n\nfunction strict() {\n for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {\n args[_key6] = arguments[_key6];\n }\n\n innerOk.apply(void 0, [strict, args.length].concat(args));\n}\n\nassert.strict = objectAssign(strict, assert, {\n equal: assert.strictEqual,\n deepEqual: assert.deepStrictEqual,\n notEqual: assert.notStrictEqual,\n notDeepEqual: assert.notDeepStrictEqual\n});\nassert.strict.strict = assert.strict;","// Currently in sync with Node.js lib/internal/assert/assertion_error.js\n// https://github.com/nodejs/node/commit/0817840f775032169ddd70c85ac059f18ffcc81c\n'use strict';\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar _require = require('util/'),\n inspect = _require.inspect;\n\nvar _require2 = require('../errors'),\n ERR_INVALID_ARG_TYPE = _require2.codes.ERR_INVALID_ARG_TYPE; // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith\n\n\nfunction endsWith(str, search, this_len) {\n if (this_len === undefined || this_len > str.length) {\n this_len = str.length;\n }\n\n return str.substring(this_len - search.length, this_len) === search;\n} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat\n\n\nfunction repeat(str, count) {\n count = Math.floor(count);\n if (str.length == 0 || count == 0) return '';\n var maxCount = str.length * count;\n count = Math.floor(Math.log(count) / Math.log(2));\n\n while (count) {\n str += str;\n count--;\n }\n\n str += str.substring(0, maxCount - str.length);\n return str;\n}\n\nvar blue = '';\nvar green = '';\nvar red = '';\nvar white = '';\nvar kReadableOperator = {\n deepStrictEqual: 'Expected values to be strictly deep-equal:',\n strictEqual: 'Expected values to be strictly equal:',\n strictEqualObject: 'Expected \"actual\" to be reference-equal to \"expected\":',\n deepEqual: 'Expected values to be loosely deep-equal:',\n equal: 'Expected values to be loosely equal:',\n notDeepStrictEqual: 'Expected \"actual\" not to be strictly deep-equal to:',\n notStrictEqual: 'Expected \"actual\" to be strictly unequal to:',\n notStrictEqualObject: 'Expected \"actual\" not to be reference-equal to \"expected\":',\n notDeepEqual: 'Expected \"actual\" not to be loosely deep-equal to:',\n notEqual: 'Expected \"actual\" to be loosely unequal to:',\n notIdentical: 'Values identical but not reference-equal:'\n}; // Comparing short primitives should just show === / !== instead of using the\n// diff.\n\nvar kMaxShortLength = 10;\n\nfunction copyError(source) {\n var keys = Object.keys(source);\n var target = Object.create(Object.getPrototypeOf(source));\n keys.forEach(function (key) {\n target[key] = source[key];\n });\n Object.defineProperty(target, 'message', {\n value: source.message\n });\n return target;\n}\n\nfunction inspectValue(val) {\n // The util.inspect default values could be changed. This makes sure the\n // error messages contain the necessary information nevertheless.\n return inspect(val, {\n compact: false,\n customInspect: false,\n depth: 1000,\n maxArrayLength: Infinity,\n // Assert compares only enumerable properties (with a few exceptions).\n showHidden: false,\n // Having a long line as error is better than wrapping the line for\n // comparison for now.\n // TODO(BridgeAR): `breakLength` should be limited as soon as soon as we\n // have meta information about the inspected properties (i.e., know where\n // in what line the property starts and ends).\n breakLength: Infinity,\n // Assert does not detect proxies currently.\n showProxy: false,\n sorted: true,\n // Inspect getters as we also check them when comparing entries.\n getters: true\n });\n}\n\nfunction createErrDiff(actual, expected, operator) {\n var other = '';\n var res = '';\n var lastPos = 0;\n var end = '';\n var skipped = false;\n var actualInspected = inspectValue(actual);\n var actualLines = actualInspected.split('\\n');\n var expectedLines = inspectValue(expected).split('\\n');\n var i = 0;\n var indicator = ''; // In case both values are objects explicitly mark them as not reference equal\n // for the `strictEqual` operator.\n\n if (operator === 'strictEqual' && _typeof(actual) === 'object' && _typeof(expected) === 'object' && actual !== null && expected !== null) {\n operator = 'strictEqualObject';\n } // If \"actual\" and \"expected\" fit on a single line and they are not strictly\n // equal, check further special handling.\n\n\n if (actualLines.length === 1 && expectedLines.length === 1 && actualLines[0] !== expectedLines[0]) {\n var inputLength = actualLines[0].length + expectedLines[0].length; // If the character length of \"actual\" and \"expected\" together is less than\n // kMaxShortLength and if neither is an object and at least one of them is\n // not `zero`, use the strict equal comparison to visualize the output.\n\n if (inputLength <= kMaxShortLength) {\n if ((_typeof(actual) !== 'object' || actual === null) && (_typeof(expected) !== 'object' || expected === null) && (actual !== 0 || expected !== 0)) {\n // -0 === +0\n return \"\".concat(kReadableOperator[operator], \"\\n\\n\") + \"\".concat(actualLines[0], \" !== \").concat(expectedLines[0], \"\\n\");\n }\n } else if (operator !== 'strictEqualObject') {\n // If the stderr is a tty and the input length is lower than the current\n // columns per line, add a mismatch indicator below the output. If it is\n // not a tty, use a default value of 80 characters.\n var maxLength = process.stderr && process.stderr.isTTY ? process.stderr.columns : 80;\n\n if (inputLength < maxLength) {\n while (actualLines[0][i] === expectedLines[0][i]) {\n i++;\n } // Ignore the first characters.\n\n\n if (i > 2) {\n // Add position indicator for the first mismatch in case it is a\n // single line and the input length is less than the column length.\n indicator = \"\\n \".concat(repeat(' ', i), \"^\");\n i = 0;\n }\n }\n }\n } // Remove all ending lines that match (this optimizes the output for\n // readability by reducing the number of total changed lines).\n\n\n var a = actualLines[actualLines.length - 1];\n var b = expectedLines[expectedLines.length - 1];\n\n while (a === b) {\n if (i++ < 2) {\n end = \"\\n \".concat(a).concat(end);\n } else {\n other = a;\n }\n\n actualLines.pop();\n expectedLines.pop();\n if (actualLines.length === 0 || expectedLines.length === 0) break;\n a = actualLines[actualLines.length - 1];\n b = expectedLines[expectedLines.length - 1];\n }\n\n var maxLines = Math.max(actualLines.length, expectedLines.length); // Strict equal with identical objects that are not identical by reference.\n // E.g., assert.deepStrictEqual({ a: Symbol() }, { a: Symbol() })\n\n if (maxLines === 0) {\n // We have to get the result again. The lines were all removed before.\n var _actualLines = actualInspected.split('\\n'); // Only remove lines in case it makes sense to collapse those.\n // TODO: Accept env to always show the full error.\n\n\n if (_actualLines.length > 30) {\n _actualLines[26] = \"\".concat(blue, \"...\").concat(white);\n\n while (_actualLines.length > 27) {\n _actualLines.pop();\n }\n }\n\n return \"\".concat(kReadableOperator.notIdentical, \"\\n\\n\").concat(_actualLines.join('\\n'), \"\\n\");\n }\n\n if (i > 3) {\n end = \"\\n\".concat(blue, \"...\").concat(white).concat(end);\n skipped = true;\n }\n\n if (other !== '') {\n end = \"\\n \".concat(other).concat(end);\n other = '';\n }\n\n var printedLines = 0;\n var msg = kReadableOperator[operator] + \"\\n\".concat(green, \"+ actual\").concat(white, \" \").concat(red, \"- expected\").concat(white);\n var skippedMsg = \" \".concat(blue, \"...\").concat(white, \" Lines skipped\");\n\n for (i = 0; i < maxLines; i++) {\n // Only extra expected lines exist\n var cur = i - lastPos;\n\n if (actualLines.length < i + 1) {\n // If the last diverging line is more than one line above and the\n // current line is at least line three, add some of the former lines and\n // also add dots to indicate skipped entries.\n if (cur > 1 && i > 2) {\n if (cur > 4) {\n res += \"\\n\".concat(blue, \"...\").concat(white);\n skipped = true;\n } else if (cur > 3) {\n res += \"\\n \".concat(expectedLines[i - 2]);\n printedLines++;\n }\n\n res += \"\\n \".concat(expectedLines[i - 1]);\n printedLines++;\n } // Mark the current line as the last diverging one.\n\n\n lastPos = i; // Add the expected line to the cache.\n\n other += \"\\n\".concat(red, \"-\").concat(white, \" \").concat(expectedLines[i]);\n printedLines++; // Only extra actual lines exist\n } else if (expectedLines.length < i + 1) {\n // If the last diverging line is more than one line above and the\n // current line is at least line three, add some of the former lines and\n // also add dots to indicate skipped entries.\n if (cur > 1 && i > 2) {\n if (cur > 4) {\n res += \"\\n\".concat(blue, \"...\").concat(white);\n skipped = true;\n } else if (cur > 3) {\n res += \"\\n \".concat(actualLines[i - 2]);\n printedLines++;\n }\n\n res += \"\\n \".concat(actualLines[i - 1]);\n printedLines++;\n } // Mark the current line as the last diverging one.\n\n\n lastPos = i; // Add the actual line to the result.\n\n res += \"\\n\".concat(green, \"+\").concat(white, \" \").concat(actualLines[i]);\n printedLines++; // Lines diverge\n } else {\n var expectedLine = expectedLines[i];\n var actualLine = actualLines[i]; // If the lines diverge, specifically check for lines that only diverge by\n // a trailing comma. In that case it is actually identical and we should\n // mark it as such.\n\n var divergingLines = actualLine !== expectedLine && (!endsWith(actualLine, ',') || actualLine.slice(0, -1) !== expectedLine); // If the expected line has a trailing comma but is otherwise identical,\n // add a comma at the end of the actual line. Otherwise the output could\n // look weird as in:\n //\n // [\n // 1 // No comma at the end!\n // + 2\n // ]\n //\n\n if (divergingLines && endsWith(expectedLine, ',') && expectedLine.slice(0, -1) === actualLine) {\n divergingLines = false;\n actualLine += ',';\n }\n\n if (divergingLines) {\n // If the last diverging line is more than one line above and the\n // current line is at least line three, add some of the former lines and\n // also add dots to indicate skipped entries.\n if (cur > 1 && i > 2) {\n if (cur > 4) {\n res += \"\\n\".concat(blue, \"...\").concat(white);\n skipped = true;\n } else if (cur > 3) {\n res += \"\\n \".concat(actualLines[i - 2]);\n printedLines++;\n }\n\n res += \"\\n \".concat(actualLines[i - 1]);\n printedLines++;\n } // Mark the current line as the last diverging one.\n\n\n lastPos = i; // Add the actual line to the result and cache the expected diverging\n // line so consecutive diverging lines show up as +++--- and not +-+-+-.\n\n res += \"\\n\".concat(green, \"+\").concat(white, \" \").concat(actualLine);\n other += \"\\n\".concat(red, \"-\").concat(white, \" \").concat(expectedLine);\n printedLines += 2; // Lines are identical\n } else {\n // Add all cached information to the result before adding other things\n // and reset the cache.\n res += other;\n other = ''; // If the last diverging line is exactly one line above or if it is the\n // very first line, add the line to the result.\n\n if (cur === 1 || i === 0) {\n res += \"\\n \".concat(actualLine);\n printedLines++;\n }\n }\n } // Inspected object to big (Show ~20 rows max)\n\n\n if (printedLines > 20 && i < maxLines - 2) {\n return \"\".concat(msg).concat(skippedMsg, \"\\n\").concat(res, \"\\n\").concat(blue, \"...\").concat(white).concat(other, \"\\n\") + \"\".concat(blue, \"...\").concat(white);\n }\n }\n\n return \"\".concat(msg).concat(skipped ? skippedMsg : '', \"\\n\").concat(res).concat(other).concat(end).concat(indicator);\n}\n\nvar AssertionError =\n/*#__PURE__*/\nfunction (_Error) {\n _inherits(AssertionError, _Error);\n\n function AssertionError(options) {\n var _this;\n\n _classCallCheck(this, AssertionError);\n\n if (_typeof(options) !== 'object' || options === null) {\n throw new ERR_INVALID_ARG_TYPE('options', 'Object', options);\n }\n\n var message = options.message,\n operator = options.operator,\n stackStartFn = options.stackStartFn;\n var actual = options.actual,\n expected = options.expected;\n var limit = Error.stackTraceLimit;\n Error.stackTraceLimit = 0;\n\n if (message != null) {\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError).call(this, String(message)));\n } else {\n if (process.stderr && process.stderr.isTTY) {\n // Reset on each call to make sure we handle dynamically set environment\n // variables correct.\n if (process.stderr && process.stderr.getColorDepth && process.stderr.getColorDepth() !== 1) {\n blue = \"\\x1B[34m\";\n green = \"\\x1B[32m\";\n white = \"\\x1B[39m\";\n red = \"\\x1B[31m\";\n } else {\n blue = '';\n green = '';\n white = '';\n red = '';\n }\n } // Prevent the error stack from being visible by duplicating the error\n // in a very close way to the original in case both sides are actually\n // instances of Error.\n\n\n if (_typeof(actual) === 'object' && actual !== null && _typeof(expected) === 'object' && expected !== null && 'stack' in actual && actual instanceof Error && 'stack' in expected && expected instanceof Error) {\n actual = copyError(actual);\n expected = copyError(expected);\n }\n\n if (operator === 'deepStrictEqual' || operator === 'strictEqual') {\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError).call(this, createErrDiff(actual, expected, operator)));\n } else if (operator === 'notDeepStrictEqual' || operator === 'notStrictEqual') {\n // In case the objects are equal but the operator requires unequal, show\n // the first object and say A equals B\n var base = kReadableOperator[operator];\n var res = inspectValue(actual).split('\\n'); // In case \"actual\" is an object, it should not be reference equal.\n\n if (operator === 'notStrictEqual' && _typeof(actual) === 'object' && actual !== null) {\n base = kReadableOperator.notStrictEqualObject;\n } // Only remove lines in case it makes sense to collapse those.\n // TODO: Accept env to always show the full error.\n\n\n if (res.length > 30) {\n res[26] = \"\".concat(blue, \"...\").concat(white);\n\n while (res.length > 27) {\n res.pop();\n }\n } // Only print a single input.\n\n\n if (res.length === 1) {\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError).call(this, \"\".concat(base, \" \").concat(res[0])));\n } else {\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError).call(this, \"\".concat(base, \"\\n\\n\").concat(res.join('\\n'), \"\\n\")));\n }\n } else {\n var _res = inspectValue(actual);\n\n var other = '';\n var knownOperators = kReadableOperator[operator];\n\n if (operator === 'notDeepEqual' || operator === 'notEqual') {\n _res = \"\".concat(kReadableOperator[operator], \"\\n\\n\").concat(_res);\n\n if (_res.length > 1024) {\n _res = \"\".concat(_res.slice(0, 1021), \"...\");\n }\n } else {\n other = \"\".concat(inspectValue(expected));\n\n if (_res.length > 512) {\n _res = \"\".concat(_res.slice(0, 509), \"...\");\n }\n\n if (other.length > 512) {\n other = \"\".concat(other.slice(0, 509), \"...\");\n }\n\n if (operator === 'deepEqual' || operator === 'equal') {\n _res = \"\".concat(knownOperators, \"\\n\\n\").concat(_res, \"\\n\\nshould equal\\n\\n\");\n } else {\n other = \" \".concat(operator, \" \").concat(other);\n }\n }\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError).call(this, \"\".concat(_res).concat(other)));\n }\n }\n\n Error.stackTraceLimit = limit;\n _this.generatedMessage = !message;\n Object.defineProperty(_assertThisInitialized(_this), 'name', {\n value: 'AssertionError [ERR_ASSERTION]',\n enumerable: false,\n writable: true,\n configurable: true\n });\n _this.code = 'ERR_ASSERTION';\n _this.actual = actual;\n _this.expected = expected;\n _this.operator = operator;\n\n if (Error.captureStackTrace) {\n // eslint-disable-next-line no-restricted-syntax\n Error.captureStackTrace(_assertThisInitialized(_this), stackStartFn);\n } // Create error message including the error code in the name.\n\n\n _this.stack; // Reset the name.\n\n _this.name = 'AssertionError';\n return _possibleConstructorReturn(_this);\n }\n\n _createClass(AssertionError, [{\n key: \"toString\",\n value: function toString() {\n return \"\".concat(this.name, \" [\").concat(this.code, \"]: \").concat(this.message);\n }\n }, {\n key: inspect.custom,\n value: function value(recurseTimes, ctx) {\n // This limits the `actual` and `expected` property default inspection to\n // the minimum depth. Otherwise those values would be too verbose compared\n // to the actual error message which contains a combined view of these two\n // input values.\n return inspect(this, _objectSpread({}, ctx, {\n customInspect: false,\n depth: 0\n }));\n }\n }]);\n\n return AssertionError;\n}(_wrapNativeSuper(Error));\n\nmodule.exports = AssertionError;","// Currently in sync with Node.js lib/internal/errors.js\n// https://github.com/nodejs/node/commit/3b044962c48fe313905877a96b5d0894a5404f6f\n\n/* eslint node-core/documented-errors: \"error\" */\n\n/* eslint node-core/alphabetize-errors: \"error\" */\n\n/* eslint node-core/prefer-util-format-errors: \"error\" */\n'use strict'; // The whole point behind this internal module is to allow Node.js to no\n// longer be forced to treat every error message change as a semver-major\n// change. The NodeError classes here all expose a `code` property whose\n// value statically and permanently identifies the error. While the error\n// message may change, the code should not.\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nvar codes = {}; // Lazy loaded\n\nvar assert;\nvar util;\n\nfunction createErrorType(code, message, Base) {\n if (!Base) {\n Base = Error;\n }\n\n function getMessage(arg1, arg2, arg3) {\n if (typeof message === 'string') {\n return message;\n } else {\n return message(arg1, arg2, arg3);\n }\n }\n\n var NodeError =\n /*#__PURE__*/\n function (_Base) {\n _inherits(NodeError, _Base);\n\n function NodeError(arg1, arg2, arg3) {\n var _this;\n\n _classCallCheck(this, NodeError);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(NodeError).call(this, getMessage(arg1, arg2, arg3)));\n _this.code = code;\n return _this;\n }\n\n return NodeError;\n }(Base);\n\n codes[code] = NodeError;\n} // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js\n\n\nfunction oneOf(expected, thing) {\n if (Array.isArray(expected)) {\n var len = expected.length;\n expected = expected.map(function (i) {\n return String(i);\n });\n\n if (len > 2) {\n return \"one of \".concat(thing, \" \").concat(expected.slice(0, len - 1).join(', '), \", or \") + expected[len - 1];\n } else if (len === 2) {\n return \"one of \".concat(thing, \" \").concat(expected[0], \" or \").concat(expected[1]);\n } else {\n return \"of \".concat(thing, \" \").concat(expected[0]);\n }\n } else {\n return \"of \".concat(thing, \" \").concat(String(expected));\n }\n} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith\n\n\nfunction startsWith(str, search, pos) {\n return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;\n} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith\n\n\nfunction endsWith(str, search, this_len) {\n if (this_len === undefined || this_len > str.length) {\n this_len = str.length;\n }\n\n return str.substring(this_len - search.length, this_len) === search;\n} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes\n\n\nfunction includes(str, search, start) {\n if (typeof start !== 'number') {\n start = 0;\n }\n\n if (start + search.length > str.length) {\n return false;\n } else {\n return str.indexOf(search, start) !== -1;\n }\n}\n\ncreateErrorType('ERR_AMBIGUOUS_ARGUMENT', 'The \"%s\" argument is ambiguous. %s', TypeError);\ncreateErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) {\n if (assert === undefined) assert = require('../assert');\n assert(typeof name === 'string', \"'name' must be a string\"); // determiner: 'must be' or 'must not be'\n\n var determiner;\n\n if (typeof expected === 'string' && startsWith(expected, 'not ')) {\n determiner = 'must not be';\n expected = expected.replace(/^not /, '');\n } else {\n determiner = 'must be';\n }\n\n var msg;\n\n if (endsWith(name, ' argument')) {\n // For cases like 'first argument'\n msg = \"The \".concat(name, \" \").concat(determiner, \" \").concat(oneOf(expected, 'type'));\n } else {\n var type = includes(name, '.') ? 'property' : 'argument';\n msg = \"The \\\"\".concat(name, \"\\\" \").concat(type, \" \").concat(determiner, \" \").concat(oneOf(expected, 'type'));\n } // TODO(BridgeAR): Improve the output by showing `null` and similar.\n\n\n msg += \". Received type \".concat(_typeof(actual));\n return msg;\n}, TypeError);\ncreateErrorType('ERR_INVALID_ARG_VALUE', function (name, value) {\n var reason = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'is invalid';\n if (util === undefined) util = require('util/');\n var inspected = util.inspect(value);\n\n if (inspected.length > 128) {\n inspected = \"\".concat(inspected.slice(0, 128), \"...\");\n }\n\n return \"The argument '\".concat(name, \"' \").concat(reason, \". Received \").concat(inspected);\n}, TypeError, RangeError);\ncreateErrorType('ERR_INVALID_RETURN_VALUE', function (input, name, value) {\n var type;\n\n if (value && value.constructor && value.constructor.name) {\n type = \"instance of \".concat(value.constructor.name);\n } else {\n type = \"type \".concat(_typeof(value));\n }\n\n return \"Expected \".concat(input, \" to be returned from the \\\"\").concat(name, \"\\\"\") + \" function but got \".concat(type, \".\");\n}, TypeError);\ncreateErrorType('ERR_MISSING_ARGS', function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (assert === undefined) assert = require('../assert');\n assert(args.length > 0, 'At least one arg needs to be specified');\n var msg = 'The ';\n var len = args.length;\n args = args.map(function (a) {\n return \"\\\"\".concat(a, \"\\\"\");\n });\n\n switch (len) {\n case 1:\n msg += \"\".concat(args[0], \" argument\");\n break;\n\n case 2:\n msg += \"\".concat(args[0], \" and \").concat(args[1], \" arguments\");\n break;\n\n default:\n msg += args.slice(0, len - 1).join(', ');\n msg += \", and \".concat(args[len - 1], \" arguments\");\n break;\n }\n\n return \"\".concat(msg, \" must be specified\");\n}, TypeError);\nmodule.exports.codes = codes;","// Currently in sync with Node.js lib/internal/util/comparisons.js\n// https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9\n'use strict';\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar regexFlagsSupported = /a/g.flags !== undefined;\n\nvar arrayFromSet = function arrayFromSet(set) {\n var array = [];\n set.forEach(function (value) {\n return array.push(value);\n });\n return array;\n};\n\nvar arrayFromMap = function arrayFromMap(map) {\n var array = [];\n map.forEach(function (value, key) {\n return array.push([key, value]);\n });\n return array;\n};\n\nvar objectIs = Object.is ? Object.is : require('object-is');\nvar objectGetOwnPropertySymbols = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols : function () {\n return [];\n};\nvar numberIsNaN = Number.isNaN ? Number.isNaN : require('is-nan');\n\nfunction uncurryThis(f) {\n return f.call.bind(f);\n}\n\nvar hasOwnProperty = uncurryThis(Object.prototype.hasOwnProperty);\nvar propertyIsEnumerable = uncurryThis(Object.prototype.propertyIsEnumerable);\nvar objectToString = uncurryThis(Object.prototype.toString);\n\nvar _require$types = require('util/').types,\n isAnyArrayBuffer = _require$types.isAnyArrayBuffer,\n isArrayBufferView = _require$types.isArrayBufferView,\n isDate = _require$types.isDate,\n isMap = _require$types.isMap,\n isRegExp = _require$types.isRegExp,\n isSet = _require$types.isSet,\n isNativeError = _require$types.isNativeError,\n isBoxedPrimitive = _require$types.isBoxedPrimitive,\n isNumberObject = _require$types.isNumberObject,\n isStringObject = _require$types.isStringObject,\n isBooleanObject = _require$types.isBooleanObject,\n isBigIntObject = _require$types.isBigIntObject,\n isSymbolObject = _require$types.isSymbolObject,\n isFloat32Array = _require$types.isFloat32Array,\n isFloat64Array = _require$types.isFloat64Array;\n\nfunction isNonIndex(key) {\n if (key.length === 0 || key.length > 10) return true;\n\n for (var i = 0; i < key.length; i++) {\n var code = key.charCodeAt(i);\n if (code < 48 || code > 57) return true;\n } // The maximum size for an array is 2 ** 32 -1.\n\n\n return key.length === 10 && key >= Math.pow(2, 32);\n}\n\nfunction getOwnNonIndexProperties(value) {\n return Object.keys(value).filter(isNonIndex).concat(objectGetOwnPropertySymbols(value).filter(Object.prototype.propertyIsEnumerable.bind(value)));\n} // Taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js\n// original notice:\n\n/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>\n * @license MIT\n */\n\n\nfunction compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n\n if (y < x) {\n return 1;\n }\n\n return 0;\n}\n\nvar ONLY_ENUMERABLE = undefined;\nvar kStrict = true;\nvar kLoose = false;\nvar kNoIterator = 0;\nvar kIsArray = 1;\nvar kIsSet = 2;\nvar kIsMap = 3; // Check if they have the same source and flags\n\nfunction areSimilarRegExps(a, b) {\n return regexFlagsSupported ? a.source === b.source && a.flags === b.flags : RegExp.prototype.toString.call(a) === RegExp.prototype.toString.call(b);\n}\n\nfunction areSimilarFloatArrays(a, b) {\n if (a.byteLength !== b.byteLength) {\n return false;\n }\n\n for (var offset = 0; offset < a.byteLength; offset++) {\n if (a[offset] !== b[offset]) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction areSimilarTypedArrays(a, b) {\n if (a.byteLength !== b.byteLength) {\n return false;\n }\n\n return compare(new Uint8Array(a.buffer, a.byteOffset, a.byteLength), new Uint8Array(b.buffer, b.byteOffset, b.byteLength)) === 0;\n}\n\nfunction areEqualArrayBuffers(buf1, buf2) {\n return buf1.byteLength === buf2.byteLength && compare(new Uint8Array(buf1), new Uint8Array(buf2)) === 0;\n}\n\nfunction isEqualBoxedPrimitive(val1, val2) {\n if (isNumberObject(val1)) {\n return isNumberObject(val2) && objectIs(Number.prototype.valueOf.call(val1), Number.prototype.valueOf.call(val2));\n }\n\n if (isStringObject(val1)) {\n return isStringObject(val2) && String.prototype.valueOf.call(val1) === String.prototype.valueOf.call(val2);\n }\n\n if (isBooleanObject(val1)) {\n return isBooleanObject(val2) && Boolean.prototype.valueOf.call(val1) === Boolean.prototype.valueOf.call(val2);\n }\n\n if (isBigIntObject(val1)) {\n return isBigIntObject(val2) && BigInt.prototype.valueOf.call(val1) === BigInt.prototype.valueOf.call(val2);\n }\n\n return isSymbolObject(val2) && Symbol.prototype.valueOf.call(val1) === Symbol.prototype.valueOf.call(val2);\n} // Notes: Type tags are historical [[Class]] properties that can be set by\n// FunctionTemplate::SetClassName() in C++ or Symbol.toStringTag in JS\n// and retrieved using Object.prototype.toString.call(obj) in JS\n// See https://tc39.github.io/ecma262/#sec-object.prototype.tostring\n// for a list of tags pre-defined in the spec.\n// There are some unspecified tags in the wild too (e.g. typed array tags).\n// Since tags can be altered, they only serve fast failures\n//\n// Typed arrays and buffers are checked by comparing the content in their\n// underlying ArrayBuffer. This optimization requires that it's\n// reasonable to interpret their underlying memory in the same way,\n// which is checked by comparing their type tags.\n// (e.g. a Uint8Array and a Uint16Array with the same memory content\n// could still be different because they will be interpreted differently).\n//\n// For strict comparison, objects should have\n// a) The same built-in type tags\n// b) The same prototypes.\n\n\nfunction innerDeepEqual(val1, val2, strict, memos) {\n // All identical values are equivalent, as determined by ===.\n if (val1 === val2) {\n if (val1 !== 0) return true;\n return strict ? objectIs(val1, val2) : true;\n } // Check more closely if val1 and val2 are equal.\n\n\n if (strict) {\n if (_typeof(val1) !== 'object') {\n return typeof val1 === 'number' && numberIsNaN(val1) && numberIsNaN(val2);\n }\n\n if (_typeof(val2) !== 'object' || val1 === null || val2 === null) {\n return false;\n }\n\n if (Object.getPrototypeOf(val1) !== Object.getPrototypeOf(val2)) {\n return false;\n }\n } else {\n if (val1 === null || _typeof(val1) !== 'object') {\n if (val2 === null || _typeof(val2) !== 'object') {\n // eslint-disable-next-line eqeqeq\n return val1 == val2;\n }\n\n return false;\n }\n\n if (val2 === null || _typeof(val2) !== 'object') {\n return false;\n }\n }\n\n var val1Tag = objectToString(val1);\n var val2Tag = objectToString(val2);\n\n if (val1Tag !== val2Tag) {\n return false;\n }\n\n if (Array.isArray(val1)) {\n // Check for sparse arrays and general fast path\n if (val1.length !== val2.length) {\n return false;\n }\n\n var keys1 = getOwnNonIndexProperties(val1, ONLY_ENUMERABLE);\n var keys2 = getOwnNonIndexProperties(val2, ONLY_ENUMERABLE);\n\n if (keys1.length !== keys2.length) {\n return false;\n }\n\n return keyCheck(val1, val2, strict, memos, kIsArray, keys1);\n } // [browserify] This triggers on certain types in IE (Map/Set) so we don't\n // wan't to early return out of the rest of the checks. However we can check\n // if the second value is one of these values and the first isn't.\n\n\n if (val1Tag === '[object Object]') {\n // return keyCheck(val1, val2, strict, memos, kNoIterator);\n if (!isMap(val1) && isMap(val2) || !isSet(val1) && isSet(val2)) {\n return false;\n }\n }\n\n if (isDate(val1)) {\n if (!isDate(val2) || Date.prototype.getTime.call(val1) !== Date.prototype.getTime.call(val2)) {\n return false;\n }\n } else if (isRegExp(val1)) {\n if (!isRegExp(val2) || !areSimilarRegExps(val1, val2)) {\n return false;\n }\n } else if (isNativeError(val1) || val1 instanceof Error) {\n // Do not compare the stack as it might differ even though the error itself\n // is otherwise identical.\n if (val1.message !== val2.message || val1.name !== val2.name) {\n return false;\n }\n } else if (isArrayBufferView(val1)) {\n if (!strict && (isFloat32Array(val1) || isFloat64Array(val1))) {\n if (!areSimilarFloatArrays(val1, val2)) {\n return false;\n }\n } else if (!areSimilarTypedArrays(val1, val2)) {\n return false;\n } // Buffer.compare returns true, so val1.length === val2.length. If they both\n // only contain numeric keys, we don't need to exam further than checking\n // the symbols.\n\n\n var _keys = getOwnNonIndexProperties(val1, ONLY_ENUMERABLE);\n\n var _keys2 = getOwnNonIndexProperties(val2, ONLY_ENUMERABLE);\n\n if (_keys.length !== _keys2.length) {\n return false;\n }\n\n return keyCheck(val1, val2, strict, memos, kNoIterator, _keys);\n } else if (isSet(val1)) {\n if (!isSet(val2) || val1.size !== val2.size) {\n return false;\n }\n\n return keyCheck(val1, val2, strict, memos, kIsSet);\n } else if (isMap(val1)) {\n if (!isMap(val2) || val1.size !== val2.size) {\n return false;\n }\n\n return keyCheck(val1, val2, strict, memos, kIsMap);\n } else if (isAnyArrayBuffer(val1)) {\n if (!areEqualArrayBuffers(val1, val2)) {\n return false;\n }\n } else if (isBoxedPrimitive(val1) && !isEqualBoxedPrimitive(val1, val2)) {\n return false;\n }\n\n return keyCheck(val1, val2, strict, memos, kNoIterator);\n}\n\nfunction getEnumerables(val, keys) {\n return keys.filter(function (k) {\n return propertyIsEnumerable(val, k);\n });\n}\n\nfunction keyCheck(val1, val2, strict, memos, iterationType, aKeys) {\n // For all remaining Object pairs, including Array, objects and Maps,\n // equivalence is determined by having:\n // a) The same number of owned enumerable properties\n // b) The same set of keys/indexes (although not necessarily the same order)\n // c) Equivalent values for every corresponding key/index\n // d) For Sets and Maps, equal contents\n // Note: this accounts for both named and indexed properties on Arrays.\n if (arguments.length === 5) {\n aKeys = Object.keys(val1);\n var bKeys = Object.keys(val2); // The pair must have the same number of owned properties.\n\n if (aKeys.length !== bKeys.length) {\n return false;\n }\n } // Cheap key test\n\n\n var i = 0;\n\n for (; i < aKeys.length; i++) {\n if (!hasOwnProperty(val2, aKeys[i])) {\n return false;\n }\n }\n\n if (strict && arguments.length === 5) {\n var symbolKeysA = objectGetOwnPropertySymbols(val1);\n\n if (symbolKeysA.length !== 0) {\n var count = 0;\n\n for (i = 0; i < symbolKeysA.length; i++) {\n var key = symbolKeysA[i];\n\n if (propertyIsEnumerable(val1, key)) {\n if (!propertyIsEnumerable(val2, key)) {\n return false;\n }\n\n aKeys.push(key);\n count++;\n } else if (propertyIsEnumerable(val2, key)) {\n return false;\n }\n }\n\n var symbolKeysB = objectGetOwnPropertySymbols(val2);\n\n if (symbolKeysA.length !== symbolKeysB.length && getEnumerables(val2, symbolKeysB).length !== count) {\n return false;\n }\n } else {\n var _symbolKeysB = objectGetOwnPropertySymbols(val2);\n\n if (_symbolKeysB.length !== 0 && getEnumerables(val2, _symbolKeysB).length !== 0) {\n return false;\n }\n }\n }\n\n if (aKeys.length === 0 && (iterationType === kNoIterator || iterationType === kIsArray && val1.length === 0 || val1.size === 0)) {\n return true;\n } // Use memos to handle cycles.\n\n\n if (memos === undefined) {\n memos = {\n val1: new Map(),\n val2: new Map(),\n position: 0\n };\n } else {\n // We prevent up to two map.has(x) calls by directly retrieving the value\n // and checking for undefined. The map can only contain numbers, so it is\n // safe to check for undefined only.\n var val2MemoA = memos.val1.get(val1);\n\n if (val2MemoA !== undefined) {\n var val2MemoB = memos.val2.get(val2);\n\n if (val2MemoB !== undefined) {\n return val2MemoA === val2MemoB;\n }\n }\n\n memos.position++;\n }\n\n memos.val1.set(val1, memos.position);\n memos.val2.set(val2, memos.position);\n var areEq = objEquiv(val1, val2, strict, aKeys, memos, iterationType);\n memos.val1.delete(val1);\n memos.val2.delete(val2);\n return areEq;\n}\n\nfunction setHasEqualElement(set, val1, strict, memo) {\n // Go looking.\n var setValues = arrayFromSet(set);\n\n for (var i = 0; i < setValues.length; i++) {\n var val2 = setValues[i];\n\n if (innerDeepEqual(val1, val2, strict, memo)) {\n // Remove the matching element to make sure we do not check that again.\n set.delete(val2);\n return true;\n }\n }\n\n return false;\n} // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness#Loose_equality_using\n// Sadly it is not possible to detect corresponding values properly in case the\n// type is a string, number, bigint or boolean. The reason is that those values\n// can match lots of different string values (e.g., 1n == '+00001').\n\n\nfunction findLooseMatchingPrimitives(prim) {\n switch (_typeof(prim)) {\n case 'undefined':\n return null;\n\n case 'object':\n // Only pass in null as object!\n return undefined;\n\n case 'symbol':\n return false;\n\n case 'string':\n prim = +prim;\n // Loose equal entries exist only if the string is possible to convert to\n // a regular number and not NaN.\n // Fall through\n\n case 'number':\n if (numberIsNaN(prim)) {\n return false;\n }\n\n }\n\n return true;\n}\n\nfunction setMightHaveLoosePrim(a, b, prim) {\n var altValue = findLooseMatchingPrimitives(prim);\n if (altValue != null) return altValue;\n return b.has(altValue) && !a.has(altValue);\n}\n\nfunction mapMightHaveLoosePrim(a, b, prim, item, memo) {\n var altValue = findLooseMatchingPrimitives(prim);\n\n if (altValue != null) {\n return altValue;\n }\n\n var curB = b.get(altValue);\n\n if (curB === undefined && !b.has(altValue) || !innerDeepEqual(item, curB, false, memo)) {\n return false;\n }\n\n return !a.has(altValue) && innerDeepEqual(item, curB, false, memo);\n}\n\nfunction setEquiv(a, b, strict, memo) {\n // This is a lazily initiated Set of entries which have to be compared\n // pairwise.\n var set = null;\n var aValues = arrayFromSet(a);\n\n for (var i = 0; i < aValues.length; i++) {\n var val = aValues[i]; // Note: Checking for the objects first improves the performance for object\n // heavy sets but it is a minor slow down for primitives. As they are fast\n // to check this improves the worst case scenario instead.\n\n if (_typeof(val) === 'object' && val !== null) {\n if (set === null) {\n set = new Set();\n } // If the specified value doesn't exist in the second set its an not null\n // object (or non strict only: a not matching primitive) we'll need to go\n // hunting for something thats deep-(strict-)equal to it. To make this\n // O(n log n) complexity we have to copy these values in a new set first.\n\n\n set.add(val);\n } else if (!b.has(val)) {\n if (strict) return false; // Fast path to detect missing string, symbol, undefined and null values.\n\n if (!setMightHaveLoosePrim(a, b, val)) {\n return false;\n }\n\n if (set === null) {\n set = new Set();\n }\n\n set.add(val);\n }\n }\n\n if (set !== null) {\n var bValues = arrayFromSet(b);\n\n for (var _i = 0; _i < bValues.length; _i++) {\n var _val = bValues[_i]; // We have to check if a primitive value is already\n // matching and only if it's not, go hunting for it.\n\n if (_typeof(_val) === 'object' && _val !== null) {\n if (!setHasEqualElement(set, _val, strict, memo)) return false;\n } else if (!strict && !a.has(_val) && !setHasEqualElement(set, _val, strict, memo)) {\n return false;\n }\n }\n\n return set.size === 0;\n }\n\n return true;\n}\n\nfunction mapHasEqualEntry(set, map, key1, item1, strict, memo) {\n // To be able to handle cases like:\n // Map([[{}, 'a'], [{}, 'b']]) vs Map([[{}, 'b'], [{}, 'a']])\n // ... we need to consider *all* matching keys, not just the first we find.\n var setValues = arrayFromSet(set);\n\n for (var i = 0; i < setValues.length; i++) {\n var key2 = setValues[i];\n\n if (innerDeepEqual(key1, key2, strict, memo) && innerDeepEqual(item1, map.get(key2), strict, memo)) {\n set.delete(key2);\n return true;\n }\n }\n\n return false;\n}\n\nfunction mapEquiv(a, b, strict, memo) {\n var set = null;\n var aEntries = arrayFromMap(a);\n\n for (var i = 0; i < aEntries.length; i++) {\n var _aEntries$i = _slicedToArray(aEntries[i], 2),\n key = _aEntries$i[0],\n item1 = _aEntries$i[1];\n\n if (_typeof(key) === 'object' && key !== null) {\n if (set === null) {\n set = new Set();\n }\n\n set.add(key);\n } else {\n // By directly retrieving the value we prevent another b.has(key) check in\n // almost all possible cases.\n var item2 = b.get(key);\n\n if (item2 === undefined && !b.has(key) || !innerDeepEqual(item1, item2, strict, memo)) {\n if (strict) return false; // Fast path to detect missing string, symbol, undefined and null\n // keys.\n\n if (!mapMightHaveLoosePrim(a, b, key, item1, memo)) return false;\n\n if (set === null) {\n set = new Set();\n }\n\n set.add(key);\n }\n }\n }\n\n if (set !== null) {\n var bEntries = arrayFromMap(b);\n\n for (var _i2 = 0; _i2 < bEntries.length; _i2++) {\n var _bEntries$_i = _slicedToArray(bEntries[_i2], 2),\n key = _bEntries$_i[0],\n item = _bEntries$_i[1];\n\n if (_typeof(key) === 'object' && key !== null) {\n if (!mapHasEqualEntry(set, a, key, item, strict, memo)) return false;\n } else if (!strict && (!a.has(key) || !innerDeepEqual(a.get(key), item, false, memo)) && !mapHasEqualEntry(set, a, key, item, false, memo)) {\n return false;\n }\n }\n\n return set.size === 0;\n }\n\n return true;\n}\n\nfunction objEquiv(a, b, strict, keys, memos, iterationType) {\n // Sets and maps don't have their entries accessible via normal object\n // properties.\n var i = 0;\n\n if (iterationType === kIsSet) {\n if (!setEquiv(a, b, strict, memos)) {\n return false;\n }\n } else if (iterationType === kIsMap) {\n if (!mapEquiv(a, b, strict, memos)) {\n return false;\n }\n } else if (iterationType === kIsArray) {\n for (; i < a.length; i++) {\n if (hasOwnProperty(a, i)) {\n if (!hasOwnProperty(b, i) || !innerDeepEqual(a[i], b[i], strict, memos)) {\n return false;\n }\n } else if (hasOwnProperty(b, i)) {\n return false;\n } else {\n // Array is sparse.\n var keysA = Object.keys(a);\n\n for (; i < keysA.length; i++) {\n var key = keysA[i];\n\n if (!hasOwnProperty(b, key) || !innerDeepEqual(a[key], b[key], strict, memos)) {\n return false;\n }\n }\n\n if (keysA.length !== Object.keys(b).length) {\n return false;\n }\n\n return true;\n }\n }\n } // The pair must have equivalent values for every corresponding key.\n // Possibly expensive deep test:\n\n\n for (i = 0; i < keys.length; i++) {\n var _key = keys[i];\n\n if (!innerDeepEqual(a[_key], b[_key], strict, memos)) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction isDeepEqual(val1, val2) {\n return innerDeepEqual(val1, val2, kLoose);\n}\n\nfunction isDeepStrictEqual(val1, val2) {\n return innerDeepEqual(val1, val2, kStrict);\n}\n\nmodule.exports = {\n isDeepEqual: isDeepEqual,\n isDeepStrictEqual: isDeepStrictEqual\n};","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar callBind = require('./');\n\nvar $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));\n\nmodule.exports = function callBoundIntrinsic(name, allowMissing) {\n\tvar intrinsic = GetIntrinsic(name, !!allowMissing);\n\tif (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {\n\t\treturn callBind(intrinsic);\n\t}\n\treturn intrinsic;\n};\n","'use strict';\n\nvar bind = require('function-bind');\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $apply = GetIntrinsic('%Function.prototype.apply%');\nvar $call = GetIntrinsic('%Function.prototype.call%');\nvar $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\nvar $max = GetIntrinsic('%Math.max%');\n\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = null;\n\t}\n}\n\nmodule.exports = function callBind(originalFunction) {\n\tvar func = $reflectApply(bind, $call, arguments);\n\tif ($gOPD && $defineProperty) {\n\t\tvar desc = $gOPD(func, 'length');\n\t\tif (desc.configurable) {\n\t\t\t// original length, plus the receiver, minus any additional arguments (after the receiver)\n\t\t\t$defineProperty(\n\t\t\t\tfunc,\n\t\t\t\t'length',\n\t\t\t\t{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }\n\t\t\t);\n\t\t}\n\t}\n\treturn func;\n};\n\nvar applyBind = function applyBind() {\n\treturn $reflectApply(bind, $apply, arguments);\n};\n\nif ($defineProperty) {\n\t$defineProperty(module.exports, 'apply', { value: applyBind });\n} else {\n\tmodule.exports.apply = applyBind;\n}\n","/*global window, global*/\nvar util = require(\"util\")\nvar assert = require(\"assert\")\nfunction now() { return new Date().getTime() }\n\nvar slice = Array.prototype.slice\nvar console\nvar times = {}\n\nif (typeof global !== \"undefined\" && global.console) {\n console = global.console\n} else if (typeof window !== \"undefined\" && window.console) {\n console = window.console\n} else {\n console = {}\n}\n\nvar functions = [\n [log, \"log\"],\n [info, \"info\"],\n [warn, \"warn\"],\n [error, \"error\"],\n [time, \"time\"],\n [timeEnd, \"timeEnd\"],\n [trace, \"trace\"],\n [dir, \"dir\"],\n [consoleAssert, \"assert\"]\n]\n\nfor (var i = 0; i < functions.length; i++) {\n var tuple = functions[i]\n var f = tuple[0]\n var name = tuple[1]\n\n if (!console[name]) {\n console[name] = f\n }\n}\n\nmodule.exports = console\n\nfunction log() {}\n\nfunction info() {\n console.log.apply(console, arguments)\n}\n\nfunction warn() {\n console.log.apply(console, arguments)\n}\n\nfunction error() {\n console.warn.apply(console, arguments)\n}\n\nfunction time(label) {\n times[label] = now()\n}\n\nfunction timeEnd(label) {\n var time = times[label]\n if (!time) {\n throw new Error(\"No such label: \" + label)\n }\n\n delete times[label]\n var duration = now() - time\n console.log(label + \": \" + duration + \"ms\")\n}\n\nfunction trace() {\n var err = new Error()\n err.name = \"Trace\"\n err.message = util.format.apply(null, arguments)\n console.error(err.stack)\n}\n\nfunction dir(object) {\n console.log(util.inspect(object) + \"\\n\")\n}\n\nfunction consoleAssert(expression) {\n if (!expression) {\n var arr = slice.call(arguments, 1)\n assert.ok(false, util.format.apply(null, arr))\n }\n}\n","var global = require('../internals/global');\nvar isCallable = require('../internals/is-callable');\nvar tryToString = require('../internals/try-to-string');\n\nvar TypeError = global.TypeError;\n\n// `Assert: IsCallable(argument) is true`\nmodule.exports = function (argument) {\n if (isCallable(argument)) return argument;\n throw TypeError(tryToString(argument) + ' is not a function');\n};\n","var global = require('../internals/global');\nvar isObject = require('../internals/is-object');\n\nvar String = global.String;\nvar TypeError = global.TypeError;\n\n// `Assert: Type(argument) is Object`\nmodule.exports = function (argument) {\n if (isObject(argument)) return argument;\n throw TypeError(String(argument) + ' is not an object');\n};\n","var toIndexedObject = require('../internals/to-indexed-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\n\n// `Array.prototype.{ indexOf, includes }` methods implementation\nvar createMethod = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIndexedObject($this);\n var length = lengthOfArrayLike(O);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare -- NaN check\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare -- NaN check\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) {\n if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.includes` method\n // https://tc39.es/ecma262/#sec-array.prototype.includes\n includes: createMethod(true),\n // `Array.prototype.indexOf` method\n // https://tc39.es/ecma262/#sec-array.prototype.indexof\n indexOf: createMethod(false)\n};\n","var fails = require('../internals/fails');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar V8_VERSION = require('../internals/engine-v8-version');\n\nvar SPECIES = wellKnownSymbol('species');\n\nmodule.exports = function (METHOD_NAME) {\n // We can't use this feature detection in V8 since it causes\n // deoptimization and serious performance degradation\n // https://github.com/zloirock/core-js/issues/677\n return V8_VERSION >= 51 || !fails(function () {\n var array = [];\n var constructor = array.constructor = {};\n constructor[SPECIES] = function () {\n return { foo: 1 };\n };\n return array[METHOD_NAME](Boolean).foo !== 1;\n });\n};\n","var global = require('../internals/global');\nvar isArray = require('../internals/is-array');\nvar isConstructor = require('../internals/is-constructor');\nvar isObject = require('../internals/is-object');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar SPECIES = wellKnownSymbol('species');\nvar Array = global.Array;\n\n// a part of `ArraySpeciesCreate` abstract operation\n// https://tc39.es/ecma262/#sec-arrayspeciescreate\nmodule.exports = function (originalArray) {\n var C;\n if (isArray(originalArray)) {\n C = originalArray.constructor;\n // cross-realm fallback\n if (isConstructor(C) && (C === Array || isArray(C.prototype))) C = undefined;\n else if (isObject(C)) {\n C = C[SPECIES];\n if (C === null) C = undefined;\n }\n } return C === undefined ? Array : C;\n};\n","var arraySpeciesConstructor = require('../internals/array-species-constructor');\n\n// `ArraySpeciesCreate` abstract operation\n// https://tc39.es/ecma262/#sec-arrayspeciescreate\nmodule.exports = function (originalArray, length) {\n return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nvar toString = uncurryThis({}.toString);\nvar stringSlice = uncurryThis(''.slice);\n\nmodule.exports = function (it) {\n return stringSlice(toString(it), 8, -1);\n};\n","var global = require('../internals/global');\nvar TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar isCallable = require('../internals/is-callable');\nvar classofRaw = require('../internals/classof-raw');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar Object = global.Object;\n\n// ES3 wrong here\nvar CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (error) { /* empty */ }\n};\n\n// getting tag from ES6+ `Object.prototype.toString`\nmodule.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {\n var O, tag, result;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag\n // builtinTag case\n : CORRECT_ARGUMENTS ? classofRaw(O)\n // ES3 arguments fallback\n : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;\n};\n","var hasOwn = require('../internals/has-own-property');\nvar ownKeys = require('../internals/own-keys');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\nvar definePropertyModule = require('../internals/object-define-property');\n\nmodule.exports = function (target, source, exceptions) {\n var keys = ownKeys(source);\n var defineProperty = definePropertyModule.f;\n var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {\n defineProperty(target, key, getOwnPropertyDescriptor(source, key));\n }\n }\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = DESCRIPTORS ? function (object, key, value) {\n return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","'use strict';\nvar toPropertyKey = require('../internals/to-property-key');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = function (object, key, value) {\n var propertyKey = toPropertyKey(key);\n if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));\n else object[propertyKey] = value;\n};\n","var global = require('../internals/global');\nvar isCallable = require('../internals/is-callable');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar makeBuiltIn = require('../internals/make-built-in');\nvar setGlobal = require('../internals/set-global');\n\nmodule.exports = function (O, key, value, options) {\n var unsafe = options ? !!options.unsafe : false;\n var simple = options ? !!options.enumerable : false;\n var noTargetGet = options ? !!options.noTargetGet : false;\n var name = options && options.name !== undefined ? options.name : key;\n if (isCallable(value)) makeBuiltIn(value, name, options);\n if (O === global) {\n if (simple) O[key] = value;\n else setGlobal(key, value);\n return O;\n } else if (!unsafe) {\n delete O[key];\n } else if (!noTargetGet && O[key]) {\n simple = true;\n }\n if (simple) O[key] = value;\n else createNonEnumerableProperty(O, key, value);\n return O;\n};\n","var fails = require('../internals/fails');\n\n// Detect IE8's incomplete defineProperty implementation\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing\n return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;\n});\n","var global = require('../internals/global');\nvar isObject = require('../internals/is-object');\n\nvar document = global.document;\n// typeof document.createElement is 'object' in old IE\nvar EXISTS = isObject(document) && isObject(document.createElement);\n\nmodule.exports = function (it) {\n return EXISTS ? document.createElement(it) : {};\n};\n","var getBuiltIn = require('../internals/get-built-in');\n\nmodule.exports = getBuiltIn('navigator', 'userAgent') || '';\n","var global = require('../internals/global');\nvar userAgent = require('../internals/engine-user-agent');\n\nvar process = global.process;\nvar Deno = global.Deno;\nvar versions = process && process.versions || Deno && Deno.version;\nvar v8 = versions && versions.v8;\nvar match, version;\n\nif (v8) {\n match = v8.split('.');\n // in old Chrome, versions of V8 isn't V8 = Chrome / 10\n // but their correct versions are not interesting for us\n version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);\n}\n\n// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`\n// so check `userAgent` even if `.v8` exists, but 0\nif (!version && userAgent) {\n match = userAgent.match(/Edge\\/(\\d+)/);\n if (!match || match[1] >= 74) {\n match = userAgent.match(/Chrome\\/(\\d+)/);\n if (match) version = +match[1];\n }\n}\n\nmodule.exports = version;\n","// IE8- don't enum bug keys\nmodule.exports = [\n 'constructor',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'toLocaleString',\n 'toString',\n 'valueOf'\n];\n","var global = require('../internals/global');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar setGlobal = require('../internals/set-global');\nvar copyConstructorProperties = require('../internals/copy-constructor-properties');\nvar isForced = require('../internals/is-forced');\n\n/*\n options.target - name of the target object\n options.global - target is the global object\n options.stat - export as static methods of target\n options.proto - export as prototype methods of target\n options.real - real prototype method for the `pure` version\n options.forced - export even if the native feature is available\n options.bind - bind methods to the target, required for the `pure` version\n options.wrap - wrap constructors to preventing global pollution, required for the `pure` version\n options.unsafe - use the simple assignment of property instead of delete + defineProperty\n options.sham - add a flag to not completely full polyfills\n options.enumerable - export as enumerable property\n options.noTargetGet - prevent calling a getter on target\n options.name - the .name of the function if it does not match the key\n*/\nmodule.exports = function (options, source) {\n var TARGET = options.target;\n var GLOBAL = options.global;\n var STATIC = options.stat;\n var FORCED, target, key, targetProperty, sourceProperty, descriptor;\n if (GLOBAL) {\n target = global;\n } else if (STATIC) {\n target = global[TARGET] || setGlobal(TARGET, {});\n } else {\n target = (global[TARGET] || {}).prototype;\n }\n if (target) for (key in source) {\n sourceProperty = source[key];\n if (options.noTargetGet) {\n descriptor = getOwnPropertyDescriptor(target, key);\n targetProperty = descriptor && descriptor.value;\n } else targetProperty = target[key];\n FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);\n // contained in target\n if (!FORCED && targetProperty !== undefined) {\n if (typeof sourceProperty == typeof targetProperty) continue;\n copyConstructorProperties(sourceProperty, targetProperty);\n }\n // add a flag to not completely full polyfills\n if (options.sham || (targetProperty && targetProperty.sham)) {\n createNonEnumerableProperty(sourceProperty, 'sham', true);\n }\n defineBuiltIn(target, key, sourceProperty, options);\n }\n};\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (error) {\n return true;\n }\n};\n","var fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es-x/no-function-prototype-bind -- safe\n var test = (function () { /* empty */ }).bind();\n // eslint-disable-next-line no-prototype-builtins -- safe\n return typeof test != 'function' || test.hasOwnProperty('prototype');\n});\n","var NATIVE_BIND = require('../internals/function-bind-native');\n\nvar call = Function.prototype.call;\n\nmodule.exports = NATIVE_BIND ? call.bind(call) : function () {\n return call.apply(call, arguments);\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar hasOwn = require('../internals/has-own-property');\n\nvar FunctionPrototype = Function.prototype;\n// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe\nvar getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;\n\nvar EXISTS = hasOwn(FunctionPrototype, 'name');\n// additional protection from minified / mangled / dropped function names\nvar PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';\nvar CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));\n\nmodule.exports = {\n EXISTS: EXISTS,\n PROPER: PROPER,\n CONFIGURABLE: CONFIGURABLE\n};\n","var NATIVE_BIND = require('../internals/function-bind-native');\n\nvar FunctionPrototype = Function.prototype;\nvar bind = FunctionPrototype.bind;\nvar call = FunctionPrototype.call;\nvar uncurryThis = NATIVE_BIND && bind.bind(call, call);\n\nmodule.exports = NATIVE_BIND ? function (fn) {\n return fn && uncurryThis(fn);\n} : function (fn) {\n return fn && function () {\n return call.apply(fn, arguments);\n };\n};\n","var global = require('../internals/global');\nvar isCallable = require('../internals/is-callable');\n\nvar aFunction = function (argument) {\n return isCallable(argument) ? argument : undefined;\n};\n\nmodule.exports = function (namespace, method) {\n return arguments.length < 2 ? aFunction(global[namespace]) : global[namespace] && global[namespace][method];\n};\n","var aCallable = require('../internals/a-callable');\n\n// `GetMethod` abstract operation\n// https://tc39.es/ecma262/#sec-getmethod\nmodule.exports = function (V, P) {\n var func = V[P];\n return func == null ? undefined : aCallable(func);\n};\n","var check = function (it) {\n return it && it.Math == Math && it;\n};\n\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nmodule.exports =\n // eslint-disable-next-line es-x/no-global-this -- safe\n check(typeof globalThis == 'object' && globalThis) ||\n check(typeof window == 'object' && window) ||\n // eslint-disable-next-line no-restricted-globals -- safe\n check(typeof self == 'object' && self) ||\n check(typeof global == 'object' && global) ||\n // eslint-disable-next-line no-new-func -- fallback\n (function () { return this; })() || Function('return this')();\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar toObject = require('../internals/to-object');\n\nvar hasOwnProperty = uncurryThis({}.hasOwnProperty);\n\n// `HasOwnProperty` abstract operation\n// https://tc39.es/ecma262/#sec-hasownproperty\n// eslint-disable-next-line es-x/no-object-hasown -- safe\nmodule.exports = Object.hasOwn || function hasOwn(it, key) {\n return hasOwnProperty(toObject(it), key);\n};\n","module.exports = {};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar createElement = require('../internals/document-create-element');\n\n// Thanks to IE8 for its funny defineProperty\nmodule.exports = !DESCRIPTORS && !fails(function () {\n // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing\n return Object.defineProperty(createElement('div'), 'a', {\n get: function () { return 7; }\n }).a != 7;\n});\n","var global = require('../internals/global');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar classof = require('../internals/classof-raw');\n\nvar Object = global.Object;\nvar split = uncurryThis(''.split);\n\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\nmodule.exports = fails(function () {\n // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346\n // eslint-disable-next-line no-prototype-builtins -- safe\n return !Object('z').propertyIsEnumerable(0);\n}) ? function (it) {\n return classof(it) == 'String' ? split(it, '') : Object(it);\n} : Object;\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar isCallable = require('../internals/is-callable');\nvar store = require('../internals/shared-store');\n\nvar functionToString = uncurryThis(Function.toString);\n\n// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper\nif (!isCallable(store.inspectSource)) {\n store.inspectSource = function (it) {\n return functionToString(it);\n };\n}\n\nmodule.exports = store.inspectSource;\n","var NATIVE_WEAK_MAP = require('../internals/native-weak-map');\nvar global = require('../internals/global');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar isObject = require('../internals/is-object');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar hasOwn = require('../internals/has-own-property');\nvar shared = require('../internals/shared-store');\nvar sharedKey = require('../internals/shared-key');\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar OBJECT_ALREADY_INITIALIZED = 'Object already initialized';\nvar TypeError = global.TypeError;\nvar WeakMap = global.WeakMap;\nvar set, get, has;\n\nvar enforce = function (it) {\n return has(it) ? get(it) : set(it, {});\n};\n\nvar getterFor = function (TYPE) {\n return function (it) {\n var state;\n if (!isObject(it) || (state = get(it)).type !== TYPE) {\n throw TypeError('Incompatible receiver, ' + TYPE + ' required');\n } return state;\n };\n};\n\nif (NATIVE_WEAK_MAP || shared.state) {\n var store = shared.state || (shared.state = new WeakMap());\n var wmget = uncurryThis(store.get);\n var wmhas = uncurryThis(store.has);\n var wmset = uncurryThis(store.set);\n set = function (it, metadata) {\n if (wmhas(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n wmset(store, it, metadata);\n return metadata;\n };\n get = function (it) {\n return wmget(store, it) || {};\n };\n has = function (it) {\n return wmhas(store, it);\n };\n} else {\n var STATE = sharedKey('state');\n hiddenKeys[STATE] = true;\n set = function (it, metadata) {\n if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n createNonEnumerableProperty(it, STATE, metadata);\n return metadata;\n };\n get = function (it) {\n return hasOwn(it, STATE) ? it[STATE] : {};\n };\n has = function (it) {\n return hasOwn(it, STATE);\n };\n}\n\nmodule.exports = {\n set: set,\n get: get,\n has: has,\n enforce: enforce,\n getterFor: getterFor\n};\n","var classof = require('../internals/classof-raw');\n\n// `IsArray` abstract operation\n// https://tc39.es/ecma262/#sec-isarray\n// eslint-disable-next-line es-x/no-array-isarray -- safe\nmodule.exports = Array.isArray || function isArray(argument) {\n return classof(argument) == 'Array';\n};\n","// `IsCallable` abstract operation\n// https://tc39.es/ecma262/#sec-iscallable\nmodule.exports = function (argument) {\n return typeof argument == 'function';\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\nvar classof = require('../internals/classof');\nvar getBuiltIn = require('../internals/get-built-in');\nvar inspectSource = require('../internals/inspect-source');\n\nvar noop = function () { /* empty */ };\nvar empty = [];\nvar construct = getBuiltIn('Reflect', 'construct');\nvar constructorRegExp = /^\\s*(?:class|function)\\b/;\nvar exec = uncurryThis(constructorRegExp.exec);\nvar INCORRECT_TO_STRING = !constructorRegExp.exec(noop);\n\nvar isConstructorModern = function isConstructor(argument) {\n if (!isCallable(argument)) return false;\n try {\n construct(noop, empty, argument);\n return true;\n } catch (error) {\n return false;\n }\n};\n\nvar isConstructorLegacy = function isConstructor(argument) {\n if (!isCallable(argument)) return false;\n switch (classof(argument)) {\n case 'AsyncFunction':\n case 'GeneratorFunction':\n case 'AsyncGeneratorFunction': return false;\n }\n try {\n // we can't check .prototype since constructors produced by .bind haven't it\n // `Function#toString` throws on some built-it function in some legacy engines\n // (for example, `DOMQuad` and similar in FF41-)\n return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));\n } catch (error) {\n return true;\n }\n};\n\nisConstructorLegacy.sham = true;\n\n// `IsConstructor` abstract operation\n// https://tc39.es/ecma262/#sec-isconstructor\nmodule.exports = !construct || fails(function () {\n var called;\n return isConstructorModern(isConstructorModern.call)\n || !isConstructorModern(Object)\n || !isConstructorModern(function () { called = true; })\n || called;\n}) ? isConstructorLegacy : isConstructorModern;\n","var fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\n\nvar replacement = /#|\\.prototype\\./;\n\nvar isForced = function (feature, detection) {\n var value = data[normalize(feature)];\n return value == POLYFILL ? true\n : value == NATIVE ? false\n : isCallable(detection) ? fails(detection)\n : !!detection;\n};\n\nvar normalize = isForced.normalize = function (string) {\n return String(string).replace(replacement, '.').toLowerCase();\n};\n\nvar data = isForced.data = {};\nvar NATIVE = isForced.NATIVE = 'N';\nvar POLYFILL = isForced.POLYFILL = 'P';\n\nmodule.exports = isForced;\n","var isCallable = require('../internals/is-callable');\n\nmodule.exports = function (it) {\n return typeof it == 'object' ? it !== null : isCallable(it);\n};\n","module.exports = false;\n","var global = require('../internals/global');\nvar getBuiltIn = require('../internals/get-built-in');\nvar isCallable = require('../internals/is-callable');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar Object = global.Object;\n\nmodule.exports = USE_SYMBOL_AS_UID ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n var $Symbol = getBuiltIn('Symbol');\n return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, Object(it));\n};\n","var toLength = require('../internals/to-length');\n\n// `LengthOfArrayLike` abstract operation\n// https://tc39.es/ecma262/#sec-lengthofarraylike\nmodule.exports = function (obj) {\n return toLength(obj.length);\n};\n","var fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\nvar hasOwn = require('../internals/has-own-property');\nvar defineProperty = require('../internals/object-define-property').f;\nvar CONFIGURABLE_FUNCTION_NAME = require('../internals/function-name').CONFIGURABLE;\nvar inspectSource = require('../internals/inspect-source');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar enforceInternalState = InternalStateModule.enforce;\nvar getInternalState = InternalStateModule.get;\n\nvar CONFIGURABLE_LENGTH = !fails(function () {\n return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;\n});\n\nvar TEMPLATE = String(String).split('String');\n\nvar makeBuiltIn = module.exports = function (value, name, options) {\n if (String(name).slice(0, 7) === 'Symbol(') {\n name = '[' + String(name).replace(/^Symbol\\(([^)]*)\\)/, '$1') + ']';\n }\n if (options && options.getter) name = 'get ' + name;\n if (options && options.setter) name = 'set ' + name;\n if (!hasOwn(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {\n defineProperty(value, 'name', { value: name, configurable: true });\n }\n if (CONFIGURABLE_LENGTH && options && hasOwn(options, 'arity') && value.length !== options.arity) {\n defineProperty(value, 'length', { value: options.arity });\n }\n var state = enforceInternalState(value);\n if (!hasOwn(state, 'source')) {\n state.source = TEMPLATE.join(typeof name == 'string' ? name : '');\n } return value;\n};\n\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n// eslint-disable-next-line no-extend-native -- required\nFunction.prototype.toString = makeBuiltIn(function toString() {\n return isCallable(this) && getInternalState(this).source || inspectSource(this);\n}, 'toString');\n","/* eslint-disable es-x/no-symbol -- required for testing */\nvar V8_VERSION = require('../internals/engine-v8-version');\nvar fails = require('../internals/fails');\n\n// eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing\nmodule.exports = !!Object.getOwnPropertySymbols && !fails(function () {\n var symbol = Symbol();\n // Chrome 38 Symbol has incorrect toString conversion\n // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances\n return !String(symbol) || !(Object(symbol) instanceof Symbol) ||\n // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances\n !Symbol.sham && V8_VERSION && V8_VERSION < 41;\n});\n","var global = require('../internals/global');\nvar isCallable = require('../internals/is-callable');\nvar inspectSource = require('../internals/inspect-source');\n\nvar WeakMap = global.WeakMap;\n\nmodule.exports = isCallable(WeakMap) && /native code/.test(inspectSource(WeakMap));\n","var global = require('../internals/global');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\nvar V8_PROTOTYPE_DEFINE_BUG = require('../internals/v8-prototype-define-bug');\nvar anObject = require('../internals/an-object');\nvar toPropertyKey = require('../internals/to-property-key');\n\nvar TypeError = global.TypeError;\n// eslint-disable-next-line es-x/no-object-defineproperty -- safe\nvar $defineProperty = Object.defineProperty;\n// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar ENUMERABLE = 'enumerable';\nvar CONFIGURABLE = 'configurable';\nvar WRITABLE = 'writable';\n\n// `Object.defineProperty` method\n// https://tc39.es/ecma262/#sec-object.defineproperty\nexports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {\n var current = $getOwnPropertyDescriptor(O, P);\n if (current && current[WRITABLE]) {\n O[P] = Attributes.value;\n Attributes = {\n configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],\n enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],\n writable: false\n };\n }\n } return $defineProperty(O, P, Attributes);\n} : $defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return $defineProperty(O, P, Attributes);\n } catch (error) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar call = require('../internals/function-call');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toPropertyKey = require('../internals/to-property-key');\nvar hasOwn = require('../internals/has-own-property');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\n\n// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// `Object.getOwnPropertyDescriptor` method\n// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor\nexports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {\n O = toIndexedObject(O);\n P = toPropertyKey(P);\n if (IE8_DOM_DEFINE) try {\n return $getOwnPropertyDescriptor(O, P);\n } catch (error) { /* empty */ }\n if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);\n};\n","var internalObjectKeys = require('../internals/object-keys-internal');\nvar enumBugKeys = require('../internals/enum-bug-keys');\n\nvar hiddenKeys = enumBugKeys.concat('length', 'prototype');\n\n// `Object.getOwnPropertyNames` method\n// https://tc39.es/ecma262/#sec-object.getownpropertynames\n// eslint-disable-next-line es-x/no-object-getownpropertynames -- safe\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return internalObjectKeys(O, hiddenKeys);\n};\n","// eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe\nexports.f = Object.getOwnPropertySymbols;\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nmodule.exports = uncurryThis({}.isPrototypeOf);\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar hasOwn = require('../internals/has-own-property');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar indexOf = require('../internals/array-includes').indexOf;\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar push = uncurryThis([].push);\n\nmodule.exports = function (object, names) {\n var O = toIndexedObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (hasOwn(O, key = names[i++])) {\n ~indexOf(result, key) || push(result, key);\n }\n return result;\n};\n","'use strict';\nvar $propertyIsEnumerable = {}.propertyIsEnumerable;\n// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// Nashorn ~ JDK8 bug\nvar NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);\n\n// `Object.prototype.propertyIsEnumerable` method implementation\n// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable\nexports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {\n var descriptor = getOwnPropertyDescriptor(this, V);\n return !!descriptor && descriptor.enumerable;\n} : $propertyIsEnumerable;\n","var global = require('../internals/global');\nvar call = require('../internals/function-call');\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\n\nvar TypeError = global.TypeError;\n\n// `OrdinaryToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-ordinarytoprimitive\nmodule.exports = function (input, pref) {\n var fn, val;\n if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;\n if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n","var getBuiltIn = require('../internals/get-built-in');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar getOwnPropertyNamesModule = require('../internals/object-get-own-property-names');\nvar getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');\nvar anObject = require('../internals/an-object');\n\nvar concat = uncurryThis([].concat);\n\n// all object keys, includes non-enumerable and symbols\nmodule.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {\n var keys = getOwnPropertyNamesModule.f(anObject(it));\n var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;\n return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;\n};\n","var global = require('../internals/global');\n\nvar TypeError = global.TypeError;\n\n// `RequireObjectCoercible` abstract operation\n// https://tc39.es/ecma262/#sec-requireobjectcoercible\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n","var global = require('../internals/global');\n\n// eslint-disable-next-line es-x/no-object-defineproperty -- safe\nvar defineProperty = Object.defineProperty;\n\nmodule.exports = function (key, value) {\n try {\n defineProperty(global, key, { value: value, configurable: true, writable: true });\n } catch (error) {\n global[key] = value;\n } return value;\n};\n","var shared = require('../internals/shared');\nvar uid = require('../internals/uid');\n\nvar keys = shared('keys');\n\nmodule.exports = function (key) {\n return keys[key] || (keys[key] = uid(key));\n};\n","var global = require('../internals/global');\nvar setGlobal = require('../internals/set-global');\n\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || setGlobal(SHARED, {});\n\nmodule.exports = store;\n","var IS_PURE = require('../internals/is-pure');\nvar store = require('../internals/shared-store');\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: '3.22.4',\n mode: IS_PURE ? 'pure' : 'global',\n copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',\n license: 'https://github.com/zloirock/core-js/blob/v3.22.4/LICENSE',\n source: 'https://github.com/zloirock/core-js'\n});\n","var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\n\nvar max = Math.max;\nvar min = Math.min;\n\n// Helper for a popular repeating case of the spec:\n// Let integer be ? ToInteger(index).\n// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).\nmodule.exports = function (index, length) {\n var integer = toIntegerOrInfinity(index);\n return integer < 0 ? max(integer + length, 0) : min(integer, length);\n};\n","// toObject with fallback for non-array-like ES3 strings\nvar IndexedObject = require('../internals/indexed-object');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nmodule.exports = function (it) {\n return IndexedObject(requireObjectCoercible(it));\n};\n","var ceil = Math.ceil;\nvar floor = Math.floor;\n\n// `ToIntegerOrInfinity` abstract operation\n// https://tc39.es/ecma262/#sec-tointegerorinfinity\nmodule.exports = function (argument) {\n var number = +argument;\n // eslint-disable-next-line no-self-compare -- safe\n return number !== number || number === 0 ? 0 : (number > 0 ? floor : ceil)(number);\n};\n","var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\n\nvar min = Math.min;\n\n// `ToLength` abstract operation\n// https://tc39.es/ecma262/#sec-tolength\nmodule.exports = function (argument) {\n return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991\n};\n","var global = require('../internals/global');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nvar Object = global.Object;\n\n// `ToObject` abstract operation\n// https://tc39.es/ecma262/#sec-toobject\nmodule.exports = function (argument) {\n return Object(requireObjectCoercible(argument));\n};\n","var global = require('../internals/global');\nvar call = require('../internals/function-call');\nvar isObject = require('../internals/is-object');\nvar isSymbol = require('../internals/is-symbol');\nvar getMethod = require('../internals/get-method');\nvar ordinaryToPrimitive = require('../internals/ordinary-to-primitive');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TypeError = global.TypeError;\nvar TO_PRIMITIVE = wellKnownSymbol('toPrimitive');\n\n// `ToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-toprimitive\nmodule.exports = function (input, pref) {\n if (!isObject(input) || isSymbol(input)) return input;\n var exoticToPrim = getMethod(input, TO_PRIMITIVE);\n var result;\n if (exoticToPrim) {\n if (pref === undefined) pref = 'default';\n result = call(exoticToPrim, input, pref);\n if (!isObject(result) || isSymbol(result)) return result;\n throw TypeError(\"Can't convert object to primitive value\");\n }\n if (pref === undefined) pref = 'number';\n return ordinaryToPrimitive(input, pref);\n};\n","var toPrimitive = require('../internals/to-primitive');\nvar isSymbol = require('../internals/is-symbol');\n\n// `ToPropertyKey` abstract operation\n// https://tc39.es/ecma262/#sec-topropertykey\nmodule.exports = function (argument) {\n var key = toPrimitive(argument, 'string');\n return isSymbol(key) ? key : key + '';\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar test = {};\n\ntest[TO_STRING_TAG] = 'z';\n\nmodule.exports = String(test) === '[object z]';\n","var global = require('../internals/global');\n\nvar String = global.String;\n\nmodule.exports = function (argument) {\n try {\n return String(argument);\n } catch (error) {\n return 'Object';\n }\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nvar id = 0;\nvar postfix = Math.random();\nvar toString = uncurryThis(1.0.toString);\n\nmodule.exports = function (key) {\n return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);\n};\n","/* eslint-disable es-x/no-symbol -- required for testing */\nvar NATIVE_SYMBOL = require('../internals/native-symbol');\n\nmodule.exports = NATIVE_SYMBOL\n && !Symbol.sham\n && typeof Symbol.iterator == 'symbol';\n","var DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\n\n// V8 ~ Chrome 36-\n// https://bugs.chromium.org/p/v8/issues/detail?id=3334\nmodule.exports = DESCRIPTORS && fails(function () {\n // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing\n return Object.defineProperty(function () { /* empty */ }, 'prototype', {\n value: 42,\n writable: false\n }).prototype != 42;\n});\n","var global = require('../internals/global');\nvar shared = require('../internals/shared');\nvar hasOwn = require('../internals/has-own-property');\nvar uid = require('../internals/uid');\nvar NATIVE_SYMBOL = require('../internals/native-symbol');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar WellKnownSymbolsStore = shared('wks');\nvar Symbol = global.Symbol;\nvar symbolFor = Symbol && Symbol['for'];\nvar createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;\n\nmodule.exports = function (name) {\n if (!hasOwn(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {\n var description = 'Symbol.' + name;\n if (NATIVE_SYMBOL && hasOwn(Symbol, name)) {\n WellKnownSymbolsStore[name] = Symbol[name];\n } else if (USE_SYMBOL_AS_UID && symbolFor) {\n WellKnownSymbolsStore[name] = symbolFor(description);\n } else {\n WellKnownSymbolsStore[name] = createWellKnownSymbol(description);\n }\n } return WellKnownSymbolsStore[name];\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar global = require('../internals/global');\nvar fails = require('../internals/fails');\nvar isArray = require('../internals/is-array');\nvar isObject = require('../internals/is-object');\nvar toObject = require('../internals/to-object');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar createProperty = require('../internals/create-property');\nvar arraySpeciesCreate = require('../internals/array-species-create');\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar V8_VERSION = require('../internals/engine-v8-version');\n\nvar IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');\nvar MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;\nvar MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';\nvar TypeError = global.TypeError;\n\n// We can't use this feature detection in V8 since it causes\n// deoptimization and serious performance degradation\n// https://github.com/zloirock/core-js/issues/679\nvar IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {\n var array = [];\n array[IS_CONCAT_SPREADABLE] = false;\n return array.concat()[0] !== array;\n});\n\nvar SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');\n\nvar isConcatSpreadable = function (O) {\n if (!isObject(O)) return false;\n var spreadable = O[IS_CONCAT_SPREADABLE];\n return spreadable !== undefined ? !!spreadable : isArray(O);\n};\n\nvar FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;\n\n// `Array.prototype.concat` method\n// https://tc39.es/ecma262/#sec-array.prototype.concat\n// with adding support of @@isConcatSpreadable and @@species\n$({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n concat: function concat(arg) {\n var O = toObject(this);\n var A = arraySpeciesCreate(O, 0);\n var n = 0;\n var i, k, length, len, E;\n for (i = -1, length = arguments.length; i < length; i++) {\n E = i === -1 ? O : arguments[i];\n if (isConcatSpreadable(E)) {\n len = lengthOfArrayLike(E);\n if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);\n for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);\n } else {\n if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);\n createProperty(A, n++, E);\n }\n }\n A.length = n;\n return A;\n }\n});\n","'use strict';\n\nvar keys = require('object-keys');\nvar hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';\n\nvar toStr = Object.prototype.toString;\nvar concat = Array.prototype.concat;\nvar origDefineProperty = Object.defineProperty;\n\nvar isFunction = function (fn) {\n\treturn typeof fn === 'function' && toStr.call(fn) === '[object Function]';\n};\n\nvar arePropertyDescriptorsSupported = function () {\n\tvar obj = {};\n\ttry {\n\t\torigDefineProperty(obj, 'x', { enumerable: false, value: obj });\n\t\t// eslint-disable-next-line no-unused-vars, no-restricted-syntax\n\t\tfor (var _ in obj) { // jscs:ignore disallowUnusedVariables\n\t\t\treturn false;\n\t\t}\n\t\treturn obj.x === obj;\n\t} catch (e) { /* this is IE 8. */\n\t\treturn false;\n\t}\n};\nvar supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported();\n\nvar defineProperty = function (object, name, value, predicate) {\n\tif (name in object && (!isFunction(predicate) || !predicate())) {\n\t\treturn;\n\t}\n\tif (supportsDescriptors) {\n\t\torigDefineProperty(object, name, {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: false,\n\t\t\tvalue: value,\n\t\t\twritable: true\n\t\t});\n\t} else {\n\t\tobject[name] = value;\n\t}\n};\n\nvar defineProperties = function (object, map) {\n\tvar predicates = arguments.length > 2 ? arguments[2] : {};\n\tvar props = keys(map);\n\tif (hasSymbols) {\n\t\tprops = concat.call(props, Object.getOwnPropertySymbols(map));\n\t}\n\tfor (var i = 0; i < props.length; i += 1) {\n\t\tdefineProperty(object, props[i], map[props[i]], predicates[props[i]]);\n\t}\n};\n\ndefineProperties.supportsDescriptors = !!supportsDescriptors;\n\nmodule.exports = defineProperties;\n","/**\n * Code refactored from Mozilla Developer Network:\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n */\n\n'use strict';\n\nfunction assign(target, firstSource) {\n if (target === undefined || target === null) {\n throw new TypeError('Cannot convert first argument to object');\n }\n\n var to = Object(target);\n for (var i = 1; i < arguments.length; i++) {\n var nextSource = arguments[i];\n if (nextSource === undefined || nextSource === null) {\n continue;\n }\n\n var keysArray = Object.keys(Object(nextSource));\n for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) {\n var nextKey = keysArray[nextIndex];\n var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);\n if (desc !== undefined && desc.enumerable) {\n to[nextKey] = nextSource[nextKey];\n }\n }\n }\n return to;\n}\n\nfunction polyfill() {\n if (!Object.assign) {\n Object.defineProperty(Object, 'assign', {\n enumerable: false,\n configurable: true,\n writable: true,\n value: assign\n });\n }\n}\n\nmodule.exports = {\n assign: assign,\n polyfill: polyfill\n};\n","/*!\n * escape-html\n * Copyright(c) 2012-2013 TJ Holowaychuk\n * Copyright(c) 2015 Andreas Lubbe\n * Copyright(c) 2015 Tiancheng \"Timothy\" Gu\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module variables.\n * @private\n */\n\nvar matchHtmlRegExp = /[\"'&<>]/;\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = escapeHtml;\n\n/**\n * Escape special characters in the given string of html.\n *\n * @param {string} string The string to escape for inserting into HTML\n * @return {string}\n * @public\n */\n\nfunction escapeHtml(string) {\n var str = '' + string;\n var match = matchHtmlRegExp.exec(str);\n\n if (!match) {\n return str;\n }\n\n var escape;\n var html = '';\n var index = 0;\n var lastIndex = 0;\n\n for (index = match.index; index < str.length; index++) {\n switch (str.charCodeAt(index)) {\n case 34: // \"\n escape = '&quot;';\n break;\n case 38: // &\n escape = '&amp;';\n break;\n case 39: // '\n escape = '&#39;';\n break;\n case 60: // <\n escape = '&lt;';\n break;\n case 62: // >\n escape = '&gt;';\n break;\n default:\n continue;\n }\n\n if (lastIndex !== index) {\n html += str.substring(lastIndex, index);\n }\n\n lastIndex = index + 1;\n html += escape;\n }\n\n return lastIndex !== index\n ? html + str.substring(lastIndex, index)\n : html;\n}\n","\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toString = Object.prototype.toString;\n\nmodule.exports = function forEach (obj, fn, ctx) {\n if (toString.call(fn) !== '[object Function]') {\n throw new TypeError('iterator must be a function');\n }\n var l = obj.length;\n if (l === +l) {\n for (var i = 0; i < l; i++) {\n fn.call(ctx, obj[i], i, obj);\n }\n } else {\n for (var k in obj) {\n if (hasOwn.call(obj, k)) {\n fn.call(ctx, obj[k], k, obj);\n }\n }\n }\n};\n\n","'use strict';\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar slice = Array.prototype.slice;\nvar toStr = Object.prototype.toString;\nvar funcType = '[object Function]';\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.call(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slice.call(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n args.concat(slice.call(arguments))\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n } else {\n return target.apply(\n that,\n args.concat(slice.call(arguments))\n );\n }\n };\n\n var boundLength = Math.max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs.push('$' + i);\n }\n\n bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = Function.prototype.bind || implementation;\n","'use strict';\n\nvar undefined;\n\nvar $SyntaxError = SyntaxError;\nvar $Function = Function;\nvar $TypeError = TypeError;\n\n// eslint-disable-next-line consistent-return\nvar getEvalledConstructor = function (expressionSyntax) {\n\ttry {\n\t\treturn $Function('\"use strict\"; return (' + expressionSyntax + ').constructor;')();\n\t} catch (e) {}\n};\n\nvar $gOPD = Object.getOwnPropertyDescriptor;\nif ($gOPD) {\n\ttry {\n\t\t$gOPD({}, '');\n\t} catch (e) {\n\t\t$gOPD = null; // this is IE 8, which has a broken gOPD\n\t}\n}\n\nvar throwTypeError = function () {\n\tthrow new $TypeError();\n};\nvar ThrowTypeError = $gOPD\n\t? (function () {\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties\n\t\t\targuments.callee; // IE 8 does not throw here\n\t\t\treturn throwTypeError;\n\t\t} catch (calleeThrows) {\n\t\t\ttry {\n\t\t\t\t// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')\n\t\t\t\treturn $gOPD(arguments, 'callee').get;\n\t\t\t} catch (gOPDthrows) {\n\t\t\t\treturn throwTypeError;\n\t\t\t}\n\t\t}\n\t}())\n\t: throwTypeError;\n\nvar hasSymbols = require('has-symbols')();\n\nvar getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto\n\nvar needsEval = {};\n\nvar TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);\n\nvar INTRINSICS = {\n\t'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,\n\t'%Array%': Array,\n\t'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,\n\t'%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,\n\t'%AsyncFromSyncIteratorPrototype%': undefined,\n\t'%AsyncFunction%': needsEval,\n\t'%AsyncGenerator%': needsEval,\n\t'%AsyncGeneratorFunction%': needsEval,\n\t'%AsyncIteratorPrototype%': needsEval,\n\t'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,\n\t'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,\n\t'%Boolean%': Boolean,\n\t'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,\n\t'%Date%': Date,\n\t'%decodeURI%': decodeURI,\n\t'%decodeURIComponent%': decodeURIComponent,\n\t'%encodeURI%': encodeURI,\n\t'%encodeURIComponent%': encodeURIComponent,\n\t'%Error%': Error,\n\t'%eval%': eval, // eslint-disable-line no-eval\n\t'%EvalError%': EvalError,\n\t'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,\n\t'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,\n\t'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,\n\t'%Function%': $Function,\n\t'%GeneratorFunction%': needsEval,\n\t'%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,\n\t'%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,\n\t'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,\n\t'%isFinite%': isFinite,\n\t'%isNaN%': isNaN,\n\t'%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,\n\t'%JSON%': typeof JSON === 'object' ? JSON : undefined,\n\t'%Map%': typeof Map === 'undefined' ? undefined : Map,\n\t'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),\n\t'%Math%': Math,\n\t'%Number%': Number,\n\t'%Object%': Object,\n\t'%parseFloat%': parseFloat,\n\t'%parseInt%': parseInt,\n\t'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,\n\t'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,\n\t'%RangeError%': RangeError,\n\t'%ReferenceError%': ReferenceError,\n\t'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,\n\t'%RegExp%': RegExp,\n\t'%Set%': typeof Set === 'undefined' ? undefined : Set,\n\t'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),\n\t'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,\n\t'%String%': String,\n\t'%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,\n\t'%Symbol%': hasSymbols ? Symbol : undefined,\n\t'%SyntaxError%': $SyntaxError,\n\t'%ThrowTypeError%': ThrowTypeError,\n\t'%TypedArray%': TypedArray,\n\t'%TypeError%': $TypeError,\n\t'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,\n\t'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,\n\t'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,\n\t'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,\n\t'%URIError%': URIError,\n\t'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,\n\t'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,\n\t'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet\n};\n\nvar doEval = function doEval(name) {\n\tvar value;\n\tif (name === '%AsyncFunction%') {\n\t\tvalue = getEvalledConstructor('async function () {}');\n\t} else if (name === '%GeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('function* () {}');\n\t} else if (name === '%AsyncGeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('async function* () {}');\n\t} else if (name === '%AsyncGenerator%') {\n\t\tvar fn = doEval('%AsyncGeneratorFunction%');\n\t\tif (fn) {\n\t\t\tvalue = fn.prototype;\n\t\t}\n\t} else if (name === '%AsyncIteratorPrototype%') {\n\t\tvar gen = doEval('%AsyncGenerator%');\n\t\tif (gen) {\n\t\t\tvalue = getProto(gen.prototype);\n\t\t}\n\t}\n\n\tINTRINSICS[name] = value;\n\n\treturn value;\n};\n\nvar LEGACY_ALIASES = {\n\t'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],\n\t'%ArrayPrototype%': ['Array', 'prototype'],\n\t'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],\n\t'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],\n\t'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],\n\t'%ArrayProto_values%': ['Array', 'prototype', 'values'],\n\t'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],\n\t'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],\n\t'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],\n\t'%BooleanPrototype%': ['Boolean', 'prototype'],\n\t'%DataViewPrototype%': ['DataView', 'prototype'],\n\t'%DatePrototype%': ['Date', 'prototype'],\n\t'%ErrorPrototype%': ['Error', 'prototype'],\n\t'%EvalErrorPrototype%': ['EvalError', 'prototype'],\n\t'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],\n\t'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],\n\t'%FunctionPrototype%': ['Function', 'prototype'],\n\t'%Generator%': ['GeneratorFunction', 'prototype'],\n\t'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],\n\t'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],\n\t'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],\n\t'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],\n\t'%JSONParse%': ['JSON', 'parse'],\n\t'%JSONStringify%': ['JSON', 'stringify'],\n\t'%MapPrototype%': ['Map', 'prototype'],\n\t'%NumberPrototype%': ['Number', 'prototype'],\n\t'%ObjectPrototype%': ['Object', 'prototype'],\n\t'%ObjProto_toString%': ['Object', 'prototype', 'toString'],\n\t'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],\n\t'%PromisePrototype%': ['Promise', 'prototype'],\n\t'%PromiseProto_then%': ['Promise', 'prototype', 'then'],\n\t'%Promise_all%': ['Promise', 'all'],\n\t'%Promise_reject%': ['Promise', 'reject'],\n\t'%Promise_resolve%': ['Promise', 'resolve'],\n\t'%RangeErrorPrototype%': ['RangeError', 'prototype'],\n\t'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],\n\t'%RegExpPrototype%': ['RegExp', 'prototype'],\n\t'%SetPrototype%': ['Set', 'prototype'],\n\t'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],\n\t'%StringPrototype%': ['String', 'prototype'],\n\t'%SymbolPrototype%': ['Symbol', 'prototype'],\n\t'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],\n\t'%TypedArrayPrototype%': ['TypedArray', 'prototype'],\n\t'%TypeErrorPrototype%': ['TypeError', 'prototype'],\n\t'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],\n\t'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],\n\t'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],\n\t'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],\n\t'%URIErrorPrototype%': ['URIError', 'prototype'],\n\t'%WeakMapPrototype%': ['WeakMap', 'prototype'],\n\t'%WeakSetPrototype%': ['WeakSet', 'prototype']\n};\n\nvar bind = require('function-bind');\nvar hasOwn = require('has');\nvar $concat = bind.call(Function.call, Array.prototype.concat);\nvar $spliceApply = bind.call(Function.apply, Array.prototype.splice);\nvar $replace = bind.call(Function.call, String.prototype.replace);\nvar $strSlice = bind.call(Function.call, String.prototype.slice);\n\n/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */\nvar rePropName = /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g;\nvar reEscapeChar = /\\\\(\\\\)?/g; /** Used to match backslashes in property paths. */\nvar stringToPath = function stringToPath(string) {\n\tvar first = $strSlice(string, 0, 1);\n\tvar last = $strSlice(string, -1);\n\tif (first === '%' && last !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected closing `%`');\n\t} else if (last === '%' && first !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected opening `%`');\n\t}\n\tvar result = [];\n\t$replace(string, rePropName, function (match, number, quote, subString) {\n\t\tresult[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;\n\t});\n\treturn result;\n};\n/* end adaptation */\n\nvar getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {\n\tvar intrinsicName = name;\n\tvar alias;\n\tif (hasOwn(LEGACY_ALIASES, intrinsicName)) {\n\t\talias = LEGACY_ALIASES[intrinsicName];\n\t\tintrinsicName = '%' + alias[0] + '%';\n\t}\n\n\tif (hasOwn(INTRINSICS, intrinsicName)) {\n\t\tvar value = INTRINSICS[intrinsicName];\n\t\tif (value === needsEval) {\n\t\t\tvalue = doEval(intrinsicName);\n\t\t}\n\t\tif (typeof value === 'undefined' && !allowMissing) {\n\t\t\tthrow new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');\n\t\t}\n\n\t\treturn {\n\t\t\talias: alias,\n\t\t\tname: intrinsicName,\n\t\t\tvalue: value\n\t\t};\n\t}\n\n\tthrow new $SyntaxError('intrinsic ' + name + ' does not exist!');\n};\n\nmodule.exports = function GetIntrinsic(name, allowMissing) {\n\tif (typeof name !== 'string' || name.length === 0) {\n\t\tthrow new $TypeError('intrinsic name must be a non-empty string');\n\t}\n\tif (arguments.length > 1 && typeof allowMissing !== 'boolean') {\n\t\tthrow new $TypeError('\"allowMissing\" argument must be a boolean');\n\t}\n\n\tvar parts = stringToPath(name);\n\tvar intrinsicBaseName = parts.length > 0 ? parts[0] : '';\n\n\tvar intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);\n\tvar intrinsicRealName = intrinsic.name;\n\tvar value = intrinsic.value;\n\tvar skipFurtherCaching = false;\n\n\tvar alias = intrinsic.alias;\n\tif (alias) {\n\t\tintrinsicBaseName = alias[0];\n\t\t$spliceApply(parts, $concat([0, 1], alias));\n\t}\n\n\tfor (var i = 1, isOwn = true; i < parts.length; i += 1) {\n\t\tvar part = parts[i];\n\t\tvar first = $strSlice(part, 0, 1);\n\t\tvar last = $strSlice(part, -1);\n\t\tif (\n\t\t\t(\n\t\t\t\t(first === '\"' || first === \"'\" || first === '`')\n\t\t\t\t|| (last === '\"' || last === \"'\" || last === '`')\n\t\t\t)\n\t\t\t&& first !== last\n\t\t) {\n\t\t\tthrow new $SyntaxError('property names with quotes must have matching quotes');\n\t\t}\n\t\tif (part === 'constructor' || !isOwn) {\n\t\t\tskipFurtherCaching = true;\n\t\t}\n\n\t\tintrinsicBaseName += '.' + part;\n\t\tintrinsicRealName = '%' + intrinsicBaseName + '%';\n\n\t\tif (hasOwn(INTRINSICS, intrinsicRealName)) {\n\t\t\tvalue = INTRINSICS[intrinsicRealName];\n\t\t} else if (value != null) {\n\t\t\tif (!(part in value)) {\n\t\t\t\tif (!allowMissing) {\n\t\t\t\t\tthrow new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');\n\t\t\t\t}\n\t\t\t\treturn void undefined;\n\t\t\t}\n\t\t\tif ($gOPD && (i + 1) >= parts.length) {\n\t\t\t\tvar desc = $gOPD(value, part);\n\t\t\t\tisOwn = !!desc;\n\n\t\t\t\t// By convention, when a data property is converted to an accessor\n\t\t\t\t// property to emulate a data property that does not suffer from\n\t\t\t\t// the override mistake, that accessor's getter is marked with\n\t\t\t\t// an `originalValue` property. Here, when we detect this, we\n\t\t\t\t// uphold the illusion by pretending to see that original data\n\t\t\t\t// property, i.e., returning the value rather than the getter\n\t\t\t\t// itself.\n\t\t\t\tif (isOwn && 'get' in desc && !('originalValue' in desc.get)) {\n\t\t\t\t\tvalue = desc.get;\n\t\t\t\t} else {\n\t\t\t\t\tvalue = value[part];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tisOwn = hasOwn(value, part);\n\t\t\t\tvalue = value[part];\n\t\t\t}\n\n\t\t\tif (isOwn && !skipFurtherCaching) {\n\t\t\t\tINTRINSICS[intrinsicRealName] = value;\n\t\t\t}\n\t\t}\n\t}\n\treturn value;\n};\n","'use strict';\n\nvar origSymbol = typeof Symbol !== 'undefined' && Symbol;\nvar hasSymbolSham = require('./shams');\n\nmodule.exports = function hasNativeSymbols() {\n\tif (typeof origSymbol !== 'function') { return false; }\n\tif (typeof Symbol !== 'function') { return false; }\n\tif (typeof origSymbol('foo') !== 'symbol') { return false; }\n\tif (typeof Symbol('bar') !== 'symbol') { return false; }\n\n\treturn hasSymbolSham();\n};\n","'use strict';\n\n/* eslint complexity: [2, 18], max-statements: [2, 33] */\nmodule.exports = function hasSymbols() {\n\tif (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }\n\tif (typeof Symbol.iterator === 'symbol') { return true; }\n\n\tvar obj = {};\n\tvar sym = Symbol('test');\n\tvar symObj = Object(sym);\n\tif (typeof sym === 'string') { return false; }\n\n\tif (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }\n\tif (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }\n\n\t// temp disabled per https://github.com/ljharb/object.assign/issues/17\n\t// if (sym instanceof Symbol) { return false; }\n\t// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4\n\t// if (!(symObj instanceof Symbol)) { return false; }\n\n\t// if (typeof Symbol.prototype.toString !== 'function') { return false; }\n\t// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }\n\n\tvar symVal = 42;\n\tobj[sym] = symVal;\n\tfor (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop\n\tif (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }\n\n\tif (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }\n\n\tvar syms = Object.getOwnPropertySymbols(obj);\n\tif (syms.length !== 1 || syms[0] !== sym) { return false; }\n\n\tif (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }\n\n\tif (typeof Object.getOwnPropertyDescriptor === 'function') {\n\t\tvar descriptor = Object.getOwnPropertyDescriptor(obj, sym);\n\t\tif (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }\n\t}\n\n\treturn true;\n};\n","'use strict';\n\nvar hasSymbols = require('has-symbols/shams');\n\nmodule.exports = function hasToStringTagShams() {\n\treturn hasSymbols() && !!Symbol.toStringTag;\n};\n","'use strict';\n\nvar bind = require('function-bind');\n\nmodule.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);\n","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n }\n}\n","'use strict';\n\nvar hasToStringTag = require('has-tostringtag/shams')();\nvar callBound = require('call-bind/callBound');\n\nvar $toString = callBound('Object.prototype.toString');\n\nvar isStandardArguments = function isArguments(value) {\n\tif (hasToStringTag && value && typeof value === 'object' && Symbol.toStringTag in value) {\n\t\treturn false;\n\t}\n\treturn $toString(value) === '[object Arguments]';\n};\n\nvar isLegacyArguments = function isArguments(value) {\n\tif (isStandardArguments(value)) {\n\t\treturn true;\n\t}\n\treturn value !== null &&\n\t\ttypeof value === 'object' &&\n\t\ttypeof value.length === 'number' &&\n\t\tvalue.length >= 0 &&\n\t\t$toString(value) !== '[object Array]' &&\n\t\t$toString(value.callee) === '[object Function]';\n};\n\nvar supportsStandardArguments = (function () {\n\treturn isStandardArguments(arguments);\n}());\n\nisStandardArguments.isLegacyArguments = isLegacyArguments; // for tests\n\nmodule.exports = supportsStandardArguments ? isStandardArguments : isLegacyArguments;\n","'use strict';\n\nvar toStr = Object.prototype.toString;\nvar fnToStr = Function.prototype.toString;\nvar isFnRegex = /^\\s*(?:function)?\\*/;\nvar hasToStringTag = require('has-tostringtag/shams')();\nvar getProto = Object.getPrototypeOf;\nvar getGeneratorFunc = function () { // eslint-disable-line consistent-return\n\tif (!hasToStringTag) {\n\t\treturn false;\n\t}\n\ttry {\n\t\treturn Function('return function*() {}')();\n\t} catch (e) {\n\t}\n};\nvar GeneratorFunction;\n\nmodule.exports = function isGeneratorFunction(fn) {\n\tif (typeof fn !== 'function') {\n\t\treturn false;\n\t}\n\tif (isFnRegex.test(fnToStr.call(fn))) {\n\t\treturn true;\n\t}\n\tif (!hasToStringTag) {\n\t\tvar str = toStr.call(fn);\n\t\treturn str === '[object GeneratorFunction]';\n\t}\n\tif (!getProto) {\n\t\treturn false;\n\t}\n\tif (typeof GeneratorFunction === 'undefined') {\n\t\tvar generatorFunc = getGeneratorFunc();\n\t\tGeneratorFunction = generatorFunc ? getProto(generatorFunc) : false;\n\t}\n\treturn getProto(fn) === GeneratorFunction;\n};\n","'use strict';\n\n/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */\n\nmodule.exports = function isNaN(value) {\n\treturn value !== value;\n};\n","'use strict';\n\nvar callBind = require('call-bind');\nvar define = require('define-properties');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar polyfill = callBind(getPolyfill(), Number);\n\n/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */\n\ndefine(polyfill, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = polyfill;\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = function getPolyfill() {\n\tif (Number.isNaN && Number.isNaN(NaN) && !Number.isNaN('a')) {\n\t\treturn Number.isNaN;\n\t}\n\treturn implementation;\n};\n","'use strict';\n\nvar define = require('define-properties');\nvar getPolyfill = require('./polyfill');\n\n/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */\n\nmodule.exports = function shimNumberIsNaN() {\n\tvar polyfill = getPolyfill();\n\tdefine(Number, { isNaN: polyfill }, {\n\t\tisNaN: function testIsNaN() {\n\t\t\treturn Number.isNaN !== polyfill;\n\t\t}\n\t});\n\treturn polyfill;\n};\n","'use strict';\n\nvar forEach = require('foreach');\nvar availableTypedArrays = require('available-typed-arrays');\nvar callBound = require('call-bind/callBound');\n\nvar $toString = callBound('Object.prototype.toString');\nvar hasToStringTag = require('has-tostringtag/shams')();\n\nvar typedArrays = availableTypedArrays();\n\nvar $indexOf = callBound('Array.prototype.indexOf', true) || function indexOf(array, value) {\n\tfor (var i = 0; i < array.length; i += 1) {\n\t\tif (array[i] === value) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n};\nvar $slice = callBound('String.prototype.slice');\nvar toStrTags = {};\nvar gOPD = require('es-abstract/helpers/getOwnPropertyDescriptor');\nvar getPrototypeOf = Object.getPrototypeOf; // require('getprototypeof');\nif (hasToStringTag && gOPD && getPrototypeOf) {\n\tforEach(typedArrays, function (typedArray) {\n\t\tvar arr = new global[typedArray]();\n\t\tif (!(Symbol.toStringTag in arr)) {\n\t\t\tthrow new EvalError('this engine has support for Symbol.toStringTag, but ' + typedArray + ' does not have the property! Please report this.');\n\t\t}\n\t\tvar proto = getPrototypeOf(arr);\n\t\tvar descriptor = gOPD(proto, Symbol.toStringTag);\n\t\tif (!descriptor) {\n\t\t\tvar superProto = getPrototypeOf(proto);\n\t\t\tdescriptor = gOPD(superProto, Symbol.toStringTag);\n\t\t}\n\t\ttoStrTags[typedArray] = descriptor.get;\n\t});\n}\n\nvar tryTypedArrays = function tryAllTypedArrays(value) {\n\tvar anyTrue = false;\n\tforEach(toStrTags, function (getter, typedArray) {\n\t\tif (!anyTrue) {\n\t\t\ttry {\n\t\t\t\tanyTrue = getter.call(value) === typedArray;\n\t\t\t} catch (e) { /**/ }\n\t\t}\n\t});\n\treturn anyTrue;\n};\n\nmodule.exports = function isTypedArray(value) {\n\tif (!value || typeof value !== 'object') { return false; }\n\tif (!hasToStringTag) {\n\t\tvar tag = $slice($toString(value), 8, -1);\n\t\treturn $indexOf(typedArrays, tag) > -1;\n\t}\n\tif (!gOPD) { return false; }\n\treturn tryTypedArrays(value);\n};\n","'use strict';\n\nvar numberIsNaN = function (value) {\n\treturn value !== value;\n};\n\nmodule.exports = function is(a, b) {\n\tif (a === 0 && b === 0) {\n\t\treturn 1 / a === 1 / b;\n\t}\n\tif (a === b) {\n\t\treturn true;\n\t}\n\tif (numberIsNaN(a) && numberIsNaN(b)) {\n\t\treturn true;\n\t}\n\treturn false;\n};\n\n","'use strict';\n\nvar define = require('define-properties');\nvar callBind = require('call-bind');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar polyfill = callBind(getPolyfill(), Object);\n\ndefine(polyfill, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = polyfill;\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = function getPolyfill() {\n\treturn typeof Object.is === 'function' ? Object.is : implementation;\n};\n","'use strict';\n\nvar getPolyfill = require('./polyfill');\nvar define = require('define-properties');\n\nmodule.exports = function shimObjectIs() {\n\tvar polyfill = getPolyfill();\n\tdefine(Object, { is: polyfill }, {\n\t\tis: function testObjectIs() {\n\t\t\treturn Object.is !== polyfill;\n\t\t}\n\t});\n\treturn polyfill;\n};\n","'use strict';\n\nvar keysShim;\nif (!Object.keys) {\n\t// modified from https://github.com/es-shims/es5-shim\n\tvar has = Object.prototype.hasOwnProperty;\n\tvar toStr = Object.prototype.toString;\n\tvar isArgs = require('./isArguments'); // eslint-disable-line global-require\n\tvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\tvar hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');\n\tvar hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');\n\tvar dontEnums = [\n\t\t'toString',\n\t\t'toLocaleString',\n\t\t'valueOf',\n\t\t'hasOwnProperty',\n\t\t'isPrototypeOf',\n\t\t'propertyIsEnumerable',\n\t\t'constructor'\n\t];\n\tvar equalsConstructorPrototype = function (o) {\n\t\tvar ctor = o.constructor;\n\t\treturn ctor && ctor.prototype === o;\n\t};\n\tvar excludedKeys = {\n\t\t$applicationCache: true,\n\t\t$console: true,\n\t\t$external: true,\n\t\t$frame: true,\n\t\t$frameElement: true,\n\t\t$frames: true,\n\t\t$innerHeight: true,\n\t\t$innerWidth: true,\n\t\t$onmozfullscreenchange: true,\n\t\t$onmozfullscreenerror: true,\n\t\t$outerHeight: true,\n\t\t$outerWidth: true,\n\t\t$pageXOffset: true,\n\t\t$pageYOffset: true,\n\t\t$parent: true,\n\t\t$scrollLeft: true,\n\t\t$scrollTop: true,\n\t\t$scrollX: true,\n\t\t$scrollY: true,\n\t\t$self: true,\n\t\t$webkitIndexedDB: true,\n\t\t$webkitStorageInfo: true,\n\t\t$window: true\n\t};\n\tvar hasAutomationEqualityBug = (function () {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined') { return false; }\n\t\tfor (var k in window) {\n\t\t\ttry {\n\t\t\t\tif (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tequalsConstructorPrototype(window[k]);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}());\n\tvar equalsConstructorPrototypeIfNotBuggy = function (o) {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined' || !hasAutomationEqualityBug) {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t}\n\t\ttry {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t};\n\n\tkeysShim = function keys(object) {\n\t\tvar isObject = object !== null && typeof object === 'object';\n\t\tvar isFunction = toStr.call(object) === '[object Function]';\n\t\tvar isArguments = isArgs(object);\n\t\tvar isString = isObject && toStr.call(object) === '[object String]';\n\t\tvar theKeys = [];\n\n\t\tif (!isObject && !isFunction && !isArguments) {\n\t\t\tthrow new TypeError('Object.keys called on a non-object');\n\t\t}\n\n\t\tvar skipProto = hasProtoEnumBug && isFunction;\n\t\tif (isString && object.length > 0 && !has.call(object, 0)) {\n\t\t\tfor (var i = 0; i < object.length; ++i) {\n\t\t\t\ttheKeys.push(String(i));\n\t\t\t}\n\t\t}\n\n\t\tif (isArguments && object.length > 0) {\n\t\t\tfor (var j = 0; j < object.length; ++j) {\n\t\t\t\ttheKeys.push(String(j));\n\t\t\t}\n\t\t} else {\n\t\t\tfor (var name in object) {\n\t\t\t\tif (!(skipProto && name === 'prototype') && has.call(object, name)) {\n\t\t\t\t\ttheKeys.push(String(name));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (hasDontEnumBug) {\n\t\t\tvar skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);\n\n\t\t\tfor (var k = 0; k < dontEnums.length; ++k) {\n\t\t\t\tif (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {\n\t\t\t\t\ttheKeys.push(dontEnums[k]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn theKeys;\n\t};\n}\nmodule.exports = keysShim;\n","'use strict';\n\nvar slice = Array.prototype.slice;\nvar isArgs = require('./isArguments');\n\nvar origKeys = Object.keys;\nvar keysShim = origKeys ? function keys(o) { return origKeys(o); } : require('./implementation');\n\nvar originalKeys = Object.keys;\n\nkeysShim.shim = function shimObjectKeys() {\n\tif (Object.keys) {\n\t\tvar keysWorksWithArguments = (function () {\n\t\t\t// Safari 5.0 bug\n\t\t\tvar args = Object.keys(arguments);\n\t\t\treturn args && args.length === arguments.length;\n\t\t}(1, 2));\n\t\tif (!keysWorksWithArguments) {\n\t\t\tObject.keys = function keys(object) { // eslint-disable-line func-name-matching\n\t\t\t\tif (isArgs(object)) {\n\t\t\t\t\treturn originalKeys(slice.call(object));\n\t\t\t\t}\n\t\t\t\treturn originalKeys(object);\n\t\t\t};\n\t\t}\n\t} else {\n\t\tObject.keys = keysShim;\n\t}\n\treturn Object.keys || keysShim;\n};\n\nmodule.exports = keysShim;\n","'use strict';\n\nvar toStr = Object.prototype.toString;\n\nmodule.exports = function isArguments(value) {\n\tvar str = toStr.call(value);\n\tvar isArgs = str === '[object Arguments]';\n\tif (!isArgs) {\n\t\tisArgs = str !== '[object Array]' &&\n\t\t\tvalue !== null &&\n\t\t\ttypeof value === 'object' &&\n\t\t\ttypeof value.length === 'number' &&\n\t\t\tvalue.length >= 0 &&\n\t\t\ttoStr.call(value.callee) === '[object Function]';\n\t}\n\treturn isArgs;\n};\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","module.exports = function isBuffer(arg) {\n return arg && typeof arg === 'object'\n && typeof arg.copy === 'function'\n && typeof arg.fill === 'function'\n && typeof arg.readUInt8 === 'function';\n}","// Currently in sync with Node.js lib/internal/util/types.js\n// https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9\n\n'use strict';\n\nvar isArgumentsObject = require('is-arguments');\nvar isGeneratorFunction = require('is-generator-function');\nvar whichTypedArray = require('which-typed-array');\nvar isTypedArray = require('is-typed-array');\n\nfunction uncurryThis(f) {\n return f.call.bind(f);\n}\n\nvar BigIntSupported = typeof BigInt !== 'undefined';\nvar SymbolSupported = typeof Symbol !== 'undefined';\n\nvar ObjectToString = uncurryThis(Object.prototype.toString);\n\nvar numberValue = uncurryThis(Number.prototype.valueOf);\nvar stringValue = uncurryThis(String.prototype.valueOf);\nvar booleanValue = uncurryThis(Boolean.prototype.valueOf);\n\nif (BigIntSupported) {\n var bigIntValue = uncurryThis(BigInt.prototype.valueOf);\n}\n\nif (SymbolSupported) {\n var symbolValue = uncurryThis(Symbol.prototype.valueOf);\n}\n\nfunction checkBoxedPrimitive(value, prototypeValueOf) {\n if (typeof value !== 'object') {\n return false;\n }\n try {\n prototypeValueOf(value);\n return true;\n } catch(e) {\n return false;\n }\n}\n\nexports.isArgumentsObject = isArgumentsObject;\nexports.isGeneratorFunction = isGeneratorFunction;\nexports.isTypedArray = isTypedArray;\n\n// Taken from here and modified for better browser support\n// https://github.com/sindresorhus/p-is-promise/blob/cda35a513bda03f977ad5cde3a079d237e82d7ef/index.js\nfunction isPromise(input) {\n\treturn (\n\t\t(\n\t\t\ttypeof Promise !== 'undefined' &&\n\t\t\tinput instanceof Promise\n\t\t) ||\n\t\t(\n\t\t\tinput !== null &&\n\t\t\ttypeof input === 'object' &&\n\t\t\ttypeof input.then === 'function' &&\n\t\t\ttypeof input.catch === 'function'\n\t\t)\n\t);\n}\nexports.isPromise = isPromise;\n\nfunction isArrayBufferView(value) {\n if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) {\n return ArrayBuffer.isView(value);\n }\n\n return (\n isTypedArray(value) ||\n isDataView(value)\n );\n}\nexports.isArrayBufferView = isArrayBufferView;\n\n\nfunction isUint8Array(value) {\n return whichTypedArray(value) === 'Uint8Array';\n}\nexports.isUint8Array = isUint8Array;\n\nfunction isUint8ClampedArray(value) {\n return whichTypedArray(value) === 'Uint8ClampedArray';\n}\nexports.isUint8ClampedArray = isUint8ClampedArray;\n\nfunction isUint16Array(value) {\n return whichTypedArray(value) === 'Uint16Array';\n}\nexports.isUint16Array = isUint16Array;\n\nfunction isUint32Array(value) {\n return whichTypedArray(value) === 'Uint32Array';\n}\nexports.isUint32Array = isUint32Array;\n\nfunction isInt8Array(value) {\n return whichTypedArray(value) === 'Int8Array';\n}\nexports.isInt8Array = isInt8Array;\n\nfunction isInt16Array(value) {\n return whichTypedArray(value) === 'Int16Array';\n}\nexports.isInt16Array = isInt16Array;\n\nfunction isInt32Array(value) {\n return whichTypedArray(value) === 'Int32Array';\n}\nexports.isInt32Array = isInt32Array;\n\nfunction isFloat32Array(value) {\n return whichTypedArray(value) === 'Float32Array';\n}\nexports.isFloat32Array = isFloat32Array;\n\nfunction isFloat64Array(value) {\n return whichTypedArray(value) === 'Float64Array';\n}\nexports.isFloat64Array = isFloat64Array;\n\nfunction isBigInt64Array(value) {\n return whichTypedArray(value) === 'BigInt64Array';\n}\nexports.isBigInt64Array = isBigInt64Array;\n\nfunction isBigUint64Array(value) {\n return whichTypedArray(value) === 'BigUint64Array';\n}\nexports.isBigUint64Array = isBigUint64Array;\n\nfunction isMapToString(value) {\n return ObjectToString(value) === '[object Map]';\n}\nisMapToString.working = (\n typeof Map !== 'undefined' &&\n isMapToString(new Map())\n);\n\nfunction isMap(value) {\n if (typeof Map === 'undefined') {\n return false;\n }\n\n return isMapToString.working\n ? isMapToString(value)\n : value instanceof Map;\n}\nexports.isMap = isMap;\n\nfunction isSetToString(value) {\n return ObjectToString(value) === '[object Set]';\n}\nisSetToString.working = (\n typeof Set !== 'undefined' &&\n isSetToString(new Set())\n);\nfunction isSet(value) {\n if (typeof Set === 'undefined') {\n return false;\n }\n\n return isSetToString.working\n ? isSetToString(value)\n : value instanceof Set;\n}\nexports.isSet = isSet;\n\nfunction isWeakMapToString(value) {\n return ObjectToString(value) === '[object WeakMap]';\n}\nisWeakMapToString.working = (\n typeof WeakMap !== 'undefined' &&\n isWeakMapToString(new WeakMap())\n);\nfunction isWeakMap(value) {\n if (typeof WeakMap === 'undefined') {\n return false;\n }\n\n return isWeakMapToString.working\n ? isWeakMapToString(value)\n : value instanceof WeakMap;\n}\nexports.isWeakMap = isWeakMap;\n\nfunction isWeakSetToString(value) {\n return ObjectToString(value) === '[object WeakSet]';\n}\nisWeakSetToString.working = (\n typeof WeakSet !== 'undefined' &&\n isWeakSetToString(new WeakSet())\n);\nfunction isWeakSet(value) {\n return isWeakSetToString(value);\n}\nexports.isWeakSet = isWeakSet;\n\nfunction isArrayBufferToString(value) {\n return ObjectToString(value) === '[object ArrayBuffer]';\n}\nisArrayBufferToString.working = (\n typeof ArrayBuffer !== 'undefined' &&\n isArrayBufferToString(new ArrayBuffer())\n);\nfunction isArrayBuffer(value) {\n if (typeof ArrayBuffer === 'undefined') {\n return false;\n }\n\n return isArrayBufferToString.working\n ? isArrayBufferToString(value)\n : value instanceof ArrayBuffer;\n}\nexports.isArrayBuffer = isArrayBuffer;\n\nfunction isDataViewToString(value) {\n return ObjectToString(value) === '[object DataView]';\n}\nisDataViewToString.working = (\n typeof ArrayBuffer !== 'undefined' &&\n typeof DataView !== 'undefined' &&\n isDataViewToString(new DataView(new ArrayBuffer(1), 0, 1))\n);\nfunction isDataView(value) {\n if (typeof DataView === 'undefined') {\n return false;\n }\n\n return isDataViewToString.working\n ? isDataViewToString(value)\n : value instanceof DataView;\n}\nexports.isDataView = isDataView;\n\n// Store a copy of SharedArrayBuffer in case it's deleted elsewhere\nvar SharedArrayBufferCopy = typeof SharedArrayBuffer !== 'undefined' ? SharedArrayBuffer : undefined;\nfunction isSharedArrayBufferToString(value) {\n return ObjectToString(value) === '[object SharedArrayBuffer]';\n}\nfunction isSharedArrayBuffer(value) {\n if (typeof SharedArrayBufferCopy === 'undefined') {\n return false;\n }\n\n if (typeof isSharedArrayBufferToString.working === 'undefined') {\n isSharedArrayBufferToString.working = isSharedArrayBufferToString(new SharedArrayBufferCopy());\n }\n\n return isSharedArrayBufferToString.working\n ? isSharedArrayBufferToString(value)\n : value instanceof SharedArrayBufferCopy;\n}\nexports.isSharedArrayBuffer = isSharedArrayBuffer;\n\nfunction isAsyncFunction(value) {\n return ObjectToString(value) === '[object AsyncFunction]';\n}\nexports.isAsyncFunction = isAsyncFunction;\n\nfunction isMapIterator(value) {\n return ObjectToString(value) === '[object Map Iterator]';\n}\nexports.isMapIterator = isMapIterator;\n\nfunction isSetIterator(value) {\n return ObjectToString(value) === '[object Set Iterator]';\n}\nexports.isSetIterator = isSetIterator;\n\nfunction isGeneratorObject(value) {\n return ObjectToString(value) === '[object Generator]';\n}\nexports.isGeneratorObject = isGeneratorObject;\n\nfunction isWebAssemblyCompiledModule(value) {\n return ObjectToString(value) === '[object WebAssembly.Module]';\n}\nexports.isWebAssemblyCompiledModule = isWebAssemblyCompiledModule;\n\nfunction isNumberObject(value) {\n return checkBoxedPrimitive(value, numberValue);\n}\nexports.isNumberObject = isNumberObject;\n\nfunction isStringObject(value) {\n return checkBoxedPrimitive(value, stringValue);\n}\nexports.isStringObject = isStringObject;\n\nfunction isBooleanObject(value) {\n return checkBoxedPrimitive(value, booleanValue);\n}\nexports.isBooleanObject = isBooleanObject;\n\nfunction isBigIntObject(value) {\n return BigIntSupported && checkBoxedPrimitive(value, bigIntValue);\n}\nexports.isBigIntObject = isBigIntObject;\n\nfunction isSymbolObject(value) {\n return SymbolSupported && checkBoxedPrimitive(value, symbolValue);\n}\nexports.isSymbolObject = isSymbolObject;\n\nfunction isBoxedPrimitive(value) {\n return (\n isNumberObject(value) ||\n isStringObject(value) ||\n isBooleanObject(value) ||\n isBigIntObject(value) ||\n isSymbolObject(value)\n );\n}\nexports.isBoxedPrimitive = isBoxedPrimitive;\n\nfunction isAnyArrayBuffer(value) {\n return typeof Uint8Array !== 'undefined' && (\n isArrayBuffer(value) ||\n isSharedArrayBuffer(value)\n );\n}\nexports.isAnyArrayBuffer = isAnyArrayBuffer;\n\n['isProxy', 'isExternal', 'isModuleNamespaceObject'].forEach(function(method) {\n Object.defineProperty(exports, method, {\n enumerable: false,\n value: function() {\n throw new Error(method + ' is not supported in userland');\n }\n });\n});\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors ||\n function getOwnPropertyDescriptors(obj) {\n var keys = Object.keys(obj);\n var descriptors = {};\n for (var i = 0; i < keys.length; i++) {\n descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]);\n }\n return descriptors;\n };\n\nvar formatRegExp = /%[sdj%]/g;\nexports.format = function(f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0; i < arguments.length; i++) {\n objects.push(inspect(arguments[i]));\n }\n return objects.join(' ');\n }\n\n var i = 1;\n var args = arguments;\n var len = args.length;\n var str = String(f).replace(formatRegExp, function(x) {\n if (x === '%%') return '%';\n if (i >= len) return x;\n switch (x) {\n case '%s': return String(args[i++]);\n case '%d': return Number(args[i++]);\n case '%j':\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return '[Circular]';\n }\n default:\n return x;\n }\n });\n for (var x = args[i]; i < len; x = args[++i]) {\n if (isNull(x) || !isObject(x)) {\n str += ' ' + x;\n } else {\n str += ' ' + inspect(x);\n }\n }\n return str;\n};\n\n\n// Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\nexports.deprecate = function(fn, msg) {\n if (typeof process !== 'undefined' && process.noDeprecation === true) {\n return fn;\n }\n\n // Allow for deprecating things in the process of starting up.\n if (typeof process === 'undefined') {\n return function() {\n return exports.deprecate(fn, msg).apply(this, arguments);\n };\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n throw new Error(msg);\n } else if (process.traceDeprecation) {\n console.trace(msg);\n } else {\n console.error(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n};\n\n\nvar debugs = {};\nvar debugEnvRegex = /^$/;\n\nif (process.env.NODE_DEBUG) {\n var debugEnv = process.env.NODE_DEBUG;\n debugEnv = debugEnv.replace(/[|\\\\{}()[\\]^$+?.]/g, '\\\\$&')\n .replace(/\\*/g, '.*')\n .replace(/,/g, '$|^')\n .toUpperCase();\n debugEnvRegex = new RegExp('^' + debugEnv + '$', 'i');\n}\nexports.debuglog = function(set) {\n set = set.toUpperCase();\n if (!debugs[set]) {\n if (debugEnvRegex.test(set)) {\n var pid = process.pid;\n debugs[set] = function() {\n var msg = exports.format.apply(exports, arguments);\n console.error('%s %d: %s', set, pid, msg);\n };\n } else {\n debugs[set] = function() {};\n }\n }\n return debugs[set];\n};\n\n\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */\n/* legacy: obj, showHidden, depth, colors*/\nfunction inspect(obj, opts) {\n // default options\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n // legacy...\n if (arguments.length >= 3) ctx.depth = arguments[2];\n if (arguments.length >= 4) ctx.colors = arguments[3];\n if (isBoolean(opts)) {\n // legacy...\n ctx.showHidden = opts;\n } else if (opts) {\n // got an \"options\" object\n exports._extend(ctx, opts);\n }\n // set default options\n if (isUndefined(ctx.showHidden)) ctx.showHidden = false;\n if (isUndefined(ctx.depth)) ctx.depth = 2;\n if (isUndefined(ctx.colors)) ctx.colors = false;\n if (isUndefined(ctx.customInspect)) ctx.customInspect = true;\n if (ctx.colors) ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}\nexports.inspect = inspect;\n\n\n// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\ninspect.colors = {\n 'bold' : [1, 22],\n 'italic' : [3, 23],\n 'underline' : [4, 24],\n 'inverse' : [7, 27],\n 'white' : [37, 39],\n 'grey' : [90, 39],\n 'black' : [30, 39],\n 'blue' : [34, 39],\n 'cyan' : [36, 39],\n 'green' : [32, 39],\n 'magenta' : [35, 39],\n 'red' : [31, 39],\n 'yellow' : [33, 39]\n};\n\n// Don't use 'blue' not visible on cmd.exe\ninspect.styles = {\n 'special': 'cyan',\n 'number': 'yellow',\n 'boolean': 'yellow',\n 'undefined': 'grey',\n 'null': 'bold',\n 'string': 'green',\n 'date': 'magenta',\n // \"name\": intentionally not styling\n 'regexp': 'red'\n};\n\n\nfunction stylizeWithColor(str, styleType) {\n var style = inspect.styles[styleType];\n\n if (style) {\n return '\\u001b[' + inspect.colors[style][0] + 'm' + str +\n '\\u001b[' + inspect.colors[style][1] + 'm';\n } else {\n return str;\n }\n}\n\n\nfunction stylizeNoColor(str, styleType) {\n return str;\n}\n\n\nfunction arrayToHash(array) {\n var hash = {};\n\n array.forEach(function(val, idx) {\n hash[val] = true;\n });\n\n return hash;\n}\n\n\nfunction formatValue(ctx, value, recurseTimes) {\n // Provide a hook for user-specified inspect functions.\n // Check that value is an object with an inspect function on it\n if (ctx.customInspect &&\n value &&\n isFunction(value.inspect) &&\n // Filter out the util module, it's inspect function is special\n value.inspect !== exports.inspect &&\n // Also filter out any prototype objects using the circular check.\n !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n if (!isString(ret)) {\n ret = formatValue(ctx, ret, recurseTimes);\n }\n return ret;\n }\n\n // Primitive types cannot have properties\n var primitive = formatPrimitive(ctx, value);\n if (primitive) {\n return primitive;\n }\n\n // Look up the keys of the object.\n var keys = Object.keys(value);\n var visibleKeys = arrayToHash(keys);\n\n if (ctx.showHidden) {\n keys = Object.getOwnPropertyNames(value);\n }\n\n // IE doesn't make error fields non-enumerable\n // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n if (isError(value)\n && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {\n return formatError(value);\n }\n\n // Some type of object without properties can be shortcutted.\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name ? ': ' + value.name : '';\n return ctx.stylize('[Function' + name + ']', 'special');\n }\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n }\n if (isDate(value)) {\n return ctx.stylize(Date.prototype.toString.call(value), 'date');\n }\n if (isError(value)) {\n return formatError(value);\n }\n }\n\n var base = '', array = false, braces = ['{', '}'];\n\n // Make Array say that they are Array\n if (isArray(value)) {\n array = true;\n braces = ['[', ']'];\n }\n\n // Make functions say that they are functions\n if (isFunction(value)) {\n var n = value.name ? ': ' + value.name : '';\n base = ' [Function' + n + ']';\n }\n\n // Make RegExps say that they are RegExps\n if (isRegExp(value)) {\n base = ' ' + RegExp.prototype.toString.call(value);\n }\n\n // Make dates with properties first say the date\n if (isDate(value)) {\n base = ' ' + Date.prototype.toUTCString.call(value);\n }\n\n // Make error with message first say the error\n if (isError(value)) {\n base = ' ' + formatError(value);\n }\n\n if (keys.length === 0 && (!array || value.length == 0)) {\n return braces[0] + base + braces[1];\n }\n\n if (recurseTimes < 0) {\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n } else {\n return ctx.stylize('[Object]', 'special');\n }\n }\n\n ctx.seen.push(value);\n\n var output;\n if (array) {\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n } else {\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n }\n\n ctx.seen.pop();\n\n return reduceToSingleString(output, base, braces);\n}\n\n\nfunction formatPrimitive(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize('undefined', 'undefined');\n if (isString(value)) {\n var simple = '\\'' + JSON.stringify(value).replace(/^\"|\"$/g, '')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"') + '\\'';\n return ctx.stylize(simple, 'string');\n }\n if (isNumber(value))\n return ctx.stylize('' + value, 'number');\n if (isBoolean(value))\n return ctx.stylize('' + value, 'boolean');\n // For some reason typeof null is \"object\", so special case here.\n if (isNull(value))\n return ctx.stylize('null', 'null');\n}\n\n\nfunction formatError(value) {\n return '[' + Error.prototype.toString.call(value) + ']';\n}\n\n\nfunction formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length; i < l; ++i) {\n if (hasOwnProperty(value, String(i))) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n String(i), true));\n } else {\n output.push('');\n }\n }\n keys.forEach(function(key) {\n if (!key.match(/^\\d+$/)) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n key, true));\n }\n });\n return output;\n}\n\n\nfunction formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };\n if (desc.get) {\n if (desc.set) {\n str = ctx.stylize('[Getter/Setter]', 'special');\n } else {\n str = ctx.stylize('[Getter]', 'special');\n }\n } else {\n if (desc.set) {\n str = ctx.stylize('[Setter]', 'special');\n }\n }\n if (!hasOwnProperty(visibleKeys, key)) {\n name = '[' + key + ']';\n }\n if (!str) {\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes)) {\n str = formatValue(ctx, desc.value, null);\n } else {\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n }\n if (str.indexOf('\\n') > -1) {\n if (array) {\n str = str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n').substr(2);\n } else {\n str = '\\n' + str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n');\n }\n }\n } else {\n str = ctx.stylize('[Circular]', 'special');\n }\n }\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/)) {\n return str;\n }\n name = JSON.stringify('' + key);\n if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n name = name.substr(1, name.length - 2);\n name = ctx.stylize(name, 'name');\n } else {\n name = name.replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"')\n .replace(/(^\"|\"$)/g, \"'\");\n name = ctx.stylize(name, 'string');\n }\n }\n\n return name + ': ' + str;\n}\n\n\nfunction reduceToSingleString(output, base, braces) {\n var numLinesEst = 0;\n var length = output.reduce(function(prev, cur) {\n numLinesEst++;\n if (cur.indexOf('\\n') >= 0) numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n }, 0);\n\n if (length > 60) {\n return braces[0] +\n (base === '' ? '' : base + '\\n ') +\n ' ' +\n output.join(',\\n ') +\n ' ' +\n braces[1];\n }\n\n return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n}\n\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nexports.types = require('./support/types');\n\nfunction isArray(ar) {\n return Array.isArray(ar);\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return isObject(re) && objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\nexports.types.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return isObject(d) && objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\nexports.types.isDate = isDate;\n\nfunction isError(e) {\n return isObject(e) &&\n (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\nexports.types.isNativeError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = require('./support/isBuffer');\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n\n\nfunction pad(n) {\n return n < 10 ? '0' + n.toString(10) : n.toString(10);\n}\n\n\nvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',\n 'Oct', 'Nov', 'Dec'];\n\n// 26 Feb 16:19:34\nfunction timestamp() {\n var d = new Date();\n var time = [pad(d.getHours()),\n pad(d.getMinutes()),\n pad(d.getSeconds())].join(':');\n return [d.getDate(), months[d.getMonth()], time].join(' ');\n}\n\n\n// log is just a thin wrapper to console.log that prepends a timestamp\nexports.log = function() {\n console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));\n};\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n * prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */\nexports.inherits = require('inherits');\n\nexports._extend = function(origin, add) {\n // Don't do anything if add isn't an object\n if (!add || !isObject(add)) return origin;\n\n var keys = Object.keys(add);\n var i = keys.length;\n while (i--) {\n origin[keys[i]] = add[keys[i]];\n }\n return origin;\n};\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nvar kCustomPromisifiedSymbol = typeof Symbol !== 'undefined' ? Symbol('util.promisify.custom') : undefined;\n\nexports.promisify = function promisify(original) {\n if (typeof original !== 'function')\n throw new TypeError('The \"original\" argument must be of type Function');\n\n if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {\n var fn = original[kCustomPromisifiedSymbol];\n if (typeof fn !== 'function') {\n throw new TypeError('The \"util.promisify.custom\" argument must be of type Function');\n }\n Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn, enumerable: false, writable: false, configurable: true\n });\n return fn;\n }\n\n function fn() {\n var promiseResolve, promiseReject;\n var promise = new Promise(function (resolve, reject) {\n promiseResolve = resolve;\n promiseReject = reject;\n });\n\n var args = [];\n for (var i = 0; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n args.push(function (err, value) {\n if (err) {\n promiseReject(err);\n } else {\n promiseResolve(value);\n }\n });\n\n try {\n original.apply(this, args);\n } catch (err) {\n promiseReject(err);\n }\n\n return promise;\n }\n\n Object.setPrototypeOf(fn, Object.getPrototypeOf(original));\n\n if (kCustomPromisifiedSymbol) Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn, enumerable: false, writable: false, configurable: true\n });\n return Object.defineProperties(\n fn,\n getOwnPropertyDescriptors(original)\n );\n}\n\nexports.promisify.custom = kCustomPromisifiedSymbol\n\nfunction callbackifyOnRejected(reason, cb) {\n // `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M).\n // Because `null` is a special error value in callbacks which means \"no error\n // occurred\", we error-wrap so the callback consumer can distinguish between\n // \"the promise rejected with null\" or \"the promise fulfilled with undefined\".\n if (!reason) {\n var newReason = new Error('Promise was rejected with a falsy value');\n newReason.reason = reason;\n reason = newReason;\n }\n return cb(reason);\n}\n\nfunction callbackify(original) {\n if (typeof original !== 'function') {\n throw new TypeError('The \"original\" argument must be of type Function');\n }\n\n // We DO NOT return the promise as it gives the user a false sense that\n // the promise is actually somehow related to the callback's execution\n // and that the callback throwing will reject the promise.\n function callbackified() {\n var args = [];\n for (var i = 0; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n\n var maybeCb = args.pop();\n if (typeof maybeCb !== 'function') {\n throw new TypeError('The last argument must be of type Function');\n }\n var self = this;\n var cb = function() {\n return maybeCb.apply(self, arguments);\n };\n // In true node style we process the callback on `nextTick` with all the\n // implications (stack, `uncaughtException`, `async_hooks`)\n original.apply(this, args)\n .then(function(ret) { process.nextTick(cb.bind(null, null, ret)) },\n function(rej) { process.nextTick(callbackifyOnRejected.bind(null, rej, cb)) });\n }\n\n Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original));\n Object.defineProperties(callbackified,\n getOwnPropertyDescriptors(original));\n return callbackified;\n}\nexports.callbackify = callbackify;\n","'use strict';\n\nvar forEach = require('foreach');\nvar availableTypedArrays = require('available-typed-arrays');\nvar callBound = require('call-bind/callBound');\n\nvar $toString = callBound('Object.prototype.toString');\nvar hasToStringTag = require('has-tostringtag/shams')();\n\nvar typedArrays = availableTypedArrays();\n\nvar $slice = callBound('String.prototype.slice');\nvar toStrTags = {};\nvar gOPD = require('es-abstract/helpers/getOwnPropertyDescriptor');\nvar getPrototypeOf = Object.getPrototypeOf; // require('getprototypeof');\nif (hasToStringTag && gOPD && getPrototypeOf) {\n\tforEach(typedArrays, function (typedArray) {\n\t\tif (typeof global[typedArray] === 'function') {\n\t\t\tvar arr = new global[typedArray]();\n\t\t\tif (!(Symbol.toStringTag in arr)) {\n\t\t\t\tthrow new EvalError('this engine has support for Symbol.toStringTag, but ' + typedArray + ' does not have the property! Please report this.');\n\t\t\t}\n\t\t\tvar proto = getPrototypeOf(arr);\n\t\t\tvar descriptor = gOPD(proto, Symbol.toStringTag);\n\t\t\tif (!descriptor) {\n\t\t\t\tvar superProto = getPrototypeOf(proto);\n\t\t\t\tdescriptor = gOPD(superProto, Symbol.toStringTag);\n\t\t\t}\n\t\t\ttoStrTags[typedArray] = descriptor.get;\n\t\t}\n\t});\n}\n\nvar tryTypedArrays = function tryAllTypedArrays(value) {\n\tvar foundName = false;\n\tforEach(toStrTags, function (getter, typedArray) {\n\t\tif (!foundName) {\n\t\t\ttry {\n\t\t\t\tvar name = getter.call(value);\n\t\t\t\tif (name === typedArray) {\n\t\t\t\t\tfoundName = name;\n\t\t\t\t}\n\t\t\t} catch (e) {}\n\t\t}\n\t});\n\treturn foundName;\n};\n\nvar isTypedArray = require('is-typed-array');\n\nmodule.exports = function whichTypedArray(value) {\n\tif (!isTypedArray(value)) { return false; }\n\tif (!hasToStringTag) { return $slice($toString(value), 8, -1); }\n\treturn tryTypedArrays(value);\n};\n","'use strict';\n\nvar possibleNames = [\n\t'BigInt64Array',\n\t'BigUint64Array',\n\t'Float32Array',\n\t'Float64Array',\n\t'Int16Array',\n\t'Int32Array',\n\t'Int8Array',\n\t'Uint16Array',\n\t'Uint32Array',\n\t'Uint8Array',\n\t'Uint8ClampedArray'\n];\n\nmodule.exports = function availableTypedArrays() {\n\tvar out = [];\n\tfor (var i = 0; i < possibleNames.length; i++) {\n\t\tif (typeof global[possibleNames[i]] === 'function') {\n\t\t\tout[out.length] = possibleNames[i];\n\t\t}\n\t}\n\treturn out;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%');\nif ($gOPD) {\n\ttry {\n\t\t$gOPD([], 'length');\n\t} catch (e) {\n\t\t// IE 8 has a broken gOPD\n\t\t$gOPD = null;\n\t}\n}\n\nmodule.exports = $gOPD;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"files_videoplayer-\" + chunkId + \".js?v=\" + {\"vendors-node_modules_video_js_dist_video_es_js\":\"1b6d9725c996f15df33f\",\"_34aa\":\"ab777726a58732acd0d2\",\"css_style_css\":\"211b329b40ae32bf5d72\",\"vendors-node_modules_video_js_dist_video-js_css\":\"6813c23d9e5029c0233b\"}[chunkId] + \"\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.p = \"/apps/files_videoplayer/js/\";","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"main\": 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tfor(moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) var result = runtime(__webpack_require__);\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkIds[i]] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkfiles_videoplayer\"] = self[\"webpackChunkfiles_videoplayer\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","/**\n * @copyright 2018 Christoph Wurst <christoph@winzerhof-wurst.at>\n *\n * @author 2018 Christoph Wurst <christoph@winzerhof-wurst.at>\n *\n * @license GNU AGPL version 3 or any later version\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport escapeHTML from 'escape-html'\nimport { loadState } from '@nextcloud/initial-state'\n\n__webpack_nonce__ = btoa(OC.requestToken)\n__webpack_public_path__ = OC.filePath('files_videoplayer', '', 'js/')\n\nlet videojs = null\n\nconst { limit } = loadState('files_downloadlimit', 'download_limit', { limit: -1 })\nconst hasDownloadLimit = limit !== -1\n\nconst videoViewer = {\n\tUI: {\n\t\tshow() {\n\t\t\tconst playerView = document.createElement('video')\n\t\t\tplayerView.id = 'my_video_1'\n\t\t\tplayerView.classList.add('video-js')\n\t\t\tplayerView.classList.add('vjs-fill')\n\t\t\tplayerView.classList.add('vjs-big-play-centered')\n\t\t\tplayerView.controls = true\n\t\t\tplayerView.preload = 'auto'\n\t\t\tplayerView.width = '100%'\n\t\t\tplayerView.height = '100%'\n\t\t\tplayerView.poster = OC.filePath('files_videoplayer', '', 'img') + '/poster.png'\n\t\t\tplayerView.setAttribute('data-setup', '{\"techOrder\": [\"html5\"]}')\n\n\t\t\tif (!hasDownloadLimit) {\n\t\t\t\tconst source = document.createElement('source')\n\t\t\t\tsource.src = escapeHTML(videoViewer.location).replace('&amp;', '&')\n\n\t\t\t\tif (videoViewer.mime) {\n\t\t\t\t\tsource.type = escapeHTML(videoViewer.mime)\n\t\t\t\t}\n\n\t\t\t\tplayerView.appendChild(source)\n\t\t\t}\n\n\t\t\tif (videoViewer.inline === null) {\n\t\t\t\tconst overlay = document.createElement('div')\n\t\t\t\toverlay.id = 'videoplayer_overlay'\n\n\t\t\t\tconst outerContainer = document.createElement('div')\n\t\t\t\touterContainer.id = 'videoplayer_outerContainer'\n\n\t\t\t\tconst container = document.createElement('div')\n\t\t\t\tcontainer.id = 'videoplayer_container'\n\n\t\t\t\tconst player = document.createElement('div')\n\t\t\t\tplayer.id = 'videoplayer'\n\n\t\t\t\tcontainer.appendChild(player)\n\t\t\t\touterContainer.appendChild(container)\n\t\t\t\toverlay.appendChild(outerContainer)\n\n\t\t\t\tplayer.appendChild(playerView)\n\t\t\t\tdocument.body.appendChild(overlay)\n\n\t\t\t\t// close when clicking on the overlay\n\t\t\t\toverlay.addEventListener('click', function(e) {\n\t\t\t\t\tif (e.target === this) {\n\t\t\t\t\t\tvideoViewer.hidePlayer()\n\t\t\t\t\t}\n\t\t\t\t})\n\n\t\t\t\tsetTimeout(() => { overlay.className = 'show' }, 0)\n\t\t\t} else {\n\t\t\t\tconst wrapper = document.createElement('div')\n\t\t\t\twrapper.id = 'videoplayer_view'\n\t\t\t\twrapper.appendChild(playerView)\n\t\t\t\tvideoViewer.inline.appendChild(wrapper)\n\t\t\t}\n\t\t\t// initialize player\n\t\t\tvideojs('my_video_1', {\n\t\t\t\tfill: true,\n\t\t\t}).ready(function() {\n\t\t\t\tvideoViewer.player = this\n\t\t\t\tif (videoViewer.inline === null) {\n\t\t\t\t\t// append close button to video element\n\t\t\t\t\tconst closeButton = document.createElement('a')\n\t\t\t\t\tcloseButton.className = 'icon-view-close'\n\t\t\t\t\tcloseButton.id = 'box-close'\n\t\t\t\t\tcloseButton.href = '#'\n\t\t\t\t\tcloseButton.addEventListener('click', function() {\n\t\t\t\t\t\tvideoViewer.hidePlayer()\n\t\t\t\t\t})\n\t\t\t\t\tdocument.getElementById('my_video_1').appendChild(closeButton)\n\t\t\t\t}\n\t\t\t\t// autoplay\n\t\t\t\tif (document.getElementById('body-public') === null) {\n\t\t\t\t\tvideoViewer.player.play()\n\t\t\t\t}\n\t\t\t})\n\n\t\t},\n\t\thide() {\n\t\t\tconst overlay = document.getElementById('videoplayer_overlay')\n\t\t\toverlay.className = ''\n\t\t\tsetTimeout(() => {\n\t\t\t\toverlay.parentElement.removeChild(overlay)\n\t\t\t}, 500)\n\t\t},\n\t},\n\tmime: null,\n\tfile: null,\n\tlocation: null,\n\tplayer: null,\n\tinline: null,\n\tmimeTypes: [\n\t\t'video/mp4',\n\t\t'video/x-m4v',\n\t\t'video/webm',\n\t\t'video/x-flv',\n\t\t'video/ogg',\n\t\t'video/quicktime',\n\t\t'video/x-matroska',\n\t],\n\tmimeTypeAliasses: {\n\t\t'video/x-matroska': 'video/webm', // mkv support for Chrome. webm uses the same container format\n\t},\n\tonView(file, data) {\n\t\tvideoViewer.file = file\n\t\tvideoViewer.dir = data.dir\n\t\tvideoViewer.location = data.fileList.getDownloadUrl(file, videoViewer.dir)\n\t\tvideoViewer.mime = data.$file.attr('data-mime')\n\t\tif (Object.prototype.hasOwnProperty.call(videoViewer.mimeTypeAliasses, videoViewer.mime)) {\n\t\t\tvideoViewer.mime = videoViewer.mimeTypeAliasses[videoViewer.mime]\n\t\t}\n\t\tvideoViewer.showPlayer()\n\t},\n\tonViewInline(element, file, mime) {\n\t\tvideoViewer.location = file\n\t\tvideoViewer.mime = mime\n\t\tif (Object.prototype.hasOwnProperty.call(videoViewer.mimeTypeAliasses, videoViewer.mime)) {\n\t\t\tvideoViewer.mime = videoViewer.mimeTypeAliasses[videoViewer.mime]\n\t\t}\n\t\tvideoViewer.inline = element\n\t\tvideoViewer.showPlayer()\n\t},\n\tshowPlayer() {\n\t\timport('video.js').then((_videojs) => {\n\t\t\tvideojs = _videojs.default\n\t\t\tPromise.all([\n\t\t\t\timport('../css/style.css'),\n\t\t\t\t// eslint-disable-next-line import/no-webpack-loader-syntax\n\t\t\t\timport('video.js/dist/video-js.css'),\n\t\t\t]).then(() => {\n\t\t\t\tvideoViewer.UI.show()\n\t\t\t})\n\t\t})\n\t},\n\thidePlayer() {\n\t\tif (videoViewer.player !== null && videoViewer.player !== false && videoViewer.inline === null) {\n\t\t\tvideoViewer.player.dispose()\n\t\t\tvideoViewer.player = false\n\t\t\tvideoViewer.UI.hide()\n\t\t}\n\t},\n\tlog(message) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.log(message)\n\t},\n}\n\ndocument.addEventListener('DOMContentLoaded', function() {\n\n\t// add event to ESC key\n\tdocument.addEventListener('keyup', function(e) {\n\t\tif ((e.key !== undefined && e.key === 'Escape')\n\t\t\t|| (e.keyCode !== undefined && e.keyCode === 27)) {\n\t\t\tvideoViewer.hidePlayer()\n\t\t}\n\t})\n\n\t// Public page magic\n\tif (document.getElementById('body-public') && document.getElementById('imgframe')) {\n\t\tconst mimetype = document.getElementById('mimetype').value\n\t\tfor (let j = 0; j < videoViewer.mimeTypes.length; ++j) {\n\t\t\tif (videoViewer.mimeTypes[j] === mimetype) {\n\t\t\t\tconst videoUrl = window.location.href.split('?')[0] + '/download'\n\t\t\t\tvideoViewer.onViewInline(document.getElementById('imgframe'), videoUrl, mimetype)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n})\n"],"names":["inProgress","dataWebpackPrefix","exports","app","key","fallback","elem","document","querySelector","concat","undefined","Error","JSON","parse","atob","value","e","_typeof","obj","Symbol","iterator","constructor","prototype","isDeepEqual","isDeepStrictEqual","_require$codes","codes","ERR_AMBIGUOUS_ARGUMENT","ERR_INVALID_ARG_TYPE","ERR_INVALID_ARG_VALUE","ERR_INVALID_RETURN_VALUE","ERR_MISSING_ARGS","AssertionError","inspect","_require$types","isPromise","isRegExp","objectAssign","Object","assign","objectIs","is","Map","lazyLoadComparison","comparison","warned","assert","module","ok","NO_EXCEPTION_SENTINEL","innerFail","message","innerOk","fn","argLen","generatedMessage","err","actual","expected","operator","stackStartFn","_len","arguments","length","args","Array","_key","apply","fail","internalMessage","argsLen","warn","process","emitWarning","console","bind","errArgs","equal","notEqual","deepEqual","notDeepEqual","deepStrictEqual","notDeepStrictEqual","strictEqual","notStrictEqual","Comparison","keys","_this","this","instance","Constructor","TypeError","_classCallCheck","forEach","test","compareExceptionKey","a","b","name","expectedException","msg","push","isPrototypeOf","call","getActual","checkIsPromise","then","catch","waitForActual","promiseFn","Promise","resolve","resultPromise","expectsError","error","details","fnType","expectsNoError","strict","_len6","_key6","throws","_len2","_key2","rejects","_len3","_key3","result","doesNotThrow","_len4","_key4","doesNotReject","_len5","_key5","ifError","newErr","origStack","stack","tmp2","split","shift","tmp1","i","pos","indexOf","slice","join","_defineProperty","defineProperty","enumerable","configurable","writable","_defineProperties","target","props","descriptor","_possibleConstructorReturn","self","_assertThisInitialized","ReferenceError","_wrapNativeSuper","Class","_cache","Function","toString","has","get","set","Wrapper","_construct","_getPrototypeOf","create","_setPrototypeOf","isNativeReflectConstruct","Reflect","construct","sham","Proxy","Date","Parent","o","p","setPrototypeOf","__proto__","getPrototypeOf","endsWith","str","search","this_len","substring","blue","green","red","white","kReadableOperator","strictEqualObject","notStrictEqualObject","notIdentical","copyError","source","inspectValue","val","compact","customInspect","depth","maxArrayLength","Infinity","showHidden","breakLength","showProxy","sorted","getters","createErrDiff","other","res","lastPos","end","skipped","actualInspected","actualLines","expectedLines","indicator","inputLength","stderr","isTTY","columns","count","Math","floor","maxCount","log","repeat","pop","maxLines","max","_actualLines","printedLines","skippedMsg","cur","expectedLine","actualLine","divergingLines","_Error","options","limit","stackTraceLimit","String","getColorDepth","base","_res","knownOperators","code","captureStackTrace","protoProps","staticProps","subClass","superClass","_inherits","custom","recurseTimes","ctx","ownKeys","getOwnPropertySymbols","filter","sym","getOwnPropertyDescriptor","_objectSpread","util","createErrorType","Base","NodeError","_Base","arg1","arg2","arg3","getMessage","oneOf","thing","isArray","len","map","determiner","substr","replace","type","start","includes","reason","inspected","RangeError","input","_slicedToArray","arr","_arrayWithHoles","_arr","_n","_d","_e","_s","_i","next","done","_iterableToArrayLimit","_nonIterableRest","regexFlagsSupported","flags","arrayFromSet","array","arrayFromMap","objectGetOwnPropertySymbols","numberIsNaN","Number","isNaN","uncurryThis","f","hasOwnProperty","propertyIsEnumerable","objectToString","isAnyArrayBuffer","isArrayBufferView","isDate","isMap","isSet","isNativeError","isBoxedPrimitive","isNumberObject","isStringObject","isBooleanObject","isBigIntObject","isSymbolObject","isFloat32Array","isFloat64Array","isNonIndex","charCodeAt","pow","getOwnNonIndexProperties","compare","x","y","min","innerDeepEqual","val1","val2","memos","buf1","buf2","val1Tag","keys1","keys2","keyCheck","getTime","RegExp","byteLength","Uint8Array","buffer","byteOffset","areSimilarTypedArrays","offset","areSimilarFloatArrays","_keys","_keys2","size","valueOf","Boolean","BigInt","isEqualBoxedPrimitive","getEnumerables","k","iterationType","aKeys","bKeys","symbolKeysA","symbolKeysB","_symbolKeysB","position","val2MemoA","val2MemoB","areEq","objEquiv","delete","setHasEqualElement","memo","setValues","findLooseMatchingPrimitives","prim","setMightHaveLoosePrim","altValue","mapMightHaveLoosePrim","item","curB","mapHasEqualEntry","key1","item1","key2","aValues","Set","add","bValues","_val","setEquiv","aEntries","_aEntries$i","item2","bEntries","_i2","_bEntries$_i","mapEquiv","keysA","GetIntrinsic","callBind","$indexOf","allowMissing","intrinsic","$apply","$call","$reflectApply","$gOPD","$defineProperty","$max","originalFunction","func","desc","applyBind","now","times","g","window","functions","label","time","duration","format","object","expression","tuple","global","isCallable","tryToString","argument","isObject","toIndexedObject","toAbsoluteIndex","lengthOfArrayLike","createMethod","IS_INCLUDES","$this","el","fromIndex","O","index","fails","wellKnownSymbol","V8_VERSION","SPECIES","METHOD_NAME","foo","isConstructor","originalArray","C","arraySpeciesConstructor","stringSlice","it","TO_STRING_TAG_SUPPORT","classofRaw","TO_STRING_TAG","CORRECT_ARGUMENTS","tag","tryGet","callee","hasOwn","getOwnPropertyDescriptorModule","definePropertyModule","exceptions","DESCRIPTORS","createPropertyDescriptor","bitmap","toPropertyKey","propertyKey","createNonEnumerableProperty","makeBuiltIn","setGlobal","unsafe","simple","noTargetGet","EXISTS","createElement","getBuiltIn","match","version","userAgent","Deno","versions","v8","defineBuiltIn","copyConstructorProperties","isForced","targetProperty","sourceProperty","TARGET","GLOBAL","STATIC","stat","forced","exec","NATIVE_BIND","FunctionPrototype","getDescriptor","PROPER","CONFIGURABLE","aFunction","namespace","method","aCallable","V","P","check","globalThis","toObject","classof","store","functionToString","inspectSource","NATIVE_WEAK_MAP","shared","sharedKey","hiddenKeys","OBJECT_ALREADY_INITIALIZED","WeakMap","state","wmget","wmhas","wmset","metadata","facade","STATE","enforce","getterFor","TYPE","noop","empty","constructorRegExp","INCORRECT_TO_STRING","isConstructorModern","isConstructorLegacy","called","replacement","feature","detection","data","normalize","POLYFILL","NATIVE","string","toLowerCase","USE_SYMBOL_AS_UID","$Symbol","toLength","CONFIGURABLE_FUNCTION_NAME","InternalStateModule","enforceInternalState","getInternalState","CONFIGURABLE_LENGTH","TEMPLATE","getter","setter","arity","symbol","IE8_DOM_DEFINE","V8_PROTOTYPE_DEFINE_BUG","anObject","$getOwnPropertyDescriptor","ENUMERABLE","WRITABLE","Attributes","current","propertyIsEnumerableModule","internalObjectKeys","getOwnPropertyNames","names","$propertyIsEnumerable","NASHORN_BUG","pref","getOwnPropertyNamesModule","getOwnPropertySymbolsModule","uid","SHARED","IS_PURE","mode","copyright","license","toIntegerOrInfinity","integer","IndexedObject","requireObjectCoercible","ceil","number","isSymbol","getMethod","ordinaryToPrimitive","TO_PRIMITIVE","exoticToPrim","toPrimitive","id","postfix","random","NATIVE_SYMBOL","WellKnownSymbolsStore","symbolFor","createWellKnownSymbol","withoutSetter","description","$","createProperty","arraySpeciesCreate","arrayMethodHasSpeciesSupport","IS_CONCAT_SPREADABLE","MAX_SAFE_INTEGER","MAXIMUM_ALLOWED_INDEX_EXCEEDED","IS_CONCAT_SPREADABLE_SUPPORT","SPECIES_SUPPORT","isConcatSpreadable","spreadable","proto","arg","E","A","n","hasSymbols","toStr","origDefineProperty","supportsDescriptors","_","arePropertyDescriptorsSupported","predicate","defineProperties","predicates","firstSource","to","nextSource","keysArray","nextIndex","nextKey","polyfill","matchHtmlRegExp","escape","html","lastIndex","l","ERROR_MESSAGE","funcType","that","bound","binder","boundLength","boundArgs","Empty","implementation","$SyntaxError","SyntaxError","$Function","$TypeError","getEvalledConstructor","expressionSyntax","throwTypeError","ThrowTypeError","calleeThrows","gOPDthrows","getProto","needsEval","TypedArray","INTRINSICS","AggregateError","ArrayBuffer","Atomics","DataView","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","eval","EvalError","Float32Array","Float64Array","FinalizationRegistry","Int8Array","Int16Array","Int32Array","isFinite","parseFloat","parseInt","SharedArrayBuffer","Uint8ClampedArray","Uint16Array","Uint32Array","URIError","WeakRef","WeakSet","doEval","gen","LEGACY_ALIASES","$concat","$spliceApply","splice","$replace","$strSlice","rePropName","reEscapeChar","stringToPath","first","last","quote","subString","getBaseIntrinsic","alias","intrinsicName","parts","intrinsicBaseName","intrinsicRealName","skipFurtherCaching","isOwn","part","origSymbol","hasSymbolSham","symObj","syms","toStringTag","ctor","superCtor","super_","TempCtor","hasToStringTag","$toString","callBound","isStandardArguments","isLegacyArguments","supportsStandardArguments","GeneratorFunction","fnToStr","isFnRegex","generatorFunc","getGeneratorFunc","define","getPolyfill","shim","NaN","availableTypedArrays","typedArrays","$slice","toStrTags","gOPD","typedArray","superProto","anyTrue","tryTypedArrays","keysShim","isArgs","isEnumerable","hasDontEnumBug","hasProtoEnumBug","dontEnums","equalsConstructorPrototype","excludedKeys","$applicationCache","$console","$external","$frame","$frameElement","$frames","$innerHeight","$innerWidth","$onmozfullscreenchange","$onmozfullscreenerror","$outerHeight","$outerWidth","$pageXOffset","$pageYOffset","$parent","$scrollLeft","$scrollTop","$scrollX","$scrollY","$self","$webkitIndexedDB","$webkitStorageInfo","$window","hasAutomationEqualityBug","isFunction","isArguments","isString","theKeys","skipProto","j","skipConstructor","equalsConstructorPrototypeIfNotBuggy","origKeys","originalKeys","cachedSetTimeout","cachedClearTimeout","defaultSetTimout","defaultClearTimeout","runTimeout","fun","setTimeout","clearTimeout","currentQueue","queue","draining","queueIndex","cleanUpNextTick","drainQueue","timeout","run","marker","runClearTimeout","Item","nextTick","title","browser","env","argv","on","addListener","once","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","binding","cwd","chdir","dir","umask","copy","fill","readUInt8","isArgumentsObject","isGeneratorFunction","whichTypedArray","isTypedArray","BigIntSupported","SymbolSupported","ObjectToString","numberValue","stringValue","booleanValue","bigIntValue","symbolValue","checkBoxedPrimitive","prototypeValueOf","isMapToString","isSetToString","isWeakMapToString","isWeakSetToString","isArrayBufferToString","isArrayBuffer","working","isDataViewToString","isDataView","isView","isUint8Array","isUint8ClampedArray","isUint16Array","isUint32Array","isInt8Array","isInt16Array","isInt32Array","isBigInt64Array","isBigUint64Array","isWeakMap","isWeakSet","SharedArrayBufferCopy","isSharedArrayBufferToString","isSharedArrayBuffer","isAsyncFunction","isMapIterator","isSetIterator","isGeneratorObject","isWebAssemblyCompiledModule","getOwnPropertyDescriptors","descriptors","formatRegExp","objects","stringify","isNull","deprecate","noDeprecation","throwDeprecation","traceDeprecation","trace","debugs","debugEnvRegex","NODE_DEBUG","debugEnv","toUpperCase","opts","seen","stylize","stylizeNoColor","colors","isBoolean","_extend","isUndefined","stylizeWithColor","formatValue","styleType","style","styles","ret","primitive","isNumber","formatPrimitive","visibleKeys","hash","idx","arrayToHash","isError","formatError","output","braces","toUTCString","formatProperty","formatArray","reduce","prev","numLinesEst","reduceToSingleString","line","ar","re","d","pad","debuglog","pid","types","isNullOrUndefined","isPrimitive","isBuffer","months","timestamp","getHours","getMinutes","getSeconds","getDate","getMonth","prop","inherits","origin","kCustomPromisifiedSymbol","callbackifyOnRejected","cb","newReason","promisify","original","promiseResolve","promiseReject","promise","reject","callbackify","callbackified","maybeCb","rej","foundName","possibleNames","out","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","m","__esModule","definition","chunkId","all","promises","u","url","script","needAttach","scripts","getElementsByTagName","s","getAttribute","charset","nc","setAttribute","src","onScriptComplete","event","onerror","onload","doneFns","parentNode","removeChild","head","appendChild","r","installedChunks","installedChunkData","errorType","realSrc","request","webpackJsonpCallback","parentChunkLoadingFunction","chunkIds","moreModules","runtime","chunkLoadingGlobal","__webpack_nonce__","btoa","OC","requestToken","__webpack_public_path__","filePath","videojs","hasDownloadLimit","loadState","videoViewer","UI","show","playerView","classList","controls","preload","width","height","poster","escapeHTML","location","mime","inline","overlay","outerContainer","container","player","body","addEventListener","hidePlayer","className","wrapper","ready","closeButton","href","getElementById","play","hide","parentElement","file","mimeTypes","mimeTypeAliasses","onView","fileList","getDownloadUrl","$file","attr","showPlayer","onViewInline","element","_videojs","default","dispose","keyCode","mimetype","videoUrl"],"sourceRoot":""} \ No newline at end of file
+{"version":3,"file":"files_videoplayer-main.js?v=a17396eb61277e3f2870","mappings":";UAAIA,EACAC,iCCIJC,EAAQ,EAUR,SAAmBC,EAAKC,EAAKC,GAC3B,IAAIC,EAAOC,SAASC,cAAc,kBAAkBC,OAAON,EAAK,KAAKM,OAAOL,IAE5E,GAAa,OAATE,EAAe,CACjB,QAAiBI,IAAbL,EACF,OAAOA,EAGT,MAAM,IAAIM,MAAM,gCAA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sO,EAAY+B,UAAU79B,SAAUwtB,EACnD,GAAIsO,EAAY+B,UAAUrQ,KAAOmR,EAAU,CAC1C,IAAMC,EAAWjoB,OAAO8lB,SAASc,KAAK34B,MAAM,KAAK,GAAK,YACtDk3B,EAAYuC,aAAa7hC,SAASghC,eAAe,YAAaoB,EAAUD,GACxE,KACA,CAIH","sources":["webpack:///files_videoplayer/webpack/runtime/load script","webpack:///files_videoplayer/node_modules/@nextcloud/initial-state/dist/index.js","webpack:///files_videoplayer/node_modules/assert/build/assert.js","webpack:///files_videoplayer/node_modules/assert/build/internal/assert/assertion_error.js","webpack:///files_videoplayer/node_modules/assert/build/internal/errors.js","webpack:///files_videoplayer/node_modules/assert/build/internal/util/comparisons.js","webpack:///files_videoplayer/node_modules/call-bind/callBound.js","webpack:///files_videoplayer/node_modules/call-bind/index.js","webpack:///files_videoplayer/node_modules/console-browserify/index.js","webpack:///files_videoplayer/node_modules/core-js/internals/a-callable.js","webpack:///files_videoplayer/node_modules/core-js/internals/an-object.js","webpack:///files_videoplayer/node_modules/core-js/internals/array-includes.js","webpack:///files_videoplayer/node_modules/core-js/internals/array-method-has-species-support.js","webpack:///files_videoplayer/node_modules/core-js/internals/array-species-constructor.js","webpack:///files_videoplayer/node_modules/core-js/internals/array-species-create.js","webpack:///files_videoplayer/node_modules/core-js/internals/classof-raw.js","webpack:///files_videoplayer/node_modules/core-js/internals/classof.js","webpack:///files_videoplayer/node_modules/core-js/internals/copy-constructor-properties.js","webpack:///files_videoplayer/node_modules/core-js/internals/create-non-enumerable-property.js","webpack:///files_videoplayer/node_modules/core-js/internals/create-property-descriptor.js","webpack:///files_videoplayer/node_modules/core-js/internals/create-property.js","webpack:///files_videoplayer/node_modules/core-js/internals/define-built-in.js","webpack:///files_videoplayer/node_modules/core-js/internals/descriptors.js","webpack:///files_videoplayer/node_modules/core-js/internals/document-create-element.js","webpack:///files_videoplayer/node_modules/core-js/internals/engine-user-agent.js","webpack:///files_videoplayer/node_modules/core-js/internals/engine-v8-version.js","webpack:///files_videoplayer/node_modules/core-js/internals/enum-bug-keys.js","webpack:///files_videoplayer/node_modules/core-js/internals/export.js","webpack:///files_videoplayer/node_modules/core-js/internals/fails.js","webpack:///files_videoplayer/node_modules/core-js/internals/function-bind-native.js","webpack:///files_videoplayer/node_modules/core-js/internals/function-call.js","webpack:///files_videoplayer/node_modules/core-js/internals/function-name.js","webpack:///files_videoplayer/node_modules/core-js/internals/function-uncurry-this.js","webpack:///files_videoplayer/node_modules/core-js/internals/get-built-in.js","webpack:///files_videoplayer/node_modules/core-js/internals/get-method.js","webpack:///files_videoplayer/node_modules/core-js/internals/global.js","webpack:///files_videoplayer/node_modules/core-js/internals/has-own-property.js","webpack:///files_videoplayer/node_modules/core-js/internals/hidden-keys.js","webpack:///files_videoplayer/node_modules/core-js/internals/ie8-dom-define.js","webpack:///files_videoplayer/node_modules/core-js/internals/indexed-object.js","webpack:///files_videoplayer/node_modules/core-js/internals/inspect-source.js","webpack:///files_videoplayer/node_modules/core-js/internals/internal-state.js","webpack:///files_videoplayer/node_modules/core-js/internals/is-array.js","webpack:///files_videoplayer/node_modules/core-js/internals/is-callable.js","webpack:///files_videoplayer/node_modules/core-js/internals/is-constructor.js","webpack:///files_videoplayer/node_modules/core-js/internals/is-forced.js","webpack:///files_videoplayer/node_modules/core-js/internals/is-object.js","webpack:///files_videoplayer/node_modules/core-js/internals/is-pure.js","webpack:///files_videoplayer/node_modules/core-js/internals/is-symbol.js","webpack:///files_videoplayer/node_modules/core-js/internals/length-of-array-like.js","webpack:///files_videoplayer/node_modules/core-js/internals/make-built-in.js","webpack:///files_videoplayer/node_modules/core-js/internals/native-symbol.js","webpack:///files_videoplayer/node_modules/core-js/internals/native-weak-map.js","webpack:///files_videoplayer/node_modules/core-js/internals/object-define-property.js","webpack:///files_videoplayer/node_modules/core-js/internals/object-get-own-property-descriptor.js","webpack:///files_videoplayer/node_modules/core-js/internals/object-get-own-property-names.js","webpack:///files_videoplayer/node_modules/core-js/internals/object-get-own-property-symbols.js","webpack:///files_videoplayer/node_modules/core-js/internals/object-is-prototype-of.js","webpack:///files_videoplayer/node_modules/core-js/internals/object-keys-internal.js","webpack:///files_videoplayer/node_modules/core-js/internals/object-property-is-enumerable.js","webpack:///files_videoplayer/node_modules/core-js/internals/ordinary-to-primitive.js","webpack:///files_videoplayer/node_modules/core-js/internals/own-keys.js","webpack:///files_videoplayer/node_modules/core-js/internals/require-object-coercible.js","webpack:///files_videoplayer/node_modules/core-js/internals/set-global.js","webpack:///files_videoplayer/node_modules/core-js/internals/shared-key.js","webpack:///files_videoplayer/node_modules/core-js/internals/shared-store.js","webpack:///files_videoplayer/node_modules/core-js/internals/shared.js","webpack:///files_videoplayer/node_modules/core-js/internals/to-absolute-index.js","webpack:///files_videoplayer/node_modules/core-js/internals/to-indexed-object.js","webpack:///files_videoplayer/node_modules/core-js/internals/to-integer-or-infinity.js","webpack:///files_videoplayer/node_modules/core-js/internals/to-length.js","webpack:///files_videoplayer/node_modules/core-js/internals/to-object.js","webpack:///files_videoplayer/node_modules/core-js/internals/to-primitive.js","webpack:///files_videoplayer/node_modules/core-js/internals/to-property-key.js","webpack:///files_videoplayer/node_modules/core-js/internals/to-string-tag-support.js","webpack:///files_videoplayer/node_modules/core-js/internals/try-to-string.js","webpack:///files_videoplayer/node_modules/core-js/internals/uid.js","webpack:///files_videoplayer/node_modules/core-js/internals/use-symbol-as-uid.js","webpack:///files_videoplayer/node_modules/core-js/internals/v8-prototype-define-bug.js","webpack:///files_videoplayer/node_modules/core-js/internals/well-known-symbol.js","webpack:///files_videoplayer/node_modules/core-js/modules/es.array.concat.js","webpack:///files_videoplayer/node_modules/define-properties/index.js","webpack:///files_videoplayer/node_modules/es6-object-assign/index.js","webpack:///files_videoplayer/node_modules/escape-html/index.js","webpack:///files_videoplayer/node_modules/foreach/index.js","webpack:///files_videoplayer/node_modules/function-bind/implementation.js","webpack:///files_videoplayer/node_modules/function-bind/index.js","webpack:///files_videoplayer/node_modules/get-intrinsic/index.js","webpack:///files_videoplayer/node_modules/has-symbols/index.js","webpack:///files_videoplayer/node_modules/has-symbols/shams.js","webpack:///files_videoplayer/node_modules/has-tostringtag/shams.js","webpack:///files_videoplayer/node_modules/has/src/index.js","webpack:///files_videoplayer/node_modules/inherits/inherits_browser.js","webpack:///files_videoplayer/node_modules/is-arguments/index.js","webpack:///files_videoplayer/node_modules/is-generator-function/index.js","webpack:///files_videoplayer/node_modules/is-nan/implementation.js","webpack:///files_videoplayer/node_modules/is-nan/index.js","webpack:///files_videoplayer/node_modules/is-nan/polyfill.js","webpack:///files_videoplayer/node_modules/is-nan/shim.js","webpack:///files_videoplayer/node_modules/is-typed-array/index.js","webpack:///files_videoplayer/node_modules/object-is/implementation.js","webpack:///files_videoplayer/node_modules/object-is/index.js","webpack:///files_videoplayer/node_modules/object-is/polyfill.js","webpack:///files_videoplayer/node_modules/object-is/shim.js","webpack:///files_videoplayer/node_modules/object-keys/implementation.js","webpack:///files_videoplayer/node_modules/object-keys/index.js","webpack:///files_videoplayer/node_modules/object-keys/isArguments.js","webpack:///files_videoplayer/node_modules/process/browser.js","webpack:///files_videoplayer/node_modules/util/support/isBufferBrowser.js","webpack:///files_videoplayer/node_modules/util/support/types.js","webpack:///files_videoplayer/node_modules/util/util.js","webpack:///files_videoplayer/node_modules/which-typed-array/index.js","webpack:///files_videoplayer/javascript/dynamic|/home/runner/work/files_videoplayer/files_videoplayer/node_modules/available-typed-arrays/index.js","webpack:///files_videoplayer/javascript/dynamic|/home/runner/work/files_videoplayer/files_videoplayer/node_modules/es-abstract/helpers/getOwnPropertyDescriptor.js","webpack:///files_videoplayer/webpack/bootstrap","webpack:///files_videoplayer/webpack/runtime/compat get default export","webpack:///files_videoplayer/webpack/runtime/define property getters","webpack:///files_videoplayer/webpack/runtime/ensure chunk","webpack:///files_videoplayer/webpack/runtime/get javascript chunk filename","webpack:///files_videoplayer/webpack/runtime/global","webpack:///files_videoplayer/webpack/runtime/hasOwnProperty shorthand","webpack:///files_videoplayer/webpack/runtime/make namespace object","webpack:///files_videoplayer/webpack/runtime/publicPath","webpack:///files_videoplayer/webpack/runtime/jsonp chunk loading","webpack:///files_videoplayer/src/main.js"],"sourcesContent":["var inProgress = {};\nvar dataWebpackPrefix = \"files_videoplayer:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\t;\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.loadState = loadState;\n\nrequire(\"core-js/modules/es.array.concat.js\");\n\n/**\n * @param app app ID, e.g. \"mail\"\n * @param key name of the property\n * @param fallback optional parameter to use as default value\n * @throws if the key can't be found\n */\nfunction loadState(app, key, fallback) {\n var elem = document.querySelector(\"#initial-state-\".concat(app, \"-\").concat(key));\n\n if (elem === null) {\n if (fallback !== undefined) {\n return fallback;\n }\n\n throw new Error(\"Could not find initial state \".concat(key, \" of \").concat(app));\n }\n\n try {\n return JSON.parse(atob(elem.value));\n } catch (e) {\n throw new Error(\"Could not parse initial state \".concat(key, \" of \").concat(app));\n }\n}\n//# sourceMappingURL=index.js.map","// Currently in sync with Node.js lib/assert.js\n// https://github.com/nodejs/node/commit/2a51ae424a513ec9a6aa3466baa0cc1d55dd4f3b\n// Originally from narwhal.js (http://narwhaljs.org)\n// Copyright (c) 2009 Thomas Robinson <280north.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the 'Software'), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n'use strict';\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar _require = require('./internal/errors'),\n _require$codes = _require.codes,\n ERR_AMBIGUOUS_ARGUMENT = _require$codes.ERR_AMBIGUOUS_ARGUMENT,\n ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,\n ERR_INVALID_ARG_VALUE = _require$codes.ERR_INVALID_ARG_VALUE,\n ERR_INVALID_RETURN_VALUE = _require$codes.ERR_INVALID_RETURN_VALUE,\n ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS;\n\nvar AssertionError = require('./internal/assert/assertion_error');\n\nvar _require2 = require('util/'),\n inspect = _require2.inspect;\n\nvar _require$types = require('util/').types,\n isPromise = _require$types.isPromise,\n isRegExp = _require$types.isRegExp;\n\nvar objectAssign = Object.assign ? Object.assign : require('es6-object-assign').assign;\nvar objectIs = Object.is ? Object.is : require('object-is');\nvar errorCache = new Map();\nvar isDeepEqual;\nvar isDeepStrictEqual;\nvar parseExpressionAt;\nvar findNodeAround;\nvar decoder;\n\nfunction lazyLoadComparison() {\n var comparison = require('./internal/util/comparisons');\n\n isDeepEqual = comparison.isDeepEqual;\n isDeepStrictEqual = comparison.isDeepStrictEqual;\n} // Escape control characters but not \\n and \\t to keep the line breaks and\n// indentation intact.\n// eslint-disable-next-line no-control-regex\n\n\nvar escapeSequencesRegExp = /[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f]/g;\nvar meta = [\"\\\\u0000\", \"\\\\u0001\", \"\\\\u0002\", \"\\\\u0003\", \"\\\\u0004\", \"\\\\u0005\", \"\\\\u0006\", \"\\\\u0007\", '\\\\b', '', '', \"\\\\u000b\", '\\\\f', '', \"\\\\u000e\", \"\\\\u000f\", \"\\\\u0010\", \"\\\\u0011\", \"\\\\u0012\", \"\\\\u0013\", \"\\\\u0014\", \"\\\\u0015\", \"\\\\u0016\", \"\\\\u0017\", \"\\\\u0018\", \"\\\\u0019\", \"\\\\u001a\", \"\\\\u001b\", \"\\\\u001c\", \"\\\\u001d\", \"\\\\u001e\", \"\\\\u001f\"];\n\nvar escapeFn = function escapeFn(str) {\n return meta[str.charCodeAt(0)];\n};\n\nvar warned = false; // The assert module provides functions that throw\n// AssertionError's when particular conditions are not met. The\n// assert module must conform to the following interface.\n\nvar assert = module.exports = ok;\nvar NO_EXCEPTION_SENTINEL = {}; // All of the following functions must throw an AssertionError\n// when a corresponding condition is not met, with a message that\n// may be undefined if not provided. All assertion methods provide\n// both the actual and expected values to the assertion error for\n// display purposes.\n\nfunction innerFail(obj) {\n if (obj.message instanceof Error) throw obj.message;\n throw new AssertionError(obj);\n}\n\nfunction fail(actual, expected, message, operator, stackStartFn) {\n var argsLen = arguments.length;\n var internalMessage;\n\n if (argsLen === 0) {\n internalMessage = 'Failed';\n } else if (argsLen === 1) {\n message = actual;\n actual = undefined;\n } else {\n if (warned === false) {\n warned = true;\n var warn = process.emitWarning ? process.emitWarning : console.warn.bind(console);\n warn('assert.fail() with more than one argument is deprecated. ' + 'Please use assert.strictEqual() instead or only pass a message.', 'DeprecationWarning', 'DEP0094');\n }\n\n if (argsLen === 2) operator = '!=';\n }\n\n if (message instanceof Error) throw message;\n var errArgs = {\n actual: actual,\n expected: expected,\n operator: operator === undefined ? 'fail' : operator,\n stackStartFn: stackStartFn || fail\n };\n\n if (message !== undefined) {\n errArgs.message = message;\n }\n\n var err = new AssertionError(errArgs);\n\n if (internalMessage) {\n err.message = internalMessage;\n err.generatedMessage = true;\n }\n\n throw err;\n}\n\nassert.fail = fail; // The AssertionError is defined in internal/error.\n\nassert.AssertionError = AssertionError;\n\nfunction innerOk(fn, argLen, value, message) {\n if (!value) {\n var generatedMessage = false;\n\n if (argLen === 0) {\n generatedMessage = true;\n message = 'No value argument passed to `assert.ok()`';\n } else if (message instanceof Error) {\n throw message;\n }\n\n var err = new AssertionError({\n actual: value,\n expected: true,\n message: message,\n operator: '==',\n stackStartFn: fn\n });\n err.generatedMessage = generatedMessage;\n throw err;\n }\n} // Pure assertion tests whether a value is truthy, as determined\n// by !!value.\n\n\nfunction ok() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n innerOk.apply(void 0, [ok, args.length].concat(args));\n}\n\nassert.ok = ok; // The equality assertion tests shallow, coercive equality with ==.\n\n/* eslint-disable no-restricted-properties */\n\nassert.equal = function equal(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n } // eslint-disable-next-line eqeqeq\n\n\n if (actual != expected) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: '==',\n stackStartFn: equal\n });\n }\n}; // The non-equality assertion tests for whether two objects are not\n// equal with !=.\n\n\nassert.notEqual = function notEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n } // eslint-disable-next-line eqeqeq\n\n\n if (actual == expected) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: '!=',\n stackStartFn: notEqual\n });\n }\n}; // The equivalence assertion tests a deep equality relation.\n\n\nassert.deepEqual = function deepEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n\n if (isDeepEqual === undefined) lazyLoadComparison();\n\n if (!isDeepEqual(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'deepEqual',\n stackStartFn: deepEqual\n });\n }\n}; // The non-equivalence assertion tests for any deep inequality.\n\n\nassert.notDeepEqual = function notDeepEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n\n if (isDeepEqual === undefined) lazyLoadComparison();\n\n if (isDeepEqual(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'notDeepEqual',\n stackStartFn: notDeepEqual\n });\n }\n};\n/* eslint-enable */\n\n\nassert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n\n if (isDeepEqual === undefined) lazyLoadComparison();\n\n if (!isDeepStrictEqual(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'deepStrictEqual',\n stackStartFn: deepStrictEqual\n });\n }\n};\n\nassert.notDeepStrictEqual = notDeepStrictEqual;\n\nfunction notDeepStrictEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n\n if (isDeepEqual === undefined) lazyLoadComparison();\n\n if (isDeepStrictEqual(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'notDeepStrictEqual',\n stackStartFn: notDeepStrictEqual\n });\n }\n}\n\nassert.strictEqual = function strictEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n\n if (!objectIs(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'strictEqual',\n stackStartFn: strictEqual\n });\n }\n};\n\nassert.notStrictEqual = function notStrictEqual(actual, expected, message) {\n if (arguments.length < 2) {\n throw new ERR_MISSING_ARGS('actual', 'expected');\n }\n\n if (objectIs(actual, expected)) {\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: 'notStrictEqual',\n stackStartFn: notStrictEqual\n });\n }\n};\n\nvar Comparison = function Comparison(obj, keys, actual) {\n var _this = this;\n\n _classCallCheck(this, Comparison);\n\n keys.forEach(function (key) {\n if (key in obj) {\n if (actual !== undefined && typeof actual[key] === 'string' && isRegExp(obj[key]) && obj[key].test(actual[key])) {\n _this[key] = actual[key];\n } else {\n _this[key] = obj[key];\n }\n }\n });\n};\n\nfunction compareExceptionKey(actual, expected, key, message, keys, fn) {\n if (!(key in actual) || !isDeepStrictEqual(actual[key], expected[key])) {\n if (!message) {\n // Create placeholder objects to create a nice output.\n var a = new Comparison(actual, keys);\n var b = new Comparison(expected, keys, actual);\n var err = new AssertionError({\n actual: a,\n expected: b,\n operator: 'deepStrictEqual',\n stackStartFn: fn\n });\n err.actual = actual;\n err.expected = expected;\n err.operator = fn.name;\n throw err;\n }\n\n innerFail({\n actual: actual,\n expected: expected,\n message: message,\n operator: fn.name,\n stackStartFn: fn\n });\n }\n}\n\nfunction expectedException(actual, expected, msg, fn) {\n if (typeof expected !== 'function') {\n if (isRegExp(expected)) return expected.test(actual); // assert.doesNotThrow does not accept objects.\n\n if (arguments.length === 2) {\n throw new ERR_INVALID_ARG_TYPE('expected', ['Function', 'RegExp'], expected);\n } // Handle primitives properly.\n\n\n if (_typeof(actual) !== 'object' || actual === null) {\n var err = new AssertionError({\n actual: actual,\n expected: expected,\n message: msg,\n operator: 'deepStrictEqual',\n stackStartFn: fn\n });\n err.operator = fn.name;\n throw err;\n }\n\n var keys = Object.keys(expected); // Special handle errors to make sure the name and the message are compared\n // as well.\n\n if (expected instanceof Error) {\n keys.push('name', 'message');\n } else if (keys.length === 0) {\n throw new ERR_INVALID_ARG_VALUE('error', expected, 'may not be an empty object');\n }\n\n if (isDeepEqual === undefined) lazyLoadComparison();\n keys.forEach(function (key) {\n if (typeof actual[key] === 'string' && isRegExp(expected[key]) && expected[key].test(actual[key])) {\n return;\n }\n\n compareExceptionKey(actual, expected, key, msg, keys, fn);\n });\n return true;\n } // Guard instanceof against arrow functions as they don't have a prototype.\n\n\n if (expected.prototype !== undefined && actual instanceof expected) {\n return true;\n }\n\n if (Error.isPrototypeOf(expected)) {\n return false;\n }\n\n return expected.call({}, actual) === true;\n}\n\nfunction getActual(fn) {\n if (typeof fn !== 'function') {\n throw new ERR_INVALID_ARG_TYPE('fn', 'Function', fn);\n }\n\n try {\n fn();\n } catch (e) {\n return e;\n }\n\n return NO_EXCEPTION_SENTINEL;\n}\n\nfunction checkIsPromise(obj) {\n // Accept native ES6 promises and promises that are implemented in a similar\n // way. Do not accept thenables that use a function as `obj` and that have no\n // `catch` handler.\n // TODO: thenables are checked up until they have the correct methods,\n // but according to documentation, the `then` method should receive\n // the `fulfill` and `reject` arguments as well or it may be never resolved.\n return isPromise(obj) || obj !== null && _typeof(obj) === 'object' && typeof obj.then === 'function' && typeof obj.catch === 'function';\n}\n\nfunction waitForActual(promiseFn) {\n return Promise.resolve().then(function () {\n var resultPromise;\n\n if (typeof promiseFn === 'function') {\n // Return a rejected promise if `promiseFn` throws synchronously.\n resultPromise = promiseFn(); // Fail in case no promise is returned.\n\n if (!checkIsPromise(resultPromise)) {\n throw new ERR_INVALID_RETURN_VALUE('instance of Promise', 'promiseFn', resultPromise);\n }\n } else if (checkIsPromise(promiseFn)) {\n resultPromise = promiseFn;\n } else {\n throw new ERR_INVALID_ARG_TYPE('promiseFn', ['Function', 'Promise'], promiseFn);\n }\n\n return Promise.resolve().then(function () {\n return resultPromise;\n }).then(function () {\n return NO_EXCEPTION_SENTINEL;\n }).catch(function (e) {\n return e;\n });\n });\n}\n\nfunction expectsError(stackStartFn, actual, error, message) {\n if (typeof error === 'string') {\n if (arguments.length === 4) {\n throw new ERR_INVALID_ARG_TYPE('error', ['Object', 'Error', 'Function', 'RegExp'], error);\n }\n\n if (_typeof(actual) === 'object' && actual !== null) {\n if (actual.message === error) {\n throw new ERR_AMBIGUOUS_ARGUMENT('error/message', \"The error message \\\"\".concat(actual.message, \"\\\" is identical to the message.\"));\n }\n } else if (actual === error) {\n throw new ERR_AMBIGUOUS_ARGUMENT('error/message', \"The error \\\"\".concat(actual, \"\\\" is identical to the message.\"));\n }\n\n message = error;\n error = undefined;\n } else if (error != null && _typeof(error) !== 'object' && typeof error !== 'function') {\n throw new ERR_INVALID_ARG_TYPE('error', ['Object', 'Error', 'Function', 'RegExp'], error);\n }\n\n if (actual === NO_EXCEPTION_SENTINEL) {\n var details = '';\n\n if (error && error.name) {\n details += \" (\".concat(error.name, \")\");\n }\n\n details += message ? \": \".concat(message) : '.';\n var fnType = stackStartFn.name === 'rejects' ? 'rejection' : 'exception';\n innerFail({\n actual: undefined,\n expected: error,\n operator: stackStartFn.name,\n message: \"Missing expected \".concat(fnType).concat(details),\n stackStartFn: stackStartFn\n });\n }\n\n if (error && !expectedException(actual, error, message, stackStartFn)) {\n throw actual;\n }\n}\n\nfunction expectsNoError(stackStartFn, actual, error, message) {\n if (actual === NO_EXCEPTION_SENTINEL) return;\n\n if (typeof error === 'string') {\n message = error;\n error = undefined;\n }\n\n if (!error || expectedException(actual, error)) {\n var details = message ? \": \".concat(message) : '.';\n var fnType = stackStartFn.name === 'doesNotReject' ? 'rejection' : 'exception';\n innerFail({\n actual: actual,\n expected: error,\n operator: stackStartFn.name,\n message: \"Got unwanted \".concat(fnType).concat(details, \"\\n\") + \"Actual message: \\\"\".concat(actual && actual.message, \"\\\"\"),\n stackStartFn: stackStartFn\n });\n }\n\n throw actual;\n}\n\nassert.throws = function throws(promiseFn) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n expectsError.apply(void 0, [throws, getActual(promiseFn)].concat(args));\n};\n\nassert.rejects = function rejects(promiseFn) {\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n args[_key3 - 1] = arguments[_key3];\n }\n\n return waitForActual(promiseFn).then(function (result) {\n return expectsError.apply(void 0, [rejects, result].concat(args));\n });\n};\n\nassert.doesNotThrow = function doesNotThrow(fn) {\n for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {\n args[_key4 - 1] = arguments[_key4];\n }\n\n expectsNoError.apply(void 0, [doesNotThrow, getActual(fn)].concat(args));\n};\n\nassert.doesNotReject = function doesNotReject(fn) {\n for (var _len5 = arguments.length, args = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {\n args[_key5 - 1] = arguments[_key5];\n }\n\n return waitForActual(fn).then(function (result) {\n return expectsNoError.apply(void 0, [doesNotReject, result].concat(args));\n });\n};\n\nassert.ifError = function ifError(err) {\n if (err !== null && err !== undefined) {\n var message = 'ifError got unwanted exception: ';\n\n if (_typeof(err) === 'object' && typeof err.message === 'string') {\n if (err.message.length === 0 && err.constructor) {\n message += err.constructor.name;\n } else {\n message += err.message;\n }\n } else {\n message += inspect(err);\n }\n\n var newErr = new AssertionError({\n actual: err,\n expected: null,\n operator: 'ifError',\n message: message,\n stackStartFn: ifError\n }); // Make sure we actually have a stack trace!\n\n var origStack = err.stack;\n\n if (typeof origStack === 'string') {\n // This will remove any duplicated frames from the error frames taken\n // from within `ifError` and add the original error frames to the newly\n // created ones.\n var tmp2 = origStack.split('\\n');\n tmp2.shift(); // Filter all frames existing in err.stack.\n\n var tmp1 = newErr.stack.split('\\n');\n\n for (var i = 0; i < tmp2.length; i++) {\n // Find the first occurrence of the frame.\n var pos = tmp1.indexOf(tmp2[i]);\n\n if (pos !== -1) {\n // Only keep new frames.\n tmp1 = tmp1.slice(0, pos);\n break;\n }\n }\n\n newErr.stack = \"\".concat(tmp1.join('\\n'), \"\\n\").concat(tmp2.join('\\n'));\n }\n\n throw newErr;\n }\n}; // Expose a strict only variant of assert\n\n\nfunction strict() {\n for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {\n args[_key6] = arguments[_key6];\n }\n\n innerOk.apply(void 0, [strict, args.length].concat(args));\n}\n\nassert.strict = objectAssign(strict, assert, {\n equal: assert.strictEqual,\n deepEqual: assert.deepStrictEqual,\n notEqual: assert.notStrictEqual,\n notDeepEqual: assert.notDeepStrictEqual\n});\nassert.strict.strict = assert.strict;","// Currently in sync with Node.js lib/internal/assert/assertion_error.js\n// https://github.com/nodejs/node/commit/0817840f775032169ddd70c85ac059f18ffcc81c\n'use strict';\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar _require = require('util/'),\n inspect = _require.inspect;\n\nvar _require2 = require('../errors'),\n ERR_INVALID_ARG_TYPE = _require2.codes.ERR_INVALID_ARG_TYPE; // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith\n\n\nfunction endsWith(str, search, this_len) {\n if (this_len === undefined || this_len > str.length) {\n this_len = str.length;\n }\n\n return str.substring(this_len - search.length, this_len) === search;\n} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat\n\n\nfunction repeat(str, count) {\n count = Math.floor(count);\n if (str.length == 0 || count == 0) return '';\n var maxCount = str.length * count;\n count = Math.floor(Math.log(count) / Math.log(2));\n\n while (count) {\n str += str;\n count--;\n }\n\n str += str.substring(0, maxCount - str.length);\n return str;\n}\n\nvar blue = '';\nvar green = '';\nvar red = '';\nvar white = '';\nvar kReadableOperator = {\n deepStrictEqual: 'Expected values to be strictly deep-equal:',\n strictEqual: 'Expected values to be strictly equal:',\n strictEqualObject: 'Expected \"actual\" to be reference-equal to \"expected\":',\n deepEqual: 'Expected values to be loosely deep-equal:',\n equal: 'Expected values to be loosely equal:',\n notDeepStrictEqual: 'Expected \"actual\" not to be strictly deep-equal to:',\n notStrictEqual: 'Expected \"actual\" to be strictly unequal to:',\n notStrictEqualObject: 'Expected \"actual\" not to be reference-equal to \"expected\":',\n notDeepEqual: 'Expected \"actual\" not to be loosely deep-equal to:',\n notEqual: 'Expected \"actual\" to be loosely unequal to:',\n notIdentical: 'Values identical but not reference-equal:'\n}; // Comparing short primitives should just show === / !== instead of using the\n// diff.\n\nvar kMaxShortLength = 10;\n\nfunction copyError(source) {\n var keys = Object.keys(source);\n var target = Object.create(Object.getPrototypeOf(source));\n keys.forEach(function (key) {\n target[key] = source[key];\n });\n Object.defineProperty(target, 'message', {\n value: source.message\n });\n return target;\n}\n\nfunction inspectValue(val) {\n // The util.inspect default values could be changed. This makes sure the\n // error messages contain the necessary information nevertheless.\n return inspect(val, {\n compact: false,\n customInspect: false,\n depth: 1000,\n maxArrayLength: Infinity,\n // Assert compares only enumerable properties (with a few exceptions).\n showHidden: false,\n // Having a long line as error is better than wrapping the line for\n // comparison for now.\n // TODO(BridgeAR): `breakLength` should be limited as soon as soon as we\n // have meta information about the inspected properties (i.e., know where\n // in what line the property starts and ends).\n breakLength: Infinity,\n // Assert does not detect proxies currently.\n showProxy: false,\n sorted: true,\n // Inspect getters as we also check them when comparing entries.\n getters: true\n });\n}\n\nfunction createErrDiff(actual, expected, operator) {\n var other = '';\n var res = '';\n var lastPos = 0;\n var end = '';\n var skipped = false;\n var actualInspected = inspectValue(actual);\n var actualLines = actualInspected.split('\\n');\n var expectedLines = inspectValue(expected).split('\\n');\n var i = 0;\n var indicator = ''; // In case both values are objects explicitly mark them as not reference equal\n // for the `strictEqual` operator.\n\n if (operator === 'strictEqual' && _typeof(actual) === 'object' && _typeof(expected) === 'object' && actual !== null && expected !== null) {\n operator = 'strictEqualObject';\n } // If \"actual\" and \"expected\" fit on a single line and they are not strictly\n // equal, check further special handling.\n\n\n if (actualLines.length === 1 && expectedLines.length === 1 && actualLines[0] !== expectedLines[0]) {\n var inputLength = actualLines[0].length + expectedLines[0].length; // If the character length of \"actual\" and \"expected\" together is less than\n // kMaxShortLength and if neither is an object and at least one of them is\n // not `zero`, use the strict equal comparison to visualize the output.\n\n if (inputLength <= kMaxShortLength) {\n if ((_typeof(actual) !== 'object' || actual === null) && (_typeof(expected) !== 'object' || expected === null) && (actual !== 0 || expected !== 0)) {\n // -0 === +0\n return \"\".concat(kReadableOperator[operator], \"\\n\\n\") + \"\".concat(actualLines[0], \" !== \").concat(expectedLines[0], \"\\n\");\n }\n } else if (operator !== 'strictEqualObject') {\n // If the stderr is a tty and the input length is lower than the current\n // columns per line, add a mismatch indicator below the output. If it is\n // not a tty, use a default value of 80 characters.\n var maxLength = process.stderr && process.stderr.isTTY ? process.stderr.columns : 80;\n\n if (inputLength < maxLength) {\n while (actualLines[0][i] === expectedLines[0][i]) {\n i++;\n } // Ignore the first characters.\n\n\n if (i > 2) {\n // Add position indicator for the first mismatch in case it is a\n // single line and the input length is less than the column length.\n indicator = \"\\n \".concat(repeat(' ', i), \"^\");\n i = 0;\n }\n }\n }\n } // Remove all ending lines that match (this optimizes the output for\n // readability by reducing the number of total changed lines).\n\n\n var a = actualLines[actualLines.length - 1];\n var b = expectedLines[expectedLines.length - 1];\n\n while (a === b) {\n if (i++ < 2) {\n end = \"\\n \".concat(a).concat(end);\n } else {\n other = a;\n }\n\n actualLines.pop();\n expectedLines.pop();\n if (actualLines.length === 0 || expectedLines.length === 0) break;\n a = actualLines[actualLines.length - 1];\n b = expectedLines[expectedLines.length - 1];\n }\n\n var maxLines = Math.max(actualLines.length, expectedLines.length); // Strict equal with identical objects that are not identical by reference.\n // E.g., assert.deepStrictEqual({ a: Symbol() }, { a: Symbol() })\n\n if (maxLines === 0) {\n // We have to get the result again. The lines were all removed before.\n var _actualLines = actualInspected.split('\\n'); // Only remove lines in case it makes sense to collapse those.\n // TODO: Accept env to always show the full error.\n\n\n if (_actualLines.length > 30) {\n _actualLines[26] = \"\".concat(blue, \"...\").concat(white);\n\n while (_actualLines.length > 27) {\n _actualLines.pop();\n }\n }\n\n return \"\".concat(kReadableOperator.notIdentical, \"\\n\\n\").concat(_actualLines.join('\\n'), \"\\n\");\n }\n\n if (i > 3) {\n end = \"\\n\".concat(blue, \"...\").concat(white).concat(end);\n skipped = true;\n }\n\n if (other !== '') {\n end = \"\\n \".concat(other).concat(end);\n other = '';\n }\n\n var printedLines = 0;\n var msg = kReadableOperator[operator] + \"\\n\".concat(green, \"+ actual\").concat(white, \" \").concat(red, \"- expected\").concat(white);\n var skippedMsg = \" \".concat(blue, \"...\").concat(white, \" Lines skipped\");\n\n for (i = 0; i < maxLines; i++) {\n // Only extra expected lines exist\n var cur = i - lastPos;\n\n if (actualLines.length < i + 1) {\n // If the last diverging line is more than one line above and the\n // current line is at least line three, add some of the former lines and\n // also add dots to indicate skipped entries.\n if (cur > 1 && i > 2) {\n if (cur > 4) {\n res += \"\\n\".concat(blue, \"...\").concat(white);\n skipped = true;\n } else if (cur > 3) {\n res += \"\\n \".concat(expectedLines[i - 2]);\n printedLines++;\n }\n\n res += \"\\n \".concat(expectedLines[i - 1]);\n printedLines++;\n } // Mark the current line as the last diverging one.\n\n\n lastPos = i; // Add the expected line to the cache.\n\n other += \"\\n\".concat(red, \"-\").concat(white, \" \").concat(expectedLines[i]);\n printedLines++; // Only extra actual lines exist\n } else if (expectedLines.length < i + 1) {\n // If the last diverging line is more than one line above and the\n // current line is at least line three, add some of the former lines and\n // also add dots to indicate skipped entries.\n if (cur > 1 && i > 2) {\n if (cur > 4) {\n res += \"\\n\".concat(blue, \"...\").concat(white);\n skipped = true;\n } else if (cur > 3) {\n res += \"\\n \".concat(actualLines[i - 2]);\n printedLines++;\n }\n\n res += \"\\n \".concat(actualLines[i - 1]);\n printedLines++;\n } // Mark the current line as the last diverging one.\n\n\n lastPos = i; // Add the actual line to the result.\n\n res += \"\\n\".concat(green, \"+\").concat(white, \" \").concat(actualLines[i]);\n printedLines++; // Lines diverge\n } else {\n var expectedLine = expectedLines[i];\n var actualLine = actualLines[i]; // If the lines diverge, specifically check for lines that only diverge by\n // a trailing comma. In that case it is actually identical and we should\n // mark it as such.\n\n var divergingLines = actualLine !== expectedLine && (!endsWith(actualLine, ',') || actualLine.slice(0, -1) !== expectedLine); // If the expected line has a trailing comma but is otherwise identical,\n // add a comma at the end of the actual line. Otherwise the output could\n // look weird as in:\n //\n // [\n // 1 // No comma at the end!\n // + 2\n // ]\n //\n\n if (divergingLines && endsWith(expectedLine, ',') && expectedLine.slice(0, -1) === actualLine) {\n divergingLines = false;\n actualLine += ',';\n }\n\n if (divergingLines) {\n // If the last diverging line is more than one line above and the\n // current line is at least line three, add some of the former lines and\n // also add dots to indicate skipped entries.\n if (cur > 1 && i > 2) {\n if (cur > 4) {\n res += \"\\n\".concat(blue, \"...\").concat(white);\n skipped = true;\n } else if (cur > 3) {\n res += \"\\n \".concat(actualLines[i - 2]);\n printedLines++;\n }\n\n res += \"\\n \".concat(actualLines[i - 1]);\n printedLines++;\n } // Mark the current line as the last diverging one.\n\n\n lastPos = i; // Add the actual line to the result and cache the expected diverging\n // line so consecutive diverging lines show up as +++--- and not +-+-+-.\n\n res += \"\\n\".concat(green, \"+\").concat(white, \" \").concat(actualLine);\n other += \"\\n\".concat(red, \"-\").concat(white, \" \").concat(expectedLine);\n printedLines += 2; // Lines are identical\n } else {\n // Add all cached information to the result before adding other things\n // and reset the cache.\n res += other;\n other = ''; // If the last diverging line is exactly one line above or if it is the\n // very first line, add the line to the result.\n\n if (cur === 1 || i === 0) {\n res += \"\\n \".concat(actualLine);\n printedLines++;\n }\n }\n } // Inspected object to big (Show ~20 rows max)\n\n\n if (printedLines > 20 && i < maxLines - 2) {\n return \"\".concat(msg).concat(skippedMsg, \"\\n\").concat(res, \"\\n\").concat(blue, \"...\").concat(white).concat(other, \"\\n\") + \"\".concat(blue, \"...\").concat(white);\n }\n }\n\n return \"\".concat(msg).concat(skipped ? skippedMsg : '', \"\\n\").concat(res).concat(other).concat(end).concat(indicator);\n}\n\nvar AssertionError =\n/*#__PURE__*/\nfunction (_Error) {\n _inherits(AssertionError, _Error);\n\n function AssertionError(options) {\n var _this;\n\n _classCallCheck(this, AssertionError);\n\n if (_typeof(options) !== 'object' || options === null) {\n throw new ERR_INVALID_ARG_TYPE('options', 'Object', options);\n }\n\n var message = options.message,\n operator = options.operator,\n stackStartFn = options.stackStartFn;\n var actual = options.actual,\n expected = options.expected;\n var limit = Error.stackTraceLimit;\n Error.stackTraceLimit = 0;\n\n if (message != null) {\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError).call(this, String(message)));\n } else {\n if (process.stderr && process.stderr.isTTY) {\n // Reset on each call to make sure we handle dynamically set environment\n // variables correct.\n if (process.stderr && process.stderr.getColorDepth && process.stderr.getColorDepth() !== 1) {\n blue = \"\\x1B[34m\";\n green = \"\\x1B[32m\";\n white = \"\\x1B[39m\";\n red = \"\\x1B[31m\";\n } else {\n blue = '';\n green = '';\n white = '';\n red = '';\n }\n } // Prevent the error stack from being visible by duplicating the error\n // in a very close way to the original in case both sides are actually\n // instances of Error.\n\n\n if (_typeof(actual) === 'object' && actual !== null && _typeof(expected) === 'object' && expected !== null && 'stack' in actual && actual instanceof Error && 'stack' in expected && expected instanceof Error) {\n actual = copyError(actual);\n expected = copyError(expected);\n }\n\n if (operator === 'deepStrictEqual' || operator === 'strictEqual') {\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError).call(this, createErrDiff(actual, expected, operator)));\n } else if (operator === 'notDeepStrictEqual' || operator === 'notStrictEqual') {\n // In case the objects are equal but the operator requires unequal, show\n // the first object and say A equals B\n var base = kReadableOperator[operator];\n var res = inspectValue(actual).split('\\n'); // In case \"actual\" is an object, it should not be reference equal.\n\n if (operator === 'notStrictEqual' && _typeof(actual) === 'object' && actual !== null) {\n base = kReadableOperator.notStrictEqualObject;\n } // Only remove lines in case it makes sense to collapse those.\n // TODO: Accept env to always show the full error.\n\n\n if (res.length > 30) {\n res[26] = \"\".concat(blue, \"...\").concat(white);\n\n while (res.length > 27) {\n res.pop();\n }\n } // Only print a single input.\n\n\n if (res.length === 1) {\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError).call(this, \"\".concat(base, \" \").concat(res[0])));\n } else {\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError).call(this, \"\".concat(base, \"\\n\\n\").concat(res.join('\\n'), \"\\n\")));\n }\n } else {\n var _res = inspectValue(actual);\n\n var other = '';\n var knownOperators = kReadableOperator[operator];\n\n if (operator === 'notDeepEqual' || operator === 'notEqual') {\n _res = \"\".concat(kReadableOperator[operator], \"\\n\\n\").concat(_res);\n\n if (_res.length > 1024) {\n _res = \"\".concat(_res.slice(0, 1021), \"...\");\n }\n } else {\n other = \"\".concat(inspectValue(expected));\n\n if (_res.length > 512) {\n _res = \"\".concat(_res.slice(0, 509), \"...\");\n }\n\n if (other.length > 512) {\n other = \"\".concat(other.slice(0, 509), \"...\");\n }\n\n if (operator === 'deepEqual' || operator === 'equal') {\n _res = \"\".concat(knownOperators, \"\\n\\n\").concat(_res, \"\\n\\nshould equal\\n\\n\");\n } else {\n other = \" \".concat(operator, \" \").concat(other);\n }\n }\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError).call(this, \"\".concat(_res).concat(other)));\n }\n }\n\n Error.stackTraceLimit = limit;\n _this.generatedMessage = !message;\n Object.defineProperty(_assertThisInitialized(_this), 'name', {\n value: 'AssertionError [ERR_ASSERTION]',\n enumerable: false,\n writable: true,\n configurable: true\n });\n _this.code = 'ERR_ASSERTION';\n _this.actual = actual;\n _this.expected = expected;\n _this.operator = operator;\n\n if (Error.captureStackTrace) {\n // eslint-disable-next-line no-restricted-syntax\n Error.captureStackTrace(_assertThisInitialized(_this), stackStartFn);\n } // Create error message including the error code in the name.\n\n\n _this.stack; // Reset the name.\n\n _this.name = 'AssertionError';\n return _possibleConstructorReturn(_this);\n }\n\n _createClass(AssertionError, [{\n key: \"toString\",\n value: function toString() {\n return \"\".concat(this.name, \" [\").concat(this.code, \"]: \").concat(this.message);\n }\n }, {\n key: inspect.custom,\n value: function value(recurseTimes, ctx) {\n // This limits the `actual` and `expected` property default inspection to\n // the minimum depth. Otherwise those values would be too verbose compared\n // to the actual error message which contains a combined view of these two\n // input values.\n return inspect(this, _objectSpread({}, ctx, {\n customInspect: false,\n depth: 0\n }));\n }\n }]);\n\n return AssertionError;\n}(_wrapNativeSuper(Error));\n\nmodule.exports = AssertionError;","// Currently in sync with Node.js lib/internal/errors.js\n// https://github.com/nodejs/node/commit/3b044962c48fe313905877a96b5d0894a5404f6f\n\n/* eslint node-core/documented-errors: \"error\" */\n\n/* eslint node-core/alphabetize-errors: \"error\" */\n\n/* eslint node-core/prefer-util-format-errors: \"error\" */\n'use strict'; // The whole point behind this internal module is to allow Node.js to no\n// longer be forced to treat every error message change as a semver-major\n// change. The NodeError classes here all expose a `code` property whose\n// value statically and permanently identifies the error. While the error\n// message may change, the code should not.\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nvar codes = {}; // Lazy loaded\n\nvar assert;\nvar util;\n\nfunction createErrorType(code, message, Base) {\n if (!Base) {\n Base = Error;\n }\n\n function getMessage(arg1, arg2, arg3) {\n if (typeof message === 'string') {\n return message;\n } else {\n return message(arg1, arg2, arg3);\n }\n }\n\n var NodeError =\n /*#__PURE__*/\n function (_Base) {\n _inherits(NodeError, _Base);\n\n function NodeError(arg1, arg2, arg3) {\n var _this;\n\n _classCallCheck(this, NodeError);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(NodeError).call(this, getMessage(arg1, arg2, arg3)));\n _this.code = code;\n return _this;\n }\n\n return NodeError;\n }(Base);\n\n codes[code] = NodeError;\n} // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js\n\n\nfunction oneOf(expected, thing) {\n if (Array.isArray(expected)) {\n var len = expected.length;\n expected = expected.map(function (i) {\n return String(i);\n });\n\n if (len > 2) {\n return \"one of \".concat(thing, \" \").concat(expected.slice(0, len - 1).join(', '), \", or \") + expected[len - 1];\n } else if (len === 2) {\n return \"one of \".concat(thing, \" \").concat(expected[0], \" or \").concat(expected[1]);\n } else {\n return \"of \".concat(thing, \" \").concat(expected[0]);\n }\n } else {\n return \"of \".concat(thing, \" \").concat(String(expected));\n }\n} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith\n\n\nfunction startsWith(str, search, pos) {\n return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;\n} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith\n\n\nfunction endsWith(str, search, this_len) {\n if (this_len === undefined || this_len > str.length) {\n this_len = str.length;\n }\n\n return str.substring(this_len - search.length, this_len) === search;\n} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes\n\n\nfunction includes(str, search, start) {\n if (typeof start !== 'number') {\n start = 0;\n }\n\n if (start + search.length > str.length) {\n return false;\n } else {\n return str.indexOf(search, start) !== -1;\n }\n}\n\ncreateErrorType('ERR_AMBIGUOUS_ARGUMENT', 'The \"%s\" argument is ambiguous. %s', TypeError);\ncreateErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) {\n if (assert === undefined) assert = require('../assert');\n assert(typeof name === 'string', \"'name' must be a string\"); // determiner: 'must be' or 'must not be'\n\n var determiner;\n\n if (typeof expected === 'string' && startsWith(expected, 'not ')) {\n determiner = 'must not be';\n expected = expected.replace(/^not /, '');\n } else {\n determiner = 'must be';\n }\n\n var msg;\n\n if (endsWith(name, ' argument')) {\n // For cases like 'first argument'\n msg = \"The \".concat(name, \" \").concat(determiner, \" \").concat(oneOf(expected, 'type'));\n } else {\n var type = includes(name, '.') ? 'property' : 'argument';\n msg = \"The \\\"\".concat(name, \"\\\" \").concat(type, \" \").concat(determiner, \" \").concat(oneOf(expected, 'type'));\n } // TODO(BridgeAR): Improve the output by showing `null` and similar.\n\n\n msg += \". Received type \".concat(_typeof(actual));\n return msg;\n}, TypeError);\ncreateErrorType('ERR_INVALID_ARG_VALUE', function (name, value) {\n var reason = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'is invalid';\n if (util === undefined) util = require('util/');\n var inspected = util.inspect(value);\n\n if (inspected.length > 128) {\n inspected = \"\".concat(inspected.slice(0, 128), \"...\");\n }\n\n return \"The argument '\".concat(name, \"' \").concat(reason, \". Received \").concat(inspected);\n}, TypeError, RangeError);\ncreateErrorType('ERR_INVALID_RETURN_VALUE', function (input, name, value) {\n var type;\n\n if (value && value.constructor && value.constructor.name) {\n type = \"instance of \".concat(value.constructor.name);\n } else {\n type = \"type \".concat(_typeof(value));\n }\n\n return \"Expected \".concat(input, \" to be returned from the \\\"\").concat(name, \"\\\"\") + \" function but got \".concat(type, \".\");\n}, TypeError);\ncreateErrorType('ERR_MISSING_ARGS', function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (assert === undefined) assert = require('../assert');\n assert(args.length > 0, 'At least one arg needs to be specified');\n var msg = 'The ';\n var len = args.length;\n args = args.map(function (a) {\n return \"\\\"\".concat(a, \"\\\"\");\n });\n\n switch (len) {\n case 1:\n msg += \"\".concat(args[0], \" argument\");\n break;\n\n case 2:\n msg += \"\".concat(args[0], \" and \").concat(args[1], \" arguments\");\n break;\n\n default:\n msg += args.slice(0, len - 1).join(', ');\n msg += \", and \".concat(args[len - 1], \" arguments\");\n break;\n }\n\n return \"\".concat(msg, \" must be specified\");\n}, TypeError);\nmodule.exports.codes = codes;","// Currently in sync with Node.js lib/internal/util/comparisons.js\n// https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9\n'use strict';\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar regexFlagsSupported = /a/g.flags !== undefined;\n\nvar arrayFromSet = function arrayFromSet(set) {\n var array = [];\n set.forEach(function (value) {\n return array.push(value);\n });\n return array;\n};\n\nvar arrayFromMap = function arrayFromMap(map) {\n var array = [];\n map.forEach(function (value, key) {\n return array.push([key, value]);\n });\n return array;\n};\n\nvar objectIs = Object.is ? Object.is : require('object-is');\nvar objectGetOwnPropertySymbols = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols : function () {\n return [];\n};\nvar numberIsNaN = Number.isNaN ? Number.isNaN : require('is-nan');\n\nfunction uncurryThis(f) {\n return f.call.bind(f);\n}\n\nvar hasOwnProperty = uncurryThis(Object.prototype.hasOwnProperty);\nvar propertyIsEnumerable = uncurryThis(Object.prototype.propertyIsEnumerable);\nvar objectToString = uncurryThis(Object.prototype.toString);\n\nvar _require$types = require('util/').types,\n isAnyArrayBuffer = _require$types.isAnyArrayBuffer,\n isArrayBufferView = _require$types.isArrayBufferView,\n isDate = _require$types.isDate,\n isMap = _require$types.isMap,\n isRegExp = _require$types.isRegExp,\n isSet = _require$types.isSet,\n isNativeError = _require$types.isNativeError,\n isBoxedPrimitive = _require$types.isBoxedPrimitive,\n isNumberObject = _require$types.isNumberObject,\n isStringObject = _require$types.isStringObject,\n isBooleanObject = _require$types.isBooleanObject,\n isBigIntObject = _require$types.isBigIntObject,\n isSymbolObject = _require$types.isSymbolObject,\n isFloat32Array = _require$types.isFloat32Array,\n isFloat64Array = _require$types.isFloat64Array;\n\nfunction isNonIndex(key) {\n if (key.length === 0 || key.length > 10) return true;\n\n for (var i = 0; i < key.length; i++) {\n var code = key.charCodeAt(i);\n if (code < 48 || code > 57) return true;\n } // The maximum size for an array is 2 ** 32 -1.\n\n\n return key.length === 10 && key >= Math.pow(2, 32);\n}\n\nfunction getOwnNonIndexProperties(value) {\n return Object.keys(value).filter(isNonIndex).concat(objectGetOwnPropertySymbols(value).filter(Object.prototype.propertyIsEnumerable.bind(value)));\n} // Taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js\n// original notice:\n\n/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>\n * @license MIT\n */\n\n\nfunction compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n\n if (y < x) {\n return 1;\n }\n\n return 0;\n}\n\nvar ONLY_ENUMERABLE = undefined;\nvar kStrict = true;\nvar kLoose = false;\nvar kNoIterator = 0;\nvar kIsArray = 1;\nvar kIsSet = 2;\nvar kIsMap = 3; // Check if they have the same source and flags\n\nfunction areSimilarRegExps(a, b) {\n return regexFlagsSupported ? a.source === b.source && a.flags === b.flags : RegExp.prototype.toString.call(a) === RegExp.prototype.toString.call(b);\n}\n\nfunction areSimilarFloatArrays(a, b) {\n if (a.byteLength !== b.byteLength) {\n return false;\n }\n\n for (var offset = 0; offset < a.byteLength; offset++) {\n if (a[offset] !== b[offset]) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction areSimilarTypedArrays(a, b) {\n if (a.byteLength !== b.byteLength) {\n return false;\n }\n\n return compare(new Uint8Array(a.buffer, a.byteOffset, a.byteLength), new Uint8Array(b.buffer, b.byteOffset, b.byteLength)) === 0;\n}\n\nfunction areEqualArrayBuffers(buf1, buf2) {\n return buf1.byteLength === buf2.byteLength && compare(new Uint8Array(buf1), new Uint8Array(buf2)) === 0;\n}\n\nfunction isEqualBoxedPrimitive(val1, val2) {\n if (isNumberObject(val1)) {\n return isNumberObject(val2) && objectIs(Number.prototype.valueOf.call(val1), Number.prototype.valueOf.call(val2));\n }\n\n if (isStringObject(val1)) {\n return isStringObject(val2) && String.prototype.valueOf.call(val1) === String.prototype.valueOf.call(val2);\n }\n\n if (isBooleanObject(val1)) {\n return isBooleanObject(val2) && Boolean.prototype.valueOf.call(val1) === Boolean.prototype.valueOf.call(val2);\n }\n\n if (isBigIntObject(val1)) {\n return isBigIntObject(val2) && BigInt.prototype.valueOf.call(val1) === BigInt.prototype.valueOf.call(val2);\n }\n\n return isSymbolObject(val2) && Symbol.prototype.valueOf.call(val1) === Symbol.prototype.valueOf.call(val2);\n} // Notes: Type tags are historical [[Class]] properties that can be set by\n// FunctionTemplate::SetClassName() in C++ or Symbol.toStringTag in JS\n// and retrieved using Object.prototype.toString.call(obj) in JS\n// See https://tc39.github.io/ecma262/#sec-object.prototype.tostring\n// for a list of tags pre-defined in the spec.\n// There are some unspecified tags in the wild too (e.g. typed array tags).\n// Since tags can be altered, they only serve fast failures\n//\n// Typed arrays and buffers are checked by comparing the content in their\n// underlying ArrayBuffer. This optimization requires that it's\n// reasonable to interpret their underlying memory in the same way,\n// which is checked by comparing their type tags.\n// (e.g. a Uint8Array and a Uint16Array with the same memory content\n// could still be different because they will be interpreted differently).\n//\n// For strict comparison, objects should have\n// a) The same built-in type tags\n// b) The same prototypes.\n\n\nfunction innerDeepEqual(val1, val2, strict, memos) {\n // All identical values are equivalent, as determined by ===.\n if (val1 === val2) {\n if (val1 !== 0) return true;\n return strict ? objectIs(val1, val2) : true;\n } // Check more closely if val1 and val2 are equal.\n\n\n if (strict) {\n if (_typeof(val1) !== 'object') {\n return typeof val1 === 'number' && numberIsNaN(val1) && numberIsNaN(val2);\n }\n\n if (_typeof(val2) !== 'object' || val1 === null || val2 === null) {\n return false;\n }\n\n if (Object.getPrototypeOf(val1) !== Object.getPrototypeOf(val2)) {\n return false;\n }\n } else {\n if (val1 === null || _typeof(val1) !== 'object') {\n if (val2 === null || _typeof(val2) !== 'object') {\n // eslint-disable-next-line eqeqeq\n return val1 == val2;\n }\n\n return false;\n }\n\n if (val2 === null || _typeof(val2) !== 'object') {\n return false;\n }\n }\n\n var val1Tag = objectToString(val1);\n var val2Tag = objectToString(val2);\n\n if (val1Tag !== val2Tag) {\n return false;\n }\n\n if (Array.isArray(val1)) {\n // Check for sparse arrays and general fast path\n if (val1.length !== val2.length) {\n return false;\n }\n\n var keys1 = getOwnNonIndexProperties(val1, ONLY_ENUMERABLE);\n var keys2 = getOwnNonIndexProperties(val2, ONLY_ENUMERABLE);\n\n if (keys1.length !== keys2.length) {\n return false;\n }\n\n return keyCheck(val1, val2, strict, memos, kIsArray, keys1);\n } // [browserify] This triggers on certain types in IE (Map/Set) so we don't\n // wan't to early return out of the rest of the checks. However we can check\n // if the second value is one of these values and the first isn't.\n\n\n if (val1Tag === '[object Object]') {\n // return keyCheck(val1, val2, strict, memos, kNoIterator);\n if (!isMap(val1) && isMap(val2) || !isSet(val1) && isSet(val2)) {\n return false;\n }\n }\n\n if (isDate(val1)) {\n if (!isDate(val2) || Date.prototype.getTime.call(val1) !== Date.prototype.getTime.call(val2)) {\n return false;\n }\n } else if (isRegExp(val1)) {\n if (!isRegExp(val2) || !areSimilarRegExps(val1, val2)) {\n return false;\n }\n } else if (isNativeError(val1) || val1 instanceof Error) {\n // Do not compare the stack as it might differ even though the error itself\n // is otherwise identical.\n if (val1.message !== val2.message || val1.name !== val2.name) {\n return false;\n }\n } else if (isArrayBufferView(val1)) {\n if (!strict && (isFloat32Array(val1) || isFloat64Array(val1))) {\n if (!areSimilarFloatArrays(val1, val2)) {\n return false;\n }\n } else if (!areSimilarTypedArrays(val1, val2)) {\n return false;\n } // Buffer.compare returns true, so val1.length === val2.length. If they both\n // only contain numeric keys, we don't need to exam further than checking\n // the symbols.\n\n\n var _keys = getOwnNonIndexProperties(val1, ONLY_ENUMERABLE);\n\n var _keys2 = getOwnNonIndexProperties(val2, ONLY_ENUMERABLE);\n\n if (_keys.length !== _keys2.length) {\n return false;\n }\n\n return keyCheck(val1, val2, strict, memos, kNoIterator, _keys);\n } else if (isSet(val1)) {\n if (!isSet(val2) || val1.size !== val2.size) {\n return false;\n }\n\n return keyCheck(val1, val2, strict, memos, kIsSet);\n } else if (isMap(val1)) {\n if (!isMap(val2) || val1.size !== val2.size) {\n return false;\n }\n\n return keyCheck(val1, val2, strict, memos, kIsMap);\n } else if (isAnyArrayBuffer(val1)) {\n if (!areEqualArrayBuffers(val1, val2)) {\n return false;\n }\n } else if (isBoxedPrimitive(val1) && !isEqualBoxedPrimitive(val1, val2)) {\n return false;\n }\n\n return keyCheck(val1, val2, strict, memos, kNoIterator);\n}\n\nfunction getEnumerables(val, keys) {\n return keys.filter(function (k) {\n return propertyIsEnumerable(val, k);\n });\n}\n\nfunction keyCheck(val1, val2, strict, memos, iterationType, aKeys) {\n // For all remaining Object pairs, including Array, objects and Maps,\n // equivalence is determined by having:\n // a) The same number of owned enumerable properties\n // b) The same set of keys/indexes (although not necessarily the same order)\n // c) Equivalent values for every corresponding key/index\n // d) For Sets and Maps, equal contents\n // Note: this accounts for both named and indexed properties on Arrays.\n if (arguments.length === 5) {\n aKeys = Object.keys(val1);\n var bKeys = Object.keys(val2); // The pair must have the same number of owned properties.\n\n if (aKeys.length !== bKeys.length) {\n return false;\n }\n } // Cheap key test\n\n\n var i = 0;\n\n for (; i < aKeys.length; i++) {\n if (!hasOwnProperty(val2, aKeys[i])) {\n return false;\n }\n }\n\n if (strict && arguments.length === 5) {\n var symbolKeysA = objectGetOwnPropertySymbols(val1);\n\n if (symbolKeysA.length !== 0) {\n var count = 0;\n\n for (i = 0; i < symbolKeysA.length; i++) {\n var key = symbolKeysA[i];\n\n if (propertyIsEnumerable(val1, key)) {\n if (!propertyIsEnumerable(val2, key)) {\n return false;\n }\n\n aKeys.push(key);\n count++;\n } else if (propertyIsEnumerable(val2, key)) {\n return false;\n }\n }\n\n var symbolKeysB = objectGetOwnPropertySymbols(val2);\n\n if (symbolKeysA.length !== symbolKeysB.length && getEnumerables(val2, symbolKeysB).length !== count) {\n return false;\n }\n } else {\n var _symbolKeysB = objectGetOwnPropertySymbols(val2);\n\n if (_symbolKeysB.length !== 0 && getEnumerables(val2, _symbolKeysB).length !== 0) {\n return false;\n }\n }\n }\n\n if (aKeys.length === 0 && (iterationType === kNoIterator || iterationType === kIsArray && val1.length === 0 || val1.size === 0)) {\n return true;\n } // Use memos to handle cycles.\n\n\n if (memos === undefined) {\n memos = {\n val1: new Map(),\n val2: new Map(),\n position: 0\n };\n } else {\n // We prevent up to two map.has(x) calls by directly retrieving the value\n // and checking for undefined. The map can only contain numbers, so it is\n // safe to check for undefined only.\n var val2MemoA = memos.val1.get(val1);\n\n if (val2MemoA !== undefined) {\n var val2MemoB = memos.val2.get(val2);\n\n if (val2MemoB !== undefined) {\n return val2MemoA === val2MemoB;\n }\n }\n\n memos.position++;\n }\n\n memos.val1.set(val1, memos.position);\n memos.val2.set(val2, memos.position);\n var areEq = objEquiv(val1, val2, strict, aKeys, memos, iterationType);\n memos.val1.delete(val1);\n memos.val2.delete(val2);\n return areEq;\n}\n\nfunction setHasEqualElement(set, val1, strict, memo) {\n // Go looking.\n var setValues = arrayFromSet(set);\n\n for (var i = 0; i < setValues.length; i++) {\n var val2 = setValues[i];\n\n if (innerDeepEqual(val1, val2, strict, memo)) {\n // Remove the matching element to make sure we do not check that again.\n set.delete(val2);\n return true;\n }\n }\n\n return false;\n} // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness#Loose_equality_using\n// Sadly it is not possible to detect corresponding values properly in case the\n// type is a string, number, bigint or boolean. The reason is that those values\n// can match lots of different string values (e.g., 1n == '+00001').\n\n\nfunction findLooseMatchingPrimitives(prim) {\n switch (_typeof(prim)) {\n case 'undefined':\n return null;\n\n case 'object':\n // Only pass in null as object!\n return undefined;\n\n case 'symbol':\n return false;\n\n case 'string':\n prim = +prim;\n // Loose equal entries exist only if the string is possible to convert to\n // a regular number and not NaN.\n // Fall through\n\n case 'number':\n if (numberIsNaN(prim)) {\n return false;\n }\n\n }\n\n return true;\n}\n\nfunction setMightHaveLoosePrim(a, b, prim) {\n var altValue = findLooseMatchingPrimitives(prim);\n if (altValue != null) return altValue;\n return b.has(altValue) && !a.has(altValue);\n}\n\nfunction mapMightHaveLoosePrim(a, b, prim, item, memo) {\n var altValue = findLooseMatchingPrimitives(prim);\n\n if (altValue != null) {\n return altValue;\n }\n\n var curB = b.get(altValue);\n\n if (curB === undefined && !b.has(altValue) || !innerDeepEqual(item, curB, false, memo)) {\n return false;\n }\n\n return !a.has(altValue) && innerDeepEqual(item, curB, false, memo);\n}\n\nfunction setEquiv(a, b, strict, memo) {\n // This is a lazily initiated Set of entries which have to be compared\n // pairwise.\n var set = null;\n var aValues = arrayFromSet(a);\n\n for (var i = 0; i < aValues.length; i++) {\n var val = aValues[i]; // Note: Checking for the objects first improves the performance for object\n // heavy sets but it is a minor slow down for primitives. As they are fast\n // to check this improves the worst case scenario instead.\n\n if (_typeof(val) === 'object' && val !== null) {\n if (set === null) {\n set = new Set();\n } // If the specified value doesn't exist in the second set its an not null\n // object (or non strict only: a not matching primitive) we'll need to go\n // hunting for something thats deep-(strict-)equal to it. To make this\n // O(n log n) complexity we have to copy these values in a new set first.\n\n\n set.add(val);\n } else if (!b.has(val)) {\n if (strict) return false; // Fast path to detect missing string, symbol, undefined and null values.\n\n if (!setMightHaveLoosePrim(a, b, val)) {\n return false;\n }\n\n if (set === null) {\n set = new Set();\n }\n\n set.add(val);\n }\n }\n\n if (set !== null) {\n var bValues = arrayFromSet(b);\n\n for (var _i = 0; _i < bValues.length; _i++) {\n var _val = bValues[_i]; // We have to check if a primitive value is already\n // matching and only if it's not, go hunting for it.\n\n if (_typeof(_val) === 'object' && _val !== null) {\n if (!setHasEqualElement(set, _val, strict, memo)) return false;\n } else if (!strict && !a.has(_val) && !setHasEqualElement(set, _val, strict, memo)) {\n return false;\n }\n }\n\n return set.size === 0;\n }\n\n return true;\n}\n\nfunction mapHasEqualEntry(set, map, key1, item1, strict, memo) {\n // To be able to handle cases like:\n // Map([[{}, 'a'], [{}, 'b']]) vs Map([[{}, 'b'], [{}, 'a']])\n // ... we need to consider *all* matching keys, not just the first we find.\n var setValues = arrayFromSet(set);\n\n for (var i = 0; i < setValues.length; i++) {\n var key2 = setValues[i];\n\n if (innerDeepEqual(key1, key2, strict, memo) && innerDeepEqual(item1, map.get(key2), strict, memo)) {\n set.delete(key2);\n return true;\n }\n }\n\n return false;\n}\n\nfunction mapEquiv(a, b, strict, memo) {\n var set = null;\n var aEntries = arrayFromMap(a);\n\n for (var i = 0; i < aEntries.length; i++) {\n var _aEntries$i = _slicedToArray(aEntries[i], 2),\n key = _aEntries$i[0],\n item1 = _aEntries$i[1];\n\n if (_typeof(key) === 'object' && key !== null) {\n if (set === null) {\n set = new Set();\n }\n\n set.add(key);\n } else {\n // By directly retrieving the value we prevent another b.has(key) check in\n // almost all possible cases.\n var item2 = b.get(key);\n\n if (item2 === undefined && !b.has(key) || !innerDeepEqual(item1, item2, strict, memo)) {\n if (strict) return false; // Fast path to detect missing string, symbol, undefined and null\n // keys.\n\n if (!mapMightHaveLoosePrim(a, b, key, item1, memo)) return false;\n\n if (set === null) {\n set = new Set();\n }\n\n set.add(key);\n }\n }\n }\n\n if (set !== null) {\n var bEntries = arrayFromMap(b);\n\n for (var _i2 = 0; _i2 < bEntries.length; _i2++) {\n var _bEntries$_i = _slicedToArray(bEntries[_i2], 2),\n key = _bEntries$_i[0],\n item = _bEntries$_i[1];\n\n if (_typeof(key) === 'object' && key !== null) {\n if (!mapHasEqualEntry(set, a, key, item, strict, memo)) return false;\n } else if (!strict && (!a.has(key) || !innerDeepEqual(a.get(key), item, false, memo)) && !mapHasEqualEntry(set, a, key, item, false, memo)) {\n return false;\n }\n }\n\n return set.size === 0;\n }\n\n return true;\n}\n\nfunction objEquiv(a, b, strict, keys, memos, iterationType) {\n // Sets and maps don't have their entries accessible via normal object\n // properties.\n var i = 0;\n\n if (iterationType === kIsSet) {\n if (!setEquiv(a, b, strict, memos)) {\n return false;\n }\n } else if (iterationType === kIsMap) {\n if (!mapEquiv(a, b, strict, memos)) {\n return false;\n }\n } else if (iterationType === kIsArray) {\n for (; i < a.length; i++) {\n if (hasOwnProperty(a, i)) {\n if (!hasOwnProperty(b, i) || !innerDeepEqual(a[i], b[i], strict, memos)) {\n return false;\n }\n } else if (hasOwnProperty(b, i)) {\n return false;\n } else {\n // Array is sparse.\n var keysA = Object.keys(a);\n\n for (; i < keysA.length; i++) {\n var key = keysA[i];\n\n if (!hasOwnProperty(b, key) || !innerDeepEqual(a[key], b[key], strict, memos)) {\n return false;\n }\n }\n\n if (keysA.length !== Object.keys(b).length) {\n return false;\n }\n\n return true;\n }\n }\n } // The pair must have equivalent values for every corresponding key.\n // Possibly expensive deep test:\n\n\n for (i = 0; i < keys.length; i++) {\n var _key = keys[i];\n\n if (!innerDeepEqual(a[_key], b[_key], strict, memos)) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction isDeepEqual(val1, val2) {\n return innerDeepEqual(val1, val2, kLoose);\n}\n\nfunction isDeepStrictEqual(val1, val2) {\n return innerDeepEqual(val1, val2, kStrict);\n}\n\nmodule.exports = {\n isDeepEqual: isDeepEqual,\n isDeepStrictEqual: isDeepStrictEqual\n};","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar callBind = require('./');\n\nvar $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));\n\nmodule.exports = function callBoundIntrinsic(name, allowMissing) {\n\tvar intrinsic = GetIntrinsic(name, !!allowMissing);\n\tif (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {\n\t\treturn callBind(intrinsic);\n\t}\n\treturn intrinsic;\n};\n","'use strict';\n\nvar bind = require('function-bind');\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $apply = GetIntrinsic('%Function.prototype.apply%');\nvar $call = GetIntrinsic('%Function.prototype.call%');\nvar $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\nvar $max = GetIntrinsic('%Math.max%');\n\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = null;\n\t}\n}\n\nmodule.exports = function callBind(originalFunction) {\n\tvar func = $reflectApply(bind, $call, arguments);\n\tif ($gOPD && $defineProperty) {\n\t\tvar desc = $gOPD(func, 'length');\n\t\tif (desc.configurable) {\n\t\t\t// original length, plus the receiver, minus any additional arguments (after the receiver)\n\t\t\t$defineProperty(\n\t\t\t\tfunc,\n\t\t\t\t'length',\n\t\t\t\t{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }\n\t\t\t);\n\t\t}\n\t}\n\treturn func;\n};\n\nvar applyBind = function applyBind() {\n\treturn $reflectApply(bind, $apply, arguments);\n};\n\nif ($defineProperty) {\n\t$defineProperty(module.exports, 'apply', { value: applyBind });\n} else {\n\tmodule.exports.apply = applyBind;\n}\n","/*global window, global*/\nvar util = require(\"util\")\nvar assert = require(\"assert\")\nfunction now() { return new Date().getTime() }\n\nvar slice = Array.prototype.slice\nvar console\nvar times = {}\n\nif (typeof global !== \"undefined\" && global.console) {\n console = global.console\n} else if (typeof window !== \"undefined\" && window.console) {\n console = window.console\n} else {\n console = {}\n}\n\nvar functions = [\n [log, \"log\"],\n [info, \"info\"],\n [warn, \"warn\"],\n [error, \"error\"],\n [time, \"time\"],\n [timeEnd, \"timeEnd\"],\n [trace, \"trace\"],\n [dir, \"dir\"],\n [consoleAssert, \"assert\"]\n]\n\nfor (var i = 0; i < functions.length; i++) {\n var tuple = functions[i]\n var f = tuple[0]\n var name = tuple[1]\n\n if (!console[name]) {\n console[name] = f\n }\n}\n\nmodule.exports = console\n\nfunction log() {}\n\nfunction info() {\n console.log.apply(console, arguments)\n}\n\nfunction warn() {\n console.log.apply(console, arguments)\n}\n\nfunction error() {\n console.warn.apply(console, arguments)\n}\n\nfunction time(label) {\n times[label] = now()\n}\n\nfunction timeEnd(label) {\n var time = times[label]\n if (!time) {\n throw new Error(\"No such label: \" + label)\n }\n\n delete times[label]\n var duration = now() - time\n console.log(label + \": \" + duration + \"ms\")\n}\n\nfunction trace() {\n var err = new Error()\n err.name = \"Trace\"\n err.message = util.format.apply(null, arguments)\n console.error(err.stack)\n}\n\nfunction dir(object) {\n console.log(util.inspect(object) + \"\\n\")\n}\n\nfunction consoleAssert(expression) {\n if (!expression) {\n var arr = slice.call(arguments, 1)\n assert.ok(false, util.format.apply(null, arr))\n }\n}\n","var global = require('../internals/global');\nvar isCallable = require('../internals/is-callable');\nvar tryToString = require('../internals/try-to-string');\n\nvar TypeError = global.TypeError;\n\n// `Assert: IsCallable(argument) is true`\nmodule.exports = function (argument) {\n if (isCallable(argument)) return argument;\n throw TypeError(tryToString(argument) + ' is not a function');\n};\n","var global = require('../internals/global');\nvar isObject = require('../internals/is-object');\n\nvar String = global.String;\nvar TypeError = global.TypeError;\n\n// `Assert: Type(argument) is Object`\nmodule.exports = function (argument) {\n if (isObject(argument)) return argument;\n throw TypeError(String(argument) + ' is not an object');\n};\n","var toIndexedObject = require('../internals/to-indexed-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\n\n// `Array.prototype.{ indexOf, includes }` methods implementation\nvar createMethod = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIndexedObject($this);\n var length = lengthOfArrayLike(O);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare -- NaN check\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare -- NaN check\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) {\n if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.includes` method\n // https://tc39.es/ecma262/#sec-array.prototype.includes\n includes: createMethod(true),\n // `Array.prototype.indexOf` method\n // https://tc39.es/ecma262/#sec-array.prototype.indexof\n indexOf: createMethod(false)\n};\n","var fails = require('../internals/fails');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar V8_VERSION = require('../internals/engine-v8-version');\n\nvar SPECIES = wellKnownSymbol('species');\n\nmodule.exports = function (METHOD_NAME) {\n // We can't use this feature detection in V8 since it causes\n // deoptimization and serious performance degradation\n // https://github.com/zloirock/core-js/issues/677\n return V8_VERSION >= 51 || !fails(function () {\n var array = [];\n var constructor = array.constructor = {};\n constructor[SPECIES] = function () {\n return { foo: 1 };\n };\n return array[METHOD_NAME](Boolean).foo !== 1;\n });\n};\n","var global = require('../internals/global');\nvar isArray = require('../internals/is-array');\nvar isConstructor = require('../internals/is-constructor');\nvar isObject = require('../internals/is-object');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar SPECIES = wellKnownSymbol('species');\nvar Array = global.Array;\n\n// a part of `ArraySpeciesCreate` abstract operation\n// https://tc39.es/ecma262/#sec-arrayspeciescreate\nmodule.exports = function (originalArray) {\n var C;\n if (isArray(originalArray)) {\n C = originalArray.constructor;\n // cross-realm fallback\n if (isConstructor(C) && (C === Array || isArray(C.prototype))) C = undefined;\n else if (isObject(C)) {\n C = C[SPECIES];\n if (C === null) C = undefined;\n }\n } return C === undefined ? Array : C;\n};\n","var arraySpeciesConstructor = require('../internals/array-species-constructor');\n\n// `ArraySpeciesCreate` abstract operation\n// https://tc39.es/ecma262/#sec-arrayspeciescreate\nmodule.exports = function (originalArray, length) {\n return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nvar toString = uncurryThis({}.toString);\nvar stringSlice = uncurryThis(''.slice);\n\nmodule.exports = function (it) {\n return stringSlice(toString(it), 8, -1);\n};\n","var global = require('../internals/global');\nvar TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar isCallable = require('../internals/is-callable');\nvar classofRaw = require('../internals/classof-raw');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar Object = global.Object;\n\n// ES3 wrong here\nvar CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (error) { /* empty */ }\n};\n\n// getting tag from ES6+ `Object.prototype.toString`\nmodule.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {\n var O, tag, result;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag\n // builtinTag case\n : CORRECT_ARGUMENTS ? classofRaw(O)\n // ES3 arguments fallback\n : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;\n};\n","var hasOwn = require('../internals/has-own-property');\nvar ownKeys = require('../internals/own-keys');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\nvar definePropertyModule = require('../internals/object-define-property');\n\nmodule.exports = function (target, source, exceptions) {\n var keys = ownKeys(source);\n var defineProperty = definePropertyModule.f;\n var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {\n defineProperty(target, key, getOwnPropertyDescriptor(source, key));\n }\n }\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = DESCRIPTORS ? function (object, key, value) {\n return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","'use strict';\nvar toPropertyKey = require('../internals/to-property-key');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = function (object, key, value) {\n var propertyKey = toPropertyKey(key);\n if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));\n else object[propertyKey] = value;\n};\n","var global = require('../internals/global');\nvar isCallable = require('../internals/is-callable');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar makeBuiltIn = require('../internals/make-built-in');\nvar setGlobal = require('../internals/set-global');\n\nmodule.exports = function (O, key, value, options) {\n var unsafe = options ? !!options.unsafe : false;\n var simple = options ? !!options.enumerable : false;\n var noTargetGet = options ? !!options.noTargetGet : false;\n var name = options && options.name !== undefined ? options.name : key;\n if (isCallable(value)) makeBuiltIn(value, name, options);\n if (O === global) {\n if (simple) O[key] = value;\n else setGlobal(key, value);\n return O;\n } else if (!unsafe) {\n delete O[key];\n } else if (!noTargetGet && O[key]) {\n simple = true;\n }\n if (simple) O[key] = value;\n else createNonEnumerableProperty(O, key, value);\n return O;\n};\n","var fails = require('../internals/fails');\n\n// Detect IE8's incomplete defineProperty implementation\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing\n return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;\n});\n","var global = require('../internals/global');\nvar isObject = require('../internals/is-object');\n\nvar document = global.document;\n// typeof document.createElement is 'object' in old IE\nvar EXISTS = isObject(document) && isObject(document.createElement);\n\nmodule.exports = function (it) {\n return EXISTS ? document.createElement(it) : {};\n};\n","var getBuiltIn = require('../internals/get-built-in');\n\nmodule.exports = getBuiltIn('navigator', 'userAgent') || '';\n","var global = require('../internals/global');\nvar userAgent = require('../internals/engine-user-agent');\n\nvar process = global.process;\nvar Deno = global.Deno;\nvar versions = process && process.versions || Deno && Deno.version;\nvar v8 = versions && versions.v8;\nvar match, version;\n\nif (v8) {\n match = v8.split('.');\n // in old Chrome, versions of V8 isn't V8 = Chrome / 10\n // but their correct versions are not interesting for us\n version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);\n}\n\n// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`\n// so check `userAgent` even if `.v8` exists, but 0\nif (!version && userAgent) {\n match = userAgent.match(/Edge\\/(\\d+)/);\n if (!match || match[1] >= 74) {\n match = userAgent.match(/Chrome\\/(\\d+)/);\n if (match) version = +match[1];\n }\n}\n\nmodule.exports = version;\n","// IE8- don't enum bug keys\nmodule.exports = [\n 'constructor',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'toLocaleString',\n 'toString',\n 'valueOf'\n];\n","var global = require('../internals/global');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar setGlobal = require('../internals/set-global');\nvar copyConstructorProperties = require('../internals/copy-constructor-properties');\nvar isForced = require('../internals/is-forced');\n\n/*\n options.target - name of the target object\n options.global - target is the global object\n options.stat - export as static methods of target\n options.proto - export as prototype methods of target\n options.real - real prototype method for the `pure` version\n options.forced - export even if the native feature is available\n options.bind - bind methods to the target, required for the `pure` version\n options.wrap - wrap constructors to preventing global pollution, required for the `pure` version\n options.unsafe - use the simple assignment of property instead of delete + defineProperty\n options.sham - add a flag to not completely full polyfills\n options.enumerable - export as enumerable property\n options.noTargetGet - prevent calling a getter on target\n options.name - the .name of the function if it does not match the key\n*/\nmodule.exports = function (options, source) {\n var TARGET = options.target;\n var GLOBAL = options.global;\n var STATIC = options.stat;\n var FORCED, target, key, targetProperty, sourceProperty, descriptor;\n if (GLOBAL) {\n target = global;\n } else if (STATIC) {\n target = global[TARGET] || setGlobal(TARGET, {});\n } else {\n target = (global[TARGET] || {}).prototype;\n }\n if (target) for (key in source) {\n sourceProperty = source[key];\n if (options.noTargetGet) {\n descriptor = getOwnPropertyDescriptor(target, key);\n targetProperty = descriptor && descriptor.value;\n } else targetProperty = target[key];\n FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);\n // contained in target\n if (!FORCED && targetProperty !== undefined) {\n if (typeof sourceProperty == typeof targetProperty) continue;\n copyConstructorProperties(sourceProperty, targetProperty);\n }\n // add a flag to not completely full polyfills\n if (options.sham || (targetProperty && targetProperty.sham)) {\n createNonEnumerableProperty(sourceProperty, 'sham', true);\n }\n defineBuiltIn(target, key, sourceProperty, options);\n }\n};\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (error) {\n return true;\n }\n};\n","var fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es-x/no-function-prototype-bind -- safe\n var test = (function () { /* empty */ }).bind();\n // eslint-disable-next-line no-prototype-builtins -- safe\n return typeof test != 'function' || test.hasOwnProperty('prototype');\n});\n","var NATIVE_BIND = require('../internals/function-bind-native');\n\nvar call = Function.prototype.call;\n\nmodule.exports = NATIVE_BIND ? call.bind(call) : function () {\n return call.apply(call, arguments);\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar hasOwn = require('../internals/has-own-property');\n\nvar FunctionPrototype = Function.prototype;\n// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe\nvar getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;\n\nvar EXISTS = hasOwn(FunctionPrototype, 'name');\n// additional protection from minified / mangled / dropped function names\nvar PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';\nvar CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));\n\nmodule.exports = {\n EXISTS: EXISTS,\n PROPER: PROPER,\n CONFIGURABLE: CONFIGURABLE\n};\n","var NATIVE_BIND = require('../internals/function-bind-native');\n\nvar FunctionPrototype = Function.prototype;\nvar bind = FunctionPrototype.bind;\nvar call = FunctionPrototype.call;\nvar uncurryThis = NATIVE_BIND && bind.bind(call, call);\n\nmodule.exports = NATIVE_BIND ? function (fn) {\n return fn && uncurryThis(fn);\n} : function (fn) {\n return fn && function () {\n return call.apply(fn, arguments);\n };\n};\n","var global = require('../internals/global');\nvar isCallable = require('../internals/is-callable');\n\nvar aFunction = function (argument) {\n return isCallable(argument) ? argument : undefined;\n};\n\nmodule.exports = function (namespace, method) {\n return arguments.length < 2 ? aFunction(global[namespace]) : global[namespace] && global[namespace][method];\n};\n","var aCallable = require('../internals/a-callable');\n\n// `GetMethod` abstract operation\n// https://tc39.es/ecma262/#sec-getmethod\nmodule.exports = function (V, P) {\n var func = V[P];\n return func == null ? undefined : aCallable(func);\n};\n","var check = function (it) {\n return it && it.Math == Math && it;\n};\n\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nmodule.exports =\n // eslint-disable-next-line es-x/no-global-this -- safe\n check(typeof globalThis == 'object' && globalThis) ||\n check(typeof window == 'object' && window) ||\n // eslint-disable-next-line no-restricted-globals -- safe\n check(typeof self == 'object' && self) ||\n check(typeof global == 'object' && global) ||\n // eslint-disable-next-line no-new-func -- fallback\n (function () { return this; })() || Function('return this')();\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar toObject = require('../internals/to-object');\n\nvar hasOwnProperty = uncurryThis({}.hasOwnProperty);\n\n// `HasOwnProperty` abstract operation\n// https://tc39.es/ecma262/#sec-hasownproperty\n// eslint-disable-next-line es-x/no-object-hasown -- safe\nmodule.exports = Object.hasOwn || function hasOwn(it, key) {\n return hasOwnProperty(toObject(it), key);\n};\n","module.exports = {};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar createElement = require('../internals/document-create-element');\n\n// Thanks to IE8 for its funny defineProperty\nmodule.exports = !DESCRIPTORS && !fails(function () {\n // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing\n return Object.defineProperty(createElement('div'), 'a', {\n get: function () { return 7; }\n }).a != 7;\n});\n","var global = require('../internals/global');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar classof = require('../internals/classof-raw');\n\nvar Object = global.Object;\nvar split = uncurryThis(''.split);\n\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\nmodule.exports = fails(function () {\n // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346\n // eslint-disable-next-line no-prototype-builtins -- safe\n return !Object('z').propertyIsEnumerable(0);\n}) ? function (it) {\n return classof(it) == 'String' ? split(it, '') : Object(it);\n} : Object;\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar isCallable = require('../internals/is-callable');\nvar store = require('../internals/shared-store');\n\nvar functionToString = uncurryThis(Function.toString);\n\n// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper\nif (!isCallable(store.inspectSource)) {\n store.inspectSource = function (it) {\n return functionToString(it);\n };\n}\n\nmodule.exports = store.inspectSource;\n","var NATIVE_WEAK_MAP = require('../internals/native-weak-map');\nvar global = require('../internals/global');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar isObject = require('../internals/is-object');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar hasOwn = require('../internals/has-own-property');\nvar shared = require('../internals/shared-store');\nvar sharedKey = require('../internals/shared-key');\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar OBJECT_ALREADY_INITIALIZED = 'Object already initialized';\nvar TypeError = global.TypeError;\nvar WeakMap = global.WeakMap;\nvar set, get, has;\n\nvar enforce = function (it) {\n return has(it) ? get(it) : set(it, {});\n};\n\nvar getterFor = function (TYPE) {\n return function (it) {\n var state;\n if (!isObject(it) || (state = get(it)).type !== TYPE) {\n throw TypeError('Incompatible receiver, ' + TYPE + ' required');\n } return state;\n };\n};\n\nif (NATIVE_WEAK_MAP || shared.state) {\n var store = shared.state || (shared.state = new WeakMap());\n var wmget = uncurryThis(store.get);\n var wmhas = uncurryThis(store.has);\n var wmset = uncurryThis(store.set);\n set = function (it, metadata) {\n if (wmhas(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n wmset(store, it, metadata);\n return metadata;\n };\n get = function (it) {\n return wmget(store, it) || {};\n };\n has = function (it) {\n return wmhas(store, it);\n };\n} else {\n var STATE = sharedKey('state');\n hiddenKeys[STATE] = true;\n set = function (it, metadata) {\n if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n createNonEnumerableProperty(it, STATE, metadata);\n return metadata;\n };\n get = function (it) {\n return hasOwn(it, STATE) ? it[STATE] : {};\n };\n has = function (it) {\n return hasOwn(it, STATE);\n };\n}\n\nmodule.exports = {\n set: set,\n get: get,\n has: has,\n enforce: enforce,\n getterFor: getterFor\n};\n","var classof = require('../internals/classof-raw');\n\n// `IsArray` abstract operation\n// https://tc39.es/ecma262/#sec-isarray\n// eslint-disable-next-line es-x/no-array-isarray -- safe\nmodule.exports = Array.isArray || function isArray(argument) {\n return classof(argument) == 'Array';\n};\n","// `IsCallable` abstract operation\n// https://tc39.es/ecma262/#sec-iscallable\nmodule.exports = function (argument) {\n return typeof argument == 'function';\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\nvar classof = require('../internals/classof');\nvar getBuiltIn = require('../internals/get-built-in');\nvar inspectSource = require('../internals/inspect-source');\n\nvar noop = function () { /* empty */ };\nvar empty = [];\nvar construct = getBuiltIn('Reflect', 'construct');\nvar constructorRegExp = /^\\s*(?:class|function)\\b/;\nvar exec = uncurryThis(constructorRegExp.exec);\nvar INCORRECT_TO_STRING = !constructorRegExp.exec(noop);\n\nvar isConstructorModern = function isConstructor(argument) {\n if (!isCallable(argument)) return false;\n try {\n construct(noop, empty, argument);\n return true;\n } catch (error) {\n return false;\n }\n};\n\nvar isConstructorLegacy = function isConstructor(argument) {\n if (!isCallable(argument)) return false;\n switch (classof(argument)) {\n case 'AsyncFunction':\n case 'GeneratorFunction':\n case 'AsyncGeneratorFunction': return false;\n }\n try {\n // we can't check .prototype since constructors produced by .bind haven't it\n // `Function#toString` throws on some built-it function in some legacy engines\n // (for example, `DOMQuad` and similar in FF41-)\n return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));\n } catch (error) {\n return true;\n }\n};\n\nisConstructorLegacy.sham = true;\n\n// `IsConstructor` abstract operation\n// https://tc39.es/ecma262/#sec-isconstructor\nmodule.exports = !construct || fails(function () {\n var called;\n return isConstructorModern(isConstructorModern.call)\n || !isConstructorModern(Object)\n || !isConstructorModern(function () { called = true; })\n || called;\n}) ? isConstructorLegacy : isConstructorModern;\n","var fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\n\nvar replacement = /#|\\.prototype\\./;\n\nvar isForced = function (feature, detection) {\n var value = data[normalize(feature)];\n return value == POLYFILL ? true\n : value == NATIVE ? false\n : isCallable(detection) ? fails(detection)\n : !!detection;\n};\n\nvar normalize = isForced.normalize = function (string) {\n return String(string).replace(replacement, '.').toLowerCase();\n};\n\nvar data = isForced.data = {};\nvar NATIVE = isForced.NATIVE = 'N';\nvar POLYFILL = isForced.POLYFILL = 'P';\n\nmodule.exports = isForced;\n","var isCallable = require('../internals/is-callable');\n\nmodule.exports = function (it) {\n return typeof it == 'object' ? it !== null : isCallable(it);\n};\n","module.exports = false;\n","var global = require('../internals/global');\nvar getBuiltIn = require('../internals/get-built-in');\nvar isCallable = require('../internals/is-callable');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar Object = global.Object;\n\nmodule.exports = USE_SYMBOL_AS_UID ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n var $Symbol = getBuiltIn('Symbol');\n return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, Object(it));\n};\n","var toLength = require('../internals/to-length');\n\n// `LengthOfArrayLike` abstract operation\n// https://tc39.es/ecma262/#sec-lengthofarraylike\nmodule.exports = function (obj) {\n return toLength(obj.length);\n};\n","var fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\nvar hasOwn = require('../internals/has-own-property');\nvar defineProperty = require('../internals/object-define-property').f;\nvar CONFIGURABLE_FUNCTION_NAME = require('../internals/function-name').CONFIGURABLE;\nvar inspectSource = require('../internals/inspect-source');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar enforceInternalState = InternalStateModule.enforce;\nvar getInternalState = InternalStateModule.get;\n\nvar CONFIGURABLE_LENGTH = !fails(function () {\n return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;\n});\n\nvar TEMPLATE = String(String).split('String');\n\nvar makeBuiltIn = module.exports = function (value, name, options) {\n if (String(name).slice(0, 7) === 'Symbol(') {\n name = '[' + String(name).replace(/^Symbol\\(([^)]*)\\)/, '$1') + ']';\n }\n if (options && options.getter) name = 'get ' + name;\n if (options && options.setter) name = 'set ' + name;\n if (!hasOwn(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {\n defineProperty(value, 'name', { value: name, configurable: true });\n }\n if (CONFIGURABLE_LENGTH && options && hasOwn(options, 'arity') && value.length !== options.arity) {\n defineProperty(value, 'length', { value: options.arity });\n }\n var state = enforceInternalState(value);\n if (!hasOwn(state, 'source')) {\n state.source = TEMPLATE.join(typeof name == 'string' ? name : '');\n } return value;\n};\n\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n// eslint-disable-next-line no-extend-native -- required\nFunction.prototype.toString = makeBuiltIn(function toString() {\n return isCallable(this) && getInternalState(this).source || inspectSource(this);\n}, 'toString');\n","/* eslint-disable es-x/no-symbol -- required for testing */\nvar V8_VERSION = require('../internals/engine-v8-version');\nvar fails = require('../internals/fails');\n\n// eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing\nmodule.exports = !!Object.getOwnPropertySymbols && !fails(function () {\n var symbol = Symbol();\n // Chrome 38 Symbol has incorrect toString conversion\n // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances\n return !String(symbol) || !(Object(symbol) instanceof Symbol) ||\n // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances\n !Symbol.sham && V8_VERSION && V8_VERSION < 41;\n});\n","var global = require('../internals/global');\nvar isCallable = require('../internals/is-callable');\nvar inspectSource = require('../internals/inspect-source');\n\nvar WeakMap = global.WeakMap;\n\nmodule.exports = isCallable(WeakMap) && /native code/.test(inspectSource(WeakMap));\n","var global = require('../internals/global');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\nvar V8_PROTOTYPE_DEFINE_BUG = require('../internals/v8-prototype-define-bug');\nvar anObject = require('../internals/an-object');\nvar toPropertyKey = require('../internals/to-property-key');\n\nvar TypeError = global.TypeError;\n// eslint-disable-next-line es-x/no-object-defineproperty -- safe\nvar $defineProperty = Object.defineProperty;\n// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar ENUMERABLE = 'enumerable';\nvar CONFIGURABLE = 'configurable';\nvar WRITABLE = 'writable';\n\n// `Object.defineProperty` method\n// https://tc39.es/ecma262/#sec-object.defineproperty\nexports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {\n var current = $getOwnPropertyDescriptor(O, P);\n if (current && current[WRITABLE]) {\n O[P] = Attributes.value;\n Attributes = {\n configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],\n enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],\n writable: false\n };\n }\n } return $defineProperty(O, P, Attributes);\n} : $defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return $defineProperty(O, P, Attributes);\n } catch (error) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar call = require('../internals/function-call');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toPropertyKey = require('../internals/to-property-key');\nvar hasOwn = require('../internals/has-own-property');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\n\n// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// `Object.getOwnPropertyDescriptor` method\n// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor\nexports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {\n O = toIndexedObject(O);\n P = toPropertyKey(P);\n if (IE8_DOM_DEFINE) try {\n return $getOwnPropertyDescriptor(O, P);\n } catch (error) { /* empty */ }\n if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);\n};\n","var internalObjectKeys = require('../internals/object-keys-internal');\nvar enumBugKeys = require('../internals/enum-bug-keys');\n\nvar hiddenKeys = enumBugKeys.concat('length', 'prototype');\n\n// `Object.getOwnPropertyNames` method\n// https://tc39.es/ecma262/#sec-object.getownpropertynames\n// eslint-disable-next-line es-x/no-object-getownpropertynames -- safe\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return internalObjectKeys(O, hiddenKeys);\n};\n","// eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe\nexports.f = Object.getOwnPropertySymbols;\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nmodule.exports = uncurryThis({}.isPrototypeOf);\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar hasOwn = require('../internals/has-own-property');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar indexOf = require('../internals/array-includes').indexOf;\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar push = uncurryThis([].push);\n\nmodule.exports = function (object, names) {\n var O = toIndexedObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (hasOwn(O, key = names[i++])) {\n ~indexOf(result, key) || push(result, key);\n }\n return result;\n};\n","'use strict';\nvar $propertyIsEnumerable = {}.propertyIsEnumerable;\n// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// Nashorn ~ JDK8 bug\nvar NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);\n\n// `Object.prototype.propertyIsEnumerable` method implementation\n// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable\nexports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {\n var descriptor = getOwnPropertyDescriptor(this, V);\n return !!descriptor && descriptor.enumerable;\n} : $propertyIsEnumerable;\n","var global = require('../internals/global');\nvar call = require('../internals/function-call');\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\n\nvar TypeError = global.TypeError;\n\n// `OrdinaryToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-ordinarytoprimitive\nmodule.exports = function (input, pref) {\n var fn, val;\n if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;\n if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n","var getBuiltIn = require('../internals/get-built-in');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar getOwnPropertyNamesModule = require('../internals/object-get-own-property-names');\nvar getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');\nvar anObject = require('../internals/an-object');\n\nvar concat = uncurryThis([].concat);\n\n// all object keys, includes non-enumerable and symbols\nmodule.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {\n var keys = getOwnPropertyNamesModule.f(anObject(it));\n var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;\n return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;\n};\n","var global = require('../internals/global');\n\nvar TypeError = global.TypeError;\n\n// `RequireObjectCoercible` abstract operation\n// https://tc39.es/ecma262/#sec-requireobjectcoercible\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n","var global = require('../internals/global');\n\n// eslint-disable-next-line es-x/no-object-defineproperty -- safe\nvar defineProperty = Object.defineProperty;\n\nmodule.exports = function (key, value) {\n try {\n defineProperty(global, key, { value: value, configurable: true, writable: true });\n } catch (error) {\n global[key] = value;\n } return value;\n};\n","var shared = require('../internals/shared');\nvar uid = require('../internals/uid');\n\nvar keys = shared('keys');\n\nmodule.exports = function (key) {\n return keys[key] || (keys[key] = uid(key));\n};\n","var global = require('../internals/global');\nvar setGlobal = require('../internals/set-global');\n\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || setGlobal(SHARED, {});\n\nmodule.exports = store;\n","var IS_PURE = require('../internals/is-pure');\nvar store = require('../internals/shared-store');\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: '3.22.4',\n mode: IS_PURE ? 'pure' : 'global',\n copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',\n license: 'https://github.com/zloirock/core-js/blob/v3.22.4/LICENSE',\n source: 'https://github.com/zloirock/core-js'\n});\n","var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\n\nvar max = Math.max;\nvar min = Math.min;\n\n// Helper for a popular repeating case of the spec:\n// Let integer be ? ToInteger(index).\n// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).\nmodule.exports = function (index, length) {\n var integer = toIntegerOrInfinity(index);\n return integer < 0 ? max(integer + length, 0) : min(integer, length);\n};\n","// toObject with fallback for non-array-like ES3 strings\nvar IndexedObject = require('../internals/indexed-object');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nmodule.exports = function (it) {\n return IndexedObject(requireObjectCoercible(it));\n};\n","var ceil = Math.ceil;\nvar floor = Math.floor;\n\n// `ToIntegerOrInfinity` abstract operation\n// https://tc39.es/ecma262/#sec-tointegerorinfinity\nmodule.exports = function (argument) {\n var number = +argument;\n // eslint-disable-next-line no-self-compare -- safe\n return number !== number || number === 0 ? 0 : (number > 0 ? floor : ceil)(number);\n};\n","var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\n\nvar min = Math.min;\n\n// `ToLength` abstract operation\n// https://tc39.es/ecma262/#sec-tolength\nmodule.exports = function (argument) {\n return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991\n};\n","var global = require('../internals/global');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nvar Object = global.Object;\n\n// `ToObject` abstract operation\n// https://tc39.es/ecma262/#sec-toobject\nmodule.exports = function (argument) {\n return Object(requireObjectCoercible(argument));\n};\n","var global = require('../internals/global');\nvar call = require('../internals/function-call');\nvar isObject = require('../internals/is-object');\nvar isSymbol = require('../internals/is-symbol');\nvar getMethod = require('../internals/get-method');\nvar ordinaryToPrimitive = require('../internals/ordinary-to-primitive');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TypeError = global.TypeError;\nvar TO_PRIMITIVE = wellKnownSymbol('toPrimitive');\n\n// `ToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-toprimitive\nmodule.exports = function (input, pref) {\n if (!isObject(input) || isSymbol(input)) return input;\n var exoticToPrim = getMethod(input, TO_PRIMITIVE);\n var result;\n if (exoticToPrim) {\n if (pref === undefined) pref = 'default';\n result = call(exoticToPrim, input, pref);\n if (!isObject(result) || isSymbol(result)) return result;\n throw TypeError(\"Can't convert object to primitive value\");\n }\n if (pref === undefined) pref = 'number';\n return ordinaryToPrimitive(input, pref);\n};\n","var toPrimitive = require('../internals/to-primitive');\nvar isSymbol = require('../internals/is-symbol');\n\n// `ToPropertyKey` abstract operation\n// https://tc39.es/ecma262/#sec-topropertykey\nmodule.exports = function (argument) {\n var key = toPrimitive(argument, 'string');\n return isSymbol(key) ? key : key + '';\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar test = {};\n\ntest[TO_STRING_TAG] = 'z';\n\nmodule.exports = String(test) === '[object z]';\n","var global = require('../internals/global');\n\nvar String = global.String;\n\nmodule.exports = function (argument) {\n try {\n return String(argument);\n } catch (error) {\n return 'Object';\n }\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nvar id = 0;\nvar postfix = Math.random();\nvar toString = uncurryThis(1.0.toString);\n\nmodule.exports = function (key) {\n return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);\n};\n","/* eslint-disable es-x/no-symbol -- required for testing */\nvar NATIVE_SYMBOL = require('../internals/native-symbol');\n\nmodule.exports = NATIVE_SYMBOL\n && !Symbol.sham\n && typeof Symbol.iterator == 'symbol';\n","var DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\n\n// V8 ~ Chrome 36-\n// https://bugs.chromium.org/p/v8/issues/detail?id=3334\nmodule.exports = DESCRIPTORS && fails(function () {\n // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing\n return Object.defineProperty(function () { /* empty */ }, 'prototype', {\n value: 42,\n writable: false\n }).prototype != 42;\n});\n","var global = require('../internals/global');\nvar shared = require('../internals/shared');\nvar hasOwn = require('../internals/has-own-property');\nvar uid = require('../internals/uid');\nvar NATIVE_SYMBOL = require('../internals/native-symbol');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar WellKnownSymbolsStore = shared('wks');\nvar Symbol = global.Symbol;\nvar symbolFor = Symbol && Symbol['for'];\nvar createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;\n\nmodule.exports = function (name) {\n if (!hasOwn(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {\n var description = 'Symbol.' + name;\n if (NATIVE_SYMBOL && hasOwn(Symbol, name)) {\n WellKnownSymbolsStore[name] = Symbol[name];\n } else if (USE_SYMBOL_AS_UID && symbolFor) {\n WellKnownSymbolsStore[name] = symbolFor(description);\n } else {\n WellKnownSymbolsStore[name] = createWellKnownSymbol(description);\n }\n } return WellKnownSymbolsStore[name];\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar global = require('../internals/global');\nvar fails = require('../internals/fails');\nvar isArray = require('../internals/is-array');\nvar isObject = require('../internals/is-object');\nvar toObject = require('../internals/to-object');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar createProperty = require('../internals/create-property');\nvar arraySpeciesCreate = require('../internals/array-species-create');\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar V8_VERSION = require('../internals/engine-v8-version');\n\nvar IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');\nvar MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;\nvar MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';\nvar TypeError = global.TypeError;\n\n// We can't use this feature detection in V8 since it causes\n// deoptimization and serious performance degradation\n// https://github.com/zloirock/core-js/issues/679\nvar IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {\n var array = [];\n array[IS_CONCAT_SPREADABLE] = false;\n return array.concat()[0] !== array;\n});\n\nvar SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');\n\nvar isConcatSpreadable = function (O) {\n if (!isObject(O)) return false;\n var spreadable = O[IS_CONCAT_SPREADABLE];\n return spreadable !== undefined ? !!spreadable : isArray(O);\n};\n\nvar FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;\n\n// `Array.prototype.concat` method\n// https://tc39.es/ecma262/#sec-array.prototype.concat\n// with adding support of @@isConcatSpreadable and @@species\n$({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n concat: function concat(arg) {\n var O = toObject(this);\n var A = arraySpeciesCreate(O, 0);\n var n = 0;\n var i, k, length, len, E;\n for (i = -1, length = arguments.length; i < length; i++) {\n E = i === -1 ? O : arguments[i];\n if (isConcatSpreadable(E)) {\n len = lengthOfArrayLike(E);\n if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);\n for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);\n } else {\n if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);\n createProperty(A, n++, E);\n }\n }\n A.length = n;\n return A;\n }\n});\n","'use strict';\n\nvar keys = require('object-keys');\nvar hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';\n\nvar toStr = Object.prototype.toString;\nvar concat = Array.prototype.concat;\nvar origDefineProperty = Object.defineProperty;\n\nvar isFunction = function (fn) {\n\treturn typeof fn === 'function' && toStr.call(fn) === '[object Function]';\n};\n\nvar arePropertyDescriptorsSupported = function () {\n\tvar obj = {};\n\ttry {\n\t\torigDefineProperty(obj, 'x', { enumerable: false, value: obj });\n\t\t// eslint-disable-next-line no-unused-vars, no-restricted-syntax\n\t\tfor (var _ in obj) { // jscs:ignore disallowUnusedVariables\n\t\t\treturn false;\n\t\t}\n\t\treturn obj.x === obj;\n\t} catch (e) { /* this is IE 8. */\n\t\treturn false;\n\t}\n};\nvar supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported();\n\nvar defineProperty = function (object, name, value, predicate) {\n\tif (name in object && (!isFunction(predicate) || !predicate())) {\n\t\treturn;\n\t}\n\tif (supportsDescriptors) {\n\t\torigDefineProperty(object, name, {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: false,\n\t\t\tvalue: value,\n\t\t\twritable: true\n\t\t});\n\t} else {\n\t\tobject[name] = value;\n\t}\n};\n\nvar defineProperties = function (object, map) {\n\tvar predicates = arguments.length > 2 ? arguments[2] : {};\n\tvar props = keys(map);\n\tif (hasSymbols) {\n\t\tprops = concat.call(props, Object.getOwnPropertySymbols(map));\n\t}\n\tfor (var i = 0; i < props.length; i += 1) {\n\t\tdefineProperty(object, props[i], map[props[i]], predicates[props[i]]);\n\t}\n};\n\ndefineProperties.supportsDescriptors = !!supportsDescriptors;\n\nmodule.exports = defineProperties;\n","/**\n * Code refactored from Mozilla Developer Network:\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n */\n\n'use strict';\n\nfunction assign(target, firstSource) {\n if (target === undefined || target === null) {\n throw new TypeError('Cannot convert first argument to object');\n }\n\n var to = Object(target);\n for (var i = 1; i < arguments.length; i++) {\n var nextSource = arguments[i];\n if (nextSource === undefined || nextSource === null) {\n continue;\n }\n\n var keysArray = Object.keys(Object(nextSource));\n for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) {\n var nextKey = keysArray[nextIndex];\n var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);\n if (desc !== undefined && desc.enumerable) {\n to[nextKey] = nextSource[nextKey];\n }\n }\n }\n return to;\n}\n\nfunction polyfill() {\n if (!Object.assign) {\n Object.defineProperty(Object, 'assign', {\n enumerable: false,\n configurable: true,\n writable: true,\n value: assign\n });\n }\n}\n\nmodule.exports = {\n assign: assign,\n polyfill: polyfill\n};\n","/*!\n * escape-html\n * Copyright(c) 2012-2013 TJ Holowaychuk\n * Copyright(c) 2015 Andreas Lubbe\n * Copyright(c) 2015 Tiancheng \"Timothy\" Gu\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module variables.\n * @private\n */\n\nvar matchHtmlRegExp = /[\"'&<>]/;\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = escapeHtml;\n\n/**\n * Escape special characters in the given string of html.\n *\n * @param {string} string The string to escape for inserting into HTML\n * @return {string}\n * @public\n */\n\nfunction escapeHtml(string) {\n var str = '' + string;\n var match = matchHtmlRegExp.exec(str);\n\n if (!match) {\n return str;\n }\n\n var escape;\n var html = '';\n var index = 0;\n var lastIndex = 0;\n\n for (index = match.index; index < str.length; index++) {\n switch (str.charCodeAt(index)) {\n case 34: // \"\n escape = '&quot;';\n break;\n case 38: // &\n escape = '&amp;';\n break;\n case 39: // '\n escape = '&#39;';\n break;\n case 60: // <\n escape = '&lt;';\n break;\n case 62: // >\n escape = '&gt;';\n break;\n default:\n continue;\n }\n\n if (lastIndex !== index) {\n html += str.substring(lastIndex, index);\n }\n\n lastIndex = index + 1;\n html += escape;\n }\n\n return lastIndex !== index\n ? html + str.substring(lastIndex, index)\n : html;\n}\n","\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toString = Object.prototype.toString;\n\nmodule.exports = function forEach (obj, fn, ctx) {\n if (toString.call(fn) !== '[object Function]') {\n throw new TypeError('iterator must be a function');\n }\n var l = obj.length;\n if (l === +l) {\n for (var i = 0; i < l; i++) {\n fn.call(ctx, obj[i], i, obj);\n }\n } else {\n for (var k in obj) {\n if (hasOwn.call(obj, k)) {\n fn.call(ctx, obj[k], k, obj);\n }\n }\n }\n};\n\n","'use strict';\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar slice = Array.prototype.slice;\nvar toStr = Object.prototype.toString;\nvar funcType = '[object Function]';\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.call(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slice.call(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n args.concat(slice.call(arguments))\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n } else {\n return target.apply(\n that,\n args.concat(slice.call(arguments))\n );\n }\n };\n\n var boundLength = Math.max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs.push('$' + i);\n }\n\n bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = Function.prototype.bind || implementation;\n","'use strict';\n\nvar undefined;\n\nvar $SyntaxError = SyntaxError;\nvar $Function = Function;\nvar $TypeError = TypeError;\n\n// eslint-disable-next-line consistent-return\nvar getEvalledConstructor = function (expressionSyntax) {\n\ttry {\n\t\treturn $Function('\"use strict\"; return (' + expressionSyntax + ').constructor;')();\n\t} catch (e) {}\n};\n\nvar $gOPD = Object.getOwnPropertyDescriptor;\nif ($gOPD) {\n\ttry {\n\t\t$gOPD({}, '');\n\t} catch (e) {\n\t\t$gOPD = null; // this is IE 8, which has a broken gOPD\n\t}\n}\n\nvar throwTypeError = function () {\n\tthrow new $TypeError();\n};\nvar ThrowTypeError = $gOPD\n\t? (function () {\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties\n\t\t\targuments.callee; // IE 8 does not throw here\n\t\t\treturn throwTypeError;\n\t\t} catch (calleeThrows) {\n\t\t\ttry {\n\t\t\t\t// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')\n\t\t\t\treturn $gOPD(arguments, 'callee').get;\n\t\t\t} catch (gOPDthrows) {\n\t\t\t\treturn throwTypeError;\n\t\t\t}\n\t\t}\n\t}())\n\t: throwTypeError;\n\nvar hasSymbols = require('has-symbols')();\n\nvar getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto\n\nvar needsEval = {};\n\nvar TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);\n\nvar INTRINSICS = {\n\t'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,\n\t'%Array%': Array,\n\t'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,\n\t'%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,\n\t'%AsyncFromSyncIteratorPrototype%': undefined,\n\t'%AsyncFunction%': needsEval,\n\t'%AsyncGenerator%': needsEval,\n\t'%AsyncGeneratorFunction%': needsEval,\n\t'%AsyncIteratorPrototype%': needsEval,\n\t'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,\n\t'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,\n\t'%Boolean%': Boolean,\n\t'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,\n\t'%Date%': Date,\n\t'%decodeURI%': decodeURI,\n\t'%decodeURIComponent%': decodeURIComponent,\n\t'%encodeURI%': encodeURI,\n\t'%encodeURIComponent%': encodeURIComponent,\n\t'%Error%': Error,\n\t'%eval%': eval, // eslint-disable-line no-eval\n\t'%EvalError%': EvalError,\n\t'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,\n\t'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,\n\t'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,\n\t'%Function%': $Function,\n\t'%GeneratorFunction%': needsEval,\n\t'%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,\n\t'%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,\n\t'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,\n\t'%isFinite%': isFinite,\n\t'%isNaN%': isNaN,\n\t'%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,\n\t'%JSON%': typeof JSON === 'object' ? JSON : undefined,\n\t'%Map%': typeof Map === 'undefined' ? undefined : Map,\n\t'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),\n\t'%Math%': Math,\n\t'%Number%': Number,\n\t'%Object%': Object,\n\t'%parseFloat%': parseFloat,\n\t'%parseInt%': parseInt,\n\t'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,\n\t'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,\n\t'%RangeError%': RangeError,\n\t'%ReferenceError%': ReferenceError,\n\t'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,\n\t'%RegExp%': RegExp,\n\t'%Set%': typeof Set === 'undefined' ? undefined : Set,\n\t'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),\n\t'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,\n\t'%String%': String,\n\t'%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,\n\t'%Symbol%': hasSymbols ? Symbol : undefined,\n\t'%SyntaxError%': $SyntaxError,\n\t'%ThrowTypeError%': ThrowTypeError,\n\t'%TypedArray%': TypedArray,\n\t'%TypeError%': $TypeError,\n\t'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,\n\t'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,\n\t'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,\n\t'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,\n\t'%URIError%': URIError,\n\t'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,\n\t'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,\n\t'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet\n};\n\nvar doEval = function doEval(name) {\n\tvar value;\n\tif (name === '%AsyncFunction%') {\n\t\tvalue = getEvalledConstructor('async function () {}');\n\t} else if (name === '%GeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('function* () {}');\n\t} else if (name === '%AsyncGeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('async function* () {}');\n\t} else if (name === '%AsyncGenerator%') {\n\t\tvar fn = doEval('%AsyncGeneratorFunction%');\n\t\tif (fn) {\n\t\t\tvalue = fn.prototype;\n\t\t}\n\t} else if (name === '%AsyncIteratorPrototype%') {\n\t\tvar gen = doEval('%AsyncGenerator%');\n\t\tif (gen) {\n\t\t\tvalue = getProto(gen.prototype);\n\t\t}\n\t}\n\n\tINTRINSICS[name] = value;\n\n\treturn value;\n};\n\nvar LEGACY_ALIASES = {\n\t'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],\n\t'%ArrayPrototype%': ['Array', 'prototype'],\n\t'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],\n\t'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],\n\t'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],\n\t'%ArrayProto_values%': ['Array', 'prototype', 'values'],\n\t'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],\n\t'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],\n\t'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],\n\t'%BooleanPrototype%': ['Boolean', 'prototype'],\n\t'%DataViewPrototype%': ['DataView', 'prototype'],\n\t'%DatePrototype%': ['Date', 'prototype'],\n\t'%ErrorPrototype%': ['Error', 'prototype'],\n\t'%EvalErrorPrototype%': ['EvalError', 'prototype'],\n\t'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],\n\t'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],\n\t'%FunctionPrototype%': ['Function', 'prototype'],\n\t'%Generator%': ['GeneratorFunction', 'prototype'],\n\t'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],\n\t'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],\n\t'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],\n\t'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],\n\t'%JSONParse%': ['JSON', 'parse'],\n\t'%JSONStringify%': ['JSON', 'stringify'],\n\t'%MapPrototype%': ['Map', 'prototype'],\n\t'%NumberPrototype%': ['Number', 'prototype'],\n\t'%ObjectPrototype%': ['Object', 'prototype'],\n\t'%ObjProto_toString%': ['Object', 'prototype', 'toString'],\n\t'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],\n\t'%PromisePrototype%': ['Promise', 'prototype'],\n\t'%PromiseProto_then%': ['Promise', 'prototype', 'then'],\n\t'%Promise_all%': ['Promise', 'all'],\n\t'%Promise_reject%': ['Promise', 'reject'],\n\t'%Promise_resolve%': ['Promise', 'resolve'],\n\t'%RangeErrorPrototype%': ['RangeError', 'prototype'],\n\t'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],\n\t'%RegExpPrototype%': ['RegExp', 'prototype'],\n\t'%SetPrototype%': ['Set', 'prototype'],\n\t'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],\n\t'%StringPrototype%': ['String', 'prototype'],\n\t'%SymbolPrototype%': ['Symbol', 'prototype'],\n\t'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],\n\t'%TypedArrayPrototype%': ['TypedArray', 'prototype'],\n\t'%TypeErrorPrototype%': ['TypeError', 'prototype'],\n\t'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],\n\t'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],\n\t'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],\n\t'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],\n\t'%URIErrorPrototype%': ['URIError', 'prototype'],\n\t'%WeakMapPrototype%': ['WeakMap', 'prototype'],\n\t'%WeakSetPrototype%': ['WeakSet', 'prototype']\n};\n\nvar bind = require('function-bind');\nvar hasOwn = require('has');\nvar $concat = bind.call(Function.call, Array.prototype.concat);\nvar $spliceApply = bind.call(Function.apply, Array.prototype.splice);\nvar $replace = bind.call(Function.call, String.prototype.replace);\nvar $strSlice = bind.call(Function.call, String.prototype.slice);\n\n/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */\nvar rePropName = /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g;\nvar reEscapeChar = /\\\\(\\\\)?/g; /** Used to match backslashes in property paths. */\nvar stringToPath = function stringToPath(string) {\n\tvar first = $strSlice(string, 0, 1);\n\tvar last = $strSlice(string, -1);\n\tif (first === '%' && last !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected closing `%`');\n\t} else if (last === '%' && first !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected opening `%`');\n\t}\n\tvar result = [];\n\t$replace(string, rePropName, function (match, number, quote, subString) {\n\t\tresult[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;\n\t});\n\treturn result;\n};\n/* end adaptation */\n\nvar getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {\n\tvar intrinsicName = name;\n\tvar alias;\n\tif (hasOwn(LEGACY_ALIASES, intrinsicName)) {\n\t\talias = LEGACY_ALIASES[intrinsicName];\n\t\tintrinsicName = '%' + alias[0] + '%';\n\t}\n\n\tif (hasOwn(INTRINSICS, intrinsicName)) {\n\t\tvar value = INTRINSICS[intrinsicName];\n\t\tif (value === needsEval) {\n\t\t\tvalue = doEval(intrinsicName);\n\t\t}\n\t\tif (typeof value === 'undefined' && !allowMissing) {\n\t\t\tthrow new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');\n\t\t}\n\n\t\treturn {\n\t\t\talias: alias,\n\t\t\tname: intrinsicName,\n\t\t\tvalue: value\n\t\t};\n\t}\n\n\tthrow new $SyntaxError('intrinsic ' + name + ' does not exist!');\n};\n\nmodule.exports = function GetIntrinsic(name, allowMissing) {\n\tif (typeof name !== 'string' || name.length === 0) {\n\t\tthrow new $TypeError('intrinsic name must be a non-empty string');\n\t}\n\tif (arguments.length > 1 && typeof allowMissing !== 'boolean') {\n\t\tthrow new $TypeError('\"allowMissing\" argument must be a boolean');\n\t}\n\n\tvar parts = stringToPath(name);\n\tvar intrinsicBaseName = parts.length > 0 ? parts[0] : '';\n\n\tvar intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);\n\tvar intrinsicRealName = intrinsic.name;\n\tvar value = intrinsic.value;\n\tvar skipFurtherCaching = false;\n\n\tvar alias = intrinsic.alias;\n\tif (alias) {\n\t\tintrinsicBaseName = alias[0];\n\t\t$spliceApply(parts, $concat([0, 1], alias));\n\t}\n\n\tfor (var i = 1, isOwn = true; i < parts.length; i += 1) {\n\t\tvar part = parts[i];\n\t\tvar first = $strSlice(part, 0, 1);\n\t\tvar last = $strSlice(part, -1);\n\t\tif (\n\t\t\t(\n\t\t\t\t(first === '\"' || first === \"'\" || first === '`')\n\t\t\t\t|| (last === '\"' || last === \"'\" || last === '`')\n\t\t\t)\n\t\t\t&& first !== last\n\t\t) {\n\t\t\tthrow new $SyntaxError('property names with quotes must have matching quotes');\n\t\t}\n\t\tif (part === 'constructor' || !isOwn) {\n\t\t\tskipFurtherCaching = true;\n\t\t}\n\n\t\tintrinsicBaseName += '.' + part;\n\t\tintrinsicRealName = '%' + intrinsicBaseName + '%';\n\n\t\tif (hasOwn(INTRINSICS, intrinsicRealName)) {\n\t\t\tvalue = INTRINSICS[intrinsicRealName];\n\t\t} else if (value != null) {\n\t\t\tif (!(part in value)) {\n\t\t\t\tif (!allowMissing) {\n\t\t\t\t\tthrow new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');\n\t\t\t\t}\n\t\t\t\treturn void undefined;\n\t\t\t}\n\t\t\tif ($gOPD && (i + 1) >= parts.length) {\n\t\t\t\tvar desc = $gOPD(value, part);\n\t\t\t\tisOwn = !!desc;\n\n\t\t\t\t// By convention, when a data property is converted to an accessor\n\t\t\t\t// property to emulate a data property that does not suffer from\n\t\t\t\t// the override mistake, that accessor's getter is marked with\n\t\t\t\t// an `originalValue` property. Here, when we detect this, we\n\t\t\t\t// uphold the illusion by pretending to see that original data\n\t\t\t\t// property, i.e., returning the value rather than the getter\n\t\t\t\t// itself.\n\t\t\t\tif (isOwn && 'get' in desc && !('originalValue' in desc.get)) {\n\t\t\t\t\tvalue = desc.get;\n\t\t\t\t} else {\n\t\t\t\t\tvalue = value[part];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tisOwn = hasOwn(value, part);\n\t\t\t\tvalue = value[part];\n\t\t\t}\n\n\t\t\tif (isOwn && !skipFurtherCaching) {\n\t\t\t\tINTRINSICS[intrinsicRealName] = value;\n\t\t\t}\n\t\t}\n\t}\n\treturn value;\n};\n","'use strict';\n\nvar origSymbol = typeof Symbol !== 'undefined' && Symbol;\nvar hasSymbolSham = require('./shams');\n\nmodule.exports = function hasNativeSymbols() {\n\tif (typeof origSymbol !== 'function') { return false; }\n\tif (typeof Symbol !== 'function') { return false; }\n\tif (typeof origSymbol('foo') !== 'symbol') { return false; }\n\tif (typeof Symbol('bar') !== 'symbol') { return false; }\n\n\treturn hasSymbolSham();\n};\n","'use strict';\n\n/* eslint complexity: [2, 18], max-statements: [2, 33] */\nmodule.exports = function hasSymbols() {\n\tif (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }\n\tif (typeof Symbol.iterator === 'symbol') { return true; }\n\n\tvar obj = {};\n\tvar sym = Symbol('test');\n\tvar symObj = Object(sym);\n\tif (typeof sym === 'string') { return false; }\n\n\tif (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }\n\tif (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }\n\n\t// temp disabled per https://github.com/ljharb/object.assign/issues/17\n\t// if (sym instanceof Symbol) { return false; }\n\t// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4\n\t// if (!(symObj instanceof Symbol)) { return false; }\n\n\t// if (typeof Symbol.prototype.toString !== 'function') { return false; }\n\t// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }\n\n\tvar symVal = 42;\n\tobj[sym] = symVal;\n\tfor (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop\n\tif (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }\n\n\tif (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }\n\n\tvar syms = Object.getOwnPropertySymbols(obj);\n\tif (syms.length !== 1 || syms[0] !== sym) { return false; }\n\n\tif (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }\n\n\tif (typeof Object.getOwnPropertyDescriptor === 'function') {\n\t\tvar descriptor = Object.getOwnPropertyDescriptor(obj, sym);\n\t\tif (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }\n\t}\n\n\treturn true;\n};\n","'use strict';\n\nvar hasSymbols = require('has-symbols/shams');\n\nmodule.exports = function hasToStringTagShams() {\n\treturn hasSymbols() && !!Symbol.toStringTag;\n};\n","'use strict';\n\nvar bind = require('function-bind');\n\nmodule.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);\n","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n }\n}\n","'use strict';\n\nvar hasToStringTag = require('has-tostringtag/shams')();\nvar callBound = require('call-bind/callBound');\n\nvar $toString = callBound('Object.prototype.toString');\n\nvar isStandardArguments = function isArguments(value) {\n\tif (hasToStringTag && value && typeof value === 'object' && Symbol.toStringTag in value) {\n\t\treturn false;\n\t}\n\treturn $toString(value) === '[object Arguments]';\n};\n\nvar isLegacyArguments = function isArguments(value) {\n\tif (isStandardArguments(value)) {\n\t\treturn true;\n\t}\n\treturn value !== null &&\n\t\ttypeof value === 'object' &&\n\t\ttypeof value.length === 'number' &&\n\t\tvalue.length >= 0 &&\n\t\t$toString(value) !== '[object Array]' &&\n\t\t$toString(value.callee) === '[object Function]';\n};\n\nvar supportsStandardArguments = (function () {\n\treturn isStandardArguments(arguments);\n}());\n\nisStandardArguments.isLegacyArguments = isLegacyArguments; // for tests\n\nmodule.exports = supportsStandardArguments ? isStandardArguments : isLegacyArguments;\n","'use strict';\n\nvar toStr = Object.prototype.toString;\nvar fnToStr = Function.prototype.toString;\nvar isFnRegex = /^\\s*(?:function)?\\*/;\nvar hasToStringTag = require('has-tostringtag/shams')();\nvar getProto = Object.getPrototypeOf;\nvar getGeneratorFunc = function () { // eslint-disable-line consistent-return\n\tif (!hasToStringTag) {\n\t\treturn false;\n\t}\n\ttry {\n\t\treturn Function('return function*() {}')();\n\t} catch (e) {\n\t}\n};\nvar GeneratorFunction;\n\nmodule.exports = function isGeneratorFunction(fn) {\n\tif (typeof fn !== 'function') {\n\t\treturn false;\n\t}\n\tif (isFnRegex.test(fnToStr.call(fn))) {\n\t\treturn true;\n\t}\n\tif (!hasToStringTag) {\n\t\tvar str = toStr.call(fn);\n\t\treturn str === '[object GeneratorFunction]';\n\t}\n\tif (!getProto) {\n\t\treturn false;\n\t}\n\tif (typeof GeneratorFunction === 'undefined') {\n\t\tvar generatorFunc = getGeneratorFunc();\n\t\tGeneratorFunction = generatorFunc ? getProto(generatorFunc) : false;\n\t}\n\treturn getProto(fn) === GeneratorFunction;\n};\n","'use strict';\n\n/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */\n\nmodule.exports = function isNaN(value) {\n\treturn value !== value;\n};\n","'use strict';\n\nvar callBind = require('call-bind');\nvar define = require('define-properties');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar polyfill = callBind(getPolyfill(), Number);\n\n/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */\n\ndefine(polyfill, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = polyfill;\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = function getPolyfill() {\n\tif (Number.isNaN && Number.isNaN(NaN) && !Number.isNaN('a')) {\n\t\treturn Number.isNaN;\n\t}\n\treturn implementation;\n};\n","'use strict';\n\nvar define = require('define-properties');\nvar getPolyfill = require('./polyfill');\n\n/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */\n\nmodule.exports = function shimNumberIsNaN() {\n\tvar polyfill = getPolyfill();\n\tdefine(Number, { isNaN: polyfill }, {\n\t\tisNaN: function testIsNaN() {\n\t\t\treturn Number.isNaN !== polyfill;\n\t\t}\n\t});\n\treturn polyfill;\n};\n","'use strict';\n\nvar forEach = require('foreach');\nvar availableTypedArrays = require('available-typed-arrays');\nvar callBound = require('call-bind/callBound');\n\nvar $toString = callBound('Object.prototype.toString');\nvar hasToStringTag = require('has-tostringtag/shams')();\n\nvar typedArrays = availableTypedArrays();\n\nvar $indexOf = callBound('Array.prototype.indexOf', true) || function indexOf(array, value) {\n\tfor (var i = 0; i < array.length; i += 1) {\n\t\tif (array[i] === value) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n};\nvar $slice = callBound('String.prototype.slice');\nvar toStrTags = {};\nvar gOPD = require('es-abstract/helpers/getOwnPropertyDescriptor');\nvar getPrototypeOf = Object.getPrototypeOf; // require('getprototypeof');\nif (hasToStringTag && gOPD && getPrototypeOf) {\n\tforEach(typedArrays, function (typedArray) {\n\t\tvar arr = new global[typedArray]();\n\t\tif (!(Symbol.toStringTag in arr)) {\n\t\t\tthrow new EvalError('this engine has support for Symbol.toStringTag, but ' + typedArray + ' does not have the property! Please report this.');\n\t\t}\n\t\tvar proto = getPrototypeOf(arr);\n\t\tvar descriptor = gOPD(proto, Symbol.toStringTag);\n\t\tif (!descriptor) {\n\t\t\tvar superProto = getPrototypeOf(proto);\n\t\t\tdescriptor = gOPD(superProto, Symbol.toStringTag);\n\t\t}\n\t\ttoStrTags[typedArray] = descriptor.get;\n\t});\n}\n\nvar tryTypedArrays = function tryAllTypedArrays(value) {\n\tvar anyTrue = false;\n\tforEach(toStrTags, function (getter, typedArray) {\n\t\tif (!anyTrue) {\n\t\t\ttry {\n\t\t\t\tanyTrue = getter.call(value) === typedArray;\n\t\t\t} catch (e) { /**/ }\n\t\t}\n\t});\n\treturn anyTrue;\n};\n\nmodule.exports = function isTypedArray(value) {\n\tif (!value || typeof value !== 'object') { return false; }\n\tif (!hasToStringTag) {\n\t\tvar tag = $slice($toString(value), 8, -1);\n\t\treturn $indexOf(typedArrays, tag) > -1;\n\t}\n\tif (!gOPD) { return false; }\n\treturn tryTypedArrays(value);\n};\n","'use strict';\n\nvar numberIsNaN = function (value) {\n\treturn value !== value;\n};\n\nmodule.exports = function is(a, b) {\n\tif (a === 0 && b === 0) {\n\t\treturn 1 / a === 1 / b;\n\t}\n\tif (a === b) {\n\t\treturn true;\n\t}\n\tif (numberIsNaN(a) && numberIsNaN(b)) {\n\t\treturn true;\n\t}\n\treturn false;\n};\n\n","'use strict';\n\nvar define = require('define-properties');\nvar callBind = require('call-bind');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar polyfill = callBind(getPolyfill(), Object);\n\ndefine(polyfill, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = polyfill;\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = function getPolyfill() {\n\treturn typeof Object.is === 'function' ? Object.is : implementation;\n};\n","'use strict';\n\nvar getPolyfill = require('./polyfill');\nvar define = require('define-properties');\n\nmodule.exports = function shimObjectIs() {\n\tvar polyfill = getPolyfill();\n\tdefine(Object, { is: polyfill }, {\n\t\tis: function testObjectIs() {\n\t\t\treturn Object.is !== polyfill;\n\t\t}\n\t});\n\treturn polyfill;\n};\n","'use strict';\n\nvar keysShim;\nif (!Object.keys) {\n\t// modified from https://github.com/es-shims/es5-shim\n\tvar has = Object.prototype.hasOwnProperty;\n\tvar toStr = Object.prototype.toString;\n\tvar isArgs = require('./isArguments'); // eslint-disable-line global-require\n\tvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\tvar hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');\n\tvar hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');\n\tvar dontEnums = [\n\t\t'toString',\n\t\t'toLocaleString',\n\t\t'valueOf',\n\t\t'hasOwnProperty',\n\t\t'isPrototypeOf',\n\t\t'propertyIsEnumerable',\n\t\t'constructor'\n\t];\n\tvar equalsConstructorPrototype = function (o) {\n\t\tvar ctor = o.constructor;\n\t\treturn ctor && ctor.prototype === o;\n\t};\n\tvar excludedKeys = {\n\t\t$applicationCache: true,\n\t\t$console: true,\n\t\t$external: true,\n\t\t$frame: true,\n\t\t$frameElement: true,\n\t\t$frames: true,\n\t\t$innerHeight: true,\n\t\t$innerWidth: true,\n\t\t$onmozfullscreenchange: true,\n\t\t$onmozfullscreenerror: true,\n\t\t$outerHeight: true,\n\t\t$outerWidth: true,\n\t\t$pageXOffset: true,\n\t\t$pageYOffset: true,\n\t\t$parent: true,\n\t\t$scrollLeft: true,\n\t\t$scrollTop: true,\n\t\t$scrollX: true,\n\t\t$scrollY: true,\n\t\t$self: true,\n\t\t$webkitIndexedDB: true,\n\t\t$webkitStorageInfo: true,\n\t\t$window: true\n\t};\n\tvar hasAutomationEqualityBug = (function () {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined') { return false; }\n\t\tfor (var k in window) {\n\t\t\ttry {\n\t\t\t\tif (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tequalsConstructorPrototype(window[k]);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}());\n\tvar equalsConstructorPrototypeIfNotBuggy = function (o) {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined' || !hasAutomationEqualityBug) {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t}\n\t\ttry {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t};\n\n\tkeysShim = function keys(object) {\n\t\tvar isObject = object !== null && typeof object === 'object';\n\t\tvar isFunction = toStr.call(object) === '[object Function]';\n\t\tvar isArguments = isArgs(object);\n\t\tvar isString = isObject && toStr.call(object) === '[object String]';\n\t\tvar theKeys = [];\n\n\t\tif (!isObject && !isFunction && !isArguments) {\n\t\t\tthrow new TypeError('Object.keys called on a non-object');\n\t\t}\n\n\t\tvar skipProto = hasProtoEnumBug && isFunction;\n\t\tif (isString && object.length > 0 && !has.call(object, 0)) {\n\t\t\tfor (var i = 0; i < object.length; ++i) {\n\t\t\t\ttheKeys.push(String(i));\n\t\t\t}\n\t\t}\n\n\t\tif (isArguments && object.length > 0) {\n\t\t\tfor (var j = 0; j < object.length; ++j) {\n\t\t\t\ttheKeys.push(String(j));\n\t\t\t}\n\t\t} else {\n\t\t\tfor (var name in object) {\n\t\t\t\tif (!(skipProto && name === 'prototype') && has.call(object, name)) {\n\t\t\t\t\ttheKeys.push(String(name));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (hasDontEnumBug) {\n\t\t\tvar skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);\n\n\t\t\tfor (var k = 0; k < dontEnums.length; ++k) {\n\t\t\t\tif (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {\n\t\t\t\t\ttheKeys.push(dontEnums[k]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn theKeys;\n\t};\n}\nmodule.exports = keysShim;\n","'use strict';\n\nvar slice = Array.prototype.slice;\nvar isArgs = require('./isArguments');\n\nvar origKeys = Object.keys;\nvar keysShim = origKeys ? function keys(o) { return origKeys(o); } : require('./implementation');\n\nvar originalKeys = Object.keys;\n\nkeysShim.shim = function shimObjectKeys() {\n\tif (Object.keys) {\n\t\tvar keysWorksWithArguments = (function () {\n\t\t\t// Safari 5.0 bug\n\t\t\tvar args = Object.keys(arguments);\n\t\t\treturn args && args.length === arguments.length;\n\t\t}(1, 2));\n\t\tif (!keysWorksWithArguments) {\n\t\t\tObject.keys = function keys(object) { // eslint-disable-line func-name-matching\n\t\t\t\tif (isArgs(object)) {\n\t\t\t\t\treturn originalKeys(slice.call(object));\n\t\t\t\t}\n\t\t\t\treturn originalKeys(object);\n\t\t\t};\n\t\t}\n\t} else {\n\t\tObject.keys = keysShim;\n\t}\n\treturn Object.keys || keysShim;\n};\n\nmodule.exports = keysShim;\n","'use strict';\n\nvar toStr = Object.prototype.toString;\n\nmodule.exports = function isArguments(value) {\n\tvar str = toStr.call(value);\n\tvar isArgs = str === '[object Arguments]';\n\tif (!isArgs) {\n\t\tisArgs = str !== '[object Array]' &&\n\t\t\tvalue !== null &&\n\t\t\ttypeof value === 'object' &&\n\t\t\ttypeof value.length === 'number' &&\n\t\t\tvalue.length >= 0 &&\n\t\t\ttoStr.call(value.callee) === '[object Function]';\n\t}\n\treturn isArgs;\n};\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","module.exports = function isBuffer(arg) {\n return arg && typeof arg === 'object'\n && typeof arg.copy === 'function'\n && typeof arg.fill === 'function'\n && typeof arg.readUInt8 === 'function';\n}","// Currently in sync with Node.js lib/internal/util/types.js\n// https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9\n\n'use strict';\n\nvar isArgumentsObject = require('is-arguments');\nvar isGeneratorFunction = require('is-generator-function');\nvar whichTypedArray = require('which-typed-array');\nvar isTypedArray = require('is-typed-array');\n\nfunction uncurryThis(f) {\n return f.call.bind(f);\n}\n\nvar BigIntSupported = typeof BigInt !== 'undefined';\nvar SymbolSupported = typeof Symbol !== 'undefined';\n\nvar ObjectToString = uncurryThis(Object.prototype.toString);\n\nvar numberValue = uncurryThis(Number.prototype.valueOf);\nvar stringValue = uncurryThis(String.prototype.valueOf);\nvar booleanValue = uncurryThis(Boolean.prototype.valueOf);\n\nif (BigIntSupported) {\n var bigIntValue = uncurryThis(BigInt.prototype.valueOf);\n}\n\nif (SymbolSupported) {\n var symbolValue = uncurryThis(Symbol.prototype.valueOf);\n}\n\nfunction checkBoxedPrimitive(value, prototypeValueOf) {\n if (typeof value !== 'object') {\n return false;\n }\n try {\n prototypeValueOf(value);\n return true;\n } catch(e) {\n return false;\n }\n}\n\nexports.isArgumentsObject = isArgumentsObject;\nexports.isGeneratorFunction = isGeneratorFunction;\nexports.isTypedArray = isTypedArray;\n\n// Taken from here and modified for better browser support\n// https://github.com/sindresorhus/p-is-promise/blob/cda35a513bda03f977ad5cde3a079d237e82d7ef/index.js\nfunction isPromise(input) {\n\treturn (\n\t\t(\n\t\t\ttypeof Promise !== 'undefined' &&\n\t\t\tinput instanceof Promise\n\t\t) ||\n\t\t(\n\t\t\tinput !== null &&\n\t\t\ttypeof input === 'object' &&\n\t\t\ttypeof input.then === 'function' &&\n\t\t\ttypeof input.catch === 'function'\n\t\t)\n\t);\n}\nexports.isPromise = isPromise;\n\nfunction isArrayBufferView(value) {\n if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) {\n return ArrayBuffer.isView(value);\n }\n\n return (\n isTypedArray(value) ||\n isDataView(value)\n );\n}\nexports.isArrayBufferView = isArrayBufferView;\n\n\nfunction isUint8Array(value) {\n return whichTypedArray(value) === 'Uint8Array';\n}\nexports.isUint8Array = isUint8Array;\n\nfunction isUint8ClampedArray(value) {\n return whichTypedArray(value) === 'Uint8ClampedArray';\n}\nexports.isUint8ClampedArray = isUint8ClampedArray;\n\nfunction isUint16Array(value) {\n return whichTypedArray(value) === 'Uint16Array';\n}\nexports.isUint16Array = isUint16Array;\n\nfunction isUint32Array(value) {\n return whichTypedArray(value) === 'Uint32Array';\n}\nexports.isUint32Array = isUint32Array;\n\nfunction isInt8Array(value) {\n return whichTypedArray(value) === 'Int8Array';\n}\nexports.isInt8Array = isInt8Array;\n\nfunction isInt16Array(value) {\n return whichTypedArray(value) === 'Int16Array';\n}\nexports.isInt16Array = isInt16Array;\n\nfunction isInt32Array(value) {\n return whichTypedArray(value) === 'Int32Array';\n}\nexports.isInt32Array = isInt32Array;\n\nfunction isFloat32Array(value) {\n return whichTypedArray(value) === 'Float32Array';\n}\nexports.isFloat32Array = isFloat32Array;\n\nfunction isFloat64Array(value) {\n return whichTypedArray(value) === 'Float64Array';\n}\nexports.isFloat64Array = isFloat64Array;\n\nfunction isBigInt64Array(value) {\n return whichTypedArray(value) === 'BigInt64Array';\n}\nexports.isBigInt64Array = isBigInt64Array;\n\nfunction isBigUint64Array(value) {\n return whichTypedArray(value) === 'BigUint64Array';\n}\nexports.isBigUint64Array = isBigUint64Array;\n\nfunction isMapToString(value) {\n return ObjectToString(value) === '[object Map]';\n}\nisMapToString.working = (\n typeof Map !== 'undefined' &&\n isMapToString(new Map())\n);\n\nfunction isMap(value) {\n if (typeof Map === 'undefined') {\n return false;\n }\n\n return isMapToString.working\n ? isMapToString(value)\n : value instanceof Map;\n}\nexports.isMap = isMap;\n\nfunction isSetToString(value) {\n return ObjectToString(value) === '[object Set]';\n}\nisSetToString.working = (\n typeof Set !== 'undefined' &&\n isSetToString(new Set())\n);\nfunction isSet(value) {\n if (typeof Set === 'undefined') {\n return false;\n }\n\n return isSetToString.working\n ? isSetToString(value)\n : value instanceof Set;\n}\nexports.isSet = isSet;\n\nfunction isWeakMapToString(value) {\n return ObjectToString(value) === '[object WeakMap]';\n}\nisWeakMapToString.working = (\n typeof WeakMap !== 'undefined' &&\n isWeakMapToString(new WeakMap())\n);\nfunction isWeakMap(value) {\n if (typeof WeakMap === 'undefined') {\n return false;\n }\n\n return isWeakMapToString.working\n ? isWeakMapToString(value)\n : value instanceof WeakMap;\n}\nexports.isWeakMap = isWeakMap;\n\nfunction isWeakSetToString(value) {\n return ObjectToString(value) === '[object WeakSet]';\n}\nisWeakSetToString.working = (\n typeof WeakSet !== 'undefined' &&\n isWeakSetToString(new WeakSet())\n);\nfunction isWeakSet(value) {\n return isWeakSetToString(value);\n}\nexports.isWeakSet = isWeakSet;\n\nfunction isArrayBufferToString(value) {\n return ObjectToString(value) === '[object ArrayBuffer]';\n}\nisArrayBufferToString.working = (\n typeof ArrayBuffer !== 'undefined' &&\n isArrayBufferToString(new ArrayBuffer())\n);\nfunction isArrayBuffer(value) {\n if (typeof ArrayBuffer === 'undefined') {\n return false;\n }\n\n return isArrayBufferToString.working\n ? isArrayBufferToString(value)\n : value instanceof ArrayBuffer;\n}\nexports.isArrayBuffer = isArrayBuffer;\n\nfunction isDataViewToString(value) {\n return ObjectToString(value) === '[object DataView]';\n}\nisDataViewToString.working = (\n typeof ArrayBuffer !== 'undefined' &&\n typeof DataView !== 'undefined' &&\n isDataViewToString(new DataView(new ArrayBuffer(1), 0, 1))\n);\nfunction isDataView(value) {\n if (typeof DataView === 'undefined') {\n return false;\n }\n\n return isDataViewToString.working\n ? isDataViewToString(value)\n : value instanceof DataView;\n}\nexports.isDataView = isDataView;\n\n// Store a copy of SharedArrayBuffer in case it's deleted elsewhere\nvar SharedArrayBufferCopy = typeof SharedArrayBuffer !== 'undefined' ? SharedArrayBuffer : undefined;\nfunction isSharedArrayBufferToString(value) {\n return ObjectToString(value) === '[object SharedArrayBuffer]';\n}\nfunction isSharedArrayBuffer(value) {\n if (typeof SharedArrayBufferCopy === 'undefined') {\n return false;\n }\n\n if (typeof isSharedArrayBufferToString.working === 'undefined') {\n isSharedArrayBufferToString.working = isSharedArrayBufferToString(new SharedArrayBufferCopy());\n }\n\n return isSharedArrayBufferToString.working\n ? isSharedArrayBufferToString(value)\n : value instanceof SharedArrayBufferCopy;\n}\nexports.isSharedArrayBuffer = isSharedArrayBuffer;\n\nfunction isAsyncFunction(value) {\n return ObjectToString(value) === '[object AsyncFunction]';\n}\nexports.isAsyncFunction = isAsyncFunction;\n\nfunction isMapIterator(value) {\n return ObjectToString(value) === '[object Map Iterator]';\n}\nexports.isMapIterator = isMapIterator;\n\nfunction isSetIterator(value) {\n return ObjectToString(value) === '[object Set Iterator]';\n}\nexports.isSetIterator = isSetIterator;\n\nfunction isGeneratorObject(value) {\n return ObjectToString(value) === '[object Generator]';\n}\nexports.isGeneratorObject = isGeneratorObject;\n\nfunction isWebAssemblyCompiledModule(value) {\n return ObjectToString(value) === '[object WebAssembly.Module]';\n}\nexports.isWebAssemblyCompiledModule = isWebAssemblyCompiledModule;\n\nfunction isNumberObject(value) {\n return checkBoxedPrimitive(value, numberValue);\n}\nexports.isNumberObject = isNumberObject;\n\nfunction isStringObject(value) {\n return checkBoxedPrimitive(value, stringValue);\n}\nexports.isStringObject = isStringObject;\n\nfunction isBooleanObject(value) {\n return checkBoxedPrimitive(value, booleanValue);\n}\nexports.isBooleanObject = isBooleanObject;\n\nfunction isBigIntObject(value) {\n return BigIntSupported && checkBoxedPrimitive(value, bigIntValue);\n}\nexports.isBigIntObject = isBigIntObject;\n\nfunction isSymbolObject(value) {\n return SymbolSupported && checkBoxedPrimitive(value, symbolValue);\n}\nexports.isSymbolObject = isSymbolObject;\n\nfunction isBoxedPrimitive(value) {\n return (\n isNumberObject(value) ||\n isStringObject(value) ||\n isBooleanObject(value) ||\n isBigIntObject(value) ||\n isSymbolObject(value)\n );\n}\nexports.isBoxedPrimitive = isBoxedPrimitive;\n\nfunction isAnyArrayBuffer(value) {\n return typeof Uint8Array !== 'undefined' && (\n isArrayBuffer(value) ||\n isSharedArrayBuffer(value)\n );\n}\nexports.isAnyArrayBuffer = isAnyArrayBuffer;\n\n['isProxy', 'isExternal', 'isModuleNamespaceObject'].forEach(function(method) {\n Object.defineProperty(exports, method, {\n enumerable: false,\n value: function() {\n throw new Error(method + ' is not supported in userland');\n }\n });\n});\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors ||\n function getOwnPropertyDescriptors(obj) {\n var keys = Object.keys(obj);\n var descriptors = {};\n for (var i = 0; i < keys.length; i++) {\n descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]);\n }\n return descriptors;\n };\n\nvar formatRegExp = /%[sdj%]/g;\nexports.format = function(f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0; i < arguments.length; i++) {\n objects.push(inspect(arguments[i]));\n }\n return objects.join(' ');\n }\n\n var i = 1;\n var args = arguments;\n var len = args.length;\n var str = String(f).replace(formatRegExp, function(x) {\n if (x === '%%') return '%';\n if (i >= len) return x;\n switch (x) {\n case '%s': return String(args[i++]);\n case '%d': return Number(args[i++]);\n case '%j':\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return '[Circular]';\n }\n default:\n return x;\n }\n });\n for (var x = args[i]; i < len; x = args[++i]) {\n if (isNull(x) || !isObject(x)) {\n str += ' ' + x;\n } else {\n str += ' ' + inspect(x);\n }\n }\n return str;\n};\n\n\n// Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\nexports.deprecate = function(fn, msg) {\n if (typeof process !== 'undefined' && process.noDeprecation === true) {\n return fn;\n }\n\n // Allow for deprecating things in the process of starting up.\n if (typeof process === 'undefined') {\n return function() {\n return exports.deprecate(fn, msg).apply(this, arguments);\n };\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n throw new Error(msg);\n } else if (process.traceDeprecation) {\n console.trace(msg);\n } else {\n console.error(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n};\n\n\nvar debugs = {};\nvar debugEnvRegex = /^$/;\n\nif (process.env.NODE_DEBUG) {\n var debugEnv = process.env.NODE_DEBUG;\n debugEnv = debugEnv.replace(/[|\\\\{}()[\\]^$+?.]/g, '\\\\$&')\n .replace(/\\*/g, '.*')\n .replace(/,/g, '$|^')\n .toUpperCase();\n debugEnvRegex = new RegExp('^' + debugEnv + '$', 'i');\n}\nexports.debuglog = function(set) {\n set = set.toUpperCase();\n if (!debugs[set]) {\n if (debugEnvRegex.test(set)) {\n var pid = process.pid;\n debugs[set] = function() {\n var msg = exports.format.apply(exports, arguments);\n console.error('%s %d: %s', set, pid, msg);\n };\n } else {\n debugs[set] = function() {};\n }\n }\n return debugs[set];\n};\n\n\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */\n/* legacy: obj, showHidden, depth, colors*/\nfunction inspect(obj, opts) {\n // default options\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n // legacy...\n if (arguments.length >= 3) ctx.depth = arguments[2];\n if (arguments.length >= 4) ctx.colors = arguments[3];\n if (isBoolean(opts)) {\n // legacy...\n ctx.showHidden = opts;\n } else if (opts) {\n // got an \"options\" object\n exports._extend(ctx, opts);\n }\n // set default options\n if (isUndefined(ctx.showHidden)) ctx.showHidden = false;\n if (isUndefined(ctx.depth)) ctx.depth = 2;\n if (isUndefined(ctx.colors)) ctx.colors = false;\n if (isUndefined(ctx.customInspect)) ctx.customInspect = true;\n if (ctx.colors) ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}\nexports.inspect = inspect;\n\n\n// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\ninspect.colors = {\n 'bold' : [1, 22],\n 'italic' : [3, 23],\n 'underline' : [4, 24],\n 'inverse' : [7, 27],\n 'white' : [37, 39],\n 'grey' : [90, 39],\n 'black' : [30, 39],\n 'blue' : [34, 39],\n 'cyan' : [36, 39],\n 'green' : [32, 39],\n 'magenta' : [35, 39],\n 'red' : [31, 39],\n 'yellow' : [33, 39]\n};\n\n// Don't use 'blue' not visible on cmd.exe\ninspect.styles = {\n 'special': 'cyan',\n 'number': 'yellow',\n 'boolean': 'yellow',\n 'undefined': 'grey',\n 'null': 'bold',\n 'string': 'green',\n 'date': 'magenta',\n // \"name\": intentionally not styling\n 'regexp': 'red'\n};\n\n\nfunction stylizeWithColor(str, styleType) {\n var style = inspect.styles[styleType];\n\n if (style) {\n return '\\u001b[' + inspect.colors[style][0] + 'm' + str +\n '\\u001b[' + inspect.colors[style][1] + 'm';\n } else {\n return str;\n }\n}\n\n\nfunction stylizeNoColor(str, styleType) {\n return str;\n}\n\n\nfunction arrayToHash(array) {\n var hash = {};\n\n array.forEach(function(val, idx) {\n hash[val] = true;\n });\n\n return hash;\n}\n\n\nfunction formatValue(ctx, value, recurseTimes) {\n // Provide a hook for user-specified inspect functions.\n // Check that value is an object with an inspect function on it\n if (ctx.customInspect &&\n value &&\n isFunction(value.inspect) &&\n // Filter out the util module, it's inspect function is special\n value.inspect !== exports.inspect &&\n // Also filter out any prototype objects using the circular check.\n !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n if (!isString(ret)) {\n ret = formatValue(ctx, ret, recurseTimes);\n }\n return ret;\n }\n\n // Primitive types cannot have properties\n var primitive = formatPrimitive(ctx, value);\n if (primitive) {\n return primitive;\n }\n\n // Look up the keys of the object.\n var keys = Object.keys(value);\n var visibleKeys = arrayToHash(keys);\n\n if (ctx.showHidden) {\n keys = Object.getOwnPropertyNames(value);\n }\n\n // IE doesn't make error fields non-enumerable\n // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n if (isError(value)\n && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {\n return formatError(value);\n }\n\n // Some type of object without properties can be shortcutted.\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name ? ': ' + value.name : '';\n return ctx.stylize('[Function' + name + ']', 'special');\n }\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n }\n if (isDate(value)) {\n return ctx.stylize(Date.prototype.toString.call(value), 'date');\n }\n if (isError(value)) {\n return formatError(value);\n }\n }\n\n var base = '', array = false, braces = ['{', '}'];\n\n // Make Array say that they are Array\n if (isArray(value)) {\n array = true;\n braces = ['[', ']'];\n }\n\n // Make functions say that they are functions\n if (isFunction(value)) {\n var n = value.name ? ': ' + value.name : '';\n base = ' [Function' + n + ']';\n }\n\n // Make RegExps say that they are RegExps\n if (isRegExp(value)) {\n base = ' ' + RegExp.prototype.toString.call(value);\n }\n\n // Make dates with properties first say the date\n if (isDate(value)) {\n base = ' ' + Date.prototype.toUTCString.call(value);\n }\n\n // Make error with message first say the error\n if (isError(value)) {\n base = ' ' + formatError(value);\n }\n\n if (keys.length === 0 && (!array || value.length == 0)) {\n return braces[0] + base + braces[1];\n }\n\n if (recurseTimes < 0) {\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n } else {\n return ctx.stylize('[Object]', 'special');\n }\n }\n\n ctx.seen.push(value);\n\n var output;\n if (array) {\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n } else {\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n }\n\n ctx.seen.pop();\n\n return reduceToSingleString(output, base, braces);\n}\n\n\nfunction formatPrimitive(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize('undefined', 'undefined');\n if (isString(value)) {\n var simple = '\\'' + JSON.stringify(value).replace(/^\"|\"$/g, '')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"') + '\\'';\n return ctx.stylize(simple, 'string');\n }\n if (isNumber(value))\n return ctx.stylize('' + value, 'number');\n if (isBoolean(value))\n return ctx.stylize('' + value, 'boolean');\n // For some reason typeof null is \"object\", so special case here.\n if (isNull(value))\n return ctx.stylize('null', 'null');\n}\n\n\nfunction formatError(value) {\n return '[' + Error.prototype.toString.call(value) + ']';\n}\n\n\nfunction formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length; i < l; ++i) {\n if (hasOwnProperty(value, String(i))) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n String(i), true));\n } else {\n output.push('');\n }\n }\n keys.forEach(function(key) {\n if (!key.match(/^\\d+$/)) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n key, true));\n }\n });\n return output;\n}\n\n\nfunction formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };\n if (desc.get) {\n if (desc.set) {\n str = ctx.stylize('[Getter/Setter]', 'special');\n } else {\n str = ctx.stylize('[Getter]', 'special');\n }\n } else {\n if (desc.set) {\n str = ctx.stylize('[Setter]', 'special');\n }\n }\n if (!hasOwnProperty(visibleKeys, key)) {\n name = '[' + key + ']';\n }\n if (!str) {\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes)) {\n str = formatValue(ctx, desc.value, null);\n } else {\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n }\n if (str.indexOf('\\n') > -1) {\n if (array) {\n str = str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n').substr(2);\n } else {\n str = '\\n' + str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n');\n }\n }\n } else {\n str = ctx.stylize('[Circular]', 'special');\n }\n }\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/)) {\n return str;\n }\n name = JSON.stringify('' + key);\n if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n name = name.substr(1, name.length - 2);\n name = ctx.stylize(name, 'name');\n } else {\n name = name.replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"')\n .replace(/(^\"|\"$)/g, \"'\");\n name = ctx.stylize(name, 'string');\n }\n }\n\n return name + ': ' + str;\n}\n\n\nfunction reduceToSingleString(output, base, braces) {\n var numLinesEst = 0;\n var length = output.reduce(function(prev, cur) {\n numLinesEst++;\n if (cur.indexOf('\\n') >= 0) numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n }, 0);\n\n if (length > 60) {\n return braces[0] +\n (base === '' ? '' : base + '\\n ') +\n ' ' +\n output.join(',\\n ') +\n ' ' +\n braces[1];\n }\n\n return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n}\n\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nexports.types = require('./support/types');\n\nfunction isArray(ar) {\n return Array.isArray(ar);\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return isObject(re) && objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\nexports.types.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return isObject(d) && objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\nexports.types.isDate = isDate;\n\nfunction isError(e) {\n return isObject(e) &&\n (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\nexports.types.isNativeError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = require('./support/isBuffer');\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n\n\nfunction pad(n) {\n return n < 10 ? '0' + n.toString(10) : n.toString(10);\n}\n\n\nvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',\n 'Oct', 'Nov', 'Dec'];\n\n// 26 Feb 16:19:34\nfunction timestamp() {\n var d = new Date();\n var time = [pad(d.getHours()),\n pad(d.getMinutes()),\n pad(d.getSeconds())].join(':');\n return [d.getDate(), months[d.getMonth()], time].join(' ');\n}\n\n\n// log is just a thin wrapper to console.log that prepends a timestamp\nexports.log = function() {\n console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));\n};\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n * prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */\nexports.inherits = require('inherits');\n\nexports._extend = function(origin, add) {\n // Don't do anything if add isn't an object\n if (!add || !isObject(add)) return origin;\n\n var keys = Object.keys(add);\n var i = keys.length;\n while (i--) {\n origin[keys[i]] = add[keys[i]];\n }\n return origin;\n};\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nvar kCustomPromisifiedSymbol = typeof Symbol !== 'undefined' ? Symbol('util.promisify.custom') : undefined;\n\nexports.promisify = function promisify(original) {\n if (typeof original !== 'function')\n throw new TypeError('The \"original\" argument must be of type Function');\n\n if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {\n var fn = original[kCustomPromisifiedSymbol];\n if (typeof fn !== 'function') {\n throw new TypeError('The \"util.promisify.custom\" argument must be of type Function');\n }\n Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn, enumerable: false, writable: false, configurable: true\n });\n return fn;\n }\n\n function fn() {\n var promiseResolve, promiseReject;\n var promise = new Promise(function (resolve, reject) {\n promiseResolve = resolve;\n promiseReject = reject;\n });\n\n var args = [];\n for (var i = 0; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n args.push(function (err, value) {\n if (err) {\n promiseReject(err);\n } else {\n promiseResolve(value);\n }\n });\n\n try {\n original.apply(this, args);\n } catch (err) {\n promiseReject(err);\n }\n\n return promise;\n }\n\n Object.setPrototypeOf(fn, Object.getPrototypeOf(original));\n\n if (kCustomPromisifiedSymbol) Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn, enumerable: false, writable: false, configurable: true\n });\n return Object.defineProperties(\n fn,\n getOwnPropertyDescriptors(original)\n );\n}\n\nexports.promisify.custom = kCustomPromisifiedSymbol\n\nfunction callbackifyOnRejected(reason, cb) {\n // `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M).\n // Because `null` is a special error value in callbacks which means \"no error\n // occurred\", we error-wrap so the callback consumer can distinguish between\n // \"the promise rejected with null\" or \"the promise fulfilled with undefined\".\n if (!reason) {\n var newReason = new Error('Promise was rejected with a falsy value');\n newReason.reason = reason;\n reason = newReason;\n }\n return cb(reason);\n}\n\nfunction callbackify(original) {\n if (typeof original !== 'function') {\n throw new TypeError('The \"original\" argument must be of type Function');\n }\n\n // We DO NOT return the promise as it gives the user a false sense that\n // the promise is actually somehow related to the callback's execution\n // and that the callback throwing will reject the promise.\n function callbackified() {\n var args = [];\n for (var i = 0; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n\n var maybeCb = args.pop();\n if (typeof maybeCb !== 'function') {\n throw new TypeError('The last argument must be of type Function');\n }\n var self = this;\n var cb = function() {\n return maybeCb.apply(self, arguments);\n };\n // In true node style we process the callback on `nextTick` with all the\n // implications (stack, `uncaughtException`, `async_hooks`)\n original.apply(this, args)\n .then(function(ret) { process.nextTick(cb.bind(null, null, ret)) },\n function(rej) { process.nextTick(callbackifyOnRejected.bind(null, rej, cb)) });\n }\n\n Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original));\n Object.defineProperties(callbackified,\n getOwnPropertyDescriptors(original));\n return callbackified;\n}\nexports.callbackify = callbackify;\n","'use strict';\n\nvar forEach = require('foreach');\nvar availableTypedArrays = require('available-typed-arrays');\nvar callBound = require('call-bind/callBound');\n\nvar $toString = callBound('Object.prototype.toString');\nvar hasToStringTag = require('has-tostringtag/shams')();\n\nvar typedArrays = availableTypedArrays();\n\nvar $slice = callBound('String.prototype.slice');\nvar toStrTags = {};\nvar gOPD = require('es-abstract/helpers/getOwnPropertyDescriptor');\nvar getPrototypeOf = Object.getPrototypeOf; // require('getprototypeof');\nif (hasToStringTag && gOPD && getPrototypeOf) {\n\tforEach(typedArrays, function (typedArray) {\n\t\tif (typeof global[typedArray] === 'function') {\n\t\t\tvar arr = new global[typedArray]();\n\t\t\tif (!(Symbol.toStringTag in arr)) {\n\t\t\t\tthrow new EvalError('this engine has support for Symbol.toStringTag, but ' + typedArray + ' does not have the property! Please report this.');\n\t\t\t}\n\t\t\tvar proto = getPrototypeOf(arr);\n\t\t\tvar descriptor = gOPD(proto, Symbol.toStringTag);\n\t\t\tif (!descriptor) {\n\t\t\t\tvar superProto = getPrototypeOf(proto);\n\t\t\t\tdescriptor = gOPD(superProto, Symbol.toStringTag);\n\t\t\t}\n\t\t\ttoStrTags[typedArray] = descriptor.get;\n\t\t}\n\t});\n}\n\nvar tryTypedArrays = function tryAllTypedArrays(value) {\n\tvar foundName = false;\n\tforEach(toStrTags, function (getter, typedArray) {\n\t\tif (!foundName) {\n\t\t\ttry {\n\t\t\t\tvar name = getter.call(value);\n\t\t\t\tif (name === typedArray) {\n\t\t\t\t\tfoundName = name;\n\t\t\t\t}\n\t\t\t} catch (e) {}\n\t\t}\n\t});\n\treturn foundName;\n};\n\nvar isTypedArray = require('is-typed-array');\n\nmodule.exports = function whichTypedArray(value) {\n\tif (!isTypedArray(value)) { return false; }\n\tif (!hasToStringTag) { return $slice($toString(value), 8, -1); }\n\treturn tryTypedArrays(value);\n};\n","'use strict';\n\nvar possibleNames = [\n\t'BigInt64Array',\n\t'BigUint64Array',\n\t'Float32Array',\n\t'Float64Array',\n\t'Int16Array',\n\t'Int32Array',\n\t'Int8Array',\n\t'Uint16Array',\n\t'Uint32Array',\n\t'Uint8Array',\n\t'Uint8ClampedArray'\n];\n\nmodule.exports = function availableTypedArrays() {\n\tvar out = [];\n\tfor (var i = 0; i < possibleNames.length; i++) {\n\t\tif (typeof global[possibleNames[i]] === 'function') {\n\t\t\tout[out.length] = possibleNames[i];\n\t\t}\n\t}\n\treturn out;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%');\nif ($gOPD) {\n\ttry {\n\t\t$gOPD([], 'length');\n\t} catch (e) {\n\t\t// IE 8 has a broken gOPD\n\t\t$gOPD = null;\n\t}\n}\n\nmodule.exports = $gOPD;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"files_videoplayer-\" + chunkId + \".js?v=\" + {\"vendors-node_modules_video_js_dist_video_es_js\":\"f87ebe9feae884a73782\",\"_34aa\":\"ab777726a58732acd0d2\",\"css_style_css\":\"211b329b40ae32bf5d72\",\"vendors-node_modules_video_js_dist_video-js_css\":\"6813c23d9e5029c0233b\"}[chunkId] + \"\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.p = \"/apps/files_videoplayer/js/\";","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"main\": 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tfor(moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) var result = runtime(__webpack_require__);\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkIds[i]] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkfiles_videoplayer\"] = self[\"webpackChunkfiles_videoplayer\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","/**\n * @copyright 2018 Christoph Wurst <christoph@winzerhof-wurst.at>\n *\n * @author 2018 Christoph Wurst <christoph@winzerhof-wurst.at>\n *\n * @license GNU AGPL version 3 or any later version\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport escapeHTML from 'escape-html'\nimport { loadState } from '@nextcloud/initial-state'\n\n__webpack_nonce__ = btoa(OC.requestToken)\n__webpack_public_path__ = OC.filePath('files_videoplayer', '', 'js/')\n\nlet videojs = null\n\nconst { limit } = loadState('files_downloadlimit', 'download_limit', { limit: -1 })\nconst hasDownloadLimit = limit !== -1\n\nconst videoViewer = {\n\tUI: {\n\t\tshow() {\n\t\t\tconst playerView = document.createElement('video')\n\t\t\tplayerView.id = 'my_video_1'\n\t\t\tplayerView.classList.add('video-js')\n\t\t\tplayerView.classList.add('vjs-fill')\n\t\t\tplayerView.classList.add('vjs-big-play-centered')\n\t\t\tplayerView.controls = true\n\t\t\tplayerView.preload = 'auto'\n\t\t\tplayerView.width = '100%'\n\t\t\tplayerView.height = '100%'\n\t\t\tplayerView.poster = OC.filePath('files_videoplayer', '', 'img') + '/poster.png'\n\t\t\tplayerView.setAttribute('data-setup', '{\"techOrder\": [\"html5\"]}')\n\n\t\t\tif (!hasDownloadLimit) {\n\t\t\t\tconst source = document.createElement('source')\n\t\t\t\tsource.src = escapeHTML(videoViewer.location).replace('&amp;', '&')\n\n\t\t\t\tif (videoViewer.mime) {\n\t\t\t\t\tsource.type = escapeHTML(videoViewer.mime)\n\t\t\t\t}\n\n\t\t\t\tplayerView.appendChild(source)\n\t\t\t}\n\n\t\t\tif (videoViewer.inline === null) {\n\t\t\t\tconst overlay = document.createElement('div')\n\t\t\t\toverlay.id = 'videoplayer_overlay'\n\n\t\t\t\tconst outerContainer = document.createElement('div')\n\t\t\t\touterContainer.id = 'videoplayer_outerContainer'\n\n\t\t\t\tconst container = document.createElement('div')\n\t\t\t\tcontainer.id = 'videoplayer_container'\n\n\t\t\t\tconst player = document.createElement('div')\n\t\t\t\tplayer.id = 'videoplayer'\n\n\t\t\t\tcontainer.appendChild(player)\n\t\t\t\touterContainer.appendChild(container)\n\t\t\t\toverlay.appendChild(outerContainer)\n\n\t\t\t\tplayer.appendChild(playerView)\n\t\t\t\tdocument.body.appendChild(overlay)\n\n\t\t\t\t// close when clicking on the overlay\n\t\t\t\toverlay.addEventListener('click', function(e) {\n\t\t\t\t\tif (e.target === this) {\n\t\t\t\t\t\tvideoViewer.hidePlayer()\n\t\t\t\t\t}\n\t\t\t\t})\n\n\t\t\t\tsetTimeout(() => { overlay.className = 'show' }, 0)\n\t\t\t} else {\n\t\t\t\tconst wrapper = document.createElement('div')\n\t\t\t\twrapper.id = 'videoplayer_view'\n\t\t\t\twrapper.appendChild(playerView)\n\t\t\t\tvideoViewer.inline.appendChild(wrapper)\n\t\t\t}\n\t\t\t// initialize player\n\t\t\tvideojs('my_video_1', {\n\t\t\t\tfill: true,\n\t\t\t}).ready(function() {\n\t\t\t\tvideoViewer.player = this\n\t\t\t\tif (videoViewer.inline === null) {\n\t\t\t\t\t// append close button to video element\n\t\t\t\t\tconst closeButton = document.createElement('a')\n\t\t\t\t\tcloseButton.className = 'icon-view-close'\n\t\t\t\t\tcloseButton.id = 'box-close'\n\t\t\t\t\tcloseButton.href = '#'\n\t\t\t\t\tcloseButton.addEventListener('click', function() {\n\t\t\t\t\t\tvideoViewer.hidePlayer()\n\t\t\t\t\t})\n\t\t\t\t\tdocument.getElementById('my_video_1').appendChild(closeButton)\n\t\t\t\t}\n\t\t\t\t// autoplay\n\t\t\t\tif (document.getElementById('body-public') === null) {\n\t\t\t\t\tvideoViewer.player.play()\n\t\t\t\t}\n\t\t\t})\n\n\t\t},\n\t\thide() {\n\t\t\tconst overlay = document.getElementById('videoplayer_overlay')\n\t\t\toverlay.className = ''\n\t\t\tsetTimeout(() => {\n\t\t\t\toverlay.parentElement.removeChild(overlay)\n\t\t\t}, 500)\n\t\t},\n\t},\n\tmime: null,\n\tfile: null,\n\tlocation: null,\n\tplayer: null,\n\tinline: null,\n\tmimeTypes: [\n\t\t'video/mp4',\n\t\t'video/x-m4v',\n\t\t'video/webm',\n\t\t'video/x-flv',\n\t\t'video/ogg',\n\t\t'video/quicktime',\n\t\t'video/x-matroska',\n\t],\n\tmimeTypeAliasses: {\n\t\t'video/x-matroska': 'video/webm', // mkv support for Chrome. webm uses the same container format\n\t},\n\tonView(file, data) {\n\t\tvideoViewer.file = file\n\t\tvideoViewer.dir = data.dir\n\t\tvideoViewer.location = data.fileList.getDownloadUrl(file, videoViewer.dir)\n\t\tvideoViewer.mime = data.$file.attr('data-mime')\n\t\tif (Object.prototype.hasOwnProperty.call(videoViewer.mimeTypeAliasses, videoViewer.mime)) {\n\t\t\tvideoViewer.mime = videoViewer.mimeTypeAliasses[videoViewer.mime]\n\t\t}\n\t\tvideoViewer.showPlayer()\n\t},\n\tonViewInline(element, file, mime) {\n\t\tvideoViewer.location = file\n\t\tvideoViewer.mime = mime\n\t\tif (Object.prototype.hasOwnProperty.call(videoViewer.mimeTypeAliasses, videoViewer.mime)) {\n\t\t\tvideoViewer.mime = videoViewer.mimeTypeAliasses[videoViewer.mime]\n\t\t}\n\t\tvideoViewer.inline = element\n\t\tvideoViewer.showPlayer()\n\t},\n\tshowPlayer() {\n\t\timport('video.js').then((_videojs) => {\n\t\t\tvideojs = _videojs.default\n\t\t\tPromise.all([\n\t\t\t\timport('../css/style.css'),\n\t\t\t\t// eslint-disable-next-line import/no-webpack-loader-syntax\n\t\t\t\timport('video.js/dist/video-js.css'),\n\t\t\t]).then(() => {\n\t\t\t\tvideoViewer.UI.show()\n\t\t\t})\n\t\t})\n\t},\n\thidePlayer() {\n\t\tif (videoViewer.player !== null && videoViewer.player !== false && videoViewer.inline === null) {\n\t\t\tvideoViewer.player.dispose()\n\t\t\tvideoViewer.player = false\n\t\t\tvideoViewer.UI.hide()\n\t\t}\n\t},\n\tlog(message) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.log(message)\n\t},\n}\n\ndocument.addEventListener('DOMContentLoaded', function() {\n\n\t// add event to ESC key\n\tdocument.addEventListener('keyup', function(e) {\n\t\tif ((e.key !== undefined && e.key === 'Escape')\n\t\t\t|| (e.keyCode !== undefined && e.keyCode === 27)) {\n\t\t\tvideoViewer.hidePlayer()\n\t\t}\n\t})\n\n\t// Public page magic\n\tif (document.getElementById('body-public') && document.getElementById('imgframe')) {\n\t\tconst mimetype = document.getElementById('mimetype').value\n\t\tfor (let j = 0; j < videoViewer.mimeTypes.length; ++j) {\n\t\t\tif (videoViewer.mimeTypes[j] === mimetype) {\n\t\t\t\tconst videoUrl = window.location.href.split('?')[0] + '/download'\n\t\t\t\tvideoViewer.onViewInline(document.getElementById('imgframe'), videoUrl, mimetype)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n})\n"],"names":["inProgress","dataWebpackPrefix","exports","app","key","fallback","elem","document","querySelector","concat","undefined","Error","JSON","parse","atob","value","e","_typeof","obj","Symbol","iterator","constructor","prototype","isDeepEqual","isDeepStrictEqual","_require$codes","codes","ERR_AMBIGUOUS_ARGUMENT","ERR_INVALID_ARG_TYPE","ERR_INVALID_ARG_VALUE","ERR_INVALID_RETURN_VALUE","ERR_MISSING_ARGS","AssertionError","inspect","_require$types","isPromise","isRegExp","objectAssign","Object","assign","objectIs","is","Map","lazyLoadComparison","comparison","warned","assert","module","ok","NO_EXCEPTION_SENTINEL","innerFail","message","innerOk","fn","argLen","generatedMessage","err","actual","expected","operator","stackStartFn","_len","arguments","length","args","Array","_key","apply","fail","internalMessage","argsLen","warn","process","emitWarning","console","bind","errArgs","equal","notEqual","deepEqual","notDeepEqual","deepStrictEqual","notDeepStrictEqual","strictEqual","notStrictEqual","Comparison","keys","_this","this","instance","Constructor","TypeError","_classCallCheck","forEach","test","compareExceptionKey","a","b","name","expectedException","msg","push","isPrototypeOf","call","getActual","checkIsPromise","then","catch","waitForActual","promiseFn","Promise","resolve","resultPromise","expectsError","error","details","fnType","expectsNoError","strict","_len6","_key6","throws","_len2","_key2","rejects","_len3","_key3","result","doesNotThrow","_len4","_key4","doesNotReject","_len5","_key5","ifError","newErr","origStack","stack","tmp2","split","shift","tmp1","i","pos","indexOf","slice","join","_defineProperty","defineProperty","enumerable","configurable","writable","_defineProperties","target","props","descriptor","_possibleConstructorReturn","self","_assertThisInitialized","ReferenceError","_wrapNativeSuper","Class","_cache","Function","toString","has","get","set","Wrapper","_construct","_getPrototypeOf","create","_setPrototypeOf","isNativeReflectConstruct","Reflect","construct","sham","Proxy","Date","Parent","o","p","setPrototypeOf","__proto__","getPrototypeOf","endsWith","str","search","this_len","substring","blue","green","red","white","kReadableOperator","strictEqualObject","notStrictEqualObject","notIdentical","copyError","source","inspectValue","val","compact","customInspect","depth","maxArrayLength","Infinity","showHidden","breakLength","showProxy","sorted","getters","createErrDiff","other","res","lastPos","end","skipped","actualInspected","actualLines","expectedLines","indicator","inputLength","stderr","isTTY","columns","count","Math","floor","maxCount","log","repeat","pop","maxLines","max","_actualLines","printedLines","skippedMsg","cur","expectedLine","actualLine","divergingLines","_Error","options","limit","stackTraceLimit","String","getColorDepth","base","_res","knownOperators","code","captureStackTrace","protoProps","staticProps","subClass","superClass","_inherits","custom","recurseTimes","ctx","ownKeys","getOwnPropertySymbols","filter","sym","getOwnPropertyDescriptor","_objectSpread","util","createErrorType","Base","NodeError","_Base","arg1","arg2","arg3","getMessage","oneOf","thing","isArray","len","map","determiner","substr","replace","type","start","includes","reason","inspected","RangeError","input","_slicedToArray","arr","_arrayWithHoles","_arr","_n","_d","_e","_s","_i","next","done","_iterableToArrayLimit","_nonIterableRest","regexFlagsSupported","flags","arrayFromSet","array","arrayFromMap","objectGetOwnPropertySymbols","numberIsNaN","Number","isNaN","uncurryThis","f","hasOwnProperty","propertyIsEnumerable","objectToString","isAnyArrayBuffer","isArrayBufferView","isDate","isMap","isSet","isNativeError","isBoxedPrimitive","isNumberObject","isStringObject","isBooleanObject","isBigIntObject","isSymbolObject","isFloat32Array","isFloat64Array","isNonIndex","charCodeAt","pow","getOwnNonIndexProperties","compare","x","y","min","innerDeepEqual","val1","val2","memos","buf1","buf2","val1Tag","keys1","keys2","keyCheck","getTime","RegExp","byteLength","Uint8Array","buffer","byteOffset","areSimilarTypedArrays","offset","areSimilarFloatArrays","_keys","_keys2","size","valueOf","Boolean","BigInt","isEqualBoxedPrimitive","getEnumerables","k","iterationType","aKeys","bKeys","symbolKeysA","symbolKeysB","_symbolKeysB","position","val2MemoA","val2MemoB","areEq","objEquiv","delete","setHasEqualElement","memo","setValues","findLooseMatchingPrimitives","prim","setMightHaveLoosePrim","altValue","mapMightHaveLoosePrim","item","curB","mapHasEqualEntry","key1","item1","key2","aValues","Set","add","bValues","_val","setEquiv","aEntries","_aEntries$i","item2","bEntries","_i2","_bEntries$_i","mapEquiv","keysA","GetIntrinsic","callBind","$indexOf","allowMissing","intrinsic","$apply","$call","$reflectApply","$gOPD","$defineProperty","$max","originalFunction","func","desc","applyBind","now","times","g","window","functions","label","time","duration","format","object","expression","tuple","global","isCallable","tryToString","argument","isObject","toIndexedObject","toAbsoluteIndex","lengthOfArrayLike","createMethod","IS_INCLUDES","$this","el","fromIndex","O","index","fails","wellKnownSymbol","V8_VERSION","SPECIES","METHOD_NAME","foo","isConstructor","originalArray","C","arraySpeciesConstructor","stringSlice","it","TO_STRING_TAG_SUPPORT","classofRaw","TO_STRING_TAG","CORRECT_ARGUMENTS","tag","tryGet","callee","hasOwn","getOwnPropertyDescriptorModule","definePropertyModule","exceptions","DESCRIPTORS","createPropertyDescriptor","bitmap","toPropertyKey","propertyKey","createNonEnumerableProperty","makeBuiltIn","setGlobal","unsafe","simple","noTargetGet","EXISTS","createElement","getBuiltIn","match","version","userAgent","Deno","versions","v8","defineBuiltIn","copyConstructorProperties","isForced","targetProperty","sourceProperty","TARGET","GLOBAL","STATIC","stat","forced","exec","NATIVE_BIND","FunctionPrototype","getDescriptor","PROPER","CONFIGURABLE","aFunction","namespace","method","aCallable","V","P","check","globalThis","toObject","classof","store","functionToString","inspectSource","NATIVE_WEAK_MAP","shared","sharedKey","hiddenKeys","OBJECT_ALREADY_INITIALIZED","WeakMap","state","wmget","wmhas","wmset","metadata","facade","STATE","enforce","getterFor","TYPE","noop","empty","constructorRegExp","INCORRECT_TO_STRING","isConstructorModern","isConstructorLegacy","called","replacement","feature","detection","data","normalize","POLYFILL","NATIVE","string","toLowerCase","USE_SYMBOL_AS_UID","$Symbol","toLength","CONFIGURABLE_FUNCTION_NAME","InternalStateModule","enforceInternalState","getInternalState","CONFIGURABLE_LENGTH","TEMPLATE","getter","setter","arity","symbol","IE8_DOM_DEFINE","V8_PROTOTYPE_DEFINE_BUG","anObject","$getOwnPropertyDescriptor","ENUMERABLE","WRITABLE","Attributes","current","propertyIsEnumerableModule","internalObjectKeys","getOwnPropertyNames","names","$propertyIsEnumerable","NASHORN_BUG","pref","getOwnPropertyNamesModule","getOwnPropertySymbolsModule","uid","SHARED","IS_PURE","mode","copyright","license","toIntegerOrInfinity","integer","IndexedObject","requireObjectCoercible","ceil","number","isSymbol","getMethod","ordinaryToPrimitive","TO_PRIMITIVE","exoticToPrim","toPrimitive","id","postfix","random","NATIVE_SYMBOL","WellKnownSymbolsStore","symbolFor","createWellKnownSymbol","withoutSetter","description","$","createProperty","arraySpeciesCreate","arrayMethodHasSpeciesSupport","IS_CONCAT_SPREADABLE","MAX_SAFE_INTEGER","MAXIMUM_ALLOWED_INDEX_EXCEEDED","IS_CONCAT_SPREADABLE_SUPPORT","SPECIES_SUPPORT","isConcatSpreadable","spreadable","proto","arg","E","A","n","hasSymbols","toStr","origDefineProperty","supportsDescriptors","_","arePropertyDescriptorsSupported","predicate","defineProperties","predicates","firstSource","to","nextSource","keysArray","nextIndex","nextKey","polyfill","matchHtmlRegExp","escape","html","lastIndex","l","ERROR_MESSAGE","funcType","that","bound","binder","boundLength","boundArgs","Empty","implementation","$SyntaxError","SyntaxError","$Function","$TypeError","getEvalledConstructor","expressionSyntax","throwTypeError","ThrowTypeError","calleeThrows","gOPDthrows","getProto","needsEval","TypedArray","INTRINSICS","AggregateError","ArrayBuffer","Atomics","DataView","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","eval","EvalError","Float32Array","Float64Array","FinalizationRegistry","Int8Array","Int16Array","Int32Array","isFinite","parseFloat","parseInt","SharedArrayBuffer","Uint8ClampedArray","Uint16Array","Uint32Array","URIError","WeakRef","WeakSet","doEval","gen","LEGACY_ALIASES","$concat","$spliceApply","splice","$replace","$strSlice","rePropName","reEscapeChar","stringToPath","first","last","quote","subString","getBaseIntrinsic","alias","intrinsicName","parts","intrinsicBaseName","intrinsicRealName","skipFurtherCaching","isOwn","part","origSymbol","hasSymbolSham","symObj","syms","toStringTag","ctor","superCtor","super_","TempCtor","hasToStringTag","$toString","callBound","isStandardArguments","isLegacyArguments","supportsStandardArguments","GeneratorFunction","fnToStr","isFnRegex","generatorFunc","getGeneratorFunc","define","getPolyfill","shim","NaN","availableTypedArrays","typedArrays","$slice","toStrTags","gOPD","typedArray","superProto","anyTrue","tryTypedArrays","keysShim","isArgs","isEnumerable","hasDontEnumBug","hasProtoEnumBug","dontEnums","equalsConstructorPrototype","excludedKeys","$applicationCache","$console","$external","$frame","$frameElement","$frames","$innerHeight","$innerWidth","$onmozfullscreenchange","$onmozfullscreenerror","$outerHeight","$outerWidth","$pageXOffset","$pageYOffset","$parent","$scrollLeft","$scrollTop","$scrollX","$scrollY","$self","$webkitIndexedDB","$webkitStorageInfo","$window","hasAutomationEqualityBug","isFunction","isArguments","isString","theKeys","skipProto","j","skipConstructor","equalsConstructorPrototypeIfNotBuggy","origKeys","originalKeys","keysWorksWithArguments","cachedSetTimeout","cachedClearTimeout","defaultSetTimout","defaultClearTimeout","runTimeout","fun","setTimeout","clearTimeout","currentQueue","queue","draining","queueIndex","cleanUpNextTick","drainQueue","timeout","run","marker","runClearTimeout","Item","nextTick","title","browser","env","argv","on","addListener","once","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","binding","cwd","chdir","dir","umask","copy","fill","readUInt8","isArgumentsObject","isGeneratorFunction","whichTypedArray","isTypedArray","BigIntSupported","SymbolSupported","ObjectToString","numberValue","stringValue","booleanValue","bigIntValue","symbolValue","checkBoxedPrimitive","prototypeValueOf","isMapToString","isSetToString","isWeakMapToString","isWeakSetToString","isArrayBufferToString","isArrayBuffer","working","isDataViewToString","isDataView","isView","isUint8Array","isUint8ClampedArray","isUint16Array","isUint32Array","isInt8Array","isInt16Array","isInt32Array","isBigInt64Array","isBigUint64Array","isWeakMap","isWeakSet","SharedArrayBufferCopy","isSharedArrayBufferToString","isSharedArrayBuffer","isAsyncFunction","isMapIterator","isSetIterator","isGeneratorObject","isWebAssemblyCompiledModule","getOwnPropertyDescriptors","descriptors","formatRegExp","objects","stringify","isNull","deprecate","noDeprecation","throwDeprecation","traceDeprecation","trace","debugs","debugEnvRegex","NODE_DEBUG","debugEnv","toUpperCase","opts","seen","stylize","stylizeNoColor","colors","isBoolean","_extend","isUndefined","stylizeWithColor","formatValue","styleType","style","styles","ret","primitive","isNumber","formatPrimitive","visibleKeys","hash","idx","arrayToHash","isError","formatError","output","braces","toUTCString","formatProperty","formatArray","reduce","prev","numLinesEst","reduceToSingleString","line","ar","re","d","pad","debuglog","pid","types","isNullOrUndefined","isPrimitive","isBuffer","months","timestamp","getHours","getMinutes","getSeconds","getDate","getMonth","prop","inherits","origin","kCustomPromisifiedSymbol","callbackifyOnRejected","cb","newReason","promisify","original","promiseResolve","promiseReject","promise","reject","callbackify","callbackified","maybeCb","rej","foundName","possibleNames","out","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","m","__esModule","definition","chunkId","all","promises","u","url","script","needAttach","scripts","getElementsByTagName","s","getAttribute","charset","nc","setAttribute","src","onScriptComplete","event","onerror","onload","doneFns","parentNode","removeChild","head","appendChild","r","installedChunks","installedChunkData","errorType","realSrc","request","webpackJsonpCallback","parentChunkLoadingFunction","chunkIds","moreModules","runtime","chunkLoadingGlobal","__webpack_nonce__","btoa","OC","requestToken","__webpack_public_path__","filePath","videojs","hasDownloadLimit","loadState","videoViewer","UI","show","playerView","classList","controls","preload","width","height","poster","escapeHTML","location","mime","inline","overlay","outerContainer","container","player","body","addEventListener","hidePlayer","className","wrapper","ready","closeButton","href","getElementById","play","hide","parentElement","file","mimeTypes","mimeTypeAliasses","onView","fileList","getDownloadUrl","$file","attr","showPlayer","onViewInline","element","_videojs","default","dispose","keyCode","mimetype","videoUrl"],"sourceRoot":""} \ No newline at end of file
diff --git a/js/files_videoplayer-vendors-node_modules_video_js_dist_video-js_css.js.map b/js/files_videoplayer-vendors-node_modules_video_js_dist_video-js_css.js.map
index 8c93194..7485b80 100644
--- a/js/files_videoplayer-vendors-node_modules_video_js_dist_video-js_css.js.map
+++ b/js/files_videoplayer-vendors-node_modules_video_js_dist_video-js_css.js.map
@@ -1 +1 @@
-{"version":3,"file":"files_videoplayer-vendors-node_modules_video_js_dist_video-js_css.js?v=6813c23d9e5029c0233b","mappings":"kMAEIA,E,MAA0B,IAA4B,GAE1DA,EAAwBC,KAAK,CAACC,EAAOC,GAAI,2o3CAAot3C,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,qDAAqD,MAAQ,GAAG,SAAW,8vXAA8vX,eAAiB,CAAC,4o3CAAot3C,WAAa,MAEp1mG,W,SCEAD,EAAOE,QAAU,SAAUC,GACzB,IAAIC,EAAO,GAuDX,OArDAA,EAAKC,SAAW,WACd,OAAOC,KAAKC,KAAI,SAAUC,GACxB,IAAIC,EAsDV,SAAgCD,EAAML,GACpC,IAAIM,EAAUD,EAAK,IAAM,GAErBE,EAAaF,EAAK,GAEtB,IAAKE,EACH,OAAOD,EAGT,GAAIN,GAAgC,mBAATQ,KAAqB,CAC9C,IAAI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AAgBvE,OAAQC,IAAM,CAClD,IAEI2E,EAASzD,EAFKoD,EAAgBtE,IAIK,IAAnCiB,EAAY0D,GAAQ7C,aACtBb,EAAY0D,GAAQ5C,UAEpBd,EAAY2D,OAAOD,EAAQ,IAI/BL,EAAkBI","sources":["webpack:///files_videoplayer/node_modules/video.js/dist/video-js.css","webpack:///files_videoplayer/node_modules/css-loader/dist/runtime/api.js","webpack://files_videoplayer/./node_modules/video.js/dist/video-js.css?658f","webpack:///files_videoplayer/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"],"sourcesContent":["// Imports\nimport ___CSS_LOADER_API_IMPORT___ from \"../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(true);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".video-js .vjs-big-play-button .vjs-icon-placeholder:before, .vjs-button > .vjs-icon-placeholder:before, .video-js .vjs-modal-dialog, .vjs-modal-dialog .vjs-modal-dialog-content {\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%; }\\n\\n.video-js .vjs-big-play-button .vjs-icon-placeholder:before, .vjs-button > .vjs-icon-placeholder:before {\\n text-align: center; }\\n\\n@font-face {\\n font-family: VideoJS;\\n src: url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAABBIAAsAAAAAGoQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAPgAAAFZRiV3RY21hcAAAAYQAAADQAAADIjn098ZnbHlmAAACVAAACv4AABEIAwnSw2hlYWQAAA1UAAAAKwAAADYV1OgpaGhlYQAADYAAAAAbAAAAJA4DByFobXR4AAANnAAAAA8AAACE4AAAAGxvY2EAAA2sAAAARAAAAEQ9NEHGbWF4cAAADfAAAAAfAAAAIAEyAIFuYW1lAAAOEAAAASUAAAIK1cf1oHBvc3QAAA84AAABDwAAAZ5AAl/0eJxjYGRgYOBiMGCwY2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JYArQC4AMwA7AD3gQwBJYE3AUkBWYFigYgBmYGtAbqB1gIEghYCG4IhHicY2BkYGBQZChlYGcAASYg5gJCBob/YD4DABfTAbQAeJxdkE1qg0AYhl8Tk9AIoVDaVSmzahcF87PMARLIMoFAl0ZHY1BHdBJIT9AT9AQ9RQ9Qeqy+yteNMzDzfM+88w0K4BY/cNAMB6N2bUaPPBLukybCLvleeAAPj8JD+hfhMV7hC3u4wxs7OO4NzQSZcI/8Ltwnfwi75E/hAR7wJTyk/xYeY49fYQ/PztM+jbTZ7LY6OWdBJdX/pqs6NYWa+zMxa13oKrA6Uoerqi/JwtpYxZXJ1coUVmeZUWVlTjq0/tHacjmdxuL90OR8O0UEDYMNdtiSEpz5XQGqzlm30kzUdAYFFOb8R7NOZk0q2lwAyz1i7oAr1xoXvrOgtYhZx8wY5KRV269JZ5yGpmzPTjQhvY9je6vEElPOuJP3mWKnP5M3V+YAAAB4nG2PyXLCMBBE3YCNDWEL2ffk7o8S8oCnkCVHC5C/jzBQlUP6IHVPzYyekl5y0iL5X5/ooY8BUmQYIkeBEca4wgRTzDDHAtdY4ga3uMM9HvCIJzzjBa94wzs+8ImvZNAq8TM+HqVkKxWlrQiOxjujQkNlEzyNzl6Z/cU2XF06at7U83VQyklLpEvSnuzsb+HAPnPfQVgaupa1Jlu4sPLsFblcitaz0dHU0ZF1qatjZ1+aTXYCmp6u0gSvWNPyHLtFZ+ZeXWVSaEkqs3T8S74WklbGbNNNq4LL4+CWKtZDv2cfX8l8aFbKFhEnJnJ+IULFpqwoQnNHlHaVQtPBl+ypmbSWdmyC61KS/AKZC3Y+AA==) format(\\\"woff\\\");\\n font-weight: normal;\\n font-style: normal; }\\n\\n.vjs-icon-play, .video-js .vjs-big-play-button .vjs-icon-placeholder:before, .video-js .vjs-play-control .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-play:before, .video-js .vjs-big-play-button .vjs-icon-placeholder:before, .video-js .vjs-play-control .vjs-icon-placeholder:before {\\n content: \\\"\\\\f101\\\"; }\\n\\n.vjs-icon-play-circle {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-play-circle:before {\\n content: \\\"\\\\f102\\\"; }\\n\\n.vjs-icon-pause, .video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-pause:before, .video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before {\\n content: \\\"\\\\f103\\\"; }\\n\\n.vjs-icon-volume-mute, .video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-volume-mute:before, .video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before {\\n content: \\\"\\\\f104\\\"; }\\n\\n.vjs-icon-volume-low, .video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-volume-low:before, .video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before {\\n content: \\\"\\\\f105\\\"; }\\n\\n.vjs-icon-volume-mid, .video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-volume-mid:before, .video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before {\\n content: \\\"\\\\f106\\\"; }\\n\\n.vjs-icon-volume-high, .video-js .vjs-mute-control .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-volume-high:before, .video-js .vjs-mute-control .vjs-icon-placeholder:before {\\n content: \\\"\\\\f107\\\"; }\\n\\n.vjs-icon-fullscreen-enter, .video-js .vjs-fullscreen-control .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-fullscreen-enter:before, .video-js .vjs-fullscreen-control .vjs-icon-placeholder:before {\\n content: \\\"\\\\f108\\\"; }\\n\\n.vjs-icon-fullscreen-exit, .video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-fullscreen-exit:before, .video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before {\\n content: \\\"\\\\f109\\\"; }\\n\\n.vjs-icon-square {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-square:before {\\n content: \\\"\\\\f10a\\\"; }\\n\\n.vjs-icon-spinner {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-spinner:before {\\n content: \\\"\\\\f10b\\\"; }\\n\\n.vjs-icon-subtitles, .video-js .vjs-subtitles-button .vjs-icon-placeholder, .video-js .vjs-subs-caps-button .vjs-icon-placeholder,\\n.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder,\\n.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder,\\n.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder,\\n.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-subtitles:before, .video-js .vjs-subtitles-button .vjs-icon-placeholder:before, .video-js .vjs-subs-caps-button .vjs-icon-placeholder:before,\\n .video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder:before,\\n .video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder:before,\\n .video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder:before,\\n .video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder:before {\\n content: \\\"\\\\f10c\\\"; }\\n\\n.vjs-icon-captions, .video-js .vjs-captions-button .vjs-icon-placeholder, .video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,\\n.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-captions:before, .video-js .vjs-captions-button .vjs-icon-placeholder:before, .video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before,\\n .video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before {\\n content: \\\"\\\\f10d\\\"; }\\n\\n.vjs-icon-chapters, .video-js .vjs-chapters-button .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-chapters:before, .video-js .vjs-chapters-button .vjs-icon-placeholder:before {\\n content: \\\"\\\\f10e\\\"; }\\n\\n.vjs-icon-share {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-share:before {\\n content: \\\"\\\\f10f\\\"; }\\n\\n.vjs-icon-cog {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-cog:before {\\n content: \\\"\\\\f110\\\"; }\\n\\n.vjs-icon-circle, .video-js .vjs-play-progress, .video-js .vjs-volume-level, .vjs-seek-to-live-control .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-circle:before, .video-js .vjs-play-progress:before, .video-js .vjs-volume-level:before, .vjs-seek-to-live-control .vjs-icon-placeholder:before {\\n content: \\\"\\\\f111\\\"; }\\n\\n.vjs-icon-circle-outline {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-circle-outline:before {\\n content: \\\"\\\\f112\\\"; }\\n\\n.vjs-icon-circle-inner-circle {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-circle-inner-circle:before {\\n content: \\\"\\\\f113\\\"; }\\n\\n.vjs-icon-hd {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-hd:before {\\n content: \\\"\\\\f114\\\"; }\\n\\n.vjs-icon-cancel, .video-js .vjs-control.vjs-close-button .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-cancel:before, .video-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before {\\n content: \\\"\\\\f115\\\"; }\\n\\n.vjs-icon-replay, .video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-replay:before, .video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before {\\n content: \\\"\\\\f116\\\"; }\\n\\n.vjs-icon-facebook {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-facebook:before {\\n content: \\\"\\\\f117\\\"; }\\n\\n.vjs-icon-gplus {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-gplus:before {\\n content: \\\"\\\\f118\\\"; }\\n\\n.vjs-icon-linkedin {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-linkedin:before {\\n content: \\\"\\\\f119\\\"; }\\n\\n.vjs-icon-twitter {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-twitter:before {\\n content: \\\"\\\\f11a\\\"; }\\n\\n.vjs-icon-tumblr {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-tumblr:before {\\n content: \\\"\\\\f11b\\\"; }\\n\\n.vjs-icon-pinterest {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-pinterest:before {\\n content: \\\"\\\\f11c\\\"; }\\n\\n.vjs-icon-audio-description, .video-js .vjs-descriptions-button .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-audio-description:before, .video-js .vjs-descriptions-button .vjs-icon-placeholder:before {\\n content: \\\"\\\\f11d\\\"; }\\n\\n.vjs-icon-audio, .video-js .vjs-audio-button .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-audio:before, .video-js .vjs-audio-button .vjs-icon-placeholder:before {\\n content: \\\"\\\\f11e\\\"; }\\n\\n.vjs-icon-next-item {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-next-item:before {\\n content: \\\"\\\\f11f\\\"; }\\n\\n.vjs-icon-previous-item {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-previous-item:before {\\n content: \\\"\\\\f120\\\"; }\\n\\n.video-js {\\n display: block;\\n vertical-align: top;\\n box-sizing: border-box;\\n color: #fff;\\n background-color: #000;\\n position: relative;\\n padding: 0;\\n font-size: 10px;\\n line-height: 1;\\n font-weight: normal;\\n font-style: normal;\\n font-family: Arial, Helvetica, sans-serif;\\n word-break: initial; }\\n .video-js:-moz-full-screen {\\n position: absolute; }\\n .video-js:-webkit-full-screen {\\n width: 100% !important;\\n height: 100% !important; }\\n\\n.video-js[tabindex=\\\"-1\\\"] {\\n outline: none; }\\n\\n.video-js *,\\n.video-js *:before,\\n.video-js *:after {\\n box-sizing: inherit; }\\n\\n.video-js ul {\\n font-family: inherit;\\n font-size: inherit;\\n line-height: inherit;\\n list-style-position: outside;\\n margin-left: 0;\\n margin-right: 0;\\n margin-top: 0;\\n margin-bottom: 0; }\\n\\n.video-js.vjs-fluid,\\n.video-js.vjs-16-9,\\n.video-js.vjs-4-3 {\\n width: 100%;\\n max-width: 100%;\\n height: 0; }\\n\\n.video-js.vjs-16-9 {\\n padding-top: 56.25%; }\\n\\n.video-js.vjs-4-3 {\\n padding-top: 75%; }\\n\\n.video-js.vjs-fill {\\n width: 100%;\\n height: 100%; }\\n\\n.video-js .vjs-tech {\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%; }\\n\\nbody.vjs-full-window {\\n padding: 0;\\n margin: 0;\\n height: 100%; }\\n\\n.vjs-full-window .video-js.vjs-fullscreen {\\n position: fixed;\\n overflow: hidden;\\n z-index: 1000;\\n left: 0;\\n top: 0;\\n bottom: 0;\\n right: 0; }\\n\\n.video-js.vjs-fullscreen {\\n width: 100% !important;\\n height: 100% !important;\\n padding-top: 0 !important; }\\n\\n.video-js.vjs-fullscreen.vjs-user-inactive {\\n cursor: none; }\\n\\n.vjs-hidden {\\n display: none !important; }\\n\\n.vjs-disabled {\\n opacity: 0.5;\\n cursor: default; }\\n\\n.video-js .vjs-offscreen {\\n height: 1px;\\n left: -9999px;\\n position: absolute;\\n top: 0;\\n width: 1px; }\\n\\n.vjs-lock-showing {\\n display: block !important;\\n opacity: 1;\\n visibility: visible; }\\n\\n.vjs-no-js {\\n padding: 20px;\\n color: #fff;\\n background-color: #000;\\n font-size: 18px;\\n font-family: Arial, Helvetica, sans-serif;\\n text-align: center;\\n width: 300px;\\n height: 150px;\\n margin: 0px auto; }\\n\\n.vjs-no-js a,\\n.vjs-no-js a:visited {\\n color: #66A8CC; }\\n\\n.video-js .vjs-big-play-button {\\n font-size: 3em;\\n line-height: 1.5em;\\n height: 1.5em;\\n width: 3em;\\n display: block;\\n position: absolute;\\n top: 10px;\\n left: 10px;\\n padding: 0;\\n cursor: pointer;\\n opacity: 1;\\n border: 0.06666em solid #fff;\\n background-color: #2B333F;\\n background-color: rgba(43, 51, 63, 0.7);\\n border-radius: 0.3em;\\n transition: all 0.4s; }\\n\\n.vjs-big-play-centered .vjs-big-play-button {\\n top: 50%;\\n left: 50%;\\n margin-top: -0.75em;\\n margin-left: -1.5em; }\\n\\n.video-js:hover .vjs-big-play-button,\\n.video-js .vjs-big-play-button:focus {\\n border-color: #fff;\\n background-color: #73859f;\\n background-color: rgba(115, 133, 159, 0.5);\\n transition: all 0s; }\\n\\n.vjs-controls-disabled .vjs-big-play-button,\\n.vjs-has-started .vjs-big-play-button,\\n.vjs-using-native-controls .vjs-big-play-button,\\n.vjs-error .vjs-big-play-button {\\n display: none; }\\n\\n.vjs-has-started.vjs-paused.vjs-show-big-play-button-on-pause .vjs-big-play-button {\\n display: block; }\\n\\n.video-js button {\\n background: none;\\n border: none;\\n color: inherit;\\n display: inline-block;\\n font-size: inherit;\\n line-height: inherit;\\n text-transform: none;\\n text-decoration: none;\\n transition: none;\\n -webkit-appearance: none;\\n -moz-appearance: none;\\n appearance: none; }\\n\\n.vjs-control .vjs-button {\\n width: 100%;\\n height: 100%; }\\n\\n.video-js .vjs-control.vjs-close-button {\\n cursor: pointer;\\n height: 3em;\\n position: absolute;\\n right: 0;\\n top: 0.5em;\\n z-index: 2; }\\n\\n.video-js .vjs-modal-dialog {\\n background: rgba(0, 0, 0, 0.8);\\n background: linear-gradient(180deg, rgba(0, 0, 0, 0.8), rgba(255, 255, 255, 0));\\n overflow: auto; }\\n\\n.video-js .vjs-modal-dialog > * {\\n box-sizing: border-box; }\\n\\n.vjs-modal-dialog .vjs-modal-dialog-content {\\n font-size: 1.2em;\\n line-height: 1.5;\\n padding: 20px 24px;\\n z-index: 1; }\\n\\n.vjs-menu-button {\\n cursor: pointer; }\\n\\n.vjs-menu-button.vjs-disabled {\\n cursor: default; }\\n\\n.vjs-workinghover .vjs-menu-button.vjs-disabled:hover .vjs-menu {\\n display: none; }\\n\\n.vjs-menu .vjs-menu-content {\\n display: block;\\n padding: 0;\\n margin: 0;\\n font-family: Arial, Helvetica, sans-serif;\\n overflow: auto; }\\n\\n.vjs-menu .vjs-menu-content > * {\\n box-sizing: border-box; }\\n\\n.vjs-scrubbing .vjs-control.vjs-menu-button:hover .vjs-menu {\\n display: none; }\\n\\n.vjs-menu li {\\n list-style: none;\\n margin: 0;\\n padding: 0.2em 0;\\n line-height: 1.4em;\\n font-size: 1.2em;\\n text-align: center;\\n text-transform: lowercase; }\\n\\n.vjs-menu li.vjs-menu-item:focus,\\n.vjs-menu li.vjs-menu-item:hover,\\n.js-focus-visible .vjs-menu li.vjs-menu-item:hover {\\n background-color: #73859f;\\n background-color: rgba(115, 133, 159, 0.5); }\\n\\n.vjs-menu li.vjs-selected,\\n.vjs-menu li.vjs-selected:focus,\\n.vjs-menu li.vjs-selected:hover,\\n.js-focus-visible .vjs-menu li.vjs-selected:hover {\\n background-color: #fff;\\n color: #2B333F; }\\n\\n.vjs-menu li.vjs-menu-title {\\n text-align: center;\\n text-transform: uppercase;\\n font-size: 1em;\\n line-height: 2em;\\n padding: 0;\\n margin: 0 0 0.3em 0;\\n font-weight: bold;\\n cursor: default; }\\n\\n.vjs-menu-button-popup .vjs-menu {\\n display: none;\\n position: absolute;\\n bottom: 0;\\n width: 10em;\\n left: -3em;\\n height: 0em;\\n margin-bottom: 1.5em;\\n border-top-color: rgba(43, 51, 63, 0.7); }\\n\\n.vjs-menu-button-popup .vjs-menu .vjs-menu-content {\\n background-color: #2B333F;\\n background-color: rgba(43, 51, 63, 0.7);\\n position: absolute;\\n width: 100%;\\n bottom: 1.5em;\\n max-height: 15em; }\\n\\n.vjs-workinghover .vjs-menu-button-popup:hover .vjs-menu,\\n.vjs-menu-button-popup .vjs-menu.vjs-lock-showing {\\n display: block; }\\n\\n.video-js .vjs-menu-button-inline {\\n transition: all 0.4s;\\n overflow: hidden; }\\n\\n.video-js .vjs-menu-button-inline:before {\\n width: 2.222222222em; }\\n\\n.video-js .vjs-menu-button-inline:hover,\\n.video-js .vjs-menu-button-inline:focus,\\n.video-js .vjs-menu-button-inline.vjs-slider-active,\\n.video-js.vjs-no-flex .vjs-menu-button-inline {\\n width: 12em; }\\n\\n.vjs-menu-button-inline .vjs-menu {\\n opacity: 0;\\n height: 100%;\\n width: auto;\\n position: absolute;\\n left: 4em;\\n top: 0;\\n padding: 0;\\n margin: 0;\\n transition: all 0.4s; }\\n\\n.vjs-menu-button-inline:hover .vjs-menu,\\n.vjs-menu-button-inline:focus .vjs-menu,\\n.vjs-menu-button-inline.vjs-slider-active .vjs-menu {\\n display: block;\\n opacity: 1; }\\n\\n.vjs-no-flex .vjs-menu-button-inline .vjs-menu {\\n display: block;\\n opacity: 1;\\n position: relative;\\n width: auto; }\\n\\n.vjs-no-flex .vjs-menu-button-inline:hover .vjs-menu,\\n.vjs-no-flex .vjs-menu-button-inline:focus .vjs-menu,\\n.vjs-no-flex .vjs-menu-button-inline.vjs-slider-active .vjs-menu {\\n width: auto; }\\n\\n.vjs-menu-button-inline .vjs-menu-content {\\n width: auto;\\n height: 100%;\\n margin: 0;\\n overflow: hidden; }\\n\\n.video-js .vjs-control-bar {\\n display: none;\\n width: 100%;\\n position: absolute;\\n bottom: 0;\\n left: 0;\\n right: 0;\\n height: 3.0em;\\n background-color: #2B333F;\\n background-color: rgba(43, 51, 63, 0.7); }\\n\\n.vjs-has-started .vjs-control-bar {\\n display: flex;\\n visibility: visible;\\n opacity: 1;\\n transition: visibility 0.1s, opacity 0.1s; }\\n\\n.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar {\\n visibility: visible;\\n opacity: 0;\\n transition: visibility 1s, opacity 1s; }\\n\\n.vjs-controls-disabled .vjs-control-bar,\\n.vjs-using-native-controls .vjs-control-bar,\\n.vjs-error .vjs-control-bar {\\n display: none !important; }\\n\\n.vjs-audio.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar {\\n opacity: 1;\\n visibility: visible; }\\n\\n.vjs-has-started.vjs-no-flex .vjs-control-bar {\\n display: table; }\\n\\n.video-js .vjs-control {\\n position: relative;\\n text-align: center;\\n margin: 0;\\n padding: 0;\\n height: 100%;\\n width: 4em;\\n flex: none; }\\n\\n.vjs-button > .vjs-icon-placeholder:before {\\n font-size: 1.8em;\\n line-height: 1.67; }\\n\\n.video-js .vjs-control:focus:before,\\n.video-js .vjs-control:hover:before,\\n.video-js .vjs-control:focus {\\n text-shadow: 0em 0em 1em white; }\\n\\n.video-js .vjs-control-text {\\n border: 0;\\n clip: rect(0 0 0 0);\\n height: 1px;\\n overflow: hidden;\\n padding: 0;\\n position: absolute;\\n width: 1px; }\\n\\n.vjs-no-flex .vjs-control {\\n display: table-cell;\\n vertical-align: middle; }\\n\\n.video-js .vjs-custom-control-spacer {\\n display: none; }\\n\\n.video-js .vjs-progress-control {\\n cursor: pointer;\\n flex: auto;\\n display: flex;\\n align-items: center;\\n min-width: 4em;\\n touch-action: none; }\\n\\n.video-js .vjs-progress-control.disabled {\\n cursor: default; }\\n\\n.vjs-live .vjs-progress-control {\\n display: none; }\\n\\n.vjs-liveui .vjs-progress-control {\\n display: flex;\\n align-items: center; }\\n\\n.vjs-no-flex .vjs-progress-control {\\n width: auto; }\\n\\n.video-js .vjs-progress-holder {\\n flex: auto;\\n transition: all 0.2s;\\n height: 0.3em; }\\n\\n.video-js .vjs-progress-control .vjs-progress-holder {\\n margin: 0 10px; }\\n\\n.video-js .vjs-progress-control:hover .vjs-progress-holder {\\n font-size: 1.666666666666666666em; }\\n\\n.video-js .vjs-progress-control:hover .vjs-progress-holder.disabled {\\n font-size: 1em; }\\n\\n.video-js .vjs-progress-holder .vjs-play-progress,\\n.video-js .vjs-progress-holder .vjs-load-progress,\\n.video-js .vjs-progress-holder .vjs-load-progress div {\\n position: absolute;\\n display: block;\\n height: 100%;\\n margin: 0;\\n padding: 0;\\n width: 0; }\\n\\n.video-js .vjs-play-progress {\\n background-color: #fff; }\\n .video-js .vjs-play-progress:before {\\n font-size: 0.9em;\\n position: absolute;\\n right: -0.5em;\\n top: -0.333333333333333em;\\n z-index: 1; }\\n\\n.video-js .vjs-load-progress {\\n background: rgba(115, 133, 159, 0.5); }\\n\\n.video-js .vjs-load-progress div {\\n background: rgba(115, 133, 159, 0.75); }\\n\\n.video-js .vjs-time-tooltip {\\n background-color: #fff;\\n background-color: rgba(255, 255, 255, 0.8);\\n border-radius: 0.3em;\\n color: #000;\\n float: right;\\n font-family: Arial, Helvetica, sans-serif;\\n font-size: 1em;\\n padding: 6px 8px 8px 8px;\\n pointer-events: none;\\n position: absolute;\\n top: -3.4em;\\n visibility: hidden;\\n z-index: 1; }\\n\\n.video-js .vjs-progress-holder:focus .vjs-time-tooltip {\\n display: none; }\\n\\n.video-js .vjs-progress-control:hover .vjs-time-tooltip,\\n.video-js .vjs-progress-control:hover .vjs-progress-holder:focus .vjs-time-tooltip {\\n display: block;\\n font-size: 0.6em;\\n visibility: visible; }\\n\\n.video-js .vjs-progress-control.disabled:hover .vjs-time-tooltip {\\n font-size: 1em; }\\n\\n.video-js .vjs-progress-control .vjs-mouse-display {\\n display: none;\\n position: absolute;\\n width: 1px;\\n height: 100%;\\n background-color: #000;\\n z-index: 1; }\\n\\n.vjs-no-flex .vjs-progress-control .vjs-mouse-display {\\n z-index: 0; }\\n\\n.video-js .vjs-progress-control:hover .vjs-mouse-display {\\n display: block; }\\n\\n.video-js.vjs-user-inactive .vjs-progress-control .vjs-mouse-display {\\n visibility: hidden;\\n opacity: 0;\\n transition: visibility 1s, opacity 1s; }\\n\\n.video-js.vjs-user-inactive.vjs-no-flex .vjs-progress-control .vjs-mouse-display {\\n display: none; }\\n\\n.vjs-mouse-display .vjs-time-tooltip {\\n color: #fff;\\n background-color: #000;\\n background-color: rgba(0, 0, 0, 0.8); }\\n\\n.video-js .vjs-slider {\\n position: relative;\\n cursor: pointer;\\n padding: 0;\\n margin: 0 0.45em 0 0.45em;\\n /* iOS Safari */\\n -webkit-touch-callout: none;\\n /* Safari */\\n -webkit-user-select: none;\\n /* Konqueror HTML */\\n /* Firefox */\\n -moz-user-select: none;\\n /* Internet Explorer/Edge */\\n -ms-user-select: none;\\n /* Non-prefixed version, currently supported by Chrome and Opera */\\n user-select: none;\\n background-color: #73859f;\\n background-color: rgba(115, 133, 159, 0.5); }\\n\\n.video-js .vjs-slider.disabled {\\n cursor: default; }\\n\\n.video-js .vjs-slider:focus {\\n text-shadow: 0em 0em 1em white;\\n box-shadow: 0 0 1em #fff; }\\n\\n.video-js .vjs-mute-control {\\n cursor: pointer;\\n flex: none; }\\n\\n.video-js .vjs-volume-control {\\n cursor: pointer;\\n margin-right: 1em;\\n display: flex; }\\n\\n.video-js .vjs-volume-control.vjs-volume-horizontal {\\n width: 5em; }\\n\\n.video-js .vjs-volume-panel .vjs-volume-control {\\n visibility: visible;\\n opacity: 0;\\n width: 1px;\\n height: 1px;\\n margin-left: -1px; }\\n\\n.video-js .vjs-volume-panel {\\n transition: width 1s; }\\n .video-js .vjs-volume-panel:hover .vjs-volume-control,\\n .video-js .vjs-volume-panel:active .vjs-volume-control,\\n .video-js .vjs-volume-panel:focus .vjs-volume-control,\\n .video-js .vjs-volume-panel .vjs-volume-control:hover,\\n .video-js .vjs-volume-panel .vjs-volume-control:active,\\n .video-js .vjs-volume-panel .vjs-mute-control:hover ~ .vjs-volume-control,\\n .video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active {\\n visibility: visible;\\n opacity: 1;\\n position: relative;\\n transition: visibility 0.1s, opacity 0.1s, height 0.1s, width 0.1s, left 0s, top 0s; }\\n .video-js .vjs-volume-panel:hover .vjs-volume-control.vjs-volume-horizontal,\\n .video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal,\\n .video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal,\\n .video-js .vjs-volume-panel .vjs-volume-control:hover.vjs-volume-horizontal,\\n .video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-horizontal,\\n .video-js .vjs-volume-panel .vjs-mute-control:hover ~ .vjs-volume-control.vjs-volume-horizontal,\\n .video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-horizontal {\\n width: 5em;\\n height: 3em; }\\n .video-js .vjs-volume-panel:hover .vjs-volume-control.vjs-volume-vertical,\\n .video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical,\\n .video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical,\\n .video-js .vjs-volume-panel .vjs-volume-control:hover.vjs-volume-vertical,\\n .video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical,\\n .video-js .vjs-volume-panel .vjs-mute-control:hover ~ .vjs-volume-control.vjs-volume-vertical,\\n .video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical {\\n left: -3.5em; }\\n .video-js .vjs-volume-panel.vjs-volume-panel-horizontal:hover, .video-js .vjs-volume-panel.vjs-volume-panel-horizontal:active, .video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active {\\n width: 9em;\\n transition: width 0.1s; }\\n .video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-mute-toggle-only {\\n width: 4em; }\\n\\n.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical {\\n height: 8em;\\n width: 3em;\\n left: -3000em;\\n transition: visibility 1s, opacity 1s, height 1s 1s, width 1s 1s, left 1s 1s, top 1s 1s; }\\n\\n.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal {\\n transition: visibility 1s, opacity 1s, height 1s 1s, width 1s, left 1s 1s, top 1s 1s; }\\n\\n.video-js.vjs-no-flex .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal {\\n width: 5em;\\n height: 3em;\\n visibility: visible;\\n opacity: 1;\\n position: relative;\\n transition: none; }\\n\\n.video-js.vjs-no-flex .vjs-volume-control.vjs-volume-vertical,\\n.video-js.vjs-no-flex .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical {\\n position: absolute;\\n bottom: 3em;\\n left: 0.5em; }\\n\\n.video-js .vjs-volume-panel {\\n display: flex; }\\n\\n.video-js .vjs-volume-bar {\\n margin: 1.35em 0.45em; }\\n\\n.vjs-volume-bar.vjs-slider-horizontal {\\n width: 5em;\\n height: 0.3em; }\\n\\n.vjs-volume-bar.vjs-slider-vertical {\\n width: 0.3em;\\n height: 5em;\\n margin: 1.35em auto; }\\n\\n.video-js .vjs-volume-level {\\n position: absolute;\\n bottom: 0;\\n left: 0;\\n background-color: #fff; }\\n .video-js .vjs-volume-level:before {\\n position: absolute;\\n font-size: 0.9em; }\\n\\n.vjs-slider-vertical .vjs-volume-level {\\n width: 0.3em; }\\n .vjs-slider-vertical .vjs-volume-level:before {\\n top: -0.5em;\\n left: -0.3em; }\\n\\n.vjs-slider-horizontal .vjs-volume-level {\\n height: 0.3em; }\\n .vjs-slider-horizontal .vjs-volume-level:before {\\n top: -0.3em;\\n right: -0.5em; }\\n\\n.video-js .vjs-volume-panel.vjs-volume-panel-vertical {\\n width: 4em; }\\n\\n.vjs-volume-bar.vjs-slider-vertical .vjs-volume-level {\\n height: 100%; }\\n\\n.vjs-volume-bar.vjs-slider-horizontal .vjs-volume-level {\\n width: 100%; }\\n\\n.video-js .vjs-volume-vertical {\\n width: 3em;\\n height: 8em;\\n bottom: 8em;\\n background-color: #2B333F;\\n background-color: rgba(43, 51, 63, 0.7); }\\n\\n.video-js .vjs-volume-horizontal .vjs-menu {\\n left: -2em; }\\n\\n.vjs-poster {\\n display: inline-block;\\n vertical-align: middle;\\n background-repeat: no-repeat;\\n background-position: 50% 50%;\\n background-size: contain;\\n background-color: #000000;\\n cursor: pointer;\\n margin: 0;\\n padding: 0;\\n position: absolute;\\n top: 0;\\n right: 0;\\n bottom: 0;\\n left: 0;\\n height: 100%; }\\n\\n.vjs-has-started .vjs-poster {\\n display: none; }\\n\\n.vjs-audio.vjs-has-started .vjs-poster {\\n display: block; }\\n\\n.vjs-using-native-controls .vjs-poster {\\n display: none; }\\n\\n.video-js .vjs-live-control {\\n display: flex;\\n align-items: flex-start;\\n flex: auto;\\n font-size: 1em;\\n line-height: 3em; }\\n\\n.vjs-no-flex .vjs-live-control {\\n display: table-cell;\\n width: auto;\\n text-align: left; }\\n\\n.video-js:not(.vjs-live) .vjs-live-control,\\n.video-js.vjs-liveui .vjs-live-control {\\n display: none; }\\n\\n.video-js .vjs-seek-to-live-control {\\n cursor: pointer;\\n flex: none;\\n display: inline-flex;\\n height: 100%;\\n padding-left: 0.5em;\\n padding-right: 0.5em;\\n font-size: 1em;\\n line-height: 3em;\\n width: auto;\\n min-width: 4em; }\\n\\n.vjs-no-flex .vjs-seek-to-live-control {\\n display: table-cell;\\n width: auto;\\n text-align: left; }\\n\\n.video-js.vjs-live:not(.vjs-liveui) .vjs-seek-to-live-control,\\n.video-js:not(.vjs-live) .vjs-seek-to-live-control {\\n display: none; }\\n\\n.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge {\\n cursor: auto; }\\n\\n.vjs-seek-to-live-control .vjs-icon-placeholder {\\n margin-right: 0.5em;\\n color: #888; }\\n\\n.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-icon-placeholder {\\n color: red; }\\n\\n.video-js .vjs-time-control {\\n flex: none;\\n font-size: 1em;\\n line-height: 3em;\\n min-width: 2em;\\n width: auto;\\n padding-left: 1em;\\n padding-right: 1em; }\\n\\n.vjs-live .vjs-time-control {\\n display: none; }\\n\\n.video-js .vjs-current-time,\\n.vjs-no-flex .vjs-current-time {\\n display: none; }\\n\\n.video-js .vjs-duration,\\n.vjs-no-flex .vjs-duration {\\n display: none; }\\n\\n.vjs-time-divider {\\n display: none;\\n line-height: 3em; }\\n\\n.vjs-live .vjs-time-divider {\\n display: none; }\\n\\n.video-js .vjs-play-control {\\n cursor: pointer; }\\n\\n.video-js .vjs-play-control .vjs-icon-placeholder {\\n flex: none; }\\n\\n.vjs-text-track-display {\\n position: absolute;\\n bottom: 3em;\\n left: 0;\\n right: 0;\\n top: 0;\\n pointer-events: none; }\\n\\n.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display {\\n bottom: 1em; }\\n\\n.video-js .vjs-text-track {\\n font-size: 1.4em;\\n text-align: center;\\n margin-bottom: 0.1em; }\\n\\n.vjs-subtitles {\\n color: #fff; }\\n\\n.vjs-captions {\\n color: #fc6; }\\n\\n.vjs-tt-cue {\\n display: block; }\\n\\nvideo::-webkit-media-text-track-display {\\n -webkit-transform: translateY(-3em);\\n transform: translateY(-3em); }\\n\\n.video-js.vjs-user-inactive.vjs-playing video::-webkit-media-text-track-display {\\n -webkit-transform: translateY(-1.5em);\\n transform: translateY(-1.5em); }\\n\\n.video-js .vjs-fullscreen-control {\\n cursor: pointer;\\n flex: none; }\\n\\n.vjs-playback-rate > .vjs-menu-button,\\n.vjs-playback-rate .vjs-playback-rate-value {\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%; }\\n\\n.vjs-playback-rate .vjs-playback-rate-value {\\n pointer-events: none;\\n font-size: 1.5em;\\n line-height: 2;\\n text-align: center; }\\n\\n.vjs-playback-rate .vjs-menu {\\n width: 4em;\\n left: 0em; }\\n\\n.vjs-error .vjs-error-display .vjs-modal-dialog-content {\\n font-size: 1.4em;\\n text-align: center; }\\n\\n.vjs-error .vjs-error-display:before {\\n color: #fff;\\n content: 'X';\\n font-family: Arial, Helvetica, sans-serif;\\n font-size: 4em;\\n left: 0;\\n line-height: 1;\\n margin-top: -0.5em;\\n position: absolute;\\n text-shadow: 0.05em 0.05em 0.1em #000;\\n text-align: center;\\n top: 50%;\\n vertical-align: middle;\\n width: 100%; }\\n\\n.vjs-loading-spinner {\\n display: none;\\n position: absolute;\\n top: 50%;\\n left: 50%;\\n margin: -25px 0 0 -25px;\\n opacity: 0.85;\\n text-align: left;\\n border: 6px solid rgba(43, 51, 63, 0.7);\\n box-sizing: border-box;\\n background-clip: padding-box;\\n width: 50px;\\n height: 50px;\\n border-radius: 25px;\\n visibility: hidden; }\\n\\n.vjs-seeking .vjs-loading-spinner,\\n.vjs-waiting .vjs-loading-spinner {\\n display: block;\\n -webkit-animation: 0s linear 0.3s forwards vjs-spinner-show;\\n animation: 0s linear 0.3s forwards vjs-spinner-show; }\\n\\n.vjs-loading-spinner:before,\\n.vjs-loading-spinner:after {\\n content: \\\"\\\";\\n position: absolute;\\n margin: -6px;\\n box-sizing: inherit;\\n width: inherit;\\n height: inherit;\\n border-radius: inherit;\\n opacity: 1;\\n border: inherit;\\n border-color: transparent;\\n border-top-color: white; }\\n\\n.vjs-seeking .vjs-loading-spinner:before,\\n.vjs-seeking .vjs-loading-spinner:after,\\n.vjs-waiting .vjs-loading-spinner:before,\\n.vjs-waiting .vjs-loading-spinner:after {\\n -webkit-animation: vjs-spinner-spin 1.1s cubic-bezier(0.6, 0.2, 0, 0.8) infinite, vjs-spinner-fade 1.1s linear infinite;\\n animation: vjs-spinner-spin 1.1s cubic-bezier(0.6, 0.2, 0, 0.8) infinite, vjs-spinner-fade 1.1s linear infinite; }\\n\\n.vjs-seeking .vjs-loading-spinner:before,\\n.vjs-waiting .vjs-loading-spinner:before {\\n border-top-color: white; }\\n\\n.vjs-seeking .vjs-loading-spinner:after,\\n.vjs-waiting .vjs-loading-spinner:after {\\n border-top-color: white;\\n -webkit-animation-delay: 0.44s;\\n animation-delay: 0.44s; }\\n\\n@keyframes vjs-spinner-show {\\n to {\\n visibility: visible; } }\\n\\n@-webkit-keyframes vjs-spinner-show {\\n to {\\n visibility: visible; } }\\n\\n@keyframes vjs-spinner-spin {\\n 100% {\\n -webkit-transform: rotate(360deg);\\n transform: rotate(360deg); } }\\n\\n@-webkit-keyframes vjs-spinner-spin {\\n 100% {\\n -webkit-transform: rotate(360deg); } }\\n\\n@keyframes vjs-spinner-fade {\\n 0% {\\n border-top-color: #73859f; }\\n 20% {\\n border-top-color: #73859f; }\\n 35% {\\n border-top-color: white; }\\n 60% {\\n border-top-color: #73859f; }\\n 100% {\\n border-top-color: #73859f; } }\\n\\n@-webkit-keyframes vjs-spinner-fade {\\n 0% {\\n border-top-color: #73859f; }\\n 20% {\\n border-top-color: #73859f; }\\n 35% {\\n border-top-color: white; }\\n 60% {\\n border-top-color: #73859f; }\\n 100% {\\n border-top-color: #73859f; } }\\n\\n.vjs-chapters-button .vjs-menu ul {\\n width: 24em; }\\n\\n.video-js .vjs-subs-caps-button + .vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder {\\n vertical-align: middle;\\n display: inline-block;\\n margin-bottom: -0.1em; }\\n\\n.video-js .vjs-subs-caps-button + .vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before {\\n font-family: VideoJS;\\n content: \\\"\\\\f10d\\\";\\n font-size: 1.5em;\\n line-height: inherit; }\\n\\n.video-js .vjs-audio-button + .vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder {\\n vertical-align: middle;\\n display: inline-block;\\n margin-bottom: -0.1em; }\\n\\n.video-js .vjs-audio-button + .vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before {\\n font-family: VideoJS;\\n content: \\\" \\\\f11d\\\";\\n font-size: 1.5em;\\n line-height: inherit; }\\n\\n.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-custom-control-spacer {\\n flex: auto;\\n display: block; }\\n\\n.video-js.vjs-layout-tiny:not(.vjs-fullscreen).vjs-no-flex .vjs-custom-control-spacer {\\n width: auto; }\\n\\n.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-current-time, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-time-divider, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-duration, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-remaining-time,\\n.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-playback-rate, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-progress-control,\\n.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-mute-control, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-volume-control, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-volume-panel,\\n.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-chapters-button, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-descriptions-button, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-captions-button,\\n.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-subtitles-button, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-subs-caps-button, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-audio-button {\\n display: none; }\\n\\n.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-current-time, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-time-divider, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-duration, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-remaining-time,\\n.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-playback-rate,\\n.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-mute-control, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-volume-control, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-volume-panel,\\n.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-chapters-button, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-descriptions-button, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-captions-button,\\n.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-subtitles-button, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-subs-caps-button, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-audio-button {\\n display: none; }\\n\\n.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-current-time, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-time-divider, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-duration, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-remaining-time,\\n.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-playback-rate,\\n.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-mute-control, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-volume-control, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-volume-panel,\\n.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-chapters-button, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-descriptions-button, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-captions-button,\\n.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-subtitles-button, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-audio-button {\\n display: none; }\\n\\n.vjs-modal-dialog.vjs-text-track-settings {\\n background-color: #2B333F;\\n background-color: rgba(43, 51, 63, 0.75);\\n color: #fff;\\n height: 70%; }\\n\\n.vjs-text-track-settings .vjs-modal-dialog-content {\\n display: table; }\\n\\n.vjs-text-track-settings .vjs-track-settings-colors,\\n.vjs-text-track-settings .vjs-track-settings-font,\\n.vjs-text-track-settings .vjs-track-settings-controls {\\n display: table-cell; }\\n\\n.vjs-text-track-settings .vjs-track-settings-controls {\\n text-align: right;\\n vertical-align: bottom; }\\n\\n@supports (display: grid) {\\n .vjs-text-track-settings .vjs-modal-dialog-content {\\n display: grid;\\n grid-template-columns: 1fr 1fr;\\n grid-template-rows: 1fr;\\n padding: 20px 24px 0px 24px; }\\n .vjs-track-settings-controls .vjs-default-button {\\n margin-bottom: 20px; }\\n .vjs-text-track-settings .vjs-track-settings-controls {\\n grid-column: 1 / -1; }\\n .vjs-layout-small .vjs-text-track-settings .vjs-modal-dialog-content,\\n .vjs-layout-x-small .vjs-text-track-settings .vjs-modal-dialog-content,\\n .vjs-layout-tiny .vjs-text-track-settings .vjs-modal-dialog-content {\\n grid-template-columns: 1fr; } }\\n\\n.vjs-track-setting > select {\\n margin-right: 1em;\\n margin-bottom: 0.5em; }\\n\\n.vjs-text-track-settings fieldset {\\n margin: 5px;\\n padding: 3px;\\n border: none; }\\n\\n.vjs-text-track-settings fieldset span {\\n display: inline-block; }\\n\\n.vjs-text-track-settings fieldset span > select {\\n max-width: 7.3em; }\\n\\n.vjs-text-track-settings legend {\\n color: #fff;\\n margin: 0 0 5px 0; }\\n\\n.vjs-text-track-settings .vjs-label {\\n position: absolute;\\n clip: rect(1px 1px 1px 1px);\\n clip: rect(1px, 1px, 1px, 1px);\\n display: block;\\n margin: 0 0 5px 0;\\n padding: 0;\\n border: 0;\\n height: 1px;\\n width: 1px;\\n overflow: hidden; }\\n\\n.vjs-track-settings-controls button:focus,\\n.vjs-track-settings-controls button:active {\\n outline-style: solid;\\n outline-width: medium;\\n background-image: linear-gradient(0deg, #fff 88%, #73859f 100%); }\\n\\n.vjs-track-settings-controls button:hover {\\n color: rgba(43, 51, 63, 0.75); }\\n\\n.vjs-track-settings-controls button {\\n background-color: #fff;\\n background-image: linear-gradient(-180deg, #fff 88%, #73859f 100%);\\n color: #2B333F;\\n cursor: pointer;\\n border-radius: 2px; }\\n\\n.vjs-track-settings-controls .vjs-default-button {\\n margin-right: 1em; }\\n\\n@media print {\\n .video-js > *:not(.vjs-tech):not(.vjs-poster) {\\n visibility: hidden; } }\\n\\n.vjs-resize-manager {\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%;\\n border: none;\\n z-index: -1000; }\\n\\n.js-focus-visible .video-js *:focus:not(.focus-visible) {\\n outline: none;\\n background: none; }\\n\\n.video-js *:focus:not(:focus-visible),\\n.video-js .vjs-menu *:focus:not(:focus-visible) {\\n outline: none;\\n background: none; }\\n\", \"\",{\"version\":3,\"sources\":[\"webpack://node_modules/video.js/dist/video-js.css\"],\"names\":[],\"mappings\":\"AAAA;EACE,kBAAkB;EAClB,MAAM;EACN,OAAO;EACP,WAAW;EACX,YAAY,EAAE;;AAEhB;EACE,kBAAkB,EAAE;;AAEtB;EACE,oBAAoB;EACpB,igLAAigL;EACjgL,mBAAmB;EACnB,kBAAkB,EAAE;;AAEtB;EACE,oBAAoB;EACpB,mBAAmB;EACnB,kBAAkB,EAAE;EACpB;IACE,gBAAgB,EAAE;;AAEtB;EACE,oBAAoB;EACpB,mBAAmB;EACnB,kBAAkB,EAAE;EACpB;IACE,gBAAgB,EAAE;;AAEtB;EACE,oBAAoB;EACpB,mBAAmB;EACnB,kBAAkB,EAAE;EACpB;IACE,gBAAgB,EAAE;;AAEtB;EACE,oBAAoB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ACE,mBAAmB,EAAE;EACvB;IACE,mBAAmB,EAAE;EACvB;;;IAGE,0BAA0B,EAAE,EAAE;;AAElC;EACE,iBAAiB;EACjB,oBAAoB,EAAE;;AAExB;EACE,WAAW;EACX,YAAY;EACZ,YAAY,EAAE;;AAEhB;EACE,qBAAqB,EAAE;;AAEzB;EACE,gBAAgB,EAAE;;AAEpB;EACE,WAAW;EACX,iBAAiB,EAAE;;AAErB;EACE,kBAAkB;EAClB,2BAA2B;EAC3B,8BAA8B;EAC9B,cAAc;EACd,iBAAiB;EACjB,UAAU;EACV,SAAS;EACT,WAAW;EACX,UAAU;EACV,gBAAgB,EAAE;;AAEpB;;EAEE,oBAAoB;EACpB,qBAAqB;EACrB,+DAA+D,EAAE;;AAEnE;EACE,6BAA6B,EAAE;;AAEjC;EACE,sBAAsB;EACtB,kEAAkE;EAClE,cAAc;EACd,eAAe;EACf,kBAAkB,EAAE;;AAEtB;EACE,iBAAiB,EAAE;;AAErB;EACE;IACE,kBAAkB,EAAE,EAAE;;AAE1B;EACE,kBAAkB;EAClB,MAAM;EACN,OAAO;EACP,WAAW;EACX,YAAY;EACZ,YAAY;EACZ,cAAc,EAAE;;AAElB;EACE,aAAa;EACb,gBAAgB,EAAE;;AAEpB;;EAEE,aAAa;EACb,gBAAgB,EAAE\",\"sourcesContent\":[\".video-js .vjs-big-play-button .vjs-icon-placeholder:before, .vjs-button > .vjs-icon-placeholder:before, .video-js .vjs-modal-dialog, .vjs-modal-dialog .vjs-modal-dialog-content {\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%; }\\n\\n.video-js .vjs-big-play-button .vjs-icon-placeholder:before, .vjs-button > .vjs-icon-placeholder:before {\\n text-align: center; }\\n\\n@font-face {\\n font-family: VideoJS;\\n src: url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAABBIAAsAAAAAGoQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEA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fX8l8aFbKFhEnJnJ+IULFpqwoQnNHlHaVQtPBl+ypmbSWdmyC61KS/AKZC3Y+AA==) format(\\\"woff\\\");\\n font-weight: normal;\\n font-style: normal; }\\n\\n.vjs-icon-play, .video-js .vjs-big-play-button .vjs-icon-placeholder:before, .video-js .vjs-play-control .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-play:before, .video-js .vjs-big-play-button .vjs-icon-placeholder:before, .video-js .vjs-play-control .vjs-icon-placeholder:before {\\n content: \\\"\\\\f101\\\"; }\\n\\n.vjs-icon-play-circle {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-play-circle:before {\\n content: \\\"\\\\f102\\\"; }\\n\\n.vjs-icon-pause, .video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-pause:before, .video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before {\\n content: \\\"\\\\f103\\\"; }\\n\\n.vjs-icon-volume-mute, .video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-volume-mute:before, .video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before {\\n content: \\\"\\\\f104\\\"; }\\n\\n.vjs-icon-volume-low, .video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-volume-low:before, .video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before {\\n content: \\\"\\\\f105\\\"; }\\n\\n.vjs-icon-volume-mid, .video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-volume-mid:before, .video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before {\\n content: \\\"\\\\f106\\\"; }\\n\\n.vjs-icon-volume-high, .video-js .vjs-mute-control .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-volume-high:before, .video-js .vjs-mute-control .vjs-icon-placeholder:before {\\n content: \\\"\\\\f107\\\"; }\\n\\n.vjs-icon-fullscreen-enter, .video-js .vjs-fullscreen-control .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-fullscreen-enter:before, .video-js .vjs-fullscreen-control .vjs-icon-placeholder:before {\\n content: \\\"\\\\f108\\\"; }\\n\\n.vjs-icon-fullscreen-exit, .video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-fullscreen-exit:before, .video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before {\\n content: \\\"\\\\f109\\\"; }\\n\\n.vjs-icon-square {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-square:before {\\n content: \\\"\\\\f10a\\\"; }\\n\\n.vjs-icon-spinner {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-spinner:before {\\n content: \\\"\\\\f10b\\\"; }\\n\\n.vjs-icon-subtitles, .video-js .vjs-subtitles-button .vjs-icon-placeholder, .video-js .vjs-subs-caps-button .vjs-icon-placeholder,\\n.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder,\\n.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder,\\n.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder,\\n.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-subtitles:before, .video-js .vjs-subtitles-button .vjs-icon-placeholder:before, .video-js .vjs-subs-caps-button .vjs-icon-placeholder:before,\\n .video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder:before,\\n .video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder:before,\\n .video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder:before,\\n .video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder:before {\\n content: \\\"\\\\f10c\\\"; }\\n\\n.vjs-icon-captions, .video-js .vjs-captions-button .vjs-icon-placeholder, .video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,\\n.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-captions:before, .video-js .vjs-captions-button .vjs-icon-placeholder:before, .video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before,\\n .video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before {\\n content: \\\"\\\\f10d\\\"; }\\n\\n.vjs-icon-chapters, .video-js .vjs-chapters-button .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-chapters:before, .video-js .vjs-chapters-button .vjs-icon-placeholder:before {\\n content: \\\"\\\\f10e\\\"; }\\n\\n.vjs-icon-share {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-share:before {\\n content: \\\"\\\\f10f\\\"; }\\n\\n.vjs-icon-cog {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-cog:before {\\n content: \\\"\\\\f110\\\"; }\\n\\n.vjs-icon-circle, .video-js .vjs-play-progress, .video-js .vjs-volume-level, .vjs-seek-to-live-control .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-circle:before, .video-js .vjs-play-progress:before, .video-js .vjs-volume-level:before, .vjs-seek-to-live-control .vjs-icon-placeholder:before {\\n content: \\\"\\\\f111\\\"; }\\n\\n.vjs-icon-circle-outline {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-circle-outline:before {\\n content: \\\"\\\\f112\\\"; }\\n\\n.vjs-icon-circle-inner-circle {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-circle-inner-circle:before {\\n content: \\\"\\\\f113\\\"; }\\n\\n.vjs-icon-hd {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-hd:before {\\n content: \\\"\\\\f114\\\"; }\\n\\n.vjs-icon-cancel, .video-js .vjs-control.vjs-close-button .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-cancel:before, .video-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before {\\n content: \\\"\\\\f115\\\"; }\\n\\n.vjs-icon-replay, .video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-replay:before, .video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before {\\n content: \\\"\\\\f116\\\"; }\\n\\n.vjs-icon-facebook {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-facebook:before {\\n content: \\\"\\\\f117\\\"; }\\n\\n.vjs-icon-gplus {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-gplus:before {\\n content: \\\"\\\\f118\\\"; }\\n\\n.vjs-icon-linkedin {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-linkedin:before {\\n content: \\\"\\\\f119\\\"; }\\n\\n.vjs-icon-twitter {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-twitter:before {\\n content: \\\"\\\\f11a\\\"; }\\n\\n.vjs-icon-tumblr {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-tumblr:before {\\n content: \\\"\\\\f11b\\\"; }\\n\\n.vjs-icon-pinterest {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-pinterest:before {\\n content: \\\"\\\\f11c\\\"; }\\n\\n.vjs-icon-audio-description, .video-js .vjs-descriptions-button .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-audio-description:before, .video-js .vjs-descriptions-button .vjs-icon-placeholder:before {\\n content: \\\"\\\\f11d\\\"; }\\n\\n.vjs-icon-audio, .video-js .vjs-audio-button .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-audio:before, .video-js .vjs-audio-button .vjs-icon-placeholder:before {\\n content: \\\"\\\\f11e\\\"; }\\n\\n.vjs-icon-next-item {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-next-item:before {\\n content: \\\"\\\\f11f\\\"; }\\n\\n.vjs-icon-previous-item {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-previous-item:before {\\n content: \\\"\\\\f120\\\"; }\\n\\n.video-js {\\n display: block;\\n vertical-align: top;\\n box-sizing: border-box;\\n color: #fff;\\n background-color: #000;\\n position: relative;\\n padding: 0;\\n font-size: 10px;\\n line-height: 1;\\n font-weight: normal;\\n font-style: normal;\\n font-family: Arial, Helvetica, sans-serif;\\n word-break: initial; }\\n .video-js:-moz-full-screen {\\n position: absolute; }\\n .video-js:-webkit-full-screen {\\n width: 100% !important;\\n height: 100% !important; }\\n\\n.video-js[tabindex=\\\"-1\\\"] {\\n outline: none; }\\n\\n.video-js *,\\n.video-js *:before,\\n.video-js *:after {\\n box-sizing: inherit; }\\n\\n.video-js ul {\\n font-family: inherit;\\n font-size: inherit;\\n line-height: inherit;\\n list-style-position: outside;\\n margin-left: 0;\\n margin-right: 0;\\n margin-top: 0;\\n margin-bottom: 0; }\\n\\n.video-js.vjs-fluid,\\n.video-js.vjs-16-9,\\n.video-js.vjs-4-3 {\\n width: 100%;\\n max-width: 100%;\\n height: 0; }\\n\\n.video-js.vjs-16-9 {\\n padding-top: 56.25%; }\\n\\n.video-js.vjs-4-3 {\\n padding-top: 75%; }\\n\\n.video-js.vjs-fill {\\n width: 100%;\\n height: 100%; }\\n\\n.video-js .vjs-tech {\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%; }\\n\\nbody.vjs-full-window {\\n padding: 0;\\n margin: 0;\\n height: 100%; }\\n\\n.vjs-full-window .video-js.vjs-fullscreen {\\n position: fixed;\\n overflow: hidden;\\n z-index: 1000;\\n left: 0;\\n top: 0;\\n bottom: 0;\\n right: 0; }\\n\\n.video-js.vjs-fullscreen {\\n width: 100% !important;\\n height: 100% !important;\\n padding-top: 0 !important; }\\n\\n.video-js.vjs-fullscreen.vjs-user-inactive {\\n cursor: none; }\\n\\n.vjs-hidden {\\n display: none !important; }\\n\\n.vjs-disabled {\\n opacity: 0.5;\\n cursor: default; }\\n\\n.video-js .vjs-offscreen {\\n height: 1px;\\n left: -9999px;\\n position: absolute;\\n top: 0;\\n width: 1px; }\\n\\n.vjs-lock-showing {\\n display: block !important;\\n opacity: 1;\\n visibility: visible; }\\n\\n.vjs-no-js {\\n padding: 20px;\\n color: #fff;\\n background-color: #000;\\n font-size: 18px;\\n font-family: Arial, Helvetica, sans-serif;\\n text-align: center;\\n width: 300px;\\n height: 150px;\\n margin: 0px auto; }\\n\\n.vjs-no-js a,\\n.vjs-no-js a:visited {\\n color: #66A8CC; }\\n\\n.video-js .vjs-big-play-button {\\n font-size: 3em;\\n line-height: 1.5em;\\n height: 1.5em;\\n width: 3em;\\n display: block;\\n position: absolute;\\n top: 10px;\\n left: 10px;\\n padding: 0;\\n cursor: pointer;\\n opacity: 1;\\n border: 0.06666em solid #fff;\\n background-color: #2B333F;\\n background-color: rgba(43, 51, 63, 0.7);\\n border-radius: 0.3em;\\n transition: all 0.4s; }\\n\\n.vjs-big-play-centered .vjs-big-play-button {\\n top: 50%;\\n left: 50%;\\n margin-top: -0.75em;\\n margin-left: -1.5em; }\\n\\n.video-js:hover .vjs-big-play-button,\\n.video-js .vjs-big-play-button:focus {\\n border-color: #fff;\\n background-color: #73859f;\\n background-color: rgba(115, 133, 159, 0.5);\\n transition: all 0s; }\\n\\n.vjs-controls-disabled .vjs-big-play-button,\\n.vjs-has-started .vjs-big-play-button,\\n.vjs-using-native-controls .vjs-big-play-button,\\n.vjs-error .vjs-big-play-button {\\n display: none; }\\n\\n.vjs-has-started.vjs-paused.vjs-show-big-play-button-on-pause .vjs-big-play-button {\\n display: block; }\\n\\n.video-js button {\\n background: none;\\n border: none;\\n color: inherit;\\n display: inline-block;\\n font-size: inherit;\\n line-height: inherit;\\n text-transform: none;\\n text-decoration: none;\\n transition: none;\\n -webkit-appearance: none;\\n -moz-appearance: none;\\n appearance: none; }\\n\\n.vjs-control .vjs-button {\\n width: 100%;\\n height: 100%; }\\n\\n.video-js .vjs-control.vjs-close-button {\\n cursor: pointer;\\n height: 3em;\\n position: absolute;\\n right: 0;\\n top: 0.5em;\\n z-index: 2; }\\n\\n.video-js .vjs-modal-dialog {\\n background: rgba(0, 0, 0, 0.8);\\n background: linear-gradient(180deg, rgba(0, 0, 0, 0.8), rgba(255, 255, 255, 0));\\n overflow: auto; }\\n\\n.video-js .vjs-modal-dialog > * {\\n box-sizing: border-box; }\\n\\n.vjs-modal-dialog .vjs-modal-dialog-content {\\n font-size: 1.2em;\\n line-height: 1.5;\\n padding: 20px 24px;\\n z-index: 1; }\\n\\n.vjs-menu-button {\\n cursor: pointer; }\\n\\n.vjs-menu-button.vjs-disabled {\\n cursor: default; }\\n\\n.vjs-workinghover .vjs-menu-button.vjs-disabled:hover .vjs-menu {\\n display: none; }\\n\\n.vjs-menu .vjs-menu-content {\\n display: block;\\n padding: 0;\\n margin: 0;\\n font-family: Arial, Helvetica, sans-serif;\\n overflow: auto; }\\n\\n.vjs-menu .vjs-menu-content > * {\\n box-sizing: border-box; }\\n\\n.vjs-scrubbing .vjs-control.vjs-menu-button:hover .vjs-menu {\\n display: none; }\\n\\n.vjs-menu li {\\n list-style: none;\\n margin: 0;\\n padding: 0.2em 0;\\n line-height: 1.4em;\\n font-size: 1.2em;\\n text-align: center;\\n text-transform: lowercase; }\\n\\n.vjs-menu li.vjs-menu-item:focus,\\n.vjs-menu li.vjs-menu-item:hover,\\n.js-focus-visible .vjs-menu li.vjs-menu-item:hover {\\n background-color: #73859f;\\n background-color: rgba(115, 133, 159, 0.5); }\\n\\n.vjs-menu li.vjs-selected,\\n.vjs-menu li.vjs-selected:focus,\\n.vjs-menu li.vjs-selected:hover,\\n.js-focus-visible .vjs-menu li.vjs-selected:hover {\\n background-color: #fff;\\n color: #2B333F; }\\n\\n.vjs-menu li.vjs-menu-title {\\n text-align: center;\\n text-transform: uppercase;\\n font-size: 1em;\\n line-height: 2em;\\n padding: 0;\\n margin: 0 0 0.3em 0;\\n font-weight: bold;\\n cursor: default; }\\n\\n.vjs-menu-button-popup .vjs-menu {\\n display: none;\\n position: absolute;\\n bottom: 0;\\n width: 10em;\\n left: -3em;\\n height: 0em;\\n margin-bottom: 1.5em;\\n border-top-color: rgba(43, 51, 63, 0.7); }\\n\\n.vjs-menu-button-popup .vjs-menu .vjs-menu-content {\\n background-color: #2B333F;\\n background-color: rgba(43, 51, 63, 0.7);\\n position: absolute;\\n width: 100%;\\n bottom: 1.5em;\\n max-height: 15em; }\\n\\n.vjs-workinghover .vjs-menu-button-popup:hover .vjs-menu,\\n.vjs-menu-button-popup .vjs-menu.vjs-lock-showing {\\n display: block; }\\n\\n.video-js .vjs-menu-button-inline {\\n transition: all 0.4s;\\n overflow: hidden; }\\n\\n.video-js .vjs-menu-button-inline:before {\\n width: 2.222222222em; }\\n\\n.video-js .vjs-menu-button-inline:hover,\\n.video-js .vjs-menu-button-inline:focus,\\n.video-js .vjs-menu-button-inline.vjs-slider-active,\\n.video-js.vjs-no-flex .vjs-menu-button-inline {\\n width: 12em; }\\n\\n.vjs-menu-button-inline .vjs-menu {\\n opacity: 0;\\n height: 100%;\\n width: auto;\\n position: absolute;\\n left: 4em;\\n top: 0;\\n padding: 0;\\n margin: 0;\\n transition: all 0.4s; }\\n\\n.vjs-menu-button-inline:hover .vjs-menu,\\n.vjs-menu-button-inline:focus .vjs-menu,\\n.vjs-menu-button-inline.vjs-slider-active .vjs-menu {\\n display: block;\\n opacity: 1; }\\n\\n.vjs-no-flex .vjs-menu-button-inline .vjs-menu {\\n display: block;\\n opacity: 1;\\n position: relative;\\n width: auto; }\\n\\n.vjs-no-flex .vjs-menu-button-inline:hover .vjs-menu,\\n.vjs-no-flex .vjs-menu-button-inline:focus .vjs-menu,\\n.vjs-no-flex .vjs-menu-button-inline.vjs-slider-active .vjs-menu {\\n width: auto; }\\n\\n.vjs-menu-button-inline .vjs-menu-content {\\n width: auto;\\n height: 100%;\\n margin: 0;\\n overflow: hidden; }\\n\\n.video-js .vjs-control-bar {\\n display: none;\\n width: 100%;\\n position: absolute;\\n bottom: 0;\\n left: 0;\\n right: 0;\\n height: 3.0em;\\n background-color: #2B333F;\\n background-color: rgba(43, 51, 63, 0.7); }\\n\\n.vjs-has-started .vjs-control-bar {\\n display: flex;\\n visibility: visible;\\n opacity: 1;\\n transition: visibility 0.1s, opacity 0.1s; }\\n\\n.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar {\\n visibility: visible;\\n opacity: 0;\\n transition: visibility 1s, opacity 1s; }\\n\\n.vjs-controls-disabled .vjs-control-bar,\\n.vjs-using-native-controls .vjs-control-bar,\\n.vjs-error .vjs-control-bar {\\n display: none !important; }\\n\\n.vjs-audio.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar {\\n opacity: 1;\\n visibility: visible; }\\n\\n.vjs-has-started.vjs-no-flex .vjs-control-bar {\\n display: table; }\\n\\n.video-js .vjs-control {\\n position: relative;\\n text-align: center;\\n margin: 0;\\n padding: 0;\\n height: 100%;\\n width: 4em;\\n flex: none; }\\n\\n.vjs-button > .vjs-icon-placeholder:before {\\n font-size: 1.8em;\\n line-height: 1.67; }\\n\\n.video-js .vjs-control:focus:before,\\n.video-js .vjs-control:hover:before,\\n.video-js .vjs-control:focus {\\n text-shadow: 0em 0em 1em white; }\\n\\n.video-js .vjs-control-text {\\n border: 0;\\n clip: rect(0 0 0 0);\\n height: 1px;\\n overflow: hidden;\\n padding: 0;\\n position: absolute;\\n width: 1px; }\\n\\n.vjs-no-flex .vjs-control {\\n display: table-cell;\\n vertical-align: middle; }\\n\\n.video-js .vjs-custom-control-spacer {\\n display: none; }\\n\\n.video-js .vjs-progress-control {\\n cursor: pointer;\\n flex: auto;\\n display: flex;\\n align-items: center;\\n min-width: 4em;\\n touch-action: none; }\\n\\n.video-js .vjs-progress-control.disabled {\\n cursor: default; }\\n\\n.vjs-live .vjs-progress-control {\\n display: none; }\\n\\n.vjs-liveui .vjs-progress-control {\\n display: flex;\\n align-items: center; }\\n\\n.vjs-no-flex .vjs-progress-control {\\n width: auto; }\\n\\n.video-js .vjs-progress-holder {\\n flex: auto;\\n transition: all 0.2s;\\n height: 0.3em; }\\n\\n.video-js .vjs-progress-control .vjs-progress-holder {\\n margin: 0 10px; }\\n\\n.video-js .vjs-progress-control:hover .vjs-progress-holder {\\n font-size: 1.666666666666666666em; }\\n\\n.video-js .vjs-progress-control:hover .vjs-progress-holder.disabled {\\n font-size: 1em; }\\n\\n.video-js .vjs-progress-holder .vjs-play-progress,\\n.video-js .vjs-progress-holder .vjs-load-progress,\\n.video-js .vjs-progress-holder .vjs-load-progress div {\\n position: absolute;\\n display: block;\\n height: 100%;\\n margin: 0;\\n padding: 0;\\n width: 0; }\\n\\n.video-js .vjs-play-progress {\\n background-color: #fff; }\\n .video-js .vjs-play-progress:before {\\n font-size: 0.9em;\\n position: absolute;\\n right: -0.5em;\\n top: -0.333333333333333em;\\n z-index: 1; }\\n\\n.video-js .vjs-load-progress {\\n background: rgba(115, 133, 159, 0.5); }\\n\\n.video-js .vjs-load-progress div {\\n background: rgba(115, 133, 159, 0.75); }\\n\\n.video-js .vjs-time-tooltip {\\n background-color: #fff;\\n background-color: rgba(255, 255, 255, 0.8);\\n border-radius: 0.3em;\\n color: #000;\\n float: right;\\n font-family: Arial, Helvetica, sans-serif;\\n font-size: 1em;\\n padding: 6px 8px 8px 8px;\\n pointer-events: none;\\n position: absolute;\\n top: -3.4em;\\n visibility: hidden;\\n z-index: 1; }\\n\\n.video-js .vjs-progress-holder:focus .vjs-time-tooltip {\\n display: none; }\\n\\n.video-js .vjs-progress-control:hover .vjs-time-tooltip,\\n.video-js .vjs-progress-control:hover .vjs-progress-holder:focus .vjs-time-tooltip {\\n display: block;\\n font-size: 0.6em;\\n visibility: visible; }\\n\\n.video-js .vjs-progress-control.disabled:hover .vjs-time-tooltip {\\n font-size: 1em; }\\n\\n.video-js .vjs-progress-control .vjs-mouse-display {\\n display: none;\\n position: absolute;\\n width: 1px;\\n height: 100%;\\n background-color: #000;\\n z-index: 1; }\\n\\n.vjs-no-flex .vjs-progress-control .vjs-mouse-display {\\n z-index: 0; }\\n\\n.video-js .vjs-progress-control:hover .vjs-mouse-display {\\n display: block; }\\n\\n.video-js.vjs-user-inactive .vjs-progress-control .vjs-mouse-display {\\n visibility: hidden;\\n opacity: 0;\\n transition: visibility 1s, opacity 1s; }\\n\\n.video-js.vjs-user-inactive.vjs-no-flex .vjs-progress-control .vjs-mouse-display {\\n display: none; }\\n\\n.vjs-mouse-display .vjs-time-tooltip {\\n color: #fff;\\n background-color: #000;\\n background-color: rgba(0, 0, 0, 0.8); }\\n\\n.video-js .vjs-slider {\\n position: relative;\\n cursor: pointer;\\n padding: 0;\\n margin: 0 0.45em 0 0.45em;\\n /* iOS Safari */\\n -webkit-touch-callout: none;\\n /* Safari */\\n -webkit-user-select: none;\\n /* Konqueror HTML */\\n /* Firefox */\\n -moz-user-select: none;\\n /* Internet Explorer/Edge */\\n -ms-user-select: none;\\n /* Non-prefixed version, currently supported by Chrome and Opera */\\n user-select: none;\\n background-color: #73859f;\\n background-color: rgba(115, 133, 159, 0.5); }\\n\\n.video-js .vjs-slider.disabled {\\n cursor: default; }\\n\\n.video-js .vjs-slider:focus {\\n text-shadow: 0em 0em 1em white;\\n box-shadow: 0 0 1em #fff; }\\n\\n.video-js .vjs-mute-control {\\n cursor: pointer;\\n flex: none; }\\n\\n.video-js .vjs-volume-control {\\n cursor: pointer;\\n margin-right: 1em;\\n display: flex; }\\n\\n.video-js .vjs-volume-control.vjs-volume-horizontal {\\n width: 5em; }\\n\\n.video-js .vjs-volume-panel .vjs-volume-control {\\n visibility: visible;\\n opacity: 0;\\n width: 1px;\\n height: 1px;\\n margin-left: -1px; }\\n\\n.video-js .vjs-volume-panel {\\n transition: width 1s; }\\n .video-js .vjs-volume-panel:hover .vjs-volume-control,\\n .video-js .vjs-volume-panel:active .vjs-volume-control,\\n .video-js .vjs-volume-panel:focus .vjs-volume-control,\\n .video-js .vjs-volume-panel .vjs-volume-control:hover,\\n .video-js .vjs-volume-panel .vjs-volume-control:active,\\n .video-js .vjs-volume-panel .vjs-mute-control:hover ~ .vjs-volume-control,\\n .video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active {\\n visibility: visible;\\n opacity: 1;\\n position: relative;\\n transition: visibility 0.1s, opacity 0.1s, height 0.1s, width 0.1s, left 0s, top 0s; }\\n .video-js .vjs-volume-panel:hover .vjs-volume-control.vjs-volume-horizontal,\\n .video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal,\\n .video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal,\\n .video-js .vjs-volume-panel .vjs-volume-control:hover.vjs-volume-horizontal,\\n .video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-horizontal,\\n .video-js .vjs-volume-panel .vjs-mute-control:hover ~ .vjs-volume-control.vjs-volume-horizontal,\\n .video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-horizontal {\\n width: 5em;\\n height: 3em; }\\n .video-js .vjs-volume-panel:hover .vjs-volume-control.vjs-volume-vertical,\\n .video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical,\\n .video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical,\\n .video-js .vjs-volume-panel .vjs-volume-control:hover.vjs-volume-vertical,\\n .video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical,\\n .video-js .vjs-volume-panel .vjs-mute-control:hover ~ .vjs-volume-control.vjs-volume-vertical,\\n .video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical {\\n left: -3.5em; }\\n .video-js .vjs-volume-panel.vjs-volume-panel-horizontal:hover, .video-js .vjs-volume-panel.vjs-volume-panel-horizontal:active, .video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active {\\n width: 9em;\\n transition: width 0.1s; }\\n .video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-mute-toggle-only {\\n width: 4em; }\\n\\n.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical {\\n height: 8em;\\n width: 3em;\\n left: -3000em;\\n transition: visibility 1s, opacity 1s, height 1s 1s, width 1s 1s, left 1s 1s, top 1s 1s; }\\n\\n.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal {\\n transition: visibility 1s, opacity 1s, height 1s 1s, width 1s, left 1s 1s, top 1s 1s; }\\n\\n.video-js.vjs-no-flex .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal {\\n width: 5em;\\n height: 3em;\\n visibility: visible;\\n opacity: 1;\\n position: relative;\\n transition: none; }\\n\\n.video-js.vjs-no-flex .vjs-volume-control.vjs-volume-vertical,\\n.video-js.vjs-no-flex .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical {\\n position: absolute;\\n bottom: 3em;\\n left: 0.5em; }\\n\\n.video-js .vjs-volume-panel {\\n display: flex; }\\n\\n.video-js .vjs-volume-bar {\\n margin: 1.35em 0.45em; }\\n\\n.vjs-volume-bar.vjs-slider-horizontal {\\n width: 5em;\\n height: 0.3em; }\\n\\n.vjs-volume-bar.vjs-slider-vertical {\\n width: 0.3em;\\n height: 5em;\\n margin: 1.35em auto; }\\n\\n.video-js .vjs-volume-level {\\n position: absolute;\\n bottom: 0;\\n left: 0;\\n background-color: #fff; }\\n .video-js .vjs-volume-level:before {\\n position: absolute;\\n font-size: 0.9em; }\\n\\n.vjs-slider-vertical .vjs-volume-level {\\n width: 0.3em; }\\n .vjs-slider-vertical .vjs-volume-level:before {\\n top: -0.5em;\\n left: -0.3em; }\\n\\n.vjs-slider-horizontal .vjs-volume-level {\\n height: 0.3em; }\\n .vjs-slider-horizontal .vjs-volume-level:before {\\n top: -0.3em;\\n right: -0.5em; }\\n\\n.video-js .vjs-volume-panel.vjs-volume-panel-vertical {\\n width: 4em; }\\n\\n.vjs-volume-bar.vjs-slider-vertical .vjs-volume-level {\\n height: 100%; }\\n\\n.vjs-volume-bar.vjs-slider-horizontal .vjs-volume-level {\\n width: 100%; }\\n\\n.video-js .vjs-volume-vertical {\\n width: 3em;\\n height: 8em;\\n bottom: 8em;\\n background-color: #2B333F;\\n background-color: rgba(43, 51, 63, 0.7); }\\n\\n.video-js .vjs-volume-horizontal .vjs-menu {\\n left: -2em; }\\n\\n.vjs-poster {\\n display: inline-block;\\n vertical-align: middle;\\n background-repeat: no-repeat;\\n background-position: 50% 50%;\\n background-size: contain;\\n background-color: #000000;\\n cursor: pointer;\\n margin: 0;\\n padding: 0;\\n position: absolute;\\n top: 0;\\n right: 0;\\n bottom: 0;\\n left: 0;\\n height: 100%; }\\n\\n.vjs-has-started .vjs-poster {\\n display: none; }\\n\\n.vjs-audio.vjs-has-started .vjs-poster {\\n display: block; }\\n\\n.vjs-using-native-controls .vjs-poster {\\n display: none; }\\n\\n.video-js .vjs-live-control {\\n display: flex;\\n align-items: flex-start;\\n flex: auto;\\n font-size: 1em;\\n line-height: 3em; }\\n\\n.vjs-no-flex .vjs-live-control {\\n display: table-cell;\\n width: auto;\\n text-align: left; }\\n\\n.video-js:not(.vjs-live) .vjs-live-control,\\n.video-js.vjs-liveui .vjs-live-control {\\n display: none; }\\n\\n.video-js .vjs-seek-to-live-control {\\n cursor: pointer;\\n flex: none;\\n display: inline-flex;\\n height: 100%;\\n padding-left: 0.5em;\\n padding-right: 0.5em;\\n font-size: 1em;\\n line-height: 3em;\\n width: auto;\\n min-width: 4em; }\\n\\n.vjs-no-flex .vjs-seek-to-live-control {\\n display: table-cell;\\n width: auto;\\n text-align: left; }\\n\\n.video-js.vjs-live:not(.vjs-liveui) .vjs-seek-to-live-control,\\n.video-js:not(.vjs-live) .vjs-seek-to-live-control {\\n display: none; }\\n\\n.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge {\\n cursor: auto; }\\n\\n.vjs-seek-to-live-control .vjs-icon-placeholder {\\n margin-right: 0.5em;\\n color: #888; }\\n\\n.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-icon-placeholder {\\n color: red; }\\n\\n.video-js .vjs-time-control {\\n flex: none;\\n font-size: 1em;\\n line-height: 3em;\\n min-width: 2em;\\n width: auto;\\n padding-left: 1em;\\n padding-right: 1em; }\\n\\n.vjs-live .vjs-time-control {\\n display: none; }\\n\\n.video-js .vjs-current-time,\\n.vjs-no-flex .vjs-current-time {\\n display: none; }\\n\\n.video-js .vjs-duration,\\n.vjs-no-flex .vjs-duration {\\n display: none; }\\n\\n.vjs-time-divider {\\n display: none;\\n line-height: 3em; }\\n\\n.vjs-live .vjs-time-divider {\\n display: none; }\\n\\n.video-js .vjs-play-control {\\n cursor: pointer; }\\n\\n.video-js .vjs-play-control .vjs-icon-placeholder {\\n flex: none; }\\n\\n.vjs-text-track-display {\\n position: absolute;\\n bottom: 3em;\\n left: 0;\\n right: 0;\\n top: 0;\\n pointer-events: none; }\\n\\n.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display {\\n bottom: 1em; }\\n\\n.video-js .vjs-text-track {\\n font-size: 1.4em;\\n text-align: center;\\n margin-bottom: 0.1em; }\\n\\n.vjs-subtitles {\\n color: #fff; }\\n\\n.vjs-captions {\\n color: #fc6; }\\n\\n.vjs-tt-cue {\\n display: block; }\\n\\nvideo::-webkit-media-text-track-display {\\n -webkit-transform: translateY(-3em);\\n transform: translateY(-3em); }\\n\\n.video-js.vjs-user-inactive.vjs-playing video::-webkit-media-text-track-display {\\n -webkit-transform: translateY(-1.5em);\\n transform: translateY(-1.5em); }\\n\\n.video-js .vjs-fullscreen-control {\\n cursor: pointer;\\n flex: none; }\\n\\n.vjs-playback-rate > .vjs-menu-button,\\n.vjs-playback-rate .vjs-playback-rate-value {\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%; }\\n\\n.vjs-playback-rate .vjs-playback-rate-value {\\n pointer-events: none;\\n font-size: 1.5em;\\n line-height: 2;\\n text-align: center; }\\n\\n.vjs-playback-rate .vjs-menu {\\n width: 4em;\\n left: 0em; }\\n\\n.vjs-error .vjs-error-display .vjs-modal-dialog-content {\\n font-size: 1.4em;\\n text-align: center; }\\n\\n.vjs-error .vjs-error-display:before {\\n color: #fff;\\n content: 'X';\\n font-family: Arial, Helvetica, sans-serif;\\n font-size: 4em;\\n left: 0;\\n line-height: 1;\\n margin-top: -0.5em;\\n position: absolute;\\n text-shadow: 0.05em 0.05em 0.1em #000;\\n text-align: center;\\n top: 50%;\\n vertical-align: middle;\\n width: 100%; }\\n\\n.vjs-loading-spinner {\\n display: none;\\n position: absolute;\\n top: 50%;\\n left: 50%;\\n margin: -25px 0 0 -25px;\\n opacity: 0.85;\\n text-align: left;\\n border: 6px solid rgba(43, 51, 63, 0.7);\\n box-sizing: border-box;\\n background-clip: padding-box;\\n width: 50px;\\n height: 50px;\\n border-radius: 25px;\\n visibility: hidden; }\\n\\n.vjs-seeking .vjs-loading-spinner,\\n.vjs-waiting .vjs-loading-spinner {\\n display: block;\\n -webkit-animation: 0s linear 0.3s forwards vjs-spinner-show;\\n animation: 0s linear 0.3s forwards vjs-spinner-show; }\\n\\n.vjs-loading-spinner:before,\\n.vjs-loading-spinner:after {\\n content: \\\"\\\";\\n position: absolute;\\n margin: -6px;\\n box-sizing: inherit;\\n width: inherit;\\n height: inherit;\\n border-radius: inherit;\\n opacity: 1;\\n border: inherit;\\n border-color: transparent;\\n border-top-color: white; }\\n\\n.vjs-seeking .vjs-loading-spinner:before,\\n.vjs-seeking .vjs-loading-spinner:after,\\n.vjs-waiting .vjs-loading-spinner:before,\\n.vjs-waiting .vjs-loading-spinner:after {\\n -webkit-animation: vjs-spinner-spin 1.1s cubic-bezier(0.6, 0.2, 0, 0.8) infinite, vjs-spinner-fade 1.1s linear infinite;\\n animation: vjs-spinner-spin 1.1s cubic-bezier(0.6, 0.2, 0, 0.8) infinite, vjs-spinner-fade 1.1s linear infinite; }\\n\\n.vjs-seeking .vjs-loading-spinner:before,\\n.vjs-waiting .vjs-loading-spinner:before {\\n border-top-color: white; }\\n\\n.vjs-seeking .vjs-loading-spinner:after,\\n.vjs-waiting .vjs-loading-spinner:after {\\n border-top-color: white;\\n -webkit-animation-delay: 0.44s;\\n animation-delay: 0.44s; }\\n\\n@keyframes vjs-spinner-show {\\n to {\\n visibility: visible; } }\\n\\n@-webkit-keyframes vjs-spinner-show {\\n to {\\n visibility: visible; } }\\n\\n@keyframes vjs-spinner-spin {\\n 100% {\\n -webkit-transform: rotate(360deg);\\n transform: rotate(360deg); } }\\n\\n@-webkit-keyframes vjs-spinner-spin {\\n 100% {\\n -webkit-transform: rotate(360deg); } }\\n\\n@keyframes vjs-spinner-fade {\\n 0% {\\n border-top-color: #73859f; }\\n 20% {\\n border-top-color: #73859f; }\\n 35% {\\n border-top-color: white; }\\n 60% {\\n border-top-color: #73859f; }\\n 100% {\\n border-top-color: #73859f; } }\\n\\n@-webkit-keyframes vjs-spinner-fade {\\n 0% {\\n border-top-color: #73859f; }\\n 20% {\\n border-top-color: #73859f; }\\n 35% {\\n border-top-color: white; }\\n 60% {\\n border-top-color: #73859f; }\\n 100% {\\n border-top-color: #73859f; } }\\n\\n.vjs-chapters-button .vjs-menu ul {\\n width: 24em; }\\n\\n.video-js .vjs-subs-caps-button + .vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder {\\n vertical-align: middle;\\n display: inline-block;\\n margin-bottom: -0.1em; }\\n\\n.video-js .vjs-subs-caps-button + .vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before {\\n font-family: VideoJS;\\n content: \\\"\\\\f10d\\\";\\n font-size: 1.5em;\\n line-height: inherit; }\\n\\n.video-js .vjs-audio-button + .vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder {\\n vertical-align: middle;\\n display: inline-block;\\n margin-bottom: -0.1em; }\\n\\n.video-js .vjs-audio-button + .vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before {\\n font-family: VideoJS;\\n content: \\\" \\\\f11d\\\";\\n font-size: 1.5em;\\n line-height: inherit; }\\n\\n.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-custom-control-spacer {\\n flex: auto;\\n display: block; }\\n\\n.video-js.vjs-layout-tiny:not(.vjs-fullscreen).vjs-no-flex .vjs-custom-control-spacer {\\n width: auto; }\\n\\n.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-current-time, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-time-divider, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-duration, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-remaining-time,\\n.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-playback-rate, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-progress-control,\\n.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-mute-control, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-volume-control, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-volume-panel,\\n.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-chapters-button, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-descriptions-button, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-captions-button,\\n.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-subtitles-button, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-subs-caps-button, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-audio-button {\\n display: none; }\\n\\n.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-current-time, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-time-divider, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-duration, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-remaining-time,\\n.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-playback-rate,\\n.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-mute-control, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-volume-control, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-volume-panel,\\n.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-chapters-button, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-descriptions-button, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-captions-button,\\n.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-subtitles-button, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-subs-caps-button, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-audio-button {\\n display: none; }\\n\\n.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-current-time, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-time-divider, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-duration, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-remaining-time,\\n.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-playback-rate,\\n.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-mute-control, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-volume-control, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-volume-panel,\\n.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-chapters-button, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-descriptions-button, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-captions-button,\\n.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-subtitles-button, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-audio-button {\\n display: none; }\\n\\n.vjs-modal-dialog.vjs-text-track-settings {\\n background-color: #2B333F;\\n background-color: rgba(43, 51, 63, 0.75);\\n color: #fff;\\n height: 70%; }\\n\\n.vjs-text-track-settings .vjs-modal-dialog-content {\\n display: table; }\\n\\n.vjs-text-track-settings .vjs-track-settings-colors,\\n.vjs-text-track-settings .vjs-track-settings-font,\\n.vjs-text-track-settings .vjs-track-settings-controls {\\n display: table-cell; }\\n\\n.vjs-text-track-settings .vjs-track-settings-controls {\\n text-align: right;\\n vertical-align: bottom; }\\n\\n@supports (display: grid) {\\n .vjs-text-track-settings .vjs-modal-dialog-content {\\n display: grid;\\n grid-template-columns: 1fr 1fr;\\n grid-template-rows: 1fr;\\n padding: 20px 24px 0px 24px; }\\n .vjs-track-settings-controls .vjs-default-button {\\n margin-bottom: 20px; }\\n .vjs-text-track-settings .vjs-track-settings-controls {\\n grid-column: 1 / -1; }\\n .vjs-layout-small .vjs-text-track-settings .vjs-modal-dialog-content,\\n .vjs-layout-x-small .vjs-text-track-settings .vjs-modal-dialog-content,\\n .vjs-layout-tiny .vjs-text-track-settings .vjs-modal-dialog-content {\\n grid-template-columns: 1fr; } }\\n\\n.vjs-track-setting > select {\\n margin-right: 1em;\\n margin-bottom: 0.5em; }\\n\\n.vjs-text-track-settings fieldset {\\n margin: 5px;\\n padding: 3px;\\n border: none; }\\n\\n.vjs-text-track-settings fieldset span {\\n display: inline-block; }\\n\\n.vjs-text-track-settings fieldset span > select {\\n max-width: 7.3em; }\\n\\n.vjs-text-track-settings legend {\\n color: #fff;\\n margin: 0 0 5px 0; }\\n\\n.vjs-text-track-settings .vjs-label {\\n position: absolute;\\n clip: rect(1px 1px 1px 1px);\\n clip: rect(1px, 1px, 1px, 1px);\\n display: block;\\n margin: 0 0 5px 0;\\n padding: 0;\\n border: 0;\\n height: 1px;\\n width: 1px;\\n overflow: hidden; }\\n\\n.vjs-track-settings-controls button:focus,\\n.vjs-track-settings-controls button:active {\\n outline-style: solid;\\n outline-width: medium;\\n background-image: linear-gradient(0deg, #fff 88%, #73859f 100%); }\\n\\n.vjs-track-settings-controls button:hover {\\n color: rgba(43, 51, 63, 0.75); }\\n\\n.vjs-track-settings-controls button {\\n background-color: #fff;\\n background-image: linear-gradient(-180deg, #fff 88%, #73859f 100%);\\n color: #2B333F;\\n cursor: pointer;\\n border-radius: 2px; }\\n\\n.vjs-track-settings-controls .vjs-default-button {\\n margin-right: 1em; }\\n\\n@media print {\\n .video-js > *:not(.vjs-tech):not(.vjs-poster) {\\n visibility: hidden; } }\\n\\n.vjs-resize-manager {\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%;\\n border: none;\\n z-index: -1000; }\\n\\n.js-focus-visible .video-js *:focus:not(.focus-visible) {\\n outline: none;\\n background: none; }\\n\\n.video-js *:focus:not(:focus-visible),\\n.video-js .vjs-menu *:focus:not(:focus-visible) {\\n outline: none;\\n background: none; }\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\n// eslint-disable-next-line func-names\nmodule.exports = function (useSourceMap) {\n var list = []; // return the list of modules as css string\n\n list.toString = function toString() {\n return this.map(function (item) {\n var content = cssWithMappingToString(item, useSourceMap);\n\n if (item[2]) {\n return \"@media \".concat(item[2], \" {\").concat(content, \"}\");\n }\n\n return content;\n }).join('');\n }; // import a list of modules into the list\n // eslint-disable-next-line func-names\n\n\n list.i = function (modules, mediaQuery, dedupe) {\n if (typeof modules === 'string') {\n // eslint-disable-next-line no-param-reassign\n modules = [[null, modules, '']];\n }\n\n var alreadyImportedModules = {};\n\n if (dedupe) {\n for (var i = 0; i < this.length; i++) {\n // eslint-disable-next-line prefer-destructuring\n var id = this[i][0];\n\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n\n for (var _i = 0; _i < modules.length; _i++) {\n var item = [].concat(modules[_i]);\n\n if (dedupe && alreadyImportedModules[item[0]]) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n if (mediaQuery) {\n if (!item[2]) {\n item[2] = mediaQuery;\n } else {\n item[2] = \"\".concat(mediaQuery, \" and \").concat(item[2]);\n }\n }\n\n list.push(item);\n }\n };\n\n return list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n var content = item[1] || ''; // eslint-disable-next-line prefer-destructuring\n\n var cssMapping = item[3];\n\n if (!cssMapping) {\n return content;\n }\n\n if (useSourceMap && typeof btoa === 'function') {\n var sourceMapping = toComment(cssMapping);\n var sourceURLs = cssMapping.sources.map(function (source) {\n return \"/*# sourceURL=\".concat(cssMapping.sourceRoot || '').concat(source, \" */\");\n });\n return [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n }\n\n return [content].join('\\n');\n} // Adapted from convert-source-map (MIT)\n\n\nfunction toComment(sourceMap) {\n // eslint-disable-next-line no-undef\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n return \"/*# \".concat(data, \" */\");\n}","import api from \"!../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../css-loader/dist/cjs.js!./video-js.css\";\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","\"use strict\";\n\nvar isOldIE = function isOldIE() {\n var memo;\n return function memorize() {\n if (typeof memo === 'undefined') {\n // Test for IE <= 9 as proposed by Browserhacks\n // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n // Tests for existence of standard globals is to allow style-loader\n // to operate correctly into non-standard environments\n // @see https://github.com/webpack-contrib/style-loader/issues/177\n memo = Boolean(window && document && document.all && !window.atob);\n }\n\n return memo;\n };\n}();\n\nvar getTarget = function getTarget() {\n var memo = {};\n return function memorize(target) {\n if (typeof memo[target] === 'undefined') {\n var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself\n\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n\n memo[target] = styleTarget;\n }\n\n return memo[target];\n };\n}();\n\nvar stylesInDom = [];\n\nfunction getIndexByIdentifier(identifier) {\n var result = -1;\n\n for (var i = 0; i < stylesInDom.length; i++) {\n if (stylesInDom[i].identifier === identifier) {\n result = i;\n break;\n }\n }\n\n return result;\n}\n\nfunction modulesToDom(list, options) {\n var idCountMap = {};\n var identifiers = [];\n\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var count = idCountMap[id] || 0;\n var identifier = \"\".concat(id, \" \").concat(count);\n idCountMap[id] = count + 1;\n var index = getIndexByIdentifier(identifier);\n var obj = {\n css: item[1],\n media: item[2],\n sourceMap: item[3]\n };\n\n if (index !== -1) {\n stylesInDom[index].references++;\n stylesInDom[index].updater(obj);\n } else {\n stylesInDom.push({\n identifier: identifier,\n updater: addStyle(obj, options),\n references: 1\n });\n }\n\n identifiers.push(identifier);\n }\n\n return identifiers;\n}\n\nfunction insertStyleElement(options) {\n var style = document.createElement('style');\n var attributes = options.attributes || {};\n\n if (typeof attributes.nonce === 'undefined') {\n var nonce = typeof __webpack_nonce__ !== 'undefined' ? __webpack_nonce__ : null;\n\n if (nonce) {\n attributes.nonce = nonce;\n }\n }\n\n Object.keys(attributes).forEach(function (key) {\n style.setAttribute(key, attributes[key]);\n });\n\n if (typeof options.insert === 'function') {\n options.insert(style);\n } else {\n var target = getTarget(options.insert || 'head');\n\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n\n target.appendChild(style);\n }\n\n return style;\n}\n\nfunction removeStyleElement(style) {\n // istanbul ignore if\n if (style.parentNode === null) {\n return false;\n }\n\n style.parentNode.removeChild(style);\n}\n/* istanbul ignore next */\n\n\nvar replaceText = function replaceText() {\n var textStore = [];\n return function replace(index, replacement) {\n textStore[index] = replacement;\n return textStore.filter(Boolean).join('\\n');\n };\n}();\n\nfunction applyToSingletonTag(style, index, remove, obj) {\n var css = remove ? '' : obj.media ? \"@media \".concat(obj.media, \" {\").concat(obj.css, \"}\") : obj.css; // For old IE\n\n /* istanbul ignore if */\n\n if (style.styleSheet) {\n style.styleSheet.cssText = replaceText(index, css);\n } else {\n var cssNode = document.createTextNode(css);\n var childNodes = style.childNodes;\n\n if (childNodes[index]) {\n style.removeChild(childNodes[index]);\n }\n\n if (childNodes.length) {\n style.insertBefore(cssNode, childNodes[index]);\n } else {\n style.appendChild(cssNode);\n }\n }\n}\n\nfunction applyToTag(style, options, obj) {\n var css = obj.css;\n var media = obj.media;\n var sourceMap = obj.sourceMap;\n\n if (media) {\n style.setAttribute('media', media);\n } else {\n style.removeAttribute('media');\n }\n\n if (sourceMap && typeof btoa !== 'undefined') {\n css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n } // For old IE\n\n /* istanbul ignore if */\n\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n while (style.firstChild) {\n style.removeChild(style.firstChild);\n }\n\n style.appendChild(document.createTextNode(css));\n }\n}\n\nvar singleton = null;\nvar singletonCounter = 0;\n\nfunction addStyle(obj, options) {\n var style;\n var update;\n var remove;\n\n if (options.singleton) {\n var styleIndex = singletonCounter++;\n style = singleton || (singleton = insertStyleElement(options));\n update = applyToSingletonTag.bind(null, style, styleIndex, false);\n remove = applyToSingletonTag.bind(null, style, styleIndex, true);\n } else {\n style = insertStyleElement(options);\n update = applyToTag.bind(null, style, options);\n\n remove = function remove() {\n removeStyleElement(style);\n };\n }\n\n update(obj);\n return function updateStyle(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {\n return;\n }\n\n update(obj = newObj);\n } else {\n remove();\n }\n };\n}\n\nmodule.exports = function (list, options) {\n options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>\n // tags it will allow on a page\n\n if (!options.singleton && typeof options.singleton !== 'boolean') {\n options.singleton = isOldIE();\n }\n\n list = list || [];\n var lastIdentifiers = modulesToDom(list, options);\n return function update(newList) {\n newList = newList || [];\n\n if (Object.prototype.toString.call(newList) !== '[object Array]') {\n return;\n }\n\n for (var i = 0; i < lastIdentifiers.length; i++) {\n var identifier = lastIdentifiers[i];\n var index = getIndexByIdentifier(identifier);\n stylesInDom[index].references--;\n }\n\n var newLastIdentifiers = modulesToDom(newList, options);\n\n for (var _i = 0; _i < lastIdentifiers.length; _i++) {\n var _identifier = lastIdentifiers[_i];\n\n var _index = getIndexByIdentifier(_identifier);\n\n if (stylesInDom[_index].references === 0) {\n stylesInDom[_index].updater();\n\n stylesInDom.splice(_index, 1);\n }\n }\n\n lastIdentifiers = newLastIdentifiers;\n };\n};"],"names":["___CSS_LOADER_EXPORT___","push","module","id","exports","useSourceMap","list","toString","this","map","item","content","cssMapping","btoa","sourceMapping","sourceMap","base64","unescape","encodeURIComponent","JSON","stringify","data","concat","sourceURLs","sources","source","sourceRoot","join","cssWithMappingToString","i","modules","mediaQuery","dedupe","alreadyImportedModules","length","_i","options","memo","isOldIE","Boolean","window","document","all","atob","getTarget","target","styleTarget","querySelector","HTMLIFrameElement","contentDocument","head","e","stylesInDom","getIndexByIdentifier","identifier","result","modulesToDom","idCountMap","identifiers","base","count","index","obj","css","media","references","updater","addStyle","insertStyleElement","style","createElement","attributes","nonce","Object","keys","forEach","key","setAttribute","insert","Error","appendChild","textStore","replaceText","replacement","filter","applyToSingletonTag","remove","styleSheet","cssText","cssNode","createTextNode","childNodes","removeChild","insertBefore","applyToTag","removeAttribute","firstChild","singleton","singletonCounter","update","styleIndex","bind","parentNode","removeStyleElement","newObj","lastIdentifiers","newList","prototype","call","newLastIdentifiers","_index","splice"],"sourceRoot":""} \ No newline at end of file
+{"version":3,"file":"files_videoplayer-vendors-node_modules_video_js_dist_video-js_css.js?v=6813c23d9e5029c0233b","mappings":"kMAEIA,E,MAA0B,IAA4B,GAE1DA,EAAwBC,KAAK,CAACC,EAAOC,GAAI,2o3CAAot3C,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,qDAAqD,MAAQ,GAAG,SAAW,8vXAA8vX,eAAiB,CAAC,4o3CAAot3C,WAAa,MAEp1mG,S,WCEAD,EAAOE,QAAU,SAAUC,GACzB,IAAIC,EAAO,GAuDX,OArDAA,EAAKC,SAAW,WACd,OAAOC,KAAKC,KAAI,SAAUC,GACxB,IAAIC,EAsDV,SAAgCD,EAAML,GACpC,IAAIM,EAAUD,EAAK,IAAM,GAErBE,EAAaF,EAAK,GAEtB,IAAKE,EACH,OAAOD,EAGT,GAAIN,GAAgC,mBAATQ,KAAqB,CAC9C,IAAIC,GAWWC,EAXeH,EAa5BI,EAASH,KAAKI,SAASC,mBAAmBC,KAAKC,UAAUL,MACzDM,EAAO,+DAA+DC,OAAON,GAC1E,OAAOM,OAAOD,EAAM,QAdrBE,EAAaX,EAAWY,QAAQf,KA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,IAAI4C,EAAqBrD,EAAakD,EAAStE,GAEtCD,EAAK,EAAGA,EAAKsE,EAAgBvE,OAAQC,IAAM,CAClD,IAEI2E,EAASzD,EAFKoD,EAAgBtE,IAIK,IAAnCiB,EAAY0D,GAAQ7C,aACtBb,EAAY0D,GAAQ5C,UAEpBd,EAAY2D,OAAOD,EAAQ,GAE/B,CAEAL,EAAkBI,CAtBlB,CAuBF,CACF,C","sources":["webpack:///files_videoplayer/node_modules/video.js/dist/video-js.css","webpack:///files_videoplayer/node_modules/css-loader/dist/runtime/api.js","webpack://files_videoplayer/./node_modules/video.js/dist/video-js.css?658f","webpack:///files_videoplayer/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"],"sourcesContent":["// Imports\nimport ___CSS_LOADER_API_IMPORT___ from \"../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(true);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".video-js .vjs-big-play-button .vjs-icon-placeholder:before, .vjs-button > .vjs-icon-placeholder:before, .video-js .vjs-modal-dialog, .vjs-modal-dialog .vjs-modal-dialog-content {\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%; }\\n\\n.video-js .vjs-big-play-button .vjs-icon-placeholder:before, .vjs-button > .vjs-icon-placeholder:before {\\n text-align: center; }\\n\\n@font-face {\\n font-family: VideoJS;\\n src: url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAABBIAAsAAAAAGoQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAPgAAAFZRiV3RY21hcAAAAYQAAADQAAADIjn098ZnbHlmAAACVAAACv4AABEIAwnSw2hlYWQAAA1UAAAAKwAAADYV1OgpaGhlYQAADYAAAAAbAAAAJA4DByFobXR4AAANnAAAAA8AAACE4AAAAGxvY2EAAA2sAAAARAAAAEQ9NEHGbWF4cAAADfAAAAAfAA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cAARD5/z87IwMjAypQBAAtgwI4AHicY2BgYGAfYAwAOkQA4QAAAAAAAA4AaAB+AMwA4AECAUIBbAGYAcICGAJYArQC4AMwA7AD3gQwBJYE3AUkBWYFigYgBmYGtAbqB1gIEghYCG4IhHicY2BkYGBQZChlYGcAASYg5gJCBob/YD4DABfTAbQAeJxdkE1qg0AYhl8Tk9AIoVDaVSmzahcF87PMARLIMoFAl0ZHY1BHdBJIT9AT9AQ9RQ9Qeqy+yteNMzDzfM+88w0K4BY/cNAMB6N2bUaPPBLukybCLvleeAAPj8JD+hfhMV7hC3u4wxs7OO4NzQSZcI/8Ltwnfwi75E/hAR7wJTyk/xYeY49fYQ/PztM+jbTZ7LY6OWdBJdX/pqs6NYWa+zMxa13oKrA6Uoerqi/JwtpYxZXJ1coUVmeZUWVlTjq0/tHacjmdxuL90OR8O0UEDYMNdtiSEpz5XQGqzlm30kzUdAYFFOb8R7NOZk0q2lwAyz1i7oAr1xoXvrOgtYhZx8wY5KRV269JZ5yGpmzPTjQhvY9je6vEElPOuJP3mWKnP5M3V+YAAAB4nG2PyXLCMBBE3YCNDWEL2ffk7o8S8oCnkCVHC5C/jzBQlUP6IHVPzYyekl5y0iL5X5/ooY8BUmQYIkeBEca4wgRTzDDHAtdY4ga3uMM9HvCIJzzjBa94wzs+8ImvZNAq8TM+HqVkKxWlrQiOxjujQkNlEzyNzl6Z/cU2XF06at7U83VQyklLpEvSnuzsb+HAPnPfQVgaupa1Jlu4sPLsFblcitaz0dHU0ZF1qatjZ1+aTXYCmp6u0gSvWNPyHLtFZ+ZeXWVSaEkqs3T8S74WklbGbNNNq4LL4+CWKtZDv2cfX8l8aFbKFhEnJnJ+IULFpqwoQnNHlHaVQtPBl+ypmbSWdmyC61KS/AKZC3Y+AA==) format(\\\"woff\\\");\\n font-weight: normal;\\n font-style: normal; }\\n\\n.vjs-icon-play, .video-js .vjs-big-play-button .vjs-icon-placeholder:before, .video-js .vjs-play-control .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-play:before, .video-js .vjs-big-play-button .vjs-icon-placeholder:before, .video-js .vjs-play-control .vjs-icon-placeholder:before {\\n content: \\\"\\\\f101\\\"; }\\n\\n.vjs-icon-play-circle {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-play-circle:before {\\n content: \\\"\\\\f102\\\"; }\\n\\n.vjs-icon-pause, .video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-pause:before, .video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before {\\n content: \\\"\\\\f103\\\"; }\\n\\n.vjs-icon-volume-mute, .video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-volume-mute:before, .video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before {\\n content: \\\"\\\\f104\\\"; }\\n\\n.vjs-icon-volume-low, .video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-volume-low:before, .video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before {\\n content: \\\"\\\\f105\\\"; }\\n\\n.vjs-icon-volume-mid, .video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-volume-mid:before, .video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before {\\n content: \\\"\\\\f106\\\"; }\\n\\n.vjs-icon-volume-high, .video-js .vjs-mute-control .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-volume-high:before, .video-js .vjs-mute-control .vjs-icon-placeholder:before {\\n content: \\\"\\\\f107\\\"; }\\n\\n.vjs-icon-fullscreen-enter, .video-js .vjs-fullscreen-control .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-fullscreen-enter:before, .video-js .vjs-fullscreen-control .vjs-icon-placeholder:before {\\n content: \\\"\\\\f108\\\"; }\\n\\n.vjs-icon-fullscreen-exit, .video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-fullscreen-exit:before, .video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before {\\n content: \\\"\\\\f109\\\"; }\\n\\n.vjs-icon-square {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-square:before {\\n content: \\\"\\\\f10a\\\"; }\\n\\n.vjs-icon-spinner {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-spinner:before {\\n content: \\\"\\\\f10b\\\"; }\\n\\n.vjs-icon-subtitles, .video-js .vjs-subtitles-button .vjs-icon-placeholder, .video-js .vjs-subs-caps-button .vjs-icon-placeholder,\\n.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder,\\n.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder,\\n.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder,\\n.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-subtitles:before, .video-js .vjs-subtitles-button .vjs-icon-placeholder:before, .video-js .vjs-subs-caps-button .vjs-icon-placeholder:before,\\n .video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder:before,\\n .video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder:before,\\n .video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder:before,\\n .video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder:before {\\n content: \\\"\\\\f10c\\\"; }\\n\\n.vjs-icon-captions, .video-js .vjs-captions-button .vjs-icon-placeholder, .video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,\\n.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-captions:before, .video-js .vjs-captions-button .vjs-icon-placeholder:before, .video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before,\\n .video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before {\\n content: \\\"\\\\f10d\\\"; }\\n\\n.vjs-icon-chapters, .video-js .vjs-chapters-button .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-chapters:before, .video-js .vjs-chapters-button .vjs-icon-placeholder:before {\\n content: \\\"\\\\f10e\\\"; }\\n\\n.vjs-icon-share {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-share:before {\\n content: \\\"\\\\f10f\\\"; }\\n\\n.vjs-icon-cog {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-cog:before {\\n content: \\\"\\\\f110\\\"; }\\n\\n.vjs-icon-circle, .video-js .vjs-play-progress, .video-js .vjs-volume-level, .vjs-seek-to-live-control .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-circle:before, .video-js .vjs-play-progress:before, .video-js .vjs-volume-level:before, .vjs-seek-to-live-control .vjs-icon-placeholder:before {\\n content: \\\"\\\\f111\\\"; }\\n\\n.vjs-icon-circle-outline {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-circle-outline:before {\\n content: \\\"\\\\f112\\\"; }\\n\\n.vjs-icon-circle-inner-circle {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-circle-inner-circle:before {\\n content: \\\"\\\\f113\\\"; }\\n\\n.vjs-icon-hd {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-hd:before {\\n content: \\\"\\\\f114\\\"; }\\n\\n.vjs-icon-cancel, .video-js .vjs-control.vjs-close-button .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-cancel:before, .video-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before {\\n content: \\\"\\\\f115\\\"; }\\n\\n.vjs-icon-replay, .video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-replay:before, .video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before {\\n content: \\\"\\\\f116\\\"; }\\n\\n.vjs-icon-facebook {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-facebook:before {\\n content: \\\"\\\\f117\\\"; }\\n\\n.vjs-icon-gplus {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-gplus:before {\\n content: \\\"\\\\f118\\\"; }\\n\\n.vjs-icon-linkedin {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-linkedin:before {\\n content: \\\"\\\\f119\\\"; }\\n\\n.vjs-icon-twitter {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-twitter:before {\\n content: \\\"\\\\f11a\\\"; }\\n\\n.vjs-icon-tumblr {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-tumblr:before {\\n content: \\\"\\\\f11b\\\"; }\\n\\n.vjs-icon-pinterest {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-pinterest:before {\\n content: \\\"\\\\f11c\\\"; }\\n\\n.vjs-icon-audio-description, .video-js .vjs-descriptions-button .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-audio-description:before, .video-js .vjs-descriptions-button .vjs-icon-placeholder:before {\\n content: \\\"\\\\f11d\\\"; }\\n\\n.vjs-icon-audio, .video-js .vjs-audio-button .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-audio:before, .video-js .vjs-audio-button .vjs-icon-placeholder:before {\\n content: \\\"\\\\f11e\\\"; }\\n\\n.vjs-icon-next-item {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-next-item:before {\\n content: \\\"\\\\f11f\\\"; }\\n\\n.vjs-icon-previous-item {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-previous-item:before {\\n content: \\\"\\\\f120\\\"; }\\n\\n.video-js {\\n display: block;\\n vertical-align: top;\\n box-sizing: border-box;\\n color: #fff;\\n background-color: #000;\\n position: relative;\\n padding: 0;\\n font-size: 10px;\\n line-height: 1;\\n font-weight: normal;\\n font-style: normal;\\n font-family: Arial, Helvetica, sans-serif;\\n word-break: initial; }\\n .video-js:-moz-full-screen {\\n position: absolute; }\\n .video-js:-webkit-full-screen {\\n width: 100% !important;\\n height: 100% !important; }\\n\\n.video-js[tabindex=\\\"-1\\\"] {\\n outline: none; }\\n\\n.video-js *,\\n.video-js *:before,\\n.video-js *:after {\\n box-sizing: inherit; }\\n\\n.video-js ul {\\n font-family: inherit;\\n font-size: inherit;\\n line-height: inherit;\\n list-style-position: outside;\\n margin-left: 0;\\n margin-right: 0;\\n margin-top: 0;\\n margin-bottom: 0; }\\n\\n.video-js.vjs-fluid,\\n.video-js.vjs-16-9,\\n.video-js.vjs-4-3 {\\n width: 100%;\\n max-width: 100%;\\n height: 0; }\\n\\n.video-js.vjs-16-9 {\\n padding-top: 56.25%; }\\n\\n.video-js.vjs-4-3 {\\n padding-top: 75%; }\\n\\n.video-js.vjs-fill {\\n width: 100%;\\n height: 100%; }\\n\\n.video-js .vjs-tech {\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%; }\\n\\nbody.vjs-full-window {\\n padding: 0;\\n margin: 0;\\n height: 100%; }\\n\\n.vjs-full-window .video-js.vjs-fullscreen {\\n position: fixed;\\n overflow: hidden;\\n z-index: 1000;\\n left: 0;\\n top: 0;\\n bottom: 0;\\n right: 0; }\\n\\n.video-js.vjs-fullscreen {\\n width: 100% !important;\\n height: 100% !important;\\n padding-top: 0 !important; }\\n\\n.video-js.vjs-fullscreen.vjs-user-inactive {\\n cursor: none; }\\n\\n.vjs-hidden {\\n display: none !important; }\\n\\n.vjs-disabled {\\n opacity: 0.5;\\n cursor: default; }\\n\\n.video-js .vjs-offscreen {\\n height: 1px;\\n left: -9999px;\\n position: absolute;\\n top: 0;\\n width: 1px; }\\n\\n.vjs-lock-showing {\\n display: block !important;\\n opacity: 1;\\n visibility: visible; }\\n\\n.vjs-no-js {\\n padding: 20px;\\n color: #fff;\\n background-color: #000;\\n font-size: 18px;\\n font-family: Arial, Helvetica, sans-serif;\\n text-align: center;\\n width: 300px;\\n height: 150px;\\n margin: 0px auto; }\\n\\n.vjs-no-js a,\\n.vjs-no-js a:visited {\\n color: #66A8CC; }\\n\\n.video-js .vjs-big-play-button {\\n font-size: 3em;\\n line-height: 1.5em;\\n height: 1.5em;\\n width: 3em;\\n display: block;\\n position: absolute;\\n top: 10px;\\n left: 10px;\\n padding: 0;\\n cursor: pointer;\\n opacity: 1;\\n border: 0.06666em solid #fff;\\n background-color: #2B333F;\\n background-color: rgba(43, 51, 63, 0.7);\\n border-radius: 0.3em;\\n transition: all 0.4s; }\\n\\n.vjs-big-play-centered .vjs-big-play-button {\\n top: 50%;\\n left: 50%;\\n margin-top: -0.75em;\\n margin-left: -1.5em; }\\n\\n.video-js:hover .vjs-big-play-button,\\n.video-js .vjs-big-play-button:focus {\\n border-color: #fff;\\n background-color: #73859f;\\n background-color: rgba(115, 133, 159, 0.5);\\n transition: all 0s; }\\n\\n.vjs-controls-disabled .vjs-big-play-button,\\n.vjs-has-started .vjs-big-play-button,\\n.vjs-using-native-controls .vjs-big-play-button,\\n.vjs-error .vjs-big-play-button {\\n display: none; }\\n\\n.vjs-has-started.vjs-paused.vjs-show-big-play-button-on-pause .vjs-big-play-button {\\n display: block; }\\n\\n.video-js button {\\n background: none;\\n border: none;\\n color: inherit;\\n display: inline-block;\\n font-size: inherit;\\n line-height: inherit;\\n text-transform: none;\\n text-decoration: none;\\n transition: none;\\n -webkit-appearance: none;\\n -moz-appearance: none;\\n appearance: none; }\\n\\n.vjs-control .vjs-button {\\n width: 100%;\\n height: 100%; }\\n\\n.video-js .vjs-control.vjs-close-button {\\n cursor: pointer;\\n height: 3em;\\n position: absolute;\\n right: 0;\\n top: 0.5em;\\n z-index: 2; }\\n\\n.video-js .vjs-modal-dialog {\\n background: rgba(0, 0, 0, 0.8);\\n background: linear-gradient(180deg, rgba(0, 0, 0, 0.8), rgba(255, 255, 255, 0));\\n overflow: auto; }\\n\\n.video-js .vjs-modal-dialog > * {\\n box-sizing: border-box; }\\n\\n.vjs-modal-dialog .vjs-modal-dialog-content {\\n font-size: 1.2em;\\n line-height: 1.5;\\n padding: 20px 24px;\\n z-index: 1; }\\n\\n.vjs-menu-button {\\n cursor: pointer; }\\n\\n.vjs-menu-button.vjs-disabled {\\n cursor: default; }\\n\\n.vjs-workinghover .vjs-menu-button.vjs-disabled:hover .vjs-menu {\\n display: none; }\\n\\n.vjs-menu .vjs-menu-content {\\n display: block;\\n padding: 0;\\n margin: 0;\\n font-family: Arial, Helvetica, sans-serif;\\n overflow: auto; }\\n\\n.vjs-menu .vjs-menu-content > * {\\n box-sizing: border-box; }\\n\\n.vjs-scrubbing .vjs-control.vjs-menu-button:hover .vjs-menu {\\n display: none; }\\n\\n.vjs-menu li {\\n list-style: none;\\n margin: 0;\\n padding: 0.2em 0;\\n line-height: 1.4em;\\n font-size: 1.2em;\\n text-align: center;\\n text-transform: lowercase; }\\n\\n.vjs-menu li.vjs-menu-item:focus,\\n.vjs-menu li.vjs-menu-item:hover,\\n.js-focus-visible .vjs-menu li.vjs-menu-item:hover {\\n background-color: #73859f;\\n background-color: rgba(115, 133, 159, 0.5); }\\n\\n.vjs-menu li.vjs-selected,\\n.vjs-menu li.vjs-selected:focus,\\n.vjs-menu li.vjs-selected:hover,\\n.js-focus-visible .vjs-menu li.vjs-selected:hover {\\n background-color: #fff;\\n color: #2B333F; }\\n\\n.vjs-menu li.vjs-menu-title {\\n text-align: center;\\n text-transform: uppercase;\\n font-size: 1em;\\n line-height: 2em;\\n padding: 0;\\n margin: 0 0 0.3em 0;\\n font-weight: bold;\\n cursor: default; }\\n\\n.vjs-menu-button-popup .vjs-menu {\\n display: none;\\n position: absolute;\\n bottom: 0;\\n width: 10em;\\n left: -3em;\\n height: 0em;\\n margin-bottom: 1.5em;\\n border-top-color: rgba(43, 51, 63, 0.7); }\\n\\n.vjs-menu-button-popup .vjs-menu .vjs-menu-content {\\n background-color: #2B333F;\\n background-color: rgba(43, 51, 63, 0.7);\\n position: absolute;\\n width: 100%;\\n bottom: 1.5em;\\n max-height: 15em; }\\n\\n.vjs-workinghover .vjs-menu-button-popup:hover .vjs-menu,\\n.vjs-menu-button-popup .vjs-menu.vjs-lock-showing {\\n display: block; }\\n\\n.video-js .vjs-menu-button-inline {\\n transition: all 0.4s;\\n overflow: hidden; }\\n\\n.video-js .vjs-menu-button-inline:before {\\n width: 2.222222222em; }\\n\\n.video-js .vjs-menu-button-inline:hover,\\n.video-js .vjs-menu-button-inline:focus,\\n.video-js .vjs-menu-button-inline.vjs-slider-active,\\n.video-js.vjs-no-flex .vjs-menu-button-inline {\\n width: 12em; }\\n\\n.vjs-menu-button-inline .vjs-menu {\\n opacity: 0;\\n height: 100%;\\n width: auto;\\n position: absolute;\\n left: 4em;\\n top: 0;\\n padding: 0;\\n margin: 0;\\n transition: all 0.4s; }\\n\\n.vjs-menu-button-inline:hover .vjs-menu,\\n.vjs-menu-button-inline:focus .vjs-menu,\\n.vjs-menu-button-inline.vjs-slider-active .vjs-menu {\\n display: block;\\n opacity: 1; }\\n\\n.vjs-no-flex .vjs-menu-button-inline .vjs-menu {\\n display: block;\\n opacity: 1;\\n position: relative;\\n width: auto; }\\n\\n.vjs-no-flex .vjs-menu-button-inline:hover .vjs-menu,\\n.vjs-no-flex .vjs-menu-button-inline:focus .vjs-menu,\\n.vjs-no-flex .vjs-menu-button-inline.vjs-slider-active .vjs-menu {\\n width: auto; }\\n\\n.vjs-menu-button-inline .vjs-menu-content {\\n width: auto;\\n height: 100%;\\n margin: 0;\\n overflow: hidden; }\\n\\n.video-js .vjs-control-bar {\\n display: none;\\n width: 100%;\\n position: absolute;\\n bottom: 0;\\n left: 0;\\n right: 0;\\n height: 3.0em;\\n background-color: #2B333F;\\n background-color: rgba(43, 51, 63, 0.7); }\\n\\n.vjs-has-started .vjs-control-bar {\\n display: flex;\\n visibility: visible;\\n opacity: 1;\\n transition: visibility 0.1s, opacity 0.1s; }\\n\\n.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar {\\n visibility: visible;\\n opacity: 0;\\n transition: visibility 1s, opacity 1s; }\\n\\n.vjs-controls-disabled .vjs-control-bar,\\n.vjs-using-native-controls .vjs-control-bar,\\n.vjs-error .vjs-control-bar {\\n display: none !important; }\\n\\n.vjs-audio.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar {\\n opacity: 1;\\n visibility: visible; }\\n\\n.vjs-has-started.vjs-no-flex .vjs-control-bar {\\n display: table; }\\n\\n.video-js .vjs-control {\\n position: relative;\\n text-align: center;\\n margin: 0;\\n padding: 0;\\n height: 100%;\\n width: 4em;\\n flex: none; }\\n\\n.vjs-button > .vjs-icon-placeholder:before {\\n font-size: 1.8em;\\n line-height: 1.67; }\\n\\n.video-js .vjs-control:focus:before,\\n.video-js .vjs-control:hover:before,\\n.video-js .vjs-control:focus {\\n text-shadow: 0em 0em 1em white; }\\n\\n.video-js .vjs-control-text {\\n border: 0;\\n clip: rect(0 0 0 0);\\n height: 1px;\\n overflow: hidden;\\n padding: 0;\\n position: absolute;\\n width: 1px; }\\n\\n.vjs-no-flex .vjs-control {\\n display: table-cell;\\n vertical-align: middle; }\\n\\n.video-js .vjs-custom-control-spacer {\\n display: none; }\\n\\n.video-js .vjs-progress-control {\\n cursor: pointer;\\n flex: auto;\\n display: flex;\\n align-items: center;\\n min-width: 4em;\\n touch-action: none; }\\n\\n.video-js .vjs-progress-control.disabled {\\n cursor: default; }\\n\\n.vjs-live .vjs-progress-control {\\n display: none; }\\n\\n.vjs-liveui .vjs-progress-control {\\n display: flex;\\n align-items: center; }\\n\\n.vjs-no-flex .vjs-progress-control {\\n width: auto; }\\n\\n.video-js .vjs-progress-holder {\\n flex: auto;\\n transition: all 0.2s;\\n height: 0.3em; }\\n\\n.video-js .vjs-progress-control .vjs-progress-holder {\\n margin: 0 10px; }\\n\\n.video-js .vjs-progress-control:hover .vjs-progress-holder {\\n font-size: 1.666666666666666666em; }\\n\\n.video-js .vjs-progress-control:hover .vjs-progress-holder.disabled {\\n font-size: 1em; }\\n\\n.video-js .vjs-progress-holder .vjs-play-progress,\\n.video-js .vjs-progress-holder .vjs-load-progress,\\n.video-js .vjs-progress-holder .vjs-load-progress div {\\n position: absolute;\\n display: block;\\n height: 100%;\\n margin: 0;\\n padding: 0;\\n width: 0; }\\n\\n.video-js .vjs-play-progress {\\n background-color: #fff; }\\n .video-js .vjs-play-progress:before {\\n font-size: 0.9em;\\n position: absolute;\\n right: -0.5em;\\n top: -0.333333333333333em;\\n z-index: 1; }\\n\\n.video-js .vjs-load-progress {\\n background: rgba(115, 133, 159, 0.5); }\\n\\n.video-js .vjs-load-progress div {\\n background: rgba(115, 133, 159, 0.75); }\\n\\n.video-js .vjs-time-tooltip {\\n background-color: #fff;\\n background-color: rgba(255, 255, 255, 0.8);\\n border-radius: 0.3em;\\n color: #000;\\n float: right;\\n font-family: Arial, Helvetica, sans-serif;\\n font-size: 1em;\\n padding: 6px 8px 8px 8px;\\n pointer-events: none;\\n position: absolute;\\n top: -3.4em;\\n visibility: hidden;\\n z-index: 1; }\\n\\n.video-js .vjs-progress-holder:focus .vjs-time-tooltip {\\n display: none; }\\n\\n.video-js .vjs-progress-control:hover .vjs-time-tooltip,\\n.video-js .vjs-progress-control:hover .vjs-progress-holder:focus .vjs-time-tooltip {\\n display: block;\\n font-size: 0.6em;\\n visibility: visible; }\\n\\n.video-js .vjs-progress-control.disabled:hover .vjs-time-tooltip {\\n font-size: 1em; }\\n\\n.video-js .vjs-progress-control .vjs-mouse-display {\\n display: none;\\n position: absolute;\\n width: 1px;\\n height: 100%;\\n background-color: #000;\\n z-index: 1; }\\n\\n.vjs-no-flex .vjs-progress-control .vjs-mouse-display {\\n z-index: 0; }\\n\\n.video-js .vjs-progress-control:hover .vjs-mouse-display {\\n display: block; }\\n\\n.video-js.vjs-user-inactive .vjs-progress-control .vjs-mouse-display {\\n visibility: hidden;\\n opacity: 0;\\n transition: visibility 1s, opacity 1s; }\\n\\n.video-js.vjs-user-inactive.vjs-no-flex .vjs-progress-control .vjs-mouse-display {\\n display: none; }\\n\\n.vjs-mouse-display .vjs-time-tooltip {\\n color: #fff;\\n background-color: #000;\\n background-color: rgba(0, 0, 0, 0.8); }\\n\\n.video-js .vjs-slider {\\n position: relative;\\n cursor: pointer;\\n padding: 0;\\n margin: 0 0.45em 0 0.45em;\\n /* iOS Safari */\\n -webkit-touch-callout: none;\\n /* Safari */\\n -webkit-user-select: none;\\n /* Konqueror HTML */\\n /* Firefox */\\n -moz-user-select: none;\\n /* Internet Explorer/Edge */\\n -ms-user-select: none;\\n /* Non-prefixed version, currently supported by Chrome and Opera */\\n user-select: none;\\n background-color: #73859f;\\n background-color: rgba(115, 133, 159, 0.5); }\\n\\n.video-js .vjs-slider.disabled {\\n cursor: default; }\\n\\n.video-js .vjs-slider:focus {\\n text-shadow: 0em 0em 1em white;\\n box-shadow: 0 0 1em #fff; }\\n\\n.video-js .vjs-mute-control {\\n cursor: pointer;\\n flex: none; }\\n\\n.video-js .vjs-volume-control {\\n cursor: pointer;\\n margin-right: 1em;\\n display: flex; }\\n\\n.video-js .vjs-volume-control.vjs-volume-horizontal {\\n width: 5em; }\\n\\n.video-js .vjs-volume-panel .vjs-volume-control {\\n visibility: visible;\\n opacity: 0;\\n width: 1px;\\n height: 1px;\\n margin-left: -1px; }\\n\\n.video-js .vjs-volume-panel {\\n transition: width 1s; }\\n .video-js .vjs-volume-panel:hover .vjs-volume-control,\\n .video-js .vjs-volume-panel:active .vjs-volume-control,\\n .video-js .vjs-volume-panel:focus .vjs-volume-control,\\n .video-js .vjs-volume-panel .vjs-volume-control:hover,\\n .video-js .vjs-volume-panel .vjs-volume-control:active,\\n .video-js .vjs-volume-panel .vjs-mute-control:hover ~ .vjs-volume-control,\\n .video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active {\\n visibility: visible;\\n opacity: 1;\\n position: relative;\\n transition: visibility 0.1s, opacity 0.1s, height 0.1s, width 0.1s, left 0s, top 0s; }\\n .video-js .vjs-volume-panel:hover .vjs-volume-control.vjs-volume-horizontal,\\n .video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal,\\n .video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal,\\n .video-js .vjs-volume-panel .vjs-volume-control:hover.vjs-volume-horizontal,\\n .video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-horizontal,\\n .video-js .vjs-volume-panel .vjs-mute-control:hover ~ .vjs-volume-control.vjs-volume-horizontal,\\n .video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-horizontal {\\n width: 5em;\\n height: 3em; }\\n .video-js .vjs-volume-panel:hover .vjs-volume-control.vjs-volume-vertical,\\n .video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical,\\n .video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical,\\n .video-js .vjs-volume-panel .vjs-volume-control:hover.vjs-volume-vertical,\\n .video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical,\\n .video-js .vjs-volume-panel .vjs-mute-control:hover ~ .vjs-volume-control.vjs-volume-vertical,\\n .video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical {\\n left: -3.5em; }\\n .video-js .vjs-volume-panel.vjs-volume-panel-horizontal:hover, .video-js .vjs-volume-panel.vjs-volume-panel-horizontal:active, .video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active {\\n width: 9em;\\n transition: width 0.1s; }\\n .video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-mute-toggle-only {\\n width: 4em; }\\n\\n.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical {\\n height: 8em;\\n width: 3em;\\n left: -3000em;\\n transition: visibility 1s, opacity 1s, height 1s 1s, width 1s 1s, left 1s 1s, top 1s 1s; }\\n\\n.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal {\\n transition: visibility 1s, opacity 1s, height 1s 1s, width 1s, left 1s 1s, top 1s 1s; }\\n\\n.video-js.vjs-no-flex .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal {\\n width: 5em;\\n height: 3em;\\n visibility: visible;\\n opacity: 1;\\n position: relative;\\n transition: none; }\\n\\n.video-js.vjs-no-flex .vjs-volume-control.vjs-volume-vertical,\\n.video-js.vjs-no-flex .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical {\\n position: absolute;\\n bottom: 3em;\\n left: 0.5em; }\\n\\n.video-js .vjs-volume-panel {\\n display: flex; }\\n\\n.video-js .vjs-volume-bar {\\n margin: 1.35em 0.45em; }\\n\\n.vjs-volume-bar.vjs-slider-horizontal {\\n width: 5em;\\n height: 0.3em; }\\n\\n.vjs-volume-bar.vjs-slider-vertical {\\n width: 0.3em;\\n height: 5em;\\n margin: 1.35em auto; }\\n\\n.video-js .vjs-volume-level {\\n position: absolute;\\n bottom: 0;\\n left: 0;\\n background-color: #fff; }\\n .video-js .vjs-volume-level:before {\\n position: absolute;\\n font-size: 0.9em; }\\n\\n.vjs-slider-vertical .vjs-volume-level {\\n width: 0.3em; }\\n .vjs-slider-vertical .vjs-volume-level:before {\\n top: -0.5em;\\n left: -0.3em; }\\n\\n.vjs-slider-horizontal .vjs-volume-level {\\n height: 0.3em; }\\n .vjs-slider-horizontal .vjs-volume-level:before {\\n top: -0.3em;\\n right: -0.5em; }\\n\\n.video-js .vjs-volume-panel.vjs-volume-panel-vertical {\\n width: 4em; }\\n\\n.vjs-volume-bar.vjs-slider-vertical .vjs-volume-level {\\n height: 100%; }\\n\\n.vjs-volume-bar.vjs-slider-horizontal .vjs-volume-level {\\n width: 100%; }\\n\\n.video-js .vjs-volume-vertical {\\n width: 3em;\\n height: 8em;\\n bottom: 8em;\\n background-color: #2B333F;\\n background-color: rgba(43, 51, 63, 0.7); }\\n\\n.video-js .vjs-volume-horizontal .vjs-menu {\\n left: -2em; }\\n\\n.vjs-poster {\\n display: inline-block;\\n vertical-align: middle;\\n background-repeat: no-repeat;\\n background-position: 50% 50%;\\n background-size: contain;\\n background-color: #000000;\\n cursor: pointer;\\n margin: 0;\\n padding: 0;\\n position: absolute;\\n top: 0;\\n right: 0;\\n bottom: 0;\\n left: 0;\\n height: 100%; }\\n\\n.vjs-has-started .vjs-poster {\\n display: none; }\\n\\n.vjs-audio.vjs-has-started .vjs-poster {\\n display: block; }\\n\\n.vjs-using-native-controls .vjs-poster {\\n display: none; }\\n\\n.video-js .vjs-live-control {\\n display: flex;\\n align-items: flex-start;\\n flex: auto;\\n font-size: 1em;\\n line-height: 3em; }\\n\\n.vjs-no-flex .vjs-live-control {\\n display: table-cell;\\n width: auto;\\n text-align: left; }\\n\\n.video-js:not(.vjs-live) .vjs-live-control,\\n.video-js.vjs-liveui .vjs-live-control {\\n display: none; }\\n\\n.video-js .vjs-seek-to-live-control {\\n cursor: pointer;\\n flex: none;\\n display: inline-flex;\\n height: 100%;\\n padding-left: 0.5em;\\n padding-right: 0.5em;\\n font-size: 1em;\\n line-height: 3em;\\n width: auto;\\n min-width: 4em; }\\n\\n.vjs-no-flex .vjs-seek-to-live-control {\\n display: table-cell;\\n width: auto;\\n text-align: left; }\\n\\n.video-js.vjs-live:not(.vjs-liveui) .vjs-seek-to-live-control,\\n.video-js:not(.vjs-live) .vjs-seek-to-live-control {\\n display: none; }\\n\\n.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge {\\n cursor: auto; }\\n\\n.vjs-seek-to-live-control .vjs-icon-placeholder {\\n margin-right: 0.5em;\\n color: #888; }\\n\\n.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-icon-placeholder {\\n color: red; }\\n\\n.video-js .vjs-time-control {\\n flex: none;\\n font-size: 1em;\\n line-height: 3em;\\n min-width: 2em;\\n width: auto;\\n padding-left: 1em;\\n padding-right: 1em; }\\n\\n.vjs-live .vjs-time-control {\\n display: none; }\\n\\n.video-js .vjs-current-time,\\n.vjs-no-flex .vjs-current-time {\\n display: none; }\\n\\n.video-js .vjs-duration,\\n.vjs-no-flex .vjs-duration {\\n display: none; }\\n\\n.vjs-time-divider {\\n display: none;\\n line-height: 3em; }\\n\\n.vjs-live .vjs-time-divider {\\n display: none; }\\n\\n.video-js .vjs-play-control {\\n cursor: pointer; }\\n\\n.video-js .vjs-play-control .vjs-icon-placeholder {\\n flex: none; }\\n\\n.vjs-text-track-display {\\n position: absolute;\\n bottom: 3em;\\n left: 0;\\n right: 0;\\n top: 0;\\n pointer-events: none; }\\n\\n.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display {\\n bottom: 1em; }\\n\\n.video-js .vjs-text-track {\\n font-size: 1.4em;\\n text-align: center;\\n margin-bottom: 0.1em; }\\n\\n.vjs-subtitles {\\n color: #fff; }\\n\\n.vjs-captions {\\n color: #fc6; }\\n\\n.vjs-tt-cue {\\n display: block; }\\n\\nvideo::-webkit-media-text-track-display {\\n -webkit-transform: translateY(-3em);\\n transform: translateY(-3em); }\\n\\n.video-js.vjs-user-inactive.vjs-playing video::-webkit-media-text-track-display {\\n -webkit-transform: translateY(-1.5em);\\n transform: translateY(-1.5em); }\\n\\n.video-js .vjs-fullscreen-control {\\n cursor: pointer;\\n flex: none; }\\n\\n.vjs-playback-rate > .vjs-menu-button,\\n.vjs-playback-rate .vjs-playback-rate-value {\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%; }\\n\\n.vjs-playback-rate .vjs-playback-rate-value {\\n pointer-events: none;\\n font-size: 1.5em;\\n line-height: 2;\\n text-align: center; }\\n\\n.vjs-playback-rate .vjs-menu {\\n width: 4em;\\n left: 0em; }\\n\\n.vjs-error .vjs-error-display .vjs-modal-dialog-content {\\n font-size: 1.4em;\\n text-align: center; }\\n\\n.vjs-error .vjs-error-display:before {\\n color: #fff;\\n content: 'X';\\n font-family: Arial, Helvetica, sans-serif;\\n font-size: 4em;\\n left: 0;\\n line-height: 1;\\n margin-top: -0.5em;\\n position: absolute;\\n text-shadow: 0.05em 0.05em 0.1em #000;\\n text-align: center;\\n top: 50%;\\n vertical-align: middle;\\n width: 100%; }\\n\\n.vjs-loading-spinner {\\n display: none;\\n position: absolute;\\n top: 50%;\\n left: 50%;\\n margin: -25px 0 0 -25px;\\n opacity: 0.85;\\n text-align: left;\\n border: 6px solid rgba(43, 51, 63, 0.7);\\n box-sizing: border-box;\\n background-clip: padding-box;\\n width: 50px;\\n height: 50px;\\n border-radius: 25px;\\n visibility: hidden; }\\n\\n.vjs-seeking .vjs-loading-spinner,\\n.vjs-waiting .vjs-loading-spinner {\\n display: block;\\n -webkit-animation: 0s linear 0.3s forwards vjs-spinner-show;\\n animation: 0s linear 0.3s forwards vjs-spinner-show; }\\n\\n.vjs-loading-spinner:before,\\n.vjs-loading-spinner:after {\\n content: \\\"\\\";\\n position: absolute;\\n margin: -6px;\\n box-sizing: inherit;\\n width: inherit;\\n height: inherit;\\n border-radius: inherit;\\n opacity: 1;\\n border: inherit;\\n border-color: transparent;\\n border-top-color: white; }\\n\\n.vjs-seeking .vjs-loading-spinner:before,\\n.vjs-seeking .vjs-loading-spinner:after,\\n.vjs-waiting .vjs-loading-spinner:before,\\n.vjs-waiting .vjs-loading-spinner:after {\\n -webkit-animation: vjs-spinner-spin 1.1s cubic-bezier(0.6, 0.2, 0, 0.8) infinite, vjs-spinner-fade 1.1s linear infinite;\\n animation: vjs-spinner-spin 1.1s cubic-bezier(0.6, 0.2, 0, 0.8) infinite, vjs-spinner-fade 1.1s linear infinite; }\\n\\n.vjs-seeking .vjs-loading-spinner:before,\\n.vjs-waiting .vjs-loading-spinner:before {\\n border-top-color: white; }\\n\\n.vjs-seeking .vjs-loading-spinner:after,\\n.vjs-waiting .vjs-loading-spinner:after {\\n border-top-color: white;\\n -webkit-animation-delay: 0.44s;\\n animation-delay: 0.44s; }\\n\\n@keyframes vjs-spinner-show {\\n to {\\n visibility: visible; } }\\n\\n@-webkit-keyframes vjs-spinner-show {\\n to {\\n visibility: visible; } }\\n\\n@keyframes vjs-spinner-spin {\\n 100% {\\n -webkit-transform: rotate(360deg);\\n transform: rotate(360deg); } }\\n\\n@-webkit-keyframes vjs-spinner-spin {\\n 100% {\\n -webkit-transform: rotate(360deg); } }\\n\\n@keyframes vjs-spinner-fade {\\n 0% {\\n border-top-color: #73859f; }\\n 20% {\\n border-top-color: #73859f; }\\n 35% {\\n border-top-color: white; }\\n 60% {\\n border-top-color: #73859f; }\\n 100% {\\n border-top-color: #73859f; } }\\n\\n@-webkit-keyframes vjs-spinner-fade {\\n 0% {\\n border-top-color: #73859f; }\\n 20% {\\n border-top-color: #73859f; }\\n 35% {\\n border-top-color: white; }\\n 60% {\\n border-top-color: #73859f; }\\n 100% {\\n border-top-color: #73859f; } }\\n\\n.vjs-chapters-button .vjs-menu ul {\\n width: 24em; }\\n\\n.video-js .vjs-subs-caps-button + .vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder {\\n vertical-align: middle;\\n display: inline-block;\\n margin-bottom: -0.1em; }\\n\\n.video-js .vjs-subs-caps-button + .vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before {\\n font-family: VideoJS;\\n content: \\\"\\\\f10d\\\";\\n font-size: 1.5em;\\n line-height: inherit; }\\n\\n.video-js .vjs-audio-button + .vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder {\\n vertical-align: middle;\\n display: inline-block;\\n margin-bottom: -0.1em; }\\n\\n.video-js .vjs-audio-button + .vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before {\\n font-family: VideoJS;\\n content: \\\" \\\\f11d\\\";\\n font-size: 1.5em;\\n line-height: inherit; }\\n\\n.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-custom-control-spacer {\\n flex: auto;\\n display: block; }\\n\\n.video-js.vjs-layout-tiny:not(.vjs-fullscreen).vjs-no-flex .vjs-custom-control-spacer {\\n width: auto; }\\n\\n.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-current-time, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-time-divider, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-duration, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-remaining-time,\\n.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-playback-rate, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-progress-control,\\n.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-mute-control, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-volume-control, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-volume-panel,\\n.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-chapters-button, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-descriptions-button, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-captions-button,\\n.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-subtitles-button, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-subs-caps-button, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-audio-button {\\n display: none; }\\n\\n.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-current-time, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-time-divider, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-duration, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-remaining-time,\\n.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-playback-rate,\\n.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-mute-control, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-volume-control, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-volume-panel,\\n.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-chapters-button, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-descriptions-button, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-captions-button,\\n.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-subtitles-button, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-subs-caps-button, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-audio-button {\\n display: none; }\\n\\n.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-current-time, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-time-divider, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-duration, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-remaining-time,\\n.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-playback-rate,\\n.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-mute-control, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-volume-control, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-volume-panel,\\n.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-chapters-button, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-descriptions-button, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-captions-button,\\n.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-subtitles-button, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-audio-button {\\n display: none; }\\n\\n.vjs-modal-dialog.vjs-text-track-settings {\\n background-color: #2B333F;\\n background-color: rgba(43, 51, 63, 0.75);\\n color: #fff;\\n height: 70%; }\\n\\n.vjs-text-track-settings .vjs-modal-dialog-content {\\n display: table; }\\n\\n.vjs-text-track-settings .vjs-track-settings-colors,\\n.vjs-text-track-settings .vjs-track-settings-font,\\n.vjs-text-track-settings .vjs-track-settings-controls {\\n display: table-cell; }\\n\\n.vjs-text-track-settings .vjs-track-settings-controls {\\n text-align: right;\\n vertical-align: bottom; }\\n\\n@supports (display: grid) {\\n .vjs-text-track-settings .vjs-modal-dialog-content {\\n display: grid;\\n grid-template-columns: 1fr 1fr;\\n grid-template-rows: 1fr;\\n padding: 20px 24px 0px 24px; }\\n .vjs-track-settings-controls .vjs-default-button {\\n margin-bottom: 20px; }\\n .vjs-text-track-settings .vjs-track-settings-controls {\\n grid-column: 1 / -1; }\\n .vjs-layout-small .vjs-text-track-settings .vjs-modal-dialog-content,\\n .vjs-layout-x-small .vjs-text-track-settings .vjs-modal-dialog-content,\\n .vjs-layout-tiny .vjs-text-track-settings .vjs-modal-dialog-content {\\n grid-template-columns: 1fr; } }\\n\\n.vjs-track-setting > select {\\n margin-right: 1em;\\n margin-bottom: 0.5em; }\\n\\n.vjs-text-track-settings fieldset {\\n margin: 5px;\\n padding: 3px;\\n border: none; }\\n\\n.vjs-text-track-settings fieldset span {\\n display: inline-block; }\\n\\n.vjs-text-track-settings fieldset span > select {\\n max-width: 7.3em; }\\n\\n.vjs-text-track-settings legend {\\n color: #fff;\\n margin: 0 0 5px 0; }\\n\\n.vjs-text-track-settings .vjs-label {\\n position: absolute;\\n clip: rect(1px 1px 1px 1px);\\n clip: rect(1px, 1px, 1px, 1px);\\n display: block;\\n margin: 0 0 5px 0;\\n padding: 0;\\n border: 0;\\n height: 1px;\\n width: 1px;\\n overflow: hidden; }\\n\\n.vjs-track-settings-controls button:focus,\\n.vjs-track-settings-controls button:active {\\n outline-style: solid;\\n outline-width: medium;\\n background-image: linear-gradient(0deg, #fff 88%, #73859f 100%); }\\n\\n.vjs-track-settings-controls button:hover {\\n color: rgba(43, 51, 63, 0.75); }\\n\\n.vjs-track-settings-controls button {\\n background-color: #fff;\\n background-image: linear-gradient(-180deg, #fff 88%, #73859f 100%);\\n color: #2B333F;\\n cursor: pointer;\\n border-radius: 2px; }\\n\\n.vjs-track-settings-controls .vjs-default-button {\\n margin-right: 1em; }\\n\\n@media print {\\n .video-js > *:not(.vjs-tech):not(.vjs-poster) {\\n visibility: hidden; } }\\n\\n.vjs-resize-manager {\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%;\\n border: none;\\n z-index: -1000; }\\n\\n.js-focus-visible .video-js *:focus:not(.focus-visible) {\\n outline: none;\\n background: none; }\\n\\n.video-js *:focus:not(:focus-visible),\\n.video-js .vjs-menu *:focus:not(:focus-visible) {\\n outline: none;\\n background: none; }\\n\", \"\",{\"version\":3,\"sources\":[\"webpack://node_modules/video.js/dist/video-js.css\"],\"names\":[],\"mappings\":\"AAAA;EACE,kBAAkB;EAClB,MAAM;EACN,OAAO;EACP,WAAW;EACX,YAAY,EAAE;;AAEhB;EACE,kBAAkB,EAAE;;AAEtB;EACE,oBAAoB;EACpB,igLAAigL;EACjgL,mBAAmB;EACnB,kBAAkB,EAAE;;AAEtB;EACE,oBAAoB;EACpB,mBAAmB;EACnB,kBAAkB,EAAE;EACpB;IACE,gBAAgB,EAAE;;AAEtB;EACE,oBAAoB;EACpB,mBAAmB;EACnB,kBAAkB,EAAE;EACpB;IACE,gBAAgB,EAAE;;AAEtB;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AAsB,EAAE;;AAE1B;EACE;IACE,aAAa;IACb,8BAA8B;IAC9B,uBAAuB;IACvB,2BAA2B,EAAE;EAC/B;IACE,mBAAmB,EAAE;EACvB;IACE,mBAAmB,EAAE;EACvB;;;IAGE,0BAA0B,EAAE,EAAE;;AAElC;EACE,iBAAiB;EACjB,oBAAoB,EAAE;;AAExB;EACE,WAAW;EACX,YAAY;EACZ,YAAY,EAAE;;AAEhB;EACE,qBAAqB,EAAE;;AAEzB;EACE,gBAAgB,EAAE;;AAEpB;EACE,WAAW;EACX,iBAAiB,EAAE;;AAErB;EACE,kBAAkB;EAClB,2BAA2B;EAC3B,8BAA8B;EAC9B,cAAc;EACd,iBAAiB;EACjB,UAAU;EACV,SAAS;EACT,WAAW;EACX,UAAU;EACV,gBAAgB,EAAE;;AAEpB;;EAEE,oBAAoB;EACpB,qBAAqB;EACrB,+DAA+D,EAAE;;AAEnE;EACE,6BAA6B,EAAE;;AAEjC;EACE,sBAAsB;EACtB,kEAAkE;EAClE,cAAc;EACd,eAAe;EACf,kBAAkB,EAAE;;AAEtB;EACE,iBAAiB,EAAE;;AAErB;EACE;IACE,kBAAkB,EAAE,EAAE;;AAE1B;EACE,kBAAkB;EAClB,MAAM;EACN,OAAO;EACP,WAAW;EACX,YAAY;EACZ,YAAY;EACZ,cAAc,EAAE;;AAElB;EACE,aAAa;EACb,gBAAgB,EAAE;;AAEpB;;EAEE,aAAa;EACb,gBAAgB,EAAE\",\"sourcesContent\":[\".video-js .vjs-big-play-button .vjs-icon-placeholder:before, .vjs-button > .vjs-icon-placeholder:before, .video-js .vjs-modal-dialog, .vjs-modal-dialog .vjs-modal-dialog-content {\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%; }\\n\\n.video-js .vjs-big-play-button .vjs-icon-placeholder:before, .vjs-button > .vjs-icon-placeholder:before {\\n text-align: center; }\\n\\n@font-face {\\n font-family: VideoJS;\\n src: url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAA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HU0ZF1qatjZ1+aTXYCmp6u0gSvWNPyHLtFZ+ZeXWVSaEkqs3T8S74WklbGbNNNq4LL4+CWKtZDv2cfX8l8aFbKFhEnJnJ+IULFpqwoQnNHlHaVQtPBl+ypmbSWdmyC61KS/AKZC3Y+AA==) format(\\\"woff\\\");\\n font-weight: normal;\\n font-style: normal; }\\n\\n.vjs-icon-play, .video-js .vjs-big-play-button .vjs-icon-placeholder:before, .video-js .vjs-play-control .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-play:before, .video-js .vjs-big-play-button .vjs-icon-placeholder:before, .video-js .vjs-play-control .vjs-icon-placeholder:before {\\n content: \\\"\\\\f101\\\"; }\\n\\n.vjs-icon-play-circle {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-play-circle:before {\\n content: \\\"\\\\f102\\\"; }\\n\\n.vjs-icon-pause, .video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-pause:before, .video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before {\\n content: \\\"\\\\f103\\\"; }\\n\\n.vjs-icon-volume-mute, .video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-volume-mute:before, .video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before {\\n content: \\\"\\\\f104\\\"; }\\n\\n.vjs-icon-volume-low, .video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-volume-low:before, .video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before {\\n content: \\\"\\\\f105\\\"; }\\n\\n.vjs-icon-volume-mid, .video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-volume-mid:before, .video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before {\\n content: \\\"\\\\f106\\\"; }\\n\\n.vjs-icon-volume-high, .video-js .vjs-mute-control .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-volume-high:before, .video-js .vjs-mute-control .vjs-icon-placeholder:before {\\n content: \\\"\\\\f107\\\"; }\\n\\n.vjs-icon-fullscreen-enter, .video-js .vjs-fullscreen-control .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-fullscreen-enter:before, .video-js .vjs-fullscreen-control .vjs-icon-placeholder:before {\\n content: \\\"\\\\f108\\\"; }\\n\\n.vjs-icon-fullscreen-exit, .video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-fullscreen-exit:before, .video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before {\\n content: \\\"\\\\f109\\\"; }\\n\\n.vjs-icon-square {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-square:before {\\n content: \\\"\\\\f10a\\\"; }\\n\\n.vjs-icon-spinner {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-spinner:before {\\n content: \\\"\\\\f10b\\\"; }\\n\\n.vjs-icon-subtitles, .video-js .vjs-subtitles-button .vjs-icon-placeholder, .video-js .vjs-subs-caps-button .vjs-icon-placeholder,\\n.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder,\\n.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder,\\n.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder,\\n.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-subtitles:before, .video-js .vjs-subtitles-button .vjs-icon-placeholder:before, .video-js .vjs-subs-caps-button .vjs-icon-placeholder:before,\\n .video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder:before,\\n .video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder:before,\\n .video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder:before,\\n .video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder:before {\\n content: \\\"\\\\f10c\\\"; }\\n\\n.vjs-icon-captions, .video-js .vjs-captions-button .vjs-icon-placeholder, .video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,\\n.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-captions:before, .video-js .vjs-captions-button .vjs-icon-placeholder:before, .video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before,\\n .video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before {\\n content: \\\"\\\\f10d\\\"; }\\n\\n.vjs-icon-chapters, .video-js .vjs-chapters-button .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-chapters:before, .video-js .vjs-chapters-button .vjs-icon-placeholder:before {\\n content: \\\"\\\\f10e\\\"; }\\n\\n.vjs-icon-share {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-share:before {\\n content: \\\"\\\\f10f\\\"; }\\n\\n.vjs-icon-cog {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-cog:before {\\n content: \\\"\\\\f110\\\"; }\\n\\n.vjs-icon-circle, .video-js .vjs-play-progress, .video-js .vjs-volume-level, .vjs-seek-to-live-control .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-circle:before, .video-js .vjs-play-progress:before, .video-js .vjs-volume-level:before, .vjs-seek-to-live-control .vjs-icon-placeholder:before {\\n content: \\\"\\\\f111\\\"; }\\n\\n.vjs-icon-circle-outline {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-circle-outline:before {\\n content: \\\"\\\\f112\\\"; }\\n\\n.vjs-icon-circle-inner-circle {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-circle-inner-circle:before {\\n content: \\\"\\\\f113\\\"; }\\n\\n.vjs-icon-hd {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-hd:before {\\n content: \\\"\\\\f114\\\"; }\\n\\n.vjs-icon-cancel, .video-js .vjs-control.vjs-close-button .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-cancel:before, .video-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before {\\n content: \\\"\\\\f115\\\"; }\\n\\n.vjs-icon-replay, .video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-replay:before, .video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before {\\n content: \\\"\\\\f116\\\"; }\\n\\n.vjs-icon-facebook {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-facebook:before {\\n content: \\\"\\\\f117\\\"; }\\n\\n.vjs-icon-gplus {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-gplus:before {\\n content: \\\"\\\\f118\\\"; }\\n\\n.vjs-icon-linkedin {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-linkedin:before {\\n content: \\\"\\\\f119\\\"; }\\n\\n.vjs-icon-twitter {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-twitter:before {\\n content: \\\"\\\\f11a\\\"; }\\n\\n.vjs-icon-tumblr {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-tumblr:before {\\n content: \\\"\\\\f11b\\\"; }\\n\\n.vjs-icon-pinterest {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-pinterest:before {\\n content: \\\"\\\\f11c\\\"; }\\n\\n.vjs-icon-audio-description, .video-js .vjs-descriptions-button .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-audio-description:before, .video-js .vjs-descriptions-button .vjs-icon-placeholder:before {\\n content: \\\"\\\\f11d\\\"; }\\n\\n.vjs-icon-audio, .video-js .vjs-audio-button .vjs-icon-placeholder {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-audio:before, .video-js .vjs-audio-button .vjs-icon-placeholder:before {\\n content: \\\"\\\\f11e\\\"; }\\n\\n.vjs-icon-next-item {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-next-item:before {\\n content: \\\"\\\\f11f\\\"; }\\n\\n.vjs-icon-previous-item {\\n font-family: VideoJS;\\n font-weight: normal;\\n font-style: normal; }\\n .vjs-icon-previous-item:before {\\n content: \\\"\\\\f120\\\"; }\\n\\n.video-js {\\n display: block;\\n vertical-align: top;\\n box-sizing: border-box;\\n color: #fff;\\n background-color: #000;\\n position: relative;\\n padding: 0;\\n font-size: 10px;\\n line-height: 1;\\n font-weight: normal;\\n font-style: normal;\\n font-family: Arial, Helvetica, sans-serif;\\n word-break: initial; }\\n .video-js:-moz-full-screen {\\n position: absolute; }\\n .video-js:-webkit-full-screen {\\n width: 100% !important;\\n height: 100% !important; }\\n\\n.video-js[tabindex=\\\"-1\\\"] {\\n outline: none; }\\n\\n.video-js *,\\n.video-js *:before,\\n.video-js *:after {\\n box-sizing: inherit; }\\n\\n.video-js ul {\\n font-family: inherit;\\n font-size: inherit;\\n line-height: inherit;\\n list-style-position: outside;\\n margin-left: 0;\\n margin-right: 0;\\n margin-top: 0;\\n margin-bottom: 0; }\\n\\n.video-js.vjs-fluid,\\n.video-js.vjs-16-9,\\n.video-js.vjs-4-3 {\\n width: 100%;\\n max-width: 100%;\\n height: 0; }\\n\\n.video-js.vjs-16-9 {\\n padding-top: 56.25%; }\\n\\n.video-js.vjs-4-3 {\\n padding-top: 75%; }\\n\\n.video-js.vjs-fill {\\n width: 100%;\\n height: 100%; }\\n\\n.video-js .vjs-tech {\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%; }\\n\\nbody.vjs-full-window {\\n padding: 0;\\n margin: 0;\\n height: 100%; }\\n\\n.vjs-full-window .video-js.vjs-fullscreen {\\n position: fixed;\\n overflow: hidden;\\n z-index: 1000;\\n left: 0;\\n top: 0;\\n bottom: 0;\\n right: 0; }\\n\\n.video-js.vjs-fullscreen {\\n width: 100% !important;\\n height: 100% !important;\\n padding-top: 0 !important; }\\n\\n.video-js.vjs-fullscreen.vjs-user-inactive {\\n cursor: none; }\\n\\n.vjs-hidden {\\n display: none !important; }\\n\\n.vjs-disabled {\\n opacity: 0.5;\\n cursor: default; }\\n\\n.video-js .vjs-offscreen {\\n height: 1px;\\n left: -9999px;\\n position: absolute;\\n top: 0;\\n width: 1px; }\\n\\n.vjs-lock-showing {\\n display: block !important;\\n opacity: 1;\\n visibility: visible; }\\n\\n.vjs-no-js {\\n padding: 20px;\\n color: #fff;\\n background-color: #000;\\n font-size: 18px;\\n font-family: Arial, Helvetica, sans-serif;\\n text-align: center;\\n width: 300px;\\n height: 150px;\\n margin: 0px auto; }\\n\\n.vjs-no-js a,\\n.vjs-no-js a:visited {\\n color: #66A8CC; }\\n\\n.video-js .vjs-big-play-button {\\n font-size: 3em;\\n line-height: 1.5em;\\n height: 1.5em;\\n width: 3em;\\n display: block;\\n position: absolute;\\n top: 10px;\\n left: 10px;\\n padding: 0;\\n cursor: pointer;\\n opacity: 1;\\n border: 0.06666em solid #fff;\\n background-color: #2B333F;\\n background-color: rgba(43, 51, 63, 0.7);\\n border-radius: 0.3em;\\n transition: all 0.4s; }\\n\\n.vjs-big-play-centered .vjs-big-play-button {\\n top: 50%;\\n left: 50%;\\n margin-top: -0.75em;\\n margin-left: -1.5em; }\\n\\n.video-js:hover .vjs-big-play-button,\\n.video-js .vjs-big-play-button:focus {\\n border-color: #fff;\\n background-color: #73859f;\\n background-color: rgba(115, 133, 159, 0.5);\\n transition: all 0s; }\\n\\n.vjs-controls-disabled .vjs-big-play-button,\\n.vjs-has-started .vjs-big-play-button,\\n.vjs-using-native-controls .vjs-big-play-button,\\n.vjs-error .vjs-big-play-button {\\n display: none; }\\n\\n.vjs-has-started.vjs-paused.vjs-show-big-play-button-on-pause .vjs-big-play-button {\\n display: block; }\\n\\n.video-js button {\\n background: none;\\n border: none;\\n color: inherit;\\n display: inline-block;\\n font-size: inherit;\\n line-height: inherit;\\n text-transform: none;\\n text-decoration: none;\\n transition: none;\\n -webkit-appearance: none;\\n -moz-appearance: none;\\n appearance: none; }\\n\\n.vjs-control .vjs-button {\\n width: 100%;\\n height: 100%; }\\n\\n.video-js .vjs-control.vjs-close-button {\\n cursor: pointer;\\n height: 3em;\\n position: absolute;\\n right: 0;\\n top: 0.5em;\\n z-index: 2; }\\n\\n.video-js .vjs-modal-dialog {\\n background: rgba(0, 0, 0, 0.8);\\n background: linear-gradient(180deg, rgba(0, 0, 0, 0.8), rgba(255, 255, 255, 0));\\n overflow: auto; }\\n\\n.video-js .vjs-modal-dialog > * {\\n box-sizing: border-box; }\\n\\n.vjs-modal-dialog .vjs-modal-dialog-content {\\n font-size: 1.2em;\\n line-height: 1.5;\\n padding: 20px 24px;\\n z-index: 1; }\\n\\n.vjs-menu-button {\\n cursor: pointer; }\\n\\n.vjs-menu-button.vjs-disabled {\\n cursor: default; }\\n\\n.vjs-workinghover .vjs-menu-button.vjs-disabled:hover .vjs-menu {\\n display: none; }\\n\\n.vjs-menu .vjs-menu-content {\\n display: block;\\n padding: 0;\\n margin: 0;\\n font-family: Arial, Helvetica, sans-serif;\\n overflow: auto; }\\n\\n.vjs-menu .vjs-menu-content > * {\\n box-sizing: border-box; }\\n\\n.vjs-scrubbing .vjs-control.vjs-menu-button:hover .vjs-menu {\\n display: none; }\\n\\n.vjs-menu li {\\n list-style: none;\\n margin: 0;\\n padding: 0.2em 0;\\n line-height: 1.4em;\\n font-size: 1.2em;\\n text-align: center;\\n text-transform: lowercase; }\\n\\n.vjs-menu li.vjs-menu-item:focus,\\n.vjs-menu li.vjs-menu-item:hover,\\n.js-focus-visible .vjs-menu li.vjs-menu-item:hover {\\n background-color: #73859f;\\n background-color: rgba(115, 133, 159, 0.5); }\\n\\n.vjs-menu li.vjs-selected,\\n.vjs-menu li.vjs-selected:focus,\\n.vjs-menu li.vjs-selected:hover,\\n.js-focus-visible .vjs-menu li.vjs-selected:hover {\\n background-color: #fff;\\n color: #2B333F; }\\n\\n.vjs-menu li.vjs-menu-title {\\n text-align: center;\\n text-transform: uppercase;\\n font-size: 1em;\\n line-height: 2em;\\n padding: 0;\\n margin: 0 0 0.3em 0;\\n font-weight: bold;\\n cursor: default; }\\n\\n.vjs-menu-button-popup .vjs-menu {\\n display: none;\\n position: absolute;\\n bottom: 0;\\n width: 10em;\\n left: -3em;\\n height: 0em;\\n margin-bottom: 1.5em;\\n border-top-color: rgba(43, 51, 63, 0.7); }\\n\\n.vjs-menu-button-popup .vjs-menu .vjs-menu-content {\\n background-color: #2B333F;\\n background-color: rgba(43, 51, 63, 0.7);\\n position: absolute;\\n width: 100%;\\n bottom: 1.5em;\\n max-height: 15em; }\\n\\n.vjs-workinghover .vjs-menu-button-popup:hover .vjs-menu,\\n.vjs-menu-button-popup .vjs-menu.vjs-lock-showing {\\n display: block; }\\n\\n.video-js .vjs-menu-button-inline {\\n transition: all 0.4s;\\n overflow: hidden; }\\n\\n.video-js .vjs-menu-button-inline:before {\\n width: 2.222222222em; }\\n\\n.video-js .vjs-menu-button-inline:hover,\\n.video-js .vjs-menu-button-inline:focus,\\n.video-js .vjs-menu-button-inline.vjs-slider-active,\\n.video-js.vjs-no-flex .vjs-menu-button-inline {\\n width: 12em; }\\n\\n.vjs-menu-button-inline .vjs-menu {\\n opacity: 0;\\n height: 100%;\\n width: auto;\\n position: absolute;\\n left: 4em;\\n top: 0;\\n padding: 0;\\n margin: 0;\\n transition: all 0.4s; }\\n\\n.vjs-menu-button-inline:hover .vjs-menu,\\n.vjs-menu-button-inline:focus .vjs-menu,\\n.vjs-menu-button-inline.vjs-slider-active .vjs-menu {\\n display: block;\\n opacity: 1; }\\n\\n.vjs-no-flex .vjs-menu-button-inline .vjs-menu {\\n display: block;\\n opacity: 1;\\n position: relative;\\n width: auto; }\\n\\n.vjs-no-flex .vjs-menu-button-inline:hover .vjs-menu,\\n.vjs-no-flex .vjs-menu-button-inline:focus .vjs-menu,\\n.vjs-no-flex .vjs-menu-button-inline.vjs-slider-active .vjs-menu {\\n width: auto; }\\n\\n.vjs-menu-button-inline .vjs-menu-content {\\n width: auto;\\n height: 100%;\\n margin: 0;\\n overflow: hidden; }\\n\\n.video-js .vjs-control-bar {\\n display: none;\\n width: 100%;\\n position: absolute;\\n bottom: 0;\\n left: 0;\\n right: 0;\\n height: 3.0em;\\n background-color: #2B333F;\\n background-color: rgba(43, 51, 63, 0.7); }\\n\\n.vjs-has-started .vjs-control-bar {\\n display: flex;\\n visibility: visible;\\n opacity: 1;\\n transition: visibility 0.1s, opacity 0.1s; }\\n\\n.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar {\\n visibility: visible;\\n opacity: 0;\\n transition: visibility 1s, opacity 1s; }\\n\\n.vjs-controls-disabled .vjs-control-bar,\\n.vjs-using-native-controls .vjs-control-bar,\\n.vjs-error .vjs-control-bar {\\n display: none !important; }\\n\\n.vjs-audio.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar {\\n opacity: 1;\\n visibility: visible; }\\n\\n.vjs-has-started.vjs-no-flex .vjs-control-bar {\\n display: table; }\\n\\n.video-js .vjs-control {\\n position: relative;\\n text-align: center;\\n margin: 0;\\n padding: 0;\\n height: 100%;\\n width: 4em;\\n flex: none; }\\n\\n.vjs-button > .vjs-icon-placeholder:before {\\n font-size: 1.8em;\\n line-height: 1.67; }\\n\\n.video-js .vjs-control:focus:before,\\n.video-js .vjs-control:hover:before,\\n.video-js .vjs-control:focus {\\n text-shadow: 0em 0em 1em white; }\\n\\n.video-js .vjs-control-text {\\n border: 0;\\n clip: rect(0 0 0 0);\\n height: 1px;\\n overflow: hidden;\\n padding: 0;\\n position: absolute;\\n width: 1px; }\\n\\n.vjs-no-flex .vjs-control {\\n display: table-cell;\\n vertical-align: middle; }\\n\\n.video-js .vjs-custom-control-spacer {\\n display: none; }\\n\\n.video-js .vjs-progress-control {\\n cursor: pointer;\\n flex: auto;\\n display: flex;\\n align-items: center;\\n min-width: 4em;\\n touch-action: none; }\\n\\n.video-js .vjs-progress-control.disabled {\\n cursor: default; }\\n\\n.vjs-live .vjs-progress-control {\\n display: none; }\\n\\n.vjs-liveui .vjs-progress-control {\\n display: flex;\\n align-items: center; }\\n\\n.vjs-no-flex .vjs-progress-control {\\n width: auto; }\\n\\n.video-js .vjs-progress-holder {\\n flex: auto;\\n transition: all 0.2s;\\n height: 0.3em; }\\n\\n.video-js .vjs-progress-control .vjs-progress-holder {\\n margin: 0 10px; }\\n\\n.video-js .vjs-progress-control:hover .vjs-progress-holder {\\n font-size: 1.666666666666666666em; }\\n\\n.video-js .vjs-progress-control:hover .vjs-progress-holder.disabled {\\n font-size: 1em; }\\n\\n.video-js .vjs-progress-holder .vjs-play-progress,\\n.video-js .vjs-progress-holder .vjs-load-progress,\\n.video-js .vjs-progress-holder .vjs-load-progress div {\\n position: absolute;\\n display: block;\\n height: 100%;\\n margin: 0;\\n padding: 0;\\n width: 0; }\\n\\n.video-js .vjs-play-progress {\\n background-color: #fff; }\\n .video-js .vjs-play-progress:before {\\n font-size: 0.9em;\\n position: absolute;\\n right: -0.5em;\\n top: -0.333333333333333em;\\n z-index: 1; }\\n\\n.video-js .vjs-load-progress {\\n background: rgba(115, 133, 159, 0.5); }\\n\\n.video-js .vjs-load-progress div {\\n background: rgba(115, 133, 159, 0.75); }\\n\\n.video-js .vjs-time-tooltip {\\n background-color: #fff;\\n background-color: rgba(255, 255, 255, 0.8);\\n border-radius: 0.3em;\\n color: #000;\\n float: right;\\n font-family: Arial, Helvetica, sans-serif;\\n font-size: 1em;\\n padding: 6px 8px 8px 8px;\\n pointer-events: none;\\n position: absolute;\\n top: -3.4em;\\n visibility: hidden;\\n z-index: 1; }\\n\\n.video-js .vjs-progress-holder:focus .vjs-time-tooltip {\\n display: none; }\\n\\n.video-js .vjs-progress-control:hover .vjs-time-tooltip,\\n.video-js .vjs-progress-control:hover .vjs-progress-holder:focus .vjs-time-tooltip {\\n display: block;\\n font-size: 0.6em;\\n visibility: visible; }\\n\\n.video-js .vjs-progress-control.disabled:hover .vjs-time-tooltip {\\n font-size: 1em; }\\n\\n.video-js .vjs-progress-control .vjs-mouse-display {\\n display: none;\\n position: absolute;\\n width: 1px;\\n height: 100%;\\n background-color: #000;\\n z-index: 1; }\\n\\n.vjs-no-flex .vjs-progress-control .vjs-mouse-display {\\n z-index: 0; }\\n\\n.video-js .vjs-progress-control:hover .vjs-mouse-display {\\n display: block; }\\n\\n.video-js.vjs-user-inactive .vjs-progress-control .vjs-mouse-display {\\n visibility: hidden;\\n opacity: 0;\\n transition: visibility 1s, opacity 1s; }\\n\\n.video-js.vjs-user-inactive.vjs-no-flex .vjs-progress-control .vjs-mouse-display {\\n display: none; }\\n\\n.vjs-mouse-display .vjs-time-tooltip {\\n color: #fff;\\n background-color: #000;\\n background-color: rgba(0, 0, 0, 0.8); }\\n\\n.video-js .vjs-slider {\\n position: relative;\\n cursor: pointer;\\n padding: 0;\\n margin: 0 0.45em 0 0.45em;\\n /* iOS Safari */\\n -webkit-touch-callout: none;\\n /* Safari */\\n -webkit-user-select: none;\\n /* Konqueror HTML */\\n /* Firefox */\\n -moz-user-select: none;\\n /* Internet Explorer/Edge */\\n -ms-user-select: none;\\n /* Non-prefixed version, currently supported by Chrome and Opera */\\n user-select: none;\\n background-color: #73859f;\\n background-color: rgba(115, 133, 159, 0.5); }\\n\\n.video-js .vjs-slider.disabled {\\n cursor: default; }\\n\\n.video-js .vjs-slider:focus {\\n text-shadow: 0em 0em 1em white;\\n box-shadow: 0 0 1em #fff; }\\n\\n.video-js .vjs-mute-control {\\n cursor: pointer;\\n flex: none; }\\n\\n.video-js .vjs-volume-control {\\n cursor: pointer;\\n margin-right: 1em;\\n display: flex; }\\n\\n.video-js .vjs-volume-control.vjs-volume-horizontal {\\n width: 5em; }\\n\\n.video-js .vjs-volume-panel .vjs-volume-control {\\n visibility: visible;\\n opacity: 0;\\n width: 1px;\\n height: 1px;\\n margin-left: -1px; }\\n\\n.video-js .vjs-volume-panel {\\n transition: width 1s; }\\n .video-js .vjs-volume-panel:hover .vjs-volume-control,\\n .video-js .vjs-volume-panel:active .vjs-volume-control,\\n .video-js .vjs-volume-panel:focus .vjs-volume-control,\\n .video-js .vjs-volume-panel .vjs-volume-control:hover,\\n .video-js .vjs-volume-panel .vjs-volume-control:active,\\n .video-js .vjs-volume-panel .vjs-mute-control:hover ~ .vjs-volume-control,\\n .video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active {\\n visibility: visible;\\n opacity: 1;\\n position: relative;\\n transition: visibility 0.1s, opacity 0.1s, height 0.1s, width 0.1s, left 0s, top 0s; }\\n .video-js .vjs-volume-panel:hover .vjs-volume-control.vjs-volume-horizontal,\\n .video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal,\\n .video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal,\\n .video-js .vjs-volume-panel .vjs-volume-control:hover.vjs-volume-horizontal,\\n .video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-horizontal,\\n .video-js .vjs-volume-panel .vjs-mute-control:hover ~ .vjs-volume-control.vjs-volume-horizontal,\\n .video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-horizontal {\\n width: 5em;\\n height: 3em; }\\n .video-js .vjs-volume-panel:hover .vjs-volume-control.vjs-volume-vertical,\\n .video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical,\\n .video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical,\\n .video-js .vjs-volume-panel .vjs-volume-control:hover.vjs-volume-vertical,\\n .video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical,\\n .video-js .vjs-volume-panel .vjs-mute-control:hover ~ .vjs-volume-control.vjs-volume-vertical,\\n .video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical {\\n left: -3.5em; }\\n .video-js .vjs-volume-panel.vjs-volume-panel-horizontal:hover, .video-js .vjs-volume-panel.vjs-volume-panel-horizontal:active, .video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active {\\n width: 9em;\\n transition: width 0.1s; }\\n .video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-mute-toggle-only {\\n width: 4em; }\\n\\n.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical {\\n height: 8em;\\n width: 3em;\\n left: -3000em;\\n transition: visibility 1s, opacity 1s, height 1s 1s, width 1s 1s, left 1s 1s, top 1s 1s; }\\n\\n.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal {\\n transition: visibility 1s, opacity 1s, height 1s 1s, width 1s, left 1s 1s, top 1s 1s; }\\n\\n.video-js.vjs-no-flex .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal {\\n width: 5em;\\n height: 3em;\\n visibility: visible;\\n opacity: 1;\\n position: relative;\\n transition: none; }\\n\\n.video-js.vjs-no-flex .vjs-volume-control.vjs-volume-vertical,\\n.video-js.vjs-no-flex .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical {\\n position: absolute;\\n bottom: 3em;\\n left: 0.5em; }\\n\\n.video-js .vjs-volume-panel {\\n display: flex; }\\n\\n.video-js .vjs-volume-bar {\\n margin: 1.35em 0.45em; }\\n\\n.vjs-volume-bar.vjs-slider-horizontal {\\n width: 5em;\\n height: 0.3em; }\\n\\n.vjs-volume-bar.vjs-slider-vertical {\\n width: 0.3em;\\n height: 5em;\\n margin: 1.35em auto; }\\n\\n.video-js .vjs-volume-level {\\n position: absolute;\\n bottom: 0;\\n left: 0;\\n background-color: #fff; }\\n .video-js .vjs-volume-level:before {\\n position: absolute;\\n font-size: 0.9em; }\\n\\n.vjs-slider-vertical .vjs-volume-level {\\n width: 0.3em; }\\n .vjs-slider-vertical .vjs-volume-level:before {\\n top: -0.5em;\\n left: -0.3em; }\\n\\n.vjs-slider-horizontal .vjs-volume-level {\\n height: 0.3em; }\\n .vjs-slider-horizontal .vjs-volume-level:before {\\n top: -0.3em;\\n right: -0.5em; }\\n\\n.video-js .vjs-volume-panel.vjs-volume-panel-vertical {\\n width: 4em; }\\n\\n.vjs-volume-bar.vjs-slider-vertical .vjs-volume-level {\\n height: 100%; }\\n\\n.vjs-volume-bar.vjs-slider-horizontal .vjs-volume-level {\\n width: 100%; }\\n\\n.video-js .vjs-volume-vertical {\\n width: 3em;\\n height: 8em;\\n bottom: 8em;\\n background-color: #2B333F;\\n background-color: rgba(43, 51, 63, 0.7); }\\n\\n.video-js .vjs-volume-horizontal .vjs-menu {\\n left: -2em; }\\n\\n.vjs-poster {\\n display: inline-block;\\n vertical-align: middle;\\n background-repeat: no-repeat;\\n background-position: 50% 50%;\\n background-size: contain;\\n background-color: #000000;\\n cursor: pointer;\\n margin: 0;\\n padding: 0;\\n position: absolute;\\n top: 0;\\n right: 0;\\n bottom: 0;\\n left: 0;\\n height: 100%; }\\n\\n.vjs-has-started .vjs-poster {\\n display: none; }\\n\\n.vjs-audio.vjs-has-started .vjs-poster {\\n display: block; }\\n\\n.vjs-using-native-controls .vjs-poster {\\n display: none; }\\n\\n.video-js .vjs-live-control {\\n display: flex;\\n align-items: flex-start;\\n flex: auto;\\n font-size: 1em;\\n line-height: 3em; }\\n\\n.vjs-no-flex .vjs-live-control {\\n display: table-cell;\\n width: auto;\\n text-align: left; }\\n\\n.video-js:not(.vjs-live) .vjs-live-control,\\n.video-js.vjs-liveui .vjs-live-control {\\n display: none; }\\n\\n.video-js .vjs-seek-to-live-control {\\n cursor: pointer;\\n flex: none;\\n display: inline-flex;\\n height: 100%;\\n padding-left: 0.5em;\\n padding-right: 0.5em;\\n font-size: 1em;\\n line-height: 3em;\\n width: auto;\\n min-width: 4em; }\\n\\n.vjs-no-flex .vjs-seek-to-live-control {\\n display: table-cell;\\n width: auto;\\n text-align: left; }\\n\\n.video-js.vjs-live:not(.vjs-liveui) .vjs-seek-to-live-control,\\n.video-js:not(.vjs-live) .vjs-seek-to-live-control {\\n display: none; }\\n\\n.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge {\\n cursor: auto; }\\n\\n.vjs-seek-to-live-control .vjs-icon-placeholder {\\n margin-right: 0.5em;\\n color: #888; }\\n\\n.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-icon-placeholder {\\n color: red; }\\n\\n.video-js .vjs-time-control {\\n flex: none;\\n font-size: 1em;\\n line-height: 3em;\\n min-width: 2em;\\n width: auto;\\n padding-left: 1em;\\n padding-right: 1em; }\\n\\n.vjs-live .vjs-time-control {\\n display: none; }\\n\\n.video-js .vjs-current-time,\\n.vjs-no-flex .vjs-current-time {\\n display: none; }\\n\\n.video-js .vjs-duration,\\n.vjs-no-flex .vjs-duration {\\n display: none; }\\n\\n.vjs-time-divider {\\n display: none;\\n line-height: 3em; }\\n\\n.vjs-live .vjs-time-divider {\\n display: none; }\\n\\n.video-js .vjs-play-control {\\n cursor: pointer; }\\n\\n.video-js .vjs-play-control .vjs-icon-placeholder {\\n flex: none; }\\n\\n.vjs-text-track-display {\\n position: absolute;\\n bottom: 3em;\\n left: 0;\\n right: 0;\\n top: 0;\\n pointer-events: none; }\\n\\n.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display {\\n bottom: 1em; }\\n\\n.video-js .vjs-text-track {\\n font-size: 1.4em;\\n text-align: center;\\n margin-bottom: 0.1em; }\\n\\n.vjs-subtitles {\\n color: #fff; }\\n\\n.vjs-captions {\\n color: #fc6; }\\n\\n.vjs-tt-cue {\\n display: block; }\\n\\nvideo::-webkit-media-text-track-display {\\n -webkit-transform: translateY(-3em);\\n transform: translateY(-3em); }\\n\\n.video-js.vjs-user-inactive.vjs-playing video::-webkit-media-text-track-display {\\n -webkit-transform: translateY(-1.5em);\\n transform: translateY(-1.5em); }\\n\\n.video-js .vjs-fullscreen-control {\\n cursor: pointer;\\n flex: none; }\\n\\n.vjs-playback-rate > .vjs-menu-button,\\n.vjs-playback-rate .vjs-playback-rate-value {\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%; }\\n\\n.vjs-playback-rate .vjs-playback-rate-value {\\n pointer-events: none;\\n font-size: 1.5em;\\n line-height: 2;\\n text-align: center; }\\n\\n.vjs-playback-rate .vjs-menu {\\n width: 4em;\\n left: 0em; }\\n\\n.vjs-error .vjs-error-display .vjs-modal-dialog-content {\\n font-size: 1.4em;\\n text-align: center; }\\n\\n.vjs-error .vjs-error-display:before {\\n color: #fff;\\n content: 'X';\\n font-family: Arial, Helvetica, sans-serif;\\n font-size: 4em;\\n left: 0;\\n line-height: 1;\\n margin-top: -0.5em;\\n position: absolute;\\n text-shadow: 0.05em 0.05em 0.1em #000;\\n text-align: center;\\n top: 50%;\\n vertical-align: middle;\\n width: 100%; }\\n\\n.vjs-loading-spinner {\\n display: none;\\n position: absolute;\\n top: 50%;\\n left: 50%;\\n margin: -25px 0 0 -25px;\\n opacity: 0.85;\\n text-align: left;\\n border: 6px solid rgba(43, 51, 63, 0.7);\\n box-sizing: border-box;\\n background-clip: padding-box;\\n width: 50px;\\n height: 50px;\\n border-radius: 25px;\\n visibility: hidden; }\\n\\n.vjs-seeking .vjs-loading-spinner,\\n.vjs-waiting .vjs-loading-spinner {\\n display: block;\\n -webkit-animation: 0s linear 0.3s forwards vjs-spinner-show;\\n animation: 0s linear 0.3s forwards vjs-spinner-show; }\\n\\n.vjs-loading-spinner:before,\\n.vjs-loading-spinner:after {\\n content: \\\"\\\";\\n position: absolute;\\n margin: -6px;\\n box-sizing: inherit;\\n width: inherit;\\n height: inherit;\\n border-radius: inherit;\\n opacity: 1;\\n border: inherit;\\n border-color: transparent;\\n border-top-color: white; }\\n\\n.vjs-seeking .vjs-loading-spinner:before,\\n.vjs-seeking .vjs-loading-spinner:after,\\n.vjs-waiting .vjs-loading-spinner:before,\\n.vjs-waiting .vjs-loading-spinner:after {\\n -webkit-animation: vjs-spinner-spin 1.1s cubic-bezier(0.6, 0.2, 0, 0.8) infinite, vjs-spinner-fade 1.1s linear infinite;\\n animation: vjs-spinner-spin 1.1s cubic-bezier(0.6, 0.2, 0, 0.8) infinite, vjs-spinner-fade 1.1s linear infinite; }\\n\\n.vjs-seeking .vjs-loading-spinner:before,\\n.vjs-waiting .vjs-loading-spinner:before {\\n border-top-color: white; }\\n\\n.vjs-seeking .vjs-loading-spinner:after,\\n.vjs-waiting .vjs-loading-spinner:after {\\n border-top-color: white;\\n -webkit-animation-delay: 0.44s;\\n animation-delay: 0.44s; }\\n\\n@keyframes vjs-spinner-show {\\n to {\\n visibility: visible; } }\\n\\n@-webkit-keyframes vjs-spinner-show {\\n to {\\n visibility: visible; } }\\n\\n@keyframes vjs-spinner-spin {\\n 100% {\\n -webkit-transform: rotate(360deg);\\n transform: rotate(360deg); } }\\n\\n@-webkit-keyframes vjs-spinner-spin {\\n 100% {\\n -webkit-transform: rotate(360deg); } }\\n\\n@keyframes vjs-spinner-fade {\\n 0% {\\n border-top-color: #73859f; }\\n 20% {\\n border-top-color: #73859f; }\\n 35% {\\n border-top-color: white; }\\n 60% {\\n border-top-color: #73859f; }\\n 100% {\\n border-top-color: #73859f; } }\\n\\n@-webkit-keyframes vjs-spinner-fade {\\n 0% {\\n border-top-color: #73859f; }\\n 20% {\\n border-top-color: #73859f; }\\n 35% {\\n border-top-color: white; }\\n 60% {\\n border-top-color: #73859f; }\\n 100% {\\n border-top-color: #73859f; } }\\n\\n.vjs-chapters-button .vjs-menu ul {\\n width: 24em; }\\n\\n.video-js .vjs-subs-caps-button + .vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder {\\n vertical-align: middle;\\n display: inline-block;\\n margin-bottom: -0.1em; }\\n\\n.video-js .vjs-subs-caps-button + .vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before {\\n font-family: VideoJS;\\n content: \\\"\\\\f10d\\\";\\n font-size: 1.5em;\\n line-height: inherit; }\\n\\n.video-js .vjs-audio-button + .vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder {\\n vertical-align: middle;\\n display: inline-block;\\n margin-bottom: -0.1em; }\\n\\n.video-js .vjs-audio-button + .vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before {\\n font-family: VideoJS;\\n content: \\\" \\\\f11d\\\";\\n font-size: 1.5em;\\n line-height: inherit; }\\n\\n.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-custom-control-spacer {\\n flex: auto;\\n display: block; }\\n\\n.video-js.vjs-layout-tiny:not(.vjs-fullscreen).vjs-no-flex .vjs-custom-control-spacer {\\n width: auto; }\\n\\n.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-current-time, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-time-divider, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-duration, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-remaining-time,\\n.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-playback-rate, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-progress-control,\\n.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-mute-control, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-volume-control, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-volume-panel,\\n.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-chapters-button, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-descriptions-button, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-captions-button,\\n.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-subtitles-button, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-subs-caps-button, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-audio-button {\\n display: none; }\\n\\n.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-current-time, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-time-divider, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-duration, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-remaining-time,\\n.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-playback-rate,\\n.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-mute-control, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-volume-control, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-volume-panel,\\n.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-chapters-button, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-descriptions-button, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-captions-button,\\n.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-subtitles-button, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-subs-caps-button, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-audio-button {\\n display: none; }\\n\\n.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-current-time, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-time-divider, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-duration, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-remaining-time,\\n.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-playback-rate,\\n.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-mute-control, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-volume-control, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-volume-panel,\\n.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-chapters-button, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-descriptions-button, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-captions-button,\\n.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-subtitles-button, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-audio-button {\\n display: none; }\\n\\n.vjs-modal-dialog.vjs-text-track-settings {\\n background-color: #2B333F;\\n background-color: rgba(43, 51, 63, 0.75);\\n color: #fff;\\n height: 70%; }\\n\\n.vjs-text-track-settings .vjs-modal-dialog-content {\\n display: table; }\\n\\n.vjs-text-track-settings .vjs-track-settings-colors,\\n.vjs-text-track-settings .vjs-track-settings-font,\\n.vjs-text-track-settings .vjs-track-settings-controls {\\n display: table-cell; }\\n\\n.vjs-text-track-settings .vjs-track-settings-controls {\\n text-align: right;\\n vertical-align: bottom; }\\n\\n@supports (display: grid) {\\n .vjs-text-track-settings .vjs-modal-dialog-content {\\n display: grid;\\n grid-template-columns: 1fr 1fr;\\n grid-template-rows: 1fr;\\n padding: 20px 24px 0px 24px; }\\n .vjs-track-settings-controls .vjs-default-button {\\n margin-bottom: 20px; }\\n .vjs-text-track-settings .vjs-track-settings-controls {\\n grid-column: 1 / -1; }\\n .vjs-layout-small .vjs-text-track-settings .vjs-modal-dialog-content,\\n .vjs-layout-x-small .vjs-text-track-settings .vjs-modal-dialog-content,\\n .vjs-layout-tiny .vjs-text-track-settings .vjs-modal-dialog-content {\\n grid-template-columns: 1fr; } }\\n\\n.vjs-track-setting > select {\\n margin-right: 1em;\\n margin-bottom: 0.5em; }\\n\\n.vjs-text-track-settings fieldset {\\n margin: 5px;\\n padding: 3px;\\n border: none; }\\n\\n.vjs-text-track-settings fieldset span {\\n display: inline-block; }\\n\\n.vjs-text-track-settings fieldset span > select {\\n max-width: 7.3em; }\\n\\n.vjs-text-track-settings legend {\\n color: #fff;\\n margin: 0 0 5px 0; }\\n\\n.vjs-text-track-settings .vjs-label {\\n position: absolute;\\n clip: rect(1px 1px 1px 1px);\\n clip: rect(1px, 1px, 1px, 1px);\\n display: block;\\n margin: 0 0 5px 0;\\n padding: 0;\\n border: 0;\\n height: 1px;\\n width: 1px;\\n overflow: hidden; }\\n\\n.vjs-track-settings-controls button:focus,\\n.vjs-track-settings-controls button:active {\\n outline-style: solid;\\n outline-width: medium;\\n background-image: linear-gradient(0deg, #fff 88%, #73859f 100%); }\\n\\n.vjs-track-settings-controls button:hover {\\n color: rgba(43, 51, 63, 0.75); }\\n\\n.vjs-track-settings-controls button {\\n background-color: #fff;\\n background-image: linear-gradient(-180deg, #fff 88%, #73859f 100%);\\n color: #2B333F;\\n cursor: pointer;\\n border-radius: 2px; }\\n\\n.vjs-track-settings-controls .vjs-default-button {\\n margin-right: 1em; }\\n\\n@media print {\\n .video-js > *:not(.vjs-tech):not(.vjs-poster) {\\n visibility: hidden; } }\\n\\n.vjs-resize-manager {\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%;\\n border: none;\\n z-index: -1000; }\\n\\n.js-focus-visible .video-js *:focus:not(.focus-visible) {\\n outline: none;\\n background: none; }\\n\\n.video-js *:focus:not(:focus-visible),\\n.video-js .vjs-menu *:focus:not(:focus-visible) {\\n outline: none;\\n background: none; }\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\n// eslint-disable-next-line func-names\nmodule.exports = function (useSourceMap) {\n var list = []; // return the list of modules as css string\n\n list.toString = function toString() {\n return this.map(function (item) {\n var content = cssWithMappingToString(item, useSourceMap);\n\n if (item[2]) {\n return \"@media \".concat(item[2], \" {\").concat(content, \"}\");\n }\n\n return content;\n }).join('');\n }; // import a list of modules into the list\n // eslint-disable-next-line func-names\n\n\n list.i = function (modules, mediaQuery, dedupe) {\n if (typeof modules === 'string') {\n // eslint-disable-next-line no-param-reassign\n modules = [[null, modules, '']];\n }\n\n var alreadyImportedModules = {};\n\n if (dedupe) {\n for (var i = 0; i < this.length; i++) {\n // eslint-disable-next-line prefer-destructuring\n var id = this[i][0];\n\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n\n for (var _i = 0; _i < modules.length; _i++) {\n var item = [].concat(modules[_i]);\n\n if (dedupe && alreadyImportedModules[item[0]]) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n if (mediaQuery) {\n if (!item[2]) {\n item[2] = mediaQuery;\n } else {\n item[2] = \"\".concat(mediaQuery, \" and \").concat(item[2]);\n }\n }\n\n list.push(item);\n }\n };\n\n return list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n var content = item[1] || ''; // eslint-disable-next-line prefer-destructuring\n\n var cssMapping = item[3];\n\n if (!cssMapping) {\n return content;\n }\n\n if (useSourceMap && typeof btoa === 'function') {\n var sourceMapping = toComment(cssMapping);\n var sourceURLs = cssMapping.sources.map(function (source) {\n return \"/*# sourceURL=\".concat(cssMapping.sourceRoot || '').concat(source, \" */\");\n });\n return [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n }\n\n return [content].join('\\n');\n} // Adapted from convert-source-map (MIT)\n\n\nfunction toComment(sourceMap) {\n // eslint-disable-next-line no-undef\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n return \"/*# \".concat(data, \" */\");\n}","import api from \"!../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../css-loader/dist/cjs.js!./video-js.css\";\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","\"use strict\";\n\nvar isOldIE = function isOldIE() {\n var memo;\n return function memorize() {\n if (typeof memo === 'undefined') {\n // Test for IE <= 9 as proposed by Browserhacks\n // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n // Tests for existence of standard globals is to allow style-loader\n // to operate correctly into non-standard environments\n // @see https://github.com/webpack-contrib/style-loader/issues/177\n memo = Boolean(window && document && document.all && !window.atob);\n }\n\n return memo;\n };\n}();\n\nvar getTarget = function getTarget() {\n var memo = {};\n return function memorize(target) {\n if (typeof memo[target] === 'undefined') {\n var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself\n\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n\n memo[target] = styleTarget;\n }\n\n return memo[target];\n };\n}();\n\nvar stylesInDom = [];\n\nfunction getIndexByIdentifier(identifier) {\n var result = -1;\n\n for (var i = 0; i < stylesInDom.length; i++) {\n if (stylesInDom[i].identifier === identifier) {\n result = i;\n break;\n }\n }\n\n return result;\n}\n\nfunction modulesToDom(list, options) {\n var idCountMap = {};\n var identifiers = [];\n\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var count = idCountMap[id] || 0;\n var identifier = \"\".concat(id, \" \").concat(count);\n idCountMap[id] = count + 1;\n var index = getIndexByIdentifier(identifier);\n var obj = {\n css: item[1],\n media: item[2],\n sourceMap: item[3]\n };\n\n if (index !== -1) {\n stylesInDom[index].references++;\n stylesInDom[index].updater(obj);\n } else {\n stylesInDom.push({\n identifier: identifier,\n updater: addStyle(obj, options),\n references: 1\n });\n }\n\n identifiers.push(identifier);\n }\n\n return identifiers;\n}\n\nfunction insertStyleElement(options) {\n var style = document.createElement('style');\n var attributes = options.attributes || {};\n\n if (typeof attributes.nonce === 'undefined') {\n var nonce = typeof __webpack_nonce__ !== 'undefined' ? __webpack_nonce__ : null;\n\n if (nonce) {\n attributes.nonce = nonce;\n }\n }\n\n Object.keys(attributes).forEach(function (key) {\n style.setAttribute(key, attributes[key]);\n });\n\n if (typeof options.insert === 'function') {\n options.insert(style);\n } else {\n var target = getTarget(options.insert || 'head');\n\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n\n target.appendChild(style);\n }\n\n return style;\n}\n\nfunction removeStyleElement(style) {\n // istanbul ignore if\n if (style.parentNode === null) {\n return false;\n }\n\n style.parentNode.removeChild(style);\n}\n/* istanbul ignore next */\n\n\nvar replaceText = function replaceText() {\n var textStore = [];\n return function replace(index, replacement) {\n textStore[index] = replacement;\n return textStore.filter(Boolean).join('\\n');\n };\n}();\n\nfunction applyToSingletonTag(style, index, remove, obj) {\n var css = remove ? '' : obj.media ? \"@media \".concat(obj.media, \" {\").concat(obj.css, \"}\") : obj.css; // For old IE\n\n /* istanbul ignore if */\n\n if (style.styleSheet) {\n style.styleSheet.cssText = replaceText(index, css);\n } else {\n var cssNode = document.createTextNode(css);\n var childNodes = style.childNodes;\n\n if (childNodes[index]) {\n style.removeChild(childNodes[index]);\n }\n\n if (childNodes.length) {\n style.insertBefore(cssNode, childNodes[index]);\n } else {\n style.appendChild(cssNode);\n }\n }\n}\n\nfunction applyToTag(style, options, obj) {\n var css = obj.css;\n var media = obj.media;\n var sourceMap = obj.sourceMap;\n\n if (media) {\n style.setAttribute('media', media);\n } else {\n style.removeAttribute('media');\n }\n\n if (sourceMap && typeof btoa !== 'undefined') {\n css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n } // For old IE\n\n /* istanbul ignore if */\n\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n while (style.firstChild) {\n style.removeChild(style.firstChild);\n }\n\n style.appendChild(document.createTextNode(css));\n }\n}\n\nvar singleton = null;\nvar singletonCounter = 0;\n\nfunction addStyle(obj, options) {\n var style;\n var update;\n var remove;\n\n if (options.singleton) {\n var styleIndex = singletonCounter++;\n style = singleton || (singleton = insertStyleElement(options));\n update = applyToSingletonTag.bind(null, style, styleIndex, false);\n remove = applyToSingletonTag.bind(null, style, styleIndex, true);\n } else {\n style = insertStyleElement(options);\n update = applyToTag.bind(null, style, options);\n\n remove = function remove() {\n removeStyleElement(style);\n };\n }\n\n update(obj);\n return function updateStyle(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {\n return;\n }\n\n update(obj = newObj);\n } else {\n remove();\n }\n };\n}\n\nmodule.exports = function (list, options) {\n options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>\n // tags it will allow on a page\n\n if (!options.singleton && typeof options.singleton !== 'boolean') {\n options.singleton = isOldIE();\n }\n\n list = list || [];\n var lastIdentifiers = modulesToDom(list, options);\n return function update(newList) {\n newList = newList || [];\n\n if (Object.prototype.toString.call(newList) !== '[object Array]') {\n return;\n }\n\n for (var i = 0; i < lastIdentifiers.length; i++) {\n var identifier = lastIdentifiers[i];\n var index = getIndexByIdentifier(identifier);\n stylesInDom[index].references--;\n }\n\n var newLastIdentifiers = modulesToDom(newList, options);\n\n for (var _i = 0; _i < lastIdentifiers.length; _i++) {\n var _identifier = lastIdentifiers[_i];\n\n var _index = getIndexByIdentifier(_identifier);\n\n if (stylesInDom[_index].references === 0) {\n stylesInDom[_index].updater();\n\n stylesInDom.splice(_index, 1);\n }\n }\n\n lastIdentifiers = newLastIdentifiers;\n };\n};"],"names":["___CSS_LOADER_EXPORT___","push","module","id","exports","useSourceMap","list","toString","this","map","item","content","cssMapping","btoa","sourceMapping","sourceMap","base64","unescape","encodeURIComponent","JSON","stringify","data","concat","sourceURLs","sources","source","sourceRoot","join","cssWithMappingToString","i","modules","mediaQuery","dedupe","alreadyImportedModules","length","_i","options","memo","isOldIE","Boolean","window","document","all","atob","getTarget","target","styleTarget","querySelector","HTMLIFrameElement","contentDocument","head","e","stylesInDom","getIndexByIdentifier","identifier","result","modulesToDom","idCountMap","identifiers","base","count","index","obj","css","media","references","updater","addStyle","insertStyleElement","style","createElement","attributes","nonce","Object","keys","forEach","key","setAttribute","insert","Error","appendChild","textStore","replaceText","replacement","filter","applyToSingletonTag","remove","styleSheet","cssText","cssNode","createTextNode","childNodes","removeChild","insertBefore","applyToTag","removeAttribute","firstChild","singleton","singletonCounter","update","styleIndex","bind","parentNode","removeStyleElement","newObj","lastIdentifiers","newList","prototype","call","newLastIdentifiers","_index","splice"],"sourceRoot":""} \ No newline at end of file
diff --git a/js/files_videoplayer-vendors-node_modules_video_js_dist_video_es_js.js b/js/files_videoplayer-vendors-node_modules_video_js_dist_video_es_js.js
index 6e7e1ee..073059f 100644
--- a/js/files_videoplayer-vendors-node_modules_video_js_dist_video_es_js.js
+++ b/js/files_videoplayer-vendors-node_modules_video_js_dist_video_es_js.js
@@ -1,3 +1,3 @@
/*! For license information please see files_videoplayer-vendors-node_modules_video_js_dist_video_es_js.js.LICENSE.txt */
-(self.webpackChunkfiles_videoplayer=self.webpackChunkfiles_videoplayer||[]).push([["vendors-node_modules_video_js_dist_video_es_js"],{4029:(e,t,i)=>{"use strict";var n=i(5320),r=Object.prototype.toString,a=Object.prototype.hasOwnProperty,s=function(e,t,i){for(var n=0,r=e.length;n<r;n++)a.call(e,n)&&(null==i?t(e[n],n,e):t.call(i,e[n],n,e))},o=function(e,t,i){for(var n=0,r=e.length;n<r;n++)null==i?t(e.charAt(n),n,e):t.call(i,e.charAt(n),n,e)},u=function(e,t,i){for(var n in e)a.call(e,n)&&(null==i?t(e[n],n,e):t.call(i,e[n],n,e))};e.exports=function(e,t,i){if(!n(t))throw new TypeError("iterator must be a function");var a;arguments.length>=3&&(a=i),"[object Array]"===r.call(e)?s(e,t,a):"string"==typeof e?o(e,t,a):u(e,t,a)}},9144:(e,t,i)=>{var n,r=void 0!==i.g?i.g:"undefined"!=typeof window?window:{},a=i(5893);"undefined"!=typeof document?n=document:(n=r["__GLOBAL_DOCUMENT_CACHE@4"])||(n=r["__GLOBAL_DOCUMENT_CACHE@4"]=a),e.exports=n},8908:(e,t,i)=>{var n;n="undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{},e.exports=n},5320:e=>{"use strict";var t,i,n=Function.prototype.toString,r="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof r&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw i}}),i={},r((function(){throw 42}),null,t)}catch(e){e!==i&&(r=null)}else r=null;var a=/^\s*class\b/,s=function(e){try{var t=n.call(e);return a.test(t)}catch(e){return!1}},o=Object.prototype.toString,u="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,l="object"==typeof document&&void 0===document.all&&void 0!==document.all?document.all:{};e.exports=r?function(e){if(e===l)return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if("function"==typeof e&&!e.prototype)return!0;try{r(e,null,t)}catch(e){if(e!==i)return!1}return!s(e)}:function(e){if(e===l)return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if("function"==typeof e&&!e.prototype)return!0;if(u)return function(e){try{return!s(e)&&(n.call(e),!0)}catch(e){return!1}}(e);if(s(e))return!1;var t=o.call(e);return"[object Function]"===t||"[object GeneratorFunction]"===t}},7376:e=>{e.exports=function(e){var i=t.call(e);return"[object Function]"===i||"function"==typeof e&&"[object RegExp]"!==i||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)};var t=Object.prototype.toString},4827:(e,t,i)=>{"use strict";var n,r=i(1961),a=i(5220);(n=function(){var e=new Uint8Array,t=0;n.prototype.init.call(this),this.setTimestamp=function(e){t=e},this.push=function(i){var n,r,s,o,u=0,l=0;for(e.length?(o=e.length,(e=new Uint8Array(i.byteLength+o)).set(e.subarray(0,o)),e.set(i,o)):e=i;e.length-l>=3;)if(e[l]!=="I".charCodeAt(0)||e[l+1]!=="D".charCodeAt(0)||e[l+2]!=="3".charCodeAt(0))if(255!=(255&e[l])||240!=(240&e[l+1]))l++;else{if(e.length-l<7)break;if(l+(u=a.parseAdtsSize(e,l))>e.length)break;s={type:"audio",data:e.subarray(l,l+u),pts:t,dts:t},this.trigger("data",s),l+=u}else{if(e.length-l<10)break;if(l+(u=a.parseId3TagSize(e,l))>e.length)break;r={type:"timed-metadata",data:e.subarray(l,l+u)},this.trigger("data",r),l+=u}n=e.length-l,e=n>0?e.subarray(l):new Uint8Array}}).prototype=new r,e.exports=n},5220:e=>{"use strict";var t=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],i=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]};e.exports={isLikelyAacData:function(e){return e[0]==="I".charCodeAt(0)&&e[1]==="D".charCodeAt(0)&&e[2]==="3".charCodeAt(0)},parseId3TagSize:function(e,t){var i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(16&e[t+5])>>4?i+20:i+10},parseAdtsSize:function(e,t){var i=(224&e[t+5])>>5,n=e[t+4]<<3;return 6144&e[t+3]|n|i},parseType:function(e,t){return e[t]==="I".charCodeAt(0)&&e[t+1]==="D".charCodeAt(0)&&e[t+2]==="3".charCodeAt(0)?"timed-metadata":!0&e[t]&&240==(240&e[t+1])?"audio":null},parseSampleRate:function(e){for(var i=0;i+5<e.length;){if(255===e[i]&&240==(246&e[i+1]))return t[(60&e[i+2])>>>2];i++}return null},parseAacTimestamp:function(e){var t,n,r;t=10,64&e[5]&&(t+=4,t+=i(e.subarray(10,14)));do{if((n=i(e.subarray(t+4,t+8)))<1)return null;if("PRIV"===String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])){r=e.subarray(t+10,t+n+10);for(var a=0;a<r.byteLength;a++)if(0===r[a]){if("com.apple.streaming.transportStreamTimestamp"===unescape(function(e,t,i){var n,r="";for(n=t;n<i;n++)r+="%"+("00"+e[n].toString(16)).slice(-2);return r}(r,0,a))){var s=r.subarray(a+1),o=(1&s[3])<<30|s[4]<<22|s[5]<<14|s[6]<<6|s[7]>>>2;return o*=4,o+=3&s[7]}break}}t+=10,t+=n}while(t<e.byteLength);return null}}},4886:(e,t,i)=>{"use strict";var n,r=i(1961),a=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];(n=function(){var e;n.prototype.init.call(this),this.push=function(t){var i,n,r,s,o,u,l=0,c=0;if("audio"===t.type)for(e?(s=e,(e=new Uint8Array(s.byteLength+t.data.byteLength)).set(s),e.set(t.data,s.byteLength)):e=t.data;l+5<e.length;)if(255===e[l]&&240==(246&e[l+1])){if(n=2*(1&~e[l+1]),i=(3&e[l+3])<<11|e[l+4]<<3|(224&e[l+5])>>5,u=9e4*(o=1024*(1+(3&e[l+6])))/a[(60&e[l+2])>>>2],r=l+i,e.byteLength<r)return;if(this.trigger("data",{pts:t.pts+c*u,dts:t.dts+c*u,sampleCount:o,audioobjecttype:1+(e[l+2]>>>6&3),channelcount:(1&e[l+2])<<2|(192&e[l+3])>>>6,samplerate:a[(60&e[l+2])>>>2],samplingfrequencyindex:(60&e[l+2])>>>2,samplesize:16,data:e.subarray(l+7+n,r)}),e.byteLength===r)return void(e=void 0);c++,e=e.subarray(r)}else l++},this.flush=function(){this.trigger("done")}}).prototype=new r,e.exports=n},6618:(e,t,i)=>{"use strict";var n,r,a,s=i(1961),o=i(9798);(r=function(){var e,t,i=0;r.prototype.init.call(this),this.push=function(n){var r;for(t?((r=new Uint8Array(t.byteLength+n.data.byteLength)).set(t),r.set(n.data,t.byteLength),t=r):t=n.data;i<t.byteLength-3;i++)if(1===t[i+2]){e=i+5;break}for(;e<t.byteLength;)switch(t[e]){case 0:if(0!==t[e-1]){e+=2;break}if(0!==t[e-2]){e++;break}i+3!==e-2&&this.trigger("data",t.subarray(i+3,e-2));do{e++}while(1!==t[e]&&e<t.length);i=e-2,e+=3;break;case 1:if(0!==t[e-1]||0!==t[e-2]){e+=3;break}this.trigger("data",t.subarray(i+3,e-2)),i=e-2,e+=3;break;default:e+=3}t=t.subarray(i),e-=i,i=0},this.flush=function(){t&&t.byteLength>3&&this.trigger("data",t.subarray(i+3)),t=null,i=0,this.trigger("done")}}).prototype=new s,a={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},(n=function(){var e,t,i,s,u,l,c,h=new r;n.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,i=e.pts,s=e.dts,h.push(e))},h.on("data",(function(n){var r={trackId:t,pts:i,dts:s,data:n};switch(31&n[0]){case 5:r.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:r.nalUnitType="sei_rbsp",r.escapedRBSP=u(n.subarray(1));break;case 7:r.nalUnitType="seq_parameter_set_rbsp",r.escapedRBSP=u(n.subarray(1)),r.config=l(r.escapedRBSP);break;case 8:r.nalUnitType="pic_parameter_set_rbsp";break;case 9:r.nalUnitType="access_unit_delimiter_rbsp"}e.trigger("data",r)})),h.on("done",(function(){e.trigger("done")})),this.flush=function(){h.flush()},c=function(e,t){var i,n=8,r=8;for(i=0;i<e;i++)0!==r&&(r=(n+t.readExpGolomb()+256)%256),n=0===r?n:r},u=function(e){for(var t,i,n=e.byteLength,r=[],a=1;a<n-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(r.push(a+2),a+=2):a++;if(0===r.length)return e;t=n-r.length,i=new Uint8Array(t);var s=0;for(a=0;a<t;s++,a++)s===r[0]&&(s++,r.shift()),i[a]=e[s];return i},l=function(e){var t,i,n,r,s,u,l,h,d,p,f,m,g,y=0,v=0,_=0,b=0,T=1;if(i=(t=new o(e)).readUnsignedByte(),r=t.readUnsignedByte(),n=t.readUnsignedByte(),t.skipUnsignedExpGolomb(),a[i]&&(3===(s=t.readUnsignedExpGolomb())&&t.skipBits(1),t.skipUnsignedExpGolomb(),t.skipUnsignedExpGolomb(),t.skipBits(1),t.readBoolean()))for(f=3!==s?8:12,g=0;g<f;g++)t.readBoolean()&&c(g<6?16:64,t);if(t.skipUnsignedExpGolomb(),0===(u=t.readUnsignedExpGolomb()))t.readUnsignedExpGolomb();else if(1===u)for(t.skipBits(1),t.skipExpGolomb(),t.skipExpGolomb(),l=t.readUnsignedExpGolomb(),g=0;g<l;g++)t.skipExpGolomb();if(t.skipUnsignedExpGolomb(),t.skipBits(1),h=t.readUnsignedExpGolomb(),d=t.readUnsignedExpGolomb(),0===(p=t.readBits(1))&&t.skipBits(1),t.skipBits(1),t.readBoolean()&&(y=t.readUnsignedExpGolomb(),v=t.readUnsignedExpGolomb(),_=t.readUnsignedExpGolomb(),b=t.readUnsignedExpGolomb()),t.readBoolean()&&t.readBoolean()){switch(t.readUnsignedByte()){case 1:m=[1,1];break;case 2:m=[12,11];break;case 3:m=[10,11];break;case 4:m=[16,11];break;case 5:m=[40,33];break;case 6:m=[24,11];break;case 7:m=[20,11];break;case 8:m=[32,11];break;case 9:m=[80,33];break;case 10:m=[18,11];break;case 11:m=[15,11];break;case 12:m=[64,33];break;case 13:m=[160,99];break;case 14:m=[4,3];break;case 15:m=[3,2];break;case 16:m=[2,1];break;case 255:m=[t.readUnsignedByte()<<8|t.readUnsignedByte(),t.readUnsignedByte()<<8|t.readUnsignedByte()]}m&&(T=m[0]/m[1])}return{profileIdc:i,levelIdc:n,profileCompatibility:r,width:Math.ceil((16*(h+1)-2*y-2*v)*T),height:(2-p)*(d+1)*16-2*_-2*b}}}).prototype=new s,e.exports={H264Stream:n,NalByteStream:r}},4212:e=>{var t,i=[33,16,5,32,164,27],n=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],r=function(e){for(var t=[];e--;)t.push(0);return t},a={96e3:[i,[227,64],r(154),[56]],88200:[i,[231],r(170),[56]],64e3:[i,[248,192],r(240),[56]],48e3:[i,[255,192],r(268),[55,148,128],r(54),[112]],44100:[i,[255,192],r(268),[55,163,128],r(84),[112]],32e3:[i,[255,192],r(268),[55,234],r(226),[112]],24e3:[i,[255,192],r(268),[55,255,128],r(268),[111,112],r(126),[224]],16e3:[i,[255,192],r(268),[55,255,128],r(268),[111,255],r(269),[223,108],r(195),[1,192]],12e3:[n,r(268),[3,127,248],r(268),[6,255,240],r(268),[13,255,224],r(268),[27,253,128],r(259),[56]],11025:[n,r(268),[3,127,248],r(268),[6,255,240],r(268),[13,255,224],r(268),[27,255,192],r(268),[55,175,128],r(108),[112]],8e3:[n,r(268),[3,121,16],r(47),[7]]};e.exports=(t=a,Object.keys(t).reduce((function(e,i){return e[i]=new Uint8Array(t[i].reduce((function(e,t){return e.concat(t)}),[])),e}),{}))},3754:(e,t,i)=>{"use strict";var n=i(5108),r=i(1961),a=i(6221),s=function(){s.prototype.init.call(this),this.captionPackets_=[],this.ccStreams_=[new h(0,0),new h(0,1),new h(1,0),new h(1,1)],this.reset(),this.ccStreams_.forEach((function(e){e.on("data",this.trigger.bind(this,"data")),e.on("done",this.trigger.bind(this,"done"))}),this)};s.prototype=new r,s.prototype.push=function(e){var t,i,n;if("sei_rbsp"===e.nalUnitType&&(t=a.parseSei(e.escapedRBSP)).payloadType===a.USER_DATA_REGISTERED_ITU_T_T35&&(i=a.parseUserData(t)))if(e.dts<this.latestDts_)this.ignoreNextEqualDts_=!0;else{if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));n=a.parseCaptionPackets(e.pts,i),this.captionPackets_=this.captionPackets_.concat(n),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts}},s.prototype.flush=function(){this.captionPackets_.length?(this.captionPackets_.forEach((function(e,t){e.presortIndex=t})),this.captionPackets_.sort((function(e,t){return e.pts===t.pts?e.presortIndex-t.presortIndex:e.pts-t.pts})),this.captionPackets_.forEach((function(e){e.type<2&&this.dispatchCea608Packet(e)}),this),this.captionPackets_.length=0,this.ccStreams_.forEach((function(e){e.flush()}),this)):this.ccStreams_.forEach((function(e){e.flush()}),this)},s.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach((function(e){e.reset()}))},s.prototype.dispatchCea608Packet=function(e){this.setsChannel1Active(e)?this.activeCea608Channel_[e.type]=0:this.setsChannel2Active(e)&&(this.activeCea608Channel_[e.type]=1),null!==this.activeCea608Channel_[e.type]&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},s.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)},s.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)};var o={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},u=function(e){return null===e?"":(e=o[e]||e,String.fromCharCode(e))},l=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],c=function(){for(var e=[],t=15;t--;)e.push("");return e},h=function(e,t){h.prototype.init.call(this),this.field_=e||0,this.dataChannel_=t||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,i,n,r,a;if((t=32639&e.ccData)!==this.lastControlCode_){if(4096==(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),n=t>>>8,r=255&t,t!==this.PADDING_)if(t===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(t===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),i=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=i,this.startPts_=e.pts;else if(t===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(t===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);else if(t===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(t===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(t===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=c();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=c();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=c()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(n,r))a=u((n=(3&n)<<8)|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isExtCharacter(n,r))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),a=u((n=(3&n)<<8)|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isMidRowCode(n,r))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14==(14&r)&&this.addFormatting(e.pts,["i"]),1==(1&r)&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(n,r))this.column_+=3&r;else if(this.isPAC(n,r)){var s=l.indexOf(7968&t);"rollUp"===this.mode_&&(s-this.rollUpRows_+1<0&&(s=this.rollUpRows_-1),this.setRollUp(e.pts,s)),s!==this.row_&&(this.clearFormatting(e.pts),this.row_=s),1&r&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16==(16&t)&&(this.column_=4*((14&t)>>1)),this.isColorPAC(r)&&14==(14&r)&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(n)&&(0===r&&(r=null),a=u(n),a+=u(r),this[this.mode_](e.pts,a),this.column_+=a.length)}else this.lastControlCode_=null}};h.prototype=new r,h.prototype.flushDisplayed=function(e){var t=this.displayed_.map((function(e){try{return e.trim()}catch(e){return n.error("Skipping malformed caption."),""}})).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})},h.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=c(),this.nonDisplayed_=c(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},h.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},h.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},h.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},h.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},h.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},h.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127},h.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},h.prototype.isNormalChar=function(e){return e>=32&&e<=127},h.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=c(),this.displayed_=c()),void 0!==t&&t!==this.row_)for(var i=0;i<this.rollUpRows_;i++)this.displayed_[t-i]=this.displayed_[this.row_-i],this.displayed_[this.row_-i]="";void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},h.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);var i=t.reduce((function(e,t){return e+"<"+t+">"}),"");this[this.mode_](e,i)},h.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce((function(e,t){return e+"</"+t+">"}),"");this.formatting_=[],this[this.mode_](e,t)}},h.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_];i+=t,this.nonDisplayed_[this.row_]=i},h.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_];i+=t,this.displayed_[this.row_]=i},h.prototype.shiftRowsUp_=function(){var e;for(e=0;e<this.topRow_;e++)this.displayed_[e]="";for(e=this.row_+1;e<15;e++)this.displayed_[e]="";for(e=this.topRow_;e<this.row_;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[this.row_]=""},h.prototype.paintOn=function(e,t){var i=this.displayed_[this.row_];i+=t,this.displayed_[this.row_]=i},e.exports={CaptionStream:s,Cea608Stream:h}},7379:(e,t,i)=>{"use strict";var n,r,a,s=i(1961),o=i(3754),u=i(5215),l=i(817).TimestampRolloverStream,c=i(5215),h=188;(n=function(){var e=new Uint8Array(h),t=0;n.prototype.init.call(this),this.push=function(i){var n,r=0,a=h;for(t?((n=new Uint8Array(i.byteLength+t)).set(e.subarray(0,t)),n.set(i,t),t=0):n=i;a<n.byteLength;)71!==n[r]||71!==n[a]?(r++,a++):(this.trigger("data",n.subarray(r,a)),r+=h,a+=h);r<n.byteLength&&(e.set(n.subarray(r),0),t=n.byteLength-r)},this.flush=function(){t===h&&71===e[0]&&(this.trigger("data",e),t=0),this.trigger("done")}}).prototype=new s,(r=function(){var e,t,i,n;r.prototype.init.call(this),n=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,n){var r=0;n.payloadUnitStartIndicator&&(r+=e[r]+1),"pat"===n.type?t(e.subarray(r),n):i(e.subarray(r),n)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],n.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=n.pmtPid},i=function(e,t){var i,r;if(1&e[5]){for(n.programMapTable={video:null,audio:null,"timed-metadata":{}},i=3+((15&e[1])<<8|e[2])-4,r=12+((15&e[10])<<8|e[11]);r<i;){var a=e[r],s=(31&e[r+1])<<8|e[r+2];a===u.H264_STREAM_TYPE&&null===n.programMapTable.video?n.programMapTable.video=s:a===u.ADTS_STREAM_TYPE&&null===n.programMapTable.audio?n.programMapTable.audio=s:a===u.METADATA_STREAM_TYPE&&(n.programMapTable["timed-metadata"][s]=a),r+=5+((15&e[r+3])<<8|e[r+4])}t.programMapTable=n.programMapTable}},this.push=function(t){var i={},n=4;if(i.payloadUnitStartIndicator=!!(64&t[1]),i.pid=31&t[1],i.pid<<=8,i.pid|=t[2],(48&t[3])>>>4>1&&(n+=t[n]+1),0===i.pid)i.type="pat",e(t.subarray(n),i),this.trigger("data",i);else if(i.pid===this.pmtPid)for(i.type="pmt",e(t.subarray(n),i),this.trigger("data",i);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,n,i]):this.processPes_(t,n,i)},this.processPes_=function(e,t,i){i.pid===this.programMapTable.video?i.streamType=u.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=u.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=e.subarray(t),this.trigger("data",i)}}).prototype=new s,r.STREAM_TYPES={h264:27,adts:15},(a=function(){var e=this,t={data:[],size:0},i={data:[],size:0},n={data:[],size:0},r=function(t,i,n){var r,a,s=new Uint8Array(t.size),o={type:i},u=0,l=0;if(t.data.length&&!(t.size<9)){for(o.trackId=t.data[0].pid,u=0;u<t.data.length;u++)a=t.data[u],s.set(a.data,l),l+=a.data.byteLength;var c,h,d;c=s,(h=o).packetLength=6+(c[4]<<8|c[5]),h.dataAlignmentIndicator=0!=(4&c[6]),192&(d=c[7])&&(h.pts=(14&c[9])<<27|(255&c[10])<<20|(254&c[11])<<12|(255&c[12])<<5|(254&c[13])>>>3,h.pts*=4,h.pts+=(6&c[13])>>>1,h.dts=h.pts,64&d&&(h.dts=(14&c[14])<<27|(255&c[15])<<20|(254&c[16])<<12|(255&c[17])<<5|(254&c[18])>>>3,h.dts*=4,h.dts+=(6&c[18])>>>1)),h.data=c.subarray(9+c[8]),r="video"===i||o.packetLength<=t.size,(n||r)&&(t.size=0,t.data.length=0),r&&e.trigger("data",o)}};a.prototype.init.call(this),this.push=function(a){({pat:function(){},pes:function(){var e,s;switch(a.streamType){case u.H264_STREAM_TYPE:case c.H264_STREAM_TYPE:e=t,s="video";break;case u.ADTS_STREAM_TYPE:e=i,s="audio";break;case u.METADATA_STREAM_TYPE:e=n,s="timed-metadata";break;default:return}a.payloadUnitStartIndicator&&r(e,s,!0),e.data.push(a),e.size+=a.data.byteLength},pmt:function(){var t={type:"metadata",tracks:[]},i=a.programMapTable;null!==i.video&&t.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+i.video,codec:"avc",type:"video"}),null!==i.audio&&t.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+i.audio,codec:"adts",type:"audio"}),e.trigger("data",t)}})[a.type]()},this.flush=function(){r(t,"video"),r(i,"audio"),r(n,"timed-metadata"),this.trigger("done")}}).prototype=new s;var d={PAT_PID:0,MP2T_PACKET_LENGTH:h,TransportPacketStream:n,TransportParseStream:r,ElementaryStream:a,TimestampRolloverStream:l,CaptionStream:o.CaptionStream,Cea608Stream:o.Cea608Stream,MetadataStream:i(8659)};for(var p in u)u.hasOwnProperty(p)&&(d[p]=u[p]);e.exports=d},8659:(e,t,i)=>{"use strict";var n,r=i(5108),a=i(1961),s=i(5215),o=function(e,t,i){var n,r="";for(n=t;n<i;n++)r+="%"+("00"+e[n].toString(16)).slice(-2);return r},u=function(e,t,i){return decodeURIComponent(o(e,t,i))},l=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},c={TXXX:function(e){var t;if(3===e.data[0]){for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=u(e.data,1,t),e.value=u(e.data,t+1,e.data.length).replace(/\0*$/,"");break}e.data=e.value}},WXXX:function(e){var t;if(3===e.data[0])for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=u(e.data,1,t),e.url=u(e.data,t+1,e.data.length);break}},PRIV:function(e){var t,i;for(t=0;t<e.data.length;t++)if(0===e.data[t]){e.owner=(i=e.data,unescape(o(i,0,t)));break}e.privateData=e.data.subarray(t+1),e.data=e.privateData}};(n=function(e){var t,i={debug:!(!e||!e.debug),descriptor:e&&e.descriptor},a=0,o=[],u=0;if(n.prototype.init.call(this),this.dispatchType=s.METADATA_STREAM_TYPE.toString(16),i.descriptor)for(t=0;t<i.descriptor.length;t++)this.dispatchType+=("00"+i.descriptor[t].toString(16)).slice(-2);this.push=function(e){var t,n,s,h,d;if("timed-metadata"===e.type)if(e.dataAlignmentIndicator&&(u=0,o.length=0),0===o.length&&(e.data.length<10||e.data[0]!=="I".charCodeAt(0)||e.data[1]!=="D".charCodeAt(0)||e.data[2]!=="3".charCodeAt(0)))i.debug&&r.log("Skipping unrecognized metadata packet");else if(o.push(e),u+=e.data.byteLength,1===o.length&&(a=l(e.data.subarray(6,10)),a+=10),!(u<a)){for(t={data:new Uint8Array(a),frames:[],pts:o[0].pts,dts:o[0].dts},d=0;d<a;)t.data.set(o[0].data.subarray(0,a-d),d),d+=o[0].data.byteLength,u-=o[0].data.byteLength,o.shift();n=10,64&t.data[5]&&(n+=4,n+=l(t.data.subarray(10,14)),a-=l(t.data.subarray(16,20)));do{if((s=l(t.data.subarray(n+4,n+8)))<1)return r.log("Malformed ID3 frame encountered. Skipping metadata parsing.");if((h={id:String.fromCharCode(t.data[n],t.data[n+1],t.data[n+2],t.data[n+3]),data:t.data.subarray(n+10,n+s+10)}).key=h.id,c[h.id]&&(c[h.id](h),"com.apple.streaming.transportStreamTimestamp"===h.owner)){var p=h.data,f=(1&p[3])<<30|p[4]<<22|p[5]<<14|p[6]<<6|p[7]>>>2;f*=4,f+=3&p[7],h.timeStamp=f,void 0===t.pts&&void 0===t.dts&&(t.pts=h.timeStamp,t.dts=h.timeStamp),this.trigger("timestamp",h)}t.frames.push(h),n+=10,n+=s}while(n<a);this.trigger("data",t)}}}).prototype=new a,e.exports=n},4149:(e,t,i)=>{"use strict";var n=i(5215),r=function(e){var t=31&e[1];return t<<=8,t|=e[2]},a=function(e){return!!(64&e[1])},s=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},o=function(e){switch(e){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}};e.exports={parseType:function(e,t){var i=r(e);return 0===i?"pat":i===t?"pmt":t?"pes":null},parsePat:function(e){var t=a(e),i=4+s(e);return t&&(i+=e[i]+1),(31&e[i+10])<<8|e[i+11]},parsePmt:function(e){var t={},i=a(e),n=4+s(e);if(i&&(n+=e[n]+1),1&e[n+5]){var r;r=3+((15&e[n+1])<<8|e[n+2])-4;for(var o=12+((15&e[n+10])<<8|e[n+11]);o<r;){var u=n+o;t[(31&e[u+1])<<8|e[u+2]]=e[u],o+=5+((15&e[u+3])<<8|e[u+4])}return t}},parsePayloadUnitStartIndicator:a,parsePesType:function(e,t){switch(t[r(e)]){case n.H264_STREAM_TYPE:return"video";case n.ADTS_STREAM_TYPE:return"audio";case n.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},parsePesTime:function(e){if(!a(e))return null;var t=4+s(e);if(t>=e.byteLength)return null;var i,n=null;return 192&(i=e[t+7])&&((n={}).pts=(14&e[t+9])<<27|(255&e[t+10])<<20|(254&e[t+11])<<12|(255&e[t+12])<<5|(254&e[t+13])>>>3,n.pts*=4,n.pts+=(6&e[t+13])>>>1,n.dts=n.pts,64&i&&(n.dts=(14&e[t+14])<<27|(255&e[t+15])<<20|(254&e[t+16])<<12|(255&e[t+17])<<5|(254&e[t+18])>>>3,n.dts*=4,n.dts+=(6&e[t+18])>>>1)),n},videoPacketContainsKeyFrame:function(e){for(var t=4+s(e),i=e.subarray(t),n=0,r=0,a=!1;r<i.byteLength-3;r++)if(1===i[r+2]){n=r+5;break}for(;n<i.byteLength;)switch(i[n]){case 0:if(0!==i[n-1]){n+=2;break}if(0!==i[n-2]){n++;break}r+3!==n-2&&"slice_layer_without_partitioning_rbsp_idr"===o(31&i[r+3])&&(a=!0);do{n++}while(1!==i[n]&&n<i.length);r=n-2,n+=3;break;case 1:if(0!==i[n-1]||0!==i[n-2]){n+=3;break}"slice_layer_without_partitioning_rbsp_idr"===o(31&i[r+3])&&(a=!0),r=n-2,n+=3;break;default:n+=3}return i=i.subarray(r),n-=r,r=0,i&&i.byteLength>3&&"slice_layer_without_partitioning_rbsp_idr"===o(31&i[r+3])&&(a=!0),a}}},5215:e=>{"use strict";e.exports={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21}},817:(e,t,i)=>{"use strict";var n=i(1961),r=function(e,t){var i=1;for(e>t&&(i=-1);Math.abs(t-e)>4294967296;)e+=8589934592*i;return e},a=function(e){var t,i;a.prototype.init.call(this),this.type_=e,this.push=function(e){e.type===this.type_&&(void 0===i&&(i=e.dts),e.dts=r(e.dts,i),e.pts=r(e.pts,i),t=e.dts,this.trigger("data",e))},this.flush=function(){i=t,this.trigger("done")},this.discontinuity=function(){i=void 0,t=void 0}};a.prototype=new n,e.exports={TimestampRolloverStream:a,handleRollover:r}},7091:(e,t,i)=>{var n=i(4212),r=i(1489);e.exports={prefixWithSilence:function(e,t,i,a){var s,o,u,l,c=0,h=0,d=0;if(t.length&&(s=r.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),o=Math.ceil(9e4/(e.samplerate/1024)),i&&a&&(c=s-Math.max(i,a),d=(h=Math.floor(c/o))*o),!(h<1||d>45e3))){for((u=n[e.samplerate])||(u=t[0].data),l=0;l<h;l++)t.splice(l,0,{data:u});e.baseMediaDecodeTime-=Math.floor(r.videoTsToAudioTs(d,e.samplerate))}},trimAdtsFramesByEarliestDts:function(e,t,i){return t.minSegmentDts>=i?e:(t.minSegmentDts=1/0,e.filter((function(e){return e.dts>=i&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)})))},generateSampleTable:function(e){var t,i,n=[];for(t=0;t<e.length;t++)i=e[t],n.push({size:i.data.byteLength,duration:1024});return n},concatenateFrameData:function(e){var t,i,n=0,r=new Uint8Array(function(e){var t,i=0;for(t=0;t<e.length;t++)i+=e[t].data.byteLength;return i}(e));for(t=0;t<e.length;t++)i=e[t],r.set(i.data,n),n+=i.data.byteLength;return r}}},6659:(e,t,i)=>{"use strict";var n=i(6221).discardEmulationPreventionBytes,r=i(3754).CaptionStream,a=i(7661),s=i(2628),o=function(e,t){for(var i=e,n=0;n<t.length;n++){var r=t[n];if(i<r.size)return r;i-=r.size}return null},u=function(e,t){var i=a.findBox(e,["moof","traf"]),r=a.findBox(e,["mdat"]),u={},l=[];return r.forEach((function(e,t){var n=i[t];l.push({mdat:e,traf:n})})),l.forEach((function(e){var i,r=e.mdat,l=e.traf,c=a.findBox(l,["tfhd"]),h=s.parseTfhd(c[0]),d=h.trackId,p=a.findBox(l,["tfdt"]),f=p.length>0?s.parseTfdt(p[0]).baseMediaDecodeTime:0,m=a.findBox(l,["trun"]);t===d&&m.length>0&&(i=function(e,t,i){var r,a,s,u,l=new DataView(e.buffer,e.byteOffset,e.byteLength),c=[];for(a=0;a+4<e.length;a+=s)if(s=l.getUint32(a),a+=4,!(s<=0))switch(31&e[a]){case 6:var h=e.subarray(a+1,a+1+s),d=o(a,t);r={nalUnitType:"sei_rbsp",size:s,data:h,escapedRBSP:n(h),trackId:i},d?(r.pts=d.pts,r.dts=d.dts,u=d):(r.pts=u.pts,r.dts=u.dts),c.push(r)}return c}(r,function(e,t,i){var n=t,r=i.defaultSampleDuration||0,a=i.defaultSampleSize||0,o=i.trackId,u=[];return e.forEach((function(e){var t=s.parseTrun(e).samples;t.forEach((function(e){void 0===e.duration&&(e.duration=r),void 0===e.size&&(e.size=a),e.trackId=o,e.dts=n,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),e.pts=n+e.compositionTimeOffset,n+=e.duration})),u=u.concat(t)})),u}(m,f,h),d),u[d]||(u[d]=[]),u[d]=u[d].concat(i))})),u};e.exports=function(){var e,t,i,n,a,s=!1;this.isInitialized=function(){return s},this.init=function(){e=new r,s=!0,e.on("data",(function(e){e.startTime=e.startPts/n,e.endTime=e.endPts/n,a.captions.push(e),a.captionStreams[e.stream]=!0}))},this.isNewInit=function(e,t){return!(e&&0===e.length||t&&"object"==typeof t&&0===Object.keys(t).length)&&(i!==e[0]||n!==t[i])},this.parse=function(e,r,s){var o;if(!this.isInitialized())return null;if(!r||!s)return null;if(this.isNewInit(r,s))i=r[0],n=s[i];else if(!i||!n)return t.push(e),null;for(;t.length>0;){var l=t.shift();this.parse(l,r,s)}return null!==(o=function(e,t,i){return t?{seiNals:u(e,t)[t],timescale:i}:null}(e,i,n))&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),a):null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach((function(t){e.push(t)}))},this.flushStream=function(){if(!this.isInitialized())return null;e.flush()},this.clearParsedCaptions=function(){a.captions=[],a.captionStreams={}},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],i=null,n=null,a?this.clearParsedCaptions():a={captions:[],captionStreams:{}},this.resetCaptionStream()},this.reset()}},9586:e=>{var t=function(e,t){var i={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return i.dataOffset=t,i.compositionTimeOffset=e.pts-e.dts,i.duration=e.duration,i.size=4*e.length,i.size+=e.byteLength,e.keyFrame&&(i.flags.dependsOn=2,i.flags.isNonSyncSample=0),i};e.exports={groupNalsIntoFrames:function(e){var t,i,n=[],r=[];for(n.byteLength=0,t=0;t<e.length;t++)"access_unit_delimiter_rbsp"===(i=e[t]).nalUnitType?(n.length&&(n.duration=i.dts-n.dts,r.push(n)),(n=[i]).byteLength=i.data.byteLength,n.pts=i.pts,n.dts=i.dts):("slice_layer_without_partitioning_rbsp_idr"===i.nalUnitType&&(n.keyFrame=!0),n.duration=i.dts-n.dts,n.byteLength+=i.data.byteLength,n.push(i));return r.length&&(!n.duration||n.duration<=0)&&(n.duration=r[r.length-1].duration),r.push(n),r},groupFramesIntoGops:function(e){var t,i,n=[],r=[];for(n.byteLength=0,n.nalCount=0,n.duration=0,n.pts=e[0].pts,n.dts=e[0].dts,r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=e[0].pts,r.dts=e[0].dts,t=0;t<e.length;t++)(i=e[t]).keyFrame?(n.length&&(r.push(n),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration),(n=[i]).nalCount=i.length,n.byteLength=i.byteLength,n.pts=i.pts,n.dts=i.dts,n.duration=i.duration):(n.duration+=i.duration,n.nalCount+=i.length,n.byteLength+=i.byteLength,n.push(i));return r.length&&n.duration<=0&&(n.duration=r[r.length-1].duration),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration,r.push(n),r},extendFirstKeyFrame:function(e){var t;return!e[0][0].keyFrame&&e.length>1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},generateSampleTable:function(e,i){var n,r,a,s,o,u=i||0,l=[];for(n=0;n<e.length;n++)for(s=e[n],r=0;r<s.length;r++)o=s[r],u+=(a=t(o,u)).size,l.push(a);return l},concatenateNalData:function(e){var t,i,n,r,a,s,o=0,u=e.byteLength,l=e.nalCount,c=new Uint8Array(u+4*l),h=new DataView(c.buffer);for(t=0;t<e.length;t++)for(r=e[t],i=0;i<r.length;i++)for(a=r[i],n=0;n<a.length;n++)s=a[n],h.setUint32(o,s.data.byteLength),o+=4,c.set(s.data,o),o+=s.data.byteLength;return c}}},272:(e,t,i)=>{e.exports={generator:i(2014),probe:i(7661),Transmuxer:i(5064).Transmuxer,AudioSegmentStream:i(5064).AudioSegmentStream,VideoSegmentStream:i(5064).VideoSegmentStream,CaptionParser:i(6659)}},2014:e=>{"use strict";var t,i,n,r,a,s,o,u,l,c,h,d,p,f,m,g,y,v,_,b,T,S,k,w,C,E,A,L,O,P,x,U,I,D,R,M,B,N,j,F,V,H=Math.pow(2,32)-1;!function(){var e;if(k={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},"undefined"!=typeof Uint8Array){for(e in k)k.hasOwnProperty(e)&&(k[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);w=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),E=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),C=new Uint8Array([0,0,0,1]),A=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),L=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),O={video:A,audio:L},U=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),x=new Uint8Array([0,0,0,0,0,0,0,0]),I=new Uint8Array([0,0,0,0,0,0,0,0]),D=I,R=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),M=I,P=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}}(),t=function(e){var t,i,n=[],r=0;for(t=1;t<arguments.length;t++)n.push(arguments[t]);for(t=n.length;t--;)r+=n[t].byteLength;for(i=new Uint8Array(r+8),new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(0,i.byteLength),i.set(e,4),t=0,r=8;t<n.length;t++)i.set(n[t],r),r+=n[t].byteLength;return i},i=function(){return t(k.dinf,t(k.dref,U))},n=function(e){return t(k.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,e.audioobjecttype<<3|e.samplingfrequencyindex>>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))},r=function(){return t(k.ftyp,w,C,w,E)},g=function(e){return t(k.hdlr,O[e])},a=function(e){return t(k.mdat,e)},m=function(e){var i=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,255&e.duration,85,196,0,0]);return e.samplerate&&(i[12]=e.samplerate>>>24&255,i[13]=e.samplerate>>>16&255,i[14]=e.samplerate>>>8&255,i[15]=255&e.samplerate),t(k.mdhd,i)},f=function(e){return t(k.mdia,m(e),g(e.type),o(e))},s=function(e){return t(k.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},o=function(e){return t(k.minf,"video"===e.type?t(k.vmhd,P):t(k.smhd,x),i(),v(e))},u=function(e,i){for(var n=[],r=i.length;r--;)n[r]=b(i[r]);return t.apply(null,[k.moof,s(e)].concat(n))},l=function(e){for(var i=e.length,n=[];i--;)n[i]=d(e[i]);return t.apply(null,[k.moov,h(4294967295)].concat(n).concat(c(e)))},c=function(e){for(var i=e.length,n=[];i--;)n[i]=T(e[i]);return t.apply(null,[k.mvex].concat(n))},h=function(e){var i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return t(k.mvhd,i)},y=function(e){var i,n,r=e.samples||[],a=new Uint8Array(4+r.length);for(n=0;n<r.length;n++)i=r[n].flags,a[n+4]=i.dependsOn<<4|i.isDependedOn<<2|i.hasRedundancy;return t(k.sdtp,a)},v=function(e){return t(k.stbl,_(e),t(k.stts,M),t(k.stsc,D),t(k.stsz,R),t(k.stco,I))},_=function(e){return t(k.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===e.type?B(e):N(e))},B=function(e){var i,n=e.sps||[],r=e.pps||[],a=[],s=[];for(i=0;i<n.length;i++)a.push((65280&n[i].byteLength)>>>8),a.push(255&n[i].byteLength),a=a.concat(Array.prototype.slice.call(n[i]));for(i=0;i<r.length;i++)s.push((65280&r[i].byteLength)>>>8),s.push(255&r[i].byteLength),s=s.concat(Array.prototype.slice.call(r[i]));return t(k.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),t(k.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([n.length]).concat(a).concat([r.length]).concat(s))),t(k.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])))},N=function(e){return t(k.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),n(e))},p=function(e){var i=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]);return t(k.tkhd,i)},b=function(e){var i,n,r,a,s,o;return i=t(k.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),s=Math.floor(e.baseMediaDecodeTime/(H+1)),o=Math.floor(e.baseMediaDecodeTime%(H+1)),n=t(k.tfdt,new Uint8Array([1,0,0,0,s>>>24&255,s>>>16&255,s>>>8&255,255&s,o>>>24&255,o>>>16&255,o>>>8&255,255&o])),92,"audio"===e.type?(r=S(e,92),t(k.traf,i,n,r)):(a=y(e),r=S(e,a.length+92),t(k.traf,i,n,r,a))},d=function(e){return e.duration=e.duration||4294967295,t(k.trak,p(e),f(e))},T=function(e){var i=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==e.type&&(i[i.length-1]=0),t(k.trex,i)},V=function(e,t){var i=0,n=0,r=0,a=0;return e.length&&(void 0!==e[0].duration&&(i=1),void 0!==e[0].size&&(n=2),void 0!==e[0].flags&&(r=4),void 0!==e[0].compositionTimeOffset&&(a=8)),[0,0,i|n|r|a,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},F=function(e,i){var n,r,a,s;for(i+=20+16*(r=e.samples||[]).length,n=V(r,i),s=0;s<r.length;s++)a=r[s],n=n.concat([(4278190080&a.duration)>>>24,(16711680&a.duration)>>>16,(65280&a.duration)>>>8,255&a.duration,(4278190080&a.size)>>>24,(16711680&a.size)>>>16,(65280&a.size)>>>8,255&a.size,a.flags.isLeading<<2|a.flags.dependsOn,a.flags.isDependedOn<<6|a.flags.hasRedundancy<<4|a.flags.paddingValue<<1|a.flags.isNonSyncSample,61440&a.flags.degradationPriority,15&a.flags.degradationPriority,(4278190080&a.compositionTimeOffset)>>>24,(16711680&a.compositionTimeOffset)>>>16,(65280&a.compositionTimeOffset)>>>8,255&a.compositionTimeOffset]);return t(k.trun,new Uint8Array(n))},j=function(e,i){var n,r,a,s;for(i+=20+8*(r=e.samples||[]).length,n=V(r,i),s=0;s<r.length;s++)a=r[s],n=n.concat([(4278190080&a.duration)>>>24,(16711680&a.duration)>>>16,(65280&a.duration)>>>8,255&a.duration,(4278190080&a.size)>>>24,(16711680&a.size)>>>16,(65280&a.size)>>>8,255&a.size]);return t(k.trun,new Uint8Array(n))},S=function(e,t){return"audio"===e.type?j(e,t):F(e,t)},e.exports={ftyp:r,mdat:a,moof:u,moov:l,initSegment:function(e){var t,i=r(),n=l(e);return(t=new Uint8Array(i.byteLength+n.byteLength)).set(i),t.set(n,i.byteLength),t}}},7661:(e,t,i)=>{"use strict";var n,r,a,s,o,u=i(1976).toUnsigned;n=function(e,t){var i,a,s,o,l,c=[];if(!t.length)return null;for(i=0;i<e.byteLength;)a=u(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3]),s=r(e.subarray(i+4,i+8)),o=a>1?i+a:e.byteLength,s===t[0]&&(1===t.length?c.push(e.subarray(i+8,o)):(l=n(e.subarray(i+8,o),t.slice(1))).length&&(c=c.concat(l))),i=o;return c},r=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),t+=String.fromCharCode(e[2]),t+=String.fromCharCode(e[3])},a=function(e){return n(e,["moov","trak"]).reduce((function(e,t){var i,r,a,s,o;return(i=n(t,["tkhd"])[0])?(r=i[0],s=u(i[a=0===r?12:20]<<24|i[a+1]<<16|i[a+2]<<8|i[a+3]),(o=n(t,["mdia","mdhd"])[0])?(a=0===(r=o[0])?12:20,e[s]=u(o[a]<<24|o[a+1]<<16|o[a+2]<<8|o[a+3]),e):null):null}),{})},s=function(e,t){var i,r,a;return i=n(t,["moof","traf"]),r=[].concat.apply([],i.map((function(t){return n(t,["tfhd"]).map((function(i){var r,a;return r=u(i[4]<<24|i[5]<<16|i[6]<<8|i[7]),a=e[r]||9e4,(n(t,["tfdt"]).map((function(e){var t,i;return t=e[0],i=u(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),1===t&&(i*=Math.pow(2,32),i+=u(e[8]<<24|e[9]<<16|e[10]<<8|e[11])),i}))[0]||1/0)/a}))}))),a=Math.min.apply(null,r),isFinite(a)?a:0},o=function(e){var t=n(e,["moov","trak"]),i=[];return t.forEach((function(e){var t=n(e,["mdia","hdlr"]),a=n(e,["tkhd"]);t.forEach((function(e,t){var n,s,o=r(e.subarray(8,12)),u=a[t];"vide"===o&&(s=0===(n=new DataView(u.buffer,u.byteOffset,u.byteLength)).getUint8(0)?n.getUint32(12):n.getUint32(20),i.push(s))}))})),i},e.exports={findBox:n,parseType:r,timescale:a,startTime:s,videoTrackIds:o}},5557:e=>{e.exports={clearDtsInfo:function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},calculateTrackBaseMediaDecodeTime:function(e,t){var i,n=e.minSegmentDts;return t||(n-=e.timelineStartInfo.dts),i=e.timelineStartInfo.baseMediaDecodeTime,i+=n,i=Math.max(0,i),"audio"===e.type&&(i*=e.samplerate/9e4,i=Math.floor(i)),i},collectDtsInfo:function(e,t){"number"==typeof t.pts&&(void 0===e.timelineStartInfo.pts&&(e.timelineStartInfo.pts=t.pts),void 0===e.minSegmentPts?e.minSegmentPts=t.pts:e.minSegmentPts=Math.min(e.minSegmentPts,t.pts),void 0===e.maxSegmentPts?e.maxSegmentPts=t.pts:e.maxSegmentPts=Math.max(e.maxSegmentPts,t.pts)),"number"==typeof t.dts&&(void 0===e.timelineStartInfo.dts&&(e.timelineStartInfo.dts=t.dts),void 0===e.minSegmentDts?e.minSegmentDts=t.dts:e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),void 0===e.maxSegmentDts?e.maxSegmentDts=t.dts:e.maxSegmentDts=Math.max(e.maxSegmentDts,t.dts))}}},5064:(e,t,i)=>{"use strict";var n,r,a,s,o=i(1961),u=i(2014),l=i(9586),c=i(7091),h=i(5557),d=i(7379),p=i(4886),f=i(6618).H264Stream,m=i(4827),g=i(5220).isLikelyAacData,y=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],v=["width","height","profileIdc","levelIdc","profileCompatibility"],_=function(e,t){var i;if(e.length!==t.length)return!1;for(i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0};(r=function(e,t){var i=[],n=0,a=0,s=0,o=1/0;t=t||{},r.prototype.init.call(this),this.push=function(t){h.collectDtsInfo(e,t),e&&y.forEach((function(i){e[i]=t[i]})),i.push(t)},this.setEarliestDts=function(t){a=t-e.timelineStartInfo.baseMediaDecodeTime},this.setVideoBaseMediaDecodeTime=function(e){o=e},this.setAudioAppendStart=function(e){s=e},this.flush=function(){var r,l,d,p;0!==i.length?(r=c.trimAdtsFramesByEarliestDts(i,e,a),e.baseMediaDecodeTime=h.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),c.prefixWithSilence(e,r,s,o),e.samples=c.generateSampleTable(r),d=u.mdat(c.concatenateFrameData(r)),i=[],l=u.moof(n,[e]),p=new Uint8Array(l.byteLength+d.byteLength),n++,p.set(l),p.set(d,l.byteLength),h.clearDtsInfo(e),this.trigger("data",{track:e,boxes:p}),this.trigger("done","AudioSegmentStream")):this.trigger("done","AudioSegmentStream")}}).prototype=new o,(n=function(e,t){var i,r,a=0,s=[],o=[];t=t||{},n.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){h.collectDtsInfo(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||i||(i=t.config,e.sps=[t.data],v.forEach((function(t){e[t]=i[t]}),this)),"pic_parameter_set_rbsp"!==t.nalUnitType||r||(r=t.data,e.pps=[t.data]),s.push(t)},this.flush=function(){for(var i,n,r,c,d,p;s.length&&"access_unit_delimiter_rbsp"!==s[0].nalUnitType;)s.shift();if(0===s.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(i=l.groupNalsIntoFrames(s),(r=l.groupFramesIntoGops(i))[0][0].keyFrame||((n=this.getGopForFusion_(s[0],e))?(r.unshift(n),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.pts=n.pts,r.dts=n.dts,r.duration+=n.duration):r=l.extendFirstKeyFrame(r)),o.length){var f;if(!(f=t.alignGopsAtEnd?this.alignGopsAtEnd_(r):this.alignGopsAtStart_(r)))return this.gopCache_.unshift({gop:r.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),s=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");h.clearDtsInfo(e),r=f}h.collectDtsInfo(e,r),e.samples=l.generateSampleTable(r),d=u.mdat(l.concatenateNalData(r)),e.baseMediaDecodeTime=h.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),this.trigger("processedGopsInfo",r.map((function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}}))),this.gopCache_.unshift({gop:r.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),s=[],this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime),this.trigger("timelineStartInfo",e.timelineStartInfo),c=u.moof(a,[e]),p=new Uint8Array(c.byteLength+d.byteLength),a++,p.set(c),p.set(d,c.byteLength),this.trigger("data",{track:e,boxes:p}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.resetStream_=function(){h.clearDtsInfo(e),i=void 0,r=void 0},this.getGopForFusion_=function(t){var i,n,r,a,s,o=1/0;for(s=0;s<this.gopCache_.length;s++)r=(a=this.gopCache_[s]).gop,e.pps&&_(e.pps[0],a.pps[0])&&e.sps&&_(e.sps[0],a.sps[0])&&(r.dts<e.timelineStartInfo.dts||(i=t.dts-r.dts-r.duration)>=-1e4&&i<=45e3&&(!n||o>i)&&(n=a,o=i));return n?n.gop:null},this.alignGopsAtStart_=function(e){var t,i,n,r,a,s,u,l;for(a=e.byteLength,s=e.nalCount,u=e.duration,t=i=0;t<o.length&&i<e.length&&(n=o[t],r=e[i],n.pts!==r.pts);)r.pts>n.pts?t++:(i++,a-=r.byteLength,s-=r.nalCount,u-=r.duration);return 0===i?e:i===e.length?null:((l=e.slice(i)).byteLength=a,l.duration=u,l.nalCount=s,l.pts=l[0].pts,l.dts=l[0].dts,l)},this.alignGopsAtEnd_=function(e){var t,i,n,r,a,s,u;for(t=o.length-1,i=e.length-1,a=null,s=!1;t>=0&&i>=0;){if(n=o[t],r=e[i],n.pts===r.pts){s=!0;break}n.pts>r.pts?t--:(t===o.length-1&&(a=i),i--)}if(!s&&null===a)return null;if(0===(u=s?i:a))return e;var l=e.slice(u),c=l.reduce((function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e}),{byteLength:0,duration:0,nalCount:0});return l.byteLength=c.byteLength,l.duration=c.duration,l.nalCount=c.nalCount,l.pts=l[0].pts,l.dts=l[0].dts,l},this.alignGopsWith=function(e){o=e}}).prototype=new o,(s=function(e,t){this.numberOfTracks=0,this.metadataStream=t,void 0!==(e=e||{}).remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"==typeof e.keepOriginalTimestamps&&(this.keepOriginalTimestamps=e.keepOriginalTimestamps),this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,s.prototype.init.call(this),this.push=function(e){return e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBoxes.push(e.boxes),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track),void("audio"===e.track.type&&(this.audioTrack=e.track)))}}).prototype=new o,s.prototype.flush=function(e){var t,i,n,r,a=0,s={captions:[],captionStreams:{},metadata:[],info:{}},o=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==e&&"AudioSegmentStream"!==e)return;if(this.remuxTracks)return;if(0===this.pendingTracks.length)return this.emittedTracks++,void(this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}for(this.videoTrack?(o=this.videoTrack.timelineStartInfo.pts,v.forEach((function(e){s.info[e]=this.videoTrack[e]}),this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,y.forEach((function(e){s.info[e]=this.audioTrack[e]}),this)),1===this.pendingTracks.length?s.type=this.pendingTracks[0].type:s.type="combined",this.emittedTracks+=this.pendingTracks.length,n=u.initSegment(this.pendingTracks),s.initSegment=new Uint8Array(n.byteLength),s.initSegment.set(n),s.data=new Uint8Array(this.pendingBytes),r=0;r<this.pendingBoxes.length;r++)s.data.set(this.pendingBoxes[r],a),a+=this.pendingBoxes[r].byteLength;for(r=0;r<this.pendingCaptions.length;r++)(t=this.pendingCaptions[r]).startTime=t.startPts,this.keepOriginalTimestamps||(t.startTime-=o),t.startTime/=9e4,t.endTime=t.endPts,this.keepOriginalTimestamps||(t.endTime-=o),t.endTime/=9e4,s.captionStreams[t.stream]=!0,s.captions.push(t);for(r=0;r<this.pendingMetadata.length;r++)(i=this.pendingMetadata[r]).cueTime=i.pts,this.keepOriginalTimestamps||(i.cueTime-=o),i.cueTime/=9e4,s.metadata.push(i);s.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",s),this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},(a=function(e){var t,i,o=this,u=!0;a.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var t={};this.transmuxPipeline_=t,t.type="aac",t.metadataStream=new d.MetadataStream,t.aacStream=new m,t.audioTimestampRolloverStream=new d.TimestampRolloverStream("audio"),t.timedMetadataTimestampRolloverStream=new d.TimestampRolloverStream("timed-metadata"),t.adtsStream=new p,t.coalesceStream=new s(e,t.metadataStream),t.headOfPipeline=t.aacStream,t.aacStream.pipe(t.audioTimestampRolloverStream).pipe(t.adtsStream),t.aacStream.pipe(t.timedMetadataTimestampRolloverStream).pipe(t.metadataStream).pipe(t.coalesceStream),t.metadataStream.on("timestamp",(function(e){t.aacStream.setTimestamp(e.timeStamp)})),t.aacStream.on("data",(function(n){"timed-metadata"!==n.type||t.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:o.baseMediaDecodeTime},codec:"adts",type:"audio"},t.coalesceStream.numberOfTracks++,t.audioSegmentStream=new r(i,e),t.adtsStream.pipe(t.audioSegmentStream).pipe(t.coalesceStream))})),t.coalesceStream.on("data",this.trigger.bind(this,"data")),t.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setupTsPipeline=function(){var a={};this.transmuxPipeline_=a,a.type="ts",a.metadataStream=new d.MetadataStream,a.packetStream=new d.TransportPacketStream,a.parseStream=new d.TransportParseStream,a.elementaryStream=new d.ElementaryStream,a.videoTimestampRolloverStream=new d.TimestampRolloverStream("video"),a.audioTimestampRolloverStream=new d.TimestampRolloverStream("audio"),a.timedMetadataTimestampRolloverStream=new d.TimestampRolloverStream("timed-metadata"),a.adtsStream=new p,a.h264Stream=new f,a.captionStream=new d.CaptionStream,a.coalesceStream=new s(e,a.metadataStream),a.headOfPipeline=a.packetStream,a.packetStream.pipe(a.parseStream).pipe(a.elementaryStream),a.elementaryStream.pipe(a.videoTimestampRolloverStream).pipe(a.h264Stream),a.elementaryStream.pipe(a.audioTimestampRolloverStream).pipe(a.adtsStream),a.elementaryStream.pipe(a.timedMetadataTimestampRolloverStream).pipe(a.metadataStream).pipe(a.coalesceStream),a.h264Stream.pipe(a.captionStream).pipe(a.coalesceStream),a.elementaryStream.on("data",(function(s){var u;if("metadata"===s.type){for(u=s.tracks.length;u--;)t||"video"!==s.tracks[u].type?i||"audio"!==s.tracks[u].type||((i=s.tracks[u]).timelineStartInfo.baseMediaDecodeTime=o.baseMediaDecodeTime):(t=s.tracks[u]).timelineStartInfo.baseMediaDecodeTime=o.baseMediaDecodeTime;t&&!a.videoSegmentStream&&(a.coalesceStream.numberOfTracks++,a.videoSegmentStream=new n(t,e),a.videoSegmentStream.on("timelineStartInfo",(function(e){i&&(i.timelineStartInfo=e,a.audioSegmentStream.setEarliestDts(e.dts))})),a.videoSegmentStream.on("processedGopsInfo",o.trigger.bind(o,"gopInfo")),a.videoSegmentStream.on("baseMediaDecodeTime",(function(e){i&&a.audioSegmentStream.setVideoBaseMediaDecodeTime(e)})),a.h264Stream.pipe(a.videoSegmentStream).pipe(a.coalesceStream)),i&&!a.audioSegmentStream&&(a.coalesceStream.numberOfTracks++,a.audioSegmentStream=new r(i,e),a.adtsStream.pipe(a.audioSegmentStream).pipe(a.coalesceStream))}})),a.coalesceStream.on("data",this.trigger.bind(this,"data")),a.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setBaseMediaDecodeTime=function(n){var r=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=n),i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,h.clearDtsInfo(i),e.keepOriginalTimestamps||(i.timelineStartInfo.baseMediaDecodeTime=n),r.audioTimestampRolloverStream&&r.audioTimestampRolloverStream.discontinuity()),t&&(r.videoSegmentStream&&(r.videoSegmentStream.gopCache_=[],r.videoTimestampRolloverStream.discontinuity()),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,h.clearDtsInfo(t),r.captionStream.reset(),e.keepOriginalTimestamps||(t.timelineStartInfo.baseMediaDecodeTime=n)),r.timedMetadataTimestampRolloverStream&&r.timedMetadataTimestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.push=function(e){if(u){var t=g(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),u=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){u=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}}).prototype=new o,e.exports={Transmuxer:a,VideoSegmentStream:n,AudioSegmentStream:r,AUDIO_PROPERTIES:y,VIDEO_PROPERTIES:v}},6221:e=>{"use strict";e.exports={parseSei:function(e){for(var t=0,i={payloadType:-1,payloadSize:0},n=0,r=0;t<e.byteLength&&128!==e[t];){for(;255===e[t];)n+=255,t++;for(n+=e[t++];255===e[t];)r+=255,t++;if(r+=e[t++],!i.payload&&4===n){i.payloadType=n,i.payloadSize=r,i.payload=e.subarray(t,t+r);break}t+=r,n=0,r=0}return i},parseUserData:function(e){return 181!==e.payload[0]||49!=(e.payload[1]<<8|e.payload[2])||"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])||3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)},parseCaptionPackets:function(e,t){var i,n,r,a,s=[];if(!(64&t[0]))return s;for(n=31&t[0],i=0;i<n;i++)a={type:3&t[(r=3*i)+2],pts:e},4&t[r+2]&&(a.ccData=t[r+3]<<8|t[r+4],s.push(a));return s},discardEmulationPreventionBytes:function(e){for(var t,i,n=e.byteLength,r=[],a=1;a<n-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(r.push(a+2),a+=2):a++;if(0===r.length)return e;t=n-r.length,i=new Uint8Array(t);var s=0;for(a=0;a<t;s++,a++)s===r[0]&&(s++,r.shift()),i[a]=e[s];return i},USER_DATA_REGISTERED_ITU_T_T35:4}},2628:(e,t,i)=>{"use strict";var n,r,a=i(7661).parseType,s=function(e){return new Date(1e3*e-20828448e5)},o=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},u=function(e){var t,i,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=[];for(t=0;t+4<e.length;t+=i)if(i=n.getUint32(t),t+=4,i<=0)r.push("<span style='color:red;'>MALFORMED DATA</span>");else switch(31&e[t]){case 1:r.push("slice_layer_without_partitioning_rbsp");break;case 5:r.push("slice_layer_without_partitioning_rbsp_idr");break;case 6:r.push("sei_rbsp");break;case 7:r.push("seq_parameter_set_rbsp");break;case 8:r.push("pic_parameter_set_rbsp");break;case 9:r.push("access_unit_delimiter_rbsp");break;default:r.push("UNKNOWN NAL - "+e[t]&31)}return r},l={avc1:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{dataReferenceIndex:t.getUint16(6),width:t.getUint16(24),height:t.getUint16(26),horizresolution:t.getUint16(28)+t.getUint16(30)/16,vertresolution:t.getUint16(32)+t.getUint16(34)/16,frameCount:t.getUint16(40),depth:t.getUint16(74),config:n(e.subarray(78,e.byteLength))}},avcC:function(e){var t,i,n,r,a=new DataView(e.buffer,e.byteOffset,e.byteLength),s={configurationVersion:e[0],avcProfileIndication:e[1],profileCompatibility:e[2],avcLevelIndication:e[3],lengthSizeMinusOne:3&e[4],sps:[],pps:[]},o=31&e[5];for(n=6,r=0;r<o;r++)i=a.getUint16(n),n+=2,s.sps.push(new Uint8Array(e.subarray(n,n+i))),n+=i;for(t=e[n],n++,r=0;r<t;r++)i=a.getUint16(n),n+=2,s.pps.push(new Uint8Array(e.subarray(n,n+i))),n+=i;return s},btrt:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{bufferSizeDB:t.getUint32(0),maxBitrate:t.getUint32(4),avgBitrate:t.getUint32(8)}},esds:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),esId:e[6]<<8|e[7],streamPriority:31&e[8],decoderConfig:{objectProfileIndication:e[11],streamType:e[12]>>>2&63,bufferSize:e[13]<<16|e[14]<<8|e[15],maxBitrate:e[16]<<24|e[17]<<16|e[18]<<8|e[19],avgBitrate:e[20]<<24|e[21]<<16|e[22]<<8|e[23],decoderConfigDescriptor:{tag:e[24],length:e[25],audioObjectType:e[26]>>>3&31,samplingFrequencyIndex:(7&e[26])<<1|e[27]>>>7&1,channelConfiguration:e[27]>>>3&15}}}},ftyp:function(e){for(var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={majorBrand:a(e.subarray(0,4)),minorVersion:t.getUint32(4),compatibleBrands:[]},n=8;n<e.byteLength;)i.compatibleBrands.push(a(e.subarray(n,n+4))),n+=4;return i},dinf:function(e){return{boxes:n(e)}},dref:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),dataReferences:n(e.subarray(8))}},hdlr:function(e){var t={version:new DataView(e.buffer,e.byteOffset,e.byteLength).getUint8(0),flags:new Uint8Array(e.subarray(1,4)),handlerType:a(e.subarray(8,12)),name:""},i=8;for(i=24;i<e.byteLength;i++){if(0===e[i]){i++;break}t.name+=String.fromCharCode(e[i])}return t.name=decodeURIComponent(escape(t.name)),t},mdat:function(e){return{byteLength:e.byteLength,nals:u(e)}},mdhd:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n=4,r={version:i.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),language:""};return 1===r.version?(n+=4,r.creationTime=s(i.getUint32(n)),n+=8,r.modificationTime=s(i.getUint32(n)),n+=4,r.timescale=i.getUint32(n),n+=8,r.duration=i.getUint32(n)):(r.creationTime=s(i.getUint32(n)),n+=4,r.modificationTime=s(i.getUint32(n)),n+=4,r.timescale=i.getUint32(n),n+=4,r.duration=i.getUint32(n)),n+=4,t=i.getUint16(n),r.language+=String.fromCharCode(96+(t>>10)),r.language+=String.fromCharCode(96+((992&t)>>5)),r.language+=String.fromCharCode(96+(31&t)),r},mdia:function(e){return{boxes:n(e)}},mfhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sequenceNumber:e[4]<<24|e[5]<<16|e[6]<<8|e[7]}},minf:function(e){return{boxes:n(e)}},mp4a:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={dataReferenceIndex:t.getUint16(6),channelcount:t.getUint16(16),samplesize:t.getUint16(18),samplerate:t.getUint16(24)+t.getUint16(26)/65536};return e.byteLength>28&&(i.streamDescriptor=n(e.subarray(28))[0]),i},moof:function(e){return{boxes:n(e)}},moov:function(e){return{boxes:n(e)}},mvex:function(e){return{boxes:n(e)}},mvhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i=4,n={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4))};return 1===n.version?(i+=4,n.creationTime=s(t.getUint32(i)),i+=8,n.modificationTime=s(t.getUint32(i)),i+=4,n.timescale=t.getUint32(i),i+=8,n.duration=t.getUint32(i)):(n.creationTime=s(t.getUint32(i)),i+=4,n.modificationTime=s(t.getUint32(i)),i+=4,n.timescale=t.getUint32(i),i+=4,n.duration=t.getUint32(i)),i+=4,n.rate=t.getUint16(i)+t.getUint16(i+2)/16,i+=4,n.volume=t.getUint8(i)+t.getUint8(i+1)/8,i+=2,i+=2,i+=8,n.matrix=new Uint32Array(e.subarray(i,i+36)),i+=36,i+=24,n.nextTrackId=t.getUint32(i),n},pdin:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),rate:t.getUint32(4),initialDelay:t.getUint32(8)}},sdtp:function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]};for(t=4;t<e.byteLength;t++)i.samples.push({dependsOn:(48&e[t])>>4,isDependedOn:(12&e[t])>>2,hasRedundancy:3&e[t]});return i},sidx:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:i.getUint32(4),timescale:i.getUint32(8),earliestPresentationTime:i.getUint32(12),firstOffset:i.getUint32(16)},r=i.getUint16(22);for(t=24;r;t+=12,r--)n.references.push({referenceType:(128&e[t])>>>7,referencedSize:2147483647&i.getUint32(t),subsegmentDuration:i.getUint32(t+4),startsWithSap:!!(128&e[t+8]),sapType:(112&e[t+8])>>>4,sapDeltaTime:268435455&i.getUint32(t+8)});return n},smhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),balance:e[4]+e[5]/256}},stbl:function(e){return{boxes:n(e)}},stco:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),chunkOffsets:[]},r=i.getUint32(4);for(t=8;r;t+=4,r--)n.chunkOffsets.push(i.getUint32(t));return n},stsc:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n=i.getUint32(4),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleToChunks:[]};for(t=8;n;t+=12,n--)r.sampleToChunks.push({firstChunk:i.getUint32(t),samplesPerChunk:i.getUint32(t+4),sampleDescriptionIndex:i.getUint32(t+8)});return r},stsd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleDescriptions:n(e.subarray(8))}},stsz:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleSize:i.getUint32(4),entries:[]};for(t=12;t<e.byteLength;t+=4)n.entries.push(i.getUint32(t));return n},stts:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),timeToSamples:[]},r=i.getUint32(4);for(t=8;r;t+=8,r--)n.timeToSamples.push({sampleCount:i.getUint32(t),sampleDelta:i.getUint32(t+4)});return n},styp:function(e){return l.ftyp(e)},tfdt:function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4)),baseMediaDecodeTime:e[4]<<24|e[5]<<16|e[6]<<8|e[7]};return 1===t.version&&(t.baseMediaDecodeTime*=Math.pow(2,32),t.baseMediaDecodeTime+=e[8]<<24|e[9]<<16|e[10]<<8|e[11]),t},tfhd:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:i.getUint32(4)},r=1&n.flags[2],a=2&n.flags[2],s=8&n.flags[2],o=16&n.flags[2],u=32&n.flags[2],l=65536&n.flags[0],c=131072&n.flags[0];return t=8,r&&(t+=4,n.baseDataOffset=i.getUint32(12),t+=4),a&&(n.sampleDescriptionIndex=i.getUint32(t),t+=4),s&&(n.defaultSampleDuration=i.getUint32(t),t+=4),o&&(n.defaultSampleSize=i.getUint32(t),t+=4),u&&(n.defaultSampleFlags=i.getUint32(t)),l&&(n.durationIsEmpty=!0),!r&&c&&(n.baseDataOffsetIsMoof=!0),n},tkhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i=4,n={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4))};return 1===n.version?(i+=4,n.creationTime=s(t.getUint32(i)),i+=8,n.modificationTime=s(t.getUint32(i)),i+=4,n.trackId=t.getUint32(i),i+=4,i+=8,n.duration=t.getUint32(i)):(n.creationTime=s(t.getUint32(i)),i+=4,n.modificationTime=s(t.getUint32(i)),i+=4,n.trackId=t.getUint32(i),i+=4,i+=4,n.duration=t.getUint32(i)),i+=4,i+=8,n.layer=t.getUint16(i),i+=2,n.alternateGroup=t.getUint16(i),i+=2,n.volume=t.getUint8(i)+t.getUint8(i+1)/8,i+=2,i+=2,n.matrix=new Uint32Array(e.subarray(i,i+36)),i+=36,n.width=t.getUint16(i)+t.getUint16(i+2)/16,i+=4,n.height=t.getUint16(i)+t.getUint16(i+2)/16,n},traf:function(e){return{boxes:n(e)}},trak:function(e){return{boxes:n(e)}},trex:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:t.getUint32(4),defaultSampleDescriptionIndex:t.getUint32(8),defaultSampleDuration:t.getUint32(12),defaultSampleSize:t.getUint32(16),sampleDependsOn:3&e[20],sampleIsDependedOn:(192&e[21])>>6,sampleHasRedundancy:(48&e[21])>>4,samplePaddingValue:(14&e[21])>>1,sampleIsDifferenceSample:!!(1&e[21]),sampleDegradationPriority:t.getUint16(22)}},trun:function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=1&i.flags[2],a=4&i.flags[2],s=1&i.flags[1],u=2&i.flags[1],l=4&i.flags[1],c=8&i.flags[1],h=n.getUint32(4),d=8;for(r&&(i.dataOffset=n.getInt32(d),d+=4),a&&h&&(t={flags:o(e.subarray(d,d+4))},d+=4,s&&(t.duration=n.getUint32(d),d+=4),u&&(t.size=n.getUint32(d),d+=4),c&&(t.compositionTimeOffset=n.getUint32(d),d+=4),i.samples.push(t),h--);h--;)t={},s&&(t.duration=n.getUint32(d),d+=4),u&&(t.size=n.getUint32(d),d+=4),l&&(t.flags=o(e.subarray(d,d+4)),d+=4),c&&(t.compositionTimeOffset=n.getUint32(d),d+=4),i.samples.push(t);return i},"url ":function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4))}},vmhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),graphicsmode:t.getUint16(4),opcolor:new Uint16Array([t.getUint16(6),t.getUint16(8),t.getUint16(10)])}}};n=function(e){for(var t,i,n,r,s,o=0,u=[],c=new ArrayBuffer(e.length),h=new Uint8Array(c),d=0;d<e.length;++d)h[d]=e[d];for(t=new DataView(c);o<e.byteLength;)i=t.getUint32(o),n=a(e.subarray(o+4,o+8)),r=i>1?o+i:e.byteLength,(s=(l[n]||function(e){return{data:e}})(e.subarray(o+8,r))).size=i,s.type=n,u.push(s),o=r;return u},r=function(e,t){var i;return t=t||0,i=new Array(2*t+1).join(" "),e.map((function(e,n){return i+e.type+"\n"+Object.keys(e).filter((function(e){return"type"!==e&&"boxes"!==e})).map((function(t){var n=i+" "+t+": ",r=e[t];if(r instanceof Uint8Array||r instanceof Uint32Array){var a=Array.prototype.slice.call(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)).map((function(e){return" "+("00"+e.toString(16)).slice(-2)})).join("").match(/.{1,24}/g);return a?1===a.length?n+"<"+a.join("").slice(1)+">":n+"<\n"+a.map((function(e){return i+" "+e})).join("\n")+"\n"+i+" >":n+"<>"}return n+JSON.stringify(r,null,2).split("\n").map((function(e,t){return 0===t?e:i+" "+e})).join("\n")})).join("\n")+(e.boxes?"\n"+r(e.boxes,t+1):"")})).join("\n")},e.exports={inspect:n,textify:r,parseTfdt:l.tfdt,parseHdlr:l.hdlr,parseTfhd:l.tfhd,parseTrun:l.trun}},5547:(e,t,i)=>{"use strict";var n=i(5215),r=i(817).handleRollover,a={};a.ts=i(4149),a.aac=i(5220);var s=9e4,o=188,u=71,l=function(e,t,i){for(var n,r,s,l,c=0,h=o,d=!1;h<=e.byteLength;)if(e[c]!==u||e[h]!==u&&h!==e.byteLength)c++,h++;else{switch(n=e.subarray(c,h),a.ts.parseType(n,t.pid)){case"pes":r=a.ts.parsePesType(n,t.table),s=a.ts.parsePayloadUnitStartIndicator(n),"audio"===r&&s&&(l=a.ts.parsePesTime(n))&&(l.type="audio",i.audio.push(l),d=!0)}if(d)break;c+=o,h+=o}for(c=(h=e.byteLength)-o,d=!1;c>=0;)if(e[c]!==u||e[h]!==u&&h!==e.byteLength)c--,h--;else{switch(n=e.subarray(c,h),a.ts.parseType(n,t.pid)){case"pes":r=a.ts.parsePesType(n,t.table),s=a.ts.parsePayloadUnitStartIndicator(n),"audio"===r&&s&&(l=a.ts.parsePesTime(n))&&(l.type="audio",i.audio.push(l),d=!0)}if(d)break;c-=o,h-=o}},c=function(e,t,i){for(var n,r,s,l,c,h,d,p=0,f=o,m=!1,g={data:[],size:0};f<e.byteLength;)if(e[p]!==u||e[f]!==u)p++,f++;else{switch(n=e.subarray(p,f),a.ts.parseType(n,t.pid)){case"pes":if(r=a.ts.parsePesType(n,t.table),s=a.ts.parsePayloadUnitStartIndicator(n),"video"===r&&(s&&!m&&(l=a.ts.parsePesTime(n))&&(l.type="video",i.video.push(l),m=!0),!i.firstKeyFrame)){if(s&&0!==g.size){for(c=new Uint8Array(g.size),h=0;g.data.length;)d=g.data.shift(),c.set(d,h),h+=d.byteLength;a.ts.videoPacketContainsKeyFrame(c)&&(i.firstKeyFrame=a.ts.parsePesTime(c),i.firstKeyFrame.type="video"),g.size=0}g.data.push(n),g.size+=n.byteLength}}if(m&&i.firstKeyFrame)break;p+=o,f+=o}for(p=(f=e.byteLength)-o,m=!1;p>=0;)if(e[p]!==u||e[f]!==u)p--,f--;else{switch(n=e.subarray(p,f),a.ts.parseType(n,t.pid)){case"pes":r=a.ts.parsePesType(n,t.table),s=a.ts.parsePayloadUnitStartIndicator(n),"video"===r&&s&&(l=a.ts.parsePesTime(n))&&(l.type="video",i.video.push(l),m=!0)}if(m)break;p-=o,f-=o}},h=function(e){var t={pid:null,table:null},i={};for(var r in function(e,t){for(var i,n=0,r=o;r<e.byteLength;)if(e[n]!==u||e[r]!==u)n++,r++;else{switch(i=e.subarray(n,r),a.ts.parseType(i,t.pid)){case"pat":t.pid||(t.pid=a.ts.parsePat(i));break;case"pmt":t.table||(t.table=a.ts.parsePmt(i))}if(t.pid&&t.table)return;n+=o,r+=o}}(e,t),t.table){if(t.table.hasOwnProperty(r))switch(t.table[r]){case n.H264_STREAM_TYPE:i.video=[],c(e,t,i),0===i.video.length&&delete i.video;break;case n.ADTS_STREAM_TYPE:i.audio=[],l(e,t,i),0===i.audio.length&&delete i.audio}}return i};e.exports={inspect:function(e,t){var i;return(i=a.aac.isLikelyAacData(e)?function(e){for(var t,i=!1,n=0,r=null,o=null,u=0,l=0;e.length-l>=3;){switch(a.aac.parseType(e,l)){case"timed-metadata":if(e.length-l<10){i=!0;break}if((u=a.aac.parseId3TagSize(e,l))>e.length){i=!0;break}null===o&&(t=e.subarray(l,l+u),o=a.aac.parseAacTimestamp(t)),l+=u;break;case"audio":if(e.length-l<7){i=!0;break}if((u=a.aac.parseAdtsSize(e,l))>e.length){i=!0;break}null===r&&(t=e.subarray(l,l+u),r=a.aac.parseSampleRate(t)),n++,l+=u;break;default:l++}if(i)return null}if(null===r||null===o)return null;var c=s/r;return{audio:[{type:"audio",dts:o,pts:o},{type:"audio",dts:o+1024*n*c,pts:o+1024*n*c}]}}(e):h(e))&&(i.audio||i.video)?(function(e,t){if(e.audio&&e.audio.length){var i=t;void 0===i&&(i=e.audio[0].dts),e.audio.forEach((function(e){e.dts=r(e.dts,i),e.pts=r(e.pts,i),e.dtsTime=e.dts/s,e.ptsTime=e.pts/s}))}if(e.video&&e.video.length){var n=t;if(void 0===n&&(n=e.video[0].dts),e.video.forEach((function(e){e.dts=r(e.dts,n),e.pts=r(e.pts,n),e.dtsTime=e.dts/s,e.ptsTime=e.pts/s})),e.firstKeyFrame){var a=e.firstKeyFrame;a.dts=r(a.dts,n),a.pts=r(a.pts,n),a.dtsTime=a.dts/s,a.ptsTime=a.dts/s}}}(i,t),i):null},parseAudioPes_:l}},1976:e=>{e.exports={toUnsigned:function(e){return e>>>0}}},1489:e=>{var t,i,n,r,a,s;t=function(e){return 9e4*e},i=function(e,t){return e*t},n=function(e){return e/9e4},r=function(e,t){return e/t},a=function(e,i){return t(r(e,i))},s=function(e,t){return i(n(e),t)},e.exports={secondsToVideoTs:t,secondsToAudioTs:i,videoTsToSeconds:n,audioTsToSeconds:r,audioTsToVideoTs:a,videoTsToAudioTs:s}},9798:e=>{"use strict";var t;t=function(e){var t=e.byteLength,i=0,n=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+n},this.loadWord=function(){var r=e.byteLength-t,a=new Uint8Array(4),s=Math.min(4,t);if(0===s)throw new Error("no bytes available");a.set(e.subarray(r,r+s)),i=new DataView(a.buffer).getUint32(0),n=8*s,t-=s},this.skipBits=function(e){var r;n>e?(i<<=e,n-=e):(e-=n,e-=8*(r=Math.floor(e/8)),t-=r,this.loadWord(),i<<=e,n-=e)},this.readBits=function(e){var r=Math.min(n,e),a=i>>>32-r;return(n-=r)>0?i<<=r:t>0&&this.loadWord(),(r=e-r)>0?a<<r|this.readBits(r):a},this.skipLeadingZeros=function(){var e;for(e=0;e<n;++e)if(0!=(i&2147483648>>>e))return i<<=e,n-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()},e.exports=t},1961:e=>{"use strict";var t=function(){this.init=function(){var e={};this.on=function(t,i){e[t]||(e[t]=[]),e[t]=e[t].concat(i)},this.off=function(t,i){var n;return!!e[t]&&(n=e[t].indexOf(i),e[t]=e[t].slice(),e[t].splice(n,1),n>-1)},this.trigger=function(t){var i,n,r,a;if(i=e[t])if(2===arguments.length)for(r=i.length,n=0;n<r;++n)i[n].call(this,arguments[1]);else{for(a=[],n=arguments.length,n=1;n<arguments.length;++n)a.push(arguments[n]);for(r=i.length,n=0;n<r;++n)i[n].apply(this,a)}},this.dispose=function(){e={}}}};t.prototype.pipe=function(e){return this.on("data",(function(t){e.push(t)})),this.on("done",(function(t){e.flush(t)})),e},t.prototype.push=function(e){this.trigger("data",e)},t.prototype.flush=function(e){this.trigger("done",e)},e.exports=t},4947:(e,t,i)=>{var n=i(2745),r=i(4029);e.exports=function(e){if(!e)return{};var t={};return r(n(e).split("\n"),(function(e){var i,r=e.indexOf(":"),a=n(e.slice(0,r)).toLowerCase(),s=n(e.slice(r+1));void 0===t[a]?t[a]=s:(i=t[a],"[object Array]"===Object.prototype.toString.call(i)?t[a].push(s):t[a]=[t[a],s])})),t}},5974:e=>{e.exports=function(e,t){var i,n=null;try{i=JSON.parse(e,t)}catch(e){n=e}return[n,i]}},2745:(e,t)=>{(t=e.exports=function(e){return e.replace(/^\s*|\s*$/g,"")}).left=function(e){return e.replace(/^\s*/,"")},t.right=function(e){return e.replace(/\s*$/,"")}},7753:e=>{function t(e){return e.replace(/\n\r?\s*/g,"")}e.exports=function(e){for(var i="",n=0;n<arguments.length;n++)i+=t(e[n])+(arguments[n+1]||"");return i}},9945:function(e){var t,i,n,r,a;t=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/\?#]*\/)*.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,i=/^([^\/?#]*)(.*)$/,n=/(?:\/|^)\.(?=\/)/g,r=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,a={buildAbsoluteURL:function(e,t,n){if(n=n||{},e=e.trim(),!(t=t.trim())){if(!n.alwaysNormalize)return e;var r=a.parseURL(e);if(!r)throw new Error("Error trying to parse base URL.");return r.path=a.normalizePath(r.path),a.buildURLFromParts(r)}var s=a.parseURL(t);if(!s)throw new Error("Error trying to parse relative URL.");if(s.scheme)return n.alwaysNormalize?(s.path=a.normalizePath(s.path),a.buildURLFromParts(s)):t;var o=a.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var u=i.exec(o.path);o.netLoc=u[1],o.path=u[2]}o.netLoc&&!o.path&&(o.path="/");var l={scheme:o.scheme,netLoc:s.netLoc,path:null,params:s.params,query:s.query,fragment:s.fragment};if(!s.netLoc&&(l.netLoc=o.netLoc,"/"!==s.path[0]))if(s.path){var c=o.path,h=c.substring(0,c.lastIndexOf("/")+1)+s.path;l.path=a.normalizePath(h)}else l.path=o.path,s.params||(l.params=o.params,s.query||(l.query=o.query));return null===l.path&&(l.path=n.alwaysNormalize?a.normalizePath(s.path):s.path),a.buildURLFromParts(l)},parseURL:function(e){var i=t.exec(e);return i?{scheme:i[1]||"",netLoc:i[2]||"",path:i[3]||"",params:i[4]||"",query:i[5]||"",fragment:i[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(n,"");e.length!==(e=e.replace(r,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}},e.exports=a},1272:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>vu});var n=i(5974),r=i.n(n),a=i(3407),s=i.n(a),o=i(7753),u=i.n(o),l=i(1875),c=i.n(l),h=i(9945),d=i.n(h),p=i(8908),f=i.n(p),m=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},g=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},y=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},v=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},_=function(){function e(){m(this,e),this.listeners={}}return e.prototype.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},e.prototype.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e].splice(i,1),i>-1},e.prototype.trigger=function(e){var t=this.listeners[e],i=void 0,n=void 0,r=void 0;if(t)if(2===arguments.length)for(n=t.length,i=0;i<n;++i)t[i].call(this,arguments[1]);else for(r=Array.prototype.slice.call(arguments,1),n=t.length,i=0;i<n;++i)t[i].apply(this,r)},e.prototype.dispose=function(){this.listeners={}},e.prototype.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}(),b=function(e){function t(){m(this,t);var i=v(this,e.call(this));return i.buffer="",i}return y(t,e),t.prototype.push=function(e){var t=void 0;for(this.buffer+=e,t=this.buffer.indexOf("\n");t>-1;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)},t}(_),T=function(e){for(var t=e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),i={},n=t.length,r=void 0;n--;)""!==t[n]&&((r=/([^=]*)=(.*)/.exec(t[n]).slice(1))[0]=r[0].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^['"](.*)['"]$/g,"$1"),i[r[0]]=r[1]);return i},S=function(e){function t(){m(this,t);var i=v(this,e.call(this));return i.customParsers=[],i}return y(t,e),t.prototype.push=function(e){var t=void 0,i=void 0;if(0!==(e=e.replace(/^[\u0000\s]+|[\u0000\s]+$/g,"")).length)if("#"===e[0]){for(var n=0;n<this.customParsers.length;n++)if(this.customParsers[n].call(this,e))return;if(0===e.indexOf("#EXT"))if(e=e.replace("\r",""),t=/^#EXTM3U/.exec(e))this.trigger("data",{type:"tag",tagType:"m3u"});else{if(t=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(e))return i={type:"tag",tagType:"inf"},t[1]&&(i.duration=parseFloat(t[1])),t[2]&&(i.title=t[2]),void this.trigger("data",i);if(t=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(e))return i={type:"tag",tagType:"targetduration"},t[1]&&(i.duration=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#ZEN-TOTAL-DURATION:?([0-9.]*)?/.exec(e))return i={type:"tag",tagType:"totalduration"},t[1]&&(i.duration=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(e))return i={type:"tag",tagType:"version"},t[1]&&(i.version=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))return i={type:"tag",tagType:"media-sequence"},t[1]&&(i.number=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))return i={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(i.number=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(e))return i={type:"tag",tagType:"playlist-type"},t[1]&&(i.playlistType=t[1]),void this.trigger("data",i);if(t=/^#EXT-X-BYTERANGE:?([0-9.]*)?@?([0-9.]*)?/.exec(e))return i={type:"tag",tagType:"byterange"},t[1]&&(i.length=parseInt(t[1],10)),t[2]&&(i.offset=parseInt(t[2],10)),void this.trigger("data",i);if(t=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(e))return i={type:"tag",tagType:"allow-cache"},t[1]&&(i.allowed=!/NO/.test(t[1])),void this.trigger("data",i);if(t=/^#EXT-X-MAP:?(.*)$/.exec(e)){if(i={type:"tag",tagType:"map"},t[1]){var r=T(t[1]);if(r.URI&&(i.uri=r.URI),r.BYTERANGE){var a=r.BYTERANGE.split("@"),s=a[0],o=a[1];i.byterange={},s&&(i.byterange.length=parseInt(s,10)),o&&(i.byterange.offset=parseInt(o,10))}}this.trigger("data",i)}else if(t=/^#EXT-X-STREAM-INF:?(.*)$/.exec(e)){if(i={type:"tag",tagType:"stream-inf"},t[1]){if(i.attributes=T(t[1]),i.attributes.RESOLUTION){var u=i.attributes.RESOLUTION.split("x"),l={};u[0]&&(l.width=parseInt(u[0],10)),u[1]&&(l.height=parseInt(u[1],10)),i.attributes.RESOLUTION=l}i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes["PROGRAM-ID"]&&(i.attributes["PROGRAM-ID"]=parseInt(i.attributes["PROGRAM-ID"],10))}this.trigger("data",i)}else{if(t=/^#EXT-X-MEDIA:?(.*)$/.exec(e))return i={type:"tag",tagType:"media"},t[1]&&(i.attributes=T(t[1])),void this.trigger("data",i);if(t=/^#EXT-X-ENDLIST/.exec(e))this.trigger("data",{type:"tag",tagType:"endlist"});else if(t=/^#EXT-X-DISCONTINUITY/.exec(e))this.trigger("data",{type:"tag",tagType:"discontinuity"});else{if(t=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(e))return i={type:"tag",tagType:"program-date-time"},t[1]&&(i.dateTimeString=t[1],i.dateTimeObject=new Date(t[1])),void this.trigger("data",i);if(t=/^#EXT-X-KEY:?(.*)$/.exec(e))return i={type:"tag",tagType:"key"},t[1]&&(i.attributes=T(t[1]),i.attributes.IV&&("0x"===i.attributes.IV.substring(0,2).toLowerCase()&&(i.attributes.IV=i.attributes.IV.substring(2)),i.attributes.IV=i.attributes.IV.match(/.{8}/g),i.attributes.IV[0]=parseInt(i.attributes.IV[0],16),i.attributes.IV[1]=parseInt(i.attributes.IV[1],16),i.attributes.IV[2]=parseInt(i.attributes.IV[2],16),i.attributes.IV[3]=parseInt(i.attributes.IV[3],16),i.attributes.IV=new Uint32Array(i.attributes.IV))),void this.trigger("data",i);if(t=/^#EXT-X-START:?(.*)$/.exec(e))return i={type:"tag",tagType:"start"},t[1]&&(i.attributes=T(t[1]),i.attributes["TIME-OFFSET"]=parseFloat(i.attributes["TIME-OFFSET"]),i.attributes.PRECISE=/YES/.test(i.attributes.PRECISE)),void this.trigger("data",i);if(t=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(e))return i={type:"tag",tagType:"cue-out-cont"},t[1]?i.data=t[1]:i.data="",void this.trigger("data",i);if(t=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(e))return i={type:"tag",tagType:"cue-out"},t[1]?i.data=t[1]:i.data="",void this.trigger("data",i);if(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(e))return i={type:"tag",tagType:"cue-in"},t[1]?i.data=t[1]:i.data="",void this.trigger("data",i);this.trigger("data",{type:"tag",data:e.slice(4)})}}}else this.trigger("data",{type:"comment",text:e.slice(1)})}else this.trigger("data",{type:"uri",uri:e})},t.prototype.addParser=function(e){var t=this,i=e.expression,n=e.customType,r=e.dataParser,a=e.segment;"function"!=typeof r&&(r=function(e){return e}),this.customParsers.push((function(e){if(i.exec(e))return t.trigger("data",{type:"custom",data:r(e),customType:n,segment:a}),!0}))},t}(_),k=function(e){function t(){m(this,t);var i=v(this,e.call(this));i.lineStream=new b,i.parseStream=new S,i.lineStream.pipe(i.parseStream);var n=i,r=[],a={},s=void 0,o=void 0,u=function(){},l={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},c=0;return i.manifest={allowCache:!0,discontinuityStarts:[],segments:[]},i.parseStream.on("data",(function(e){var t=void 0,i=void 0;({tag:function(){({"allow-cache":function(){this.manifest.allowCache=e.allowed,"allowed"in e||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange:function(){var t={};"length"in e&&(a.byterange=t,t.length=e.length,"offset"in e||(this.trigger("info",{message:"defaulting offset to zero"}),e.offset=0)),"offset"in e&&(a.byterange=t,t.offset=e.offset)},endlist:function(){this.manifest.endList=!0},inf:function(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),e.duration>0&&(a.duration=e.duration),0===e.duration&&(a.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=r},key:function(){e.attributes?"NONE"!==e.attributes.METHOD?e.attributes.URI?(e.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),o={method:e.attributes.METHOD||"AES-128",uri:e.attributes.URI},void 0!==e.attributes.IV&&(o.iv=e.attributes.IV)):this.trigger("warn",{message:"ignoring key declaration without URI"}):o=null:this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence":function(){isFinite(e.number)?this.manifest.mediaSequence=e.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+e.number})},"discontinuity-sequence":function(){isFinite(e.number)?(this.manifest.discontinuitySequence=e.number,c=e.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+e.number})},"playlist-type":function(){/VOD|EVENT/.test(e.playlistType)?this.manifest.playlistType=e.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+e.playlist})},map:function(){s={},e.uri&&(s.uri=e.uri),e.byterange&&(s.byterange=e.byterange)},"stream-inf":function(){this.manifest.playlists=r,this.manifest.mediaGroups=this.manifest.mediaGroups||l,e.attributes?(a.attributes||(a.attributes={}),g(a.attributes,e.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||l,e.attributes&&e.attributes.TYPE&&e.attributes["GROUP-ID"]&&e.attributes.NAME){var n=this.manifest.mediaGroups[e.attributes.TYPE];n[e.attributes["GROUP-ID"]]=n[e.attributes["GROUP-ID"]]||{},t=n[e.attributes["GROUP-ID"]],(i={default:/yes/i.test(e.attributes.DEFAULT)}).default?i.autoselect=!0:i.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(i.language=e.attributes.LANGUAGE),e.attributes.URI&&(i.uri=e.attributes.URI),e.attributes["INSTREAM-ID"]&&(i.instreamId=e.attributes["INSTREAM-ID"]),e.attributes.CHARACTERISTICS&&(i.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(i.forced=/yes/i.test(e.attributes.FORCED)),t[e.attributes.NAME]=i}else this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){c+=1,a.discontinuity=!0,this.manifest.discontinuityStarts.push(r.length)},"program-date-time":function(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=e.dateTimeString,this.manifest.dateTimeObject=e.dateTimeObject),a.dateTimeString=e.dateTimeString,a.dateTimeObject=e.dateTimeObject},targetduration:function(){!isFinite(e.duration)||e.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+e.duration}):this.manifest.targetDuration=e.duration},totalduration:function(){!isFinite(e.duration)||e.duration<0?this.trigger("warn",{message:"ignoring invalid total duration: "+e.duration}):this.manifest.totalDuration=e.duration},start:function(){e.attributes&&!isNaN(e.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:e.attributes["TIME-OFFSET"],precise:e.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out":function(){a.cueOut=e.data},"cue-out-cont":function(){a.cueOutCont=e.data},"cue-in":function(){a.cueIn=e.data}}[e.tagType]||u).call(n)},uri:function(){a.uri=e.uri,r.push(a),this.manifest.targetDuration&&!("duration"in a)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),a.duration=this.manifest.targetDuration),o&&(a.key=o),a.timeline=c,s&&(a.map=s),a={}},comment:function(){},custom:function(){e.segment?(a.custom=a.custom||{},a.custom[e.customType]=e.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[e.customType]=e.data)}})[e.type].call(n)})),i}return y(t,e),t.prototype.push=function(e){this.lineStream.push(e)},t.prototype.end=function(){this.lineStream.push("\n")},t.prototype.addParser=function(e){this.parseStream.addParser(e)},t}(_),w=i(9144),C=i.n(w),E=function(e){return!!e&&"object"==typeof e},A=function e(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return i.reduce((function(t,i){return Object.keys(i).forEach((function(n){Array.isArray(t[n])&&Array.isArray(i[n])?t[n]=t[n].concat(i[n]):E(t[n])&&E(i[n])?t[n]=e(t[n],i[n]):t[n]=i[n]})),t}),{})},L=function(e){return e.reduce((function(e,t){return e.concat(t)}),[])},O=function(e){if(!e.length)return[];for(var t=[],i=0;i<e.length;i++)t.push(e[i]);return t},P=function(e){var t;return(t=e.reduce((function(e,t){var i,n=t.attributes.id+(t.attributes.lang||"");return e[n]?(t.segments[0].discontinuity=!0,(i=e[n].segments).push.apply(i,t.segments),t.attributes.contentProtection&&(e[n].attributes.contentProtection=t.attributes.contentProtection)):e[n]=t,e}),{}),Object.keys(t).map((function(e){return t[e]}))).map((function(e){var t,i;return e.discontinuityStarts=(t=e.segments,i="discontinuity",t.reduce((function(e,t,n){return t[i]&&e.push(n),e}),[])),e}))},x=function(e){var t,i=e.attributes,n=e.segments,r={attributes:(t={NAME:i.id,BANDWIDTH:i.bandwidth,CODECS:i.codecs},t["PROGRAM-ID"]=1,t),uri:"",endList:"static"===(i.type||"static"),timeline:i.periodIndex,resolvedUri:"",targetDuration:i.duration,segments:n,mediaSequence:n.length?n[0].number:1};return i.contentProtection&&(r.contentProtection=i.contentProtection),r},U=function(e){var t,i=e.attributes,n=e.segments,r={attributes:(t={NAME:i.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:i.width,height:i.height},CODECS:i.codecs,BANDWIDTH:i.bandwidth},t["PROGRAM-ID"]=1,t),uri:"",endList:"static"===(i.type||"static"),timeline:i.periodIndex,resolvedUri:"",targetDuration:i.duration,segments:n,mediaSequence:n.length?n[0].number:1};return i.contentProtection&&(r.contentProtection=i.contentProtection),r},I=function(e){var t;if(!e.length)return{};var i=e[0].attributes,n=i.sourceDuration,r=i.minimumUpdatePeriod,a=void 0===r?0:r,s=P(e.filter((function(e){var t=e.attributes;return"video/mp4"===t.mimeType||"video"===t.contentType}))).map(U),o=P(e.filter((function(e){var t=e.attributes;return"audio/mp4"===t.mimeType||"audio"===t.contentType}))),u=e.filter((function(e){var t=e.attributes;return"text/vtt"===t.mimeType||"text"===t.contentType})),l={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(t={AUDIO:{},VIDEO:{}},t["CLOSED-CAPTIONS"]={},t.SUBTITLES={},t),uri:"",duration:n,playlists:s,minimumUpdatePeriod:1e3*a};return o.length&&(l.mediaGroups.AUDIO.audio=o.reduce((function(e,t){var i=t.attributes.role&&t.attributes.role.value||"main",n=t.attributes.lang||"",r="main";return n&&(r=t.attributes.lang+" ("+i+")"),e[r]&&e[r].playlists[0].attributes.BANDWIDTH>t.attributes.bandwidth||(e[r]={language:n,autoselect:!0,default:"main"===i,playlists:[x(t)],uri:""}),e}),{})),u.length&&(l.mediaGroups.SUBTITLES.subs=function(e){return e.reduce((function(e,t){var i,n,r,a,s=t.attributes.lang||"text";return e[s]||(e[s]={language:s,default:!1,autoselect:!1,playlists:[(i=t,r=i.attributes,a=i.segments,void 0===a&&(a=[{uri:r.baseUrl,timeline:r.periodIndex,resolvedUri:r.baseUrl||"",duration:r.sourceDuration,number:0}],r.duration=r.sourceDuration),{attributes:(n={NAME:r.id,BANDWIDTH:r.bandwidth},n["PROGRAM-ID"]=1,n),uri:"",endList:"static"===(r.type||"static"),timeline:r.periodIndex,resolvedUri:r.baseUrl||"",targetDuration:r.duration,segments:a,mediaSequence:a.length?a[0].number:1})],uri:""}),e}),{})}(u)),l};"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self&&self;var D,R=(function(e,t){var i,n,r,a,s;i=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/\?#]*\/)*.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,n=/^([^\/?#]*)(.*)$/,r=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,s={buildAbsoluteURL:function(e,t,i){if(i=i||{},e=e.trim(),!(t=t.trim())){if(!i.alwaysNormalize)return e;var r=s.parseURL(e);if(!r)throw new Error("Error trying to parse base URL.");return r.path=s.normalizePath(r.path),s.buildURLFromParts(r)}var a=s.parseURL(t);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return i.alwaysNormalize?(a.path=s.normalizePath(a.path),s.buildURLFromParts(a)):t;var o=s.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var u=n.exec(o.path);o.netLoc=u[1],o.path=u[2]}o.netLoc&&!o.path&&(o.path="/");var l={scheme:o.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(l.netLoc=o.netLoc,"/"!==a.path[0]))if(a.path){var c=o.path,h=c.substring(0,c.lastIndexOf("/")+1)+a.path;l.path=s.normalizePath(h)}else l.path=o.path,a.params||(l.params=o.params,a.query||(l.query=o.query));return null===l.path&&(l.path=i.alwaysNormalize?s.normalizePath(a.path):a.path),s.buildURLFromParts(l)},parseURL:function(e){var t=i.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(r,"");e.length!==(e=e.replace(a,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}},e.exports=s}(D={exports:{}},D.exports),D.exports),M=function(e,t){return/^[a-z]+:/i.test(t)?t:(/\/\//i.test(e)||(e=R.buildAbsoluteURL(f().location.href,e)),R.buildAbsoluteURL(e,t))},B=function(e){var t=e.baseUrl,i=void 0===t?"":t,n=e.source,r=void 0===n?"":n,a=e.range,s=void 0===a?"":a,o={uri:r,resolvedUri:M(i||"",r)};if(s){var u=s.split("-"),l=parseInt(u[0],10),c=parseInt(u[1],10);o.byterange={length:c-l,offset:l}}return o},N=function(e,t,i){var n=e.NOW,r=e.clientOffset,a=e.availabilityStartTime,s=e.timescale,o=void 0===s?1:s,u=e.start,l=void 0===u?0:u,c=e.minimumUpdatePeriod,h=(n+r)/1e3+(void 0===c?0:c)-(a+l);return Math.ceil((h*o-t)/i)},j=function(e,t){for(var i=e.type,n=void 0===i?"static":i,r=e.minimumUpdatePeriod,a=void 0===r?0:r,s=e.media,o=void 0===s?"":s,u=e.sourceDuration,l=e.timescale,c=void 0===l?1:l,h=e.startNumber,d=void 0===h?1:h,p=e.periodIndex,f=[],m=-1,g=0;g<t.length;g++){var y=t[g],v=y.d,_=y.r||0,b=y.t||0;m<0&&(m=b),b&&b>m&&(m=b);var T=void 0;if(_<0){var S=g+1;T=S===t.length?"dynamic"===n&&a>0&&o.indexOf("$Number$")>0?N(e,m,v):(u*c-m)/v:(t[S].t-m)/v}else T=_+1;for(var k=d+f.length+T,w=d+f.length;w<k;)f.push({number:w,duration:v/c,time:m,timeline:p}),m+=v,w++}return f},F={static:function(e){var t=e.duration,i=e.timescale,n=void 0===i?1:i,r=e.sourceDuration;return{start:0,end:Math.ceil(r/(t/n))}},dynamic:function(e){var t=e.NOW,i=e.clientOffset,n=e.availabilityStartTime,r=e.timescale,a=void 0===r?1:r,s=e.duration,o=e.start,u=void 0===o?0:o,l=e.minimumUpdatePeriod,c=void 0===l?0:l,h=e.timeShiftBufferDepth,d=void 0===h?1/0:h,p=(t+i)/1e3,f=n+u,m=p+c-f,g=Math.ceil(m*a/s),y=Math.floor((p-f-d)*a/s),v=Math.floor((p-f)*a/s);return{start:Math.max(0,y),end:Math.min(g,v)}}},V=function(e){var t=e.type,i=void 0===t?"static":t,n=e.duration,r=e.timescale,a=void 0===r?1:r,s=e.sourceDuration,o=F[i](e),u=function(e,t){for(var i=[],n=e;n<t;n++)i.push(n);return i}(o.start,o.end).map(function(e){return function(t,i){var n=e.duration,r=e.timescale,a=void 0===r?1:r,s=e.periodIndex,o=e.startNumber;return{number:(void 0===o?1:o)+t,duration:n/a,timeline:s,time:i*n}}}(e));if("static"===i){var l=u.length-1;u[l].duration=s-n/a*l}return u},H=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,q=function(e,t){return e.replace(H,function(e){return function(t,i,n,r){if("$$"===t)return"$";if(void 0===e[i])return t;var a=""+e[i];return"RepresentationID"===i?a:(r=n?parseInt(r,10):1,a.length>=r?a:""+new Array(r-a.length+1).join("0")+a)}}(t))},z=function(e,t){var i={RepresentationID:e.id,Bandwidth:e.bandwidth||0},n=e.initialization,r=void 0===n?{sourceURL:"",range:""}:n,a=B({baseUrl:e.baseUrl,source:q(r.sourceURL,i),range:r.range});return function(e,t){return e.duration||t?e.duration?V(e):j(e,t):[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodIndex}]}(e,t).map((function(t){i.Number=t.number,i.Time=t.time;var n=q(e.media||"",i);return{uri:n,timeline:t.timeline,duration:t.duration,resolvedUri:M(e.baseUrl||"",n),map:a,number:t.number}}))},W="INVALID_NUMBER_OF_PERIOD",G="DASH_EMPTY_MANIFEST",X="DASH_INVALID_XML",Y="NO_BASE_URL",$="SEGMENT_TIME_UNSPECIFIED",K="UNSUPPORTED_UTC_TIMING_SCHEME",Q=function(e,t){var i=e.duration,n=e.segmentUrls,r=void 0===n?[]:n;if(!i&&!t||i&&t)throw new Error($);var a,s=r.map((function(t){return function(e,t){var i=e.baseUrl,n=e.initialization,r=void 0===n?{}:n,a=B({baseUrl:i,source:r.sourceURL,range:r.range}),s=B({baseUrl:i,source:t.media,range:t.mediaRange});return s.map=a,s}(e,t)}));return i&&(a=V(e)),t&&(a=j(e,t)),a.map((function(e,t){if(s[t]){var i=s[t];return i.timeline=e.timeline,i.duration=e.duration,i.number=e.number,i}})).filter((function(e){return e}))},J=function(e){var t=e.baseUrl,i=e.initialization,n=void 0===i?{}:i,r=e.sourceDuration,a=e.timescale,s=void 0===a?1:a,o=e.indexRange,u=void 0===o?"":o,l=e.duration;if(!t)throw new Error(Y);var c=B({baseUrl:t,source:n.sourceURL,range:n.range}),h=B({baseUrl:t,source:t,range:u});if(h.map=c,l){var d=V(e);d.length&&(h.duration=d[0].duration,h.timeline=d[0].timeline)}else r&&(h.duration=r/s,h.timeline=0);return h.number=0,[h]},Z=function(e){var t,i,n=e.attributes,r=e.segmentInfo;if(r.template?(i=z,t=A(n,r.template)):r.base?(i=J,t=A(n,r.base)):r.list&&(i=Q,t=A(n,r.list)),!i)return{attributes:n};var a=i(t,r.timeline);if(t.duration){var s=t,o=s.duration,u=s.timescale,l=void 0===u?1:u;t.duration=o/l}else a.length?t.duration=a.reduce((function(e,t){return Math.max(e,Math.ceil(t.duration))}),0):t.duration=0;return{attributes:t,segments:a}},ee=function(e,t){return O(e.childNodes).filter((function(e){return e.tagName===t}))},te=function(e){return e.textContent.trim()},ie=function(e){var t=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);if(!t)return 0;var i=t.slice(1),n=i[0],r=i[1],a=i[2],s=i[3],o=i[4],u=i[5];return 31536e3*parseFloat(n||0)+2592e3*parseFloat(r||0)+86400*parseFloat(a||0)+3600*parseFloat(s||0)+60*parseFloat(o||0)+parseFloat(u||0)},ne={mediaPresentationDuration:function(e){return ie(e)},availabilityStartTime:function(e){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t=e)&&(t+="Z"),Date.parse(t)/1e3;var t},minimumUpdatePeriod:function(e){return ie(e)},timeShiftBufferDepth:function(e){return ie(e)},start:function(e){return ie(e)},width:function(e){return parseInt(e,10)},height:function(e){return parseInt(e,10)},bandwidth:function(e){return parseInt(e,10)},startNumber:function(e){return parseInt(e,10)},timescale:function(e){return parseInt(e,10)},duration:function(e){var t=parseInt(e,10);return isNaN(t)?ie(e):t},d:function(e){return parseInt(e,10)},t:function(e){return parseInt(e,10)},r:function(e){return parseInt(e,10)},DEFAULT:function(e){return e}},re=function(e){return e&&e.attributes?O(e.attributes).reduce((function(e,t){var i=ne[t.name]||ne.DEFAULT;return e[t.name]=i(t.value),e}),{}):{}};var ae={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"},se=function(e,t){return t.length?L(e.map((function(e){return t.map((function(t){return M(e,te(t))}))}))):e},oe=function(e){var t=ee(e,"SegmentTemplate")[0],i=ee(e,"SegmentList")[0],n=i&&ee(i,"SegmentURL").map((function(e){return A({tag:"SegmentURL"},re(e))})),r=ee(e,"SegmentBase")[0],a=i||t,s=a&&ee(a,"SegmentTimeline")[0],o=i||r||t,u=o&&ee(o,"Initialization")[0],l=t&&re(t);l&&u?l.initialization=u&&re(u):l&&l.initialization&&(l.initialization={sourceURL:l.initialization});var c={template:l,timeline:s&&ee(s,"S").map((function(e){return re(e)})),list:i&&A(re(i),{segmentUrls:n,initialization:re(u)}),base:r&&A(re(r),{initialization:re(u)})};return Object.keys(c).forEach((function(e){c[e]||delete c[e]})),c},ue=function(e){return e.reduce((function(e,t){var i=re(t),n=ae[i.schemeIdUri];if(n){e[n]={attributes:i};var r=ee(t,"cenc:pssh")[0];if(r){var a=te(r),s=a&&function(e){for(var t=f().atob(e),i=new Uint8Array(t.length),n=0;n<t.length;n++)i[n]=t.charCodeAt(n);return i}(a);e[n].pssh=s}}return e}),{})},le=function(e,t,i){return function(n){var r=re(n),a=se(t,ee(n,"BaseURL")),s=ee(n,"Role")[0],o={role:re(s)},u=A(e,r,o),l=ue(ee(n,"ContentProtection"));Object.keys(l).length&&(u=A(u,{contentProtection:l}));var c=oe(n),h=ee(n,"Representation"),d=A(i,c);return L(h.map(function(e,t,i){return function(n){var r=ee(n,"BaseURL"),a=se(t,r),s=A(e,re(n)),o=oe(n);return a.map((function(e){return{segmentInfo:A(i,o),attributes:A(s,{baseUrl:e})}}))}}(u,a,d)))}},ce=function(e,t){void 0===t&&(t={});var i=t,n=i.manifestUri,r=void 0===n?"":n,a=i.NOW,s=void 0===a?Date.now():a,o=i.clientOffset,u=void 0===o?0:o,l=ee(e,"Period");if(!l.length)throw new Error(W);var c=re(e),h=se([r],ee(e,"BaseURL"));return c.sourceDuration=c.mediaPresentationDuration||0,c.NOW=s,c.clientOffset=u,L(l.map(function(e,t){return function(i,n){var r=se(t,ee(i,"BaseURL")),a=re(i),s=parseInt(a.id,10),o=f().isNaN(s)?n:s,u=A(e,{periodIndex:o}),l=ee(i,"AdaptationSet"),c=oe(i);return L(l.map(le(u,r,c)))}}(c,h)))},he=function(e){if(""===e)throw new Error(G);var t=(new(f().DOMParser)).parseFromString(e,"application/xml"),i=t&&"MPD"===t.documentElement.tagName?t.documentElement:null;if(!i||i&&i.getElementsByTagName("parsererror").length>0)throw new Error(X);return i},de=function(e,t){return I(ce(he(e),t).map(Z))},pe=function(e){return function(e){var t=ee(e,"UTCTiming")[0];if(!t)return null;var i=re(t);switch(i.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":i.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":i.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":i.method="DIRECT",i.value=Date.parse(i.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(K)}return i}(he(e))},fe=i(7661),me=i.n(fe),ge=i(272),ye=i(5547),ve=i.n(ye);var _e=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},be=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),Te=null,Se=function(){function e(t){_e(this,e),Te||(Te=function(){var e=[[[],[],[],[],[]],[[],[],[],[],[]]],t=e[0],i=e[1],n=t[4],r=i[4],a=void 0,s=void 0,o=void 0,u=[],l=[],c=void 0,h=void 0,d=void 0,p=void 0,f=void 0;for(a=0;a<256;a++)l[(u[a]=a<<1^283*(a>>7))^a]=a;for(s=o=0;!n[s];s^=c||1,o=l[o]||1)for(d=(d=o^o<<1^o<<2^o<<3^o<<4)>>8^255&d^99,n[s]=d,r[d]=s,f=16843009*u[h=u[c=u[s]]]^65537*h^257*c^16843008*s,p=257*u[d]^16843008*d,a=0;a<4;a++)t[a][s]=p=p<<24^p>>>8,i[a][d]=f=f<<24^f>>>8;for(a=0;a<5;a++)t[a]=t[a].slice(0),i[a]=i[a].slice(0);return e}()),this._tables=[[Te[0][0].slice(),Te[0][1].slice(),Te[0][2].slice(),Te[0][3].slice(),Te[0][4].slice()],[Te[1][0].slice(),Te[1][1].slice(),Te[1][2].slice(),Te[1][3].slice(),Te[1][4].slice()]];var i=void 0,n=void 0,r=void 0,a=void 0,s=void 0,o=this._tables[0][4],u=this._tables[1],l=t.length,c=1;if(4!==l&&6!==l&&8!==l)throw new Error("Invalid aes key size");for(a=t.slice(0),s=[],this._key=[a,s],i=l;i<4*l+28;i++)r=a[i-1],(i%l==0||8===l&&i%l==4)&&(r=o[r>>>24]<<24^o[r>>16&255]<<16^o[r>>8&255]<<8^o[255&r],i%l==0&&(r=r<<8^r>>>24^c<<24,c=c<<1^283*(c>>7))),a[i]=a[i-l]^r;for(n=0;i;n++,i--)r=a[3&n?i:i-4],s[n]=i<=4||n<4?r:u[0][o[r>>>24]]^u[1][o[r>>16&255]]^u[2][o[r>>8&255]]^u[3][o[255&r]]}return e.prototype.decrypt=function(e,t,i,n,r,a){var s=this._key[1],o=e^s[0],u=n^s[1],l=i^s[2],c=t^s[3],h=void 0,d=void 0,p=void 0,f=s.length/4-2,m=void 0,g=4,y=this._tables[1],v=y[0],_=y[1],b=y[2],T=y[3],S=y[4];for(m=0;m<f;m++)h=v[o>>>24]^_[u>>16&255]^b[l>>8&255]^T[255&c]^s[g],d=v[u>>>24]^_[l>>16&255]^b[c>>8&255]^T[255&o]^s[g+1],p=v[l>>>24]^_[c>>16&255]^b[o>>8&255]^T[255&u]^s[g+2],c=v[c>>>24]^_[o>>16&255]^b[u>>8&255]^T[255&l]^s[g+3],g+=4,o=h,u=d,l=p;for(m=0;m<4;m++)r[(3&-m)+a]=S[o>>>24]<<24^S[u>>16&255]<<16^S[l>>8&255]<<8^S[255&c]^s[g++],h=o,o=u,u=l,l=c,c=h},e}(),ke=function(){function e(){_e(this,e),this.listeners={}}return e.prototype.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},e.prototype.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e].splice(i,1),i>-1},e.prototype.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,n=0;n<i;++n)t[n].call(this,arguments[1]);else for(var r=Array.prototype.slice.call(arguments,1),a=t.length,s=0;s<a;++s)t[s].apply(this,r)},e.prototype.dispose=function(){this.listeners={}},e.prototype.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}(),we=function(e){function t(){_e(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,ke));return i.jobs=[],i.delay=1,i.timeout_=null,i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},t.prototype.push=function(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},t}(ke),Ce=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},Ee=function(e,t,i){var n=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),r=new Se(Array.prototype.slice.call(t)),a=new Uint8Array(e.byteLength),s=new Int32Array(a.buffer),o=void 0,u=void 0,l=void 0,c=void 0,h=void 0,d=void 0,p=void 0,f=void 0,m=void 0;for(o=i[0],u=i[1],l=i[2],c=i[3],m=0;m<n.length;m+=4)h=Ce(n[m]),d=Ce(n[m+1]),p=Ce(n[m+2]),f=Ce(n[m+3]),r.decrypt(h,d,p,f,s,m),s[m]=Ce(s[m]^o),s[m+1]=Ce(s[m+1]^u),s[m+2]=Ce(s[m+2]^l),s[m+3]=Ce(s[m+3]^c),o=h,u=d,l=p,c=f;return a},Ae=function(){function e(t,i,n,r){_e(this,e);var a=e.STEP,s=new Int32Array(t.buffer),o=new Uint8Array(t.byteLength),u=0;for(this.asyncStream_=new we,this.asyncStream_.push(this.decryptChunk_(s.subarray(u,u+a),i,n,o)),u=a;u<s.length;u+=a)n=new Uint32Array([Ce(s[u-4]),Ce(s[u-3]),Ce(s[u-2]),Ce(s[u-1])]),this.asyncStream_.push(this.decryptChunk_(s.subarray(u,u+a),i,n,o));this.asyncStream_.push((function(){var e;r(null,(e=o).subarray(0,e.byteLength-e[e.byteLength-1]))}))}return e.prototype.decryptChunk_=function(e,t,i,n){return function(){var r=Ee(e,t,i);n.set(r,e.byteOffset)}},be(e,null,[{key:"STEP",get:function(){return 32e3}}]),e}(),Le=i(5108),Oe="7.4.1";function Pe(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function xe(e,t){return(xe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ue(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function Ie(e,t,i){return(Ie=Ue()?Reflect.construct:function(e,t,i){var n=[null];n.push.apply(n,t);var r=new(Function.bind.apply(e,n));return i&&xe(r,i.prototype),r}).apply(null,arguments)}function De(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Re(e,t){return t||(t=e.slice(0)),e.raw=t,e}var Me=[];var Be=function e(t){var i,n="info",r=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i("log",n,t)};return i=function(e,t){return function(i,n,r){var a=t.levels[n],s=new RegExp("^("+a+")$");if("log"!==i&&r.unshift(i.toUpperCase()+":"),r.unshift(e+":"),Me&&Me.push([].concat(r)),f().console){var o=f().console[i];o||"debug"!==i||(o=f().console.info||f().console.log),o&&a&&s.test(i)&&o[Array.isArray(r)?"apply":"call"](f().console,r)}}}(t,r),r.createLogger=function(i){return e(t+": "+i)},r.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:n},r.level=function(e){if("string"==typeof e){if(!r.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');n=e}return n},(r.history=function(){return Me?[].concat(Me):[]}).filter=function(e){return(Me||[]).filter((function(t){return new RegExp(".*"+e+".*").test(t[0])}))},r.history.clear=function(){Me&&(Me.length=0)},r.history.disable=function(){null!==Me&&(Me.length=0,Me=null)},r.history.enable=function(){null===Me&&(Me=[])},r.error=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return i("error",n,t)},r.warn=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return i("warn",n,t)},r.debug=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return i("debug",n,t)},r}("VIDEOJS"),Ne=Be.createLogger,je=Object.prototype.toString,Fe=function(e){return qe(e)?Object.keys(e):[]};function Ve(e,t){Fe(e).forEach((function(i){return t(e[i],i)}))}function He(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return Object.assign?Object.assign.apply(Object,[e].concat(i)):(i.forEach((function(t){t&&Ve(t,(function(t,i){e[i]=t}))})),e)}function qe(e){return!!e&&"object"==typeof e}function ze(e){return qe(e)&&"[object Object]"===je.call(e)&&e.constructor===Object}function We(e,t){if(!e||!t)return"";if("function"==typeof f().getComputedStyle){var i=f().getComputedStyle(e);return i?i[t]:""}return""}function Ge(){var e=Re(["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 ","."]);return Ge=function(){return e},e}function Xe(e){return"string"==typeof e&&/\S/.test(e)}function Ye(e){if(/\s/.test(e))throw new Error("class has illegal whitespace characters")}function $e(){return C()===f().document}function Ke(e){return qe(e)&&1===e.nodeType}function Qe(){try{return f().parent!==f().self}catch(e){return!0}}function Je(e){return function(t,i){if(!Xe(t))return C()[e](null);Xe(i)&&(i=C().querySelector(i));var n=Ke(i)?i:C();return n[e]&&n[e](t)}}function Ze(e,t,i,n){void 0===e&&(e="div"),void 0===t&&(t={}),void 0===i&&(i={});var r=C().createElement(e);return Object.getOwnPropertyNames(t).forEach((function(e){var i=t[e];-1!==e.indexOf("aria-")||"role"===e||"type"===e?(Be.warn(u()(Ge(),e,i)),r.setAttribute(e,i)):"textContent"===e?et(r,i):r[e]=i})),Object.getOwnPropertyNames(i).forEach((function(e){r.setAttribute(e,i[e])})),n&&_t(r,n),r}function et(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function tt(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function it(e,t){return Ye(t),e.classList?e.classList.contains(t):(i=t,new RegExp("(^|\\s)"+i+"($|\\s)")).test(e.className);var i}function nt(e,t){return e.classList?e.classList.add(t):it(e,t)||(e.className=(e.className+" "+t).trim()),e}function rt(e,t){return e.classList?e.classList.remove(t):(Ye(t),e.className=e.className.split(/\s+/).filter((function(e){return e!==t})).join(" ")),e}function at(e,t,i){var n=it(e,t);if("function"==typeof i&&(i=i(e,t)),"boolean"!=typeof i&&(i=!n),i!==n)return i?nt(e,t):rt(e,t),e}function st(e,t){Object.getOwnPropertyNames(t).forEach((function(i){var n=t[i];null==n||!1===n?e.removeAttribute(i):e.setAttribute(i,!0===n?"":n)}))}function ot(e){var t={},i=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(e&&e.attributes&&e.attributes.length>0)for(var n=e.attributes,r=n.length-1;r>=0;r--){var a=n[r].name,s=n[r].value;"boolean"!=typeof e[a]&&-1===i.indexOf(","+a+",")||(s=null!==s),t[a]=s}return t}function ut(e,t){return e.getAttribute(t)}function lt(e,t,i){e.setAttribute(t,i)}function ct(e,t){e.removeAttribute(t)}function ht(){C().body.focus(),C().onselectstart=function(){return!1}}function dt(){C().onselectstart=function(){return!0}}function pt(e){if(e&&e.getBoundingClientRect&&e.parentNode){var t=e.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach((function(e){void 0!==t[e]&&(i[e]=t[e])})),i.height||(i.height=parseFloat(We(e,"height"))),i.width||(i.width=parseFloat(We(e,"width"))),i}}function ft(e){var t;if(e.getBoundingClientRect&&e.parentNode&&(t=e.getBoundingClientRect()),!t)return{left:0,top:0};var i=C().documentElement,n=C().body,r=i.clientLeft||n.clientLeft||0,a=f().pageXOffset||n.scrollLeft,s=t.left+a-r,o=i.clientTop||n.clientTop||0,u=f().pageYOffset||n.scrollTop,l=t.top+u-o;return{left:Math.round(s),top:Math.round(l)}}function mt(e,t){var i={},n=ft(e),r=e.offsetWidth,a=e.offsetHeight,s=n.top,o=n.left,u=t.pageY,l=t.pageX;return t.changedTouches&&(l=t.changedTouches[0].pageX,u=t.changedTouches[0].pageY),i.y=Math.max(0,Math.min(1,(s-u+a)/a)),i.x=Math.max(0,Math.min(1,(l-o)/r)),i}function gt(e){return qe(e)&&3===e.nodeType}function yt(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function vt(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map((function(e){return"function"==typeof e&&(e=e()),Ke(e)||gt(e)?e:"string"==typeof e&&/\S/.test(e)?C().createTextNode(e):void 0})).filter((function(e){return e}))}function _t(e,t){return vt(t).forEach((function(t){return e.appendChild(t)})),e}function bt(e,t){return _t(yt(e),t)}function Tt(e){return void 0===e.button&&void 0===e.buttons||(0===e.button&&void 0===e.buttons||0===e.button&&1===e.buttons)}var St=Je("querySelector"),kt=Je("querySelectorAll"),wt=Object.freeze({isReal:$e,isEl:Ke,isInFrame:Qe,createEl:Ze,textContent:et,prependTo:tt,hasClass:it,addClass:nt,removeClass:rt,toggleClass:at,setAttributes:st,getAttributes:ot,getAttribute:ut,setAttribute:lt,removeAttribute:ct,blockTextSelection:ht,unblockTextSelection:dt,getBoundingClientRect:pt,findPosition:ft,getPointerPosition:mt,isTextNode:gt,emptyEl:yt,normalizeContent:vt,appendContent:_t,insertContent:bt,isSingleLeftClick:Tt,$:St,$$:kt}),Ct=1;function Et(){return Ct++}var At={},Lt="vdata"+(new Date).getTime();function Ot(e){var t=e[Lt];return t||(t=e[Lt]=Et()),At[t]||(At[t]={}),At[t]}function Pt(e){var t=e[Lt];return!!t&&!!Object.getOwnPropertyNames(At[t]).length}function xt(e){var t=e[Lt];if(t){delete At[t];try{delete e[Lt]}catch(t){e.removeAttribute?e.removeAttribute(Lt):e[Lt]=null}}}function Ut(e,t){var i=Ot(e);0===i.handlers[t].length&&(delete i.handlers[t],e.removeEventListener?e.removeEventListener(t,i.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,i.dispatcher)),Object.getOwnPropertyNames(i.handlers).length<=0&&(delete i.handlers,delete i.dispatcher,delete i.disabled),0===Object.getOwnPropertyNames(i).length&&xt(e)}function It(e,t,i,n){i.forEach((function(i){e(t,i,n)}))}function Dt(e){function t(){return!0}function i(){return!1}if(!e||!e.isPropagationStopped){var n=e||f().event;for(var r in e={},n)"layerX"!==r&&"layerY"!==r&&"keyLocation"!==r&&"webkitMovementX"!==r&&"webkitMovementY"!==r&&("returnValue"===r&&n.preventDefault||(e[r]=n[r]));if(e.target||(e.target=e.srcElement||C()),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){n.preventDefault&&n.preventDefault(),e.returnValue=!1,n.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){n.stopPropagation&&n.stopPropagation(),e.cancelBubble=!0,n.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=i,e.stopImmediatePropagation=function(){n.stopImmediatePropagation&&n.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=i,null!==e.clientX&&void 0!==e.clientX){var a=C().documentElement,s=C().body;e.pageX=e.clientX+(a&&a.scrollLeft||s&&s.scrollLeft||0)-(a&&a.clientLeft||s&&s.clientLeft||0),e.pageY=e.clientY+(a&&a.scrollTop||s&&s.scrollTop||0)-(a&&a.clientTop||s&&s.clientTop||0)}e.which=e.charCode||e.keyCode,null!==e.button&&void 0!==e.button&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0)}return e}var Rt=!1;!function(){try{var e=Object.defineProperty({},"passive",{get:function(){Rt=!0}});f().addEventListener("test",null,e),f().removeEventListener("test",null,e)}catch(e){}}();var Mt=["touchstart","touchmove"];function Bt(e,t,i){if(Array.isArray(t))return It(Bt,e,t,i);var n=Ot(e);if(n.handlers||(n.handlers={}),n.handlers[t]||(n.handlers[t]=[]),i.guid||(i.guid=Et()),n.handlers[t].push(i),n.dispatcher||(n.disabled=!1,n.dispatcher=function(t,i){if(!n.disabled){t=Dt(t);var r=n.handlers[t.type];if(r)for(var a=r.slice(0),s=0,o=a.length;s<o&&!t.isImmediatePropagationStopped();s++)try{a[s].call(e,t,i)}catch(e){Be.error(e)}}}),1===n.handlers[t].length)if(e.addEventListener){var r=!1;Rt&&Mt.indexOf(t)>-1&&(r={passive:!0}),e.addEventListener(t,n.dispatcher,r)}else e.attachEvent&&e.attachEvent("on"+t,n.dispatcher)}function Nt(e,t,i){if(Pt(e)){var n=Ot(e);if(n.handlers){if(Array.isArray(t))return It(Nt,e,t,i);var r=function(e,t){n.handlers[t]=[],Ut(e,t)};if(void 0!==t){var a=n.handlers[t];if(a)if(i){if(i.guid)for(var s=0;s<a.length;s++)a[s].guid===i.guid&&a.splice(s--,1);Ut(e,t)}else r(e,t)}else for(var o in n.handlers)Object.prototype.hasOwnProperty.call(n.handlers||{},o)&&r(e,o)}}}function jt(e,t,i){var n=Pt(e)?Ot(e):{},r=e.parentNode||e.ownerDocument;if("string"==typeof t?t={type:t,target:e}:t.target||(t.target=e),t=Dt(t),n.dispatcher&&n.dispatcher.call(e,t,i),r&&!t.isPropagationStopped()&&!0===t.bubbles)jt.call(null,r,t,i);else if(!r&&!t.defaultPrevented){var a=Ot(t.target);t.target[t.type]&&(a.disabled=!0,"function"==typeof t.target[t.type]&&t.target[t.type](),a.disabled=!1)}return!t.defaultPrevented}function Ft(e,t,i){if(Array.isArray(t))return It(Ft,e,t,i);var n=function n(){Nt(e,t,n),i.apply(this,arguments)};n.guid=i.guid=i.guid||Et(),Bt(e,t,n)}var Vt,Ht=Object.freeze({fixEvent:Dt,on:Bt,off:Nt,trigger:jt,one:Ft}),qt=!1,zt=function(){if($e()&&!1!==Vt.options.autoSetup){var e=Array.prototype.slice.call(C().getElementsByTagName("video")),t=Array.prototype.slice.call(C().getElementsByTagName("audio")),i=Array.prototype.slice.call(C().getElementsByTagName("video-js")),n=e.concat(t,i);if(n&&n.length>0)for(var r=0,a=n.length;r<a;r++){var s=n[r];if(!s||!s.getAttribute){Wt(1);break}void 0===s.player&&null!==s.getAttribute("data-setup")&&Vt(s)}else qt||Wt(1)}};function Wt(e,t){t&&(Vt=t),f().setTimeout(zt,e)}$e()&&"complete"===C().readyState?qt=!0:Ft(f(),"load",(function(){qt=!0}));var Gt,Xt=function(e){var t=C().createElement("style");return t.className=e,t},Yt=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t},$t=function(e,t,i){t.guid||(t.guid=Et());var n=function(){return t.apply(e,arguments)};return n.guid=i?i+"_"+t.guid:t.guid,n},Kt=function(e,t){var i=Date.now();return function(){var n=Date.now();n-i>=t&&(e.apply(void 0,arguments),i=n)}},Qt=function(){};Qt.prototype.allowedEvents_={},Qt.prototype.on=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},Bt(this,e,t),this.addEventListener=i},Qt.prototype.addEventListener=Qt.prototype.on,Qt.prototype.off=function(e,t){Nt(this,e,t)},Qt.prototype.removeEventListener=Qt.prototype.off,Qt.prototype.one=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},Ft(this,e,t),this.addEventListener=i},Qt.prototype.trigger=function(e){var t=e.type||e;"string"==typeof e&&(e={type:t}),e=Dt(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),jt(this,e)},Qt.prototype.dispatchEvent=Qt.prototype.trigger,Qt.prototype.queueTrigger=function(e){var t=this;Gt||(Gt=new Map);var i=e.type||e,n=Gt.get(this);n||(n=new Map,Gt.set(this,n));var r=n.get(i);n.delete(i),f().clearTimeout(r);var a=f().setTimeout((function(){0===n.size&&(n=null,Gt.delete(t)),t.trigger(e)}),0);n.set(i,a)};var Jt=function(e){return e instanceof Qt||!!e.eventBusEl_&&["on","one","off","trigger"].every((function(t){return"function"==typeof e[t]}))},Zt=function(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},ei=function(e){if(!e.nodeName&&!Jt(e))throw new Error("Invalid target; must be a DOM node or evented object.")},ti=function(e){if(!Zt(e))throw new Error("Invalid event type; must be a non-empty string or array.")},ii=function(e){if("function"!=typeof e)throw new Error("Invalid listener; must be a function.")},ni=function(e,t){var i,n,r,a=t.length<3||t[0]===e||t[0]===e.eventBusEl_;return a?(i=e.eventBusEl_,t.length>=3&&t.shift(),n=t[0],r=t[1]):(i=t[0],n=t[1],r=t[2]),ei(i),ti(n),ii(r),{isTargetingSelf:a,target:i,type:n,listener:r=$t(e,r)}},ri=function(e,t,i,n){ei(e),e.nodeName?Ht[t](e,i,n):e[t](i,n)},ai={on:function(){for(var e=this,t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];var r=ni(this,i),a=r.isTargetingSelf,s=r.target,o=r.type,u=r.listener;if(ri(s,"on",o,u),!a){var l=function(){return e.off(s,o,u)};l.guid=u.guid;var c=function(){return e.off("dispose",l)};c.guid=u.guid,ri(this,"on","dispose",l),ri(s,"on","dispose",c)}},one:function(){for(var e=this,t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];var r=ni(this,i),a=r.isTargetingSelf,s=r.target,o=r.type,u=r.listener;if(a)ri(s,"one",o,u);else{var l=function t(){e.off(s,o,t);for(var i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];u.apply(null,n)};l.guid=u.guid,ri(s,"one",o,l)}},off:function(e,t,i){if(!e||Zt(e))Nt(this.eventBusEl_,e,t);else{var n=e,r=t;ei(n),ti(r),ii(i),i=$t(this,i),this.off("dispose",i),n.nodeName?(Nt(n,r,i),Nt(n,"dispose",i)):Jt(n)&&(n.off(r,i),n.off("dispose",i))}},trigger:function(e,t){return jt(this.eventBusEl_,e,t)}};function si(e,t){void 0===t&&(t={});var i=t.eventBusKey;if(i){if(!e[i].nodeName)throw new Error('The eventBusKey "'+i+'" does not refer to an element.');e.eventBusEl_=e[i]}else e.eventBusEl_=Ze("span",{className:"vjs-event-bus"});return He(e,ai),e.eventedCallbacks&&e.eventedCallbacks.forEach((function(e){e()})),e.on("dispose",(function(){e.off(),f().setTimeout((function(){e.eventBusEl_=null}),0)})),e}var oi={state:{},setState:function(e){var t,i=this;return"function"==typeof e&&(e=e()),Ve(e,(function(e,n){i.state[n]!==e&&((t=t||{})[n]={from:i.state[n],to:e}),i.state[n]=e})),t&&Jt(this)&&this.trigger({changes:t,type:"statechanged"}),t}};function ui(e,t){return He(e,oi),e.state=He({},e.state,t),"function"==typeof e.handleStateChanged&&Jt(e)&&e.on("statechanged",e.handleStateChanged),e}function li(e){return"string"!=typeof e?e:e.charAt(0).toUpperCase()+e.slice(1)}function ci(){for(var e={},t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return i.forEach((function(t){t&&Ve(t,(function(t,i){ze(t)?(ze(e[i])||(e[i]={}),e[i]=ci(e[i],t)):e[i]=t}))})),e}var hi=function(){function e(e,t,i){if(!e&&this.play?this.player_=e=this:this.player_=e,this.options_=ci({},this.options_),t=this.options_=ci(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){var n=e&&e.id&&e.id()||"no_player";this.id_=n+"_component_"+Et()}this.name_=t.name||null,t.el?this.el_=t.el:!1!==t.createEl&&(this.el_=this.createEl()),!1!==t.evented&&si(this,{eventBusKey:this.el_?"el_":null}),ui(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},!1!==t.initChildren&&this.initChildren(),this.ready(i),!1!==t.reportTouchActivity&&this.enableTouchActivity()}var t=e.prototype;return t.dispose=function(){if(this.trigger({type:"dispose",bubbles:!1}),this.children_)for(var e=this.children_.length-1;e>=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),xt(this.el_),this.el_=null),this.player_=null},t.player=function(){return this.player_},t.options=function(e){return Be.warn("this.options() has been deprecated and will be moved to the constructor in 6.0"),e?(this.options_=ci(this.options_,e),this.options_):this.options_},t.el=function(){return this.el_},t.createEl=function(e,t,i){return Ze(e,t,i)},t.localize=function(e,t,i){void 0===i&&(i=e);var n=this.player_.language&&this.player_.language(),r=this.player_.languages&&this.player_.languages(),a=r&&r[n],s=n&&n.split("-")[0],o=r&&r[s],u=i;return a&&a[e]?u=a[e]:o&&o[e]&&(u=o[e]),t&&(u=u.replace(/\{(\d+)\}/g,(function(e,i){var n=t[i-1],r=n;return void 0===n&&(r=e),r}))),u},t.contentEl=function(){return this.contentEl_||this.el_},t.id=function(){return this.id_},t.name=function(){return this.name_},t.children=function(){return this.children_},t.getChildById=function(e){return this.childIndex_[e]},t.getChild=function(e){if(e)return e=li(e),this.childNameIndex_[e]},t.addChild=function(t,i,n){var r,a;if(void 0===i&&(i={}),void 0===n&&(n=this.children_.length),"string"==typeof t){a=li(t);var s=i.componentClass||a;i.name=a;var o=e.getComponent(s);if(!o)throw new Error("Component "+s+" does not exist");if("function"!=typeof o)return null;r=new o(this.player_||this,i)}else r=t;if(this.children_.splice(n,0,r),"function"==typeof r.id&&(this.childIndex_[r.id()]=r),(a=a||r.name&&li(r.name()))&&(this.childNameIndex_[a]=r),"function"==typeof r.el&&r.el()){var u=this.contentEl().children[n]||null;this.contentEl().insertBefore(r.el(),u)}return r},t.removeChild=function(e){if("string"==typeof e&&(e=this.getChild(e)),e&&this.children_){for(var t=!1,i=this.children_.length-1;i>=0;i--)if(this.children_[i]===e){t=!0,this.children_.splice(i,1);break}if(t){this.childIndex_[e.id()]=null,this.childNameIndex_[e.name()]=null;var n=e.el();n&&n.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}},t.initChildren=function(){var t=this,i=this.options_.children;if(i){var n,r=this.options_,a=e.getComponent("Tech");(n=Array.isArray(i)?i:Object.keys(i)).concat(Object.keys(this.options_).filter((function(e){return!n.some((function(t){return"string"==typeof t?e===t:e===t.name}))}))).map((function(e){var n,r;return"string"==typeof e?r=i[n=e]||t.options_[n]||{}:(n=e.name,r=e),{name:n,opts:r}})).filter((function(t){var i=e.getComponent(t.opts.componentClass||li(t.name));return i&&!a.isTech(i)})).forEach((function(e){var i=e.name,n=e.opts;if(void 0!==r[i]&&(n=r[i]),!1!==n){!0===n&&(n={}),n.playerOptions=t.options_.playerOptions;var a=t.addChild(i,n);a&&(t[i]=a)}}))}},t.buildCSSClass=function(){return""},t.ready=function(e,t){if(void 0===t&&(t=!1),e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))},t.triggerReady=function(){this.isReady_=!0,this.setTimeout((function(){var e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach((function(e){e.call(this)}),this),this.trigger("ready")}),1)},t.$=function(e,t){return St(e,t||this.contentEl())},t.$$=function(e,t){return kt(e,t||this.contentEl())},t.hasClass=function(e){return it(this.el_,e)},t.addClass=function(e){nt(this.el_,e)},t.removeClass=function(e){rt(this.el_,e)},t.toggleClass=function(e,t){at(this.el_,e,t)},t.show=function(){this.removeClass("vjs-hidden")},t.hide=function(){this.addClass("vjs-hidden")},t.lockShowing=function(){this.addClass("vjs-lock-showing")},t.unlockShowing=function(){this.removeClass("vjs-lock-showing")},t.getAttribute=function(e){return ut(this.el_,e)},t.setAttribute=function(e,t){lt(this.el_,e,t)},t.removeAttribute=function(e){ct(this.el_,e)},t.width=function(e,t){return this.dimension("width",e,t)},t.height=function(e,t){return this.dimension("height",e,t)},t.dimensions=function(e,t){this.width(e,!0),this.height(t)},t.dimension=function(e,t,i){if(void 0!==t)return null!==t&&t==t||(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(i||this.trigger("componentresize"));if(!this.el_)return 0;var n=this.el_.style[e],r=n.indexOf("px");return-1!==r?parseInt(n.slice(0,r),10):parseInt(this.el_["offset"+li(e)],10)},t.currentDimension=function(e){var t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if("function"==typeof f().getComputedStyle){var i=f().getComputedStyle(this.el_);t=i.getPropertyValue(e)||i[e]}if(0===(t=parseFloat(t))){var n="offset"+li(e);t=this.el_[n]}return t},t.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},t.currentWidth=function(){return this.currentDimension("width")},t.currentHeight=function(){return this.currentDimension("height")},t.focus=function(){this.el_.focus()},t.blur=function(){this.el_.blur()},t.emitTapEvents=function(){var e,t=0,i=null;this.on("touchstart",(function(n){1===n.touches.length&&(i={pageX:n.touches[0].pageX,pageY:n.touches[0].pageY},t=(new Date).getTime(),e=!0)})),this.on("touchmove",(function(t){if(t.touches.length>1)e=!1;else if(i){var n=t.touches[0].pageX-i.pageX,r=t.touches[0].pageY-i.pageY;Math.sqrt(n*n+r*r)>10&&(e=!1)}}));var n=function(){e=!1};this.on("touchleave",n),this.on("touchcancel",n),this.on("touchend",(function(n){(i=null,!0===e)&&((new Date).getTime()-t<200&&(n.preventDefault(),this.trigger("tap")))}))},t.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var e,t=$t(this.player(),this.player().reportUserActivity);this.on("touchstart",(function(){t(),this.clearInterval(e),e=this.setInterval(t,250)}));var i=function(i){t(),this.clearInterval(e)};this.on("touchmove",t),this.on("touchend",i),this.on("touchcancel",i)}},t.setTimeout=function(e,t){var i,n,r=this;return e=$t(this,e),i=f().setTimeout((function(){r.off("dispose",n),e()}),t),(n=function(){return r.clearTimeout(i)}).guid="vjs-timeout-"+i,this.on("dispose",n),i},t.clearTimeout=function(e){f().clearTimeout(e);var t=function(){};return t.guid="vjs-timeout-"+e,this.off("dispose",t),e},t.setInterval=function(e,t){var i=this;e=$t(this,e);var n=f().setInterval(e,t),r=function(){return i.clearInterval(n)};return r.guid="vjs-interval-"+n,this.on("dispose",r),n},t.clearInterval=function(e){f().clearInterval(e);var t=function(){};return t.guid="vjs-interval-"+e,this.off("dispose",t),e},t.requestAnimationFrame=function(e){var t,i,n=this;return this.supportsRaf_?(e=$t(this,e),t=f().requestAnimationFrame((function(){n.off("dispose",i),e()})),(i=function(){return n.cancelAnimationFrame(t)}).guid="vjs-raf-"+t,this.on("dispose",i),t):this.setTimeout(e,1e3/60)},t.cancelAnimationFrame=function(e){if(this.supportsRaf_){f().cancelAnimationFrame(e);var t=function(){};return t.guid="vjs-raf-"+e,this.off("dispose",t),e}return this.clearTimeout(e)},e.registerComponent=function(t,i){if("string"!=typeof t||!t)throw new Error('Illegal component name, "'+t+'"; must be a non-empty string.');var n,r=e.getComponent("Tech"),a=r&&r.isTech(i),s=e===i||e.prototype.isPrototypeOf(i.prototype);if(a||!s)throw n=a?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error('Illegal component, "'+t+'"; '+n+".");t=li(t),e.components_||(e.components_={});var o=e.getComponent("Player");if("Player"===t&&o&&o.players){var u=o.players,l=Object.keys(u);if(u&&l.length>0&&l.map((function(e){return u[e]})).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return e.components_[t]=i,i},e.getComponent=function(t){if(t)return t=li(t),e.components_&&e.components_[t]?e.components_[t]:void 0},e}();hi.prototype.supportsRaf_="function"==typeof f().requestAnimationFrame&&"function"==typeof f().cancelAnimationFrame,hi.registerComponent("Component",hi);var di,pi=f().navigator&&f().navigator.userAgent||"",fi=/AppleWebKit\/([\d.]+)/i.exec(pi),mi=fi?parseFloat(fi.pop()):null,gi=/iPad/i.test(pi),yi=/iPhone/i.test(pi)&&!gi,vi=/iPod/i.test(pi),_i=yi||gi||vi,bi=(di=pi.match(/OS (\d+)_/i))&&di[1]?di[1]:null,Ti=/Android/i.test(pi),Si=function(){var e=pi.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;var t=e[1]&&parseFloat(e[1]),i=e[2]&&parseFloat(e[2]);return t&&i?parseFloat(e[1]+"."+e[2]):t||null}(),ki=Ti&&Si<5&&mi<537,wi=/Firefox/i.test(pi),Ci=/Edge/i.test(pi),Ei=!Ci&&(/Chrome/i.test(pi)||/CriOS/i.test(pi)),Ai=function(){var e=pi.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),Li=function(){var e=/MSIE\s(\d+)\.\d/.exec(pi),t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(pi)&&/rv:11.0/.test(pi)&&(t=11),t}(),Oi=/Safari/i.test(pi)&&!Ei&&!Ti&&!Ci,Pi=(Oi||_i)&&!Ei,xi=$e()&&("ontouchstart"in f()||f().navigator.maxTouchPoints||f().DocumentTouch&&f().document instanceof f().DocumentTouch),Ui=Object.freeze({IS_IPAD:gi,IS_IPHONE:yi,IS_IPOD:vi,IS_IOS:_i,IOS_VERSION:bi,IS_ANDROID:Ti,ANDROID_VERSION:Si,IS_NATIVE_ANDROID:ki,IS_FIREFOX:wi,IS_EDGE:Ci,IS_CHROME:Ei,CHROME_VERSION:Ai,IE_VERSION:Li,IS_SAFARI:Oi,IS_ANY_SAFARI:Pi,TOUCH_ENABLED:xi});function Ii(e,t,i,n){return function(e,t,i){if("number"!=typeof t||t<0||t>i)throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+i+").")}(e,n,i.length-1),i[n][t]}function Di(e){return void 0===e||0===e.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:Ii.bind(null,"start",0,e),end:Ii.bind(null,"end",1,e)}}function Ri(e,t){return Array.isArray(e)?Di(e):void 0===e||void 0===t?Di():Di([[e,t]])}function Mi(e,t){var i,n,r=0;if(!t)return 0;e&&e.length||(e=Ri(0,0));for(var a=0;a<e.length;a++)i=e.start(a),(n=e.end(a))>t&&(n=t),r+=n-i;return r/t}for(var Bi,Ni={},ji=[["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"]],Fi=ji[0],Vi=0;Vi<ji.length;Vi++)if(ji[Vi][1]in C()){Bi=ji[Vi];break}if(Bi)for(var Hi=0;Hi<Bi.length;Hi++)Ni[Fi[Hi]]=Bi[Hi];function qi(e){if(e instanceof qi)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:qe(e)&&("number"==typeof e.code&&(this.code=e.code),He(this,e)),this.message||(this.message=qi.defaultMessages[this.code]||"")}qi.prototype.code=0,qi.prototype.message="",qi.prototype.status=null,qi.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],qi.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(var zi=0;zi<qi.errorTypes.length;zi++)qi[qi.errorTypes[zi]]=zi,qi.prototype[qi.errorTypes[zi]]=zi;function Wi(e){return null!=e&&"function"==typeof e.then}function Gi(e){Wi(e)&&e.then(null,(function(e){}))}var Xi=function(e){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((function(t,i,n){return e[i]&&(t[i]=e[i]),t}),{cues:e.cues&&Array.prototype.map.call(e.cues,(function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}}))})},Yi=function(e){var t=e.$$("track"),i=Array.prototype.map.call(t,(function(e){return e.track}));return Array.prototype.map.call(t,(function(e){var t=Xi(e.track);return e.src&&(t.src=e.src),t})).concat(Array.prototype.filter.call(e.textTracks(),(function(e){return-1===i.indexOf(e)})).map(Xi))},$i=function(e,t){return e.forEach((function(e){var i=t.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach((function(e){return i.addCue(e)}))})),t.textTracks()},Ki=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).opened_=n.hasBeenOpened_=n.hasBeenFilled_=!1,n.closeable(!n.options_.uncloseable),n.content(n.options_.content),n.contentEl_=Ze("div",{className:"vjs-modal-dialog-content"},{role:"document"}),n.descEl_=Ze("p",{className:"vjs-modal-dialog-description vjs-control-text",id:n.el().getAttribute("aria-describedby")}),et(n.descEl_,n.description()),n.el_.appendChild(n.descEl_),n.el_.appendChild(n.contentEl_),n}Pe(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})},i.dispose=function(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,e.prototype.dispose.call(this)},i.buildCSSClass=function(){return"vjs-modal-dialog vjs-hidden "+e.prototype.buildCSSClass.call(this)},i.handleKeyPress=function(e){27===e.which&&this.closeable()&&this.close()},i.label=function(){return this.localize(this.options_.label||"Modal Window")},i.description=function(){var e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e},i.open=function(){if(!this.opened_){var e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.closeable()&&this.on(this.el_.ownerDocument,"keydown",$t(this,this.handleKeyPress)),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}},i.opened=function(e){return"boolean"==typeof e&&this[e?"open":"close"](),this.opened_},i.close=function(){if(this.opened_){var e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.closeable()&&this.off(this.el_.ownerDocument,"keydown",$t(this,this.handleKeyPress)),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}},i.closeable=function(e){if("boolean"==typeof e){var t=this.closeable_=!!e,i=this.getChild("closeButton");if(t&&!i){var n=this.contentEl_;this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=n,this.on(i,"close",this.close)}!t&&i&&(this.off(i,"close",this.close),this.removeChild(i),i.dispose())}return this.closeable_},i.fill=function(){this.fillWith(this.content())},i.fillWith=function(e){var t=this.contentEl(),i=t.parentNode,n=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),bt(t,e),this.trigger("modalfill"),n?i.insertBefore(t,n):i.appendChild(t);var r=this.getChild("closeButton");r&&i.appendChild(r.el_)},i.empty=function(){this.trigger("beforemodalempty"),yt(this.contentEl()),this.trigger("modalempty")},i.content=function(e){return void 0!==e&&(this.content_=e),this.content_},i.conditionalFocus_=function(){var e=C().activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus(),this.on(C(),"keydown",this.handleKeyDown))},i.conditionalBlur_=function(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null),this.off(C(),"keydown",this.handleKeyDown)},i.handleKeyDown=function(e){if(9===e.which){for(var t,i=this.focusableEls_(),n=this.el_.querySelector(":focus"),r=0;r<i.length;r++)if(n===i[r]){t=r;break}C().activeElement===this.el_&&(t=0),e.shiftKey&&0===t?(i[i.length-1].focus(),e.preventDefault()):e.shiftKey||t!==i.length-1||(i[0].focus(),e.preventDefault())}},i.focusableEls_=function(){var e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,(function(e){return(e instanceof f().HTMLAnchorElement||e instanceof f().HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof f().HTMLInputElement||e instanceof f().HTMLSelectElement||e instanceof f().HTMLTextAreaElement||e instanceof f().HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof f().HTMLIFrameElement||e instanceof f().HTMLObjectElement||e instanceof f().HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable")}))},t}(hi);Ki.prototype.options_={pauseOnOpen:!0,temporary:!0},hi.registerComponent("ModalDialog",Ki);var Qi=function(e){function t(t){var i;void 0===t&&(t=[]),(i=e.call(this)||this).tracks_=[],Object.defineProperty(De(De(i)),"length",{get:function(){return this.tracks_.length}});for(var n=0;n<t.length;n++)i.addTrack(t[n]);return i}Pe(t,e);var i=t.prototype;return i.addTrack=function(e){var t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get:function(){return this.tracks_[t]}}),-1===this.tracks_.indexOf(e)&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack"}))},i.removeTrack=function(e){for(var t,i=0,n=this.length;i<n;i++)if(this[i]===e){(t=this[i]).off&&t.off(),this.tracks_.splice(i,1);break}t&&this.trigger({track:t,type:"removetrack"})},i.getTrackById=function(e){for(var t=null,i=0,n=this.length;i<n;i++){var r=this[i];if(r.id===e){t=r;break}}return t},t}(Qt);for(var Ji in Qi.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack"},Qi.prototype.allowedEvents_)Qi.prototype["on"+Ji]=null;var Zi=function(e,t){for(var i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].enabled=!1)},en=function(e){function t(t){var i;void 0===t&&(t=[]);for(var n=t.length-1;n>=0;n--)if(t[n].enabled){Zi(t,t[n]);break}return(i=e.call(this,t)||this).changing_=!1,i}return Pe(t,e),t.prototype.addTrack=function(t){var i=this;t.enabled&&Zi(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&t.addEventListener("enabledchange",(function(){i.changing_||(i.changing_=!0,Zi(i,t),i.changing_=!1,i.trigger("change"))}))},t}(Qi),tn=function(e,t){for(var i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].selected=!1)},nn=function(e){function t(t){var i;void 0===t&&(t=[]);for(var n=t.length-1;n>=0;n--)if(t[n].selected){tn(t,t[n]);break}return(i=e.call(this,t)||this).changing_=!1,Object.defineProperty(De(De(i)),"selectedIndex",{get:function(){for(var e=0;e<this.length;e++)if(this[e].selected)return e;return-1},set:function(){}}),i}return Pe(t,e),t.prototype.addTrack=function(t){var i=this;t.selected&&tn(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&t.addEventListener("selectedchange",(function(){i.changing_||(i.changing_=!0,tn(i,t),i.changing_=!1,i.trigger("change"))}))},t}(Qi),rn=function(e){function t(){return e.apply(this,arguments)||this}return Pe(t,e),t.prototype.addTrack=function(t){e.prototype.addTrack.call(this,t),t.addEventListener("modechange",$t(this,(function(){this.queueTrigger("change")})));-1===["metadata","chapters"].indexOf(t.kind)&&t.addEventListener("modechange",$t(this,(function(){this.trigger("selectedlanguagechange")})))},t}(Qi),an=function(){function e(e){void 0===e&&(e=[]),this.trackElements_=[],Object.defineProperty(this,"length",{get:function(){return this.trackElements_.length}});for(var t=0,i=e.length;t<i;t++)this.addTrackElement_(e[t])}var t=e.prototype;return t.addTrackElement_=function(e){var t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get:function(){return this.trackElements_[t]}}),-1===this.trackElements_.indexOf(e)&&this.trackElements_.push(e)},t.getTrackElementByTrack_=function(e){for(var t,i=0,n=this.trackElements_.length;i<n;i++)if(e===this.trackElements_[i].track){t=this.trackElements_[i];break}return t},t.removeTrackElement_=function(e){for(var t=0,i=this.trackElements_.length;t<i;t++)if(e===this.trackElements_[t]){this.trackElements_.splice(t,1);break}},e}(),sn=function(){function e(t){e.prototype.setCues_.call(this,t),Object.defineProperty(this,"length",{get:function(){return this.length_}})}var t=e.prototype;return t.setCues_=function(e){var t=this.length||0,i=0,n=e.length;this.cues_=e,this.length_=e.length;var r=function(e){""+e in this||Object.defineProperty(this,""+e,{get:function(){return this.cues_[e]}})};if(t<n)for(i=t;i<n;i++)r.call(this,i)},t.getCueById=function(e){for(var t=null,i=0,n=this.length;i<n;i++){var r=this[i];if(r.id===e){t=r;break}}return t},e}(),on={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},un={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},ln={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},cn={disabled:"disabled",hidden:"hidden",showing:"showing"},hn=function(e){function t(t){var i;void 0===t&&(t={}),i=e.call(this)||this;var n={id:t.id||"vjs_track_"+Et(),kind:t.kind||"",label:t.label||"",language:t.language||""},r=function(e){Object.defineProperty(De(De(i)),e,{get:function(){return n[e]},set:function(){}})};for(var a in n)r(a);return i}return Pe(t,e),t}(Qt),dn=function(e){var t=["protocol","hostname","port","pathname","search","hash","host"],i=C().createElement("a");i.href=e;var n,r=""===i.host&&"file:"!==i.protocol;r&&((n=C().createElement("div")).innerHTML='<a href="'+e+'"></a>',i=n.firstChild,n.setAttribute("style","display:none; position:absolute;"),C().body.appendChild(n));for(var a={},s=0;s<t.length;s++)a[t[s]]=i[t[s]];return"http:"===a.protocol&&(a.host=a.host.replace(/:80$/,"")),"https:"===a.protocol&&(a.host=a.host.replace(/:443$/,"")),a.protocol||(a.protocol=f().location.protocol),r&&C().body.removeChild(n),a},pn=function(e){if(!e.match(/^https?:\/\//)){var t=C().createElement("div");t.innerHTML='<a href="'+e+'">x</a>',e=t.firstChild.href}return e},fn=function(e){if("string"==typeof e){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i.exec(e);if(t)return t.pop().toLowerCase()}return""},mn=function(e){var t=f().location,i=dn(e);return(":"===i.protocol?t.protocol:i.protocol)+i.host!==t.protocol+t.host},gn=Object.freeze({parseUrl:dn,getAbsoluteURL:pn,getFileExtension:fn,isCrossOrigin:mn}),yn=function(e,t){var i=new(f().WebVTT.Parser)(f(),f().vttjs,f().WebVTT.StringDecoder()),n=[];i.oncue=function(e){t.addCue(e)},i.onparsingerror=function(e){n.push(e)},i.onflush=function(){t.trigger({type:"loadeddata",target:t})},i.parse(e),n.length>0&&(f().console&&f().console.groupCollapsed&&f().console.groupCollapsed("Text Track parsing errors for "+t.src),n.forEach((function(e){return Be.error(e)})),f().console&&f().console.groupEnd&&f().console.groupEnd()),i.flush()},vn=function(e){function t(t){var i;if(void 0===t&&(t={}),!t.tech)throw new Error("A tech was not provided.");var n=ci(t,{kind:ln[t.kind]||"subtitles",language:t.language||t.srclang||""}),r=cn[n.mode]||"disabled",a=n.default;"metadata"!==n.kind&&"chapters"!==n.kind||(r="hidden"),(i=e.call(this,n)||this).tech_=n.tech,i.cues_=[],i.activeCues_=[];var s=new sn(i.cues_),o=new sn(i.activeCues_),u=!1,l=$t(De(De(i)),(function(){this.activeCues=this.activeCues,u&&(this.trigger("cuechange"),u=!1)}));return"disabled"!==r&&i.tech_.ready((function(){i.tech_.on("timeupdate",l)}),!0),Object.defineProperties(De(De(i)),{default:{get:function(){return a},set:function(){}},mode:{get:function(){return r},set:function(e){var t=this;cn[e]&&("disabled"!==(r=e)?this.tech_.ready((function(){t.tech_.on("timeupdate",l)}),!0):this.tech_.off("timeupdate",l),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?s:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return o;for(var e=this.tech_.currentTime(),t=[],i=0,n=this.cues.length;i<n;i++){var r=this.cues[i];(r.startTime<=e&&r.endTime>=e||r.startTime===r.endTime&&r.startTime<=e&&r.startTime+.5>=e)&&t.push(r)}if(u=!1,t.length!==this.activeCues_.length)u=!0;else for(var a=0;a<t.length;a++)-1===this.activeCues_.indexOf(t[a])&&(u=!0);return this.activeCues_=t,o.setCues_(this.activeCues_),o},set:function(){}}}),n.src?(i.src=n.src,function(e,t){var i={uri:e},n=mn(e);n&&(i.cors=n),c()(i,$t(this,(function(e,i,n){if(e)return Be.error(e,i);if(t.loaded_=!0,"function"!=typeof f().WebVTT){if(t.tech_){var r=function(){return yn(n,t)};t.tech_.on("vttjsloaded",r),t.tech_.on("vttjserror",(function(){Be.error("vttjs failed to load, stopping trying to process "+t.src),t.tech_.off("vttjsloaded",r)}))}}else yn(n,t)})))}(n.src,De(De(i)))):i.loaded_=!0,i}Pe(t,e);var i=t.prototype;return i.addCue=function(e){var t=e;if(f().vttjs&&!(e instanceof f().vttjs.VTTCue)){for(var i in t=new(f().vttjs.VTTCue)(e.startTime,e.endTime,e.text),e)i in t||(t[i]=e[i]);t.id=e.id,t.originalCue_=e}for(var n=this.tech_.textTracks(),r=0;r<n.length;r++)n[r]!==this&&n[r].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)},i.removeCue=function(e){for(var t=this.cues_.length;t--;){var i=this.cues_[t];if(i===e||i.originalCue_&&i.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}},t}(hn);vn.prototype.allowedEvents_={cuechange:"cuechange"};var _n=function(e){function t(t){var i;void 0===t&&(t={});var n=ci(t,{kind:un[t.kind]||""});i=e.call(this,n)||this;var r=!1;return Object.defineProperty(De(De(i)),"enabled",{get:function(){return r},set:function(e){"boolean"==typeof e&&e!==r&&(r=e,this.trigger("enabledchange"))}}),n.enabled&&(i.enabled=n.enabled),i.loaded_=!0,i}return Pe(t,e),t}(hn),bn=function(e){function t(t){var i;void 0===t&&(t={});var n=ci(t,{kind:on[t.kind]||""});i=e.call(this,n)||this;var r=!1;return Object.defineProperty(De(De(i)),"selected",{get:function(){return r},set:function(e){"boolean"==typeof e&&e!==r&&(r=e,this.trigger("selectedchange"))}}),n.selected&&(i.selected=n.selected),i}return Pe(t,e),t}(hn),Tn=function(e){function t(t){var i,n;void 0===t&&(t={}),i=e.call(this)||this;var r=new vn(t);return i.kind=r.kind,i.src=r.src,i.srclang=r.language,i.label=r.label,i.default=r.default,Object.defineProperties(De(De(i)),{readyState:{get:function(){return n}},track:{get:function(){return r}}}),n=0,r.addEventListener("loadeddata",(function(){n=2,i.trigger({type:"load",target:De(De(i))})})),i}return Pe(t,e),t}(Qt);Tn.prototype.allowedEvents_={load:"load"},Tn.NONE=0,Tn.LOADING=1,Tn.LOADED=2,Tn.ERROR=3;var Sn={audio:{ListClass:en,TrackClass:_n,capitalName:"Audio"},video:{ListClass:nn,TrackClass:bn,capitalName:"Video"},text:{ListClass:rn,TrackClass:vn,capitalName:"Text"}};Object.keys(Sn).forEach((function(e){Sn[e].getterName=e+"Tracks",Sn[e].privateName=e+"Tracks_"}));var kn={remoteText:{ListClass:rn,TrackClass:vn,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:an,TrackClass:Tn,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},wn=ci(Sn,kn);kn.names=Object.keys(kn),Sn.names=Object.keys(Sn),wn.names=[].concat(kn.names).concat(Sn.names);var Cn=function(e){function t(t,i){var n;return void 0===t&&(t={}),void 0===i&&(i=function(){}),t.reportTouchActivity=!1,(n=e.call(this,null,t,i)||this).hasStarted_=!1,n.on("playing",(function(){this.hasStarted_=!0})),n.on("loadstart",(function(){this.hasStarted_=!1})),wn.names.forEach((function(e){var i=wn[e];t&&t[i.getterName]&&(n[i.privateName]=t[i.getterName])})),n.featuresProgressEvents||n.manualProgressOn(),n.featuresTimeupdateEvents||n.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach((function(e){!1===t["native"+e+"Tracks"]&&(n["featuresNative"+e+"Tracks"]=!1)})),!1===t.nativeCaptions||!1===t.nativeTextTracks?n.featuresNativeTextTracks=!1:!0!==t.nativeCaptions&&!0!==t.nativeTextTracks||(n.featuresNativeTextTracks=!0),n.featuresNativeTextTracks||n.emulateTextTracks(),n.autoRemoteTextTracks_=new wn.text.ListClass,n.initTrackListeners(),t.nativeControlsForTouch||n.emitTapEvents(),n.constructor&&(n.name_=n.constructor.name||"Unknown Tech"),n}Pe(t,e);var i=t.prototype;return i.triggerSourceset=function(e){var t=this;this.isReady_||this.one("ready",(function(){return t.setTimeout((function(){return t.triggerSourceset(e)}),1)})),this.trigger({src:e,type:"sourceset"})},i.manualProgressOn=function(){this.on("durationchange",this.onDurationChange),this.manualProgress=!0,this.one("ready",this.trackProgress)},i.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange)},i.trackProgress=function(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval($t(this,(function(){var e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),this.bufferedPercent_=e,1===e&&this.stopTrackingProgress()})),500)},i.onDurationChange=function(e){this.duration_=this.duration()},i.buffered=function(){return Ri(0,0)},i.bufferedPercent=function(){return Mi(this.buffered(),this.duration_)},i.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},i.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime),this.on("pause",this.stopTrackingCurrentTime)},i.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime),this.off("pause",this.stopTrackingCurrentTime)},i.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval((function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}),250)},i.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},i.dispose=function(){this.clearTracks(Sn.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),e.prototype.dispose.call(this)},i.clearTracks=function(e){var t=this;(e=[].concat(e)).forEach((function(e){for(var i=t[e+"Tracks"]()||[],n=i.length;n--;){var r=i[n];"text"===e&&t.removeRemoteTextTrack(r),i.removeTrack(r)}}))},i.cleanupAutoTextTracks=function(){for(var e=this.autoRemoteTextTracks_||[],t=e.length;t--;){var i=e[t];this.removeRemoteTextTrack(i)}},i.reset=function(){},i.error=function(e){return void 0!==e&&(this.error_=new qi(e),this.trigger("error")),this.error_},i.played=function(){return this.hasStarted_?Ri(0,0):Ri()},i.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},i.initTrackListeners=function(){var e=this;Sn.names.forEach((function(t){var i=Sn[t],n=function(){e.trigger(t+"trackchange")},r=e[i.getterName]();r.addEventListener("removetrack",n),r.addEventListener("addtrack",n),e.on("dispose",(function(){r.removeEventListener("removetrack",n),r.removeEventListener("addtrack",n)}))}))},i.addWebVttScript_=function(){var e=this;if(!f().WebVTT)if(C().body.contains(this.el())){if(!this.options_["vtt.js"]&&ze(s())&&Object.keys(s()).length>0)return void this.trigger("vttjsloaded");var t=C().createElement("script");t.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",t.onload=function(){e.trigger("vttjsloaded")},t.onerror=function(){e.trigger("vttjserror")},this.on("dispose",(function(){t.onload=null,t.onerror=null})),f().WebVTT=!0,this.el().parentNode.appendChild(t)}else this.ready(this.addWebVttScript_)},i.emulateTextTracks=function(){var e=this,t=this.textTracks(),i=this.remoteTextTracks(),n=function(e){return t.addTrack(e.track)},r=function(e){return t.removeTrack(e.track)};i.on("addtrack",n),i.on("removetrack",r),this.addWebVttScript_();var a=function(){return e.trigger("texttrackchange")},s=function(){a();for(var e=0;e<t.length;e++){var i=t[e];i.removeEventListener("cuechange",a),"showing"===i.mode&&i.addEventListener("cuechange",a)}};s(),t.addEventListener("change",s),t.addEventListener("addtrack",s),t.addEventListener("removetrack",s),this.on("dispose",(function(){i.off("addtrack",n),i.off("removetrack",r),t.removeEventListener("change",s),t.removeEventListener("addtrack",s),t.removeEventListener("removetrack",s);for(var e=0;e<t.length;e++){t[e].removeEventListener("cuechange",a)}}))},i.addTextTrack=function(e,t,i){if(!e)throw new Error("TextTrack kind is required but was not provided");return function(e,t,i,n,r){void 0===r&&(r={});var a=e.textTracks();r.kind=t,i&&(r.label=i),n&&(r.language=n),r.tech=e;var s=new wn.text.TrackClass(r);return a.addTrack(s),s}(this,e,t,i)},i.createRemoteTextTrack=function(e){var t=ci(e,{tech:this});return new kn.remoteTextEl.TrackClass(t)},i.addRemoteTextTrack=function(e,t){var i=this;void 0===e&&(e={});var n=this.createRemoteTextTrack(e);return!0!==t&&!1!==t&&(Be.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),t=!0),this.remoteTextTrackEls().addTrackElement_(n),this.remoteTextTracks().addTrack(n.track),!0!==t&&this.ready((function(){return i.autoRemoteTextTracks_.addTrack(n.track)})),n},i.removeRemoteTextTrack=function(e){var t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)},i.getVideoPlaybackQuality=function(){return{}},i.setPoster=function(){},i.playsinline=function(){},i.setPlaysinline=function(){},i.overrideNativeAudioTracks=function(){},i.overrideNativeVideoTracks=function(){},i.canPlayType=function(){return""},t.canPlayType=function(){return""},t.canPlaySource=function(e,i){return t.canPlayType(e.type)},t.isTech=function(e){return e.prototype instanceof t||e instanceof t||e===t},t.registerTech=function(e,i){if(t.techs_||(t.techs_={}),!t.isTech(i))throw new Error("Tech "+e+" must be a Tech");if(!t.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!t.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=li(e),t.techs_[e]=i,"Tech"!==e&&t.defaultTechOrder_.push(e),i},t.getTech=function(e){if(e)return e=li(e),t.techs_&&t.techs_[e]?t.techs_[e]:f()&&f().videojs&&f().videojs[e]?(Be.warn("The "+e+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),f().videojs[e]):void 0},t}(hi);wn.names.forEach((function(e){var t=wn[e];Cn.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}})),Cn.prototype.featuresVolumeControl=!0,Cn.prototype.featuresMuteControl=!0,Cn.prototype.featuresFullscreenResize=!1,Cn.prototype.featuresPlaybackRate=!1,Cn.prototype.featuresProgressEvents=!1,Cn.prototype.featuresSourceset=!1,Cn.prototype.featuresTimeupdateEvents=!1,Cn.prototype.featuresNativeTextTracks=!1,Cn.withSourceHandlers=function(e){e.registerSourceHandler=function(t,i){var n=e.sourceHandlers;n||(n=e.sourceHandlers=[]),void 0===i&&(i=n.length),n.splice(i,0,t)},e.canPlayType=function(t){for(var i,n=e.sourceHandlers||[],r=0;r<n.length;r++)if(i=n[r].canPlayType(t))return i;return""},e.selectSourceHandler=function(t,i){for(var n=e.sourceHandlers||[],r=0;r<n.length;r++)if(n[r].canHandleSource(t,i))return n[r];return null},e.canPlaySource=function(t,i){var n=e.selectSourceHandler(t,i);return n?n.canHandleSource(t,i):""};["seekable","seeking","duration"].forEach((function(e){var t=this[e];"function"==typeof t&&(this[e]=function(){return this.sourceHandler_&&this.sourceHandler_[e]?this.sourceHandler_[e].apply(this.sourceHandler_,arguments):t.apply(this,arguments)})}),e.prototype),e.prototype.setSource=function(t){var i=e.selectSourceHandler(t,this.options_);i||(e.nativeSourceHandler?i=e.nativeSourceHandler:Be.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler),i!==e.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=i.handleSource(t,this,this.options_),this.on("dispose",this.disposeSourceHandler)},e.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}},hi.registerComponent("Tech",Cn),Cn.registerTech("Tech",Cn),Cn.defaultTechOrder_=[];var En={},An={},Ln={};function On(e,t,i){e.setTimeout((function(){return Rn(t,En[t.type],i,e)}),1)}function Pn(e,t,i,n){void 0===n&&(n=null);var r="call"+li(i),a=e.reduce(Dn(r),n),s=a===Ln,o=s?null:t[i](a);return function(e,t,i,n){for(var r=e.length-1;r>=0;r--){var a=e[r];a[t]&&a[t](n,i)}}(e,i,o,s),o}var xn={buffered:1,currentTime:1,duration:1,seekable:1,played:1,paused:1},Un={setCurrentTime:1},In={play:1,pause:1};function Dn(e){return function(t,i){return t===Ln?Ln:i[e]?i[e](t):t}}function Rn(e,t,i,n,r,a){void 0===e&&(e={}),void 0===t&&(t=[]),void 0===r&&(r=[]),void 0===a&&(a=!1);var s=t,o=s[0],u=s.slice(1);if("string"==typeof o)Rn(e,En[o],i,n,r,a);else if(o){var l=function(e,t){var i=An[e.id()],n=null;if(null==i)return n=t(e),An[e.id()]=[[t,n]],n;for(var r=0;r<i.length;r++){var a=i[r],s=a[0],o=a[1];s===t&&(n=o)}return null===n&&(n=t(e),i.push([t,n])),n}(n,o);if(!l.setSource)return r.push(l),Rn(e,u,i,n,r,a);l.setSource(He({},e),(function(t,s){if(t)return Rn(e,u,i,n,r,a);r.push(l),Rn(s,e.type===s.type?u:En[s.type],i,n,r,a)}))}else u.length?Rn(e,u,i,n,r,a):a?i(e,r):Rn(e,En["*"],i,n,r,!0)}var Mn={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",mp3:"audio/mpeg",aac:"audio/aac",oga:"audio/ogg",m3u8:"application/x-mpegURL"},Bn=function(e){void 0===e&&(e="");var t=fn(e);return Mn[t.toLowerCase()]||""},Nn=function e(t){if(Array.isArray(t)){var i=[];t.forEach((function(t){t=e(t),Array.isArray(t)?i=i.concat(t):qe(t)&&i.push(t)})),t=i}else t="string"==typeof t&&t.trim()?[jn({src:t})]:qe(t)&&"string"==typeof t.src&&t.src&&t.src.trim()?[jn(t)]:[];return t};function jn(e){var t=Bn(e.src);return!e.type&&t&&(e.type=t),e}var Fn=function(e){function t(t,i,n){var r,a=ci({createEl:!1},i);if(r=e.call(this,t,a,n)||this,i.playerOptions.sources&&0!==i.playerOptions.sources.length)t.src(i.playerOptions.sources);else for(var s=0,o=i.playerOptions.techOrder;s<o.length;s++){var u=li(o[s]),l=Cn.getTech(u);if(u||(l=hi.getComponent(u)),l&&l.isSupported()){t.loadTech_(u);break}}return r}return Pe(t,e),t}(hi);hi.registerComponent("MediaLoader",Fn);var Vn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).emitTapEvents(),n.enable(),n}Pe(t,e);var i=t.prototype;return i.createEl=function(t,i,n){void 0===t&&(t="div"),void 0===i&&(i={}),void 0===n&&(n={}),i=He({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass(),tabIndex:0},i),"button"===t&&Be.error("Creating a ClickableComponent with an HTML element of "+t+" is not supported; use a Button instead."),n=He({role:"button"},n),this.tabIndex_=i.tabIndex;var r=e.prototype.createEl.call(this,t,i,n);return this.createControlTextEl(r),r},i.dispose=function(){this.controlTextEl_=null,e.prototype.dispose.call(this)},i.createControlTextEl=function(e){return this.controlTextEl_=Ze("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_},i.controlText=function(e,t){if(void 0===t&&(t=this.el()),void 0===e)return this.controlText_||"Need Text";var i=this.localize(e);this.controlText_=e,et(this.controlTextEl_,i),this.nonIconControl||t.setAttribute("title",i)},i.buildCSSClass=function(){return"vjs-control vjs-button "+e.prototype.buildCSSClass.call(this)},i.enable=function(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),void 0!==this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick),this.on("focus",this.handleFocus),this.on("blur",this.handleBlur))},i.disable=function(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),void 0!==this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off(["tap","click"],this.handleClick),this.off("focus",this.handleFocus),this.off("blur",this.handleBlur)},i.handleClick=function(e){},i.handleFocus=function(e){Bt(C(),"keydown",$t(this,this.handleKeyPress))},i.handleKeyPress=function(t){32===t.which||13===t.which?(t.preventDefault(),this.trigger("click")):e.prototype.handleKeyPress&&e.prototype.handleKeyPress.call(this,t)},i.handleBlur=function(e){Nt(C(),"keydown",$t(this,this.handleKeyPress))},t}(hi);hi.registerComponent("ClickableComponent",Vn);var Hn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update(),t.on("posterchange",$t(De(De(n)),n.update)),n}Pe(t,e);var i=t.prototype;return i.dispose=function(){this.player().off("posterchange",this.update),e.prototype.dispose.call(this)},i.createEl=function(){return Ze("div",{className:"vjs-poster",tabIndex:-1})},i.update=function(e){var t=this.player().poster();this.setSrc(t),t?this.show():this.hide()},i.setSrc=function(e){var t="";e&&(t='url("'+e+'")'),this.el_.style.backgroundImage=t},i.handleClick=function(e){this.player_.controls()&&(this.player_.paused()?Gi(this.player_.play()):this.player_.pause())},t}(Vn);hi.registerComponent("PosterImage",Hn);var qn={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'};function zn(e,t){var i;if(4===e.length)i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");i=e.slice(1)}return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")"}function Wn(e,t,i){try{e.style[t]=i}catch(e){return}}var Gn=function(e){function t(t,i,n){var r;r=e.call(this,t,i,n)||this;var a=$t(De(De(r)),r.updateDisplay);return t.on("loadstart",$t(De(De(r)),r.toggleDisplay)),t.on("texttrackchange",a),t.on("loadedmetadata",$t(De(De(r)),r.preselectTrack)),t.ready($t(De(De(r)),(function(){if(t.tech_&&t.tech_.featuresNativeTextTracks)this.hide();else{t.on("fullscreenchange",a),t.on("playerresize",a),f().addEventListener("orientationchange",a),t.on("dispose",(function(){return f().removeEventListener("orientationchange",a)}));for(var e=this.options_.playerOptions.tracks||[],i=0;i<e.length;i++)this.player_.addRemoteTextTrack(e[i],!0);this.preselectTrack()}}))),r}Pe(t,e);var i=t.prototype;return i.preselectTrack=function(){for(var e,t,i,n={captions:1,subtitles:1},r=this.player_.textTracks(),a=this.player_.cache_.selectedLanguage,s=0;s<r.length;s++){var o=r[s];a&&a.enabled&&a.language&&a.language===o.language&&o.kind in n?o.kind===a.kind?i=o:i||(i=o):a&&!a.enabled?(i=null,e=null,t=null):o.default&&("descriptions"!==o.kind||e?o.kind in n&&!t&&(t=o):e=o)}i?i.mode="showing":t?t.mode="showing":e&&(e.mode="showing")},i.toggleDisplay=function(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()},i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-text-track-display"},{"aria-live":"off","aria-atomic":"true"})},i.clearDisplay=function(){"function"==typeof f().WebVTT&&f().WebVTT.processCues(f(),[],this.el_)},i.updateDisplay=function(){var e=this.player_.textTracks();this.clearDisplay();for(var t=null,i=null,n=e.length;n--;){var r=e[n];"showing"===r.mode&&("descriptions"===r.kind?t=r:i=r)}i?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(i)):t&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(t))},i.updateForTrack=function(e){if("function"==typeof f().WebVTT&&e.activeCues){for(var t=[],i=0;i<e.activeCues.length;i++)t.push(e.activeCues[i]);if(f().WebVTT.processCues(f(),t,this.el_),this.player_.textTrackSettings)for(var n=this.player_.textTrackSettings.getValues(),r=t.length;r--;){var a=t[r];if(a){var s=a.displayState;if(n.color&&(s.firstChild.style.color=n.color),n.textOpacity&&Wn(s.firstChild,"color",zn(n.color||"#fff",n.textOpacity)),n.backgroundColor&&(s.firstChild.style.backgroundColor=n.backgroundColor),n.backgroundOpacity&&Wn(s.firstChild,"backgroundColor",zn(n.backgroundColor||"#000",n.backgroundOpacity)),n.windowColor&&(n.windowOpacity?Wn(s,"backgroundColor",zn(n.windowColor,n.windowOpacity)):s.style.backgroundColor=n.windowColor),n.edgeStyle&&("dropshadow"===n.edgeStyle?s.firstChild.style.textShadow="2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px #222":"raised"===n.edgeStyle?s.firstChild.style.textShadow="1px 1px #222, 2px 2px #222, 3px 3px #222":"depressed"===n.edgeStyle?s.firstChild.style.textShadow="1px 1px #ccc, 0 1px #ccc, -1px -1px #222, 0 -1px #222":"uniform"===n.edgeStyle&&(s.firstChild.style.textShadow="0 0 4px #222, 0 0 4px #222, 0 0 4px #222, 0 0 4px #222")),n.fontPercent&&1!==n.fontPercent){var o=f().parseFloat(s.style.fontSize);s.style.fontSize=o*n.fontPercent+"px",s.style.height="auto",s.style.top="auto",s.style.bottom="2px"}n.fontFamily&&"default"!==n.fontFamily&&("small-caps"===n.fontFamily?s.firstChild.style.fontVariant="small-caps":s.firstChild.style.fontFamily=qn[n.fontFamily])}}}},t}(hi);hi.registerComponent("TextTrackDisplay",Gn);var Xn=function(e){function t(){return e.apply(this,arguments)||this}return Pe(t,e),t.prototype.createEl=function(){var t=this.player_.isAudio(),i=this.localize(t?"Audio Player":"Video Player"),n=Ze("span",{className:"vjs-control-text",innerHTML:this.localize("{1} is loading.",[i])}),r=e.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",dir:"ltr"});return r.appendChild(n),r},t}(hi);hi.registerComponent("LoadingSpinner",Xn);var Yn=function(e){function t(){return e.apply(this,arguments)||this}Pe(t,e);var i=t.prototype;return i.createEl=function(e,t,i){void 0===t&&(t={}),void 0===i&&(i={}),t=He({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass()},t),i=He({type:"button"},i);var n=hi.prototype.createEl.call(this,"button",t,i);return this.createControlTextEl(n),n},i.addChild=function(e,t){void 0===t&&(t={});var i=this.constructor.name;return Be.warn("Adding an actionable (user controllable) child to a Button ("+i+") is not supported; use a ClickableComponent instead."),hi.prototype.addChild.call(this,e,t)},i.enable=function(){e.prototype.enable.call(this),this.el_.removeAttribute("disabled")},i.disable=function(){e.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},i.handleKeyPress=function(t){32!==t.which&&13!==t.which&&e.prototype.handleKeyPress.call(this,t)},t}(Vn);hi.registerComponent("Button",Yn);var $n=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).mouseused_=!1,n.on("mousedown",n.handleMouseDown),n}Pe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-big-play-button"},i.handleClick=function(e){var t=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY)Gi(t);else{var i=this.player_.getChild("controlBar"),n=i&&i.getChild("playToggle");if(n){var r=function(){return n.focus()};Wi(t)?t.then(r,(function(){})):this.setTimeout(r,1)}else this.player_.focus()}},i.handleKeyPress=function(t){this.mouseused_=!1,e.prototype.handleKeyPress.call(this,t)},i.handleMouseDown=function(e){this.mouseused_=!0},t}(Yn);$n.prototype.controlText_="Play Video",hi.registerComponent("BigPlayButton",$n);var Kn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).controlText(i&&i.controlText||n.localize("Close")),n}Pe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-close-button "+e.prototype.buildCSSClass.call(this)},i.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},t}(Yn);hi.registerComponent("CloseButton",Kn);var Qn=function(e){function t(t,i){var n;return void 0===i&&(i={}),n=e.call(this,t,i)||this,i.replay=void 0===i.replay||i.replay,n.on(t,"play",n.handlePlay),n.on(t,"pause",n.handlePause),i.replay&&n.on(t,"ended",n.handleEnded),n}Pe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-play-control "+e.prototype.buildCSSClass.call(this)},i.handleClick=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},i.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},i.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},i.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},i.handleEnded=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",this.handleSeeked)},t}(Yn);Qn.prototype.controlText_="Play",hi.registerComponent("PlayToggle",Qn);var Jn=function(e,t){e=e<0?0:e;var i=Math.floor(e%60),n=Math.floor(e/60%60),r=Math.floor(e/3600),a=Math.floor(t/60%60),s=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(r=n=i="-"),(r=r>0||s>0?r+":":"")+(n=((r||a>=10)&&n<10?"0"+n:n)+":")+(i=i<10?"0"+i:i)},Zn=Jn;function er(e,t){return void 0===t&&(t=e),Zn(e,t)}var tr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).throttledUpdateContent=Kt($t(De(De(n)),n.updateContent),25),n.on(t,"timeupdate",n.throttledUpdateContent),n}Pe(t,e);var i=t.prototype;return i.createEl=function(t){var i=this.buildCSSClass(),n=e.prototype.createEl.call(this,"div",{className:i+" vjs-time-control vjs-control",innerHTML:'<span class="vjs-control-text" role="presentation">'+this.localize(this.labelText_)+" </span>"});return this.contentEl_=Ze("span",{className:i+"-display"},{"aria-live":"off",role:"presentation"}),this.updateTextNode_(),n.appendChild(this.contentEl_),n},i.dispose=function(){this.contentEl_=null,this.textNode_=null,e.prototype.dispose.call(this)},i.updateTextNode_=function(){if(this.contentEl_){for(;this.contentEl_.firstChild;)this.contentEl_.removeChild(this.contentEl_.firstChild);this.textNode_=C().createTextNode(this.formattedTime_||this.formatTime_(0)),this.contentEl_.appendChild(this.textNode_)}},i.formatTime_=function(e){return er(e)},i.updateFormattedTime_=function(e){var t=this.formatTime_(e);t!==this.formattedTime_&&(this.formattedTime_=t,this.requestAnimationFrame(this.updateTextNode_))},i.updateContent=function(e){},t}(hi);tr.prototype.labelText_="Time",tr.prototype.controlText_="Time",hi.registerComponent("TimeDisplay",tr);var ir=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"ended",n.handleEnded),n}Pe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-current-time"},i.updateContent=function(e){var t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();this.updateFormattedTime_(t)},i.handleEnded=function(e){this.player_.duration()&&this.updateFormattedTime_(this.player_.duration())},t}(tr);ir.prototype.labelText_="Current Time",ir.prototype.controlText_="Current Time",hi.registerComponent("CurrentTimeDisplay",ir);var nr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"durationchange",n.updateContent),n.on(t,"loadstart",n.updateContent),n.on(t,"loadedmetadata",n.throttledUpdateContent),n}Pe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-duration"},i.updateContent=function(e){var t=this.player_.duration();this.duration_!==t&&(this.duration_=t,this.updateFormattedTime_(t))},t}(tr);nr.prototype.labelText_="Duration",nr.prototype.controlText_="Duration",hi.registerComponent("DurationDisplay",nr);var rr=function(e){function t(){return e.apply(this,arguments)||this}return Pe(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider",innerHTML:"<div><span>/</span></div>"},{"aria-hidden":!0})},t}(hi);hi.registerComponent("TimeDivider",rr);var ar=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"durationchange",n.throttledUpdateContent),n.on(t,"ended",n.handleEnded),n}Pe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-remaining-time"},i.formatTime_=function(t){return"-"+e.prototype.formatTime_.call(this,t)},i.updateContent=function(e){this.player_.duration()&&(this.player_.remainingTimeDisplay?this.updateFormattedTime_(this.player_.remainingTimeDisplay()):this.updateFormattedTime_(this.player_.remainingTime()))},i.handleEnded=function(e){this.player_.duration()&&this.updateFormattedTime_(0)},t}(tr);ar.prototype.labelText_="Remaining Time",ar.prototype.controlText_="Remaining Time",hi.registerComponent("RemainingTimeDisplay",ar);var sr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).updateShowing(),n.on(n.player(),"durationchange",n.updateShowing),n}Pe(t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=Ze("div",{className:"vjs-live-display",innerHTML:'<span class="vjs-control-text">'+this.localize("Stream Type")+" </span>"+this.localize("LIVE")},{"aria-live":"off"}),t.appendChild(this.contentEl_),t},i.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},i.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},t}(hi);hi.registerComponent("LiveDisplay",sr);var or=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).updateLiveEdgeStatus(),n.player_.liveTracker&&n.on(n.player_.liveTracker,"liveedgechange",n.updateLiveEdgeStatus),n}Pe(t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=Ze("span",{className:"vjs-seek-to-live-text",innerHTML:this.localize("LIVE")},{"aria-hidden":"true"}),t.appendChild(this.textEl_),t},i.updateLiveEdgeStatus=function(e){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))},i.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},i.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatus),this.textEl_=null,e.prototype.dispose.call(this)},t}(Yn);or.prototype.controlText_="Seek to live, currently playing live",hi.registerComponent("SeekToLive",or);var ur=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).bar=n.getChild(n.options_.barName),n.vertical(!!n.options_.vertical),n.enable(),n}Pe(t,e);var i=t.prototype;return i.enabled=function(){return this.enabled_},i.enable=function(){this.enabled()||(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(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)},i.disable=function(){if(this.enabled()){var e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown),this.off("touchstart",this.handleMouseDown),this.off("focus",this.handleFocus),this.off("blur",this.handleBlur),this.off("click",this.handleClick),this.off(this.player_,"controlsvisible",this.update),this.off(e,"mousemove",this.handleMouseMove),this.off(e,"mouseup",this.handleMouseUp),this.off(e,"touchmove",this.handleMouseMove),this.off(e,"touchend",this.handleMouseUp),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},i.createEl=function(t,i,n){return void 0===i&&(i={}),void 0===n&&(n={}),i.className=i.className+" vjs-slider",i=He({tabIndex:0},i),n=He({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},n),e.prototype.createEl.call(this,t,i,n)},i.handleMouseDown=function(e){var t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||Ei||e.preventDefault(),ht(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove),this.on(t,"mouseup",this.handleMouseUp),this.on(t,"touchmove",this.handleMouseMove),this.on(t,"touchend",this.handleMouseUp),this.handleMouseMove(e)},i.handleMouseMove=function(e){},i.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;dt(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(e,"mousemove",this.handleMouseMove),this.off(e,"mouseup",this.handleMouseUp),this.off(e,"touchmove",this.handleMouseMove),this.off(e,"touchend",this.handleMouseUp),this.update()},i.update=function(){if(this.el_){var e=this.getPercent(),t=this.bar;if(t){("number"!=typeof e||e!=e||e<0||e===1/0)&&(e=0);var i=(100*e).toFixed(2)+"%",n=t.el().style;return this.vertical()?n.height=i:n.width=i,e}}},i.calculateDistance=function(e){var t=mt(this.el_,e);return this.vertical()?t.y:t.x},i.handleFocus=function(){this.on(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},i.handleKeyPress=function(e){37===e.which||40===e.which?(e.preventDefault(),this.stepBack()):38!==e.which&&39!==e.which||(e.preventDefault(),this.stepForward())},i.handleBlur=function(){this.off(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},i.handleClick=function(e){e.stopImmediatePropagation(),e.preventDefault()},i.vertical=function(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},t}(hi);hi.registerComponent("Slider",ur);var lr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).partEls_=[],n.on(t,"progress",n.update),n}Pe(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-load-progress",innerHTML:'<span class="vjs-control-text"><span>'+this.localize("Loaded")+'</span>: <span class="vjs-control-text-loaded-percentage">0%</span></span>'})},i.dispose=function(){this.partEls_=null,e.prototype.dispose.call(this)},i.update=function(e){var t=this.player_.liveTracker,i=this.player_.buffered(),n=t&&t.isLive()?t.seekableEnd():this.player_.duration(),r=this.player_.bufferedEnd(),a=this.partEls_,s=this.$(".vjs-control-text-loaded-percentage"),o=function(e,t,i){var n=e/t||0;return n=100*(n>=1?1:n),i&&(n=n.toFixed(2)),n+"%"};this.el_.style.width=o(r,n),et(s,o(r,n,!0));for(var u=0;u<i.length;u++){var l=i.start(u),c=i.end(u),h=a[u];h||(h=this.el_.appendChild(Ze()),a[u]=h),h.style.left=o(l,r),h.style.width=o(c-l,r)}for(var d=a.length;d>i.length;d--)this.el_.removeChild(a[d-1]);a.length=i.length},t}(hi);hi.registerComponent("LoadProgressBar",lr);var cr=function(e){function t(){return e.apply(this,arguments)||this}Pe(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},i.update=function(e,t,i){var n=pt(this.el_),r=pt(this.player_.el()),a=e.width*t;if(r&&n){var s=e.left-r.left+a,o=e.width-a+(r.right-e.right),u=n.width/2;s<u?u+=u-s:o<u&&(u=o),u<0?u=0:u>n.width&&(u=n.width),this.el_.style.right="-"+u+"px",et(this.el_,i)}},i.updateTime=function(e,t,i,n){var r=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame((function(){var a,s=r.player_.duration();if(r.player_.liveTracker&&r.player_.liveTracker.isLive()){var o=r.player_.liveTracker.liveWindow(),u=o-t*o;a=(u<1?"":"-")+er(u,o)}else a=er(i,s);r.update(e,t,a),n&&n()}))},t}(hi);hi.registerComponent("TimeTooltip",cr);var hr=function(e){function t(){return e.apply(this,arguments)||this}Pe(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},i.update=function(e,t){var i=this.getChild("timeTooltip");if(i){var n=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();i.updateTime(e,t,n)}},t}(hi);hr.prototype.options_={children:[]},_i||Ti||hr.prototype.options_.children.push("timeTooltip"),hi.registerComponent("PlayProgressBar",hr);var dr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=Kt($t(De(De(n)),n.update),25),n}Pe(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},i.update=function(e,t){var i=this,n=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,n,(function(){i.el_.style.left=e.width*t+"px"}))},t}(hi);dr.prototype.options_={children:["timeTooltip"]},hi.registerComponent("MouseTimeDisplay",dr);var pr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).setEventHandlers_(),n}Pe(t,e);var i=t.prototype;return i.setEventHandlers_=function(){var e=this;this.update=Kt($t(this,this.update),30),this.on(this.player_,"timeupdate",this.update),this.on(this.player_,"ended",this.handleEnded),this.on(this.player_,"durationchange",this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.on(this.player_,["playing"],(function(){e.clearInterval(e.updateInterval),e.updateInterval=e.setInterval((function(){e.requestAnimationFrame((function(){e.update()}))}),30)})),this.on(this.player_,["ended","pause","waiting"],(function(t){e.player_.liveTracker&&e.player_.liveTracker.isLive()&&"ended"!==t.type||e.clearInterval(e.updateInterval)})),this.on(this.player_,["timeupdate","ended"],this.update)},i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},i.update_=function(e,t){var i=this.player_.liveTracker,n=this.player_.duration();i&&i.isLive()&&(n=this.player_.liveTracker.liveCurrentTime()),i&&i.seekableEnd()===1/0?this.disable():this.enable(),this.el_.setAttribute("aria-valuenow",(100*t).toFixed(2)),this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[er(e,n),er(n,n)],"{1} of {2}")),this.bar.update(pt(this.el_),t)},i.update=function(t){var i=e.prototype.update.call(this);return this.update_(this.getCurrentTime_(),i),i},i.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},i.handleEnded=function(e){this.update_(this.player_.duration(),1)},i.getPercent=function(){var e,t=this.getCurrentTime_(),i=this.player_.liveTracker;return i&&i.isLive()?(e=(t-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(e=1)):e=t/this.player_.duration(),e>=1?1:e||0},i.handleMouseDown=function(t){Tt(t)&&(t.stopPropagation(),this.player_.scrubbing(!0),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),e.prototype.handleMouseDown.call(this,t))},i.handleMouseMove=function(e){if(Tt(e)){var t,i=this.calculateDistance(e),n=this.player_.liveTracker;if(n&&n.isLive()){var r=n.seekableStart(),a=n.liveCurrentTime();if((t=r+i*n.liveWindow())>=a&&(t=a),t<=r&&(t=r+.1),t===1/0)return}else(t=i*this.player_.duration())===this.player_.duration()&&(t-=.1);this.player_.currentTime(t)}},i.enable=function(){e.prototype.enable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.show()},i.disable=function(){e.prototype.disable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.hide()},i.handleMouseUp=function(t){e.prototype.handleMouseUp.call(this,t),t&&t.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying&&Gi(this.player_.play())},i.stepForward=function(){this.player_.currentTime(this.player_.currentTime()+5)},i.stepBack=function(){this.player_.currentTime(this.player_.currentTime()-5)},i.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},i.handleKeyPress=function(t){32===t.which||13===t.which?(t.preventDefault(),this.handleAction(t)):e.prototype.handleKeyPress&&e.prototype.handleKeyPress.call(this,t)},t}(ur);pr.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},_i||Ti||pr.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),pr.prototype.playerEvent="timeupdate",hi.registerComponent("SeekBar",pr);var fr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).handleMouseMove=Kt($t(De(De(n)),n.handleMouseMove),25),n.throttledHandleMouseSeek=Kt($t(De(De(n)),n.handleMouseSeek),25),n.enable(),n}Pe(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},i.handleMouseMove=function(e){var t=this.getChild("seekBar");if(t){var i=t.getChild("mouseTimeDisplay"),n=t.el(),r=pt(n),a=mt(n,e).x;a>1?a=1:a<0&&(a=0),i&&i.update(r,a)}},i.handleMouseSeek=function(e){var t=this.getChild("seekBar");t&&t.handleMouseMove(e)},i.enabled=function(){return this.enabled_},i.disable=function(){this.children().forEach((function(e){return e.disable&&e.disable()})),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDown),this.off(this.el_,"mousemove",this.handleMouseMove),this.handleMouseUp(),this.addClass("disabled"),this.enabled_=!1)},i.enable=function(){this.children().forEach((function(e){return e.enable&&e.enable()})),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDown),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},i.handleMouseDown=function(e){var t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUp),this.on(t,"touchend",this.handleMouseUp)},i.handleMouseUp=function(e){var t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseUp(e),this.off(t,"mousemove",this.throttledHandleMouseSeek),this.off(t,"touchmove",this.throttledHandleMouseSeek),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchend",this.handleMouseUp)},t}(hi);fr.prototype.options_={children:["seekBar"]},hi.registerComponent("ProgressControl",fr);var mr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"fullscreenchange",n.handleFullscreenChange),!1===C()[Ni.fullscreenEnabled]&&n.disable(),n}Pe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-fullscreen-control "+e.prototype.buildCSSClass.call(this)},i.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},i.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},t}(Yn);mr.prototype.controlText_="Fullscreen",hi.registerComponent("FullscreenToggle",mr);var gr=function(e){function t(){return e.apply(this,arguments)||this}return Pe(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:'<span class="vjs-control-text"></span>'})},t}(hi);hi.registerComponent("VolumeLevel",gr);var yr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on("slideractive",n.updateLastVolume_),n.on(t,"volumechange",n.updateARIAAttributes),t.ready((function(){return n.updateARIAAttributes()})),n}Pe(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},i.handleMouseDown=function(t){Tt(t)&&e.prototype.handleMouseDown.call(this,t)},i.handleMouseMove=function(e){Tt(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},i.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},i.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},i.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},i.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},i.updateARIAAttributes=function(e){var t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")},i.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},i.updateLastVolume_=function(){var e=this,t=this.player_.volume();this.one("sliderinactive",(function(){0===e.player_.volume()&&e.player_.lastVolume_(t)}))},t}(ur);yr.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},yr.prototype.playerEvent="volumechange",hi.registerComponent("VolumeBar",yr);var vr=function(e){function t(t,i){var n;return void 0===i&&(i={}),i.vertical=i.vertical||!1,(void 0===i.volumeBar||ze(i.volumeBar))&&(i.volumeBar=i.volumeBar||{},i.volumeBar.vertical=i.vertical),function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))}(De(De(n=e.call(this,t,i)||this)),t),n.throttledHandleMouseMove=Kt($t(De(De(n)),n.handleMouseMove),25),n.on("mousedown",n.handleMouseDown),n.on("touchstart",n.handleMouseDown),n.on(n.volumeBar,["focus","slideractive"],(function(){n.volumeBar.addClass("vjs-slider-active"),n.addClass("vjs-slider-active"),n.trigger("slideractive")})),n.on(n.volumeBar,["blur","sliderinactive"],(function(){n.volumeBar.removeClass("vjs-slider-active"),n.removeClass("vjs-slider-active"),n.trigger("sliderinactive")})),n}Pe(t,e);var i=t.prototype;return i.createEl=function(){var t="vjs-volume-horizontal";return this.options_.vertical&&(t="vjs-volume-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+t})},i.handleMouseDown=function(e){var t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUp),this.on(t,"touchend",this.handleMouseUp)},i.handleMouseUp=function(e){var t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchend",this.handleMouseUp)},i.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},t}(hi);vr.prototype.options_={children:["volumeBar"]},hi.registerComponent("VolumeControl",vr);var _r=function(e){function t(t,i){var n;return function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))}(De(De(n=e.call(this,t,i)||this)),t),n.on(t,["loadstart","volumechange"],n.update),n}Pe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-mute-control "+e.prototype.buildCSSClass.call(this)},i.handleClick=function(e){var t=this.player_.volume(),i=this.player_.lastVolume_();if(0===t){var n=i<.1?.1:i;this.player_.volume(n),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},i.update=function(e){this.updateIcon_(),this.updateControlText_()},i.updateIcon_=function(){var e=this.player_.volume(),t=3;_i&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2);for(var i=0;i<4;i++)rt(this.el_,"vjs-vol-"+i);nt(this.el_,"vjs-vol-"+t)},i.updateControlText_=function(){var e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)},t}(Yn);_r.prototype.controlText_="Mute",hi.registerComponent("MuteToggle",_r);var br=function(e){function t(t,i){var n;return void 0===i&&(i={}),void 0!==i.inline?i.inline=i.inline:i.inline=!0,(void 0===i.volumeControl||ze(i.volumeControl))&&(i.volumeControl=i.volumeControl||{},i.volumeControl.vertical=!i.inline),(n=e.call(this,t,i)||this).on(t,["loadstart"],n.volumePanelState_),n.on(n.volumeControl,["slideractive"],n.sliderActive_),n.on(n.volumeControl,["sliderinactive"],n.sliderInactive_),n}Pe(t,e);var i=t.prototype;return i.sliderActive_=function(){this.addClass("vjs-slider-active")},i.sliderInactive_=function(){this.removeClass("vjs-slider-active")},i.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")},i.createEl=function(){var t="vjs-volume-panel-horizontal";return this.options_.inline||(t="vjs-volume-panel-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+t})},t}(hi);br.prototype.options_={children:["muteToggle","volumeControl"]},hi.registerComponent("VolumePanel",br);var Tr=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,i&&(n.menuButton_=i.menuButton),n.focusedChild_=-1,n.on("keydown",n.handleKeyPress),n}Pe(t,e);var i=t.prototype;return i.addItem=function(e){this.addChild(e),e.on("blur",$t(this,this.handleBlur)),e.on(["tap","click"],$t(this,(function(t){this.menuButton_&&(this.menuButton_.unpressButton(),"CaptionSettingsMenuItem"!==e.name()&&this.menuButton_.focus())})))},i.createEl=function(){var t=this.options_.contentElType||"ul";this.contentEl_=Ze(t,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var i=e.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return i.appendChild(this.contentEl_),Bt(i,"click",(function(e){e.preventDefault(),e.stopImmediatePropagation()})),i},i.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},i.handleBlur=function(e){var t=e.relatedTarget||C().activeElement;if(!this.children().some((function(e){return e.el()===t}))){var i=this.menuButton_;i&&i.buttonPressed_&&t!==i.el().firstChild&&i.unpressButton()}},i.handleKeyPress=function(e){37===e.which||40===e.which?(e.preventDefault(),this.stepForward()):38!==e.which&&39!==e.which||(e.preventDefault(),this.stepBack())},i.stepForward=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)},i.stepBack=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)},i.focus=function(e){void 0===e&&(e=0);var t=this.children().slice();t.length&&t[0].className&&/vjs-menu-title/.test(t[0].className)&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())},t}(hi);hi.registerComponent("Menu",Tr);var Sr=function(e){function t(t,i){var n;void 0===i&&(i={}),(n=e.call(this,t,i)||this).menuButton_=new Yn(t,i),n.menuButton_.controlText(n.controlText_),n.menuButton_.el_.setAttribute("aria-haspopup","true");var r=Yn.prototype.buildCSSClass();return n.menuButton_.el_.className=n.buildCSSClass()+" "+r,n.menuButton_.removeClass("vjs-control"),n.addChild(n.menuButton_),n.update(),n.enabled_=!0,n.on(n.menuButton_,"tap",n.handleClick),n.on(n.menuButton_,"click",n.handleClick),n.on(n.menuButton_,"focus",n.handleFocus),n.on(n.menuButton_,"blur",n.handleBlur),n.on(n.menuButton_,"mouseenter",(function(){n.menu.show()})),n.on("keydown",n.handleSubmenuKeyPress),n}Pe(t,e);var i=t.prototype;return i.update=function(){var e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?this.hide():this.show()},i.createMenu=function(){var e=new Tr(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var t=Ze("li",{className:"vjs-menu-title",innerHTML:li(this.options_.title),tabIndex:-1});this.hideThreshold_+=1,e.children_.unshift(t),tt(t,e.contentEl())}if(this.items=this.createItems(),this.items)for(var i=0;i<this.items.length;i++)e.addItem(this.items[i]);return e},i.createItems=function(){},i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildWrapperCSSClass()},{})},i.buildWrapperCSSClass=function(){var t="vjs-menu-button";return!0===this.options_.inline?t+="-inline":t+="-popup","vjs-menu-button "+t+" "+Yn.prototype.buildCSSClass()+" "+e.prototype.buildCSSClass.call(this)},i.buildCSSClass=function(){var t="vjs-menu-button";return!0===this.options_.inline?t+="-inline":t+="-popup","vjs-menu-button "+t+" "+e.prototype.buildCSSClass.call(this)},i.controlText=function(e,t){return void 0===t&&(t=this.menuButton_.el()),this.menuButton_.controlText(e,t)},i.handleClick=function(e){this.buttonPressed_?this.unpressButton():this.pressButton()},i.focus=function(){this.menuButton_.focus()},i.blur=function(){this.menuButton_.blur()},i.handleFocus=function(){Bt(C(),"keydown",$t(this,this.handleKeyPress))},i.handleBlur=function(){Nt(C(),"keydown",$t(this,this.handleKeyPress))},i.handleKeyPress=function(e){27===e.which||9===e.which?(this.buttonPressed_&&this.unpressButton(),9!==e.which&&(e.preventDefault(),this.menuButton_.el_.focus())):13!==e.which&&38!==e.which&&40!==e.which||this.buttonPressed_||(this.pressButton(),e.preventDefault())},i.handleSubmenuKeyPress=function(e){27!==e.which&&9!==e.which||(this.buttonPressed_&&this.unpressButton(),9!==e.which&&(e.preventDefault(),this.menuButton_.el_.focus()))},i.pressButton=function(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),_i&&Qe())return;this.menu.focus()}},i.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},i.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},i.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},t}(hi);hi.registerComponent("MenuButton",Sr);var kr=function(e){function t(t,i){var n,r=i.tracks;if((n=e.call(this,t,i)||this).items.length<=1&&n.hide(),!r)return De(n);var a=$t(De(De(n)),n.update);return r.addEventListener("removetrack",a),r.addEventListener("addtrack",a),n.player_.on("ready",a),n.player_.on("dispose",(function(){r.removeEventListener("removetrack",a),r.removeEventListener("addtrack",a)})),n}return Pe(t,e),t}(Sr);hi.registerComponent("TrackButton",kr);var wr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).selectable=i.selectable,n.isSelected_=i.selected||!1,n.multiSelectable=i.multiSelectable,n.selected(n.isSelected_),n.selectable?n.multiSelectable?n.el_.setAttribute("role","menuitemcheckbox"):n.el_.setAttribute("role","menuitemradio"):n.el_.setAttribute("role","menuitem"),n}Pe(t,e);var i=t.prototype;return i.createEl=function(t,i,n){return this.nonIconControl=!0,e.prototype.createEl.call(this,"li",He({className:"vjs-menu-item",innerHTML:'<span class="vjs-menu-item-text">'+this.localize(this.options_.label)+"</span>",tabIndex:-1},i),n)},i.handleClick=function(e){this.selected(!0)},i.selected=function(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))},t}(Vn);hi.registerComponent("MenuItem",wr);var Cr=function(e){function t(t,i){var n,r=i.track,a=t.textTracks();i.label=r.label||r.language||"Unknown",i.selected="showing"===r.mode,(n=e.call(this,t,i)||this).track=r;var s,o=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];n.handleTracksChange.apply(De(De(n)),t)},u=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];n.handleSelectedLanguageChange.apply(De(De(n)),t)};(t.on(["loadstart","texttrackchange"],o),a.addEventListener("change",o),a.addEventListener("selectedlanguagechange",u),n.on("dispose",(function(){t.off(["loadstart","texttrackchange"],o),a.removeEventListener("change",o),a.removeEventListener("selectedlanguagechange",u)})),void 0===a.onchange)&&n.on(["tap","click"],(function(){if("object"!=typeof f().Event)try{s=new(f().Event)("change")}catch(e){}s||(s=C().createEvent("Event")).initEvent("change",!0,!0),a.dispatchEvent(s)}));return n.handleTracksChange(),n}Pe(t,e);var i=t.prototype;return i.handleClick=function(t){var i=this.track.kind,n=this.track.kinds,r=this.player_.textTracks();if(n||(n=[i]),e.prototype.handleClick.call(this,t),r)for(var a=0;a<r.length;a++){var s=r[a];s===this.track&&n.indexOf(s.kind)>-1?"showing"!==s.mode&&(s.mode="showing"):"disabled"!==s.mode&&(s.mode="disabled")}},i.handleTracksChange=function(e){var t="showing"===this.track.mode;t!==this.isSelected_&&this.selected(t)},i.handleSelectedLanguageChange=function(e){if("showing"===this.track.mode){var t=this.player_.cache_.selectedLanguage;if(t&&t.enabled&&t.language===this.track.language&&t.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}},i.dispose=function(){this.track=null,e.prototype.dispose.call(this)},t}(wr);hi.registerComponent("TextTrackMenuItem",Cr);var Er=function(e){function t(t,i){return i.track={player:t,kind:i.kind,kinds:i.kinds,default:!1,mode:"disabled"},i.kinds||(i.kinds=[i.kind]),i.label?i.track.label=i.label:i.track.label=i.kinds.join(" and ")+" off",i.selectable=!0,i.multiSelectable=!1,e.call(this,t,i)||this}Pe(t,e);var i=t.prototype;return i.handleTracksChange=function(e){for(var t=this.player().textTracks(),i=!0,n=0,r=t.length;n<r;n++){var a=t[n];if(this.options_.kinds.indexOf(a.kind)>-1&&"showing"===a.mode){i=!1;break}}i!==this.isSelected_&&this.selected(i)},i.handleSelectedLanguageChange=function(e){for(var t=this.player().textTracks(),i=!0,n=0,r=t.length;n<r;n++){var a=t[n];if(["captions","descriptions","subtitles"].indexOf(a.kind)>-1&&"showing"===a.mode){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})},t}(Cr);hi.registerComponent("OffTextTrackMenuItem",Er);var Ar=function(e){function t(t,i){return void 0===i&&(i={}),i.tracks=t.textTracks(),e.call(this,t,i)||this}return Pe(t,e),t.prototype.createItems=function(e,t){var i;void 0===e&&(e=[]),void 0===t&&(t=Cr),this.label_&&(i=this.label_+" off"),e.push(new Er(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;var n=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var r=0;r<n.length;r++){var a=n[r];if(this.kinds_.indexOf(a.kind)>-1){var s=new t(this.player_,{track:a,selectable:!0,multiSelectable:!1});s.addClass("vjs-"+a.kind+"-menu-item"),e.push(s)}}return e},t}(kr);hi.registerComponent("TextTrackButton",Ar);var Lr=function(e){function t(t,i){var n,r=i.track,a=i.cue,s=t.currentTime();return i.selectable=!0,i.multiSelectable=!1,i.label=a.text,i.selected=a.startTime<=s&&s<a.endTime,(n=e.call(this,t,i)||this).track=r,n.cue=a,r.addEventListener("cuechange",$t(De(De(n)),n.update)),n}Pe(t,e);var i=t.prototype;return i.handleClick=function(t){e.prototype.handleClick.call(this),this.player_.currentTime(this.cue.startTime),this.update(this.cue.startTime)},i.update=function(e){var t=this.cue,i=this.player_.currentTime();this.selected(t.startTime<=i&&i<t.endTime)},t}(wr);hi.registerComponent("ChaptersTrackMenuItem",Lr);var Or=function(e){function t(t,i,n){return e.call(this,t,i,n)||this}Pe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-chapters-button "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-chapters-button "+e.prototype.buildWrapperCSSClass.call(this)},i.update=function(t){this.track_&&(!t||"addtrack"!==t.type&&"removetrack"!==t.type)||this.setTrack(this.findChaptersTrack()),e.prototype.update.call(this)},i.setTrack=function(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){var t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.removeEventListener("load",this.updateHandler_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";var i=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);i&&i.addEventListener("load",this.updateHandler_)}}},i.findChaptersTrack=function(){for(var e=this.player_.textTracks()||[],t=e.length-1;t>=0;t--){var i=e[t];if(i.kind===this.kind_)return i}},i.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(li(this.kind_))},i.createMenu=function(){return this.options_.title=this.getMenuCaption(),e.prototype.createMenu.call(this)},i.createItems=function(){var e=[];if(!this.track_)return e;var t=this.track_.cues;if(!t)return e;for(var i=0,n=t.length;i<n;i++){var r=t[i],a=new Lr(this.player_,{track:this.track_,cue:r});e.push(a)}return e},t}(Ar);Or.prototype.kind_="chapters",Or.prototype.controlText_="Chapters",hi.registerComponent("ChaptersButton",Or);var Pr=function(e){function t(t,i,n){var r;r=e.call(this,t,i,n)||this;var a=t.textTracks(),s=$t(De(De(r)),r.handleTracksChange);return a.addEventListener("change",s),r.on("dispose",(function(){a.removeEventListener("change",s)})),r}Pe(t,e);var i=t.prototype;return i.handleTracksChange=function(e){for(var t=this.player().textTracks(),i=!1,n=0,r=t.length;n<r;n++){var a=t[n];if(a.kind!==this.kind_&&"showing"===a.mode){i=!0;break}}i?this.disable():this.enable()},i.buildCSSClass=function(){return"vjs-descriptions-button "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-descriptions-button "+e.prototype.buildWrapperCSSClass.call(this)},t}(Ar);Pr.prototype.kind_="descriptions",Pr.prototype.controlText_="Descriptions",hi.registerComponent("DescriptionsButton",Pr);var xr=function(e){function t(t,i,n){return e.call(this,t,i,n)||this}Pe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-subtitles-button "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-subtitles-button "+e.prototype.buildWrapperCSSClass.call(this)},t}(Ar);xr.prototype.kind_="subtitles",xr.prototype.controlText_="Subtitles",hi.registerComponent("SubtitlesButton",xr);var Ur=function(e){function t(t,i){var n;return i.track={player:t,kind:i.kind,label:i.kind+" settings",selectable:!1,default:!1,mode:"disabled"},i.selectable=!1,i.name="CaptionSettingsMenuItem",(n=e.call(this,t,i)||this).addClass("vjs-texttrack-settings"),n.controlText(", opens "+i.kind+" settings dialog"),n}return Pe(t,e),t.prototype.handleClick=function(e){this.player().getChild("textTrackSettings").open()},t}(Cr);hi.registerComponent("CaptionSettingsMenuItem",Ur);var Ir=function(e){function t(t,i,n){return e.call(this,t,i,n)||this}Pe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-captions-button "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-captions-button "+e.prototype.buildWrapperCSSClass.call(this)},i.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new Ur(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),e.prototype.createItems.call(this,t)},t}(Ar);Ir.prototype.kind_="captions",Ir.prototype.controlText_="Captions",hi.registerComponent("CaptionsButton",Ir);var Dr=function(e){function t(){return e.apply(this,arguments)||this}return Pe(t,e),t.prototype.createEl=function(t,i,n){var r='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);return"captions"===this.options_.track.kind&&(r+='\n <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n <span class="vjs-control-text"> '+this.localize("Captions")+"</span>\n "),r+="</span>",e.prototype.createEl.call(this,t,He({innerHTML:r},i),n)},t}(Cr);hi.registerComponent("SubsCapsMenuItem",Dr);var Rr=function(e){function t(t,i){var n;return void 0===i&&(i={}),(n=e.call(this,t,i)||this).label_="subtitles",["en","en-us","en-ca","fr-ca"].indexOf(n.player_.language_)>-1&&(n.label_="captions"),n.menuButton_.controlText(li(n.label_)),n}Pe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildWrapperCSSClass.call(this)},i.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new Ur(this.player_,{kind:this.label_})),this.hideThreshold_+=1),t=e.prototype.createItems.call(this,t,Dr)},t}(Ar);Rr.prototype.kinds_=["captions","subtitles"],Rr.prototype.controlText_="Subtitles",hi.registerComponent("SubsCapsButton",Rr);var Mr=function(e){function t(t,i){var n,r=i.track,a=t.audioTracks();i.label=r.label||r.language||"Unknown",i.selected=r.enabled,(n=e.call(this,t,i)||this).track=r,n.addClass("vjs-"+r.kind+"-menu-item");var s=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];n.handleTracksChange.apply(De(De(n)),t)};return a.addEventListener("change",s),n.on("dispose",(function(){a.removeEventListener("change",s)})),n}Pe(t,e);var i=t.prototype;return i.createEl=function(t,i,n){var r='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);return"main-desc"===this.options_.track.kind&&(r+='\n <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n <span class="vjs-control-text"> '+this.localize("Descriptions")+"</span>\n "),r+="</span>",e.prototype.createEl.call(this,t,He({innerHTML:r},i),n)},i.handleClick=function(t){var i=this.player_.audioTracks();e.prototype.handleClick.call(this,t);for(var n=0;n<i.length;n++){var r=i[n];r.enabled=r===this.track}},i.handleTracksChange=function(e){this.selected(this.track.enabled)},t}(wr);hi.registerComponent("AudioTrackMenuItem",Mr);var Br=function(e){function t(t,i){return void 0===i&&(i={}),i.tracks=t.audioTracks(),e.call(this,t,i)||this}Pe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-audio-button "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-audio-button "+e.prototype.buildWrapperCSSClass.call(this)},i.createItems=function(e){void 0===e&&(e=[]),this.hideThreshold_=1;for(var t=this.player_.audioTracks(),i=0;i<t.length;i++){var n=t[i];e.push(new Mr(this.player_,{track:n,selectable:!0,multiSelectable:!1}))}return e},t}(kr);Br.prototype.controlText_="Audio Track",hi.registerComponent("AudioTrackButton",Br);var Nr=function(e){function t(t,i){var n,r=i.rate,a=parseFloat(r,10);return i.label=r,i.selected=1===a,i.selectable=!0,i.multiSelectable=!1,(n=e.call(this,t,i)||this).label=r,n.rate=a,n.on(t,"ratechange",n.update),n}Pe(t,e);var i=t.prototype;return i.handleClick=function(t){e.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},i.update=function(e){this.selected(this.player().playbackRate()===this.rate)},t}(wr);Nr.prototype.contentElType="button",hi.registerComponent("PlaybackRateMenuItem",Nr);var jr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).updateVisibility(),n.updateLabel(),n.on(t,"loadstart",n.updateVisibility),n.on(t,"ratechange",n.updateLabel),n}Pe(t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this);return this.labelEl_=Ze("div",{className:"vjs-playback-rate-value",innerHTML:"1x"}),t.appendChild(this.labelEl_),t},i.dispose=function(){this.labelEl_=null,e.prototype.dispose.call(this)},i.buildCSSClass=function(){return"vjs-playback-rate "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-playback-rate "+e.prototype.buildWrapperCSSClass.call(this)},i.createMenu=function(){var e=new Tr(this.player()),t=this.playbackRates();if(t)for(var i=t.length-1;i>=0;i--)e.addChild(new Nr(this.player(),{rate:t[i]+"x"}));return e},i.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},i.handleClick=function(e){for(var t=this.player().playbackRate(),i=this.playbackRates(),n=i[0],r=0;r<i.length;r++)if(i[r]>t){n=i[r];break}this.player().playbackRate(n)},i.playbackRates=function(){return this.options_.playbackRates||this.options_.playerOptions&&this.options_.playerOptions.playbackRates},i.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},i.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},i.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.innerHTML=this.player().playbackRate()+"x")},t}(Sr);jr.prototype.controlText_="Playback Rate",hi.registerComponent("PlaybackRateMenuButton",jr);var Fr=function(e){function t(){return e.apply(this,arguments)||this}Pe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-spacer "+e.prototype.buildCSSClass.call(this)},i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass()})},t}(hi);hi.registerComponent("Spacer",Fr);var Vr=function(e){function t(){return e.apply(this,arguments)||this}Pe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-custom-control-spacer "+e.prototype.buildCSSClass.call(this)},i.createEl=function(){var t=e.prototype.createEl.call(this,{className:this.buildCSSClass()});return t.innerHTML=" ",t},t}(Fr);hi.registerComponent("CustomControlSpacer",Vr);var Hr=function(e){function t(){return e.apply(this,arguments)||this}return Pe(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},t}(hi);Hr.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},hi.registerComponent("ControlBar",Hr);var qr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"error",n.open),n}Pe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-error-display "+e.prototype.buildCSSClass.call(this)},i.content=function(){var e=this.player().error();return e?this.localize(e.message):""},t}(Ki);qr.prototype.options_=ci(Ki.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),hi.registerComponent("ErrorDisplay",qr);var zr="vjs-text-track-settings",Wr=["#000","Black"],Gr=["#00F","Blue"],Xr=["#0FF","Cyan"],Yr=["#0F0","Green"],$r=["#F0F","Magenta"],Kr=["#F00","Red"],Qr=["#FFF","White"],Jr=["#FF0","Yellow"],Zr=["1","Opaque"],ea=["0.5","Semi-Transparent"],ta=["0","Transparent"],ia={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Wr,Qr,Kr,Yr,Gr,Jr,$r,Xr]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[Zr,ea,ta]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Qr,Wr,Kr,Yr,Gr,Jr,$r,Xr]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:function(e){return"1.00"===e?null:Number(e)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[Zr,ea]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[ta,ea,Zr]}};function na(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}ia.windowColor.options=ia.backgroundColor.options;var ra=function(e){function t(t,i){var n;return i.temporary=!1,(n=e.call(this,t,i)||this).updateDisplay=$t(De(De(n)),n.updateDisplay),n.fill(),n.hasBeenOpened_=n.hasBeenFilled_=!0,n.endDialog=Ze("p",{className:"vjs-control-text",textContent:n.localize("End of dialog window.")}),n.el().appendChild(n.endDialog),n.setDefaults(),void 0===i.persistTextTrackSettings&&(n.options_.persistTextTrackSettings=n.options_.playerOptions.persistTextTrackSettings),n.on(n.$(".vjs-done-button"),"click",(function(){n.saveSettings(),n.close()})),n.on(n.$(".vjs-default-button"),"click",(function(){n.setDefaults(),n.updateDisplay()})),Ve(ia,(function(e){n.on(n.$(e.selector),"change",n.updateDisplay)})),n.options_.persistTextTrackSettings&&n.restoreSettings(),n}Pe(t,e);var i=t.prototype;return i.dispose=function(){this.endDialog=null,e.prototype.dispose.call(this)},i.createElSelect_=function(e,t,i){var n=this;void 0===t&&(t=""),void 0===i&&(i="label");var r=ia[e],a=r.id.replace("%s",this.id_),s=[t,a].join(" ").trim();return["<"+i+' id="'+a+'" class="'+("label"===i?"vjs-label":"")+'">',this.localize(r.label),"</"+i+">",'<select aria-labelledby="'+s+'">'].concat(r.options.map((function(e){var t=a+"-"+e[1].replace(/\W+/g,"");return['<option id="'+t+'" value="'+e[0]+'" ','aria-labelledby="'+s+" "+t+'">',n.localize(e[1]),"</option>"].join("")}))).concat("</select>").join("")},i.createElFgColor_=function(){var e="captions-text-legend-"+this.id_;return['<fieldset class="vjs-fg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Text"),"</legend>",this.createElSelect_("color",e),'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",e),"</span>","</fieldset>"].join("")},i.createElBgColor_=function(){var e="captions-background-"+this.id_;return['<fieldset class="vjs-bg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Background"),"</legend>",this.createElSelect_("backgroundColor",e),'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",e),"</span>","</fieldset>"].join("")},i.createElWinColor_=function(){var e="captions-window-"+this.id_;return['<fieldset class="vjs-window-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Window"),"</legend>",this.createElSelect_("windowColor",e),'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",e),"</span>","</fieldset>"].join("")},i.createElColors_=function(){return Ze("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},i.createElFont_=function(){return Ze("div",{className:"vjs-track-settings-font",innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_("fontPercent","","legend"),"</fieldset>",'<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_("edgeStyle","","legend"),"</fieldset>",'<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_("fontFamily","","legend"),"</fieldset>"].join("")})},i.createElControls_=function(){var e=this.localize("restore all settings to the default values");return Ze("div",{className:"vjs-track-settings-controls",innerHTML:['<button type="button" class="vjs-default-button" title="'+e+'">',this.localize("Reset"),'<span class="vjs-control-text"> '+e+"</span>","</button>",'<button type="button" class="vjs-done-button">'+this.localize("Done")+"</button>"].join("")})},i.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},i.label=function(){return this.localize("Caption Settings Dialog")},i.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},i.buildCSSClass=function(){return e.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},i.getValues=function(){var e=this;return function(e,t,i){return void 0===i&&(i=0),Fe(e).reduce((function(i,n){return t(i,e[n],n)}),i)}(ia,(function(t,i,n){var r,a,s=(r=e.$(i.selector),a=i.parser,na(r.options[r.options.selectedIndex].value,a));return void 0!==s&&(t[n]=s),t}),{})},i.setValues=function(e){var t=this;Ve(ia,(function(i,n){!function(e,t,i){if(t)for(var n=0;n<e.options.length;n++)if(na(e.options[n].value,i)===t){e.selectedIndex=n;break}}(t.$(i.selector),e[n],i.parser)}))},i.setDefaults=function(){var e=this;Ve(ia,(function(t){var i=t.hasOwnProperty("default")?t.default:0;e.$(t.selector).selectedIndex=i}))},i.restoreSettings=function(){var e;try{e=JSON.parse(f().localStorage.getItem(zr))}catch(e){Be.warn(e)}e&&this.setValues(e)},i.saveSettings=function(){if(this.options_.persistTextTrackSettings){var e=this.getValues();try{Object.keys(e).length?f().localStorage.setItem(zr,JSON.stringify(e)):f().localStorage.removeItem(zr)}catch(e){Be.warn(e)}}},i.updateDisplay=function(){var e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()},i.conditionalBlur_=function(){this.previouslyActiveEl_=null,this.off(C(),"keydown",this.handleKeyDown);var e=this.player_.controlBar,t=e&&e.subsCapsButton,i=e&&e.captionsButton;t?t.focus():i&&i.focus()},t}(Ki);hi.registerComponent("TextTrackSettings",ra);var aa=function(e){function t(t,i){var n,r=i.ResizeObserver||f().ResizeObserver;null===i.ResizeObserver&&(r=!1);var a=ci({createEl:!r,reportTouchActivity:!1},i);return(n=e.call(this,t,a)||this).ResizeObserver=i.ResizeObserver||f().ResizeObserver,n.loadListener_=null,n.resizeObserver_=null,n.debouncedHandler_=function(e,t,i,n){var r;void 0===n&&(n=f());var a=function(){var a=this,s=arguments,o=function(){r=null,o=null,i||e.apply(a,s)};!r&&i&&e.apply(a,s),n.clearTimeout(r),r=n.setTimeout(o,t)};return a.cancel=function(){n.clearTimeout(r),r=null},a}((function(){n.resizeHandler()}),100,!1,De(De(n))),r?(n.resizeObserver_=new n.ResizeObserver(n.debouncedHandler_),n.resizeObserver_.observe(t.el())):(n.loadListener_=function(){n.el_&&n.el_.contentWindow&&Bt(n.el_.contentWindow,"resize",n.debouncedHandler_)},n.one("load",n.loadListener_)),n}Pe(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager"})},i.resizeHandler=function(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")},i.dispose=function(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.el_&&this.el_.contentWindow&&Nt(this.el_.contentWindow,"resize",this.debouncedHandler_),this.loadListener_&&this.off("load",this.loadListener_),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null},t}(hi);hi.registerComponent("ResizeManager",aa);var sa=function(e){function t(t,i){var n,r=ci({createEl:!1},i);return(n=e.call(this,t,r)||this).reset_(),n.on(n.player_,"durationchange",n.handleDurationchange),n}Pe(t,e);var i=t.prototype;return i.isBehind_=function(){if(!this.timeupdateSeen_)return!1;var e=this.liveCurrentTime(),t=this.player_.currentTime(),i=this.seekableIncrement_;return e!==1/0&&e-(2*i+.07)>=t},i.trackLive_=function(){this.pastSeekEnd_=this.pastSeekEnd_;var e=this.player_.seekable();if(e&&e.length){var t=this.seekableEnd();t!==this.lastSeekEnd_&&(this.lastSeekEnd_&&(this.seekableIncrement_=Math.abs(t-this.lastSeekEnd_)),this.pastSeekEnd_=0,this.lastSeekEnd_=t,this.trigger("seekableendchange")),this.pastSeekEnd_=this.pastSeekEnd()+.03,this.isBehind_()!==this.behindLiveEdge()&&(this.behindLiveEdge_=this.isBehind_(),this.trigger("liveedgechange"))}},i.handleDurationchange=function(){this.player_.duration()===1/0?this.startTracking():this.stopTracking()},i.startTracking=function(){var e=this;this.isTracking()||(this.trackingInterval_=this.setInterval(this.trackLive_,30),this.trackLive_(),this.on(this.player_,"play",this.trackLive_),this.on(this.player_,"pause",this.trackLive_),this.one(this.player_,"play",this.handlePlay),this.timeupdateSeen_||(this.handleTimeupdate=function(){e.timeupdateSeen_=!0,e.handleTimeupdate=null},this.one(this.player_,"timeupdate",this.handleTimeupdate)))},i.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge)},i.reset_=function(){this.pastSeekEnd_=0,this.lastSeekEnd_=null,this.behindLiveEdge_=null,this.timeupdateSeen_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.seekableIncrement_=12,this.off(this.player_,"play",this.trackLive_),this.off(this.player_,"pause",this.trackLive_),this.off(this.player_,"play",this.handlePlay),this.off(this.player_,"timeupdate",this.seekToLiveEdge),this.handleTimeupdate&&(this.off(this.player_,"timeupdate",this.handleTimeupdate),this.handleTimeupdate=null)},i.stopTracking=function(){this.isTracking()&&this.reset_()},i.seekableEnd=function(){for(var e=this.player_.seekable(),t=[],i=e?e.length:0;i--;)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0},i.seekableStart=function(){for(var e=this.player_.seekable(),t=[],i=e?e.length:0;i--;)t.push(e.start(i));return t.length?t.sort()[0]:0},i.liveWindow=function(){var e=this.liveCurrentTime();return e===1/0?1/0:e-this.seekableStart()},i.isLive=function(){return this.isTracking()},i.atLiveEdge=function(){return!this.behindLiveEdge()},i.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},i.pastSeekEnd=function(){return this.pastSeekEnd_},i.behindLiveEdge=function(){return this.behindLiveEdge_},i.isTracking=function(){return"number"==typeof this.trackingInterval_},i.seekToLiveEdge=function(){this.atLiveEdge()||(this.player_.currentTime(this.liveCurrentTime()),this.player_.paused()&&this.player_.play())},i.dispose=function(){this.stopTracking(),e.prototype.dispose.call(this)},t}(hi);hi.registerComponent("LiveTracker",sa);var oa=function(e){var t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;var i=e.$$("source"),n=[],r="";if(!i.length)return!1;for(var a=0;a<i.length;a++){var s=i[a].src;s&&-1===n.indexOf(s)&&n.push(s)}return!!n.length&&(1===n.length&&(r=n[0]),e.triggerSourceset(r),!0)},ua=Object.defineProperty({},"innerHTML",{get:function(){return this.cloneNode(!0).innerHTML},set:function(e){var t=C().createElement(this.nodeName.toLowerCase());t.innerHTML=e;for(var i=C().createDocumentFragment();t.childNodes.length;)i.appendChild(t.childNodes[0]);return this.innerText="",f().Element.prototype.appendChild.call(this,i),this.innerHTML}}),la=function(e,t){for(var i={},n=0;n<e.length&&!((i=Object.getOwnPropertyDescriptor(e[n],t))&&i.set&&i.get);n++);return i.enumerable=!0,i.configurable=!0,i},ca=function(e){var t=e.el();if(!t.resetSourceWatch_){var i={},n=function(e){return la([e.el(),f().HTMLMediaElement.prototype,f().Element.prototype,ua],"innerHTML")}(e),r=function(i){return function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];var s=i.apply(t,r);return oa(e),s}};["append","appendChild","insertAdjacentHTML"].forEach((function(e){t[e]&&(i[e]=t[e],t[e]=r(i[e]))})),Object.defineProperty(t,"innerHTML",ci(n,{set:r(n.set)})),t.resetSourceWatch_=function(){t.resetSourceWatch_=null,Object.keys(i).forEach((function(e){t[e]=i[e]})),Object.defineProperty(t,"innerHTML",n)},e.one("sourceset",t.resetSourceWatch_)}},ha=Object.defineProperty({},"src",{get:function(){return this.hasAttribute("src")?pn(f().Element.prototype.getAttribute.call(this,"src")):""},set:function(e){return f().Element.prototype.setAttribute.call(this,"src",e),e}}),da=function(e){if(e.featuresSourceset){var t=e.el();if(!t.resetSourceset_){var i=function(e){return la([e.el(),f().HTMLMediaElement.prototype,ha],"src")}(e),n=t.setAttribute,r=t.load;Object.defineProperty(t,"src",ci(i,{set:function(n){var r=i.set.call(t,n);return e.triggerSourceset(t.src),r}})),t.setAttribute=function(i,r){var a=n.call(t,i,r);return/src/i.test(i)&&e.triggerSourceset(t.src),a},t.load=function(){var i=r.call(t);return oa(e)||(e.triggerSourceset(""),ca(e)),i},t.currentSrc?e.triggerSourceset(t.currentSrc):oa(e)||ca(e),t.resetSourceset_=function(){t.resetSourceset_=null,t.load=r,t.setAttribute=n,Object.defineProperty(t,"src",i),t.resetSourceWatch_&&t.resetSourceWatch_()}}}};function pa(){var e=Re(["Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\n This may prevent text tracks from loading."]);return pa=function(){return e},e}var fa=function(e){function t(t,i){var n;n=e.call(this,t,i)||this;var r=t.source,a=!1;if(r&&(n.el_.currentSrc!==r.src||t.tag&&3===t.tag.initNetworkState_)?n.setSource(r):n.handleLateInit_(n.el_),t.enableSourceset&&n.setupSourcesetHandling_(),n.el_.hasChildNodes()){for(var s=n.el_.childNodes,o=s.length,l=[];o--;){var c=s[o];"track"===c.nodeName.toLowerCase()&&(n.featuresNativeTextTracks?(n.remoteTextTrackEls().addTrackElement_(c),n.remoteTextTracks().addTrack(c.track),n.textTracks().addTrack(c.track),a||n.el_.hasAttribute("crossorigin")||!mn(c.src)||(a=!0)):l.push(c))}for(var h=0;h<l.length;h++)n.el_.removeChild(l[h])}return n.proxyNativeTracks_(),n.featuresNativeTextTracks&&a&&Be.warn(u()(pa())),n.restoreMetadataTracksInIOSNativePlayer_(),(xi||yi||ki)&&!0===t.nativeControlsForTouch&&n.setControls(!0),n.proxyWebkitFullscreen_(),n.triggerReady(),n}Pe(t,e);var i=t.prototype;return i.dispose=function(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),t.disposeMediaElement(this.el_),this.options_=null,e.prototype.dispose.call(this)},i.setupSourcesetHandling_=function(){da(this)},i.restoreMetadataTracksInIOSNativePlayer_=function(){var e,t=this.textTracks(),i=function(){e=[];for(var i=0;i<t.length;i++){var n=t[i];"metadata"===n.kind&&e.push({track:n,storedMode:n.mode})}};i(),t.addEventListener("change",i),this.on("dispose",(function(){return t.removeEventListener("change",i)}));var n=function i(){for(var n=0;n<e.length;n++){var r=e[n];"disabled"===r.track.mode&&r.track.mode!==r.storedMode&&(r.track.mode=r.storedMode)}t.removeEventListener("change",i)};this.on("webkitbeginfullscreen",(function(){t.removeEventListener("change",i),t.removeEventListener("change",n),t.addEventListener("change",n)})),this.on("webkitendfullscreen",(function(){t.removeEventListener("change",i),t.addEventListener("change",i),t.removeEventListener("change",n)}))},i.overrideNative_=function(e,t){var i=this;if(t===this["featuresNative"+e+"Tracks"]){var n=e.toLowerCase();this[n+"TracksListeners_"]&&Object.keys(this[n+"TracksListeners_"]).forEach((function(e){i.el()[n+"Tracks"].removeEventListener(e,i[n+"TracksListeners_"][e])})),this["featuresNative"+e+"Tracks"]=!t,this[n+"TracksListeners_"]=null,this.proxyNativeTracksForType_(n)}},i.overrideNativeAudioTracks=function(e){this.overrideNative_("Audio",e)},i.overrideNativeVideoTracks=function(e){this.overrideNative_("Video",e)},i.proxyNativeTracksForType_=function(e){var t=this,i=Sn[e],n=this.el()[i.getterName],r=this[i.getterName]();if(this["featuresNative"+i.capitalName+"Tracks"]&&n&&n.addEventListener){var a={change:function(e){r.trigger({type:"change",target:r,currentTarget:r,srcElement:r})},addtrack:function(e){r.addTrack(e.track)},removetrack:function(e){r.removeTrack(e.track)}},s=function(){for(var e=[],t=0;t<r.length;t++){for(var i=!1,a=0;a<n.length;a++)if(n[a]===r[t]){i=!0;break}i||e.push(r[t])}for(;e.length;)r.removeTrack(e.shift())};this[i.getterName+"Listeners_"]=a,Object.keys(a).forEach((function(e){var i=a[e];n.addEventListener(e,i),t.on("dispose",(function(t){return n.removeEventListener(e,i)}))})),this.on("loadstart",s),this.on("dispose",(function(e){return t.off("loadstart",s)}))}},i.proxyNativeTracks_=function(){var e=this;Sn.names.forEach((function(t){e.proxyNativeTracksForType_(t)}))},i.createEl=function(){var e=this.options_.tag;if(!e||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(e){var i=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(i,e),t.disposeMediaElement(e),e=i}else{e=C().createElement("video");var n=ci({},this.options_.tag&&ot(this.options_.tag));xi&&!0===this.options_.nativeControlsForTouch||delete n.controls,st(e,He(n,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}void 0!==this.options_.preload&&lt(e,"preload",this.options_.preload);for(var r=["loop","muted","playsinline","autoplay"],a=0;a<r.length;a++){var s=r[a],o=this.options_[s];void 0!==o&&(o?lt(e,s,s):ct(e,s),e[s]=o)}return e},i.handleLateInit_=function(e){if(0!==e.networkState&&3!==e.networkState){if(0===e.readyState){var t=!1,i=function(){t=!0};this.on("loadstart",i);var n=function(){t||this.trigger("loadstart")};return this.on("loadedmetadata",n),void this.ready((function(){this.off("loadstart",i),this.off("loadedmetadata",n),t||this.trigger("loadstart")}))}var r=["loadstart"];r.push("loadedmetadata"),e.readyState>=2&&r.push("loadeddata"),e.readyState>=3&&r.push("canplay"),e.readyState>=4&&r.push("canplaythrough"),this.ready((function(){r.forEach((function(e){this.trigger(e)}),this)}))}},i.setCurrentTime=function(e){try{this.el_.currentTime=e}catch(e){Be(e,"Video is not ready. (Video.js)")}},i.duration=function(){var e=this;if(this.el_.duration===1/0&&Ti&&Ei&&0===this.el_.currentTime){return this.on("timeupdate",(function t(){e.el_.currentTime>0&&(e.el_.duration===1/0&&e.trigger("durationchange"),e.off("timeupdate",t))})),NaN}return this.el_.duration||NaN},i.width=function(){return this.el_.offsetWidth},i.height=function(){return this.el_.offsetHeight},i.proxyWebkitFullscreen_=function(){var e=this;if("webkitDisplayingFullscreen"in this.el_){var t=function(){this.trigger("fullscreenchange",{isFullscreen:!1})},i=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",t),this.trigger("fullscreenchange",{isFullscreen:!0}))};this.on("webkitbeginfullscreen",i),this.on("dispose",(function(){e.off("webkitbeginfullscreen",i),e.off("webkitendfullscreen",t)}))}},i.supportsFullScreen=function(){if("function"==typeof this.el_.webkitEnterFullScreen){var e=f().navigator&&f().navigator.userAgent||"";if(/Android/.test(e)||!/Chrome|Mac OS X 10.5/.test(e))return!0}return!1},i.enterFullScreen=function(){var e=this.el_;e.paused&&e.networkState<=e.HAVE_METADATA?(this.el_.play(),this.setTimeout((function(){e.pause(),e.webkitEnterFullScreen()}),0)):e.webkitEnterFullScreen()},i.exitFullScreen=function(){this.el_.webkitExitFullScreen()},i.src=function(e){if(void 0===e)return this.el_.src;this.setSrc(e)},i.reset=function(){t.resetMediaElement(this.el_)},i.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},i.setControls=function(e){this.el_.controls=!!e},i.addTextTrack=function(t,i,n){return this.featuresNativeTextTracks?this.el_.addTextTrack(t,i,n):e.prototype.addTextTrack.call(this,t,i,n)},i.createRemoteTextTrack=function(t){if(!this.featuresNativeTextTracks)return e.prototype.createRemoteTextTrack.call(this,t);var i=C().createElement("track");return t.kind&&(i.kind=t.kind),t.label&&(i.label=t.label),(t.language||t.srclang)&&(i.srclang=t.language||t.srclang),t.default&&(i.default=t.default),t.id&&(i.id=t.id),t.src&&(i.src=t.src),i},i.addRemoteTextTrack=function(t,i){var n=e.prototype.addRemoteTextTrack.call(this,t,i);return this.featuresNativeTextTracks&&this.el().appendChild(n),n},i.removeRemoteTextTrack=function(t){if(e.prototype.removeRemoteTextTrack.call(this,t),this.featuresNativeTextTracks)for(var i=this.$$("track"),n=i.length;n--;)t!==i[n]&&t!==i[n].track||this.el().removeChild(i[n])},i.getVideoPlaybackQuality=function(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();var e={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),f().performance&&"function"==typeof f().performance.now?e.creationTime=f().performance.now():f().performance&&f().performance.timing&&"number"==typeof f().performance.timing.navigationStart&&(e.creationTime=f().Date.now()-f().performance.timing.navigationStart),e},t}(Cn);if($e()){fa.TEST_VID=C().createElement("video");var ma=C().createElement("track");ma.kind="captions",ma.srclang="en",ma.label="English",fa.TEST_VID.appendChild(ma)}fa.isSupported=function(){try{fa.TEST_VID.volume=.5}catch(e){return!1}return!(!fa.TEST_VID||!fa.TEST_VID.canPlayType)},fa.canPlayType=function(e){return fa.TEST_VID.canPlayType(e)},fa.canPlaySource=function(e,t){return fa.canPlayType(e.type)},fa.canControlVolume=function(){try{var e=fa.TEST_VID.volume;return fa.TEST_VID.volume=e/2+.1,e!==fa.TEST_VID.volume}catch(e){return!1}},fa.canMuteVolume=function(){try{var e=fa.TEST_VID.muted;return fa.TEST_VID.muted=!e,fa.TEST_VID.muted?lt(fa.TEST_VID,"muted","muted"):ct(fa.TEST_VID,"muted"),e!==fa.TEST_VID.muted}catch(e){return!1}},fa.canControlPlaybackRate=function(){if(Ti&&Ei&&Ai<58)return!1;try{var e=fa.TEST_VID.playbackRate;return fa.TEST_VID.playbackRate=e/2+.1,e!==fa.TEST_VID.playbackRate}catch(e){return!1}},fa.canOverrideAttributes=function(){try{var e=function(){};Object.defineProperty(C().createElement("video"),"src",{get:e,set:e}),Object.defineProperty(C().createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(C().createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(C().createElement("audio"),"innerHTML",{get:e,set:e})}catch(e){return!1}return!0},fa.supportsNativeTextTracks=function(){return Pi||_i&&Ei},fa.supportsNativeVideoTracks=function(){return!(!fa.TEST_VID||!fa.TEST_VID.videoTracks)},fa.supportsNativeAudioTracks=function(){return!(!fa.TEST_VID||!fa.TEST_VID.audioTracks)},fa.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],fa.prototype.featuresVolumeControl=fa.canControlVolume(),fa.prototype.featuresMuteControl=fa.canMuteVolume(),fa.prototype.featuresPlaybackRate=fa.canControlPlaybackRate(),fa.prototype.featuresSourceset=fa.canOverrideAttributes(),fa.prototype.movingMediaElementInDOM=!_i,fa.prototype.featuresFullscreenResize=!0,fa.prototype.featuresProgressEvents=!0,fa.prototype.featuresTimeupdateEvents=!0,fa.prototype.featuresNativeTextTracks=fa.supportsNativeTextTracks(),fa.prototype.featuresNativeVideoTracks=fa.supportsNativeVideoTracks(),fa.prototype.featuresNativeAudioTracks=fa.supportsNativeAudioTracks();var ga=fa.TEST_VID&&fa.TEST_VID.constructor.prototype.canPlayType,ya=/^application\/(?:x-|vnd\.apple\.)mpegurl/i;function va(){var e=Re(["\n Using the tech directly can be dangerous. I hope you know what you're doing.\n See https://github.com/videojs/video.js/issues/2617 for more info.\n "]);return va=function(){return e},e}fa.patchCanPlayType=function(){Si>=4&&!wi&&!Ei&&(fa.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&ya.test(e)?"maybe":ga.call(this,e)})},fa.unpatchCanPlayType=function(){var e=fa.TEST_VID.constructor.prototype.canPlayType;return fa.TEST_VID.constructor.prototype.canPlayType=ga,e},fa.patchCanPlayType(),fa.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},fa.resetMediaElement=function(e){if(e){for(var t=e.querySelectorAll("source"),i=t.length;i--;)e.removeChild(t[i]);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach((function(e){fa.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}})),["muted","defaultMuted","autoplay","loop","playsinline"].forEach((function(e){fa.prototype["set"+li(e)]=function(t){this.el_[e]=t,t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}})),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","played","networkState","readyState","videoWidth","videoHeight"].forEach((function(e){fa.prototype[e]=function(){return this.el_[e]}})),["volume","src","poster","preload","playbackRate","defaultPlaybackRate"].forEach((function(e){fa.prototype["set"+li(e)]=function(t){this.el_[e]=t}})),["pause","load","play"].forEach((function(e){fa.prototype[e]=function(){return this.el_[e]()}})),Cn.withSourceHandlers(fa),fa.nativeSourceHandler={},fa.nativeSourceHandler.canPlayType=function(e){try{return fa.TEST_VID.canPlayType(e)}catch(e){return""}},fa.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return fa.nativeSourceHandler.canPlayType(e.type);if(e.src){var i=fn(e.src);return fa.nativeSourceHandler.canPlayType("video/"+i)}return""},fa.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src)},fa.nativeSourceHandler.dispose=function(){},fa.registerSourceHandler(fa.nativeSourceHandler),Cn.registerTech("Html5",fa);var _a=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],ba={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Ta=["tiny","xsmall","small","medium","large","xlarge","huge"],Sa={};Ta.forEach((function(e){var t="x"===e.charAt(0)?"x-"+e.substring(1):e;Sa[e]="vjs-layout-"+t}));var ka={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},wa=function(e){function t(i,n,r){var a;if(i.id=i.id||n.id||"vjs_video_"+Et(),(n=He(t.getTagSettings(i),n)).initChildren=!1,n.createEl=!1,n.evented=!1,n.reportTouchActivity=!1,!n.language)if("function"==typeof i.closest){var s=i.closest("[lang]");s&&s.getAttribute&&(n.language=s.getAttribute("lang"))}else for(var o=i;o&&1===o.nodeType;){if(ot(o).hasOwnProperty("lang")){n.language=o.getAttribute("lang");break}o=o.parentNode}if((a=e.call(this,null,n,r)||this).log=Ne(a.id_),a.isPosterFromTech_=!1,a.queuedCallbacks_=[],a.isReady_=!1,a.hasStarted_=!1,a.userActive_=!1,!a.options_||!a.options_.techOrder||!a.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(a.tag=i,a.tagAttributes=i&&ot(i),a.language(a.options_.language),n.languages){var u={};Object.getOwnPropertyNames(n.languages).forEach((function(e){u[e.toLowerCase()]=n.languages[e]})),a.languages_=u}else a.languages_=t.prototype.options_.languages;a.cache_={},a.poster_=n.poster||"",a.controls_=!!n.controls,a.cache_.lastVolume=1,i.controls=!1,i.removeAttribute("controls"),i.hasAttribute("autoplay")?a.options_.autoplay=!0:a.autoplay(a.options_.autoplay),a.scrubbing_=!1,a.el_=a.createEl(),a.cache_.lastPlaybackRate=a.defaultPlaybackRate(),si(De(De(a)),{eventBusKey:"el_"}),a.fluid_&&a.on("playerreset",a.updateStyleEl_);var l=ci(a.options_);if(n.plugins){var c=n.plugins;Object.keys(c).forEach((function(e){if("function"!=typeof this[e])throw new Error('plugin "'+e+'" does not exist');this[e](c[e])}),De(De(a)))}a.options_.playerOptions=l,a.middleware_=[],a.initChildren(),a.isAudio("audio"===i.nodeName.toLowerCase()),a.controls()?a.addClass("vjs-controls-enabled"):a.addClass("vjs-controls-disabled"),a.el_.setAttribute("role","region"),a.isAudio()?a.el_.setAttribute("aria-label",a.localize("Audio Player")):a.el_.setAttribute("aria-label",a.localize("Video Player")),a.isAudio()&&a.addClass("vjs-audio"),a.flexNotSupported_()&&a.addClass("vjs-no-flex"),_i||a.addClass("vjs-workinghover"),t.players[a.id_]=De(De(a));var h=Oe.split(".")[0];return a.addClass("vjs-v"+h),a.userActive(!0),a.reportUserActivity(),a.one("play",a.listenForUserActivity_),a.on("fullscreenchange",a.handleFullscreenChange_),a.on("stageclick",a.handleStageClick_),a.breakpoints(a.options_.breakpoints),a.responsive(a.options_.responsive),a.changingSrc_=!1,a.playWaitingForReady_=!1,a.playOnLoadstart_=null,a}Pe(t,e);var i=t.prototype;return i.dispose=function(){this.trigger("dispose"),this.off("dispose"),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),t.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),An[this.id()]=null,e.prototype.dispose.call(this)},i.createEl=function(){var t,i=this.tag,n=this.playerElIngest_=i.parentNode&&i.parentNode.hasAttribute&&i.parentNode.hasAttribute("data-vjs-player"),r="video-js"===this.tag.tagName.toLowerCase();n?t=this.el_=i.parentNode:r||(t=this.el_=e.prototype.createEl.call(this,"div"));var a=ot(i);if(r){for(t=this.el_=i,i=this.tag=C().createElement("video");t.children.length;)i.appendChild(t.firstChild);it(t,"video-js")||nt(t,"video-js"),t.appendChild(i),n=this.playerElIngest_=t,Object.keys(t).forEach((function(e){i[e]=t[e]}))}if(i.setAttribute("tabindex","-1"),a.tabindex="-1",Li&&(i.setAttribute("role","application"),a.role="application"),i.removeAttribute("width"),i.removeAttribute("height"),"width"in a&&delete a.width,"height"in a&&delete a.height,Object.getOwnPropertyNames(a).forEach((function(e){r&&"class"===e||t.setAttribute(e,a[e]),r&&i.setAttribute(e,a[e])})),i.playerId=i.id,i.id+="_html5_api",i.className="vjs-tech",i.player=t.player=this,this.addClass("vjs-paused"),!0!==f().VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=Xt("vjs-styles-dimensions");var s=St(".vjs-styles-defaults"),o=St("head");o.insertBefore(this.styleEl_,s?s.nextSibling:o.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio);for(var u=i.getElementsByTagName("a"),l=0;l<u.length;l++){var c=u.item(l);nt(c,"vjs-hidden"),c.setAttribute("hidden","hidden")}return i.initNetworkState_=i.networkState,i.parentNode&&!n&&i.parentNode.insertBefore(t,i),tt(i,t),this.children_.unshift(i),this.el_.setAttribute("lang",this.language_),this.el_=t,t},i.width=function(e){return this.dimension("width",e)},i.height=function(e){return this.dimension("height",e)},i.dimension=function(e,t){var i=e+"_";if(void 0===t)return this[i]||0;if(""===t)return this[i]=void 0,void this.updateStyleEl_();var n=parseFloat(t);isNaN(n)?Be.error('Improper value "'+t+'" supplied for for '+e):(this[i]=n,this.updateStyleEl_())},i.fluid=function(e){if(void 0===e)return!!this.fluid_;var t,i;this.fluid_=!!e,Jt(this)&&this.off("playerreset",this.updateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),Jt(t=function(){this.on("playerreset",this.updateStyleEl_)})?i():(t.eventedCallbacks||(t.eventedCallbacks=[]),t.eventedCallbacks.push(i))):this.removeClass("vjs-fluid"),this.updateStyleEl_()},i.fill=function(e){if(void 0===e)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")},i.aspectRatio=function(e){if(void 0===e)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()},i.updateStyleEl_=function(){if(!0!==f().VIDEOJS_NO_DYNAMIC_STYLE){var e,t,i,n=(void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"),r=n[1]/n[0];e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/r:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*r,i=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(i),Yt(this.styleEl_,"\n ."+i+" {\n width: "+e+"px;\n height: "+t+"px;\n }\n\n ."+i+".vjs-fluid {\n padding-top: "+100*r+"%;\n }\n ")}else{var a="number"==typeof this.width_?this.width_:this.options_.width,s="number"==typeof this.height_?this.height_:this.options_.height,o=this.tech_&&this.tech_.el();o&&(a>=0&&(o.width=a),s>=0&&(o.height=s))}},i.loadTech_=function(e,t){var i=this;this.tech_&&this.unloadTech_();var n=li(e),r=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==n&&this.tag&&(Cn.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=n,this.isReady_=!1;var a={source:t,autoplay:"string"!=typeof this.autoplay()&&this.autoplay(),nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+r+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};wn.names.forEach((function(e){var t=wn[e];a[t.getterName]=i[t.privateName]})),He(a,this.options_[n]),He(a,this.options_[r]),He(a,this.options_[e.toLowerCase()]),this.tag&&(a.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(a.startTime=this.cache_.currentTime);var s=Cn.getTech(e);if(!s)throw new Error("No Tech named '"+n+"' exists! '"+n+"' should be registered using videojs.registerTech()'");this.tech_=new s(a),this.tech_.ready($t(this,this.handleTechReady_),!0),$i(this.textTracksJson_||[],this.tech_),_a.forEach((function(e){i.on(i.tech_,e,i["handleTech"+li(e)+"_"])})),Object.keys(ba).forEach((function(e){i.on(i.tech_,e,(function(t){0===i.tech_.playbackRate()&&i.tech_.seeking()?i.queuedCallbacks_.push({callback:i["handleTech"+ba[e]+"_"].bind(i),event:t}):i["handleTech"+ba[e]+"_"](t)}))})),this.on(this.tech_,"loadstart",this.handleTechLoadStart_),this.on(this.tech_,"sourceset",this.handleTechSourceset_),this.on(this.tech_,"waiting",this.handleTechWaiting_),this.on(this.tech_,"ended",this.handleTechEnded_),this.on(this.tech_,"seeking",this.handleTechSeeking_),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_,"durationchange",this.handleTechDurationChange_),this.on(this.tech_,"fullscreenchange",this.handleTechFullscreenChange_),this.on(this.tech_,"error",this.handleTechError_),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_,"ratechange",this.handleTechRateChange_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===n&&this.tag||tt(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},i.unloadTech_=function(){var e=this;wn.names.forEach((function(t){var i=wn[t];e[i.privateName]=e[i.getterName]()})),this.textTracksJson_=Yi(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},i.tech=function(e){return void 0===e&&Be.warn(u()(va())),this.tech_},i.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"mousedown",this.handleTechClick_),this.on(this.tech_,"dblclick",this.handleTechDoubleClick_),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_)},i.removeTechControlsListeners_=function(){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_),this.off(this.tech_,"dblclick",this.handleTechDoubleClick_)},i.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},i.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(this.autoplay())},i.manualAutoplay_=function(e){var t=this;if(this.tech_&&"string"==typeof e){var i,n=function(){var e=t.muted();t.muted(!0);var i=t.play();if(i&&i.then&&i.catch)return i.catch((function(i){t.muted(e)}))};if("any"===e?(i=this.play())&&i.then&&i.catch&&i.catch((function(){return n()})):i="muted"===e?n():this.play(),i&&i.then&&i.catch)return i.then((function(){t.trigger({type:"autoplay-success",autoplay:e})})).catch((function(i){t.trigger({type:"autoplay-failure",autoplay:e})}))}},i.updateSourceCaches_=function(e){void 0===e&&(e="");var t=e,i="";"string"!=typeof t&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=function(e,t){if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;var i=e.cache_.sources.filter((function(e){return e.src===t}));if(i.length)return i[0].type;for(var n=e.$$("source"),r=0;r<n.length;r++){var a=n[r];if(a.type&&a.src&&a.src===t)return a.type}return Bn(t)}(this,t)),this.cache_.source=ci({},e,{src:t,type:i});for(var n=this.cache_.sources.filter((function(e){return e.src&&e.src===t})),r=[],a=this.$$("source"),s=[],o=0;o<a.length;o++){var u=ot(a[o]);r.push(u),u.src&&u.src===t&&s.push(u.src)}s.length&&!n.length?this.cache_.sources=r:n.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t},i.handleTechSourceset_=function(e){var t=this;if(!this.changingSrc_){var i=function(e){return t.updateSourceCaches_(e)},n=this.currentSource().src,r=e.src;if(n&&!/^blob:/.test(n)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==n)&&(i=function(){}),i(r),!e.src){this.tech_.one(["sourceset","loadstart"],(function e(i){if("sourceset"!==i.type){var n=t.techGet("currentSrc");t.lastSource_.tech=n,t.updateSourceCaches_(n)}t.tech_.off(["sourceset","loadstart"],e)}))}}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})},i.hasStarted=function(e){if(void 0===e)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started"))},i.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},i.handleTechRateChange_=function(){this.tech_.playbackRate()>0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach((function(e){return e.callback(e.event)})),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},i.handleTechWaiting_=function(){var e=this;this.addClass("vjs-waiting"),this.trigger("waiting");var t=this.currentTime();this.on("timeupdate",(function i(){t!==e.currentTime()&&(e.removeClass("vjs-waiting"),e.off("timeupdate",i))}))},i.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},i.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},i.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},i.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},i.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.trigger("seeked")},i.handleTechFirstPlay_=function(){this.options_.starttime&&(Be.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},i.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},i.handleTechEnded_=function(){this.addClass("vjs-ended"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},i.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},i.handleTechClick_=function(e){Tt(e)&&this.controls_&&(this.paused()?Gi(this.play()):this.pause())},i.handleTechDoubleClick_=function(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),(function(t){return t.contains(e.target)}))||(this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))},i.handleTechTap_=function(){this.userActive(!this.userActive())},i.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},i.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},i.handleTechTouchEnd_=function(e){e.preventDefault()},i.handleFullscreenChange_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},i.handleStageClick_=function(){this.reportUserActivity()},i.handleTechFullscreenChange_=function(e,t){t&&this.isFullscreen(t.isFullscreen),this.trigger("fullscreenchange")},i.handleTechError_=function(){var e=this.tech_.error();this.error(e)},i.handleTechTextData_=function(){var e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)},i.getCache=function(){return this.cache_},i.techCall_=function(e,t){this.ready((function(){if(e in Un)return function(e,t,i,n){return t[i](e.reduce(Dn(i),n))}(this.middleware_,this.tech_,e,t);if(e in In)return Pn(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(e){throw Be(e),e}}),!0)},i.techGet_=function(e){if(this.tech_&&this.tech_.isReady_){if(e in xn)return function(e,t,i){return e.reduceRight(Dn(i),t[i]())}(this.middleware_,this.tech_,e);if(e in In)return Pn(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e])throw Be("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",t),t;if("TypeError"===t.name)throw Be("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",t),this.tech_.isReady_=!1,t;throw Be(t),t}}},i.play=function(){var e=this,t=this.options_.Promise||f().Promise;return t?new t((function(t){e.play_(t)})):this.play_()},i.play_=function(e){var t=this;if(void 0===e&&(e=Gi),this.playOnLoadstart_&&this.off("loadstart",this.playOnLoadstart_),this.isReady_){if(!this.changingSrc_&&(this.src()||this.currentSrc()))return void e(this.techGet_("play"));this.playOnLoadstart_=function(){t.playOnLoadstart_=null,e(t.play())},this.one("loadstart",this.playOnLoadstart_)}else{if(this.playWaitingForReady_)return;this.playWaitingForReady_=!0,this.ready((function(){t.playWaitingForReady_=!1,e(t.play())}))}},i.pause=function(){this.techCall_("pause")},i.paused=function(){return!1!==this.techGet_("paused")},i.played=function(){return this.techGet_("played")||Ri(0,0)},i.scrubbing=function(e){if(void 0===e)return this.scrubbing_;this.scrubbing_=!!e,e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},i.currentTime=function(e){return void 0!==e?(e<0&&(e=0),void this.techCall_("setCurrentTime",e)):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},i.duration=function(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?(this.addClass("vjs-live"),this.options_.liveui&&this.player_.liveTracker&&this.addClass("vjs-liveui")):(this.removeClass("vjs-live"),this.removeClass("vjs-liveui")),isNaN(e)||this.trigger("durationchange"))},i.remainingTime=function(){return this.duration()-this.currentTime()},i.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},i.buffered=function(){var e=this.techGet_("buffered");return e&&e.length||(e=Ri(0,0)),e},i.bufferedPercent=function(){return Mi(this.buffered(),this.duration())},i.bufferedEnd=function(){var e=this.buffered(),t=this.duration(),i=e.end(e.length-1);return i>t&&(i=t),i},i.volume=function(e){var t;return void 0!==e?(t=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=t,this.techCall_("setVolume",t),void(t>0&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t)},i.muted=function(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)},i.defaultMuted=function(e){return void 0!==e?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1},i.lastVolume_=function(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e},i.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},i.isFullscreen=function(e){if(void 0===e)return!!this.isFullscreen_;this.isFullscreen_=!!e},i.requestFullscreen=function(){var e=Ni;this.isFullscreen(!0),e.requestFullscreen?(Bt(C(),e.fullscreenchange,$t(this,(function t(i){this.isFullscreen(C()[e.fullscreenElement]),!1===this.isFullscreen()&&Nt(C(),e.fullscreenchange,t),this.trigger("fullscreenchange")}))),this.el_[e.requestFullscreen]()):this.tech_.supportsFullScreen()?this.techCall_("enterFullScreen"):(this.enterFullWindow(),this.trigger("fullscreenchange"))},i.exitFullscreen=function(){var e=Ni;this.isFullscreen(!1),e.requestFullscreen?C()[e.exitFullscreen]():this.tech_.supportsFullScreen()?this.techCall_("exitFullScreen"):(this.exitFullWindow(),this.trigger("fullscreenchange"))},i.enterFullWindow=function(){this.isFullWindow=!0,this.docOrigOverflow=C().documentElement.style.overflow,Bt(C(),"keydown",$t(this,this.fullWindowOnEscKey)),C().documentElement.style.overflow="hidden",nt(C().body,"vjs-full-window"),this.trigger("enterFullWindow")},i.fullWindowOnEscKey=function(e){27===e.keyCode&&(!0===this.isFullscreen()?this.exitFullscreen():this.exitFullWindow())},i.exitFullWindow=function(){this.isFullWindow=!1,Nt(C(),"keydown",this.fullWindowOnEscKey),C().documentElement.style.overflow=this.docOrigOverflow,rt(C().body,"vjs-full-window"),this.trigger("exitFullWindow")},i.canPlayType=function(e){for(var t,i=0,n=this.options_.techOrder;i<n.length;i++){var r=n[i],a=Cn.getTech(r);if(a||(a=hi.getComponent(r)),a){if(a.isSupported()&&(t=a.canPlayType(e)))return t}else Be.error('The "'+r+'" tech is undefined. Skipped browser support check for that tech.')}return""},i.selectSource=function(e){var t=this,i=this.options_.techOrder.map((function(e){return[e,Cn.getTech(e)]})).filter((function(e){var t=e[0],i=e[1];return i?i.isSupported():(Be.error('The "'+t+'" tech is undefined. Skipped browser support check for that tech.'),!1)})),n=function(e,t,i){var n;return e.some((function(e){return t.some((function(t){if(n=i(e,t))return!0}))})),n},r=function(e,i){var n=e[0];if(e[1].canPlaySource(i,t.options_[n.toLowerCase()]))return{source:i,tech:n}};return(this.options_.sourceOrder?n(e,i,function(e){return function(t,i){return e(i,t)}}(r)):n(i,e,r))||!1},i.src=function(e){var t=this;if(void 0===e)return this.cache_.src||"";var i=Nn(e);i.length?(this.changingSrc_=!0,this.cache_.sources=i,this.updateSourceCaches_(i[0]),On(this,i[0],(function(e,n){var r,a;if(t.middleware_=n,t.cache_.sources=i,t.updateSourceCaches_(e),t.src_(e))return i.length>1?t.src(i.slice(1)):(t.changingSrc_=!1,t.setTimeout((function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})}),0),void t.triggerReady());r=n,a=t.tech_,r.forEach((function(e){return e.setTech&&e.setTech(a)}))}))):this.setTimeout((function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})}),0)},i.src_=function(e){var t,i,n=this,r=this.selectSource([e]);return!r||(t=r.tech,i=this.techName_,li(t)!==li(i)?(this.changingSrc_=!0,this.loadTech_(r.tech,r.source),this.tech_.ready((function(){n.changingSrc_=!1})),!1):(this.ready((function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1}),!0),!1))},i.load=function(){this.techCall_("load")},i.reset=function(){this.tech_&&this.tech_.clearTracks("text"),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),Jt(this)&&this.trigger("playerreset")},i.currentSources=function(){var e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t},i.currentSource=function(){return this.cache_.source||{}},i.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},i.currentType=function(){return this.currentSource()&&this.currentSource().type||""},i.preload=function(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")},i.autoplay=function(e){if(void 0===e)return this.options_.autoplay||!1;var t;"string"==typeof e&&/(any|play|muted)/.test(e)?(this.options_.autoplay=e,this.manualAutoplay_(e),t=!1):this.options_.autoplay=!!e,t=t||this.options_.autoplay,this.tech_&&this.techCall_("setAutoplay",t)},i.playsinline=function(e){return void 0!==e?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")},i.loop=function(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")},i.poster=function(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))},i.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},i.controls=function(e){if(void 0===e)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))},i.usingNativeControls=function(e){if(void 0===e)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},i.error=function(e){return void 0===e?this.error_||null:null===e?(this.error_=e,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close())):(this.error_=new qi(e),this.addClass("vjs-error"),Be.error("(CODE:"+this.error_.code+" "+qi.errorTypes[this.error_.code]+")",this.error_.message,this.error_),void this.trigger("error"))},i.reportUserActivity=function(e){this.userActivity_=!0},i.userActive=function(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",(function(e){e.stopPropagation(),e.preventDefault()})),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},i.listenForUserActivity_=function(){var e,t,i,n,r=$t(this,this.reportUserActivity);this.on("mousedown",(function(){r(),this.clearInterval(e),e=this.setInterval(r,250)})),this.on("mousemove",(function(e){e.screenX===t&&e.screenY===i||(t=e.screenX,i=e.screenY,r())})),this.on("mouseup",(function(t){r(),this.clearInterval(e)})),this.on("keydown",r),this.on("keyup",r),this.setInterval((function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(n);var e=this.options_.inactivityTimeout;e<=0||(n=this.setTimeout((function(){this.userActivity_||this.userActive(!1)}),e))}}),250)},i.playbackRate=function(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)},i.defaultPlaybackRate=function(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},i.isAudio=function(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e},i.addTextTrack=function(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)},i.addRemoteTextTrack=function(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)},i.removeRemoteTextTrack=function(e){void 0===e&&(e={});var t=e.track;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)},i.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},i.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},i.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},i.language=function(e){if(void 0===e)return this.language_;this.language_=String(e).toLowerCase()},i.languages=function(){return ci(t.prototype.options_.languages,this.languages_)},i.toJSON=function(){var e=ci(this.options_),t=e.tracks;e.tracks=[];for(var i=0;i<t.length;i++){var n=t[i];(n=ci(n)).player=void 0,e.tracks[i]=n}return e},i.createModal=function(e,t){var i=this;(t=t||{}).content=e||"";var n=new Ki(this,t);return this.addChild(n),n.on("dispose",(function(){i.removeChild(n)})),n.open(),n},i.updateCurrentBreakpoint_=function(){if(this.responsive())for(var e=this.currentBreakpoint(),t=this.currentWidth(),i=0;i<Ta.length;i++){var n=Ta[i];if(t<=this.breakpoints_[n]){if(e===n)return;e&&this.removeClass(Sa[e]),this.addClass(Sa[n]),this.breakpoint_=n;break}}},i.removeCurrentBreakpoint_=function(){var e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)},i.breakpoints=function(e){return void 0===e||(this.breakpoint_="",this.breakpoints_=He({},ka,e),this.updateCurrentBreakpoint_()),He(this.breakpoints_)},i.responsive=function(e){return void 0===e?this.responsive_:(e=Boolean(e))!==this.responsive_?(this.responsive_=e,e?(this.on("playerresize",this.updateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.updateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e):void 0},i.currentBreakpoint=function(){return this.breakpoint_},i.currentBreakpointClass=function(){return Sa[this.breakpoint_]||""},t.getTagSettings=function(e){var t={sources:[],tracks:[]},i=ot(e),n=i["data-setup"];if(it(e,"vjs-fill")&&(i.fill=!0),it(e,"vjs-fluid")&&(i.fluid=!0),null!==n){var a=r()(n||"{}"),s=a[0],o=a[1];s&&Be.error(s),He(i,o)}if(He(t,i),e.hasChildNodes())for(var u=e.childNodes,l=0,c=u.length;l<c;l++){var h=u[l],d=h.nodeName.toLowerCase();"source"===d?t.sources.push(ot(h)):"track"===d&&t.tracks.push(ot(h))}return t},i.flexNotSupported_=function(){var e=C().createElement("i");return!("flexBasis"in e.style||"webkitFlexBasis"in e.style||"mozFlexBasis"in e.style||"msFlexBasis"in e.style||"msFlexOrder"in e.style)},t}(hi);wn.names.forEach((function(e){var t=wn[e];wa.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}})),wa.players={};var Ca=f().navigator;wa.prototype.options_={techOrder:Cn.defaultTechOrder_,html5:{},flash:{},inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:Ca&&(Ca.languages&&Ca.languages[0]||Ca.userLanguage||Ca.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",breakpoints:{},responsive:!1},["ended","seeking","seekable","networkState","readyState"].forEach((function(e){wa.prototype[e]=function(){return this.techGet_(e)}})),_a.forEach((function(e){wa.prototype["handleTech"+li(e)+"_"]=function(){return this.trigger(e)}})),hi.registerComponent("Player",wa);var Ea="plugin",Aa={},La=function(e){return Aa.hasOwnProperty(e)},Oa=function(e){return La(e)?Aa[e]:void 0},Pa=function(e,t){e.activePlugins_=e.activePlugins_||{},e.activePlugins_[t]=!0},xa=function(e,t,i){var n=(i?"before":"")+"pluginsetup";e.trigger(n,t),e.trigger(n+":"+t.name,t)},Ua=function(e,t){return t.prototype.name=e,function(){xa(this,{name:e,plugin:t,instance:null},!0);for(var i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];var a=Ie(t,[this].concat(n));return this[e]=function(){return a},xa(this,a.getEventHash()),a}},Ia=function(){function e(t){if(this.constructor===e)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=t,si(this),delete this.trigger,ui(this,this.constructor.defaultState),Pa(t,this.name),this.dispose=$t(this,this.dispose),t.on("dispose",this.dispose)}var t=e.prototype;return t.version=function(){return this.constructor.VERSION},t.getEventHash=function(e){return void 0===e&&(e={}),e.name=this.name,e.plugin=this.constructor,e.instance=this,e},t.trigger=function(e,t){return void 0===t&&(t={}),jt(this.eventBusEl_,e,this.getEventHash(t))},t.handleStateChanged=function(e){},t.dispose=function(){var e=this.name,t=this.player;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t.activePlugins_[e]=!1,this.player=this.state=null,t[e]=Ua(e,Aa[e])},e.isBasic=function(t){var i="string"==typeof t?Oa(t):t;return"function"==typeof i&&!e.prototype.isPrototypeOf(i.prototype)},e.registerPlugin=function(t,i){if("string"!=typeof t)throw new Error('Illegal plugin name, "'+t+'", must be a string, was '+typeof t+".");if(La(t))Be.warn('A plugin named "'+t+'" already exists. You may want to avoid re-registering plugins!');else if(wa.prototype.hasOwnProperty(t))throw new Error('Illegal plugin name, "'+t+'", cannot share a name with an existing player method!');if("function"!=typeof i)throw new Error('Illegal plugin for "'+t+'", must be a function, was '+typeof i+".");return Aa[t]=i,t!==Ea&&(e.isBasic(i)?wa.prototype[t]=function(e,t){var i=function(){xa(this,{name:e,plugin:t,instance:null},!0);var i=t.apply(this,arguments);return Pa(this,e),xa(this,{name:e,plugin:t,instance:i}),i};return Object.keys(t).forEach((function(e){i[e]=t[e]})),i}(t,i):wa.prototype[t]=Ua(t,i)),i},e.deregisterPlugin=function(e){if(e===Ea)throw new Error("Cannot de-register base plugin.");La(e)&&(delete Aa[e],delete wa.prototype[e])},e.getPlugins=function(e){var t;return void 0===e&&(e=Object.keys(Aa)),e.forEach((function(e){var i=Oa(e);i&&((t=t||{})[e]=i)})),t},e.getPluginVersion=function(e){var t=Oa(e);return t&&t.VERSION||""},e}();Ia.getPlugin=Oa,Ia.BASE_PLUGIN_NAME=Ea,Ia.registerPlugin(Ea,Ia),wa.prototype.usingPlugin=function(e){return!!this.activePlugins_&&!0===this.activePlugins_[e]},wa.prototype.hasPlugin=function(e){return!!La(e)};var Da=function(e){return 0===e.indexOf("#")?e.slice(1):e};function Ra(e,t,i){var n=Ra.getPlayer(e);if(n)return t&&Be.warn('Player "'+e+'" is already initialised. Options will not be applied.'),i&&n.ready(i),n;var r="string"==typeof e?St("#"+Da(e)):e;if(!Ke(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");C().body.contains(r)||Be.warn("The element supplied is not included in the DOM"),t=t||{},Ra.hooks("beforesetup").forEach((function(e){var i=e(r,ci(t));qe(i)&&!Array.isArray(i)?t=ci(t,i):Be.error("please return an object in beforesetup hooks")}));var a=hi.getComponent("Player");return n=new a(r,t,i),Ra.hooks("setup").forEach((function(e){return e(n)})),n}if(Ra.hooks_={},Ra.hooks=function(e,t){return Ra.hooks_[e]=Ra.hooks_[e]||[],t&&(Ra.hooks_[e]=Ra.hooks_[e].concat(t)),Ra.hooks_[e]},Ra.hook=function(e,t){Ra.hooks(e,t)},Ra.hookOnce=function(e,t){Ra.hooks(e,[].concat(t).map((function(t){return function i(){return Ra.removeHook(e,i),t.apply(void 0,arguments)}})))},Ra.removeHook=function(e,t){var i=Ra.hooks(e).indexOf(t);return!(i<=-1)&&(Ra.hooks_[e]=Ra.hooks_[e].slice(),Ra.hooks_[e].splice(i,1),!0)},!0!==f().VIDEOJS_NO_DYNAMIC_STYLE&&$e()){var Ma=St(".vjs-styles-defaults");if(!Ma){Ma=Xt("vjs-styles-defaults");var Ba=St("head");Ba&&Ba.insertBefore(Ma,Ba.firstChild),Yt(Ma,"\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid {\n padding-top: 56.25%\n }\n ")}}Wt(1,Ra),Ra.VERSION=Oe,Ra.options=wa.prototype.options_,Ra.getPlayers=function(){return wa.players},Ra.getPlayer=function(e){var t,i=wa.players;if("string"==typeof e){var n=Da(e),r=i[n];if(r)return r;t=St("#"+n)}else t=e;if(Ke(t)){var a=t,s=a.player,o=a.playerId;if(s||i[o])return s||i[o]}},Ra.getAllPlayers=function(){return Object.keys(wa.players).map((function(e){return wa.players[e]})).filter(Boolean)},Ra.players=wa.players,Ra.getComponent=hi.getComponent,Ra.registerComponent=function(e,t){Cn.isTech(t)&&Be.warn("The "+e+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),hi.registerComponent.call(hi,e,t)},Ra.getTech=Cn.getTech,Ra.registerTech=Cn.registerTech,Ra.use=function(e,t){En[e]=En[e]||[],En[e].push(t)},Object.defineProperty(Ra,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(Ra.middleware,"TERMINATOR",{value:Ln,writeable:!1,enumerable:!0}),Ra.browser=Ui,Ra.TOUCH_ENABLED=xi,Ra.extend=function(e,t){void 0===t&&(t={});var i=function(){e.apply(this,arguments)},n={};for(var r in"object"==typeof t?(t.constructor!==Object.prototype.constructor&&(i=t.constructor),n=t):"function"==typeof t&&(i=t),function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.super_=t)}(i,e),n)n.hasOwnProperty(r)&&(i.prototype[r]=n[r]);return i},Ra.mergeOptions=ci,Ra.bind=$t,Ra.registerPlugin=Ia.registerPlugin,Ra.deregisterPlugin=Ia.deregisterPlugin,Ra.plugin=function(e,t){return Be.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Ia.registerPlugin(e,t)},Ra.getPlugins=Ia.getPlugins,Ra.getPlugin=Ia.getPlugin,Ra.getPluginVersion=Ia.getPluginVersion,Ra.addLanguage=function(e,t){var i;return e=(""+e).toLowerCase(),Ra.options.languages=ci(Ra.options.languages,((i={})[e]=t,i)),Ra.options.languages[e]},Ra.log=Be,Ra.createLogger=Ne,Ra.createTimeRange=Ra.createTimeRanges=Ri,Ra.formatTime=er,Ra.setFormatTime=function(e){Zn=e},Ra.resetFormatTime=function(){Zn=Jn},Ra.parseUrl=dn,Ra.isCrossOrigin=mn,Ra.EventTarget=Qt,Ra.on=Bt,Ra.one=Ft,Ra.off=Nt,Ra.trigger=jt,Ra.xhr=c(),Ra.TextTrack=vn,Ra.AudioTrack=_n,Ra.VideoTrack=bn,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach((function(e){Ra[e]=function(){return Be.warn("videojs."+e+"() is deprecated; use videojs.dom."+e+"() instead"),wt[e].apply(null,arguments)}})),Ra.computedStyle=We,Ra.dom=wt,Ra.url=gn;var Na=function(e,t){return/^[a-z]+:/i.test(t)?t:(/\/\//i.test(e)||(e=d().buildAbsoluteURL(f().location.href,e)),d().buildAbsoluteURL(e,t))},ja=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Fa=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),Va=function e(t,i,n){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,i);if(void 0===r){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,i,n)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(n):void 0},Ha=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},qa=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},za=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i=[],n=!0,r=!1,a=void 0;try{for(var s,o=e[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!t||i.length!==t);n=!0);}catch(e){r=!0,a=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw a}}return i}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},Wa=Ra.mergeOptions,Ga=Ra.EventTarget,Xa=Ra.log,Ya=function(e,t){["AUDIO","SUBTITLES"].forEach((function(i){for(var n in e.mediaGroups[i])for(var r in e.mediaGroups[i][n]){var a=e.mediaGroups[i][n][r];t(a,i,n,r)}}))},$a=function(e,t){var i=Wa(e,{}),n=i.playlists[t.uri];if(!n)return null;if(n.segments&&t.segments&&n.segments.length===t.segments.length&&n.mediaSequence===t.mediaSequence)return null;var r=Wa(n,t);n.segments&&(r.segments=function(e,t,i){var n=t.slice();i=i||0;for(var r=Math.min(e.length,t.length+i),a=i;a<r;a++)n[a-i]=Wa(e[a],n[a-i]);return n}(n.segments,t.segments,t.mediaSequence-n.mediaSequence)),r.segments.forEach((function(e){!function(e,t){e.resolvedUri||(e.resolvedUri=Na(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=Na(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=Na(t,e.map.uri))}(e,r.resolvedUri)}));for(var a=0;a<i.playlists.length;a++)i.playlists[a].uri===t.uri&&(i.playlists[a]=r);return i.playlists[t.uri]=r,i},Ka=function(e){for(var t=e.playlists.length;t--;){var i=e.playlists[t];e.playlists[i.uri]=i,i.resolvedUri=Na(e.uri,i.uri),i.id=t,i.attributes||(i.attributes={},Xa.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute."))}},Qa=function(e){Ya(e,(function(t){t.uri&&(t.resolvedUri=Na(e.uri,t.uri))}))},Ja=function(e,t){var i=e.segments[e.segments.length-1];return t&&i&&i.duration?1e3*i.duration:500*(e.targetDuration||10)},Za=function(e){function t(e,i,n){ja(this,t);var r=qa(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));if(r.srcUrl=e,r.hls_=i,r.withCredentials=n,!r.srcUrl)throw new Error("A non-empty playlist URL is required");return r.state="HAVE_NOTHING",r.on("mediaupdatetimeout",(function(){"HAVE_METADATA"===r.state&&(r.state="HAVE_CURRENT_METADATA",r.request=r.hls_.xhr({uri:Na(r.master.uri,r.media().uri),withCredentials:r.withCredentials},(function(e,t){if(r.request)return e?r.playlistRequestError(r.request,r.media().uri,"HAVE_METADATA"):void r.haveMetadata(r.request,r.media().uri)})))})),r}return Ha(t,e),Fa(t,[{key:"playlistRequestError",value:function(e,t,i){this.request=null,i&&(this.state=i),this.error={playlist:this.master.playlists[t],status:e.status,message:"HLS playlist request error at URL: "+t,responseText:e.responseText,code:e.status>=500?4:2},this.trigger("error")}},{key:"haveMetadata",value:function(e,t){var i=this;this.request=null,this.state="HAVE_METADATA";var n=new k;n.push(e.responseText),n.end(),n.manifest.uri=t,n.manifest.attributes=n.manifest.attributes||{};var r=$a(this.master,n.manifest);this.targetDuration=n.manifest.targetDuration,r?(this.master=r,this.media_=this.master.playlists[n.manifest.uri]):this.trigger("playlistunchanged"),this.media().endList||(f().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=f().setTimeout((function(){i.trigger("mediaupdatetimeout")}),Ja(this.media(),!!r))),this.trigger("loadedplaylist")}},{key:"dispose",value:function(){this.stopRequest(),f().clearTimeout(this.mediaUpdateTimeout)}},{key:"stopRequest",value:function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}},{key:"media",value:function(e){var t=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);var i=this.state;if("string"==typeof e){if(!this.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.master.playlists[e]}var n=!this.media_||e.uri!==this.media_.uri;if(this.master.playlists[e.uri].endList)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(n&&(this.trigger("mediachanging"),this.trigger("mediachange")));if(n){if(this.state="SWITCHING_MEDIA",this.request){if(Na(this.master.uri,e.uri)===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.request=this.hls_.xhr({uri:Na(this.master.uri,e.uri),withCredentials:this.withCredentials},(function(n,r){if(t.request){if(n)return t.playlistRequestError(t.request,e.uri,i);t.haveMetadata(r,e.uri),"HAVE_MASTER"===i?t.trigger("loadedmetadata"):t.trigger("mediachange")}}))}}},{key:"pause",value:function(){this.stopRequest(),f().clearTimeout(this.mediaUpdateTimeout),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")}},{key:"load",value:function(e){var t=this;f().clearTimeout(this.mediaUpdateTimeout);var i=this.media();if(e){var n=i?i.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=f().setTimeout((function(){return t.load()}),n)}else this.started?i&&!i.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()}},{key:"start",value:function(){var e=this;this.started=!0,this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials},(function(t,i){if(e.request){if(e.request=null,t)return e.error={status:i.status,message:"HLS playlist request error at URL: "+e.srcUrl,responseText:i.responseText,code:2},"HAVE_NOTHING"===e.state&&(e.started=!1),e.trigger("error");var n=new k;return n.push(i.responseText),n.end(),e.state="HAVE_MASTER",n.manifest.uri=e.srcUrl,n.manifest.playlists?(e.master=n.manifest,Ka(e.master),Qa(e.master),e.trigger("loadedplaylist"),void(e.request||e.media(n.manifest.playlists[0]))):(e.master={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:f().location.href,playlists:[{uri:e.srcUrl,id:0}]},e.master.playlists[e.srcUrl]=e.master.playlists[0],e.master.playlists[0].resolvedUri=e.srcUrl,e.master.playlists[0].attributes=e.master.playlists[0].attributes||{},e.haveMetadata(i,e.srcUrl),e.trigger("loadedmetadata"))}}))}}]),t}(Ga),es=Ra.createTimeRange,ts=function(e,t,i){var n,r;return void 0===t&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence?0:(n=function(e,t){var i=0,n=t-e.mediaSequence,r=e.segments[n];if(r){if(void 0!==r.start)return{result:r.start,precise:!0};if(void 0!==r.end)return{result:r.end-r.duration,precise:!0}}for(;n--;){if(void 0!==(r=e.segments[n]).end)return{result:i+r.end,precise:!0};if(i+=r.duration,void 0!==r.start)return{result:i+r.start,precise:!0}}return{result:i,precise:!1}}(e,t)).precise?n.result:(r=function(e,t){for(var i=0,n=void 0,r=t-e.mediaSequence;r<e.segments.length;r++){if(void 0!==(n=e.segments[r]).start)return{result:n.start-i,precise:!0};if(i+=n.duration,void 0!==n.end)return{result:n.end-i,precise:!0}}return{result:-1,precise:!1}}(e,t)).precise?r.result:n.result+i},is=function(e,t,i){if(!e)return 0;if("number"!=typeof i&&(i=0),void 0===t){if(e.totalDuration)return e.totalDuration;if(!e.endList)return f()[1/0]}return ts(e,t,i)},ns=function(e,t,i){var n=0;if(t>i){var r=[i,t];t=r[0],i=r[1]}if(t<0){for(var a=t;a<Math.min(0,i);a++)n+=e.targetDuration;t=0}for(var s=t;s<i;s++)n+=e.segments[s].duration;return n},rs=function(e){if(!e.segments.length)return 0;for(var t=e.segments.length-1,i=e.segments[t].duration||e.targetDuration,n=i+2*e.targetDuration;t--&&!((i+=e.segments[t].duration)>=n););return Math.max(0,t)},as=function(e,t,i){if(!e||!e.segments)return null;if(e.endList)return is(e);if(null===t)return null;t=t||0;var n=i?rs(e):e.segments.length;return ts(e,e.mediaSequence+n,t)},ss=function(e){return e-Math.floor(e)==0},os=function(e,t){if(ss(t))return t+.1*e;for(var i=t.toString().split(".")[1].length,n=1;n<=i;n++){var r=Math.pow(10,n),a=t*r;if(ss(a)||n===i)return(a+e)/r}},us=os.bind(null,1),ls=os.bind(null,-1),cs=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},hs=function(e){return e.excludeUntil&&e.excludeUntil===1/0},ds=function(e){var t=cs(e);return!e.disabled&&!t},ps=function(e,t){return t.attributes&&t.attributes[e]},fs=function(e,t){if(1===e.playlists.length)return!0;var i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter((function(e){return!!ds(e)&&(e.attributes.BANDWIDTH||0)<i})).length},ms={duration:is,seekable:function(e,t){var i=t||0,n=as(e,t,!0);return null===n?es():es(i,n)},safeLiveIndex:rs,getMediaInfoForTime:function(e,t,i,n){var r=void 0,a=void 0,s=e.segments.length,o=t-n;if(o<0){if(i>0)for(r=i-1;r>=0;r--)if(a=e.segments[r],(o+=ls(a.duration))>0)return{mediaIndex:r,startTime:n-ns(e,i,r)};return{mediaIndex:0,startTime:t}}if(i<0){for(r=i;r<0;r++)if((o-=e.targetDuration)<0)return{mediaIndex:0,startTime:t};i=0}for(r=i;r<s;r++)if(a=e.segments[r],(o-=us(a.duration))<0)return{mediaIndex:r,startTime:n+ns(e,i,r)};return{mediaIndex:s-1,startTime:t}},isEnabled:ds,isDisabled:function(e){return e.disabled},isBlacklisted:cs,isIncompatible:hs,playlistEnd:as,isAes:function(e){for(var t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},isFmp4:function(e){for(var t=0;t<e.segments.length;t++)if(e.segments[t].map)return!0;return!1},hasAttribute:ps,estimateSegmentRequestTime:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(!ps("BANDWIDTH",i))return NaN;var r=e*i.attributes.BANDWIDTH;return(r-8*n)/t},isLowestEnabledRendition:fs},gs=Ra.xhr,ys=Ra.mergeOptions,vs=function(){return function e(t,i){t=ys({timeout:45e3},t);var n=e.beforeRequest||Ra.Hls.xhr.beforeRequest;if(n&&"function"==typeof n){var r=n(t);r&&(t=r)}var a=gs(t,(function(e,t){var n=a.response;!e&&n&&(a.responseTime=Date.now(),a.roundTripTime=a.responseTime-a.requestTime,a.bytesReceived=n.byteLength||n.length,a.bandwidth||(a.bandwidth=Math.floor(a.bytesReceived/a.roundTripTime*8*1e3))),t.headers&&(a.responseHeaders=t.headers),e&&"ETIMEDOUT"===e.code&&(a.timedout=!0),e||a.aborted||200===t.statusCode||206===t.statusCode||0===t.statusCode||(e=new Error("XHR Failed with a response of: "+(a&&(n||a.responseText)))),i(e,a)})),s=a.abort;return a.abort=function(){return a.aborted=!0,s.apply(a,arguments)},a.uri=t.uri,a.requestTime=Date.now(),a}},_s=function(e,t){return e.start(t)+"-"+e.end(t)},bs=function(e,t){var i=e.toString(16);return"00".substring(0,2-i.length)+i+(t%2?" ":"")},Ts=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},Ss=function(e){var t={};return Object.keys(e).forEach((function(i){var n=e[i];ArrayBuffer.isView(n)?t[i]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:t[i]=n})),t},ks=function(e){var t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},ws=function(e){for(var t=Array.prototype.slice.call(e),i=16,n="",r=0;r<t.length/i;r++)n+=t.slice(r*i,r*i+i).map(bs).join("")+" "+t.slice(r*i,r*i+i).map(Ts).join("")+"\n";return n},Cs=Object.freeze({createTransferableMessage:Ss,initSegmentId:ks,hexDump:ws,tagDump:function(e){var t=e.bytes;return ws(t)},textRanges:function(e){var t="",i=void 0;for(i=0;i<e.length;i++)t+=_s(e,i)+" ";return t}}),Es=function(e,t,i,n){var r=void 0;if("stream"===t){r=new Date(1e3*n+i.getTime());var a=e.toISOString(),s=i.toISOString(),o=r.toISOString();return s<=a&&a<=o}if("player"===t)return r=n+i,i<=e&&e<=r},As=function(e,t,i){if(!i.segments||0===i.segments.length)return null;if("player"!==t&&"stream"!==t)return null;for(var n=0,r=0;r<i.segments.length;r++){var a=i.segments[r],s=n+a.duration,o=void 0,u=void 0;"player"===t?(o=a.start,u=n):(o=a.dateTimeObject,u=a.dateTimeObject);var l=void 0!==a.start&&void 0!==a.end&&Es(e,t,o,a.end-a.start),c=Es(e,t,u,a.duration);if(l)return{segment:a,estimatedStart:u,type:"accurate"};if(c)return{segment:a,estimatedStart:u,type:"estimate"};n=s}return null},Ls=function(e){var t=e.playlist,i=e.time,n=void 0===i?void 0:i,r=e.callback;if(!r)throw new Error("getStreamTime: callback must be provided");if(!t||void 0===n)return r({message:"getStreamTime: playlist and time must be provided"});var a=function(e,t){return As(e,"player",t)}(n,t);if(!a)return r({message:"valid streamTime was not found"});if("estimate"===a.type)return r({message:"Accurate streamTime could not be determined. Please seek to e.seekTime and try again",seekTime:a.estimatedStart});var s={mediaSeconds:n};return a.segment.dateTimeObject&&(s.programDateTime=a.segment.dateTimeObject.toISOString()),r(null,s)},Os=function e(t){var i=t.streamTime,n=t.playlist,r=t.retryCount,a=void 0===r?2:r,s=t.seekTo,o=t.pauseAfterSeek,u=void 0===o||o,l=t.tech,c=t.callback;if(!c)throw new Error("seekToStreamTime: callback must be provided");if(void 0===i||!n||!s)return c({message:"seekToStreamTime: streamTime, seekTo and playlist must be provided"});if(!n.endList&&!l.hasStarted_)return c({message:"player must be playing a live stream to start buffering"});if(!function(e){if(!e.segments||0===e.segments.length)return!1;for(var t=0;t<e.segments.length;t++)if(!e.segments[t].dateTimeObject)return!1;return!0}(n))return c({message:"programDateTime tags must be provided in the manifest "+n.resolvedUri});var h=function(e,t){var i=void 0;try{i=new Date(e)}catch(e){return null}return As(i,"stream",t)}(i,n);if(!h)return c({message:i+" was not found in the stream"});if("estimate"===h.type)return 0===a?c({message:i+" is not buffered yet. Try again"}):e({streamTime:i,playlist:n,retryCount:a-1,seekTo:s,pauseAfterSeek:u,tech:l,callback:c});var d=h.segment,p=function(e,t){var i=void 0,n=void 0;try{i=new Date(e),n=new Date(t)}catch(e){}var r=i.getTime();return(n.getTime()-r)/1e3}(d.dateTimeObject,i),f=d.start+p;l.one("seeked",(function(){return c(null,l.currentTime())})),u&&l.pause(),s(f)},Ps=1/30,xs=.1,Us=function(e,t){var i=[],n=void 0;if(e&&e.length)for(n=0;n<e.length;n++)t(e.start(n),e.end(n))&&i.push([e.start(n),e.end(n)]);return Ra.createTimeRanges(i)},Is=function(e,t){return Us(e,(function(e,i){return e-Ps<=t&&i+Ps>=t}))},Ds=function(e,t){return Us(e,(function(e){return e-Ps>=t}))},Rs=function(e){var t=[];if(!e||!e.length)return"";for(var i=0;i<e.length;i++)t.push(e.start(i)+" => "+e.end(i));return t.join(", ")},Ms=function(e){for(var t=[],i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t},Bs=function(e,t,i){var n=void 0,r=void 0;if(i&&i.cues)for(n=i.cues.length;n--;)(r=i.cues[n]).startTime<=t&&r.endTime>=e&&i.removeCue(r)},Ns=function(e){return isNaN(e)||Math.abs(e)===1/0?Number.MAX_VALUE:e},js=function(e,t,i){var n=f().WebKitDataCue||f().VTTCue;if(t&&t.forEach((function(e){var t=e.stream;this.inbandTextTracks_[t].addCue(new n(e.startTime+this.timestampOffset,e.endTime+this.timestampOffset,e.text))}),e),i){var r=Ns(e.mediaSource_.duration);if(i.forEach((function(e){var t=e.cueTime+this.timestampOffset;e.frames.forEach((function(e){var i=new n(t,t,e.value||e.url||e.data||"");i.frame=e,i.value=e,function(e){Object.defineProperties(e.frame,{id:{get:function(){return Ra.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key}},value:{get:function(){return Ra.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data}},privateData:{get:function(){return Ra.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data}}})}(i),this.metadataTrack_.addCue(i)}),this)}),e),e.metadataTrack_&&e.metadataTrack_.cues&&e.metadataTrack_.cues.length){for(var a=e.metadataTrack_.cues,s=[],o=0;o<a.length;o++)a[o]&&s.push(a[o]);var u=s.reduce((function(e,t){var i=e[t.startTime]||[];return i.push(t),e[t.startTime]=i,e}),{}),l=Object.keys(u).sort((function(e,t){return Number(e)-Number(t)}));l.forEach((function(e,t){var i=u[e],n=Number(l[t+1])||r;i.forEach((function(e){e.endTime=n}))}))}}},Fs="undefined"!=typeof window?window:{},Vs="undefined"==typeof Symbol?"__target":Symbol(),Hs=Fs.BlobBuilder||Fs.WebKitBlobBuilder||Fs.MozBlobBuilder||Fs.MSBlobBuilder,qs=Fs.URL||Fs.webkitURL||qs&&qs.msURL,zs=Fs.Worker;function Ws(e,t){return function(i){var n=this;if(!t)return new zs(e);if(zs&&!i){var r=$s(t.toString().replace(/^function.+?{/,"").slice(0,-1));return this[Vs]=new zs(r),function(e,t){if(!e||!t)return;var i=e.terminate;e.objURL=t,e.terminate=function(){e.objURL&&qs.revokeObjectURL(e.objURL),i.call(e)}}(this[Vs],r),this[Vs]}var a={postMessage:function(e){n.onmessage&&setTimeout((function(){n.onmessage({data:e,target:a})}))}};t.call(a),this.postMessage=function(e){setTimeout((function(){a.onmessage({data:e,target:n})}))},this.isThisThread=!0}}if(zs){var Gs,Xs=$s("self.onmessage = function () {}"),Ys=new Uint8Array(1);try{(Gs=new zs(Xs)).postMessage(Ys,[Ys.buffer])}catch(e){zs=null}finally{qs.revokeObjectURL(Xs),Gs&&Gs.terminate()}}function $s(e){try{return qs.createObjectURL(new Blob([e],{type:"application/javascript"}))}catch(i){var t=new Hs;return t.append(e),qs.createObjectURL(t.getBlob(type))}}var Ks=new Ws("./transmuxer-worker.worker.js",(function(e,t){var i=this;!function(){var e,t,n,r,a,s,o,u,l,c,h,d,p,f,m,g,y,v,_,b,T,S,k,w,C,E,A,L,O,P,x,U,I,D,R,M,B,N,j,F,V=Math.pow(2,32)-1;!function(){var e;if(S={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},"undefined"!=typeof Uint8Array){for(e in S)S.hasOwnProperty(e)&&(S[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);k=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),C=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),w=new Uint8Array([0,0,0,1]),E=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),A=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),L={video:E,audio:A},x=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),P=new Uint8Array([0,0,0,0,0,0,0,0]),U=new Uint8Array([0,0,0,0,0,0,0,0]),I=U,D=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),R=U,O=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}}(),e=function(e){var t,i,n=[],r=0;for(t=1;t<arguments.length;t++)n.push(arguments[t]);for(t=n.length;t--;)r+=n[t].byteLength;for(i=new Uint8Array(r+8),new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(0,i.byteLength),i.set(e,4),t=0,r=8;t<n.length;t++)i.set(n[t],r),r+=n[t].byteLength;return i},t=function(){return e(S.dinf,e(S.dref,x))},n=function(t){return e(S.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,t.audioobjecttype<<3|t.samplingfrequencyindex>>>1,t.samplingfrequencyindex<<7|t.channelcount<<3,6,1,2]))},m=function(t){return e(S.hdlr,L[t])},f=function(t){var i=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,t.duration>>>24&255,t.duration>>>16&255,t.duration>>>8&255,255&t.duration,85,196,0,0]);return t.samplerate&&(i[12]=t.samplerate>>>24&255,i[13]=t.samplerate>>>16&255,i[14]=t.samplerate>>>8&255,i[15]=255&t.samplerate),e(S.mdhd,i)},p=function(t){return e(S.mdia,f(t),m(t.type),s(t))},a=function(t){return e(S.mfhd,new Uint8Array([0,0,0,0,(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t]))},s=function(i){return e(S.minf,"video"===i.type?e(S.vmhd,O):e(S.smhd,P),t(),y(i))},o=function(t,i){for(var n=[],r=i.length;r--;)n[r]=_(i[r]);return e.apply(null,[S.moof,a(t)].concat(n))},u=function(t){for(var i=t.length,n=[];i--;)n[i]=h(t[i]);return e.apply(null,[S.moov,c(4294967295)].concat(n).concat(l(t)))},l=function(t){for(var i=t.length,n=[];i--;)n[i]=b(t[i]);return e.apply(null,[S.mvex].concat(n))},c=function(t){var i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return e(S.mvhd,i)},g=function(t){var i,n,r=t.samples||[],a=new Uint8Array(4+r.length);for(n=0;n<r.length;n++)i=r[n].flags,a[n+4]=i.dependsOn<<4|i.isDependedOn<<2|i.hasRedundancy;return e(S.sdtp,a)},y=function(t){return e(S.stbl,v(t),e(S.stts,R),e(S.stsc,I),e(S.stsz,D),e(S.stco,U))},v=function(t){return e(S.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===t.type?M(t):B(t))},M=function(t){var i,n=t.sps||[],r=t.pps||[],a=[],s=[];for(i=0;i<n.length;i++)a.push((65280&n[i].byteLength)>>>8),a.push(255&n[i].byteLength),a=a.concat(Array.prototype.slice.call(n[i]));for(i=0;i<r.length;i++)s.push((65280&r[i].byteLength)>>>8),s.push(255&r[i].byteLength),s=s.concat(Array.prototype.slice.call(r[i]));return e(S.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&t.width)>>8,255&t.width,(65280&t.height)>>8,255&t.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),e(S.avcC,new Uint8Array([1,t.profileIdc,t.profileCompatibility,t.levelIdc,255].concat([n.length]).concat(a).concat([r.length]).concat(s))),e(S.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])))},B=function(t){return e(S.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&t.channelcount)>>8,255&t.channelcount,(65280&t.samplesize)>>8,255&t.samplesize,0,0,0,0,(65280&t.samplerate)>>8,255&t.samplerate,0,0]),n(t))},d=function(t){var i=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&t.id)>>24,(16711680&t.id)>>16,(65280&t.id)>>8,255&t.id,0,0,0,0,(4278190080&t.duration)>>24,(16711680&t.duration)>>16,(65280&t.duration)>>8,255&t.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&t.width)>>8,255&t.width,0,0,(65280&t.height)>>8,255&t.height,0,0]);return e(S.tkhd,i)},_=function(t){var i,n,r,a,s,o;return i=e(S.tfhd,new Uint8Array([0,0,0,58,(4278190080&t.id)>>24,(16711680&t.id)>>16,(65280&t.id)>>8,255&t.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),s=Math.floor(t.baseMediaDecodeTime/(V+1)),o=Math.floor(t.baseMediaDecodeTime%(V+1)),n=e(S.tfdt,new Uint8Array([1,0,0,0,s>>>24&255,s>>>16&255,s>>>8&255,255&s,o>>>24&255,o>>>16&255,o>>>8&255,255&o])),92,"audio"===t.type?(r=T(t,92),e(S.traf,i,n,r)):(a=g(t),r=T(t,a.length+92),e(S.traf,i,n,r,a))},h=function(t){return t.duration=t.duration||4294967295,e(S.trak,d(t),p(t))},b=function(t){var i=new Uint8Array([0,0,0,0,(4278190080&t.id)>>24,(16711680&t.id)>>16,(65280&t.id)>>8,255&t.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==t.type&&(i[i.length-1]=0),e(S.trex,i)},F=function(e,t){var i=0,n=0,r=0,a=0;return e.length&&(void 0!==e[0].duration&&(i=1),void 0!==e[0].size&&(n=2),void 0!==e[0].flags&&(r=4),void 0!==e[0].compositionTimeOffset&&(a=8)),[0,0,i|n|r|a,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},j=function(t,i){var n,r,a,s;for(i+=20+16*(r=t.samples||[]).length,n=F(r,i),s=0;s<r.length;s++)a=r[s],n=n.concat([(4278190080&a.duration)>>>24,(16711680&a.duration)>>>16,(65280&a.duration)>>>8,255&a.duration,(4278190080&a.size)>>>24,(16711680&a.size)>>>16,(65280&a.size)>>>8,255&a.size,a.flags.isLeading<<2|a.flags.dependsOn,a.flags.isDependedOn<<6|a.flags.hasRedundancy<<4|a.flags.paddingValue<<1|a.flags.isNonSyncSample,61440&a.flags.degradationPriority,15&a.flags.degradationPriority,(4278190080&a.compositionTimeOffset)>>>24,(16711680&a.compositionTimeOffset)>>>16,(65280&a.compositionTimeOffset)>>>8,255&a.compositionTimeOffset]);return e(S.trun,new Uint8Array(n))},N=function(t,i){var n,r,a,s;for(i+=20+8*(r=t.samples||[]).length,n=F(r,i),s=0;s<r.length;s++)a=r[s],n=n.concat([(4278190080&a.duration)>>>24,(16711680&a.duration)>>>16,(65280&a.duration)>>>8,255&a.duration,(4278190080&a.size)>>>24,(16711680&a.size)>>>16,(65280&a.size)>>>8,255&a.size]);return e(S.trun,new Uint8Array(n))},T=function(e,t){return"audio"===e.type?N(e,t):j(e,t)};var H,q,z,W,G,X={ftyp:r=function(){return e(S.ftyp,k,w,k,C)},mdat:function(t){return e(S.mdat,t)},moof:o,moov:u,initSegment:function(e){var t,i=r(),n=u(e);return(t=new Uint8Array(i.byteLength+n.byteLength)).set(i),t.set(n,i.byteLength),t}},Y=function(e){return e>>>0};z=function(e){return H(e,["moov","trak"]).reduce((function(e,t){var i,n,r,a,s;return(i=H(t,["tkhd"])[0])?(n=i[0],a=Y(i[r=0===n?12:20]<<24|i[r+1]<<16|i[r+2]<<8|i[r+3]),(s=H(t,["mdia","mdhd"])[0])?(r=0===(n=s[0])?12:20,e[a]=Y(s[r]<<24|s[r+1]<<16|s[r+2]<<8|s[r+3]),e):null):null}),{})},W=function(e,t){var i,n,r;return i=H(t,["moof","traf"]),n=[].concat.apply([],i.map((function(t){return H(t,["tfhd"]).map((function(i){var n,r;return n=Y(i[4]<<24|i[5]<<16|i[6]<<8|i[7]),r=e[n]||9e4,(H(t,["tfdt"]).map((function(e){var t,i;return t=e[0],i=Y(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),1===t&&(i*=Math.pow(2,32),i+=Y(e[8]<<24|e[9]<<16|e[10]<<8|e[11])),i}))[0]||1/0)/r}))}))),r=Math.min.apply(null,n),isFinite(r)?r:0},G=function(e){var t=H(e,["moov","trak"]),i=[];return t.forEach((function(e){var t=H(e,["mdia","hdlr"]),n=H(e,["tkhd"]);t.forEach((function(e,t){var r,a,s=q(e.subarray(8,12)),o=n[t];"vide"===s&&(a=0===(r=new DataView(o.buffer,o.byteOffset,o.byteLength)).getUint8(0)?r.getUint32(12):r.getUint32(20),i.push(a))}))})),i};var $={findBox:H=function(e,t){var i,n,r,a,s,o=[];if(!t.length)return null;for(i=0;i<e.byteLength;)n=Y(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3]),r=q(e.subarray(i+4,i+8)),a=n>1?i+n:e.byteLength,r===t[0]&&(1===t.length?o.push(e.subarray(i+8,a)):(s=H(e.subarray(i+8,a),t.slice(1))).length&&(o=o.concat(s))),i=a;return o},parseType:q=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),t+=String.fromCharCode(e[2]),t+=String.fromCharCode(e[3])},timescale:z,startTime:W,videoTrackIds:G},K=function(){this.init=function(){var e={};this.on=function(t,i){e[t]||(e[t]=[]),e[t]=e[t].concat(i)},this.off=function(t,i){var n;return!!e[t]&&(n=e[t].indexOf(i),e[t]=e[t].slice(),e[t].splice(n,1),n>-1)},this.trigger=function(t){var i,n,r,a;if(i=e[t])if(2===arguments.length)for(r=i.length,n=0;n<r;++n)i[n].call(this,arguments[1]);else{for(a=[],n=arguments.length,n=1;n<arguments.length;++n)a.push(arguments[n]);for(r=i.length,n=0;n<r;++n)i[n].apply(this,a)}},this.dispose=function(){e={}}}};K.prototype.pipe=function(e){return this.on("data",(function(t){e.push(t)})),this.on("done",(function(t){e.flush(t)})),e},K.prototype.push=function(e){this.trigger("data",e)},K.prototype.flush=function(e){this.trigger("done",e)};var Q,J,Z,ee,te,ie,ne,re=K,ae=function(e,t){var i={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return i.dataOffset=t,i.compositionTimeOffset=e.pts-e.dts,i.duration=e.duration,i.size=4*e.length,i.size+=e.byteLength,e.keyFrame&&(i.flags.dependsOn=2,i.flags.isNonSyncSample=0),i},se=function(e){var t,i,n=[],r=[];for(n.byteLength=0,t=0;t<e.length;t++)"access_unit_delimiter_rbsp"===(i=e[t]).nalUnitType?(n.length&&(n.duration=i.dts-n.dts,r.push(n)),(n=[i]).byteLength=i.data.byteLength,n.pts=i.pts,n.dts=i.dts):("slice_layer_without_partitioning_rbsp_idr"===i.nalUnitType&&(n.keyFrame=!0),n.duration=i.dts-n.dts,n.byteLength+=i.data.byteLength,n.push(i));return r.length&&(!n.duration||n.duration<=0)&&(n.duration=r[r.length-1].duration),r.push(n),r},oe=function(e){var t,i,n=[],r=[];for(n.byteLength=0,n.nalCount=0,n.duration=0,n.pts=e[0].pts,n.dts=e[0].dts,r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=e[0].pts,r.dts=e[0].dts,t=0;t<e.length;t++)(i=e[t]).keyFrame?(n.length&&(r.push(n),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration),(n=[i]).nalCount=i.length,n.byteLength=i.byteLength,n.pts=i.pts,n.dts=i.dts,n.duration=i.duration):(n.duration+=i.duration,n.nalCount+=i.length,n.byteLength+=i.byteLength,n.push(i));return r.length&&n.duration<=0&&(n.duration=r[r.length-1].duration),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration,r.push(n),r},ue=function(e){var t;return!e[0][0].keyFrame&&e.length>1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},le=function(e,t){var i,n,r,a,s,o=t||0,u=[];for(i=0;i<e.length;i++)for(a=e[i],n=0;n<a.length;n++)s=a[n],o+=(r=ae(s,o)).size,u.push(r);return u},ce=function(e){var t,i,n,r,a,s,o=0,u=e.byteLength,l=e.nalCount,c=new Uint8Array(u+4*l),h=new DataView(c.buffer);for(t=0;t<e.length;t++)for(r=e[t],i=0;i<r.length;i++)for(a=r[i],n=0;n<a.length;n++)s=a[n],h.setUint32(o,s.data.byteLength),o+=4,c.set(s.data,o),o+=s.data.byteLength;return c},he=[33,16,5,32,164,27],de=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],pe=function(e){for(var t=[];e--;)t.push(0);return t},fe={96e3:[he,[227,64],pe(154),[56]],88200:[he,[231],pe(170),[56]],64e3:[he,[248,192],pe(240),[56]],48e3:[he,[255,192],pe(268),[55,148,128],pe(54),[112]],44100:[he,[255,192],pe(268),[55,163,128],pe(84),[112]],32e3:[he,[255,192],pe(268),[55,234],pe(226),[112]],24e3:[he,[255,192],pe(268),[55,255,128],pe(268),[111,112],pe(126),[224]],16e3:[he,[255,192],pe(268),[55,255,128],pe(268),[111,255],pe(269),[223,108],pe(195),[1,192]],12e3:[de,pe(268),[3,127,248],pe(268),[6,255,240],pe(268),[13,255,224],pe(268),[27,253,128],pe(259),[56]],11025:[de,pe(268),[3,127,248],pe(268),[6,255,240],pe(268),[13,255,224],pe(268),[27,255,192],pe(268),[55,175,128],pe(108),[112]],8e3:[de,pe(268),[3,121,16],pe(47),[7]]},me=(Q=fe,Object.keys(Q).reduce((function(e,t){return e[t]=new Uint8Array(Q[t].reduce((function(e,t){return e.concat(t)}),[])),e}),{}));ie=function(e,t){return J(te(e,t))},ne=function(e,t){return Z(ee(e),t)};J=function(e){return 9e4*e},Z=function(e,t){return e*t},ee=function(e){return e/9e4},te=function(e,t){return e/t};var ge=ie,ye=ne,ve=function(e,t,i,n){var r,a,s,o,u=0,l=0,c=0;if(t.length&&(r=ge(e.baseMediaDecodeTime,e.samplerate),a=Math.ceil(9e4/(e.samplerate/1024)),i&&n&&(u=r-Math.max(i,n),c=(l=Math.floor(u/a))*a),!(l<1||c>45e3))){for((s=me[e.samplerate])||(s=t[0].data),o=0;o<l;o++)t.splice(o,0,{data:s});e.baseMediaDecodeTime-=Math.floor(ye(c,e.samplerate))}},_e=function(e,t,i){return t.minSegmentDts>=i?e:(t.minSegmentDts=1/0,e.filter((function(e){return e.dts>=i&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)})))},be=function(e){var t,i,n=[];for(t=0;t<e.length;t++)i=e[t],n.push({size:i.data.byteLength,duration:1024});return n},Te=function(e){var t,i,n=0,r=new Uint8Array(function(e){var t,i=0;for(t=0;t<e.length;t++)i+=e[t].data.byteLength;return i}(e));for(t=0;t<e.length;t++)i=e[t],r.set(i.data,n),n+=i.data.byteLength;return r},Se=function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},ke=function(e,t){var i,n=e.minSegmentDts;return t||(n-=e.timelineStartInfo.dts),i=e.timelineStartInfo.baseMediaDecodeTime,i+=n,i=Math.max(0,i),"audio"===e.type&&(i*=e.samplerate/9e4,i=Math.floor(i)),i},we=function(e,t){"number"==typeof t.pts&&(void 0===e.timelineStartInfo.pts&&(e.timelineStartInfo.pts=t.pts),void 0===e.minSegmentPts?e.minSegmentPts=t.pts:e.minSegmentPts=Math.min(e.minSegmentPts,t.pts),void 0===e.maxSegmentPts?e.maxSegmentPts=t.pts:e.maxSegmentPts=Math.max(e.maxSegmentPts,t.pts)),"number"==typeof t.dts&&(void 0===e.timelineStartInfo.dts&&(e.timelineStartInfo.dts=t.dts),void 0===e.minSegmentDts?e.minSegmentDts=t.dts:e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),void 0===e.maxSegmentDts?e.maxSegmentDts=t.dts:e.maxSegmentDts=Math.max(e.maxSegmentDts,t.dts))},Ce=function(e){for(var t=0,i={payloadType:-1,payloadSize:0},n=0,r=0;t<e.byteLength&&128!==e[t];){for(;255===e[t];)n+=255,t++;for(n+=e[t++];255===e[t];)r+=255,t++;if(r+=e[t++],!i.payload&&4===n){i.payloadType=n,i.payloadSize=r,i.payload=e.subarray(t,t+r);break}t+=r,n=0,r=0}return i},Ee=function(e){return 181!==e.payload[0]||49!=(e.payload[1]<<8|e.payload[2])||"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])||3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)},Ae=function(e,t){var i,n,r,a,s=[];if(!(64&t[0]))return s;for(n=31&t[0],i=0;i<n;i++)a={type:3&t[(r=3*i)+2],pts:e},4&t[r+2]&&(a.ccData=t[r+3]<<8|t[r+4],s.push(a));return s},Oe=function(e){for(var t,i,n=e.byteLength,r=[],a=1;a<n-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(r.push(a+2),a+=2):a++;if(0===r.length)return e;t=n-r.length,i=new Uint8Array(t);var s=0;for(a=0;a<t;s++,a++)s===r[0]&&(s++,r.shift()),i[a]=e[s];return i},Pe=4,xe=function e(){e.prototype.init.call(this),this.captionPackets_=[],this.ccStreams_=[new Me(0,0),new Me(0,1),new Me(1,0),new Me(1,1)],this.reset(),this.ccStreams_.forEach((function(e){e.on("data",this.trigger.bind(this,"data")),e.on("done",this.trigger.bind(this,"done"))}),this)};(xe.prototype=new re).push=function(e){var t,i,n;if("sei_rbsp"===e.nalUnitType&&(t=Ce(e.escapedRBSP)).payloadType===Pe&&(i=Ee(t)))if(e.dts<this.latestDts_)this.ignoreNextEqualDts_=!0;else{if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));n=Ae(e.pts,i),this.captionPackets_=this.captionPackets_.concat(n),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts}},xe.prototype.flush=function(){this.captionPackets_.length?(this.captionPackets_.forEach((function(e,t){e.presortIndex=t})),this.captionPackets_.sort((function(e,t){return e.pts===t.pts?e.presortIndex-t.presortIndex:e.pts-t.pts})),this.captionPackets_.forEach((function(e){e.type<2&&this.dispatchCea608Packet(e)}),this),this.captionPackets_.length=0,this.ccStreams_.forEach((function(e){e.flush()}),this)):this.ccStreams_.forEach((function(e){e.flush()}),this)},xe.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach((function(e){e.reset()}))},xe.prototype.dispatchCea608Packet=function(e){this.setsChannel1Active(e)?this.activeCea608Channel_[e.type]=0:this.setsChannel2Active(e)&&(this.activeCea608Channel_[e.type]=1),null!==this.activeCea608Channel_[e.type]&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},xe.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)},xe.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)};var Ue={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},Ie=function(e){return null===e?"":(e=Ue[e]||e,String.fromCharCode(e))},De=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Re=function(){for(var e=[],t=15;t--;)e.push("");return e},Me=function e(t,i){e.prototype.init.call(this),this.field_=t||0,this.dataChannel_=i||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,i,n,r,a;if((t=32639&e.ccData)!==this.lastControlCode_){if(4096==(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),n=t>>>8,r=255&t,t!==this.PADDING_)if(t===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(t===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),i=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=i,this.startPts_=e.pts;else if(t===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(t===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);else if(t===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(t===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(t===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=Re();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Re();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=Re()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(n,r))a=Ie((n=(3&n)<<8)|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isExtCharacter(n,r))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),a=Ie((n=(3&n)<<8)|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isMidRowCode(n,r))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14==(14&r)&&this.addFormatting(e.pts,["i"]),1==(1&r)&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(n,r))this.column_+=3&r;else if(this.isPAC(n,r)){var s=De.indexOf(7968&t);"rollUp"===this.mode_&&(s-this.rollUpRows_+1<0&&(s=this.rollUpRows_-1),this.setRollUp(e.pts,s)),s!==this.row_&&(this.clearFormatting(e.pts),this.row_=s),1&r&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16==(16&t)&&(this.column_=4*((14&t)>>1)),this.isColorPAC(r)&&14==(14&r)&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(n)&&(0===r&&(r=null),a=Ie(n),a+=Ie(r),this[this.mode_](e.pts,a),this.column_+=a.length)}else this.lastControlCode_=null}};Me.prototype=new re,Me.prototype.flushDisplayed=function(e){var t=this.displayed_.map((function(e){try{return e.trim()}catch(e){return Le.error("Skipping malformed caption."),""}})).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})},Me.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Re(),this.nonDisplayed_=Re(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},Me.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},Me.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},Me.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},Me.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},Me.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},Me.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127},Me.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},Me.prototype.isNormalChar=function(e){return e>=32&&e<=127},Me.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=Re(),this.displayed_=Re()),void 0!==t&&t!==this.row_)for(var i=0;i<this.rollUpRows_;i++)this.displayed_[t-i]=this.displayed_[this.row_-i],this.displayed_[this.row_-i]="";void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},Me.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);var i=t.reduce((function(e,t){return e+"<"+t+">"}),"");this[this.mode_](e,i)},Me.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce((function(e,t){return e+"</"+t+">"}),"");this.formatting_=[],this[this.mode_](e,t)}},Me.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_];i+=t,this.nonDisplayed_[this.row_]=i},Me.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_];i+=t,this.displayed_[this.row_]=i},Me.prototype.shiftRowsUp_=function(){var e;for(e=0;e<this.topRow_;e++)this.displayed_[e]="";for(e=this.row_+1;e<15;e++)this.displayed_[e]="";for(e=this.topRow_;e<this.row_;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[this.row_]=""},Me.prototype.paintOn=function(e,t){var i=this.displayed_[this.row_];i+=t,this.displayed_[this.row_]=i};var Be={CaptionStream:xe,Cea608Stream:Me},Ne={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},je=function(e,t){var i=1;for(e>t&&(i=-1);Math.abs(t-e)>4294967296;)e+=8589934592*i;return e},Fe=function e(t){var i,n;e.prototype.init.call(this),this.type_=t,this.push=function(e){e.type===this.type_&&(void 0===n&&(n=e.dts),e.dts=je(e.dts,n),e.pts=je(e.pts,n),i=e.dts,this.trigger("data",e))},this.flush=function(){n=i,this.trigger("done")},this.discontinuity=function(){n=void 0,i=void 0}};Fe.prototype=new re;var Ve,He=Fe,qe=function(e,t,i){var n,r="";for(n=t;n<i;n++)r+="%"+("00"+e[n].toString(16)).slice(-2);return r},ze=function(e,t,i){return decodeURIComponent(qe(e,t,i))},We=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},Ge={TXXX:function(e){var t;if(3===e.data[0]){for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=ze(e.data,1,t),e.value=ze(e.data,t+1,e.data.length).replace(/\0*$/,"");break}e.data=e.value}},WXXX:function(e){var t;if(3===e.data[0])for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=ze(e.data,1,t),e.url=ze(e.data,t+1,e.data.length);break}},PRIV:function(e){var t,i;for(t=0;t<e.data.length;t++)if(0===e.data[t]){e.owner=(i=e.data,unescape(qe(i,0,t)));break}e.privateData=e.data.subarray(t+1),e.data=e.privateData}};(Ve=function(e){var t,i={debug:!(!e||!e.debug),descriptor:e&&e.descriptor},n=0,r=[],a=0;if(Ve.prototype.init.call(this),this.dispatchType=Ne.METADATA_STREAM_TYPE.toString(16),i.descriptor)for(t=0;t<i.descriptor.length;t++)this.dispatchType+=("00"+i.descriptor[t].toString(16)).slice(-2);this.push=function(e){var t,s,o,u,l;if("timed-metadata"===e.type)if(e.dataAlignmentIndicator&&(a=0,r.length=0),0===r.length&&(e.data.length<10||e.data[0]!=="I".charCodeAt(0)||e.data[1]!=="D".charCodeAt(0)||e.data[2]!=="3".charCodeAt(0)))i.debug&&Le.log("Skipping unrecognized metadata packet");else if(r.push(e),a+=e.data.byteLength,1===r.length&&(n=We(e.data.subarray(6,10)),n+=10),!(a<n)){for(t={data:new Uint8Array(n),frames:[],pts:r[0].pts,dts:r[0].dts},l=0;l<n;)t.data.set(r[0].data.subarray(0,n-l),l),l+=r[0].data.byteLength,a-=r[0].data.byteLength,r.shift();s=10,64&t.data[5]&&(s+=4,s+=We(t.data.subarray(10,14)),n-=We(t.data.subarray(16,20)));do{if((o=We(t.data.subarray(s+4,s+8)))<1)return Le.log("Malformed ID3 frame encountered. Skipping metadata parsing.");if((u={id:String.fromCharCode(t.data[s],t.data[s+1],t.data[s+2],t.data[s+3]),data:t.data.subarray(s+10,s+o+10)}).key=u.id,Ge[u.id]&&(Ge[u.id](u),"com.apple.streaming.transportStreamTimestamp"===u.owner)){var c=u.data,h=(1&c[3])<<30|c[4]<<22|c[5]<<14|c[6]<<6|c[7]>>>2;h*=4,h+=3&c[7],u.timeStamp=h,void 0===t.pts&&void 0===t.dts&&(t.pts=u.timeStamp,t.dts=u.timeStamp),this.trigger("timestamp",u)}t.frames.push(u),s+=10,s+=o}while(s<n);this.trigger("data",t)}}}).prototype=new re;var Xe,Ye,$e,Ke=Ve,Qe=He,Je=188;(Xe=function(){var e=new Uint8Array(Je),t=0;Xe.prototype.init.call(this),this.push=function(i){var n,r=0,a=Je;for(t?((n=new Uint8Array(i.byteLength+t)).set(e.subarray(0,t)),n.set(i,t),t=0):n=i;a<n.byteLength;)71!==n[r]||71!==n[a]?(r++,a++):(this.trigger("data",n.subarray(r,a)),r+=Je,a+=Je);r<n.byteLength&&(e.set(n.subarray(r),0),t=n.byteLength-r)},this.flush=function(){t===Je&&71===e[0]&&(this.trigger("data",e),t=0),this.trigger("done")}}).prototype=new re,(Ye=function(){var e,t,i,n;Ye.prototype.init.call(this),n=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,n){var r=0;n.payloadUnitStartIndicator&&(r+=e[r]+1),"pat"===n.type?t(e.subarray(r),n):i(e.subarray(r),n)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],n.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=n.pmtPid},i=function(e,t){var i,r;if(1&e[5]){for(n.programMapTable={video:null,audio:null,"timed-metadata":{}},i=3+((15&e[1])<<8|e[2])-4,r=12+((15&e[10])<<8|e[11]);r<i;){var a=e[r],s=(31&e[r+1])<<8|e[r+2];a===Ne.H264_STREAM_TYPE&&null===n.programMapTable.video?n.programMapTable.video=s:a===Ne.ADTS_STREAM_TYPE&&null===n.programMapTable.audio?n.programMapTable.audio=s:a===Ne.METADATA_STREAM_TYPE&&(n.programMapTable["timed-metadata"][s]=a),r+=5+((15&e[r+3])<<8|e[r+4])}t.programMapTable=n.programMapTable}},this.push=function(t){var i={},n=4;if(i.payloadUnitStartIndicator=!!(64&t[1]),i.pid=31&t[1],i.pid<<=8,i.pid|=t[2],(48&t[3])>>>4>1&&(n+=t[n]+1),0===i.pid)i.type="pat",e(t.subarray(n),i),this.trigger("data",i);else if(i.pid===this.pmtPid)for(i.type="pmt",e(t.subarray(n),i),this.trigger("data",i);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,n,i]):this.processPes_(t,n,i)},this.processPes_=function(e,t,i){i.pid===this.programMapTable.video?i.streamType=Ne.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=Ne.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=e.subarray(t),this.trigger("data",i)}}).prototype=new re,Ye.STREAM_TYPES={h264:27,adts:15},($e=function(){var e=this,t={data:[],size:0},i={data:[],size:0},n={data:[],size:0},r=function(t,i,n){var r,a,s=new Uint8Array(t.size),o={type:i},u=0,l=0;if(t.data.length&&!(t.size<9)){for(o.trackId=t.data[0].pid,u=0;u<t.data.length;u++)a=t.data[u],s.set(a.data,l),l+=a.data.byteLength;var c,h,d;c=s,(h=o).packetLength=6+(c[4]<<8|c[5]),h.dataAlignmentIndicator=0!=(4&c[6]),192&(d=c[7])&&(h.pts=(14&c[9])<<27|(255&c[10])<<20|(254&c[11])<<12|(255&c[12])<<5|(254&c[13])>>>3,h.pts*=4,h.pts+=(6&c[13])>>>1,h.dts=h.pts,64&d&&(h.dts=(14&c[14])<<27|(255&c[15])<<20|(254&c[16])<<12|(255&c[17])<<5|(254&c[18])>>>3,h.dts*=4,h.dts+=(6&c[18])>>>1)),h.data=c.subarray(9+c[8]),r="video"===i||o.packetLength<=t.size,(n||r)&&(t.size=0,t.data.length=0),r&&e.trigger("data",o)}};$e.prototype.init.call(this),this.push=function(a){({pat:function(){},pes:function(){var e,s;switch(a.streamType){case Ne.H264_STREAM_TYPE:case Ne.H264_STREAM_TYPE:e=t,s="video";break;case Ne.ADTS_STREAM_TYPE:e=i,s="audio";break;case Ne.METADATA_STREAM_TYPE:e=n,s="timed-metadata";break;default:return}a.payloadUnitStartIndicator&&r(e,s,!0),e.data.push(a),e.size+=a.data.byteLength},pmt:function(){var t={type:"metadata",tracks:[]},i=a.programMapTable;null!==i.video&&t.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+i.video,codec:"avc",type:"video"}),null!==i.audio&&t.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+i.audio,codec:"adts",type:"audio"}),e.trigger("data",t)}})[a.type]()},this.flush=function(){r(t,"video"),r(i,"audio"),r(n,"timed-metadata"),this.trigger("done")}}).prototype=new re;var Ze={PAT_PID:0,MP2T_PACKET_LENGTH:Je,TransportPacketStream:Xe,TransportParseStream:Ye,ElementaryStream:$e,TimestampRolloverStream:Qe,CaptionStream:Be.CaptionStream,Cea608Stream:Be.Cea608Stream,MetadataStream:Ke};for(var et in Ne)Ne.hasOwnProperty(et)&&(Ze[et]=Ne[et]);var tt,it=Ze,nt=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];(tt=function(){var e;tt.prototype.init.call(this),this.push=function(t){var i,n,r,a,s,o,u=0,l=0;if("audio"===t.type)for(e?(a=e,(e=new Uint8Array(a.byteLength+t.data.byteLength)).set(a),e.set(t.data,a.byteLength)):e=t.data;u+5<e.length;)if(255===e[u]&&240==(246&e[u+1])){if(n=2*(1&~e[u+1]),i=(3&e[u+3])<<11|e[u+4]<<3|(224&e[u+5])>>5,o=9e4*(s=1024*(1+(3&e[u+6])))/nt[(60&e[u+2])>>>2],r=u+i,e.byteLength<r)return;if(this.trigger("data",{pts:t.pts+l*o,dts:t.dts+l*o,sampleCount:s,audioobjecttype:1+(e[u+2]>>>6&3),channelcount:(1&e[u+2])<<2|(192&e[u+3])>>>6,samplerate:nt[(60&e[u+2])>>>2],samplingfrequencyindex:(60&e[u+2])>>>2,samplesize:16,data:e.subarray(u+7+n,r)}),e.byteLength===r)return void(e=void 0);l++,e=e.subarray(r)}else u++},this.flush=function(){this.trigger("done")}}).prototype=new re;var rt,at,st,ot=tt,ut=function(e){var t=e.byteLength,i=0,n=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+n},this.loadWord=function(){var r=e.byteLength-t,a=new Uint8Array(4),s=Math.min(4,t);if(0===s)throw new Error("no bytes available");a.set(e.subarray(r,r+s)),i=new DataView(a.buffer).getUint32(0),n=8*s,t-=s},this.skipBits=function(e){var r;n>e?(i<<=e,n-=e):(e-=n,e-=8*(r=Math.floor(e/8)),t-=r,this.loadWord(),i<<=e,n-=e)},this.readBits=function(e){var r=Math.min(n,e),a=i>>>32-r;return(n-=r)>0?i<<=r:t>0&&this.loadWord(),(r=e-r)>0?a<<r|this.readBits(r):a},this.skipLeadingZeros=function(){var e;for(e=0;e<n;++e)if(0!=(i&2147483648>>>e))return i<<=e,n-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};(at=function(){var e,t,i=0;at.prototype.init.call(this),this.push=function(n){var r;for(t?((r=new Uint8Array(t.byteLength+n.data.byteLength)).set(t),r.set(n.data,t.byteLength),t=r):t=n.data;i<t.byteLength-3;i++)if(1===t[i+2]){e=i+5;break}for(;e<t.byteLength;)switch(t[e]){case 0:if(0!==t[e-1]){e+=2;break}if(0!==t[e-2]){e++;break}i+3!==e-2&&this.trigger("data",t.subarray(i+3,e-2));do{e++}while(1!==t[e]&&e<t.length);i=e-2,e+=3;break;case 1:if(0!==t[e-1]||0!==t[e-2]){e+=3;break}this.trigger("data",t.subarray(i+3,e-2)),i=e-2,e+=3;break;default:e+=3}t=t.subarray(i),e-=i,i=0},this.flush=function(){t&&t.byteLength>3&&this.trigger("data",t.subarray(i+3)),t=null,i=0,this.trigger("done")}}).prototype=new re,st={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},(rt=function(){var e,t,i,n,r,a,s,o=new at;rt.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,i=e.pts,n=e.dts,o.push(e))},o.on("data",(function(s){var o={trackId:t,pts:i,dts:n,data:s};switch(31&s[0]){case 5:o.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:o.nalUnitType="sei_rbsp",o.escapedRBSP=r(s.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp",o.escapedRBSP=r(s.subarray(1)),o.config=a(o.escapedRBSP);break;case 8:o.nalUnitType="pic_parameter_set_rbsp";break;case 9:o.nalUnitType="access_unit_delimiter_rbsp"}e.trigger("data",o)})),o.on("done",(function(){e.trigger("done")})),this.flush=function(){o.flush()},s=function(e,t){var i,n=8,r=8;for(i=0;i<e;i++)0!==r&&(r=(n+t.readExpGolomb()+256)%256),n=0===r?n:r},r=function(e){for(var t,i,n=e.byteLength,r=[],a=1;a<n-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(r.push(a+2),a+=2):a++;if(0===r.length)return e;t=n-r.length,i=new Uint8Array(t);var s=0;for(a=0;a<t;s++,a++)s===r[0]&&(s++,r.shift()),i[a]=e[s];return i},a=function(e){var t,i,n,r,a,o,u,l,c,h,d,p,f,m=0,g=0,y=0,v=0,_=1;if(i=(t=new ut(e)).readUnsignedByte(),r=t.readUnsignedByte(),n=t.readUnsignedByte(),t.skipUnsignedExpGolomb(),st[i]&&(3===(a=t.readUnsignedExpGolomb())&&t.skipBits(1),t.skipUnsignedExpGolomb(),t.skipUnsignedExpGolomb(),t.skipBits(1),t.readBoolean()))for(d=3!==a?8:12,f=0;f<d;f++)t.readBoolean()&&s(f<6?16:64,t);if(t.skipUnsignedExpGolomb(),0===(o=t.readUnsignedExpGolomb()))t.readUnsignedExpGolomb();else if(1===o)for(t.skipBits(1),t.skipExpGolomb(),t.skipExpGolomb(),u=t.readUnsignedExpGolomb(),f=0;f<u;f++)t.skipExpGolomb();if(t.skipUnsignedExpGolomb(),t.skipBits(1),l=t.readUnsignedExpGolomb(),c=t.readUnsignedExpGolomb(),0===(h=t.readBits(1))&&t.skipBits(1),t.skipBits(1),t.readBoolean()&&(m=t.readUnsignedExpGolomb(),g=t.readUnsignedExpGolomb(),y=t.readUnsignedExpGolomb(),v=t.readUnsignedExpGolomb()),t.readBoolean()&&t.readBoolean()){switch(t.readUnsignedByte()){case 1:p=[1,1];break;case 2:p=[12,11];break;case 3:p=[10,11];break;case 4:p=[16,11];break;case 5:p=[40,33];break;case 6:p=[24,11];break;case 7:p=[20,11];break;case 8:p=[32,11];break;case 9:p=[80,33];break;case 10:p=[18,11];break;case 11:p=[15,11];break;case 12:p=[64,33];break;case 13:p=[160,99];break;case 14:p=[4,3];break;case 15:p=[3,2];break;case 16:p=[2,1];break;case 255:p=[t.readUnsignedByte()<<8|t.readUnsignedByte(),t.readUnsignedByte()<<8|t.readUnsignedByte()]}p&&(_=p[0]/p[1])}return{profileIdc:i,levelIdc:n,profileCompatibility:r,width:Math.ceil((16*(l+1)-2*m-2*g)*_),height:(2-h)*(c+1)*16-2*y-2*v}}}).prototype=new re;var lt,ct={H264Stream:rt,NalByteStream:at},ht=function(e){return e[0]==="I".charCodeAt(0)&&e[1]==="D".charCodeAt(0)&&e[2]==="3".charCodeAt(0)},dt=function(e,t){var i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(16&e[t+5])>>4?i+20:i+10},pt=function(e,t){var i=(224&e[t+5])>>5,n=e[t+4]<<3;return 6144&e[t+3]|n|i};(lt=function(){var e=new Uint8Array,t=0;lt.prototype.init.call(this),this.setTimestamp=function(e){t=e},this.push=function(i){var n,r,a,s,o=0,u=0;for(e.length?(s=e.length,(e=new Uint8Array(i.byteLength+s)).set(e.subarray(0,s)),e.set(i,s)):e=i;e.length-u>=3;)if(e[u]!=="I".charCodeAt(0)||e[u+1]!=="D".charCodeAt(0)||e[u+2]!=="3".charCodeAt(0))if(255!=(255&e[u])||240!=(240&e[u+1]))u++;else{if(e.length-u<7)break;if(u+(o=pt(e,u))>e.length)break;a={type:"audio",data:e.subarray(u,u+o),pts:t,dts:t},this.trigger("data",a),u+=o}else{if(e.length-u<10)break;if(u+(o=dt(e,u))>e.length)break;r={type:"timed-metadata",data:e.subarray(u,u+o)},this.trigger("data",r),u+=o}n=e.length-u,e=n>0?e.subarray(u):new Uint8Array}}).prototype=new re;var ft,mt,gt,yt,vt=lt,_t=ct.H264Stream,bt=ht,Tt=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],St=["width","height","profileIdc","levelIdc","profileCompatibility"],kt=function(e,t){var i;if(e.length!==t.length)return!1;for(i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0};(mt=function(e,t){var i=[],n=0,r=0,a=0,s=1/0;t=t||{},mt.prototype.init.call(this),this.push=function(t){we(e,t),e&&Tt.forEach((function(i){e[i]=t[i]})),i.push(t)},this.setEarliestDts=function(t){r=t-e.timelineStartInfo.baseMediaDecodeTime},this.setVideoBaseMediaDecodeTime=function(e){s=e},this.setAudioAppendStart=function(e){a=e},this.flush=function(){var o,u,l,c;0!==i.length?(o=_e(i,e,r),e.baseMediaDecodeTime=ke(e,t.keepOriginalTimestamps),ve(e,o,a,s),e.samples=be(o),l=X.mdat(Te(o)),i=[],u=X.moof(n,[e]),c=new Uint8Array(u.byteLength+l.byteLength),n++,c.set(u),c.set(l,u.byteLength),Se(e),this.trigger("data",{track:e,boxes:c}),this.trigger("done","AudioSegmentStream")):this.trigger("done","AudioSegmentStream")}}).prototype=new re,(ft=function(e,t){var i,n,r=0,a=[],s=[];t=t||{},ft.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){we(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||i||(i=t.config,e.sps=[t.data],St.forEach((function(t){e[t]=i[t]}),this)),"pic_parameter_set_rbsp"!==t.nalUnitType||n||(n=t.data,e.pps=[t.data]),a.push(t)},this.flush=function(){for(var i,n,o,u,l,c;a.length&&"access_unit_delimiter_rbsp"!==a[0].nalUnitType;)a.shift();if(0===a.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(i=se(a),(o=oe(i))[0][0].keyFrame||((n=this.getGopForFusion_(a[0],e))?(o.unshift(n),o.byteLength+=n.byteLength,o.nalCount+=n.nalCount,o.pts=n.pts,o.dts=n.dts,o.duration+=n.duration):o=ue(o)),s.length){var h;if(!(h=t.alignGopsAtEnd?this.alignGopsAtEnd_(o):this.alignGopsAtStart_(o)))return this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),a=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");Se(e),o=h}we(e,o),e.samples=le(o),l=X.mdat(ce(o)),e.baseMediaDecodeTime=ke(e,t.keepOriginalTimestamps),this.trigger("processedGopsInfo",o.map((function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}}))),this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),a=[],this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime),this.trigger("timelineStartInfo",e.timelineStartInfo),u=X.moof(r,[e]),c=new Uint8Array(u.byteLength+l.byteLength),r++,c.set(u),c.set(l,u.byteLength),this.trigger("data",{track:e,boxes:c}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.resetStream_=function(){Se(e),i=void 0,n=void 0},this.getGopForFusion_=function(t){var i,n,r,a,s,o=1/0;for(s=0;s<this.gopCache_.length;s++)r=(a=this.gopCache_[s]).gop,e.pps&&kt(e.pps[0],a.pps[0])&&e.sps&&kt(e.sps[0],a.sps[0])&&(r.dts<e.timelineStartInfo.dts||(i=t.dts-r.dts-r.duration)>=-1e4&&i<=45e3&&(!n||o>i)&&(n=a,o=i));return n?n.gop:null},this.alignGopsAtStart_=function(e){var t,i,n,r,a,o,u,l;for(a=e.byteLength,o=e.nalCount,u=e.duration,t=i=0;t<s.length&&i<e.length&&(n=s[t],r=e[i],n.pts!==r.pts);)r.pts>n.pts?t++:(i++,a-=r.byteLength,o-=r.nalCount,u-=r.duration);return 0===i?e:i===e.length?null:((l=e.slice(i)).byteLength=a,l.duration=u,l.nalCount=o,l.pts=l[0].pts,l.dts=l[0].dts,l)},this.alignGopsAtEnd_=function(e){var t,i,n,r,a,o,u;for(t=s.length-1,i=e.length-1,a=null,o=!1;t>=0&&i>=0;){if(n=s[t],r=e[i],n.pts===r.pts){o=!0;break}n.pts>r.pts?t--:(t===s.length-1&&(a=i),i--)}if(!o&&null===a)return null;if(0===(u=o?i:a))return e;var l=e.slice(u),c=l.reduce((function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e}),{byteLength:0,duration:0,nalCount:0});return l.byteLength=c.byteLength,l.duration=c.duration,l.nalCount=c.nalCount,l.pts=l[0].pts,l.dts=l[0].dts,l},this.alignGopsWith=function(e){s=e}}).prototype=new re,(yt=function(e,t){this.numberOfTracks=0,this.metadataStream=t,void 0!==(e=e||{}).remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"==typeof e.keepOriginalTimestamps&&(this.keepOriginalTimestamps=e.keepOriginalTimestamps),this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,yt.prototype.init.call(this),this.push=function(e){return e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBoxes.push(e.boxes),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track),void("audio"===e.track.type&&(this.audioTrack=e.track)))}}).prototype=new re,yt.prototype.flush=function(e){var t,i,n,r,a=0,s={captions:[],captionStreams:{},metadata:[],info:{}},o=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==e&&"AudioSegmentStream"!==e)return;if(this.remuxTracks)return;if(0===this.pendingTracks.length)return this.emittedTracks++,void(this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}for(this.videoTrack?(o=this.videoTrack.timelineStartInfo.pts,St.forEach((function(e){s.info[e]=this.videoTrack[e]}),this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,Tt.forEach((function(e){s.info[e]=this.audioTrack[e]}),this)),1===this.pendingTracks.length?s.type=this.pendingTracks[0].type:s.type="combined",this.emittedTracks+=this.pendingTracks.length,n=X.initSegment(this.pendingTracks),s.initSegment=new Uint8Array(n.byteLength),s.initSegment.set(n),s.data=new Uint8Array(this.pendingBytes),r=0;r<this.pendingBoxes.length;r++)s.data.set(this.pendingBoxes[r],a),a+=this.pendingBoxes[r].byteLength;for(r=0;r<this.pendingCaptions.length;r++)(t=this.pendingCaptions[r]).startTime=t.startPts,this.keepOriginalTimestamps||(t.startTime-=o),t.startTime/=9e4,t.endTime=t.endPts,this.keepOriginalTimestamps||(t.endTime-=o),t.endTime/=9e4,s.captionStreams[t.stream]=!0,s.captions.push(t);for(r=0;r<this.pendingMetadata.length;r++)(i=this.pendingMetadata[r]).cueTime=i.pts,this.keepOriginalTimestamps||(i.cueTime-=o),i.cueTime/=9e4,s.metadata.push(i);s.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",s),this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},(gt=function(e){var t,i,n=this,r=!0;gt.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var t={};this.transmuxPipeline_=t,t.type="aac",t.metadataStream=new it.MetadataStream,t.aacStream=new vt,t.audioTimestampRolloverStream=new it.TimestampRolloverStream("audio"),t.timedMetadataTimestampRolloverStream=new it.TimestampRolloverStream("timed-metadata"),t.adtsStream=new ot,t.coalesceStream=new yt(e,t.metadataStream),t.headOfPipeline=t.aacStream,t.aacStream.pipe(t.audioTimestampRolloverStream).pipe(t.adtsStream),t.aacStream.pipe(t.timedMetadataTimestampRolloverStream).pipe(t.metadataStream).pipe(t.coalesceStream),t.metadataStream.on("timestamp",(function(e){t.aacStream.setTimestamp(e.timeStamp)})),t.aacStream.on("data",(function(r){"timed-metadata"!==r.type||t.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:n.baseMediaDecodeTime},codec:"adts",type:"audio"},t.coalesceStream.numberOfTracks++,t.audioSegmentStream=new mt(i,e),t.adtsStream.pipe(t.audioSegmentStream).pipe(t.coalesceStream))})),t.coalesceStream.on("data",this.trigger.bind(this,"data")),t.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setupTsPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="ts",r.metadataStream=new it.MetadataStream,r.packetStream=new it.TransportPacketStream,r.parseStream=new it.TransportParseStream,r.elementaryStream=new it.ElementaryStream,r.videoTimestampRolloverStream=new it.TimestampRolloverStream("video"),r.audioTimestampRolloverStream=new it.TimestampRolloverStream("audio"),r.timedMetadataTimestampRolloverStream=new it.TimestampRolloverStream("timed-metadata"),r.adtsStream=new ot,r.h264Stream=new _t,r.captionStream=new it.CaptionStream,r.coalesceStream=new yt(e,r.metadataStream),r.headOfPipeline=r.packetStream,r.packetStream.pipe(r.parseStream).pipe(r.elementaryStream),r.elementaryStream.pipe(r.videoTimestampRolloverStream).pipe(r.h264Stream),r.elementaryStream.pipe(r.audioTimestampRolloverStream).pipe(r.adtsStream),r.elementaryStream.pipe(r.timedMetadataTimestampRolloverStream).pipe(r.metadataStream).pipe(r.coalesceStream),r.h264Stream.pipe(r.captionStream).pipe(r.coalesceStream),r.elementaryStream.on("data",(function(a){var s;if("metadata"===a.type){for(s=a.tracks.length;s--;)t||"video"!==a.tracks[s].type?i||"audio"!==a.tracks[s].type||((i=a.tracks[s]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime):(t=a.tracks[s]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime;t&&!r.videoSegmentStream&&(r.coalesceStream.numberOfTracks++,r.videoSegmentStream=new ft(t,e),r.videoSegmentStream.on("timelineStartInfo",(function(e){i&&(i.timelineStartInfo=e,r.audioSegmentStream.setEarliestDts(e.dts))})),r.videoSegmentStream.on("processedGopsInfo",n.trigger.bind(n,"gopInfo")),r.videoSegmentStream.on("baseMediaDecodeTime",(function(e){i&&r.audioSegmentStream.setVideoBaseMediaDecodeTime(e)})),r.h264Stream.pipe(r.videoSegmentStream).pipe(r.coalesceStream)),i&&!r.audioSegmentStream&&(r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new mt(i,e),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream))}})),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setBaseMediaDecodeTime=function(n){var r=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=n),i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,Se(i),e.keepOriginalTimestamps||(i.timelineStartInfo.baseMediaDecodeTime=n),r.audioTimestampRolloverStream&&r.audioTimestampRolloverStream.discontinuity()),t&&(r.videoSegmentStream&&(r.videoSegmentStream.gopCache_=[],r.videoTimestampRolloverStream.discontinuity()),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,Se(t),r.captionStream.reset(),e.keepOriginalTimestamps||(t.timelineStartInfo.baseMediaDecodeTime=n)),r.timedMetadataTimestampRolloverStream&&r.timedMetadataTimestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.push=function(e){if(r){var t=bt(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),r=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){r=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}}).prototype=new re;var wt,Ct,Et={Transmuxer:gt,VideoSegmentStream:ft,AudioSegmentStream:mt,AUDIO_PROPERTIES:Tt,VIDEO_PROPERTIES:St},At=$.parseType,Lt=function(e){return new Date(1e3*e-20828448e5)},Ot=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},Pt=function(e){var t,i,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=[];for(t=0;t+4<e.length;t+=i)if(i=n.getUint32(t),t+=4,i<=0)r.push("<span style='color:red;'>MALFORMED DATA</span>");else switch(31&e[t]){case 1:r.push("slice_layer_without_partitioning_rbsp");break;case 5:r.push("slice_layer_without_partitioning_rbsp_idr");break;case 6:r.push("sei_rbsp");break;case 7:r.push("seq_parameter_set_rbsp");break;case 8:r.push("pic_parameter_set_rbsp");break;case 9:r.push("access_unit_delimiter_rbsp");break;default:r.push("UNKNOWN NAL - "+e[t]&31)}return r},xt={avc1:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{dataReferenceIndex:t.getUint16(6),width:t.getUint16(24),height:t.getUint16(26),horizresolution:t.getUint16(28)+t.getUint16(30)/16,vertresolution:t.getUint16(32)+t.getUint16(34)/16,frameCount:t.getUint16(40),depth:t.getUint16(74),config:wt(e.subarray(78,e.byteLength))}},avcC:function(e){var t,i,n,r,a=new DataView(e.buffer,e.byteOffset,e.byteLength),s={configurationVersion:e[0],avcProfileIndication:e[1],profileCompatibility:e[2],avcLevelIndication:e[3],lengthSizeMinusOne:3&e[4],sps:[],pps:[]},o=31&e[5];for(n=6,r=0;r<o;r++)i=a.getUint16(n),n+=2,s.sps.push(new Uint8Array(e.subarray(n,n+i))),n+=i;for(t=e[n],n++,r=0;r<t;r++)i=a.getUint16(n),n+=2,s.pps.push(new Uint8Array(e.subarray(n,n+i))),n+=i;return s},btrt:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{bufferSizeDB:t.getUint32(0),maxBitrate:t.getUint32(4),avgBitrate:t.getUint32(8)}},esds:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),esId:e[6]<<8|e[7],streamPriority:31&e[8],decoderConfig:{objectProfileIndication:e[11],streamType:e[12]>>>2&63,bufferSize:e[13]<<16|e[14]<<8|e[15],maxBitrate:e[16]<<24|e[17]<<16|e[18]<<8|e[19],avgBitrate:e[20]<<24|e[21]<<16|e[22]<<8|e[23],decoderConfigDescriptor:{tag:e[24],length:e[25],audioObjectType:e[26]>>>3&31,samplingFrequencyIndex:(7&e[26])<<1|e[27]>>>7&1,channelConfiguration:e[27]>>>3&15}}}},ftyp:function(e){for(var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={majorBrand:At(e.subarray(0,4)),minorVersion:t.getUint32(4),compatibleBrands:[]},n=8;n<e.byteLength;)i.compatibleBrands.push(At(e.subarray(n,n+4))),n+=4;return i},dinf:function(e){return{boxes:wt(e)}},dref:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),dataReferences:wt(e.subarray(8))}},hdlr:function(e){var t={version:new DataView(e.buffer,e.byteOffset,e.byteLength).getUint8(0),flags:new Uint8Array(e.subarray(1,4)),handlerType:At(e.subarray(8,12)),name:""},i=8;for(i=24;i<e.byteLength;i++){if(0===e[i]){i++;break}t.name+=String.fromCharCode(e[i])}return t.name=decodeURIComponent(escape(t.name)),t},mdat:function(e){return{byteLength:e.byteLength,nals:Pt(e)}},mdhd:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n=4,r={version:i.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),language:""};return 1===r.version?(n+=4,r.creationTime=Lt(i.getUint32(n)),n+=8,r.modificationTime=Lt(i.getUint32(n)),n+=4,r.timescale=i.getUint32(n),n+=8,r.duration=i.getUint32(n)):(r.creationTime=Lt(i.getUint32(n)),n+=4,r.modificationTime=Lt(i.getUint32(n)),n+=4,r.timescale=i.getUint32(n),n+=4,r.duration=i.getUint32(n)),n+=4,t=i.getUint16(n),r.language+=String.fromCharCode(96+(t>>10)),r.language+=String.fromCharCode(96+((992&t)>>5)),r.language+=String.fromCharCode(96+(31&t)),r},mdia:function(e){return{boxes:wt(e)}},mfhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sequenceNumber:e[4]<<24|e[5]<<16|e[6]<<8|e[7]}},minf:function(e){return{boxes:wt(e)}},mp4a:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={dataReferenceIndex:t.getUint16(6),channelcount:t.getUint16(16),samplesize:t.getUint16(18),samplerate:t.getUint16(24)+t.getUint16(26)/65536};return e.byteLength>28&&(i.streamDescriptor=wt(e.subarray(28))[0]),i},moof:function(e){return{boxes:wt(e)}},moov:function(e){return{boxes:wt(e)}},mvex:function(e){return{boxes:wt(e)}},mvhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i=4,n={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4))};return 1===n.version?(i+=4,n.creationTime=Lt(t.getUint32(i)),i+=8,n.modificationTime=Lt(t.getUint32(i)),i+=4,n.timescale=t.getUint32(i),i+=8,n.duration=t.getUint32(i)):(n.creationTime=Lt(t.getUint32(i)),i+=4,n.modificationTime=Lt(t.getUint32(i)),i+=4,n.timescale=t.getUint32(i),i+=4,n.duration=t.getUint32(i)),i+=4,n.rate=t.getUint16(i)+t.getUint16(i+2)/16,i+=4,n.volume=t.getUint8(i)+t.getUint8(i+1)/8,i+=2,i+=2,i+=8,n.matrix=new Uint32Array(e.subarray(i,i+36)),i+=36,i+=24,n.nextTrackId=t.getUint32(i),n},pdin:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),rate:t.getUint32(4),initialDelay:t.getUint32(8)}},sdtp:function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]};for(t=4;t<e.byteLength;t++)i.samples.push({dependsOn:(48&e[t])>>4,isDependedOn:(12&e[t])>>2,hasRedundancy:3&e[t]});return i},sidx:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:i.getUint32(4),timescale:i.getUint32(8),earliestPresentationTime:i.getUint32(12),firstOffset:i.getUint32(16)},r=i.getUint16(22);for(t=24;r;t+=12,r--)n.references.push({referenceType:(128&e[t])>>>7,referencedSize:2147483647&i.getUint32(t),subsegmentDuration:i.getUint32(t+4),startsWithSap:!!(128&e[t+8]),sapType:(112&e[t+8])>>>4,sapDeltaTime:268435455&i.getUint32(t+8)});return n},smhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),balance:e[4]+e[5]/256}},stbl:function(e){return{boxes:wt(e)}},stco:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),chunkOffsets:[]},r=i.getUint32(4);for(t=8;r;t+=4,r--)n.chunkOffsets.push(i.getUint32(t));return n},stsc:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n=i.getUint32(4),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleToChunks:[]};for(t=8;n;t+=12,n--)r.sampleToChunks.push({firstChunk:i.getUint32(t),samplesPerChunk:i.getUint32(t+4),sampleDescriptionIndex:i.getUint32(t+8)});return r},stsd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleDescriptions:wt(e.subarray(8))}},stsz:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleSize:i.getUint32(4),entries:[]};for(t=12;t<e.byteLength;t+=4)n.entries.push(i.getUint32(t));return n},stts:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),timeToSamples:[]},r=i.getUint32(4);for(t=8;r;t+=8,r--)n.timeToSamples.push({sampleCount:i.getUint32(t),sampleDelta:i.getUint32(t+4)});return n},styp:function(e){return xt.ftyp(e)},tfdt:function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4)),baseMediaDecodeTime:e[4]<<24|e[5]<<16|e[6]<<8|e[7]};return 1===t.version&&(t.baseMediaDecodeTime*=Math.pow(2,32),t.baseMediaDecodeTime+=e[8]<<24|e[9]<<16|e[10]<<8|e[11]),t},tfhd:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:i.getUint32(4)},r=1&n.flags[2],a=2&n.flags[2],s=8&n.flags[2],o=16&n.flags[2],u=32&n.flags[2],l=65536&n.flags[0],c=131072&n.flags[0];return t=8,r&&(t+=4,n.baseDataOffset=i.getUint32(12),t+=4),a&&(n.sampleDescriptionIndex=i.getUint32(t),t+=4),s&&(n.defaultSampleDuration=i.getUint32(t),t+=4),o&&(n.defaultSampleSize=i.getUint32(t),t+=4),u&&(n.defaultSampleFlags=i.getUint32(t)),l&&(n.durationIsEmpty=!0),!r&&c&&(n.baseDataOffsetIsMoof=!0),n},tkhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i=4,n={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4))};return 1===n.version?(i+=4,n.creationTime=Lt(t.getUint32(i)),i+=8,n.modificationTime=Lt(t.getUint32(i)),i+=4,n.trackId=t.getUint32(i),i+=4,i+=8,n.duration=t.getUint32(i)):(n.creationTime=Lt(t.getUint32(i)),i+=4,n.modificationTime=Lt(t.getUint32(i)),i+=4,n.trackId=t.getUint32(i),i+=4,i+=4,n.duration=t.getUint32(i)),i+=4,i+=8,n.layer=t.getUint16(i),i+=2,n.alternateGroup=t.getUint16(i),i+=2,n.volume=t.getUint8(i)+t.getUint8(i+1)/8,i+=2,i+=2,n.matrix=new Uint32Array(e.subarray(i,i+36)),i+=36,n.width=t.getUint16(i)+t.getUint16(i+2)/16,i+=4,n.height=t.getUint16(i)+t.getUint16(i+2)/16,n},traf:function(e){return{boxes:wt(e)}},trak:function(e){return{boxes:wt(e)}},trex:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:t.getUint32(4),defaultSampleDescriptionIndex:t.getUint32(8),defaultSampleDuration:t.getUint32(12),defaultSampleSize:t.getUint32(16),sampleDependsOn:3&e[20],sampleIsDependedOn:(192&e[21])>>6,sampleHasRedundancy:(48&e[21])>>4,samplePaddingValue:(14&e[21])>>1,sampleIsDifferenceSample:!!(1&e[21]),sampleDegradationPriority:t.getUint16(22)}},trun:function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=1&i.flags[2],a=4&i.flags[2],s=1&i.flags[1],o=2&i.flags[1],u=4&i.flags[1],l=8&i.flags[1],c=n.getUint32(4),h=8;for(r&&(i.dataOffset=n.getInt32(h),h+=4),a&&c&&(t={flags:Ot(e.subarray(h,h+4))},h+=4,s&&(t.duration=n.getUint32(h),h+=4),o&&(t.size=n.getUint32(h),h+=4),l&&(t.compositionTimeOffset=n.getUint32(h),h+=4),i.samples.push(t),c--);c--;)t={},s&&(t.duration=n.getUint32(h),h+=4),o&&(t.size=n.getUint32(h),h+=4),u&&(t.flags=Ot(e.subarray(h,h+4)),h+=4),l&&(t.compositionTimeOffset=n.getUint32(h),h+=4),i.samples.push(t);return i},"url ":function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4))}},vmhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),graphicsmode:t.getUint16(4),opcolor:new Uint16Array([t.getUint16(6),t.getUint16(8),t.getUint16(10)])}}},Ut={inspect:wt=function(e){for(var t,i,n,r,a,s=0,o=[],u=new ArrayBuffer(e.length),l=new Uint8Array(u),c=0;c<e.length;++c)l[c]=e[c];for(t=new DataView(u);s<e.byteLength;)i=t.getUint32(s),n=At(e.subarray(s+4,s+8)),r=i>1?s+i:e.byteLength,(a=(xt[n]||function(e){return{data:e}})(e.subarray(s+8,r))).size=i,a.type=n,o.push(a),s=r;return o},textify:Ct=function(e,t){var i;return t=t||0,i=new Array(2*t+1).join(" "),e.map((function(e,n){return i+e.type+"\n"+Object.keys(e).filter((function(e){return"type"!==e&&"boxes"!==e})).map((function(t){var n=i+" "+t+": ",r=e[t];if(r instanceof Uint8Array||r instanceof Uint32Array){var a=Array.prototype.slice.call(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)).map((function(e){return" "+("00"+e.toString(16)).slice(-2)})).join("").match(/.{1,24}/g);return a?1===a.length?n+"<"+a.join("").slice(1)+">":n+"<\n"+a.map((function(e){return i+" "+e})).join("\n")+"\n"+i+" >":n+"<>"}return n+JSON.stringify(r,null,2).split("\n").map((function(e,t){return 0===t?e:i+" "+e})).join("\n")})).join("\n")+(e.boxes?"\n"+Ct(e.boxes,t+1):"")})).join("\n")},parseTfdt:xt.tfdt,parseHdlr:xt.hdlr,parseTfhd:xt.tfhd,parseTrun:xt.trun},It=Oe,Dt=Be.CaptionStream,Rt=function(e,t){for(var i=e,n=0;n<t.length;n++){var r=t[n];if(i<r.size)return r;i-=r.size}return null},Mt=function(e,t){var i=$.findBox(e,["moof","traf"]),n=$.findBox(e,["mdat"]),r={},a=[];return n.forEach((function(e,t){var n=i[t];a.push({mdat:e,traf:n})})),a.forEach((function(e){var i,n=e.mdat,a=e.traf,s=$.findBox(a,["tfhd"]),o=Ut.parseTfhd(s[0]),u=o.trackId,l=$.findBox(a,["tfdt"]),c=l.length>0?Ut.parseTfdt(l[0]).baseMediaDecodeTime:0,h=$.findBox(a,["trun"]);t===u&&h.length>0&&(i=function(e,t,i){var n,r,a,s,o=new DataView(e.buffer,e.byteOffset,e.byteLength),u=[];for(r=0;r+4<e.length;r+=a)if(a=o.getUint32(r),r+=4,!(a<=0))switch(31&e[r]){case 6:var l=e.subarray(r+1,r+1+a),c=Rt(r,t);n={nalUnitType:"sei_rbsp",size:a,data:l,escapedRBSP:It(l),trackId:i},c?(n.pts=c.pts,n.dts=c.dts,s=c):(n.pts=s.pts,n.dts=s.dts),u.push(n)}return u}(n,function(e,t,i){var n=t,r=i.defaultSampleDuration||0,a=i.defaultSampleSize||0,s=i.trackId,o=[];return e.forEach((function(e){var t=Ut.parseTrun(e).samples;t.forEach((function(e){void 0===e.duration&&(e.duration=r),void 0===e.size&&(e.size=a),e.trackId=s,e.dts=n,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),e.pts=n+e.compositionTimeOffset,n+=e.duration})),o=o.concat(t)})),o}(h,c,o),u),r[u]||(r[u]=[]),r[u]=r[u].concat(i))})),r},Bt={generator:X,probe:$,Transmuxer:Et.Transmuxer,AudioSegmentStream:Et.AudioSegmentStream,VideoSegmentStream:Et.VideoSegmentStream,CaptionParser:function(){var e,t,i,n,r,a=!1;this.isInitialized=function(){return a},this.init=function(){e=new Dt,a=!0,e.on("data",(function(e){e.startTime=e.startPts/n,e.endTime=e.endPts/n,r.captions.push(e),r.captionStreams[e.stream]=!0}))},this.isNewInit=function(e,t){return!(e&&0===e.length||t&&"object"==typeof t&&0===Object.keys(t).length)&&(i!==e[0]||n!==t[i])},this.parse=function(e,a,s){var o;if(!this.isInitialized())return null;if(!a||!s)return null;if(this.isNewInit(a,s))i=a[0],n=s[i];else if(!i||!n)return t.push(e),null;for(;t.length>0;){var u=t.shift();this.parse(u,a,s)}return null!==(o=function(e,t,i){return t?{seiNals:Mt(e,t)[t],timescale:i}:null}(e,i,n))&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),r):null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach((function(t){e.push(t)}))},this.flushStream=function(){if(!this.isInitialized())return null;e.flush()},this.clearParsedCaptions=function(){r.captions=[],r.captionStreams={}},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],i=null,n=null,r?this.clearParsedCaptions():r={captions:[],captionStreams:{}},this.resetCaptionStream()},this.reset()}},Nt=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),jt=function(){function e(t,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options=i||{},this.self=t,this.init()}return Nt(e,[{key:"init",value:function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Bt.Transmuxer(this.options),function(e,t){t.on("data",(function(t){var i=t.initSegment;t.initSegment={data:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength};var n=t.data;t.data=n.buffer,e.postMessage({action:"data",segment:t,byteOffset:n.byteOffset,byteLength:n.byteLength},[t.data])})),t.captionStream&&t.captionStream.on("data",(function(t){e.postMessage({action:"caption",data:t})})),t.on("done",(function(t){e.postMessage({action:"done"})})),t.on("gopInfo",(function(t){e.postMessage({action:"gopInfo",gopInfo:t})}))}(this.self,this.transmuxer)}},{key:"push",value:function(e){var t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)}},{key:"reset",value:function(){this.init()}},{key:"setTimestampOffset",value:function(e){var t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(9e4*t))}},{key:"setAudioAppendStart",value:function(e){this.transmuxer.setAudioAppendStart(Math.ceil(9e4*e.appendStart))}},{key:"flush",value:function(e){this.transmuxer.flush()}},{key:"resetCaptions",value:function(){this.transmuxer.resetCaptions()}},{key:"alignGopsWith",value:function(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())}}]),e}();new function(e){e.onmessage=function(t){"init"===t.data.action&&t.data.options?this.messageHandlers=new jt(e,t.data.options):(this.messageHandlers||(this.messageHandlers=new jt(e)),t.data&&t.data.action&&"init"!==t.data.action&&this.messageHandlers[t.data.action]&&this.messageHandlers[t.data.action](t.data))}}(i)}()})),Qs={videoCodec:"avc1",videoObjectTypeIndicator:".4d400d",audioProfile:"2"},Js=function(e){return e.map((function(e){return e.replace(/avc1\.(\d+)\.(\d+)/i,(function(e,t,i){return"avc1."+("00"+Number(t).toString(16)).slice(-2)+"00"+("00"+Number(i).toString(16)).slice(-2)}))}))},Zs=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t={codecCount:0},i=void 0;return t.codecCount=e.split(",").length,t.codecCount=t.codecCount||2,(i=/(^|\s|,)+(avc[13])([^ ,]*)/i.exec(e))&&(t.videoCodec=i[2],t.videoObjectTypeIndicator=i[3]),t.audioProfile=/(^|\s|,)+mp4a.[0-9A-Fa-f]+\.([0-9A-Fa-f]+)/i.exec(e),t.audioProfile=t.audioProfile&&t.audioProfile[2],t},eo=function(e,t,i){return e+"/"+t+'; codecs="'+i.filter((function(e){return!!e})).join(", ")+'"'},to=function(e,t){var i=function(e){return e.segments&&e.segments.length&&e.segments[0].map?"mp4":"mp2t"}(t),n=function(e){var t=e.attributes||{};return t.CODECS?Zs(t.CODECS):Qs}(t),r=t.attributes||{},a=!0,s=!1;if(!t)return[];if(e.mediaGroups.AUDIO&&r.AUDIO){var o=e.mediaGroups.AUDIO[r.AUDIO];if(o)for(var u in s=!0,a=!1,o)if(!o[u].uri&&!o[u].playlists){a=!0;break}}s&&!n.audioProfile&&(a||(n.audioProfile=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var i=e.mediaGroups.AUDIO[t];if(!i)return null;for(var n in i){var r=i[n];if(r.default&&r.playlists)return Zs(r.playlists[0].attributes.CODECS).audioProfile}return null}(e,r.AUDIO)),n.audioProfile||(Ra.log.warn("Multiple audio tracks present but no audio codec string is specified. Attempting to use the default audio codec (mp4a.40.2)"),n.audioProfile=Qs.audioProfile));var l={};n.videoCodec&&(l.video=""+n.videoCodec+n.videoObjectTypeIndicator),n.audioProfile&&(l.audio="mp4a.40."+n.audioProfile);var c=eo("audio",i,[l.audio]),h=eo("video",i,[l.video]),d=eo("video",i,[l.video,l.audio]);return s?!a&&l.video?[h,c]:a||l.video?[d,c]:[c,c]:l.video?[d]:[c]},io=function(e){return/mp4a\.\d+.\d+/i.test(e)},no=function(e){return/avc1\.[\da-f]+/i.test(e)},ro=function(e,t,i){if(null==t||!e.length)return[];var n=Math.ceil(9e4*(t-i+3)),r=void 0;for(r=0;r<e.length&&!(e[r].pts>n);r++);return e.slice(r)},ao=function(e){function t(e,i){ja(this,t);var n=qa(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,Ra.EventTarget));n.timestampOffset_=0,n.pendingBuffers_=[],n.bufferUpdating_=!1,n.mediaSource_=e,n.codecs_=i,n.audioCodec_=null,n.videoCodec_=null,n.audioDisabled_=!1,n.appendAudioInitSegment_=!0,n.gopBuffer_=[],n.timeMapping_=0,n.safeAppend_=Ra.browser.IE_VERSION>=11;var r={remux:!1,alignGopsAtEnd:n.safeAppend_};return n.codecs_.forEach((function(e){io(e)?n.audioCodec_=e:no(e)&&(n.videoCodec_=e)})),n.transmuxer_=new Ks,n.transmuxer_.postMessage({action:"init",options:r}),n.transmuxer_.onmessage=function(e){return"data"===e.data.action?n.data_(e):"done"===e.data.action?n.done_(e):"gopInfo"===e.data.action?n.appendGopInfo_(e):void 0},Object.defineProperty(n,"timestampOffset",{get:function(){return this.timestampOffset_},set:function(e){"number"==typeof e&&e>=0&&(this.timestampOffset_=e,this.appendAudioInitSegment_=!0,this.gopBuffer_.length=0,this.timeMapping_=0,this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e}))}}),Object.defineProperty(n,"appendWindowStart",{get:function(){return(this.videoBuffer_||this.audioBuffer_).appendWindowStart},set:function(e){this.videoBuffer_&&(this.videoBuffer_.appendWindowStart=e),this.audioBuffer_&&(this.audioBuffer_.appendWindowStart=e)}}),Object.defineProperty(n,"updating",{get:function(){return!!(this.bufferUpdating_||!this.audioDisabled_&&this.audioBuffer_&&this.audioBuffer_.updating||this.videoBuffer_&&this.videoBuffer_.updating)}}),Object.defineProperty(n,"buffered",{get:function(){return function(e,t,i){var n=null,r=null,a=0,s=[],o=[];if(!e&&!t)return Ra.createTimeRange();if(!e)return t.buffered;if(!t)return e.buffered;if(i)return e.buffered;if(0===e.buffered.length&&0===t.buffered.length)return Ra.createTimeRange();for(var u=e.buffered,l=t.buffered,c=u.length;c--;)s.push({time:u.start(c),type:"start"}),s.push({time:u.end(c),type:"end"});for(c=l.length;c--;)s.push({time:l.start(c),type:"start"}),s.push({time:l.end(c),type:"end"});for(s.sort((function(e,t){return e.time-t.time})),c=0;c<s.length;c++)"start"===s[c].type?2==++a&&(n=s[c].time):"end"===s[c].type&&1==--a&&(r=s[c].time),null!==n&&null!==r&&(o.push([n,r]),n=null,r=null);return Ra.createTimeRanges(o)}(this.videoBuffer_,this.audioBuffer_,this.audioDisabled_)}}),n}return Ha(t,e),Fa(t,[{key:"data_",value:function(e){var t=e.data.segment;t.data=new Uint8Array(t.data,e.data.byteOffset,e.data.byteLength),t.initSegment=new Uint8Array(t.initSegment.data,t.initSegment.byteOffset,t.initSegment.byteLength),function(e,t,i){var n=t.player_;if(i.captions&&i.captions.length)for(var r in e.inbandTextTracks_||(e.inbandTextTracks_={}),i.captionStreams)if(!e.inbandTextTracks_[r]){n.tech_.trigger({type:"usage",name:"hls-608"});var a=n.textTracks().getTrackById(r);e.inbandTextTracks_[r]=a||n.addRemoteTextTrack({kind:"captions",id:r,label:r},!1).track}i.metadata&&i.metadata.length&&!e.metadataTrack_&&(e.metadataTrack_=n.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,e.metadataTrack_.inBandMetadataTrackDispatchType=i.metadata.dispatchType)}(this,this.mediaSource_,t),this.pendingBuffers_.push(t)}},{key:"done_",value:function(e){"closed"!==this.mediaSource_.readyState?this.processPendingSegments_():this.pendingBuffers_.length=0}},{key:"createRealSourceBuffers_",value:function(){var e=this,t=["audio","video"];t.forEach((function(i){if(e[i+"Codec_"]&&!e[i+"Buffer_"]){var n=null;if(e.mediaSource_[i+"Buffer_"])(n=e.mediaSource_[i+"Buffer_"]).updating=!1;else{var r=i+'/mp4;codecs="'+e[i+"Codec_"]+'"';n=function(e,t){var i=e.addSourceBuffer(t),n=Object.create(null);n.updating=!1,n.realBuffer_=i;var r=function(e){"function"==typeof i[e]?n[e]=function(){return i[e].apply(i,arguments)}:void 0===n[e]&&Object.defineProperty(n,e,{get:function(){return i[e]},set:function(t){return i[e]=t}})};for(var a in i)r(a);return n}(e.mediaSource_.nativeMediaSource_,r),e.mediaSource_[i+"Buffer_"]=n}e[i+"Buffer_"]=n,["update","updatestart","updateend"].forEach((function(r){n.addEventListener(r,(function(){if("audio"!==i||!e.audioDisabled_)return"updateend"===r&&(e[i+"Buffer_"].updating=!1),t.every((function(t){return!("audio"!==t||!e.audioDisabled_)||(i===t||!e[t+"Buffer_"]||!e[t+"Buffer_"].updating)}))?e.trigger(r):void 0}))}))}}))}},{key:"appendBuffer",value:function(e){if(this.bufferUpdating_=!0,this.audioBuffer_&&this.audioBuffer_.buffered.length){var t=this.audioBuffer_.buffered;this.transmuxer_.postMessage({action:"setAudioAppendStart",appendStart:t.end(t.length-1)})}this.videoBuffer_&&this.transmuxer_.postMessage({action:"alignGopsWith",gopsToAlignWith:ro(this.gopBuffer_,this.mediaSource_.player_?this.mediaSource_.player_.currentTime():null,this.timeMapping_)}),this.transmuxer_.postMessage({action:"push",data:e.buffer,byteOffset:e.byteOffset,byteLength:e.byteLength},[e.buffer]),this.transmuxer_.postMessage({action:"flush"})}},{key:"appendGopInfo_",value:function(e){this.gopBuffer_=function(e,t,i){if(!t.length)return e;if(i)return t.slice();for(var n=t[0].pts,r=0;r<e.length&&!(e[r].pts>=n);r++);return e.slice(0,r).concat(t)}(this.gopBuffer_,e.data.gopInfo,this.safeAppend_)}},{key:"remove",value:function(e,t){if(this.videoBuffer_&&(this.videoBuffer_.updating=!0,this.videoBuffer_.remove(e,t),this.gopBuffer_=function(e,t,i,n){for(var r=Math.ceil(9e4*(t-n)),a=Math.ceil(9e4*(i-n)),s=e.slice(),o=e.length;o--&&!(e[o].pts<=a););if(-1===o)return s;for(var u=o+1;u--&&!(e[u].pts<=r););return u=Math.max(u,0),s.splice(u,o-u+1),s}(this.gopBuffer_,e,t,this.timeMapping_)),!this.audioDisabled_&&this.audioBuffer_&&(this.audioBuffer_.updating=!0,this.audioBuffer_.remove(e,t)),Bs(e,t,this.metadataTrack_),this.inbandTextTracks_)for(var i in this.inbandTextTracks_)Bs(e,t,this.inbandTextTracks_[i])}},{key:"processPendingSegments_",value:function(){var e={video:{segments:[],bytes:0},audio:{segments:[],bytes:0},captions:[],metadata:[]};e=this.pendingBuffers_.reduce((function(e,t){var i=t.type,n=t.data,r=t.initSegment;return e[i].segments.push(n),e[i].bytes+=n.byteLength,e[i].initSegment=r,t.captions&&(e.captions=e.captions.concat(t.captions)),t.info&&(e[i].info=t.info),t.metadata&&(e.metadata=e.metadata.concat(t.metadata)),e}),e),this.videoBuffer_||this.audioBuffer_||(0===e.video.bytes&&(this.videoCodec_=null),0===e.audio.bytes&&(this.audioCodec_=null),this.createRealSourceBuffers_()),e.audio.info&&this.mediaSource_.trigger({type:"audioinfo",info:e.audio.info}),e.video.info&&this.mediaSource_.trigger({type:"videoinfo",info:e.video.info}),this.appendAudioInitSegment_&&(!this.audioDisabled_&&this.audioBuffer_&&(e.audio.segments.unshift(e.audio.initSegment),e.audio.bytes+=e.audio.initSegment.byteLength),this.appendAudioInitSegment_=!1);var t=!1;this.videoBuffer_&&e.video.bytes?(e.video.segments.unshift(e.video.initSegment),e.video.bytes+=e.video.initSegment.byteLength,this.concatAndAppendSegments_(e.video,this.videoBuffer_),js(this,e.captions,e.metadata)):!this.videoBuffer_||!this.audioDisabled_&&this.audioBuffer_||(t=!0),!this.audioDisabled_&&this.audioBuffer_&&this.concatAndAppendSegments_(e.audio,this.audioBuffer_),this.pendingBuffers_.length=0,t&&this.trigger("updateend"),this.bufferUpdating_=!1}},{key:"concatAndAppendSegments_",value:function(e,t){var i=0,n=void 0;if(e.bytes){n=new Uint8Array(e.bytes),e.segments.forEach((function(e){n.set(e,i),i+=e.byteLength}));try{t.updating=!0,t.appendBuffer(n)}catch(e){this.mediaSource_.player_&&this.mediaSource_.player_.error({code:-3,type:"APPEND_BUFFER_ERR",message:e.message,originalError:e})}}}},{key:"abort",value:function(){this.videoBuffer_&&this.videoBuffer_.abort(),!this.audioDisabled_&&this.audioBuffer_&&this.audioBuffer_.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"reset"}),this.pendingBuffers_.length=0,this.bufferUpdating_=!1}}]),t}(Ra.EventTarget),so=function(e){function t(){ja(this,t);var e=qa(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),i=void 0;for(i in e.nativeMediaSource_=new(f().MediaSource),e.nativeMediaSource_)i in t.prototype||"function"!=typeof e.nativeMediaSource_[i]||(e[i]=e.nativeMediaSource_[i].bind(e.nativeMediaSource_));return e.duration_=NaN,Object.defineProperty(e,"duration",{get:function(){return this.duration_===1/0?this.duration_:this.nativeMediaSource_.duration},set:function(e){this.duration_=e,e===1/0||(this.nativeMediaSource_.duration=e)}}),Object.defineProperty(e,"seekable",{get:function(){return this.duration_===1/0?Ra.createTimeRanges([[0,this.nativeMediaSource_.duration]]):this.nativeMediaSource_.seekable}}),Object.defineProperty(e,"readyState",{get:function(){return this.nativeMediaSource_.readyState}}),Object.defineProperty(e,"activeSourceBuffers",{get:function(){return this.activeSourceBuffers_}}),e.sourceBuffers=[],e.activeSourceBuffers_=[],e.updateActiveSourceBuffers_=function(){if(e.activeSourceBuffers_.length=0,1===e.sourceBuffers.length){var t=e.sourceBuffers[0];return t.appendAudioInitSegment_=!0,t.audioDisabled_=!t.audioCodec_,void e.activeSourceBuffers_.push(t)}for(var i=!1,n=!0,r=0;r<e.player_.audioTracks().length;r++){var a=e.player_.audioTracks()[r];if(a.enabled&&"main"!==a.kind){i=!0,n=!1;break}}e.sourceBuffers.forEach((function(t,r){if(t.appendAudioInitSegment_=!0,t.videoCodec_&&t.audioCodec_)t.audioDisabled_=i;else if(t.videoCodec_&&!t.audioCodec_)t.audioDisabled_=!0,n=!1;else if(!t.videoCodec_&&t.audioCodec_&&(t.audioDisabled_=r?n:!n,t.audioDisabled_))return;e.activeSourceBuffers_.push(t)}))},e.onPlayerMediachange_=function(){e.sourceBuffers.forEach((function(e){e.appendAudioInitSegment_=!0}))},e.onHlsReset_=function(){e.sourceBuffers.forEach((function(e){e.transmuxer_&&e.transmuxer_.postMessage({action:"resetCaptions"})}))},e.onHlsSegmentTimeMapping_=function(t){e.sourceBuffers.forEach((function(e){return e.timeMapping_=t.mapping}))},["sourceopen","sourceclose","sourceended"].forEach((function(e){this.nativeMediaSource_.addEventListener(e,this.trigger.bind(this))}),e),e.on("sourceopen",(function(t){var i=C().querySelector('[src="'+e.url_+'"]');i&&(e.player_=Ra(i.parentNode),e.player_&&(e.player_.tech_.on("hls-reset",e.onHlsReset_),e.player_.tech_.on("hls-segment-time-mapping",e.onHlsSegmentTimeMapping_),e.player_.audioTracks&&e.player_.audioTracks()&&(e.player_.audioTracks().on("change",e.updateActiveSourceBuffers_),e.player_.audioTracks().on("addtrack",e.updateActiveSourceBuffers_),e.player_.audioTracks().on("removetrack",e.updateActiveSourceBuffers_)),e.player_.on("mediachange",e.onPlayerMediachange_)))})),e.on("sourceended",(function(t){for(var i=Ns(e.duration),n=0;n<e.sourceBuffers.length;n++){var r=e.sourceBuffers[n],a=r.metadataTrack_&&r.metadataTrack_.cues;a&&a.length&&(a[a.length-1].endTime=i)}})),e.on("sourceclose",(function(e){this.sourceBuffers.forEach((function(e){e.transmuxer_&&e.transmuxer_.terminate()})),this.sourceBuffers.length=0,this.player_&&(this.player_.audioTracks&&this.player_.audioTracks()&&(this.player_.audioTracks().off("change",this.updateActiveSourceBuffers_),this.player_.audioTracks().off("addtrack",this.updateActiveSourceBuffers_),this.player_.audioTracks().off("removetrack",this.updateActiveSourceBuffers_)),this.player_.el_&&this.player_.off("mediachange",this.onPlayerMediachange_),this.player_.tech_&&this.player_.tech_.el_&&(this.player_.tech_.off("hls-reset",this.onHlsReset_),this.player_.tech_.off("hls-segment-time-mapping",this.onHlsSegmentTimeMapping_)))})),e}return Ha(t,e),Fa(t,[{key:"addSeekableRange_",value:function(e,t){var i=void 0;if(this.duration!==1/0)throw(i=new Error("MediaSource.addSeekableRange() can only be invoked when the duration is Infinity")).name="InvalidStateError",i.code=11,i;(t>this.nativeMediaSource_.duration||isNaN(this.nativeMediaSource_.duration))&&(this.nativeMediaSource_.duration=t)}},{key:"addSourceBuffer",value:function(e){var t=void 0,i=function(e){var t={type:"",parameters:{}},i=e.trim().split(";");return t.type=i.shift().trim(),i.forEach((function(e){var i=e.trim().split("=");if(i.length>1){var n=i[0].replace(/"/g,"").trim(),r=i[1].replace(/"/g,"").trim();t.parameters[n]=r}})),t}(e);if(/^(video|audio)\/mp2t$/i.test(i.type)){var n=[];i.parameters&&i.parameters.codecs&&(n=i.parameters.codecs.split(","),n=(n=Js(n)).filter((function(e){return io(e)||no(e)}))),0===n.length&&(n=["avc1.4d400d","mp4a.40.2"]),t=new ao(this,n),0!==this.sourceBuffers.length&&(this.sourceBuffers[0].createRealSourceBuffers_(),t.createRealSourceBuffers_(),this.sourceBuffers[0].audioDisabled_=!0)}else t=this.nativeMediaSource_.addSourceBuffer(e);return this.sourceBuffers.push(t),t}}]),t}(Ra.EventTarget),oo=0;Ra.mediaSources={};var uo=function(e,t){var i=Ra.mediaSources[e];if(!i)throw new Error("Media Source not found (Video.js)");i.trigger({type:"sourceopen",swfId:t})},lo=function(){return!!f().MediaSource&&!!f().MediaSource.isTypeSupported&&f().MediaSource.isTypeSupported('video/mp4;codecs="avc1.4d400d,mp4a.40.2"')},co=function(){if(this.MediaSource={open:uo,supportsNativeMediaSources:lo},lo())return new so;throw new Error("Cannot use create a virtual MediaSource for this video")};co.open=uo,co.supportsNativeMediaSources=lo;var ho={createObjectURL:function(e){var t=void 0;return e instanceof so?(t=f().URL.createObjectURL(e.nativeMediaSource_),e.url_=t,t):e instanceof so?(t="blob:vjs-media-source/"+oo,oo++,Ra.mediaSources[t]=e,t):(t=f().URL.createObjectURL(e),e.url_=t,t)}};Ra.MediaSource=co,Ra.URL=ho;var po=Ra.EventTarget,fo=Ra.mergeOptions,mo=function(e,t){for(var i=fo(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod}),n=0;n<t.playlists.length;n++){var r=$a(i,t.playlists[n]);r&&(i=r)}return Ya(t,(function(e,t,n,r){if(e.playlists&&e.playlists.length){var a=e.playlists[0].uri,s=$a(i,e.playlists[0]);s&&((i=s).mediaGroups[t][n][r].playlists[0]=i.playlists[a])}})),i},go=function(e){function t(e,i,n,r){ja(this,t);var a=qa(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));if(a.hls_=i,a.withCredentials=n,!e)throw new Error("A non-empty playlist URL or playlist is required");return a.on("minimumUpdatePeriod",(function(){a.refreshXml_()})),a.on("mediaupdatetimeout",(function(){a.refreshMedia_()})),"string"==typeof e?(a.srcUrl=e,a.state="HAVE_NOTHING",qa(a)):(a.masterPlaylistLoader_=r,a.state="HAVE_METADATA",a.started=!0,a.media(e),f().setTimeout((function(){a.trigger("loadedmetadata")}),0),a)}return Ha(t,e),Fa(t,[{key:"dispose",value:function(){this.stopRequest(),f().clearTimeout(this.mediaUpdateTimeout)}},{key:"stopRequest",value:function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}},{key:"media",value:function(e){if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);var t=this.state;if("string"==typeof e){if(!this.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.master.playlists[e]}var i=!this.media_||e.uri!==this.media_.uri;this.state="HAVE_METADATA",i&&(this.media_&&this.trigger("mediachanging"),this.media_=e,this.refreshMedia_(),"HAVE_MASTER"!==t&&this.trigger("mediachange"))}},{key:"pause",value:function(){this.stopRequest(),f().clearTimeout(this.mediaUpdateTimeout),"HAVE_NOTHING"===this.state&&(this.started=!1)}},{key:"load",value:function(e){var t=this;f().clearTimeout(this.mediaUpdateTimeout);var i=this.media();if(e){var n=i?i.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=f().setTimeout((function(){return t.load()}),n)}else this.started?this.trigger("loadedplaylist"):this.start()}},{key:"parseMasterXml",value:function(){var e=de(this.masterXml_,{manifestUri:this.srcUrl,clientOffset:this.clientOffset_});e.uri=this.srcUrl;for(var t=0;t<e.playlists.length;t++){var i="placeholder-uri-"+t;e.playlists[t].uri=i,e.playlists[i]=e.playlists[t]}return Ya(e,(function(t,i,n,r){if(t.playlists&&t.playlists.length){var a="placeholder-uri-"+i+"-"+n+"-"+r;t.playlists[0].uri=a,e.playlists[a]=t.playlists[0]}})),Ka(e),Qa(e),e}},{key:"start",value:function(){var e=this;this.started=!0,this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials},(function(t,i){if(e.request){if(e.request=null,t)return e.error={status:i.status,message:"DASH playlist request error at URL: "+e.srcUrl,responseText:i.responseText,code:2},"HAVE_NOTHING"===e.state&&(e.started=!1),e.trigger("error");e.masterXml_=i.responseText,i.responseHeaders&&i.responseHeaders.date?e.masterLoaded_=Date.parse(i.responseHeaders.date):e.masterLoaded_=Date.now(),e.syncClientServerClock_(e.onClientServerClockSync_.bind(e))}}))}},{key:"syncClientServerClock_",value:function(e){var t=this,i=pe(this.masterXml_);return null===i?(this.clientOffset_=this.masterLoaded_-Date.now(),e()):"DIRECT"===i.method?(this.clientOffset_=i.value-Date.now(),e()):void(this.request=this.hls_.xhr({uri:Na(this.srcUrl,i.value),method:i.method,withCredentials:this.withCredentials},(function(n,r){if(t.request){if(n)return t.clientOffset_=t.masterLoaded_-Date.now(),e();var a=void 0;a="HEAD"===i.method?r.responseHeaders&&r.responseHeaders.date?Date.parse(r.responseHeaders.date):t.masterLoaded_:Date.parse(r.responseText),t.clientOffset_=a-Date.now(),e()}})))}},{key:"onClientServerClockSync_",value:function(){var e=this;this.master=this.parseMasterXml(),this.state="HAVE_MASTER",this.trigger("loadedplaylist"),this.media_||this.media(this.master.playlists[0]),f().setTimeout((function(){e.trigger("loadedmetadata")}),0),this.master.minimumUpdatePeriod&&f().setTimeout((function(){e.trigger("minimumUpdatePeriod")}),this.master.minimumUpdatePeriod)}},{key:"refreshXml_",value:function(){var e=this;this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials},(function(t,i){if(e.request){if(e.request=null,t)return e.error={status:i.status,message:"DASH playlist request error at URL: "+e.srcUrl,responseText:i.responseText,code:2},"HAVE_NOTHING"===e.state&&(e.started=!1),e.trigger("error");e.masterXml_=i.responseText;var n=e.parseMasterXml();e.master=mo(e.master,n),f().setTimeout((function(){e.trigger("minimumUpdatePeriod")}),e.master.minimumUpdatePeriod)}}))}},{key:"refreshMedia_",value:function(){var e=this,t=void 0,i=void 0;this.masterPlaylistLoader_?(t=this.masterPlaylistLoader_.master,i=this.masterPlaylistLoader_.parseMasterXml()):(t=this.master,i=this.parseMasterXml());var n=mo(t,i);n?(this.masterPlaylistLoader_?this.masterPlaylistLoader_.master=n:this.master=n,this.media_=n.playlists[this.media_.uri]):this.trigger("playlistunchanged"),this.media().endList||(this.mediaUpdateTimeout=f().setTimeout((function(){e.trigger("mediaupdatetimeout")}),Ja(this.media(),!!n))),this.trigger("loadedplaylist")}}]),t}(po),yo=function(e){return Ra.log.debug?Ra.log.debug.bind(Ra,"VHS:",e+" >"):function(){}};function vo(){}var _o=function(){function e(t,i,n,r){ja(this,e),this.callbacks_=[],this.pendingCallback_=null,this.timestampOffset_=0,this.mediaSource=t,this.processedAppend_=!1,this.type_=n,this.mimeType_=i,this.logger_=yo("SourceUpdater["+n+"]["+i+"]"),"closed"===t.readyState?t.addEventListener("sourceopen",this.createSourceBuffer_.bind(this,i,r)):this.createSourceBuffer_(i,r)}return Fa(e,[{key:"createSourceBuffer_",value:function(e,t){var i=this;this.sourceBuffer_=this.mediaSource.addSourceBuffer(e),this.logger_("created SourceBuffer"),t&&(t.trigger("sourcebufferadded"),this.mediaSource.sourceBuffers.length<2)?t.on("sourcebufferadded",(function(){i.start_()})):this.start_()}},{key:"start_",value:function(){var e=this;this.started_=!0,this.onUpdateendCallback_=function(){var t=e.pendingCallback_;e.pendingCallback_=null,e.logger_("buffered ["+Rs(e.buffered())+"]"),t&&t(),e.runCallback_()},this.sourceBuffer_.addEventListener("updateend",this.onUpdateendCallback_),this.runCallback_()}},{key:"abort",value:function(e){var t=this;this.processedAppend_&&this.queueCallback_((function(){t.sourceBuffer_.abort()}),e)}},{key:"appendBuffer",value:function(e,t){var i=this;this.processedAppend_=!0,this.queueCallback_((function(){i.sourceBuffer_.appendBuffer(e)}),t)}},{key:"buffered",value:function(){return this.sourceBuffer_?this.sourceBuffer_.buffered:Ra.createTimeRanges()}},{key:"remove",value:function(e,t){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:vo;this.processedAppend_&&this.queueCallback_((function(){i.logger_("remove ["+e+" => "+t+"]"),i.sourceBuffer_.remove(e,t)}),n)}},{key:"updating",value:function(){return!this.sourceBuffer_||this.sourceBuffer_.updating||this.pendingCallback_}},{key:"timestampOffset",value:function(e){var t=this;return void 0!==e&&(this.queueCallback_((function(){t.sourceBuffer_.timestampOffset=e})),this.timestampOffset_=e),this.timestampOffset_}},{key:"queueCallback_",value:function(e,t){this.callbacks_.push([e.bind(this),t]),this.runCallback_()}},{key:"runCallback_",value:function(){var e=void 0;!this.updating()&&this.callbacks_.length&&this.started_&&(e=this.callbacks_.shift(),this.pendingCallback_=e[1],e[0]())}},{key:"dispose",value:function(){this.sourceBuffer_.removeEventListener("updateend",this.onUpdateendCallback_),this.sourceBuffer_&&"open"===this.mediaSource.readyState&&this.sourceBuffer_.abort()}}]),e}(),bo={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,BUFFER_LOW_WATER_LINE_RATE:1},To=2,So=-101,ko=-102,wo=function(e){var t,i,n={};return e.byterange&&(n.Range=(t=e.byterange,i=t.offset+t.length-1,"bytes="+t.offset+"-"+i)),n},Co=function(e){e.forEach((function(e){e.abort()}))},Eo=function(e,t){return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:So,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:ko,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:To,xhr:t}:null},Ao=function(e,t,i){var n=0,r=!1;return function(a,s){if(!r)return a?(r=!0,Co(e),i(a,s)):(n+=1)===e.length?(s.endOfAllRequests=Date.now(),s.encryptedBytes?function(e,t,i){e.addEventListener("message",(function n(r){if(r.data.source===t.requestId){e.removeEventListener("message",n);var a=r.data.decrypted;return t.bytes=new Uint8Array(a.bytes,a.byteOffset,a.byteLength),i(null,t)}})),e.postMessage(Ss({source:t.requestId,encrypted:t.encryptedBytes,key:t.key.bytes,iv:t.key.iv}),[t.encryptedBytes.buffer,t.key.bytes.buffer])}(t,s,i):i(null,s)):void 0}},Lo=function(e,t){return function(i){var n,r,a;return e.stats=Ra.mergeOptions(e.stats,(r=(n=i).target,(a={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-r.requestTime||0}).bytesReceived=n.loaded,a.bandwidth=Math.floor(a.bytesReceived/a.roundTripTime*8*1e3),a)),!e.stats.firstBytesReceivedAt&&e.stats.bytesReceived&&(e.stats.firstBytesReceivedAt=Date.now()),t(i,e)}},Oo=function(e,t,i,n,r,a,s){var o=[],u=Ao(o,i,s);if(r.key){var l=e(Ra.mergeOptions(t,{uri:r.key.resolvedUri,responseType:"arraybuffer"}),function(e,t){return function(i,n){var r=n.response,a=Eo(i,n);if(a)return t(a,e);if(16!==r.byteLength)return t({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:To,xhr:n},e);var s=new DataView(r);return e.key.bytes=new Uint32Array([s.getUint32(0),s.getUint32(4),s.getUint32(8),s.getUint32(12)]),t(null,e)}}(r,u));o.push(l)}if(r.map&&!r.map.bytes){var c=e(Ra.mergeOptions(t,{uri:r.map.resolvedUri,responseType:"arraybuffer",headers:wo(r.map)}),function(e,t,i){return function(n,r){var a=r.response,s=Eo(n,r);return s?i(s,e):0===a.byteLength?i({status:r.status,message:"Empty HLS segment content at URL: "+r.uri,code:To,xhr:r},e):(e.map.bytes=new Uint8Array(r.response),t.isInitialized()||t.init(),e.map.timescales=me().timescale(e.map.bytes),e.map.videoTrackIds=me().videoTrackIds(e.map.bytes),i(null,e))}}(r,n,u));o.push(c)}var h=e(Ra.mergeOptions(t,{uri:r.resolvedUri,responseType:"arraybuffer",headers:wo(r)}),function(e,t,i){return function(n,r){var a=r.response,s=Eo(n,r),o=void 0;return s?i(s,e):0===a.byteLength?i({status:r.status,message:"Empty HLS segment content at URL: "+r.uri,code:To,xhr:r},e):(e.stats=function(e){return{bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}}(r),e.key?e.encryptedBytes=new Uint8Array(r.response):e.bytes=new Uint8Array(r.response),e.map&&e.map.bytes&&(t.isInitialized()||t.init(),(o=t.parse(e.bytes,e.map.videoTrackIds,e.map.timescales))&&o.captions&&(e.captionStreams=o.captionStreams,e.fmp4Captions=o.captions)),i(null,e))}}(r,n,u));return h.addEventListener("progress",Lo(r,a)),o.push(h),function(){return Co(o)}},Po=function(e,t){var i;return e&&(i=f().getComputedStyle(e))?i[t]:""},xo=function(e,t){var i=e.slice();e.sort((function(e,n){var r=t(e,n);return 0===r?i.indexOf(e)-i.indexOf(n):r}))},Uo=function(e,t){var i=void 0,n=void 0;return e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||f().Number.MAX_VALUE,t.attributes.BANDWIDTH&&(n=t.attributes.BANDWIDTH),i-(n=n||f().Number.MAX_VALUE)},Io=function(e,t,i){if(!e||!t)return!1;var n=i===e.segments.length;return e.endList&&"open"===t.readyState&&n},Do=function(e){return"number"==typeof e&&isFinite(e)},Ro=function(e){function t(e){ja(this,t);var i=qa(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));if(!e)throw new TypeError("Initialization settings are required");if("function"!=typeof e.currentTime)throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");return i.bandwidth=e.bandwidth,i.throughput={rate:0,count:0},i.roundTrip=NaN,i.resetStats_(),i.mediaIndex=null,i.hasPlayed_=e.hasPlayed,i.currentTime_=e.currentTime,i.seekable_=e.seekable,i.seeking_=e.seeking,i.duration_=e.duration,i.mediaSource_=e.mediaSource,i.hls_=e.hls,i.loaderType_=e.loaderType,i.startingMedia_=void 0,i.segmentMetadataTrack_=e.segmentMetadataTrack,i.goalBufferLength_=e.goalBufferLength,i.sourceType_=e.sourceType,i.inbandTextTracks_=e.inbandTextTracks,i.state_="INIT",i.checkBufferTimeout_=null,i.error_=void 0,i.currentTimeline_=-1,i.pendingSegment_=null,i.mimeType_=null,i.sourceUpdater_=null,i.xhrOptions_=null,i.activeInitSegmentId_=null,i.initSegments_={},i.captionParser_=new ge.CaptionParser,i.decrypter_=e.decrypter,i.syncController_=e.syncController,i.syncPoint_={segmentIndex:0,time:0},i.syncController_.on("syncinfoupdate",(function(){return i.trigger("syncinfoupdate")})),i.mediaSource_.addEventListener("sourceopen",(function(){return i.ended_=!1})),i.fetchAtBuffer_=!1,i.logger_=yo("SegmentLoader["+i.loaderType_+"]"),Object.defineProperty(i,"state",{get:function(){return this.state_},set:function(e){e!==this.state_&&(this.logger_(this.state_+" -> "+e),this.state_=e)}}),i}return Ha(t,e),Fa(t,[{key:"resetStats_",value:function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0}},{key:"dispose",value:function(){this.state="DISPOSED",this.pause(),this.abort_(),this.sourceUpdater_&&this.sourceUpdater_.dispose(),this.resetStats_(),this.captionParser_.reset()}},{key:"abort",value:function(){"WAITING"===this.state?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)}},{key:"abort_",value:function(){this.pendingSegment_&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null}},{key:"error",value:function(e){return void 0!==e&&(this.error_=e),this.pendingSegment_=null,this.error_}},{key:"endOfStream",value:function(){this.ended_=!0,this.pause(),this.trigger("ended")}},{key:"buffered_",value:function(){return this.sourceUpdater_?this.sourceUpdater_.buffered():Ra.createTimeRanges()}},{key:"initSegment",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return null;var i=ks(e),n=this.initSegments_[i];return t&&!n&&e.bytes&&(this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,timescales:e.timescales,videoTrackIds:e.videoTrackIds}),n||e}},{key:"couldBeginLoading_",value:function(){return this.playlist_&&(this.sourceUpdater_||this.mimeType_&&"INIT"===this.state)&&!this.paused()}},{key:"load",value:function(){if(this.monitorBuffer_(),this.playlist_){if(this.syncController_.setDateTimeMapping(this.playlist_),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY")}}},{key:"init_",value:function(){return this.state="READY",this.sourceUpdater_=new _o(this.mediaSource_,this.mimeType_,this.loaderType_,this.sourceBufferEmitter_),this.resetEverything(),this.monitorBuffer_()}},{key:"playlist",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e){var i=this.playlist_,n=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,this.hasPlayed_()||(e.syncInfo={mediaSequence:e.mediaSequence,time:0});var r=i?i.id:null;if(this.logger_("playlist update ["+r+" => "+e.id+"]"),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(i&&i.uri===e.uri){var a=e.mediaSequence-i.mediaSequence;this.logger_("live window shift ["+a+"]"),null!==this.mediaIndex&&(this.mediaIndex-=a),n&&(n.mediaIndex-=a,n.mediaIndex>=0&&(n.segment=e.segments[n.mediaIndex])),this.syncController_.saveExpiredSegmentInfo(i,e)}else null!==this.mediaIndex&&this.resyncLoader()}}},{key:"pause",value:function(){this.checkBufferTimeout_&&(f().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}},{key:"paused",value:function(){return null===this.checkBufferTimeout_}},{key:"mimeType",value:function(e,t){this.mimeType_||(this.mimeType_=e,this.sourceBufferEmitter_=t,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_())}},{key:"resetEverything",value:function(e){this.ended_=!1,this.resetLoader(),this.remove(0,this.duration_(),e),this.captionParser_.clearAllCaptions(),this.trigger("reseteverything")}},{key:"resetLoader",value:function(){this.fetchAtBuffer_=!1,this.resyncLoader()}},{key:"resyncLoader",value:function(){this.mediaIndex=null,this.syncPoint_=null,this.abort()}},{key:"remove",value:function(e,t,i){if(this.sourceUpdater_&&this.sourceUpdater_.remove(e,t,i),Bs(e,t,this.segmentMetadataTrack_),this.inbandTextTracks_)for(var n in this.inbandTextTracks_)Bs(e,t,this.inbandTextTracks_[n])}},{key:"monitorBuffer_",value:function(){this.checkBufferTimeout_&&f().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=f().setTimeout(this.monitorBufferTick_.bind(this),1)}},{key:"monitorBufferTick_",value:function(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&f().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=f().setTimeout(this.monitorBufferTick_.bind(this),500)}},{key:"fillBuffer_",value:function(){if(!this.sourceUpdater_.updating()){this.syncPoint_||(this.syncPoint_=this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_()));var e=this.checkBuffer_(this.buffered_(),this.playlist_,this.mediaIndex,this.hasPlayed_(),this.currentTime_(),this.syncPoint_);if(e)Io(this.playlist_,this.mediaSource_,e.mediaIndex)?this.endOfStream():(e.mediaIndex!==this.playlist_.segments.length-1||"ended"!==this.mediaSource_.readyState||this.seeking_())&&((e.timeline!==this.currentTimeline_||null!==e.startOfSegment&&e.startOfSegment<this.sourceUpdater_.timestampOffset())&&(this.syncController_.reset(),e.timestampOffset=e.startOfSegment,this.captionParser_.clearAllCaptions()),this.loadSegment_(e))}}},{key:"checkBuffer_",value:function(e,t,i,n,r,a){var s=0,o=void 0;e.length&&(s=e.end(e.length-1));var u=Math.max(0,s-r);if(!t.segments.length)return null;if(u>=this.goalBufferLength_())return null;if(!n&&u>=1)return null;if(null===a)return i=this.getSyncSegmentCandidate_(t),this.generateSegmentInfo_(t,i,null,!0);if(null!==i){var l=t.segments[i];return o=l&&l.end?l.end:s,this.generateSegmentInfo_(t,i+1,o,!1)}if(this.fetchAtBuffer_){var c=ms.getMediaInfoForTime(t,s,a.segmentIndex,a.time);i=c.mediaIndex,o=c.startTime}else{var h=ms.getMediaInfoForTime(t,r,a.segmentIndex,a.time);i=h.mediaIndex,o=h.startTime}return this.generateSegmentInfo_(t,i,o,!1)}},{key:"getSyncSegmentCandidate_",value:function(e){var t=this;if(-1===this.currentTimeline_)return 0;var i=e.segments.map((function(e,t){return{timeline:e.timeline,segmentIndex:t}})).filter((function(e){return e.timeline===t.currentTimeline_}));return i.length?i[Math.min(i.length-1,1)].segmentIndex:Math.max(e.segments.length-1,0)}},{key:"generateSegmentInfo_",value:function(e,t,i,n){if(t<0||t>=e.segments.length)return null;var r=e.segments[t];return{requestId:"segment-loader-"+Math.random(),uri:r.resolvedUri,mediaIndex:t,isSyncRequest:n,startOfSegment:i,playlist:e,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:r.timeline,duration:r.duration,segment:r}}},{key:"abortRequestEarly_",value:function(e){if(this.hls_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH)return!1;if(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return!1;var t=this.currentTime_(),i=e.bandwidth,n=this.pendingSegment_.duration,r=ms.estimateSegmentRequestTime(n,i,this.playlist_,e.bytesReceived),a=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return((e.length?e.end(e.length-1):0)-t)/i}(this.buffered_(),t,this.hls_.tech_.playbackRate())-1;if(r<=a)return!1;var s=function(e){var t=e.master,i=e.currentTime,n=e.bandwidth,r=e.duration,a=e.segmentDuration,s=e.timeUntilRebuffer,o=e.currentTimeline,u=e.syncController,l=t.playlists.filter((function(e){return!ms.isIncompatible(e)})),c=l.filter(ms.isEnabled);c.length||(c=l.filter((function(e){return!ms.isDisabled(e)})));var h=c.filter(ms.hasAttribute.bind(null,"BANDWIDTH")).map((function(e){var t=u.getSyncPoint(e,r,o,i)?1:2;return{playlist:e,rebufferingImpact:ms.estimateSegmentRequestTime(a,n,e)*t-s}})),d=h.filter((function(e){return e.rebufferingImpact<=0}));return xo(d,(function(e,t){return Uo(t.playlist,e.playlist)})),d.length?d[0]:(xo(h,(function(e,t){return e.rebufferingImpact-t.rebufferingImpact})),h[0]||null)}({master:this.hls_.playlists.master,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:n,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(s){var o=r-a-s.rebufferingImpact,u=.5;return a<=Ps&&(u=1),!s.playlist||s.playlist.uri===this.playlist_.uri||o<u?!1:(this.bandwidth=s.playlist.attributes.BANDWIDTH*bo.BANDWIDTH_VARIANCE+1,this.abort(),this.trigger("earlyabort"),!0)}}},{key:"handleProgress_",value:function(e,t){this.pendingSegment_&&t.requestId===this.pendingSegment_.requestId&&!this.abortRequestEarly_(t.stats)&&this.trigger("progress")}},{key:"loadSegment_",value:function(e){this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),e.abortRequests=Oo(this.hls_.xhr,this.xhrOptions_,this.decrypter_,this.captionParser_,this.createSimplifiedSegmentObj_(e),this.handleProgress_.bind(this),this.segmentRequestFinished_.bind(this))}},{key:"trimBackBuffer_",value:function(e){var t=function(e,t,i){var n=void 0;return n=e.length&&e.start(0)>0&&e.start(0)<t?e.start(0):t-30,Math.min(n,t-i)}(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}},{key:"createSimplifiedSegmentObj_",value:function(e){var t=e.segment,i={resolvedUri:t.resolvedUri,byterange:t.byterange,requestId:e.requestId};if(t.key){var n=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);i.key={resolvedUri:t.key.resolvedUri,iv:n}}return t.map&&(i.map=this.initSegment(t.map)),i}},{key:"segmentRequestFinished_",value:function(e,t){if(this.mediaRequests+=1,t.stats&&(this.mediaBytesTransferred+=t.stats.bytesReceived,this.mediaTransferDuration+=t.stats.roundTripTime),this.pendingSegment_){if(t.requestId===this.pendingSegment_.requestId){if(e)return this.pendingSegment_=null,this.state="READY",e.code===ko?void(this.mediaRequestsAborted+=1):(this.pause(),e.code===So?(this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,void this.trigger("bandwidthupdate")):(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error")));this.bandwidth=t.stats.bandwidth,this.roundTrip=t.stats.roundTripTime,t.map&&(t.map=this.initSegment(t.map,!0)),this.processSegmentResponse_(t)}}else this.mediaRequestsAborted+=1}},{key:"processSegmentResponse_",value:function(e){var t=this.pendingSegment_;t.bytes=e.bytes,e.map&&(t.segment.map.bytes=e.map.bytes),t.endOfAllRequests=e.endOfAllRequests,e.fmp4Captions&&(!function(e,t,i){for(var n in i)if(!e[n]){t.trigger({type:"usage",name:"hls-608"});var r=t.textTracks().getTrackById(n);e[n]=r||t.addRemoteTextTrack({kind:"captions",id:n,label:n},!1).track}}(this.inbandTextTracks_,this.hls_.tech_,e.captionStreams),function(e){var t=e.inbandTextTracks,i=e.captionArray,n=e.timestampOffset;if(i){var r=window.WebKitDataCue||window.VTTCue;i.forEach((function(e){var i=e.stream,a=e.startTime,s=e.endTime;t[i]&&(a+=n,s+=n,t[i].addCue(new r(a,s,e.text)))}))}}({inbandTextTracks:this.inbandTextTracks_,captionArray:e.fmp4Captions,timestampOffset:0}),this.captionParser_.clearParsedCaptions()),this.handleSegment_()}},{key:"handleSegment_",value:function(){var e=this;if(this.pendingSegment_){var t=this.pendingSegment_,i=t.segment,n=this.syncController_.probeSegmentInfo(t);void 0===this.startingMedia_&&n&&(n.containsAudio||n.containsVideo)&&(this.startingMedia_={containsAudio:n.containsAudio,containsVideo:n.containsVideo});var r,a,s,o=(r=this.loaderType_,a=this.startingMedia_,s=n,"main"===r&&a&&s?s.containsAudio||s.containsVideo?a.containsVideo&&!s.containsVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!a.containsVideo&&s.containsVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null);if(o)return this.error({message:o,blacklistDuration:1/0}),void this.trigger("error");if(t.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");null!==t.timestampOffset&&t.timestampOffset!==this.sourceUpdater_.timestampOffset()&&(this.sourceUpdater_.timestampOffset(t.timestampOffset),this.trigger("timestampoffset"));var u=this.syncController_.mappingForTimeline(t.timeline);if(null!==u&&this.trigger({type:"segmenttimemapping",mapping:u}),this.state="APPENDING",i.map){var l=ks(i.map);if(!this.activeInitSegmentId_||this.activeInitSegmentId_!==l){var c=this.initSegment(i.map);this.sourceUpdater_.appendBuffer(c.bytes,(function(){e.activeInitSegmentId_=l}))}}t.byteLength=t.bytes.byteLength,"number"==typeof i.start&&"number"==typeof i.end?this.mediaSecondsLoaded+=i.end-i.start:this.mediaSecondsLoaded+=i.duration,this.logger_(function(e){var t=e.segment,i=t.start,n=t.end,r=e.playlist,a=r.mediaSequence,s=r.id,o=r.segments,u=void 0===o?[]:o,l=e.mediaIndex,c=e.timeline;return["appending ["+l+"] of ["+a+", "+(a+u.length)+"] from playlist ["+s+"]","["+i+" => "+n+"] in timeline ["+c+"]"].join(" ")}(t)),this.sourceUpdater_.appendBuffer(t.bytes,this.handleUpdateEnd_.bind(this))}else this.state="READY"}},{key:"handleUpdateEnd_",value:function(){if(!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());var e=this.pendingSegment_,t=e.segment,i=null!==this.mediaIndex;(this.pendingSegment_=null,this.recordThroughput_(e),this.addSegmentMetadataCue_(e),this.state="READY",this.mediaIndex=e.mediaIndex,this.fetchAtBuffer_=!0,this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate"),t.end&&this.currentTime_()-t.end>3*e.playlist.targetDuration)?this.resetEverything():(i&&this.trigger("bandwidthupdate"),this.trigger("progress"),Io(e.playlist,this.mediaSource_,e.mediaIndex+1)&&this.endOfStream(),this.paused()||this.monitorBuffer_())}},{key:"recordThroughput_",value:function(e){var t=this.throughput.rate,i=Date.now()-e.endOfAllRequests+1,n=Math.floor(e.byteLength/i*8*1e3);this.throughput.rate+=(n-t)/++this.throughput.count}},{key:"addSegmentMetadataCue_",value:function(e){if(this.segmentMetadataTrack_){var t=e.segment,i=t.start,n=t.end;if(Do(i)&&Do(n)){Bs(i,n,this.segmentMetadataTrack_);var r=f().WebKitDataCue||f().VTTCue,a={dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.uri,start:i,end:n},s=new r(i,n,JSON.stringify(a));s.value=a,this.segmentMetadataTrack_.addCue(s)}}}}]),t}(Ra.EventTarget),Mo=function(e){return decodeURIComponent(escape(String.fromCharCode.apply(null,e)))},Bo=new Uint8Array("\n\n".split("").map((function(e){return e.charCodeAt(0)}))),No=function(e){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ja(this,t);var n=qa(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,i));return n.mediaSource_=null,n.subtitlesTrack_=null,n}return Ha(t,e),Fa(t,[{key:"buffered_",value:function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues.length)return Ra.createTimeRanges();var e=this.subtitlesTrack_.cues,t=e[0].startTime,i=e[e.length-1].startTime;return Ra.createTimeRanges([[t,i]])}},{key:"initSegment",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return null;var i=ks(e),n=this.initSegments_[i];if(t&&!n&&e.bytes){var r=Bo.byteLength+e.bytes.byteLength,a=new Uint8Array(r);a.set(e.bytes),a.set(Bo,e.bytes.byteLength),this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:a}}return n||e}},{key:"couldBeginLoading_",value:function(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}},{key:"init_",value:function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}},{key:"track",value:function(e){return void 0===e||(this.subtitlesTrack_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_}},{key:"remove",value:function(e,t){Bs(e,t,this.subtitlesTrack_)}},{key:"fillBuffer_",value:function(){var e=this;this.syncPoint_||(this.syncPoint_=this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_()));var t=this.checkBuffer_(this.buffered_(),this.playlist_,this.mediaIndex,this.hasPlayed_(),this.currentTime_(),this.syncPoint_);if(t=this.skipEmptySegments_(t)){if(null===this.syncController_.timestampOffsetForTimeline(t.timeline)){return this.syncController_.one("timestampoffset",(function(){e.state="READY",e.paused()||e.monitorBuffer_()})),void(this.state="WAITING_ON_TIMELINE")}this.loadSegment_(t)}}},{key:"skipEmptySegments_",value:function(e){for(;e&&e.segment.empty;)e=this.generateSegmentInfo_(e.playlist,e.mediaIndex+1,e.startOfSegment+e.duration,e.isSyncRequest);return e}},{key:"handleSegment_",value:function(){var e=this;if(this.pendingSegment_&&this.subtitlesTrack_){this.state="APPENDING";var t=this.pendingSegment_,i=t.segment;if("function"!=typeof f().WebVTT&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){var n=function(){e.handleSegment_()};return this.state="WAITING_ON_VTTJS",this.subtitlesTrack_.tech_.one("vttjsloaded",n),void this.subtitlesTrack_.tech_.one("vttjserror",(function(){e.subtitlesTrack_.tech_.off("vttjsloaded",n),e.error({message:"Error loading vtt.js"}),e.state="READY",e.pause(),e.trigger("error")}))}i.requested=!0;try{this.parseVTTCues_(t)}catch(e){return this.error({message:e.message}),this.state="READY",this.pause(),this.trigger("error")}if(this.updateTimeMapping_(t,this.syncController_.timelines[t.timeline],this.playlist_),t.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");t.byteLength=t.bytes.byteLength,this.mediaSecondsLoaded+=i.duration,t.cues.length&&this.remove(t.cues[0].endTime,t.cues[t.cues.length-1].endTime),t.cues.forEach((function(t){e.subtitlesTrack_.addCue(t)})),this.handleUpdateEnd_()}else this.state="READY"}},{key:"parseVTTCues_",value:function(e){var t=void 0,i=!1;"function"==typeof f().TextDecoder?t=new(f().TextDecoder)("utf8"):(t=f().WebVTT.StringDecoder(),i=!0);var n=new(f().WebVTT.Parser)(f(),f().vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},n.oncue=e.cues.push.bind(e.cues),n.ontimestampmap=function(t){return e.timestampmap=t},n.onparsingerror=function(e){Ra.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){var r=e.segment.map.bytes;i&&(r=Mo(r)),n.parse(r)}var a=e.bytes;i&&(a=Mo(a)),n.parse(a),n.flush()}},{key:"updateTimeMapping_",value:function(e,t,i){var n=e.segment;if(t)if(e.cues.length){var r=e.timestampmap,a=r.MPEGTS/9e4-r.LOCAL+t.mapping;if(e.cues.forEach((function(e){e.startTime+=a,e.endTime+=a})),!i.syncInfo){var s=e.cues[0].startTime,o=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(s,o-n.duration)}}}else n.empty=!0}}]),t}(Ro),jo=function(e,t){for(var i=e.cues,n=0;n<i.length;n++){var r=i[n];if(t>=r.adStartTime&&t<=r.adEndTime)return r}return null},Fo=ve().inspect,Vo=[{name:"VOD",run:function(e,t,i,n,r){if(i!==1/0){return{time:0,segmentIndex:0}}return null}},{name:"ProgramDateTime",run:function(e,t,i,n,r){if(!e.datetimeToDisplayTime)return null;var a=t.segments||[],s=null,o=null;r=r||0;for(var u=0;u<a.length;u++){var l=a[u];if(l.dateTimeObject){var c=l.dateTimeObject.getTime()/1e3+e.datetimeToDisplayTime,h=Math.abs(r-c);if(null!==o&&o<h)break;o=h,s={time:c,segmentIndex:u}}}return s}},{name:"Segment",run:function(e,t,i,n,r){var a=t.segments||[],s=null,o=null;r=r||0;for(var u=0;u<a.length;u++){var l=a[u];if(l.timeline===n&&void 0!==l.start){var c=Math.abs(r-l.start);if(null!==o&&o<c)break;(!s||null===o||o>=c)&&(o=c,s={time:l.start,segmentIndex:u})}}return s}},{name:"Discontinuity",run:function(e,t,i,n,r){var a=null;if(r=r||0,t.discontinuityStarts&&t.discontinuityStarts.length)for(var s=null,o=0;o<t.discontinuityStarts.length;o++){var u=t.discontinuityStarts[o],l=t.discontinuitySequence+o+1,c=e.discontinuities[l];if(c){var h=Math.abs(r-c.time);if(null!==s&&s<h)break;(!a||null===s||s>=h)&&(s=h,a={time:c.time,segmentIndex:u})}}return a}},{name:"Playlist",run:function(e,t,i,n,r){return t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence}:null}}],Ho=function(e){function t(){ja(this,t);var e=qa(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.inspectCache_=void 0,e.timelines=[],e.discontinuities=[],e.datetimeToDisplayTime=null,e.logger_=yo("SyncController"),e}return Ha(t,e),Fa(t,[{key:"getSyncPoint",value:function(e,t,i,n){var r=this.runStrategies_(e,t,i,n);return r.length?this.selectSyncPoint_(r,{key:"time",value:n}):null}},{key:"getExpiredTime",value:function(e,t){if(!e||!e.segments)return null;var i=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!i.length)return null;var n=this.selectSyncPoint_(i,{key:"segmentIndex",value:0});return n.segmentIndex>0&&(n.time*=-1),Math.abs(n.time+ns(e,n.segmentIndex,0))}},{key:"runStrategies_",value:function(e,t,i,n){for(var r=[],a=0;a<Vo.length;a++){var s=Vo[a],o=s.run(this,e,t,i,n);o&&(o.strategy=s.name,r.push({strategy:s.name,syncPoint:o}))}return r}},{key:"selectSyncPoint_",value:function(e,t){for(var i=e[0].syncPoint,n=Math.abs(e[0].syncPoint[t.key]-t.value),r=e[0].strategy,a=1;a<e.length;a++){var s=Math.abs(e[a].syncPoint[t.key]-t.value);s<n&&(n=s,i=e[a].syncPoint,r=e[a].strategy)}return this.logger_("syncPoint for ["+t.key+": "+t.value+"] chosen with strategy ["+r+"]: [time:"+i.time+", segmentIndex:"+i.segmentIndex+"]"),i}},{key:"saveExpiredSegmentInfo",value:function(e,t){for(var i=t.mediaSequence-e.mediaSequence-1;i>=0;i--){var n=e.segments[i];if(n&&void 0!==n.start){t.syncInfo={mediaSequence:e.mediaSequence+i,time:n.start},this.logger_("playlist refresh sync: [time:"+t.syncInfo.time+", mediaSequence: "+t.syncInfo.mediaSequence+"]"),this.trigger("syncinfoupdate");break}}}},{key:"setDateTimeMapping",value:function(e){if(!this.datetimeToDisplayTime&&e.segments&&e.segments.length&&e.segments[0].dateTimeObject){var t=e.segments[0].dateTimeObject.getTime()/1e3;this.datetimeToDisplayTime=-t}}},{key:"reset",value:function(){this.inspectCache_=void 0}},{key:"probeSegmentInfo",value:function(e){var t=e.segment,i=e.playlist,n=void 0;return(n=t.map?this.probeMp4Segment_(e):this.probeTsSegment_(e))&&this.calculateSegmentTimeMapping_(e,n)&&(this.saveDiscontinuitySyncInfo_(e),i.syncInfo||(i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:t.start})),n}},{key:"probeMp4Segment_",value:function(e){var t=e.segment,i=me().timescale(t.map.bytes),n=me().startTime(i,e.bytes);return null!==e.timestampOffset&&(e.timestampOffset-=n),{start:n,end:n+t.duration}}},{key:"probeTsSegment_",value:function(e){var t=Fo(e.bytes,this.inspectCache_),i=void 0,n=void 0;return t?(t.video&&2===t.video.length?(this.inspectCache_=t.video[1].dts,i=t.video[0].dtsTime,n=t.video[1].dtsTime):t.audio&&2===t.audio.length&&(this.inspectCache_=t.audio[1].dts,i=t.audio[0].dtsTime,n=t.audio[1].dtsTime),{start:i,end:n,containsVideo:t.video&&2===t.video.length,containsAudio:t.audio&&2===t.audio.length}):null}},{key:"timestampOffsetForTimeline",value:function(e){return void 0===this.timelines[e]?null:this.timelines[e].time}},{key:"mappingForTimeline",value:function(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping}},{key:"calculateSegmentTimeMapping_",value:function(e,t){var i=e.segment,n=this.timelines[e.timeline];if(null!==e.timestampOffset)n={time:e.startOfSegment,mapping:e.startOfSegment-t.start},this.timelines[e.timeline]=n,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+e.timeline+": [time: "+n.time+"] [mapping: "+n.mapping+"]"),i.start=e.startOfSegment,i.end=t.end+n.mapping;else{if(!n)return!1;i.start=t.start+n.mapping,i.end=t.end+n.mapping}return!0}},{key:"saveDiscontinuitySyncInfo_",value:function(e){var t=e.playlist,i=e.segment;if(i.discontinuity)this.discontinuities[i.timeline]={time:i.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(var n=0;n<t.discontinuityStarts.length;n++){var r=t.discontinuityStarts[n],a=t.discontinuitySequence+n+1,s=r-e.mediaIndex,o=Math.abs(s);if(!this.discontinuities[a]||this.discontinuities[a].accuracy>o){var u=void 0;u=s<0?i.start-ns(t,e.mediaIndex,r):i.end+ns(t,e.mediaIndex+1,r),this.discontinuities[a]={time:u,accuracy:o}}}}}]),t}(Ra.EventTarget),qo=new Ws("./decrypter-worker.worker.js",(function(e,t){var i=this;!function(){var e=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},t=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),n=null,r=function(){function t(i){e(this,t),n||(n=function(){var e=[[[],[],[],[],[]],[[],[],[],[],[]]],t=e[0],i=e[1],n=t[4],r=i[4],a=void 0,s=void 0,o=void 0,u=[],l=[],c=void 0,h=void 0,d=void 0,p=void 0,f=void 0;for(a=0;a<256;a++)l[(u[a]=a<<1^283*(a>>7))^a]=a;for(s=o=0;!n[s];s^=c||1,o=l[o]||1)for(d=(d=o^o<<1^o<<2^o<<3^o<<4)>>8^255&d^99,n[s]=d,r[d]=s,f=16843009*u[h=u[c=u[s]]]^65537*h^257*c^16843008*s,p=257*u[d]^16843008*d,a=0;a<4;a++)t[a][s]=p=p<<24^p>>>8,i[a][d]=f=f<<24^f>>>8;for(a=0;a<5;a++)t[a]=t[a].slice(0),i[a]=i[a].slice(0);return e}()),this._tables=[[n[0][0].slice(),n[0][1].slice(),n[0][2].slice(),n[0][3].slice(),n[0][4].slice()],[n[1][0].slice(),n[1][1].slice(),n[1][2].slice(),n[1][3].slice(),n[1][4].slice()]];var r=void 0,a=void 0,s=void 0,o=void 0,u=void 0,l=this._tables[0][4],c=this._tables[1],h=i.length,d=1;if(4!==h&&6!==h&&8!==h)throw new Error("Invalid aes key size");for(o=i.slice(0),u=[],this._key=[o,u],r=h;r<4*h+28;r++)s=o[r-1],(r%h==0||8===h&&r%h==4)&&(s=l[s>>>24]<<24^l[s>>16&255]<<16^l[s>>8&255]<<8^l[255&s],r%h==0&&(s=s<<8^s>>>24^d<<24,d=d<<1^283*(d>>7))),o[r]=o[r-h]^s;for(a=0;r;a++,r--)s=o[3&a?r:r-4],u[a]=r<=4||a<4?s:c[0][l[s>>>24]]^c[1][l[s>>16&255]]^c[2][l[s>>8&255]]^c[3][l[255&s]]}return t.prototype.decrypt=function(e,t,i,n,r,a){var s=this._key[1],o=e^s[0],u=n^s[1],l=i^s[2],c=t^s[3],h=void 0,d=void 0,p=void 0,f=s.length/4-2,m=void 0,g=4,y=this._tables[1],v=y[0],_=y[1],b=y[2],T=y[3],S=y[4];for(m=0;m<f;m++)h=v[o>>>24]^_[u>>16&255]^b[l>>8&255]^T[255&c]^s[g],d=v[u>>>24]^_[l>>16&255]^b[c>>8&255]^T[255&o]^s[g+1],p=v[l>>>24]^_[c>>16&255]^b[o>>8&255]^T[255&u]^s[g+2],c=v[c>>>24]^_[o>>16&255]^b[u>>8&255]^T[255&l]^s[g+3],g+=4,o=h,u=d,l=p;for(m=0;m<4;m++)r[(3&-m)+a]=S[o>>>24]<<24^S[u>>16&255]<<16^S[l>>8&255]<<8^S[255&c]^s[g++],h=o,o=u,u=l,l=c,c=h},t}(),a=function(){function t(){e(this,t),this.listeners={}}return t.prototype.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.prototype.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e].splice(i,1),i>-1},t.prototype.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,n=0;n<i;++n)t[n].call(this,arguments[1]);else for(var r=Array.prototype.slice.call(arguments,1),a=t.length,s=0;s<a;++s)t[s].apply(this,r)},t.prototype.dispose=function(){this.listeners={}},t.prototype.pipe=function(e){this.on("data",(function(t){e.push(t)}))},t}(),s=function(t){function i(){e(this,i);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,t.call(this,a));return n.jobs=[],n.delay=1,n.timeout_=null,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(i,t),i.prototype.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},i.prototype.push=function(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},i}(a),o=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},u=function(){function i(t,n,r,a){e(this,i);var u=i.STEP,l=new Int32Array(t.buffer),c=new Uint8Array(t.byteLength),h=0;for(this.asyncStream_=new s,this.asyncStream_.push(this.decryptChunk_(l.subarray(h,h+u),n,r,c)),h=u;h<l.length;h+=u)r=new Uint32Array([o(l[h-4]),o(l[h-3]),o(l[h-2]),o(l[h-1])]),this.asyncStream_.push(this.decryptChunk_(l.subarray(h,h+u),n,r,c));this.asyncStream_.push((function(){var e;a(null,(e=c).subarray(0,e.byteLength-e[e.byteLength-1]))}))}return i.prototype.decryptChunk_=function(e,t,i,n){return function(){var a=function(e,t,i){var n=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),a=new r(Array.prototype.slice.call(t)),s=new Uint8Array(e.byteLength),u=new Int32Array(s.buffer),l=void 0,c=void 0,h=void 0,d=void 0,p=void 0,f=void 0,m=void 0,g=void 0,y=void 0;for(l=i[0],c=i[1],h=i[2],d=i[3],y=0;y<n.length;y+=4)p=o(n[y]),f=o(n[y+1]),m=o(n[y+2]),g=o(n[y+3]),a.decrypt(p,f,m,g,u,y),u[y]=o(u[y]^l),u[y+1]=o(u[y+1]^c),u[y+2]=o(u[y+2]^h),u[y+3]=o(u[y+3]^d),l=p,c=f,h=m,d=g;return s}(e,t,i);n.set(a,e.byteOffset)}},t(i,null,[{key:"STEP",get:function(){return 32e3}}]),i}();new function(e){e.onmessage=function(t){var i=t.data,n=new Uint8Array(i.encrypted.bytes,i.encrypted.byteOffset,i.encrypted.byteLength),r=new Uint32Array(i.key.bytes,i.key.byteOffset,i.key.byteLength/4),a=new Uint32Array(i.iv.bytes,i.iv.byteOffset,i.iv.byteLength/4);new u(n,r,a,(function(t,n){var r,a;e.postMessage((r={source:i.source,decrypted:n},a={},Object.keys(r).forEach((function(e){var t=r[e];ArrayBuffer.isView(t)?a[e]={bytes:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength}:a[e]=t})),a),[n.buffer])}))}}(i)}()})),zo=function(e){var t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},Wo=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},Go=function(e,t){t.activePlaylistLoader=e,e.load()},Xo={AUDIO:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e],r=t.blacklistCurrentPlaylist;Wo(i,n);var a=n.activeTrack(),s=n.activeGroup(),o=(s.filter((function(e){return e.default}))[0]||s[0]).id,u=n.tracks[o];if(a!==u){for(var l in Ra.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),n.tracks)n.tracks[l].enabled=n.tracks[l]===u;n.onTrackChanged()}else r({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e];Ra.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),Wo(i,n);var r=n.activeTrack();r&&(r.mode="disabled"),n.onTrackChanged()}}},Yo={AUDIO:function(e,t,i){if(t){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,r),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),r),n.paused()||a.load()})),t.on("error",Xo[e](e,i))}},SUBTITLES:function(e,t,i){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e],s=i.mediaTypes[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,r),a.track(s.activeTrack()),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),r),n.paused()||a.load()})),t.on("error",Xo[e](e,i))}},$o=function(e,t){return function(i){return i.attributes[e]===t}},Ko=function(e){return function(t){return t.resolvedUri===e}},Qo={AUDIO:function(e,t){var i=t.hls,n=t.sourceType,r=t.segmentLoaders[e],a=t.requestOptions.withCredentials,s=t.master,o=s.mediaGroups,u=s.playlists,l=t.mediaTypes[e],c=l.groups,h=l.tracks,d=t.masterPlaylistLoader;for(var p in o[e]&&0!==Object.keys(o[e]).length||(o[e]={main:{default:{default:!0}}}),o[e]){c[p]||(c[p]=[]);var f=u.filter($o(e,p));for(var m in o[e][p]){var g=o[e][p][m];f.filter(Ko(g.resolvedUri)).length&&delete g.resolvedUri;var y=void 0;if(y=g.resolvedUri?new Za(g.resolvedUri,i,a):g.playlists&&"dash"===n?new go(g.playlists[0],i,a,d):null,g=Ra.mergeOptions({id:m,playlistLoader:y},g),Yo[e](e,g.playlistLoader,t),c[p].push(g),void 0===h[m]){var v=new Ra.AudioTrack({id:m,kind:zo(g),enabled:!1,language:g.language,default:g.default,label:m});h[m]=v}}}r.on("error",Xo[e](e,t))},SUBTITLES:function(e,t){var i=t.tech,n=t.hls,r=t.sourceType,a=t.segmentLoaders[e],s=t.requestOptions.withCredentials,o=t.master.mediaGroups,u=t.mediaTypes[e],l=u.groups,c=u.tracks,h=t.masterPlaylistLoader;for(var d in o[e])for(var p in l[d]||(l[d]=[]),o[e][d])if(!o[e][d][p].forced){var f=o[e][d][p],m=void 0;if("hls"===r?m=new Za(f.resolvedUri,n,s):"dash"===r&&(m=new go(f.playlists[0],n,s,h)),f=Ra.mergeOptions({id:p,playlistLoader:m},f),Yo[e](e,f.playlistLoader,t),l[d].push(f),void 0===c[p]){var g=i.addRemoteTextTrack({id:p,kind:"subtitles",default:f.default&&f.autoselect,language:f.language,label:p},!1).track;c[p]=g}}a.on("error",Xo[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var i=t.tech,n=t.master.mediaGroups,r=t.mediaTypes[e],a=r.groups,s=r.tracks;for(var o in n[e])for(var u in a[o]||(a[o]=[]),n[e][o]){var l=n[e][o][u];if(l.instreamId.match(/CC\d/)&&(a[o].push(Ra.mergeOptions({id:u},l)),void 0===s[u])){var c=i.addRemoteTextTrack({id:l.instreamId,kind:"captions",default:l.default&&l.autoselect,language:l.language,label:u},!1).track;s[u]=c}}}},Jo={AUDIO:function(e,t){return function(){var i=t.mediaTypes[e].tracks;for(var n in i)if(i[n].enabled)return i[n];return null}},SUBTITLES:function(e,t){return function(){var i=t.mediaTypes[e].tracks;for(var n in i)if("showing"===i[n].mode)return i[n];return null}}},Zo=function(e){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((function(t){Qo[t](t,e)}));var t=e.mediaTypes,i=e.masterPlaylistLoader,n=e.tech,r=e.hls;["AUDIO","SUBTITLES"].forEach((function(i){t[i].activeGroup=function(e,t){return function(i){var n=t.masterPlaylistLoader,r=t.mediaTypes[e].groups,a=n.media();if(!a)return null;var s=null;return a.attributes[e]&&(s=r[a.attributes[e]]),s=s||r.main,void 0===i?s:null===i?null:s.filter((function(e){return e.id===i.id}))[0]||null}}(i,e),t[i].activeTrack=Jo[i](i,e),t[i].onGroupChanged=function(e,t){return function(){var i=t.segmentLoaders,n=i[e],r=i.main,a=t.mediaTypes[e],s=a.activeTrack(),o=a.activeGroup(s),u=a.activePlaylistLoader;Wo(n,a),o&&(o.playlistLoader?(n.resyncLoader(),Go(o.playlistLoader,a)):u&&r.resetEverything())}}(i,e),t[i].onTrackChanged=function(e,t){return function(){var i=t.segmentLoaders,n=i[e],r=i.main,a=t.mediaTypes[e],s=a.activeTrack(),o=a.activeGroup(s),u=a.activePlaylistLoader;Wo(n,a),o&&(o.playlistLoader?u!==o.playlistLoader?(n.track&&n.track(s),n.resetEverything(),Go(o.playlistLoader,a)):Go(o.playlistLoader,a):r.resetEverything())}}(i,e)}));var a=t.AUDIO.activeGroup(),s=(a.filter((function(e){return e.default}))[0]||a[0]).id;t.AUDIO.tracks[s].enabled=!0,t.AUDIO.onTrackChanged(),i.on("mediachange",(function(){["AUDIO","SUBTITLES"].forEach((function(e){return t[e].onGroupChanged()}))}));var o=function(){t.AUDIO.onTrackChanged(),n.trigger({type:"usage",name:"hls-audio-change"})};for(var u in n.audioTracks().addEventListener("change",o),n.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),r.on("dispose",(function(){n.audioTracks().removeEventListener("change",o),n.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)})),n.clearTracks("audio"),t.AUDIO.tracks)n.audioTracks().addTrack(t.AUDIO.tracks[u])},eu=void 0,tu=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred"],iu=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]},nu=function(e){function t(e){ja(this,t);var i,n=qa(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),r=e.url,a=e.withCredentials,s=e.tech,o=e.bandwidth,u=e.externHls,l=e.useCueTags,c=e.blacklistDuration,h=e.enableLowInitialPlaylist,d=e.sourceType,p=e.seekTo;if(!r)throw new Error("A non-empty playlist URL is required");eu=u,n.withCredentials=a,n.tech_=s,n.hls_=s.hls,n.seekTo_=p,n.sourceType_=d,n.useCueTags_=l,n.blacklistDuration=c,n.enableLowInitialPlaylist=h,n.useCueTags_&&(n.cueTagsTrack_=n.tech_.addTextTrack("metadata","ad-cues"),n.cueTagsTrack_.inBandMetadataTrackDispatchType=""),n.requestOptions_={withCredentials:n.withCredentials,timeout:null},n.mediaTypes_=(i={},["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((function(e){i[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:vo,activeTrack:vo,onGroupChanged:vo,onTrackChanged:vo}})),i),n.mediaSource=new Ra.MediaSource,n.mediaSource.addEventListener("sourceopen",n.handleSourceOpen_.bind(n)),n.seekable_=Ra.createTimeRanges(),n.hasPlayed_=function(){return!1},n.syncController_=new Ho(e),n.segmentMetadataTrack_=s.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,n.decrypter_=new qo,n.inbandTextTracks_={};var f={hls:n.hls_,mediaSource:n.mediaSource,currentTime:n.tech_.currentTime.bind(n.tech_),seekable:function(){return n.seekable()},seeking:function(){return n.tech_.seeking()},duration:function(){return n.mediaSource.duration},hasPlayed:function(){return n.hasPlayed_()},goalBufferLength:function(){return n.goalBufferLength()},bandwidth:o,syncController:n.syncController_,decrypter:n.decrypter_,sourceType:n.sourceType_,inbandTextTracks:n.inbandTextTracks_};return n.masterPlaylistLoader_="dash"===n.sourceType_?new go(r,n.hls_,n.withCredentials):new Za(r,n.hls_,n.withCredentials),n.setupMasterPlaylistLoaderListeners_(),n.mainSegmentLoader_=new Ro(Ra.mergeOptions(f,{segmentMetadataTrack:n.segmentMetadataTrack_,loaderType:"main"}),e),n.audioSegmentLoader_=new Ro(Ra.mergeOptions(f,{loaderType:"audio"}),e),n.subtitleSegmentLoader_=new No(Ra.mergeOptions(f,{loaderType:"vtt"}),e),n.setupSegmentLoaderListeners_(),tu.forEach((function(e){n[e+"_"]=iu.bind(n,e)})),n.logger_=yo("MPC"),n.masterPlaylistLoader_.load(),n}return Ha(t,e),Fa(t,[{key:"setupMasterPlaylistLoaderListeners_",value:function(){var e=this;this.masterPlaylistLoader_.on("loadedmetadata",(function(){var t=e.masterPlaylistLoader_.media(),i=1.5*e.masterPlaylistLoader_.targetDuration*1e3;fs(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=i,t.endList&&"none"!==e.tech_.preload()&&(e.mainSegmentLoader_.playlist(t,e.requestOptions_),e.mainSegmentLoader_.load()),Zo({sourceType:e.sourceType_,segmentLoaders:{AUDIO:e.audioSegmentLoader_,SUBTITLES:e.subtitleSegmentLoader_,main:e.mainSegmentLoader_},tech:e.tech_,requestOptions:e.requestOptions_,masterPlaylistLoader:e.masterPlaylistLoader_,hls:e.hls_,master:e.master(),mediaTypes:e.mediaTypes_,blacklistCurrentPlaylist:e.blacklistCurrentPlaylist.bind(e)}),e.triggerPresenceUsage_(e.master(),t);try{e.setupSourceBuffers_()}catch(t){return Ra.log.warn("Failed to create SourceBuffers",t),e.mediaSource.endOfStream("decode")}e.setupFirstPlay(),e.trigger("selectedinitialmedia")})),this.masterPlaylistLoader_.on("loadedplaylist",(function(){var t=e.masterPlaylistLoader_.media();if(!t){e.excludeUnsupportedVariants_();var i=void 0;return e.enableLowInitialPlaylist&&(i=e.selectInitialPlaylist()),i||(i=e.selectPlaylist()),e.initialMedia_=i,void e.masterPlaylistLoader_.media(e.initialMedia_)}if(e.useCueTags_&&e.updateAdCues_(t),e.mainSegmentLoader_.playlist(t,e.requestOptions_),e.updateDuration(),e.tech_.paused()||(e.mainSegmentLoader_.load(),e.audioSegmentLoader_&&e.audioSegmentLoader_.load()),!t.endList){var n=function(){var t=e.seekable();0!==t.length&&e.mediaSource.addSeekableRange_(t.start(0),t.end(0))};if(e.duration()!==1/0){e.tech_.one("durationchange",(function t(){e.duration()===1/0?n():e.tech_.one("durationchange",t)}))}else n()}})),this.masterPlaylistLoader_.on("error",(function(){e.blacklistCurrentPlaylist(e.masterPlaylistLoader_.error)})),this.masterPlaylistLoader_.on("mediachanging",(function(){e.mainSegmentLoader_.abort(),e.mainSegmentLoader_.pause()})),this.masterPlaylistLoader_.on("mediachange",(function(){var t=e.masterPlaylistLoader_.media(),i=1.5*e.masterPlaylistLoader_.targetDuration*1e3;fs(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=i,e.mainSegmentLoader_.playlist(t,e.requestOptions_),e.mainSegmentLoader_.load(),e.tech_.trigger({type:"mediachange",bubbles:!0})})),this.masterPlaylistLoader_.on("playlistunchanged",(function(){var t=e.masterPlaylistLoader_.media();e.stuckAtPlaylistEnd_(t)&&(e.blacklistCurrentPlaylist({message:"Playlist no longer updating."}),e.tech_.trigger("playliststuck"))})),this.masterPlaylistLoader_.on("renditiondisabled",(function(){e.tech_.trigger({type:"usage",name:"hls-rendition-disabled"})})),this.masterPlaylistLoader_.on("renditionenabled",(function(){e.tech_.trigger({type:"usage",name:"hls-rendition-enabled"})}))}},{key:"triggerPresenceUsage_",value:function(e,t){var i=e.mediaGroups||{},n=!0,r=Object.keys(i.AUDIO);for(var a in i.AUDIO)for(var s in i.AUDIO[a]){i.AUDIO[a][s].uri||(n=!1)}n&&this.tech_.trigger({type:"usage",name:"hls-demuxed"}),Object.keys(i.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"hls-webvtt"}),eu.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"hls-aes"}),eu.Playlist.isFmp4(t)&&this.tech_.trigger({type:"usage",name:"hls-fmp4"}),r.length&&Object.keys(i.AUDIO[r[0]]).length>1&&this.tech_.trigger({type:"usage",name:"hls-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"})}},{key:"setupSegmentLoaderListeners_",value:function(){var e=this;this.mainSegmentLoader_.on("bandwidthupdate",(function(){var t=e.selectPlaylist(),i=e.masterPlaylistLoader_.media(),n=e.tech_.buffered(),r=n.length?n.end(n.length-1)-e.tech_.currentTime():0,a=e.bufferLowWaterLine();(!i.endList||e.duration()<bo.MAX_BUFFER_LOW_WATER_LINE||t.attributes.BANDWIDTH<i.attributes.BANDWIDTH||r>=a)&&e.masterPlaylistLoader_.media(t),e.tech_.trigger("bandwidthupdate")})),this.mainSegmentLoader_.on("progress",(function(){e.trigger("progress")})),this.mainSegmentLoader_.on("error",(function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error())})),this.mainSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.mainSegmentLoader_.on("timestampoffset",(function(){e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})})),this.audioSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.mainSegmentLoader_.on("ended",(function(){e.onEndOfStream()})),this.mainSegmentLoader_.on("earlyabort",(function(){e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120)})),this.mainSegmentLoader_.on("reseteverything",(function(){e.tech_.trigger("hls-reset")})),this.mainSegmentLoader_.on("segmenttimemapping",(function(t){e.tech_.trigger({type:"hls-segment-time-mapping",mapping:t.mapping})})),this.audioSegmentLoader_.on("ended",(function(){e.onEndOfStream()}))}},{key:"mediaSecondsLoaded_",value:function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}},{key:"load",value:function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}},{key:"smoothQualityChange_",value:function(){var e=this.selectPlaylist();e!==this.masterPlaylistLoader_.media()&&(this.masterPlaylistLoader_.media(e),this.mainSegmentLoader_.resetLoader())}},{key:"fastQualityChange_",value:function(){var e=this,t=this.selectPlaylist();t!==this.masterPlaylistLoader_.media()&&(this.masterPlaylistLoader_.media(t),this.mainSegmentLoader_.resetEverything((function(){Ra.browser.IE_VERSION||Ra.browser.IS_EDGE?e.tech_.setCurrentTime(e.tech_.currentTime()+.04):e.tech_.setCurrentTime(e.tech_.currentTime())})))}},{key:"play",value:function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.seekTo_(0),this.hasPlayed_()&&this.load();var e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0)?this.seekTo_(e.end(e.length-1)):void 0}}},{key:"setupFirstPlay",value:function(){var e=this,t=this.masterPlaylistLoader_.media();if(!t||this.tech_.paused()||this.hasPlayed_())return!1;if(!t.endList){var i=this.seekable();if(!i.length)return!1;if(Ra.browser.IE_VERSION&&0===this.tech_.readyState())return this.tech_.one("loadedmetadata",(function(){e.trigger("firstplay"),e.seekTo_(i.end(0)),e.hasPlayed_=function(){return!0}})),!1;this.trigger("firstplay"),this.seekTo_(i.end(0))}return this.hasPlayed_=function(){return!0},this.load(),!0}},{key:"handleSourceOpen_",value:function(){try{this.setupSourceBuffers_()}catch(e){return Ra.log.warn("Failed to create Source Buffers",e),this.mediaSource.endOfStream("decode")}if(this.tech_.autoplay()){var e=this.tech_.play();void 0!==e&&"function"==typeof e.then&&e.then(null,(function(e){}))}this.trigger("sourceopen")}},{key:"onEndOfStream",value:function(){var e=this.mainSegmentLoader_.ended_;this.mediaTypes_.AUDIO.activePlaylistLoader&&(e=!this.mainSegmentLoader_.startingMedia_||this.mainSegmentLoader_.startingMedia_.containsVideo?e&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_),e&&this.mediaSource.endOfStream()}},{key:"stuckAtPlaylistEnd_",value:function(e){if(!this.seekable().length)return!1;var t=this.syncController_.getExpiredTime(e,this.mediaSource.duration);if(null===t)return!1;var i=eu.Playlist.playlistEnd(e,t),n=this.tech_.currentTime(),r=this.tech_.buffered();if(!r.length)return i-n<=xs;var a=r.end(r.length-1);return a-n<=xs&&i-a<=xs}},{key:"blacklistCurrentPlaylist",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1],i=void 0,n=void 0;if(i=e.playlist||this.masterPlaylistLoader_.media(),t=t||e.blacklistDuration||this.blacklistDuration,!i){this.error=e;try{return this.mediaSource.endOfStream("network")}catch(e){return this.trigger("error")}}var r=1===this.masterPlaylistLoader_.master.playlists.filter(ds).length;return r?(Ra.log.warn("Problem encountered with the current HLS playlist. Trying again since it is the final playlist."),this.tech_.trigger("retryplaylist"),this.masterPlaylistLoader_.load(r)):(i.excludeUntil=Date.now()+1e3*t,this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"}),n=this.selectPlaylist(),Ra.log.warn("Problem encountered with the current HLS playlist."+(e.message?" "+e.message:"")+" Switching to another playlist."),this.masterPlaylistLoader_.media(n))}},{key:"pauseLoading",value:function(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}},{key:"setCurrentTime",value:function(e){var t=Is(this.tech_.buffered(),e);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0}},{key:"duration",value:function(){return this.masterPlaylistLoader_?this.mediaSource?this.mediaSource.duration:eu.Playlist.duration(this.masterPlaylistLoader_.media()):0}},{key:"seekable",value:function(){return this.seekable_}},{key:"onSyncInfoUpdate_",value:function(){var e=void 0,t=void 0;if(this.masterPlaylistLoader_){var i=this.masterPlaylistLoader_.media();if(i){var n=this.syncController_.getExpiredTime(i,this.mediaSource.duration);if(null!==n&&0!==(e=eu.Playlist.seekable(i,n)).length){if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(i=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null===(n=this.syncController_.getExpiredTime(i,this.mediaSource.duration)))return;if(0===(t=eu.Playlist.seekable(i,n)).length)return}t?t.start(0)>e.end(0)||e.start(0)>t.end(0)?this.seekable_=e:this.seekable_=Ra.createTimeRanges([[t.start(0)>e.start(0)?t.start(0):e.start(0),t.end(0)<e.end(0)?t.end(0):e.end(0)]]):this.seekable_=e,this.logger_("seekable updated ["+Rs(this.seekable_)+"]"),this.tech_.trigger("seekablechanged")}}}}},{key:"updateDuration",value:function(){var e=this,t=this.mediaSource.duration,i=eu.Playlist.duration(this.masterPlaylistLoader_.media()),n=this.tech_.buffered(),r=function t(){e.mediaSource.duration=i,e.tech_.trigger("durationchange"),e.mediaSource.removeEventListener("sourceopen",t)};n.length>0&&(i=Math.max(i,n.end(n.length-1))),t!==i&&("open"!==this.mediaSource.readyState?this.mediaSource.addEventListener("sourceopen",r):r())}},{key:"dispose",value:function(){var e=this;this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),["AUDIO","SUBTITLES"].forEach((function(t){var i=e.mediaTypes_[t].groups;for(var n in i)i[n].forEach((function(e){e.playlistLoader&&e.playlistLoader.dispose()}))})),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose()}},{key:"master",value:function(){return this.masterPlaylistLoader_.master}},{key:"media",value:function(){return this.masterPlaylistLoader_.media()||this.initialMedia_}},{key:"setupSourceBuffers_",value:function(){var e,t=this.masterPlaylistLoader_.media();if(t&&"open"===this.mediaSource.readyState){if((e=to(this.masterPlaylistLoader_.master,t)).length<1)return this.error="No compatible SourceBuffer configuration for the variant stream:"+t.resolvedUri,this.mediaSource.endOfStream("decode");this.configureLoaderMimeTypes_(e),this.excludeIncompatibleVariants_(t)}}},{key:"configureLoaderMimeTypes_",value:function(e){var t=e.length>1&&-1===e[0].indexOf(",")&&e[0]!==e[1]?new Ra.EventTarget:null;this.mainSegmentLoader_.mimeType(e[0],t),e[1]&&this.audioSegmentLoader_.mimeType(e[1],t)}},{key:"excludeUnsupportedVariants_",value:function(){this.master().playlists.forEach((function(e){var t;e.attributes.CODECS&&f().MediaSource&&f().MediaSource.isTypeSupported&&!f().MediaSource.isTypeSupported('video/mp4; codecs="'+(t=e.attributes.CODECS,t.replace(/avc1\.(\d+)\.(\d+)/i,(function(e){return Js([e])[0]}))+'"'))&&(e.excludeUntil=1/0)}))}},{key:"excludeIncompatibleVariants_",value:function(e){var t=2,i=null,n=void 0;e.attributes.CODECS&&(n=Zs(e.attributes.CODECS),i=n.videoCodec,t=n.codecCount),this.master().playlists.forEach((function(e){var n={codecCount:2,videoCodec:null};e.attributes.CODECS&&(n=Zs(e.attributes.CODECS)),n.codecCount!==t&&(e.excludeUntil=1/0),n.videoCodec!==i&&(e.excludeUntil=1/0)}))}},{key:"updateAdCues_",value:function(e){var t=0,i=this.seekable();i.length&&(t=i.start(0)),function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(e.segments)for(var n=i,r=void 0,a=0;a<e.segments.length;a++){var s=e.segments[a];if(r||(r=jo(t,n+s.duration/2)),r){if("cueIn"in s){r.endTime=n,r.adEndTime=n,n+=s.duration,r=null;continue}if(n<r.endTime){n+=s.duration;continue}r.endTime+=s.duration}else if("cueOut"in s&&((r=new(f().VTTCue)(n,n+s.duration,s.cueOut)).adStartTime=n,r.adEndTime=n+parseFloat(s.cueOut),t.addCue(r)),"cueOutCont"in s){var o=void 0,u=void 0,l=s.cueOutCont.split("/").map(parseFloat),c=za(l,2);o=c[0],u=c[1],(r=new(f().VTTCue)(n,n+s.duration,"")).adStartTime=n-o,r.adEndTime=r.adStartTime+u,t.addCue(r)}n+=s.duration}}(e,this.cueTagsTrack_,t)}},{key:"goalBufferLength",value:function(){var e=this.tech_.currentTime(),t=bo.GOAL_BUFFER_LENGTH,i=bo.GOAL_BUFFER_LENGTH_RATE,n=Math.max(t,bo.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,n)}},{key:"bufferLowWaterLine",value:function(){var e=this.tech_.currentTime(),t=bo.BUFFER_LOW_WATER_LINE,i=bo.BUFFER_LOW_WATER_LINE_RATE,n=Math.max(t,bo.MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,n)}}]),t}(Ra.EventTarget),ru=function e(t,i,n){ja(this,e);var r,a,s,o=t.masterPlaylistController_,u=o[(t.options_.smoothQualityChange?"smooth":"fast")+"QualityChange_"].bind(o);if(i.attributes.RESOLUTION){var l=i.attributes.RESOLUTION;this.width=l.width,this.height=l.height}this.bandwidth=i.attributes.BANDWIDTH,this.id=n,this.enabled=(r=t.playlists,a=i.uri,s=u,function(e){var t=r.master.playlists[a],i=hs(t),n=ds(t);return void 0===e?n:(e?delete t.disabled:t.disabled=!0,e===n||i||(s(),e?r.trigger("renditionenabled"):r.trigger("renditiondisabled")),e)})},au=["seeking","seeked","pause","playing","error"],su=function(){function e(t){var i=this;ja(this,e),this.tech_=t.tech,this.seekable=t.seekable,this.seekTo=t.seekTo,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=yo("PlaybackWatcher"),this.logger_("initialize");var n=function(){return i.monitorCurrentTime_()},r=function(){return i.techWaiting_()},a=function(){return i.cancelTimer_()},s=function(){return i.fixesBadSeeks_()};this.tech_.on("seekablechanged",s),this.tech_.on("waiting",r),this.tech_.on(au,a),this.tech_.on("canplay",n),this.dispose=function(){i.logger_("dispose"),i.tech_.off("seekablechanged",s),i.tech_.off("waiting",r),i.tech_.off(au,a),i.tech_.off("canplay",n),i.checkCurrentTimeTimeout_&&f().clearTimeout(i.checkCurrentTimeTimeout_),i.cancelTimer_()}}return Fa(e,[{key:"monitorCurrentTime_",value:function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&f().clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=f().setTimeout(this.monitorCurrentTime_.bind(this),250)}},{key:"checkCurrentTime_",value:function(){if(this.tech_.seeking()&&this.fixesBadSeeks_())return this.consecutiveUpdates=0,void(this.lastRecordedTime=this.tech_.currentTime());if(!this.tech_.paused()&&!this.tech_.seeking()){var e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+xs>=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}}},{key:"cancelTimer_",value:function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null}},{key:"fixesBadSeeks_",value:function(){var e=this.tech_.seeking(),t=this.seekable(),i=this.tech_.currentTime(),n=void 0;e&&this.afterSeekableWindow_(t,i)&&(n=t.end(t.length-1));e&&this.beforeSeekableWindow_(t,i)&&(n=t.start(0)+xs);return void 0!==n&&(this.logger_("Trying to seek outside of seekable at time "+i+" with seekable range "+Rs(t)+". Seeking to "+n+"."),this.seekTo(n),!0)}},{key:"waiting_",value:function(){if(!this.techWaiting_()){var e=this.tech_.currentTime(),t=this.tech_.buffered(),i=Is(t,e);return i.length&&e+3<=i.end(0)?(this.cancelTimer_(),this.seekTo(e),this.logger_("Stopped at "+e+" while inside a buffered region ["+i.start(0)+" -> "+i.end(0)+"]. Attempting to resume playback by seeking to the current time."),void this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})):void 0}}},{key:"techWaiting_",value:function(){var e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking()&&this.fixesBadSeeks_())return!0;if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(e,t)){var i=e.end(e.length-1);return this.logger_("Fell out of live window at time "+t+". Seeking to live point (seekable end) "+i),this.cancelTimer_(),this.seekTo(i),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var n=this.tech_.buffered(),r=Ds(n,t);if(this.videoUnderflow_(r,n,t))return this.cancelTimer_(),this.seekTo(t),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;if(r.length>0){var a=r.start(0)-t;return this.logger_("Stopped at "+t+", setting timer for "+a+", seeking to "+r.start(0)),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*a,t),!0}return!1}},{key:"afterSeekableWindow_",value:function(e,t){return!!e.length&&t>e.end(e.length-1)+xs}},{key:"beforeSeekableWindow_",value:function(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-xs)}},{key:"videoUnderflow_",value:function(e,t,i){if(0===e.length){var n=this.gapFromVideoUnderflow_(t,i);if(n)return this.logger_("Encountered a gap in video from "+n.start+" to "+n.end+". Seeking to current time "+i),!0}return!1}},{key:"skipTheGap_",value:function(e){var t=this.tech_.buffered(),i=this.tech_.currentTime(),n=Ds(t,i);this.cancelTimer_(),0!==n.length&&i===e&&(this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",e,"nextRange start:",n.start(0)),this.seekTo(n.start(0)+Ps),this.tech_.trigger({type:"usage",name:"hls-gap-skip"}))}},{key:"gapFromVideoUnderflow_",value:function(e,t){for(var i=function(e){if(e.length<2)return Ra.createTimeRanges();for(var t=[],i=1;i<e.length;i++){var n=e.end(i-1),r=e.start(i);t.push([n,r])}return Ra.createTimeRanges(t)}(e),n=0;n<i.length;n++){var r=i.start(n),a=i.end(n);if(t-r<4&&t-r>2)return{start:r,end:a}}return null}}]),e}(),ou={errorInterval:30,getSource:function(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_)}},uu=function e(t,i){var n=0,r=0,a=Ra.mergeOptions(ou,i);t.ready((function(){t.trigger({type:"usage",name:"hls-error-reload-initialized"})}));var s=function(){r&&t.currentTime(r)},o=function(e){null!=e&&(r=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",s),t.src(e),t.trigger({type:"usage",name:"hls-error-reload"}),t.play())},u=function(){if(Date.now()-n<1e3*a.errorInterval)t.trigger({type:"usage",name:"hls-error-reload-canceled"});else{if(a.getSource&&"function"==typeof a.getSource)return n=Date.now(),a.getSource.call(t,o);Ra.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")}},l=function e(){t.off("loadedmetadata",s),t.off("error",u),t.off("dispose",e)};t.on("error",u),t.on("dispose",l),t.reloadSourceOnError=function(i){l(),e(t,i)}},lu=function(e){uu(this,e)};Ra.use("*",(function(e){return{setSource:function(e,t){t(null,e)},setCurrentTime:function(t){return e.vhs&&e.currentSource().src===e.vhs.source_.src&&e.vhs.setCurrentTime(t),t},play:function(){e.vhs&&e.currentSource().src===e.vhs.source_.src&&e.vhs.setCurrentTime(e.currentTime())}}}));var cu={PlaylistLoader:Za,Playlist:ms,Decrypter:Ae,AsyncStream:we,decrypt:Ee,utils:Cs,STANDARD_PLAYLIST_SELECTOR:function(){return function(e,t,i,n,r){var a=e.playlists.map((function(e){var t,i;return t=e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,i=e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height,{bandwidth:e.attributes.BANDWIDTH||f().Number.MAX_VALUE,width:t,height:i,playlist:e}}));xo(a,(function(e,t){return e.bandwidth-t.bandwidth}));var s=(a=a.filter((function(e){return!ms.isIncompatible(e.playlist)}))).filter((function(e){return ms.isEnabled(e.playlist)}));s.length||(s=a.filter((function(e){return!ms.isDisabled(e.playlist)})));var o=s.filter((function(e){return e.bandwidth*bo.BANDWIDTH_VARIANCE<t})),u=o[o.length-1],l=o.filter((function(e){return e.bandwidth===u.bandwidth}))[0];if(!1===r){var c=l||s[0]||a[0];return c?c.playlist:null}var h=o.filter((function(e){return e.width&&e.height}));xo(h,(function(e,t){return e.width-t.width}));var d=h.filter((function(e){return e.width===i&&e.height===n}));u=d[d.length-1];var p=d.filter((function(e){return e.bandwidth===u.bandwidth}))[0],m=void 0,g=void 0,y=void 0;p||(g=(m=h.filter((function(e){return e.width>i||e.height>n}))).filter((function(e){return e.width===m[0].width&&e.height===m[0].height})),u=g[g.length-1],y=g.filter((function(e){return e.bandwidth===u.bandwidth}))[0]);var v=y||p||l||s[0]||a[0];return v?v.playlist:null}(this.playlists.master,this.systemBandwidth,parseInt(Po(this.tech_.el(),"width"),10),parseInt(Po(this.tech_.el(),"height"),10),this.limitRenditionByPlayerDimensions)},INITIAL_PLAYLIST_SELECTOR:function(){var e=this.playlists.master.playlists.filter(ms.isEnabled);return xo(e,(function(e,t){return Uo(e,t)})),e.filter((function(e){return Zs(e.attributes.CODECS).videoCodec}))[0]||null},comparePlaylistBandwidth:Uo,comparePlaylistResolution:function(e,t){var i=void 0,n=void 0;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||f().Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(n=t.attributes.RESOLUTION.width),i===(n=n||f().Number.MAX_VALUE)&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-n},xhr:vs()};["GOAL_BUFFER_LENGTH","MAX_GOAL_BUFFER_LENGTH","GOAL_BUFFER_LENGTH_RATE","BUFFER_LOW_WATER_LINE","MAX_BUFFER_LOW_WATER_LINE","BUFFER_LOW_WATER_LINE_RATE","BANDWIDTH_VARIANCE"].forEach((function(e){Object.defineProperty(cu,e,{get:function(){return Ra.log.warn("using Hls."+e+" is UNSAFE be sure you know what you are doing"),bo[e]},set:function(t){Ra.log.warn("using Hls."+e+" is UNSAFE be sure you know what you are doing"),"number"!=typeof t||t<0?Ra.log.warn("value of Hls."+e+" must be greater than or equal to 0"):bo[e]=t}})}));var hu="videojs-vhs",du=function(e){if(/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i.test(e))return"hls";return/^application\/dash\+xml/i.test(e)?"dash":null},pu=function(e,t){for(var i=t.media(),n=-1,r=0;r<e.length;r++)if(e[r].id===i.uri){n=r;break}e.selectedIndex_=n,e.trigger({selectedIndex:n,type:"change"})};cu.canPlaySource=function(){return Ra.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var fu=function(e){if("dash"===e.options_.sourceType){var t=Ra.players[e.tech_.options_.playerId];if(t.eme){var i=function(e,t,i){if(!e)return e;var n={};for(var r in e)n[r]={audioContentType:'audio/mp4; codecs="'+i.attributes.CODECS+'"',videoContentType:'video/mp4; codecs="'+t.attributes.CODECS+'"'},t.contentProtection&&t.contentProtection[r]&&t.contentProtection[r].pssh&&(n[r].pssh=t.contentProtection[r].pssh),"string"==typeof e[r]&&(n[r].url=e[r]);return Ra.mergeOptions(e,n)}(e.source_.keySystems,e.playlists.media(),e.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader.media());i&&(t.currentSource().keySystems=i,t.eme.initializeMediaKeys&&t.eme.initializeMediaKeys())}}},mu=function(){if(!window.localStorage)return null;var e=window.localStorage.getItem(hu);if(!e)return null;try{return JSON.parse(e)}catch(e){return null}};cu.supportsNativeHls=function(){var e=C().createElement("video");if(!Ra.getTech("Html5").isSupported())return!1;return["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some((function(t){return/maybe|probably/i.test(e.canPlayType(t))}))}(),cu.supportsNativeDash=!!Ra.getTech("Html5").isSupported()&&/maybe|probably/i.test(C().createElement("video").canPlayType("application/dash+xml")),cu.supportsTypeNatively=function(e){return"hls"===e?cu.supportsNativeHls:"dash"===e&&cu.supportsNativeDash},cu.isSupported=function(){return Ra.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var gu=function(e){function t(e,i,n){ja(this,t);var r=qa(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,i,n.hls));if(i.options_&&i.options_.playerId){var a=Ra(i.options_.playerId);a.hasOwnProperty("hls")||Object.defineProperty(a,"hls",{get:function(){return Ra.log.warn("player.hls is deprecated. Use player.tech().hls instead."),i.trigger({type:"usage",name:"hls-player-access"}),r},configurable:!0}),a.vhs=r,a.dash=r,r.player_=a}if(r.tech_=i,r.source_=e,r.stats={},r.setOptions_(),r.options_.overrideNative&&i.overrideNativeAudioTracks&&i.overrideNativeVideoTracks)i.overrideNativeAudioTracks(!0),i.overrideNativeVideoTracks(!0);else if(r.options_.overrideNative&&(i.featuresNativeVideoTracks||i.featuresNativeAudioTracks))throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB");return r.on(C(),["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],(function(e){var t=C().fullscreenElement||C().webkitFullscreenElement||C().mozFullScreenElement||C().msFullscreenElement;t&&t.contains(r.tech_.el())&&r.masterPlaylistController_.smoothQualityChange_()})),r.on(r.tech_,"seeking",(function(){this.tech_.seeking()&&0===this.tech_.currentTime()&&this.tech_.player_.loop()&&this.setCurrentTime(0)})),r.on(r.tech_,"error",(function(){this.masterPlaylistController_&&this.masterPlaylistController_.pauseLoading()})),r.on(r.tech_,"play",r.play),r}return Ha(t,e),Fa(t,[{key:"setOptions_",value:function(){var e=this;if(this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.smoothQualityChange=this.options_.smoothQualityChange||!1,this.options_.useBandwidthFromLocalStorage=void 0!==this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,"number"!=typeof this.options_.blacklistDuration&&(this.options_.blacklistDuration=300),"number"!=typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage){var t=mu();t&&t.bandwidth&&(this.options_.bandwidth=t.bandwidth,this.tech_.trigger({type:"usage",name:"hls-bandwidth-from-local-storage"})),t&&t.throughput&&(this.options_.throughput=t.throughput,this.tech_.trigger({type:"usage",name:"hls-throughput-from-local-storage"}))}"number"!=typeof this.options_.bandwidth&&(this.options_.bandwidth=bo.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===bo.INITIAL_BANDWIDTH,["withCredentials","limitRenditionByPlayerDimensions","bandwidth","smoothQualityChange"].forEach((function(t){void 0!==e.source_[t]&&(e.options_[t]=e.source_[t])})),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions}},{key:"src",value:function(e,t){var i=this;e&&(this.setOptions_(),this.options_.url=this.source_.src,this.options_.tech=this.tech_,this.options_.externHls=cu,this.options_.sourceType=du(t),this.options_.seekTo=function(e){i.tech_.setCurrentTime(e),i.setCurrentTime(e)},this.masterPlaylistController_=new nu(this.options_),this.playbackWatcher_=new su(Ra.mergeOptions(this.options_,{seekable:function(){return i.seekable()}})),this.masterPlaylistController_.on("error",(function(){Ra.players[i.tech_.options_.playerId].error(i.masterPlaylistController_.error)})),this.masterPlaylistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):cu.STANDARD_PLAYLIST_SELECTOR.bind(this),this.masterPlaylistController_.selectInitialPlaylist=cu.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.masterPlaylistController_.masterPlaylistLoader_,this.mediaSource=this.masterPlaylistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get:function(){return this.masterPlaylistController_.selectPlaylist},set:function(e){this.masterPlaylistController_.selectPlaylist=e.bind(this)}},throughput:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=e,this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.bandwidth},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=e,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var e=1/(this.bandwidth||1),t=void 0;return t=this.throughput>0?1/this.throughput:0,Math.floor(1/(e+t))},set:function(){Ra.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:function(){return i.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return i.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return i.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return i.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return i.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return i.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return i.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return i.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},buffered:{get:function(){return Ms(i.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return i.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return i.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return i.tech_.name_},enumerable:!0},duration:{get:function(){return i.tech_.duration()},enumerable:!0},master:{get:function(){return i.playlists.master},enumerable:!0},playerDimensions:{get:function(){return i.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return Ms(i.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return i.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",(function(){i.options_.useBandwidthFromLocalStorage&&function(e){if(!window.localStorage)return!1;var t=mu();t=t?Ra.mergeOptions(t,e):e;try{window.localStorage.setItem(hu,JSON.stringify(t))}catch(e){return!1}}({bandwidth:i.bandwidth,throughput:Math.round(i.throughput)})})),this.masterPlaylistController_.on("selectedinitialmedia",(function(){var e,t;t=(e=i).playlists,e.representations=function(){return t.master.playlists.filter((function(e){return!hs(e)})).map((function(t,i){return new ru(e,t,t.uri)}))},fu(i)})),this.on(this.masterPlaylistController_,"progress",(function(){this.tech_.trigger("progress")})),this.tech_.ready((function(){return i.setupQualityLevels_()})),this.tech_.el()&&this.tech_.src(Ra.URL.createObjectURL(this.masterPlaylistController_.mediaSource)))}},{key:"setupQualityLevels_",value:function(){var e=this,t=Ra.players[this.tech_.options_.playerId];t&&t.qualityLevels&&(this.qualityLevels_=t.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",(function(){var t,i;t=e.qualityLevels_,(i=e).representations().forEach((function(e){t.addQualityLevel(e)})),pu(t,i.playlists)})),this.playlists.on("mediachange",(function(){pu(e.qualityLevels_,e.playlists)})))}},{key:"play",value:function(){this.masterPlaylistController_.play()}},{key:"setCurrentTime",value:function(e){this.masterPlaylistController_.setCurrentTime(e)}},{key:"duration",value:function(){return this.masterPlaylistController_.duration()}},{key:"seekable",value:function(){return this.masterPlaylistController_.seekable()}},{key:"dispose",value:function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.hls&&delete this.tech_.hls,Va(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"dispose",this).call(this)}},{key:"convertToStreamTime",value:function(e,t){return Ls({playlist:this.masterPlaylistController_.media(),time:e,callback:t})}},{key:"seekToStreamTime",value:function(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2;return Os({streamTime:e,playlist:this.masterPlaylistController_.media(),retryCount:n,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}}]),t}(Ra.getComponent("Component")),yu={name:"videojs-http-streaming",VERSION:"1.5.1",canHandleSource:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=Ra.mergeOptions(Ra.options,t);return yu.canPlayType(e.type,i)},handleSource:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=Ra.mergeOptions(Ra.options,i);return t.hls=new gu(e,t,n),t.hls.xhr=vs(),t.hls.src(e.src,e.type),t.hls},canPlayType:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=Ra.mergeOptions(Ra.options,t),n=i.hls.overrideNative,r=du(e),a=r&&(!cu.supportsTypeNatively(r)||n);return a?"maybe":""}};void 0!==Ra.MediaSource&&void 0!==Ra.URL||(Ra.MediaSource=co,Ra.URL=ho),co.supportsNativeMediaSources()&&Ra.getTech("Html5").registerSourceHandler(yu,0),Ra.HlsHandler=gu,Ra.HlsSourceHandler=yu,Ra.Hls=cu,Ra.use||Ra.registerComponent("Hls",cu),Ra.options.hls=Ra.options.hls||{},Ra.registerPlugin?Ra.registerPlugin("reloadSourceOnError",lu):Ra.plugin("reloadSourceOnError",lu);const vu=Ra},3407:(e,t,i)=>{var n=i(8908),r=e.exports={WebVTT:i(3706),VTTCue:i(2230),VTTRegion:i(3710)};n.vttjs=r,n.WebVTT=r.WebVTT;var a=r.VTTCue,s=r.VTTRegion,o=n.VTTCue,u=n.VTTRegion;r.shim=function(){n.VTTCue=a,n.VTTRegion=s},r.restore=function(){n.VTTCue=o,n.VTTRegion=u},n.VTTCue||r.shim()},3706:e=>{var t=Object.create||function(){function e(){}return function(t){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e}}();function i(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function n(e){function t(e,t,i,n){return 3600*(0|e)+60*(0|t)+(0|i)+(0|n)/1e3}var i=e.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return i?i[3]?t(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?t(i[1],i[2],0,i[4]):t(0,i[1],i[2],i[4]):null}function r(){this.values=t(null)}function a(e,t,i,n){var r=n?e.split(n):[e];for(var a in r)if("string"==typeof r[a]){var s=r[a].split(i);if(2===s.length)t(s[0],s[1])}}function s(e,t,s){var o=e;function u(){var t=n(e);if(null===t)throw new i(i.Errors.BadTimeStamp,"Malformed timestamp: "+o);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function l(){e=e.replace(/^\s+/,"")}if(l(),t.startTime=u(),l(),"--\x3e"!==e.substr(0,3))throw new i(i.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+o);e=e.substr(3),l(),t.endTime=u(),l(),function(e,t){var i=new r;a(e,(function(e,t){switch(e){case"region":for(var n=s.length-1;n>=0;n--)if(s[n].id===t){i.set(e,s[n].region);break}break;case"vertical":i.alt(e,t,["rl","lr"]);break;case"line":var r=t.split(","),a=r[0];i.integer(e,a),i.percent(e,a)&&i.set("snapToLines",!1),i.alt(e,a,["auto"]),2===r.length&&i.alt("lineAlign",r[1],["start","middle","end"]);break;case"position":r=t.split(","),i.percent(e,r[0]),2===r.length&&i.alt("positionAlign",r[1],["start","middle","end"]);break;case"size":i.percent(e,t);break;case"align":i.alt(e,t,["start","middle","end","left","right"])}}),/:/,/\s/),t.region=i.get("region",null),t.vertical=i.get("vertical",""),t.line=i.get("line","auto"),t.lineAlign=i.get("lineAlign","start"),t.snapToLines=i.get("snapToLines",!0),t.size=i.get("size",100),t.align=i.get("align","middle"),t.position=i.get("position",{start:0,left:0,middle:50,end:100,right:100},t.align),t.positionAlign=i.get("positionAlign",{start:"start",left:"start",middle:"middle",end:"end",right:"end"},t.align)}(e,t)}i.prototype=t(Error.prototype),i.prototype.constructor=i,i.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},r.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,i){for(var n=0;n<i.length;++n)if(t===i[n]){this.set(e,t);break}},integer:function(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))},percent:function(e,t){return!!(t.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(t=parseFloat(t))>=0&&t<=100)&&(this.set(e,t),!0)}};var o={"&amp;":"&","&lt;":"<","&gt;":">","&lrm;":"‎","&rlm;":"‏","&nbsp;":" "},u={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},l={v:"title",lang:"lang"},c={rt:"ruby"};function h(e,t){function i(){if(!t)return null;var e,i=t.match(/^([^<]*)(<[^>]*>?)?/);return e=i[1]?i[1]:i[2],t=t.substr(e.length),e}function r(e){return o[e]}function a(e){for(;v=e.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)e=e.replace(v[0],r);return e}function s(e,t){return!c[t.localName]||c[t.localName]===e.localName}function h(t,i){var n=u[t];if(!n)return null;var r=e.document.createElement(n);r.localName=n;var a=l[t];return a&&i&&(r[a]=i.trim()),r}for(var d,p=e.document.createElement("div"),f=p,m=[];null!==(d=i());)if("<"!==d[0])f.appendChild(e.document.createTextNode(a(d)));else{if("/"===d[1]){m.length&&m[m.length-1]===d.substr(2).replace(">","")&&(m.pop(),f=f.parentNode);continue}var g,y=n(d.substr(1,d.length-2));if(y){g=e.document.createProcessingInstruction("timestamp",y),f.appendChild(g);continue}var v=d.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!v)continue;if(!(g=h(v[1],v[3])))continue;if(!s(f,g))continue;v[2]&&(g.className=v[2].substr(1).replace("."," ")),m.push(v[1]),f.appendChild(g),f=g}return p}var d=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function p(e){for(var t=0;t<d.length;t++){var i=d[t];if(e>=i[0]&&e<=i[1])return!0}return!1}function f(e){var t=[],i="";if(!e||!e.childNodes)return"ltr";function n(e,t){for(var i=t.childNodes.length-1;i>=0;i--)e.push(t.childNodes[i])}function r(e){if(!e||!e.length)return null;var t=e.pop(),i=t.textContent||t.innerText;if(i){var a=i.match(/^.*(\n|\r)/);return a?(e.length=0,a[0]):i}return"ruby"===t.tagName?r(e):t.childNodes?(n(e,t),r(e)):void 0}for(n(t,e);i=r(t);)for(var a=0;a<i.length;a++)if(p(i.charCodeAt(a)))return"rtl";return"ltr"}function m(){}function g(e,t,i){m.call(this),this.cue=t,this.cueDiv=h(e,t.text);var n={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(n,this.cueDiv),this.div=e.document.createElement("div"),n={direction:f(this.cueDiv),writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:"middle"===t.align?"center":t.align,font:i.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(n),this.div.appendChild(this.cueDiv);var r=0;switch(t.positionAlign){case"start":r=t.position;break;case"middle":r=t.position-t.size/2;break;case"end":r=t.position-t.size}""===t.vertical?this.applyStyles({left:this.formatStyle(r,"%"),width:this.formatStyle(t.size,"%")}):this.applyStyles({top:this.formatStyle(r,"%"),height:this.formatStyle(t.size,"%")}),this.move=function(e){this.applyStyles({top:this.formatStyle(e.top,"px"),bottom:this.formatStyle(e.bottom,"px"),left:this.formatStyle(e.left,"px"),right:this.formatStyle(e.right,"px"),height:this.formatStyle(e.height,"px"),width:this.formatStyle(e.width,"px")})}}function y(e){var t,i,n,r;if(e.div){i=e.div.offsetHeight,n=e.div.offsetWidth,r=e.div.offsetTop;var a=(a=e.div.childNodes)&&(a=a[0])&&a.getClientRects&&a.getClientRects();e=e.div.getBoundingClientRect(),t=a?Math.max(a[0]&&a[0].height||0,e.height/a.length):0}this.left=e.left,this.right=e.right,this.top=e.top||r,this.height=e.height||i,this.bottom=e.bottom||r+(e.height||i),this.width=e.width||n,this.lineHeight=void 0!==t?t:e.lineHeight}function v(e,t,i,n){var r=new y(t),a=t.cue,s=function(e){if("number"==typeof e.line&&(e.snapToLines||e.line>=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,i=t.textTrackList,n=0,r=0;r<i.length&&i[r]!==t;r++)"showing"===i[r].mode&&n++;return-1*++n}(a),o=[];if(a.snapToLines){var u;switch(a.vertical){case"":o=["+y","-y"],u="height";break;case"rl":o=["+x","-x"],u="width";break;case"lr":o=["-x","+x"],u="width"}var l=r.lineHeight,c=l*Math.round(s),h=i[u]+l,d=o[0];Math.abs(c)>h&&(c=c<0?-1:1,c*=Math.ceil(h/l)*l),s<0&&(c+=""===a.vertical?i.height:i.width,o=o.reverse()),r.move(d,c)}else{var p=r.lineHeight/i.height*100;switch(a.lineAlign){case"middle":s-=p/2;break;case"end":s-=p}switch(a.vertical){case"":t.applyStyles({top:t.formatStyle(s,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(s,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(s,"%")})}o=["+y","-x","+x","-y"],r=new y(t)}var f=function(e,t){for(var r,a=new y(e),s=1,o=0;o<t.length;o++){for(;e.overlapsOppositeAxis(i,t[o])||e.within(i)&&e.overlapsAny(n);)e.move(t[o]);if(e.within(i))return e;var u=e.intersectPercentage(i);s>u&&(r=new y(e),s=u),e=new y(a)}return r||a}(r,o);t.move(f.toCSSCompatValues(i))}function _(){}m.prototype.applyStyles=function(e,t){for(var i in t=t||this.div,e)e.hasOwnProperty(i)&&(t.style[i]=e[i])},m.prototype.formatStyle=function(e,t){return 0===e?0:e+t},g.prototype=t(m.prototype),g.prototype.constructor=g,y.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t}},y.prototype.overlaps=function(e){return this.left<e.right&&this.right>e.left&&this.top<e.bottom&&this.bottom>e.top},y.prototype.overlapsAny=function(e){for(var t=0;t<e.length;t++)if(this.overlaps(e[t]))return!0;return!1},y.prototype.within=function(e){return this.top>=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},y.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.left<e.left;case"-x":return this.right>e.right;case"+y":return this.top<e.top;case"-y":return this.bottom>e.bottom}},y.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},y.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},y.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,n=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||i}},_.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},_.convertCueToDOMTree=function(e,t){return e&&t?h(e,t):null};_.processCues=function(e,t,i){if(!e||!t||!i)return null;for(;i.firstChild;)i.removeChild(i.firstChild);var n=e.document.createElement("div");if(n.style.position="absolute",n.style.left="0",n.style.right="0",n.style.top="0",n.style.bottom="0",n.style.margin="1.5%",i.appendChild(n),function(e){for(var t=0;t<e.length;t++)if(e[t].hasBeenReset||!e[t].displayState)return!0;return!1}(t)){var r=[],a=y.getSimpleBoxPosition(n),s={font:Math.round(.05*a.height*100)/100+"px sans-serif"};!function(){for(var i,o,u=0;u<t.length;u++)o=t[u],i=new g(e,o,s),n.appendChild(i.div),v(0,i,a,r),o.displayState=i.div,r.push(y.getSimpleBoxPosition(i))}()}else for(var o=0;o<t.length;o++)n.appendChild(t[o].displayState)},_.Parser=function(e,t,i){i||(i=t,t={}),t||(t={}),this.window=e,this.vttjs=t,this.state="INITIAL",this.buffer="",this.decoder=i||new TextDecoder("utf8"),this.regionList=[]},_.Parser.prototype={reportOrThrowError:function(e){if(!(e instanceof i))throw e;this.onparsingerror&&this.onparsingerror(e)},parse:function(e){var t=this;function o(){for(var e=t.buffer,i=0;i<e.length&&"\r"!==e[i]&&"\n"!==e[i];)++i;var n=e.substr(0,i);return"\r"===e[i]&&++i,"\n"===e[i]&&++i,t.buffer=e.substr(i),n}function u(e){e.match(/X-TIMESTAMP-MAP/)?a(e,(function(e,i){switch(e){case"X-TIMESTAMP-MAP":!function(e){var i=new r;a(e,(function(e,t){switch(e){case"MPEGT":i.integer(e+"S",t);break;case"LOCA":i.set(e+"L",n(t))}}),/[^\d]:/,/,/),t.ontimestampmap&&t.ontimestampmap({MPEGTS:i.get("MPEGTS"),LOCAL:i.get("LOCAL")})}(i)}}),/=/):a(e,(function(e,i){switch(e){case"Region":!function(e){var i=new r;if(a(e,(function(e,t){switch(e){case"id":i.set(e,t);break;case"width":i.percent(e,t);break;case"lines":i.integer(e,t);break;case"regionanchor":case"viewportanchor":var n=t.split(",");if(2!==n.length)break;var a=new r;if(a.percent("x",n[0]),a.percent("y",n[1]),!a.has("x")||!a.has("y"))break;i.set(e+"X",a.get("x")),i.set(e+"Y",a.get("y"));break;case"scroll":i.alt(e,t,["up"])}}),/=/,/\s/),i.has("id")){var n=new(t.vttjs.VTTRegion||t.window.VTTRegion);n.width=i.get("width",100),n.lines=i.get("lines",3),n.regionAnchorX=i.get("regionanchorX",0),n.regionAnchorY=i.get("regionanchorY",100),n.viewportAnchorX=i.get("viewportanchorX",0),n.viewportAnchorY=i.get("viewportanchorY",100),n.scroll=i.get("scroll",""),t.onregion&&t.onregion(n),t.regionList.push({id:i.get("id"),region:n})}}(i)}}),/:/)}e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));try{var l;if("INITIAL"===t.state){if(!/\r\n|\n/.test(t.buffer))return this;var c=(l=o()).match(/^WEBVTT([ \t].*)?$/);if(!c||!c[0])throw new i(i.Errors.BadSignature);t.state="HEADER"}for(var h=!1;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(h?h=!1:l=o(),t.state){case"HEADER":/:/.test(l)?u(l):l||(t.state="ID");continue;case"NOTE":l||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(l)){t.state="NOTE";break}if(!l)continue;if(t.cue=new(t.vttjs.VTTCue||t.window.VTTCue)(0,0,""),t.state="CUE",-1===l.indexOf("--\x3e")){t.cue.id=l;continue}case"CUE":try{s(l,t.cue,t.regionList)}catch(e){t.reportOrThrowError(e),t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":var d=-1!==l.indexOf("--\x3e");if(!l||d&&(h=!0)){t.oncue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}t.cue.text&&(t.cue.text+="\n"),t.cue.text+=l;continue;case"BADCUE":l||(t.state="ID");continue}}}catch(e){t.reportOrThrowError(e),"CUETEXT"===t.state&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state="INITIAL"===t.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var e=this;try{if(e.buffer+=e.decoder.decode(),(e.cue||"HEADER"===e.state)&&(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state)throw new i(i.Errors.BadSignature)}catch(t){e.reportOrThrowError(t)}return e.onflush&&e.onflush(),this}},e.exports=_},2230:e=>{var t={"":1,lr:1,rl:1},i={start:1,middle:1,end:1,left:1,right:1};function n(e){return"string"==typeof e&&(!!i[e.toLowerCase()]&&e.toLowerCase())}function r(e,i,r){this.hasBeenReset=!1;var a="",s=!1,o=e,u=i,l=r,c=null,h="",d=!0,p="auto",f="start",m=50,g="middle",y=50,v="middle";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return a},set:function(e){a=""+e}},pauseOnExit:{enumerable:!0,get:function(){return s},set:function(e){s=!!e}},startTime:{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");o=e,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");u=e,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return l},set:function(e){l=""+e,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return c},set:function(e){c=e,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return h},set:function(e){var i=function(e){return"string"==typeof e&&!!t[e.toLowerCase()]&&e.toLowerCase()}(e);if(!1===i)throw new SyntaxError("An invalid or illegal string was specified.");h=i,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return d},set:function(e){d=!!e,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return p},set:function(e){if("number"!=typeof e&&"auto"!==e)throw new SyntaxError("An invalid number or illegal string was specified.");p=e,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return f},set:function(e){var t=n(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");f=t,this.hasBeenReset=!0}},position:{enumerable:!0,get:function(){return m},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");m=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return g},set:function(e){var t=n(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");g=t,this.hasBeenReset=!0}},size:{enumerable:!0,get:function(){return y},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");y=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return v},set:function(e){var t=n(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");v=t,this.hasBeenReset=!0}}}),this.displayState=void 0}r.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},e.exports=r},3710:e=>{var t={"":!0,up:!0};function i(e){return"number"==typeof e&&e>=0&&e<=100}e.exports=function(){var e=100,n=3,r=0,a=100,s=0,o=100,u="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!i(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return n},set:function(e){if("number"!=typeof e)throw new TypeError("Lines must be set to a number.");n=e}},regionAnchorY:{enumerable:!0,get:function(){return a},set:function(e){if(!i(e))throw new Error("RegionAnchorX must be between 0 and 100.");a=e}},regionAnchorX:{enumerable:!0,get:function(){return r},set:function(e){if(!i(e))throw new Error("RegionAnchorY must be between 0 and 100.");r=e}},viewportAnchorY:{enumerable:!0,get:function(){return o},set:function(e){if(!i(e))throw new Error("ViewportAnchorY must be between 0 and 100.");o=e}},viewportAnchorX:{enumerable:!0,get:function(){return s},set:function(e){if(!i(e))throw new Error("ViewportAnchorX must be between 0 and 100.");s=e}},scroll:{enumerable:!0,get:function(){return u},set:function(e){var i=function(e){return"string"==typeof e&&!!t[e.toLowerCase()]&&e.toLowerCase()}(e);if(!1===i)throw new SyntaxError("An invalid or illegal string was specified.");u=i}}})}},1875:(e,t,i)=>{"use strict";var n=i(8908),r=i(7376),a=i(4947),s=i(7529);function o(e,t,i){var n=e;return r(t)?(i=t,"string"==typeof e&&(n={uri:e})):n=s(t,{uri:e}),n.callback=i,n}function u(e,t,i){return l(t=o(e,t,i))}function l(e){if(void 0===e.callback)throw new Error("callback argument missing");var t=!1,i=function(i,n,r){t||(t=!0,e.callback(i,n,r))};function n(){var e=void 0;if(e=c.response?c.response:c.responseText||function(e){if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML;return null}(c),y)try{e=JSON.parse(e)}catch(e){}return e}function r(e){return clearTimeout(h),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,i(e,v)}function s(){if(!l){var t;clearTimeout(h),t=e.useXDR&&void 0===c.status?200:1223===c.status?204:c.status;var r=v,s=null;return 0!==t?(r={body:n(),statusCode:t,method:p,headers:{},url:d,rawRequest:c},c.getAllResponseHeaders&&(r.headers=a(c.getAllResponseHeaders()))):s=new Error("Internal XMLHttpRequest Error"),i(s,r,r.body)}}var o,l,c=e.xhr||null;c||(c=e.cors||e.useXDR?new u.XDomainRequest:new u.XMLHttpRequest);var h,d=c.url=e.uri||e.url,p=c.method=e.method||"GET",f=e.body||e.data,m=c.headers=e.headers||{},g=!!e.sync,y=!1,v={body:void 0,headers:{},statusCode:0,method:p,url:d,rawRequest:c};if("json"in e&&!1!==e.json&&(y=!0,m.accept||m.Accept||(m.Accept="application/json"),"GET"!==p&&"HEAD"!==p&&(m["content-type"]||m["Content-Type"]||(m["Content-Type"]="application/json"),f=JSON.stringify(!0===e.json?f:e.json))),c.onreadystatechange=function(){4===c.readyState&&setTimeout(s,0)},c.onload=s,c.onerror=r,c.onprogress=function(){},c.onabort=function(){l=!0},c.ontimeout=r,c.open(p,d,!g,e.username,e.password),g||(c.withCredentials=!!e.withCredentials),!g&&e.timeout>0&&(h=setTimeout((function(){if(!l){l=!0,c.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",r(e)}}),e.timeout)),c.setRequestHeader)for(o in m)m.hasOwnProperty(o)&&c.setRequestHeader(o,m[o]);else if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(c.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(c),c.send(f||null),c}e.exports=u,u.XMLHttpRequest=n.XMLHttpRequest||function(){},u.XDomainRequest="withCredentials"in new u.XMLHttpRequest?u.XMLHttpRequest:n.XDomainRequest,function(e,t){for(var i=0;i<e.length;i++)t(e[i])}(["get","put","post","patch","head","delete"],(function(e){u["delete"===e?"del":e]=function(t,i,n){return(i=o(t,i,n)).method=e.toUpperCase(),l(i)}}))},7529:e=>{e.exports=function(){for(var e={},i=0;i<arguments.length;i++){var n=arguments[i];for(var r in n)t.call(n,r)&&(e[r]=n[r])}return e};var t=Object.prototype.hasOwnProperty}}]);
-//# sourceMappingURL=files_videoplayer-vendors-node_modules_video_js_dist_video_es_js.js.map?v=1b6d9725c996f15df33f \ No newline at end of file
+(self.webpackChunkfiles_videoplayer=self.webpackChunkfiles_videoplayer||[]).push([["vendors-node_modules_video_js_dist_video_es_js"],{4029:(e,t,i)=>{"use strict";var n=i(5320),r=Object.prototype.toString,a=Object.prototype.hasOwnProperty,s=function(e,t,i){for(var n=0,r=e.length;n<r;n++)a.call(e,n)&&(null==i?t(e[n],n,e):t.call(i,e[n],n,e))},o=function(e,t,i){for(var n=0,r=e.length;n<r;n++)null==i?t(e.charAt(n),n,e):t.call(i,e.charAt(n),n,e)},u=function(e,t,i){for(var n in e)a.call(e,n)&&(null==i?t(e[n],n,e):t.call(i,e[n],n,e))};e.exports=function(e,t,i){if(!n(t))throw new TypeError("iterator must be a function");var a;arguments.length>=3&&(a=i),"[object Array]"===r.call(e)?s(e,t,a):"string"==typeof e?o(e,t,a):u(e,t,a)}},9144:(e,t,i)=>{var n,r=void 0!==i.g?i.g:"undefined"!=typeof window?window:{},a=i(5893);"undefined"!=typeof document?n=document:(n=r["__GLOBAL_DOCUMENT_CACHE@4"])||(n=r["__GLOBAL_DOCUMENT_CACHE@4"]=a),e.exports=n},8908:(e,t,i)=>{var n;n="undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{},e.exports=n},5320:e=>{"use strict";var t,i,n=Function.prototype.toString,r="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof r&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw i}}),i={},r((function(){throw 42}),null,t)}catch(e){e!==i&&(r=null)}else r=null;var a=/^\s*class\b/,s=function(e){try{var t=n.call(e);return a.test(t)}catch(e){return!1}},o=Object.prototype.toString,u="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,l="object"==typeof document&&void 0===document.all&&void 0!==document.all?document.all:{};e.exports=r?function(e){if(e===l)return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if("function"==typeof e&&!e.prototype)return!0;try{r(e,null,t)}catch(e){if(e!==i)return!1}return!s(e)}:function(e){if(e===l)return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if("function"==typeof e&&!e.prototype)return!0;if(u)return function(e){try{return!s(e)&&(n.call(e),!0)}catch(e){return!1}}(e);if(s(e))return!1;var t=o.call(e);return"[object Function]"===t||"[object GeneratorFunction]"===t}},7376:e=>{e.exports=function(e){var i=t.call(e);return"[object Function]"===i||"function"==typeof e&&"[object RegExp]"!==i||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)};var t=Object.prototype.toString},4827:(e,t,i)=>{"use strict";var n,r=i(1961),a=i(5220);(n=function(){var e=new Uint8Array,t=0;n.prototype.init.call(this),this.setTimestamp=function(e){t=e},this.push=function(i){var n,r,s,o,u=0,l=0;for(e.length?(o=e.length,(e=new Uint8Array(i.byteLength+o)).set(e.subarray(0,o)),e.set(i,o)):e=i;e.length-l>=3;)if(e[l]!=="I".charCodeAt(0)||e[l+1]!=="D".charCodeAt(0)||e[l+2]!=="3".charCodeAt(0))if(255!=(255&e[l])||240!=(240&e[l+1]))l++;else{if(e.length-l<7)break;if(l+(u=a.parseAdtsSize(e,l))>e.length)break;s={type:"audio",data:e.subarray(l,l+u),pts:t,dts:t},this.trigger("data",s),l+=u}else{if(e.length-l<10)break;if(l+(u=a.parseId3TagSize(e,l))>e.length)break;r={type:"timed-metadata",data:e.subarray(l,l+u)},this.trigger("data",r),l+=u}n=e.length-l,e=n>0?e.subarray(l):new Uint8Array}}).prototype=new r,e.exports=n},5220:e=>{"use strict";var t=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],i=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]};e.exports={isLikelyAacData:function(e){return e[0]==="I".charCodeAt(0)&&e[1]==="D".charCodeAt(0)&&e[2]==="3".charCodeAt(0)},parseId3TagSize:function(e,t){var i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(16&e[t+5])>>4?i+20:i+10},parseAdtsSize:function(e,t){var i=(224&e[t+5])>>5,n=e[t+4]<<3;return 6144&e[t+3]|n|i},parseType:function(e,t){return e[t]==="I".charCodeAt(0)&&e[t+1]==="D".charCodeAt(0)&&e[t+2]==="3".charCodeAt(0)?"timed-metadata":!0&e[t]&&240==(240&e[t+1])?"audio":null},parseSampleRate:function(e){for(var i=0;i+5<e.length;){if(255===e[i]&&240==(246&e[i+1]))return t[(60&e[i+2])>>>2];i++}return null},parseAacTimestamp:function(e){var t,n,r;t=10,64&e[5]&&(t+=4,t+=i(e.subarray(10,14)));do{if((n=i(e.subarray(t+4,t+8)))<1)return null;if("PRIV"===String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])){r=e.subarray(t+10,t+n+10);for(var a=0;a<r.byteLength;a++)if(0===r[a]){var s=unescape(function(e,t,i){var n,r="";for(n=t;n<i;n++)r+="%"+("00"+e[n].toString(16)).slice(-2);return r}(r,0,a));if("com.apple.streaming.transportStreamTimestamp"===s){var o=r.subarray(a+1),u=(1&o[3])<<30|o[4]<<22|o[5]<<14|o[6]<<6|o[7]>>>2;return u*=4,u+=3&o[7]}break}}t+=10,t+=n}while(t<e.byteLength);return null}}},4886:(e,t,i)=>{"use strict";var n,r=i(1961),a=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];(n=function(){var e;n.prototype.init.call(this),this.push=function(t){var i,n,r,s,o,u,l=0,c=0;if("audio"===t.type)for(e?(s=e,(e=new Uint8Array(s.byteLength+t.data.byteLength)).set(s),e.set(t.data,s.byteLength)):e=t.data;l+5<e.length;)if(255===e[l]&&240==(246&e[l+1])){if(n=2*(1&~e[l+1]),i=(3&e[l+3])<<11|e[l+4]<<3|(224&e[l+5])>>5,u=9e4*(o=1024*(1+(3&e[l+6])))/a[(60&e[l+2])>>>2],r=l+i,e.byteLength<r)return;if(this.trigger("data",{pts:t.pts+c*u,dts:t.dts+c*u,sampleCount:o,audioobjecttype:1+(e[l+2]>>>6&3),channelcount:(1&e[l+2])<<2|(192&e[l+3])>>>6,samplerate:a[(60&e[l+2])>>>2],samplingfrequencyindex:(60&e[l+2])>>>2,samplesize:16,data:e.subarray(l+7+n,r)}),e.byteLength===r)return void(e=void 0);c++,e=e.subarray(r)}else l++},this.flush=function(){this.trigger("done")}}).prototype=new r,e.exports=n},6618:(e,t,i)=>{"use strict";var n,r,a,s=i(1961),o=i(9798);(r=function(){var e,t,i=0;r.prototype.init.call(this),this.push=function(n){var r;for(t?((r=new Uint8Array(t.byteLength+n.data.byteLength)).set(t),r.set(n.data,t.byteLength),t=r):t=n.data;i<t.byteLength-3;i++)if(1===t[i+2]){e=i+5;break}for(;e<t.byteLength;)switch(t[e]){case 0:if(0!==t[e-1]){e+=2;break}if(0!==t[e-2]){e++;break}i+3!==e-2&&this.trigger("data",t.subarray(i+3,e-2));do{e++}while(1!==t[e]&&e<t.length);i=e-2,e+=3;break;case 1:if(0!==t[e-1]||0!==t[e-2]){e+=3;break}this.trigger("data",t.subarray(i+3,e-2)),i=e-2,e+=3;break;default:e+=3}t=t.subarray(i),e-=i,i=0},this.flush=function(){t&&t.byteLength>3&&this.trigger("data",t.subarray(i+3)),t=null,i=0,this.trigger("done")}}).prototype=new s,a={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},(n=function(){var e,t,i,s,u,l,c,h=new r;n.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,i=e.pts,s=e.dts,h.push(e))},h.on("data",(function(n){var r={trackId:t,pts:i,dts:s,data:n};switch(31&n[0]){case 5:r.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:r.nalUnitType="sei_rbsp",r.escapedRBSP=u(n.subarray(1));break;case 7:r.nalUnitType="seq_parameter_set_rbsp",r.escapedRBSP=u(n.subarray(1)),r.config=l(r.escapedRBSP);break;case 8:r.nalUnitType="pic_parameter_set_rbsp";break;case 9:r.nalUnitType="access_unit_delimiter_rbsp"}e.trigger("data",r)})),h.on("done",(function(){e.trigger("done")})),this.flush=function(){h.flush()},c=function(e,t){var i,n=8,r=8;for(i=0;i<e;i++)0!==r&&(r=(n+t.readExpGolomb()+256)%256),n=0===r?n:r},u=function(e){for(var t,i,n=e.byteLength,r=[],a=1;a<n-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(r.push(a+2),a+=2):a++;if(0===r.length)return e;t=n-r.length,i=new Uint8Array(t);var s=0;for(a=0;a<t;s++,a++)s===r[0]&&(s++,r.shift()),i[a]=e[s];return i},l=function(e){var t,i,n,r,s,u,l,h,d,p,f,m,g,y=0,v=0,_=0,b=0,T=1;if(i=(t=new o(e)).readUnsignedByte(),r=t.readUnsignedByte(),n=t.readUnsignedByte(),t.skipUnsignedExpGolomb(),a[i]&&(3===(s=t.readUnsignedExpGolomb())&&t.skipBits(1),t.skipUnsignedExpGolomb(),t.skipUnsignedExpGolomb(),t.skipBits(1),t.readBoolean()))for(f=3!==s?8:12,g=0;g<f;g++)t.readBoolean()&&c(g<6?16:64,t);if(t.skipUnsignedExpGolomb(),0===(u=t.readUnsignedExpGolomb()))t.readUnsignedExpGolomb();else if(1===u)for(t.skipBits(1),t.skipExpGolomb(),t.skipExpGolomb(),l=t.readUnsignedExpGolomb(),g=0;g<l;g++)t.skipExpGolomb();if(t.skipUnsignedExpGolomb(),t.skipBits(1),h=t.readUnsignedExpGolomb(),d=t.readUnsignedExpGolomb(),0===(p=t.readBits(1))&&t.skipBits(1),t.skipBits(1),t.readBoolean()&&(y=t.readUnsignedExpGolomb(),v=t.readUnsignedExpGolomb(),_=t.readUnsignedExpGolomb(),b=t.readUnsignedExpGolomb()),t.readBoolean()&&t.readBoolean()){switch(t.readUnsignedByte()){case 1:m=[1,1];break;case 2:m=[12,11];break;case 3:m=[10,11];break;case 4:m=[16,11];break;case 5:m=[40,33];break;case 6:m=[24,11];break;case 7:m=[20,11];break;case 8:m=[32,11];break;case 9:m=[80,33];break;case 10:m=[18,11];break;case 11:m=[15,11];break;case 12:m=[64,33];break;case 13:m=[160,99];break;case 14:m=[4,3];break;case 15:m=[3,2];break;case 16:m=[2,1];break;case 255:m=[t.readUnsignedByte()<<8|t.readUnsignedByte(),t.readUnsignedByte()<<8|t.readUnsignedByte()]}m&&(T=m[0]/m[1])}return{profileIdc:i,levelIdc:n,profileCompatibility:r,width:Math.ceil((16*(h+1)-2*y-2*v)*T),height:(2-p)*(d+1)*16-2*_-2*b}}}).prototype=new s,e.exports={H264Stream:n,NalByteStream:r}},4212:e=>{var t,i=[33,16,5,32,164,27],n=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],r=function(e){for(var t=[];e--;)t.push(0);return t},a={96e3:[i,[227,64],r(154),[56]],88200:[i,[231],r(170),[56]],64e3:[i,[248,192],r(240),[56]],48e3:[i,[255,192],r(268),[55,148,128],r(54),[112]],44100:[i,[255,192],r(268),[55,163,128],r(84),[112]],32e3:[i,[255,192],r(268),[55,234],r(226),[112]],24e3:[i,[255,192],r(268),[55,255,128],r(268),[111,112],r(126),[224]],16e3:[i,[255,192],r(268),[55,255,128],r(268),[111,255],r(269),[223,108],r(195),[1,192]],12e3:[n,r(268),[3,127,248],r(268),[6,255,240],r(268),[13,255,224],r(268),[27,253,128],r(259),[56]],11025:[n,r(268),[3,127,248],r(268),[6,255,240],r(268),[13,255,224],r(268),[27,255,192],r(268),[55,175,128],r(108),[112]],8e3:[n,r(268),[3,121,16],r(47),[7]]};e.exports=(t=a,Object.keys(t).reduce((function(e,i){return e[i]=new Uint8Array(t[i].reduce((function(e,t){return e.concat(t)}),[])),e}),{}))},3754:(e,t,i)=>{"use strict";var n=i(5108),r=i(1961),a=i(6221),s=function(){s.prototype.init.call(this),this.captionPackets_=[],this.ccStreams_=[new h(0,0),new h(0,1),new h(1,0),new h(1,1)],this.reset(),this.ccStreams_.forEach((function(e){e.on("data",this.trigger.bind(this,"data")),e.on("done",this.trigger.bind(this,"done"))}),this)};s.prototype=new r,s.prototype.push=function(e){var t,i,n;if("sei_rbsp"===e.nalUnitType&&(t=a.parseSei(e.escapedRBSP)).payloadType===a.USER_DATA_REGISTERED_ITU_T_T35&&(i=a.parseUserData(t)))if(e.dts<this.latestDts_)this.ignoreNextEqualDts_=!0;else{if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));n=a.parseCaptionPackets(e.pts,i),this.captionPackets_=this.captionPackets_.concat(n),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts}},s.prototype.flush=function(){this.captionPackets_.length?(this.captionPackets_.forEach((function(e,t){e.presortIndex=t})),this.captionPackets_.sort((function(e,t){return e.pts===t.pts?e.presortIndex-t.presortIndex:e.pts-t.pts})),this.captionPackets_.forEach((function(e){e.type<2&&this.dispatchCea608Packet(e)}),this),this.captionPackets_.length=0,this.ccStreams_.forEach((function(e){e.flush()}),this)):this.ccStreams_.forEach((function(e){e.flush()}),this)},s.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach((function(e){e.reset()}))},s.prototype.dispatchCea608Packet=function(e){this.setsChannel1Active(e)?this.activeCea608Channel_[e.type]=0:this.setsChannel2Active(e)&&(this.activeCea608Channel_[e.type]=1),null!==this.activeCea608Channel_[e.type]&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},s.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)},s.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)};var o={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},u=function(e){return null===e?"":(e=o[e]||e,String.fromCharCode(e))},l=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],c=function(){for(var e=[],t=15;t--;)e.push("");return e},h=function(e,t){h.prototype.init.call(this),this.field_=e||0,this.dataChannel_=t||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,i,n,r,a;if((t=32639&e.ccData)!==this.lastControlCode_){if(4096==(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),n=t>>>8,r=255&t,t!==this.PADDING_)if(t===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(t===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),i=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=i,this.startPts_=e.pts;else if(t===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(t===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);else if(t===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(t===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(t===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=c();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=c();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=c()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(n,r))a=u((n=(3&n)<<8)|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isExtCharacter(n,r))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),a=u((n=(3&n)<<8)|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isMidRowCode(n,r))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14==(14&r)&&this.addFormatting(e.pts,["i"]),1==(1&r)&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(n,r))this.column_+=3&r;else if(this.isPAC(n,r)){var s=l.indexOf(7968&t);"rollUp"===this.mode_&&(s-this.rollUpRows_+1<0&&(s=this.rollUpRows_-1),this.setRollUp(e.pts,s)),s!==this.row_&&(this.clearFormatting(e.pts),this.row_=s),1&r&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16==(16&t)&&(this.column_=4*((14&t)>>1)),this.isColorPAC(r)&&14==(14&r)&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(n)&&(0===r&&(r=null),a=u(n),a+=u(r),this[this.mode_](e.pts,a),this.column_+=a.length)}else this.lastControlCode_=null}};h.prototype=new r,h.prototype.flushDisplayed=function(e){var t=this.displayed_.map((function(e){try{return e.trim()}catch(e){return n.error("Skipping malformed caption."),""}})).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})},h.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=c(),this.nonDisplayed_=c(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},h.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},h.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},h.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},h.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},h.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},h.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127},h.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},h.prototype.isNormalChar=function(e){return e>=32&&e<=127},h.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=c(),this.displayed_=c()),void 0!==t&&t!==this.row_)for(var i=0;i<this.rollUpRows_;i++)this.displayed_[t-i]=this.displayed_[this.row_-i],this.displayed_[this.row_-i]="";void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},h.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);var i=t.reduce((function(e,t){return e+"<"+t+">"}),"");this[this.mode_](e,i)},h.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce((function(e,t){return e+"</"+t+">"}),"");this.formatting_=[],this[this.mode_](e,t)}},h.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_];i+=t,this.nonDisplayed_[this.row_]=i},h.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_];i+=t,this.displayed_[this.row_]=i},h.prototype.shiftRowsUp_=function(){var e;for(e=0;e<this.topRow_;e++)this.displayed_[e]="";for(e=this.row_+1;e<15;e++)this.displayed_[e]="";for(e=this.topRow_;e<this.row_;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[this.row_]=""},h.prototype.paintOn=function(e,t){var i=this.displayed_[this.row_];i+=t,this.displayed_[this.row_]=i},e.exports={CaptionStream:s,Cea608Stream:h}},7379:(e,t,i)=>{"use strict";var n,r,a,s=i(1961),o=i(3754),u=i(5215),l=i(817).TimestampRolloverStream,c=i(5215),h=188;(n=function(){var e=new Uint8Array(h),t=0;n.prototype.init.call(this),this.push=function(i){var n,r=0,a=h;for(t?((n=new Uint8Array(i.byteLength+t)).set(e.subarray(0,t)),n.set(i,t),t=0):n=i;a<n.byteLength;)71!==n[r]||71!==n[a]?(r++,a++):(this.trigger("data",n.subarray(r,a)),r+=h,a+=h);r<n.byteLength&&(e.set(n.subarray(r),0),t=n.byteLength-r)},this.flush=function(){t===h&&71===e[0]&&(this.trigger("data",e),t=0),this.trigger("done")}}).prototype=new s,(r=function(){var e,t,i,n;r.prototype.init.call(this),n=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,n){var r=0;n.payloadUnitStartIndicator&&(r+=e[r]+1),"pat"===n.type?t(e.subarray(r),n):i(e.subarray(r),n)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],n.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=n.pmtPid},i=function(e,t){var i,r;if(1&e[5]){for(n.programMapTable={video:null,audio:null,"timed-metadata":{}},i=3+((15&e[1])<<8|e[2])-4,r=12+((15&e[10])<<8|e[11]);r<i;){var a=e[r],s=(31&e[r+1])<<8|e[r+2];a===u.H264_STREAM_TYPE&&null===n.programMapTable.video?n.programMapTable.video=s:a===u.ADTS_STREAM_TYPE&&null===n.programMapTable.audio?n.programMapTable.audio=s:a===u.METADATA_STREAM_TYPE&&(n.programMapTable["timed-metadata"][s]=a),r+=5+((15&e[r+3])<<8|e[r+4])}t.programMapTable=n.programMapTable}},this.push=function(t){var i={},n=4;if(i.payloadUnitStartIndicator=!!(64&t[1]),i.pid=31&t[1],i.pid<<=8,i.pid|=t[2],(48&t[3])>>>4>1&&(n+=t[n]+1),0===i.pid)i.type="pat",e(t.subarray(n),i),this.trigger("data",i);else if(i.pid===this.pmtPid)for(i.type="pmt",e(t.subarray(n),i),this.trigger("data",i);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,n,i]):this.processPes_(t,n,i)},this.processPes_=function(e,t,i){i.pid===this.programMapTable.video?i.streamType=u.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=u.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=e.subarray(t),this.trigger("data",i)}}).prototype=new s,r.STREAM_TYPES={h264:27,adts:15},a=function(){var e=this,t={data:[],size:0},i={data:[],size:0},n={data:[],size:0},r=function(t,i,n){var r,a,s=new Uint8Array(t.size),o={type:i},u=0,l=0;if(t.data.length&&!(t.size<9)){for(o.trackId=t.data[0].pid,u=0;u<t.data.length;u++)a=t.data[u],s.set(a.data,l),l+=a.data.byteLength;var c,h,d;c=s,(h=o).packetLength=6+(c[4]<<8|c[5]),h.dataAlignmentIndicator=0!=(4&c[6]),192&(d=c[7])&&(h.pts=(14&c[9])<<27|(255&c[10])<<20|(254&c[11])<<12|(255&c[12])<<5|(254&c[13])>>>3,h.pts*=4,h.pts+=(6&c[13])>>>1,h.dts=h.pts,64&d&&(h.dts=(14&c[14])<<27|(255&c[15])<<20|(254&c[16])<<12|(255&c[17])<<5|(254&c[18])>>>3,h.dts*=4,h.dts+=(6&c[18])>>>1)),h.data=c.subarray(9+c[8]),r="video"===i||o.packetLength<=t.size,(n||r)&&(t.size=0,t.data.length=0),r&&e.trigger("data",o)}};a.prototype.init.call(this),this.push=function(a){({pat:function(){},pes:function(){var e,s;switch(a.streamType){case u.H264_STREAM_TYPE:case c.H264_STREAM_TYPE:e=t,s="video";break;case u.ADTS_STREAM_TYPE:e=i,s="audio";break;case u.METADATA_STREAM_TYPE:e=n,s="timed-metadata";break;default:return}a.payloadUnitStartIndicator&&r(e,s,!0),e.data.push(a),e.size+=a.data.byteLength},pmt:function(){var t={type:"metadata",tracks:[]},i=a.programMapTable;null!==i.video&&t.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+i.video,codec:"avc",type:"video"}),null!==i.audio&&t.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+i.audio,codec:"adts",type:"audio"}),e.trigger("data",t)}})[a.type]()},this.flush=function(){r(t,"video"),r(i,"audio"),r(n,"timed-metadata"),this.trigger("done")}},a.prototype=new s;var d={PAT_PID:0,MP2T_PACKET_LENGTH:h,TransportPacketStream:n,TransportParseStream:r,ElementaryStream:a,TimestampRolloverStream:l,CaptionStream:o.CaptionStream,Cea608Stream:o.Cea608Stream,MetadataStream:i(8659)};for(var p in u)u.hasOwnProperty(p)&&(d[p]=u[p]);e.exports=d},8659:(e,t,i)=>{"use strict";var n,r=i(5108),a=i(1961),s=i(5215),o=function(e,t,i){var n,r="";for(n=t;n<i;n++)r+="%"+("00"+e[n].toString(16)).slice(-2);return r},u=function(e,t,i){return decodeURIComponent(o(e,t,i))},l=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},c={TXXX:function(e){var t;if(3===e.data[0]){for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=u(e.data,1,t),e.value=u(e.data,t+1,e.data.length).replace(/\0*$/,"");break}e.data=e.value}},WXXX:function(e){var t;if(3===e.data[0])for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=u(e.data,1,t),e.url=u(e.data,t+1,e.data.length);break}},PRIV:function(e){var t,i;for(t=0;t<e.data.length;t++)if(0===e.data[t]){e.owner=(i=e.data,unescape(o(i,0,t)));break}e.privateData=e.data.subarray(t+1),e.data=e.privateData}};(n=function(e){var t,i={debug:!(!e||!e.debug),descriptor:e&&e.descriptor},a=0,o=[],u=0;if(n.prototype.init.call(this),this.dispatchType=s.METADATA_STREAM_TYPE.toString(16),i.descriptor)for(t=0;t<i.descriptor.length;t++)this.dispatchType+=("00"+i.descriptor[t].toString(16)).slice(-2);this.push=function(e){var t,n,s,h,d;if("timed-metadata"===e.type)if(e.dataAlignmentIndicator&&(u=0,o.length=0),0===o.length&&(e.data.length<10||e.data[0]!=="I".charCodeAt(0)||e.data[1]!=="D".charCodeAt(0)||e.data[2]!=="3".charCodeAt(0)))i.debug&&r.log("Skipping unrecognized metadata packet");else if(o.push(e),u+=e.data.byteLength,1===o.length&&(a=l(e.data.subarray(6,10)),a+=10),!(u<a)){for(t={data:new Uint8Array(a),frames:[],pts:o[0].pts,dts:o[0].dts},d=0;d<a;)t.data.set(o[0].data.subarray(0,a-d),d),d+=o[0].data.byteLength,u-=o[0].data.byteLength,o.shift();n=10,64&t.data[5]&&(n+=4,n+=l(t.data.subarray(10,14)),a-=l(t.data.subarray(16,20)));do{if((s=l(t.data.subarray(n+4,n+8)))<1)return r.log("Malformed ID3 frame encountered. Skipping metadata parsing.");if((h={id:String.fromCharCode(t.data[n],t.data[n+1],t.data[n+2],t.data[n+3]),data:t.data.subarray(n+10,n+s+10)}).key=h.id,c[h.id]&&(c[h.id](h),"com.apple.streaming.transportStreamTimestamp"===h.owner)){var p=h.data,f=(1&p[3])<<30|p[4]<<22|p[5]<<14|p[6]<<6|p[7]>>>2;f*=4,f+=3&p[7],h.timeStamp=f,void 0===t.pts&&void 0===t.dts&&(t.pts=h.timeStamp,t.dts=h.timeStamp),this.trigger("timestamp",h)}t.frames.push(h),n+=10,n+=s}while(n<a);this.trigger("data",t)}}}).prototype=new a,e.exports=n},4149:(e,t,i)=>{"use strict";var n=i(5215),r=function(e){var t=31&e[1];return t<<=8,t|=e[2]},a=function(e){return!!(64&e[1])},s=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},o=function(e){switch(e){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}};e.exports={parseType:function(e,t){var i=r(e);return 0===i?"pat":i===t?"pmt":t?"pes":null},parsePat:function(e){var t=a(e),i=4+s(e);return t&&(i+=e[i]+1),(31&e[i+10])<<8|e[i+11]},parsePmt:function(e){var t={},i=a(e),n=4+s(e);if(i&&(n+=e[n]+1),1&e[n+5]){var r;r=3+((15&e[n+1])<<8|e[n+2])-4;for(var o=12+((15&e[n+10])<<8|e[n+11]);o<r;){var u=n+o;t[(31&e[u+1])<<8|e[u+2]]=e[u],o+=5+((15&e[u+3])<<8|e[u+4])}return t}},parsePayloadUnitStartIndicator:a,parsePesType:function(e,t){switch(t[r(e)]){case n.H264_STREAM_TYPE:return"video";case n.ADTS_STREAM_TYPE:return"audio";case n.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},parsePesTime:function(e){if(!a(e))return null;var t=4+s(e);if(t>=e.byteLength)return null;var i,n=null;return 192&(i=e[t+7])&&((n={}).pts=(14&e[t+9])<<27|(255&e[t+10])<<20|(254&e[t+11])<<12|(255&e[t+12])<<5|(254&e[t+13])>>>3,n.pts*=4,n.pts+=(6&e[t+13])>>>1,n.dts=n.pts,64&i&&(n.dts=(14&e[t+14])<<27|(255&e[t+15])<<20|(254&e[t+16])<<12|(255&e[t+17])<<5|(254&e[t+18])>>>3,n.dts*=4,n.dts+=(6&e[t+18])>>>1)),n},videoPacketContainsKeyFrame:function(e){for(var t=4+s(e),i=e.subarray(t),n=0,r=0,a=!1;r<i.byteLength-3;r++)if(1===i[r+2]){n=r+5;break}for(;n<i.byteLength;)switch(i[n]){case 0:if(0!==i[n-1]){n+=2;break}if(0!==i[n-2]){n++;break}r+3!==n-2&&"slice_layer_without_partitioning_rbsp_idr"===o(31&i[r+3])&&(a=!0);do{n++}while(1!==i[n]&&n<i.length);r=n-2,n+=3;break;case 1:if(0!==i[n-1]||0!==i[n-2]){n+=3;break}"slice_layer_without_partitioning_rbsp_idr"===o(31&i[r+3])&&(a=!0),r=n-2,n+=3;break;default:n+=3}return i=i.subarray(r),n-=r,r=0,i&&i.byteLength>3&&"slice_layer_without_partitioning_rbsp_idr"===o(31&i[r+3])&&(a=!0),a}}},5215:e=>{"use strict";e.exports={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21}},817:(e,t,i)=>{"use strict";var n=i(1961),r=function(e,t){var i=1;for(e>t&&(i=-1);Math.abs(t-e)>4294967296;)e+=8589934592*i;return e},a=function(e){var t,i;a.prototype.init.call(this),this.type_=e,this.push=function(e){e.type===this.type_&&(void 0===i&&(i=e.dts),e.dts=r(e.dts,i),e.pts=r(e.pts,i),t=e.dts,this.trigger("data",e))},this.flush=function(){i=t,this.trigger("done")},this.discontinuity=function(){i=void 0,t=void 0}};a.prototype=new n,e.exports={TimestampRolloverStream:a,handleRollover:r}},7091:(e,t,i)=>{var n=i(4212),r=i(1489);e.exports={prefixWithSilence:function(e,t,i,a){var s,o,u,l,c=0,h=0,d=0;if(t.length&&(s=r.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),o=Math.ceil(9e4/(e.samplerate/1024)),i&&a&&(c=s-Math.max(i,a),d=(h=Math.floor(c/o))*o),!(h<1||d>45e3))){for((u=n[e.samplerate])||(u=t[0].data),l=0;l<h;l++)t.splice(l,0,{data:u});e.baseMediaDecodeTime-=Math.floor(r.videoTsToAudioTs(d,e.samplerate))}},trimAdtsFramesByEarliestDts:function(e,t,i){return t.minSegmentDts>=i?e:(t.minSegmentDts=1/0,e.filter((function(e){return e.dts>=i&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)})))},generateSampleTable:function(e){var t,i,n=[];for(t=0;t<e.length;t++)i=e[t],n.push({size:i.data.byteLength,duration:1024});return n},concatenateFrameData:function(e){var t,i,n=0,r=new Uint8Array(function(e){var t,i=0;for(t=0;t<e.length;t++)i+=e[t].data.byteLength;return i}(e));for(t=0;t<e.length;t++)i=e[t],r.set(i.data,n),n+=i.data.byteLength;return r}}},6659:(e,t,i)=>{"use strict";var n=i(6221).discardEmulationPreventionBytes,r=i(3754).CaptionStream,a=i(7661),s=i(2628),o=function(e,t){for(var i=e,n=0;n<t.length;n++){var r=t[n];if(i<r.size)return r;i-=r.size}return null},u=function(e,t){var i=a.findBox(e,["moof","traf"]),r=a.findBox(e,["mdat"]),u={},l=[];return r.forEach((function(e,t){var n=i[t];l.push({mdat:e,traf:n})})),l.forEach((function(e){var i,r,l=e.mdat,c=e.traf,h=a.findBox(c,["tfhd"]),d=s.parseTfhd(h[0]),p=d.trackId,f=a.findBox(c,["tfdt"]),m=f.length>0?s.parseTfdt(f[0]).baseMediaDecodeTime:0,g=a.findBox(c,["trun"]);t===p&&g.length>0&&(i=function(e,t,i){var n=t,r=i.defaultSampleDuration||0,a=i.defaultSampleSize||0,o=i.trackId,u=[];return e.forEach((function(e){var t=s.parseTrun(e).samples;t.forEach((function(e){void 0===e.duration&&(e.duration=r),void 0===e.size&&(e.size=a),e.trackId=o,e.dts=n,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),e.pts=n+e.compositionTimeOffset,n+=e.duration})),u=u.concat(t)})),u}(g,m,d),r=function(e,t,i){var r,a,s,u,l=new DataView(e.buffer,e.byteOffset,e.byteLength),c=[];for(a=0;a+4<e.length;a+=s)if(s=l.getUint32(a),a+=4,!(s<=0)&&6==(31&e[a])){var h=e.subarray(a+1,a+1+s),d=o(a,t);r={nalUnitType:"sei_rbsp",size:s,data:h,escapedRBSP:n(h),trackId:i},d?(r.pts=d.pts,r.dts=d.dts,u=d):(r.pts=u.pts,r.dts=u.dts),c.push(r)}return c}(l,i,p),u[p]||(u[p]=[]),u[p]=u[p].concat(r))})),u};e.exports=function(){var e,t,i,n,a,s=!1;this.isInitialized=function(){return s},this.init=function(){e=new r,s=!0,e.on("data",(function(e){e.startTime=e.startPts/n,e.endTime=e.endPts/n,a.captions.push(e),a.captionStreams[e.stream]=!0}))},this.isNewInit=function(e,t){return!(e&&0===e.length||t&&"object"==typeof t&&0===Object.keys(t).length)&&(i!==e[0]||n!==t[i])},this.parse=function(e,r,s){var o;if(!this.isInitialized())return null;if(!r||!s)return null;if(this.isNewInit(r,s))i=r[0],n=s[i];else if(!i||!n)return t.push(e),null;for(;t.length>0;){var l=t.shift();this.parse(l,r,s)}return o=function(e,t,i){return t?{seiNals:u(e,t)[t],timescale:i}:null}(e,i,n),null!==o&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),a):null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach((function(t){e.push(t)}))},this.flushStream=function(){if(!this.isInitialized())return null;e.flush()},this.clearParsedCaptions=function(){a.captions=[],a.captionStreams={}},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],i=null,n=null,a?this.clearParsedCaptions():a={captions:[],captionStreams:{}},this.resetCaptionStream()},this.reset()}},9586:e=>{var t=function(e,t){var i={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return i.dataOffset=t,i.compositionTimeOffset=e.pts-e.dts,i.duration=e.duration,i.size=4*e.length,i.size+=e.byteLength,e.keyFrame&&(i.flags.dependsOn=2,i.flags.isNonSyncSample=0),i};e.exports={groupNalsIntoFrames:function(e){var t,i,n=[],r=[];for(n.byteLength=0,t=0;t<e.length;t++)"access_unit_delimiter_rbsp"===(i=e[t]).nalUnitType?(n.length&&(n.duration=i.dts-n.dts,r.push(n)),(n=[i]).byteLength=i.data.byteLength,n.pts=i.pts,n.dts=i.dts):("slice_layer_without_partitioning_rbsp_idr"===i.nalUnitType&&(n.keyFrame=!0),n.duration=i.dts-n.dts,n.byteLength+=i.data.byteLength,n.push(i));return r.length&&(!n.duration||n.duration<=0)&&(n.duration=r[r.length-1].duration),r.push(n),r},groupFramesIntoGops:function(e){var t,i,n=[],r=[];for(n.byteLength=0,n.nalCount=0,n.duration=0,n.pts=e[0].pts,n.dts=e[0].dts,r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=e[0].pts,r.dts=e[0].dts,t=0;t<e.length;t++)(i=e[t]).keyFrame?(n.length&&(r.push(n),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration),(n=[i]).nalCount=i.length,n.byteLength=i.byteLength,n.pts=i.pts,n.dts=i.dts,n.duration=i.duration):(n.duration+=i.duration,n.nalCount+=i.length,n.byteLength+=i.byteLength,n.push(i));return r.length&&n.duration<=0&&(n.duration=r[r.length-1].duration),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration,r.push(n),r},extendFirstKeyFrame:function(e){var t;return!e[0][0].keyFrame&&e.length>1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},generateSampleTable:function(e,i){var n,r,a,s,o,u=i||0,l=[];for(n=0;n<e.length;n++)for(s=e[n],r=0;r<s.length;r++)o=s[r],u+=(a=t(o,u)).size,l.push(a);return l},concatenateNalData:function(e){var t,i,n,r,a,s,o=0,u=e.byteLength,l=e.nalCount,c=new Uint8Array(u+4*l),h=new DataView(c.buffer);for(t=0;t<e.length;t++)for(r=e[t],i=0;i<r.length;i++)for(a=r[i],n=0;n<a.length;n++)s=a[n],h.setUint32(o,s.data.byteLength),o+=4,c.set(s.data,o),o+=s.data.byteLength;return c}}},272:(e,t,i)=>{e.exports={generator:i(2014),probe:i(7661),Transmuxer:i(5064).Transmuxer,AudioSegmentStream:i(5064).AudioSegmentStream,VideoSegmentStream:i(5064).VideoSegmentStream,CaptionParser:i(6659)}},2014:e=>{"use strict";var t,i,n,r,a,s,o,u,l,c,h,d,p,f,m,g,y,v,_,b,T,S,k,w,C,E,A,L,O,P,x,U,I,D,R,M,B,N,j,F,V,H=Math.pow(2,32)-1;!function(){var e;if(k={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},"undefined"!=typeof Uint8Array){for(e in k)k.hasOwnProperty(e)&&(k[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);w=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),E=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),C=new Uint8Array([0,0,0,1]),A=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),L=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),O={video:A,audio:L},U=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),x=new Uint8Array([0,0,0,0,0,0,0,0]),I=new Uint8Array([0,0,0,0,0,0,0,0]),D=I,R=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),M=I,P=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}}(),t=function(e){var t,i,n=[],r=0;for(t=1;t<arguments.length;t++)n.push(arguments[t]);for(t=n.length;t--;)r+=n[t].byteLength;for(i=new Uint8Array(r+8),new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(0,i.byteLength),i.set(e,4),t=0,r=8;t<n.length;t++)i.set(n[t],r),r+=n[t].byteLength;return i},i=function(){return t(k.dinf,t(k.dref,U))},n=function(e){return t(k.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,e.audioobjecttype<<3|e.samplingfrequencyindex>>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))},r=function(){return t(k.ftyp,w,C,w,E)},g=function(e){return t(k.hdlr,O[e])},a=function(e){return t(k.mdat,e)},m=function(e){var i=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,255&e.duration,85,196,0,0]);return e.samplerate&&(i[12]=e.samplerate>>>24&255,i[13]=e.samplerate>>>16&255,i[14]=e.samplerate>>>8&255,i[15]=255&e.samplerate),t(k.mdhd,i)},f=function(e){return t(k.mdia,m(e),g(e.type),o(e))},s=function(e){return t(k.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},o=function(e){return t(k.minf,"video"===e.type?t(k.vmhd,P):t(k.smhd,x),i(),v(e))},u=function(e,i){for(var n=[],r=i.length;r--;)n[r]=b(i[r]);return t.apply(null,[k.moof,s(e)].concat(n))},l=function(e){for(var i=e.length,n=[];i--;)n[i]=d(e[i]);return t.apply(null,[k.moov,h(4294967295)].concat(n).concat(c(e)))},c=function(e){for(var i=e.length,n=[];i--;)n[i]=T(e[i]);return t.apply(null,[k.mvex].concat(n))},h=function(e){var i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return t(k.mvhd,i)},y=function(e){var i,n,r=e.samples||[],a=new Uint8Array(4+r.length);for(n=0;n<r.length;n++)i=r[n].flags,a[n+4]=i.dependsOn<<4|i.isDependedOn<<2|i.hasRedundancy;return t(k.sdtp,a)},v=function(e){return t(k.stbl,_(e),t(k.stts,M),t(k.stsc,D),t(k.stsz,R),t(k.stco,I))},_=function(e){return t(k.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===e.type?B(e):N(e))},B=function(e){var i,n=e.sps||[],r=e.pps||[],a=[],s=[];for(i=0;i<n.length;i++)a.push((65280&n[i].byteLength)>>>8),a.push(255&n[i].byteLength),a=a.concat(Array.prototype.slice.call(n[i]));for(i=0;i<r.length;i++)s.push((65280&r[i].byteLength)>>>8),s.push(255&r[i].byteLength),s=s.concat(Array.prototype.slice.call(r[i]));return t(k.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),t(k.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([n.length]).concat(a).concat([r.length]).concat(s))),t(k.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])))},N=function(e){return t(k.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),n(e))},p=function(e){var i=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]);return t(k.tkhd,i)},b=function(e){var i,n,r,a,s,o;return i=t(k.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),s=Math.floor(e.baseMediaDecodeTime/(H+1)),o=Math.floor(e.baseMediaDecodeTime%(H+1)),n=t(k.tfdt,new Uint8Array([1,0,0,0,s>>>24&255,s>>>16&255,s>>>8&255,255&s,o>>>24&255,o>>>16&255,o>>>8&255,255&o])),92,"audio"===e.type?(r=S(e,92),t(k.traf,i,n,r)):(a=y(e),r=S(e,a.length+92),t(k.traf,i,n,r,a))},d=function(e){return e.duration=e.duration||4294967295,t(k.trak,p(e),f(e))},T=function(e){var i=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==e.type&&(i[i.length-1]=0),t(k.trex,i)},V=function(e,t){var i=0,n=0,r=0,a=0;return e.length&&(void 0!==e[0].duration&&(i=1),void 0!==e[0].size&&(n=2),void 0!==e[0].flags&&(r=4),void 0!==e[0].compositionTimeOffset&&(a=8)),[0,0,i|n|r|a,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},F=function(e,i){var n,r,a,s;for(i+=20+16*(r=e.samples||[]).length,n=V(r,i),s=0;s<r.length;s++)a=r[s],n=n.concat([(4278190080&a.duration)>>>24,(16711680&a.duration)>>>16,(65280&a.duration)>>>8,255&a.duration,(4278190080&a.size)>>>24,(16711680&a.size)>>>16,(65280&a.size)>>>8,255&a.size,a.flags.isLeading<<2|a.flags.dependsOn,a.flags.isDependedOn<<6|a.flags.hasRedundancy<<4|a.flags.paddingValue<<1|a.flags.isNonSyncSample,61440&a.flags.degradationPriority,15&a.flags.degradationPriority,(4278190080&a.compositionTimeOffset)>>>24,(16711680&a.compositionTimeOffset)>>>16,(65280&a.compositionTimeOffset)>>>8,255&a.compositionTimeOffset]);return t(k.trun,new Uint8Array(n))},j=function(e,i){var n,r,a,s;for(i+=20+8*(r=e.samples||[]).length,n=V(r,i),s=0;s<r.length;s++)a=r[s],n=n.concat([(4278190080&a.duration)>>>24,(16711680&a.duration)>>>16,(65280&a.duration)>>>8,255&a.duration,(4278190080&a.size)>>>24,(16711680&a.size)>>>16,(65280&a.size)>>>8,255&a.size]);return t(k.trun,new Uint8Array(n))},S=function(e,t){return"audio"===e.type?j(e,t):F(e,t)},e.exports={ftyp:r,mdat:a,moof:u,moov:l,initSegment:function(e){var t,i=r(),n=l(e);return(t=new Uint8Array(i.byteLength+n.byteLength)).set(i),t.set(n,i.byteLength),t}}},7661:(e,t,i)=>{"use strict";var n,r,a,s,o,u=i(1976).toUnsigned;n=function(e,t){var i,a,s,o,l,c=[];if(!t.length)return null;for(i=0;i<e.byteLength;)a=u(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3]),s=r(e.subarray(i+4,i+8)),o=a>1?i+a:e.byteLength,s===t[0]&&(1===t.length?c.push(e.subarray(i+8,o)):(l=n(e.subarray(i+8,o),t.slice(1))).length&&(c=c.concat(l))),i=o;return c},r=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),t+=String.fromCharCode(e[2]),t+=String.fromCharCode(e[3])},a=function(e){return n(e,["moov","trak"]).reduce((function(e,t){var i,r,a,s,o;return(i=n(t,["tkhd"])[0])?(r=i[0],s=u(i[a=0===r?12:20]<<24|i[a+1]<<16|i[a+2]<<8|i[a+3]),(o=n(t,["mdia","mdhd"])[0])?(a=0===(r=o[0])?12:20,e[s]=u(o[a]<<24|o[a+1]<<16|o[a+2]<<8|o[a+3]),e):null):null}),{})},s=function(e,t){var i,r,a;return i=n(t,["moof","traf"]),r=[].concat.apply([],i.map((function(t){return n(t,["tfhd"]).map((function(i){var r,a,s;return r=u(i[4]<<24|i[5]<<16|i[6]<<8|i[7]),a=e[r]||9e4,s=n(t,["tfdt"]).map((function(e){var t,i;return t=e[0],i=u(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),1===t&&(i*=Math.pow(2,32),i+=u(e[8]<<24|e[9]<<16|e[10]<<8|e[11])),i}))[0],(s=s||1/0)/a}))}))),a=Math.min.apply(null,r),isFinite(a)?a:0},o=function(e){var t=n(e,["moov","trak"]),i=[];return t.forEach((function(e){var t=n(e,["mdia","hdlr"]),a=n(e,["tkhd"]);t.forEach((function(e,t){var n,s,o=r(e.subarray(8,12)),u=a[t];"vide"===o&&(s=0===(n=new DataView(u.buffer,u.byteOffset,u.byteLength)).getUint8(0)?n.getUint32(12):n.getUint32(20),i.push(s))}))})),i},e.exports={findBox:n,parseType:r,timescale:a,startTime:s,videoTrackIds:o}},5557:e=>{e.exports={clearDtsInfo:function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},calculateTrackBaseMediaDecodeTime:function(e,t){var i,n=e.minSegmentDts;return t||(n-=e.timelineStartInfo.dts),i=e.timelineStartInfo.baseMediaDecodeTime,i+=n,i=Math.max(0,i),"audio"===e.type&&(i*=e.samplerate/9e4,i=Math.floor(i)),i},collectDtsInfo:function(e,t){"number"==typeof t.pts&&(void 0===e.timelineStartInfo.pts&&(e.timelineStartInfo.pts=t.pts),void 0===e.minSegmentPts?e.minSegmentPts=t.pts:e.minSegmentPts=Math.min(e.minSegmentPts,t.pts),void 0===e.maxSegmentPts?e.maxSegmentPts=t.pts:e.maxSegmentPts=Math.max(e.maxSegmentPts,t.pts)),"number"==typeof t.dts&&(void 0===e.timelineStartInfo.dts&&(e.timelineStartInfo.dts=t.dts),void 0===e.minSegmentDts?e.minSegmentDts=t.dts:e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),void 0===e.maxSegmentDts?e.maxSegmentDts=t.dts:e.maxSegmentDts=Math.max(e.maxSegmentDts,t.dts))}}},5064:(e,t,i)=>{"use strict";var n,r,a,s,o=i(1961),u=i(2014),l=i(9586),c=i(7091),h=i(5557),d=i(7379),p=i(4886),f=i(6618).H264Stream,m=i(4827),g=i(5220).isLikelyAacData,y=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],v=["width","height","profileIdc","levelIdc","profileCompatibility"],_=function(e,t){var i;if(e.length!==t.length)return!1;for(i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0};(r=function(e,t){var i=[],n=0,a=0,s=0,o=1/0;t=t||{},r.prototype.init.call(this),this.push=function(t){h.collectDtsInfo(e,t),e&&y.forEach((function(i){e[i]=t[i]})),i.push(t)},this.setEarliestDts=function(t){a=t-e.timelineStartInfo.baseMediaDecodeTime},this.setVideoBaseMediaDecodeTime=function(e){o=e},this.setAudioAppendStart=function(e){s=e},this.flush=function(){var r,l,d,p;0!==i.length?(r=c.trimAdtsFramesByEarliestDts(i,e,a),e.baseMediaDecodeTime=h.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),c.prefixWithSilence(e,r,s,o),e.samples=c.generateSampleTable(r),d=u.mdat(c.concatenateFrameData(r)),i=[],l=u.moof(n,[e]),p=new Uint8Array(l.byteLength+d.byteLength),n++,p.set(l),p.set(d,l.byteLength),h.clearDtsInfo(e),this.trigger("data",{track:e,boxes:p}),this.trigger("done","AudioSegmentStream")):this.trigger("done","AudioSegmentStream")}}).prototype=new o,(n=function(e,t){var i,r,a=0,s=[],o=[];t=t||{},n.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){h.collectDtsInfo(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||i||(i=t.config,e.sps=[t.data],v.forEach((function(t){e[t]=i[t]}),this)),"pic_parameter_set_rbsp"!==t.nalUnitType||r||(r=t.data,e.pps=[t.data]),s.push(t)},this.flush=function(){for(var i,n,r,c,d,p;s.length&&"access_unit_delimiter_rbsp"!==s[0].nalUnitType;)s.shift();if(0===s.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(i=l.groupNalsIntoFrames(s),(r=l.groupFramesIntoGops(i))[0][0].keyFrame||((n=this.getGopForFusion_(s[0],e))?(r.unshift(n),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.pts=n.pts,r.dts=n.dts,r.duration+=n.duration):r=l.extendFirstKeyFrame(r)),o.length){var f;if(!(f=t.alignGopsAtEnd?this.alignGopsAtEnd_(r):this.alignGopsAtStart_(r)))return this.gopCache_.unshift({gop:r.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),s=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");h.clearDtsInfo(e),r=f}h.collectDtsInfo(e,r),e.samples=l.generateSampleTable(r),d=u.mdat(l.concatenateNalData(r)),e.baseMediaDecodeTime=h.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),this.trigger("processedGopsInfo",r.map((function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}}))),this.gopCache_.unshift({gop:r.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),s=[],this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime),this.trigger("timelineStartInfo",e.timelineStartInfo),c=u.moof(a,[e]),p=new Uint8Array(c.byteLength+d.byteLength),a++,p.set(c),p.set(d,c.byteLength),this.trigger("data",{track:e,boxes:p}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.resetStream_=function(){h.clearDtsInfo(e),i=void 0,r=void 0},this.getGopForFusion_=function(t){var i,n,r,a,s,o=1/0;for(s=0;s<this.gopCache_.length;s++)r=(a=this.gopCache_[s]).gop,e.pps&&_(e.pps[0],a.pps[0])&&e.sps&&_(e.sps[0],a.sps[0])&&(r.dts<e.timelineStartInfo.dts||(i=t.dts-r.dts-r.duration)>=-1e4&&i<=45e3&&(!n||o>i)&&(n=a,o=i));return n?n.gop:null},this.alignGopsAtStart_=function(e){var t,i,n,r,a,s,u,l;for(a=e.byteLength,s=e.nalCount,u=e.duration,t=i=0;t<o.length&&i<e.length&&(n=o[t],r=e[i],n.pts!==r.pts);)r.pts>n.pts?t++:(i++,a-=r.byteLength,s-=r.nalCount,u-=r.duration);return 0===i?e:i===e.length?null:((l=e.slice(i)).byteLength=a,l.duration=u,l.nalCount=s,l.pts=l[0].pts,l.dts=l[0].dts,l)},this.alignGopsAtEnd_=function(e){var t,i,n,r,a,s,u;for(t=o.length-1,i=e.length-1,a=null,s=!1;t>=0&&i>=0;){if(n=o[t],r=e[i],n.pts===r.pts){s=!0;break}n.pts>r.pts?t--:(t===o.length-1&&(a=i),i--)}if(!s&&null===a)return null;if(0===(u=s?i:a))return e;var l=e.slice(u),c=l.reduce((function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e}),{byteLength:0,duration:0,nalCount:0});return l.byteLength=c.byteLength,l.duration=c.duration,l.nalCount=c.nalCount,l.pts=l[0].pts,l.dts=l[0].dts,l},this.alignGopsWith=function(e){o=e}}).prototype=new o,(s=function(e,t){this.numberOfTracks=0,this.metadataStream=t,void 0!==(e=e||{}).remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"==typeof e.keepOriginalTimestamps&&(this.keepOriginalTimestamps=e.keepOriginalTimestamps),this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,s.prototype.init.call(this),this.push=function(e){return e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBoxes.push(e.boxes),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track),void("audio"===e.track.type&&(this.audioTrack=e.track)))}}).prototype=new o,s.prototype.flush=function(e){var t,i,n,r,a=0,s={captions:[],captionStreams:{},metadata:[],info:{}},o=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==e&&"AudioSegmentStream"!==e)return;if(this.remuxTracks)return;if(0===this.pendingTracks.length)return this.emittedTracks++,void(this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}for(this.videoTrack?(o=this.videoTrack.timelineStartInfo.pts,v.forEach((function(e){s.info[e]=this.videoTrack[e]}),this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,y.forEach((function(e){s.info[e]=this.audioTrack[e]}),this)),1===this.pendingTracks.length?s.type=this.pendingTracks[0].type:s.type="combined",this.emittedTracks+=this.pendingTracks.length,n=u.initSegment(this.pendingTracks),s.initSegment=new Uint8Array(n.byteLength),s.initSegment.set(n),s.data=new Uint8Array(this.pendingBytes),r=0;r<this.pendingBoxes.length;r++)s.data.set(this.pendingBoxes[r],a),a+=this.pendingBoxes[r].byteLength;for(r=0;r<this.pendingCaptions.length;r++)(t=this.pendingCaptions[r]).startTime=t.startPts,this.keepOriginalTimestamps||(t.startTime-=o),t.startTime/=9e4,t.endTime=t.endPts,this.keepOriginalTimestamps||(t.endTime-=o),t.endTime/=9e4,s.captionStreams[t.stream]=!0,s.captions.push(t);for(r=0;r<this.pendingMetadata.length;r++)(i=this.pendingMetadata[r]).cueTime=i.pts,this.keepOriginalTimestamps||(i.cueTime-=o),i.cueTime/=9e4,s.metadata.push(i);s.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",s),this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},(a=function(e){var t,i,o=this,u=!0;a.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var t={};this.transmuxPipeline_=t,t.type="aac",t.metadataStream=new d.MetadataStream,t.aacStream=new m,t.audioTimestampRolloverStream=new d.TimestampRolloverStream("audio"),t.timedMetadataTimestampRolloverStream=new d.TimestampRolloverStream("timed-metadata"),t.adtsStream=new p,t.coalesceStream=new s(e,t.metadataStream),t.headOfPipeline=t.aacStream,t.aacStream.pipe(t.audioTimestampRolloverStream).pipe(t.adtsStream),t.aacStream.pipe(t.timedMetadataTimestampRolloverStream).pipe(t.metadataStream).pipe(t.coalesceStream),t.metadataStream.on("timestamp",(function(e){t.aacStream.setTimestamp(e.timeStamp)})),t.aacStream.on("data",(function(n){"timed-metadata"!==n.type||t.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:o.baseMediaDecodeTime},codec:"adts",type:"audio"},t.coalesceStream.numberOfTracks++,t.audioSegmentStream=new r(i,e),t.adtsStream.pipe(t.audioSegmentStream).pipe(t.coalesceStream))})),t.coalesceStream.on("data",this.trigger.bind(this,"data")),t.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setupTsPipeline=function(){var a={};this.transmuxPipeline_=a,a.type="ts",a.metadataStream=new d.MetadataStream,a.packetStream=new d.TransportPacketStream,a.parseStream=new d.TransportParseStream,a.elementaryStream=new d.ElementaryStream,a.videoTimestampRolloverStream=new d.TimestampRolloverStream("video"),a.audioTimestampRolloverStream=new d.TimestampRolloverStream("audio"),a.timedMetadataTimestampRolloverStream=new d.TimestampRolloverStream("timed-metadata"),a.adtsStream=new p,a.h264Stream=new f,a.captionStream=new d.CaptionStream,a.coalesceStream=new s(e,a.metadataStream),a.headOfPipeline=a.packetStream,a.packetStream.pipe(a.parseStream).pipe(a.elementaryStream),a.elementaryStream.pipe(a.videoTimestampRolloverStream).pipe(a.h264Stream),a.elementaryStream.pipe(a.audioTimestampRolloverStream).pipe(a.adtsStream),a.elementaryStream.pipe(a.timedMetadataTimestampRolloverStream).pipe(a.metadataStream).pipe(a.coalesceStream),a.h264Stream.pipe(a.captionStream).pipe(a.coalesceStream),a.elementaryStream.on("data",(function(s){var u;if("metadata"===s.type){for(u=s.tracks.length;u--;)t||"video"!==s.tracks[u].type?i||"audio"!==s.tracks[u].type||((i=s.tracks[u]).timelineStartInfo.baseMediaDecodeTime=o.baseMediaDecodeTime):(t=s.tracks[u]).timelineStartInfo.baseMediaDecodeTime=o.baseMediaDecodeTime;t&&!a.videoSegmentStream&&(a.coalesceStream.numberOfTracks++,a.videoSegmentStream=new n(t,e),a.videoSegmentStream.on("timelineStartInfo",(function(e){i&&(i.timelineStartInfo=e,a.audioSegmentStream.setEarliestDts(e.dts))})),a.videoSegmentStream.on("processedGopsInfo",o.trigger.bind(o,"gopInfo")),a.videoSegmentStream.on("baseMediaDecodeTime",(function(e){i&&a.audioSegmentStream.setVideoBaseMediaDecodeTime(e)})),a.h264Stream.pipe(a.videoSegmentStream).pipe(a.coalesceStream)),i&&!a.audioSegmentStream&&(a.coalesceStream.numberOfTracks++,a.audioSegmentStream=new r(i,e),a.adtsStream.pipe(a.audioSegmentStream).pipe(a.coalesceStream))}})),a.coalesceStream.on("data",this.trigger.bind(this,"data")),a.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setBaseMediaDecodeTime=function(n){var r=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=n),i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,h.clearDtsInfo(i),e.keepOriginalTimestamps||(i.timelineStartInfo.baseMediaDecodeTime=n),r.audioTimestampRolloverStream&&r.audioTimestampRolloverStream.discontinuity()),t&&(r.videoSegmentStream&&(r.videoSegmentStream.gopCache_=[],r.videoTimestampRolloverStream.discontinuity()),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,h.clearDtsInfo(t),r.captionStream.reset(),e.keepOriginalTimestamps||(t.timelineStartInfo.baseMediaDecodeTime=n)),r.timedMetadataTimestampRolloverStream&&r.timedMetadataTimestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.push=function(e){if(u){var t=g(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),u=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){u=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}}).prototype=new o,e.exports={Transmuxer:a,VideoSegmentStream:n,AudioSegmentStream:r,AUDIO_PROPERTIES:y,VIDEO_PROPERTIES:v}},6221:e=>{"use strict";e.exports={parseSei:function(e){for(var t=0,i={payloadType:-1,payloadSize:0},n=0,r=0;t<e.byteLength&&128!==e[t];){for(;255===e[t];)n+=255,t++;for(n+=e[t++];255===e[t];)r+=255,t++;if(r+=e[t++],!i.payload&&4===n){i.payloadType=n,i.payloadSize=r,i.payload=e.subarray(t,t+r);break}t+=r,n=0,r=0}return i},parseUserData:function(e){return 181!==e.payload[0]||49!=(e.payload[1]<<8|e.payload[2])||"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])||3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)},parseCaptionPackets:function(e,t){var i,n,r,a,s=[];if(!(64&t[0]))return s;for(n=31&t[0],i=0;i<n;i++)a={type:3&t[(r=3*i)+2],pts:e},4&t[r+2]&&(a.ccData=t[r+3]<<8|t[r+4],s.push(a));return s},discardEmulationPreventionBytes:function(e){for(var t,i,n=e.byteLength,r=[],a=1;a<n-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(r.push(a+2),a+=2):a++;if(0===r.length)return e;t=n-r.length,i=new Uint8Array(t);var s=0;for(a=0;a<t;s++,a++)s===r[0]&&(s++,r.shift()),i[a]=e[s];return i},USER_DATA_REGISTERED_ITU_T_T35:4}},2628:(e,t,i)=>{"use strict";var n,r,a=i(7661).parseType,s=function(e){return new Date(1e3*e-20828448e5)},o=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},u=function(e){var t,i,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=[];for(t=0;t+4<e.length;t+=i)if(i=n.getUint32(t),t+=4,i<=0)r.push("<span style='color:red;'>MALFORMED DATA</span>");else switch(31&e[t]){case 1:r.push("slice_layer_without_partitioning_rbsp");break;case 5:r.push("slice_layer_without_partitioning_rbsp_idr");break;case 6:r.push("sei_rbsp");break;case 7:r.push("seq_parameter_set_rbsp");break;case 8:r.push("pic_parameter_set_rbsp");break;case 9:r.push("access_unit_delimiter_rbsp");break;default:r.push("UNKNOWN NAL - "+e[t]&31)}return r},l={avc1:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{dataReferenceIndex:t.getUint16(6),width:t.getUint16(24),height:t.getUint16(26),horizresolution:t.getUint16(28)+t.getUint16(30)/16,vertresolution:t.getUint16(32)+t.getUint16(34)/16,frameCount:t.getUint16(40),depth:t.getUint16(74),config:n(e.subarray(78,e.byteLength))}},avcC:function(e){var t,i,n,r,a=new DataView(e.buffer,e.byteOffset,e.byteLength),s={configurationVersion:e[0],avcProfileIndication:e[1],profileCompatibility:e[2],avcLevelIndication:e[3],lengthSizeMinusOne:3&e[4],sps:[],pps:[]},o=31&e[5];for(n=6,r=0;r<o;r++)i=a.getUint16(n),n+=2,s.sps.push(new Uint8Array(e.subarray(n,n+i))),n+=i;for(t=e[n],n++,r=0;r<t;r++)i=a.getUint16(n),n+=2,s.pps.push(new Uint8Array(e.subarray(n,n+i))),n+=i;return s},btrt:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{bufferSizeDB:t.getUint32(0),maxBitrate:t.getUint32(4),avgBitrate:t.getUint32(8)}},esds:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),esId:e[6]<<8|e[7],streamPriority:31&e[8],decoderConfig:{objectProfileIndication:e[11],streamType:e[12]>>>2&63,bufferSize:e[13]<<16|e[14]<<8|e[15],maxBitrate:e[16]<<24|e[17]<<16|e[18]<<8|e[19],avgBitrate:e[20]<<24|e[21]<<16|e[22]<<8|e[23],decoderConfigDescriptor:{tag:e[24],length:e[25],audioObjectType:e[26]>>>3&31,samplingFrequencyIndex:(7&e[26])<<1|e[27]>>>7&1,channelConfiguration:e[27]>>>3&15}}}},ftyp:function(e){for(var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={majorBrand:a(e.subarray(0,4)),minorVersion:t.getUint32(4),compatibleBrands:[]},n=8;n<e.byteLength;)i.compatibleBrands.push(a(e.subarray(n,n+4))),n+=4;return i},dinf:function(e){return{boxes:n(e)}},dref:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),dataReferences:n(e.subarray(8))}},hdlr:function(e){var t={version:new DataView(e.buffer,e.byteOffset,e.byteLength).getUint8(0),flags:new Uint8Array(e.subarray(1,4)),handlerType:a(e.subarray(8,12)),name:""},i=8;for(i=24;i<e.byteLength;i++){if(0===e[i]){i++;break}t.name+=String.fromCharCode(e[i])}return t.name=decodeURIComponent(escape(t.name)),t},mdat:function(e){return{byteLength:e.byteLength,nals:u(e)}},mdhd:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n=4,r={version:i.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),language:""};return 1===r.version?(n+=4,r.creationTime=s(i.getUint32(n)),n+=8,r.modificationTime=s(i.getUint32(n)),n+=4,r.timescale=i.getUint32(n),n+=8,r.duration=i.getUint32(n)):(r.creationTime=s(i.getUint32(n)),n+=4,r.modificationTime=s(i.getUint32(n)),n+=4,r.timescale=i.getUint32(n),n+=4,r.duration=i.getUint32(n)),n+=4,t=i.getUint16(n),r.language+=String.fromCharCode(96+(t>>10)),r.language+=String.fromCharCode(96+((992&t)>>5)),r.language+=String.fromCharCode(96+(31&t)),r},mdia:function(e){return{boxes:n(e)}},mfhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sequenceNumber:e[4]<<24|e[5]<<16|e[6]<<8|e[7]}},minf:function(e){return{boxes:n(e)}},mp4a:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={dataReferenceIndex:t.getUint16(6),channelcount:t.getUint16(16),samplesize:t.getUint16(18),samplerate:t.getUint16(24)+t.getUint16(26)/65536};return e.byteLength>28&&(i.streamDescriptor=n(e.subarray(28))[0]),i},moof:function(e){return{boxes:n(e)}},moov:function(e){return{boxes:n(e)}},mvex:function(e){return{boxes:n(e)}},mvhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i=4,n={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4))};return 1===n.version?(i+=4,n.creationTime=s(t.getUint32(i)),i+=8,n.modificationTime=s(t.getUint32(i)),i+=4,n.timescale=t.getUint32(i),i+=8,n.duration=t.getUint32(i)):(n.creationTime=s(t.getUint32(i)),i+=4,n.modificationTime=s(t.getUint32(i)),i+=4,n.timescale=t.getUint32(i),i+=4,n.duration=t.getUint32(i)),i+=4,n.rate=t.getUint16(i)+t.getUint16(i+2)/16,i+=4,n.volume=t.getUint8(i)+t.getUint8(i+1)/8,i+=2,i+=2,i+=8,n.matrix=new Uint32Array(e.subarray(i,i+36)),i+=36,i+=24,n.nextTrackId=t.getUint32(i),n},pdin:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),rate:t.getUint32(4),initialDelay:t.getUint32(8)}},sdtp:function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]};for(t=4;t<e.byteLength;t++)i.samples.push({dependsOn:(48&e[t])>>4,isDependedOn:(12&e[t])>>2,hasRedundancy:3&e[t]});return i},sidx:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:i.getUint32(4),timescale:i.getUint32(8),earliestPresentationTime:i.getUint32(12),firstOffset:i.getUint32(16)},r=i.getUint16(22);for(t=24;r;t+=12,r--)n.references.push({referenceType:(128&e[t])>>>7,referencedSize:2147483647&i.getUint32(t),subsegmentDuration:i.getUint32(t+4),startsWithSap:!!(128&e[t+8]),sapType:(112&e[t+8])>>>4,sapDeltaTime:268435455&i.getUint32(t+8)});return n},smhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),balance:e[4]+e[5]/256}},stbl:function(e){return{boxes:n(e)}},stco:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),chunkOffsets:[]},r=i.getUint32(4);for(t=8;r;t+=4,r--)n.chunkOffsets.push(i.getUint32(t));return n},stsc:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n=i.getUint32(4),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleToChunks:[]};for(t=8;n;t+=12,n--)r.sampleToChunks.push({firstChunk:i.getUint32(t),samplesPerChunk:i.getUint32(t+4),sampleDescriptionIndex:i.getUint32(t+8)});return r},stsd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleDescriptions:n(e.subarray(8))}},stsz:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleSize:i.getUint32(4),entries:[]};for(t=12;t<e.byteLength;t+=4)n.entries.push(i.getUint32(t));return n},stts:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),timeToSamples:[]},r=i.getUint32(4);for(t=8;r;t+=8,r--)n.timeToSamples.push({sampleCount:i.getUint32(t),sampleDelta:i.getUint32(t+4)});return n},styp:function(e){return l.ftyp(e)},tfdt:function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4)),baseMediaDecodeTime:e[4]<<24|e[5]<<16|e[6]<<8|e[7]};return 1===t.version&&(t.baseMediaDecodeTime*=Math.pow(2,32),t.baseMediaDecodeTime+=e[8]<<24|e[9]<<16|e[10]<<8|e[11]),t},tfhd:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:i.getUint32(4)},r=1&n.flags[2],a=2&n.flags[2],s=8&n.flags[2],o=16&n.flags[2],u=32&n.flags[2],l=65536&n.flags[0],c=131072&n.flags[0];return t=8,r&&(t+=4,n.baseDataOffset=i.getUint32(12),t+=4),a&&(n.sampleDescriptionIndex=i.getUint32(t),t+=4),s&&(n.defaultSampleDuration=i.getUint32(t),t+=4),o&&(n.defaultSampleSize=i.getUint32(t),t+=4),u&&(n.defaultSampleFlags=i.getUint32(t)),l&&(n.durationIsEmpty=!0),!r&&c&&(n.baseDataOffsetIsMoof=!0),n},tkhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i=4,n={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4))};return 1===n.version?(i+=4,n.creationTime=s(t.getUint32(i)),i+=8,n.modificationTime=s(t.getUint32(i)),i+=4,n.trackId=t.getUint32(i),i+=4,i+=8,n.duration=t.getUint32(i)):(n.creationTime=s(t.getUint32(i)),i+=4,n.modificationTime=s(t.getUint32(i)),i+=4,n.trackId=t.getUint32(i),i+=4,i+=4,n.duration=t.getUint32(i)),i+=4,i+=8,n.layer=t.getUint16(i),i+=2,n.alternateGroup=t.getUint16(i),i+=2,n.volume=t.getUint8(i)+t.getUint8(i+1)/8,i+=2,i+=2,n.matrix=new Uint32Array(e.subarray(i,i+36)),i+=36,n.width=t.getUint16(i)+t.getUint16(i+2)/16,i+=4,n.height=t.getUint16(i)+t.getUint16(i+2)/16,n},traf:function(e){return{boxes:n(e)}},trak:function(e){return{boxes:n(e)}},trex:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:t.getUint32(4),defaultSampleDescriptionIndex:t.getUint32(8),defaultSampleDuration:t.getUint32(12),defaultSampleSize:t.getUint32(16),sampleDependsOn:3&e[20],sampleIsDependedOn:(192&e[21])>>6,sampleHasRedundancy:(48&e[21])>>4,samplePaddingValue:(14&e[21])>>1,sampleIsDifferenceSample:!!(1&e[21]),sampleDegradationPriority:t.getUint16(22)}},trun:function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=1&i.flags[2],a=4&i.flags[2],s=1&i.flags[1],u=2&i.flags[1],l=4&i.flags[1],c=8&i.flags[1],h=n.getUint32(4),d=8;for(r&&(i.dataOffset=n.getInt32(d),d+=4),a&&h&&(t={flags:o(e.subarray(d,d+4))},d+=4,s&&(t.duration=n.getUint32(d),d+=4),u&&(t.size=n.getUint32(d),d+=4),c&&(t.compositionTimeOffset=n.getUint32(d),d+=4),i.samples.push(t),h--);h--;)t={},s&&(t.duration=n.getUint32(d),d+=4),u&&(t.size=n.getUint32(d),d+=4),l&&(t.flags=o(e.subarray(d,d+4)),d+=4),c&&(t.compositionTimeOffset=n.getUint32(d),d+=4),i.samples.push(t);return i},"url ":function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4))}},vmhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),graphicsmode:t.getUint16(4),opcolor:new Uint16Array([t.getUint16(6),t.getUint16(8),t.getUint16(10)])}}};n=function(e){for(var t,i,n,r,s,o=0,u=[],c=new ArrayBuffer(e.length),h=new Uint8Array(c),d=0;d<e.length;++d)h[d]=e[d];for(t=new DataView(c);o<e.byteLength;)i=t.getUint32(o),n=a(e.subarray(o+4,o+8)),r=i>1?o+i:e.byteLength,(s=(l[n]||function(e){return{data:e}})(e.subarray(o+8,r))).size=i,s.type=n,u.push(s),o=r;return u},r=function(e,t){var i;return t=t||0,i=new Array(2*t+1).join(" "),e.map((function(e,n){return i+e.type+"\n"+Object.keys(e).filter((function(e){return"type"!==e&&"boxes"!==e})).map((function(t){var n=i+" "+t+": ",r=e[t];if(r instanceof Uint8Array||r instanceof Uint32Array){var a=Array.prototype.slice.call(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)).map((function(e){return" "+("00"+e.toString(16)).slice(-2)})).join("").match(/.{1,24}/g);return a?1===a.length?n+"<"+a.join("").slice(1)+">":n+"<\n"+a.map((function(e){return i+" "+e})).join("\n")+"\n"+i+" >":n+"<>"}return n+JSON.stringify(r,null,2).split("\n").map((function(e,t){return 0===t?e:i+" "+e})).join("\n")})).join("\n")+(e.boxes?"\n"+r(e.boxes,t+1):"")})).join("\n")},e.exports={inspect:n,textify:r,parseTfdt:l.tfdt,parseHdlr:l.hdlr,parseTfhd:l.tfhd,parseTrun:l.trun}},5547:(e,t,i)=>{"use strict";var n=i(5215),r=i(817).handleRollover,a={};a.ts=i(4149),a.aac=i(5220);var s=9e4,o=188,u=71,l=function(e,t,i){for(var n,r,s,l,c=0,h=o,d=!1;h<=e.byteLength;)if(e[c]!==u||e[h]!==u&&h!==e.byteLength)c++,h++;else{if(n=e.subarray(c,h),"pes"===a.ts.parseType(n,t.pid))r=a.ts.parsePesType(n,t.table),s=a.ts.parsePayloadUnitStartIndicator(n),"audio"===r&&s&&(l=a.ts.parsePesTime(n))&&(l.type="audio",i.audio.push(l),d=!0);if(d)break;c+=o,h+=o}for(c=(h=e.byteLength)-o,d=!1;c>=0;)if(e[c]!==u||e[h]!==u&&h!==e.byteLength)c--,h--;else{if(n=e.subarray(c,h),"pes"===a.ts.parseType(n,t.pid))r=a.ts.parsePesType(n,t.table),s=a.ts.parsePayloadUnitStartIndicator(n),"audio"===r&&s&&(l=a.ts.parsePesTime(n))&&(l.type="audio",i.audio.push(l),d=!0);if(d)break;c-=o,h-=o}},c=function(e,t,i){for(var n,r,s,l,c,h,d,p=0,f=o,m=!1,g={data:[],size:0};f<e.byteLength;)if(e[p]!==u||e[f]!==u)p++,f++;else{if(n=e.subarray(p,f),"pes"===a.ts.parseType(n,t.pid))if(r=a.ts.parsePesType(n,t.table),s=a.ts.parsePayloadUnitStartIndicator(n),"video"===r&&(s&&!m&&(l=a.ts.parsePesTime(n))&&(l.type="video",i.video.push(l),m=!0),!i.firstKeyFrame)){if(s&&0!==g.size){for(c=new Uint8Array(g.size),h=0;g.data.length;)d=g.data.shift(),c.set(d,h),h+=d.byteLength;a.ts.videoPacketContainsKeyFrame(c)&&(i.firstKeyFrame=a.ts.parsePesTime(c),i.firstKeyFrame.type="video"),g.size=0}g.data.push(n),g.size+=n.byteLength}if(m&&i.firstKeyFrame)break;p+=o,f+=o}for(p=(f=e.byteLength)-o,m=!1;p>=0;)if(e[p]!==u||e[f]!==u)p--,f--;else{if(n=e.subarray(p,f),"pes"===a.ts.parseType(n,t.pid))r=a.ts.parsePesType(n,t.table),s=a.ts.parsePayloadUnitStartIndicator(n),"video"===r&&s&&(l=a.ts.parsePesTime(n))&&(l.type="video",i.video.push(l),m=!0);if(m)break;p-=o,f-=o}},h=function(e){var t={pid:null,table:null},i={};for(var r in function(e,t){for(var i,n=0,r=o;r<e.byteLength;)if(e[n]!==u||e[r]!==u)n++,r++;else{switch(i=e.subarray(n,r),a.ts.parseType(i,t.pid)){case"pat":t.pid||(t.pid=a.ts.parsePat(i));break;case"pmt":t.table||(t.table=a.ts.parsePmt(i))}if(t.pid&&t.table)return;n+=o,r+=o}}(e,t),t.table){if(t.table.hasOwnProperty(r))switch(t.table[r]){case n.H264_STREAM_TYPE:i.video=[],c(e,t,i),0===i.video.length&&delete i.video;break;case n.ADTS_STREAM_TYPE:i.audio=[],l(e,t,i),0===i.audio.length&&delete i.audio}}return i};e.exports={inspect:function(e,t){var i;return i=a.aac.isLikelyAacData(e)?function(e){for(var t,i=!1,n=0,r=null,o=null,u=0,l=0;e.length-l>=3;){switch(a.aac.parseType(e,l)){case"timed-metadata":if(e.length-l<10){i=!0;break}if((u=a.aac.parseId3TagSize(e,l))>e.length){i=!0;break}null===o&&(t=e.subarray(l,l+u),o=a.aac.parseAacTimestamp(t)),l+=u;break;case"audio":if(e.length-l<7){i=!0;break}if((u=a.aac.parseAdtsSize(e,l))>e.length){i=!0;break}null===r&&(t=e.subarray(l,l+u),r=a.aac.parseSampleRate(t)),n++,l+=u;break;default:l++}if(i)return null}if(null===r||null===o)return null;var c=s/r;return{audio:[{type:"audio",dts:o,pts:o},{type:"audio",dts:o+1024*n*c,pts:o+1024*n*c}]}}(e):h(e),i&&(i.audio||i.video)?(function(e,t){if(e.audio&&e.audio.length){var i=t;void 0===i&&(i=e.audio[0].dts),e.audio.forEach((function(e){e.dts=r(e.dts,i),e.pts=r(e.pts,i),e.dtsTime=e.dts/s,e.ptsTime=e.pts/s}))}if(e.video&&e.video.length){var n=t;if(void 0===n&&(n=e.video[0].dts),e.video.forEach((function(e){e.dts=r(e.dts,n),e.pts=r(e.pts,n),e.dtsTime=e.dts/s,e.ptsTime=e.pts/s})),e.firstKeyFrame){var a=e.firstKeyFrame;a.dts=r(a.dts,n),a.pts=r(a.pts,n),a.dtsTime=a.dts/s,a.ptsTime=a.dts/s}}}(i,t),i):null},parseAudioPes_:l}},1976:e=>{e.exports={toUnsigned:function(e){return e>>>0}}},1489:e=>{var t,i,n,r,a,s;t=function(e){return 9e4*e},i=function(e,t){return e*t},n=function(e){return e/9e4},r=function(e,t){return e/t},a=function(e,i){return t(r(e,i))},s=function(e,t){return i(n(e),t)},e.exports={secondsToVideoTs:t,secondsToAudioTs:i,videoTsToSeconds:n,audioTsToSeconds:r,audioTsToVideoTs:a,videoTsToAudioTs:s}},9798:e=>{"use strict";var t;t=function(e){var t=e.byteLength,i=0,n=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+n},this.loadWord=function(){var r=e.byteLength-t,a=new Uint8Array(4),s=Math.min(4,t);if(0===s)throw new Error("no bytes available");a.set(e.subarray(r,r+s)),i=new DataView(a.buffer).getUint32(0),n=8*s,t-=s},this.skipBits=function(e){var r;n>e?(i<<=e,n-=e):(e-=n,e-=8*(r=Math.floor(e/8)),t-=r,this.loadWord(),i<<=e,n-=e)},this.readBits=function(e){var r=Math.min(n,e),a=i>>>32-r;return(n-=r)>0?i<<=r:t>0&&this.loadWord(),(r=e-r)>0?a<<r|this.readBits(r):a},this.skipLeadingZeros=function(){var e;for(e=0;e<n;++e)if(0!=(i&2147483648>>>e))return i<<=e,n-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()},e.exports=t},1961:e=>{"use strict";var t=function(){this.init=function(){var e={};this.on=function(t,i){e[t]||(e[t]=[]),e[t]=e[t].concat(i)},this.off=function(t,i){var n;return!!e[t]&&(n=e[t].indexOf(i),e[t]=e[t].slice(),e[t].splice(n,1),n>-1)},this.trigger=function(t){var i,n,r,a;if(i=e[t])if(2===arguments.length)for(r=i.length,n=0;n<r;++n)i[n].call(this,arguments[1]);else{for(a=[],n=arguments.length,n=1;n<arguments.length;++n)a.push(arguments[n]);for(r=i.length,n=0;n<r;++n)i[n].apply(this,a)}},this.dispose=function(){e={}}}};t.prototype.pipe=function(e){return this.on("data",(function(t){e.push(t)})),this.on("done",(function(t){e.flush(t)})),e},t.prototype.push=function(e){this.trigger("data",e)},t.prototype.flush=function(e){this.trigger("done",e)},e.exports=t},4947:(e,t,i)=>{var n=i(2745),r=i(4029);e.exports=function(e){if(!e)return{};var t={};return r(n(e).split("\n"),(function(e){var i,r=e.indexOf(":"),a=n(e.slice(0,r)).toLowerCase(),s=n(e.slice(r+1));void 0===t[a]?t[a]=s:(i=t[a],"[object Array]"===Object.prototype.toString.call(i)?t[a].push(s):t[a]=[t[a],s])})),t}},5974:e=>{e.exports=function(e,t){var i,n=null;try{i=JSON.parse(e,t)}catch(e){n=e}return[n,i]}},2745:(e,t)=>{(t=e.exports=function(e){return e.replace(/^\s*|\s*$/g,"")}).left=function(e){return e.replace(/^\s*/,"")},t.right=function(e){return e.replace(/\s*$/,"")}},7753:e=>{function t(e){return e.replace(/\n\r?\s*/g,"")}e.exports=function(e){for(var i="",n=0;n<arguments.length;n++)i+=t(e[n])+(arguments[n+1]||"");return i}},9945:function(e){var t,i,n,r,a;t=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/\?#]*\/)*.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,i=/^([^\/?#]*)(.*)$/,n=/(?:\/|^)\.(?=\/)/g,r=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,a={buildAbsoluteURL:function(e,t,n){if(n=n||{},e=e.trim(),!(t=t.trim())){if(!n.alwaysNormalize)return e;var r=a.parseURL(e);if(!r)throw new Error("Error trying to parse base URL.");return r.path=a.normalizePath(r.path),a.buildURLFromParts(r)}var s=a.parseURL(t);if(!s)throw new Error("Error trying to parse relative URL.");if(s.scheme)return n.alwaysNormalize?(s.path=a.normalizePath(s.path),a.buildURLFromParts(s)):t;var o=a.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var u=i.exec(o.path);o.netLoc=u[1],o.path=u[2]}o.netLoc&&!o.path&&(o.path="/");var l={scheme:o.scheme,netLoc:s.netLoc,path:null,params:s.params,query:s.query,fragment:s.fragment};if(!s.netLoc&&(l.netLoc=o.netLoc,"/"!==s.path[0]))if(s.path){var c=o.path,h=c.substring(0,c.lastIndexOf("/")+1)+s.path;l.path=a.normalizePath(h)}else l.path=o.path,s.params||(l.params=o.params,s.query||(l.query=o.query));return null===l.path&&(l.path=n.alwaysNormalize?a.normalizePath(s.path):s.path),a.buildURLFromParts(l)},parseURL:function(e){var i=t.exec(e);return i?{scheme:i[1]||"",netLoc:i[2]||"",path:i[3]||"",params:i[4]||"",query:i[5]||"",fragment:i[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(n,"");e.length!==(e=e.replace(r,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}},e.exports=a},1272:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>_u});var n=i(5974),r=i.n(n),a=i(3407),s=i.n(a),o=i(7753),u=i.n(o),l=i(1875),c=i.n(l),h=i(9945),d=i.n(h),p=i(8908),f=i.n(p),m=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},g=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},y=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},v=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},_=function(){function e(){m(this,e),this.listeners={}}return e.prototype.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},e.prototype.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e].splice(i,1),i>-1},e.prototype.trigger=function(e){var t=this.listeners[e],i=void 0,n=void 0,r=void 0;if(t)if(2===arguments.length)for(n=t.length,i=0;i<n;++i)t[i].call(this,arguments[1]);else for(r=Array.prototype.slice.call(arguments,1),n=t.length,i=0;i<n;++i)t[i].apply(this,r)},e.prototype.dispose=function(){this.listeners={}},e.prototype.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}(),b=function(e){function t(){m(this,t);var i=v(this,e.call(this));return i.buffer="",i}return y(t,e),t.prototype.push=function(e){var t=void 0;for(this.buffer+=e,t=this.buffer.indexOf("\n");t>-1;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)},t}(_),T=function(e){for(var t=e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),i={},n=t.length,r=void 0;n--;)""!==t[n]&&((r=/([^=]*)=(.*)/.exec(t[n]).slice(1))[0]=r[0].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^['"](.*)['"]$/g,"$1"),i[r[0]]=r[1]);return i},S=function(e){function t(){m(this,t);var i=v(this,e.call(this));return i.customParsers=[],i}return y(t,e),t.prototype.push=function(e){var t=void 0,i=void 0;if(0!==(e=e.replace(/^[\u0000\s]+|[\u0000\s]+$/g,"")).length)if("#"===e[0]){for(var n=0;n<this.customParsers.length;n++)if(this.customParsers[n].call(this,e))return;if(0===e.indexOf("#EXT"))if(e=e.replace("\r",""),t=/^#EXTM3U/.exec(e))this.trigger("data",{type:"tag",tagType:"m3u"});else{if(t=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(e))return i={type:"tag",tagType:"inf"},t[1]&&(i.duration=parseFloat(t[1])),t[2]&&(i.title=t[2]),void this.trigger("data",i);if(t=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(e))return i={type:"tag",tagType:"targetduration"},t[1]&&(i.duration=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#ZEN-TOTAL-DURATION:?([0-9.]*)?/.exec(e))return i={type:"tag",tagType:"totalduration"},t[1]&&(i.duration=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(e))return i={type:"tag",tagType:"version"},t[1]&&(i.version=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))return i={type:"tag",tagType:"media-sequence"},t[1]&&(i.number=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))return i={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(i.number=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(e))return i={type:"tag",tagType:"playlist-type"},t[1]&&(i.playlistType=t[1]),void this.trigger("data",i);if(t=/^#EXT-X-BYTERANGE:?([0-9.]*)?@?([0-9.]*)?/.exec(e))return i={type:"tag",tagType:"byterange"},t[1]&&(i.length=parseInt(t[1],10)),t[2]&&(i.offset=parseInt(t[2],10)),void this.trigger("data",i);if(t=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(e))return i={type:"tag",tagType:"allow-cache"},t[1]&&(i.allowed=!/NO/.test(t[1])),void this.trigger("data",i);if(t=/^#EXT-X-MAP:?(.*)$/.exec(e)){if(i={type:"tag",tagType:"map"},t[1]){var r=T(t[1]);if(r.URI&&(i.uri=r.URI),r.BYTERANGE){var a=r.BYTERANGE.split("@"),s=a[0],o=a[1];i.byterange={},s&&(i.byterange.length=parseInt(s,10)),o&&(i.byterange.offset=parseInt(o,10))}}this.trigger("data",i)}else if(t=/^#EXT-X-STREAM-INF:?(.*)$/.exec(e)){if(i={type:"tag",tagType:"stream-inf"},t[1]){if(i.attributes=T(t[1]),i.attributes.RESOLUTION){var u=i.attributes.RESOLUTION.split("x"),l={};u[0]&&(l.width=parseInt(u[0],10)),u[1]&&(l.height=parseInt(u[1],10)),i.attributes.RESOLUTION=l}i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes["PROGRAM-ID"]&&(i.attributes["PROGRAM-ID"]=parseInt(i.attributes["PROGRAM-ID"],10))}this.trigger("data",i)}else{if(t=/^#EXT-X-MEDIA:?(.*)$/.exec(e))return i={type:"tag",tagType:"media"},t[1]&&(i.attributes=T(t[1])),void this.trigger("data",i);if(t=/^#EXT-X-ENDLIST/.exec(e))this.trigger("data",{type:"tag",tagType:"endlist"});else if(t=/^#EXT-X-DISCONTINUITY/.exec(e))this.trigger("data",{type:"tag",tagType:"discontinuity"});else{if(t=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(e))return i={type:"tag",tagType:"program-date-time"},t[1]&&(i.dateTimeString=t[1],i.dateTimeObject=new Date(t[1])),void this.trigger("data",i);if(t=/^#EXT-X-KEY:?(.*)$/.exec(e))return i={type:"tag",tagType:"key"},t[1]&&(i.attributes=T(t[1]),i.attributes.IV&&("0x"===i.attributes.IV.substring(0,2).toLowerCase()&&(i.attributes.IV=i.attributes.IV.substring(2)),i.attributes.IV=i.attributes.IV.match(/.{8}/g),i.attributes.IV[0]=parseInt(i.attributes.IV[0],16),i.attributes.IV[1]=parseInt(i.attributes.IV[1],16),i.attributes.IV[2]=parseInt(i.attributes.IV[2],16),i.attributes.IV[3]=parseInt(i.attributes.IV[3],16),i.attributes.IV=new Uint32Array(i.attributes.IV))),void this.trigger("data",i);if(t=/^#EXT-X-START:?(.*)$/.exec(e))return i={type:"tag",tagType:"start"},t[1]&&(i.attributes=T(t[1]),i.attributes["TIME-OFFSET"]=parseFloat(i.attributes["TIME-OFFSET"]),i.attributes.PRECISE=/YES/.test(i.attributes.PRECISE)),void this.trigger("data",i);if(t=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(e))return i={type:"tag",tagType:"cue-out-cont"},t[1]?i.data=t[1]:i.data="",void this.trigger("data",i);if(t=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(e))return i={type:"tag",tagType:"cue-out"},t[1]?i.data=t[1]:i.data="",void this.trigger("data",i);if(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(e))return i={type:"tag",tagType:"cue-in"},t[1]?i.data=t[1]:i.data="",void this.trigger("data",i);this.trigger("data",{type:"tag",data:e.slice(4)})}}}else this.trigger("data",{type:"comment",text:e.slice(1)})}else this.trigger("data",{type:"uri",uri:e})},t.prototype.addParser=function(e){var t=this,i=e.expression,n=e.customType,r=e.dataParser,a=e.segment;"function"!=typeof r&&(r=function(e){return e}),this.customParsers.push((function(e){if(i.exec(e))return t.trigger("data",{type:"custom",data:r(e),customType:n,segment:a}),!0}))},t}(_),k=function(e){function t(){m(this,t);var i=v(this,e.call(this));i.lineStream=new b,i.parseStream=new S,i.lineStream.pipe(i.parseStream);var n=i,r=[],a={},s=void 0,o=void 0,u=function(){},l={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},c=0;return i.manifest={allowCache:!0,discontinuityStarts:[],segments:[]},i.parseStream.on("data",(function(e){var t=void 0,i=void 0;({tag:function(){({"allow-cache":function(){this.manifest.allowCache=e.allowed,"allowed"in e||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange:function(){var t={};"length"in e&&(a.byterange=t,t.length=e.length,"offset"in e||(this.trigger("info",{message:"defaulting offset to zero"}),e.offset=0)),"offset"in e&&(a.byterange=t,t.offset=e.offset)},endlist:function(){this.manifest.endList=!0},inf:function(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),e.duration>0&&(a.duration=e.duration),0===e.duration&&(a.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=r},key:function(){e.attributes?"NONE"!==e.attributes.METHOD?e.attributes.URI?(e.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),o={method:e.attributes.METHOD||"AES-128",uri:e.attributes.URI},void 0!==e.attributes.IV&&(o.iv=e.attributes.IV)):this.trigger("warn",{message:"ignoring key declaration without URI"}):o=null:this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence":function(){isFinite(e.number)?this.manifest.mediaSequence=e.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+e.number})},"discontinuity-sequence":function(){isFinite(e.number)?(this.manifest.discontinuitySequence=e.number,c=e.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+e.number})},"playlist-type":function(){/VOD|EVENT/.test(e.playlistType)?this.manifest.playlistType=e.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+e.playlist})},map:function(){s={},e.uri&&(s.uri=e.uri),e.byterange&&(s.byterange=e.byterange)},"stream-inf":function(){this.manifest.playlists=r,this.manifest.mediaGroups=this.manifest.mediaGroups||l,e.attributes?(a.attributes||(a.attributes={}),g(a.attributes,e.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||l,e.attributes&&e.attributes.TYPE&&e.attributes["GROUP-ID"]&&e.attributes.NAME){var n=this.manifest.mediaGroups[e.attributes.TYPE];n[e.attributes["GROUP-ID"]]=n[e.attributes["GROUP-ID"]]||{},t=n[e.attributes["GROUP-ID"]],(i={default:/yes/i.test(e.attributes.DEFAULT)}).default?i.autoselect=!0:i.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(i.language=e.attributes.LANGUAGE),e.attributes.URI&&(i.uri=e.attributes.URI),e.attributes["INSTREAM-ID"]&&(i.instreamId=e.attributes["INSTREAM-ID"]),e.attributes.CHARACTERISTICS&&(i.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(i.forced=/yes/i.test(e.attributes.FORCED)),t[e.attributes.NAME]=i}else this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){c+=1,a.discontinuity=!0,this.manifest.discontinuityStarts.push(r.length)},"program-date-time":function(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=e.dateTimeString,this.manifest.dateTimeObject=e.dateTimeObject),a.dateTimeString=e.dateTimeString,a.dateTimeObject=e.dateTimeObject},targetduration:function(){!isFinite(e.duration)||e.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+e.duration}):this.manifest.targetDuration=e.duration},totalduration:function(){!isFinite(e.duration)||e.duration<0?this.trigger("warn",{message:"ignoring invalid total duration: "+e.duration}):this.manifest.totalDuration=e.duration},start:function(){e.attributes&&!isNaN(e.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:e.attributes["TIME-OFFSET"],precise:e.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out":function(){a.cueOut=e.data},"cue-out-cont":function(){a.cueOutCont=e.data},"cue-in":function(){a.cueIn=e.data}}[e.tagType]||u).call(n)},uri:function(){a.uri=e.uri,r.push(a),this.manifest.targetDuration&&!("duration"in a)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),a.duration=this.manifest.targetDuration),o&&(a.key=o),a.timeline=c,s&&(a.map=s),a={}},comment:function(){},custom:function(){e.segment?(a.custom=a.custom||{},a.custom[e.customType]=e.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[e.customType]=e.data)}})[e.type].call(n)})),i}return y(t,e),t.prototype.push=function(e){this.lineStream.push(e)},t.prototype.end=function(){this.lineStream.push("\n")},t.prototype.addParser=function(e){this.parseStream.addParser(e)},t}(_),w=i(9144),C=i.n(w),E=function(e){return!!e&&"object"==typeof e},A=function e(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return i.reduce((function(t,i){return Object.keys(i).forEach((function(n){Array.isArray(t[n])&&Array.isArray(i[n])?t[n]=t[n].concat(i[n]):E(t[n])&&E(i[n])?t[n]=e(t[n],i[n]):t[n]=i[n]})),t}),{})},L=function(e){return e.reduce((function(e,t){return e.concat(t)}),[])},O=function(e){if(!e.length)return[];for(var t=[],i=0;i<e.length;i++)t.push(e[i]);return t},P=function(e){var t;return(t=e.reduce((function(e,t){var i,n=t.attributes.id+(t.attributes.lang||"");return e[n]?(t.segments[0].discontinuity=!0,(i=e[n].segments).push.apply(i,t.segments),t.attributes.contentProtection&&(e[n].attributes.contentProtection=t.attributes.contentProtection)):e[n]=t,e}),{}),Object.keys(t).map((function(e){return t[e]}))).map((function(e){var t,i;return e.discontinuityStarts=(t=e.segments,i="discontinuity",t.reduce((function(e,t,n){return t[i]&&e.push(n),e}),[])),e}))},x=function(e){var t,i=e.attributes,n=e.segments,r={attributes:(t={NAME:i.id,BANDWIDTH:i.bandwidth,CODECS:i.codecs},t["PROGRAM-ID"]=1,t),uri:"",endList:"static"===(i.type||"static"),timeline:i.periodIndex,resolvedUri:"",targetDuration:i.duration,segments:n,mediaSequence:n.length?n[0].number:1};return i.contentProtection&&(r.contentProtection=i.contentProtection),r},U=function(e){var t,i=e.attributes,n=e.segments,r={attributes:(t={NAME:i.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:i.width,height:i.height},CODECS:i.codecs,BANDWIDTH:i.bandwidth},t["PROGRAM-ID"]=1,t),uri:"",endList:"static"===(i.type||"static"),timeline:i.periodIndex,resolvedUri:"",targetDuration:i.duration,segments:n,mediaSequence:n.length?n[0].number:1};return i.contentProtection&&(r.contentProtection=i.contentProtection),r},I=function(e){var t;if(!e.length)return{};var i=e[0].attributes,n=i.sourceDuration,r=i.minimumUpdatePeriod,a=void 0===r?0:r,s=P(e.filter((function(e){var t=e.attributes;return"video/mp4"===t.mimeType||"video"===t.contentType}))).map(U),o=P(e.filter((function(e){var t=e.attributes;return"audio/mp4"===t.mimeType||"audio"===t.contentType}))),u=e.filter((function(e){var t=e.attributes;return"text/vtt"===t.mimeType||"text"===t.contentType})),l={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(t={AUDIO:{},VIDEO:{}},t["CLOSED-CAPTIONS"]={},t.SUBTITLES={},t),uri:"",duration:n,playlists:s,minimumUpdatePeriod:1e3*a};return o.length&&(l.mediaGroups.AUDIO.audio=o.reduce((function(e,t){var i=t.attributes.role&&t.attributes.role.value||"main",n=t.attributes.lang||"",r="main";return n&&(r=t.attributes.lang+" ("+i+")"),e[r]&&e[r].playlists[0].attributes.BANDWIDTH>t.attributes.bandwidth||(e[r]={language:n,autoselect:!0,default:"main"===i,playlists:[x(t)],uri:""}),e}),{})),u.length&&(l.mediaGroups.SUBTITLES.subs=function(e){return e.reduce((function(e,t){var i,n,r,a,s=t.attributes.lang||"text";return e[s]||(e[s]={language:s,default:!1,autoselect:!1,playlists:[(i=t,r=i.attributes,a=i.segments,void 0===a&&(a=[{uri:r.baseUrl,timeline:r.periodIndex,resolvedUri:r.baseUrl||"",duration:r.sourceDuration,number:0}],r.duration=r.sourceDuration),{attributes:(n={NAME:r.id,BANDWIDTH:r.bandwidth},n["PROGRAM-ID"]=1,n),uri:"",endList:"static"===(r.type||"static"),timeline:r.periodIndex,resolvedUri:r.baseUrl||"",targetDuration:r.duration,segments:a,mediaSequence:a.length?a[0].number:1})],uri:""}),e}),{})}(u)),l};"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self&&self;var D,R,M=(D=function(e,t){var i,n,r,a,s;i=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/\?#]*\/)*.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,n=/^([^\/?#]*)(.*)$/,r=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,s={buildAbsoluteURL:function(e,t,i){if(i=i||{},e=e.trim(),!(t=t.trim())){if(!i.alwaysNormalize)return e;var r=s.parseURL(e);if(!r)throw new Error("Error trying to parse base URL.");return r.path=s.normalizePath(r.path),s.buildURLFromParts(r)}var a=s.parseURL(t);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return i.alwaysNormalize?(a.path=s.normalizePath(a.path),s.buildURLFromParts(a)):t;var o=s.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var u=n.exec(o.path);o.netLoc=u[1],o.path=u[2]}o.netLoc&&!o.path&&(o.path="/");var l={scheme:o.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(l.netLoc=o.netLoc,"/"!==a.path[0]))if(a.path){var c=o.path,h=c.substring(0,c.lastIndexOf("/")+1)+a.path;l.path=s.normalizePath(h)}else l.path=o.path,a.params||(l.params=o.params,a.query||(l.query=o.query));return null===l.path&&(l.path=i.alwaysNormalize?s.normalizePath(a.path):a.path),s.buildURLFromParts(l)},parseURL:function(e){var t=i.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(r,"");e.length!==(e=e.replace(a,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}},e.exports=s},D(R={exports:{}},R.exports),R.exports),B=function(e,t){return/^[a-z]+:/i.test(t)?t:(/\/\//i.test(e)||(e=M.buildAbsoluteURL(f().location.href,e)),M.buildAbsoluteURL(e,t))},N=function(e){var t=e.baseUrl,i=void 0===t?"":t,n=e.source,r=void 0===n?"":n,a=e.range,s=void 0===a?"":a,o={uri:r,resolvedUri:B(i||"",r)};if(s){var u=s.split("-"),l=parseInt(u[0],10),c=parseInt(u[1],10);o.byterange={length:c-l,offset:l}}return o},j=function(e,t,i){var n=e.NOW,r=e.clientOffset,a=e.availabilityStartTime,s=e.timescale,o=void 0===s?1:s,u=e.start,l=void 0===u?0:u,c=e.minimumUpdatePeriod,h=(n+r)/1e3+(void 0===c?0:c)-(a+l);return Math.ceil((h*o-t)/i)},F=function(e,t){for(var i=e.type,n=void 0===i?"static":i,r=e.minimumUpdatePeriod,a=void 0===r?0:r,s=e.media,o=void 0===s?"":s,u=e.sourceDuration,l=e.timescale,c=void 0===l?1:l,h=e.startNumber,d=void 0===h?1:h,p=e.periodIndex,f=[],m=-1,g=0;g<t.length;g++){var y=t[g],v=y.d,_=y.r||0,b=y.t||0;m<0&&(m=b),b&&b>m&&(m=b);var T=void 0;if(_<0){var S=g+1;T=S===t.length?"dynamic"===n&&a>0&&o.indexOf("$Number$")>0?j(e,m,v):(u*c-m)/v:(t[S].t-m)/v}else T=_+1;for(var k=d+f.length+T,w=d+f.length;w<k;)f.push({number:w,duration:v/c,time:m,timeline:p}),m+=v,w++}return f},V={static:function(e){var t=e.duration,i=e.timescale,n=void 0===i?1:i,r=e.sourceDuration;return{start:0,end:Math.ceil(r/(t/n))}},dynamic:function(e){var t=e.NOW,i=e.clientOffset,n=e.availabilityStartTime,r=e.timescale,a=void 0===r?1:r,s=e.duration,o=e.start,u=void 0===o?0:o,l=e.minimumUpdatePeriod,c=void 0===l?0:l,h=e.timeShiftBufferDepth,d=void 0===h?1/0:h,p=(t+i)/1e3,f=n+u,m=p+c-f,g=Math.ceil(m*a/s),y=Math.floor((p-f-d)*a/s),v=Math.floor((p-f)*a/s);return{start:Math.max(0,y),end:Math.min(g,v)}}},H=function(e){var t=e.type,i=void 0===t?"static":t,n=e.duration,r=e.timescale,a=void 0===r?1:r,s=e.sourceDuration,o=V[i](e),u=function(e,t){for(var i=[],n=e;n<t;n++)i.push(n);return i}(o.start,o.end).map(function(e){return function(t,i){var n=e.duration,r=e.timescale,a=void 0===r?1:r,s=e.periodIndex,o=e.startNumber;return{number:(void 0===o?1:o)+t,duration:n/a,timeline:s,time:i*n}}}(e));if("static"===i){var l=u.length-1;u[l].duration=s-n/a*l}return u},q=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,z=function(e,t){return e.replace(q,function(e){return function(t,i,n,r){if("$$"===t)return"$";if(void 0===e[i])return t;var a=""+e[i];return"RepresentationID"===i?a:(r=n?parseInt(r,10):1,a.length>=r?a:""+new Array(r-a.length+1).join("0")+a)}}(t))},W=function(e,t){var i={RepresentationID:e.id,Bandwidth:e.bandwidth||0},n=e.initialization,r=void 0===n?{sourceURL:"",range:""}:n,a=N({baseUrl:e.baseUrl,source:z(r.sourceURL,i),range:r.range}),s=function(e,t){return e.duration||t?e.duration?H(e):F(e,t):[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodIndex}]}(e,t);return s.map((function(t){i.Number=t.number,i.Time=t.time;var n=z(e.media||"",i);return{uri:n,timeline:t.timeline,duration:t.duration,resolvedUri:B(e.baseUrl||"",n),map:a,number:t.number}}))},G="INVALID_NUMBER_OF_PERIOD",X="DASH_EMPTY_MANIFEST",Y="DASH_INVALID_XML",$="NO_BASE_URL",K="SEGMENT_TIME_UNSPECIFIED",Q="UNSUPPORTED_UTC_TIMING_SCHEME",J=function(e,t){var i=e.duration,n=e.segmentUrls,r=void 0===n?[]:n;if(!i&&!t||i&&t)throw new Error(K);var a,s=r.map((function(t){return function(e,t){var i=e.baseUrl,n=e.initialization,r=void 0===n?{}:n,a=N({baseUrl:i,source:r.sourceURL,range:r.range}),s=N({baseUrl:i,source:t.media,range:t.mediaRange});return s.map=a,s}(e,t)}));return i&&(a=H(e)),t&&(a=F(e,t)),a.map((function(e,t){if(s[t]){var i=s[t];return i.timeline=e.timeline,i.duration=e.duration,i.number=e.number,i}})).filter((function(e){return e}))},Z=function(e){var t=e.baseUrl,i=e.initialization,n=void 0===i?{}:i,r=e.sourceDuration,a=e.timescale,s=void 0===a?1:a,o=e.indexRange,u=void 0===o?"":o,l=e.duration;if(!t)throw new Error($);var c=N({baseUrl:t,source:n.sourceURL,range:n.range}),h=N({baseUrl:t,source:t,range:u});if(h.map=c,l){var d=H(e);d.length&&(h.duration=d[0].duration,h.timeline=d[0].timeline)}else r&&(h.duration=r/s,h.timeline=0);return h.number=0,[h]},ee=function(e){var t,i,n=e.attributes,r=e.segmentInfo;if(r.template?(i=W,t=A(n,r.template)):r.base?(i=Z,t=A(n,r.base)):r.list&&(i=J,t=A(n,r.list)),!i)return{attributes:n};var a=i(t,r.timeline);if(t.duration){var s=t,o=s.duration,u=s.timescale,l=void 0===u?1:u;t.duration=o/l}else a.length?t.duration=a.reduce((function(e,t){return Math.max(e,Math.ceil(t.duration))}),0):t.duration=0;return{attributes:t,segments:a}},te=function(e,t){return O(e.childNodes).filter((function(e){return e.tagName===t}))},ie=function(e){return e.textContent.trim()},ne=function(e){var t=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);if(!t)return 0;var i=t.slice(1),n=i[0],r=i[1],a=i[2],s=i[3],o=i[4],u=i[5];return 31536e3*parseFloat(n||0)+2592e3*parseFloat(r||0)+86400*parseFloat(a||0)+3600*parseFloat(s||0)+60*parseFloat(o||0)+parseFloat(u||0)},re={mediaPresentationDuration:function(e){return ne(e)},availabilityStartTime:function(e){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t=e)&&(t+="Z"),Date.parse(t)/1e3;var t},minimumUpdatePeriod:function(e){return ne(e)},timeShiftBufferDepth:function(e){return ne(e)},start:function(e){return ne(e)},width:function(e){return parseInt(e,10)},height:function(e){return parseInt(e,10)},bandwidth:function(e){return parseInt(e,10)},startNumber:function(e){return parseInt(e,10)},timescale:function(e){return parseInt(e,10)},duration:function(e){var t=parseInt(e,10);return isNaN(t)?ne(e):t},d:function(e){return parseInt(e,10)},t:function(e){return parseInt(e,10)},r:function(e){return parseInt(e,10)},DEFAULT:function(e){return e}},ae=function(e){return e&&e.attributes?O(e.attributes).reduce((function(e,t){var i=re[t.name]||re.DEFAULT;return e[t.name]=i(t.value),e}),{}):{}};var se={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"},oe=function(e,t){return t.length?L(e.map((function(e){return t.map((function(t){return B(e,ie(t))}))}))):e},ue=function(e){var t=te(e,"SegmentTemplate")[0],i=te(e,"SegmentList")[0],n=i&&te(i,"SegmentURL").map((function(e){return A({tag:"SegmentURL"},ae(e))})),r=te(e,"SegmentBase")[0],a=i||t,s=a&&te(a,"SegmentTimeline")[0],o=i||r||t,u=o&&te(o,"Initialization")[0],l=t&&ae(t);l&&u?l.initialization=u&&ae(u):l&&l.initialization&&(l.initialization={sourceURL:l.initialization});var c={template:l,timeline:s&&te(s,"S").map((function(e){return ae(e)})),list:i&&A(ae(i),{segmentUrls:n,initialization:ae(u)}),base:r&&A(ae(r),{initialization:ae(u)})};return Object.keys(c).forEach((function(e){c[e]||delete c[e]})),c},le=function(e){return e.reduce((function(e,t){var i=ae(t),n=se[i.schemeIdUri];if(n){e[n]={attributes:i};var r=te(t,"cenc:pssh")[0];if(r){var a=ie(r),s=a&&function(e){for(var t=f().atob(e),i=new Uint8Array(t.length),n=0;n<t.length;n++)i[n]=t.charCodeAt(n);return i}(a);e[n].pssh=s}}return e}),{})},ce=function(e,t,i){return function(n){var r=ae(n),a=oe(t,te(n,"BaseURL")),s=te(n,"Role")[0],o={role:ae(s)},u=A(e,r,o),l=le(te(n,"ContentProtection"));Object.keys(l).length&&(u=A(u,{contentProtection:l}));var c=ue(n),h=te(n,"Representation"),d=A(i,c);return L(h.map(function(e,t,i){return function(n){var r=te(n,"BaseURL"),a=oe(t,r),s=A(e,ae(n)),o=ue(n);return a.map((function(e){return{segmentInfo:A(i,o),attributes:A(s,{baseUrl:e})}}))}}(u,a,d)))}},he=function(e,t){void 0===t&&(t={});var i=t,n=i.manifestUri,r=void 0===n?"":n,a=i.NOW,s=void 0===a?Date.now():a,o=i.clientOffset,u=void 0===o?0:o,l=te(e,"Period");if(!l.length)throw new Error(G);var c=ae(e),h=oe([r],te(e,"BaseURL"));return c.sourceDuration=c.mediaPresentationDuration||0,c.NOW=s,c.clientOffset=u,L(l.map(function(e,t){return function(i,n){var r=oe(t,te(i,"BaseURL")),a=ae(i),s=parseInt(a.id,10),o=f().isNaN(s)?n:s,u=A(e,{periodIndex:o}),l=te(i,"AdaptationSet"),c=ue(i);return L(l.map(ce(u,r,c)))}}(c,h)))},de=function(e){if(""===e)throw new Error(X);var t=(new(f().DOMParser)).parseFromString(e,"application/xml"),i=t&&"MPD"===t.documentElement.tagName?t.documentElement:null;if(!i||i&&i.getElementsByTagName("parsererror").length>0)throw new Error(Y);return i},pe=function(e,t){return I(he(de(e),t).map(ee))},fe=function(e){return function(e){var t=te(e,"UTCTiming")[0];if(!t)return null;var i=ae(t);switch(i.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":i.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":i.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":i.method="DIRECT",i.value=Date.parse(i.value);break;default:throw new Error(Q)}return i}(de(e))},me=i(7661),ge=i.n(me),ye=i(272),ve=i(5547),_e=i.n(ve);var be=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Te=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),Se=null,ke=function(){function e(t){be(this,e),Se||(Se=function(){var e=[[[],[],[],[],[]],[[],[],[],[],[]]],t=e[0],i=e[1],n=t[4],r=i[4],a=void 0,s=void 0,o=void 0,u=[],l=[],c=void 0,h=void 0,d=void 0,p=void 0,f=void 0;for(a=0;a<256;a++)l[(u[a]=a<<1^283*(a>>7))^a]=a;for(s=o=0;!n[s];s^=c||1,o=l[o]||1)for(d=(d=o^o<<1^o<<2^o<<3^o<<4)>>8^255&d^99,n[s]=d,r[d]=s,f=16843009*u[h=u[c=u[s]]]^65537*h^257*c^16843008*s,p=257*u[d]^16843008*d,a=0;a<4;a++)t[a][s]=p=p<<24^p>>>8,i[a][d]=f=f<<24^f>>>8;for(a=0;a<5;a++)t[a]=t[a].slice(0),i[a]=i[a].slice(0);return e}()),this._tables=[[Se[0][0].slice(),Se[0][1].slice(),Se[0][2].slice(),Se[0][3].slice(),Se[0][4].slice()],[Se[1][0].slice(),Se[1][1].slice(),Se[1][2].slice(),Se[1][3].slice(),Se[1][4].slice()]];var i=void 0,n=void 0,r=void 0,a=void 0,s=void 0,o=this._tables[0][4],u=this._tables[1],l=t.length,c=1;if(4!==l&&6!==l&&8!==l)throw new Error("Invalid aes key size");for(a=t.slice(0),s=[],this._key=[a,s],i=l;i<4*l+28;i++)r=a[i-1],(i%l==0||8===l&&i%l==4)&&(r=o[r>>>24]<<24^o[r>>16&255]<<16^o[r>>8&255]<<8^o[255&r],i%l==0&&(r=r<<8^r>>>24^c<<24,c=c<<1^283*(c>>7))),a[i]=a[i-l]^r;for(n=0;i;n++,i--)r=a[3&n?i:i-4],s[n]=i<=4||n<4?r:u[0][o[r>>>24]]^u[1][o[r>>16&255]]^u[2][o[r>>8&255]]^u[3][o[255&r]]}return e.prototype.decrypt=function(e,t,i,n,r,a){var s=this._key[1],o=e^s[0],u=n^s[1],l=i^s[2],c=t^s[3],h=void 0,d=void 0,p=void 0,f=s.length/4-2,m=void 0,g=4,y=this._tables[1],v=y[0],_=y[1],b=y[2],T=y[3],S=y[4];for(m=0;m<f;m++)h=v[o>>>24]^_[u>>16&255]^b[l>>8&255]^T[255&c]^s[g],d=v[u>>>24]^_[l>>16&255]^b[c>>8&255]^T[255&o]^s[g+1],p=v[l>>>24]^_[c>>16&255]^b[o>>8&255]^T[255&u]^s[g+2],c=v[c>>>24]^_[o>>16&255]^b[u>>8&255]^T[255&l]^s[g+3],g+=4,o=h,u=d,l=p;for(m=0;m<4;m++)r[(3&-m)+a]=S[o>>>24]<<24^S[u>>16&255]<<16^S[l>>8&255]<<8^S[255&c]^s[g++],h=o,o=u,u=l,l=c,c=h},e}(),we=function(){function e(){be(this,e),this.listeners={}}return e.prototype.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},e.prototype.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e].splice(i,1),i>-1},e.prototype.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,n=0;n<i;++n)t[n].call(this,arguments[1]);else for(var r=Array.prototype.slice.call(arguments,1),a=t.length,s=0;s<a;++s)t[s].apply(this,r)},e.prototype.dispose=function(){this.listeners={}},e.prototype.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}(),Ce=function(e){function t(){be(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,we));return i.jobs=[],i.delay=1,i.timeout_=null,i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},t.prototype.push=function(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},t}(we),Ee=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},Ae=function(e,t,i){var n=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),r=new ke(Array.prototype.slice.call(t)),a=new Uint8Array(e.byteLength),s=new Int32Array(a.buffer),o=void 0,u=void 0,l=void 0,c=void 0,h=void 0,d=void 0,p=void 0,f=void 0,m=void 0;for(o=i[0],u=i[1],l=i[2],c=i[3],m=0;m<n.length;m+=4)h=Ee(n[m]),d=Ee(n[m+1]),p=Ee(n[m+2]),f=Ee(n[m+3]),r.decrypt(h,d,p,f,s,m),s[m]=Ee(s[m]^o),s[m+1]=Ee(s[m+1]^u),s[m+2]=Ee(s[m+2]^l),s[m+3]=Ee(s[m+3]^c),o=h,u=d,l=p,c=f;return a},Le=function(){function e(t,i,n,r){be(this,e);var a=e.STEP,s=new Int32Array(t.buffer),o=new Uint8Array(t.byteLength),u=0;for(this.asyncStream_=new Ce,this.asyncStream_.push(this.decryptChunk_(s.subarray(u,u+a),i,n,o)),u=a;u<s.length;u+=a)n=new Uint32Array([Ee(s[u-4]),Ee(s[u-3]),Ee(s[u-2]),Ee(s[u-1])]),this.asyncStream_.push(this.decryptChunk_(s.subarray(u,u+a),i,n,o));this.asyncStream_.push((function(){var e;r(null,(e=o).subarray(0,e.byteLength-e[e.byteLength-1]))}))}return e.prototype.decryptChunk_=function(e,t,i,n){return function(){var r=Ae(e,t,i);n.set(r,e.byteOffset)}},Te(e,null,[{key:"STEP",get:function(){return 32e3}}]),e}(),Oe=i(5108),Pe="7.4.1";function xe(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function Ue(e,t){return Ue=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ue(e,t)}function Ie(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function De(e,t,i){return De=Ie()?Reflect.construct:function(e,t,i){var n=[null];n.push.apply(n,t);var r=new(Function.bind.apply(e,n));return i&&Ue(r,i.prototype),r},De.apply(null,arguments)}function Re(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Me(e,t){return t||(t=e.slice(0)),e.raw=t,e}var Be=[];var Ne=function e(t){var i,n="info",r=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i("log",n,t)};return i=function(e,t){return function(i,n,r){var a=t.levels[n],s=new RegExp("^("+a+")$");if("log"!==i&&r.unshift(i.toUpperCase()+":"),r.unshift(e+":"),Be&&Be.push([].concat(r)),f().console){var o=f().console[i];o||"debug"!==i||(o=f().console.info||f().console.log),o&&a&&s.test(i)&&o[Array.isArray(r)?"apply":"call"](f().console,r)}}}(t,r),r.createLogger=function(i){return e(t+": "+i)},r.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:n},r.level=function(e){if("string"==typeof e){if(!r.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');n=e}return n},(r.history=function(){return Be?[].concat(Be):[]}).filter=function(e){return(Be||[]).filter((function(t){return new RegExp(".*"+e+".*").test(t[0])}))},r.history.clear=function(){Be&&(Be.length=0)},r.history.disable=function(){null!==Be&&(Be.length=0,Be=null)},r.history.enable=function(){null===Be&&(Be=[])},r.error=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return i("error",n,t)},r.warn=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return i("warn",n,t)},r.debug=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return i("debug",n,t)},r}("VIDEOJS"),je=Ne.createLogger,Fe=Object.prototype.toString,Ve=function(e){return ze(e)?Object.keys(e):[]};function He(e,t){Ve(e).forEach((function(i){return t(e[i],i)}))}function qe(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return Object.assign?Object.assign.apply(Object,[e].concat(i)):(i.forEach((function(t){t&&He(t,(function(t,i){e[i]=t}))})),e)}function ze(e){return!!e&&"object"==typeof e}function We(e){return ze(e)&&"[object Object]"===Fe.call(e)&&e.constructor===Object}function Ge(e,t){if(!e||!t)return"";if("function"==typeof f().getComputedStyle){var i=f().getComputedStyle(e);return i?i[t]:""}return""}function Xe(){var e=Me(["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 ","."]);return Xe=function(){return e},e}function Ye(e){return"string"==typeof e&&/\S/.test(e)}function $e(e){if(/\s/.test(e))throw new Error("class has illegal whitespace characters")}function Ke(){return C()===f().document}function Qe(e){return ze(e)&&1===e.nodeType}function Je(){try{return f().parent!==f().self}catch(e){return!0}}function Ze(e){return function(t,i){if(!Ye(t))return C()[e](null);Ye(i)&&(i=C().querySelector(i));var n=Qe(i)?i:C();return n[e]&&n[e](t)}}function et(e,t,i,n){void 0===e&&(e="div"),void 0===t&&(t={}),void 0===i&&(i={});var r=C().createElement(e);return Object.getOwnPropertyNames(t).forEach((function(e){var i=t[e];-1!==e.indexOf("aria-")||"role"===e||"type"===e?(Ne.warn(u()(Xe(),e,i)),r.setAttribute(e,i)):"textContent"===e?tt(r,i):r[e]=i})),Object.getOwnPropertyNames(i).forEach((function(e){r.setAttribute(e,i[e])})),n&&bt(r,n),r}function tt(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function it(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function nt(e,t){return $e(t),e.classList?e.classList.contains(t):(i=t,new RegExp("(^|\\s)"+i+"($|\\s)")).test(e.className);var i}function rt(e,t){return e.classList?e.classList.add(t):nt(e,t)||(e.className=(e.className+" "+t).trim()),e}function at(e,t){return e.classList?e.classList.remove(t):($e(t),e.className=e.className.split(/\s+/).filter((function(e){return e!==t})).join(" ")),e}function st(e,t,i){var n=nt(e,t);if("function"==typeof i&&(i=i(e,t)),"boolean"!=typeof i&&(i=!n),i!==n)return i?rt(e,t):at(e,t),e}function ot(e,t){Object.getOwnPropertyNames(t).forEach((function(i){var n=t[i];null==n||!1===n?e.removeAttribute(i):e.setAttribute(i,!0===n?"":n)}))}function ut(e){var t={},i=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(e&&e.attributes&&e.attributes.length>0)for(var n=e.attributes,r=n.length-1;r>=0;r--){var a=n[r].name,s=n[r].value;"boolean"!=typeof e[a]&&-1===i.indexOf(","+a+",")||(s=null!==s),t[a]=s}return t}function lt(e,t){return e.getAttribute(t)}function ct(e,t,i){e.setAttribute(t,i)}function ht(e,t){e.removeAttribute(t)}function dt(){C().body.focus(),C().onselectstart=function(){return!1}}function pt(){C().onselectstart=function(){return!0}}function ft(e){if(e&&e.getBoundingClientRect&&e.parentNode){var t=e.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach((function(e){void 0!==t[e]&&(i[e]=t[e])})),i.height||(i.height=parseFloat(Ge(e,"height"))),i.width||(i.width=parseFloat(Ge(e,"width"))),i}}function mt(e){var t;if(e.getBoundingClientRect&&e.parentNode&&(t=e.getBoundingClientRect()),!t)return{left:0,top:0};var i=C().documentElement,n=C().body,r=i.clientLeft||n.clientLeft||0,a=f().pageXOffset||n.scrollLeft,s=t.left+a-r,o=i.clientTop||n.clientTop||0,u=f().pageYOffset||n.scrollTop,l=t.top+u-o;return{left:Math.round(s),top:Math.round(l)}}function gt(e,t){var i={},n=mt(e),r=e.offsetWidth,a=e.offsetHeight,s=n.top,o=n.left,u=t.pageY,l=t.pageX;return t.changedTouches&&(l=t.changedTouches[0].pageX,u=t.changedTouches[0].pageY),i.y=Math.max(0,Math.min(1,(s-u+a)/a)),i.x=Math.max(0,Math.min(1,(l-o)/r)),i}function yt(e){return ze(e)&&3===e.nodeType}function vt(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function _t(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map((function(e){return"function"==typeof e&&(e=e()),Qe(e)||yt(e)?e:"string"==typeof e&&/\S/.test(e)?C().createTextNode(e):void 0})).filter((function(e){return e}))}function bt(e,t){return _t(t).forEach((function(t){return e.appendChild(t)})),e}function Tt(e,t){return bt(vt(e),t)}function St(e){return void 0===e.button&&void 0===e.buttons||(0===e.button&&void 0===e.buttons||0===e.button&&1===e.buttons)}var kt=Ze("querySelector"),wt=Ze("querySelectorAll"),Ct=Object.freeze({isReal:Ke,isEl:Qe,isInFrame:Je,createEl:et,textContent:tt,prependTo:it,hasClass:nt,addClass:rt,removeClass:at,toggleClass:st,setAttributes:ot,getAttributes:ut,getAttribute:lt,setAttribute:ct,removeAttribute:ht,blockTextSelection:dt,unblockTextSelection:pt,getBoundingClientRect:ft,findPosition:mt,getPointerPosition:gt,isTextNode:yt,emptyEl:vt,normalizeContent:_t,appendContent:bt,insertContent:Tt,isSingleLeftClick:St,$:kt,$$:wt}),Et=1;function At(){return Et++}var Lt={},Ot="vdata"+(new Date).getTime();function Pt(e){var t=e[Ot];return t||(t=e[Ot]=At()),Lt[t]||(Lt[t]={}),Lt[t]}function xt(e){var t=e[Ot];return!!t&&!!Object.getOwnPropertyNames(Lt[t]).length}function Ut(e){var t=e[Ot];if(t){delete Lt[t];try{delete e[Ot]}catch(t){e.removeAttribute?e.removeAttribute(Ot):e[Ot]=null}}}function It(e,t){var i=Pt(e);0===i.handlers[t].length&&(delete i.handlers[t],e.removeEventListener?e.removeEventListener(t,i.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,i.dispatcher)),Object.getOwnPropertyNames(i.handlers).length<=0&&(delete i.handlers,delete i.dispatcher,delete i.disabled),0===Object.getOwnPropertyNames(i).length&&Ut(e)}function Dt(e,t,i,n){i.forEach((function(i){e(t,i,n)}))}function Rt(e){function t(){return!0}function i(){return!1}if(!e||!e.isPropagationStopped){var n=e||f().event;for(var r in e={},n)"layerX"!==r&&"layerY"!==r&&"keyLocation"!==r&&"webkitMovementX"!==r&&"webkitMovementY"!==r&&("returnValue"===r&&n.preventDefault||(e[r]=n[r]));if(e.target||(e.target=e.srcElement||C()),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){n.preventDefault&&n.preventDefault(),e.returnValue=!1,n.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){n.stopPropagation&&n.stopPropagation(),e.cancelBubble=!0,n.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=i,e.stopImmediatePropagation=function(){n.stopImmediatePropagation&&n.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=i,null!==e.clientX&&void 0!==e.clientX){var a=C().documentElement,s=C().body;e.pageX=e.clientX+(a&&a.scrollLeft||s&&s.scrollLeft||0)-(a&&a.clientLeft||s&&s.clientLeft||0),e.pageY=e.clientY+(a&&a.scrollTop||s&&s.scrollTop||0)-(a&&a.clientTop||s&&s.clientTop||0)}e.which=e.charCode||e.keyCode,null!==e.button&&void 0!==e.button&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0)}return e}var Mt=!1;!function(){try{var e=Object.defineProperty({},"passive",{get:function(){Mt=!0}});f().addEventListener("test",null,e),f().removeEventListener("test",null,e)}catch(e){}}();var Bt=["touchstart","touchmove"];function Nt(e,t,i){if(Array.isArray(t))return Dt(Nt,e,t,i);var n=Pt(e);if(n.handlers||(n.handlers={}),n.handlers[t]||(n.handlers[t]=[]),i.guid||(i.guid=At()),n.handlers[t].push(i),n.dispatcher||(n.disabled=!1,n.dispatcher=function(t,i){if(!n.disabled){t=Rt(t);var r=n.handlers[t.type];if(r)for(var a=r.slice(0),s=0,o=a.length;s<o&&!t.isImmediatePropagationStopped();s++)try{a[s].call(e,t,i)}catch(e){Ne.error(e)}}}),1===n.handlers[t].length)if(e.addEventListener){var r=!1;Mt&&Bt.indexOf(t)>-1&&(r={passive:!0}),e.addEventListener(t,n.dispatcher,r)}else e.attachEvent&&e.attachEvent("on"+t,n.dispatcher)}function jt(e,t,i){if(xt(e)){var n=Pt(e);if(n.handlers){if(Array.isArray(t))return Dt(jt,e,t,i);var r=function(e,t){n.handlers[t]=[],It(e,t)};if(void 0!==t){var a=n.handlers[t];if(a)if(i){if(i.guid)for(var s=0;s<a.length;s++)a[s].guid===i.guid&&a.splice(s--,1);It(e,t)}else r(e,t)}else for(var o in n.handlers)Object.prototype.hasOwnProperty.call(n.handlers||{},o)&&r(e,o)}}}function Ft(e,t,i){var n=xt(e)?Pt(e):{},r=e.parentNode||e.ownerDocument;if("string"==typeof t?t={type:t,target:e}:t.target||(t.target=e),t=Rt(t),n.dispatcher&&n.dispatcher.call(e,t,i),r&&!t.isPropagationStopped()&&!0===t.bubbles)Ft.call(null,r,t,i);else if(!r&&!t.defaultPrevented){var a=Pt(t.target);t.target[t.type]&&(a.disabled=!0,"function"==typeof t.target[t.type]&&t.target[t.type](),a.disabled=!1)}return!t.defaultPrevented}function Vt(e,t,i){if(Array.isArray(t))return Dt(Vt,e,t,i);var n=function n(){jt(e,t,n),i.apply(this,arguments)};n.guid=i.guid=i.guid||At(),Nt(e,t,n)}var Ht,qt=Object.freeze({fixEvent:Rt,on:Nt,off:jt,trigger:Ft,one:Vt}),zt=!1,Wt=function(){if(Ke()&&!1!==Ht.options.autoSetup){var e=Array.prototype.slice.call(C().getElementsByTagName("video")),t=Array.prototype.slice.call(C().getElementsByTagName("audio")),i=Array.prototype.slice.call(C().getElementsByTagName("video-js")),n=e.concat(t,i);if(n&&n.length>0)for(var r=0,a=n.length;r<a;r++){var s=n[r];if(!s||!s.getAttribute){Gt(1);break}void 0===s.player&&null!==s.getAttribute("data-setup")&&Ht(s)}else zt||Gt(1)}};function Gt(e,t){t&&(Ht=t),f().setTimeout(Wt,e)}Ke()&&"complete"===C().readyState?zt=!0:Vt(f(),"load",(function(){zt=!0}));var Xt,Yt=function(e){var t=C().createElement("style");return t.className=e,t},$t=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t},Kt=function(e,t,i){t.guid||(t.guid=At());var n=function(){return t.apply(e,arguments)};return n.guid=i?i+"_"+t.guid:t.guid,n},Qt=function(e,t){var i=Date.now();return function(){var n=Date.now();n-i>=t&&(e.apply(void 0,arguments),i=n)}},Jt=function(){};Jt.prototype.allowedEvents_={},Jt.prototype.on=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},Nt(this,e,t),this.addEventListener=i},Jt.prototype.addEventListener=Jt.prototype.on,Jt.prototype.off=function(e,t){jt(this,e,t)},Jt.prototype.removeEventListener=Jt.prototype.off,Jt.prototype.one=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},Vt(this,e,t),this.addEventListener=i},Jt.prototype.trigger=function(e){var t=e.type||e;"string"==typeof e&&(e={type:t}),e=Rt(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),Ft(this,e)},Jt.prototype.dispatchEvent=Jt.prototype.trigger,Jt.prototype.queueTrigger=function(e){var t=this;Xt||(Xt=new Map);var i=e.type||e,n=Xt.get(this);n||(n=new Map,Xt.set(this,n));var r=n.get(i);n.delete(i),f().clearTimeout(r);var a=f().setTimeout((function(){0===n.size&&(n=null,Xt.delete(t)),t.trigger(e)}),0);n.set(i,a)};var Zt=function(e){return e instanceof Jt||!!e.eventBusEl_&&["on","one","off","trigger"].every((function(t){return"function"==typeof e[t]}))},ei=function(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},ti=function(e){if(!e.nodeName&&!Zt(e))throw new Error("Invalid target; must be a DOM node or evented object.")},ii=function(e){if(!ei(e))throw new Error("Invalid event type; must be a non-empty string or array.")},ni=function(e){if("function"!=typeof e)throw new Error("Invalid listener; must be a function.")},ri=function(e,t){var i,n,r,a=t.length<3||t[0]===e||t[0]===e.eventBusEl_;return a?(i=e.eventBusEl_,t.length>=3&&t.shift(),n=t[0],r=t[1]):(i=t[0],n=t[1],r=t[2]),ti(i),ii(n),ni(r),{isTargetingSelf:a,target:i,type:n,listener:r=Kt(e,r)}},ai=function(e,t,i,n){ti(e),e.nodeName?qt[t](e,i,n):e[t](i,n)},si={on:function(){for(var e=this,t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];var r=ri(this,i),a=r.isTargetingSelf,s=r.target,o=r.type,u=r.listener;if(ai(s,"on",o,u),!a){var l=function(){return e.off(s,o,u)};l.guid=u.guid;var c=function(){return e.off("dispose",l)};c.guid=u.guid,ai(this,"on","dispose",l),ai(s,"on","dispose",c)}},one:function(){for(var e=this,t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];var r=ri(this,i),a=r.isTargetingSelf,s=r.target,o=r.type,u=r.listener;if(a)ai(s,"one",o,u);else{var l=function t(){e.off(s,o,t);for(var i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];u.apply(null,n)};l.guid=u.guid,ai(s,"one",o,l)}},off:function(e,t,i){if(!e||ei(e))jt(this.eventBusEl_,e,t);else{var n=e,r=t;ti(n),ii(r),ni(i),i=Kt(this,i),this.off("dispose",i),n.nodeName?(jt(n,r,i),jt(n,"dispose",i)):Zt(n)&&(n.off(r,i),n.off("dispose",i))}},trigger:function(e,t){return Ft(this.eventBusEl_,e,t)}};function oi(e,t){void 0===t&&(t={});var i=t.eventBusKey;if(i){if(!e[i].nodeName)throw new Error('The eventBusKey "'+i+'" does not refer to an element.');e.eventBusEl_=e[i]}else e.eventBusEl_=et("span",{className:"vjs-event-bus"});return qe(e,si),e.eventedCallbacks&&e.eventedCallbacks.forEach((function(e){e()})),e.on("dispose",(function(){e.off(),f().setTimeout((function(){e.eventBusEl_=null}),0)})),e}var ui={state:{},setState:function(e){var t,i=this;return"function"==typeof e&&(e=e()),He(e,(function(e,n){i.state[n]!==e&&((t=t||{})[n]={from:i.state[n],to:e}),i.state[n]=e})),t&&Zt(this)&&this.trigger({changes:t,type:"statechanged"}),t}};function li(e,t){return qe(e,ui),e.state=qe({},e.state,t),"function"==typeof e.handleStateChanged&&Zt(e)&&e.on("statechanged",e.handleStateChanged),e}function ci(e){return"string"!=typeof e?e:e.charAt(0).toUpperCase()+e.slice(1)}function hi(){for(var e={},t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return i.forEach((function(t){t&&He(t,(function(t,i){We(t)?(We(e[i])||(e[i]={}),e[i]=hi(e[i],t)):e[i]=t}))})),e}var di=function(){function e(e,t,i){if(!e&&this.play?this.player_=e=this:this.player_=e,this.options_=hi({},this.options_),t=this.options_=hi(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){var n=e&&e.id&&e.id()||"no_player";this.id_=n+"_component_"+At()}this.name_=t.name||null,t.el?this.el_=t.el:!1!==t.createEl&&(this.el_=this.createEl()),!1!==t.evented&&oi(this,{eventBusKey:this.el_?"el_":null}),li(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},!1!==t.initChildren&&this.initChildren(),this.ready(i),!1!==t.reportTouchActivity&&this.enableTouchActivity()}var t=e.prototype;return t.dispose=function(){if(this.trigger({type:"dispose",bubbles:!1}),this.children_)for(var e=this.children_.length-1;e>=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),Ut(this.el_),this.el_=null),this.player_=null},t.player=function(){return this.player_},t.options=function(e){return Ne.warn("this.options() has been deprecated and will be moved to the constructor in 6.0"),e?(this.options_=hi(this.options_,e),this.options_):this.options_},t.el=function(){return this.el_},t.createEl=function(e,t,i){return et(e,t,i)},t.localize=function(e,t,i){void 0===i&&(i=e);var n=this.player_.language&&this.player_.language(),r=this.player_.languages&&this.player_.languages(),a=r&&r[n],s=n&&n.split("-")[0],o=r&&r[s],u=i;return a&&a[e]?u=a[e]:o&&o[e]&&(u=o[e]),t&&(u=u.replace(/\{(\d+)\}/g,(function(e,i){var n=t[i-1],r=n;return void 0===n&&(r=e),r}))),u},t.contentEl=function(){return this.contentEl_||this.el_},t.id=function(){return this.id_},t.name=function(){return this.name_},t.children=function(){return this.children_},t.getChildById=function(e){return this.childIndex_[e]},t.getChild=function(e){if(e)return e=ci(e),this.childNameIndex_[e]},t.addChild=function(t,i,n){var r,a;if(void 0===i&&(i={}),void 0===n&&(n=this.children_.length),"string"==typeof t){a=ci(t);var s=i.componentClass||a;i.name=a;var o=e.getComponent(s);if(!o)throw new Error("Component "+s+" does not exist");if("function"!=typeof o)return null;r=new o(this.player_||this,i)}else r=t;if(this.children_.splice(n,0,r),"function"==typeof r.id&&(this.childIndex_[r.id()]=r),(a=a||r.name&&ci(r.name()))&&(this.childNameIndex_[a]=r),"function"==typeof r.el&&r.el()){var u=this.contentEl().children[n]||null;this.contentEl().insertBefore(r.el(),u)}return r},t.removeChild=function(e){if("string"==typeof e&&(e=this.getChild(e)),e&&this.children_){for(var t=!1,i=this.children_.length-1;i>=0;i--)if(this.children_[i]===e){t=!0,this.children_.splice(i,1);break}if(t){this.childIndex_[e.id()]=null,this.childNameIndex_[e.name()]=null;var n=e.el();n&&n.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}},t.initChildren=function(){var t=this,i=this.options_.children;if(i){var n,r=this.options_,a=e.getComponent("Tech");(n=Array.isArray(i)?i:Object.keys(i)).concat(Object.keys(this.options_).filter((function(e){return!n.some((function(t){return"string"==typeof t?e===t:e===t.name}))}))).map((function(e){var n,r;return"string"==typeof e?r=i[n=e]||t.options_[n]||{}:(n=e.name,r=e),{name:n,opts:r}})).filter((function(t){var i=e.getComponent(t.opts.componentClass||ci(t.name));return i&&!a.isTech(i)})).forEach((function(e){var i=e.name,n=e.opts;if(void 0!==r[i]&&(n=r[i]),!1!==n){!0===n&&(n={}),n.playerOptions=t.options_.playerOptions;var a=t.addChild(i,n);a&&(t[i]=a)}}))}},t.buildCSSClass=function(){return""},t.ready=function(e,t){if(void 0===t&&(t=!1),e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))},t.triggerReady=function(){this.isReady_=!0,this.setTimeout((function(){var e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach((function(e){e.call(this)}),this),this.trigger("ready")}),1)},t.$=function(e,t){return kt(e,t||this.contentEl())},t.$$=function(e,t){return wt(e,t||this.contentEl())},t.hasClass=function(e){return nt(this.el_,e)},t.addClass=function(e){rt(this.el_,e)},t.removeClass=function(e){at(this.el_,e)},t.toggleClass=function(e,t){st(this.el_,e,t)},t.show=function(){this.removeClass("vjs-hidden")},t.hide=function(){this.addClass("vjs-hidden")},t.lockShowing=function(){this.addClass("vjs-lock-showing")},t.unlockShowing=function(){this.removeClass("vjs-lock-showing")},t.getAttribute=function(e){return lt(this.el_,e)},t.setAttribute=function(e,t){ct(this.el_,e,t)},t.removeAttribute=function(e){ht(this.el_,e)},t.width=function(e,t){return this.dimension("width",e,t)},t.height=function(e,t){return this.dimension("height",e,t)},t.dimensions=function(e,t){this.width(e,!0),this.height(t)},t.dimension=function(e,t,i){if(void 0!==t)return null!==t&&t==t||(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(i||this.trigger("componentresize"));if(!this.el_)return 0;var n=this.el_.style[e],r=n.indexOf("px");return-1!==r?parseInt(n.slice(0,r),10):parseInt(this.el_["offset"+ci(e)],10)},t.currentDimension=function(e){var t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if("function"==typeof f().getComputedStyle){var i=f().getComputedStyle(this.el_);t=i.getPropertyValue(e)||i[e]}if(0===(t=parseFloat(t))){var n="offset"+ci(e);t=this.el_[n]}return t},t.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},t.currentWidth=function(){return this.currentDimension("width")},t.currentHeight=function(){return this.currentDimension("height")},t.focus=function(){this.el_.focus()},t.blur=function(){this.el_.blur()},t.emitTapEvents=function(){var e,t=0,i=null;this.on("touchstart",(function(n){1===n.touches.length&&(i={pageX:n.touches[0].pageX,pageY:n.touches[0].pageY},t=(new Date).getTime(),e=!0)})),this.on("touchmove",(function(t){if(t.touches.length>1)e=!1;else if(i){var n=t.touches[0].pageX-i.pageX,r=t.touches[0].pageY-i.pageY;Math.sqrt(n*n+r*r)>10&&(e=!1)}}));var n=function(){e=!1};this.on("touchleave",n),this.on("touchcancel",n),this.on("touchend",(function(n){(i=null,!0===e)&&((new Date).getTime()-t<200&&(n.preventDefault(),this.trigger("tap")))}))},t.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var e,t=Kt(this.player(),this.player().reportUserActivity);this.on("touchstart",(function(){t(),this.clearInterval(e),e=this.setInterval(t,250)}));var i=function(i){t(),this.clearInterval(e)};this.on("touchmove",t),this.on("touchend",i),this.on("touchcancel",i)}},t.setTimeout=function(e,t){var i,n,r=this;return e=Kt(this,e),i=f().setTimeout((function(){r.off("dispose",n),e()}),t),(n=function(){return r.clearTimeout(i)}).guid="vjs-timeout-"+i,this.on("dispose",n),i},t.clearTimeout=function(e){f().clearTimeout(e);var t=function(){};return t.guid="vjs-timeout-"+e,this.off("dispose",t),e},t.setInterval=function(e,t){var i=this;e=Kt(this,e);var n=f().setInterval(e,t),r=function(){return i.clearInterval(n)};return r.guid="vjs-interval-"+n,this.on("dispose",r),n},t.clearInterval=function(e){f().clearInterval(e);var t=function(){};return t.guid="vjs-interval-"+e,this.off("dispose",t),e},t.requestAnimationFrame=function(e){var t,i,n=this;return this.supportsRaf_?(e=Kt(this,e),t=f().requestAnimationFrame((function(){n.off("dispose",i),e()})),(i=function(){return n.cancelAnimationFrame(t)}).guid="vjs-raf-"+t,this.on("dispose",i),t):this.setTimeout(e,1e3/60)},t.cancelAnimationFrame=function(e){if(this.supportsRaf_){f().cancelAnimationFrame(e);var t=function(){};return t.guid="vjs-raf-"+e,this.off("dispose",t),e}return this.clearTimeout(e)},e.registerComponent=function(t,i){if("string"!=typeof t||!t)throw new Error('Illegal component name, "'+t+'"; must be a non-empty string.');var n,r=e.getComponent("Tech"),a=r&&r.isTech(i),s=e===i||e.prototype.isPrototypeOf(i.prototype);if(a||!s)throw n=a?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error('Illegal component, "'+t+'"; '+n+".");t=ci(t),e.components_||(e.components_={});var o=e.getComponent("Player");if("Player"===t&&o&&o.players){var u=o.players,l=Object.keys(u);if(u&&l.length>0&&l.map((function(e){return u[e]})).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return e.components_[t]=i,i},e.getComponent=function(t){if(t)return t=ci(t),e.components_&&e.components_[t]?e.components_[t]:void 0},e}();di.prototype.supportsRaf_="function"==typeof f().requestAnimationFrame&&"function"==typeof f().cancelAnimationFrame,di.registerComponent("Component",di);var pi,fi=f().navigator&&f().navigator.userAgent||"",mi=/AppleWebKit\/([\d.]+)/i.exec(fi),gi=mi?parseFloat(mi.pop()):null,yi=/iPad/i.test(fi),vi=/iPhone/i.test(fi)&&!yi,_i=/iPod/i.test(fi),bi=vi||yi||_i,Ti=(pi=fi.match(/OS (\d+)_/i))&&pi[1]?pi[1]:null,Si=/Android/i.test(fi),ki=function(){var e=fi.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;var t=e[1]&&parseFloat(e[1]),i=e[2]&&parseFloat(e[2]);return t&&i?parseFloat(e[1]+"."+e[2]):t||null}(),wi=Si&&ki<5&&gi<537,Ci=/Firefox/i.test(fi),Ei=/Edge/i.test(fi),Ai=!Ei&&(/Chrome/i.test(fi)||/CriOS/i.test(fi)),Li=function(){var e=fi.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),Oi=function(){var e=/MSIE\s(\d+)\.\d/.exec(fi),t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(fi)&&/rv:11.0/.test(fi)&&(t=11),t}(),Pi=/Safari/i.test(fi)&&!Ai&&!Si&&!Ei,xi=(Pi||bi)&&!Ai,Ui=Ke()&&("ontouchstart"in f()||f().navigator.maxTouchPoints||f().DocumentTouch&&f().document instanceof f().DocumentTouch),Ii=Object.freeze({IS_IPAD:yi,IS_IPHONE:vi,IS_IPOD:_i,IS_IOS:bi,IOS_VERSION:Ti,IS_ANDROID:Si,ANDROID_VERSION:ki,IS_NATIVE_ANDROID:wi,IS_FIREFOX:Ci,IS_EDGE:Ei,IS_CHROME:Ai,CHROME_VERSION:Li,IE_VERSION:Oi,IS_SAFARI:Pi,IS_ANY_SAFARI:xi,TOUCH_ENABLED:Ui});function Di(e,t,i,n){return function(e,t,i){if("number"!=typeof t||t<0||t>i)throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+i+").")}(e,n,i.length-1),i[n][t]}function Ri(e){return void 0===e||0===e.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:Di.bind(null,"start",0,e),end:Di.bind(null,"end",1,e)}}function Mi(e,t){return Array.isArray(e)?Ri(e):void 0===e||void 0===t?Ri():Ri([[e,t]])}function Bi(e,t){var i,n,r=0;if(!t)return 0;e&&e.length||(e=Mi(0,0));for(var a=0;a<e.length;a++)i=e.start(a),(n=e.end(a))>t&&(n=t),r+=n-i;return r/t}for(var Ni,ji={},Fi=[["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"]],Vi=Fi[0],Hi=0;Hi<Fi.length;Hi++)if(Fi[Hi][1]in C()){Ni=Fi[Hi];break}if(Ni)for(var qi=0;qi<Ni.length;qi++)ji[Vi[qi]]=Ni[qi];function zi(e){if(e instanceof zi)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:ze(e)&&("number"==typeof e.code&&(this.code=e.code),qe(this,e)),this.message||(this.message=zi.defaultMessages[this.code]||"")}zi.prototype.code=0,zi.prototype.message="",zi.prototype.status=null,zi.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],zi.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(var Wi=0;Wi<zi.errorTypes.length;Wi++)zi[zi.errorTypes[Wi]]=Wi,zi.prototype[zi.errorTypes[Wi]]=Wi;function Gi(e){return null!=e&&"function"==typeof e.then}function Xi(e){Gi(e)&&e.then(null,(function(e){}))}var Yi=function(e){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((function(t,i,n){return e[i]&&(t[i]=e[i]),t}),{cues:e.cues&&Array.prototype.map.call(e.cues,(function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}}))})},$i=function(e){var t=e.$$("track"),i=Array.prototype.map.call(t,(function(e){return e.track}));return Array.prototype.map.call(t,(function(e){var t=Yi(e.track);return e.src&&(t.src=e.src),t})).concat(Array.prototype.filter.call(e.textTracks(),(function(e){return-1===i.indexOf(e)})).map(Yi))},Ki=function(e,t){return e.forEach((function(e){var i=t.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach((function(e){return i.addCue(e)}))})),t.textTracks()},Qi=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).opened_=n.hasBeenOpened_=n.hasBeenFilled_=!1,n.closeable(!n.options_.uncloseable),n.content(n.options_.content),n.contentEl_=et("div",{className:"vjs-modal-dialog-content"},{role:"document"}),n.descEl_=et("p",{className:"vjs-modal-dialog-description vjs-control-text",id:n.el().getAttribute("aria-describedby")}),tt(n.descEl_,n.description()),n.el_.appendChild(n.descEl_),n.el_.appendChild(n.contentEl_),n}xe(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})},i.dispose=function(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,e.prototype.dispose.call(this)},i.buildCSSClass=function(){return"vjs-modal-dialog vjs-hidden "+e.prototype.buildCSSClass.call(this)},i.handleKeyPress=function(e){27===e.which&&this.closeable()&&this.close()},i.label=function(){return this.localize(this.options_.label||"Modal Window")},i.description=function(){var e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e},i.open=function(){if(!this.opened_){var e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.closeable()&&this.on(this.el_.ownerDocument,"keydown",Kt(this,this.handleKeyPress)),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}},i.opened=function(e){return"boolean"==typeof e&&this[e?"open":"close"](),this.opened_},i.close=function(){if(this.opened_){var e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.closeable()&&this.off(this.el_.ownerDocument,"keydown",Kt(this,this.handleKeyPress)),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}},i.closeable=function(e){if("boolean"==typeof e){var t=this.closeable_=!!e,i=this.getChild("closeButton");if(t&&!i){var n=this.contentEl_;this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=n,this.on(i,"close",this.close)}!t&&i&&(this.off(i,"close",this.close),this.removeChild(i),i.dispose())}return this.closeable_},i.fill=function(){this.fillWith(this.content())},i.fillWith=function(e){var t=this.contentEl(),i=t.parentNode,n=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),Tt(t,e),this.trigger("modalfill"),n?i.insertBefore(t,n):i.appendChild(t);var r=this.getChild("closeButton");r&&i.appendChild(r.el_)},i.empty=function(){this.trigger("beforemodalempty"),vt(this.contentEl()),this.trigger("modalempty")},i.content=function(e){return void 0!==e&&(this.content_=e),this.content_},i.conditionalFocus_=function(){var e=C().activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus(),this.on(C(),"keydown",this.handleKeyDown))},i.conditionalBlur_=function(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null),this.off(C(),"keydown",this.handleKeyDown)},i.handleKeyDown=function(e){if(9===e.which){for(var t,i=this.focusableEls_(),n=this.el_.querySelector(":focus"),r=0;r<i.length;r++)if(n===i[r]){t=r;break}C().activeElement===this.el_&&(t=0),e.shiftKey&&0===t?(i[i.length-1].focus(),e.preventDefault()):e.shiftKey||t!==i.length-1||(i[0].focus(),e.preventDefault())}},i.focusableEls_=function(){var e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,(function(e){return(e instanceof f().HTMLAnchorElement||e instanceof f().HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof f().HTMLInputElement||e instanceof f().HTMLSelectElement||e instanceof f().HTMLTextAreaElement||e instanceof f().HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof f().HTMLIFrameElement||e instanceof f().HTMLObjectElement||e instanceof f().HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable")}))},t}(di);Qi.prototype.options_={pauseOnOpen:!0,temporary:!0},di.registerComponent("ModalDialog",Qi);var Ji=function(e){function t(t){var i;void 0===t&&(t=[]),(i=e.call(this)||this).tracks_=[],Object.defineProperty(Re(Re(i)),"length",{get:function(){return this.tracks_.length}});for(var n=0;n<t.length;n++)i.addTrack(t[n]);return i}xe(t,e);var i=t.prototype;return i.addTrack=function(e){var t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get:function(){return this.tracks_[t]}}),-1===this.tracks_.indexOf(e)&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack"}))},i.removeTrack=function(e){for(var t,i=0,n=this.length;i<n;i++)if(this[i]===e){(t=this[i]).off&&t.off(),this.tracks_.splice(i,1);break}t&&this.trigger({track:t,type:"removetrack"})},i.getTrackById=function(e){for(var t=null,i=0,n=this.length;i<n;i++){var r=this[i];if(r.id===e){t=r;break}}return t},t}(Jt);for(var Zi in Ji.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack"},Ji.prototype.allowedEvents_)Ji.prototype["on"+Zi]=null;var en=function(e,t){for(var i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].enabled=!1)},tn=function(e){function t(t){var i;void 0===t&&(t=[]);for(var n=t.length-1;n>=0;n--)if(t[n].enabled){en(t,t[n]);break}return(i=e.call(this,t)||this).changing_=!1,i}return xe(t,e),t.prototype.addTrack=function(t){var i=this;t.enabled&&en(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&t.addEventListener("enabledchange",(function(){i.changing_||(i.changing_=!0,en(i,t),i.changing_=!1,i.trigger("change"))}))},t}(Ji),nn=function(e,t){for(var i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].selected=!1)},rn=function(e){function t(t){var i;void 0===t&&(t=[]);for(var n=t.length-1;n>=0;n--)if(t[n].selected){nn(t,t[n]);break}return(i=e.call(this,t)||this).changing_=!1,Object.defineProperty(Re(Re(i)),"selectedIndex",{get:function(){for(var e=0;e<this.length;e++)if(this[e].selected)return e;return-1},set:function(){}}),i}return xe(t,e),t.prototype.addTrack=function(t){var i=this;t.selected&&nn(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&t.addEventListener("selectedchange",(function(){i.changing_||(i.changing_=!0,nn(i,t),i.changing_=!1,i.trigger("change"))}))},t}(Ji),an=function(e){function t(){return e.apply(this,arguments)||this}return xe(t,e),t.prototype.addTrack=function(t){e.prototype.addTrack.call(this,t),t.addEventListener("modechange",Kt(this,(function(){this.queueTrigger("change")})));-1===["metadata","chapters"].indexOf(t.kind)&&t.addEventListener("modechange",Kt(this,(function(){this.trigger("selectedlanguagechange")})))},t}(Ji),sn=function(){function e(e){void 0===e&&(e=[]),this.trackElements_=[],Object.defineProperty(this,"length",{get:function(){return this.trackElements_.length}});for(var t=0,i=e.length;t<i;t++)this.addTrackElement_(e[t])}var t=e.prototype;return t.addTrackElement_=function(e){var t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get:function(){return this.trackElements_[t]}}),-1===this.trackElements_.indexOf(e)&&this.trackElements_.push(e)},t.getTrackElementByTrack_=function(e){for(var t,i=0,n=this.trackElements_.length;i<n;i++)if(e===this.trackElements_[i].track){t=this.trackElements_[i];break}return t},t.removeTrackElement_=function(e){for(var t=0,i=this.trackElements_.length;t<i;t++)if(e===this.trackElements_[t]){this.trackElements_.splice(t,1);break}},e}(),on=function(){function e(t){e.prototype.setCues_.call(this,t),Object.defineProperty(this,"length",{get:function(){return this.length_}})}var t=e.prototype;return t.setCues_=function(e){var t=this.length||0,i=0,n=e.length;this.cues_=e,this.length_=e.length;var r=function(e){""+e in this||Object.defineProperty(this,""+e,{get:function(){return this.cues_[e]}})};if(t<n)for(i=t;i<n;i++)r.call(this,i)},t.getCueById=function(e){for(var t=null,i=0,n=this.length;i<n;i++){var r=this[i];if(r.id===e){t=r;break}}return t},e}(),un={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},ln={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},cn={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},hn={disabled:"disabled",hidden:"hidden",showing:"showing"},dn=function(e){function t(t){var i;void 0===t&&(t={}),i=e.call(this)||this;var n={id:t.id||"vjs_track_"+At(),kind:t.kind||"",label:t.label||"",language:t.language||""},r=function(e){Object.defineProperty(Re(Re(i)),e,{get:function(){return n[e]},set:function(){}})};for(var a in n)r(a);return i}return xe(t,e),t}(Jt),pn=function(e){var t=["protocol","hostname","port","pathname","search","hash","host"],i=C().createElement("a");i.href=e;var n,r=""===i.host&&"file:"!==i.protocol;r&&((n=C().createElement("div")).innerHTML='<a href="'+e+'"></a>',i=n.firstChild,n.setAttribute("style","display:none; position:absolute;"),C().body.appendChild(n));for(var a={},s=0;s<t.length;s++)a[t[s]]=i[t[s]];return"http:"===a.protocol&&(a.host=a.host.replace(/:80$/,"")),"https:"===a.protocol&&(a.host=a.host.replace(/:443$/,"")),a.protocol||(a.protocol=f().location.protocol),r&&C().body.removeChild(n),a},fn=function(e){if(!e.match(/^https?:\/\//)){var t=C().createElement("div");t.innerHTML='<a href="'+e+'">x</a>',e=t.firstChild.href}return e},mn=function(e){if("string"==typeof e){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i.exec(e);if(t)return t.pop().toLowerCase()}return""},gn=function(e){var t=f().location,i=pn(e);return(":"===i.protocol?t.protocol:i.protocol)+i.host!==t.protocol+t.host},yn=Object.freeze({parseUrl:pn,getAbsoluteURL:fn,getFileExtension:mn,isCrossOrigin:gn}),vn=function(e,t){var i=new(f().WebVTT.Parser)(f(),f().vttjs,f().WebVTT.StringDecoder()),n=[];i.oncue=function(e){t.addCue(e)},i.onparsingerror=function(e){n.push(e)},i.onflush=function(){t.trigger({type:"loadeddata",target:t})},i.parse(e),n.length>0&&(f().console&&f().console.groupCollapsed&&f().console.groupCollapsed("Text Track parsing errors for "+t.src),n.forEach((function(e){return Ne.error(e)})),f().console&&f().console.groupEnd&&f().console.groupEnd()),i.flush()},_n=function(e){function t(t){var i;if(void 0===t&&(t={}),!t.tech)throw new Error("A tech was not provided.");var n=hi(t,{kind:cn[t.kind]||"subtitles",language:t.language||t.srclang||""}),r=hn[n.mode]||"disabled",a=n.default;"metadata"!==n.kind&&"chapters"!==n.kind||(r="hidden"),(i=e.call(this,n)||this).tech_=n.tech,i.cues_=[],i.activeCues_=[];var s=new on(i.cues_),o=new on(i.activeCues_),u=!1,l=Kt(Re(Re(i)),(function(){this.activeCues=this.activeCues,u&&(this.trigger("cuechange"),u=!1)}));return"disabled"!==r&&i.tech_.ready((function(){i.tech_.on("timeupdate",l)}),!0),Object.defineProperties(Re(Re(i)),{default:{get:function(){return a},set:function(){}},mode:{get:function(){return r},set:function(e){var t=this;hn[e]&&("disabled"!==(r=e)?this.tech_.ready((function(){t.tech_.on("timeupdate",l)}),!0):this.tech_.off("timeupdate",l),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?s:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return o;for(var e=this.tech_.currentTime(),t=[],i=0,n=this.cues.length;i<n;i++){var r=this.cues[i];(r.startTime<=e&&r.endTime>=e||r.startTime===r.endTime&&r.startTime<=e&&r.startTime+.5>=e)&&t.push(r)}if(u=!1,t.length!==this.activeCues_.length)u=!0;else for(var a=0;a<t.length;a++)-1===this.activeCues_.indexOf(t[a])&&(u=!0);return this.activeCues_=t,o.setCues_(this.activeCues_),o},set:function(){}}}),n.src?(i.src=n.src,function(e,t){var i={uri:e},n=gn(e);n&&(i.cors=n),c()(i,Kt(this,(function(e,i,n){if(e)return Ne.error(e,i);if(t.loaded_=!0,"function"!=typeof f().WebVTT){if(t.tech_){var r=function(){return vn(n,t)};t.tech_.on("vttjsloaded",r),t.tech_.on("vttjserror",(function(){Ne.error("vttjs failed to load, stopping trying to process "+t.src),t.tech_.off("vttjsloaded",r)}))}}else vn(n,t)})))}(n.src,Re(Re(i)))):i.loaded_=!0,i}xe(t,e);var i=t.prototype;return i.addCue=function(e){var t=e;if(f().vttjs&&!(e instanceof f().vttjs.VTTCue)){for(var i in t=new(f().vttjs.VTTCue)(e.startTime,e.endTime,e.text),e)i in t||(t[i]=e[i]);t.id=e.id,t.originalCue_=e}for(var n=this.tech_.textTracks(),r=0;r<n.length;r++)n[r]!==this&&n[r].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)},i.removeCue=function(e){for(var t=this.cues_.length;t--;){var i=this.cues_[t];if(i===e||i.originalCue_&&i.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}},t}(dn);_n.prototype.allowedEvents_={cuechange:"cuechange"};var bn=function(e){function t(t){var i;void 0===t&&(t={});var n=hi(t,{kind:ln[t.kind]||""});i=e.call(this,n)||this;var r=!1;return Object.defineProperty(Re(Re(i)),"enabled",{get:function(){return r},set:function(e){"boolean"==typeof e&&e!==r&&(r=e,this.trigger("enabledchange"))}}),n.enabled&&(i.enabled=n.enabled),i.loaded_=!0,i}return xe(t,e),t}(dn),Tn=function(e){function t(t){var i;void 0===t&&(t={});var n=hi(t,{kind:un[t.kind]||""});i=e.call(this,n)||this;var r=!1;return Object.defineProperty(Re(Re(i)),"selected",{get:function(){return r},set:function(e){"boolean"==typeof e&&e!==r&&(r=e,this.trigger("selectedchange"))}}),n.selected&&(i.selected=n.selected),i}return xe(t,e),t}(dn),Sn=function(e){function t(t){var i,n;void 0===t&&(t={}),i=e.call(this)||this;var r=new _n(t);return i.kind=r.kind,i.src=r.src,i.srclang=r.language,i.label=r.label,i.default=r.default,Object.defineProperties(Re(Re(i)),{readyState:{get:function(){return n}},track:{get:function(){return r}}}),n=0,r.addEventListener("loadeddata",(function(){n=2,i.trigger({type:"load",target:Re(Re(i))})})),i}return xe(t,e),t}(Jt);Sn.prototype.allowedEvents_={load:"load"},Sn.NONE=0,Sn.LOADING=1,Sn.LOADED=2,Sn.ERROR=3;var kn={audio:{ListClass:tn,TrackClass:bn,capitalName:"Audio"},video:{ListClass:rn,TrackClass:Tn,capitalName:"Video"},text:{ListClass:an,TrackClass:_n,capitalName:"Text"}};Object.keys(kn).forEach((function(e){kn[e].getterName=e+"Tracks",kn[e].privateName=e+"Tracks_"}));var wn={remoteText:{ListClass:an,TrackClass:_n,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:sn,TrackClass:Sn,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},Cn=hi(kn,wn);wn.names=Object.keys(wn),kn.names=Object.keys(kn),Cn.names=[].concat(wn.names).concat(kn.names);var En=function(e){function t(t,i){var n;return void 0===t&&(t={}),void 0===i&&(i=function(){}),t.reportTouchActivity=!1,(n=e.call(this,null,t,i)||this).hasStarted_=!1,n.on("playing",(function(){this.hasStarted_=!0})),n.on("loadstart",(function(){this.hasStarted_=!1})),Cn.names.forEach((function(e){var i=Cn[e];t&&t[i.getterName]&&(n[i.privateName]=t[i.getterName])})),n.featuresProgressEvents||n.manualProgressOn(),n.featuresTimeupdateEvents||n.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach((function(e){!1===t["native"+e+"Tracks"]&&(n["featuresNative"+e+"Tracks"]=!1)})),!1===t.nativeCaptions||!1===t.nativeTextTracks?n.featuresNativeTextTracks=!1:!0!==t.nativeCaptions&&!0!==t.nativeTextTracks||(n.featuresNativeTextTracks=!0),n.featuresNativeTextTracks||n.emulateTextTracks(),n.autoRemoteTextTracks_=new Cn.text.ListClass,n.initTrackListeners(),t.nativeControlsForTouch||n.emitTapEvents(),n.constructor&&(n.name_=n.constructor.name||"Unknown Tech"),n}xe(t,e);var i=t.prototype;return i.triggerSourceset=function(e){var t=this;this.isReady_||this.one("ready",(function(){return t.setTimeout((function(){return t.triggerSourceset(e)}),1)})),this.trigger({src:e,type:"sourceset"})},i.manualProgressOn=function(){this.on("durationchange",this.onDurationChange),this.manualProgress=!0,this.one("ready",this.trackProgress)},i.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange)},i.trackProgress=function(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(Kt(this,(function(){var e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),this.bufferedPercent_=e,1===e&&this.stopTrackingProgress()})),500)},i.onDurationChange=function(e){this.duration_=this.duration()},i.buffered=function(){return Mi(0,0)},i.bufferedPercent=function(){return Bi(this.buffered(),this.duration_)},i.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},i.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime),this.on("pause",this.stopTrackingCurrentTime)},i.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime),this.off("pause",this.stopTrackingCurrentTime)},i.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval((function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}),250)},i.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},i.dispose=function(){this.clearTracks(kn.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),e.prototype.dispose.call(this)},i.clearTracks=function(e){var t=this;(e=[].concat(e)).forEach((function(e){for(var i=t[e+"Tracks"]()||[],n=i.length;n--;){var r=i[n];"text"===e&&t.removeRemoteTextTrack(r),i.removeTrack(r)}}))},i.cleanupAutoTextTracks=function(){for(var e=this.autoRemoteTextTracks_||[],t=e.length;t--;){var i=e[t];this.removeRemoteTextTrack(i)}},i.reset=function(){},i.error=function(e){return void 0!==e&&(this.error_=new zi(e),this.trigger("error")),this.error_},i.played=function(){return this.hasStarted_?Mi(0,0):Mi()},i.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},i.initTrackListeners=function(){var e=this;kn.names.forEach((function(t){var i=kn[t],n=function(){e.trigger(t+"trackchange")},r=e[i.getterName]();r.addEventListener("removetrack",n),r.addEventListener("addtrack",n),e.on("dispose",(function(){r.removeEventListener("removetrack",n),r.removeEventListener("addtrack",n)}))}))},i.addWebVttScript_=function(){var e=this;if(!f().WebVTT)if(C().body.contains(this.el())){if(!this.options_["vtt.js"]&&We(s())&&Object.keys(s()).length>0)return void this.trigger("vttjsloaded");var t=C().createElement("script");t.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",t.onload=function(){e.trigger("vttjsloaded")},t.onerror=function(){e.trigger("vttjserror")},this.on("dispose",(function(){t.onload=null,t.onerror=null})),f().WebVTT=!0,this.el().parentNode.appendChild(t)}else this.ready(this.addWebVttScript_)},i.emulateTextTracks=function(){var e=this,t=this.textTracks(),i=this.remoteTextTracks(),n=function(e){return t.addTrack(e.track)},r=function(e){return t.removeTrack(e.track)};i.on("addtrack",n),i.on("removetrack",r),this.addWebVttScript_();var a=function(){return e.trigger("texttrackchange")},s=function(){a();for(var e=0;e<t.length;e++){var i=t[e];i.removeEventListener("cuechange",a),"showing"===i.mode&&i.addEventListener("cuechange",a)}};s(),t.addEventListener("change",s),t.addEventListener("addtrack",s),t.addEventListener("removetrack",s),this.on("dispose",(function(){i.off("addtrack",n),i.off("removetrack",r),t.removeEventListener("change",s),t.removeEventListener("addtrack",s),t.removeEventListener("removetrack",s);for(var e=0;e<t.length;e++){t[e].removeEventListener("cuechange",a)}}))},i.addTextTrack=function(e,t,i){if(!e)throw new Error("TextTrack kind is required but was not provided");return function(e,t,i,n,r){void 0===r&&(r={});var a=e.textTracks();r.kind=t,i&&(r.label=i),n&&(r.language=n),r.tech=e;var s=new Cn.text.TrackClass(r);return a.addTrack(s),s}(this,e,t,i)},i.createRemoteTextTrack=function(e){var t=hi(e,{tech:this});return new wn.remoteTextEl.TrackClass(t)},i.addRemoteTextTrack=function(e,t){var i=this;void 0===e&&(e={});var n=this.createRemoteTextTrack(e);return!0!==t&&!1!==t&&(Ne.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),t=!0),this.remoteTextTrackEls().addTrackElement_(n),this.remoteTextTracks().addTrack(n.track),!0!==t&&this.ready((function(){return i.autoRemoteTextTracks_.addTrack(n.track)})),n},i.removeRemoteTextTrack=function(e){var t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)},i.getVideoPlaybackQuality=function(){return{}},i.setPoster=function(){},i.playsinline=function(){},i.setPlaysinline=function(){},i.overrideNativeAudioTracks=function(){},i.overrideNativeVideoTracks=function(){},i.canPlayType=function(){return""},t.canPlayType=function(){return""},t.canPlaySource=function(e,i){return t.canPlayType(e.type)},t.isTech=function(e){return e.prototype instanceof t||e instanceof t||e===t},t.registerTech=function(e,i){if(t.techs_||(t.techs_={}),!t.isTech(i))throw new Error("Tech "+e+" must be a Tech");if(!t.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!t.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=ci(e),t.techs_[e]=i,"Tech"!==e&&t.defaultTechOrder_.push(e),i},t.getTech=function(e){if(e)return e=ci(e),t.techs_&&t.techs_[e]?t.techs_[e]:f()&&f().videojs&&f().videojs[e]?(Ne.warn("The "+e+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),f().videojs[e]):void 0},t}(di);Cn.names.forEach((function(e){var t=Cn[e];En.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}})),En.prototype.featuresVolumeControl=!0,En.prototype.featuresMuteControl=!0,En.prototype.featuresFullscreenResize=!1,En.prototype.featuresPlaybackRate=!1,En.prototype.featuresProgressEvents=!1,En.prototype.featuresSourceset=!1,En.prototype.featuresTimeupdateEvents=!1,En.prototype.featuresNativeTextTracks=!1,En.withSourceHandlers=function(e){e.registerSourceHandler=function(t,i){var n=e.sourceHandlers;n||(n=e.sourceHandlers=[]),void 0===i&&(i=n.length),n.splice(i,0,t)},e.canPlayType=function(t){for(var i,n=e.sourceHandlers||[],r=0;r<n.length;r++)if(i=n[r].canPlayType(t))return i;return""},e.selectSourceHandler=function(t,i){for(var n=e.sourceHandlers||[],r=0;r<n.length;r++)if(n[r].canHandleSource(t,i))return n[r];return null},e.canPlaySource=function(t,i){var n=e.selectSourceHandler(t,i);return n?n.canHandleSource(t,i):""};["seekable","seeking","duration"].forEach((function(e){var t=this[e];"function"==typeof t&&(this[e]=function(){return this.sourceHandler_&&this.sourceHandler_[e]?this.sourceHandler_[e].apply(this.sourceHandler_,arguments):t.apply(this,arguments)})}),e.prototype),e.prototype.setSource=function(t){var i=e.selectSourceHandler(t,this.options_);i||(e.nativeSourceHandler?i=e.nativeSourceHandler:Ne.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler),i!==e.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=i.handleSource(t,this,this.options_),this.on("dispose",this.disposeSourceHandler)},e.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}},di.registerComponent("Tech",En),En.registerTech("Tech",En),En.defaultTechOrder_=[];var An={},Ln={},On={};function Pn(e,t,i){e.setTimeout((function(){return Mn(t,An[t.type],i,e)}),1)}function xn(e,t,i,n){void 0===n&&(n=null);var r="call"+ci(i),a=e.reduce(Rn(r),n),s=a===On,o=s?null:t[i](a);return function(e,t,i,n){for(var r=e.length-1;r>=0;r--){var a=e[r];a[t]&&a[t](n,i)}}(e,i,o,s),o}var Un={buffered:1,currentTime:1,duration:1,seekable:1,played:1,paused:1},In={setCurrentTime:1},Dn={play:1,pause:1};function Rn(e){return function(t,i){return t===On?On:i[e]?i[e](t):t}}function Mn(e,t,i,n,r,a){void 0===e&&(e={}),void 0===t&&(t=[]),void 0===r&&(r=[]),void 0===a&&(a=!1);var s=t,o=s[0],u=s.slice(1);if("string"==typeof o)Mn(e,An[o],i,n,r,a);else if(o){var l=function(e,t){var i=Ln[e.id()],n=null;if(null==i)return n=t(e),Ln[e.id()]=[[t,n]],n;for(var r=0;r<i.length;r++){var a=i[r],s=a[0],o=a[1];s===t&&(n=o)}return null===n&&(n=t(e),i.push([t,n])),n}(n,o);if(!l.setSource)return r.push(l),Mn(e,u,i,n,r,a);l.setSource(qe({},e),(function(t,s){if(t)return Mn(e,u,i,n,r,a);r.push(l),Mn(s,e.type===s.type?u:An[s.type],i,n,r,a)}))}else u.length?Mn(e,u,i,n,r,a):a?i(e,r):Mn(e,An["*"],i,n,r,!0)}var Bn={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",mp3:"audio/mpeg",aac:"audio/aac",oga:"audio/ogg",m3u8:"application/x-mpegURL"},Nn=function(e){void 0===e&&(e="");var t=mn(e);return Bn[t.toLowerCase()]||""},jn=function e(t){if(Array.isArray(t)){var i=[];t.forEach((function(t){t=e(t),Array.isArray(t)?i=i.concat(t):ze(t)&&i.push(t)})),t=i}else t="string"==typeof t&&t.trim()?[Fn({src:t})]:ze(t)&&"string"==typeof t.src&&t.src&&t.src.trim()?[Fn(t)]:[];return t};function Fn(e){var t=Nn(e.src);return!e.type&&t&&(e.type=t),e}var Vn=function(e){function t(t,i,n){var r,a=hi({createEl:!1},i);if(r=e.call(this,t,a,n)||this,i.playerOptions.sources&&0!==i.playerOptions.sources.length)t.src(i.playerOptions.sources);else for(var s=0,o=i.playerOptions.techOrder;s<o.length;s++){var u=ci(o[s]),l=En.getTech(u);if(u||(l=di.getComponent(u)),l&&l.isSupported()){t.loadTech_(u);break}}return r}return xe(t,e),t}(di);di.registerComponent("MediaLoader",Vn);var Hn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).emitTapEvents(),n.enable(),n}xe(t,e);var i=t.prototype;return i.createEl=function(t,i,n){void 0===t&&(t="div"),void 0===i&&(i={}),void 0===n&&(n={}),i=qe({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass(),tabIndex:0},i),"button"===t&&Ne.error("Creating a ClickableComponent with an HTML element of "+t+" is not supported; use a Button instead."),n=qe({role:"button"},n),this.tabIndex_=i.tabIndex;var r=e.prototype.createEl.call(this,t,i,n);return this.createControlTextEl(r),r},i.dispose=function(){this.controlTextEl_=null,e.prototype.dispose.call(this)},i.createControlTextEl=function(e){return this.controlTextEl_=et("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_},i.controlText=function(e,t){if(void 0===t&&(t=this.el()),void 0===e)return this.controlText_||"Need Text";var i=this.localize(e);this.controlText_=e,tt(this.controlTextEl_,i),this.nonIconControl||t.setAttribute("title",i)},i.buildCSSClass=function(){return"vjs-control vjs-button "+e.prototype.buildCSSClass.call(this)},i.enable=function(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),void 0!==this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick),this.on("focus",this.handleFocus),this.on("blur",this.handleBlur))},i.disable=function(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),void 0!==this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off(["tap","click"],this.handleClick),this.off("focus",this.handleFocus),this.off("blur",this.handleBlur)},i.handleClick=function(e){},i.handleFocus=function(e){Nt(C(),"keydown",Kt(this,this.handleKeyPress))},i.handleKeyPress=function(t){32===t.which||13===t.which?(t.preventDefault(),this.trigger("click")):e.prototype.handleKeyPress&&e.prototype.handleKeyPress.call(this,t)},i.handleBlur=function(e){jt(C(),"keydown",Kt(this,this.handleKeyPress))},t}(di);di.registerComponent("ClickableComponent",Hn);var qn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update(),t.on("posterchange",Kt(Re(Re(n)),n.update)),n}xe(t,e);var i=t.prototype;return i.dispose=function(){this.player().off("posterchange",this.update),e.prototype.dispose.call(this)},i.createEl=function(){return et("div",{className:"vjs-poster",tabIndex:-1})},i.update=function(e){var t=this.player().poster();this.setSrc(t),t?this.show():this.hide()},i.setSrc=function(e){var t="";e&&(t='url("'+e+'")'),this.el_.style.backgroundImage=t},i.handleClick=function(e){this.player_.controls()&&(this.player_.paused()?Xi(this.player_.play()):this.player_.pause())},t}(Hn);di.registerComponent("PosterImage",qn);var zn={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'};function Wn(e,t){var i;if(4===e.length)i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");i=e.slice(1)}return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")"}function Gn(e,t,i){try{e.style[t]=i}catch(e){return}}var Xn=function(e){function t(t,i,n){var r;r=e.call(this,t,i,n)||this;var a=Kt(Re(Re(r)),r.updateDisplay);return t.on("loadstart",Kt(Re(Re(r)),r.toggleDisplay)),t.on("texttrackchange",a),t.on("loadedmetadata",Kt(Re(Re(r)),r.preselectTrack)),t.ready(Kt(Re(Re(r)),(function(){if(t.tech_&&t.tech_.featuresNativeTextTracks)this.hide();else{t.on("fullscreenchange",a),t.on("playerresize",a),f().addEventListener("orientationchange",a),t.on("dispose",(function(){return f().removeEventListener("orientationchange",a)}));for(var e=this.options_.playerOptions.tracks||[],i=0;i<e.length;i++)this.player_.addRemoteTextTrack(e[i],!0);this.preselectTrack()}}))),r}xe(t,e);var i=t.prototype;return i.preselectTrack=function(){for(var e,t,i,n={captions:1,subtitles:1},r=this.player_.textTracks(),a=this.player_.cache_.selectedLanguage,s=0;s<r.length;s++){var o=r[s];a&&a.enabled&&a.language&&a.language===o.language&&o.kind in n?o.kind===a.kind?i=o:i||(i=o):a&&!a.enabled?(i=null,e=null,t=null):o.default&&("descriptions"!==o.kind||e?o.kind in n&&!t&&(t=o):e=o)}i?i.mode="showing":t?t.mode="showing":e&&(e.mode="showing")},i.toggleDisplay=function(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()},i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-text-track-display"},{"aria-live":"off","aria-atomic":"true"})},i.clearDisplay=function(){"function"==typeof f().WebVTT&&f().WebVTT.processCues(f(),[],this.el_)},i.updateDisplay=function(){var e=this.player_.textTracks();this.clearDisplay();for(var t=null,i=null,n=e.length;n--;){var r=e[n];"showing"===r.mode&&("descriptions"===r.kind?t=r:i=r)}i?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(i)):t&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(t))},i.updateForTrack=function(e){if("function"==typeof f().WebVTT&&e.activeCues){for(var t=[],i=0;i<e.activeCues.length;i++)t.push(e.activeCues[i]);if(f().WebVTT.processCues(f(),t,this.el_),this.player_.textTrackSettings)for(var n=this.player_.textTrackSettings.getValues(),r=t.length;r--;){var a=t[r];if(a){var s=a.displayState;if(n.color&&(s.firstChild.style.color=n.color),n.textOpacity&&Gn(s.firstChild,"color",Wn(n.color||"#fff",n.textOpacity)),n.backgroundColor&&(s.firstChild.style.backgroundColor=n.backgroundColor),n.backgroundOpacity&&Gn(s.firstChild,"backgroundColor",Wn(n.backgroundColor||"#000",n.backgroundOpacity)),n.windowColor&&(n.windowOpacity?Gn(s,"backgroundColor",Wn(n.windowColor,n.windowOpacity)):s.style.backgroundColor=n.windowColor),n.edgeStyle&&("dropshadow"===n.edgeStyle?s.firstChild.style.textShadow="2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px #222":"raised"===n.edgeStyle?s.firstChild.style.textShadow="1px 1px #222, 2px 2px #222, 3px 3px #222":"depressed"===n.edgeStyle?s.firstChild.style.textShadow="1px 1px #ccc, 0 1px #ccc, -1px -1px #222, 0 -1px #222":"uniform"===n.edgeStyle&&(s.firstChild.style.textShadow="0 0 4px #222, 0 0 4px #222, 0 0 4px #222, 0 0 4px #222")),n.fontPercent&&1!==n.fontPercent){var o=f().parseFloat(s.style.fontSize);s.style.fontSize=o*n.fontPercent+"px",s.style.height="auto",s.style.top="auto",s.style.bottom="2px"}n.fontFamily&&"default"!==n.fontFamily&&("small-caps"===n.fontFamily?s.firstChild.style.fontVariant="small-caps":s.firstChild.style.fontFamily=zn[n.fontFamily])}}}},t}(di);di.registerComponent("TextTrackDisplay",Xn);var Yn=function(e){function t(){return e.apply(this,arguments)||this}return xe(t,e),t.prototype.createEl=function(){var t=this.player_.isAudio(),i=this.localize(t?"Audio Player":"Video Player"),n=et("span",{className:"vjs-control-text",innerHTML:this.localize("{1} is loading.",[i])}),r=e.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",dir:"ltr"});return r.appendChild(n),r},t}(di);di.registerComponent("LoadingSpinner",Yn);var $n=function(e){function t(){return e.apply(this,arguments)||this}xe(t,e);var i=t.prototype;return i.createEl=function(e,t,i){void 0===t&&(t={}),void 0===i&&(i={}),t=qe({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass()},t),i=qe({type:"button"},i);var n=di.prototype.createEl.call(this,"button",t,i);return this.createControlTextEl(n),n},i.addChild=function(e,t){void 0===t&&(t={});var i=this.constructor.name;return Ne.warn("Adding an actionable (user controllable) child to a Button ("+i+") is not supported; use a ClickableComponent instead."),di.prototype.addChild.call(this,e,t)},i.enable=function(){e.prototype.enable.call(this),this.el_.removeAttribute("disabled")},i.disable=function(){e.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},i.handleKeyPress=function(t){32!==t.which&&13!==t.which&&e.prototype.handleKeyPress.call(this,t)},t}(Hn);di.registerComponent("Button",$n);var Kn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).mouseused_=!1,n.on("mousedown",n.handleMouseDown),n}xe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-big-play-button"},i.handleClick=function(e){var t=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY)Xi(t);else{var i=this.player_.getChild("controlBar"),n=i&&i.getChild("playToggle");if(n){var r=function(){return n.focus()};Gi(t)?t.then(r,(function(){})):this.setTimeout(r,1)}else this.player_.focus()}},i.handleKeyPress=function(t){this.mouseused_=!1,e.prototype.handleKeyPress.call(this,t)},i.handleMouseDown=function(e){this.mouseused_=!0},t}($n);Kn.prototype.controlText_="Play Video",di.registerComponent("BigPlayButton",Kn);var Qn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).controlText(i&&i.controlText||n.localize("Close")),n}xe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-close-button "+e.prototype.buildCSSClass.call(this)},i.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},t}($n);di.registerComponent("CloseButton",Qn);var Jn=function(e){function t(t,i){var n;return void 0===i&&(i={}),n=e.call(this,t,i)||this,i.replay=void 0===i.replay||i.replay,n.on(t,"play",n.handlePlay),n.on(t,"pause",n.handlePause),i.replay&&n.on(t,"ended",n.handleEnded),n}xe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-play-control "+e.prototype.buildCSSClass.call(this)},i.handleClick=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},i.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},i.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},i.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},i.handleEnded=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",this.handleSeeked)},t}($n);Jn.prototype.controlText_="Play",di.registerComponent("PlayToggle",Jn);var Zn=function(e,t){e=e<0?0:e;var i=Math.floor(e%60),n=Math.floor(e/60%60),r=Math.floor(e/3600),a=Math.floor(t/60%60),s=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(r=n=i="-"),(r=r>0||s>0?r+":":"")+(n=((r||a>=10)&&n<10?"0"+n:n)+":")+(i=i<10?"0"+i:i)},er=Zn;function tr(e,t){return void 0===t&&(t=e),er(e,t)}var ir=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).throttledUpdateContent=Qt(Kt(Re(Re(n)),n.updateContent),25),n.on(t,"timeupdate",n.throttledUpdateContent),n}xe(t,e);var i=t.prototype;return i.createEl=function(t){var i=this.buildCSSClass(),n=e.prototype.createEl.call(this,"div",{className:i+" vjs-time-control vjs-control",innerHTML:'<span class="vjs-control-text" role="presentation">'+this.localize(this.labelText_)+" </span>"});return this.contentEl_=et("span",{className:i+"-display"},{"aria-live":"off",role:"presentation"}),this.updateTextNode_(),n.appendChild(this.contentEl_),n},i.dispose=function(){this.contentEl_=null,this.textNode_=null,e.prototype.dispose.call(this)},i.updateTextNode_=function(){if(this.contentEl_){for(;this.contentEl_.firstChild;)this.contentEl_.removeChild(this.contentEl_.firstChild);this.textNode_=C().createTextNode(this.formattedTime_||this.formatTime_(0)),this.contentEl_.appendChild(this.textNode_)}},i.formatTime_=function(e){return tr(e)},i.updateFormattedTime_=function(e){var t=this.formatTime_(e);t!==this.formattedTime_&&(this.formattedTime_=t,this.requestAnimationFrame(this.updateTextNode_))},i.updateContent=function(e){},t}(di);ir.prototype.labelText_="Time",ir.prototype.controlText_="Time",di.registerComponent("TimeDisplay",ir);var nr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"ended",n.handleEnded),n}xe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-current-time"},i.updateContent=function(e){var t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();this.updateFormattedTime_(t)},i.handleEnded=function(e){this.player_.duration()&&this.updateFormattedTime_(this.player_.duration())},t}(ir);nr.prototype.labelText_="Current Time",nr.prototype.controlText_="Current Time",di.registerComponent("CurrentTimeDisplay",nr);var rr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"durationchange",n.updateContent),n.on(t,"loadstart",n.updateContent),n.on(t,"loadedmetadata",n.throttledUpdateContent),n}xe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-duration"},i.updateContent=function(e){var t=this.player_.duration();this.duration_!==t&&(this.duration_=t,this.updateFormattedTime_(t))},t}(ir);rr.prototype.labelText_="Duration",rr.prototype.controlText_="Duration",di.registerComponent("DurationDisplay",rr);var ar=function(e){function t(){return e.apply(this,arguments)||this}return xe(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider",innerHTML:"<div><span>/</span></div>"},{"aria-hidden":!0})},t}(di);di.registerComponent("TimeDivider",ar);var sr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"durationchange",n.throttledUpdateContent),n.on(t,"ended",n.handleEnded),n}xe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-remaining-time"},i.formatTime_=function(t){return"-"+e.prototype.formatTime_.call(this,t)},i.updateContent=function(e){this.player_.duration()&&(this.player_.remainingTimeDisplay?this.updateFormattedTime_(this.player_.remainingTimeDisplay()):this.updateFormattedTime_(this.player_.remainingTime()))},i.handleEnded=function(e){this.player_.duration()&&this.updateFormattedTime_(0)},t}(ir);sr.prototype.labelText_="Remaining Time",sr.prototype.controlText_="Remaining Time",di.registerComponent("RemainingTimeDisplay",sr);var or=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).updateShowing(),n.on(n.player(),"durationchange",n.updateShowing),n}xe(t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=et("div",{className:"vjs-live-display",innerHTML:'<span class="vjs-control-text">'+this.localize("Stream Type")+" </span>"+this.localize("LIVE")},{"aria-live":"off"}),t.appendChild(this.contentEl_),t},i.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},i.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},t}(di);di.registerComponent("LiveDisplay",or);var ur=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).updateLiveEdgeStatus(),n.player_.liveTracker&&n.on(n.player_.liveTracker,"liveedgechange",n.updateLiveEdgeStatus),n}xe(t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=et("span",{className:"vjs-seek-to-live-text",innerHTML:this.localize("LIVE")},{"aria-hidden":"true"}),t.appendChild(this.textEl_),t},i.updateLiveEdgeStatus=function(e){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))},i.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},i.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatus),this.textEl_=null,e.prototype.dispose.call(this)},t}($n);ur.prototype.controlText_="Seek to live, currently playing live",di.registerComponent("SeekToLive",ur);var lr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).bar=n.getChild(n.options_.barName),n.vertical(!!n.options_.vertical),n.enable(),n}xe(t,e);var i=t.prototype;return i.enabled=function(){return this.enabled_},i.enable=function(){this.enabled()||(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(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)},i.disable=function(){if(this.enabled()){var e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown),this.off("touchstart",this.handleMouseDown),this.off("focus",this.handleFocus),this.off("blur",this.handleBlur),this.off("click",this.handleClick),this.off(this.player_,"controlsvisible",this.update),this.off(e,"mousemove",this.handleMouseMove),this.off(e,"mouseup",this.handleMouseUp),this.off(e,"touchmove",this.handleMouseMove),this.off(e,"touchend",this.handleMouseUp),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},i.createEl=function(t,i,n){return void 0===i&&(i={}),void 0===n&&(n={}),i.className=i.className+" vjs-slider",i=qe({tabIndex:0},i),n=qe({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},n),e.prototype.createEl.call(this,t,i,n)},i.handleMouseDown=function(e){var t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||Ai||e.preventDefault(),dt(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove),this.on(t,"mouseup",this.handleMouseUp),this.on(t,"touchmove",this.handleMouseMove),this.on(t,"touchend",this.handleMouseUp),this.handleMouseMove(e)},i.handleMouseMove=function(e){},i.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;pt(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(e,"mousemove",this.handleMouseMove),this.off(e,"mouseup",this.handleMouseUp),this.off(e,"touchmove",this.handleMouseMove),this.off(e,"touchend",this.handleMouseUp),this.update()},i.update=function(){if(this.el_){var e=this.getPercent(),t=this.bar;if(t){("number"!=typeof e||e!=e||e<0||e===1/0)&&(e=0);var i=(100*e).toFixed(2)+"%",n=t.el().style;return this.vertical()?n.height=i:n.width=i,e}}},i.calculateDistance=function(e){var t=gt(this.el_,e);return this.vertical()?t.y:t.x},i.handleFocus=function(){this.on(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},i.handleKeyPress=function(e){37===e.which||40===e.which?(e.preventDefault(),this.stepBack()):38!==e.which&&39!==e.which||(e.preventDefault(),this.stepForward())},i.handleBlur=function(){this.off(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},i.handleClick=function(e){e.stopImmediatePropagation(),e.preventDefault()},i.vertical=function(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},t}(di);di.registerComponent("Slider",lr);var cr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).partEls_=[],n.on(t,"progress",n.update),n}xe(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-load-progress",innerHTML:'<span class="vjs-control-text"><span>'+this.localize("Loaded")+'</span>: <span class="vjs-control-text-loaded-percentage">0%</span></span>'})},i.dispose=function(){this.partEls_=null,e.prototype.dispose.call(this)},i.update=function(e){var t=this.player_.liveTracker,i=this.player_.buffered(),n=t&&t.isLive()?t.seekableEnd():this.player_.duration(),r=this.player_.bufferedEnd(),a=this.partEls_,s=this.$(".vjs-control-text-loaded-percentage"),o=function(e,t,i){var n=e/t||0;return n=100*(n>=1?1:n),i&&(n=n.toFixed(2)),n+"%"};this.el_.style.width=o(r,n),tt(s,o(r,n,!0));for(var u=0;u<i.length;u++){var l=i.start(u),c=i.end(u),h=a[u];h||(h=this.el_.appendChild(et()),a[u]=h),h.style.left=o(l,r),h.style.width=o(c-l,r)}for(var d=a.length;d>i.length;d--)this.el_.removeChild(a[d-1]);a.length=i.length},t}(di);di.registerComponent("LoadProgressBar",cr);var hr=function(e){function t(){return e.apply(this,arguments)||this}xe(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},i.update=function(e,t,i){var n=ft(this.el_),r=ft(this.player_.el()),a=e.width*t;if(r&&n){var s=e.left-r.left+a,o=e.width-a+(r.right-e.right),u=n.width/2;s<u?u+=u-s:o<u&&(u=o),u<0?u=0:u>n.width&&(u=n.width),this.el_.style.right="-"+u+"px",tt(this.el_,i)}},i.updateTime=function(e,t,i,n){var r=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame((function(){var a,s=r.player_.duration();if(r.player_.liveTracker&&r.player_.liveTracker.isLive()){var o=r.player_.liveTracker.liveWindow(),u=o-t*o;a=(u<1?"":"-")+tr(u,o)}else a=tr(i,s);r.update(e,t,a),n&&n()}))},t}(di);di.registerComponent("TimeTooltip",hr);var dr=function(e){function t(){return e.apply(this,arguments)||this}xe(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},i.update=function(e,t){var i=this.getChild("timeTooltip");if(i){var n=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();i.updateTime(e,t,n)}},t}(di);dr.prototype.options_={children:[]},bi||Si||dr.prototype.options_.children.push("timeTooltip"),di.registerComponent("PlayProgressBar",dr);var pr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=Qt(Kt(Re(Re(n)),n.update),25),n}xe(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},i.update=function(e,t){var i=this,n=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,n,(function(){i.el_.style.left=e.width*t+"px"}))},t}(di);pr.prototype.options_={children:["timeTooltip"]},di.registerComponent("MouseTimeDisplay",pr);var fr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).setEventHandlers_(),n}xe(t,e);var i=t.prototype;return i.setEventHandlers_=function(){var e=this;this.update=Qt(Kt(this,this.update),30),this.on(this.player_,"timeupdate",this.update),this.on(this.player_,"ended",this.handleEnded),this.on(this.player_,"durationchange",this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.on(this.player_,["playing"],(function(){e.clearInterval(e.updateInterval),e.updateInterval=e.setInterval((function(){e.requestAnimationFrame((function(){e.update()}))}),30)})),this.on(this.player_,["ended","pause","waiting"],(function(t){e.player_.liveTracker&&e.player_.liveTracker.isLive()&&"ended"!==t.type||e.clearInterval(e.updateInterval)})),this.on(this.player_,["timeupdate","ended"],this.update)},i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},i.update_=function(e,t){var i=this.player_.liveTracker,n=this.player_.duration();i&&i.isLive()&&(n=this.player_.liveTracker.liveCurrentTime()),i&&i.seekableEnd()===1/0?this.disable():this.enable(),this.el_.setAttribute("aria-valuenow",(100*t).toFixed(2)),this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[tr(e,n),tr(n,n)],"{1} of {2}")),this.bar.update(ft(this.el_),t)},i.update=function(t){var i=e.prototype.update.call(this);return this.update_(this.getCurrentTime_(),i),i},i.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},i.handleEnded=function(e){this.update_(this.player_.duration(),1)},i.getPercent=function(){var e,t=this.getCurrentTime_(),i=this.player_.liveTracker;return i&&i.isLive()?(e=(t-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(e=1)):e=t/this.player_.duration(),e>=1?1:e||0},i.handleMouseDown=function(t){St(t)&&(t.stopPropagation(),this.player_.scrubbing(!0),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),e.prototype.handleMouseDown.call(this,t))},i.handleMouseMove=function(e){if(St(e)){var t,i=this.calculateDistance(e),n=this.player_.liveTracker;if(n&&n.isLive()){var r=n.seekableStart(),a=n.liveCurrentTime();if((t=r+i*n.liveWindow())>=a&&(t=a),t<=r&&(t=r+.1),t===1/0)return}else(t=i*this.player_.duration())===this.player_.duration()&&(t-=.1);this.player_.currentTime(t)}},i.enable=function(){e.prototype.enable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.show()},i.disable=function(){e.prototype.disable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.hide()},i.handleMouseUp=function(t){e.prototype.handleMouseUp.call(this,t),t&&t.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying&&Xi(this.player_.play())},i.stepForward=function(){this.player_.currentTime(this.player_.currentTime()+5)},i.stepBack=function(){this.player_.currentTime(this.player_.currentTime()-5)},i.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},i.handleKeyPress=function(t){32===t.which||13===t.which?(t.preventDefault(),this.handleAction(t)):e.prototype.handleKeyPress&&e.prototype.handleKeyPress.call(this,t)},t}(lr);fr.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},bi||Si||fr.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),fr.prototype.playerEvent="timeupdate",di.registerComponent("SeekBar",fr);var mr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).handleMouseMove=Qt(Kt(Re(Re(n)),n.handleMouseMove),25),n.throttledHandleMouseSeek=Qt(Kt(Re(Re(n)),n.handleMouseSeek),25),n.enable(),n}xe(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},i.handleMouseMove=function(e){var t=this.getChild("seekBar");if(t){var i=t.getChild("mouseTimeDisplay"),n=t.el(),r=ft(n),a=gt(n,e).x;a>1?a=1:a<0&&(a=0),i&&i.update(r,a)}},i.handleMouseSeek=function(e){var t=this.getChild("seekBar");t&&t.handleMouseMove(e)},i.enabled=function(){return this.enabled_},i.disable=function(){this.children().forEach((function(e){return e.disable&&e.disable()})),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDown),this.off(this.el_,"mousemove",this.handleMouseMove),this.handleMouseUp(),this.addClass("disabled"),this.enabled_=!1)},i.enable=function(){this.children().forEach((function(e){return e.enable&&e.enable()})),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDown),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},i.handleMouseDown=function(e){var t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUp),this.on(t,"touchend",this.handleMouseUp)},i.handleMouseUp=function(e){var t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseUp(e),this.off(t,"mousemove",this.throttledHandleMouseSeek),this.off(t,"touchmove",this.throttledHandleMouseSeek),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchend",this.handleMouseUp)},t}(di);mr.prototype.options_={children:["seekBar"]},di.registerComponent("ProgressControl",mr);var gr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"fullscreenchange",n.handleFullscreenChange),!1===C()[ji.fullscreenEnabled]&&n.disable(),n}xe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-fullscreen-control "+e.prototype.buildCSSClass.call(this)},i.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},i.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},t}($n);gr.prototype.controlText_="Fullscreen",di.registerComponent("FullscreenToggle",gr);var yr=function(e){function t(){return e.apply(this,arguments)||this}return xe(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:'<span class="vjs-control-text"></span>'})},t}(di);di.registerComponent("VolumeLevel",yr);var vr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on("slideractive",n.updateLastVolume_),n.on(t,"volumechange",n.updateARIAAttributes),t.ready((function(){return n.updateARIAAttributes()})),n}xe(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},i.handleMouseDown=function(t){St(t)&&e.prototype.handleMouseDown.call(this,t)},i.handleMouseMove=function(e){St(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},i.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},i.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},i.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},i.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},i.updateARIAAttributes=function(e){var t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")},i.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},i.updateLastVolume_=function(){var e=this,t=this.player_.volume();this.one("sliderinactive",(function(){0===e.player_.volume()&&e.player_.lastVolume_(t)}))},t}(lr);vr.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},vr.prototype.playerEvent="volumechange",di.registerComponent("VolumeBar",vr);var _r=function(e){function t(t,i){var n;return void 0===i&&(i={}),i.vertical=i.vertical||!1,(void 0===i.volumeBar||We(i.volumeBar))&&(i.volumeBar=i.volumeBar||{},i.volumeBar.vertical=i.vertical),function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))}(Re(Re(n=e.call(this,t,i)||this)),t),n.throttledHandleMouseMove=Qt(Kt(Re(Re(n)),n.handleMouseMove),25),n.on("mousedown",n.handleMouseDown),n.on("touchstart",n.handleMouseDown),n.on(n.volumeBar,["focus","slideractive"],(function(){n.volumeBar.addClass("vjs-slider-active"),n.addClass("vjs-slider-active"),n.trigger("slideractive")})),n.on(n.volumeBar,["blur","sliderinactive"],(function(){n.volumeBar.removeClass("vjs-slider-active"),n.removeClass("vjs-slider-active"),n.trigger("sliderinactive")})),n}xe(t,e);var i=t.prototype;return i.createEl=function(){var t="vjs-volume-horizontal";return this.options_.vertical&&(t="vjs-volume-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+t})},i.handleMouseDown=function(e){var t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUp),this.on(t,"touchend",this.handleMouseUp)},i.handleMouseUp=function(e){var t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchend",this.handleMouseUp)},i.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},t}(di);_r.prototype.options_={children:["volumeBar"]},di.registerComponent("VolumeControl",_r);var br=function(e){function t(t,i){var n;return function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))}(Re(Re(n=e.call(this,t,i)||this)),t),n.on(t,["loadstart","volumechange"],n.update),n}xe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-mute-control "+e.prototype.buildCSSClass.call(this)},i.handleClick=function(e){var t=this.player_.volume(),i=this.player_.lastVolume_();if(0===t){var n=i<.1?.1:i;this.player_.volume(n),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},i.update=function(e){this.updateIcon_(),this.updateControlText_()},i.updateIcon_=function(){var e=this.player_.volume(),t=3;bi&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2);for(var i=0;i<4;i++)at(this.el_,"vjs-vol-"+i);rt(this.el_,"vjs-vol-"+t)},i.updateControlText_=function(){var e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)},t}($n);br.prototype.controlText_="Mute",di.registerComponent("MuteToggle",br);var Tr=function(e){function t(t,i){var n;return void 0===i&&(i={}),void 0!==i.inline?i.inline=i.inline:i.inline=!0,(void 0===i.volumeControl||We(i.volumeControl))&&(i.volumeControl=i.volumeControl||{},i.volumeControl.vertical=!i.inline),(n=e.call(this,t,i)||this).on(t,["loadstart"],n.volumePanelState_),n.on(n.volumeControl,["slideractive"],n.sliderActive_),n.on(n.volumeControl,["sliderinactive"],n.sliderInactive_),n}xe(t,e);var i=t.prototype;return i.sliderActive_=function(){this.addClass("vjs-slider-active")},i.sliderInactive_=function(){this.removeClass("vjs-slider-active")},i.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")},i.createEl=function(){var t="vjs-volume-panel-horizontal";return this.options_.inline||(t="vjs-volume-panel-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+t})},t}(di);Tr.prototype.options_={children:["muteToggle","volumeControl"]},di.registerComponent("VolumePanel",Tr);var Sr=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,i&&(n.menuButton_=i.menuButton),n.focusedChild_=-1,n.on("keydown",n.handleKeyPress),n}xe(t,e);var i=t.prototype;return i.addItem=function(e){this.addChild(e),e.on("blur",Kt(this,this.handleBlur)),e.on(["tap","click"],Kt(this,(function(t){this.menuButton_&&(this.menuButton_.unpressButton(),"CaptionSettingsMenuItem"!==e.name()&&this.menuButton_.focus())})))},i.createEl=function(){var t=this.options_.contentElType||"ul";this.contentEl_=et(t,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var i=e.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return i.appendChild(this.contentEl_),Nt(i,"click",(function(e){e.preventDefault(),e.stopImmediatePropagation()})),i},i.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},i.handleBlur=function(e){var t=e.relatedTarget||C().activeElement;if(!this.children().some((function(e){return e.el()===t}))){var i=this.menuButton_;i&&i.buttonPressed_&&t!==i.el().firstChild&&i.unpressButton()}},i.handleKeyPress=function(e){37===e.which||40===e.which?(e.preventDefault(),this.stepForward()):38!==e.which&&39!==e.which||(e.preventDefault(),this.stepBack())},i.stepForward=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)},i.stepBack=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)},i.focus=function(e){void 0===e&&(e=0);var t=this.children().slice();t.length&&t[0].className&&/vjs-menu-title/.test(t[0].className)&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())},t}(di);di.registerComponent("Menu",Sr);var kr=function(e){function t(t,i){var n;void 0===i&&(i={}),(n=e.call(this,t,i)||this).menuButton_=new $n(t,i),n.menuButton_.controlText(n.controlText_),n.menuButton_.el_.setAttribute("aria-haspopup","true");var r=$n.prototype.buildCSSClass();return n.menuButton_.el_.className=n.buildCSSClass()+" "+r,n.menuButton_.removeClass("vjs-control"),n.addChild(n.menuButton_),n.update(),n.enabled_=!0,n.on(n.menuButton_,"tap",n.handleClick),n.on(n.menuButton_,"click",n.handleClick),n.on(n.menuButton_,"focus",n.handleFocus),n.on(n.menuButton_,"blur",n.handleBlur),n.on(n.menuButton_,"mouseenter",(function(){n.menu.show()})),n.on("keydown",n.handleSubmenuKeyPress),n}xe(t,e);var i=t.prototype;return i.update=function(){var e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?this.hide():this.show()},i.createMenu=function(){var e=new Sr(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var t=et("li",{className:"vjs-menu-title",innerHTML:ci(this.options_.title),tabIndex:-1});this.hideThreshold_+=1,e.children_.unshift(t),it(t,e.contentEl())}if(this.items=this.createItems(),this.items)for(var i=0;i<this.items.length;i++)e.addItem(this.items[i]);return e},i.createItems=function(){},i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildWrapperCSSClass()},{})},i.buildWrapperCSSClass=function(){var t="vjs-menu-button";return!0===this.options_.inline?t+="-inline":t+="-popup","vjs-menu-button "+t+" "+$n.prototype.buildCSSClass()+" "+e.prototype.buildCSSClass.call(this)},i.buildCSSClass=function(){var t="vjs-menu-button";return!0===this.options_.inline?t+="-inline":t+="-popup","vjs-menu-button "+t+" "+e.prototype.buildCSSClass.call(this)},i.controlText=function(e,t){return void 0===t&&(t=this.menuButton_.el()),this.menuButton_.controlText(e,t)},i.handleClick=function(e){this.buttonPressed_?this.unpressButton():this.pressButton()},i.focus=function(){this.menuButton_.focus()},i.blur=function(){this.menuButton_.blur()},i.handleFocus=function(){Nt(C(),"keydown",Kt(this,this.handleKeyPress))},i.handleBlur=function(){jt(C(),"keydown",Kt(this,this.handleKeyPress))},i.handleKeyPress=function(e){27===e.which||9===e.which?(this.buttonPressed_&&this.unpressButton(),9!==e.which&&(e.preventDefault(),this.menuButton_.el_.focus())):13!==e.which&&38!==e.which&&40!==e.which||this.buttonPressed_||(this.pressButton(),e.preventDefault())},i.handleSubmenuKeyPress=function(e){27!==e.which&&9!==e.which||(this.buttonPressed_&&this.unpressButton(),9!==e.which&&(e.preventDefault(),this.menuButton_.el_.focus()))},i.pressButton=function(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),bi&&Je())return;this.menu.focus()}},i.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},i.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},i.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},t}(di);di.registerComponent("MenuButton",kr);var wr=function(e){function t(t,i){var n,r=i.tracks;if((n=e.call(this,t,i)||this).items.length<=1&&n.hide(),!r)return Re(n);var a=Kt(Re(Re(n)),n.update);return r.addEventListener("removetrack",a),r.addEventListener("addtrack",a),n.player_.on("ready",a),n.player_.on("dispose",(function(){r.removeEventListener("removetrack",a),r.removeEventListener("addtrack",a)})),n}return xe(t,e),t}(kr);di.registerComponent("TrackButton",wr);var Cr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).selectable=i.selectable,n.isSelected_=i.selected||!1,n.multiSelectable=i.multiSelectable,n.selected(n.isSelected_),n.selectable?n.multiSelectable?n.el_.setAttribute("role","menuitemcheckbox"):n.el_.setAttribute("role","menuitemradio"):n.el_.setAttribute("role","menuitem"),n}xe(t,e);var i=t.prototype;return i.createEl=function(t,i,n){return this.nonIconControl=!0,e.prototype.createEl.call(this,"li",qe({className:"vjs-menu-item",innerHTML:'<span class="vjs-menu-item-text">'+this.localize(this.options_.label)+"</span>",tabIndex:-1},i),n)},i.handleClick=function(e){this.selected(!0)},i.selected=function(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))},t}(Hn);di.registerComponent("MenuItem",Cr);var Er=function(e){function t(t,i){var n,r=i.track,a=t.textTracks();i.label=r.label||r.language||"Unknown",i.selected="showing"===r.mode,(n=e.call(this,t,i)||this).track=r;var s,o=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];n.handleTracksChange.apply(Re(Re(n)),t)},u=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];n.handleSelectedLanguageChange.apply(Re(Re(n)),t)};(t.on(["loadstart","texttrackchange"],o),a.addEventListener("change",o),a.addEventListener("selectedlanguagechange",u),n.on("dispose",(function(){t.off(["loadstart","texttrackchange"],o),a.removeEventListener("change",o),a.removeEventListener("selectedlanguagechange",u)})),void 0===a.onchange)&&n.on(["tap","click"],(function(){if("object"!=typeof f().Event)try{s=new(f().Event)("change")}catch(e){}s||(s=C().createEvent("Event")).initEvent("change",!0,!0),a.dispatchEvent(s)}));return n.handleTracksChange(),n}xe(t,e);var i=t.prototype;return i.handleClick=function(t){var i=this.track.kind,n=this.track.kinds,r=this.player_.textTracks();if(n||(n=[i]),e.prototype.handleClick.call(this,t),r)for(var a=0;a<r.length;a++){var s=r[a];s===this.track&&n.indexOf(s.kind)>-1?"showing"!==s.mode&&(s.mode="showing"):"disabled"!==s.mode&&(s.mode="disabled")}},i.handleTracksChange=function(e){var t="showing"===this.track.mode;t!==this.isSelected_&&this.selected(t)},i.handleSelectedLanguageChange=function(e){if("showing"===this.track.mode){var t=this.player_.cache_.selectedLanguage;if(t&&t.enabled&&t.language===this.track.language&&t.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}},i.dispose=function(){this.track=null,e.prototype.dispose.call(this)},t}(Cr);di.registerComponent("TextTrackMenuItem",Er);var Ar=function(e){function t(t,i){return i.track={player:t,kind:i.kind,kinds:i.kinds,default:!1,mode:"disabled"},i.kinds||(i.kinds=[i.kind]),i.label?i.track.label=i.label:i.track.label=i.kinds.join(" and ")+" off",i.selectable=!0,i.multiSelectable=!1,e.call(this,t,i)||this}xe(t,e);var i=t.prototype;return i.handleTracksChange=function(e){for(var t=this.player().textTracks(),i=!0,n=0,r=t.length;n<r;n++){var a=t[n];if(this.options_.kinds.indexOf(a.kind)>-1&&"showing"===a.mode){i=!1;break}}i!==this.isSelected_&&this.selected(i)},i.handleSelectedLanguageChange=function(e){for(var t=this.player().textTracks(),i=!0,n=0,r=t.length;n<r;n++){var a=t[n];if(["captions","descriptions","subtitles"].indexOf(a.kind)>-1&&"showing"===a.mode){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})},t}(Er);di.registerComponent("OffTextTrackMenuItem",Ar);var Lr=function(e){function t(t,i){return void 0===i&&(i={}),i.tracks=t.textTracks(),e.call(this,t,i)||this}return xe(t,e),t.prototype.createItems=function(e,t){var i;void 0===e&&(e=[]),void 0===t&&(t=Er),this.label_&&(i=this.label_+" off"),e.push(new Ar(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;var n=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var r=0;r<n.length;r++){var a=n[r];if(this.kinds_.indexOf(a.kind)>-1){var s=new t(this.player_,{track:a,selectable:!0,multiSelectable:!1});s.addClass("vjs-"+a.kind+"-menu-item"),e.push(s)}}return e},t}(wr);di.registerComponent("TextTrackButton",Lr);var Or=function(e){function t(t,i){var n,r=i.track,a=i.cue,s=t.currentTime();return i.selectable=!0,i.multiSelectable=!1,i.label=a.text,i.selected=a.startTime<=s&&s<a.endTime,(n=e.call(this,t,i)||this).track=r,n.cue=a,r.addEventListener("cuechange",Kt(Re(Re(n)),n.update)),n}xe(t,e);var i=t.prototype;return i.handleClick=function(t){e.prototype.handleClick.call(this),this.player_.currentTime(this.cue.startTime),this.update(this.cue.startTime)},i.update=function(e){var t=this.cue,i=this.player_.currentTime();this.selected(t.startTime<=i&&i<t.endTime)},t}(Cr);di.registerComponent("ChaptersTrackMenuItem",Or);var Pr=function(e){function t(t,i,n){return e.call(this,t,i,n)||this}xe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-chapters-button "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-chapters-button "+e.prototype.buildWrapperCSSClass.call(this)},i.update=function(t){this.track_&&(!t||"addtrack"!==t.type&&"removetrack"!==t.type)||this.setTrack(this.findChaptersTrack()),e.prototype.update.call(this)},i.setTrack=function(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){var t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.removeEventListener("load",this.updateHandler_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";var i=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);i&&i.addEventListener("load",this.updateHandler_)}}},i.findChaptersTrack=function(){for(var e=this.player_.textTracks()||[],t=e.length-1;t>=0;t--){var i=e[t];if(i.kind===this.kind_)return i}},i.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(ci(this.kind_))},i.createMenu=function(){return this.options_.title=this.getMenuCaption(),e.prototype.createMenu.call(this)},i.createItems=function(){var e=[];if(!this.track_)return e;var t=this.track_.cues;if(!t)return e;for(var i=0,n=t.length;i<n;i++){var r=t[i],a=new Or(this.player_,{track:this.track_,cue:r});e.push(a)}return e},t}(Lr);Pr.prototype.kind_="chapters",Pr.prototype.controlText_="Chapters",di.registerComponent("ChaptersButton",Pr);var xr=function(e){function t(t,i,n){var r;r=e.call(this,t,i,n)||this;var a=t.textTracks(),s=Kt(Re(Re(r)),r.handleTracksChange);return a.addEventListener("change",s),r.on("dispose",(function(){a.removeEventListener("change",s)})),r}xe(t,e);var i=t.prototype;return i.handleTracksChange=function(e){for(var t=this.player().textTracks(),i=!1,n=0,r=t.length;n<r;n++){var a=t[n];if(a.kind!==this.kind_&&"showing"===a.mode){i=!0;break}}i?this.disable():this.enable()},i.buildCSSClass=function(){return"vjs-descriptions-button "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-descriptions-button "+e.prototype.buildWrapperCSSClass.call(this)},t}(Lr);xr.prototype.kind_="descriptions",xr.prototype.controlText_="Descriptions",di.registerComponent("DescriptionsButton",xr);var Ur=function(e){function t(t,i,n){return e.call(this,t,i,n)||this}xe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-subtitles-button "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-subtitles-button "+e.prototype.buildWrapperCSSClass.call(this)},t}(Lr);Ur.prototype.kind_="subtitles",Ur.prototype.controlText_="Subtitles",di.registerComponent("SubtitlesButton",Ur);var Ir=function(e){function t(t,i){var n;return i.track={player:t,kind:i.kind,label:i.kind+" settings",selectable:!1,default:!1,mode:"disabled"},i.selectable=!1,i.name="CaptionSettingsMenuItem",(n=e.call(this,t,i)||this).addClass("vjs-texttrack-settings"),n.controlText(", opens "+i.kind+" settings dialog"),n}return xe(t,e),t.prototype.handleClick=function(e){this.player().getChild("textTrackSettings").open()},t}(Er);di.registerComponent("CaptionSettingsMenuItem",Ir);var Dr=function(e){function t(t,i,n){return e.call(this,t,i,n)||this}xe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-captions-button "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-captions-button "+e.prototype.buildWrapperCSSClass.call(this)},i.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new Ir(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),e.prototype.createItems.call(this,t)},t}(Lr);Dr.prototype.kind_="captions",Dr.prototype.controlText_="Captions",di.registerComponent("CaptionsButton",Dr);var Rr=function(e){function t(){return e.apply(this,arguments)||this}return xe(t,e),t.prototype.createEl=function(t,i,n){var r='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);return"captions"===this.options_.track.kind&&(r+='\n <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n <span class="vjs-control-text"> '+this.localize("Captions")+"</span>\n "),r+="</span>",e.prototype.createEl.call(this,t,qe({innerHTML:r},i),n)},t}(Er);di.registerComponent("SubsCapsMenuItem",Rr);var Mr=function(e){function t(t,i){var n;return void 0===i&&(i={}),(n=e.call(this,t,i)||this).label_="subtitles",["en","en-us","en-ca","fr-ca"].indexOf(n.player_.language_)>-1&&(n.label_="captions"),n.menuButton_.controlText(ci(n.label_)),n}xe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildWrapperCSSClass.call(this)},i.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new Ir(this.player_,{kind:this.label_})),this.hideThreshold_+=1),t=e.prototype.createItems.call(this,t,Rr)},t}(Lr);Mr.prototype.kinds_=["captions","subtitles"],Mr.prototype.controlText_="Subtitles",di.registerComponent("SubsCapsButton",Mr);var Br=function(e){function t(t,i){var n,r=i.track,a=t.audioTracks();i.label=r.label||r.language||"Unknown",i.selected=r.enabled,(n=e.call(this,t,i)||this).track=r,n.addClass("vjs-"+r.kind+"-menu-item");var s=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];n.handleTracksChange.apply(Re(Re(n)),t)};return a.addEventListener("change",s),n.on("dispose",(function(){a.removeEventListener("change",s)})),n}xe(t,e);var i=t.prototype;return i.createEl=function(t,i,n){var r='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);return"main-desc"===this.options_.track.kind&&(r+='\n <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n <span class="vjs-control-text"> '+this.localize("Descriptions")+"</span>\n "),r+="</span>",e.prototype.createEl.call(this,t,qe({innerHTML:r},i),n)},i.handleClick=function(t){var i=this.player_.audioTracks();e.prototype.handleClick.call(this,t);for(var n=0;n<i.length;n++){var r=i[n];r.enabled=r===this.track}},i.handleTracksChange=function(e){this.selected(this.track.enabled)},t}(Cr);di.registerComponent("AudioTrackMenuItem",Br);var Nr=function(e){function t(t,i){return void 0===i&&(i={}),i.tracks=t.audioTracks(),e.call(this,t,i)||this}xe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-audio-button "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-audio-button "+e.prototype.buildWrapperCSSClass.call(this)},i.createItems=function(e){void 0===e&&(e=[]),this.hideThreshold_=1;for(var t=this.player_.audioTracks(),i=0;i<t.length;i++){var n=t[i];e.push(new Br(this.player_,{track:n,selectable:!0,multiSelectable:!1}))}return e},t}(wr);Nr.prototype.controlText_="Audio Track",di.registerComponent("AudioTrackButton",Nr);var jr=function(e){function t(t,i){var n,r=i.rate,a=parseFloat(r,10);return i.label=r,i.selected=1===a,i.selectable=!0,i.multiSelectable=!1,(n=e.call(this,t,i)||this).label=r,n.rate=a,n.on(t,"ratechange",n.update),n}xe(t,e);var i=t.prototype;return i.handleClick=function(t){e.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},i.update=function(e){this.selected(this.player().playbackRate()===this.rate)},t}(Cr);jr.prototype.contentElType="button",di.registerComponent("PlaybackRateMenuItem",jr);var Fr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).updateVisibility(),n.updateLabel(),n.on(t,"loadstart",n.updateVisibility),n.on(t,"ratechange",n.updateLabel),n}xe(t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this);return this.labelEl_=et("div",{className:"vjs-playback-rate-value",innerHTML:"1x"}),t.appendChild(this.labelEl_),t},i.dispose=function(){this.labelEl_=null,e.prototype.dispose.call(this)},i.buildCSSClass=function(){return"vjs-playback-rate "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-playback-rate "+e.prototype.buildWrapperCSSClass.call(this)},i.createMenu=function(){var e=new Sr(this.player()),t=this.playbackRates();if(t)for(var i=t.length-1;i>=0;i--)e.addChild(new jr(this.player(),{rate:t[i]+"x"}));return e},i.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},i.handleClick=function(e){for(var t=this.player().playbackRate(),i=this.playbackRates(),n=i[0],r=0;r<i.length;r++)if(i[r]>t){n=i[r];break}this.player().playbackRate(n)},i.playbackRates=function(){return this.options_.playbackRates||this.options_.playerOptions&&this.options_.playerOptions.playbackRates},i.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},i.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},i.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.innerHTML=this.player().playbackRate()+"x")},t}(kr);Fr.prototype.controlText_="Playback Rate",di.registerComponent("PlaybackRateMenuButton",Fr);var Vr=function(e){function t(){return e.apply(this,arguments)||this}xe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-spacer "+e.prototype.buildCSSClass.call(this)},i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass()})},t}(di);di.registerComponent("Spacer",Vr);var Hr=function(e){function t(){return e.apply(this,arguments)||this}xe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-custom-control-spacer "+e.prototype.buildCSSClass.call(this)},i.createEl=function(){var t=e.prototype.createEl.call(this,{className:this.buildCSSClass()});return t.innerHTML=" ",t},t}(Vr);di.registerComponent("CustomControlSpacer",Hr);var qr=function(e){function t(){return e.apply(this,arguments)||this}return xe(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},t}(di);qr.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},di.registerComponent("ControlBar",qr);var zr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"error",n.open),n}xe(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-error-display "+e.prototype.buildCSSClass.call(this)},i.content=function(){var e=this.player().error();return e?this.localize(e.message):""},t}(Qi);zr.prototype.options_=hi(Qi.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),di.registerComponent("ErrorDisplay",zr);var Wr="vjs-text-track-settings",Gr=["#000","Black"],Xr=["#00F","Blue"],Yr=["#0FF","Cyan"],$r=["#0F0","Green"],Kr=["#F0F","Magenta"],Qr=["#F00","Red"],Jr=["#FFF","White"],Zr=["#FF0","Yellow"],ea=["1","Opaque"],ta=["0.5","Semi-Transparent"],ia=["0","Transparent"],na={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Gr,Jr,Qr,$r,Xr,Zr,Kr,Yr]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[ea,ta,ia]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Jr,Gr,Qr,$r,Xr,Zr,Kr,Yr]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:function(e){return"1.00"===e?null:Number(e)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[ea,ta]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[ia,ta,ea]}};function ra(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}na.windowColor.options=na.backgroundColor.options;var aa=function(e){function t(t,i){var n;return i.temporary=!1,(n=e.call(this,t,i)||this).updateDisplay=Kt(Re(Re(n)),n.updateDisplay),n.fill(),n.hasBeenOpened_=n.hasBeenFilled_=!0,n.endDialog=et("p",{className:"vjs-control-text",textContent:n.localize("End of dialog window.")}),n.el().appendChild(n.endDialog),n.setDefaults(),void 0===i.persistTextTrackSettings&&(n.options_.persistTextTrackSettings=n.options_.playerOptions.persistTextTrackSettings),n.on(n.$(".vjs-done-button"),"click",(function(){n.saveSettings(),n.close()})),n.on(n.$(".vjs-default-button"),"click",(function(){n.setDefaults(),n.updateDisplay()})),He(na,(function(e){n.on(n.$(e.selector),"change",n.updateDisplay)})),n.options_.persistTextTrackSettings&&n.restoreSettings(),n}xe(t,e);var i=t.prototype;return i.dispose=function(){this.endDialog=null,e.prototype.dispose.call(this)},i.createElSelect_=function(e,t,i){var n=this;void 0===t&&(t=""),void 0===i&&(i="label");var r=na[e],a=r.id.replace("%s",this.id_),s=[t,a].join(" ").trim();return["<"+i+' id="'+a+'" class="'+("label"===i?"vjs-label":"")+'">',this.localize(r.label),"</"+i+">",'<select aria-labelledby="'+s+'">'].concat(r.options.map((function(e){var t=a+"-"+e[1].replace(/\W+/g,"");return['<option id="'+t+'" value="'+e[0]+'" ','aria-labelledby="'+s+" "+t+'">',n.localize(e[1]),"</option>"].join("")}))).concat("</select>").join("")},i.createElFgColor_=function(){var e="captions-text-legend-"+this.id_;return['<fieldset class="vjs-fg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Text"),"</legend>",this.createElSelect_("color",e),'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",e),"</span>","</fieldset>"].join("")},i.createElBgColor_=function(){var e="captions-background-"+this.id_;return['<fieldset class="vjs-bg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Background"),"</legend>",this.createElSelect_("backgroundColor",e),'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",e),"</span>","</fieldset>"].join("")},i.createElWinColor_=function(){var e="captions-window-"+this.id_;return['<fieldset class="vjs-window-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Window"),"</legend>",this.createElSelect_("windowColor",e),'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",e),"</span>","</fieldset>"].join("")},i.createElColors_=function(){return et("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},i.createElFont_=function(){return et("div",{className:"vjs-track-settings-font",innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_("fontPercent","","legend"),"</fieldset>",'<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_("edgeStyle","","legend"),"</fieldset>",'<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_("fontFamily","","legend"),"</fieldset>"].join("")})},i.createElControls_=function(){var e=this.localize("restore all settings to the default values");return et("div",{className:"vjs-track-settings-controls",innerHTML:['<button type="button" class="vjs-default-button" title="'+e+'">',this.localize("Reset"),'<span class="vjs-control-text"> '+e+"</span>","</button>",'<button type="button" class="vjs-done-button">'+this.localize("Done")+"</button>"].join("")})},i.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},i.label=function(){return this.localize("Caption Settings Dialog")},i.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},i.buildCSSClass=function(){return e.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},i.getValues=function(){var e=this;return function(e,t,i){return void 0===i&&(i=0),Ve(e).reduce((function(i,n){return t(i,e[n],n)}),i)}(na,(function(t,i,n){var r,a,s=(r=e.$(i.selector),a=i.parser,ra(r.options[r.options.selectedIndex].value,a));return void 0!==s&&(t[n]=s),t}),{})},i.setValues=function(e){var t=this;He(na,(function(i,n){!function(e,t,i){if(t)for(var n=0;n<e.options.length;n++)if(ra(e.options[n].value,i)===t){e.selectedIndex=n;break}}(t.$(i.selector),e[n],i.parser)}))},i.setDefaults=function(){var e=this;He(na,(function(t){var i=t.hasOwnProperty("default")?t.default:0;e.$(t.selector).selectedIndex=i}))},i.restoreSettings=function(){var e;try{e=JSON.parse(f().localStorage.getItem(Wr))}catch(e){Ne.warn(e)}e&&this.setValues(e)},i.saveSettings=function(){if(this.options_.persistTextTrackSettings){var e=this.getValues();try{Object.keys(e).length?f().localStorage.setItem(Wr,JSON.stringify(e)):f().localStorage.removeItem(Wr)}catch(e){Ne.warn(e)}}},i.updateDisplay=function(){var e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()},i.conditionalBlur_=function(){this.previouslyActiveEl_=null,this.off(C(),"keydown",this.handleKeyDown);var e=this.player_.controlBar,t=e&&e.subsCapsButton,i=e&&e.captionsButton;t?t.focus():i&&i.focus()},t}(Qi);di.registerComponent("TextTrackSettings",aa);var sa=function(e){function t(t,i){var n,r=i.ResizeObserver||f().ResizeObserver;null===i.ResizeObserver&&(r=!1);var a=hi({createEl:!r,reportTouchActivity:!1},i);return(n=e.call(this,t,a)||this).ResizeObserver=i.ResizeObserver||f().ResizeObserver,n.loadListener_=null,n.resizeObserver_=null,n.debouncedHandler_=function(e,t,i,n){var r;void 0===n&&(n=f());var a=function(){var a=this,s=arguments,o=function(){r=null,o=null,i||e.apply(a,s)};!r&&i&&e.apply(a,s),n.clearTimeout(r),r=n.setTimeout(o,t)};return a.cancel=function(){n.clearTimeout(r),r=null},a}((function(){n.resizeHandler()}),100,!1,Re(Re(n))),r?(n.resizeObserver_=new n.ResizeObserver(n.debouncedHandler_),n.resizeObserver_.observe(t.el())):(n.loadListener_=function(){n.el_&&n.el_.contentWindow&&Nt(n.el_.contentWindow,"resize",n.debouncedHandler_)},n.one("load",n.loadListener_)),n}xe(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager"})},i.resizeHandler=function(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")},i.dispose=function(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.el_&&this.el_.contentWindow&&jt(this.el_.contentWindow,"resize",this.debouncedHandler_),this.loadListener_&&this.off("load",this.loadListener_),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null},t}(di);di.registerComponent("ResizeManager",sa);var oa=function(e){function t(t,i){var n,r=hi({createEl:!1},i);return(n=e.call(this,t,r)||this).reset_(),n.on(n.player_,"durationchange",n.handleDurationchange),n}xe(t,e);var i=t.prototype;return i.isBehind_=function(){if(!this.timeupdateSeen_)return!1;var e=this.liveCurrentTime(),t=this.player_.currentTime(),i=this.seekableIncrement_;return e!==1/0&&e-(2*i+.07)>=t},i.trackLive_=function(){this.pastSeekEnd_=this.pastSeekEnd_;var e=this.player_.seekable();if(e&&e.length){var t=this.seekableEnd();t!==this.lastSeekEnd_&&(this.lastSeekEnd_&&(this.seekableIncrement_=Math.abs(t-this.lastSeekEnd_)),this.pastSeekEnd_=0,this.lastSeekEnd_=t,this.trigger("seekableendchange")),this.pastSeekEnd_=this.pastSeekEnd()+.03,this.isBehind_()!==this.behindLiveEdge()&&(this.behindLiveEdge_=this.isBehind_(),this.trigger("liveedgechange"))}},i.handleDurationchange=function(){this.player_.duration()===1/0?this.startTracking():this.stopTracking()},i.startTracking=function(){var e=this;this.isTracking()||(this.trackingInterval_=this.setInterval(this.trackLive_,30),this.trackLive_(),this.on(this.player_,"play",this.trackLive_),this.on(this.player_,"pause",this.trackLive_),this.one(this.player_,"play",this.handlePlay),this.timeupdateSeen_||(this.handleTimeupdate=function(){e.timeupdateSeen_=!0,e.handleTimeupdate=null},this.one(this.player_,"timeupdate",this.handleTimeupdate)))},i.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge)},i.reset_=function(){this.pastSeekEnd_=0,this.lastSeekEnd_=null,this.behindLiveEdge_=null,this.timeupdateSeen_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.seekableIncrement_=12,this.off(this.player_,"play",this.trackLive_),this.off(this.player_,"pause",this.trackLive_),this.off(this.player_,"play",this.handlePlay),this.off(this.player_,"timeupdate",this.seekToLiveEdge),this.handleTimeupdate&&(this.off(this.player_,"timeupdate",this.handleTimeupdate),this.handleTimeupdate=null)},i.stopTracking=function(){this.isTracking()&&this.reset_()},i.seekableEnd=function(){for(var e=this.player_.seekable(),t=[],i=e?e.length:0;i--;)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0},i.seekableStart=function(){for(var e=this.player_.seekable(),t=[],i=e?e.length:0;i--;)t.push(e.start(i));return t.length?t.sort()[0]:0},i.liveWindow=function(){var e=this.liveCurrentTime();return e===1/0?1/0:e-this.seekableStart()},i.isLive=function(){return this.isTracking()},i.atLiveEdge=function(){return!this.behindLiveEdge()},i.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},i.pastSeekEnd=function(){return this.pastSeekEnd_},i.behindLiveEdge=function(){return this.behindLiveEdge_},i.isTracking=function(){return"number"==typeof this.trackingInterval_},i.seekToLiveEdge=function(){this.atLiveEdge()||(this.player_.currentTime(this.liveCurrentTime()),this.player_.paused()&&this.player_.play())},i.dispose=function(){this.stopTracking(),e.prototype.dispose.call(this)},t}(di);di.registerComponent("LiveTracker",oa);var ua=function(e){var t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;var i=e.$$("source"),n=[],r="";if(!i.length)return!1;for(var a=0;a<i.length;a++){var s=i[a].src;s&&-1===n.indexOf(s)&&n.push(s)}return!!n.length&&(1===n.length&&(r=n[0]),e.triggerSourceset(r),!0)},la=Object.defineProperty({},"innerHTML",{get:function(){return this.cloneNode(!0).innerHTML},set:function(e){var t=C().createElement(this.nodeName.toLowerCase());t.innerHTML=e;for(var i=C().createDocumentFragment();t.childNodes.length;)i.appendChild(t.childNodes[0]);return this.innerText="",f().Element.prototype.appendChild.call(this,i),this.innerHTML}}),ca=function(e,t){for(var i={},n=0;n<e.length&&!((i=Object.getOwnPropertyDescriptor(e[n],t))&&i.set&&i.get);n++);return i.enumerable=!0,i.configurable=!0,i},ha=function(e){var t=e.el();if(!t.resetSourceWatch_){var i={},n=function(e){return ca([e.el(),f().HTMLMediaElement.prototype,f().Element.prototype,la],"innerHTML")}(e),r=function(i){return function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];var s=i.apply(t,r);return ua(e),s}};["append","appendChild","insertAdjacentHTML"].forEach((function(e){t[e]&&(i[e]=t[e],t[e]=r(i[e]))})),Object.defineProperty(t,"innerHTML",hi(n,{set:r(n.set)})),t.resetSourceWatch_=function(){t.resetSourceWatch_=null,Object.keys(i).forEach((function(e){t[e]=i[e]})),Object.defineProperty(t,"innerHTML",n)},e.one("sourceset",t.resetSourceWatch_)}},da=Object.defineProperty({},"src",{get:function(){return this.hasAttribute("src")?fn(f().Element.prototype.getAttribute.call(this,"src")):""},set:function(e){return f().Element.prototype.setAttribute.call(this,"src",e),e}}),pa=function(e){if(e.featuresSourceset){var t=e.el();if(!t.resetSourceset_){var i=function(e){return ca([e.el(),f().HTMLMediaElement.prototype,da],"src")}(e),n=t.setAttribute,r=t.load;Object.defineProperty(t,"src",hi(i,{set:function(n){var r=i.set.call(t,n);return e.triggerSourceset(t.src),r}})),t.setAttribute=function(i,r){var a=n.call(t,i,r);return/src/i.test(i)&&e.triggerSourceset(t.src),a},t.load=function(){var i=r.call(t);return ua(e)||(e.triggerSourceset(""),ha(e)),i},t.currentSrc?e.triggerSourceset(t.currentSrc):ua(e)||ha(e),t.resetSourceset_=function(){t.resetSourceset_=null,t.load=r,t.setAttribute=n,Object.defineProperty(t,"src",i),t.resetSourceWatch_&&t.resetSourceWatch_()}}}};function fa(){var e=Me(["Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\n This may prevent text tracks from loading."]);return fa=function(){return e},e}var ma=function(e){function t(t,i){var n;n=e.call(this,t,i)||this;var r=t.source,a=!1;if(r&&(n.el_.currentSrc!==r.src||t.tag&&3===t.tag.initNetworkState_)?n.setSource(r):n.handleLateInit_(n.el_),t.enableSourceset&&n.setupSourcesetHandling_(),n.el_.hasChildNodes()){for(var s=n.el_.childNodes,o=s.length,l=[];o--;){var c=s[o];"track"===c.nodeName.toLowerCase()&&(n.featuresNativeTextTracks?(n.remoteTextTrackEls().addTrackElement_(c),n.remoteTextTracks().addTrack(c.track),n.textTracks().addTrack(c.track),a||n.el_.hasAttribute("crossorigin")||!gn(c.src)||(a=!0)):l.push(c))}for(var h=0;h<l.length;h++)n.el_.removeChild(l[h])}return n.proxyNativeTracks_(),n.featuresNativeTextTracks&&a&&Ne.warn(u()(fa())),n.restoreMetadataTracksInIOSNativePlayer_(),(Ui||vi||wi)&&!0===t.nativeControlsForTouch&&n.setControls(!0),n.proxyWebkitFullscreen_(),n.triggerReady(),n}xe(t,e);var i=t.prototype;return i.dispose=function(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),t.disposeMediaElement(this.el_),this.options_=null,e.prototype.dispose.call(this)},i.setupSourcesetHandling_=function(){pa(this)},i.restoreMetadataTracksInIOSNativePlayer_=function(){var e,t=this.textTracks(),i=function(){e=[];for(var i=0;i<t.length;i++){var n=t[i];"metadata"===n.kind&&e.push({track:n,storedMode:n.mode})}};i(),t.addEventListener("change",i),this.on("dispose",(function(){return t.removeEventListener("change",i)}));var n=function i(){for(var n=0;n<e.length;n++){var r=e[n];"disabled"===r.track.mode&&r.track.mode!==r.storedMode&&(r.track.mode=r.storedMode)}t.removeEventListener("change",i)};this.on("webkitbeginfullscreen",(function(){t.removeEventListener("change",i),t.removeEventListener("change",n),t.addEventListener("change",n)})),this.on("webkitendfullscreen",(function(){t.removeEventListener("change",i),t.addEventListener("change",i),t.removeEventListener("change",n)}))},i.overrideNative_=function(e,t){var i=this;if(t===this["featuresNative"+e+"Tracks"]){var n=e.toLowerCase();this[n+"TracksListeners_"]&&Object.keys(this[n+"TracksListeners_"]).forEach((function(e){i.el()[n+"Tracks"].removeEventListener(e,i[n+"TracksListeners_"][e])})),this["featuresNative"+e+"Tracks"]=!t,this[n+"TracksListeners_"]=null,this.proxyNativeTracksForType_(n)}},i.overrideNativeAudioTracks=function(e){this.overrideNative_("Audio",e)},i.overrideNativeVideoTracks=function(e){this.overrideNative_("Video",e)},i.proxyNativeTracksForType_=function(e){var t=this,i=kn[e],n=this.el()[i.getterName],r=this[i.getterName]();if(this["featuresNative"+i.capitalName+"Tracks"]&&n&&n.addEventListener){var a={change:function(e){r.trigger({type:"change",target:r,currentTarget:r,srcElement:r})},addtrack:function(e){r.addTrack(e.track)},removetrack:function(e){r.removeTrack(e.track)}},s=function(){for(var e=[],t=0;t<r.length;t++){for(var i=!1,a=0;a<n.length;a++)if(n[a]===r[t]){i=!0;break}i||e.push(r[t])}for(;e.length;)r.removeTrack(e.shift())};this[i.getterName+"Listeners_"]=a,Object.keys(a).forEach((function(e){var i=a[e];n.addEventListener(e,i),t.on("dispose",(function(t){return n.removeEventListener(e,i)}))})),this.on("loadstart",s),this.on("dispose",(function(e){return t.off("loadstart",s)}))}},i.proxyNativeTracks_=function(){var e=this;kn.names.forEach((function(t){e.proxyNativeTracksForType_(t)}))},i.createEl=function(){var e=this.options_.tag;if(!e||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(e){var i=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(i,e),t.disposeMediaElement(e),e=i}else{e=C().createElement("video");var n=hi({},this.options_.tag&&ut(this.options_.tag));Ui&&!0===this.options_.nativeControlsForTouch||delete n.controls,ot(e,qe(n,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}void 0!==this.options_.preload&&ct(e,"preload",this.options_.preload);for(var r=["loop","muted","playsinline","autoplay"],a=0;a<r.length;a++){var s=r[a],o=this.options_[s];void 0!==o&&(o?ct(e,s,s):ht(e,s),e[s]=o)}return e},i.handleLateInit_=function(e){if(0!==e.networkState&&3!==e.networkState){if(0===e.readyState){var t=!1,i=function(){t=!0};this.on("loadstart",i);var n=function(){t||this.trigger("loadstart")};return this.on("loadedmetadata",n),void this.ready((function(){this.off("loadstart",i),this.off("loadedmetadata",n),t||this.trigger("loadstart")}))}var r=["loadstart"];r.push("loadedmetadata"),e.readyState>=2&&r.push("loadeddata"),e.readyState>=3&&r.push("canplay"),e.readyState>=4&&r.push("canplaythrough"),this.ready((function(){r.forEach((function(e){this.trigger(e)}),this)}))}},i.setCurrentTime=function(e){try{this.el_.currentTime=e}catch(e){Ne(e,"Video is not ready. (Video.js)")}},i.duration=function(){var e=this;if(this.el_.duration===1/0&&Si&&Ai&&0===this.el_.currentTime){return this.on("timeupdate",(function t(){e.el_.currentTime>0&&(e.el_.duration===1/0&&e.trigger("durationchange"),e.off("timeupdate",t))})),NaN}return this.el_.duration||NaN},i.width=function(){return this.el_.offsetWidth},i.height=function(){return this.el_.offsetHeight},i.proxyWebkitFullscreen_=function(){var e=this;if("webkitDisplayingFullscreen"in this.el_){var t=function(){this.trigger("fullscreenchange",{isFullscreen:!1})},i=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",t),this.trigger("fullscreenchange",{isFullscreen:!0}))};this.on("webkitbeginfullscreen",i),this.on("dispose",(function(){e.off("webkitbeginfullscreen",i),e.off("webkitendfullscreen",t)}))}},i.supportsFullScreen=function(){if("function"==typeof this.el_.webkitEnterFullScreen){var e=f().navigator&&f().navigator.userAgent||"";if(/Android/.test(e)||!/Chrome|Mac OS X 10.5/.test(e))return!0}return!1},i.enterFullScreen=function(){var e=this.el_;e.paused&&e.networkState<=e.HAVE_METADATA?(this.el_.play(),this.setTimeout((function(){e.pause(),e.webkitEnterFullScreen()}),0)):e.webkitEnterFullScreen()},i.exitFullScreen=function(){this.el_.webkitExitFullScreen()},i.src=function(e){if(void 0===e)return this.el_.src;this.setSrc(e)},i.reset=function(){t.resetMediaElement(this.el_)},i.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},i.setControls=function(e){this.el_.controls=!!e},i.addTextTrack=function(t,i,n){return this.featuresNativeTextTracks?this.el_.addTextTrack(t,i,n):e.prototype.addTextTrack.call(this,t,i,n)},i.createRemoteTextTrack=function(t){if(!this.featuresNativeTextTracks)return e.prototype.createRemoteTextTrack.call(this,t);var i=C().createElement("track");return t.kind&&(i.kind=t.kind),t.label&&(i.label=t.label),(t.language||t.srclang)&&(i.srclang=t.language||t.srclang),t.default&&(i.default=t.default),t.id&&(i.id=t.id),t.src&&(i.src=t.src),i},i.addRemoteTextTrack=function(t,i){var n=e.prototype.addRemoteTextTrack.call(this,t,i);return this.featuresNativeTextTracks&&this.el().appendChild(n),n},i.removeRemoteTextTrack=function(t){if(e.prototype.removeRemoteTextTrack.call(this,t),this.featuresNativeTextTracks)for(var i=this.$$("track"),n=i.length;n--;)t!==i[n]&&t!==i[n].track||this.el().removeChild(i[n])},i.getVideoPlaybackQuality=function(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();var e={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),f().performance&&"function"==typeof f().performance.now?e.creationTime=f().performance.now():f().performance&&f().performance.timing&&"number"==typeof f().performance.timing.navigationStart&&(e.creationTime=f().Date.now()-f().performance.timing.navigationStart),e},t}(En);if(Ke()){ma.TEST_VID=C().createElement("video");var ga=C().createElement("track");ga.kind="captions",ga.srclang="en",ga.label="English",ma.TEST_VID.appendChild(ga)}ma.isSupported=function(){try{ma.TEST_VID.volume=.5}catch(e){return!1}return!(!ma.TEST_VID||!ma.TEST_VID.canPlayType)},ma.canPlayType=function(e){return ma.TEST_VID.canPlayType(e)},ma.canPlaySource=function(e,t){return ma.canPlayType(e.type)},ma.canControlVolume=function(){try{var e=ma.TEST_VID.volume;return ma.TEST_VID.volume=e/2+.1,e!==ma.TEST_VID.volume}catch(e){return!1}},ma.canMuteVolume=function(){try{var e=ma.TEST_VID.muted;return ma.TEST_VID.muted=!e,ma.TEST_VID.muted?ct(ma.TEST_VID,"muted","muted"):ht(ma.TEST_VID,"muted"),e!==ma.TEST_VID.muted}catch(e){return!1}},ma.canControlPlaybackRate=function(){if(Si&&Ai&&Li<58)return!1;try{var e=ma.TEST_VID.playbackRate;return ma.TEST_VID.playbackRate=e/2+.1,e!==ma.TEST_VID.playbackRate}catch(e){return!1}},ma.canOverrideAttributes=function(){try{var e=function(){};Object.defineProperty(C().createElement("video"),"src",{get:e,set:e}),Object.defineProperty(C().createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(C().createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(C().createElement("audio"),"innerHTML",{get:e,set:e})}catch(e){return!1}return!0},ma.supportsNativeTextTracks=function(){return xi||bi&&Ai},ma.supportsNativeVideoTracks=function(){return!(!ma.TEST_VID||!ma.TEST_VID.videoTracks)},ma.supportsNativeAudioTracks=function(){return!(!ma.TEST_VID||!ma.TEST_VID.audioTracks)},ma.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],ma.prototype.featuresVolumeControl=ma.canControlVolume(),ma.prototype.featuresMuteControl=ma.canMuteVolume(),ma.prototype.featuresPlaybackRate=ma.canControlPlaybackRate(),ma.prototype.featuresSourceset=ma.canOverrideAttributes(),ma.prototype.movingMediaElementInDOM=!bi,ma.prototype.featuresFullscreenResize=!0,ma.prototype.featuresProgressEvents=!0,ma.prototype.featuresTimeupdateEvents=!0,ma.prototype.featuresNativeTextTracks=ma.supportsNativeTextTracks(),ma.prototype.featuresNativeVideoTracks=ma.supportsNativeVideoTracks(),ma.prototype.featuresNativeAudioTracks=ma.supportsNativeAudioTracks();var ya=ma.TEST_VID&&ma.TEST_VID.constructor.prototype.canPlayType,va=/^application\/(?:x-|vnd\.apple\.)mpegurl/i;function _a(){var e=Me(["\n Using the tech directly can be dangerous. I hope you know what you're doing.\n See https://github.com/videojs/video.js/issues/2617 for more info.\n "]);return _a=function(){return e},e}ma.patchCanPlayType=function(){ki>=4&&!Ci&&!Ai&&(ma.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&va.test(e)?"maybe":ya.call(this,e)})},ma.unpatchCanPlayType=function(){var e=ma.TEST_VID.constructor.prototype.canPlayType;return ma.TEST_VID.constructor.prototype.canPlayType=ya,e},ma.patchCanPlayType(),ma.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},ma.resetMediaElement=function(e){if(e){for(var t=e.querySelectorAll("source"),i=t.length;i--;)e.removeChild(t[i]);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach((function(e){ma.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}})),["muted","defaultMuted","autoplay","loop","playsinline"].forEach((function(e){ma.prototype["set"+ci(e)]=function(t){this.el_[e]=t,t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}})),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","played","networkState","readyState","videoWidth","videoHeight"].forEach((function(e){ma.prototype[e]=function(){return this.el_[e]}})),["volume","src","poster","preload","playbackRate","defaultPlaybackRate"].forEach((function(e){ma.prototype["set"+ci(e)]=function(t){this.el_[e]=t}})),["pause","load","play"].forEach((function(e){ma.prototype[e]=function(){return this.el_[e]()}})),En.withSourceHandlers(ma),ma.nativeSourceHandler={},ma.nativeSourceHandler.canPlayType=function(e){try{return ma.TEST_VID.canPlayType(e)}catch(e){return""}},ma.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return ma.nativeSourceHandler.canPlayType(e.type);if(e.src){var i=mn(e.src);return ma.nativeSourceHandler.canPlayType("video/"+i)}return""},ma.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src)},ma.nativeSourceHandler.dispose=function(){},ma.registerSourceHandler(ma.nativeSourceHandler),En.registerTech("Html5",ma);var ba=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Ta={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Sa=["tiny","xsmall","small","medium","large","xlarge","huge"],ka={};Sa.forEach((function(e){var t="x"===e.charAt(0)?"x-"+e.substring(1):e;ka[e]="vjs-layout-"+t}));var wa={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},Ca=function(e){function t(i,n,r){var a;if(i.id=i.id||n.id||"vjs_video_"+At(),(n=qe(t.getTagSettings(i),n)).initChildren=!1,n.createEl=!1,n.evented=!1,n.reportTouchActivity=!1,!n.language)if("function"==typeof i.closest){var s=i.closest("[lang]");s&&s.getAttribute&&(n.language=s.getAttribute("lang"))}else for(var o=i;o&&1===o.nodeType;){if(ut(o).hasOwnProperty("lang")){n.language=o.getAttribute("lang");break}o=o.parentNode}if((a=e.call(this,null,n,r)||this).log=je(a.id_),a.isPosterFromTech_=!1,a.queuedCallbacks_=[],a.isReady_=!1,a.hasStarted_=!1,a.userActive_=!1,!a.options_||!a.options_.techOrder||!a.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(a.tag=i,a.tagAttributes=i&&ut(i),a.language(a.options_.language),n.languages){var u={};Object.getOwnPropertyNames(n.languages).forEach((function(e){u[e.toLowerCase()]=n.languages[e]})),a.languages_=u}else a.languages_=t.prototype.options_.languages;a.cache_={},a.poster_=n.poster||"",a.controls_=!!n.controls,a.cache_.lastVolume=1,i.controls=!1,i.removeAttribute("controls"),i.hasAttribute("autoplay")?a.options_.autoplay=!0:a.autoplay(a.options_.autoplay),a.scrubbing_=!1,a.el_=a.createEl(),a.cache_.lastPlaybackRate=a.defaultPlaybackRate(),oi(Re(Re(a)),{eventBusKey:"el_"}),a.fluid_&&a.on("playerreset",a.updateStyleEl_);var l=hi(a.options_);if(n.plugins){var c=n.plugins;Object.keys(c).forEach((function(e){if("function"!=typeof this[e])throw new Error('plugin "'+e+'" does not exist');this[e](c[e])}),Re(Re(a)))}a.options_.playerOptions=l,a.middleware_=[],a.initChildren(),a.isAudio("audio"===i.nodeName.toLowerCase()),a.controls()?a.addClass("vjs-controls-enabled"):a.addClass("vjs-controls-disabled"),a.el_.setAttribute("role","region"),a.isAudio()?a.el_.setAttribute("aria-label",a.localize("Audio Player")):a.el_.setAttribute("aria-label",a.localize("Video Player")),a.isAudio()&&a.addClass("vjs-audio"),a.flexNotSupported_()&&a.addClass("vjs-no-flex"),bi||a.addClass("vjs-workinghover"),t.players[a.id_]=Re(Re(a));var h=Pe.split(".")[0];return a.addClass("vjs-v"+h),a.userActive(!0),a.reportUserActivity(),a.one("play",a.listenForUserActivity_),a.on("fullscreenchange",a.handleFullscreenChange_),a.on("stageclick",a.handleStageClick_),a.breakpoints(a.options_.breakpoints),a.responsive(a.options_.responsive),a.changingSrc_=!1,a.playWaitingForReady_=!1,a.playOnLoadstart_=null,a}xe(t,e);var i=t.prototype;return i.dispose=function(){this.trigger("dispose"),this.off("dispose"),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),t.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),Ln[this.id()]=null,e.prototype.dispose.call(this)},i.createEl=function(){var t,i=this.tag,n=this.playerElIngest_=i.parentNode&&i.parentNode.hasAttribute&&i.parentNode.hasAttribute("data-vjs-player"),r="video-js"===this.tag.tagName.toLowerCase();n?t=this.el_=i.parentNode:r||(t=this.el_=e.prototype.createEl.call(this,"div"));var a=ut(i);if(r){for(t=this.el_=i,i=this.tag=C().createElement("video");t.children.length;)i.appendChild(t.firstChild);nt(t,"video-js")||rt(t,"video-js"),t.appendChild(i),n=this.playerElIngest_=t,Object.keys(t).forEach((function(e){i[e]=t[e]}))}if(i.setAttribute("tabindex","-1"),a.tabindex="-1",Oi&&(i.setAttribute("role","application"),a.role="application"),i.removeAttribute("width"),i.removeAttribute("height"),"width"in a&&delete a.width,"height"in a&&delete a.height,Object.getOwnPropertyNames(a).forEach((function(e){r&&"class"===e||t.setAttribute(e,a[e]),r&&i.setAttribute(e,a[e])})),i.playerId=i.id,i.id+="_html5_api",i.className="vjs-tech",i.player=t.player=this,this.addClass("vjs-paused"),!0!==f().VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=Yt("vjs-styles-dimensions");var s=kt(".vjs-styles-defaults"),o=kt("head");o.insertBefore(this.styleEl_,s?s.nextSibling:o.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio);for(var u=i.getElementsByTagName("a"),l=0;l<u.length;l++){var c=u.item(l);rt(c,"vjs-hidden"),c.setAttribute("hidden","hidden")}return i.initNetworkState_=i.networkState,i.parentNode&&!n&&i.parentNode.insertBefore(t,i),it(i,t),this.children_.unshift(i),this.el_.setAttribute("lang",this.language_),this.el_=t,t},i.width=function(e){return this.dimension("width",e)},i.height=function(e){return this.dimension("height",e)},i.dimension=function(e,t){var i=e+"_";if(void 0===t)return this[i]||0;if(""===t)return this[i]=void 0,void this.updateStyleEl_();var n=parseFloat(t);isNaN(n)?Ne.error('Improper value "'+t+'" supplied for for '+e):(this[i]=n,this.updateStyleEl_())},i.fluid=function(e){if(void 0===e)return!!this.fluid_;var t,i;this.fluid_=!!e,Zt(this)&&this.off("playerreset",this.updateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),Zt(t=function(){this.on("playerreset",this.updateStyleEl_)})?i():(t.eventedCallbacks||(t.eventedCallbacks=[]),t.eventedCallbacks.push(i))):this.removeClass("vjs-fluid"),this.updateStyleEl_()},i.fill=function(e){if(void 0===e)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")},i.aspectRatio=function(e){if(void 0===e)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()},i.updateStyleEl_=function(){if(!0!==f().VIDEOJS_NO_DYNAMIC_STYLE){var e,t,i,n=(void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"),r=n[1]/n[0];e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/r:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*r,i=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(i),$t(this.styleEl_,"\n ."+i+" {\n width: "+e+"px;\n height: "+t+"px;\n }\n\n ."+i+".vjs-fluid {\n padding-top: "+100*r+"%;\n }\n ")}else{var a="number"==typeof this.width_?this.width_:this.options_.width,s="number"==typeof this.height_?this.height_:this.options_.height,o=this.tech_&&this.tech_.el();o&&(a>=0&&(o.width=a),s>=0&&(o.height=s))}},i.loadTech_=function(e,t){var i=this;this.tech_&&this.unloadTech_();var n=ci(e),r=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==n&&this.tag&&(En.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=n,this.isReady_=!1;var a={source:t,autoplay:"string"!=typeof this.autoplay()&&this.autoplay(),nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+r+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};Cn.names.forEach((function(e){var t=Cn[e];a[t.getterName]=i[t.privateName]})),qe(a,this.options_[n]),qe(a,this.options_[r]),qe(a,this.options_[e.toLowerCase()]),this.tag&&(a.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(a.startTime=this.cache_.currentTime);var s=En.getTech(e);if(!s)throw new Error("No Tech named '"+n+"' exists! '"+n+"' should be registered using videojs.registerTech()'");this.tech_=new s(a),this.tech_.ready(Kt(this,this.handleTechReady_),!0),Ki(this.textTracksJson_||[],this.tech_),ba.forEach((function(e){i.on(i.tech_,e,i["handleTech"+ci(e)+"_"])})),Object.keys(Ta).forEach((function(e){i.on(i.tech_,e,(function(t){0===i.tech_.playbackRate()&&i.tech_.seeking()?i.queuedCallbacks_.push({callback:i["handleTech"+Ta[e]+"_"].bind(i),event:t}):i["handleTech"+Ta[e]+"_"](t)}))})),this.on(this.tech_,"loadstart",this.handleTechLoadStart_),this.on(this.tech_,"sourceset",this.handleTechSourceset_),this.on(this.tech_,"waiting",this.handleTechWaiting_),this.on(this.tech_,"ended",this.handleTechEnded_),this.on(this.tech_,"seeking",this.handleTechSeeking_),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_,"durationchange",this.handleTechDurationChange_),this.on(this.tech_,"fullscreenchange",this.handleTechFullscreenChange_),this.on(this.tech_,"error",this.handleTechError_),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_,"ratechange",this.handleTechRateChange_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===n&&this.tag||it(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},i.unloadTech_=function(){var e=this;Cn.names.forEach((function(t){var i=Cn[t];e[i.privateName]=e[i.getterName]()})),this.textTracksJson_=$i(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},i.tech=function(e){return void 0===e&&Ne.warn(u()(_a())),this.tech_},i.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"mousedown",this.handleTechClick_),this.on(this.tech_,"dblclick",this.handleTechDoubleClick_),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_)},i.removeTechControlsListeners_=function(){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_),this.off(this.tech_,"dblclick",this.handleTechDoubleClick_)},i.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},i.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(this.autoplay())},i.manualAutoplay_=function(e){var t=this;if(this.tech_&&"string"==typeof e){var i,n=function(){var e=t.muted();t.muted(!0);var i=t.play();if(i&&i.then&&i.catch)return i.catch((function(i){t.muted(e)}))};if("any"===e?(i=this.play())&&i.then&&i.catch&&i.catch((function(){return n()})):i="muted"===e?n():this.play(),i&&i.then&&i.catch)return i.then((function(){t.trigger({type:"autoplay-success",autoplay:e})})).catch((function(i){t.trigger({type:"autoplay-failure",autoplay:e})}))}},i.updateSourceCaches_=function(e){void 0===e&&(e="");var t=e,i="";"string"!=typeof t&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=function(e,t){if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;var i=e.cache_.sources.filter((function(e){return e.src===t}));if(i.length)return i[0].type;for(var n=e.$$("source"),r=0;r<n.length;r++){var a=n[r];if(a.type&&a.src&&a.src===t)return a.type}return Nn(t)}(this,t)),this.cache_.source=hi({},e,{src:t,type:i});for(var n=this.cache_.sources.filter((function(e){return e.src&&e.src===t})),r=[],a=this.$$("source"),s=[],o=0;o<a.length;o++){var u=ut(a[o]);r.push(u),u.src&&u.src===t&&s.push(u.src)}s.length&&!n.length?this.cache_.sources=r:n.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t},i.handleTechSourceset_=function(e){var t=this;if(!this.changingSrc_){var i=function(e){return t.updateSourceCaches_(e)},n=this.currentSource().src,r=e.src;if(n&&!/^blob:/.test(n)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==n)&&(i=function(){}),i(r),!e.src){this.tech_.one(["sourceset","loadstart"],(function e(i){if("sourceset"!==i.type){var n=t.techGet("currentSrc");t.lastSource_.tech=n,t.updateSourceCaches_(n)}t.tech_.off(["sourceset","loadstart"],e)}))}}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})},i.hasStarted=function(e){if(void 0===e)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started"))},i.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},i.handleTechRateChange_=function(){this.tech_.playbackRate()>0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach((function(e){return e.callback(e.event)})),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},i.handleTechWaiting_=function(){var e=this;this.addClass("vjs-waiting"),this.trigger("waiting");var t=this.currentTime();this.on("timeupdate",(function i(){t!==e.currentTime()&&(e.removeClass("vjs-waiting"),e.off("timeupdate",i))}))},i.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},i.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},i.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},i.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},i.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.trigger("seeked")},i.handleTechFirstPlay_=function(){this.options_.starttime&&(Ne.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},i.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},i.handleTechEnded_=function(){this.addClass("vjs-ended"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},i.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},i.handleTechClick_=function(e){St(e)&&this.controls_&&(this.paused()?Xi(this.play()):this.pause())},i.handleTechDoubleClick_=function(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),(function(t){return t.contains(e.target)}))||(this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))},i.handleTechTap_=function(){this.userActive(!this.userActive())},i.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},i.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},i.handleTechTouchEnd_=function(e){e.preventDefault()},i.handleFullscreenChange_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},i.handleStageClick_=function(){this.reportUserActivity()},i.handleTechFullscreenChange_=function(e,t){t&&this.isFullscreen(t.isFullscreen),this.trigger("fullscreenchange")},i.handleTechError_=function(){var e=this.tech_.error();this.error(e)},i.handleTechTextData_=function(){var e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)},i.getCache=function(){return this.cache_},i.techCall_=function(e,t){this.ready((function(){if(e in In)return function(e,t,i,n){return t[i](e.reduce(Rn(i),n))}(this.middleware_,this.tech_,e,t);if(e in Dn)return xn(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(e){throw Ne(e),e}}),!0)},i.techGet_=function(e){if(this.tech_&&this.tech_.isReady_){if(e in Un)return function(e,t,i){return e.reduceRight(Rn(i),t[i]())}(this.middleware_,this.tech_,e);if(e in Dn)return xn(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e])throw Ne("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",t),t;if("TypeError"===t.name)throw Ne("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",t),this.tech_.isReady_=!1,t;throw Ne(t),t}}},i.play=function(){var e=this,t=this.options_.Promise||f().Promise;return t?new t((function(t){e.play_(t)})):this.play_()},i.play_=function(e){var t=this;if(void 0===e&&(e=Xi),this.playOnLoadstart_&&this.off("loadstart",this.playOnLoadstart_),this.isReady_){if(!this.changingSrc_&&(this.src()||this.currentSrc()))return void e(this.techGet_("play"));this.playOnLoadstart_=function(){t.playOnLoadstart_=null,e(t.play())},this.one("loadstart",this.playOnLoadstart_)}else{if(this.playWaitingForReady_)return;this.playWaitingForReady_=!0,this.ready((function(){t.playWaitingForReady_=!1,e(t.play())}))}},i.pause=function(){this.techCall_("pause")},i.paused=function(){return!1!==this.techGet_("paused")},i.played=function(){return this.techGet_("played")||Mi(0,0)},i.scrubbing=function(e){if(void 0===e)return this.scrubbing_;this.scrubbing_=!!e,e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},i.currentTime=function(e){return void 0!==e?(e<0&&(e=0),void this.techCall_("setCurrentTime",e)):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},i.duration=function(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?(this.addClass("vjs-live"),this.options_.liveui&&this.player_.liveTracker&&this.addClass("vjs-liveui")):(this.removeClass("vjs-live"),this.removeClass("vjs-liveui")),isNaN(e)||this.trigger("durationchange"))},i.remainingTime=function(){return this.duration()-this.currentTime()},i.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},i.buffered=function(){var e=this.techGet_("buffered");return e&&e.length||(e=Mi(0,0)),e},i.bufferedPercent=function(){return Bi(this.buffered(),this.duration())},i.bufferedEnd=function(){var e=this.buffered(),t=this.duration(),i=e.end(e.length-1);return i>t&&(i=t),i},i.volume=function(e){var t;return void 0!==e?(t=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=t,this.techCall_("setVolume",t),void(t>0&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t)},i.muted=function(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)},i.defaultMuted=function(e){return void 0!==e?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1},i.lastVolume_=function(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e},i.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},i.isFullscreen=function(e){if(void 0===e)return!!this.isFullscreen_;this.isFullscreen_=!!e},i.requestFullscreen=function(){var e=ji;this.isFullscreen(!0),e.requestFullscreen?(Nt(C(),e.fullscreenchange,Kt(this,(function t(i){this.isFullscreen(C()[e.fullscreenElement]),!1===this.isFullscreen()&&jt(C(),e.fullscreenchange,t),this.trigger("fullscreenchange")}))),this.el_[e.requestFullscreen]()):this.tech_.supportsFullScreen()?this.techCall_("enterFullScreen"):(this.enterFullWindow(),this.trigger("fullscreenchange"))},i.exitFullscreen=function(){var e=ji;this.isFullscreen(!1),e.requestFullscreen?C()[e.exitFullscreen]():this.tech_.supportsFullScreen()?this.techCall_("exitFullScreen"):(this.exitFullWindow(),this.trigger("fullscreenchange"))},i.enterFullWindow=function(){this.isFullWindow=!0,this.docOrigOverflow=C().documentElement.style.overflow,Nt(C(),"keydown",Kt(this,this.fullWindowOnEscKey)),C().documentElement.style.overflow="hidden",rt(C().body,"vjs-full-window"),this.trigger("enterFullWindow")},i.fullWindowOnEscKey=function(e){27===e.keyCode&&(!0===this.isFullscreen()?this.exitFullscreen():this.exitFullWindow())},i.exitFullWindow=function(){this.isFullWindow=!1,jt(C(),"keydown",this.fullWindowOnEscKey),C().documentElement.style.overflow=this.docOrigOverflow,at(C().body,"vjs-full-window"),this.trigger("exitFullWindow")},i.canPlayType=function(e){for(var t,i=0,n=this.options_.techOrder;i<n.length;i++){var r=n[i],a=En.getTech(r);if(a||(a=di.getComponent(r)),a){if(a.isSupported()&&(t=a.canPlayType(e)))return t}else Ne.error('The "'+r+'" tech is undefined. Skipped browser support check for that tech.')}return""},i.selectSource=function(e){var t,i=this,n=this.options_.techOrder.map((function(e){return[e,En.getTech(e)]})).filter((function(e){var t=e[0],i=e[1];return i?i.isSupported():(Ne.error('The "'+t+'" tech is undefined. Skipped browser support check for that tech.'),!1)})),r=function(e,t,i){var n;return e.some((function(e){return t.some((function(t){if(n=i(e,t))return!0}))})),n},a=function(e,t){var n=e[0];if(e[1].canPlaySource(t,i.options_[n.toLowerCase()]))return{source:t,tech:n}};return t=this.options_.sourceOrder?r(e,n,function(e){return function(t,i){return e(i,t)}}(a)):r(n,e,a),t||!1},i.src=function(e){var t=this;if(void 0===e)return this.cache_.src||"";var i=jn(e);i.length?(this.changingSrc_=!0,this.cache_.sources=i,this.updateSourceCaches_(i[0]),Pn(this,i[0],(function(e,n){var r,a;if(t.middleware_=n,t.cache_.sources=i,t.updateSourceCaches_(e),t.src_(e))return i.length>1?t.src(i.slice(1)):(t.changingSrc_=!1,t.setTimeout((function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})}),0),void t.triggerReady());r=n,a=t.tech_,r.forEach((function(e){return e.setTech&&e.setTech(a)}))}))):this.setTimeout((function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})}),0)},i.src_=function(e){var t,i,n=this,r=this.selectSource([e]);return!r||(t=r.tech,i=this.techName_,ci(t)!==ci(i)?(this.changingSrc_=!0,this.loadTech_(r.tech,r.source),this.tech_.ready((function(){n.changingSrc_=!1})),!1):(this.ready((function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1}),!0),!1))},i.load=function(){this.techCall_("load")},i.reset=function(){this.tech_&&this.tech_.clearTracks("text"),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),Zt(this)&&this.trigger("playerreset")},i.currentSources=function(){var e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t},i.currentSource=function(){return this.cache_.source||{}},i.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},i.currentType=function(){return this.currentSource()&&this.currentSource().type||""},i.preload=function(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")},i.autoplay=function(e){if(void 0===e)return this.options_.autoplay||!1;var t;"string"==typeof e&&/(any|play|muted)/.test(e)?(this.options_.autoplay=e,this.manualAutoplay_(e),t=!1):this.options_.autoplay=!!e,t=t||this.options_.autoplay,this.tech_&&this.techCall_("setAutoplay",t)},i.playsinline=function(e){return void 0!==e?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")},i.loop=function(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")},i.poster=function(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))},i.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},i.controls=function(e){if(void 0===e)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))},i.usingNativeControls=function(e){if(void 0===e)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},i.error=function(e){return void 0===e?this.error_||null:null===e?(this.error_=e,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close())):(this.error_=new zi(e),this.addClass("vjs-error"),Ne.error("(CODE:"+this.error_.code+" "+zi.errorTypes[this.error_.code]+")",this.error_.message,this.error_),void this.trigger("error"))},i.reportUserActivity=function(e){this.userActivity_=!0},i.userActive=function(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",(function(e){e.stopPropagation(),e.preventDefault()})),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},i.listenForUserActivity_=function(){var e,t,i,n,r=Kt(this,this.reportUserActivity);this.on("mousedown",(function(){r(),this.clearInterval(e),e=this.setInterval(r,250)})),this.on("mousemove",(function(e){e.screenX===t&&e.screenY===i||(t=e.screenX,i=e.screenY,r())})),this.on("mouseup",(function(t){r(),this.clearInterval(e)})),this.on("keydown",r),this.on("keyup",r),this.setInterval((function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(n);var e=this.options_.inactivityTimeout;e<=0||(n=this.setTimeout((function(){this.userActivity_||this.userActive(!1)}),e))}}),250)},i.playbackRate=function(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)},i.defaultPlaybackRate=function(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},i.isAudio=function(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e},i.addTextTrack=function(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)},i.addRemoteTextTrack=function(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)},i.removeRemoteTextTrack=function(e){void 0===e&&(e={});var t=e.track;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)},i.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},i.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},i.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},i.language=function(e){if(void 0===e)return this.language_;this.language_=String(e).toLowerCase()},i.languages=function(){return hi(t.prototype.options_.languages,this.languages_)},i.toJSON=function(){var e=hi(this.options_),t=e.tracks;e.tracks=[];for(var i=0;i<t.length;i++){var n=t[i];(n=hi(n)).player=void 0,e.tracks[i]=n}return e},i.createModal=function(e,t){var i=this;(t=t||{}).content=e||"";var n=new Qi(this,t);return this.addChild(n),n.on("dispose",(function(){i.removeChild(n)})),n.open(),n},i.updateCurrentBreakpoint_=function(){if(this.responsive())for(var e=this.currentBreakpoint(),t=this.currentWidth(),i=0;i<Sa.length;i++){var n=Sa[i];if(t<=this.breakpoints_[n]){if(e===n)return;e&&this.removeClass(ka[e]),this.addClass(ka[n]),this.breakpoint_=n;break}}},i.removeCurrentBreakpoint_=function(){var e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)},i.breakpoints=function(e){return void 0===e||(this.breakpoint_="",this.breakpoints_=qe({},wa,e),this.updateCurrentBreakpoint_()),qe(this.breakpoints_)},i.responsive=function(e){return void 0===e?this.responsive_:(e=Boolean(e))!==this.responsive_?(this.responsive_=e,e?(this.on("playerresize",this.updateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.updateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e):void 0},i.currentBreakpoint=function(){return this.breakpoint_},i.currentBreakpointClass=function(){return ka[this.breakpoint_]||""},t.getTagSettings=function(e){var t={sources:[],tracks:[]},i=ut(e),n=i["data-setup"];if(nt(e,"vjs-fill")&&(i.fill=!0),nt(e,"vjs-fluid")&&(i.fluid=!0),null!==n){var a=r()(n||"{}"),s=a[0],o=a[1];s&&Ne.error(s),qe(i,o)}if(qe(t,i),e.hasChildNodes())for(var u=e.childNodes,l=0,c=u.length;l<c;l++){var h=u[l],d=h.nodeName.toLowerCase();"source"===d?t.sources.push(ut(h)):"track"===d&&t.tracks.push(ut(h))}return t},i.flexNotSupported_=function(){var e=C().createElement("i");return!("flexBasis"in e.style||"webkitFlexBasis"in e.style||"mozFlexBasis"in e.style||"msFlexBasis"in e.style||"msFlexOrder"in e.style)},t}(di);Cn.names.forEach((function(e){var t=Cn[e];Ca.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}})),Ca.players={};var Ea=f().navigator;Ca.prototype.options_={techOrder:En.defaultTechOrder_,html5:{},flash:{},inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:Ea&&(Ea.languages&&Ea.languages[0]||Ea.userLanguage||Ea.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",breakpoints:{},responsive:!1},["ended","seeking","seekable","networkState","readyState"].forEach((function(e){Ca.prototype[e]=function(){return this.techGet_(e)}})),ba.forEach((function(e){Ca.prototype["handleTech"+ci(e)+"_"]=function(){return this.trigger(e)}})),di.registerComponent("Player",Ca);var Aa="plugin",La={},Oa=function(e){return La.hasOwnProperty(e)},Pa=function(e){return Oa(e)?La[e]:void 0},xa=function(e,t){e.activePlugins_=e.activePlugins_||{},e.activePlugins_[t]=!0},Ua=function(e,t,i){var n=(i?"before":"")+"pluginsetup";e.trigger(n,t),e.trigger(n+":"+t.name,t)},Ia=function(e,t){return t.prototype.name=e,function(){Ua(this,{name:e,plugin:t,instance:null},!0);for(var i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];var a=De(t,[this].concat(n));return this[e]=function(){return a},Ua(this,a.getEventHash()),a}},Da=function(){function e(t){if(this.constructor===e)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=t,oi(this),delete this.trigger,li(this,this.constructor.defaultState),xa(t,this.name),this.dispose=Kt(this,this.dispose),t.on("dispose",this.dispose)}var t=e.prototype;return t.version=function(){return this.constructor.VERSION},t.getEventHash=function(e){return void 0===e&&(e={}),e.name=this.name,e.plugin=this.constructor,e.instance=this,e},t.trigger=function(e,t){return void 0===t&&(t={}),Ft(this.eventBusEl_,e,this.getEventHash(t))},t.handleStateChanged=function(e){},t.dispose=function(){var e=this.name,t=this.player;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t.activePlugins_[e]=!1,this.player=this.state=null,t[e]=Ia(e,La[e])},e.isBasic=function(t){var i="string"==typeof t?Pa(t):t;return"function"==typeof i&&!e.prototype.isPrototypeOf(i.prototype)},e.registerPlugin=function(t,i){if("string"!=typeof t)throw new Error('Illegal plugin name, "'+t+'", must be a string, was '+typeof t+".");if(Oa(t))Ne.warn('A plugin named "'+t+'" already exists. You may want to avoid re-registering plugins!');else if(Ca.prototype.hasOwnProperty(t))throw new Error('Illegal plugin name, "'+t+'", cannot share a name with an existing player method!');if("function"!=typeof i)throw new Error('Illegal plugin for "'+t+'", must be a function, was '+typeof i+".");return La[t]=i,t!==Aa&&(e.isBasic(i)?Ca.prototype[t]=function(e,t){var i=function(){Ua(this,{name:e,plugin:t,instance:null},!0);var i=t.apply(this,arguments);return xa(this,e),Ua(this,{name:e,plugin:t,instance:i}),i};return Object.keys(t).forEach((function(e){i[e]=t[e]})),i}(t,i):Ca.prototype[t]=Ia(t,i)),i},e.deregisterPlugin=function(e){if(e===Aa)throw new Error("Cannot de-register base plugin.");Oa(e)&&(delete La[e],delete Ca.prototype[e])},e.getPlugins=function(e){var t;return void 0===e&&(e=Object.keys(La)),e.forEach((function(e){var i=Pa(e);i&&((t=t||{})[e]=i)})),t},e.getPluginVersion=function(e){var t=Pa(e);return t&&t.VERSION||""},e}();Da.getPlugin=Pa,Da.BASE_PLUGIN_NAME=Aa,Da.registerPlugin(Aa,Da),Ca.prototype.usingPlugin=function(e){return!!this.activePlugins_&&!0===this.activePlugins_[e]},Ca.prototype.hasPlugin=function(e){return!!Oa(e)};var Ra=function(e){return 0===e.indexOf("#")?e.slice(1):e};function Ma(e,t,i){var n=Ma.getPlayer(e);if(n)return t&&Ne.warn('Player "'+e+'" is already initialised. Options will not be applied.'),i&&n.ready(i),n;var r="string"==typeof e?kt("#"+Ra(e)):e;if(!Qe(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");C().body.contains(r)||Ne.warn("The element supplied is not included in the DOM"),t=t||{},Ma.hooks("beforesetup").forEach((function(e){var i=e(r,hi(t));ze(i)&&!Array.isArray(i)?t=hi(t,i):Ne.error("please return an object in beforesetup hooks")}));var a=di.getComponent("Player");return n=new a(r,t,i),Ma.hooks("setup").forEach((function(e){return e(n)})),n}if(Ma.hooks_={},Ma.hooks=function(e,t){return Ma.hooks_[e]=Ma.hooks_[e]||[],t&&(Ma.hooks_[e]=Ma.hooks_[e].concat(t)),Ma.hooks_[e]},Ma.hook=function(e,t){Ma.hooks(e,t)},Ma.hookOnce=function(e,t){Ma.hooks(e,[].concat(t).map((function(t){return function i(){return Ma.removeHook(e,i),t.apply(void 0,arguments)}})))},Ma.removeHook=function(e,t){var i=Ma.hooks(e).indexOf(t);return!(i<=-1)&&(Ma.hooks_[e]=Ma.hooks_[e].slice(),Ma.hooks_[e].splice(i,1),!0)},!0!==f().VIDEOJS_NO_DYNAMIC_STYLE&&Ke()){var Ba=kt(".vjs-styles-defaults");if(!Ba){Ba=Yt("vjs-styles-defaults");var Na=kt("head");Na&&Na.insertBefore(Ba,Na.firstChild),$t(Ba,"\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid {\n padding-top: 56.25%\n }\n ")}}Gt(1,Ma),Ma.VERSION=Pe,Ma.options=Ca.prototype.options_,Ma.getPlayers=function(){return Ca.players},Ma.getPlayer=function(e){var t,i=Ca.players;if("string"==typeof e){var n=Ra(e),r=i[n];if(r)return r;t=kt("#"+n)}else t=e;if(Qe(t)){var a=t,s=a.player,o=a.playerId;if(s||i[o])return s||i[o]}},Ma.getAllPlayers=function(){return Object.keys(Ca.players).map((function(e){return Ca.players[e]})).filter(Boolean)},Ma.players=Ca.players,Ma.getComponent=di.getComponent,Ma.registerComponent=function(e,t){En.isTech(t)&&Ne.warn("The "+e+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),di.registerComponent.call(di,e,t)},Ma.getTech=En.getTech,Ma.registerTech=En.registerTech,Ma.use=function(e,t){An[e]=An[e]||[],An[e].push(t)},Object.defineProperty(Ma,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(Ma.middleware,"TERMINATOR",{value:On,writeable:!1,enumerable:!0}),Ma.browser=Ii,Ma.TOUCH_ENABLED=Ui,Ma.extend=function(e,t){void 0===t&&(t={});var i=function(){e.apply(this,arguments)},n={};for(var r in"object"==typeof t?(t.constructor!==Object.prototype.constructor&&(i=t.constructor),n=t):"function"==typeof t&&(i=t),function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.super_=t)}(i,e),n)n.hasOwnProperty(r)&&(i.prototype[r]=n[r]);return i},Ma.mergeOptions=hi,Ma.bind=Kt,Ma.registerPlugin=Da.registerPlugin,Ma.deregisterPlugin=Da.deregisterPlugin,Ma.plugin=function(e,t){return Ne.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Da.registerPlugin(e,t)},Ma.getPlugins=Da.getPlugins,Ma.getPlugin=Da.getPlugin,Ma.getPluginVersion=Da.getPluginVersion,Ma.addLanguage=function(e,t){var i;return e=(""+e).toLowerCase(),Ma.options.languages=hi(Ma.options.languages,((i={})[e]=t,i)),Ma.options.languages[e]},Ma.log=Ne,Ma.createLogger=je,Ma.createTimeRange=Ma.createTimeRanges=Mi,Ma.formatTime=tr,Ma.setFormatTime=function(e){er=e},Ma.resetFormatTime=function(){er=Zn},Ma.parseUrl=pn,Ma.isCrossOrigin=gn,Ma.EventTarget=Jt,Ma.on=Nt,Ma.one=Vt,Ma.off=jt,Ma.trigger=Ft,Ma.xhr=c(),Ma.TextTrack=_n,Ma.AudioTrack=bn,Ma.VideoTrack=Tn,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach((function(e){Ma[e]=function(){return Ne.warn("videojs."+e+"() is deprecated; use videojs.dom."+e+"() instead"),Ct[e].apply(null,arguments)}})),Ma.computedStyle=Ge,Ma.dom=Ct,Ma.url=yn;var ja=function(e,t){return/^[a-z]+:/i.test(t)?t:(/\/\//i.test(e)||(e=d().buildAbsoluteURL(f().location.href,e)),d().buildAbsoluteURL(e,t))},Fa=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Va=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),Ha=function e(t,i,n){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,i);if(void 0===r){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,i,n)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(n):void 0},qa=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},za=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},Wa=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i=[],n=!0,r=!1,a=void 0;try{for(var s,o=e[Symbol.iterator]();!(n=(s=o.next()).done)&&(i.push(s.value),!t||i.length!==t);n=!0);}catch(e){r=!0,a=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw a}}return i}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},Ga=Ma.mergeOptions,Xa=Ma.EventTarget,Ya=Ma.log,$a=function(e,t){["AUDIO","SUBTITLES"].forEach((function(i){for(var n in e.mediaGroups[i])for(var r in e.mediaGroups[i][n]){var a=e.mediaGroups[i][n][r];t(a,i,n,r)}}))},Ka=function(e,t){var i=Ga(e,{}),n=i.playlists[t.uri];if(!n)return null;if(n.segments&&t.segments&&n.segments.length===t.segments.length&&n.mediaSequence===t.mediaSequence)return null;var r=Ga(n,t);n.segments&&(r.segments=function(e,t,i){var n=t.slice();i=i||0;for(var r=Math.min(e.length,t.length+i),a=i;a<r;a++)n[a-i]=Ga(e[a],n[a-i]);return n}(n.segments,t.segments,t.mediaSequence-n.mediaSequence)),r.segments.forEach((function(e){!function(e,t){e.resolvedUri||(e.resolvedUri=ja(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=ja(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=ja(t,e.map.uri))}(e,r.resolvedUri)}));for(var a=0;a<i.playlists.length;a++)i.playlists[a].uri===t.uri&&(i.playlists[a]=r);return i.playlists[t.uri]=r,i},Qa=function(e){for(var t=e.playlists.length;t--;){var i=e.playlists[t];e.playlists[i.uri]=i,i.resolvedUri=ja(e.uri,i.uri),i.id=t,i.attributes||(i.attributes={},Ya.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute."))}},Ja=function(e){$a(e,(function(t){t.uri&&(t.resolvedUri=ja(e.uri,t.uri))}))},Za=function(e,t){var i=e.segments[e.segments.length-1];return t&&i&&i.duration?1e3*i.duration:500*(e.targetDuration||10)},es=function(e){function t(e,i,n){Fa(this,t);var r=za(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));if(r.srcUrl=e,r.hls_=i,r.withCredentials=n,!r.srcUrl)throw new Error("A non-empty playlist URL is required");return r.state="HAVE_NOTHING",r.on("mediaupdatetimeout",(function(){"HAVE_METADATA"===r.state&&(r.state="HAVE_CURRENT_METADATA",r.request=r.hls_.xhr({uri:ja(r.master.uri,r.media().uri),withCredentials:r.withCredentials},(function(e,t){if(r.request)return e?r.playlistRequestError(r.request,r.media().uri,"HAVE_METADATA"):void r.haveMetadata(r.request,r.media().uri)})))})),r}return qa(t,e),Va(t,[{key:"playlistRequestError",value:function(e,t,i){this.request=null,i&&(this.state=i),this.error={playlist:this.master.playlists[t],status:e.status,message:"HLS playlist request error at URL: "+t,responseText:e.responseText,code:e.status>=500?4:2},this.trigger("error")}},{key:"haveMetadata",value:function(e,t){var i=this;this.request=null,this.state="HAVE_METADATA";var n=new k;n.push(e.responseText),n.end(),n.manifest.uri=t,n.manifest.attributes=n.manifest.attributes||{};var r=Ka(this.master,n.manifest);this.targetDuration=n.manifest.targetDuration,r?(this.master=r,this.media_=this.master.playlists[n.manifest.uri]):this.trigger("playlistunchanged"),this.media().endList||(f().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=f().setTimeout((function(){i.trigger("mediaupdatetimeout")}),Za(this.media(),!!r))),this.trigger("loadedplaylist")}},{key:"dispose",value:function(){this.stopRequest(),f().clearTimeout(this.mediaUpdateTimeout)}},{key:"stopRequest",value:function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}},{key:"media",value:function(e){var t=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);var i=this.state;if("string"==typeof e){if(!this.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.master.playlists[e]}var n=!this.media_||e.uri!==this.media_.uri;if(this.master.playlists[e.uri].endList)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(n&&(this.trigger("mediachanging"),this.trigger("mediachange")));if(n){if(this.state="SWITCHING_MEDIA",this.request){if(ja(this.master.uri,e.uri)===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.request=this.hls_.xhr({uri:ja(this.master.uri,e.uri),withCredentials:this.withCredentials},(function(n,r){if(t.request){if(n)return t.playlistRequestError(t.request,e.uri,i);t.haveMetadata(r,e.uri),"HAVE_MASTER"===i?t.trigger("loadedmetadata"):t.trigger("mediachange")}}))}}},{key:"pause",value:function(){this.stopRequest(),f().clearTimeout(this.mediaUpdateTimeout),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")}},{key:"load",value:function(e){var t=this;f().clearTimeout(this.mediaUpdateTimeout);var i=this.media();if(e){var n=i?i.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=f().setTimeout((function(){return t.load()}),n)}else this.started?i&&!i.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()}},{key:"start",value:function(){var e=this;this.started=!0,this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials},(function(t,i){if(e.request){if(e.request=null,t)return e.error={status:i.status,message:"HLS playlist request error at URL: "+e.srcUrl,responseText:i.responseText,code:2},"HAVE_NOTHING"===e.state&&(e.started=!1),e.trigger("error");var n=new k;return n.push(i.responseText),n.end(),e.state="HAVE_MASTER",n.manifest.uri=e.srcUrl,n.manifest.playlists?(e.master=n.manifest,Qa(e.master),Ja(e.master),e.trigger("loadedplaylist"),void(e.request||e.media(n.manifest.playlists[0]))):(e.master={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:f().location.href,playlists:[{uri:e.srcUrl,id:0}]},e.master.playlists[e.srcUrl]=e.master.playlists[0],e.master.playlists[0].resolvedUri=e.srcUrl,e.master.playlists[0].attributes=e.master.playlists[0].attributes||{},e.haveMetadata(i,e.srcUrl),e.trigger("loadedmetadata"))}}))}}]),t}(Xa),ts=Ma.createTimeRange,is=function(e,t,i){var n,r;return void 0===t&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence?0:(n=function(e,t){var i=0,n=t-e.mediaSequence,r=e.segments[n];if(r){if(void 0!==r.start)return{result:r.start,precise:!0};if(void 0!==r.end)return{result:r.end-r.duration,precise:!0}}for(;n--;){if(void 0!==(r=e.segments[n]).end)return{result:i+r.end,precise:!0};if(i+=r.duration,void 0!==r.start)return{result:i+r.start,precise:!0}}return{result:i,precise:!1}}(e,t),n.precise?n.result:(r=function(e,t){for(var i=0,n=void 0,r=t-e.mediaSequence;r<e.segments.length;r++){if(void 0!==(n=e.segments[r]).start)return{result:n.start-i,precise:!0};if(i+=n.duration,void 0!==n.end)return{result:n.end-i,precise:!0}}return{result:-1,precise:!1}}(e,t),r.precise?r.result:n.result+i))},ns=function(e,t,i){if(!e)return 0;if("number"!=typeof i&&(i=0),void 0===t){if(e.totalDuration)return e.totalDuration;if(!e.endList)return f()[1/0]}return is(e,t,i)},rs=function(e,t,i){var n=0;if(t>i){var r=[i,t];t=r[0],i=r[1]}if(t<0){for(var a=t;a<Math.min(0,i);a++)n+=e.targetDuration;t=0}for(var s=t;s<i;s++)n+=e.segments[s].duration;return n},as=function(e){if(!e.segments.length)return 0;for(var t=e.segments.length-1,i=e.segments[t].duration||e.targetDuration,n=i+2*e.targetDuration;t--&&!((i+=e.segments[t].duration)>=n););return Math.max(0,t)},ss=function(e,t,i){if(!e||!e.segments)return null;if(e.endList)return ns(e);if(null===t)return null;t=t||0;var n=i?as(e):e.segments.length;return is(e,e.mediaSequence+n,t)},os=function(e){return e-Math.floor(e)==0},us=function(e,t){if(os(t))return t+.1*e;for(var i=t.toString().split(".")[1].length,n=1;n<=i;n++){var r=Math.pow(10,n),a=t*r;if(os(a)||n===i)return(a+e)/r}},ls=us.bind(null,1),cs=us.bind(null,-1),hs=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},ds=function(e){return e.excludeUntil&&e.excludeUntil===1/0},ps=function(e){var t=hs(e);return!e.disabled&&!t},fs=function(e,t){return t.attributes&&t.attributes[e]},ms=function(e,t){if(1===e.playlists.length)return!0;var i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter((function(e){return!!ps(e)&&(e.attributes.BANDWIDTH||0)<i})).length},gs={duration:ns,seekable:function(e,t){var i=t||0,n=ss(e,t,!0);return null===n?ts():ts(i,n)},safeLiveIndex:as,getMediaInfoForTime:function(e,t,i,n){var r=void 0,a=void 0,s=e.segments.length,o=t-n;if(o<0){if(i>0)for(r=i-1;r>=0;r--)if(a=e.segments[r],(o+=cs(a.duration))>0)return{mediaIndex:r,startTime:n-rs(e,i,r)};return{mediaIndex:0,startTime:t}}if(i<0){for(r=i;r<0;r++)if((o-=e.targetDuration)<0)return{mediaIndex:0,startTime:t};i=0}for(r=i;r<s;r++)if(a=e.segments[r],(o-=ls(a.duration))<0)return{mediaIndex:r,startTime:n+rs(e,i,r)};return{mediaIndex:s-1,startTime:t}},isEnabled:ps,isDisabled:function(e){return e.disabled},isBlacklisted:hs,isIncompatible:ds,playlistEnd:ss,isAes:function(e){for(var t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},isFmp4:function(e){for(var t=0;t<e.segments.length;t++)if(e.segments[t].map)return!0;return!1},hasAttribute:fs,estimateSegmentRequestTime:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(!fs("BANDWIDTH",i))return NaN;var r=e*i.attributes.BANDWIDTH;return(r-8*n)/t},isLowestEnabledRendition:ms},ys=Ma.xhr,vs=Ma.mergeOptions,_s=function(){return function e(t,i){t=vs({timeout:45e3},t);var n=e.beforeRequest||Ma.Hls.xhr.beforeRequest;if(n&&"function"==typeof n){var r=n(t);r&&(t=r)}var a=ys(t,(function(e,t){var n=a.response;!e&&n&&(a.responseTime=Date.now(),a.roundTripTime=a.responseTime-a.requestTime,a.bytesReceived=n.byteLength||n.length,a.bandwidth||(a.bandwidth=Math.floor(a.bytesReceived/a.roundTripTime*8*1e3))),t.headers&&(a.responseHeaders=t.headers),e&&"ETIMEDOUT"===e.code&&(a.timedout=!0),e||a.aborted||200===t.statusCode||206===t.statusCode||0===t.statusCode||(e=new Error("XHR Failed with a response of: "+(a&&(n||a.responseText)))),i(e,a)})),s=a.abort;return a.abort=function(){return a.aborted=!0,s.apply(a,arguments)},a.uri=t.uri,a.requestTime=Date.now(),a}},bs=function(e,t){return e.start(t)+"-"+e.end(t)},Ts=function(e,t){var i=e.toString(16);return"00".substring(0,2-i.length)+i+(t%2?" ":"")},Ss=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},ks=function(e){var t={};return Object.keys(e).forEach((function(i){var n=e[i];ArrayBuffer.isView(n)?t[i]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:t[i]=n})),t},ws=function(e){var t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},Cs=function(e){for(var t=Array.prototype.slice.call(e),i=16,n="",r=0;r<t.length/i;r++)n+=t.slice(r*i,r*i+i).map(Ts).join("")+" "+t.slice(r*i,r*i+i).map(Ss).join("")+"\n";return n},Es=Object.freeze({createTransferableMessage:ks,initSegmentId:ws,hexDump:Cs,tagDump:function(e){var t=e.bytes;return Cs(t)},textRanges:function(e){var t="",i=void 0;for(i=0;i<e.length;i++)t+=bs(e,i)+" ";return t}}),As=function(e,t,i,n){var r=void 0;if("stream"===t){r=new Date(1e3*n+i.getTime());var a=e.toISOString(),s=i.toISOString(),o=r.toISOString();return s<=a&&a<=o}if("player"===t)return r=n+i,i<=e&&e<=r},Ls=function(e,t,i){if(!i.segments||0===i.segments.length)return null;if("player"!==t&&"stream"!==t)return null;for(var n=0,r=0;r<i.segments.length;r++){var a=i.segments[r],s=n+a.duration,o=void 0,u=void 0;"player"===t?(o=a.start,u=n):(o=a.dateTimeObject,u=a.dateTimeObject);var l=void 0!==a.start&&void 0!==a.end&&As(e,t,o,a.end-a.start),c=As(e,t,u,a.duration);if(l)return{segment:a,estimatedStart:u,type:"accurate"};if(c)return{segment:a,estimatedStart:u,type:"estimate"};n=s}return null},Os=function(e){var t=e.playlist,i=e.time,n=void 0===i?void 0:i,r=e.callback;if(!r)throw new Error("getStreamTime: callback must be provided");if(!t||void 0===n)return r({message:"getStreamTime: playlist and time must be provided"});var a=function(e,t){return Ls(e,"player",t)}(n,t);if(!a)return r({message:"valid streamTime was not found"});if("estimate"===a.type)return r({message:"Accurate streamTime could not be determined. Please seek to e.seekTime and try again",seekTime:a.estimatedStart});var s={mediaSeconds:n};return a.segment.dateTimeObject&&(s.programDateTime=a.segment.dateTimeObject.toISOString()),r(null,s)},Ps=function e(t){var i=t.streamTime,n=t.playlist,r=t.retryCount,a=void 0===r?2:r,s=t.seekTo,o=t.pauseAfterSeek,u=void 0===o||o,l=t.tech,c=t.callback;if(!c)throw new Error("seekToStreamTime: callback must be provided");if(void 0===i||!n||!s)return c({message:"seekToStreamTime: streamTime, seekTo and playlist must be provided"});if(!n.endList&&!l.hasStarted_)return c({message:"player must be playing a live stream to start buffering"});if(!function(e){if(!e.segments||0===e.segments.length)return!1;for(var t=0;t<e.segments.length;t++)if(!e.segments[t].dateTimeObject)return!1;return!0}(n))return c({message:"programDateTime tags must be provided in the manifest "+n.resolvedUri});var h=function(e,t){var i=void 0;try{i=new Date(e)}catch(e){return null}return Ls(i,"stream",t)}(i,n);if(!h)return c({message:i+" was not found in the stream"});if("estimate"===h.type)return 0===a?c({message:i+" is not buffered yet. Try again"}):e({streamTime:i,playlist:n,retryCount:a-1,seekTo:s,pauseAfterSeek:u,tech:l,callback:c});var d=h.segment,p=function(e,t){var i=void 0,n=void 0;try{i=new Date(e),n=new Date(t)}catch(e){}var r=i.getTime();return(n.getTime()-r)/1e3}(d.dateTimeObject,i),f=d.start+p;l.one("seeked",(function(){return c(null,l.currentTime())})),u&&l.pause(),s(f)},xs=1/30,Us=.1,Is=function(e,t){var i=[],n=void 0;if(e&&e.length)for(n=0;n<e.length;n++)t(e.start(n),e.end(n))&&i.push([e.start(n),e.end(n)]);return Ma.createTimeRanges(i)},Ds=function(e,t){return Is(e,(function(e,i){return e-xs<=t&&i+xs>=t}))},Rs=function(e,t){return Is(e,(function(e){return e-xs>=t}))},Ms=function(e){var t=[];if(!e||!e.length)return"";for(var i=0;i<e.length;i++)t.push(e.start(i)+" => "+e.end(i));return t.join(", ")},Bs=function(e){for(var t=[],i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t},Ns=function(e,t,i){var n=void 0,r=void 0;if(i&&i.cues)for(n=i.cues.length;n--;)(r=i.cues[n]).startTime<=t&&r.endTime>=e&&i.removeCue(r)},js=function(e){return isNaN(e)||Math.abs(e)===1/0?Number.MAX_VALUE:e},Fs=function(e,t,i){var n=f().WebKitDataCue||f().VTTCue;if(t&&t.forEach((function(e){var t=e.stream;this.inbandTextTracks_[t].addCue(new n(e.startTime+this.timestampOffset,e.endTime+this.timestampOffset,e.text))}),e),i){var r=js(e.mediaSource_.duration);if(i.forEach((function(e){var t=e.cueTime+this.timestampOffset;e.frames.forEach((function(e){var i=new n(t,t,e.value||e.url||e.data||"");i.frame=e,i.value=e,function(e){Object.defineProperties(e.frame,{id:{get:function(){return Ma.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key}},value:{get:function(){return Ma.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data}},privateData:{get:function(){return Ma.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data}}})}(i),this.metadataTrack_.addCue(i)}),this)}),e),e.metadataTrack_&&e.metadataTrack_.cues&&e.metadataTrack_.cues.length){for(var a=e.metadataTrack_.cues,s=[],o=0;o<a.length;o++)a[o]&&s.push(a[o]);var u=s.reduce((function(e,t){var i=e[t.startTime]||[];return i.push(t),e[t.startTime]=i,e}),{}),l=Object.keys(u).sort((function(e,t){return Number(e)-Number(t)}));l.forEach((function(e,t){var i=u[e],n=Number(l[t+1])||r;i.forEach((function(e){e.endTime=n}))}))}}},Vs="undefined"!=typeof window?window:{},Hs="undefined"==typeof Symbol?"__target":Symbol(),qs=Vs.BlobBuilder||Vs.WebKitBlobBuilder||Vs.MozBlobBuilder||Vs.MSBlobBuilder,zs=Vs.URL||Vs.webkitURL||zs&&zs.msURL,Ws=Vs.Worker;function Gs(e,t){return function(i){var n=this;if(!t)return new Ws(e);if(Ws&&!i){var r=Ks(t.toString().replace(/^function.+?{/,"").slice(0,-1));return this[Hs]=new Ws(r),function(e,t){if(!e||!t)return;var i=e.terminate;e.objURL=t,e.terminate=function(){e.objURL&&zs.revokeObjectURL(e.objURL),i.call(e)}}(this[Hs],r),this[Hs]}var a={postMessage:function(e){n.onmessage&&setTimeout((function(){n.onmessage({data:e,target:a})}))}};t.call(a),this.postMessage=function(e){setTimeout((function(){a.onmessage({data:e,target:n})}))},this.isThisThread=!0}}if(Ws){var Xs,Ys=Ks("self.onmessage = function () {}"),$s=new Uint8Array(1);try{(Xs=new Ws(Ys)).postMessage($s,[$s.buffer])}catch(e){Ws=null}finally{zs.revokeObjectURL(Ys),Xs&&Xs.terminate()}}function Ks(e){try{return zs.createObjectURL(new Blob([e],{type:"application/javascript"}))}catch(i){var t=new qs;return t.append(e),zs.createObjectURL(t.getBlob(type))}}var Qs=new Gs("./transmuxer-worker.worker.js",(function(e,t){var i=this;!function(){var e,t,n,r,a,s,o,u,l,c,h,d,p,f,m,g,y,v,_,b,T,S,k,w,C,E,A,L,O,P,x,U,I,D,R,M,B,N,j,F,V=Math.pow(2,32)-1;!function(){var e;if(S={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},"undefined"!=typeof Uint8Array){for(e in S)S.hasOwnProperty(e)&&(S[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);k=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),C=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),w=new Uint8Array([0,0,0,1]),E=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),A=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),L={video:E,audio:A},x=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),P=new Uint8Array([0,0,0,0,0,0,0,0]),U=new Uint8Array([0,0,0,0,0,0,0,0]),I=U,D=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),R=U,O=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}}(),e=function(e){var t,i,n=[],r=0;for(t=1;t<arguments.length;t++)n.push(arguments[t]);for(t=n.length;t--;)r+=n[t].byteLength;for(i=new Uint8Array(r+8),new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(0,i.byteLength),i.set(e,4),t=0,r=8;t<n.length;t++)i.set(n[t],r),r+=n[t].byteLength;return i},t=function(){return e(S.dinf,e(S.dref,x))},n=function(t){return e(S.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,t.audioobjecttype<<3|t.samplingfrequencyindex>>>1,t.samplingfrequencyindex<<7|t.channelcount<<3,6,1,2]))},m=function(t){return e(S.hdlr,L[t])},f=function(t){var i=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,t.duration>>>24&255,t.duration>>>16&255,t.duration>>>8&255,255&t.duration,85,196,0,0]);return t.samplerate&&(i[12]=t.samplerate>>>24&255,i[13]=t.samplerate>>>16&255,i[14]=t.samplerate>>>8&255,i[15]=255&t.samplerate),e(S.mdhd,i)},p=function(t){return e(S.mdia,f(t),m(t.type),s(t))},a=function(t){return e(S.mfhd,new Uint8Array([0,0,0,0,(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t]))},s=function(i){return e(S.minf,"video"===i.type?e(S.vmhd,O):e(S.smhd,P),t(),y(i))},o=function(t,i){for(var n=[],r=i.length;r--;)n[r]=_(i[r]);return e.apply(null,[S.moof,a(t)].concat(n))},u=function(t){for(var i=t.length,n=[];i--;)n[i]=h(t[i]);return e.apply(null,[S.moov,c(4294967295)].concat(n).concat(l(t)))},l=function(t){for(var i=t.length,n=[];i--;)n[i]=b(t[i]);return e.apply(null,[S.mvex].concat(n))},c=function(t){var i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return e(S.mvhd,i)},g=function(t){var i,n,r=t.samples||[],a=new Uint8Array(4+r.length);for(n=0;n<r.length;n++)i=r[n].flags,a[n+4]=i.dependsOn<<4|i.isDependedOn<<2|i.hasRedundancy;return e(S.sdtp,a)},y=function(t){return e(S.stbl,v(t),e(S.stts,R),e(S.stsc,I),e(S.stsz,D),e(S.stco,U))},v=function(t){return e(S.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===t.type?M(t):B(t))},M=function(t){var i,n=t.sps||[],r=t.pps||[],a=[],s=[];for(i=0;i<n.length;i++)a.push((65280&n[i].byteLength)>>>8),a.push(255&n[i].byteLength),a=a.concat(Array.prototype.slice.call(n[i]));for(i=0;i<r.length;i++)s.push((65280&r[i].byteLength)>>>8),s.push(255&r[i].byteLength),s=s.concat(Array.prototype.slice.call(r[i]));return e(S.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&t.width)>>8,255&t.width,(65280&t.height)>>8,255&t.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),e(S.avcC,new Uint8Array([1,t.profileIdc,t.profileCompatibility,t.levelIdc,255].concat([n.length]).concat(a).concat([r.length]).concat(s))),e(S.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])))},B=function(t){return e(S.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&t.channelcount)>>8,255&t.channelcount,(65280&t.samplesize)>>8,255&t.samplesize,0,0,0,0,(65280&t.samplerate)>>8,255&t.samplerate,0,0]),n(t))},d=function(t){var i=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&t.id)>>24,(16711680&t.id)>>16,(65280&t.id)>>8,255&t.id,0,0,0,0,(4278190080&t.duration)>>24,(16711680&t.duration)>>16,(65280&t.duration)>>8,255&t.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&t.width)>>8,255&t.width,0,0,(65280&t.height)>>8,255&t.height,0,0]);return e(S.tkhd,i)},_=function(t){var i,n,r,a,s,o;return i=e(S.tfhd,new Uint8Array([0,0,0,58,(4278190080&t.id)>>24,(16711680&t.id)>>16,(65280&t.id)>>8,255&t.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),s=Math.floor(t.baseMediaDecodeTime/(V+1)),o=Math.floor(t.baseMediaDecodeTime%(V+1)),n=e(S.tfdt,new Uint8Array([1,0,0,0,s>>>24&255,s>>>16&255,s>>>8&255,255&s,o>>>24&255,o>>>16&255,o>>>8&255,255&o])),92,"audio"===t.type?(r=T(t,92),e(S.traf,i,n,r)):(a=g(t),r=T(t,a.length+92),e(S.traf,i,n,r,a))},h=function(t){return t.duration=t.duration||4294967295,e(S.trak,d(t),p(t))},b=function(t){var i=new Uint8Array([0,0,0,0,(4278190080&t.id)>>24,(16711680&t.id)>>16,(65280&t.id)>>8,255&t.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==t.type&&(i[i.length-1]=0),e(S.trex,i)},F=function(e,t){var i=0,n=0,r=0,a=0;return e.length&&(void 0!==e[0].duration&&(i=1),void 0!==e[0].size&&(n=2),void 0!==e[0].flags&&(r=4),void 0!==e[0].compositionTimeOffset&&(a=8)),[0,0,i|n|r|a,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},j=function(t,i){var n,r,a,s;for(i+=20+16*(r=t.samples||[]).length,n=F(r,i),s=0;s<r.length;s++)a=r[s],n=n.concat([(4278190080&a.duration)>>>24,(16711680&a.duration)>>>16,(65280&a.duration)>>>8,255&a.duration,(4278190080&a.size)>>>24,(16711680&a.size)>>>16,(65280&a.size)>>>8,255&a.size,a.flags.isLeading<<2|a.flags.dependsOn,a.flags.isDependedOn<<6|a.flags.hasRedundancy<<4|a.flags.paddingValue<<1|a.flags.isNonSyncSample,61440&a.flags.degradationPriority,15&a.flags.degradationPriority,(4278190080&a.compositionTimeOffset)>>>24,(16711680&a.compositionTimeOffset)>>>16,(65280&a.compositionTimeOffset)>>>8,255&a.compositionTimeOffset]);return e(S.trun,new Uint8Array(n))},N=function(t,i){var n,r,a,s;for(i+=20+8*(r=t.samples||[]).length,n=F(r,i),s=0;s<r.length;s++)a=r[s],n=n.concat([(4278190080&a.duration)>>>24,(16711680&a.duration)>>>16,(65280&a.duration)>>>8,255&a.duration,(4278190080&a.size)>>>24,(16711680&a.size)>>>16,(65280&a.size)>>>8,255&a.size]);return e(S.trun,new Uint8Array(n))},T=function(e,t){return"audio"===e.type?N(e,t):j(e,t)};var H,q,z,W,G,X={ftyp:r=function(){return e(S.ftyp,k,w,k,C)},mdat:function(t){return e(S.mdat,t)},moof:o,moov:u,initSegment:function(e){var t,i=r(),n=u(e);return(t=new Uint8Array(i.byteLength+n.byteLength)).set(i),t.set(n,i.byteLength),t}},Y=function(e){return e>>>0};H=function(e,t){var i,n,r,a,s,o=[];if(!t.length)return null;for(i=0;i<e.byteLength;)n=Y(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3]),r=q(e.subarray(i+4,i+8)),a=n>1?i+n:e.byteLength,r===t[0]&&(1===t.length?o.push(e.subarray(i+8,a)):(s=H(e.subarray(i+8,a),t.slice(1))).length&&(o=o.concat(s))),i=a;return o},z=function(e){return H(e,["moov","trak"]).reduce((function(e,t){var i,n,r,a,s;return(i=H(t,["tkhd"])[0])?(n=i[0],a=Y(i[r=0===n?12:20]<<24|i[r+1]<<16|i[r+2]<<8|i[r+3]),(s=H(t,["mdia","mdhd"])[0])?(r=0===(n=s[0])?12:20,e[a]=Y(s[r]<<24|s[r+1]<<16|s[r+2]<<8|s[r+3]),e):null):null}),{})},W=function(e,t){var i,n,r;return i=H(t,["moof","traf"]),n=[].concat.apply([],i.map((function(t){return H(t,["tfhd"]).map((function(i){var n,r,a;return n=Y(i[4]<<24|i[5]<<16|i[6]<<8|i[7]),r=e[n]||9e4,a=H(t,["tfdt"]).map((function(e){var t,i;return t=e[0],i=Y(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),1===t&&(i*=Math.pow(2,32),i+=Y(e[8]<<24|e[9]<<16|e[10]<<8|e[11])),i}))[0],(a=a||1/0)/r}))}))),r=Math.min.apply(null,n),isFinite(r)?r:0},G=function(e){var t=H(e,["moov","trak"]),i=[];return t.forEach((function(e){var t=H(e,["mdia","hdlr"]),n=H(e,["tkhd"]);t.forEach((function(e,t){var r,a,s=q(e.subarray(8,12)),o=n[t];"vide"===s&&(a=0===(r=new DataView(o.buffer,o.byteOffset,o.byteLength)).getUint8(0)?r.getUint32(12):r.getUint32(20),i.push(a))}))})),i};var $={findBox:H,parseType:q=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),t+=String.fromCharCode(e[2]),t+=String.fromCharCode(e[3])},timescale:z,startTime:W,videoTrackIds:G},K=function(){this.init=function(){var e={};this.on=function(t,i){e[t]||(e[t]=[]),e[t]=e[t].concat(i)},this.off=function(t,i){var n;return!!e[t]&&(n=e[t].indexOf(i),e[t]=e[t].slice(),e[t].splice(n,1),n>-1)},this.trigger=function(t){var i,n,r,a;if(i=e[t])if(2===arguments.length)for(r=i.length,n=0;n<r;++n)i[n].call(this,arguments[1]);else{for(a=[],n=arguments.length,n=1;n<arguments.length;++n)a.push(arguments[n]);for(r=i.length,n=0;n<r;++n)i[n].apply(this,a)}},this.dispose=function(){e={}}}};K.prototype.pipe=function(e){return this.on("data",(function(t){e.push(t)})),this.on("done",(function(t){e.flush(t)})),e},K.prototype.push=function(e){this.trigger("data",e)},K.prototype.flush=function(e){this.trigger("done",e)};var Q,J,Z,ee,te,ie,ne,re=K,ae=function(e,t){var i={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return i.dataOffset=t,i.compositionTimeOffset=e.pts-e.dts,i.duration=e.duration,i.size=4*e.length,i.size+=e.byteLength,e.keyFrame&&(i.flags.dependsOn=2,i.flags.isNonSyncSample=0),i},se=function(e){var t,i,n=[],r=[];for(n.byteLength=0,t=0;t<e.length;t++)"access_unit_delimiter_rbsp"===(i=e[t]).nalUnitType?(n.length&&(n.duration=i.dts-n.dts,r.push(n)),(n=[i]).byteLength=i.data.byteLength,n.pts=i.pts,n.dts=i.dts):("slice_layer_without_partitioning_rbsp_idr"===i.nalUnitType&&(n.keyFrame=!0),n.duration=i.dts-n.dts,n.byteLength+=i.data.byteLength,n.push(i));return r.length&&(!n.duration||n.duration<=0)&&(n.duration=r[r.length-1].duration),r.push(n),r},oe=function(e){var t,i,n=[],r=[];for(n.byteLength=0,n.nalCount=0,n.duration=0,n.pts=e[0].pts,n.dts=e[0].dts,r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=e[0].pts,r.dts=e[0].dts,t=0;t<e.length;t++)(i=e[t]).keyFrame?(n.length&&(r.push(n),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration),(n=[i]).nalCount=i.length,n.byteLength=i.byteLength,n.pts=i.pts,n.dts=i.dts,n.duration=i.duration):(n.duration+=i.duration,n.nalCount+=i.length,n.byteLength+=i.byteLength,n.push(i));return r.length&&n.duration<=0&&(n.duration=r[r.length-1].duration),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration,r.push(n),r},ue=function(e){var t;return!e[0][0].keyFrame&&e.length>1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},le=function(e,t){var i,n,r,a,s,o=t||0,u=[];for(i=0;i<e.length;i++)for(a=e[i],n=0;n<a.length;n++)s=a[n],o+=(r=ae(s,o)).size,u.push(r);return u},ce=function(e){var t,i,n,r,a,s,o=0,u=e.byteLength,l=e.nalCount,c=new Uint8Array(u+4*l),h=new DataView(c.buffer);for(t=0;t<e.length;t++)for(r=e[t],i=0;i<r.length;i++)for(a=r[i],n=0;n<a.length;n++)s=a[n],h.setUint32(o,s.data.byteLength),o+=4,c.set(s.data,o),o+=s.data.byteLength;return c},he=[33,16,5,32,164,27],de=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],pe=function(e){for(var t=[];e--;)t.push(0);return t},fe={96e3:[he,[227,64],pe(154),[56]],88200:[he,[231],pe(170),[56]],64e3:[he,[248,192],pe(240),[56]],48e3:[he,[255,192],pe(268),[55,148,128],pe(54),[112]],44100:[he,[255,192],pe(268),[55,163,128],pe(84),[112]],32e3:[he,[255,192],pe(268),[55,234],pe(226),[112]],24e3:[he,[255,192],pe(268),[55,255,128],pe(268),[111,112],pe(126),[224]],16e3:[he,[255,192],pe(268),[55,255,128],pe(268),[111,255],pe(269),[223,108],pe(195),[1,192]],12e3:[de,pe(268),[3,127,248],pe(268),[6,255,240],pe(268),[13,255,224],pe(268),[27,253,128],pe(259),[56]],11025:[de,pe(268),[3,127,248],pe(268),[6,255,240],pe(268),[13,255,224],pe(268),[27,255,192],pe(268),[55,175,128],pe(108),[112]],8e3:[de,pe(268),[3,121,16],pe(47),[7]]},me=(Q=fe,Object.keys(Q).reduce((function(e,t){return e[t]=new Uint8Array(Q[t].reduce((function(e,t){return e.concat(t)}),[])),e}),{}));ie=function(e,t){return J(te(e,t))},ne=function(e,t){return Z(ee(e),t)};J=function(e){return 9e4*e},Z=function(e,t){return e*t},ee=function(e){return e/9e4},te=function(e,t){return e/t};var ge=ie,ye=ne,ve=function(e,t,i,n){var r,a,s,o,u=0,l=0,c=0;if(t.length&&(r=ge(e.baseMediaDecodeTime,e.samplerate),a=Math.ceil(9e4/(e.samplerate/1024)),i&&n&&(u=r-Math.max(i,n),c=(l=Math.floor(u/a))*a),!(l<1||c>45e3))){for((s=me[e.samplerate])||(s=t[0].data),o=0;o<l;o++)t.splice(o,0,{data:s});e.baseMediaDecodeTime-=Math.floor(ye(c,e.samplerate))}},_e=function(e,t,i){return t.minSegmentDts>=i?e:(t.minSegmentDts=1/0,e.filter((function(e){return e.dts>=i&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)})))},be=function(e){var t,i,n=[];for(t=0;t<e.length;t++)i=e[t],n.push({size:i.data.byteLength,duration:1024});return n},Te=function(e){var t,i,n=0,r=new Uint8Array(function(e){var t,i=0;for(t=0;t<e.length;t++)i+=e[t].data.byteLength;return i}(e));for(t=0;t<e.length;t++)i=e[t],r.set(i.data,n),n+=i.data.byteLength;return r},Se=function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},ke=function(e,t){var i,n=e.minSegmentDts;return t||(n-=e.timelineStartInfo.dts),i=e.timelineStartInfo.baseMediaDecodeTime,i+=n,i=Math.max(0,i),"audio"===e.type&&(i*=e.samplerate/9e4,i=Math.floor(i)),i},we=function(e,t){"number"==typeof t.pts&&(void 0===e.timelineStartInfo.pts&&(e.timelineStartInfo.pts=t.pts),void 0===e.minSegmentPts?e.minSegmentPts=t.pts:e.minSegmentPts=Math.min(e.minSegmentPts,t.pts),void 0===e.maxSegmentPts?e.maxSegmentPts=t.pts:e.maxSegmentPts=Math.max(e.maxSegmentPts,t.pts)),"number"==typeof t.dts&&(void 0===e.timelineStartInfo.dts&&(e.timelineStartInfo.dts=t.dts),void 0===e.minSegmentDts?e.minSegmentDts=t.dts:e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),void 0===e.maxSegmentDts?e.maxSegmentDts=t.dts:e.maxSegmentDts=Math.max(e.maxSegmentDts,t.dts))},Ce=function(e){for(var t=0,i={payloadType:-1,payloadSize:0},n=0,r=0;t<e.byteLength&&128!==e[t];){for(;255===e[t];)n+=255,t++;for(n+=e[t++];255===e[t];)r+=255,t++;if(r+=e[t++],!i.payload&&4===n){i.payloadType=n,i.payloadSize=r,i.payload=e.subarray(t,t+r);break}t+=r,n=0,r=0}return i},Ee=function(e){return 181!==e.payload[0]||49!=(e.payload[1]<<8|e.payload[2])||"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])||3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)},Ae=function(e,t){var i,n,r,a,s=[];if(!(64&t[0]))return s;for(n=31&t[0],i=0;i<n;i++)a={type:3&t[(r=3*i)+2],pts:e},4&t[r+2]&&(a.ccData=t[r+3]<<8|t[r+4],s.push(a));return s},Le=function(e){for(var t,i,n=e.byteLength,r=[],a=1;a<n-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(r.push(a+2),a+=2):a++;if(0===r.length)return e;t=n-r.length,i=new Uint8Array(t);var s=0;for(a=0;a<t;s++,a++)s===r[0]&&(s++,r.shift()),i[a]=e[s];return i},Pe=4,xe=function e(){e.prototype.init.call(this),this.captionPackets_=[],this.ccStreams_=[new Me(0,0),new Me(0,1),new Me(1,0),new Me(1,1)],this.reset(),this.ccStreams_.forEach((function(e){e.on("data",this.trigger.bind(this,"data")),e.on("done",this.trigger.bind(this,"done"))}),this)};(xe.prototype=new re).push=function(e){var t,i,n;if("sei_rbsp"===e.nalUnitType&&(t=Ce(e.escapedRBSP)).payloadType===Pe&&(i=Ee(t)))if(e.dts<this.latestDts_)this.ignoreNextEqualDts_=!0;else{if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));n=Ae(e.pts,i),this.captionPackets_=this.captionPackets_.concat(n),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts}},xe.prototype.flush=function(){this.captionPackets_.length?(this.captionPackets_.forEach((function(e,t){e.presortIndex=t})),this.captionPackets_.sort((function(e,t){return e.pts===t.pts?e.presortIndex-t.presortIndex:e.pts-t.pts})),this.captionPackets_.forEach((function(e){e.type<2&&this.dispatchCea608Packet(e)}),this),this.captionPackets_.length=0,this.ccStreams_.forEach((function(e){e.flush()}),this)):this.ccStreams_.forEach((function(e){e.flush()}),this)},xe.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach((function(e){e.reset()}))},xe.prototype.dispatchCea608Packet=function(e){this.setsChannel1Active(e)?this.activeCea608Channel_[e.type]=0:this.setsChannel2Active(e)&&(this.activeCea608Channel_[e.type]=1),null!==this.activeCea608Channel_[e.type]&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},xe.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)},xe.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)};var Ue={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},Ie=function(e){return null===e?"":(e=Ue[e]||e,String.fromCharCode(e))},De=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Re=function(){for(var e=[],t=15;t--;)e.push("");return e},Me=function e(t,i){e.prototype.init.call(this),this.field_=t||0,this.dataChannel_=i||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,i,n,r,a;if((t=32639&e.ccData)!==this.lastControlCode_){if(4096==(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),n=t>>>8,r=255&t,t!==this.PADDING_)if(t===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(t===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),i=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=i,this.startPts_=e.pts;else if(t===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(t===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);else if(t===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(t===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(t===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=Re();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Re();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=Re()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(n,r))a=Ie((n=(3&n)<<8)|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isExtCharacter(n,r))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),a=Ie((n=(3&n)<<8)|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isMidRowCode(n,r))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14==(14&r)&&this.addFormatting(e.pts,["i"]),1==(1&r)&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(n,r))this.column_+=3&r;else if(this.isPAC(n,r)){var s=De.indexOf(7968&t);"rollUp"===this.mode_&&(s-this.rollUpRows_+1<0&&(s=this.rollUpRows_-1),this.setRollUp(e.pts,s)),s!==this.row_&&(this.clearFormatting(e.pts),this.row_=s),1&r&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16==(16&t)&&(this.column_=4*((14&t)>>1)),this.isColorPAC(r)&&14==(14&r)&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(n)&&(0===r&&(r=null),a=Ie(n),a+=Ie(r),this[this.mode_](e.pts,a),this.column_+=a.length)}else this.lastControlCode_=null}};Me.prototype=new re,Me.prototype.flushDisplayed=function(e){var t=this.displayed_.map((function(e){try{return e.trim()}catch(e){return Oe.error("Skipping malformed caption."),""}})).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})},Me.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Re(),this.nonDisplayed_=Re(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},Me.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},Me.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},Me.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},Me.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},Me.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},Me.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127},Me.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},Me.prototype.isNormalChar=function(e){return e>=32&&e<=127},Me.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=Re(),this.displayed_=Re()),void 0!==t&&t!==this.row_)for(var i=0;i<this.rollUpRows_;i++)this.displayed_[t-i]=this.displayed_[this.row_-i],this.displayed_[this.row_-i]="";void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},Me.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);var i=t.reduce((function(e,t){return e+"<"+t+">"}),"");this[this.mode_](e,i)},Me.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce((function(e,t){return e+"</"+t+">"}),"");this.formatting_=[],this[this.mode_](e,t)}},Me.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_];i+=t,this.nonDisplayed_[this.row_]=i},Me.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_];i+=t,this.displayed_[this.row_]=i},Me.prototype.shiftRowsUp_=function(){var e;for(e=0;e<this.topRow_;e++)this.displayed_[e]="";for(e=this.row_+1;e<15;e++)this.displayed_[e]="";for(e=this.topRow_;e<this.row_;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[this.row_]=""},Me.prototype.paintOn=function(e,t){var i=this.displayed_[this.row_];i+=t,this.displayed_[this.row_]=i};var Be={CaptionStream:xe,Cea608Stream:Me},Ne={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},je=function(e,t){var i=1;for(e>t&&(i=-1);Math.abs(t-e)>4294967296;)e+=8589934592*i;return e},Fe=function e(t){var i,n;e.prototype.init.call(this),this.type_=t,this.push=function(e){e.type===this.type_&&(void 0===n&&(n=e.dts),e.dts=je(e.dts,n),e.pts=je(e.pts,n),i=e.dts,this.trigger("data",e))},this.flush=function(){n=i,this.trigger("done")},this.discontinuity=function(){n=void 0,i=void 0}};Fe.prototype=new re;var Ve,He=Fe,qe=function(e,t,i){var n,r="";for(n=t;n<i;n++)r+="%"+("00"+e[n].toString(16)).slice(-2);return r},ze=function(e,t,i){return decodeURIComponent(qe(e,t,i))},We=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},Ge={TXXX:function(e){var t;if(3===e.data[0]){for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=ze(e.data,1,t),e.value=ze(e.data,t+1,e.data.length).replace(/\0*$/,"");break}e.data=e.value}},WXXX:function(e){var t;if(3===e.data[0])for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=ze(e.data,1,t),e.url=ze(e.data,t+1,e.data.length);break}},PRIV:function(e){var t,i;for(t=0;t<e.data.length;t++)if(0===e.data[t]){e.owner=(i=e.data,unescape(qe(i,0,t)));break}e.privateData=e.data.subarray(t+1),e.data=e.privateData}};Ve=function(e){var t,i={debug:!(!e||!e.debug),descriptor:e&&e.descriptor},n=0,r=[],a=0;if(Ve.prototype.init.call(this),this.dispatchType=Ne.METADATA_STREAM_TYPE.toString(16),i.descriptor)for(t=0;t<i.descriptor.length;t++)this.dispatchType+=("00"+i.descriptor[t].toString(16)).slice(-2);this.push=function(e){var t,s,o,u,l;if("timed-metadata"===e.type)if(e.dataAlignmentIndicator&&(a=0,r.length=0),0===r.length&&(e.data.length<10||e.data[0]!=="I".charCodeAt(0)||e.data[1]!=="D".charCodeAt(0)||e.data[2]!=="3".charCodeAt(0)))i.debug&&Oe.log("Skipping unrecognized metadata packet");else if(r.push(e),a+=e.data.byteLength,1===r.length&&(n=We(e.data.subarray(6,10)),n+=10),!(a<n)){for(t={data:new Uint8Array(n),frames:[],pts:r[0].pts,dts:r[0].dts},l=0;l<n;)t.data.set(r[0].data.subarray(0,n-l),l),l+=r[0].data.byteLength,a-=r[0].data.byteLength,r.shift();s=10,64&t.data[5]&&(s+=4,s+=We(t.data.subarray(10,14)),n-=We(t.data.subarray(16,20)));do{if((o=We(t.data.subarray(s+4,s+8)))<1)return Oe.log("Malformed ID3 frame encountered. Skipping metadata parsing.");if((u={id:String.fromCharCode(t.data[s],t.data[s+1],t.data[s+2],t.data[s+3]),data:t.data.subarray(s+10,s+o+10)}).key=u.id,Ge[u.id]&&(Ge[u.id](u),"com.apple.streaming.transportStreamTimestamp"===u.owner)){var c=u.data,h=(1&c[3])<<30|c[4]<<22|c[5]<<14|c[6]<<6|c[7]>>>2;h*=4,h+=3&c[7],u.timeStamp=h,void 0===t.pts&&void 0===t.dts&&(t.pts=u.timeStamp,t.dts=u.timeStamp),this.trigger("timestamp",u)}t.frames.push(u),s+=10,s+=o}while(s<n);this.trigger("data",t)}}},Ve.prototype=new re;var Xe,Ye,$e,Ke=Ve,Qe=He,Je=188;(Xe=function(){var e=new Uint8Array(Je),t=0;Xe.prototype.init.call(this),this.push=function(i){var n,r=0,a=Je;for(t?((n=new Uint8Array(i.byteLength+t)).set(e.subarray(0,t)),n.set(i,t),t=0):n=i;a<n.byteLength;)71!==n[r]||71!==n[a]?(r++,a++):(this.trigger("data",n.subarray(r,a)),r+=Je,a+=Je);r<n.byteLength&&(e.set(n.subarray(r),0),t=n.byteLength-r)},this.flush=function(){t===Je&&71===e[0]&&(this.trigger("data",e),t=0),this.trigger("done")}}).prototype=new re,Ye=function(){var e,t,i,n;Ye.prototype.init.call(this),n=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,n){var r=0;n.payloadUnitStartIndicator&&(r+=e[r]+1),"pat"===n.type?t(e.subarray(r),n):i(e.subarray(r),n)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],n.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=n.pmtPid},i=function(e,t){var i,r;if(1&e[5]){for(n.programMapTable={video:null,audio:null,"timed-metadata":{}},i=3+((15&e[1])<<8|e[2])-4,r=12+((15&e[10])<<8|e[11]);r<i;){var a=e[r],s=(31&e[r+1])<<8|e[r+2];a===Ne.H264_STREAM_TYPE&&null===n.programMapTable.video?n.programMapTable.video=s:a===Ne.ADTS_STREAM_TYPE&&null===n.programMapTable.audio?n.programMapTable.audio=s:a===Ne.METADATA_STREAM_TYPE&&(n.programMapTable["timed-metadata"][s]=a),r+=5+((15&e[r+3])<<8|e[r+4])}t.programMapTable=n.programMapTable}},this.push=function(t){var i={},n=4;if(i.payloadUnitStartIndicator=!!(64&t[1]),i.pid=31&t[1],i.pid<<=8,i.pid|=t[2],(48&t[3])>>>4>1&&(n+=t[n]+1),0===i.pid)i.type="pat",e(t.subarray(n),i),this.trigger("data",i);else if(i.pid===this.pmtPid)for(i.type="pmt",e(t.subarray(n),i),this.trigger("data",i);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,n,i]):this.processPes_(t,n,i)},this.processPes_=function(e,t,i){i.pid===this.programMapTable.video?i.streamType=Ne.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=Ne.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=e.subarray(t),this.trigger("data",i)}},Ye.prototype=new re,Ye.STREAM_TYPES={h264:27,adts:15},$e=function(){var e=this,t={data:[],size:0},i={data:[],size:0},n={data:[],size:0},r=function(t,i,n){var r,a,s=new Uint8Array(t.size),o={type:i},u=0,l=0;if(t.data.length&&!(t.size<9)){for(o.trackId=t.data[0].pid,u=0;u<t.data.length;u++)a=t.data[u],s.set(a.data,l),l+=a.data.byteLength;var c,h,d;c=s,(h=o).packetLength=6+(c[4]<<8|c[5]),h.dataAlignmentIndicator=0!=(4&c[6]),192&(d=c[7])&&(h.pts=(14&c[9])<<27|(255&c[10])<<20|(254&c[11])<<12|(255&c[12])<<5|(254&c[13])>>>3,h.pts*=4,h.pts+=(6&c[13])>>>1,h.dts=h.pts,64&d&&(h.dts=(14&c[14])<<27|(255&c[15])<<20|(254&c[16])<<12|(255&c[17])<<5|(254&c[18])>>>3,h.dts*=4,h.dts+=(6&c[18])>>>1)),h.data=c.subarray(9+c[8]),r="video"===i||o.packetLength<=t.size,(n||r)&&(t.size=0,t.data.length=0),r&&e.trigger("data",o)}};$e.prototype.init.call(this),this.push=function(a){({pat:function(){},pes:function(){var e,s;switch(a.streamType){case Ne.H264_STREAM_TYPE:case Ne.H264_STREAM_TYPE:e=t,s="video";break;case Ne.ADTS_STREAM_TYPE:e=i,s="audio";break;case Ne.METADATA_STREAM_TYPE:e=n,s="timed-metadata";break;default:return}a.payloadUnitStartIndicator&&r(e,s,!0),e.data.push(a),e.size+=a.data.byteLength},pmt:function(){var t={type:"metadata",tracks:[]},i=a.programMapTable;null!==i.video&&t.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+i.video,codec:"avc",type:"video"}),null!==i.audio&&t.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+i.audio,codec:"adts",type:"audio"}),e.trigger("data",t)}})[a.type]()},this.flush=function(){r(t,"video"),r(i,"audio"),r(n,"timed-metadata"),this.trigger("done")}},$e.prototype=new re;var Ze={PAT_PID:0,MP2T_PACKET_LENGTH:Je,TransportPacketStream:Xe,TransportParseStream:Ye,ElementaryStream:$e,TimestampRolloverStream:Qe,CaptionStream:Be.CaptionStream,Cea608Stream:Be.Cea608Stream,MetadataStream:Ke};for(var et in Ne)Ne.hasOwnProperty(et)&&(Ze[et]=Ne[et]);var tt,it=Ze,nt=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];tt=function(){var e;tt.prototype.init.call(this),this.push=function(t){var i,n,r,a,s,o,u=0,l=0;if("audio"===t.type)for(e?(a=e,(e=new Uint8Array(a.byteLength+t.data.byteLength)).set(a),e.set(t.data,a.byteLength)):e=t.data;u+5<e.length;)if(255===e[u]&&240==(246&e[u+1])){if(n=2*(1&~e[u+1]),i=(3&e[u+3])<<11|e[u+4]<<3|(224&e[u+5])>>5,o=9e4*(s=1024*(1+(3&e[u+6])))/nt[(60&e[u+2])>>>2],r=u+i,e.byteLength<r)return;if(this.trigger("data",{pts:t.pts+l*o,dts:t.dts+l*o,sampleCount:s,audioobjecttype:1+(e[u+2]>>>6&3),channelcount:(1&e[u+2])<<2|(192&e[u+3])>>>6,samplerate:nt[(60&e[u+2])>>>2],samplingfrequencyindex:(60&e[u+2])>>>2,samplesize:16,data:e.subarray(u+7+n,r)}),e.byteLength===r)return void(e=void 0);l++,e=e.subarray(r)}else u++},this.flush=function(){this.trigger("done")}},tt.prototype=new re;var rt,at,st,ot=tt,ut=function(e){var t=e.byteLength,i=0,n=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+n},this.loadWord=function(){var r=e.byteLength-t,a=new Uint8Array(4),s=Math.min(4,t);if(0===s)throw new Error("no bytes available");a.set(e.subarray(r,r+s)),i=new DataView(a.buffer).getUint32(0),n=8*s,t-=s},this.skipBits=function(e){var r;n>e?(i<<=e,n-=e):(e-=n,e-=8*(r=Math.floor(e/8)),t-=r,this.loadWord(),i<<=e,n-=e)},this.readBits=function(e){var r=Math.min(n,e),a=i>>>32-r;return(n-=r)>0?i<<=r:t>0&&this.loadWord(),(r=e-r)>0?a<<r|this.readBits(r):a},this.skipLeadingZeros=function(){var e;for(e=0;e<n;++e)if(0!=(i&2147483648>>>e))return i<<=e,n-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};at=function(){var e,t,i=0;at.prototype.init.call(this),this.push=function(n){var r;for(t?((r=new Uint8Array(t.byteLength+n.data.byteLength)).set(t),r.set(n.data,t.byteLength),t=r):t=n.data;i<t.byteLength-3;i++)if(1===t[i+2]){e=i+5;break}for(;e<t.byteLength;)switch(t[e]){case 0:if(0!==t[e-1]){e+=2;break}if(0!==t[e-2]){e++;break}i+3!==e-2&&this.trigger("data",t.subarray(i+3,e-2));do{e++}while(1!==t[e]&&e<t.length);i=e-2,e+=3;break;case 1:if(0!==t[e-1]||0!==t[e-2]){e+=3;break}this.trigger("data",t.subarray(i+3,e-2)),i=e-2,e+=3;break;default:e+=3}t=t.subarray(i),e-=i,i=0},this.flush=function(){t&&t.byteLength>3&&this.trigger("data",t.subarray(i+3)),t=null,i=0,this.trigger("done")}},at.prototype=new re,st={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},rt=function(){var e,t,i,n,r,a,s,o=new at;rt.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,i=e.pts,n=e.dts,o.push(e))},o.on("data",(function(s){var o={trackId:t,pts:i,dts:n,data:s};switch(31&s[0]){case 5:o.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:o.nalUnitType="sei_rbsp",o.escapedRBSP=r(s.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp",o.escapedRBSP=r(s.subarray(1)),o.config=a(o.escapedRBSP);break;case 8:o.nalUnitType="pic_parameter_set_rbsp";break;case 9:o.nalUnitType="access_unit_delimiter_rbsp"}e.trigger("data",o)})),o.on("done",(function(){e.trigger("done")})),this.flush=function(){o.flush()},s=function(e,t){var i,n=8,r=8;for(i=0;i<e;i++)0!==r&&(r=(n+t.readExpGolomb()+256)%256),n=0===r?n:r},r=function(e){for(var t,i,n=e.byteLength,r=[],a=1;a<n-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(r.push(a+2),a+=2):a++;if(0===r.length)return e;t=n-r.length,i=new Uint8Array(t);var s=0;for(a=0;a<t;s++,a++)s===r[0]&&(s++,r.shift()),i[a]=e[s];return i},a=function(e){var t,i,n,r,a,o,u,l,c,h,d,p,f,m=0,g=0,y=0,v=0,_=1;if(i=(t=new ut(e)).readUnsignedByte(),r=t.readUnsignedByte(),n=t.readUnsignedByte(),t.skipUnsignedExpGolomb(),st[i]&&(3===(a=t.readUnsignedExpGolomb())&&t.skipBits(1),t.skipUnsignedExpGolomb(),t.skipUnsignedExpGolomb(),t.skipBits(1),t.readBoolean()))for(d=3!==a?8:12,f=0;f<d;f++)t.readBoolean()&&s(f<6?16:64,t);if(t.skipUnsignedExpGolomb(),0===(o=t.readUnsignedExpGolomb()))t.readUnsignedExpGolomb();else if(1===o)for(t.skipBits(1),t.skipExpGolomb(),t.skipExpGolomb(),u=t.readUnsignedExpGolomb(),f=0;f<u;f++)t.skipExpGolomb();if(t.skipUnsignedExpGolomb(),t.skipBits(1),l=t.readUnsignedExpGolomb(),c=t.readUnsignedExpGolomb(),0===(h=t.readBits(1))&&t.skipBits(1),t.skipBits(1),t.readBoolean()&&(m=t.readUnsignedExpGolomb(),g=t.readUnsignedExpGolomb(),y=t.readUnsignedExpGolomb(),v=t.readUnsignedExpGolomb()),t.readBoolean()&&t.readBoolean()){switch(t.readUnsignedByte()){case 1:p=[1,1];break;case 2:p=[12,11];break;case 3:p=[10,11];break;case 4:p=[16,11];break;case 5:p=[40,33];break;case 6:p=[24,11];break;case 7:p=[20,11];break;case 8:p=[32,11];break;case 9:p=[80,33];break;case 10:p=[18,11];break;case 11:p=[15,11];break;case 12:p=[64,33];break;case 13:p=[160,99];break;case 14:p=[4,3];break;case 15:p=[3,2];break;case 16:p=[2,1];break;case 255:p=[t.readUnsignedByte()<<8|t.readUnsignedByte(),t.readUnsignedByte()<<8|t.readUnsignedByte()]}p&&(_=p[0]/p[1])}return{profileIdc:i,levelIdc:n,profileCompatibility:r,width:Math.ceil((16*(l+1)-2*m-2*g)*_),height:(2-h)*(c+1)*16-2*y-2*v}}},rt.prototype=new re;var lt,ct={H264Stream:rt,NalByteStream:at},ht=function(e){return e[0]==="I".charCodeAt(0)&&e[1]==="D".charCodeAt(0)&&e[2]==="3".charCodeAt(0)},dt=function(e,t){var i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(16&e[t+5])>>4?i+20:i+10},pt=function(e,t){var i=(224&e[t+5])>>5,n=e[t+4]<<3;return 6144&e[t+3]|n|i};(lt=function(){var e=new Uint8Array,t=0;lt.prototype.init.call(this),this.setTimestamp=function(e){t=e},this.push=function(i){var n,r,a,s,o=0,u=0;for(e.length?(s=e.length,(e=new Uint8Array(i.byteLength+s)).set(e.subarray(0,s)),e.set(i,s)):e=i;e.length-u>=3;)if(e[u]!=="I".charCodeAt(0)||e[u+1]!=="D".charCodeAt(0)||e[u+2]!=="3".charCodeAt(0))if(255!=(255&e[u])||240!=(240&e[u+1]))u++;else{if(e.length-u<7)break;if(u+(o=pt(e,u))>e.length)break;a={type:"audio",data:e.subarray(u,u+o),pts:t,dts:t},this.trigger("data",a),u+=o}else{if(e.length-u<10)break;if(u+(o=dt(e,u))>e.length)break;r={type:"timed-metadata",data:e.subarray(u,u+o)},this.trigger("data",r),u+=o}n=e.length-u,e=n>0?e.subarray(u):new Uint8Array}}).prototype=new re;var ft,mt,gt,yt,vt=lt,_t=ct.H264Stream,bt=ht,Tt=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],St=["width","height","profileIdc","levelIdc","profileCompatibility"],kt=function(e,t){var i;if(e.length!==t.length)return!1;for(i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0};mt=function(e,t){var i=[],n=0,r=0,a=0,s=1/0;t=t||{},mt.prototype.init.call(this),this.push=function(t){we(e,t),e&&Tt.forEach((function(i){e[i]=t[i]})),i.push(t)},this.setEarliestDts=function(t){r=t-e.timelineStartInfo.baseMediaDecodeTime},this.setVideoBaseMediaDecodeTime=function(e){s=e},this.setAudioAppendStart=function(e){a=e},this.flush=function(){var o,u,l,c;0!==i.length?(o=_e(i,e,r),e.baseMediaDecodeTime=ke(e,t.keepOriginalTimestamps),ve(e,o,a,s),e.samples=be(o),l=X.mdat(Te(o)),i=[],u=X.moof(n,[e]),c=new Uint8Array(u.byteLength+l.byteLength),n++,c.set(u),c.set(l,u.byteLength),Se(e),this.trigger("data",{track:e,boxes:c}),this.trigger("done","AudioSegmentStream")):this.trigger("done","AudioSegmentStream")}},mt.prototype=new re,ft=function(e,t){var i,n,r=0,a=[],s=[];t=t||{},ft.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){we(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||i||(i=t.config,e.sps=[t.data],St.forEach((function(t){e[t]=i[t]}),this)),"pic_parameter_set_rbsp"!==t.nalUnitType||n||(n=t.data,e.pps=[t.data]),a.push(t)},this.flush=function(){for(var i,n,o,u,l,c;a.length&&"access_unit_delimiter_rbsp"!==a[0].nalUnitType;)a.shift();if(0===a.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(i=se(a),(o=oe(i))[0][0].keyFrame||((n=this.getGopForFusion_(a[0],e))?(o.unshift(n),o.byteLength+=n.byteLength,o.nalCount+=n.nalCount,o.pts=n.pts,o.dts=n.dts,o.duration+=n.duration):o=ue(o)),s.length){var h;if(!(h=t.alignGopsAtEnd?this.alignGopsAtEnd_(o):this.alignGopsAtStart_(o)))return this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),a=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");Se(e),o=h}we(e,o),e.samples=le(o),l=X.mdat(ce(o)),e.baseMediaDecodeTime=ke(e,t.keepOriginalTimestamps),this.trigger("processedGopsInfo",o.map((function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}}))),this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),a=[],this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime),this.trigger("timelineStartInfo",e.timelineStartInfo),u=X.moof(r,[e]),c=new Uint8Array(u.byteLength+l.byteLength),r++,c.set(u),c.set(l,u.byteLength),this.trigger("data",{track:e,boxes:c}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.resetStream_=function(){Se(e),i=void 0,n=void 0},this.getGopForFusion_=function(t){var i,n,r,a,s,o=1/0;for(s=0;s<this.gopCache_.length;s++)r=(a=this.gopCache_[s]).gop,e.pps&&kt(e.pps[0],a.pps[0])&&e.sps&&kt(e.sps[0],a.sps[0])&&(r.dts<e.timelineStartInfo.dts||(i=t.dts-r.dts-r.duration)>=-1e4&&i<=45e3&&(!n||o>i)&&(n=a,o=i));return n?n.gop:null},this.alignGopsAtStart_=function(e){var t,i,n,r,a,o,u,l;for(a=e.byteLength,o=e.nalCount,u=e.duration,t=i=0;t<s.length&&i<e.length&&(n=s[t],r=e[i],n.pts!==r.pts);)r.pts>n.pts?t++:(i++,a-=r.byteLength,o-=r.nalCount,u-=r.duration);return 0===i?e:i===e.length?null:((l=e.slice(i)).byteLength=a,l.duration=u,l.nalCount=o,l.pts=l[0].pts,l.dts=l[0].dts,l)},this.alignGopsAtEnd_=function(e){var t,i,n,r,a,o,u;for(t=s.length-1,i=e.length-1,a=null,o=!1;t>=0&&i>=0;){if(n=s[t],r=e[i],n.pts===r.pts){o=!0;break}n.pts>r.pts?t--:(t===s.length-1&&(a=i),i--)}if(!o&&null===a)return null;if(0===(u=o?i:a))return e;var l=e.slice(u),c=l.reduce((function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e}),{byteLength:0,duration:0,nalCount:0});return l.byteLength=c.byteLength,l.duration=c.duration,l.nalCount=c.nalCount,l.pts=l[0].pts,l.dts=l[0].dts,l},this.alignGopsWith=function(e){s=e}},ft.prototype=new re,yt=function(e,t){this.numberOfTracks=0,this.metadataStream=t,void 0!==(e=e||{}).remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"==typeof e.keepOriginalTimestamps&&(this.keepOriginalTimestamps=e.keepOriginalTimestamps),this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,yt.prototype.init.call(this),this.push=function(e){return e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBoxes.push(e.boxes),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track),void("audio"===e.track.type&&(this.audioTrack=e.track)))}},yt.prototype=new re,yt.prototype.flush=function(e){var t,i,n,r,a=0,s={captions:[],captionStreams:{},metadata:[],info:{}},o=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==e&&"AudioSegmentStream"!==e)return;if(this.remuxTracks)return;if(0===this.pendingTracks.length)return this.emittedTracks++,void(this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}for(this.videoTrack?(o=this.videoTrack.timelineStartInfo.pts,St.forEach((function(e){s.info[e]=this.videoTrack[e]}),this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,Tt.forEach((function(e){s.info[e]=this.audioTrack[e]}),this)),1===this.pendingTracks.length?s.type=this.pendingTracks[0].type:s.type="combined",this.emittedTracks+=this.pendingTracks.length,n=X.initSegment(this.pendingTracks),s.initSegment=new Uint8Array(n.byteLength),s.initSegment.set(n),s.data=new Uint8Array(this.pendingBytes),r=0;r<this.pendingBoxes.length;r++)s.data.set(this.pendingBoxes[r],a),a+=this.pendingBoxes[r].byteLength;for(r=0;r<this.pendingCaptions.length;r++)(t=this.pendingCaptions[r]).startTime=t.startPts,this.keepOriginalTimestamps||(t.startTime-=o),t.startTime/=9e4,t.endTime=t.endPts,this.keepOriginalTimestamps||(t.endTime-=o),t.endTime/=9e4,s.captionStreams[t.stream]=!0,s.captions.push(t);for(r=0;r<this.pendingMetadata.length;r++)(i=this.pendingMetadata[r]).cueTime=i.pts,this.keepOriginalTimestamps||(i.cueTime-=o),i.cueTime/=9e4,s.metadata.push(i);s.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",s),this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},gt=function(e){var t,i,n=this,r=!0;gt.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var t={};this.transmuxPipeline_=t,t.type="aac",t.metadataStream=new it.MetadataStream,t.aacStream=new vt,t.audioTimestampRolloverStream=new it.TimestampRolloverStream("audio"),t.timedMetadataTimestampRolloverStream=new it.TimestampRolloverStream("timed-metadata"),t.adtsStream=new ot,t.coalesceStream=new yt(e,t.metadataStream),t.headOfPipeline=t.aacStream,t.aacStream.pipe(t.audioTimestampRolloverStream).pipe(t.adtsStream),t.aacStream.pipe(t.timedMetadataTimestampRolloverStream).pipe(t.metadataStream).pipe(t.coalesceStream),t.metadataStream.on("timestamp",(function(e){t.aacStream.setTimestamp(e.timeStamp)})),t.aacStream.on("data",(function(r){"timed-metadata"!==r.type||t.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:n.baseMediaDecodeTime},codec:"adts",type:"audio"},t.coalesceStream.numberOfTracks++,t.audioSegmentStream=new mt(i,e),t.adtsStream.pipe(t.audioSegmentStream).pipe(t.coalesceStream))})),t.coalesceStream.on("data",this.trigger.bind(this,"data")),t.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setupTsPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="ts",r.metadataStream=new it.MetadataStream,r.packetStream=new it.TransportPacketStream,r.parseStream=new it.TransportParseStream,r.elementaryStream=new it.ElementaryStream,r.videoTimestampRolloverStream=new it.TimestampRolloverStream("video"),r.audioTimestampRolloverStream=new it.TimestampRolloverStream("audio"),r.timedMetadataTimestampRolloverStream=new it.TimestampRolloverStream("timed-metadata"),r.adtsStream=new ot,r.h264Stream=new _t,r.captionStream=new it.CaptionStream,r.coalesceStream=new yt(e,r.metadataStream),r.headOfPipeline=r.packetStream,r.packetStream.pipe(r.parseStream).pipe(r.elementaryStream),r.elementaryStream.pipe(r.videoTimestampRolloverStream).pipe(r.h264Stream),r.elementaryStream.pipe(r.audioTimestampRolloverStream).pipe(r.adtsStream),r.elementaryStream.pipe(r.timedMetadataTimestampRolloverStream).pipe(r.metadataStream).pipe(r.coalesceStream),r.h264Stream.pipe(r.captionStream).pipe(r.coalesceStream),r.elementaryStream.on("data",(function(a){var s;if("metadata"===a.type){for(s=a.tracks.length;s--;)t||"video"!==a.tracks[s].type?i||"audio"!==a.tracks[s].type||((i=a.tracks[s]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime):(t=a.tracks[s]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime;t&&!r.videoSegmentStream&&(r.coalesceStream.numberOfTracks++,r.videoSegmentStream=new ft(t,e),r.videoSegmentStream.on("timelineStartInfo",(function(e){i&&(i.timelineStartInfo=e,r.audioSegmentStream.setEarliestDts(e.dts))})),r.videoSegmentStream.on("processedGopsInfo",n.trigger.bind(n,"gopInfo")),r.videoSegmentStream.on("baseMediaDecodeTime",(function(e){i&&r.audioSegmentStream.setVideoBaseMediaDecodeTime(e)})),r.h264Stream.pipe(r.videoSegmentStream).pipe(r.coalesceStream)),i&&!r.audioSegmentStream&&(r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new mt(i,e),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream))}})),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setBaseMediaDecodeTime=function(n){var r=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=n),i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,Se(i),e.keepOriginalTimestamps||(i.timelineStartInfo.baseMediaDecodeTime=n),r.audioTimestampRolloverStream&&r.audioTimestampRolloverStream.discontinuity()),t&&(r.videoSegmentStream&&(r.videoSegmentStream.gopCache_=[],r.videoTimestampRolloverStream.discontinuity()),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,Se(t),r.captionStream.reset(),e.keepOriginalTimestamps||(t.timelineStartInfo.baseMediaDecodeTime=n)),r.timedMetadataTimestampRolloverStream&&r.timedMetadataTimestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.push=function(e){if(r){var t=bt(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),r=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){r=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},gt.prototype=new re;var wt,Ct,Et={Transmuxer:gt,VideoSegmentStream:ft,AudioSegmentStream:mt,AUDIO_PROPERTIES:Tt,VIDEO_PROPERTIES:St},At=$.parseType,Lt=function(e){return new Date(1e3*e-20828448e5)},Ot=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},Pt=function(e){var t,i,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=[];for(t=0;t+4<e.length;t+=i)if(i=n.getUint32(t),t+=4,i<=0)r.push("<span style='color:red;'>MALFORMED DATA</span>");else switch(31&e[t]){case 1:r.push("slice_layer_without_partitioning_rbsp");break;case 5:r.push("slice_layer_without_partitioning_rbsp_idr");break;case 6:r.push("sei_rbsp");break;case 7:r.push("seq_parameter_set_rbsp");break;case 8:r.push("pic_parameter_set_rbsp");break;case 9:r.push("access_unit_delimiter_rbsp");break;default:r.push("UNKNOWN NAL - "+e[t]&31)}return r},xt={avc1:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{dataReferenceIndex:t.getUint16(6),width:t.getUint16(24),height:t.getUint16(26),horizresolution:t.getUint16(28)+t.getUint16(30)/16,vertresolution:t.getUint16(32)+t.getUint16(34)/16,frameCount:t.getUint16(40),depth:t.getUint16(74),config:wt(e.subarray(78,e.byteLength))}},avcC:function(e){var t,i,n,r,a=new DataView(e.buffer,e.byteOffset,e.byteLength),s={configurationVersion:e[0],avcProfileIndication:e[1],profileCompatibility:e[2],avcLevelIndication:e[3],lengthSizeMinusOne:3&e[4],sps:[],pps:[]},o=31&e[5];for(n=6,r=0;r<o;r++)i=a.getUint16(n),n+=2,s.sps.push(new Uint8Array(e.subarray(n,n+i))),n+=i;for(t=e[n],n++,r=0;r<t;r++)i=a.getUint16(n),n+=2,s.pps.push(new Uint8Array(e.subarray(n,n+i))),n+=i;return s},btrt:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{bufferSizeDB:t.getUint32(0),maxBitrate:t.getUint32(4),avgBitrate:t.getUint32(8)}},esds:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),esId:e[6]<<8|e[7],streamPriority:31&e[8],decoderConfig:{objectProfileIndication:e[11],streamType:e[12]>>>2&63,bufferSize:e[13]<<16|e[14]<<8|e[15],maxBitrate:e[16]<<24|e[17]<<16|e[18]<<8|e[19],avgBitrate:e[20]<<24|e[21]<<16|e[22]<<8|e[23],decoderConfigDescriptor:{tag:e[24],length:e[25],audioObjectType:e[26]>>>3&31,samplingFrequencyIndex:(7&e[26])<<1|e[27]>>>7&1,channelConfiguration:e[27]>>>3&15}}}},ftyp:function(e){for(var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={majorBrand:At(e.subarray(0,4)),minorVersion:t.getUint32(4),compatibleBrands:[]},n=8;n<e.byteLength;)i.compatibleBrands.push(At(e.subarray(n,n+4))),n+=4;return i},dinf:function(e){return{boxes:wt(e)}},dref:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),dataReferences:wt(e.subarray(8))}},hdlr:function(e){var t={version:new DataView(e.buffer,e.byteOffset,e.byteLength).getUint8(0),flags:new Uint8Array(e.subarray(1,4)),handlerType:At(e.subarray(8,12)),name:""},i=8;for(i=24;i<e.byteLength;i++){if(0===e[i]){i++;break}t.name+=String.fromCharCode(e[i])}return t.name=decodeURIComponent(escape(t.name)),t},mdat:function(e){return{byteLength:e.byteLength,nals:Pt(e)}},mdhd:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n=4,r={version:i.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),language:""};return 1===r.version?(n+=4,r.creationTime=Lt(i.getUint32(n)),n+=8,r.modificationTime=Lt(i.getUint32(n)),n+=4,r.timescale=i.getUint32(n),n+=8,r.duration=i.getUint32(n)):(r.creationTime=Lt(i.getUint32(n)),n+=4,r.modificationTime=Lt(i.getUint32(n)),n+=4,r.timescale=i.getUint32(n),n+=4,r.duration=i.getUint32(n)),n+=4,t=i.getUint16(n),r.language+=String.fromCharCode(96+(t>>10)),r.language+=String.fromCharCode(96+((992&t)>>5)),r.language+=String.fromCharCode(96+(31&t)),r},mdia:function(e){return{boxes:wt(e)}},mfhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sequenceNumber:e[4]<<24|e[5]<<16|e[6]<<8|e[7]}},minf:function(e){return{boxes:wt(e)}},mp4a:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={dataReferenceIndex:t.getUint16(6),channelcount:t.getUint16(16),samplesize:t.getUint16(18),samplerate:t.getUint16(24)+t.getUint16(26)/65536};return e.byteLength>28&&(i.streamDescriptor=wt(e.subarray(28))[0]),i},moof:function(e){return{boxes:wt(e)}},moov:function(e){return{boxes:wt(e)}},mvex:function(e){return{boxes:wt(e)}},mvhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i=4,n={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4))};return 1===n.version?(i+=4,n.creationTime=Lt(t.getUint32(i)),i+=8,n.modificationTime=Lt(t.getUint32(i)),i+=4,n.timescale=t.getUint32(i),i+=8,n.duration=t.getUint32(i)):(n.creationTime=Lt(t.getUint32(i)),i+=4,n.modificationTime=Lt(t.getUint32(i)),i+=4,n.timescale=t.getUint32(i),i+=4,n.duration=t.getUint32(i)),i+=4,n.rate=t.getUint16(i)+t.getUint16(i+2)/16,i+=4,n.volume=t.getUint8(i)+t.getUint8(i+1)/8,i+=2,i+=2,i+=8,n.matrix=new Uint32Array(e.subarray(i,i+36)),i+=36,i+=24,n.nextTrackId=t.getUint32(i),n},pdin:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),rate:t.getUint32(4),initialDelay:t.getUint32(8)}},sdtp:function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]};for(t=4;t<e.byteLength;t++)i.samples.push({dependsOn:(48&e[t])>>4,isDependedOn:(12&e[t])>>2,hasRedundancy:3&e[t]});return i},sidx:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:i.getUint32(4),timescale:i.getUint32(8),earliestPresentationTime:i.getUint32(12),firstOffset:i.getUint32(16)},r=i.getUint16(22);for(t=24;r;t+=12,r--)n.references.push({referenceType:(128&e[t])>>>7,referencedSize:2147483647&i.getUint32(t),subsegmentDuration:i.getUint32(t+4),startsWithSap:!!(128&e[t+8]),sapType:(112&e[t+8])>>>4,sapDeltaTime:268435455&i.getUint32(t+8)});return n},smhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),balance:e[4]+e[5]/256}},stbl:function(e){return{boxes:wt(e)}},stco:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),chunkOffsets:[]},r=i.getUint32(4);for(t=8;r;t+=4,r--)n.chunkOffsets.push(i.getUint32(t));return n},stsc:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n=i.getUint32(4),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleToChunks:[]};for(t=8;n;t+=12,n--)r.sampleToChunks.push({firstChunk:i.getUint32(t),samplesPerChunk:i.getUint32(t+4),sampleDescriptionIndex:i.getUint32(t+8)});return r},stsd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleDescriptions:wt(e.subarray(8))}},stsz:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleSize:i.getUint32(4),entries:[]};for(t=12;t<e.byteLength;t+=4)n.entries.push(i.getUint32(t));return n},stts:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),timeToSamples:[]},r=i.getUint32(4);for(t=8;r;t+=8,r--)n.timeToSamples.push({sampleCount:i.getUint32(t),sampleDelta:i.getUint32(t+4)});return n},styp:function(e){return xt.ftyp(e)},tfdt:function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4)),baseMediaDecodeTime:e[4]<<24|e[5]<<16|e[6]<<8|e[7]};return 1===t.version&&(t.baseMediaDecodeTime*=Math.pow(2,32),t.baseMediaDecodeTime+=e[8]<<24|e[9]<<16|e[10]<<8|e[11]),t},tfhd:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:i.getUint32(4)},r=1&n.flags[2],a=2&n.flags[2],s=8&n.flags[2],o=16&n.flags[2],u=32&n.flags[2],l=65536&n.flags[0],c=131072&n.flags[0];return t=8,r&&(t+=4,n.baseDataOffset=i.getUint32(12),t+=4),a&&(n.sampleDescriptionIndex=i.getUint32(t),t+=4),s&&(n.defaultSampleDuration=i.getUint32(t),t+=4),o&&(n.defaultSampleSize=i.getUint32(t),t+=4),u&&(n.defaultSampleFlags=i.getUint32(t)),l&&(n.durationIsEmpty=!0),!r&&c&&(n.baseDataOffsetIsMoof=!0),n},tkhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i=4,n={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4))};return 1===n.version?(i+=4,n.creationTime=Lt(t.getUint32(i)),i+=8,n.modificationTime=Lt(t.getUint32(i)),i+=4,n.trackId=t.getUint32(i),i+=4,i+=8,n.duration=t.getUint32(i)):(n.creationTime=Lt(t.getUint32(i)),i+=4,n.modificationTime=Lt(t.getUint32(i)),i+=4,n.trackId=t.getUint32(i),i+=4,i+=4,n.duration=t.getUint32(i)),i+=4,i+=8,n.layer=t.getUint16(i),i+=2,n.alternateGroup=t.getUint16(i),i+=2,n.volume=t.getUint8(i)+t.getUint8(i+1)/8,i+=2,i+=2,n.matrix=new Uint32Array(e.subarray(i,i+36)),i+=36,n.width=t.getUint16(i)+t.getUint16(i+2)/16,i+=4,n.height=t.getUint16(i)+t.getUint16(i+2)/16,n},traf:function(e){return{boxes:wt(e)}},trak:function(e){return{boxes:wt(e)}},trex:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:t.getUint32(4),defaultSampleDescriptionIndex:t.getUint32(8),defaultSampleDuration:t.getUint32(12),defaultSampleSize:t.getUint32(16),sampleDependsOn:3&e[20],sampleIsDependedOn:(192&e[21])>>6,sampleHasRedundancy:(48&e[21])>>4,samplePaddingValue:(14&e[21])>>1,sampleIsDifferenceSample:!!(1&e[21]),sampleDegradationPriority:t.getUint16(22)}},trun:function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=1&i.flags[2],a=4&i.flags[2],s=1&i.flags[1],o=2&i.flags[1],u=4&i.flags[1],l=8&i.flags[1],c=n.getUint32(4),h=8;for(r&&(i.dataOffset=n.getInt32(h),h+=4),a&&c&&(t={flags:Ot(e.subarray(h,h+4))},h+=4,s&&(t.duration=n.getUint32(h),h+=4),o&&(t.size=n.getUint32(h),h+=4),l&&(t.compositionTimeOffset=n.getUint32(h),h+=4),i.samples.push(t),c--);c--;)t={},s&&(t.duration=n.getUint32(h),h+=4),o&&(t.size=n.getUint32(h),h+=4),u&&(t.flags=Ot(e.subarray(h,h+4)),h+=4),l&&(t.compositionTimeOffset=n.getUint32(h),h+=4),i.samples.push(t);return i},"url ":function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4))}},vmhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),graphicsmode:t.getUint16(4),opcolor:new Uint16Array([t.getUint16(6),t.getUint16(8),t.getUint16(10)])}}};wt=function(e){for(var t,i,n,r,a,s=0,o=[],u=new ArrayBuffer(e.length),l=new Uint8Array(u),c=0;c<e.length;++c)l[c]=e[c];for(t=new DataView(u);s<e.byteLength;)i=t.getUint32(s),n=At(e.subarray(s+4,s+8)),r=i>1?s+i:e.byteLength,(a=(xt[n]||function(e){return{data:e}})(e.subarray(s+8,r))).size=i,a.type=n,o.push(a),s=r;return o},Ct=function(e,t){var i;return t=t||0,i=new Array(2*t+1).join(" "),e.map((function(e,n){return i+e.type+"\n"+Object.keys(e).filter((function(e){return"type"!==e&&"boxes"!==e})).map((function(t){var n=i+" "+t+": ",r=e[t];if(r instanceof Uint8Array||r instanceof Uint32Array){var a=Array.prototype.slice.call(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)).map((function(e){return" "+("00"+e.toString(16)).slice(-2)})).join("").match(/.{1,24}/g);return a?1===a.length?n+"<"+a.join("").slice(1)+">":n+"<\n"+a.map((function(e){return i+" "+e})).join("\n")+"\n"+i+" >":n+"<>"}return n+JSON.stringify(r,null,2).split("\n").map((function(e,t){return 0===t?e:i+" "+e})).join("\n")})).join("\n")+(e.boxes?"\n"+Ct(e.boxes,t+1):"")})).join("\n")};var Ut={inspect:wt,textify:Ct,parseTfdt:xt.tfdt,parseHdlr:xt.hdlr,parseTfhd:xt.tfhd,parseTrun:xt.trun},It=Le,Dt=Be.CaptionStream,Rt=function(e,t){for(var i=e,n=0;n<t.length;n++){var r=t[n];if(i<r.size)return r;i-=r.size}return null},Mt=function(e,t){var i=$.findBox(e,["moof","traf"]),n=$.findBox(e,["mdat"]),r={},a=[];return n.forEach((function(e,t){var n=i[t];a.push({mdat:e,traf:n})})),a.forEach((function(e){var i,n,a=e.mdat,s=e.traf,o=$.findBox(s,["tfhd"]),u=Ut.parseTfhd(o[0]),l=u.trackId,c=$.findBox(s,["tfdt"]),h=c.length>0?Ut.parseTfdt(c[0]).baseMediaDecodeTime:0,d=$.findBox(s,["trun"]);t===l&&d.length>0&&(i=function(e,t,i){var n=t,r=i.defaultSampleDuration||0,a=i.defaultSampleSize||0,s=i.trackId,o=[];return e.forEach((function(e){var t=Ut.parseTrun(e).samples;t.forEach((function(e){void 0===e.duration&&(e.duration=r),void 0===e.size&&(e.size=a),e.trackId=s,e.dts=n,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),e.pts=n+e.compositionTimeOffset,n+=e.duration})),o=o.concat(t)})),o}(d,h,u),n=function(e,t,i){var n,r,a,s,o=new DataView(e.buffer,e.byteOffset,e.byteLength),u=[];for(r=0;r+4<e.length;r+=a)if(a=o.getUint32(r),r+=4,!(a<=0)&&6==(31&e[r])){var l=e.subarray(r+1,r+1+a),c=Rt(r,t);n={nalUnitType:"sei_rbsp",size:a,data:l,escapedRBSP:It(l),trackId:i},c?(n.pts=c.pts,n.dts=c.dts,s=c):(n.pts=s.pts,n.dts=s.dts),u.push(n)}return u}(a,i,l),r[l]||(r[l]=[]),r[l]=r[l].concat(n))})),r},Bt=function(){var e,t,i,n,r,a=!1;this.isInitialized=function(){return a},this.init=function(){e=new Dt,a=!0,e.on("data",(function(e){e.startTime=e.startPts/n,e.endTime=e.endPts/n,r.captions.push(e),r.captionStreams[e.stream]=!0}))},this.isNewInit=function(e,t){return!(e&&0===e.length||t&&"object"==typeof t&&0===Object.keys(t).length)&&(i!==e[0]||n!==t[i])},this.parse=function(e,a,s){var o;if(!this.isInitialized())return null;if(!a||!s)return null;if(this.isNewInit(a,s))i=a[0],n=s[i];else if(!i||!n)return t.push(e),null;for(;t.length>0;){var u=t.shift();this.parse(u,a,s)}return o=function(e,t,i){return t?{seiNals:Mt(e,t)[t],timescale:i}:null}(e,i,n),null!==o&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),r):null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach((function(t){e.push(t)}))},this.flushStream=function(){if(!this.isInitialized())return null;e.flush()},this.clearParsedCaptions=function(){r.captions=[],r.captionStreams={}},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],i=null,n=null,r?this.clearParsedCaptions():r={captions:[],captionStreams:{}},this.resetCaptionStream()},this.reset()},Nt={generator:X,probe:$,Transmuxer:Et.Transmuxer,AudioSegmentStream:Et.AudioSegmentStream,VideoSegmentStream:Et.VideoSegmentStream,CaptionParser:Bt},jt=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),Ft=function(){function e(t,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options=i||{},this.self=t,this.init()}return jt(e,[{key:"init",value:function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Nt.Transmuxer(this.options),function(e,t){t.on("data",(function(t){var i=t.initSegment;t.initSegment={data:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength};var n=t.data;t.data=n.buffer,e.postMessage({action:"data",segment:t,byteOffset:n.byteOffset,byteLength:n.byteLength},[t.data])})),t.captionStream&&t.captionStream.on("data",(function(t){e.postMessage({action:"caption",data:t})})),t.on("done",(function(t){e.postMessage({action:"done"})})),t.on("gopInfo",(function(t){e.postMessage({action:"gopInfo",gopInfo:t})}))}(this.self,this.transmuxer)}},{key:"push",value:function(e){var t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)}},{key:"reset",value:function(){this.init()}},{key:"setTimestampOffset",value:function(e){var t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(9e4*t))}},{key:"setAudioAppendStart",value:function(e){this.transmuxer.setAudioAppendStart(Math.ceil(9e4*e.appendStart))}},{key:"flush",value:function(e){this.transmuxer.flush()}},{key:"resetCaptions",value:function(){this.transmuxer.resetCaptions()}},{key:"alignGopsWith",value:function(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())}}]),e}(),Vt=new function(e){e.onmessage=function(t){"init"===t.data.action&&t.data.options?this.messageHandlers=new Ft(e,t.data.options):(this.messageHandlers||(this.messageHandlers=new Ft(e)),t.data&&t.data.action&&"init"!==t.data.action&&this.messageHandlers[t.data.action]&&this.messageHandlers[t.data.action](t.data))}}(i)}()})),Js={videoCodec:"avc1",videoObjectTypeIndicator:".4d400d",audioProfile:"2"},Zs=function(e){return e.map((function(e){return e.replace(/avc1\.(\d+)\.(\d+)/i,(function(e,t,i){return"avc1."+("00"+Number(t).toString(16)).slice(-2)+"00"+("00"+Number(i).toString(16)).slice(-2)}))}))},eo=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t={codecCount:0},i=void 0;return t.codecCount=e.split(",").length,t.codecCount=t.codecCount||2,(i=/(^|\s|,)+(avc[13])([^ ,]*)/i.exec(e))&&(t.videoCodec=i[2],t.videoObjectTypeIndicator=i[3]),t.audioProfile=/(^|\s|,)+mp4a.[0-9A-Fa-f]+\.([0-9A-Fa-f]+)/i.exec(e),t.audioProfile=t.audioProfile&&t.audioProfile[2],t},to=function(e,t,i){return e+"/"+t+'; codecs="'+i.filter((function(e){return!!e})).join(", ")+'"'},io=function(e,t){var i=function(e){return e.segments&&e.segments.length&&e.segments[0].map?"mp4":"mp2t"}(t),n=function(e){var t=e.attributes||{};return t.CODECS?eo(t.CODECS):Js}(t),r=t.attributes||{},a=!0,s=!1;if(!t)return[];if(e.mediaGroups.AUDIO&&r.AUDIO){var o=e.mediaGroups.AUDIO[r.AUDIO];if(o)for(var u in s=!0,a=!1,o)if(!o[u].uri&&!o[u].playlists){a=!0;break}}s&&!n.audioProfile&&(a||(n.audioProfile=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var i=e.mediaGroups.AUDIO[t];if(!i)return null;for(var n in i){var r=i[n];if(r.default&&r.playlists)return eo(r.playlists[0].attributes.CODECS).audioProfile}return null}(e,r.AUDIO)),n.audioProfile||(Ma.log.warn("Multiple audio tracks present but no audio codec string is specified. Attempting to use the default audio codec (mp4a.40.2)"),n.audioProfile=Js.audioProfile));var l={};n.videoCodec&&(l.video=""+n.videoCodec+n.videoObjectTypeIndicator),n.audioProfile&&(l.audio="mp4a.40."+n.audioProfile);var c=to("audio",i,[l.audio]),h=to("video",i,[l.video]),d=to("video",i,[l.video,l.audio]);return s?!a&&l.video?[h,c]:a||l.video?[d,c]:[c,c]:l.video?[d]:[c]},no=function(e){return/mp4a\.\d+.\d+/i.test(e)},ro=function(e){return/avc1\.[\da-f]+/i.test(e)},ao=function(e,t,i){if(null==t||!e.length)return[];var n=Math.ceil(9e4*(t-i+3)),r=void 0;for(r=0;r<e.length&&!(e[r].pts>n);r++);return e.slice(r)},so=function(e){function t(e,i){Fa(this,t);var n=za(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,Ma.EventTarget));n.timestampOffset_=0,n.pendingBuffers_=[],n.bufferUpdating_=!1,n.mediaSource_=e,n.codecs_=i,n.audioCodec_=null,n.videoCodec_=null,n.audioDisabled_=!1,n.appendAudioInitSegment_=!0,n.gopBuffer_=[],n.timeMapping_=0,n.safeAppend_=Ma.browser.IE_VERSION>=11;var r={remux:!1,alignGopsAtEnd:n.safeAppend_};return n.codecs_.forEach((function(e){no(e)?n.audioCodec_=e:ro(e)&&(n.videoCodec_=e)})),n.transmuxer_=new Qs,n.transmuxer_.postMessage({action:"init",options:r}),n.transmuxer_.onmessage=function(e){return"data"===e.data.action?n.data_(e):"done"===e.data.action?n.done_(e):"gopInfo"===e.data.action?n.appendGopInfo_(e):void 0},Object.defineProperty(n,"timestampOffset",{get:function(){return this.timestampOffset_},set:function(e){"number"==typeof e&&e>=0&&(this.timestampOffset_=e,this.appendAudioInitSegment_=!0,this.gopBuffer_.length=0,this.timeMapping_=0,this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e}))}}),Object.defineProperty(n,"appendWindowStart",{get:function(){return(this.videoBuffer_||this.audioBuffer_).appendWindowStart},set:function(e){this.videoBuffer_&&(this.videoBuffer_.appendWindowStart=e),this.audioBuffer_&&(this.audioBuffer_.appendWindowStart=e)}}),Object.defineProperty(n,"updating",{get:function(){return!!(this.bufferUpdating_||!this.audioDisabled_&&this.audioBuffer_&&this.audioBuffer_.updating||this.videoBuffer_&&this.videoBuffer_.updating)}}),Object.defineProperty(n,"buffered",{get:function(){return function(e,t,i){var n=null,r=null,a=0,s=[],o=[];if(!e&&!t)return Ma.createTimeRange();if(!e)return t.buffered;if(!t)return e.buffered;if(i)return e.buffered;if(0===e.buffered.length&&0===t.buffered.length)return Ma.createTimeRange();for(var u=e.buffered,l=t.buffered,c=u.length;c--;)s.push({time:u.start(c),type:"start"}),s.push({time:u.end(c),type:"end"});for(c=l.length;c--;)s.push({time:l.start(c),type:"start"}),s.push({time:l.end(c),type:"end"});for(s.sort((function(e,t){return e.time-t.time})),c=0;c<s.length;c++)"start"===s[c].type?2==++a&&(n=s[c].time):"end"===s[c].type&&1==--a&&(r=s[c].time),null!==n&&null!==r&&(o.push([n,r]),n=null,r=null);return Ma.createTimeRanges(o)}(this.videoBuffer_,this.audioBuffer_,this.audioDisabled_)}}),n}return qa(t,e),Va(t,[{key:"data_",value:function(e){var t=e.data.segment;t.data=new Uint8Array(t.data,e.data.byteOffset,e.data.byteLength),t.initSegment=new Uint8Array(t.initSegment.data,t.initSegment.byteOffset,t.initSegment.byteLength),function(e,t,i){var n=t.player_;if(i.captions&&i.captions.length)for(var r in e.inbandTextTracks_||(e.inbandTextTracks_={}),i.captionStreams)if(!e.inbandTextTracks_[r]){n.tech_.trigger({type:"usage",name:"hls-608"});var a=n.textTracks().getTrackById(r);e.inbandTextTracks_[r]=a||n.addRemoteTextTrack({kind:"captions",id:r,label:r},!1).track}i.metadata&&i.metadata.length&&!e.metadataTrack_&&(e.metadataTrack_=n.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,e.metadataTrack_.inBandMetadataTrackDispatchType=i.metadata.dispatchType)}(this,this.mediaSource_,t),this.pendingBuffers_.push(t)}},{key:"done_",value:function(e){"closed"!==this.mediaSource_.readyState?this.processPendingSegments_():this.pendingBuffers_.length=0}},{key:"createRealSourceBuffers_",value:function(){var e=this,t=["audio","video"];t.forEach((function(i){if(e[i+"Codec_"]&&!e[i+"Buffer_"]){var n=null;if(e.mediaSource_[i+"Buffer_"])(n=e.mediaSource_[i+"Buffer_"]).updating=!1;else{var r=i+'/mp4;codecs="'+e[i+"Codec_"]+'"';n=function(e,t){var i=e.addSourceBuffer(t),n=Object.create(null);n.updating=!1,n.realBuffer_=i;var r=function(e){"function"==typeof i[e]?n[e]=function(){return i[e].apply(i,arguments)}:void 0===n[e]&&Object.defineProperty(n,e,{get:function(){return i[e]},set:function(t){return i[e]=t}})};for(var a in i)r(a);return n}(e.mediaSource_.nativeMediaSource_,r),e.mediaSource_[i+"Buffer_"]=n}e[i+"Buffer_"]=n,["update","updatestart","updateend"].forEach((function(r){n.addEventListener(r,(function(){if("audio"!==i||!e.audioDisabled_)return"updateend"===r&&(e[i+"Buffer_"].updating=!1),t.every((function(t){return!("audio"!==t||!e.audioDisabled_)||(i===t||!e[t+"Buffer_"]||!e[t+"Buffer_"].updating)}))?e.trigger(r):void 0}))}))}}))}},{key:"appendBuffer",value:function(e){if(this.bufferUpdating_=!0,this.audioBuffer_&&this.audioBuffer_.buffered.length){var t=this.audioBuffer_.buffered;this.transmuxer_.postMessage({action:"setAudioAppendStart",appendStart:t.end(t.length-1)})}this.videoBuffer_&&this.transmuxer_.postMessage({action:"alignGopsWith",gopsToAlignWith:ao(this.gopBuffer_,this.mediaSource_.player_?this.mediaSource_.player_.currentTime():null,this.timeMapping_)}),this.transmuxer_.postMessage({action:"push",data:e.buffer,byteOffset:e.byteOffset,byteLength:e.byteLength},[e.buffer]),this.transmuxer_.postMessage({action:"flush"})}},{key:"appendGopInfo_",value:function(e){this.gopBuffer_=function(e,t,i){if(!t.length)return e;if(i)return t.slice();for(var n=t[0].pts,r=0;r<e.length&&!(e[r].pts>=n);r++);return e.slice(0,r).concat(t)}(this.gopBuffer_,e.data.gopInfo,this.safeAppend_)}},{key:"remove",value:function(e,t){if(this.videoBuffer_&&(this.videoBuffer_.updating=!0,this.videoBuffer_.remove(e,t),this.gopBuffer_=function(e,t,i,n){for(var r=Math.ceil(9e4*(t-n)),a=Math.ceil(9e4*(i-n)),s=e.slice(),o=e.length;o--&&!(e[o].pts<=a););if(-1===o)return s;for(var u=o+1;u--&&!(e[u].pts<=r););return u=Math.max(u,0),s.splice(u,o-u+1),s}(this.gopBuffer_,e,t,this.timeMapping_)),!this.audioDisabled_&&this.audioBuffer_&&(this.audioBuffer_.updating=!0,this.audioBuffer_.remove(e,t)),Ns(e,t,this.metadataTrack_),this.inbandTextTracks_)for(var i in this.inbandTextTracks_)Ns(e,t,this.inbandTextTracks_[i])}},{key:"processPendingSegments_",value:function(){var e={video:{segments:[],bytes:0},audio:{segments:[],bytes:0},captions:[],metadata:[]};e=this.pendingBuffers_.reduce((function(e,t){var i=t.type,n=t.data,r=t.initSegment;return e[i].segments.push(n),e[i].bytes+=n.byteLength,e[i].initSegment=r,t.captions&&(e.captions=e.captions.concat(t.captions)),t.info&&(e[i].info=t.info),t.metadata&&(e.metadata=e.metadata.concat(t.metadata)),e}),e),this.videoBuffer_||this.audioBuffer_||(0===e.video.bytes&&(this.videoCodec_=null),0===e.audio.bytes&&(this.audioCodec_=null),this.createRealSourceBuffers_()),e.audio.info&&this.mediaSource_.trigger({type:"audioinfo",info:e.audio.info}),e.video.info&&this.mediaSource_.trigger({type:"videoinfo",info:e.video.info}),this.appendAudioInitSegment_&&(!this.audioDisabled_&&this.audioBuffer_&&(e.audio.segments.unshift(e.audio.initSegment),e.audio.bytes+=e.audio.initSegment.byteLength),this.appendAudioInitSegment_=!1);var t=!1;this.videoBuffer_&&e.video.bytes?(e.video.segments.unshift(e.video.initSegment),e.video.bytes+=e.video.initSegment.byteLength,this.concatAndAppendSegments_(e.video,this.videoBuffer_),Fs(this,e.captions,e.metadata)):!this.videoBuffer_||!this.audioDisabled_&&this.audioBuffer_||(t=!0),!this.audioDisabled_&&this.audioBuffer_&&this.concatAndAppendSegments_(e.audio,this.audioBuffer_),this.pendingBuffers_.length=0,t&&this.trigger("updateend"),this.bufferUpdating_=!1}},{key:"concatAndAppendSegments_",value:function(e,t){var i=0,n=void 0;if(e.bytes){n=new Uint8Array(e.bytes),e.segments.forEach((function(e){n.set(e,i),i+=e.byteLength}));try{t.updating=!0,t.appendBuffer(n)}catch(e){this.mediaSource_.player_&&this.mediaSource_.player_.error({code:-3,type:"APPEND_BUFFER_ERR",message:e.message,originalError:e})}}}},{key:"abort",value:function(){this.videoBuffer_&&this.videoBuffer_.abort(),!this.audioDisabled_&&this.audioBuffer_&&this.audioBuffer_.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"reset"}),this.pendingBuffers_.length=0,this.bufferUpdating_=!1}}]),t}(Ma.EventTarget),oo=function(e){function t(){Fa(this,t);var e=za(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),i=void 0;for(i in e.nativeMediaSource_=new(f().MediaSource),e.nativeMediaSource_)i in t.prototype||"function"!=typeof e.nativeMediaSource_[i]||(e[i]=e.nativeMediaSource_[i].bind(e.nativeMediaSource_));return e.duration_=NaN,Object.defineProperty(e,"duration",{get:function(){return this.duration_===1/0?this.duration_:this.nativeMediaSource_.duration},set:function(e){this.duration_=e,e===1/0||(this.nativeMediaSource_.duration=e)}}),Object.defineProperty(e,"seekable",{get:function(){return this.duration_===1/0?Ma.createTimeRanges([[0,this.nativeMediaSource_.duration]]):this.nativeMediaSource_.seekable}}),Object.defineProperty(e,"readyState",{get:function(){return this.nativeMediaSource_.readyState}}),Object.defineProperty(e,"activeSourceBuffers",{get:function(){return this.activeSourceBuffers_}}),e.sourceBuffers=[],e.activeSourceBuffers_=[],e.updateActiveSourceBuffers_=function(){if(e.activeSourceBuffers_.length=0,1===e.sourceBuffers.length){var t=e.sourceBuffers[0];return t.appendAudioInitSegment_=!0,t.audioDisabled_=!t.audioCodec_,void e.activeSourceBuffers_.push(t)}for(var i=!1,n=!0,r=0;r<e.player_.audioTracks().length;r++){var a=e.player_.audioTracks()[r];if(a.enabled&&"main"!==a.kind){i=!0,n=!1;break}}e.sourceBuffers.forEach((function(t,r){if(t.appendAudioInitSegment_=!0,t.videoCodec_&&t.audioCodec_)t.audioDisabled_=i;else if(t.videoCodec_&&!t.audioCodec_)t.audioDisabled_=!0,n=!1;else if(!t.videoCodec_&&t.audioCodec_&&(t.audioDisabled_=r?n:!n,t.audioDisabled_))return;e.activeSourceBuffers_.push(t)}))},e.onPlayerMediachange_=function(){e.sourceBuffers.forEach((function(e){e.appendAudioInitSegment_=!0}))},e.onHlsReset_=function(){e.sourceBuffers.forEach((function(e){e.transmuxer_&&e.transmuxer_.postMessage({action:"resetCaptions"})}))},e.onHlsSegmentTimeMapping_=function(t){e.sourceBuffers.forEach((function(e){return e.timeMapping_=t.mapping}))},["sourceopen","sourceclose","sourceended"].forEach((function(e){this.nativeMediaSource_.addEventListener(e,this.trigger.bind(this))}),e),e.on("sourceopen",(function(t){var i=C().querySelector('[src="'+e.url_+'"]');i&&(e.player_=Ma(i.parentNode),e.player_&&(e.player_.tech_.on("hls-reset",e.onHlsReset_),e.player_.tech_.on("hls-segment-time-mapping",e.onHlsSegmentTimeMapping_),e.player_.audioTracks&&e.player_.audioTracks()&&(e.player_.audioTracks().on("change",e.updateActiveSourceBuffers_),e.player_.audioTracks().on("addtrack",e.updateActiveSourceBuffers_),e.player_.audioTracks().on("removetrack",e.updateActiveSourceBuffers_)),e.player_.on("mediachange",e.onPlayerMediachange_)))})),e.on("sourceended",(function(t){for(var i=js(e.duration),n=0;n<e.sourceBuffers.length;n++){var r=e.sourceBuffers[n],a=r.metadataTrack_&&r.metadataTrack_.cues;a&&a.length&&(a[a.length-1].endTime=i)}})),e.on("sourceclose",(function(e){this.sourceBuffers.forEach((function(e){e.transmuxer_&&e.transmuxer_.terminate()})),this.sourceBuffers.length=0,this.player_&&(this.player_.audioTracks&&this.player_.audioTracks()&&(this.player_.audioTracks().off("change",this.updateActiveSourceBuffers_),this.player_.audioTracks().off("addtrack",this.updateActiveSourceBuffers_),this.player_.audioTracks().off("removetrack",this.updateActiveSourceBuffers_)),this.player_.el_&&this.player_.off("mediachange",this.onPlayerMediachange_),this.player_.tech_&&this.player_.tech_.el_&&(this.player_.tech_.off("hls-reset",this.onHlsReset_),this.player_.tech_.off("hls-segment-time-mapping",this.onHlsSegmentTimeMapping_)))})),e}return qa(t,e),Va(t,[{key:"addSeekableRange_",value:function(e,t){var i=void 0;if(this.duration!==1/0)throw(i=new Error("MediaSource.addSeekableRange() can only be invoked when the duration is Infinity")).name="InvalidStateError",i.code=11,i;(t>this.nativeMediaSource_.duration||isNaN(this.nativeMediaSource_.duration))&&(this.nativeMediaSource_.duration=t)}},{key:"addSourceBuffer",value:function(e){var t=void 0,i=function(e){var t={type:"",parameters:{}},i=e.trim().split(";");return t.type=i.shift().trim(),i.forEach((function(e){var i=e.trim().split("=");if(i.length>1){var n=i[0].replace(/"/g,"").trim(),r=i[1].replace(/"/g,"").trim();t.parameters[n]=r}})),t}(e);if(/^(video|audio)\/mp2t$/i.test(i.type)){var n=[];i.parameters&&i.parameters.codecs&&(n=i.parameters.codecs.split(","),n=(n=Zs(n)).filter((function(e){return no(e)||ro(e)}))),0===n.length&&(n=["avc1.4d400d","mp4a.40.2"]),t=new so(this,n),0!==this.sourceBuffers.length&&(this.sourceBuffers[0].createRealSourceBuffers_(),t.createRealSourceBuffers_(),this.sourceBuffers[0].audioDisabled_=!0)}else t=this.nativeMediaSource_.addSourceBuffer(e);return this.sourceBuffers.push(t),t}}]),t}(Ma.EventTarget),uo=0;Ma.mediaSources={};var lo=function(e,t){var i=Ma.mediaSources[e];if(!i)throw new Error("Media Source not found (Video.js)");i.trigger({type:"sourceopen",swfId:t})},co=function(){return!!f().MediaSource&&!!f().MediaSource.isTypeSupported&&f().MediaSource.isTypeSupported('video/mp4;codecs="avc1.4d400d,mp4a.40.2"')},ho=function(){if(this.MediaSource={open:lo,supportsNativeMediaSources:co},co())return new oo;throw new Error("Cannot use create a virtual MediaSource for this video")};ho.open=lo,ho.supportsNativeMediaSources=co;var po={createObjectURL:function(e){var t=void 0;return e instanceof oo?(t=f().URL.createObjectURL(e.nativeMediaSource_),e.url_=t,t):e instanceof oo?(t="blob:vjs-media-source/"+uo,uo++,Ma.mediaSources[t]=e,t):(t=f().URL.createObjectURL(e),e.url_=t,t)}};Ma.MediaSource=ho,Ma.URL=po;var fo=Ma.EventTarget,mo=Ma.mergeOptions,go=function(e,t){for(var i=mo(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod}),n=0;n<t.playlists.length;n++){var r=Ka(i,t.playlists[n]);r&&(i=r)}return $a(t,(function(e,t,n,r){if(e.playlists&&e.playlists.length){var a=e.playlists[0].uri,s=Ka(i,e.playlists[0]);s&&((i=s).mediaGroups[t][n][r].playlists[0]=i.playlists[a])}})),i},yo=function(e){function t(e,i,n,r){Fa(this,t);var a=za(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));if(a.hls_=i,a.withCredentials=n,!e)throw new Error("A non-empty playlist URL or playlist is required");return a.on("minimumUpdatePeriod",(function(){a.refreshXml_()})),a.on("mediaupdatetimeout",(function(){a.refreshMedia_()})),"string"==typeof e?(a.srcUrl=e,a.state="HAVE_NOTHING",za(a)):(a.masterPlaylistLoader_=r,a.state="HAVE_METADATA",a.started=!0,a.media(e),f().setTimeout((function(){a.trigger("loadedmetadata")}),0),a)}return qa(t,e),Va(t,[{key:"dispose",value:function(){this.stopRequest(),f().clearTimeout(this.mediaUpdateTimeout)}},{key:"stopRequest",value:function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}},{key:"media",value:function(e){if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);var t=this.state;if("string"==typeof e){if(!this.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.master.playlists[e]}var i=!this.media_||e.uri!==this.media_.uri;this.state="HAVE_METADATA",i&&(this.media_&&this.trigger("mediachanging"),this.media_=e,this.refreshMedia_(),"HAVE_MASTER"!==t&&this.trigger("mediachange"))}},{key:"pause",value:function(){this.stopRequest(),f().clearTimeout(this.mediaUpdateTimeout),"HAVE_NOTHING"===this.state&&(this.started=!1)}},{key:"load",value:function(e){var t=this;f().clearTimeout(this.mediaUpdateTimeout);var i=this.media();if(e){var n=i?i.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=f().setTimeout((function(){return t.load()}),n)}else this.started?this.trigger("loadedplaylist"):this.start()}},{key:"parseMasterXml",value:function(){var e=pe(this.masterXml_,{manifestUri:this.srcUrl,clientOffset:this.clientOffset_});e.uri=this.srcUrl;for(var t=0;t<e.playlists.length;t++){var i="placeholder-uri-"+t;e.playlists[t].uri=i,e.playlists[i]=e.playlists[t]}return $a(e,(function(t,i,n,r){if(t.playlists&&t.playlists.length){var a="placeholder-uri-"+i+"-"+n+"-"+r;t.playlists[0].uri=a,e.playlists[a]=t.playlists[0]}})),Qa(e),Ja(e),e}},{key:"start",value:function(){var e=this;this.started=!0,this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials},(function(t,i){if(e.request){if(e.request=null,t)return e.error={status:i.status,message:"DASH playlist request error at URL: "+e.srcUrl,responseText:i.responseText,code:2},"HAVE_NOTHING"===e.state&&(e.started=!1),e.trigger("error");e.masterXml_=i.responseText,i.responseHeaders&&i.responseHeaders.date?e.masterLoaded_=Date.parse(i.responseHeaders.date):e.masterLoaded_=Date.now(),e.syncClientServerClock_(e.onClientServerClockSync_.bind(e))}}))}},{key:"syncClientServerClock_",value:function(e){var t=this,i=fe(this.masterXml_);return null===i?(this.clientOffset_=this.masterLoaded_-Date.now(),e()):"DIRECT"===i.method?(this.clientOffset_=i.value-Date.now(),e()):void(this.request=this.hls_.xhr({uri:ja(this.srcUrl,i.value),method:i.method,withCredentials:this.withCredentials},(function(n,r){if(t.request){if(n)return t.clientOffset_=t.masterLoaded_-Date.now(),e();var a=void 0;a="HEAD"===i.method?r.responseHeaders&&r.responseHeaders.date?Date.parse(r.responseHeaders.date):t.masterLoaded_:Date.parse(r.responseText),t.clientOffset_=a-Date.now(),e()}})))}},{key:"onClientServerClockSync_",value:function(){var e=this;this.master=this.parseMasterXml(),this.state="HAVE_MASTER",this.trigger("loadedplaylist"),this.media_||this.media(this.master.playlists[0]),f().setTimeout((function(){e.trigger("loadedmetadata")}),0),this.master.minimumUpdatePeriod&&f().setTimeout((function(){e.trigger("minimumUpdatePeriod")}),this.master.minimumUpdatePeriod)}},{key:"refreshXml_",value:function(){var e=this;this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials},(function(t,i){if(e.request){if(e.request=null,t)return e.error={status:i.status,message:"DASH playlist request error at URL: "+e.srcUrl,responseText:i.responseText,code:2},"HAVE_NOTHING"===e.state&&(e.started=!1),e.trigger("error");e.masterXml_=i.responseText;var n=e.parseMasterXml();e.master=go(e.master,n),f().setTimeout((function(){e.trigger("minimumUpdatePeriod")}),e.master.minimumUpdatePeriod)}}))}},{key:"refreshMedia_",value:function(){var e=this,t=void 0,i=void 0;this.masterPlaylistLoader_?(t=this.masterPlaylistLoader_.master,i=this.masterPlaylistLoader_.parseMasterXml()):(t=this.master,i=this.parseMasterXml());var n=go(t,i);n?(this.masterPlaylistLoader_?this.masterPlaylistLoader_.master=n:this.master=n,this.media_=n.playlists[this.media_.uri]):this.trigger("playlistunchanged"),this.media().endList||(this.mediaUpdateTimeout=f().setTimeout((function(){e.trigger("mediaupdatetimeout")}),Za(this.media(),!!n))),this.trigger("loadedplaylist")}}]),t}(fo),vo=function(e){return Ma.log.debug?Ma.log.debug.bind(Ma,"VHS:",e+" >"):function(){}};function _o(){}var bo=function(){function e(t,i,n,r){Fa(this,e),this.callbacks_=[],this.pendingCallback_=null,this.timestampOffset_=0,this.mediaSource=t,this.processedAppend_=!1,this.type_=n,this.mimeType_=i,this.logger_=vo("SourceUpdater["+n+"]["+i+"]"),"closed"===t.readyState?t.addEventListener("sourceopen",this.createSourceBuffer_.bind(this,i,r)):this.createSourceBuffer_(i,r)}return Va(e,[{key:"createSourceBuffer_",value:function(e,t){var i=this;this.sourceBuffer_=this.mediaSource.addSourceBuffer(e),this.logger_("created SourceBuffer"),t&&(t.trigger("sourcebufferadded"),this.mediaSource.sourceBuffers.length<2)?t.on("sourcebufferadded",(function(){i.start_()})):this.start_()}},{key:"start_",value:function(){var e=this;this.started_=!0,this.onUpdateendCallback_=function(){var t=e.pendingCallback_;e.pendingCallback_=null,e.logger_("buffered ["+Ms(e.buffered())+"]"),t&&t(),e.runCallback_()},this.sourceBuffer_.addEventListener("updateend",this.onUpdateendCallback_),this.runCallback_()}},{key:"abort",value:function(e){var t=this;this.processedAppend_&&this.queueCallback_((function(){t.sourceBuffer_.abort()}),e)}},{key:"appendBuffer",value:function(e,t){var i=this;this.processedAppend_=!0,this.queueCallback_((function(){i.sourceBuffer_.appendBuffer(e)}),t)}},{key:"buffered",value:function(){return this.sourceBuffer_?this.sourceBuffer_.buffered:Ma.createTimeRanges()}},{key:"remove",value:function(e,t){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:_o;this.processedAppend_&&this.queueCallback_((function(){i.logger_("remove ["+e+" => "+t+"]"),i.sourceBuffer_.remove(e,t)}),n)}},{key:"updating",value:function(){return!this.sourceBuffer_||this.sourceBuffer_.updating||this.pendingCallback_}},{key:"timestampOffset",value:function(e){var t=this;return void 0!==e&&(this.queueCallback_((function(){t.sourceBuffer_.timestampOffset=e})),this.timestampOffset_=e),this.timestampOffset_}},{key:"queueCallback_",value:function(e,t){this.callbacks_.push([e.bind(this),t]),this.runCallback_()}},{key:"runCallback_",value:function(){var e=void 0;!this.updating()&&this.callbacks_.length&&this.started_&&(e=this.callbacks_.shift(),this.pendingCallback_=e[1],e[0]())}},{key:"dispose",value:function(){this.sourceBuffer_.removeEventListener("updateend",this.onUpdateendCallback_),this.sourceBuffer_&&"open"===this.mediaSource.readyState&&this.sourceBuffer_.abort()}}]),e}(),To={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,BUFFER_LOW_WATER_LINE_RATE:1},So=2,ko=-101,wo=-102,Co=function(e){var t,i,n={};return e.byterange&&(n.Range=(t=e.byterange,i=t.offset+t.length-1,"bytes="+t.offset+"-"+i)),n},Eo=function(e){e.forEach((function(e){e.abort()}))},Ao=function(e,t){return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:ko,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:wo,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:So,xhr:t}:null},Lo=function(e,t,i){var n=0,r=!1;return function(a,s){if(!r)return a?(r=!0,Eo(e),i(a,s)):(n+=1)===e.length?(s.endOfAllRequests=Date.now(),s.encryptedBytes?function(e,t,i){e.addEventListener("message",(function n(r){if(r.data.source===t.requestId){e.removeEventListener("message",n);var a=r.data.decrypted;return t.bytes=new Uint8Array(a.bytes,a.byteOffset,a.byteLength),i(null,t)}})),e.postMessage(ks({source:t.requestId,encrypted:t.encryptedBytes,key:t.key.bytes,iv:t.key.iv}),[t.encryptedBytes.buffer,t.key.bytes.buffer])}(t,s,i):i(null,s)):void 0}},Oo=function(e,t){return function(i){var n,r,a;return e.stats=Ma.mergeOptions(e.stats,(r=(n=i).target,(a={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-r.requestTime||0}).bytesReceived=n.loaded,a.bandwidth=Math.floor(a.bytesReceived/a.roundTripTime*8*1e3),a)),!e.stats.firstBytesReceivedAt&&e.stats.bytesReceived&&(e.stats.firstBytesReceivedAt=Date.now()),t(i,e)}},Po=function(e,t,i,n,r,a,s){var o=[],u=Lo(o,i,s);if(r.key){var l=Ma.mergeOptions(t,{uri:r.key.resolvedUri,responseType:"arraybuffer"}),c=function(e,t){return function(i,n){var r=n.response,a=Ao(i,n);if(a)return t(a,e);if(16!==r.byteLength)return t({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:So,xhr:n},e);var s=new DataView(r);return e.key.bytes=new Uint32Array([s.getUint32(0),s.getUint32(4),s.getUint32(8),s.getUint32(12)]),t(null,e)}}(r,u),h=e(l,c);o.push(h)}if(r.map&&!r.map.bytes){var d=Ma.mergeOptions(t,{uri:r.map.resolvedUri,responseType:"arraybuffer",headers:Co(r.map)}),p=function(e,t,i){return function(n,r){var a=r.response,s=Ao(n,r);return s?i(s,e):0===a.byteLength?i({status:r.status,message:"Empty HLS segment content at URL: "+r.uri,code:So,xhr:r},e):(e.map.bytes=new Uint8Array(r.response),t.isInitialized()||t.init(),e.map.timescales=ge().timescale(e.map.bytes),e.map.videoTrackIds=ge().videoTrackIds(e.map.bytes),i(null,e))}}(r,n,u),f=e(d,p);o.push(f)}var m=Ma.mergeOptions(t,{uri:r.resolvedUri,responseType:"arraybuffer",headers:Co(r)}),g=function(e,t,i){return function(n,r){var a=r.response,s=Ao(n,r),o=void 0;return s?i(s,e):0===a.byteLength?i({status:r.status,message:"Empty HLS segment content at URL: "+r.uri,code:So,xhr:r},e):(e.stats=function(e){return{bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}}(r),e.key?e.encryptedBytes=new Uint8Array(r.response):e.bytes=new Uint8Array(r.response),e.map&&e.map.bytes&&(t.isInitialized()||t.init(),(o=t.parse(e.bytes,e.map.videoTrackIds,e.map.timescales))&&o.captions&&(e.captionStreams=o.captionStreams,e.fmp4Captions=o.captions)),i(null,e))}}(r,n,u),y=e(m,g);return y.addEventListener("progress",Oo(r,a)),o.push(y),function(){return Eo(o)}},xo=function(e,t){var i;return e&&(i=f().getComputedStyle(e))?i[t]:""},Uo=function(e,t){var i=e.slice();e.sort((function(e,n){var r=t(e,n);return 0===r?i.indexOf(e)-i.indexOf(n):r}))},Io=function(e,t){var i=void 0,n=void 0;return e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||f().Number.MAX_VALUE,t.attributes.BANDWIDTH&&(n=t.attributes.BANDWIDTH),i-(n=n||f().Number.MAX_VALUE)},Do=function(e,t,i){if(!e||!t)return!1;var n=i===e.segments.length;return e.endList&&"open"===t.readyState&&n},Ro=function(e){return"number"==typeof e&&isFinite(e)},Mo=function(e){function t(e){Fa(this,t);var i=za(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));if(!e)throw new TypeError("Initialization settings are required");if("function"!=typeof e.currentTime)throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");return i.bandwidth=e.bandwidth,i.throughput={rate:0,count:0},i.roundTrip=NaN,i.resetStats_(),i.mediaIndex=null,i.hasPlayed_=e.hasPlayed,i.currentTime_=e.currentTime,i.seekable_=e.seekable,i.seeking_=e.seeking,i.duration_=e.duration,i.mediaSource_=e.mediaSource,i.hls_=e.hls,i.loaderType_=e.loaderType,i.startingMedia_=void 0,i.segmentMetadataTrack_=e.segmentMetadataTrack,i.goalBufferLength_=e.goalBufferLength,i.sourceType_=e.sourceType,i.inbandTextTracks_=e.inbandTextTracks,i.state_="INIT",i.checkBufferTimeout_=null,i.error_=void 0,i.currentTimeline_=-1,i.pendingSegment_=null,i.mimeType_=null,i.sourceUpdater_=null,i.xhrOptions_=null,i.activeInitSegmentId_=null,i.initSegments_={},i.captionParser_=new ye.CaptionParser,i.decrypter_=e.decrypter,i.syncController_=e.syncController,i.syncPoint_={segmentIndex:0,time:0},i.syncController_.on("syncinfoupdate",(function(){return i.trigger("syncinfoupdate")})),i.mediaSource_.addEventListener("sourceopen",(function(){return i.ended_=!1})),i.fetchAtBuffer_=!1,i.logger_=vo("SegmentLoader["+i.loaderType_+"]"),Object.defineProperty(i,"state",{get:function(){return this.state_},set:function(e){e!==this.state_&&(this.logger_(this.state_+" -> "+e),this.state_=e)}}),i}return qa(t,e),Va(t,[{key:"resetStats_",value:function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0}},{key:"dispose",value:function(){this.state="DISPOSED",this.pause(),this.abort_(),this.sourceUpdater_&&this.sourceUpdater_.dispose(),this.resetStats_(),this.captionParser_.reset()}},{key:"abort",value:function(){"WAITING"===this.state?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)}},{key:"abort_",value:function(){this.pendingSegment_&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null}},{key:"error",value:function(e){return void 0!==e&&(this.error_=e),this.pendingSegment_=null,this.error_}},{key:"endOfStream",value:function(){this.ended_=!0,this.pause(),this.trigger("ended")}},{key:"buffered_",value:function(){return this.sourceUpdater_?this.sourceUpdater_.buffered():Ma.createTimeRanges()}},{key:"initSegment",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return null;var i=ws(e),n=this.initSegments_[i];return t&&!n&&e.bytes&&(this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,timescales:e.timescales,videoTrackIds:e.videoTrackIds}),n||e}},{key:"couldBeginLoading_",value:function(){return this.playlist_&&(this.sourceUpdater_||this.mimeType_&&"INIT"===this.state)&&!this.paused()}},{key:"load",value:function(){if(this.monitorBuffer_(),this.playlist_){if(this.syncController_.setDateTimeMapping(this.playlist_),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY")}}},{key:"init_",value:function(){return this.state="READY",this.sourceUpdater_=new bo(this.mediaSource_,this.mimeType_,this.loaderType_,this.sourceBufferEmitter_),this.resetEverything(),this.monitorBuffer_()}},{key:"playlist",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e){var i=this.playlist_,n=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,this.hasPlayed_()||(e.syncInfo={mediaSequence:e.mediaSequence,time:0});var r=i?i.id:null;if(this.logger_("playlist update ["+r+" => "+e.id+"]"),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(i&&i.uri===e.uri){var a=e.mediaSequence-i.mediaSequence;this.logger_("live window shift ["+a+"]"),null!==this.mediaIndex&&(this.mediaIndex-=a),n&&(n.mediaIndex-=a,n.mediaIndex>=0&&(n.segment=e.segments[n.mediaIndex])),this.syncController_.saveExpiredSegmentInfo(i,e)}else null!==this.mediaIndex&&this.resyncLoader()}}},{key:"pause",value:function(){this.checkBufferTimeout_&&(f().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}},{key:"paused",value:function(){return null===this.checkBufferTimeout_}},{key:"mimeType",value:function(e,t){this.mimeType_||(this.mimeType_=e,this.sourceBufferEmitter_=t,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_())}},{key:"resetEverything",value:function(e){this.ended_=!1,this.resetLoader(),this.remove(0,this.duration_(),e),this.captionParser_.clearAllCaptions(),this.trigger("reseteverything")}},{key:"resetLoader",value:function(){this.fetchAtBuffer_=!1,this.resyncLoader()}},{key:"resyncLoader",value:function(){this.mediaIndex=null,this.syncPoint_=null,this.abort()}},{key:"remove",value:function(e,t,i){if(this.sourceUpdater_&&this.sourceUpdater_.remove(e,t,i),Ns(e,t,this.segmentMetadataTrack_),this.inbandTextTracks_)for(var n in this.inbandTextTracks_)Ns(e,t,this.inbandTextTracks_[n])}},{key:"monitorBuffer_",value:function(){this.checkBufferTimeout_&&f().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=f().setTimeout(this.monitorBufferTick_.bind(this),1)}},{key:"monitorBufferTick_",value:function(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&f().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=f().setTimeout(this.monitorBufferTick_.bind(this),500)}},{key:"fillBuffer_",value:function(){if(!this.sourceUpdater_.updating()){this.syncPoint_||(this.syncPoint_=this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_()));var e=this.checkBuffer_(this.buffered_(),this.playlist_,this.mediaIndex,this.hasPlayed_(),this.currentTime_(),this.syncPoint_);if(e)Do(this.playlist_,this.mediaSource_,e.mediaIndex)?this.endOfStream():(e.mediaIndex!==this.playlist_.segments.length-1||"ended"!==this.mediaSource_.readyState||this.seeking_())&&((e.timeline!==this.currentTimeline_||null!==e.startOfSegment&&e.startOfSegment<this.sourceUpdater_.timestampOffset())&&(this.syncController_.reset(),e.timestampOffset=e.startOfSegment,this.captionParser_.clearAllCaptions()),this.loadSegment_(e))}}},{key:"checkBuffer_",value:function(e,t,i,n,r,a){var s=0,o=void 0;e.length&&(s=e.end(e.length-1));var u=Math.max(0,s-r);if(!t.segments.length)return null;if(u>=this.goalBufferLength_())return null;if(!n&&u>=1)return null;if(null===a)return i=this.getSyncSegmentCandidate_(t),this.generateSegmentInfo_(t,i,null,!0);if(null!==i){var l=t.segments[i];return o=l&&l.end?l.end:s,this.generateSegmentInfo_(t,i+1,o,!1)}if(this.fetchAtBuffer_){var c=gs.getMediaInfoForTime(t,s,a.segmentIndex,a.time);i=c.mediaIndex,o=c.startTime}else{var h=gs.getMediaInfoForTime(t,r,a.segmentIndex,a.time);i=h.mediaIndex,o=h.startTime}return this.generateSegmentInfo_(t,i,o,!1)}},{key:"getSyncSegmentCandidate_",value:function(e){var t=this;if(-1===this.currentTimeline_)return 0;var i=e.segments.map((function(e,t){return{timeline:e.timeline,segmentIndex:t}})).filter((function(e){return e.timeline===t.currentTimeline_}));return i.length?i[Math.min(i.length-1,1)].segmentIndex:Math.max(e.segments.length-1,0)}},{key:"generateSegmentInfo_",value:function(e,t,i,n){if(t<0||t>=e.segments.length)return null;var r=e.segments[t];return{requestId:"segment-loader-"+Math.random(),uri:r.resolvedUri,mediaIndex:t,isSyncRequest:n,startOfSegment:i,playlist:e,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:r.timeline,duration:r.duration,segment:r}}},{key:"abortRequestEarly_",value:function(e){if(this.hls_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH)return!1;if(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return!1;var t=this.currentTime_(),i=e.bandwidth,n=this.pendingSegment_.duration,r=gs.estimateSegmentRequestTime(n,i,this.playlist_,e.bytesReceived),a=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return((e.length?e.end(e.length-1):0)-t)/i}(this.buffered_(),t,this.hls_.tech_.playbackRate())-1;if(r<=a)return!1;var s=function(e){var t=e.master,i=e.currentTime,n=e.bandwidth,r=e.duration,a=e.segmentDuration,s=e.timeUntilRebuffer,o=e.currentTimeline,u=e.syncController,l=t.playlists.filter((function(e){return!gs.isIncompatible(e)})),c=l.filter(gs.isEnabled);c.length||(c=l.filter((function(e){return!gs.isDisabled(e)})));var h=c.filter(gs.hasAttribute.bind(null,"BANDWIDTH")).map((function(e){var t=u.getSyncPoint(e,r,o,i)?1:2;return{playlist:e,rebufferingImpact:gs.estimateSegmentRequestTime(a,n,e)*t-s}})),d=h.filter((function(e){return e.rebufferingImpact<=0}));return Uo(d,(function(e,t){return Io(t.playlist,e.playlist)})),d.length?d[0]:(Uo(h,(function(e,t){return e.rebufferingImpact-t.rebufferingImpact})),h[0]||null)}({master:this.hls_.playlists.master,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:n,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(s){var o=r-a-s.rebufferingImpact,u=.5;return a<=xs&&(u=1),!s.playlist||s.playlist.uri===this.playlist_.uri||o<u?!1:(this.bandwidth=s.playlist.attributes.BANDWIDTH*To.BANDWIDTH_VARIANCE+1,this.abort(),this.trigger("earlyabort"),!0)}}},{key:"handleProgress_",value:function(e,t){this.pendingSegment_&&t.requestId===this.pendingSegment_.requestId&&!this.abortRequestEarly_(t.stats)&&this.trigger("progress")}},{key:"loadSegment_",value:function(e){this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),e.abortRequests=Po(this.hls_.xhr,this.xhrOptions_,this.decrypter_,this.captionParser_,this.createSimplifiedSegmentObj_(e),this.handleProgress_.bind(this),this.segmentRequestFinished_.bind(this))}},{key:"trimBackBuffer_",value:function(e){var t=function(e,t,i){var n=void 0;return n=e.length&&e.start(0)>0&&e.start(0)<t?e.start(0):t-30,Math.min(n,t-i)}(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}},{key:"createSimplifiedSegmentObj_",value:function(e){var t=e.segment,i={resolvedUri:t.resolvedUri,byterange:t.byterange,requestId:e.requestId};if(t.key){var n=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);i.key={resolvedUri:t.key.resolvedUri,iv:n}}return t.map&&(i.map=this.initSegment(t.map)),i}},{key:"segmentRequestFinished_",value:function(e,t){if(this.mediaRequests+=1,t.stats&&(this.mediaBytesTransferred+=t.stats.bytesReceived,this.mediaTransferDuration+=t.stats.roundTripTime),this.pendingSegment_){if(t.requestId===this.pendingSegment_.requestId){if(e)return this.pendingSegment_=null,this.state="READY",e.code===wo?void(this.mediaRequestsAborted+=1):(this.pause(),e.code===ko?(this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,void this.trigger("bandwidthupdate")):(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error")));this.bandwidth=t.stats.bandwidth,this.roundTrip=t.stats.roundTripTime,t.map&&(t.map=this.initSegment(t.map,!0)),this.processSegmentResponse_(t)}}else this.mediaRequestsAborted+=1}},{key:"processSegmentResponse_",value:function(e){var t=this.pendingSegment_;t.bytes=e.bytes,e.map&&(t.segment.map.bytes=e.map.bytes),t.endOfAllRequests=e.endOfAllRequests,e.fmp4Captions&&(!function(e,t,i){for(var n in i)if(!e[n]){t.trigger({type:"usage",name:"hls-608"});var r=t.textTracks().getTrackById(n);e[n]=r||t.addRemoteTextTrack({kind:"captions",id:n,label:n},!1).track}}(this.inbandTextTracks_,this.hls_.tech_,e.captionStreams),function(e){var t=e.inbandTextTracks,i=e.captionArray,n=e.timestampOffset;if(i){var r=window.WebKitDataCue||window.VTTCue;i.forEach((function(e){var i=e.stream,a=e.startTime,s=e.endTime;t[i]&&(a+=n,s+=n,t[i].addCue(new r(a,s,e.text)))}))}}({inbandTextTracks:this.inbandTextTracks_,captionArray:e.fmp4Captions,timestampOffset:0}),this.captionParser_.clearParsedCaptions()),this.handleSegment_()}},{key:"handleSegment_",value:function(){var e=this;if(this.pendingSegment_){var t=this.pendingSegment_,i=t.segment,n=this.syncController_.probeSegmentInfo(t);void 0===this.startingMedia_&&n&&(n.containsAudio||n.containsVideo)&&(this.startingMedia_={containsAudio:n.containsAudio,containsVideo:n.containsVideo});var r,a,s,o=(r=this.loaderType_,a=this.startingMedia_,s=n,"main"===r&&a&&s?s.containsAudio||s.containsVideo?a.containsVideo&&!s.containsVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!a.containsVideo&&s.containsVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null);if(o)return this.error({message:o,blacklistDuration:1/0}),void this.trigger("error");if(t.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");null!==t.timestampOffset&&t.timestampOffset!==this.sourceUpdater_.timestampOffset()&&(this.sourceUpdater_.timestampOffset(t.timestampOffset),this.trigger("timestampoffset"));var u=this.syncController_.mappingForTimeline(t.timeline);if(null!==u&&this.trigger({type:"segmenttimemapping",mapping:u}),this.state="APPENDING",i.map){var l=ws(i.map);if(!this.activeInitSegmentId_||this.activeInitSegmentId_!==l){var c=this.initSegment(i.map);this.sourceUpdater_.appendBuffer(c.bytes,(function(){e.activeInitSegmentId_=l}))}}t.byteLength=t.bytes.byteLength,"number"==typeof i.start&&"number"==typeof i.end?this.mediaSecondsLoaded+=i.end-i.start:this.mediaSecondsLoaded+=i.duration,this.logger_(function(e){var t=e.segment,i=t.start,n=t.end,r=e.playlist,a=r.mediaSequence,s=r.id,o=r.segments,u=void 0===o?[]:o,l=e.mediaIndex,c=e.timeline;return["appending ["+l+"] of ["+a+", "+(a+u.length)+"] from playlist ["+s+"]","["+i+" => "+n+"] in timeline ["+c+"]"].join(" ")}(t)),this.sourceUpdater_.appendBuffer(t.bytes,this.handleUpdateEnd_.bind(this))}else this.state="READY"}},{key:"handleUpdateEnd_",value:function(){if(!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());var e=this.pendingSegment_,t=e.segment,i=null!==this.mediaIndex;(this.pendingSegment_=null,this.recordThroughput_(e),this.addSegmentMetadataCue_(e),this.state="READY",this.mediaIndex=e.mediaIndex,this.fetchAtBuffer_=!0,this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate"),t.end&&this.currentTime_()-t.end>3*e.playlist.targetDuration)?this.resetEverything():(i&&this.trigger("bandwidthupdate"),this.trigger("progress"),Do(e.playlist,this.mediaSource_,e.mediaIndex+1)&&this.endOfStream(),this.paused()||this.monitorBuffer_())}},{key:"recordThroughput_",value:function(e){var t=this.throughput.rate,i=Date.now()-e.endOfAllRequests+1,n=Math.floor(e.byteLength/i*8*1e3);this.throughput.rate+=(n-t)/++this.throughput.count}},{key:"addSegmentMetadataCue_",value:function(e){if(this.segmentMetadataTrack_){var t=e.segment,i=t.start,n=t.end;if(Ro(i)&&Ro(n)){Ns(i,n,this.segmentMetadataTrack_);var r=f().WebKitDataCue||f().VTTCue,a={dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.uri,start:i,end:n},s=new r(i,n,JSON.stringify(a));s.value=a,this.segmentMetadataTrack_.addCue(s)}}}}]),t}(Ma.EventTarget),Bo=function(e){return decodeURIComponent(escape(String.fromCharCode.apply(null,e)))},No=new Uint8Array("\n\n".split("").map((function(e){return e.charCodeAt(0)}))),jo=function(e){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Fa(this,t);var n=za(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,i));return n.mediaSource_=null,n.subtitlesTrack_=null,n}return qa(t,e),Va(t,[{key:"buffered_",value:function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues.length)return Ma.createTimeRanges();var e=this.subtitlesTrack_.cues,t=e[0].startTime,i=e[e.length-1].startTime;return Ma.createTimeRanges([[t,i]])}},{key:"initSegment",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return null;var i=ws(e),n=this.initSegments_[i];if(t&&!n&&e.bytes){var r=No.byteLength+e.bytes.byteLength,a=new Uint8Array(r);a.set(e.bytes),a.set(No,e.bytes.byteLength),this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:a}}return n||e}},{key:"couldBeginLoading_",value:function(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}},{key:"init_",value:function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}},{key:"track",value:function(e){return void 0===e||(this.subtitlesTrack_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_}},{key:"remove",value:function(e,t){Ns(e,t,this.subtitlesTrack_)}},{key:"fillBuffer_",value:function(){var e=this;this.syncPoint_||(this.syncPoint_=this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_()));var t=this.checkBuffer_(this.buffered_(),this.playlist_,this.mediaIndex,this.hasPlayed_(),this.currentTime_(),this.syncPoint_);if(t=this.skipEmptySegments_(t)){if(null===this.syncController_.timestampOffsetForTimeline(t.timeline)){return this.syncController_.one("timestampoffset",(function(){e.state="READY",e.paused()||e.monitorBuffer_()})),void(this.state="WAITING_ON_TIMELINE")}this.loadSegment_(t)}}},{key:"skipEmptySegments_",value:function(e){for(;e&&e.segment.empty;)e=this.generateSegmentInfo_(e.playlist,e.mediaIndex+1,e.startOfSegment+e.duration,e.isSyncRequest);return e}},{key:"handleSegment_",value:function(){var e=this;if(this.pendingSegment_&&this.subtitlesTrack_){this.state="APPENDING";var t=this.pendingSegment_,i=t.segment;if("function"!=typeof f().WebVTT&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){var n=function(){e.handleSegment_()};return this.state="WAITING_ON_VTTJS",this.subtitlesTrack_.tech_.one("vttjsloaded",n),void this.subtitlesTrack_.tech_.one("vttjserror",(function(){e.subtitlesTrack_.tech_.off("vttjsloaded",n),e.error({message:"Error loading vtt.js"}),e.state="READY",e.pause(),e.trigger("error")}))}i.requested=!0;try{this.parseVTTCues_(t)}catch(e){return this.error({message:e.message}),this.state="READY",this.pause(),this.trigger("error")}if(this.updateTimeMapping_(t,this.syncController_.timelines[t.timeline],this.playlist_),t.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");t.byteLength=t.bytes.byteLength,this.mediaSecondsLoaded+=i.duration,t.cues.length&&this.remove(t.cues[0].endTime,t.cues[t.cues.length-1].endTime),t.cues.forEach((function(t){e.subtitlesTrack_.addCue(t)})),this.handleUpdateEnd_()}else this.state="READY"}},{key:"parseVTTCues_",value:function(e){var t=void 0,i=!1;"function"==typeof f().TextDecoder?t=new(f().TextDecoder)("utf8"):(t=f().WebVTT.StringDecoder(),i=!0);var n=new(f().WebVTT.Parser)(f(),f().vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},n.oncue=e.cues.push.bind(e.cues),n.ontimestampmap=function(t){return e.timestampmap=t},n.onparsingerror=function(e){Ma.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){var r=e.segment.map.bytes;i&&(r=Bo(r)),n.parse(r)}var a=e.bytes;i&&(a=Bo(a)),n.parse(a),n.flush()}},{key:"updateTimeMapping_",value:function(e,t,i){var n=e.segment;if(t)if(e.cues.length){var r=e.timestampmap,a=r.MPEGTS/9e4-r.LOCAL+t.mapping;if(e.cues.forEach((function(e){e.startTime+=a,e.endTime+=a})),!i.syncInfo){var s=e.cues[0].startTime,o=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(s,o-n.duration)}}}else n.empty=!0}}]),t}(Mo),Fo=function(e,t){for(var i=e.cues,n=0;n<i.length;n++){var r=i[n];if(t>=r.adStartTime&&t<=r.adEndTime)return r}return null},Vo=_e().inspect,Ho=[{name:"VOD",run:function(e,t,i,n,r){if(i!==1/0){return{time:0,segmentIndex:0}}return null}},{name:"ProgramDateTime",run:function(e,t,i,n,r){if(!e.datetimeToDisplayTime)return null;var a=t.segments||[],s=null,o=null;r=r||0;for(var u=0;u<a.length;u++){var l=a[u];if(l.dateTimeObject){var c=l.dateTimeObject.getTime()/1e3+e.datetimeToDisplayTime,h=Math.abs(r-c);if(null!==o&&o<h)break;o=h,s={time:c,segmentIndex:u}}}return s}},{name:"Segment",run:function(e,t,i,n,r){var a=t.segments||[],s=null,o=null;r=r||0;for(var u=0;u<a.length;u++){var l=a[u];if(l.timeline===n&&void 0!==l.start){var c=Math.abs(r-l.start);if(null!==o&&o<c)break;(!s||null===o||o>=c)&&(o=c,s={time:l.start,segmentIndex:u})}}return s}},{name:"Discontinuity",run:function(e,t,i,n,r){var a=null;if(r=r||0,t.discontinuityStarts&&t.discontinuityStarts.length)for(var s=null,o=0;o<t.discontinuityStarts.length;o++){var u=t.discontinuityStarts[o],l=t.discontinuitySequence+o+1,c=e.discontinuities[l];if(c){var h=Math.abs(r-c.time);if(null!==s&&s<h)break;(!a||null===s||s>=h)&&(s=h,a={time:c.time,segmentIndex:u})}}return a}},{name:"Playlist",run:function(e,t,i,n,r){return t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence}:null}}],qo=function(e){function t(){Fa(this,t);var e=za(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.inspectCache_=void 0,e.timelines=[],e.discontinuities=[],e.datetimeToDisplayTime=null,e.logger_=vo("SyncController"),e}return qa(t,e),Va(t,[{key:"getSyncPoint",value:function(e,t,i,n){var r=this.runStrategies_(e,t,i,n);return r.length?this.selectSyncPoint_(r,{key:"time",value:n}):null}},{key:"getExpiredTime",value:function(e,t){if(!e||!e.segments)return null;var i=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!i.length)return null;var n=this.selectSyncPoint_(i,{key:"segmentIndex",value:0});return n.segmentIndex>0&&(n.time*=-1),Math.abs(n.time+rs(e,n.segmentIndex,0))}},{key:"runStrategies_",value:function(e,t,i,n){for(var r=[],a=0;a<Ho.length;a++){var s=Ho[a],o=s.run(this,e,t,i,n);o&&(o.strategy=s.name,r.push({strategy:s.name,syncPoint:o}))}return r}},{key:"selectSyncPoint_",value:function(e,t){for(var i=e[0].syncPoint,n=Math.abs(e[0].syncPoint[t.key]-t.value),r=e[0].strategy,a=1;a<e.length;a++){var s=Math.abs(e[a].syncPoint[t.key]-t.value);s<n&&(n=s,i=e[a].syncPoint,r=e[a].strategy)}return this.logger_("syncPoint for ["+t.key+": "+t.value+"] chosen with strategy ["+r+"]: [time:"+i.time+", segmentIndex:"+i.segmentIndex+"]"),i}},{key:"saveExpiredSegmentInfo",value:function(e,t){for(var i=t.mediaSequence-e.mediaSequence-1;i>=0;i--){var n=e.segments[i];if(n&&void 0!==n.start){t.syncInfo={mediaSequence:e.mediaSequence+i,time:n.start},this.logger_("playlist refresh sync: [time:"+t.syncInfo.time+", mediaSequence: "+t.syncInfo.mediaSequence+"]"),this.trigger("syncinfoupdate");break}}}},{key:"setDateTimeMapping",value:function(e){if(!this.datetimeToDisplayTime&&e.segments&&e.segments.length&&e.segments[0].dateTimeObject){var t=e.segments[0].dateTimeObject.getTime()/1e3;this.datetimeToDisplayTime=-t}}},{key:"reset",value:function(){this.inspectCache_=void 0}},{key:"probeSegmentInfo",value:function(e){var t=e.segment,i=e.playlist,n=void 0;return(n=t.map?this.probeMp4Segment_(e):this.probeTsSegment_(e))&&this.calculateSegmentTimeMapping_(e,n)&&(this.saveDiscontinuitySyncInfo_(e),i.syncInfo||(i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:t.start})),n}},{key:"probeMp4Segment_",value:function(e){var t=e.segment,i=ge().timescale(t.map.bytes),n=ge().startTime(i,e.bytes);return null!==e.timestampOffset&&(e.timestampOffset-=n),{start:n,end:n+t.duration}}},{key:"probeTsSegment_",value:function(e){var t=Vo(e.bytes,this.inspectCache_),i=void 0,n=void 0;return t?(t.video&&2===t.video.length?(this.inspectCache_=t.video[1].dts,i=t.video[0].dtsTime,n=t.video[1].dtsTime):t.audio&&2===t.audio.length&&(this.inspectCache_=t.audio[1].dts,i=t.audio[0].dtsTime,n=t.audio[1].dtsTime),{start:i,end:n,containsVideo:t.video&&2===t.video.length,containsAudio:t.audio&&2===t.audio.length}):null}},{key:"timestampOffsetForTimeline",value:function(e){return void 0===this.timelines[e]?null:this.timelines[e].time}},{key:"mappingForTimeline",value:function(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping}},{key:"calculateSegmentTimeMapping_",value:function(e,t){var i=e.segment,n=this.timelines[e.timeline];if(null!==e.timestampOffset)n={time:e.startOfSegment,mapping:e.startOfSegment-t.start},this.timelines[e.timeline]=n,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+e.timeline+": [time: "+n.time+"] [mapping: "+n.mapping+"]"),i.start=e.startOfSegment,i.end=t.end+n.mapping;else{if(!n)return!1;i.start=t.start+n.mapping,i.end=t.end+n.mapping}return!0}},{key:"saveDiscontinuitySyncInfo_",value:function(e){var t=e.playlist,i=e.segment;if(i.discontinuity)this.discontinuities[i.timeline]={time:i.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(var n=0;n<t.discontinuityStarts.length;n++){var r=t.discontinuityStarts[n],a=t.discontinuitySequence+n+1,s=r-e.mediaIndex,o=Math.abs(s);if(!this.discontinuities[a]||this.discontinuities[a].accuracy>o){var u=void 0;u=s<0?i.start-rs(t,e.mediaIndex,r):i.end+rs(t,e.mediaIndex+1,r),this.discontinuities[a]={time:u,accuracy:o}}}}}]),t}(Ma.EventTarget),zo=new Gs("./decrypter-worker.worker.js",(function(e,t){var i=this;!function(){var e=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},t=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),n=null,r=function(){function t(i){e(this,t),n||(n=function(){var e=[[[],[],[],[],[]],[[],[],[],[],[]]],t=e[0],i=e[1],n=t[4],r=i[4],a=void 0,s=void 0,o=void 0,u=[],l=[],c=void 0,h=void 0,d=void 0,p=void 0,f=void 0;for(a=0;a<256;a++)l[(u[a]=a<<1^283*(a>>7))^a]=a;for(s=o=0;!n[s];s^=c||1,o=l[o]||1)for(d=(d=o^o<<1^o<<2^o<<3^o<<4)>>8^255&d^99,n[s]=d,r[d]=s,f=16843009*u[h=u[c=u[s]]]^65537*h^257*c^16843008*s,p=257*u[d]^16843008*d,a=0;a<4;a++)t[a][s]=p=p<<24^p>>>8,i[a][d]=f=f<<24^f>>>8;for(a=0;a<5;a++)t[a]=t[a].slice(0),i[a]=i[a].slice(0);return e}()),this._tables=[[n[0][0].slice(),n[0][1].slice(),n[0][2].slice(),n[0][3].slice(),n[0][4].slice()],[n[1][0].slice(),n[1][1].slice(),n[1][2].slice(),n[1][3].slice(),n[1][4].slice()]];var r=void 0,a=void 0,s=void 0,o=void 0,u=void 0,l=this._tables[0][4],c=this._tables[1],h=i.length,d=1;if(4!==h&&6!==h&&8!==h)throw new Error("Invalid aes key size");for(o=i.slice(0),u=[],this._key=[o,u],r=h;r<4*h+28;r++)s=o[r-1],(r%h==0||8===h&&r%h==4)&&(s=l[s>>>24]<<24^l[s>>16&255]<<16^l[s>>8&255]<<8^l[255&s],r%h==0&&(s=s<<8^s>>>24^d<<24,d=d<<1^283*(d>>7))),o[r]=o[r-h]^s;for(a=0;r;a++,r--)s=o[3&a?r:r-4],u[a]=r<=4||a<4?s:c[0][l[s>>>24]]^c[1][l[s>>16&255]]^c[2][l[s>>8&255]]^c[3][l[255&s]]}return t.prototype.decrypt=function(e,t,i,n,r,a){var s=this._key[1],o=e^s[0],u=n^s[1],l=i^s[2],c=t^s[3],h=void 0,d=void 0,p=void 0,f=s.length/4-2,m=void 0,g=4,y=this._tables[1],v=y[0],_=y[1],b=y[2],T=y[3],S=y[4];for(m=0;m<f;m++)h=v[o>>>24]^_[u>>16&255]^b[l>>8&255]^T[255&c]^s[g],d=v[u>>>24]^_[l>>16&255]^b[c>>8&255]^T[255&o]^s[g+1],p=v[l>>>24]^_[c>>16&255]^b[o>>8&255]^T[255&u]^s[g+2],c=v[c>>>24]^_[o>>16&255]^b[u>>8&255]^T[255&l]^s[g+3],g+=4,o=h,u=d,l=p;for(m=0;m<4;m++)r[(3&-m)+a]=S[o>>>24]<<24^S[u>>16&255]<<16^S[l>>8&255]<<8^S[255&c]^s[g++],h=o,o=u,u=l,l=c,c=h},t}(),a=function(){function t(){e(this,t),this.listeners={}}return t.prototype.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.prototype.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e].splice(i,1),i>-1},t.prototype.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,n=0;n<i;++n)t[n].call(this,arguments[1]);else for(var r=Array.prototype.slice.call(arguments,1),a=t.length,s=0;s<a;++s)t[s].apply(this,r)},t.prototype.dispose=function(){this.listeners={}},t.prototype.pipe=function(e){this.on("data",(function(t){e.push(t)}))},t}(),s=function(t){function i(){e(this,i);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,t.call(this,a));return n.jobs=[],n.delay=1,n.timeout_=null,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(i,t),i.prototype.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},i.prototype.push=function(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},i}(a),o=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},u=function(){function i(t,n,r,a){e(this,i);var u=i.STEP,l=new Int32Array(t.buffer),c=new Uint8Array(t.byteLength),h=0;for(this.asyncStream_=new s,this.asyncStream_.push(this.decryptChunk_(l.subarray(h,h+u),n,r,c)),h=u;h<l.length;h+=u)r=new Uint32Array([o(l[h-4]),o(l[h-3]),o(l[h-2]),o(l[h-1])]),this.asyncStream_.push(this.decryptChunk_(l.subarray(h,h+u),n,r,c));this.asyncStream_.push((function(){var e;a(null,(e=c).subarray(0,e.byteLength-e[e.byteLength-1]))}))}return i.prototype.decryptChunk_=function(e,t,i,n){return function(){var a=function(e,t,i){var n=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),a=new r(Array.prototype.slice.call(t)),s=new Uint8Array(e.byteLength),u=new Int32Array(s.buffer),l=void 0,c=void 0,h=void 0,d=void 0,p=void 0,f=void 0,m=void 0,g=void 0,y=void 0;for(l=i[0],c=i[1],h=i[2],d=i[3],y=0;y<n.length;y+=4)p=o(n[y]),f=o(n[y+1]),m=o(n[y+2]),g=o(n[y+3]),a.decrypt(p,f,m,g,u,y),u[y]=o(u[y]^l),u[y+1]=o(u[y+1]^c),u[y+2]=o(u[y+2]^h),u[y+3]=o(u[y+3]^d),l=p,c=f,h=m,d=g;return s}(e,t,i);n.set(a,e.byteOffset)}},t(i,null,[{key:"STEP",get:function(){return 32e3}}]),i}(),l=new function(e){e.onmessage=function(t){var i=t.data,n=new Uint8Array(i.encrypted.bytes,i.encrypted.byteOffset,i.encrypted.byteLength),r=new Uint32Array(i.key.bytes,i.key.byteOffset,i.key.byteLength/4),a=new Uint32Array(i.iv.bytes,i.iv.byteOffset,i.iv.byteLength/4);new u(n,r,a,(function(t,n){var r,a;e.postMessage((r={source:i.source,decrypted:n},a={},Object.keys(r).forEach((function(e){var t=r[e];ArrayBuffer.isView(t)?a[e]={bytes:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength}:a[e]=t})),a),[n.buffer])}))}}(i)}()})),Wo=function(e){var t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},Go=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},Xo=function(e,t){t.activePlaylistLoader=e,e.load()},Yo={AUDIO:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e],r=t.blacklistCurrentPlaylist;Go(i,n);var a=n.activeTrack(),s=n.activeGroup(),o=(s.filter((function(e){return e.default}))[0]||s[0]).id,u=n.tracks[o];if(a!==u){for(var l in Ma.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),n.tracks)n.tracks[l].enabled=n.tracks[l]===u;n.onTrackChanged()}else r({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e];Ma.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),Go(i,n);var r=n.activeTrack();r&&(r.mode="disabled"),n.onTrackChanged()}}},$o={AUDIO:function(e,t,i){if(t){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,r),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),r),n.paused()||a.load()})),t.on("error",Yo[e](e,i))}},SUBTITLES:function(e,t,i){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e],s=i.mediaTypes[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,r),a.track(s.activeTrack()),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),r),n.paused()||a.load()})),t.on("error",Yo[e](e,i))}},Ko=function(e,t){return function(i){return i.attributes[e]===t}},Qo=function(e){return function(t){return t.resolvedUri===e}},Jo={AUDIO:function(e,t){var i=t.hls,n=t.sourceType,r=t.segmentLoaders[e],a=t.requestOptions.withCredentials,s=t.master,o=s.mediaGroups,u=s.playlists,l=t.mediaTypes[e],c=l.groups,h=l.tracks,d=t.masterPlaylistLoader;for(var p in o[e]&&0!==Object.keys(o[e]).length||(o[e]={main:{default:{default:!0}}}),o[e]){c[p]||(c[p]=[]);var f=u.filter(Ko(e,p));for(var m in o[e][p]){var g=o[e][p][m];f.filter(Qo(g.resolvedUri)).length&&delete g.resolvedUri;var y=void 0;if(y=g.resolvedUri?new es(g.resolvedUri,i,a):g.playlists&&"dash"===n?new yo(g.playlists[0],i,a,d):null,g=Ma.mergeOptions({id:m,playlistLoader:y},g),$o[e](e,g.playlistLoader,t),c[p].push(g),void 0===h[m]){var v=new Ma.AudioTrack({id:m,kind:Wo(g),enabled:!1,language:g.language,default:g.default,label:m});h[m]=v}}}r.on("error",Yo[e](e,t))},SUBTITLES:function(e,t){var i=t.tech,n=t.hls,r=t.sourceType,a=t.segmentLoaders[e],s=t.requestOptions.withCredentials,o=t.master.mediaGroups,u=t.mediaTypes[e],l=u.groups,c=u.tracks,h=t.masterPlaylistLoader;for(var d in o[e])for(var p in l[d]||(l[d]=[]),o[e][d])if(!o[e][d][p].forced){var f=o[e][d][p],m=void 0;if("hls"===r?m=new es(f.resolvedUri,n,s):"dash"===r&&(m=new yo(f.playlists[0],n,s,h)),f=Ma.mergeOptions({id:p,playlistLoader:m},f),$o[e](e,f.playlistLoader,t),l[d].push(f),void 0===c[p]){var g=i.addRemoteTextTrack({id:p,kind:"subtitles",default:f.default&&f.autoselect,language:f.language,label:p},!1).track;c[p]=g}}a.on("error",Yo[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var i=t.tech,n=t.master.mediaGroups,r=t.mediaTypes[e],a=r.groups,s=r.tracks;for(var o in n[e])for(var u in a[o]||(a[o]=[]),n[e][o]){var l=n[e][o][u];if(l.instreamId.match(/CC\d/)&&(a[o].push(Ma.mergeOptions({id:u},l)),void 0===s[u])){var c=i.addRemoteTextTrack({id:l.instreamId,kind:"captions",default:l.default&&l.autoselect,language:l.language,label:u},!1).track;s[u]=c}}}},Zo={AUDIO:function(e,t){return function(){var i=t.mediaTypes[e].tracks;for(var n in i)if(i[n].enabled)return i[n];return null}},SUBTITLES:function(e,t){return function(){var i=t.mediaTypes[e].tracks;for(var n in i)if("showing"===i[n].mode)return i[n];return null}}},eu=function(e){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((function(t){Jo[t](t,e)}));var t=e.mediaTypes,i=e.masterPlaylistLoader,n=e.tech,r=e.hls;["AUDIO","SUBTITLES"].forEach((function(i){t[i].activeGroup=function(e,t){return function(i){var n=t.masterPlaylistLoader,r=t.mediaTypes[e].groups,a=n.media();if(!a)return null;var s=null;return a.attributes[e]&&(s=r[a.attributes[e]]),s=s||r.main,void 0===i?s:null===i?null:s.filter((function(e){return e.id===i.id}))[0]||null}}(i,e),t[i].activeTrack=Zo[i](i,e),t[i].onGroupChanged=function(e,t){return function(){var i=t.segmentLoaders,n=i[e],r=i.main,a=t.mediaTypes[e],s=a.activeTrack(),o=a.activeGroup(s),u=a.activePlaylistLoader;Go(n,a),o&&(o.playlistLoader?(n.resyncLoader(),Xo(o.playlistLoader,a)):u&&r.resetEverything())}}(i,e),t[i].onTrackChanged=function(e,t){return function(){var i=t.segmentLoaders,n=i[e],r=i.main,a=t.mediaTypes[e],s=a.activeTrack(),o=a.activeGroup(s),u=a.activePlaylistLoader;Go(n,a),o&&(o.playlistLoader?u!==o.playlistLoader?(n.track&&n.track(s),n.resetEverything(),Xo(o.playlistLoader,a)):Xo(o.playlistLoader,a):r.resetEverything())}}(i,e)}));var a=t.AUDIO.activeGroup(),s=(a.filter((function(e){return e.default}))[0]||a[0]).id;t.AUDIO.tracks[s].enabled=!0,t.AUDIO.onTrackChanged(),i.on("mediachange",(function(){["AUDIO","SUBTITLES"].forEach((function(e){return t[e].onGroupChanged()}))}));var o=function(){t.AUDIO.onTrackChanged(),n.trigger({type:"usage",name:"hls-audio-change"})};for(var u in n.audioTracks().addEventListener("change",o),n.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),r.on("dispose",(function(){n.audioTracks().removeEventListener("change",o),n.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)})),n.clearTracks("audio"),t.AUDIO.tracks)n.audioTracks().addTrack(t.AUDIO.tracks[u])},tu=void 0,iu=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred"],nu=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]},ru=function(e){function t(e){Fa(this,t);var i,n=za(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),r=e.url,a=e.withCredentials,s=e.tech,o=e.bandwidth,u=e.externHls,l=e.useCueTags,c=e.blacklistDuration,h=e.enableLowInitialPlaylist,d=e.sourceType,p=e.seekTo;if(!r)throw new Error("A non-empty playlist URL is required");tu=u,n.withCredentials=a,n.tech_=s,n.hls_=s.hls,n.seekTo_=p,n.sourceType_=d,n.useCueTags_=l,n.blacklistDuration=c,n.enableLowInitialPlaylist=h,n.useCueTags_&&(n.cueTagsTrack_=n.tech_.addTextTrack("metadata","ad-cues"),n.cueTagsTrack_.inBandMetadataTrackDispatchType=""),n.requestOptions_={withCredentials:n.withCredentials,timeout:null},n.mediaTypes_=(i={},["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((function(e){i[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:_o,activeTrack:_o,onGroupChanged:_o,onTrackChanged:_o}})),i),n.mediaSource=new Ma.MediaSource,n.mediaSource.addEventListener("sourceopen",n.handleSourceOpen_.bind(n)),n.seekable_=Ma.createTimeRanges(),n.hasPlayed_=function(){return!1},n.syncController_=new qo(e),n.segmentMetadataTrack_=s.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,n.decrypter_=new zo,n.inbandTextTracks_={};var f={hls:n.hls_,mediaSource:n.mediaSource,currentTime:n.tech_.currentTime.bind(n.tech_),seekable:function(){return n.seekable()},seeking:function(){return n.tech_.seeking()},duration:function(){return n.mediaSource.duration},hasPlayed:function(){return n.hasPlayed_()},goalBufferLength:function(){return n.goalBufferLength()},bandwidth:o,syncController:n.syncController_,decrypter:n.decrypter_,sourceType:n.sourceType_,inbandTextTracks:n.inbandTextTracks_};return n.masterPlaylistLoader_="dash"===n.sourceType_?new yo(r,n.hls_,n.withCredentials):new es(r,n.hls_,n.withCredentials),n.setupMasterPlaylistLoaderListeners_(),n.mainSegmentLoader_=new Mo(Ma.mergeOptions(f,{segmentMetadataTrack:n.segmentMetadataTrack_,loaderType:"main"}),e),n.audioSegmentLoader_=new Mo(Ma.mergeOptions(f,{loaderType:"audio"}),e),n.subtitleSegmentLoader_=new jo(Ma.mergeOptions(f,{loaderType:"vtt"}),e),n.setupSegmentLoaderListeners_(),iu.forEach((function(e){n[e+"_"]=nu.bind(n,e)})),n.logger_=vo("MPC"),n.masterPlaylistLoader_.load(),n}return qa(t,e),Va(t,[{key:"setupMasterPlaylistLoaderListeners_",value:function(){var e=this;this.masterPlaylistLoader_.on("loadedmetadata",(function(){var t=e.masterPlaylistLoader_.media(),i=1.5*e.masterPlaylistLoader_.targetDuration*1e3;ms(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=i,t.endList&&"none"!==e.tech_.preload()&&(e.mainSegmentLoader_.playlist(t,e.requestOptions_),e.mainSegmentLoader_.load()),eu({sourceType:e.sourceType_,segmentLoaders:{AUDIO:e.audioSegmentLoader_,SUBTITLES:e.subtitleSegmentLoader_,main:e.mainSegmentLoader_},tech:e.tech_,requestOptions:e.requestOptions_,masterPlaylistLoader:e.masterPlaylistLoader_,hls:e.hls_,master:e.master(),mediaTypes:e.mediaTypes_,blacklistCurrentPlaylist:e.blacklistCurrentPlaylist.bind(e)}),e.triggerPresenceUsage_(e.master(),t);try{e.setupSourceBuffers_()}catch(t){return Ma.log.warn("Failed to create SourceBuffers",t),e.mediaSource.endOfStream("decode")}e.setupFirstPlay(),e.trigger("selectedinitialmedia")})),this.masterPlaylistLoader_.on("loadedplaylist",(function(){var t=e.masterPlaylistLoader_.media();if(!t){e.excludeUnsupportedVariants_();var i=void 0;return e.enableLowInitialPlaylist&&(i=e.selectInitialPlaylist()),i||(i=e.selectPlaylist()),e.initialMedia_=i,void e.masterPlaylistLoader_.media(e.initialMedia_)}if(e.useCueTags_&&e.updateAdCues_(t),e.mainSegmentLoader_.playlist(t,e.requestOptions_),e.updateDuration(),e.tech_.paused()||(e.mainSegmentLoader_.load(),e.audioSegmentLoader_&&e.audioSegmentLoader_.load()),!t.endList){var n=function(){var t=e.seekable();0!==t.length&&e.mediaSource.addSeekableRange_(t.start(0),t.end(0))};if(e.duration()!==1/0){e.tech_.one("durationchange",(function t(){e.duration()===1/0?n():e.tech_.one("durationchange",t)}))}else n()}})),this.masterPlaylistLoader_.on("error",(function(){e.blacklistCurrentPlaylist(e.masterPlaylistLoader_.error)})),this.masterPlaylistLoader_.on("mediachanging",(function(){e.mainSegmentLoader_.abort(),e.mainSegmentLoader_.pause()})),this.masterPlaylistLoader_.on("mediachange",(function(){var t=e.masterPlaylistLoader_.media(),i=1.5*e.masterPlaylistLoader_.targetDuration*1e3;ms(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=i,e.mainSegmentLoader_.playlist(t,e.requestOptions_),e.mainSegmentLoader_.load(),e.tech_.trigger({type:"mediachange",bubbles:!0})})),this.masterPlaylistLoader_.on("playlistunchanged",(function(){var t=e.masterPlaylistLoader_.media();e.stuckAtPlaylistEnd_(t)&&(e.blacklistCurrentPlaylist({message:"Playlist no longer updating."}),e.tech_.trigger("playliststuck"))})),this.masterPlaylistLoader_.on("renditiondisabled",(function(){e.tech_.trigger({type:"usage",name:"hls-rendition-disabled"})})),this.masterPlaylistLoader_.on("renditionenabled",(function(){e.tech_.trigger({type:"usage",name:"hls-rendition-enabled"})}))}},{key:"triggerPresenceUsage_",value:function(e,t){var i=e.mediaGroups||{},n=!0,r=Object.keys(i.AUDIO);for(var a in i.AUDIO)for(var s in i.AUDIO[a]){i.AUDIO[a][s].uri||(n=!1)}n&&this.tech_.trigger({type:"usage",name:"hls-demuxed"}),Object.keys(i.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"hls-webvtt"}),tu.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"hls-aes"}),tu.Playlist.isFmp4(t)&&this.tech_.trigger({type:"usage",name:"hls-fmp4"}),r.length&&Object.keys(i.AUDIO[r[0]]).length>1&&this.tech_.trigger({type:"usage",name:"hls-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"})}},{key:"setupSegmentLoaderListeners_",value:function(){var e=this;this.mainSegmentLoader_.on("bandwidthupdate",(function(){var t=e.selectPlaylist(),i=e.masterPlaylistLoader_.media(),n=e.tech_.buffered(),r=n.length?n.end(n.length-1)-e.tech_.currentTime():0,a=e.bufferLowWaterLine();(!i.endList||e.duration()<To.MAX_BUFFER_LOW_WATER_LINE||t.attributes.BANDWIDTH<i.attributes.BANDWIDTH||r>=a)&&e.masterPlaylistLoader_.media(t),e.tech_.trigger("bandwidthupdate")})),this.mainSegmentLoader_.on("progress",(function(){e.trigger("progress")})),this.mainSegmentLoader_.on("error",(function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error())})),this.mainSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.mainSegmentLoader_.on("timestampoffset",(function(){e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})})),this.audioSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.mainSegmentLoader_.on("ended",(function(){e.onEndOfStream()})),this.mainSegmentLoader_.on("earlyabort",(function(){e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120)})),this.mainSegmentLoader_.on("reseteverything",(function(){e.tech_.trigger("hls-reset")})),this.mainSegmentLoader_.on("segmenttimemapping",(function(t){e.tech_.trigger({type:"hls-segment-time-mapping",mapping:t.mapping})})),this.audioSegmentLoader_.on("ended",(function(){e.onEndOfStream()}))}},{key:"mediaSecondsLoaded_",value:function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}},{key:"load",value:function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}},{key:"smoothQualityChange_",value:function(){var e=this.selectPlaylist();e!==this.masterPlaylistLoader_.media()&&(this.masterPlaylistLoader_.media(e),this.mainSegmentLoader_.resetLoader())}},{key:"fastQualityChange_",value:function(){var e=this,t=this.selectPlaylist();t!==this.masterPlaylistLoader_.media()&&(this.masterPlaylistLoader_.media(t),this.mainSegmentLoader_.resetEverything((function(){Ma.browser.IE_VERSION||Ma.browser.IS_EDGE?e.tech_.setCurrentTime(e.tech_.currentTime()+.04):e.tech_.setCurrentTime(e.tech_.currentTime())})))}},{key:"play",value:function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.seekTo_(0),this.hasPlayed_()&&this.load();var e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0)?this.seekTo_(e.end(e.length-1)):void 0}}},{key:"setupFirstPlay",value:function(){var e=this,t=this.masterPlaylistLoader_.media();if(!t||this.tech_.paused()||this.hasPlayed_())return!1;if(!t.endList){var i=this.seekable();if(!i.length)return!1;if(Ma.browser.IE_VERSION&&0===this.tech_.readyState())return this.tech_.one("loadedmetadata",(function(){e.trigger("firstplay"),e.seekTo_(i.end(0)),e.hasPlayed_=function(){return!0}})),!1;this.trigger("firstplay"),this.seekTo_(i.end(0))}return this.hasPlayed_=function(){return!0},this.load(),!0}},{key:"handleSourceOpen_",value:function(){try{this.setupSourceBuffers_()}catch(e){return Ma.log.warn("Failed to create Source Buffers",e),this.mediaSource.endOfStream("decode")}if(this.tech_.autoplay()){var e=this.tech_.play();void 0!==e&&"function"==typeof e.then&&e.then(null,(function(e){}))}this.trigger("sourceopen")}},{key:"onEndOfStream",value:function(){var e=this.mainSegmentLoader_.ended_;this.mediaTypes_.AUDIO.activePlaylistLoader&&(e=!this.mainSegmentLoader_.startingMedia_||this.mainSegmentLoader_.startingMedia_.containsVideo?e&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_),e&&this.mediaSource.endOfStream()}},{key:"stuckAtPlaylistEnd_",value:function(e){if(!this.seekable().length)return!1;var t=this.syncController_.getExpiredTime(e,this.mediaSource.duration);if(null===t)return!1;var i=tu.Playlist.playlistEnd(e,t),n=this.tech_.currentTime(),r=this.tech_.buffered();if(!r.length)return i-n<=Us;var a=r.end(r.length-1);return a-n<=Us&&i-a<=Us}},{key:"blacklistCurrentPlaylist",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1],i=void 0,n=void 0;if(i=e.playlist||this.masterPlaylistLoader_.media(),t=t||e.blacklistDuration||this.blacklistDuration,!i){this.error=e;try{return this.mediaSource.endOfStream("network")}catch(e){return this.trigger("error")}}var r=1===this.masterPlaylistLoader_.master.playlists.filter(ps).length;return r?(Ma.log.warn("Problem encountered with the current HLS playlist. Trying again since it is the final playlist."),this.tech_.trigger("retryplaylist"),this.masterPlaylistLoader_.load(r)):(i.excludeUntil=Date.now()+1e3*t,this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"}),n=this.selectPlaylist(),Ma.log.warn("Problem encountered with the current HLS playlist."+(e.message?" "+e.message:"")+" Switching to another playlist."),this.masterPlaylistLoader_.media(n))}},{key:"pauseLoading",value:function(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}},{key:"setCurrentTime",value:function(e){var t=Ds(this.tech_.buffered(),e);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0}},{key:"duration",value:function(){return this.masterPlaylistLoader_?this.mediaSource?this.mediaSource.duration:tu.Playlist.duration(this.masterPlaylistLoader_.media()):0}},{key:"seekable",value:function(){return this.seekable_}},{key:"onSyncInfoUpdate_",value:function(){var e=void 0,t=void 0;if(this.masterPlaylistLoader_){var i=this.masterPlaylistLoader_.media();if(i){var n=this.syncController_.getExpiredTime(i,this.mediaSource.duration);if(null!==n&&0!==(e=tu.Playlist.seekable(i,n)).length){if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(i=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null===(n=this.syncController_.getExpiredTime(i,this.mediaSource.duration)))return;if(0===(t=tu.Playlist.seekable(i,n)).length)return}t?t.start(0)>e.end(0)||e.start(0)>t.end(0)?this.seekable_=e:this.seekable_=Ma.createTimeRanges([[t.start(0)>e.start(0)?t.start(0):e.start(0),t.end(0)<e.end(0)?t.end(0):e.end(0)]]):this.seekable_=e,this.logger_("seekable updated ["+Ms(this.seekable_)+"]"),this.tech_.trigger("seekablechanged")}}}}},{key:"updateDuration",value:function(){var e=this,t=this.mediaSource.duration,i=tu.Playlist.duration(this.masterPlaylistLoader_.media()),n=this.tech_.buffered(),r=function t(){e.mediaSource.duration=i,e.tech_.trigger("durationchange"),e.mediaSource.removeEventListener("sourceopen",t)};n.length>0&&(i=Math.max(i,n.end(n.length-1))),t!==i&&("open"!==this.mediaSource.readyState?this.mediaSource.addEventListener("sourceopen",r):r())}},{key:"dispose",value:function(){var e=this;this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),["AUDIO","SUBTITLES"].forEach((function(t){var i=e.mediaTypes_[t].groups;for(var n in i)i[n].forEach((function(e){e.playlistLoader&&e.playlistLoader.dispose()}))})),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose()}},{key:"master",value:function(){return this.masterPlaylistLoader_.master}},{key:"media",value:function(){return this.masterPlaylistLoader_.media()||this.initialMedia_}},{key:"setupSourceBuffers_",value:function(){var e,t=this.masterPlaylistLoader_.media();if(t&&"open"===this.mediaSource.readyState){if((e=io(this.masterPlaylistLoader_.master,t)).length<1)return this.error="No compatible SourceBuffer configuration for the variant stream:"+t.resolvedUri,this.mediaSource.endOfStream("decode");this.configureLoaderMimeTypes_(e),this.excludeIncompatibleVariants_(t)}}},{key:"configureLoaderMimeTypes_",value:function(e){var t=e.length>1&&-1===e[0].indexOf(",")&&e[0]!==e[1]?new Ma.EventTarget:null;this.mainSegmentLoader_.mimeType(e[0],t),e[1]&&this.audioSegmentLoader_.mimeType(e[1],t)}},{key:"excludeUnsupportedVariants_",value:function(){this.master().playlists.forEach((function(e){var t;e.attributes.CODECS&&f().MediaSource&&f().MediaSource.isTypeSupported&&!f().MediaSource.isTypeSupported('video/mp4; codecs="'+(t=e.attributes.CODECS,t.replace(/avc1\.(\d+)\.(\d+)/i,(function(e){return Zs([e])[0]}))+'"'))&&(e.excludeUntil=1/0)}))}},{key:"excludeIncompatibleVariants_",value:function(e){var t=2,i=null,n=void 0;e.attributes.CODECS&&(n=eo(e.attributes.CODECS),i=n.videoCodec,t=n.codecCount),this.master().playlists.forEach((function(e){var n={codecCount:2,videoCodec:null};e.attributes.CODECS&&(n=eo(e.attributes.CODECS)),n.codecCount!==t&&(e.excludeUntil=1/0),n.videoCodec!==i&&(e.excludeUntil=1/0)}))}},{key:"updateAdCues_",value:function(e){var t=0,i=this.seekable();i.length&&(t=i.start(0)),function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(e.segments)for(var n=i,r=void 0,a=0;a<e.segments.length;a++){var s=e.segments[a];if(r||(r=Fo(t,n+s.duration/2)),r){if("cueIn"in s){r.endTime=n,r.adEndTime=n,n+=s.duration,r=null;continue}if(n<r.endTime){n+=s.duration;continue}r.endTime+=s.duration}else if("cueOut"in s&&((r=new(f().VTTCue)(n,n+s.duration,s.cueOut)).adStartTime=n,r.adEndTime=n+parseFloat(s.cueOut),t.addCue(r)),"cueOutCont"in s){var o=void 0,u=void 0,l=s.cueOutCont.split("/").map(parseFloat),c=Wa(l,2);o=c[0],u=c[1],(r=new(f().VTTCue)(n,n+s.duration,"")).adStartTime=n-o,r.adEndTime=r.adStartTime+u,t.addCue(r)}n+=s.duration}}(e,this.cueTagsTrack_,t)}},{key:"goalBufferLength",value:function(){var e=this.tech_.currentTime(),t=To.GOAL_BUFFER_LENGTH,i=To.GOAL_BUFFER_LENGTH_RATE,n=Math.max(t,To.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,n)}},{key:"bufferLowWaterLine",value:function(){var e=this.tech_.currentTime(),t=To.BUFFER_LOW_WATER_LINE,i=To.BUFFER_LOW_WATER_LINE_RATE,n=Math.max(t,To.MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,n)}}]),t}(Ma.EventTarget),au=function e(t,i,n){Fa(this,e);var r,a,s,o=t.masterPlaylistController_,u=o[(t.options_.smoothQualityChange?"smooth":"fast")+"QualityChange_"].bind(o);if(i.attributes.RESOLUTION){var l=i.attributes.RESOLUTION;this.width=l.width,this.height=l.height}this.bandwidth=i.attributes.BANDWIDTH,this.id=n,this.enabled=(r=t.playlists,a=i.uri,s=u,function(e){var t=r.master.playlists[a],i=ds(t),n=ps(t);return void 0===e?n:(e?delete t.disabled:t.disabled=!0,e===n||i||(s(),e?r.trigger("renditionenabled"):r.trigger("renditiondisabled")),e)})},su=["seeking","seeked","pause","playing","error"],ou=function(){function e(t){var i=this;Fa(this,e),this.tech_=t.tech,this.seekable=t.seekable,this.seekTo=t.seekTo,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=vo("PlaybackWatcher"),this.logger_("initialize");var n=function(){return i.monitorCurrentTime_()},r=function(){return i.techWaiting_()},a=function(){return i.cancelTimer_()},s=function(){return i.fixesBadSeeks_()};this.tech_.on("seekablechanged",s),this.tech_.on("waiting",r),this.tech_.on(su,a),this.tech_.on("canplay",n),this.dispose=function(){i.logger_("dispose"),i.tech_.off("seekablechanged",s),i.tech_.off("waiting",r),i.tech_.off(su,a),i.tech_.off("canplay",n),i.checkCurrentTimeTimeout_&&f().clearTimeout(i.checkCurrentTimeTimeout_),i.cancelTimer_()}}return Va(e,[{key:"monitorCurrentTime_",value:function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&f().clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=f().setTimeout(this.monitorCurrentTime_.bind(this),250)}},{key:"checkCurrentTime_",value:function(){if(this.tech_.seeking()&&this.fixesBadSeeks_())return this.consecutiveUpdates=0,void(this.lastRecordedTime=this.tech_.currentTime());if(!this.tech_.paused()&&!this.tech_.seeking()){var e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+Us>=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}}},{key:"cancelTimer_",value:function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null}},{key:"fixesBadSeeks_",value:function(){var e=this.tech_.seeking(),t=this.seekable(),i=this.tech_.currentTime(),n=void 0;e&&this.afterSeekableWindow_(t,i)&&(n=t.end(t.length-1));e&&this.beforeSeekableWindow_(t,i)&&(n=t.start(0)+Us);return void 0!==n&&(this.logger_("Trying to seek outside of seekable at time "+i+" with seekable range "+Ms(t)+". Seeking to "+n+"."),this.seekTo(n),!0)}},{key:"waiting_",value:function(){if(!this.techWaiting_()){var e=this.tech_.currentTime(),t=this.tech_.buffered(),i=Ds(t,e);return i.length&&e+3<=i.end(0)?(this.cancelTimer_(),this.seekTo(e),this.logger_("Stopped at "+e+" while inside a buffered region ["+i.start(0)+" -> "+i.end(0)+"]. Attempting to resume playback by seeking to the current time."),void this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})):void 0}}},{key:"techWaiting_",value:function(){var e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking()&&this.fixesBadSeeks_())return!0;if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(e,t)){var i=e.end(e.length-1);return this.logger_("Fell out of live window at time "+t+". Seeking to live point (seekable end) "+i),this.cancelTimer_(),this.seekTo(i),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var n=this.tech_.buffered(),r=Rs(n,t);if(this.videoUnderflow_(r,n,t))return this.cancelTimer_(),this.seekTo(t),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;if(r.length>0){var a=r.start(0)-t;return this.logger_("Stopped at "+t+", setting timer for "+a+", seeking to "+r.start(0)),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*a,t),!0}return!1}},{key:"afterSeekableWindow_",value:function(e,t){return!!e.length&&t>e.end(e.length-1)+Us}},{key:"beforeSeekableWindow_",value:function(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-Us)}},{key:"videoUnderflow_",value:function(e,t,i){if(0===e.length){var n=this.gapFromVideoUnderflow_(t,i);if(n)return this.logger_("Encountered a gap in video from "+n.start+" to "+n.end+". Seeking to current time "+i),!0}return!1}},{key:"skipTheGap_",value:function(e){var t=this.tech_.buffered(),i=this.tech_.currentTime(),n=Rs(t,i);this.cancelTimer_(),0!==n.length&&i===e&&(this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",e,"nextRange start:",n.start(0)),this.seekTo(n.start(0)+xs),this.tech_.trigger({type:"usage",name:"hls-gap-skip"}))}},{key:"gapFromVideoUnderflow_",value:function(e,t){for(var i=function(e){if(e.length<2)return Ma.createTimeRanges();for(var t=[],i=1;i<e.length;i++){var n=e.end(i-1),r=e.start(i);t.push([n,r])}return Ma.createTimeRanges(t)}(e),n=0;n<i.length;n++){var r=i.start(n),a=i.end(n);if(t-r<4&&t-r>2)return{start:r,end:a}}return null}}]),e}(),uu={errorInterval:30,getSource:function(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_)}},lu=function e(t,i){var n=0,r=0,a=Ma.mergeOptions(uu,i);t.ready((function(){t.trigger({type:"usage",name:"hls-error-reload-initialized"})}));var s=function(){r&&t.currentTime(r)},o=function(e){null!=e&&(r=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",s),t.src(e),t.trigger({type:"usage",name:"hls-error-reload"}),t.play())},u=function(){if(Date.now()-n<1e3*a.errorInterval)t.trigger({type:"usage",name:"hls-error-reload-canceled"});else{if(a.getSource&&"function"==typeof a.getSource)return n=Date.now(),a.getSource.call(t,o);Ma.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")}},l=function e(){t.off("loadedmetadata",s),t.off("error",u),t.off("dispose",e)};t.on("error",u),t.on("dispose",l),t.reloadSourceOnError=function(i){l(),e(t,i)}},cu=function(e){lu(this,e)};Ma.use("*",(function(e){return{setSource:function(e,t){t(null,e)},setCurrentTime:function(t){return e.vhs&&e.currentSource().src===e.vhs.source_.src&&e.vhs.setCurrentTime(t),t},play:function(){e.vhs&&e.currentSource().src===e.vhs.source_.src&&e.vhs.setCurrentTime(e.currentTime())}}}));var hu={PlaylistLoader:es,Playlist:gs,Decrypter:Le,AsyncStream:Ce,decrypt:Ae,utils:Es,STANDARD_PLAYLIST_SELECTOR:function(){return function(e,t,i,n,r){var a=e.playlists.map((function(e){var t,i;return t=e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,i=e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height,{bandwidth:e.attributes.BANDWIDTH||f().Number.MAX_VALUE,width:t,height:i,playlist:e}}));Uo(a,(function(e,t){return e.bandwidth-t.bandwidth}));var s=(a=a.filter((function(e){return!gs.isIncompatible(e.playlist)}))).filter((function(e){return gs.isEnabled(e.playlist)}));s.length||(s=a.filter((function(e){return!gs.isDisabled(e.playlist)})));var o=s.filter((function(e){return e.bandwidth*To.BANDWIDTH_VARIANCE<t})),u=o[o.length-1],l=o.filter((function(e){return e.bandwidth===u.bandwidth}))[0];if(!1===r){var c=l||s[0]||a[0];return c?c.playlist:null}var h=o.filter((function(e){return e.width&&e.height}));Uo(h,(function(e,t){return e.width-t.width}));var d=h.filter((function(e){return e.width===i&&e.height===n}));u=d[d.length-1];var p=d.filter((function(e){return e.bandwidth===u.bandwidth}))[0],m=void 0,g=void 0,y=void 0;p||(g=(m=h.filter((function(e){return e.width>i||e.height>n}))).filter((function(e){return e.width===m[0].width&&e.height===m[0].height})),u=g[g.length-1],y=g.filter((function(e){return e.bandwidth===u.bandwidth}))[0]);var v=y||p||l||s[0]||a[0];return v?v.playlist:null}(this.playlists.master,this.systemBandwidth,parseInt(xo(this.tech_.el(),"width"),10),parseInt(xo(this.tech_.el(),"height"),10),this.limitRenditionByPlayerDimensions)},INITIAL_PLAYLIST_SELECTOR:function(){var e=this.playlists.master.playlists.filter(gs.isEnabled);return Uo(e,(function(e,t){return Io(e,t)})),e.filter((function(e){return eo(e.attributes.CODECS).videoCodec}))[0]||null},comparePlaylistBandwidth:Io,comparePlaylistResolution:function(e,t){var i=void 0,n=void 0;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||f().Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(n=t.attributes.RESOLUTION.width),i===(n=n||f().Number.MAX_VALUE)&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-n},xhr:_s()};["GOAL_BUFFER_LENGTH","MAX_GOAL_BUFFER_LENGTH","GOAL_BUFFER_LENGTH_RATE","BUFFER_LOW_WATER_LINE","MAX_BUFFER_LOW_WATER_LINE","BUFFER_LOW_WATER_LINE_RATE","BANDWIDTH_VARIANCE"].forEach((function(e){Object.defineProperty(hu,e,{get:function(){return Ma.log.warn("using Hls."+e+" is UNSAFE be sure you know what you are doing"),To[e]},set:function(t){Ma.log.warn("using Hls."+e+" is UNSAFE be sure you know what you are doing"),"number"!=typeof t||t<0?Ma.log.warn("value of Hls."+e+" must be greater than or equal to 0"):To[e]=t}})}));var du="videojs-vhs",pu=function(e){if(/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i.test(e))return"hls";return/^application\/dash\+xml/i.test(e)?"dash":null},fu=function(e,t){for(var i=t.media(),n=-1,r=0;r<e.length;r++)if(e[r].id===i.uri){n=r;break}e.selectedIndex_=n,e.trigger({selectedIndex:n,type:"change"})};hu.canPlaySource=function(){return Ma.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var mu=function(e){if("dash"===e.options_.sourceType){var t=Ma.players[e.tech_.options_.playerId];if(t.eme){var i=function(e,t,i){if(!e)return e;var n={};for(var r in e)n[r]={audioContentType:'audio/mp4; codecs="'+i.attributes.CODECS+'"',videoContentType:'video/mp4; codecs="'+t.attributes.CODECS+'"'},t.contentProtection&&t.contentProtection[r]&&t.contentProtection[r].pssh&&(n[r].pssh=t.contentProtection[r].pssh),"string"==typeof e[r]&&(n[r].url=e[r]);return Ma.mergeOptions(e,n)}(e.source_.keySystems,e.playlists.media(),e.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader.media());i&&(t.currentSource().keySystems=i,t.eme.initializeMediaKeys&&t.eme.initializeMediaKeys())}}},gu=function(){if(!window.localStorage)return null;var e=window.localStorage.getItem(du);if(!e)return null;try{return JSON.parse(e)}catch(e){return null}};hu.supportsNativeHls=function(){var e=C().createElement("video");if(!Ma.getTech("Html5").isSupported())return!1;return["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some((function(t){return/maybe|probably/i.test(e.canPlayType(t))}))}(),hu.supportsNativeDash=!!Ma.getTech("Html5").isSupported()&&/maybe|probably/i.test(C().createElement("video").canPlayType("application/dash+xml")),hu.supportsTypeNatively=function(e){return"hls"===e?hu.supportsNativeHls:"dash"===e&&hu.supportsNativeDash},hu.isSupported=function(){return Ma.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var yu=function(e){function t(e,i,n){Fa(this,t);var r=za(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,i,n.hls));if(i.options_&&i.options_.playerId){var a=Ma(i.options_.playerId);a.hasOwnProperty("hls")||Object.defineProperty(a,"hls",{get:function(){return Ma.log.warn("player.hls is deprecated. Use player.tech().hls instead."),i.trigger({type:"usage",name:"hls-player-access"}),r},configurable:!0}),a.vhs=r,a.dash=r,r.player_=a}if(r.tech_=i,r.source_=e,r.stats={},r.setOptions_(),r.options_.overrideNative&&i.overrideNativeAudioTracks&&i.overrideNativeVideoTracks)i.overrideNativeAudioTracks(!0),i.overrideNativeVideoTracks(!0);else if(r.options_.overrideNative&&(i.featuresNativeVideoTracks||i.featuresNativeAudioTracks))throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB");return r.on(C(),["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],(function(e){var t=C().fullscreenElement||C().webkitFullscreenElement||C().mozFullScreenElement||C().msFullscreenElement;t&&t.contains(r.tech_.el())&&r.masterPlaylistController_.smoothQualityChange_()})),r.on(r.tech_,"seeking",(function(){this.tech_.seeking()&&0===this.tech_.currentTime()&&this.tech_.player_.loop()&&this.setCurrentTime(0)})),r.on(r.tech_,"error",(function(){this.masterPlaylistController_&&this.masterPlaylistController_.pauseLoading()})),r.on(r.tech_,"play",r.play),r}return qa(t,e),Va(t,[{key:"setOptions_",value:function(){var e=this;if(this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.smoothQualityChange=this.options_.smoothQualityChange||!1,this.options_.useBandwidthFromLocalStorage=void 0!==this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,"number"!=typeof this.options_.blacklistDuration&&(this.options_.blacklistDuration=300),"number"!=typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage){var t=gu();t&&t.bandwidth&&(this.options_.bandwidth=t.bandwidth,this.tech_.trigger({type:"usage",name:"hls-bandwidth-from-local-storage"})),t&&t.throughput&&(this.options_.throughput=t.throughput,this.tech_.trigger({type:"usage",name:"hls-throughput-from-local-storage"}))}"number"!=typeof this.options_.bandwidth&&(this.options_.bandwidth=To.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===To.INITIAL_BANDWIDTH,["withCredentials","limitRenditionByPlayerDimensions","bandwidth","smoothQualityChange"].forEach((function(t){void 0!==e.source_[t]&&(e.options_[t]=e.source_[t])})),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions}},{key:"src",value:function(e,t){var i=this;e&&(this.setOptions_(),this.options_.url=this.source_.src,this.options_.tech=this.tech_,this.options_.externHls=hu,this.options_.sourceType=pu(t),this.options_.seekTo=function(e){i.tech_.setCurrentTime(e),i.setCurrentTime(e)},this.masterPlaylistController_=new ru(this.options_),this.playbackWatcher_=new ou(Ma.mergeOptions(this.options_,{seekable:function(){return i.seekable()}})),this.masterPlaylistController_.on("error",(function(){Ma.players[i.tech_.options_.playerId].error(i.masterPlaylistController_.error)})),this.masterPlaylistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):hu.STANDARD_PLAYLIST_SELECTOR.bind(this),this.masterPlaylistController_.selectInitialPlaylist=hu.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.masterPlaylistController_.masterPlaylistLoader_,this.mediaSource=this.masterPlaylistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get:function(){return this.masterPlaylistController_.selectPlaylist},set:function(e){this.masterPlaylistController_.selectPlaylist=e.bind(this)}},throughput:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=e,this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.bandwidth},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=e,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var e=1/(this.bandwidth||1),t=void 0;return t=this.throughput>0?1/this.throughput:0,Math.floor(1/(e+t))},set:function(){Ma.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:function(){return i.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return i.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return i.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return i.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return i.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return i.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return i.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return i.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},buffered:{get:function(){return Bs(i.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return i.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return i.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return i.tech_.name_},enumerable:!0},duration:{get:function(){return i.tech_.duration()},enumerable:!0},master:{get:function(){return i.playlists.master},enumerable:!0},playerDimensions:{get:function(){return i.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return Bs(i.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return i.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",(function(){i.options_.useBandwidthFromLocalStorage&&function(e){if(!window.localStorage)return!1;var t=gu();t=t?Ma.mergeOptions(t,e):e;try{window.localStorage.setItem(du,JSON.stringify(t))}catch(e){return!1}}({bandwidth:i.bandwidth,throughput:Math.round(i.throughput)})})),this.masterPlaylistController_.on("selectedinitialmedia",(function(){var e,t;t=(e=i).playlists,e.representations=function(){return t.master.playlists.filter((function(e){return!ds(e)})).map((function(t,i){return new au(e,t,t.uri)}))},mu(i)})),this.on(this.masterPlaylistController_,"progress",(function(){this.tech_.trigger("progress")})),this.tech_.ready((function(){return i.setupQualityLevels_()})),this.tech_.el()&&this.tech_.src(Ma.URL.createObjectURL(this.masterPlaylistController_.mediaSource)))}},{key:"setupQualityLevels_",value:function(){var e=this,t=Ma.players[this.tech_.options_.playerId];t&&t.qualityLevels&&(this.qualityLevels_=t.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",(function(){var t,i;t=e.qualityLevels_,(i=e).representations().forEach((function(e){t.addQualityLevel(e)})),fu(t,i.playlists)})),this.playlists.on("mediachange",(function(){fu(e.qualityLevels_,e.playlists)})))}},{key:"play",value:function(){this.masterPlaylistController_.play()}},{key:"setCurrentTime",value:function(e){this.masterPlaylistController_.setCurrentTime(e)}},{key:"duration",value:function(){return this.masterPlaylistController_.duration()}},{key:"seekable",value:function(){return this.masterPlaylistController_.seekable()}},{key:"dispose",value:function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.hls&&delete this.tech_.hls,Ha(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"dispose",this).call(this)}},{key:"convertToStreamTime",value:function(e,t){return Os({playlist:this.masterPlaylistController_.media(),time:e,callback:t})}},{key:"seekToStreamTime",value:function(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2;return Ps({streamTime:e,playlist:this.masterPlaylistController_.media(),retryCount:n,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}}]),t}(Ma.getComponent("Component")),vu={name:"videojs-http-streaming",VERSION:"1.5.1",canHandleSource:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=Ma.mergeOptions(Ma.options,t);return vu.canPlayType(e.type,i)},handleSource:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=Ma.mergeOptions(Ma.options,i);return t.hls=new yu(e,t,n),t.hls.xhr=_s(),t.hls.src(e.src,e.type),t.hls},canPlayType:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=Ma.mergeOptions(Ma.options,t),n=i.hls.overrideNative,r=pu(e),a=r&&(!hu.supportsTypeNatively(r)||n);return a?"maybe":""}};void 0!==Ma.MediaSource&&void 0!==Ma.URL||(Ma.MediaSource=ho,Ma.URL=po),ho.supportsNativeMediaSources()&&Ma.getTech("Html5").registerSourceHandler(vu,0),Ma.HlsHandler=yu,Ma.HlsSourceHandler=vu,Ma.Hls=hu,Ma.use||Ma.registerComponent("Hls",hu),Ma.options.hls=Ma.options.hls||{},Ma.registerPlugin?Ma.registerPlugin("reloadSourceOnError",cu):Ma.plugin("reloadSourceOnError",cu);const _u=Ma},3407:(e,t,i)=>{var n=i(8908),r=e.exports={WebVTT:i(3706),VTTCue:i(2230),VTTRegion:i(3710)};n.vttjs=r,n.WebVTT=r.WebVTT;var a=r.VTTCue,s=r.VTTRegion,o=n.VTTCue,u=n.VTTRegion;r.shim=function(){n.VTTCue=a,n.VTTRegion=s},r.restore=function(){n.VTTCue=o,n.VTTRegion=u},n.VTTCue||r.shim()},3706:e=>{var t=Object.create||function(){function e(){}return function(t){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e}}();function i(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function n(e){function t(e,t,i,n){return 3600*(0|e)+60*(0|t)+(0|i)+(0|n)/1e3}var i=e.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return i?i[3]?t(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?t(i[1],i[2],0,i[4]):t(0,i[1],i[2],i[4]):null}function r(){this.values=t(null)}function a(e,t,i,n){var r=n?e.split(n):[e];for(var a in r)if("string"==typeof r[a]){var s=r[a].split(i);if(2===s.length)t(s[0],s[1])}}function s(e,t,s){var o=e;function u(){var t=n(e);if(null===t)throw new i(i.Errors.BadTimeStamp,"Malformed timestamp: "+o);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function l(){e=e.replace(/^\s+/,"")}if(l(),t.startTime=u(),l(),"--\x3e"!==e.substr(0,3))throw new i(i.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+o);e=e.substr(3),l(),t.endTime=u(),l(),function(e,t){var i=new r;a(e,(function(e,t){switch(e){case"region":for(var n=s.length-1;n>=0;n--)if(s[n].id===t){i.set(e,s[n].region);break}break;case"vertical":i.alt(e,t,["rl","lr"]);break;case"line":var r=t.split(","),a=r[0];i.integer(e,a),i.percent(e,a)&&i.set("snapToLines",!1),i.alt(e,a,["auto"]),2===r.length&&i.alt("lineAlign",r[1],["start","middle","end"]);break;case"position":r=t.split(","),i.percent(e,r[0]),2===r.length&&i.alt("positionAlign",r[1],["start","middle","end"]);break;case"size":i.percent(e,t);break;case"align":i.alt(e,t,["start","middle","end","left","right"])}}),/:/,/\s/),t.region=i.get("region",null),t.vertical=i.get("vertical",""),t.line=i.get("line","auto"),t.lineAlign=i.get("lineAlign","start"),t.snapToLines=i.get("snapToLines",!0),t.size=i.get("size",100),t.align=i.get("align","middle"),t.position=i.get("position",{start:0,left:0,middle:50,end:100,right:100},t.align),t.positionAlign=i.get("positionAlign",{start:"start",left:"start",middle:"middle",end:"end",right:"end"},t.align)}(e,t)}i.prototype=t(Error.prototype),i.prototype.constructor=i,i.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},r.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,i){for(var n=0;n<i.length;++n)if(t===i[n]){this.set(e,t);break}},integer:function(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))},percent:function(e,t){return!!(t.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(t=parseFloat(t))>=0&&t<=100)&&(this.set(e,t),!0)}};var o={"&amp;":"&","&lt;":"<","&gt;":">","&lrm;":"‎","&rlm;":"‏","&nbsp;":" "},u={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},l={v:"title",lang:"lang"},c={rt:"ruby"};function h(e,t){function i(){if(!t)return null;var e,i=t.match(/^([^<]*)(<[^>]*>?)?/);return e=i[1]?i[1]:i[2],t=t.substr(e.length),e}function r(e){return o[e]}function a(e){for(;v=e.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)e=e.replace(v[0],r);return e}function s(e,t){return!c[t.localName]||c[t.localName]===e.localName}function h(t,i){var n=u[t];if(!n)return null;var r=e.document.createElement(n);r.localName=n;var a=l[t];return a&&i&&(r[a]=i.trim()),r}for(var d,p=e.document.createElement("div"),f=p,m=[];null!==(d=i());)if("<"!==d[0])f.appendChild(e.document.createTextNode(a(d)));else{if("/"===d[1]){m.length&&m[m.length-1]===d.substr(2).replace(">","")&&(m.pop(),f=f.parentNode);continue}var g,y=n(d.substr(1,d.length-2));if(y){g=e.document.createProcessingInstruction("timestamp",y),f.appendChild(g);continue}var v=d.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!v)continue;if(!(g=h(v[1],v[3])))continue;if(!s(f,g))continue;v[2]&&(g.className=v[2].substr(1).replace("."," ")),m.push(v[1]),f.appendChild(g),f=g}return p}var d=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function p(e){for(var t=0;t<d.length;t++){var i=d[t];if(e>=i[0]&&e<=i[1])return!0}return!1}function f(e){var t=[],i="";if(!e||!e.childNodes)return"ltr";function n(e,t){for(var i=t.childNodes.length-1;i>=0;i--)e.push(t.childNodes[i])}function r(e){if(!e||!e.length)return null;var t=e.pop(),i=t.textContent||t.innerText;if(i){var a=i.match(/^.*(\n|\r)/);return a?(e.length=0,a[0]):i}return"ruby"===t.tagName?r(e):t.childNodes?(n(e,t),r(e)):void 0}for(n(t,e);i=r(t);)for(var a=0;a<i.length;a++)if(p(i.charCodeAt(a)))return"rtl";return"ltr"}function m(){}function g(e,t,i){m.call(this),this.cue=t,this.cueDiv=h(e,t.text);var n={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(n,this.cueDiv),this.div=e.document.createElement("div"),n={direction:f(this.cueDiv),writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:"middle"===t.align?"center":t.align,font:i.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(n),this.div.appendChild(this.cueDiv);var r=0;switch(t.positionAlign){case"start":r=t.position;break;case"middle":r=t.position-t.size/2;break;case"end":r=t.position-t.size}""===t.vertical?this.applyStyles({left:this.formatStyle(r,"%"),width:this.formatStyle(t.size,"%")}):this.applyStyles({top:this.formatStyle(r,"%"),height:this.formatStyle(t.size,"%")}),this.move=function(e){this.applyStyles({top:this.formatStyle(e.top,"px"),bottom:this.formatStyle(e.bottom,"px"),left:this.formatStyle(e.left,"px"),right:this.formatStyle(e.right,"px"),height:this.formatStyle(e.height,"px"),width:this.formatStyle(e.width,"px")})}}function y(e){var t,i,n,r;if(e.div){i=e.div.offsetHeight,n=e.div.offsetWidth,r=e.div.offsetTop;var a=(a=e.div.childNodes)&&(a=a[0])&&a.getClientRects&&a.getClientRects();e=e.div.getBoundingClientRect(),t=a?Math.max(a[0]&&a[0].height||0,e.height/a.length):0}this.left=e.left,this.right=e.right,this.top=e.top||r,this.height=e.height||i,this.bottom=e.bottom||r+(e.height||i),this.width=e.width||n,this.lineHeight=void 0!==t?t:e.lineHeight}function v(e,t,i,n){var r=new y(t),a=t.cue,s=function(e){if("number"==typeof e.line&&(e.snapToLines||e.line>=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,i=t.textTrackList,n=0,r=0;r<i.length&&i[r]!==t;r++)"showing"===i[r].mode&&n++;return-1*++n}(a),o=[];if(a.snapToLines){var u;switch(a.vertical){case"":o=["+y","-y"],u="height";break;case"rl":o=["+x","-x"],u="width";break;case"lr":o=["-x","+x"],u="width"}var l=r.lineHeight,c=l*Math.round(s),h=i[u]+l,d=o[0];Math.abs(c)>h&&(c=c<0?-1:1,c*=Math.ceil(h/l)*l),s<0&&(c+=""===a.vertical?i.height:i.width,o=o.reverse()),r.move(d,c)}else{var p=r.lineHeight/i.height*100;switch(a.lineAlign){case"middle":s-=p/2;break;case"end":s-=p}switch(a.vertical){case"":t.applyStyles({top:t.formatStyle(s,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(s,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(s,"%")})}o=["+y","-x","+x","-y"],r=new y(t)}var f=function(e,t){for(var r,a=new y(e),s=1,o=0;o<t.length;o++){for(;e.overlapsOppositeAxis(i,t[o])||e.within(i)&&e.overlapsAny(n);)e.move(t[o]);if(e.within(i))return e;var u=e.intersectPercentage(i);s>u&&(r=new y(e),s=u),e=new y(a)}return r||a}(r,o);t.move(f.toCSSCompatValues(i))}function _(){}m.prototype.applyStyles=function(e,t){for(var i in t=t||this.div,e)e.hasOwnProperty(i)&&(t.style[i]=e[i])},m.prototype.formatStyle=function(e,t){return 0===e?0:e+t},g.prototype=t(m.prototype),g.prototype.constructor=g,y.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t}},y.prototype.overlaps=function(e){return this.left<e.right&&this.right>e.left&&this.top<e.bottom&&this.bottom>e.top},y.prototype.overlapsAny=function(e){for(var t=0;t<e.length;t++)if(this.overlaps(e[t]))return!0;return!1},y.prototype.within=function(e){return this.top>=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},y.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.left<e.left;case"-x":return this.right>e.right;case"+y":return this.top<e.top;case"-y":return this.bottom>e.bottom}},y.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},y.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},y.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,n=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||i}},_.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},_.convertCueToDOMTree=function(e,t){return e&&t?h(e,t):null};_.processCues=function(e,t,i){if(!e||!t||!i)return null;for(;i.firstChild;)i.removeChild(i.firstChild);var n=e.document.createElement("div");if(n.style.position="absolute",n.style.left="0",n.style.right="0",n.style.top="0",n.style.bottom="0",n.style.margin="1.5%",i.appendChild(n),function(e){for(var t=0;t<e.length;t++)if(e[t].hasBeenReset||!e[t].displayState)return!0;return!1}(t)){var r=[],a=y.getSimpleBoxPosition(n),s={font:Math.round(.05*a.height*100)/100+"px sans-serif"};!function(){for(var i,o,u=0;u<t.length;u++)o=t[u],i=new g(e,o,s),n.appendChild(i.div),v(0,i,a,r),o.displayState=i.div,r.push(y.getSimpleBoxPosition(i))}()}else for(var o=0;o<t.length;o++)n.appendChild(t[o].displayState)},_.Parser=function(e,t,i){i||(i=t,t={}),t||(t={}),this.window=e,this.vttjs=t,this.state="INITIAL",this.buffer="",this.decoder=i||new TextDecoder("utf8"),this.regionList=[]},_.Parser.prototype={reportOrThrowError:function(e){if(!(e instanceof i))throw e;this.onparsingerror&&this.onparsingerror(e)},parse:function(e){var t=this;function o(){for(var e=t.buffer,i=0;i<e.length&&"\r"!==e[i]&&"\n"!==e[i];)++i;var n=e.substr(0,i);return"\r"===e[i]&&++i,"\n"===e[i]&&++i,t.buffer=e.substr(i),n}function u(e){e.match(/X-TIMESTAMP-MAP/)?a(e,(function(e,i){if("X-TIMESTAMP-MAP"===e)!function(e){var i=new r;a(e,(function(e,t){switch(e){case"MPEGT":i.integer(e+"S",t);break;case"LOCA":i.set(e+"L",n(t))}}),/[^\d]:/,/,/),t.ontimestampmap&&t.ontimestampmap({MPEGTS:i.get("MPEGTS"),LOCAL:i.get("LOCAL")})}(i)}),/=/):a(e,(function(e,i){if("Region"===e)!function(e){var i=new r;if(a(e,(function(e,t){switch(e){case"id":i.set(e,t);break;case"width":i.percent(e,t);break;case"lines":i.integer(e,t);break;case"regionanchor":case"viewportanchor":var n=t.split(",");if(2!==n.length)break;var a=new r;if(a.percent("x",n[0]),a.percent("y",n[1]),!a.has("x")||!a.has("y"))break;i.set(e+"X",a.get("x")),i.set(e+"Y",a.get("y"));break;case"scroll":i.alt(e,t,["up"])}}),/=/,/\s/),i.has("id")){var n=new(t.vttjs.VTTRegion||t.window.VTTRegion);n.width=i.get("width",100),n.lines=i.get("lines",3),n.regionAnchorX=i.get("regionanchorX",0),n.regionAnchorY=i.get("regionanchorY",100),n.viewportAnchorX=i.get("viewportanchorX",0),n.viewportAnchorY=i.get("viewportanchorY",100),n.scroll=i.get("scroll",""),t.onregion&&t.onregion(n),t.regionList.push({id:i.get("id"),region:n})}}(i)}),/:/)}e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));try{var l;if("INITIAL"===t.state){if(!/\r\n|\n/.test(t.buffer))return this;var c=(l=o()).match(/^WEBVTT([ \t].*)?$/);if(!c||!c[0])throw new i(i.Errors.BadSignature);t.state="HEADER"}for(var h=!1;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(h?h=!1:l=o(),t.state){case"HEADER":/:/.test(l)?u(l):l||(t.state="ID");continue;case"NOTE":l||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(l)){t.state="NOTE";break}if(!l)continue;if(t.cue=new(t.vttjs.VTTCue||t.window.VTTCue)(0,0,""),t.state="CUE",-1===l.indexOf("--\x3e")){t.cue.id=l;continue}case"CUE":try{s(l,t.cue,t.regionList)}catch(e){t.reportOrThrowError(e),t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":var d=-1!==l.indexOf("--\x3e");if(!l||d&&(h=!0)){t.oncue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}t.cue.text&&(t.cue.text+="\n"),t.cue.text+=l;continue;case"BADCUE":l||(t.state="ID");continue}}}catch(e){t.reportOrThrowError(e),"CUETEXT"===t.state&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state="INITIAL"===t.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var e=this;try{if(e.buffer+=e.decoder.decode(),(e.cue||"HEADER"===e.state)&&(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state)throw new i(i.Errors.BadSignature)}catch(t){e.reportOrThrowError(t)}return e.onflush&&e.onflush(),this}},e.exports=_},2230:e=>{var t={"":1,lr:1,rl:1},i={start:1,middle:1,end:1,left:1,right:1};function n(e){return"string"==typeof e&&(!!i[e.toLowerCase()]&&e.toLowerCase())}function r(e,i,r){this.hasBeenReset=!1;var a="",s=!1,o=e,u=i,l=r,c=null,h="",d=!0,p="auto",f="start",m=50,g="middle",y=50,v="middle";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return a},set:function(e){a=""+e}},pauseOnExit:{enumerable:!0,get:function(){return s},set:function(e){s=!!e}},startTime:{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");o=e,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");u=e,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return l},set:function(e){l=""+e,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return c},set:function(e){c=e,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return h},set:function(e){var i=function(e){return"string"==typeof e&&!!t[e.toLowerCase()]&&e.toLowerCase()}(e);if(!1===i)throw new SyntaxError("An invalid or illegal string was specified.");h=i,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return d},set:function(e){d=!!e,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return p},set:function(e){if("number"!=typeof e&&"auto"!==e)throw new SyntaxError("An invalid number or illegal string was specified.");p=e,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return f},set:function(e){var t=n(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");f=t,this.hasBeenReset=!0}},position:{enumerable:!0,get:function(){return m},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");m=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return g},set:function(e){var t=n(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");g=t,this.hasBeenReset=!0}},size:{enumerable:!0,get:function(){return y},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");y=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return v},set:function(e){var t=n(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");v=t,this.hasBeenReset=!0}}}),this.displayState=void 0}r.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},e.exports=r},3710:e=>{var t={"":!0,up:!0};function i(e){return"number"==typeof e&&e>=0&&e<=100}e.exports=function(){var e=100,n=3,r=0,a=100,s=0,o=100,u="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!i(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return n},set:function(e){if("number"!=typeof e)throw new TypeError("Lines must be set to a number.");n=e}},regionAnchorY:{enumerable:!0,get:function(){return a},set:function(e){if(!i(e))throw new Error("RegionAnchorX must be between 0 and 100.");a=e}},regionAnchorX:{enumerable:!0,get:function(){return r},set:function(e){if(!i(e))throw new Error("RegionAnchorY must be between 0 and 100.");r=e}},viewportAnchorY:{enumerable:!0,get:function(){return o},set:function(e){if(!i(e))throw new Error("ViewportAnchorY must be between 0 and 100.");o=e}},viewportAnchorX:{enumerable:!0,get:function(){return s},set:function(e){if(!i(e))throw new Error("ViewportAnchorX must be between 0 and 100.");s=e}},scroll:{enumerable:!0,get:function(){return u},set:function(e){var i=function(e){return"string"==typeof e&&!!t[e.toLowerCase()]&&e.toLowerCase()}(e);if(!1===i)throw new SyntaxError("An invalid or illegal string was specified.");u=i}}})}},1875:(e,t,i)=>{"use strict";var n=i(8908),r=i(7376),a=i(4947),s=i(7529);function o(e,t,i){var n=e;return r(t)?(i=t,"string"==typeof e&&(n={uri:e})):n=s(t,{uri:e}),n.callback=i,n}function u(e,t,i){return l(t=o(e,t,i))}function l(e){if(void 0===e.callback)throw new Error("callback argument missing");var t=!1,i=function(i,n,r){t||(t=!0,e.callback(i,n,r))};function n(){var e=void 0;if(e=c.response?c.response:c.responseText||function(e){if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML;return null}(c),y)try{e=JSON.parse(e)}catch(e){}return e}function r(e){return clearTimeout(h),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,i(e,v)}function s(){if(!l){var t;clearTimeout(h),t=e.useXDR&&void 0===c.status?200:1223===c.status?204:c.status;var r=v,s=null;return 0!==t?(r={body:n(),statusCode:t,method:p,headers:{},url:d,rawRequest:c},c.getAllResponseHeaders&&(r.headers=a(c.getAllResponseHeaders()))):s=new Error("Internal XMLHttpRequest Error"),i(s,r,r.body)}}var o,l,c=e.xhr||null;c||(c=e.cors||e.useXDR?new u.XDomainRequest:new u.XMLHttpRequest);var h,d=c.url=e.uri||e.url,p=c.method=e.method||"GET",f=e.body||e.data,m=c.headers=e.headers||{},g=!!e.sync,y=!1,v={body:void 0,headers:{},statusCode:0,method:p,url:d,rawRequest:c};if("json"in e&&!1!==e.json&&(y=!0,m.accept||m.Accept||(m.Accept="application/json"),"GET"!==p&&"HEAD"!==p&&(m["content-type"]||m["Content-Type"]||(m["Content-Type"]="application/json"),f=JSON.stringify(!0===e.json?f:e.json))),c.onreadystatechange=function(){4===c.readyState&&setTimeout(s,0)},c.onload=s,c.onerror=r,c.onprogress=function(){},c.onabort=function(){l=!0},c.ontimeout=r,c.open(p,d,!g,e.username,e.password),g||(c.withCredentials=!!e.withCredentials),!g&&e.timeout>0&&(h=setTimeout((function(){if(!l){l=!0,c.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",r(e)}}),e.timeout)),c.setRequestHeader)for(o in m)m.hasOwnProperty(o)&&c.setRequestHeader(o,m[o]);else if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(c.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(c),c.send(f||null),c}e.exports=u,u.XMLHttpRequest=n.XMLHttpRequest||function(){},u.XDomainRequest="withCredentials"in new u.XMLHttpRequest?u.XMLHttpRequest:n.XDomainRequest,function(e,t){for(var i=0;i<e.length;i++)t(e[i])}(["get","put","post","patch","head","delete"],(function(e){u["delete"===e?"del":e]=function(t,i,n){return(i=o(t,i,n)).method=e.toUpperCase(),l(i)}}))},7529:e=>{e.exports=function(){for(var e={},i=0;i<arguments.length;i++){var n=arguments[i];for(var r in n)t.call(n,r)&&(e[r]=n[r])}return e};var t=Object.prototype.hasOwnProperty}}]);
+//# sourceMappingURL=files_videoplayer-vendors-node_modules_video_js_dist_video_es_js.js.map?v=f87ebe9feae884a73782 \ No newline at end of file
diff --git a/js/files_videoplayer-vendors-node_modules_video_js_dist_video_es_js.js.map b/js/files_videoplayer-vendors-node_modules_video_js_dist_video_es_js.js.map
index 122e03a..05fc7c1 100644
--- a/js/files_videoplayer-vendors-node_modules_video_js_dist_video_es_js.js.map
+++ b/js/files_videoplayer-vendors-node_modules_video_js_dist_video_es_js.js.map
@@ -1 +1 @@
-{"version":3,"file":"files_videoplayer-vendors-node_modules_video_js_dist_video_es_js.js?v=1b6d9725c996f15df33f","mappings":";kKAEA,IAAIA,EAAa,EAAQ,MAErBC,EAAQC,OAAOC,UAAUC,SACzBC,EAAiBH,OAAOC,UAAUE,eAElCC,EAAe,SAAsBC,EAAOC,EAAUC,GACtD,IAAK,IAAIC,EAAI,EAAGC,EAAMJ,EAAMK,OAAQF,EAAIC,EAAKD,IACrCL,EAAeQ,KAAKN,EAAOG,KACX,MAAZD,EACAD,EAASD,EAAMG,GAAIA,EAAGH,GAEtBC,EAASK,KAAKJ,EAAUF,EAAMG,GAAIA,EAAGH,KAMjDO,EAAgB,SAAuBC,EAAQP,EAAUC,GACzD,IAAK,IAAIC,EAAI,EAAGC,EAAMI,EAAOH,OAAQF,EAAIC,EAAKD,IAE1B,MAAZD,EACAD,EAASO,EAAOC,OAAON,GAAIA,EAAGK,GAE9BP,EAASK,KAAKJ,EAAUM,EAAOC,OAAON,GAAIA,EAAGK,IAKrDE,EAAgB,SAAuBC,EAAQV,EAAUC,GACzD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KAAKuL,EACT,GAAGA,EAAI5L,eAAeK,GAAI,OAAO,EAErC,OAAO,EAgLwB0wH,CAAQr6G,EAAQif,SAC3C,MAAM,IAAId,MAAM,qDAkBpB,MAfI,iBAAkBne,IAClB02E,EAAIob,aAAe9xF,EAAQ8xF,cAG3B,eAAgB9xF,GACc,mBAAvBA,EAAQs6G,YAEft6G,EAAQs6G,WAAW5jC,GAMvBA,EAAI6jC,KAAK35E,GAAQ,MAEV81C,EAzNXrsF,EAAOC,QAAUuuH,EACjBA,EAAUiB,eAAiBhvH,EAAOgvH,gBAyOlC,aAxOAjB,EAAUgB,eAAiB,oBAAqB,IAAKhB,EAAUiB,eAAoBjB,EAAUiB,eAAiBhvH,EAAO+uH,eAUrH,SAAsBrwH,EAAOC,GACzB,IAAK,IAAIE,EAAI,EAAGA,EAAIH,EAAMK,OAAQF,IAC9BF,EAASD,EAAMG,IAVvBJ,CAAa,CAAC,MAAO,MAAO,OAAQ,QAAS,OAAQ,WAAW,SAASg9B,GACrEsyF,EAAqB,WAAXtyF,EAAsB,MAAQA,GAAU,SAASxC,EAAK/jB,EAASujC,GAGrE,OAFAvjC,EAAU44G,EAAW70F,EAAK/jB,EAASujC,IAC3Bhd,OAASA,EAAOsV,cACjBi9E,EAAW94G,iBCd1B3V,EAAOC,QAIP,WAGI,IAFA,IAAIw3B,EAAS,GAEJn4B,EAAI,EAAGA,EAAIe,UAAUb,OAAQF,IAAK,CACvC,IAAIo4B,EAASr3B,UAAUf,GAEvB,IAAK,IAAIwL,KAAO4sB,EACRz4B,EAAeQ,KAAKi4B,EAAQ5sB,KAC5B2sB,EAAO3sB,GAAO4sB,EAAO5sB,IAKjC,OAAO2sB,GAfX,IAAIx4B,EAAiBH,OAAOC,UAAUE","sources":["webpack:///files_videoplayer/node_modules/for-each/index.js","webpack:///files_videoplayer/node_modules/global/document.js","webpack:///files_videoplayer/node_modules/global/window.js","webpack:///files_videoplayer/node_modules/is-callable/index.js","webpack:///files_videoplayer/node_modules/is-function/index.js","webpack:///files_videoplayer/node_modules/mux.js/lib/aac/index.js","webpack:///files_videoplayer/node_modules/mux.js/lib/aac/utils.js","webpack:///files_videoplayer/node_modules/mux.js/lib/codecs/adts.js","webpack:///files_videoplayer/node_modules/mux.js/lib/codecs/h264.js","webpack:///files_videoplayer/node_modules/mux.js/lib/data/silence.js","webpack:///files_videoplayer/node_modules/mux.js/lib/m2ts/caption-stream.js","webpack:///files_videoplayer/node_modules/mux.js/lib/m2ts/m2ts.js","webpack:///files_videoplayer/node_modules/mux.js/lib/m2ts/metadata-stream.js","webpack:///files_videoplayer/node_modules/mux.js/lib/m2ts/probe.js","webpack:///files_videoplayer/node_modules/mux.js/lib/m2ts/stream-types.js","webpack:///files_videoplayer/node_modules/mux.js/lib/m2ts/timestamp-rollover-stream.js","webpack:///files_videoplayer/node_modules/mux.js/lib/mp4/audio-frame-utils.js","webpack:///files_videoplayer/node_modules/mux.js/lib/mp4/caption-parser.js","webpack:///files_videoplayer/node_modules/mux.js/lib/mp4/frame-utils.js","webpack:///files_videoplayer/node_modules/mux.js/lib/mp4/index.js","webpack:///files_videoplayer/node_modules/mux.js/lib/mp4/mp4-generator.js","webpack:///files_videoplayer/node_modules/mux.js/lib/mp4/probe.js","webpack:///files_videoplayer/node_modules/mux.js/lib/mp4/track-decode-info.js","webpack:///files_videoplayer/node_modules/mux.js/lib/mp4/transmuxer.js","webpack:///files_videoplayer/node_modules/mux.js/lib/tools/caption-packet-parser.js","webpack:///files_videoplayer/node_modules/mux.js/lib/tools/mp4-inspector.js","webpack:///files_videoplayer/node_modules/mux.js/lib/tools/ts-inspector.js","webpack:///files_videoplayer/node_modules/mux.js/lib/utils/bin.js","webpack:///files_videoplayer/node_modules/mux.js/lib/utils/clock.js","webpack:///files_videoplayer/node_modules/mux.js/lib/utils/exp-golomb.js","webpack:///files_videoplayer/node_modules/mux.js/lib/utils/stream.js","webpack:///files_videoplayer/node_modules/parse-headers/parse-headers.js","webpack:///files_videoplayer/node_modules/safe-json-parse/tuple.js","webpack:///files_videoplayer/node_modules/trim/index.js","webpack:///files_videoplayer/node_modules/tsml/tsml.js","webpack:///files_videoplayer/node_modules/url-toolkit/src/url-toolkit.js","webpack:///files_videoplayer/node_modules/m3u8-parser/dist/m3u8-parser.es.js","webpack:///files_videoplayer/node_modules/mpd-parser/dist/mpd-parser.es.js","webpack:///files_videoplayer/node_modules/pkcs7/dist/pkcs7.es.js","webpack:///files_videoplayer/node_modules/aes-decrypter/dist/aes-decrypter.es.js","webpack:///files_videoplayer/node_modules/video.js/dist/video.es.js","webpack:///files_videoplayer/node_modules/videojs-vtt.js/lib/browser-index.js","webpack:///files_videoplayer/node_modules/videojs-vtt.js/lib/vtt.js","webpack:///files_videoplayer/node_modules/videojs-vtt.js/lib/vttcue.js","webpack:///files_videoplayer/node_modules/videojs-vtt.js/lib/vttregion.js","webpack:///files_videoplayer/node_modules/xhr/index.js","webpack:///files_videoplayer/node_modules/xtend/immutable.js"],"sourcesContent":["'use strict';\n\nvar isCallable = require('is-callable');\n\nvar toStr = Object.prototype.toString;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar forEachArray = function forEachArray(array, iterator, receiver) {\n for (var i = 0, len = array.length; i < len; i++) {\n if (hasOwnProperty.call(array, i)) {\n if (receiver == null) {\n iterator(array[i], i, array);\n } else {\n iterator.call(receiver, array[i], i, array);\n }\n }\n }\n};\n\nvar forEachString = function forEachString(string, iterator, receiver) {\n for (var i = 0, len = string.length; i < len; i++) {\n // no such thing as a sparse string.\n if (receiver == null) {\n iterator(string.charAt(i), i, string);\n } else {\n iterator.call(receiver, string.charAt(i), i, string);\n }\n }\n};\n\nvar forEachObject = function forEachObject(object, iterator, receiver) {\n for (var k in object) {\n if (hasOwnProperty.call(object, k)) {\n if (receiver == null) {\n iterator(object[k], k, object);\n } else {\n iterator.call(receiver, object[k], k, object);\n }\n }\n }\n};\n\nvar forEach = function forEach(list, iterator, thisArg) {\n if (!isCallable(iterator)) {\n throw new TypeError('iterator must be a function');\n }\n\n var receiver;\n if (arguments.length >= 3) {\n receiver = thisArg;\n }\n\n if (toStr.call(list) === '[object Array]') {\n forEachArray(list, iterator, receiver);\n } else if (typeof list === 'string') {\n forEachString(list, iterator, receiver);\n } else {\n forEachObject(list, iterator, receiver);\n }\n};\n\nmodule.exports = forEach;\n","var topLevel = typeof global !== 'undefined' ? global :\n typeof window !== 'undefined' ? window : {}\nvar minDoc = require('min-document');\n\nvar doccy;\n\nif (typeof document !== 'undefined') {\n doccy = document;\n} else {\n doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'];\n\n if (!doccy) {\n doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'] = minDoc;\n }\n}\n\nmodule.exports = doccy;\n","var win;\n\nif (typeof window !== \"undefined\") {\n win = window;\n} else if (typeof global !== \"undefined\") {\n win = global;\n} else if (typeof self !== \"undefined\"){\n win = self;\n} else {\n win = {};\n}\n\nmodule.exports = win;\n","'use strict';\n\nvar fnToStr = Function.prototype.toString;\nvar reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply;\nvar badArrayLike;\nvar isCallableMarker;\nif (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') {\n\ttry {\n\t\tbadArrayLike = Object.defineProperty({}, 'length', {\n\t\t\tget: function () {\n\t\t\t\tthrow isCallableMarker;\n\t\t\t}\n\t\t});\n\t\tisCallableMarker = {};\n\t\t// eslint-disable-next-line no-throw-literal\n\t\treflectApply(function () { throw 42; }, null, badArrayLike);\n\t} catch (_) {\n\t\tif (_ !== isCallableMarker) {\n\t\t\treflectApply = null;\n\t\t}\n\t}\n} else {\n\treflectApply = null;\n}\n\nvar constructorRegex = /^\\s*class\\b/;\nvar isES6ClassFn = function isES6ClassFunction(value) {\n\ttry {\n\t\tvar fnStr = fnToStr.call(value);\n\t\treturn constructorRegex.test(fnStr);\n\t} catch (e) {\n\t\treturn false; // not a function\n\t}\n};\n\nvar tryFunctionObject = function tryFunctionToStr(value) {\n\ttry {\n\t\tif (isES6ClassFn(value)) { return false; }\n\t\tfnToStr.call(value);\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\nvar toStr = Object.prototype.toString;\nvar fnClass = '[object Function]';\nvar genClass = '[object GeneratorFunction]';\nvar hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';\n/* globals document: false */\nvar documentDotAll = typeof document === 'object' && typeof document.all === 'undefined' && document.all !== undefined ? document.all : {};\n\nmodule.exports = reflectApply\n\t? function isCallable(value) {\n\t\tif (value === documentDotAll) { return true; }\n\t\tif (!value) { return false; }\n\t\tif (typeof value !== 'function' && typeof value !== 'object') { return false; }\n\t\tif (typeof value === 'function' && !value.prototype) { return true; }\n\t\ttry {\n\t\t\treflectApply(value, null, badArrayLike);\n\t\t} catch (e) {\n\t\t\tif (e !== isCallableMarker) { return false; }\n\t\t}\n\t\treturn !isES6ClassFn(value);\n\t}\n\t: function isCallable(value) {\n\t\tif (value === documentDotAll) { return true; }\n\t\tif (!value) { return false; }\n\t\tif (typeof value !== 'function' && typeof value !== 'object') { return false; }\n\t\tif (typeof value === 'function' && !value.prototype) { return true; }\n\t\tif (hasToStringTag) { return tryFunctionObject(value); }\n\t\tif (isES6ClassFn(value)) { return false; }\n\t\tvar strClass = toStr.call(value);\n\t\treturn strClass === fnClass || strClass === genClass;\n\t};\n","module.exports = isFunction\n\nvar toString = Object.prototype.toString\n\nfunction isFunction (fn) {\n var string = toString.call(fn)\n return string === '[object Function]' ||\n (typeof fn === 'function' && string !== '[object RegExp]') ||\n (typeof window !== 'undefined' &&\n // IE8 and below\n (fn === window.setTimeout ||\n fn === window.alert ||\n fn === window.confirm ||\n fn === window.prompt))\n};\n","/**\n * mux.js\n *\n * Copyright (c) 2016 Brightcove\n * All rights reserved.\n *\n * A stream-based aac to mp4 converter. This utility can be used to\n * deliver mp4s to a SourceBuffer on platforms that support native\n * Media Source Extensions.\n */\n'use strict';\nvar Stream = require('../utils/stream.js');\nvar aacUtils = require('./utils');\n\n// Constants\nvar AacStream;\n\n/**\n * Splits an incoming stream of binary data into ADTS and ID3 Frames.\n */\n\nAacStream = function() {\n var\n everything = new Uint8Array(),\n timeStamp = 0;\n\n AacStream.prototype.init.call(this);\n\n this.setTimestamp = function(timestamp) {\n timeStamp = timestamp;\n };\n\n this.push = function(bytes) {\n var\n frameSize = 0,\n byteIndex = 0,\n bytesLeft,\n chunk,\n packet,\n tempLength;\n\n // If there are bytes remaining from the last segment, prepend them to the\n // bytes that were pushed in\n if (everything.length) {\n tempLength = everything.length;\n everything = new Uint8Array(bytes.byteLength + tempLength);\n everything.set(everything.subarray(0, tempLength));\n everything.set(bytes, tempLength);\n } else {\n everything = bytes;\n }\n\n while (everything.length - byteIndex >= 3) {\n if ((everything[byteIndex] === 'I'.charCodeAt(0)) &&\n (everything[byteIndex + 1] === 'D'.charCodeAt(0)) &&\n (everything[byteIndex + 2] === '3'.charCodeAt(0))) {\n\n // Exit early because we don't have enough to parse\n // the ID3 tag header\n if (everything.length - byteIndex < 10) {\n break;\n }\n\n // check framesize\n frameSize = aacUtils.parseId3TagSize(everything, byteIndex);\n\n // Exit early if we don't have enough in the buffer\n // to emit a full packet\n // Add to byteIndex to support multiple ID3 tags in sequence\n if (byteIndex + frameSize > everything.length) {\n break;\n }\n chunk = {\n type: 'timed-metadata',\n data: everything.subarray(byteIndex, byteIndex + frameSize)\n };\n this.trigger('data', chunk);\n byteIndex += frameSize;\n continue;\n } else if (((everything[byteIndex] & 0xff) === 0xff) &&\n ((everything[byteIndex + 1] & 0xf0) === 0xf0)) {\n\n // Exit early because we don't have enough to parse\n // the ADTS frame header\n if (everything.length - byteIndex < 7) {\n break;\n }\n\n frameSize = aacUtils.parseAdtsSize(everything, byteIndex);\n\n // Exit early if we don't have enough in the buffer\n // to emit a full packet\n if (byteIndex + frameSize > everything.length) {\n break;\n }\n\n packet = {\n type: 'audio',\n data: everything.subarray(byteIndex, byteIndex + frameSize),\n pts: timeStamp,\n dts: timeStamp\n };\n this.trigger('data', packet);\n byteIndex += frameSize;\n continue;\n }\n byteIndex++;\n }\n bytesLeft = everything.length - byteIndex;\n\n if (bytesLeft > 0) {\n everything = everything.subarray(byteIndex);\n } else {\n everything = new Uint8Array();\n }\n };\n};\n\nAacStream.prototype = new Stream();\n\nmodule.exports = AacStream;\n","/**\n * mux.js\n *\n * Copyright (c) 2016 Brightcove\n * All rights reserved.\n *\n * Utilities to detect basic properties and metadata about Aac data.\n */\n'use strict';\n\nvar ADTS_SAMPLING_FREQUENCIES = [\n 96000,\n 88200,\n 64000,\n 48000,\n 44100,\n 32000,\n 24000,\n 22050,\n 16000,\n 12000,\n 11025,\n 8000,\n 7350\n];\n\nvar isLikelyAacData = function(data) {\n if ((data[0] === 'I'.charCodeAt(0)) &&\n (data[1] === 'D'.charCodeAt(0)) &&\n (data[2] === '3'.charCodeAt(0))) {\n return true;\n }\n return false;\n};\n\nvar parseSyncSafeInteger = function(data) {\n return (data[0] << 21) |\n (data[1] << 14) |\n (data[2] << 7) |\n (data[3]);\n};\n\n// return a percent-encoded representation of the specified byte range\n// @see http://en.wikipedia.org/wiki/Percent-encoding\nvar percentEncode = function(bytes, start, end) {\n var i, result = '';\n for (i = start; i < end; i++) {\n result += '%' + ('00' + bytes[i].toString(16)).slice(-2);\n }\n return result;\n};\n\n// return the string representation of the specified byte range,\n// interpreted as ISO-8859-1.\nvar parseIso88591 = function(bytes, start, end) {\n return unescape(percentEncode(bytes, start, end)); // jshint ignore:line\n};\n\nvar parseId3TagSize = function(header, byteIndex) {\n var\n returnSize = (header[byteIndex + 6] << 21) |\n (header[byteIndex + 7] << 14) |\n (header[byteIndex + 8] << 7) |\n (header[byteIndex + 9]),\n flags = header[byteIndex + 5],\n footerPresent = (flags & 16) >> 4;\n\n if (footerPresent) {\n return returnSize + 20;\n }\n return returnSize + 10;\n};\n\nvar parseAdtsSize = function(header, byteIndex) {\n var\n lowThree = (header[byteIndex + 5] & 0xE0) >> 5,\n middle = header[byteIndex + 4] << 3,\n highTwo = header[byteIndex + 3] & 0x3 << 11;\n\n return (highTwo | middle) | lowThree;\n};\n\nvar parseType = function(header, byteIndex) {\n if ((header[byteIndex] === 'I'.charCodeAt(0)) &&\n (header[byteIndex + 1] === 'D'.charCodeAt(0)) &&\n (header[byteIndex + 2] === '3'.charCodeAt(0))) {\n return 'timed-metadata';\n } else if ((header[byteIndex] & 0xff === 0xff) &&\n ((header[byteIndex + 1] & 0xf0) === 0xf0)) {\n return 'audio';\n }\n return null;\n};\n\nvar parseSampleRate = function(packet) {\n var i = 0;\n\n while (i + 5 < packet.length) {\n if (packet[i] !== 0xFF || (packet[i + 1] & 0xF6) !== 0xF0) {\n // If a valid header was not found, jump one forward and attempt to\n // find a valid ADTS header starting at the next byte\n i++;\n continue;\n }\n return ADTS_SAMPLING_FREQUENCIES[(packet[i + 2] & 0x3c) >>> 2];\n }\n\n return null;\n};\n\nvar parseAacTimestamp = function(packet) {\n var frameStart, frameSize, frame, frameHeader;\n\n // find the start of the first frame and the end of the tag\n frameStart = 10;\n if (packet[5] & 0x40) {\n // advance the frame start past the extended header\n frameStart += 4; // header size field\n frameStart += parseSyncSafeInteger(packet.subarray(10, 14));\n }\n\n // parse one or more ID3 frames\n // http://id3.org/id3v2.3.0#ID3v2_frame_overview\n do {\n // determine the number of bytes in this frame\n frameSize = parseSyncSafeInteger(packet.subarray(frameStart + 4, frameStart + 8));\n if (frameSize < 1) {\n return null;\n }\n frameHeader = String.fromCharCode(packet[frameStart],\n packet[frameStart + 1],\n packet[frameStart + 2],\n packet[frameStart + 3]);\n\n if (frameHeader === 'PRIV') {\n frame = packet.subarray(frameStart + 10, frameStart + frameSize + 10);\n\n for (var i = 0; i < frame.byteLength; i++) {\n if (frame[i] === 0) {\n var owner = parseIso88591(frame, 0, i);\n if (owner === 'com.apple.streaming.transportStreamTimestamp') {\n var d = frame.subarray(i + 1);\n var size = ((d[3] & 0x01) << 30) |\n (d[4] << 22) |\n (d[5] << 14) |\n (d[6] << 6) |\n (d[7] >>> 2);\n size *= 4;\n size += d[7] & 0x03;\n\n return size;\n }\n break;\n }\n }\n }\n\n frameStart += 10; // advance past the frame header\n frameStart += frameSize; // advance past the frame body\n } while (frameStart < packet.byteLength);\n return null;\n};\n\nmodule.exports = {\n isLikelyAacData: isLikelyAacData,\n parseId3TagSize: parseId3TagSize,\n parseAdtsSize: parseAdtsSize,\n parseType: parseType,\n parseSampleRate: parseSampleRate,\n parseAacTimestamp: parseAacTimestamp\n};\n","'use strict';\n\nvar Stream = require('../utils/stream.js');\n\nvar AdtsStream;\n\nvar\n ADTS_SAMPLING_FREQUENCIES = [\n 96000,\n 88200,\n 64000,\n 48000,\n 44100,\n 32000,\n 24000,\n 22050,\n 16000,\n 12000,\n 11025,\n 8000,\n 7350\n ];\n\n/*\n * Accepts a ElementaryStream and emits data events with parsed\n * AAC Audio Frames of the individual packets. Input audio in ADTS\n * format is unpacked and re-emitted as AAC frames.\n *\n * @see http://wiki.multimedia.cx/index.php?title=ADTS\n * @see http://wiki.multimedia.cx/?title=Understanding_AAC\n */\nAdtsStream = function() {\n var buffer;\n\n AdtsStream.prototype.init.call(this);\n\n this.push = function(packet) {\n var\n i = 0,\n frameNum = 0,\n frameLength,\n protectionSkipBytes,\n frameEnd,\n oldBuffer,\n sampleCount,\n adtsFrameDuration;\n\n if (packet.type !== 'audio') {\n // ignore non-audio data\n return;\n }\n\n // Prepend any data in the buffer to the input data so that we can parse\n // aac frames the cross a PES packet boundary\n if (buffer) {\n oldBuffer = buffer;\n buffer = new Uint8Array(oldBuffer.byteLength + packet.data.byteLength);\n buffer.set(oldBuffer);\n buffer.set(packet.data, oldBuffer.byteLength);\n } else {\n buffer = packet.data;\n }\n\n // unpack any ADTS frames which have been fully received\n // for details on the ADTS header, see http://wiki.multimedia.cx/index.php?title=ADTS\n while (i + 5 < buffer.length) {\n\n // Loook for the start of an ADTS header..\n if (buffer[i] !== 0xFF || (buffer[i + 1] & 0xF6) !== 0xF0) {\n // If a valid header was not found, jump one forward and attempt to\n // find a valid ADTS header starting at the next byte\n i++;\n continue;\n }\n\n // The protection skip bit tells us if we have 2 bytes of CRC data at the\n // end of the ADTS header\n protectionSkipBytes = (~buffer[i + 1] & 0x01) * 2;\n\n // Frame length is a 13 bit integer starting 16 bits from the\n // end of the sync sequence\n frameLength = ((buffer[i + 3] & 0x03) << 11) |\n (buffer[i + 4] << 3) |\n ((buffer[i + 5] & 0xe0) >> 5);\n\n sampleCount = ((buffer[i + 6] & 0x03) + 1) * 1024;\n adtsFrameDuration = (sampleCount * 90000) /\n ADTS_SAMPLING_FREQUENCIES[(buffer[i + 2] & 0x3c) >>> 2];\n\n frameEnd = i + frameLength;\n\n // If we don't have enough data to actually finish this ADTS frame, return\n // and wait for more data\n if (buffer.byteLength < frameEnd) {\n return;\n }\n\n // Otherwise, deliver the complete AAC frame\n this.trigger('data', {\n pts: packet.pts + (frameNum * adtsFrameDuration),\n dts: packet.dts + (frameNum * adtsFrameDuration),\n sampleCount: sampleCount,\n audioobjecttype: ((buffer[i + 2] >>> 6) & 0x03) + 1,\n channelcount: ((buffer[i + 2] & 1) << 2) |\n ((buffer[i + 3] & 0xc0) >>> 6),\n samplerate: ADTS_SAMPLING_FREQUENCIES[(buffer[i + 2] & 0x3c) >>> 2],\n samplingfrequencyindex: (buffer[i + 2] & 0x3c) >>> 2,\n // assume ISO/IEC 14496-12 AudioSampleEntry default of 16\n samplesize: 16,\n data: buffer.subarray(i + 7 + protectionSkipBytes, frameEnd)\n });\n\n // If the buffer is empty, clear it and return\n if (buffer.byteLength === frameEnd) {\n buffer = undefined;\n return;\n }\n\n frameNum++;\n\n // Remove the finished frame from the buffer and start the process again\n buffer = buffer.subarray(frameEnd);\n }\n };\n this.flush = function() {\n this.trigger('done');\n };\n};\n\nAdtsStream.prototype = new Stream();\n\nmodule.exports = AdtsStream;\n","'use strict';\n\nvar Stream = require('../utils/stream.js');\nvar ExpGolomb = require('../utils/exp-golomb.js');\n\nvar H264Stream, NalByteStream;\nvar PROFILES_WITH_OPTIONAL_SPS_DATA;\n\n/**\n * Accepts a NAL unit byte stream and unpacks the embedded NAL units.\n */\nNalByteStream = function() {\n var\n syncPoint = 0,\n i,\n buffer;\n NalByteStream.prototype.init.call(this);\n\n /*\n * Scans a byte stream and triggers a data event with the NAL units found.\n * @param {Object} data Event received from H264Stream\n * @param {Uint8Array} data.data The h264 byte stream to be scanned\n *\n * @see H264Stream.push\n */\n this.push = function(data) {\n var swapBuffer;\n\n if (!buffer) {\n buffer = data.data;\n } else {\n swapBuffer = new Uint8Array(buffer.byteLength + data.data.byteLength);\n swapBuffer.set(buffer);\n swapBuffer.set(data.data, buffer.byteLength);\n buffer = swapBuffer;\n }\n\n // Rec. ITU-T H.264, Annex B\n // scan for NAL unit boundaries\n\n // a match looks like this:\n // 0 0 1 .. NAL .. 0 0 1\n // ^ sync point ^ i\n // or this:\n // 0 0 1 .. NAL .. 0 0 0\n // ^ sync point ^ i\n\n // advance the sync point to a NAL start, if necessary\n for (; syncPoint < buffer.byteLength - 3; syncPoint++) {\n if (buffer[syncPoint + 2] === 1) {\n // the sync point is properly aligned\n i = syncPoint + 5;\n break;\n }\n }\n\n while (i < buffer.byteLength) {\n // look at the current byte to determine if we've hit the end of\n // a NAL unit boundary\n switch (buffer[i]) {\n case 0:\n // skip past non-sync sequences\n if (buffer[i - 1] !== 0) {\n i += 2;\n break;\n } else if (buffer[i - 2] !== 0) {\n i++;\n break;\n }\n\n // deliver the NAL unit if it isn't empty\n if (syncPoint + 3 !== i - 2) {\n this.trigger('data', buffer.subarray(syncPoint + 3, i - 2));\n }\n\n // drop trailing zeroes\n do {\n i++;\n } while (buffer[i] !== 1 && i < buffer.length);\n syncPoint = i - 2;\n i += 3;\n break;\n case 1:\n // skip past non-sync sequences\n if (buffer[i - 1] !== 0 ||\n buffer[i - 2] !== 0) {\n i += 3;\n break;\n }\n\n // deliver the NAL unit\n this.trigger('data', buffer.subarray(syncPoint + 3, i - 2));\n syncPoint = i - 2;\n i += 3;\n break;\n default:\n // the current byte isn't a one or zero, so it cannot be part\n // of a sync sequence\n i += 3;\n break;\n }\n }\n // filter out the NAL units that were delivered\n buffer = buffer.subarray(syncPoint);\n i -= syncPoint;\n syncPoint = 0;\n };\n\n this.flush = function() {\n // deliver the last buffered NAL unit\n if (buffer && buffer.byteLength > 3) {\n this.trigger('data', buffer.subarray(syncPoint + 3));\n }\n // reset the stream state\n buffer = null;\n syncPoint = 0;\n this.trigger('done');\n };\n};\nNalByteStream.prototype = new Stream();\n\n// values of profile_idc that indicate additional fields are included in the SPS\n// see Recommendation ITU-T H.264 (4/2013),\n// 7.3.2.1.1 Sequence parameter set data syntax\nPROFILES_WITH_OPTIONAL_SPS_DATA = {\n 100: true,\n 110: true,\n 122: true,\n 244: true,\n 44: true,\n 83: true,\n 86: true,\n 118: true,\n 128: true,\n 138: true,\n 139: true,\n 134: true\n};\n\n/**\n * Accepts input from a ElementaryStream and produces H.264 NAL unit data\n * events.\n */\nH264Stream = function() {\n var\n nalByteStream = new NalByteStream(),\n self,\n trackId,\n currentPts,\n currentDts,\n\n discardEmulationPreventionBytes,\n readSequenceParameterSet,\n skipScalingList;\n\n H264Stream.prototype.init.call(this);\n self = this;\n\n /*\n * Pushes a packet from a stream onto the NalByteStream\n *\n * @param {Object} packet - A packet received from a stream\n * @param {Uint8Array} packet.data - The raw bytes of the packet\n * @param {Number} packet.dts - Decode timestamp of the packet\n * @param {Number} packet.pts - Presentation timestamp of the packet\n * @param {Number} packet.trackId - The id of the h264 track this packet came from\n * @param {('video'|'audio')} packet.type - The type of packet\n *\n */\n this.push = function(packet) {\n if (packet.type !== 'video') {\n return;\n }\n trackId = packet.trackId;\n currentPts = packet.pts;\n currentDts = packet.dts;\n\n nalByteStream.push(packet);\n };\n\n /*\n * Identify NAL unit types and pass on the NALU, trackId, presentation and decode timestamps\n * for the NALUs to the next stream component.\n * Also, preprocess caption and sequence parameter NALUs.\n *\n * @param {Uint8Array} data - A NAL unit identified by `NalByteStream.push`\n * @see NalByteStream.push\n */\n nalByteStream.on('data', function(data) {\n var\n event = {\n trackId: trackId,\n pts: currentPts,\n dts: currentDts,\n data: data\n };\n\n switch (data[0] & 0x1f) {\n case 0x05:\n event.nalUnitType = 'slice_layer_without_partitioning_rbsp_idr';\n break;\n case 0x06:\n event.nalUnitType = 'sei_rbsp';\n event.escapedRBSP = discardEmulationPreventionBytes(data.subarray(1));\n break;\n case 0x07:\n event.nalUnitType = 'seq_parameter_set_rbsp';\n event.escapedRBSP = discardEmulationPreventionBytes(data.subarray(1));\n event.config = readSequenceParameterSet(event.escapedRBSP);\n break;\n case 0x08:\n event.nalUnitType = 'pic_parameter_set_rbsp';\n break;\n case 0x09:\n event.nalUnitType = 'access_unit_delimiter_rbsp';\n break;\n\n default:\n break;\n }\n // This triggers data on the H264Stream\n self.trigger('data', event);\n });\n nalByteStream.on('done', function() {\n self.trigger('done');\n });\n\n this.flush = function() {\n nalByteStream.flush();\n };\n\n /**\n * Advance the ExpGolomb decoder past a scaling list. The scaling\n * list is optionally transmitted as part of a sequence parameter\n * set and is not relevant to transmuxing.\n * @param count {number} the number of entries in this scaling list\n * @param expGolombDecoder {object} an ExpGolomb pointed to the\n * start of a scaling list\n * @see Recommendation ITU-T H.264, Section 7.3.2.1.1.1\n */\n skipScalingList = function(count, expGolombDecoder) {\n var\n lastScale = 8,\n nextScale = 8,\n j,\n deltaScale;\n\n for (j = 0; j < count; j++) {\n if (nextScale !== 0) {\n deltaScale = expGolombDecoder.readExpGolomb();\n nextScale = (lastScale + deltaScale + 256) % 256;\n }\n\n lastScale = (nextScale === 0) ? lastScale : nextScale;\n }\n };\n\n /**\n * Expunge any \"Emulation Prevention\" bytes from a \"Raw Byte\n * Sequence Payload\"\n * @param data {Uint8Array} the bytes of a RBSP from a NAL\n * unit\n * @return {Uint8Array} the RBSP without any Emulation\n * Prevention Bytes\n */\n discardEmulationPreventionBytes = function(data) {\n var\n length = data.byteLength,\n emulationPreventionBytesPositions = [],\n i = 1,\n newLength, newData;\n\n // Find all `Emulation Prevention Bytes`\n while (i < length - 2) {\n if (data[i] === 0 && data[i + 1] === 0 && data[i + 2] === 0x03) {\n emulationPreventionBytesPositions.push(i + 2);\n i += 2;\n } else {\n i++;\n }\n }\n\n // If no Emulation Prevention Bytes were found just return the original\n // array\n if (emulationPreventionBytesPositions.length === 0) {\n return data;\n }\n\n // Create a new array to hold the NAL unit data\n newLength = length - emulationPreventionBytesPositions.length;\n newData = new Uint8Array(newLength);\n var sourceIndex = 0;\n\n for (i = 0; i < newLength; sourceIndex++, i++) {\n if (sourceIndex === emulationPreventionBytesPositions[0]) {\n // Skip this byte\n sourceIndex++;\n // Remove this position index\n emulationPreventionBytesPositions.shift();\n }\n newData[i] = data[sourceIndex];\n }\n\n return newData;\n };\n\n /**\n * Read a sequence parameter set and return some interesting video\n * properties. A sequence parameter set is the H264 metadata that\n * describes the properties of upcoming video frames.\n * @param data {Uint8Array} the bytes of a sequence parameter set\n * @return {object} an object with configuration parsed from the\n * sequence parameter set, including the dimensions of the\n * associated video frames.\n */\n readSequenceParameterSet = function(data) {\n var\n frameCropLeftOffset = 0,\n frameCropRightOffset = 0,\n frameCropTopOffset = 0,\n frameCropBottomOffset = 0,\n sarScale = 1,\n expGolombDecoder, profileIdc, levelIdc, profileCompatibility,\n chromaFormatIdc, picOrderCntType,\n numRefFramesInPicOrderCntCycle, picWidthInMbsMinus1,\n picHeightInMapUnitsMinus1,\n frameMbsOnlyFlag,\n scalingListCount,\n sarRatio,\n aspectRatioIdc,\n i;\n\n expGolombDecoder = new ExpGolomb(data);\n profileIdc = expGolombDecoder.readUnsignedByte(); // profile_idc\n profileCompatibility = expGolombDecoder.readUnsignedByte(); // constraint_set[0-5]_flag\n levelIdc = expGolombDecoder.readUnsignedByte(); // level_idc u(8)\n expGolombDecoder.skipUnsignedExpGolomb(); // seq_parameter_set_id\n\n // some profiles have more optional data we don't need\n if (PROFILES_WITH_OPTIONAL_SPS_DATA[profileIdc]) {\n chromaFormatIdc = expGolombDecoder.readUnsignedExpGolomb();\n if (chromaFormatIdc === 3) {\n expGolombDecoder.skipBits(1); // separate_colour_plane_flag\n }\n expGolombDecoder.skipUnsignedExpGolomb(); // bit_depth_luma_minus8\n expGolombDecoder.skipUnsignedExpGolomb(); // bit_depth_chroma_minus8\n expGolombDecoder.skipBits(1); // qpprime_y_zero_transform_bypass_flag\n if (expGolombDecoder.readBoolean()) { // seq_scaling_matrix_present_flag\n scalingListCount = (chromaFormatIdc !== 3) ? 8 : 12;\n for (i = 0; i < scalingListCount; i++) {\n if (expGolombDecoder.readBoolean()) { // seq_scaling_list_present_flag[ i ]\n if (i < 6) {\n skipScalingList(16, expGolombDecoder);\n } else {\n skipScalingList(64, expGolombDecoder);\n }\n }\n }\n }\n }\n\n expGolombDecoder.skipUnsignedExpGolomb(); // log2_max_frame_num_minus4\n picOrderCntType = expGolombDecoder.readUnsignedExpGolomb();\n\n if (picOrderCntType === 0) {\n expGolombDecoder.readUnsignedExpGolomb(); // log2_max_pic_order_cnt_lsb_minus4\n } else if (picOrderCntType === 1) {\n expGolombDecoder.skipBits(1); // delta_pic_order_always_zero_flag\n expGolombDecoder.skipExpGolomb(); // offset_for_non_ref_pic\n expGolombDecoder.skipExpGolomb(); // offset_for_top_to_bottom_field\n numRefFramesInPicOrderCntCycle = expGolombDecoder.readUnsignedExpGolomb();\n for (i = 0; i < numRefFramesInPicOrderCntCycle; i++) {\n expGolombDecoder.skipExpGolomb(); // offset_for_ref_frame[ i ]\n }\n }\n\n expGolombDecoder.skipUnsignedExpGolomb(); // max_num_ref_frames\n expGolombDecoder.skipBits(1); // gaps_in_frame_num_value_allowed_flag\n\n picWidthInMbsMinus1 = expGolombDecoder.readUnsignedExpGolomb();\n picHeightInMapUnitsMinus1 = expGolombDecoder.readUnsignedExpGolomb();\n\n frameMbsOnlyFlag = expGolombDecoder.readBits(1);\n if (frameMbsOnlyFlag === 0) {\n expGolombDecoder.skipBits(1); // mb_adaptive_frame_field_flag\n }\n\n expGolombDecoder.skipBits(1); // direct_8x8_inference_flag\n if (expGolombDecoder.readBoolean()) { // frame_cropping_flag\n frameCropLeftOffset = expGolombDecoder.readUnsignedExpGolomb();\n frameCropRightOffset = expGolombDecoder.readUnsignedExpGolomb();\n frameCropTopOffset = expGolombDecoder.readUnsignedExpGolomb();\n frameCropBottomOffset = expGolombDecoder.readUnsignedExpGolomb();\n }\n if (expGolombDecoder.readBoolean()) {\n // vui_parameters_present_flag\n if (expGolombDecoder.readBoolean()) {\n // aspect_ratio_info_present_flag\n aspectRatioIdc = expGolombDecoder.readUnsignedByte();\n switch (aspectRatioIdc) {\n case 1: sarRatio = [1, 1]; break;\n case 2: sarRatio = [12, 11]; break;\n case 3: sarRatio = [10, 11]; break;\n case 4: sarRatio = [16, 11]; break;\n case 5: sarRatio = [40, 33]; break;\n case 6: sarRatio = [24, 11]; break;\n case 7: sarRatio = [20, 11]; break;\n case 8: sarRatio = [32, 11]; break;\n case 9: sarRatio = [80, 33]; break;\n case 10: sarRatio = [18, 11]; break;\n case 11: sarRatio = [15, 11]; break;\n case 12: sarRatio = [64, 33]; break;\n case 13: sarRatio = [160, 99]; break;\n case 14: sarRatio = [4, 3]; break;\n case 15: sarRatio = [3, 2]; break;\n case 16: sarRatio = [2, 1]; break;\n case 255: {\n sarRatio = [expGolombDecoder.readUnsignedByte() << 8 |\n expGolombDecoder.readUnsignedByte(),\n expGolombDecoder.readUnsignedByte() << 8 |\n expGolombDecoder.readUnsignedByte() ];\n break;\n }\n }\n if (sarRatio) {\n sarScale = sarRatio[0] / sarRatio[1];\n }\n }\n }\n return {\n profileIdc: profileIdc,\n levelIdc: levelIdc,\n profileCompatibility: profileCompatibility,\n width: Math.ceil((((picWidthInMbsMinus1 + 1) * 16) - frameCropLeftOffset * 2 - frameCropRightOffset * 2) * sarScale),\n height: ((2 - frameMbsOnlyFlag) * (picHeightInMapUnitsMinus1 + 1) * 16) - (frameCropTopOffset * 2) - (frameCropBottomOffset * 2)\n };\n };\n\n};\nH264Stream.prototype = new Stream();\n\nmodule.exports = {\n H264Stream: H264Stream,\n NalByteStream: NalByteStream\n};\n","var highPrefix = [33, 16, 5, 32, 164, 27];\nvar lowPrefix = [33, 65, 108, 84, 1, 2, 4, 8, 168, 2, 4, 8, 17, 191, 252];\nvar zeroFill = function(count) {\n var a = [];\n while (count--) {\n a.push(0);\n }\n return a;\n};\n\nvar makeTable = function(metaTable) {\n return Object.keys(metaTable).reduce(function(obj, key) {\n obj[key] = new Uint8Array(metaTable[key].reduce(function(arr, part) {\n return arr.concat(part);\n }, []));\n return obj;\n }, {});\n};\n\n// Frames-of-silence to use for filling in missing AAC frames\nvar coneOfSilence = {\n 96000: [highPrefix, [227, 64], zeroFill(154), [56]],\n 88200: [highPrefix, [231], zeroFill(170), [56]],\n 64000: [highPrefix, [248, 192], zeroFill(240), [56]],\n 48000: [highPrefix, [255, 192], zeroFill(268), [55, 148, 128], zeroFill(54), [112]],\n 44100: [highPrefix, [255, 192], zeroFill(268), [55, 163, 128], zeroFill(84), [112]],\n 32000: [highPrefix, [255, 192], zeroFill(268), [55, 234], zeroFill(226), [112]],\n 24000: [highPrefix, [255, 192], zeroFill(268), [55, 255, 128], zeroFill(268), [111, 112], zeroFill(126), [224]],\n 16000: [highPrefix, [255, 192], zeroFill(268), [55, 255, 128], zeroFill(268), [111, 255], zeroFill(269), [223, 108], zeroFill(195), [1, 192]],\n 12000: [lowPrefix, zeroFill(268), [3, 127, 248], zeroFill(268), [6, 255, 240], zeroFill(268), [13, 255, 224], zeroFill(268), [27, 253, 128], zeroFill(259), [56]],\n 11025: [lowPrefix, zeroFill(268), [3, 127, 248], zeroFill(268), [6, 255, 240], zeroFill(268), [13, 255, 224], zeroFill(268), [27, 255, 192], zeroFill(268), [55, 175, 128], zeroFill(108), [112]],\n 8000: [lowPrefix, zeroFill(268), [3, 121, 16], zeroFill(47), [7]]\n};\n\nmodule.exports = makeTable(coneOfSilence);\n","/**\n * mux.js\n *\n * Copyright (c) 2015 Brightcove\n * All rights reserved.\n *\n * Reads in-band caption information from a video elementary\n * stream. Captions must follow the CEA-708 standard for injection\n * into an MPEG-2 transport streams.\n * @see https://en.wikipedia.org/wiki/CEA-708\n * @see https://www.gpo.gov/fdsys/pkg/CFR-2007-title47-vol1/pdf/CFR-2007-title47-vol1-sec15-119.pdf\n */\n\n'use strict';\n\n// -----------------\n// Link To Transport\n// -----------------\n\nvar Stream = require('../utils/stream');\nvar cea708Parser = require('../tools/caption-packet-parser');\n\nvar CaptionStream = function() {\n\n CaptionStream.prototype.init.call(this);\n\n this.captionPackets_ = [];\n\n this.ccStreams_ = [\n new Cea608Stream(0, 0), // eslint-disable-line no-use-before-define\n new Cea608Stream(0, 1), // eslint-disable-line no-use-before-define\n new Cea608Stream(1, 0), // eslint-disable-line no-use-before-define\n new Cea608Stream(1, 1) // eslint-disable-line no-use-before-define\n ];\n\n this.reset();\n\n // forward data and done events from CCs to this CaptionStream\n this.ccStreams_.forEach(function(cc) {\n cc.on('data', this.trigger.bind(this, 'data'));\n cc.on('done', this.trigger.bind(this, 'done'));\n }, this);\n\n};\n\nCaptionStream.prototype = new Stream();\nCaptionStream.prototype.push = function(event) {\n var sei, userData, newCaptionPackets;\n\n // only examine SEI NALs\n if (event.nalUnitType !== 'sei_rbsp') {\n return;\n }\n\n // parse the sei\n sei = cea708Parser.parseSei(event.escapedRBSP);\n\n // ignore everything but user_data_registered_itu_t_t35\n if (sei.payloadType !== cea708Parser.USER_DATA_REGISTERED_ITU_T_T35) {\n return;\n }\n\n // parse out the user data payload\n userData = cea708Parser.parseUserData(sei);\n\n // ignore unrecognized userData\n if (!userData) {\n return;\n }\n\n // Sometimes, the same segment # will be downloaded twice. To stop the\n // caption data from being processed twice, we track the latest dts we've\n // received and ignore everything with a dts before that. However, since\n // data for a specific dts can be split across packets on either side of\n // a segment boundary, we need to make sure we *don't* ignore the packets\n // from the *next* segment that have dts === this.latestDts_. By constantly\n // tracking the number of packets received with dts === this.latestDts_, we\n // know how many should be ignored once we start receiving duplicates.\n if (event.dts < this.latestDts_) {\n // We've started getting older data, so set the flag.\n this.ignoreNextEqualDts_ = true;\n return;\n } else if ((event.dts === this.latestDts_) && (this.ignoreNextEqualDts_)) {\n this.numSameDts_--;\n if (!this.numSameDts_) {\n // We've received the last duplicate packet, time to start processing again\n this.ignoreNextEqualDts_ = false;\n }\n return;\n }\n\n // parse out CC data packets and save them for later\n newCaptionPackets = cea708Parser.parseCaptionPackets(event.pts, userData);\n this.captionPackets_ = this.captionPackets_.concat(newCaptionPackets);\n if (this.latestDts_ !== event.dts) {\n this.numSameDts_ = 0;\n }\n this.numSameDts_++;\n this.latestDts_ = event.dts;\n};\n\nCaptionStream.prototype.flush = function() {\n // make sure we actually parsed captions before proceeding\n if (!this.captionPackets_.length) {\n this.ccStreams_.forEach(function(cc) {\n cc.flush();\n }, this);\n return;\n }\n\n // In Chrome, the Array#sort function is not stable so add a\n // presortIndex that we can use to ensure we get a stable-sort\n this.captionPackets_.forEach(function(elem, idx) {\n elem.presortIndex = idx;\n });\n\n // sort caption byte-pairs based on their PTS values\n this.captionPackets_.sort(function(a, b) {\n if (a.pts === b.pts) {\n return a.presortIndex - b.presortIndex;\n }\n return a.pts - b.pts;\n });\n\n this.captionPackets_.forEach(function(packet) {\n if (packet.type < 2) {\n // Dispatch packet to the right Cea608Stream\n this.dispatchCea608Packet(packet);\n }\n // this is where an 'else' would go for a dispatching packets\n // to a theoretical Cea708Stream that handles SERVICEn data\n }, this);\n\n this.captionPackets_.length = 0;\n this.ccStreams_.forEach(function(cc) {\n cc.flush();\n }, this);\n return;\n};\n\nCaptionStream.prototype.reset = function() {\n this.latestDts_ = null;\n this.ignoreNextEqualDts_ = false;\n this.numSameDts_ = 0;\n this.activeCea608Channel_ = [null, null];\n this.ccStreams_.forEach(function(ccStream) {\n ccStream.reset();\n });\n};\n\nCaptionStream.prototype.dispatchCea608Packet = function(packet) {\n // NOTE: packet.type is the CEA608 field\n if (this.setsChannel1Active(packet)) {\n this.activeCea608Channel_[packet.type] = 0;\n } else if (this.setsChannel2Active(packet)) {\n this.activeCea608Channel_[packet.type] = 1;\n }\n if (this.activeCea608Channel_[packet.type] === null) {\n // If we haven't received anything to set the active channel, discard the\n // data; we don't want jumbled captions\n return;\n }\n this.ccStreams_[(packet.type << 1) + this.activeCea608Channel_[packet.type]].push(packet);\n};\n\nCaptionStream.prototype.setsChannel1Active = function(packet) {\n return ((packet.ccData & 0x7800) === 0x1000);\n};\nCaptionStream.prototype.setsChannel2Active = function(packet) {\n return ((packet.ccData & 0x7800) === 0x1800);\n};\n\n// ----------------------\n// Session to Application\n// ----------------------\n\n// This hash maps non-ASCII, special, and extended character codes to their\n// proper Unicode equivalent. The first keys that are only a single byte\n// are the non-standard ASCII characters, which simply map the CEA608 byte\n// to the standard ASCII/Unicode. The two-byte keys that follow are the CEA608\n// character codes, but have their MSB bitmasked with 0x03 so that a lookup\n// can be performed regardless of the field and data channel on which the\n// character code was received.\nvar CHARACTER_TRANSLATION = {\n 0x2a: 0xe1, // á\n 0x5c: 0xe9, // é\n 0x5e: 0xed, // í\n 0x5f: 0xf3, // ó\n 0x60: 0xfa, // ú\n 0x7b: 0xe7, // ç\n 0x7c: 0xf7, // ÷\n 0x7d: 0xd1, // Ñ\n 0x7e: 0xf1, // ñ\n 0x7f: 0x2588, // █\n 0x0130: 0xae, // ®\n 0x0131: 0xb0, // °\n 0x0132: 0xbd, // ½\n 0x0133: 0xbf, // ¿\n 0x0134: 0x2122, // ™\n 0x0135: 0xa2, // ¢\n 0x0136: 0xa3, // £\n 0x0137: 0x266a, // ♪\n 0x0138: 0xe0, // à\n 0x0139: 0xa0, //\n 0x013a: 0xe8, // è\n 0x013b: 0xe2, // â\n 0x013c: 0xea, // ê\n 0x013d: 0xee, // î\n 0x013e: 0xf4, // ô\n 0x013f: 0xfb, // û\n 0x0220: 0xc1, // Á\n 0x0221: 0xc9, // É\n 0x0222: 0xd3, // Ó\n 0x0223: 0xda, // Ú\n 0x0224: 0xdc, // Ü\n 0x0225: 0xfc, // ü\n 0x0226: 0x2018, // ‘\n 0x0227: 0xa1, // ¡\n 0x0228: 0x2a, // *\n 0x0229: 0x27, // '\n 0x022a: 0x2014, // —\n 0x022b: 0xa9, // ©\n 0x022c: 0x2120, // ℠\n 0x022d: 0x2022, // •\n 0x022e: 0x201c, // “\n 0x022f: 0x201d, // ”\n 0x0230: 0xc0, // À\n 0x0231: 0xc2, // Â\n 0x0232: 0xc7, // Ç\n 0x0233: 0xc8, // È\n 0x0234: 0xca, // Ê\n 0x0235: 0xcb, // Ë\n 0x0236: 0xeb, // ë\n 0x0237: 0xce, // Î\n 0x0238: 0xcf, // Ï\n 0x0239: 0xef, // ï\n 0x023a: 0xd4, // Ô\n 0x023b: 0xd9, // Ù\n 0x023c: 0xf9, // ù\n 0x023d: 0xdb, // Û\n 0x023e: 0xab, // «\n 0x023f: 0xbb, // »\n 0x0320: 0xc3, // Ã\n 0x0321: 0xe3, // ã\n 0x0322: 0xcd, // Í\n 0x0323: 0xcc, // Ì\n 0x0324: 0xec, // ì\n 0x0325: 0xd2, // Ò\n 0x0326: 0xf2, // ò\n 0x0327: 0xd5, // Õ\n 0x0328: 0xf5, // õ\n 0x0329: 0x7b, // {\n 0x032a: 0x7d, // }\n 0x032b: 0x5c, // \\\n 0x032c: 0x5e, // ^\n 0x032d: 0x5f, // _\n 0x032e: 0x7c, // |\n 0x032f: 0x7e, // ~\n 0x0330: 0xc4, // Ä\n 0x0331: 0xe4, // ä\n 0x0332: 0xd6, // Ö\n 0x0333: 0xf6, // ö\n 0x0334: 0xdf, // ß\n 0x0335: 0xa5, // ¥\n 0x0336: 0xa4, // ¤\n 0x0337: 0x2502, // │\n 0x0338: 0xc5, // Å\n 0x0339: 0xe5, // å\n 0x033a: 0xd8, // Ø\n 0x033b: 0xf8, // ø\n 0x033c: 0x250c, // ┌\n 0x033d: 0x2510, // ┐\n 0x033e: 0x2514, // └\n 0x033f: 0x2518 // ┘\n};\n\nvar getCharFromCode = function(code) {\n if (code === null) {\n return '';\n }\n code = CHARACTER_TRANSLATION[code] || code;\n return String.fromCharCode(code);\n};\n\n// the index of the last row in a CEA-608 display buffer\nvar BOTTOM_ROW = 14;\n\n// This array is used for mapping PACs -> row #, since there's no way of\n// getting it through bit logic.\nvar ROWS = [0x1100, 0x1120, 0x1200, 0x1220, 0x1500, 0x1520, 0x1600, 0x1620,\n 0x1700, 0x1720, 0x1000, 0x1300, 0x1320, 0x1400, 0x1420];\n\n// CEA-608 captions are rendered onto a 34x15 matrix of character\n// cells. The \"bottom\" row is the last element in the outer array.\nvar createDisplayBuffer = function() {\n var result = [], i = BOTTOM_ROW + 1;\n while (i--) {\n result.push('');\n }\n return result;\n};\n\nvar Cea608Stream = function(field, dataChannel) {\n Cea608Stream.prototype.init.call(this);\n\n this.field_ = field || 0;\n this.dataChannel_ = dataChannel || 0;\n\n this.name_ = 'CC' + (((this.field_ << 1) | this.dataChannel_) + 1);\n\n this.setConstants();\n this.reset();\n\n this.push = function(packet) {\n var data, swap, char0, char1, text;\n // remove the parity bits\n data = packet.ccData & 0x7f7f;\n\n // ignore duplicate control codes; the spec demands they're sent twice\n if (data === this.lastControlCode_) {\n this.lastControlCode_ = null;\n return;\n }\n\n // Store control codes\n if ((data & 0xf000) === 0x1000) {\n this.lastControlCode_ = data;\n } else if (data !== this.PADDING_) {\n this.lastControlCode_ = null;\n }\n\n char0 = data >>> 8;\n char1 = data & 0xff;\n\n if (data === this.PADDING_) {\n return;\n\n } else if (data === this.RESUME_CAPTION_LOADING_) {\n this.mode_ = 'popOn';\n\n } else if (data === this.END_OF_CAPTION_) {\n // If an EOC is received while in paint-on mode, the displayed caption\n // text should be swapped to non-displayed memory as if it was a pop-on\n // caption. Because of that, we should explicitly switch back to pop-on\n // mode\n this.mode_ = 'popOn';\n this.clearFormatting(packet.pts);\n // if a caption was being displayed, it's gone now\n this.flushDisplayed(packet.pts);\n\n // flip memory\n swap = this.displayed_;\n this.displayed_ = this.nonDisplayed_;\n this.nonDisplayed_ = swap;\n\n // start measuring the time to display the caption\n this.startPts_ = packet.pts;\n\n } else if (data === this.ROLL_UP_2_ROWS_) {\n this.rollUpRows_ = 2;\n this.setRollUp(packet.pts);\n } else if (data === this.ROLL_UP_3_ROWS_) {\n this.rollUpRows_ = 3;\n this.setRollUp(packet.pts);\n } else if (data === this.ROLL_UP_4_ROWS_) {\n this.rollUpRows_ = 4;\n this.setRollUp(packet.pts);\n } else if (data === this.CARRIAGE_RETURN_) {\n this.clearFormatting(packet.pts);\n this.flushDisplayed(packet.pts);\n this.shiftRowsUp_();\n this.startPts_ = packet.pts;\n\n } else if (data === this.BACKSPACE_) {\n if (this.mode_ === 'popOn') {\n this.nonDisplayed_[this.row_] = this.nonDisplayed_[this.row_].slice(0, -1);\n } else {\n this.displayed_[this.row_] = this.displayed_[this.row_].slice(0, -1);\n }\n } else if (data === this.ERASE_DISPLAYED_MEMORY_) {\n this.flushDisplayed(packet.pts);\n this.displayed_ = createDisplayBuffer();\n } else if (data === this.ERASE_NON_DISPLAYED_MEMORY_) {\n this.nonDisplayed_ = createDisplayBuffer();\n\n } else if (data === this.RESUME_DIRECT_CAPTIONING_) {\n if (this.mode_ !== 'paintOn') {\n // NOTE: This should be removed when proper caption positioning is\n // implemented\n this.flushDisplayed(packet.pts);\n this.displayed_ = createDisplayBuffer();\n }\n this.mode_ = 'paintOn';\n this.startPts_ = packet.pts;\n\n // Append special characters to caption text\n } else if (this.isSpecialCharacter(char0, char1)) {\n // Bitmask char0 so that we can apply character transformations\n // regardless of field and data channel.\n // Then byte-shift to the left and OR with char1 so we can pass the\n // entire character code to `getCharFromCode`.\n char0 = (char0 & 0x03) << 8;\n text = getCharFromCode(char0 | char1);\n this[this.mode_](packet.pts, text);\n this.column_++;\n\n // Append extended characters to caption text\n } else if (this.isExtCharacter(char0, char1)) {\n // Extended characters always follow their \"non-extended\" equivalents.\n // IE if a \"è\" is desired, you'll always receive \"eè\"; non-compliant\n // decoders are supposed to drop the \"è\", while compliant decoders\n // backspace the \"e\" and insert \"è\".\n\n // Delete the previous character\n if (this.mode_ === 'popOn') {\n this.nonDisplayed_[this.row_] = this.nonDisplayed_[this.row_].slice(0, -1);\n } else {\n this.displayed_[this.row_] = this.displayed_[this.row_].slice(0, -1);\n }\n\n // Bitmask char0 so that we can apply character transformations\n // regardless of field and data channel.\n // Then byte-shift to the left and OR with char1 so we can pass the\n // entire character code to `getCharFromCode`.\n char0 = (char0 & 0x03) << 8;\n text = getCharFromCode(char0 | char1);\n this[this.mode_](packet.pts, text);\n this.column_++;\n\n // Process mid-row codes\n } else if (this.isMidRowCode(char0, char1)) {\n // Attributes are not additive, so clear all formatting\n this.clearFormatting(packet.pts);\n\n // According to the standard, mid-row codes\n // should be replaced with spaces, so add one now\n this[this.mode_](packet.pts, ' ');\n this.column_++;\n\n if ((char1 & 0xe) === 0xe) {\n this.addFormatting(packet.pts, ['i']);\n }\n\n if ((char1 & 0x1) === 0x1) {\n this.addFormatting(packet.pts, ['u']);\n }\n\n // Detect offset control codes and adjust cursor\n } else if (this.isOffsetControlCode(char0, char1)) {\n // Cursor position is set by indent PAC (see below) in 4-column\n // increments, with an additional offset code of 1-3 to reach any\n // of the 32 columns specified by CEA-608. So all we need to do\n // here is increment the column cursor by the given offset.\n this.column_ += (char1 & 0x03);\n\n // Detect PACs (Preamble Address Codes)\n } else if (this.isPAC(char0, char1)) {\n\n // There's no logic for PAC -> row mapping, so we have to just\n // find the row code in an array and use its index :(\n var row = ROWS.indexOf(data & 0x1f20);\n\n // Configure the caption window if we're in roll-up mode\n if (this.mode_ === 'rollUp') {\n // This implies that the base row is incorrectly set.\n // As per the recommendation in CEA-608(Base Row Implementation), defer to the number\n // of roll-up rows set.\n if (row - this.rollUpRows_ + 1 < 0) {\n row = this.rollUpRows_ - 1;\n }\n\n this.setRollUp(packet.pts, row);\n }\n\n if (row !== this.row_) {\n // formatting is only persistent for current row\n this.clearFormatting(packet.pts);\n this.row_ = row;\n }\n // All PACs can apply underline, so detect and apply\n // (All odd-numbered second bytes set underline)\n if ((char1 & 0x1) && (this.formatting_.indexOf('u') === -1)) {\n this.addFormatting(packet.pts, ['u']);\n }\n\n if ((data & 0x10) === 0x10) {\n // We've got an indent level code. Each successive even number\n // increments the column cursor by 4, so we can get the desired\n // column position by bit-shifting to the right (to get n/2)\n // and multiplying by 4.\n this.column_ = ((data & 0xe) >> 1) * 4;\n }\n\n if (this.isColorPAC(char1)) {\n // it's a color code, though we only support white, which\n // can be either normal or italicized. white italics can be\n // either 0x4e or 0x6e depending on the row, so we just\n // bitwise-and with 0xe to see if italics should be turned on\n if ((char1 & 0xe) === 0xe) {\n this.addFormatting(packet.pts, ['i']);\n }\n }\n\n // We have a normal character in char0, and possibly one in char1\n } else if (this.isNormalChar(char0)) {\n if (char1 === 0x00) {\n char1 = null;\n }\n text = getCharFromCode(char0);\n text += getCharFromCode(char1);\n this[this.mode_](packet.pts, text);\n this.column_ += text.length;\n\n } // finish data processing\n\n };\n};\nCea608Stream.prototype = new Stream();\n// Trigger a cue point that captures the current state of the\n// display buffer\nCea608Stream.prototype.flushDisplayed = function(pts) {\n var content = this.displayed_\n // remove spaces from the start and end of the string\n .map(function(row) {\n try {\n return row.trim();\n } catch (e) {\n // Ordinarily, this shouldn't happen. However, caption\n // parsing errors should not throw exceptions and\n // break playback.\n // eslint-disable-next-line no-console\n console.error('Skipping malformed caption.');\n return '';\n }\n })\n // combine all text rows to display in one cue\n .join('\\n')\n // and remove blank rows from the start and end, but not the middle\n .replace(/^\\n+|\\n+$/g, '');\n\n if (content.length) {\n this.trigger('data', {\n startPts: this.startPts_,\n endPts: pts,\n text: content,\n stream: this.name_\n });\n }\n};\n\n/**\n * Zero out the data, used for startup and on seek\n */\nCea608Stream.prototype.reset = function() {\n this.mode_ = 'popOn';\n // When in roll-up mode, the index of the last row that will\n // actually display captions. If a caption is shifted to a row\n // with a lower index than this, it is cleared from the display\n // buffer\n this.topRow_ = 0;\n this.startPts_ = 0;\n this.displayed_ = createDisplayBuffer();\n this.nonDisplayed_ = createDisplayBuffer();\n this.lastControlCode_ = null;\n\n // Track row and column for proper line-breaking and spacing\n this.column_ = 0;\n this.row_ = BOTTOM_ROW;\n this.rollUpRows_ = 2;\n\n // This variable holds currently-applied formatting\n this.formatting_ = [];\n};\n\n/**\n * Sets up control code and related constants for this instance\n */\nCea608Stream.prototype.setConstants = function() {\n // The following attributes have these uses:\n // ext_ : char0 for mid-row codes, and the base for extended\n // chars (ext_+0, ext_+1, and ext_+2 are char0s for\n // extended codes)\n // control_: char0 for control codes, except byte-shifted to the\n // left so that we can do this.control_ | CONTROL_CODE\n // offset_: char0 for tab offset codes\n //\n // It's also worth noting that control codes, and _only_ control codes,\n // differ between field 1 and field2. Field 2 control codes are always\n // their field 1 value plus 1. That's why there's the \"| field\" on the\n // control value.\n if (this.dataChannel_ === 0) {\n this.BASE_ = 0x10;\n this.EXT_ = 0x11;\n this.CONTROL_ = (0x14 | this.field_) << 8;\n this.OFFSET_ = 0x17;\n } else if (this.dataChannel_ === 1) {\n this.BASE_ = 0x18;\n this.EXT_ = 0x19;\n this.CONTROL_ = (0x1c | this.field_) << 8;\n this.OFFSET_ = 0x1f;\n }\n\n // Constants for the LSByte command codes recognized by Cea608Stream. This\n // list is not exhaustive. For a more comprehensive listing and semantics see\n // http://www.gpo.gov/fdsys/pkg/CFR-2010-title47-vol1/pdf/CFR-2010-title47-vol1-sec15-119.pdf\n // Padding\n this.PADDING_ = 0x0000;\n // Pop-on Mode\n this.RESUME_CAPTION_LOADING_ = this.CONTROL_ | 0x20;\n this.END_OF_CAPTION_ = this.CONTROL_ | 0x2f;\n // Roll-up Mode\n this.ROLL_UP_2_ROWS_ = this.CONTROL_ | 0x25;\n this.ROLL_UP_3_ROWS_ = this.CONTROL_ | 0x26;\n this.ROLL_UP_4_ROWS_ = this.CONTROL_ | 0x27;\n this.CARRIAGE_RETURN_ = this.CONTROL_ | 0x2d;\n // paint-on mode\n this.RESUME_DIRECT_CAPTIONING_ = this.CONTROL_ | 0x29;\n // Erasure\n this.BACKSPACE_ = this.CONTROL_ | 0x21;\n this.ERASE_DISPLAYED_MEMORY_ = this.CONTROL_ | 0x2c;\n this.ERASE_NON_DISPLAYED_MEMORY_ = this.CONTROL_ | 0x2e;\n};\n\n/**\n * Detects if the 2-byte packet data is a special character\n *\n * Special characters have a second byte in the range 0x30 to 0x3f,\n * with the first byte being 0x11 (for data channel 1) or 0x19 (for\n * data channel 2).\n *\n * @param {Integer} char0 The first byte\n * @param {Integer} char1 The second byte\n * @return {Boolean} Whether the 2 bytes are an special character\n */\nCea608Stream.prototype.isSpecialCharacter = function(char0, char1) {\n return (char0 === this.EXT_ && char1 >= 0x30 && char1 <= 0x3f);\n};\n\n/**\n * Detects if the 2-byte packet data is an extended character\n *\n * Extended characters have a second byte in the range 0x20 to 0x3f,\n * with the first byte being 0x12 or 0x13 (for data channel 1) or\n * 0x1a or 0x1b (for data channel 2).\n *\n * @param {Integer} char0 The first byte\n * @param {Integer} char1 The second byte\n * @return {Boolean} Whether the 2 bytes are an extended character\n */\nCea608Stream.prototype.isExtCharacter = function(char0, char1) {\n return ((char0 === (this.EXT_ + 1) || char0 === (this.EXT_ + 2)) &&\n (char1 >= 0x20 && char1 <= 0x3f));\n};\n\n/**\n * Detects if the 2-byte packet is a mid-row code\n *\n * Mid-row codes have a second byte in the range 0x20 to 0x2f, with\n * the first byte being 0x11 (for data channel 1) or 0x19 (for data\n * channel 2).\n *\n * @param {Integer} char0 The first byte\n * @param {Integer} char1 The second byte\n * @return {Boolean} Whether the 2 bytes are a mid-row code\n */\nCea608Stream.prototype.isMidRowCode = function(char0, char1) {\n return (char0 === this.EXT_ && (char1 >= 0x20 && char1 <= 0x2f));\n};\n\n/**\n * Detects if the 2-byte packet is an offset control code\n *\n * Offset control codes have a second byte in the range 0x21 to 0x23,\n * with the first byte being 0x17 (for data channel 1) or 0x1f (for\n * data channel 2).\n *\n * @param {Integer} char0 The first byte\n * @param {Integer} char1 The second byte\n * @return {Boolean} Whether the 2 bytes are an offset control code\n */\nCea608Stream.prototype.isOffsetControlCode = function(char0, char1) {\n return (char0 === this.OFFSET_ && (char1 >= 0x21 && char1 <= 0x23));\n};\n\n/**\n * Detects if the 2-byte packet is a Preamble Address Code\n *\n * PACs have a first byte in the range 0x10 to 0x17 (for data channel 1)\n * or 0x18 to 0x1f (for data channel 2), with the second byte in the\n * range 0x40 to 0x7f.\n *\n * @param {Integer} char0 The first byte\n * @param {Integer} char1 The second byte\n * @return {Boolean} Whether the 2 bytes are a PAC\n */\nCea608Stream.prototype.isPAC = function(char0, char1) {\n return (char0 >= this.BASE_ && char0 < (this.BASE_ + 8) &&\n (char1 >= 0x40 && char1 <= 0x7f));\n};\n\n/**\n * Detects if a packet's second byte is in the range of a PAC color code\n *\n * PAC color codes have the second byte be in the range 0x40 to 0x4f, or\n * 0x60 to 0x6f.\n *\n * @param {Integer} char1 The second byte\n * @return {Boolean} Whether the byte is a color PAC\n */\nCea608Stream.prototype.isColorPAC = function(char1) {\n return ((char1 >= 0x40 && char1 <= 0x4f) || (char1 >= 0x60 && char1 <= 0x7f));\n};\n\n/**\n * Detects if a single byte is in the range of a normal character\n *\n * Normal text bytes are in the range 0x20 to 0x7f.\n *\n * @param {Integer} char The byte\n * @return {Boolean} Whether the byte is a normal character\n */\nCea608Stream.prototype.isNormalChar = function(char) {\n return (char >= 0x20 && char <= 0x7f);\n};\n\n/**\n * Configures roll-up\n *\n * @param {Integer} pts Current PTS\n * @param {Integer} newBaseRow Used by PACs to slide the current window to\n * a new position\n */\nCea608Stream.prototype.setRollUp = function(pts, newBaseRow) {\n // Reset the base row to the bottom row when switching modes\n if (this.mode_ !== 'rollUp') {\n this.row_ = BOTTOM_ROW;\n this.mode_ = 'rollUp';\n // Spec says to wipe memories when switching to roll-up\n this.flushDisplayed(pts);\n this.nonDisplayed_ = createDisplayBuffer();\n this.displayed_ = createDisplayBuffer();\n }\n\n if (newBaseRow !== undefined && newBaseRow !== this.row_) {\n // move currently displayed captions (up or down) to the new base row\n for (var i = 0; i < this.rollUpRows_; i++) {\n this.displayed_[newBaseRow - i] = this.displayed_[this.row_ - i];\n this.displayed_[this.row_ - i] = '';\n }\n }\n\n if (newBaseRow === undefined) {\n newBaseRow = this.row_;\n }\n\n this.topRow_ = newBaseRow - this.rollUpRows_ + 1;\n};\n\n// Adds the opening HTML tag for the passed character to the caption text,\n// and keeps track of it for later closing\nCea608Stream.prototype.addFormatting = function(pts, format) {\n this.formatting_ = this.formatting_.concat(format);\n var text = format.reduce(function(text, format) {\n return text + '<' + format + '>';\n }, '');\n this[this.mode_](pts, text);\n};\n\n// Adds HTML closing tags for current formatting to caption text and\n// clears remembered formatting\nCea608Stream.prototype.clearFormatting = function(pts) {\n if (!this.formatting_.length) {\n return;\n }\n var text = this.formatting_.reverse().reduce(function(text, format) {\n return text + '</' + format + '>';\n }, '');\n this.formatting_ = [];\n this[this.mode_](pts, text);\n};\n\n// Mode Implementations\nCea608Stream.prototype.popOn = function(pts, text) {\n var baseRow = this.nonDisplayed_[this.row_];\n\n // buffer characters\n baseRow += text;\n this.nonDisplayed_[this.row_] = baseRow;\n};\n\nCea608Stream.prototype.rollUp = function(pts, text) {\n var baseRow = this.displayed_[this.row_];\n\n baseRow += text;\n this.displayed_[this.row_] = baseRow;\n\n};\n\nCea608Stream.prototype.shiftRowsUp_ = function() {\n var i;\n // clear out inactive rows\n for (i = 0; i < this.topRow_; i++) {\n this.displayed_[i] = '';\n }\n for (i = this.row_ + 1; i < BOTTOM_ROW + 1; i++) {\n this.displayed_[i] = '';\n }\n // shift displayed rows up\n for (i = this.topRow_; i < this.row_; i++) {\n this.displayed_[i] = this.displayed_[i + 1];\n }\n // clear out the bottom row\n this.displayed_[this.row_] = '';\n};\n\nCea608Stream.prototype.paintOn = function(pts, text) {\n var baseRow = this.displayed_[this.row_];\n\n baseRow += text;\n this.displayed_[this.row_] = baseRow;\n};\n\n// exports\nmodule.exports = {\n CaptionStream: CaptionStream,\n Cea608Stream: Cea608Stream\n};\n","/**\n * mux.js\n *\n * Copyright (c) 2015 Brightcove\n * All rights reserved.\n *\n * A stream-based mp2t to mp4 converter. This utility can be used to\n * deliver mp4s to a SourceBuffer on platforms that support native\n * Media Source Extensions.\n */\n'use strict';\nvar Stream = require('../utils/stream.js'),\n CaptionStream = require('./caption-stream'),\n StreamTypes = require('./stream-types'),\n TimestampRolloverStream = require('./timestamp-rollover-stream').TimestampRolloverStream;\n\nvar m2tsStreamTypes = require('./stream-types.js');\n\n// object types\nvar TransportPacketStream, TransportParseStream, ElementaryStream;\n\n// constants\nvar\n MP2T_PACKET_LENGTH = 188, // bytes\n SYNC_BYTE = 0x47;\n\n/**\n * Splits an incoming stream of binary data into MPEG-2 Transport\n * Stream packets.\n */\nTransportPacketStream = function() {\n var\n buffer = new Uint8Array(MP2T_PACKET_LENGTH),\n bytesInBuffer = 0;\n\n TransportPacketStream.prototype.init.call(this);\n\n // Deliver new bytes to the stream.\n\n /**\n * Split a stream of data into M2TS packets\n **/\n this.push = function(bytes) {\n var\n startIndex = 0,\n endIndex = MP2T_PACKET_LENGTH,\n everything;\n\n // If there are bytes remaining from the last segment, prepend them to the\n // bytes that were pushed in\n if (bytesInBuffer) {\n everything = new Uint8Array(bytes.byteLength + bytesInBuffer);\n everything.set(buffer.subarray(0, bytesInBuffer));\n everything.set(bytes, bytesInBuffer);\n bytesInBuffer = 0;\n } else {\n everything = bytes;\n }\n\n // While we have enough data for a packet\n while (endIndex < everything.byteLength) {\n // Look for a pair of start and end sync bytes in the data..\n if (everything[startIndex] === SYNC_BYTE && everything[endIndex] === SYNC_BYTE) {\n // We found a packet so emit it and jump one whole packet forward in\n // the stream\n this.trigger('data', everything.subarray(startIndex, endIndex));\n startIndex += MP2T_PACKET_LENGTH;\n endIndex += MP2T_PACKET_LENGTH;\n continue;\n }\n // If we get here, we have somehow become de-synchronized and we need to step\n // forward one byte at a time until we find a pair of sync bytes that denote\n // a packet\n startIndex++;\n endIndex++;\n }\n\n // If there was some data left over at the end of the segment that couldn't\n // possibly be a whole packet, keep it because it might be the start of a packet\n // that continues in the next segment\n if (startIndex < everything.byteLength) {\n buffer.set(everything.subarray(startIndex), 0);\n bytesInBuffer = everything.byteLength - startIndex;\n }\n };\n\n /**\n * Passes identified M2TS packets to the TransportParseStream to be parsed\n **/\n this.flush = function() {\n // If the buffer contains a whole packet when we are being flushed, emit it\n // and empty the buffer. Otherwise hold onto the data because it may be\n // important for decoding the next segment\n if (bytesInBuffer === MP2T_PACKET_LENGTH && buffer[0] === SYNC_BYTE) {\n this.trigger('data', buffer);\n bytesInBuffer = 0;\n }\n this.trigger('done');\n };\n};\nTransportPacketStream.prototype = new Stream();\n\n/**\n * Accepts an MP2T TransportPacketStream and emits data events with parsed\n * forms of the individual transport stream packets.\n */\nTransportParseStream = function() {\n var parsePsi, parsePat, parsePmt, self;\n TransportParseStream.prototype.init.call(this);\n self = this;\n\n this.packetsWaitingForPmt = [];\n this.programMapTable = undefined;\n\n parsePsi = function(payload, psi) {\n var offset = 0;\n\n // PSI packets may be split into multiple sections and those\n // sections may be split into multiple packets. If a PSI\n // section starts in this packet, the payload_unit_start_indicator\n // will be true and the first byte of the payload will indicate\n // the offset from the current position to the start of the\n // section.\n if (psi.payloadUnitStartIndicator) {\n offset += payload[offset] + 1;\n }\n\n if (psi.type === 'pat') {\n parsePat(payload.subarray(offset), psi);\n } else {\n parsePmt(payload.subarray(offset), psi);\n }\n };\n\n parsePat = function(payload, pat) {\n pat.section_number = payload[7]; // eslint-disable-line camelcase\n pat.last_section_number = payload[8]; // eslint-disable-line camelcase\n\n // skip the PSI header and parse the first PMT entry\n self.pmtPid = (payload[10] & 0x1F) << 8 | payload[11];\n pat.pmtPid = self.pmtPid;\n };\n\n /**\n * Parse out the relevant fields of a Program Map Table (PMT).\n * @param payload {Uint8Array} the PMT-specific portion of an MP2T\n * packet. The first byte in this array should be the table_id\n * field.\n * @param pmt {object} the object that should be decorated with\n * fields parsed from the PMT.\n */\n parsePmt = function(payload, pmt) {\n var sectionLength, tableEnd, programInfoLength, offset;\n\n // PMTs can be sent ahead of the time when they should actually\n // take effect. We don't believe this should ever be the case\n // for HLS but we'll ignore \"forward\" PMT declarations if we see\n // them. Future PMT declarations have the current_next_indicator\n // set to zero.\n if (!(payload[5] & 0x01)) {\n return;\n }\n\n // overwrite any existing program map table\n self.programMapTable = {\n video: null,\n audio: null,\n 'timed-metadata': {}\n };\n\n // the mapping table ends at the end of the current section\n sectionLength = (payload[1] & 0x0f) << 8 | payload[2];\n tableEnd = 3 + sectionLength - 4;\n\n // to determine where the table is, we have to figure out how\n // long the program info descriptors are\n programInfoLength = (payload[10] & 0x0f) << 8 | payload[11];\n\n // advance the offset to the first entry in the mapping table\n offset = 12 + programInfoLength;\n while (offset < tableEnd) {\n var streamType = payload[offset];\n var pid = (payload[offset + 1] & 0x1F) << 8 | payload[offset + 2];\n\n // only map a single elementary_pid for audio and video stream types\n // TODO: should this be done for metadata too? for now maintain behavior of\n // multiple metadata streams\n if (streamType === StreamTypes.H264_STREAM_TYPE &&\n self.programMapTable.video === null) {\n self.programMapTable.video = pid;\n } else if (streamType === StreamTypes.ADTS_STREAM_TYPE &&\n self.programMapTable.audio === null) {\n self.programMapTable.audio = pid;\n } else if (streamType === StreamTypes.METADATA_STREAM_TYPE) {\n // map pid to stream type for metadata streams\n self.programMapTable['timed-metadata'][pid] = streamType;\n }\n\n // move to the next table entry\n // skip past the elementary stream descriptors, if present\n offset += ((payload[offset + 3] & 0x0F) << 8 | payload[offset + 4]) + 5;\n }\n\n // record the map on the packet as well\n pmt.programMapTable = self.programMapTable;\n };\n\n /**\n * Deliver a new MP2T packet to the next stream in the pipeline.\n */\n this.push = function(packet) {\n var\n result = {},\n offset = 4;\n\n result.payloadUnitStartIndicator = !!(packet[1] & 0x40);\n\n // pid is a 13-bit field starting at the last bit of packet[1]\n result.pid = packet[1] & 0x1f;\n result.pid <<= 8;\n result.pid |= packet[2];\n\n // if an adaption field is present, its length is specified by the\n // fifth byte of the TS packet header. The adaptation field is\n // used to add stuffing to PES packets that don't fill a complete\n // TS packet, and to specify some forms of timing and control data\n // that we do not currently use.\n if (((packet[3] & 0x30) >>> 4) > 0x01) {\n offset += packet[offset] + 1;\n }\n\n // parse the rest of the packet based on the type\n if (result.pid === 0) {\n result.type = 'pat';\n parsePsi(packet.subarray(offset), result);\n this.trigger('data', result);\n } else if (result.pid === this.pmtPid) {\n result.type = 'pmt';\n parsePsi(packet.subarray(offset), result);\n this.trigger('data', result);\n\n // if there are any packets waiting for a PMT to be found, process them now\n while (this.packetsWaitingForPmt.length) {\n this.processPes_.apply(this, this.packetsWaitingForPmt.shift());\n }\n } else if (this.programMapTable === undefined) {\n // When we have not seen a PMT yet, defer further processing of\n // PES packets until one has been parsed\n this.packetsWaitingForPmt.push([packet, offset, result]);\n } else {\n this.processPes_(packet, offset, result);\n }\n };\n\n this.processPes_ = function(packet, offset, result) {\n // set the appropriate stream type\n if (result.pid === this.programMapTable.video) {\n result.streamType = StreamTypes.H264_STREAM_TYPE;\n } else if (result.pid === this.programMapTable.audio) {\n result.streamType = StreamTypes.ADTS_STREAM_TYPE;\n } else {\n // if not video or audio, it is timed-metadata or unknown\n // if unknown, streamType will be undefined\n result.streamType = this.programMapTable['timed-metadata'][result.pid];\n }\n\n result.type = 'pes';\n result.data = packet.subarray(offset);\n\n this.trigger('data', result);\n };\n\n};\nTransportParseStream.prototype = new Stream();\nTransportParseStream.STREAM_TYPES = {\n h264: 0x1b,\n adts: 0x0f\n};\n\n/**\n * Reconsistutes program elementary stream (PES) packets from parsed\n * transport stream packets. That is, if you pipe an\n * mp2t.TransportParseStream into a mp2t.ElementaryStream, the output\n * events will be events which capture the bytes for individual PES\n * packets plus relevant metadata that has been extracted from the\n * container.\n */\nElementaryStream = function() {\n var\n self = this,\n // PES packet fragments\n video = {\n data: [],\n size: 0\n },\n audio = {\n data: [],\n size: 0\n },\n timedMetadata = {\n data: [],\n size: 0\n },\n parsePes = function(payload, pes) {\n var ptsDtsFlags;\n\n // get the packet length, this will be 0 for video\n pes.packetLength = 6 + ((payload[4] << 8) | payload[5]);\n\n // find out if this packets starts a new keyframe\n pes.dataAlignmentIndicator = (payload[6] & 0x04) !== 0;\n // PES packets may be annotated with a PTS value, or a PTS value\n // and a DTS value. Determine what combination of values is\n // available to work with.\n ptsDtsFlags = payload[7];\n\n // PTS and DTS are normally stored as a 33-bit number. Javascript\n // performs all bitwise operations on 32-bit integers but javascript\n // supports a much greater range (52-bits) of integer using standard\n // mathematical operations.\n // We construct a 31-bit value using bitwise operators over the 31\n // most significant bits and then multiply by 4 (equal to a left-shift\n // of 2) before we add the final 2 least significant bits of the\n // timestamp (equal to an OR.)\n if (ptsDtsFlags & 0xC0) {\n // the PTS and DTS are not written out directly. For information\n // on how they are encoded, see\n // http://dvd.sourceforge.net/dvdinfo/pes-hdr.html\n pes.pts = (payload[9] & 0x0E) << 27 |\n (payload[10] & 0xFF) << 20 |\n (payload[11] & 0xFE) << 12 |\n (payload[12] & 0xFF) << 5 |\n (payload[13] & 0xFE) >>> 3;\n pes.pts *= 4; // Left shift by 2\n pes.pts += (payload[13] & 0x06) >>> 1; // OR by the two LSBs\n pes.dts = pes.pts;\n if (ptsDtsFlags & 0x40) {\n pes.dts = (payload[14] & 0x0E) << 27 |\n (payload[15] & 0xFF) << 20 |\n (payload[16] & 0xFE) << 12 |\n (payload[17] & 0xFF) << 5 |\n (payload[18] & 0xFE) >>> 3;\n pes.dts *= 4; // Left shift by 2\n pes.dts += (payload[18] & 0x06) >>> 1; // OR by the two LSBs\n }\n }\n // the data section starts immediately after the PES header.\n // pes_header_data_length specifies the number of header bytes\n // that follow the last byte of the field.\n pes.data = payload.subarray(9 + payload[8]);\n },\n /**\n * Pass completely parsed PES packets to the next stream in the pipeline\n **/\n flushStream = function(stream, type, forceFlush) {\n var\n packetData = new Uint8Array(stream.size),\n event = {\n type: type\n },\n i = 0,\n offset = 0,\n packetFlushable = false,\n fragment;\n\n // do nothing if there is not enough buffered data for a complete\n // PES header\n if (!stream.data.length || stream.size < 9) {\n return;\n }\n event.trackId = stream.data[0].pid;\n\n // reassemble the packet\n for (i = 0; i < stream.data.length; i++) {\n fragment = stream.data[i];\n\n packetData.set(fragment.data, offset);\n offset += fragment.data.byteLength;\n }\n\n // parse assembled packet's PES header\n parsePes(packetData, event);\n\n // non-video PES packets MUST have a non-zero PES_packet_length\n // check that there is enough stream data to fill the packet\n packetFlushable = type === 'video' || event.packetLength <= stream.size;\n\n // flush pending packets if the conditions are right\n if (forceFlush || packetFlushable) {\n stream.size = 0;\n stream.data.length = 0;\n }\n\n // only emit packets that are complete. this is to avoid assembling\n // incomplete PES packets due to poor segmentation\n if (packetFlushable) {\n self.trigger('data', event);\n }\n };\n\n ElementaryStream.prototype.init.call(this);\n\n /**\n * Identifies M2TS packet types and parses PES packets using metadata\n * parsed from the PMT\n **/\n this.push = function(data) {\n ({\n pat: function() {\n // we have to wait for the PMT to arrive as well before we\n // have any meaningful metadata\n },\n pes: function() {\n var stream, streamType;\n\n switch (data.streamType) {\n case StreamTypes.H264_STREAM_TYPE:\n case m2tsStreamTypes.H264_STREAM_TYPE:\n stream = video;\n streamType = 'video';\n break;\n case StreamTypes.ADTS_STREAM_TYPE:\n stream = audio;\n streamType = 'audio';\n break;\n case StreamTypes.METADATA_STREAM_TYPE:\n stream = timedMetadata;\n streamType = 'timed-metadata';\n break;\n default:\n // ignore unknown stream types\n return;\n }\n\n // if a new packet is starting, we can flush the completed\n // packet\n if (data.payloadUnitStartIndicator) {\n flushStream(stream, streamType, true);\n }\n\n // buffer this fragment until we are sure we've received the\n // complete payload\n stream.data.push(data);\n stream.size += data.data.byteLength;\n },\n pmt: function() {\n var\n event = {\n type: 'metadata',\n tracks: []\n },\n programMapTable = data.programMapTable;\n\n // translate audio and video streams to tracks\n if (programMapTable.video !== null) {\n event.tracks.push({\n timelineStartInfo: {\n baseMediaDecodeTime: 0\n },\n id: +programMapTable.video,\n codec: 'avc',\n type: 'video'\n });\n }\n if (programMapTable.audio !== null) {\n event.tracks.push({\n timelineStartInfo: {\n baseMediaDecodeTime: 0\n },\n id: +programMapTable.audio,\n codec: 'adts',\n type: 'audio'\n });\n }\n\n self.trigger('data', event);\n }\n })[data.type]();\n };\n\n /**\n * Flush any remaining input. Video PES packets may be of variable\n * length. Normally, the start of a new video packet can trigger the\n * finalization of the previous packet. That is not possible if no\n * more video is forthcoming, however. In that case, some other\n * mechanism (like the end of the file) has to be employed. When it is\n * clear that no additional data is forthcoming, calling this method\n * will flush the buffered packets.\n */\n this.flush = function() {\n // !!THIS ORDER IS IMPORTANT!!\n // video first then audio\n flushStream(video, 'video');\n flushStream(audio, 'audio');\n flushStream(timedMetadata, 'timed-metadata');\n this.trigger('done');\n };\n};\nElementaryStream.prototype = new Stream();\n\nvar m2ts = {\n PAT_PID: 0x0000,\n MP2T_PACKET_LENGTH: MP2T_PACKET_LENGTH,\n TransportPacketStream: TransportPacketStream,\n TransportParseStream: TransportParseStream,\n ElementaryStream: ElementaryStream,\n TimestampRolloverStream: TimestampRolloverStream,\n CaptionStream: CaptionStream.CaptionStream,\n Cea608Stream: CaptionStream.Cea608Stream,\n MetadataStream: require('./metadata-stream')\n};\n\nfor (var type in StreamTypes) {\n if (StreamTypes.hasOwnProperty(type)) {\n m2ts[type] = StreamTypes[type];\n }\n}\n\nmodule.exports = m2ts;\n","/**\n * Accepts program elementary stream (PES) data events and parses out\n * ID3 metadata from them, if present.\n * @see http://id3.org/id3v2.3.0\n */\n'use strict';\nvar\n Stream = require('../utils/stream'),\n StreamTypes = require('./stream-types'),\n // return a percent-encoded representation of the specified byte range\n // @see http://en.wikipedia.org/wiki/Percent-encoding\n percentEncode = function(bytes, start, end) {\n var i, result = '';\n for (i = start; i < end; i++) {\n result += '%' + ('00' + bytes[i].toString(16)).slice(-2);\n }\n return result;\n },\n // return the string representation of the specified byte range,\n // interpreted as UTf-8.\n parseUtf8 = function(bytes, start, end) {\n return decodeURIComponent(percentEncode(bytes, start, end));\n },\n // return the string representation of the specified byte range,\n // interpreted as ISO-8859-1.\n parseIso88591 = function(bytes, start, end) {\n return unescape(percentEncode(bytes, start, end)); // jshint ignore:line\n },\n parseSyncSafeInteger = function(data) {\n return (data[0] << 21) |\n (data[1] << 14) |\n (data[2] << 7) |\n (data[3]);\n },\n tagParsers = {\n TXXX: function(tag) {\n var i;\n if (tag.data[0] !== 3) {\n // ignore frames with unrecognized character encodings\n return;\n }\n\n for (i = 1; i < tag.data.length; i++) {\n if (tag.data[i] === 0) {\n // parse the text fields\n tag.description = parseUtf8(tag.data, 1, i);\n // do not include the null terminator in the tag value\n tag.value = parseUtf8(tag.data, i + 1, tag.data.length).replace(/\\0*$/, '');\n break;\n }\n }\n tag.data = tag.value;\n },\n WXXX: function(tag) {\n var i;\n if (tag.data[0] !== 3) {\n // ignore frames with unrecognized character encodings\n return;\n }\n\n for (i = 1; i < tag.data.length; i++) {\n if (tag.data[i] === 0) {\n // parse the description and URL fields\n tag.description = parseUtf8(tag.data, 1, i);\n tag.url = parseUtf8(tag.data, i + 1, tag.data.length);\n break;\n }\n }\n },\n PRIV: function(tag) {\n var i;\n\n for (i = 0; i < tag.data.length; i++) {\n if (tag.data[i] === 0) {\n // parse the description and URL fields\n tag.owner = parseIso88591(tag.data, 0, i);\n break;\n }\n }\n tag.privateData = tag.data.subarray(i + 1);\n tag.data = tag.privateData;\n }\n },\n MetadataStream;\n\nMetadataStream = function(options) {\n var\n settings = {\n debug: !!(options && options.debug),\n\n // the bytes of the program-level descriptor field in MP2T\n // see ISO/IEC 13818-1:2013 (E), section 2.6 \"Program and\n // program element descriptors\"\n descriptor: options && options.descriptor\n },\n // the total size in bytes of the ID3 tag being parsed\n tagSize = 0,\n // tag data that is not complete enough to be parsed\n buffer = [],\n // the total number of bytes currently in the buffer\n bufferSize = 0,\n i;\n\n MetadataStream.prototype.init.call(this);\n\n // calculate the text track in-band metadata track dispatch type\n // https://html.spec.whatwg.org/multipage/embedded-content.html#steps-to-expose-a-media-resource-specific-text-track\n this.dispatchType = StreamTypes.METADATA_STREAM_TYPE.toString(16);\n if (settings.descriptor) {\n for (i = 0; i < settings.descriptor.length; i++) {\n this.dispatchType += ('00' + settings.descriptor[i].toString(16)).slice(-2);\n }\n }\n\n this.push = function(chunk) {\n var tag, frameStart, frameSize, frame, i, frameHeader;\n if (chunk.type !== 'timed-metadata') {\n return;\n }\n\n // if data_alignment_indicator is set in the PES header,\n // we must have the start of a new ID3 tag. Assume anything\n // remaining in the buffer was malformed and throw it out\n if (chunk.dataAlignmentIndicator) {\n bufferSize = 0;\n buffer.length = 0;\n }\n\n // ignore events that don't look like ID3 data\n if (buffer.length === 0 &&\n (chunk.data.length < 10 ||\n chunk.data[0] !== 'I'.charCodeAt(0) ||\n chunk.data[1] !== 'D'.charCodeAt(0) ||\n chunk.data[2] !== '3'.charCodeAt(0))) {\n if (settings.debug) {\n // eslint-disable-next-line no-console\n console.log('Skipping unrecognized metadata packet');\n }\n return;\n }\n\n // add this chunk to the data we've collected so far\n\n buffer.push(chunk);\n bufferSize += chunk.data.byteLength;\n\n // grab the size of the entire frame from the ID3 header\n if (buffer.length === 1) {\n // the frame size is transmitted as a 28-bit integer in the\n // last four bytes of the ID3 header.\n // The most significant bit of each byte is dropped and the\n // results concatenated to recover the actual value.\n tagSize = parseSyncSafeInteger(chunk.data.subarray(6, 10));\n\n // ID3 reports the tag size excluding the header but it's more\n // convenient for our comparisons to include it\n tagSize += 10;\n }\n\n // if the entire frame has not arrived, wait for more data\n if (bufferSize < tagSize) {\n return;\n }\n\n // collect the entire frame so it can be parsed\n tag = {\n data: new Uint8Array(tagSize),\n frames: [],\n pts: buffer[0].pts,\n dts: buffer[0].dts\n };\n for (i = 0; i < tagSize;) {\n tag.data.set(buffer[0].data.subarray(0, tagSize - i), i);\n i += buffer[0].data.byteLength;\n bufferSize -= buffer[0].data.byteLength;\n buffer.shift();\n }\n\n // find the start of the first frame and the end of the tag\n frameStart = 10;\n if (tag.data[5] & 0x40) {\n // advance the frame start past the extended header\n frameStart += 4; // header size field\n frameStart += parseSyncSafeInteger(tag.data.subarray(10, 14));\n\n // clip any padding off the end\n tagSize -= parseSyncSafeInteger(tag.data.subarray(16, 20));\n }\n\n // parse one or more ID3 frames\n // http://id3.org/id3v2.3.0#ID3v2_frame_overview\n do {\n // determine the number of bytes in this frame\n frameSize = parseSyncSafeInteger(tag.data.subarray(frameStart + 4, frameStart + 8));\n if (frameSize < 1) {\n // eslint-disable-next-line no-console\n return console.log('Malformed ID3 frame encountered. Skipping metadata parsing.');\n }\n frameHeader = String.fromCharCode(tag.data[frameStart],\n tag.data[frameStart + 1],\n tag.data[frameStart + 2],\n tag.data[frameStart + 3]);\n\n\n frame = {\n id: frameHeader,\n data: tag.data.subarray(frameStart + 10, frameStart + frameSize + 10)\n };\n frame.key = frame.id;\n if (tagParsers[frame.id]) {\n tagParsers[frame.id](frame);\n\n // handle the special PRIV frame used to indicate the start\n // time for raw AAC data\n if (frame.owner === 'com.apple.streaming.transportStreamTimestamp') {\n var\n d = frame.data,\n size = ((d[3] & 0x01) << 30) |\n (d[4] << 22) |\n (d[5] << 14) |\n (d[6] << 6) |\n (d[7] >>> 2);\n\n size *= 4;\n size += d[7] & 0x03;\n frame.timeStamp = size;\n // in raw AAC, all subsequent data will be timestamped based\n // on the value of this frame\n // we couldn't have known the appropriate pts and dts before\n // parsing this ID3 tag so set those values now\n if (tag.pts === undefined && tag.dts === undefined) {\n tag.pts = frame.timeStamp;\n tag.dts = frame.timeStamp;\n }\n this.trigger('timestamp', frame);\n }\n }\n tag.frames.push(frame);\n\n frameStart += 10; // advance past the frame header\n frameStart += frameSize; // advance past the frame body\n } while (frameStart < tagSize);\n this.trigger('data', tag);\n };\n};\nMetadataStream.prototype = new Stream();\n\nmodule.exports = MetadataStream;\n","/**\n * mux.js\n *\n * Copyright (c) 2016 Brightcove\n * All rights reserved.\n *\n * Utilities to detect basic properties and metadata about TS Segments.\n */\n'use strict';\n\nvar StreamTypes = require('./stream-types.js');\n\nvar parsePid = function(packet) {\n var pid = packet[1] & 0x1f;\n pid <<= 8;\n pid |= packet[2];\n return pid;\n};\n\nvar parsePayloadUnitStartIndicator = function(packet) {\n return !!(packet[1] & 0x40);\n};\n\nvar parseAdaptionField = function(packet) {\n var offset = 0;\n // if an adaption field is present, its length is specified by the\n // fifth byte of the TS packet header. The adaptation field is\n // used to add stuffing to PES packets that don't fill a complete\n // TS packet, and to specify some forms of timing and control data\n // that we do not currently use.\n if (((packet[3] & 0x30) >>> 4) > 0x01) {\n offset += packet[4] + 1;\n }\n return offset;\n};\n\nvar parseType = function(packet, pmtPid) {\n var pid = parsePid(packet);\n if (pid === 0) {\n return 'pat';\n } else if (pid === pmtPid) {\n return 'pmt';\n } else if (pmtPid) {\n return 'pes';\n }\n return null;\n};\n\nvar parsePat = function(packet) {\n var pusi = parsePayloadUnitStartIndicator(packet);\n var offset = 4 + parseAdaptionField(packet);\n\n if (pusi) {\n offset += packet[offset] + 1;\n }\n\n return (packet[offset + 10] & 0x1f) << 8 | packet[offset + 11];\n};\n\nvar parsePmt = function(packet) {\n var programMapTable = {};\n var pusi = parsePayloadUnitStartIndicator(packet);\n var payloadOffset = 4 + parseAdaptionField(packet);\n\n if (pusi) {\n payloadOffset += packet[payloadOffset] + 1;\n }\n\n // PMTs can be sent ahead of the time when they should actually\n // take effect. We don't believe this should ever be the case\n // for HLS but we'll ignore \"forward\" PMT declarations if we see\n // them. Future PMT declarations have the current_next_indicator\n // set to zero.\n if (!(packet[payloadOffset + 5] & 0x01)) {\n return;\n }\n\n var sectionLength, tableEnd, programInfoLength;\n // the mapping table ends at the end of the current section\n sectionLength = (packet[payloadOffset + 1] & 0x0f) << 8 | packet[payloadOffset + 2];\n tableEnd = 3 + sectionLength - 4;\n\n // to determine where the table is, we have to figure out how\n // long the program info descriptors are\n programInfoLength = (packet[payloadOffset + 10] & 0x0f) << 8 | packet[payloadOffset + 11];\n\n // advance the offset to the first entry in the mapping table\n var offset = 12 + programInfoLength;\n while (offset < tableEnd) {\n var i = payloadOffset + offset;\n // add an entry that maps the elementary_pid to the stream_type\n programMapTable[(packet[i + 1] & 0x1F) << 8 | packet[i + 2]] = packet[i];\n\n // move to the next table entry\n // skip past the elementary stream descriptors, if present\n offset += ((packet[i + 3] & 0x0F) << 8 | packet[i + 4]) + 5;\n }\n return programMapTable;\n};\n\nvar parsePesType = function(packet, programMapTable) {\n var pid = parsePid(packet);\n var type = programMapTable[pid];\n switch (type) {\n case StreamTypes.H264_STREAM_TYPE:\n return 'video';\n case StreamTypes.ADTS_STREAM_TYPE:\n return 'audio';\n case StreamTypes.METADATA_STREAM_TYPE:\n return 'timed-metadata';\n default:\n return null;\n }\n};\n\nvar parsePesTime = function(packet) {\n var pusi = parsePayloadUnitStartIndicator(packet);\n if (!pusi) {\n return null;\n }\n\n var offset = 4 + parseAdaptionField(packet);\n\n if (offset >= packet.byteLength) {\n // From the H 222.0 MPEG-TS spec\n // \"For transport stream packets carrying PES packets, stuffing is needed when there\n // is insufficient PES packet data to completely fill the transport stream packet\n // payload bytes. Stuffing is accomplished by defining an adaptation field longer than\n // the sum of the lengths of the data elements in it, so that the payload bytes\n // remaining after the adaptation field exactly accommodates the available PES packet\n // data.\"\n //\n // If the offset is >= the length of the packet, then the packet contains no data\n // and instead is just adaption field stuffing bytes\n return null;\n }\n\n var pes = null;\n var ptsDtsFlags;\n\n // PES packets may be annotated with a PTS value, or a PTS value\n // and a DTS value. Determine what combination of values is\n // available to work with.\n ptsDtsFlags = packet[offset + 7];\n\n // PTS and DTS are normally stored as a 33-bit number. Javascript\n // performs all bitwise operations on 32-bit integers but javascript\n // supports a much greater range (52-bits) of integer using standard\n // mathematical operations.\n // We construct a 31-bit value using bitwise operators over the 31\n // most significant bits and then multiply by 4 (equal to a left-shift\n // of 2) before we add the final 2 least significant bits of the\n // timestamp (equal to an OR.)\n if (ptsDtsFlags & 0xC0) {\n pes = {};\n // the PTS and DTS are not written out directly. For information\n // on how they are encoded, see\n // http://dvd.sourceforge.net/dvdinfo/pes-hdr.html\n pes.pts = (packet[offset + 9] & 0x0E) << 27 |\n (packet[offset + 10] & 0xFF) << 20 |\n (packet[offset + 11] & 0xFE) << 12 |\n (packet[offset + 12] & 0xFF) << 5 |\n (packet[offset + 13] & 0xFE) >>> 3;\n pes.pts *= 4; // Left shift by 2\n pes.pts += (packet[offset + 13] & 0x06) >>> 1; // OR by the two LSBs\n pes.dts = pes.pts;\n if (ptsDtsFlags & 0x40) {\n pes.dts = (packet[offset + 14] & 0x0E) << 27 |\n (packet[offset + 15] & 0xFF) << 20 |\n (packet[offset + 16] & 0xFE) << 12 |\n (packet[offset + 17] & 0xFF) << 5 |\n (packet[offset + 18] & 0xFE) >>> 3;\n pes.dts *= 4; // Left shift by 2\n pes.dts += (packet[offset + 18] & 0x06) >>> 1; // OR by the two LSBs\n }\n }\n return pes;\n};\n\nvar parseNalUnitType = function(type) {\n switch (type) {\n case 0x05:\n return 'slice_layer_without_partitioning_rbsp_idr';\n case 0x06:\n return 'sei_rbsp';\n case 0x07:\n return 'seq_parameter_set_rbsp';\n case 0x08:\n return 'pic_parameter_set_rbsp';\n case 0x09:\n return 'access_unit_delimiter_rbsp';\n default:\n return null;\n }\n};\n\nvar videoPacketContainsKeyFrame = function(packet) {\n var offset = 4 + parseAdaptionField(packet);\n var frameBuffer = packet.subarray(offset);\n var frameI = 0;\n var frameSyncPoint = 0;\n var foundKeyFrame = false;\n var nalType;\n\n // advance the sync point to a NAL start, if necessary\n for (; frameSyncPoint < frameBuffer.byteLength - 3; frameSyncPoint++) {\n if (frameBuffer[frameSyncPoint + 2] === 1) {\n // the sync point is properly aligned\n frameI = frameSyncPoint + 5;\n break;\n }\n }\n\n while (frameI < frameBuffer.byteLength) {\n // look at the current byte to determine if we've hit the end of\n // a NAL unit boundary\n switch (frameBuffer[frameI]) {\n case 0:\n // skip past non-sync sequences\n if (frameBuffer[frameI - 1] !== 0) {\n frameI += 2;\n break;\n } else if (frameBuffer[frameI - 2] !== 0) {\n frameI++;\n break;\n }\n\n if (frameSyncPoint + 3 !== frameI - 2) {\n nalType = parseNalUnitType(frameBuffer[frameSyncPoint + 3] & 0x1f);\n if (nalType === 'slice_layer_without_partitioning_rbsp_idr') {\n foundKeyFrame = true;\n }\n }\n\n // drop trailing zeroes\n do {\n frameI++;\n } while (frameBuffer[frameI] !== 1 && frameI < frameBuffer.length);\n frameSyncPoint = frameI - 2;\n frameI += 3;\n break;\n case 1:\n // skip past non-sync sequences\n if (frameBuffer[frameI - 1] !== 0 ||\n frameBuffer[frameI - 2] !== 0) {\n frameI += 3;\n break;\n }\n\n nalType = parseNalUnitType(frameBuffer[frameSyncPoint + 3] & 0x1f);\n if (nalType === 'slice_layer_without_partitioning_rbsp_idr') {\n foundKeyFrame = true;\n }\n frameSyncPoint = frameI - 2;\n frameI += 3;\n break;\n default:\n // the current byte isn't a one or zero, so it cannot be part\n // of a sync sequence\n frameI += 3;\n break;\n }\n }\n frameBuffer = frameBuffer.subarray(frameSyncPoint);\n frameI -= frameSyncPoint;\n frameSyncPoint = 0;\n // parse the final nal\n if (frameBuffer && frameBuffer.byteLength > 3) {\n nalType = parseNalUnitType(frameBuffer[frameSyncPoint + 3] & 0x1f);\n if (nalType === 'slice_layer_without_partitioning_rbsp_idr') {\n foundKeyFrame = true;\n }\n }\n\n return foundKeyFrame;\n};\n\n\nmodule.exports = {\n parseType: parseType,\n parsePat: parsePat,\n parsePmt: parsePmt,\n parsePayloadUnitStartIndicator: parsePayloadUnitStartIndicator,\n parsePesType: parsePesType,\n parsePesTime: parsePesTime,\n videoPacketContainsKeyFrame: videoPacketContainsKeyFrame\n};\n","'use strict';\n\nmodule.exports = {\n H264_STREAM_TYPE: 0x1B,\n ADTS_STREAM_TYPE: 0x0F,\n METADATA_STREAM_TYPE: 0x15\n};\n","/**\n * mux.js\n *\n * Copyright (c) 2016 Brightcove\n * All rights reserved.\n *\n * Accepts program elementary stream (PES) data events and corrects\n * decode and presentation time stamps to account for a rollover\n * of the 33 bit value.\n */\n\n'use strict';\n\nvar Stream = require('../utils/stream');\n\nvar MAX_TS = 8589934592;\n\nvar RO_THRESH = 4294967296;\n\nvar handleRollover = function(value, reference) {\n var direction = 1;\n\n if (value > reference) {\n // If the current timestamp value is greater than our reference timestamp and we detect a\n // timestamp rollover, this means the roll over is happening in the opposite direction.\n // Example scenario: Enter a long stream/video just after a rollover occurred. The reference\n // point will be set to a small number, e.g. 1. The user then seeks backwards over the\n // rollover point. In loading this segment, the timestamp values will be very large,\n // e.g. 2^33 - 1. Since this comes before the data we loaded previously, we want to adjust\n // the time stamp to be `value - 2^33`.\n direction = -1;\n }\n\n // Note: A seek forwards or back that is greater than the RO_THRESH (2^32, ~13 hours) will\n // cause an incorrect adjustment.\n while (Math.abs(reference - value) > RO_THRESH) {\n value += (direction * MAX_TS);\n }\n\n return value;\n};\n\nvar TimestampRolloverStream = function(type) {\n var lastDTS, referenceDTS;\n\n TimestampRolloverStream.prototype.init.call(this);\n\n this.type_ = type;\n\n this.push = function(data) {\n if (data.type !== this.type_) {\n return;\n }\n\n if (referenceDTS === undefined) {\n referenceDTS = data.dts;\n }\n\n data.dts = handleRollover(data.dts, referenceDTS);\n data.pts = handleRollover(data.pts, referenceDTS);\n\n lastDTS = data.dts;\n\n this.trigger('data', data);\n };\n\n this.flush = function() {\n referenceDTS = lastDTS;\n this.trigger('done');\n };\n\n this.discontinuity = function() {\n referenceDTS = void 0;\n lastDTS = void 0;\n };\n\n};\n\nTimestampRolloverStream.prototype = new Stream();\n\nmodule.exports = {\n TimestampRolloverStream: TimestampRolloverStream,\n handleRollover: handleRollover\n};\n","var coneOfSilence = require('../data/silence');\nvar clock = require('../utils/clock');\n\nvar ONE_SECOND_IN_TS = 90000; // 90kHz clock\n\n/**\n * Sum the `byteLength` properties of the data in each AAC frame\n */\nvar sumFrameByteLengths = function(array) {\n var\n i,\n currentObj,\n sum = 0;\n\n // sum the byteLength's all each nal unit in the frame\n for (i = 0; i < array.length; i++) {\n currentObj = array[i];\n sum += currentObj.data.byteLength;\n }\n\n return sum;\n};\n\n// Possibly pad (prefix) the audio track with silence if appending this track\n// would lead to the introduction of a gap in the audio buffer\nvar prefixWithSilence = function(\n track,\n frames,\n audioAppendStartTs,\n videoBaseMediaDecodeTime\n) {\n var\n baseMediaDecodeTimeTs,\n frameDuration = 0,\n audioGapDuration = 0,\n audioFillFrameCount = 0,\n audioFillDuration = 0,\n silentFrame,\n i;\n\n if (!frames.length) {\n return;\n }\n\n baseMediaDecodeTimeTs =\n clock.audioTsToVideoTs(track.baseMediaDecodeTime, track.samplerate);\n // determine frame clock duration based on sample rate, round up to avoid overfills\n frameDuration = Math.ceil(ONE_SECOND_IN_TS / (track.samplerate / 1024));\n\n if (audioAppendStartTs && videoBaseMediaDecodeTime) {\n // insert the shortest possible amount (audio gap or audio to video gap)\n audioGapDuration =\n baseMediaDecodeTimeTs - Math.max(audioAppendStartTs, videoBaseMediaDecodeTime);\n // number of full frames in the audio gap\n audioFillFrameCount = Math.floor(audioGapDuration / frameDuration);\n audioFillDuration = audioFillFrameCount * frameDuration;\n }\n\n // don't attempt to fill gaps smaller than a single frame or larger\n // than a half second\n if (audioFillFrameCount < 1 || audioFillDuration > ONE_SECOND_IN_TS / 2) {\n return;\n }\n\n silentFrame = coneOfSilence[track.samplerate];\n\n if (!silentFrame) {\n // we don't have a silent frame pregenerated for the sample rate, so use a frame\n // from the content instead\n silentFrame = frames[0].data;\n }\n\n for (i = 0; i < audioFillFrameCount; i++) {\n frames.splice(i, 0, {\n data: silentFrame\n });\n }\n\n track.baseMediaDecodeTime -=\n Math.floor(clock.videoTsToAudioTs(audioFillDuration, track.samplerate));\n};\n\n// If the audio segment extends before the earliest allowed dts\n// value, remove AAC frames until starts at or after the earliest\n// allowed DTS so that we don't end up with a negative baseMedia-\n// DecodeTime for the audio track\nvar trimAdtsFramesByEarliestDts = function(adtsFrames, track, earliestAllowedDts) {\n if (track.minSegmentDts >= earliestAllowedDts) {\n return adtsFrames;\n }\n\n // We will need to recalculate the earliest segment Dts\n track.minSegmentDts = Infinity;\n\n return adtsFrames.filter(function(currentFrame) {\n // If this is an allowed frame, keep it and record it's Dts\n if (currentFrame.dts >= earliestAllowedDts) {\n track.minSegmentDts = Math.min(track.minSegmentDts, currentFrame.dts);\n track.minSegmentPts = track.minSegmentDts;\n return true;\n }\n // Otherwise, discard it\n return false;\n });\n};\n\n// generate the track's raw mdat data from an array of frames\nvar generateSampleTable = function(frames) {\n var\n i,\n currentFrame,\n samples = [];\n\n for (i = 0; i < frames.length; i++) {\n currentFrame = frames[i];\n samples.push({\n size: currentFrame.data.byteLength,\n duration: 1024 // For AAC audio, all samples contain 1024 samples\n });\n }\n return samples;\n};\n\n// generate the track's sample table from an array of frames\nvar concatenateFrameData = function(frames) {\n var\n i,\n currentFrame,\n dataOffset = 0,\n data = new Uint8Array(sumFrameByteLengths(frames));\n\n for (i = 0; i < frames.length; i++) {\n currentFrame = frames[i];\n\n data.set(currentFrame.data, dataOffset);\n dataOffset += currentFrame.data.byteLength;\n }\n return data;\n};\n\nmodule.exports = {\n prefixWithSilence: prefixWithSilence,\n trimAdtsFramesByEarliestDts: trimAdtsFramesByEarliestDts,\n generateSampleTable: generateSampleTable,\n concatenateFrameData: concatenateFrameData\n};\n","/**\n * mux.js\n *\n * Copyright (c) 2015 Brightcove\n * All rights reserved.\n *\n * Reads in-band CEA-708 captions out of FMP4 segments.\n * @see https://en.wikipedia.org/wiki/CEA-708\n */\n'use strict';\n\nvar discardEmulationPreventionBytes = require('../tools/caption-packet-parser').discardEmulationPreventionBytes;\nvar CaptionStream = require('../m2ts/caption-stream').CaptionStream;\nvar probe = require('./probe');\nvar inspect = require('../tools/mp4-inspector');\n\n/**\n * Maps an offset in the mdat to a sample based on the the size of the samples.\n * Assumes that `parseSamples` has been called first.\n *\n * @param {Number} offset - The offset into the mdat\n * @param {Object[]} samples - An array of samples, parsed using `parseSamples`\n * @return {?Object} The matching sample, or null if no match was found.\n *\n * @see ISO-BMFF-12/2015, Section 8.8.8\n **/\nvar mapToSample = function(offset, samples) {\n var approximateOffset = offset;\n\n for (var i = 0; i < samples.length; i++) {\n var sample = samples[i];\n\n if (approximateOffset < sample.size) {\n return sample;\n }\n\n approximateOffset -= sample.size;\n }\n\n return null;\n};\n\n/**\n * Finds SEI nal units contained in a Media Data Box.\n * Assumes that `parseSamples` has been called first.\n *\n * @param {Uint8Array} avcStream - The bytes of the mdat\n * @param {Object[]} samples - The samples parsed out by `parseSamples`\n * @param {Number} trackId - The trackId of this video track\n * @return {Object[]} seiNals - the parsed SEI NALUs found.\n * The contents of the seiNal should match what is expected by\n * CaptionStream.push (nalUnitType, size, data, escapedRBSP, pts, dts)\n *\n * @see ISO-BMFF-12/2015, Section 8.1.1\n * @see Rec. ITU-T H.264, 7.3.2.3.1\n **/\nvar findSeiNals = function(avcStream, samples, trackId) {\n var\n avcView = new DataView(avcStream.buffer, avcStream.byteOffset, avcStream.byteLength),\n result = [],\n seiNal,\n i,\n length,\n lastMatchedSample;\n\n for (i = 0; i + 4 < avcStream.length; i += length) {\n length = avcView.getUint32(i);\n i += 4;\n\n // Bail if this doesn't appear to be an H264 stream\n if (length <= 0) {\n continue;\n }\n\n switch (avcStream[i] & 0x1F) {\n case 0x06:\n var data = avcStream.subarray(i + 1, i + 1 + length);\n var matchingSample = mapToSample(i, samples);\n\n seiNal = {\n nalUnitType: 'sei_rbsp',\n size: length,\n data: data,\n escapedRBSP: discardEmulationPreventionBytes(data),\n trackId: trackId\n };\n\n if (matchingSample) {\n seiNal.pts = matchingSample.pts;\n seiNal.dts = matchingSample.dts;\n lastMatchedSample = matchingSample;\n } else {\n // If a matching sample cannot be found, use the last\n // sample's values as they should be as close as possible\n seiNal.pts = lastMatchedSample.pts;\n seiNal.dts = lastMatchedSample.dts;\n }\n\n result.push(seiNal);\n break;\n default:\n break;\n }\n }\n\n return result;\n};\n\n/**\n * Parses sample information out of Track Run Boxes and calculates\n * the absolute presentation and decode timestamps of each sample.\n *\n * @param {Array<Uint8Array>} truns - The Trun Run boxes to be parsed\n * @param {Number} baseMediaDecodeTime - base media decode time from tfdt\n @see ISO-BMFF-12/2015, Section 8.8.12\n * @param {Object} tfhd - The parsed Track Fragment Header\n * @see inspect.parseTfhd\n * @return {Object[]} the parsed samples\n *\n * @see ISO-BMFF-12/2015, Section 8.8.8\n **/\nvar parseSamples = function(truns, baseMediaDecodeTime, tfhd) {\n var currentDts = baseMediaDecodeTime;\n var defaultSampleDuration = tfhd.defaultSampleDuration || 0;\n var defaultSampleSize = tfhd.defaultSampleSize || 0;\n var trackId = tfhd.trackId;\n var allSamples = [];\n\n truns.forEach(function(trun) {\n // Note: We currently do not parse the sample table as well\n // as the trun. It's possible some sources will require this.\n // moov > trak > mdia > minf > stbl\n var trackRun = inspect.parseTrun(trun);\n var samples = trackRun.samples;\n\n samples.forEach(function(sample) {\n if (sample.duration === undefined) {\n sample.duration = defaultSampleDuration;\n }\n if (sample.size === undefined) {\n sample.size = defaultSampleSize;\n }\n sample.trackId = trackId;\n sample.dts = currentDts;\n if (sample.compositionTimeOffset === undefined) {\n sample.compositionTimeOffset = 0;\n }\n sample.pts = currentDts + sample.compositionTimeOffset;\n\n currentDts += sample.duration;\n });\n\n allSamples = allSamples.concat(samples);\n });\n\n return allSamples;\n};\n\n/**\n * Parses out caption nals from an FMP4 segment's video tracks.\n *\n * @param {Uint8Array} segment - The bytes of a single segment\n * @param {Number} videoTrackId - The trackId of a video track in the segment\n * @return {Object.<Number, Object[]>} A mapping of video trackId to\n * a list of seiNals found in that track\n **/\nvar parseCaptionNals = function(segment, videoTrackId) {\n // To get the samples\n var trafs = probe.findBox(segment, ['moof', 'traf']);\n // To get SEI NAL units\n var mdats = probe.findBox(segment, ['mdat']);\n var captionNals = {};\n var mdatTrafPairs = [];\n\n // Pair up each traf with a mdat as moofs and mdats are in pairs\n mdats.forEach(function(mdat, index) {\n var matchingTraf = trafs[index];\n mdatTrafPairs.push({\n mdat: mdat,\n traf: matchingTraf\n });\n });\n\n mdatTrafPairs.forEach(function(pair) {\n var mdat = pair.mdat;\n var traf = pair.traf;\n var tfhd = probe.findBox(traf, ['tfhd']);\n // Exactly 1 tfhd per traf\n var headerInfo = inspect.parseTfhd(tfhd[0]);\n var trackId = headerInfo.trackId;\n var tfdt = probe.findBox(traf, ['tfdt']);\n // Either 0 or 1 tfdt per traf\n var baseMediaDecodeTime = (tfdt.length > 0) ? inspect.parseTfdt(tfdt[0]).baseMediaDecodeTime : 0;\n var truns = probe.findBox(traf, ['trun']);\n var samples;\n var seiNals;\n\n // Only parse video data for the chosen video track\n if (videoTrackId === trackId && truns.length > 0) {\n samples = parseSamples(truns, baseMediaDecodeTime, headerInfo);\n\n seiNals = findSeiNals(mdat, samples, trackId);\n\n if (!captionNals[trackId]) {\n captionNals[trackId] = [];\n }\n\n captionNals[trackId] = captionNals[trackId].concat(seiNals);\n }\n });\n\n return captionNals;\n};\n\n/**\n * Parses out inband captions from an MP4 container and returns\n * caption objects that can be used by WebVTT and the TextTrack API.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/VTTCue\n * @see https://developer.mozilla.org/en-US/docs/Web/API/TextTrack\n * Assumes that `probe.getVideoTrackIds` and `probe.timescale` have been called first\n *\n * @param {Uint8Array} segment - The fmp4 segment containing embedded captions\n * @param {Number} trackId - The id of the video track to parse\n * @param {Number} timescale - The timescale for the video track from the init segment\n *\n * @return {?Object[]} parsedCaptions - A list of captions or null if no video tracks\n * @return {Number} parsedCaptions[].startTime - The time to show the caption in seconds\n * @return {Number} parsedCaptions[].endTime - The time to stop showing the caption in seconds\n * @return {String} parsedCaptions[].text - The visible content of the caption\n **/\nvar parseEmbeddedCaptions = function(segment, trackId, timescale) {\n var seiNals;\n\n if (!trackId) {\n return null;\n }\n\n seiNals = parseCaptionNals(segment, trackId);\n\n return {\n seiNals: seiNals[trackId],\n timescale: timescale\n };\n};\n\n/**\n * Converts SEI NALUs into captions that can be used by video.js\n **/\nvar CaptionParser = function() {\n var isInitialized = false;\n var captionStream;\n\n // Stores segments seen before trackId and timescale are set\n var segmentCache;\n // Stores video track ID of the track being parsed\n var trackId;\n // Stores the timescale of the track being parsed\n var timescale;\n // Stores captions parsed so far\n var parsedCaptions;\n\n /**\n * A method to indicate whether a CaptionParser has been initalized\n * @returns {Boolean}\n **/\n this.isInitialized = function() {\n return isInitialized;\n };\n\n /**\n * Initializes the underlying CaptionStream, SEI NAL parsing\n * and management, and caption collection\n **/\n this.init = function() {\n captionStream = new CaptionStream();\n isInitialized = true;\n\n // Collect dispatched captions\n captionStream.on('data', function(event) {\n // Convert to seconds in the source's timescale\n event.startTime = event.startPts / timescale;\n event.endTime = event.endPts / timescale;\n\n parsedCaptions.captions.push(event);\n parsedCaptions.captionStreams[event.stream] = true;\n });\n };\n\n /**\n * Determines if a new video track will be selected\n * or if the timescale changed\n * @return {Boolean}\n **/\n this.isNewInit = function(videoTrackIds, timescales) {\n if ((videoTrackIds && videoTrackIds.length === 0) ||\n (timescales && typeof timescales === 'object' &&\n Object.keys(timescales).length === 0)) {\n return false;\n }\n\n return trackId !== videoTrackIds[0] ||\n timescale !== timescales[trackId];\n };\n\n /**\n * Parses out SEI captions and interacts with underlying\n * CaptionStream to return dispatched captions\n *\n * @param {Uint8Array} segment - The fmp4 segment containing embedded captions\n * @param {Number[]} videoTrackIds - A list of video tracks found in the init segment\n * @param {Object.<Number, Number>} timescales - The timescales found in the init segment\n * @see parseEmbeddedCaptions\n * @see m2ts/caption-stream.js\n **/\n this.parse = function(segment, videoTrackIds, timescales) {\n var parsedData;\n\n if (!this.isInitialized()) {\n return null;\n\n // This is not likely to be a video segment\n } else if (!videoTrackIds || !timescales) {\n return null;\n\n } else if (this.isNewInit(videoTrackIds, timescales)) {\n // Use the first video track only as there is no\n // mechanism to switch to other video tracks\n trackId = videoTrackIds[0];\n timescale = timescales[trackId];\n\n // If an init segment has not been seen yet, hold onto segment\n // data until we have one\n } else if (!trackId || !timescale) {\n segmentCache.push(segment);\n return null;\n }\n\n // Now that a timescale and trackId is set, parse cached segments\n while (segmentCache.length > 0) {\n var cachedSegment = segmentCache.shift();\n\n this.parse(cachedSegment, videoTrackIds, timescales);\n }\n\n parsedData = parseEmbeddedCaptions(segment, trackId, timescale);\n\n if (parsedData === null || !parsedData.seiNals) {\n return null;\n }\n\n this.pushNals(parsedData.seiNals);\n // Force the parsed captions to be dispatched\n this.flushStream();\n\n return parsedCaptions;\n };\n\n /**\n * Pushes SEI NALUs onto CaptionStream\n * @param {Object[]} nals - A list of SEI nals parsed using `parseCaptionNals`\n * Assumes that `parseCaptionNals` has been called first\n * @see m2ts/caption-stream.js\n **/\n this.pushNals = function(nals) {\n if (!this.isInitialized() || !nals || nals.length === 0) {\n return null;\n }\n\n nals.forEach(function(nal) {\n captionStream.push(nal);\n });\n };\n\n /**\n * Flushes underlying CaptionStream to dispatch processed, displayable captions\n * @see m2ts/caption-stream.js\n **/\n this.flushStream = function() {\n if (!this.isInitialized()) {\n return null;\n }\n\n captionStream.flush();\n };\n\n /**\n * Reset caption buckets for new data\n **/\n this.clearParsedCaptions = function() {\n parsedCaptions.captions = [];\n parsedCaptions.captionStreams = {};\n };\n\n /**\n * Resets underlying CaptionStream\n * @see m2ts/caption-stream.js\n **/\n this.resetCaptionStream = function() {\n if (!this.isInitialized()) {\n return null;\n }\n\n captionStream.reset();\n };\n\n /**\n * Convenience method to clear all captions flushed from the\n * CaptionStream and still being parsed\n * @see m2ts/caption-stream.js\n **/\n this.clearAllCaptions = function() {\n this.clearParsedCaptions();\n this.resetCaptionStream();\n };\n\n /**\n * Reset caption parser\n **/\n this.reset = function() {\n segmentCache = [];\n trackId = null;\n timescale = null;\n\n if (!parsedCaptions) {\n parsedCaptions = {\n captions: [],\n // CC1, CC2, CC3, CC4\n captionStreams: {}\n };\n } else {\n this.clearParsedCaptions();\n }\n\n this.resetCaptionStream();\n };\n\n this.reset();\n};\n\nmodule.exports = CaptionParser;\n","// Convert an array of nal units into an array of frames with each frame being\n// composed of the nal units that make up that frame\n// Also keep track of cummulative data about the frame from the nal units such\n// as the frame duration, starting pts, etc.\nvar groupNalsIntoFrames = function(nalUnits) {\n var\n i,\n currentNal,\n currentFrame = [],\n frames = [];\n\n currentFrame.byteLength = 0;\n\n for (i = 0; i < nalUnits.length; i++) {\n currentNal = nalUnits[i];\n\n // Split on 'aud'-type nal units\n if (currentNal.nalUnitType === 'access_unit_delimiter_rbsp') {\n // Since the very first nal unit is expected to be an AUD\n // only push to the frames array when currentFrame is not empty\n if (currentFrame.length) {\n currentFrame.duration = currentNal.dts - currentFrame.dts;\n frames.push(currentFrame);\n }\n currentFrame = [currentNal];\n currentFrame.byteLength = currentNal.data.byteLength;\n currentFrame.pts = currentNal.pts;\n currentFrame.dts = currentNal.dts;\n } else {\n // Specifically flag key frames for ease of use later\n if (currentNal.nalUnitType === 'slice_layer_without_partitioning_rbsp_idr') {\n currentFrame.keyFrame = true;\n }\n currentFrame.duration = currentNal.dts - currentFrame.dts;\n currentFrame.byteLength += currentNal.data.byteLength;\n currentFrame.push(currentNal);\n }\n }\n\n // For the last frame, use the duration of the previous frame if we\n // have nothing better to go on\n if (frames.length &&\n (!currentFrame.duration ||\n currentFrame.duration <= 0)) {\n currentFrame.duration = frames[frames.length - 1].duration;\n }\n\n // Push the final frame\n frames.push(currentFrame);\n return frames;\n};\n\n// Convert an array of frames into an array of Gop with each Gop being composed\n// of the frames that make up that Gop\n// Also keep track of cummulative data about the Gop from the frames such as the\n// Gop duration, starting pts, etc.\nvar groupFramesIntoGops = function(frames) {\n var\n i,\n currentFrame,\n currentGop = [],\n gops = [];\n\n // We must pre-set some of the values on the Gop since we\n // keep running totals of these values\n currentGop.byteLength = 0;\n currentGop.nalCount = 0;\n currentGop.duration = 0;\n currentGop.pts = frames[0].pts;\n currentGop.dts = frames[0].dts;\n\n // store some metadata about all the Gops\n gops.byteLength = 0;\n gops.nalCount = 0;\n gops.duration = 0;\n gops.pts = frames[0].pts;\n gops.dts = frames[0].dts;\n\n for (i = 0; i < frames.length; i++) {\n currentFrame = frames[i];\n\n if (currentFrame.keyFrame) {\n // Since the very first frame is expected to be an keyframe\n // only push to the gops array when currentGop is not empty\n if (currentGop.length) {\n gops.push(currentGop);\n gops.byteLength += currentGop.byteLength;\n gops.nalCount += currentGop.nalCount;\n gops.duration += currentGop.duration;\n }\n\n currentGop = [currentFrame];\n currentGop.nalCount = currentFrame.length;\n currentGop.byteLength = currentFrame.byteLength;\n currentGop.pts = currentFrame.pts;\n currentGop.dts = currentFrame.dts;\n currentGop.duration = currentFrame.duration;\n } else {\n currentGop.duration += currentFrame.duration;\n currentGop.nalCount += currentFrame.length;\n currentGop.byteLength += currentFrame.byteLength;\n currentGop.push(currentFrame);\n }\n }\n\n if (gops.length && currentGop.duration <= 0) {\n currentGop.duration = gops[gops.length - 1].duration;\n }\n gops.byteLength += currentGop.byteLength;\n gops.nalCount += currentGop.nalCount;\n gops.duration += currentGop.duration;\n\n // push the final Gop\n gops.push(currentGop);\n return gops;\n};\n\n/*\n * Search for the first keyframe in the GOPs and throw away all frames\n * until that keyframe. Then extend the duration of the pulled keyframe\n * and pull the PTS and DTS of the keyframe so that it covers the time\n * range of the frames that were disposed.\n *\n * @param {Array} gops video GOPs\n * @returns {Array} modified video GOPs\n */\nvar extendFirstKeyFrame = function(gops) {\n var currentGop;\n\n if (!gops[0][0].keyFrame && gops.length > 1) {\n // Remove the first GOP\n currentGop = gops.shift();\n\n gops.byteLength -= currentGop.byteLength;\n gops.nalCount -= currentGop.nalCount;\n\n // Extend the first frame of what is now the\n // first gop to cover the time period of the\n // frames we just removed\n gops[0][0].dts = currentGop.dts;\n gops[0][0].pts = currentGop.pts;\n gops[0][0].duration += currentGop.duration;\n }\n\n return gops;\n};\n\n/**\n * Default sample object\n * see ISO/IEC 14496-12:2012, section 8.6.4.3\n */\nvar createDefaultSample = function() {\n return {\n size: 0,\n flags: {\n isLeading: 0,\n dependsOn: 1,\n isDependedOn: 0,\n hasRedundancy: 0,\n degradationPriority: 0,\n isNonSyncSample: 1\n }\n };\n};\n\n/*\n * Collates information from a video frame into an object for eventual\n * entry into an MP4 sample table.\n *\n * @param {Object} frame the video frame\n * @param {Number} dataOffset the byte offset to position the sample\n * @return {Object} object containing sample table info for a frame\n */\nvar sampleForFrame = function(frame, dataOffset) {\n var sample = createDefaultSample();\n\n sample.dataOffset = dataOffset;\n sample.compositionTimeOffset = frame.pts - frame.dts;\n sample.duration = frame.duration;\n sample.size = 4 * frame.length; // Space for nal unit size\n sample.size += frame.byteLength;\n\n if (frame.keyFrame) {\n sample.flags.dependsOn = 2;\n sample.flags.isNonSyncSample = 0;\n }\n\n return sample;\n};\n\n// generate the track's sample table from an array of gops\nvar generateSampleTable = function(gops, baseDataOffset) {\n var\n h, i,\n sample,\n currentGop,\n currentFrame,\n dataOffset = baseDataOffset || 0,\n samples = [];\n\n for (h = 0; h < gops.length; h++) {\n currentGop = gops[h];\n\n for (i = 0; i < currentGop.length; i++) {\n currentFrame = currentGop[i];\n\n sample = sampleForFrame(currentFrame, dataOffset);\n\n dataOffset += sample.size;\n\n samples.push(sample);\n }\n }\n return samples;\n};\n\n// generate the track's raw mdat data from an array of gops\nvar concatenateNalData = function(gops) {\n var\n h, i, j,\n currentGop,\n currentFrame,\n currentNal,\n dataOffset = 0,\n nalsByteLength = gops.byteLength,\n numberOfNals = gops.nalCount,\n totalByteLength = nalsByteLength + 4 * numberOfNals,\n data = new Uint8Array(totalByteLength),\n view = new DataView(data.buffer);\n\n // For each Gop..\n for (h = 0; h < gops.length; h++) {\n currentGop = gops[h];\n\n // For each Frame..\n for (i = 0; i < currentGop.length; i++) {\n currentFrame = currentGop[i];\n\n // For each NAL..\n for (j = 0; j < currentFrame.length; j++) {\n currentNal = currentFrame[j];\n\n view.setUint32(dataOffset, currentNal.data.byteLength);\n dataOffset += 4;\n data.set(currentNal.data, dataOffset);\n dataOffset += currentNal.data.byteLength;\n }\n }\n }\n return data;\n};\n\nmodule.exports = {\n groupNalsIntoFrames: groupNalsIntoFrames,\n groupFramesIntoGops: groupFramesIntoGops,\n extendFirstKeyFrame: extendFirstKeyFrame,\n generateSampleTable: generateSampleTable,\n concatenateNalData: concatenateNalData\n};\n","module.exports = {\n generator: require('./mp4-generator'),\n probe: require('./probe'),\n Transmuxer: require('./transmuxer').Transmuxer,\n AudioSegmentStream: require('./transmuxer').AudioSegmentStream,\n VideoSegmentStream: require('./transmuxer').VideoSegmentStream,\n CaptionParser: require('./caption-parser')\n};\n","/**\n * mux.js\n *\n * Copyright (c) 2015 Brightcove\n * All rights reserved.\n *\n * Functions that generate fragmented MP4s suitable for use with Media\n * Source Extensions.\n */\n'use strict';\n\nvar UINT32_MAX = Math.pow(2, 32) - 1;\n\nvar box, dinf, esds, ftyp, mdat, mfhd, minf, moof, moov, mvex, mvhd,\n trak, tkhd, mdia, mdhd, hdlr, sdtp, stbl, stsd, traf, trex,\n trun, types, MAJOR_BRAND, MINOR_VERSION, AVC1_BRAND, VIDEO_HDLR,\n AUDIO_HDLR, HDLR_TYPES, VMHD, SMHD, DREF, STCO, STSC, STSZ, STTS;\n\n// pre-calculate constants\n(function() {\n var i;\n types = {\n avc1: [], // codingname\n avcC: [],\n btrt: [],\n dinf: [],\n dref: [],\n esds: [],\n ftyp: [],\n hdlr: [],\n mdat: [],\n mdhd: [],\n mdia: [],\n mfhd: [],\n minf: [],\n moof: [],\n moov: [],\n mp4a: [], // codingname\n mvex: [],\n mvhd: [],\n sdtp: [],\n smhd: [],\n stbl: [],\n stco: [],\n stsc: [],\n stsd: [],\n stsz: [],\n stts: [],\n styp: [],\n tfdt: [],\n tfhd: [],\n traf: [],\n trak: [],\n trun: [],\n trex: [],\n tkhd: [],\n vmhd: []\n };\n\n // In environments where Uint8Array is undefined (e.g., IE8), skip set up so that we\n // don't throw an error\n if (typeof Uint8Array === 'undefined') {\n return;\n }\n\n for (i in types) {\n if (types.hasOwnProperty(i)) {\n types[i] = [\n i.charCodeAt(0),\n i.charCodeAt(1),\n i.charCodeAt(2),\n i.charCodeAt(3)\n ];\n }\n }\n\n MAJOR_BRAND = new Uint8Array([\n 'i'.charCodeAt(0),\n 's'.charCodeAt(0),\n 'o'.charCodeAt(0),\n 'm'.charCodeAt(0)\n ]);\n AVC1_BRAND = new Uint8Array([\n 'a'.charCodeAt(0),\n 'v'.charCodeAt(0),\n 'c'.charCodeAt(0),\n '1'.charCodeAt(0)\n ]);\n MINOR_VERSION = new Uint8Array([0, 0, 0, 1]);\n VIDEO_HDLR = new Uint8Array([\n 0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, // pre_defined\n 0x76, 0x69, 0x64, 0x65, // handler_type: 'vide'\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x56, 0x69, 0x64, 0x65,\n 0x6f, 0x48, 0x61, 0x6e,\n 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'VideoHandler'\n ]);\n AUDIO_HDLR = new Uint8Array([\n 0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, // pre_defined\n 0x73, 0x6f, 0x75, 0x6e, // handler_type: 'soun'\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x53, 0x6f, 0x75, 0x6e,\n 0x64, 0x48, 0x61, 0x6e,\n 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'SoundHandler'\n ]);\n HDLR_TYPES = {\n video: VIDEO_HDLR,\n audio: AUDIO_HDLR\n };\n DREF = new Uint8Array([\n 0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x01, // entry_count\n 0x00, 0x00, 0x00, 0x0c, // entry_size\n 0x75, 0x72, 0x6c, 0x20, // 'url' type\n 0x00, // version 0\n 0x00, 0x00, 0x01 // entry_flags\n ]);\n SMHD = new Uint8Array([\n 0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, // balance, 0 means centered\n 0x00, 0x00 // reserved\n ]);\n STCO = new Uint8Array([\n 0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00 // entry_count\n ]);\n STSC = STCO;\n STSZ = new Uint8Array([\n 0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, // sample_size\n 0x00, 0x00, 0x00, 0x00 // sample_count\n ]);\n STTS = STCO;\n VMHD = new Uint8Array([\n 0x00, // version\n 0x00, 0x00, 0x01, // flags\n 0x00, 0x00, // graphicsmode\n 0x00, 0x00,\n 0x00, 0x00,\n 0x00, 0x00 // opcolor\n ]);\n}());\n\nbox = function(type) {\n var\n payload = [],\n size = 0,\n i,\n result,\n view;\n\n for (i = 1; i < arguments.length; i++) {\n payload.push(arguments[i]);\n }\n\n i = payload.length;\n\n // calculate the total size we need to allocate\n while (i--) {\n size += payload[i].byteLength;\n }\n result = new Uint8Array(size + 8);\n view = new DataView(result.buffer, result.byteOffset, result.byteLength);\n view.setUint32(0, result.byteLength);\n result.set(type, 4);\n\n // copy the payload into the result\n for (i = 0, size = 8; i < payload.length; i++) {\n result.set(payload[i], size);\n size += payload[i].byteLength;\n }\n return result;\n};\n\ndinf = function() {\n return box(types.dinf, box(types.dref, DREF));\n};\n\nesds = function(track) {\n return box(types.esds, new Uint8Array([\n 0x00, // version\n 0x00, 0x00, 0x00, // flags\n\n // ES_Descriptor\n 0x03, // tag, ES_DescrTag\n 0x19, // length\n 0x00, 0x00, // ES_ID\n 0x00, // streamDependenceFlag, URL_flag, reserved, streamPriority\n\n // DecoderConfigDescriptor\n 0x04, // tag, DecoderConfigDescrTag\n 0x11, // length\n 0x40, // object type\n 0x15, // streamType\n 0x00, 0x06, 0x00, // bufferSizeDB\n 0x00, 0x00, 0xda, 0xc0, // maxBitrate\n 0x00, 0x00, 0xda, 0xc0, // avgBitrate\n\n // DecoderSpecificInfo\n 0x05, // tag, DecoderSpecificInfoTag\n 0x02, // length\n // ISO/IEC 14496-3, AudioSpecificConfig\n // for samplingFrequencyIndex see ISO/IEC 13818-7:2006, 8.1.3.2.2, Table 35\n (track.audioobjecttype << 3) | (track.samplingfrequencyindex >>> 1),\n (track.samplingfrequencyindex << 7) | (track.channelcount << 3),\n 0x06, 0x01, 0x02 // GASpecificConfig\n ]));\n};\n\nftyp = function() {\n return box(types.ftyp, MAJOR_BRAND, MINOR_VERSION, MAJOR_BRAND, AVC1_BRAND);\n};\n\nhdlr = function(type) {\n return box(types.hdlr, HDLR_TYPES[type]);\n};\nmdat = function(data) {\n return box(types.mdat, data);\n};\nmdhd = function(track) {\n var result = new Uint8Array([\n 0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x02, // creation_time\n 0x00, 0x00, 0x00, 0x03, // modification_time\n 0x00, 0x01, 0x5f, 0x90, // timescale, 90,000 \"ticks\" per second\n\n (track.duration >>> 24) & 0xFF,\n (track.duration >>> 16) & 0xFF,\n (track.duration >>> 8) & 0xFF,\n track.duration & 0xFF, // duration\n 0x55, 0xc4, // 'und' language (undetermined)\n 0x00, 0x00\n ]);\n\n // Use the sample rate from the track metadata, when it is\n // defined. The sample rate can be parsed out of an ADTS header, for\n // instance.\n if (track.samplerate) {\n result[12] = (track.samplerate >>> 24) & 0xFF;\n result[13] = (track.samplerate >>> 16) & 0xFF;\n result[14] = (track.samplerate >>> 8) & 0xFF;\n result[15] = (track.samplerate) & 0xFF;\n }\n\n return box(types.mdhd, result);\n};\nmdia = function(track) {\n return box(types.mdia, mdhd(track), hdlr(track.type), minf(track));\n};\nmfhd = function(sequenceNumber) {\n return box(types.mfhd, new Uint8Array([\n 0x00,\n 0x00, 0x00, 0x00, // flags\n (sequenceNumber & 0xFF000000) >> 24,\n (sequenceNumber & 0xFF0000) >> 16,\n (sequenceNumber & 0xFF00) >> 8,\n sequenceNumber & 0xFF // sequence_number\n ]));\n};\nminf = function(track) {\n return box(types.minf,\n track.type === 'video' ? box(types.vmhd, VMHD) : box(types.smhd, SMHD),\n dinf(),\n stbl(track));\n};\nmoof = function(sequenceNumber, tracks) {\n var\n trackFragments = [],\n i = tracks.length;\n // build traf boxes for each track fragment\n while (i--) {\n trackFragments[i] = traf(tracks[i]);\n }\n return box.apply(null, [\n types.moof,\n mfhd(sequenceNumber)\n ].concat(trackFragments));\n};\n/**\n * Returns a movie box.\n * @param tracks {array} the tracks associated with this movie\n * @see ISO/IEC 14496-12:2012(E), section 8.2.1\n */\nmoov = function(tracks) {\n var\n i = tracks.length,\n boxes = [];\n\n while (i--) {\n boxes[i] = trak(tracks[i]);\n }\n\n return box.apply(null, [types.moov, mvhd(0xffffffff)].concat(boxes).concat(mvex(tracks)));\n};\nmvex = function(tracks) {\n var\n i = tracks.length,\n boxes = [];\n\n while (i--) {\n boxes[i] = trex(tracks[i]);\n }\n return box.apply(null, [types.mvex].concat(boxes));\n};\nmvhd = function(duration) {\n var\n bytes = new Uint8Array([\n 0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x01, // creation_time\n 0x00, 0x00, 0x00, 0x02, // modification_time\n 0x00, 0x01, 0x5f, 0x90, // timescale, 90,000 \"ticks\" per second\n (duration & 0xFF000000) >> 24,\n (duration & 0xFF0000) >> 16,\n (duration & 0xFF00) >> 8,\n duration & 0xFF, // duration\n 0x00, 0x01, 0x00, 0x00, // 1.0 rate\n 0x01, 0x00, // 1.0 volume\n 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x01, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, // pre_defined\n 0xff, 0xff, 0xff, 0xff // next_track_ID\n ]);\n return box(types.mvhd, bytes);\n};\n\nsdtp = function(track) {\n var\n samples = track.samples || [],\n bytes = new Uint8Array(4 + samples.length),\n flags,\n i;\n\n // leave the full box header (4 bytes) all zero\n\n // write the sample table\n for (i = 0; i < samples.length; i++) {\n flags = samples[i].flags;\n\n bytes[i + 4] = (flags.dependsOn << 4) |\n (flags.isDependedOn << 2) |\n (flags.hasRedundancy);\n }\n\n return box(types.sdtp,\n bytes);\n};\n\nstbl = function(track) {\n return box(types.stbl,\n stsd(track),\n box(types.stts, STTS),\n box(types.stsc, STSC),\n box(types.stsz, STSZ),\n box(types.stco, STCO));\n};\n\n(function() {\n var videoSample, audioSample;\n\n stsd = function(track) {\n\n return box(types.stsd, new Uint8Array([\n 0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x01\n ]), track.type === 'video' ? videoSample(track) : audioSample(track));\n };\n\n videoSample = function(track) {\n var\n sps = track.sps || [],\n pps = track.pps || [],\n sequenceParameterSets = [],\n pictureParameterSets = [],\n i;\n\n // assemble the SPSs\n for (i = 0; i < sps.length; i++) {\n sequenceParameterSets.push((sps[i].byteLength & 0xFF00) >>> 8);\n sequenceParameterSets.push((sps[i].byteLength & 0xFF)); // sequenceParameterSetLength\n sequenceParameterSets = sequenceParameterSets.concat(Array.prototype.slice.call(sps[i])); // SPS\n }\n\n // assemble the PPSs\n for (i = 0; i < pps.length; i++) {\n pictureParameterSets.push((pps[i].byteLength & 0xFF00) >>> 8);\n pictureParameterSets.push((pps[i].byteLength & 0xFF));\n pictureParameterSets = pictureParameterSets.concat(Array.prototype.slice.call(pps[i]));\n }\n\n return box(types.avc1, new Uint8Array([\n 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // data_reference_index\n 0x00, 0x00, // pre_defined\n 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, // pre_defined\n (track.width & 0xff00) >> 8,\n track.width & 0xff, // width\n (track.height & 0xff00) >> 8,\n track.height & 0xff, // height\n 0x00, 0x48, 0x00, 0x00, // horizresolution\n 0x00, 0x48, 0x00, 0x00, // vertresolution\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // frame_count\n 0x13,\n 0x76, 0x69, 0x64, 0x65,\n 0x6f, 0x6a, 0x73, 0x2d,\n 0x63, 0x6f, 0x6e, 0x74,\n 0x72, 0x69, 0x62, 0x2d,\n 0x68, 0x6c, 0x73, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, // compressorname\n 0x00, 0x18, // depth = 24\n 0x11, 0x11 // pre_defined = -1\n ]), box(types.avcC, new Uint8Array([\n 0x01, // configurationVersion\n track.profileIdc, // AVCProfileIndication\n track.profileCompatibility, // profile_compatibility\n track.levelIdc, // AVCLevelIndication\n 0xff // lengthSizeMinusOne, hard-coded to 4 bytes\n ].concat([\n sps.length // numOfSequenceParameterSets\n ]).concat(sequenceParameterSets).concat([\n pps.length // numOfPictureParameterSets\n ]).concat(pictureParameterSets))), // \"PPS\"\n box(types.btrt, new Uint8Array([\n 0x00, 0x1c, 0x9c, 0x80, // bufferSizeDB\n 0x00, 0x2d, 0xc6, 0xc0, // maxBitrate\n 0x00, 0x2d, 0xc6, 0xc0\n ])) // avgBitrate\n );\n };\n\n audioSample = function(track) {\n return box(types.mp4a, new Uint8Array([\n\n // SampleEntry, ISO/IEC 14496-12\n 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // data_reference_index\n\n // AudioSampleEntry, ISO/IEC 14496-12\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n (track.channelcount & 0xff00) >> 8,\n (track.channelcount & 0xff), // channelcount\n\n (track.samplesize & 0xff00) >> 8,\n (track.samplesize & 0xff), // samplesize\n 0x00, 0x00, // pre_defined\n 0x00, 0x00, // reserved\n\n (track.samplerate & 0xff00) >> 8,\n (track.samplerate & 0xff),\n 0x00, 0x00 // samplerate, 16.16\n\n // MP4AudioSampleEntry, ISO/IEC 14496-14\n ]), esds(track));\n };\n}());\n\ntkhd = function(track) {\n var result = new Uint8Array([\n 0x00, // version 0\n 0x00, 0x00, 0x07, // flags\n 0x00, 0x00, 0x00, 0x00, // creation_time\n 0x00, 0x00, 0x00, 0x00, // modification_time\n (track.id & 0xFF000000) >> 24,\n (track.id & 0xFF0000) >> 16,\n (track.id & 0xFF00) >> 8,\n track.id & 0xFF, // track_ID\n 0x00, 0x00, 0x00, 0x00, // reserved\n (track.duration & 0xFF000000) >> 24,\n (track.duration & 0xFF0000) >> 16,\n (track.duration & 0xFF00) >> 8,\n track.duration & 0xFF, // duration\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, // layer\n 0x00, 0x00, // alternate_group\n 0x01, 0x00, // non-audio track volume\n 0x00, 0x00, // reserved\n 0x00, 0x01, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x01, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix\n (track.width & 0xFF00) >> 8,\n track.width & 0xFF,\n 0x00, 0x00, // width\n (track.height & 0xFF00) >> 8,\n track.height & 0xFF,\n 0x00, 0x00 // height\n ]);\n\n return box(types.tkhd, result);\n};\n\n/**\n * Generate a track fragment (traf) box. A traf box collects metadata\n * about tracks in a movie fragment (moof) box.\n */\ntraf = function(track) {\n var trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun,\n sampleDependencyTable, dataOffset,\n upperWordBaseMediaDecodeTime, lowerWordBaseMediaDecodeTime;\n\n trackFragmentHeader = box(types.tfhd, new Uint8Array([\n 0x00, // version 0\n 0x00, 0x00, 0x3a, // flags\n (track.id & 0xFF000000) >> 24,\n (track.id & 0xFF0000) >> 16,\n (track.id & 0xFF00) >> 8,\n (track.id & 0xFF), // track_ID\n 0x00, 0x00, 0x00, 0x01, // sample_description_index\n 0x00, 0x00, 0x00, 0x00, // default_sample_duration\n 0x00, 0x00, 0x00, 0x00, // default_sample_size\n 0x00, 0x00, 0x00, 0x00 // default_sample_flags\n ]));\n\n upperWordBaseMediaDecodeTime = Math.floor(track.baseMediaDecodeTime / (UINT32_MAX + 1));\n lowerWordBaseMediaDecodeTime = Math.floor(track.baseMediaDecodeTime % (UINT32_MAX + 1));\n\n trackFragmentDecodeTime = box(types.tfdt, new Uint8Array([\n 0x01, // version 1\n 0x00, 0x00, 0x00, // flags\n // baseMediaDecodeTime\n (upperWordBaseMediaDecodeTime >>> 24) & 0xFF,\n (upperWordBaseMediaDecodeTime >>> 16) & 0xFF,\n (upperWordBaseMediaDecodeTime >>> 8) & 0xFF,\n upperWordBaseMediaDecodeTime & 0xFF,\n (lowerWordBaseMediaDecodeTime >>> 24) & 0xFF,\n (lowerWordBaseMediaDecodeTime >>> 16) & 0xFF,\n (lowerWordBaseMediaDecodeTime >>> 8) & 0xFF,\n lowerWordBaseMediaDecodeTime & 0xFF\n ]));\n\n // the data offset specifies the number of bytes from the start of\n // the containing moof to the first payload byte of the associated\n // mdat\n dataOffset = (32 + // tfhd\n 20 + // tfdt\n 8 + // traf header\n 16 + // mfhd\n 8 + // moof header\n 8); // mdat header\n\n // audio tracks require less metadata\n if (track.type === 'audio') {\n trackFragmentRun = trun(track, dataOffset);\n return box(types.traf,\n trackFragmentHeader,\n trackFragmentDecodeTime,\n trackFragmentRun);\n }\n\n // video tracks should contain an independent and disposable samples\n // box (sdtp)\n // generate one and adjust offsets to match\n sampleDependencyTable = sdtp(track);\n trackFragmentRun = trun(track,\n sampleDependencyTable.length + dataOffset);\n return box(types.traf,\n trackFragmentHeader,\n trackFragmentDecodeTime,\n trackFragmentRun,\n sampleDependencyTable);\n};\n\n/**\n * Generate a track box.\n * @param track {object} a track definition\n * @return {Uint8Array} the track box\n */\ntrak = function(track) {\n track.duration = track.duration || 0xffffffff;\n return box(types.trak,\n tkhd(track),\n mdia(track));\n};\n\ntrex = function(track) {\n var result = new Uint8Array([\n 0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n (track.id & 0xFF000000) >> 24,\n (track.id & 0xFF0000) >> 16,\n (track.id & 0xFF00) >> 8,\n (track.id & 0xFF), // track_ID\n 0x00, 0x00, 0x00, 0x01, // default_sample_description_index\n 0x00, 0x00, 0x00, 0x00, // default_sample_duration\n 0x00, 0x00, 0x00, 0x00, // default_sample_size\n 0x00, 0x01, 0x00, 0x01 // default_sample_flags\n ]);\n // the last two bytes of default_sample_flags is the sample\n // degradation priority, a hint about the importance of this sample\n // relative to others. Lower the degradation priority for all sample\n // types other than video.\n if (track.type !== 'video') {\n result[result.length - 1] = 0x00;\n }\n\n return box(types.trex, result);\n};\n\n(function() {\n var audioTrun, videoTrun, trunHeader;\n\n // This method assumes all samples are uniform. That is, if a\n // duration is present for the first sample, it will be present for\n // all subsequent samples.\n // see ISO/IEC 14496-12:2012, Section 8.8.8.1\n trunHeader = function(samples, offset) {\n var durationPresent = 0, sizePresent = 0,\n flagsPresent = 0, compositionTimeOffset = 0;\n\n // trun flag constants\n if (samples.length) {\n if (samples[0].duration !== undefined) {\n durationPresent = 0x1;\n }\n if (samples[0].size !== undefined) {\n sizePresent = 0x2;\n }\n if (samples[0].flags !== undefined) {\n flagsPresent = 0x4;\n }\n if (samples[0].compositionTimeOffset !== undefined) {\n compositionTimeOffset = 0x8;\n }\n }\n\n return [\n 0x00, // version 0\n 0x00,\n durationPresent | sizePresent | flagsPresent | compositionTimeOffset,\n 0x01, // flags\n (samples.length & 0xFF000000) >>> 24,\n (samples.length & 0xFF0000) >>> 16,\n (samples.length & 0xFF00) >>> 8,\n samples.length & 0xFF, // sample_count\n (offset & 0xFF000000) >>> 24,\n (offset & 0xFF0000) >>> 16,\n (offset & 0xFF00) >>> 8,\n offset & 0xFF // data_offset\n ];\n };\n\n videoTrun = function(track, offset) {\n var bytes, samples, sample, i;\n\n samples = track.samples || [];\n offset += 8 + 12 + (16 * samples.length);\n\n bytes = trunHeader(samples, offset);\n\n for (i = 0; i < samples.length; i++) {\n sample = samples[i];\n bytes = bytes.concat([\n (sample.duration & 0xFF000000) >>> 24,\n (sample.duration & 0xFF0000) >>> 16,\n (sample.duration & 0xFF00) >>> 8,\n sample.duration & 0xFF, // sample_duration\n (sample.size & 0xFF000000) >>> 24,\n (sample.size & 0xFF0000) >>> 16,\n (sample.size & 0xFF00) >>> 8,\n sample.size & 0xFF, // sample_size\n (sample.flags.isLeading << 2) | sample.flags.dependsOn,\n (sample.flags.isDependedOn << 6) |\n (sample.flags.hasRedundancy << 4) |\n (sample.flags.paddingValue << 1) |\n sample.flags.isNonSyncSample,\n sample.flags.degradationPriority & 0xF0 << 8,\n sample.flags.degradationPriority & 0x0F, // sample_flags\n (sample.compositionTimeOffset & 0xFF000000) >>> 24,\n (sample.compositionTimeOffset & 0xFF0000) >>> 16,\n (sample.compositionTimeOffset & 0xFF00) >>> 8,\n sample.compositionTimeOffset & 0xFF // sample_composition_time_offset\n ]);\n }\n return box(types.trun, new Uint8Array(bytes));\n };\n\n audioTrun = function(track, offset) {\n var bytes, samples, sample, i;\n\n samples = track.samples || [];\n offset += 8 + 12 + (8 * samples.length);\n\n bytes = trunHeader(samples, offset);\n\n for (i = 0; i < samples.length; i++) {\n sample = samples[i];\n bytes = bytes.concat([\n (sample.duration & 0xFF000000) >>> 24,\n (sample.duration & 0xFF0000) >>> 16,\n (sample.duration & 0xFF00) >>> 8,\n sample.duration & 0xFF, // sample_duration\n (sample.size & 0xFF000000) >>> 24,\n (sample.size & 0xFF0000) >>> 16,\n (sample.size & 0xFF00) >>> 8,\n sample.size & 0xFF]); // sample_size\n }\n\n return box(types.trun, new Uint8Array(bytes));\n };\n\n trun = function(track, offset) {\n if (track.type === 'audio') {\n return audioTrun(track, offset);\n }\n\n return videoTrun(track, offset);\n };\n}());\n\nmodule.exports = {\n ftyp: ftyp,\n mdat: mdat,\n moof: moof,\n moov: moov,\n initSegment: function(tracks) {\n var\n fileType = ftyp(),\n movie = moov(tracks),\n result;\n\n result = new Uint8Array(fileType.byteLength + movie.byteLength);\n result.set(fileType);\n result.set(movie, fileType.byteLength);\n return result;\n }\n};\n","/**\n * mux.js\n *\n * Copyright (c) 2015 Brightcove\n * All rights reserved.\n *\n * Utilities to detect basic properties and metadata about MP4s.\n */\n'use strict';\n\nvar toUnsigned = require('../utils/bin').toUnsigned;\nvar findBox, parseType, timescale, startTime, getVideoTrackIds;\n\n// Find the data for a box specified by its path\nfindBox = function(data, path) {\n var results = [],\n i, size, type, end, subresults;\n\n if (!path.length) {\n // short-circuit the search for empty paths\n return null;\n }\n\n for (i = 0; i < data.byteLength;) {\n size = toUnsigned(data[i] << 24 |\n data[i + 1] << 16 |\n data[i + 2] << 8 |\n data[i + 3]);\n\n type = parseType(data.subarray(i + 4, i + 8));\n\n end = size > 1 ? i + size : data.byteLength;\n\n if (type === path[0]) {\n if (path.length === 1) {\n // this is the end of the path and we've found the box we were\n // looking for\n results.push(data.subarray(i + 8, end));\n } else {\n // recursively search for the next box along the path\n subresults = findBox(data.subarray(i + 8, end), path.slice(1));\n if (subresults.length) {\n results = results.concat(subresults);\n }\n }\n }\n i = end;\n }\n\n // we've finished searching all of data\n return results;\n};\n\n/**\n * Returns the string representation of an ASCII encoded four byte buffer.\n * @param buffer {Uint8Array} a four-byte buffer to translate\n * @return {string} the corresponding string\n */\nparseType = function(buffer) {\n var result = '';\n result += String.fromCharCode(buffer[0]);\n result += String.fromCharCode(buffer[1]);\n result += String.fromCharCode(buffer[2]);\n result += String.fromCharCode(buffer[3]);\n return result;\n};\n\n/**\n * Parses an MP4 initialization segment and extracts the timescale\n * values for any declared tracks. Timescale values indicate the\n * number of clock ticks per second to assume for time-based values\n * elsewhere in the MP4.\n *\n * To determine the start time of an MP4, you need two pieces of\n * information: the timescale unit and the earliest base media decode\n * time. Multiple timescales can be specified within an MP4 but the\n * base media decode time is always expressed in the timescale from\n * the media header box for the track:\n * ```\n * moov > trak > mdia > mdhd.timescale\n * ```\n * @param init {Uint8Array} the bytes of the init segment\n * @return {object} a hash of track ids to timescale values or null if\n * the init segment is malformed.\n */\ntimescale = function(init) {\n var\n result = {},\n traks = findBox(init, ['moov', 'trak']);\n\n // mdhd timescale\n return traks.reduce(function(result, trak) {\n var tkhd, version, index, id, mdhd;\n\n tkhd = findBox(trak, ['tkhd'])[0];\n if (!tkhd) {\n return null;\n }\n version = tkhd[0];\n index = version === 0 ? 12 : 20;\n id = toUnsigned(tkhd[index] << 24 |\n tkhd[index + 1] << 16 |\n tkhd[index + 2] << 8 |\n tkhd[index + 3]);\n\n mdhd = findBox(trak, ['mdia', 'mdhd'])[0];\n if (!mdhd) {\n return null;\n }\n version = mdhd[0];\n index = version === 0 ? 12 : 20;\n result[id] = toUnsigned(mdhd[index] << 24 |\n mdhd[index + 1] << 16 |\n mdhd[index + 2] << 8 |\n mdhd[index + 3]);\n return result;\n }, result);\n};\n\n/**\n * Determine the base media decode start time, in seconds, for an MP4\n * fragment. If multiple fragments are specified, the earliest time is\n * returned.\n *\n * The base media decode time can be parsed from track fragment\n * metadata:\n * ```\n * moof > traf > tfdt.baseMediaDecodeTime\n * ```\n * It requires the timescale value from the mdhd to interpret.\n *\n * @param timescale {object} a hash of track ids to timescale values.\n * @return {number} the earliest base media decode start time for the\n * fragment, in seconds\n */\nstartTime = function(timescale, fragment) {\n var trafs, baseTimes, result;\n\n // we need info from two childrend of each track fragment box\n trafs = findBox(fragment, ['moof', 'traf']);\n\n // determine the start times for each track\n baseTimes = [].concat.apply([], trafs.map(function(traf) {\n return findBox(traf, ['tfhd']).map(function(tfhd) {\n var id, scale, baseTime;\n\n // get the track id from the tfhd\n id = toUnsigned(tfhd[4] << 24 |\n tfhd[5] << 16 |\n tfhd[6] << 8 |\n tfhd[7]);\n // assume a 90kHz clock if no timescale was specified\n scale = timescale[id] || 90e3;\n\n // get the base media decode time from the tfdt\n baseTime = findBox(traf, ['tfdt']).map(function(tfdt) {\n var version, result;\n\n version = tfdt[0];\n result = toUnsigned(tfdt[4] << 24 |\n tfdt[5] << 16 |\n tfdt[6] << 8 |\n tfdt[7]);\n if (version === 1) {\n result *= Math.pow(2, 32);\n result += toUnsigned(tfdt[8] << 24 |\n tfdt[9] << 16 |\n tfdt[10] << 8 |\n tfdt[11]);\n }\n return result;\n })[0];\n baseTime = baseTime || Infinity;\n\n // convert base time to seconds\n return baseTime / scale;\n });\n }));\n\n // return the minimum\n result = Math.min.apply(null, baseTimes);\n return isFinite(result) ? result : 0;\n};\n\n/**\n * Find the trackIds of the video tracks in this source.\n * Found by parsing the Handler Reference and Track Header Boxes:\n * moov > trak > mdia > hdlr\n * moov > trak > tkhd\n *\n * @param {Uint8Array} init - The bytes of the init segment for this source\n * @return {Number[]} A list of trackIds\n *\n * @see ISO-BMFF-12/2015, Section 8.4.3\n **/\ngetVideoTrackIds = function(init) {\n var traks = findBox(init, ['moov', 'trak']);\n var videoTrackIds = [];\n\n traks.forEach(function(trak) {\n var hdlrs = findBox(trak, ['mdia', 'hdlr']);\n var tkhds = findBox(trak, ['tkhd']);\n\n hdlrs.forEach(function(hdlr, index) {\n var handlerType = parseType(hdlr.subarray(8, 12));\n var tkhd = tkhds[index];\n var view;\n var version;\n var trackId;\n\n if (handlerType === 'vide') {\n view = new DataView(tkhd.buffer, tkhd.byteOffset, tkhd.byteLength);\n version = view.getUint8(0);\n trackId = (version === 0) ? view.getUint32(12) : view.getUint32(20);\n\n videoTrackIds.push(trackId);\n }\n });\n });\n\n return videoTrackIds;\n};\n\nmodule.exports = {\n findBox: findBox,\n parseType: parseType,\n timescale: timescale,\n startTime: startTime,\n videoTrackIds: getVideoTrackIds\n};\n","var ONE_SECOND_IN_TS = 90000; // 90kHz clock\n\n/**\n * Store information about the start and end of the track and the\n * duration for each frame/sample we process in order to calculate\n * the baseMediaDecodeTime\n */\nvar collectDtsInfo = function(track, data) {\n if (typeof data.pts === 'number') {\n if (track.timelineStartInfo.pts === undefined) {\n track.timelineStartInfo.pts = data.pts;\n }\n\n if (track.minSegmentPts === undefined) {\n track.minSegmentPts = data.pts;\n } else {\n track.minSegmentPts = Math.min(track.minSegmentPts, data.pts);\n }\n\n if (track.maxSegmentPts === undefined) {\n track.maxSegmentPts = data.pts;\n } else {\n track.maxSegmentPts = Math.max(track.maxSegmentPts, data.pts);\n }\n }\n\n if (typeof data.dts === 'number') {\n if (track.timelineStartInfo.dts === undefined) {\n track.timelineStartInfo.dts = data.dts;\n }\n\n if (track.minSegmentDts === undefined) {\n track.minSegmentDts = data.dts;\n } else {\n track.minSegmentDts = Math.min(track.minSegmentDts, data.dts);\n }\n\n if (track.maxSegmentDts === undefined) {\n track.maxSegmentDts = data.dts;\n } else {\n track.maxSegmentDts = Math.max(track.maxSegmentDts, data.dts);\n }\n }\n};\n\n/**\n * Clear values used to calculate the baseMediaDecodeTime between\n * tracks\n */\nvar clearDtsInfo = function(track) {\n delete track.minSegmentDts;\n delete track.maxSegmentDts;\n delete track.minSegmentPts;\n delete track.maxSegmentPts;\n};\n\n/**\n * Calculate the track's baseMediaDecodeTime based on the earliest\n * DTS the transmuxer has ever seen and the minimum DTS for the\n * current track\n * @param track {object} track metadata configuration\n * @param keepOriginalTimestamps {boolean} If true, keep the timestamps\n * in the source; false to adjust the first segment to start at 0.\n */\nvar calculateTrackBaseMediaDecodeTime = function(track, keepOriginalTimestamps) {\n var\n baseMediaDecodeTime,\n scale,\n minSegmentDts = track.minSegmentDts;\n\n // Optionally adjust the time so the first segment starts at zero.\n if (!keepOriginalTimestamps) {\n minSegmentDts -= track.timelineStartInfo.dts;\n }\n\n // track.timelineStartInfo.baseMediaDecodeTime is the location, in time, where\n // we want the start of the first segment to be placed\n baseMediaDecodeTime = track.timelineStartInfo.baseMediaDecodeTime;\n\n // Add to that the distance this segment is from the very first\n baseMediaDecodeTime += minSegmentDts;\n\n // baseMediaDecodeTime must not become negative\n baseMediaDecodeTime = Math.max(0, baseMediaDecodeTime);\n\n if (track.type === 'audio') {\n // Audio has a different clock equal to the sampling_rate so we need to\n // scale the PTS values into the clock rate of the track\n scale = track.samplerate / ONE_SECOND_IN_TS;\n baseMediaDecodeTime *= scale;\n baseMediaDecodeTime = Math.floor(baseMediaDecodeTime);\n }\n\n return baseMediaDecodeTime;\n};\n\nmodule.exports = {\n clearDtsInfo: clearDtsInfo,\n calculateTrackBaseMediaDecodeTime: calculateTrackBaseMediaDecodeTime,\n collectDtsInfo: collectDtsInfo\n};\n","/**\n * mux.js\n *\n * Copyright (c) 2015 Brightcove\n * All rights reserved.\n *\n * A stream-based mp2t to mp4 converter. This utility can be used to\n * deliver mp4s to a SourceBuffer on platforms that support native\n * Media Source Extensions.\n */\n'use strict';\n\nvar Stream = require('../utils/stream.js');\nvar mp4 = require('./mp4-generator.js');\nvar frameUtils = require('./frame-utils');\nvar audioFrameUtils = require('./audio-frame-utils');\nvar trackDecodeInfo = require('./track-decode-info');\nvar m2ts = require('../m2ts/m2ts.js');\nvar AdtsStream = require('../codecs/adts.js');\nvar H264Stream = require('../codecs/h264').H264Stream;\nvar AacStream = require('../aac');\nvar isLikelyAacData = require('../aac/utils').isLikelyAacData;\n\n// constants\nvar AUDIO_PROPERTIES = [\n 'audioobjecttype',\n 'channelcount',\n 'samplerate',\n 'samplingfrequencyindex',\n 'samplesize'\n];\n\nvar VIDEO_PROPERTIES = [\n 'width',\n 'height',\n 'profileIdc',\n 'levelIdc',\n 'profileCompatibility'\n];\n\n// object types\nvar VideoSegmentStream, AudioSegmentStream, Transmuxer, CoalesceStream;\n\n/**\n * Compare two arrays (even typed) for same-ness\n */\nvar arrayEquals = function(a, b) {\n var\n i;\n\n if (a.length !== b.length) {\n return false;\n }\n\n // compare the value of each element in the array\n for (i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n\n return true;\n};\n\n/**\n * Constructs a single-track, ISO BMFF media segment from AAC data\n * events. The output of this stream can be fed to a SourceBuffer\n * configured with a suitable initialization segment.\n * @param track {object} track metadata configuration\n * @param options {object} transmuxer options object\n * @param options.keepOriginalTimestamps {boolean} If true, keep the timestamps\n * in the source; false to adjust the first segment to start at 0.\n */\nAudioSegmentStream = function(track, options) {\n var\n adtsFrames = [],\n sequenceNumber = 0,\n earliestAllowedDts = 0,\n audioAppendStartTs = 0,\n videoBaseMediaDecodeTime = Infinity;\n\n options = options || {};\n\n AudioSegmentStream.prototype.init.call(this);\n\n this.push = function(data) {\n trackDecodeInfo.collectDtsInfo(track, data);\n\n if (track) {\n AUDIO_PROPERTIES.forEach(function(prop) {\n track[prop] = data[prop];\n });\n }\n\n // buffer audio data until end() is called\n adtsFrames.push(data);\n };\n\n this.setEarliestDts = function(earliestDts) {\n earliestAllowedDts = earliestDts - track.timelineStartInfo.baseMediaDecodeTime;\n };\n\n this.setVideoBaseMediaDecodeTime = function(baseMediaDecodeTime) {\n videoBaseMediaDecodeTime = baseMediaDecodeTime;\n };\n\n this.setAudioAppendStart = function(timestamp) {\n audioAppendStartTs = timestamp;\n };\n\n this.flush = function() {\n var\n frames,\n moof,\n mdat,\n boxes;\n\n // return early if no audio data has been observed\n if (adtsFrames.length === 0) {\n this.trigger('done', 'AudioSegmentStream');\n return;\n }\n\n frames = audioFrameUtils.trimAdtsFramesByEarliestDts(\n adtsFrames, track, earliestAllowedDts);\n track.baseMediaDecodeTime = trackDecodeInfo.calculateTrackBaseMediaDecodeTime(\n track, options.keepOriginalTimestamps);\n\n audioFrameUtils.prefixWithSilence(\n track, frames, audioAppendStartTs, videoBaseMediaDecodeTime);\n\n // we have to build the index from byte locations to\n // samples (that is, adts frames) in the audio data\n track.samples = audioFrameUtils.generateSampleTable(frames);\n\n // concatenate the audio data to constuct the mdat\n mdat = mp4.mdat(audioFrameUtils.concatenateFrameData(frames));\n\n adtsFrames = [];\n\n moof = mp4.moof(sequenceNumber, [track]);\n boxes = new Uint8Array(moof.byteLength + mdat.byteLength);\n\n // bump the sequence number for next time\n sequenceNumber++;\n\n boxes.set(moof);\n boxes.set(mdat, moof.byteLength);\n\n trackDecodeInfo.clearDtsInfo(track);\n\n this.trigger('data', {track: track, boxes: boxes});\n this.trigger('done', 'AudioSegmentStream');\n };\n};\n\nAudioSegmentStream.prototype = new Stream();\n\n/**\n * Constructs a single-track, ISO BMFF media segment from H264 data\n * events. The output of this stream can be fed to a SourceBuffer\n * configured with a suitable initialization segment.\n * @param track {object} track metadata configuration\n * @param options {object} transmuxer options object\n * @param options.alignGopsAtEnd {boolean} If true, start from the end of the\n * gopsToAlignWith list when attempting to align gop pts\n * @param options.keepOriginalTimestamps {boolean} If true, keep the timestamps\n * in the source; false to adjust the first segment to start at 0.\n */\nVideoSegmentStream = function(track, options) {\n var\n sequenceNumber = 0,\n nalUnits = [],\n gopsToAlignWith = [],\n config,\n pps;\n\n options = options || {};\n\n VideoSegmentStream.prototype.init.call(this);\n\n delete track.minPTS;\n\n this.gopCache_ = [];\n\n /**\n * Constructs a ISO BMFF segment given H264 nalUnits\n * @param {Object} nalUnit A data event representing a nalUnit\n * @param {String} nalUnit.nalUnitType\n * @param {Object} nalUnit.config Properties for a mp4 track\n * @param {Uint8Array} nalUnit.data The nalUnit bytes\n * @see lib/codecs/h264.js\n **/\n this.push = function(nalUnit) {\n trackDecodeInfo.collectDtsInfo(track, nalUnit);\n\n // record the track config\n if (nalUnit.nalUnitType === 'seq_parameter_set_rbsp' && !config) {\n config = nalUnit.config;\n track.sps = [nalUnit.data];\n\n VIDEO_PROPERTIES.forEach(function(prop) {\n track[prop] = config[prop];\n }, this);\n }\n\n if (nalUnit.nalUnitType === 'pic_parameter_set_rbsp' &&\n !pps) {\n pps = nalUnit.data;\n track.pps = [nalUnit.data];\n }\n\n // buffer video until flush() is called\n nalUnits.push(nalUnit);\n };\n\n /**\n * Pass constructed ISO BMFF track and boxes on to the\n * next stream in the pipeline\n **/\n this.flush = function() {\n var\n frames,\n gopForFusion,\n gops,\n moof,\n mdat,\n boxes;\n\n // Throw away nalUnits at the start of the byte stream until\n // we find the first AUD\n while (nalUnits.length) {\n if (nalUnits[0].nalUnitType === 'access_unit_delimiter_rbsp') {\n break;\n }\n nalUnits.shift();\n }\n\n // Return early if no video data has been observed\n if (nalUnits.length === 0) {\n this.resetStream_();\n this.trigger('done', 'VideoSegmentStream');\n return;\n }\n\n // Organize the raw nal-units into arrays that represent\n // higher-level constructs such as frames and gops\n // (group-of-pictures)\n frames = frameUtils.groupNalsIntoFrames(nalUnits);\n gops = frameUtils.groupFramesIntoGops(frames);\n\n // If the first frame of this fragment is not a keyframe we have\n // a problem since MSE (on Chrome) requires a leading keyframe.\n //\n // We have two approaches to repairing this situation:\n // 1) GOP-FUSION:\n // This is where we keep track of the GOPS (group-of-pictures)\n // from previous fragments and attempt to find one that we can\n // prepend to the current fragment in order to create a valid\n // fragment.\n // 2) KEYFRAME-PULLING:\n // Here we search for the first keyframe in the fragment and\n // throw away all the frames between the start of the fragment\n // and that keyframe. We then extend the duration and pull the\n // PTS of the keyframe forward so that it covers the time range\n // of the frames that were disposed of.\n //\n // #1 is far prefereable over #2 which can cause \"stuttering\" but\n // requires more things to be just right.\n if (!gops[0][0].keyFrame) {\n // Search for a gop for fusion from our gopCache\n gopForFusion = this.getGopForFusion_(nalUnits[0], track);\n\n if (gopForFusion) {\n gops.unshift(gopForFusion);\n // Adjust Gops' metadata to account for the inclusion of the\n // new gop at the beginning\n gops.byteLength += gopForFusion.byteLength;\n gops.nalCount += gopForFusion.nalCount;\n gops.pts = gopForFusion.pts;\n gops.dts = gopForFusion.dts;\n gops.duration += gopForFusion.duration;\n } else {\n // If we didn't find a candidate gop fall back to keyframe-pulling\n gops = frameUtils.extendFirstKeyFrame(gops);\n }\n }\n\n // Trim gops to align with gopsToAlignWith\n if (gopsToAlignWith.length) {\n var alignedGops;\n\n if (options.alignGopsAtEnd) {\n alignedGops = this.alignGopsAtEnd_(gops);\n } else {\n alignedGops = this.alignGopsAtStart_(gops);\n }\n\n if (!alignedGops) {\n // save all the nals in the last GOP into the gop cache\n this.gopCache_.unshift({\n gop: gops.pop(),\n pps: track.pps,\n sps: track.sps\n });\n\n // Keep a maximum of 6 GOPs in the cache\n this.gopCache_.length = Math.min(6, this.gopCache_.length);\n\n // Clear nalUnits\n nalUnits = [];\n\n // return early no gops can be aligned with desired gopsToAlignWith\n this.resetStream_();\n this.trigger('done', 'VideoSegmentStream');\n return;\n }\n\n // Some gops were trimmed. clear dts info so minSegmentDts and pts are correct\n // when recalculated before sending off to CoalesceStream\n trackDecodeInfo.clearDtsInfo(track);\n\n gops = alignedGops;\n }\n\n trackDecodeInfo.collectDtsInfo(track, gops);\n\n // First, we have to build the index from byte locations to\n // samples (that is, frames) in the video data\n track.samples = frameUtils.generateSampleTable(gops);\n\n // Concatenate the video data and construct the mdat\n mdat = mp4.mdat(frameUtils.concatenateNalData(gops));\n\n track.baseMediaDecodeTime = trackDecodeInfo.calculateTrackBaseMediaDecodeTime(\n track, options.keepOriginalTimestamps);\n\n this.trigger('processedGopsInfo', gops.map(function(gop) {\n return {\n pts: gop.pts,\n dts: gop.dts,\n byteLength: gop.byteLength\n };\n }));\n\n // save all the nals in the last GOP into the gop cache\n this.gopCache_.unshift({\n gop: gops.pop(),\n pps: track.pps,\n sps: track.sps\n });\n\n // Keep a maximum of 6 GOPs in the cache\n this.gopCache_.length = Math.min(6, this.gopCache_.length);\n\n // Clear nalUnits\n nalUnits = [];\n\n this.trigger('baseMediaDecodeTime', track.baseMediaDecodeTime);\n this.trigger('timelineStartInfo', track.timelineStartInfo);\n\n moof = mp4.moof(sequenceNumber, [track]);\n\n // it would be great to allocate this array up front instead of\n // throwing away hundreds of media segment fragments\n boxes = new Uint8Array(moof.byteLength + mdat.byteLength);\n\n // Bump the sequence number for next time\n sequenceNumber++;\n\n boxes.set(moof);\n boxes.set(mdat, moof.byteLength);\n\n this.trigger('data', {track: track, boxes: boxes});\n\n this.resetStream_();\n\n // Continue with the flush process now\n this.trigger('done', 'VideoSegmentStream');\n };\n\n this.resetStream_ = function() {\n trackDecodeInfo.clearDtsInfo(track);\n\n // reset config and pps because they may differ across segments\n // for instance, when we are rendition switching\n config = undefined;\n pps = undefined;\n };\n\n // Search for a candidate Gop for gop-fusion from the gop cache and\n // return it or return null if no good candidate was found\n this.getGopForFusion_ = function(nalUnit) {\n var\n halfSecond = 45000, // Half-a-second in a 90khz clock\n allowableOverlap = 10000, // About 3 frames @ 30fps\n nearestDistance = Infinity,\n dtsDistance,\n nearestGopObj,\n currentGop,\n currentGopObj,\n i;\n\n // Search for the GOP nearest to the beginning of this nal unit\n for (i = 0; i < this.gopCache_.length; i++) {\n currentGopObj = this.gopCache_[i];\n currentGop = currentGopObj.gop;\n\n // Reject Gops with different SPS or PPS\n if (!(track.pps && arrayEquals(track.pps[0], currentGopObj.pps[0])) ||\n !(track.sps && arrayEquals(track.sps[0], currentGopObj.sps[0]))) {\n continue;\n }\n\n // Reject Gops that would require a negative baseMediaDecodeTime\n if (currentGop.dts < track.timelineStartInfo.dts) {\n continue;\n }\n\n // The distance between the end of the gop and the start of the nalUnit\n dtsDistance = (nalUnit.dts - currentGop.dts) - currentGop.duration;\n\n // Only consider GOPS that start before the nal unit and end within\n // a half-second of the nal unit\n if (dtsDistance >= -allowableOverlap &&\n dtsDistance <= halfSecond) {\n\n // Always use the closest GOP we found if there is more than\n // one candidate\n if (!nearestGopObj ||\n nearestDistance > dtsDistance) {\n nearestGopObj = currentGopObj;\n nearestDistance = dtsDistance;\n }\n }\n }\n\n if (nearestGopObj) {\n return nearestGopObj.gop;\n }\n return null;\n };\n\n // trim gop list to the first gop found that has a matching pts with a gop in the list\n // of gopsToAlignWith starting from the START of the list\n this.alignGopsAtStart_ = function(gops) {\n var alignIndex, gopIndex, align, gop, byteLength, nalCount, duration, alignedGops;\n\n byteLength = gops.byteLength;\n nalCount = gops.nalCount;\n duration = gops.duration;\n alignIndex = gopIndex = 0;\n\n while (alignIndex < gopsToAlignWith.length && gopIndex < gops.length) {\n align = gopsToAlignWith[alignIndex];\n gop = gops[gopIndex];\n\n if (align.pts === gop.pts) {\n break;\n }\n\n if (gop.pts > align.pts) {\n // this current gop starts after the current gop we want to align on, so increment\n // align index\n alignIndex++;\n continue;\n }\n\n // current gop starts before the current gop we want to align on. so increment gop\n // index\n gopIndex++;\n byteLength -= gop.byteLength;\n nalCount -= gop.nalCount;\n duration -= gop.duration;\n }\n\n if (gopIndex === 0) {\n // no gops to trim\n return gops;\n }\n\n if (gopIndex === gops.length) {\n // all gops trimmed, skip appending all gops\n return null;\n }\n\n alignedGops = gops.slice(gopIndex);\n alignedGops.byteLength = byteLength;\n alignedGops.duration = duration;\n alignedGops.nalCount = nalCount;\n alignedGops.pts = alignedGops[0].pts;\n alignedGops.dts = alignedGops[0].dts;\n\n return alignedGops;\n };\n\n // trim gop list to the first gop found that has a matching pts with a gop in the list\n // of gopsToAlignWith starting from the END of the list\n this.alignGopsAtEnd_ = function(gops) {\n var alignIndex, gopIndex, align, gop, alignEndIndex, matchFound;\n\n alignIndex = gopsToAlignWith.length - 1;\n gopIndex = gops.length - 1;\n alignEndIndex = null;\n matchFound = false;\n\n while (alignIndex >= 0 && gopIndex >= 0) {\n align = gopsToAlignWith[alignIndex];\n gop = gops[gopIndex];\n\n if (align.pts === gop.pts) {\n matchFound = true;\n break;\n }\n\n if (align.pts > gop.pts) {\n alignIndex--;\n continue;\n }\n\n if (alignIndex === gopsToAlignWith.length - 1) {\n // gop.pts is greater than the last alignment candidate. If no match is found\n // by the end of this loop, we still want to append gops that come after this\n // point\n alignEndIndex = gopIndex;\n }\n\n gopIndex--;\n }\n\n if (!matchFound && alignEndIndex === null) {\n return null;\n }\n\n var trimIndex;\n\n if (matchFound) {\n trimIndex = gopIndex;\n } else {\n trimIndex = alignEndIndex;\n }\n\n if (trimIndex === 0) {\n return gops;\n }\n\n var alignedGops = gops.slice(trimIndex);\n var metadata = alignedGops.reduce(function(total, gop) {\n total.byteLength += gop.byteLength;\n total.duration += gop.duration;\n total.nalCount += gop.nalCount;\n return total;\n }, { byteLength: 0, duration: 0, nalCount: 0 });\n\n alignedGops.byteLength = metadata.byteLength;\n alignedGops.duration = metadata.duration;\n alignedGops.nalCount = metadata.nalCount;\n alignedGops.pts = alignedGops[0].pts;\n alignedGops.dts = alignedGops[0].dts;\n\n return alignedGops;\n };\n\n this.alignGopsWith = function(newGopsToAlignWith) {\n gopsToAlignWith = newGopsToAlignWith;\n };\n};\n\nVideoSegmentStream.prototype = new Stream();\n\n/**\n * A Stream that can combine multiple streams (ie. audio & video)\n * into a single output segment for MSE. Also supports audio-only\n * and video-only streams.\n * @param options {object} transmuxer options object\n * @param options.keepOriginalTimestamps {boolean} If true, keep the timestamps\n * in the source; false to adjust the first segment to start at media timeline start.\n */\nCoalesceStream = function(options, metadataStream) {\n // Number of Tracks per output segment\n // If greater than 1, we combine multiple\n // tracks into a single segment\n this.numberOfTracks = 0;\n this.metadataStream = metadataStream;\n\n options = options || {};\n\n if (typeof options.remux !== 'undefined') {\n this.remuxTracks = !!options.remux;\n } else {\n this.remuxTracks = true;\n }\n\n if (typeof options.keepOriginalTimestamps === 'boolean') {\n this.keepOriginalTimestamps = options.keepOriginalTimestamps;\n }\n\n this.pendingTracks = [];\n this.videoTrack = null;\n this.pendingBoxes = [];\n this.pendingCaptions = [];\n this.pendingMetadata = [];\n this.pendingBytes = 0;\n this.emittedTracks = 0;\n\n CoalesceStream.prototype.init.call(this);\n\n // Take output from multiple\n this.push = function(output) {\n // buffer incoming captions until the associated video segment\n // finishes\n if (output.text) {\n return this.pendingCaptions.push(output);\n }\n // buffer incoming id3 tags until the final flush\n if (output.frames) {\n return this.pendingMetadata.push(output);\n }\n\n // Add this track to the list of pending tracks and store\n // important information required for the construction of\n // the final segment\n this.pendingTracks.push(output.track);\n this.pendingBoxes.push(output.boxes);\n this.pendingBytes += output.boxes.byteLength;\n\n if (output.track.type === 'video') {\n this.videoTrack = output.track;\n }\n if (output.track.type === 'audio') {\n this.audioTrack = output.track;\n }\n };\n};\n\nCoalesceStream.prototype = new Stream();\nCoalesceStream.prototype.flush = function(flushSource) {\n var\n offset = 0,\n event = {\n captions: [],\n captionStreams: {},\n metadata: [],\n info: {}\n },\n caption,\n id3,\n initSegment,\n timelineStartPts = 0,\n i;\n\n if (this.pendingTracks.length < this.numberOfTracks) {\n if (flushSource !== 'VideoSegmentStream' &&\n flushSource !== 'AudioSegmentStream') {\n // Return because we haven't received a flush from a data-generating\n // portion of the segment (meaning that we have only recieved meta-data\n // or captions.)\n return;\n } else if (this.remuxTracks) {\n // Return until we have enough tracks from the pipeline to remux (if we\n // are remuxing audio and video into a single MP4)\n return;\n } else if (this.pendingTracks.length === 0) {\n // In the case where we receive a flush without any data having been\n // received we consider it an emitted track for the purposes of coalescing\n // `done` events.\n // We do this for the case where there is an audio and video track in the\n // segment but no audio data. (seen in several playlists with alternate\n // audio tracks and no audio present in the main TS segments.)\n this.emittedTracks++;\n\n if (this.emittedTracks >= this.numberOfTracks) {\n this.trigger('done');\n this.emittedTracks = 0;\n }\n return;\n }\n }\n\n if (this.videoTrack) {\n timelineStartPts = this.videoTrack.timelineStartInfo.pts;\n VIDEO_PROPERTIES.forEach(function(prop) {\n event.info[prop] = this.videoTrack[prop];\n }, this);\n } else if (this.audioTrack) {\n timelineStartPts = this.audioTrack.timelineStartInfo.pts;\n AUDIO_PROPERTIES.forEach(function(prop) {\n event.info[prop] = this.audioTrack[prop];\n }, this);\n }\n\n if (this.pendingTracks.length === 1) {\n event.type = this.pendingTracks[0].type;\n } else {\n event.type = 'combined';\n }\n\n this.emittedTracks += this.pendingTracks.length;\n\n initSegment = mp4.initSegment(this.pendingTracks);\n\n // Create a new typed array to hold the init segment\n event.initSegment = new Uint8Array(initSegment.byteLength);\n\n // Create an init segment containing a moov\n // and track definitions\n event.initSegment.set(initSegment);\n\n // Create a new typed array to hold the moof+mdats\n event.data = new Uint8Array(this.pendingBytes);\n\n // Append each moof+mdat (one per track) together\n for (i = 0; i < this.pendingBoxes.length; i++) {\n event.data.set(this.pendingBoxes[i], offset);\n offset += this.pendingBoxes[i].byteLength;\n }\n\n // Translate caption PTS times into second offsets to match the\n // video timeline for the segment, and add track info\n for (i = 0; i < this.pendingCaptions.length; i++) {\n caption = this.pendingCaptions[i];\n\n caption.startTime = caption.startPts;\n if (!this.keepOriginalTimestamps) {\n caption.startTime -= timelineStartPts;\n }\n caption.startTime /= 90e3;\n\n caption.endTime = caption.endPts;\n if (!this.keepOriginalTimestamps) {\n caption.endTime -= timelineStartPts;\n }\n caption.endTime /= 90e3;\n\n event.captionStreams[caption.stream] = true;\n event.captions.push(caption);\n }\n\n // Translate ID3 frame PTS times into second offsets to match the\n // video timeline for the segment\n for (i = 0; i < this.pendingMetadata.length; i++) {\n id3 = this.pendingMetadata[i];\n\n id3.cueTime = id3.pts;\n if (!this.keepOriginalTimestamps) {\n id3.cueTime -= timelineStartPts;\n }\n id3.cueTime /= 90e3;\n\n event.metadata.push(id3);\n }\n\n // We add this to every single emitted segment even though we only need\n // it for the first\n event.metadata.dispatchType = this.metadataStream.dispatchType;\n\n // Reset stream state\n this.pendingTracks.length = 0;\n this.videoTrack = null;\n this.pendingBoxes.length = 0;\n this.pendingCaptions.length = 0;\n this.pendingBytes = 0;\n this.pendingMetadata.length = 0;\n\n // Emit the built segment\n this.trigger('data', event);\n\n // Only emit `done` if all tracks have been flushed and emitted\n if (this.emittedTracks >= this.numberOfTracks) {\n this.trigger('done');\n this.emittedTracks = 0;\n }\n};\n/**\n * A Stream that expects MP2T binary data as input and produces\n * corresponding media segments, suitable for use with Media Source\n * Extension (MSE) implementations that support the ISO BMFF byte\n * stream format, like Chrome.\n */\nTransmuxer = function(options) {\n var\n self = this,\n hasFlushed = true,\n videoTrack,\n audioTrack;\n\n Transmuxer.prototype.init.call(this);\n\n options = options || {};\n this.baseMediaDecodeTime = options.baseMediaDecodeTime || 0;\n this.transmuxPipeline_ = {};\n\n this.setupAacPipeline = function() {\n var pipeline = {};\n this.transmuxPipeline_ = pipeline;\n\n pipeline.type = 'aac';\n pipeline.metadataStream = new m2ts.MetadataStream();\n\n // set up the parsing pipeline\n pipeline.aacStream = new AacStream();\n pipeline.audioTimestampRolloverStream = new m2ts.TimestampRolloverStream('audio');\n pipeline.timedMetadataTimestampRolloverStream = new m2ts.TimestampRolloverStream('timed-metadata');\n pipeline.adtsStream = new AdtsStream();\n pipeline.coalesceStream = new CoalesceStream(options, pipeline.metadataStream);\n pipeline.headOfPipeline = pipeline.aacStream;\n\n pipeline.aacStream\n .pipe(pipeline.audioTimestampRolloverStream)\n .pipe(pipeline.adtsStream);\n pipeline.aacStream\n .pipe(pipeline.timedMetadataTimestampRolloverStream)\n .pipe(pipeline.metadataStream)\n .pipe(pipeline.coalesceStream);\n\n pipeline.metadataStream.on('timestamp', function(frame) {\n pipeline.aacStream.setTimestamp(frame.timeStamp);\n });\n\n pipeline.aacStream.on('data', function(data) {\n if (data.type === 'timed-metadata' && !pipeline.audioSegmentStream) {\n audioTrack = audioTrack || {\n timelineStartInfo: {\n baseMediaDecodeTime: self.baseMediaDecodeTime\n },\n codec: 'adts',\n type: 'audio'\n };\n // hook up the audio segment stream to the first track with aac data\n pipeline.coalesceStream.numberOfTracks++;\n pipeline.audioSegmentStream = new AudioSegmentStream(audioTrack, options);\n // Set up the final part of the audio pipeline\n pipeline.adtsStream\n .pipe(pipeline.audioSegmentStream)\n .pipe(pipeline.coalesceStream);\n }\n });\n\n // Re-emit any data coming from the coalesce stream to the outside world\n pipeline.coalesceStream.on('data', this.trigger.bind(this, 'data'));\n // Let the consumer know we have finished flushing the entire pipeline\n pipeline.coalesceStream.on('done', this.trigger.bind(this, 'done'));\n };\n\n this.setupTsPipeline = function() {\n var pipeline = {};\n this.transmuxPipeline_ = pipeline;\n\n pipeline.type = 'ts';\n pipeline.metadataStream = new m2ts.MetadataStream();\n\n // set up the parsing pipeline\n pipeline.packetStream = new m2ts.TransportPacketStream();\n pipeline.parseStream = new m2ts.TransportParseStream();\n pipeline.elementaryStream = new m2ts.ElementaryStream();\n pipeline.videoTimestampRolloverStream = new m2ts.TimestampRolloverStream('video');\n pipeline.audioTimestampRolloverStream = new m2ts.TimestampRolloverStream('audio');\n pipeline.timedMetadataTimestampRolloverStream = new m2ts.TimestampRolloverStream('timed-metadata');\n pipeline.adtsStream = new AdtsStream();\n pipeline.h264Stream = new H264Stream();\n pipeline.captionStream = new m2ts.CaptionStream();\n pipeline.coalesceStream = new CoalesceStream(options, pipeline.metadataStream);\n pipeline.headOfPipeline = pipeline.packetStream;\n\n // disassemble MPEG2-TS packets into elementary streams\n pipeline.packetStream\n .pipe(pipeline.parseStream)\n .pipe(pipeline.elementaryStream);\n\n // !!THIS ORDER IS IMPORTANT!!\n // demux the streams\n pipeline.elementaryStream\n .pipe(pipeline.videoTimestampRolloverStream)\n .pipe(pipeline.h264Stream);\n pipeline.elementaryStream\n .pipe(pipeline.audioTimestampRolloverStream)\n .pipe(pipeline.adtsStream);\n\n pipeline.elementaryStream\n .pipe(pipeline.timedMetadataTimestampRolloverStream)\n .pipe(pipeline.metadataStream)\n .pipe(pipeline.coalesceStream);\n\n // Hook up CEA-608/708 caption stream\n pipeline.h264Stream.pipe(pipeline.captionStream)\n .pipe(pipeline.coalesceStream);\n\n pipeline.elementaryStream.on('data', function(data) {\n var i;\n\n if (data.type === 'metadata') {\n i = data.tracks.length;\n\n // scan the tracks listed in the metadata\n while (i--) {\n if (!videoTrack && data.tracks[i].type === 'video') {\n videoTrack = data.tracks[i];\n videoTrack.timelineStartInfo.baseMediaDecodeTime = self.baseMediaDecodeTime;\n } else if (!audioTrack && data.tracks[i].type === 'audio') {\n audioTrack = data.tracks[i];\n audioTrack.timelineStartInfo.baseMediaDecodeTime = self.baseMediaDecodeTime;\n }\n }\n\n // hook up the video segment stream to the first track with h264 data\n if (videoTrack && !pipeline.videoSegmentStream) {\n pipeline.coalesceStream.numberOfTracks++;\n pipeline.videoSegmentStream = new VideoSegmentStream(videoTrack, options);\n\n pipeline.videoSegmentStream.on('timelineStartInfo', function(timelineStartInfo) {\n // When video emits timelineStartInfo data after a flush, we forward that\n // info to the AudioSegmentStream, if it exists, because video timeline\n // data takes precedence.\n if (audioTrack) {\n audioTrack.timelineStartInfo = timelineStartInfo;\n // On the first segment we trim AAC frames that exist before the\n // very earliest DTS we have seen in video because Chrome will\n // interpret any video track with a baseMediaDecodeTime that is\n // non-zero as a gap.\n pipeline.audioSegmentStream.setEarliestDts(timelineStartInfo.dts);\n }\n });\n\n pipeline.videoSegmentStream.on('processedGopsInfo',\n self.trigger.bind(self, 'gopInfo'));\n\n pipeline.videoSegmentStream.on('baseMediaDecodeTime', function(baseMediaDecodeTime) {\n if (audioTrack) {\n pipeline.audioSegmentStream.setVideoBaseMediaDecodeTime(baseMediaDecodeTime);\n }\n });\n\n // Set up the final part of the video pipeline\n pipeline.h264Stream\n .pipe(pipeline.videoSegmentStream)\n .pipe(pipeline.coalesceStream);\n }\n\n if (audioTrack && !pipeline.audioSegmentStream) {\n // hook up the audio segment stream to the first track with aac data\n pipeline.coalesceStream.numberOfTracks++;\n pipeline.audioSegmentStream = new AudioSegmentStream(audioTrack, options);\n\n // Set up the final part of the audio pipeline\n pipeline.adtsStream\n .pipe(pipeline.audioSegmentStream)\n .pipe(pipeline.coalesceStream);\n }\n }\n });\n\n // Re-emit any data coming from the coalesce stream to the outside world\n pipeline.coalesceStream.on('data', this.trigger.bind(this, 'data'));\n // Let the consumer know we have finished flushing the entire pipeline\n pipeline.coalesceStream.on('done', this.trigger.bind(this, 'done'));\n };\n\n // hook up the segment streams once track metadata is delivered\n this.setBaseMediaDecodeTime = function(baseMediaDecodeTime) {\n var pipeline = this.transmuxPipeline_;\n\n if (!options.keepOriginalTimestamps) {\n this.baseMediaDecodeTime = baseMediaDecodeTime;\n }\n\n if (audioTrack) {\n audioTrack.timelineStartInfo.dts = undefined;\n audioTrack.timelineStartInfo.pts = undefined;\n trackDecodeInfo.clearDtsInfo(audioTrack);\n if (!options.keepOriginalTimestamps) {\n audioTrack.timelineStartInfo.baseMediaDecodeTime = baseMediaDecodeTime;\n }\n if (pipeline.audioTimestampRolloverStream) {\n pipeline.audioTimestampRolloverStream.discontinuity();\n }\n }\n if (videoTrack) {\n if (pipeline.videoSegmentStream) {\n pipeline.videoSegmentStream.gopCache_ = [];\n pipeline.videoTimestampRolloverStream.discontinuity();\n }\n videoTrack.timelineStartInfo.dts = undefined;\n videoTrack.timelineStartInfo.pts = undefined;\n trackDecodeInfo.clearDtsInfo(videoTrack);\n pipeline.captionStream.reset();\n if (!options.keepOriginalTimestamps) {\n videoTrack.timelineStartInfo.baseMediaDecodeTime = baseMediaDecodeTime;\n }\n }\n\n if (pipeline.timedMetadataTimestampRolloverStream) {\n pipeline.timedMetadataTimestampRolloverStream.discontinuity();\n }\n };\n\n this.setAudioAppendStart = function(timestamp) {\n if (audioTrack) {\n this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(timestamp);\n }\n };\n\n this.alignGopsWith = function(gopsToAlignWith) {\n if (videoTrack && this.transmuxPipeline_.videoSegmentStream) {\n this.transmuxPipeline_.videoSegmentStream.alignGopsWith(gopsToAlignWith);\n }\n };\n\n // feed incoming data to the front of the parsing pipeline\n this.push = function(data) {\n if (hasFlushed) {\n var isAac = isLikelyAacData(data);\n\n if (isAac && this.transmuxPipeline_.type !== 'aac') {\n this.setupAacPipeline();\n } else if (!isAac && this.transmuxPipeline_.type !== 'ts') {\n this.setupTsPipeline();\n }\n hasFlushed = false;\n }\n this.transmuxPipeline_.headOfPipeline.push(data);\n };\n\n // flush any buffered data\n this.flush = function() {\n hasFlushed = true;\n // Start at the top of the pipeline and flush all pending work\n this.transmuxPipeline_.headOfPipeline.flush();\n };\n\n // Caption data has to be reset when seeking outside buffered range\n this.resetCaptions = function() {\n if (this.transmuxPipeline_.captionStream) {\n this.transmuxPipeline_.captionStream.reset();\n }\n };\n\n};\nTransmuxer.prototype = new Stream();\n\nmodule.exports = {\n Transmuxer: Transmuxer,\n VideoSegmentStream: VideoSegmentStream,\n AudioSegmentStream: AudioSegmentStream,\n AUDIO_PROPERTIES: AUDIO_PROPERTIES,\n VIDEO_PROPERTIES: VIDEO_PROPERTIES\n};\n","/**\n * mux.js\n *\n * Copyright (c) 2015 Brightcove\n * All rights reserved.\n *\n * Reads in-band caption information from a video elementary\n * stream. Captions must follow the CEA-708 standard for injection\n * into an MPEG-2 transport streams.\n * @see https://en.wikipedia.org/wiki/CEA-708\n * @see https://www.gpo.gov/fdsys/pkg/CFR-2007-title47-vol1/pdf/CFR-2007-title47-vol1-sec15-119.pdf\n */\n\n'use strict';\n\n// Supplemental enhancement information (SEI) NAL units have a\n// payload type field to indicate how they are to be\n// interpreted. CEAS-708 caption content is always transmitted with\n// payload type 0x04.\nvar USER_DATA_REGISTERED_ITU_T_T35 = 4,\n RBSP_TRAILING_BITS = 128;\n\n/**\n * Parse a supplemental enhancement information (SEI) NAL unit.\n * Stops parsing once a message of type ITU T T35 has been found.\n *\n * @param bytes {Uint8Array} the bytes of a SEI NAL unit\n * @return {object} the parsed SEI payload\n * @see Rec. ITU-T H.264, 7.3.2.3.1\n */\nvar parseSei = function(bytes) {\n var\n i = 0,\n result = {\n payloadType: -1,\n payloadSize: 0\n },\n payloadType = 0,\n payloadSize = 0;\n\n // go through the sei_rbsp parsing each each individual sei_message\n while (i < bytes.byteLength) {\n // stop once we have hit the end of the sei_rbsp\n if (bytes[i] === RBSP_TRAILING_BITS) {\n break;\n }\n\n // Parse payload type\n while (bytes[i] === 0xFF) {\n payloadType += 255;\n i++;\n }\n payloadType += bytes[i++];\n\n // Parse payload size\n while (bytes[i] === 0xFF) {\n payloadSize += 255;\n i++;\n }\n payloadSize += bytes[i++];\n\n // this sei_message is a 608/708 caption so save it and break\n // there can only ever be one caption message in a frame's sei\n if (!result.payload && payloadType === USER_DATA_REGISTERED_ITU_T_T35) {\n result.payloadType = payloadType;\n result.payloadSize = payloadSize;\n result.payload = bytes.subarray(i, i + payloadSize);\n break;\n }\n\n // skip the payload and parse the next message\n i += payloadSize;\n payloadType = 0;\n payloadSize = 0;\n }\n\n return result;\n};\n\n// see ANSI/SCTE 128-1 (2013), section 8.1\nvar parseUserData = function(sei) {\n // itu_t_t35_contry_code must be 181 (United States) for\n // captions\n if (sei.payload[0] !== 181) {\n return null;\n }\n\n // itu_t_t35_provider_code should be 49 (ATSC) for captions\n if (((sei.payload[1] << 8) | sei.payload[2]) !== 49) {\n return null;\n }\n\n // the user_identifier should be \"GA94\" to indicate ATSC1 data\n if (String.fromCharCode(sei.payload[3],\n sei.payload[4],\n sei.payload[5],\n sei.payload[6]) !== 'GA94') {\n return null;\n }\n\n // finally, user_data_type_code should be 0x03 for caption data\n if (sei.payload[7] !== 0x03) {\n return null;\n }\n\n // return the user_data_type_structure and strip the trailing\n // marker bits\n return sei.payload.subarray(8, sei.payload.length - 1);\n};\n\n// see CEA-708-D, section 4.4\nvar parseCaptionPackets = function(pts, userData) {\n var results = [], i, count, offset, data;\n\n // if this is just filler, return immediately\n if (!(userData[0] & 0x40)) {\n return results;\n }\n\n // parse out the cc_data_1 and cc_data_2 fields\n count = userData[0] & 0x1f;\n for (i = 0; i < count; i++) {\n offset = i * 3;\n data = {\n type: userData[offset + 2] & 0x03,\n pts: pts\n };\n\n // capture cc data when cc_valid is 1\n if (userData[offset + 2] & 0x04) {\n data.ccData = (userData[offset + 3] << 8) | userData[offset + 4];\n results.push(data);\n }\n }\n return results;\n};\n\nvar discardEmulationPreventionBytes = function(data) {\n var\n length = data.byteLength,\n emulationPreventionBytesPositions = [],\n i = 1,\n newLength, newData;\n\n // Find all `Emulation Prevention Bytes`\n while (i < length - 2) {\n if (data[i] === 0 && data[i + 1] === 0 && data[i + 2] === 0x03) {\n emulationPreventionBytesPositions.push(i + 2);\n i += 2;\n } else {\n i++;\n }\n }\n\n // If no Emulation Prevention Bytes were found just return the original\n // array\n if (emulationPreventionBytesPositions.length === 0) {\n return data;\n }\n\n // Create a new array to hold the NAL unit data\n newLength = length - emulationPreventionBytesPositions.length;\n newData = new Uint8Array(newLength);\n var sourceIndex = 0;\n\n for (i = 0; i < newLength; sourceIndex++, i++) {\n if (sourceIndex === emulationPreventionBytesPositions[0]) {\n // Skip this byte\n sourceIndex++;\n // Remove this position index\n emulationPreventionBytesPositions.shift();\n }\n newData[i] = data[sourceIndex];\n }\n\n return newData;\n};\n\n// exports\nmodule.exports = {\n parseSei: parseSei,\n parseUserData: parseUserData,\n parseCaptionPackets: parseCaptionPackets,\n discardEmulationPreventionBytes: discardEmulationPreventionBytes,\n USER_DATA_REGISTERED_ITU_T_T35: USER_DATA_REGISTERED_ITU_T_T35\n};\n","/**\n * mux.js\n *\n * Copyright (c) 2015 Brightcove\n * All rights reserved.\n *\n * Parse the internal MP4 structure into an equivalent javascript\n * object.\n */\n'use strict';\n\nvar\n inspectMp4,\n textifyMp4,\n\n parseType = require('../mp4/probe').parseType,\n parseMp4Date = function(seconds) {\n return new Date(seconds * 1000 - 2082844800000);\n },\n parseSampleFlags = function(flags) {\n return {\n isLeading: (flags[0] & 0x0c) >>> 2,\n dependsOn: flags[0] & 0x03,\n isDependedOn: (flags[1] & 0xc0) >>> 6,\n hasRedundancy: (flags[1] & 0x30) >>> 4,\n paddingValue: (flags[1] & 0x0e) >>> 1,\n isNonSyncSample: flags[1] & 0x01,\n degradationPriority: (flags[2] << 8) | flags[3]\n };\n },\n nalParse = function(avcStream) {\n var\n avcView = new DataView(avcStream.buffer, avcStream.byteOffset, avcStream.byteLength),\n result = [],\n i,\n length;\n for (i = 0; i + 4 < avcStream.length; i += length) {\n length = avcView.getUint32(i);\n i += 4;\n\n // bail if this doesn't appear to be an H264 stream\n if (length <= 0) {\n result.push('<span style=\\'color:red;\\'>MALFORMED DATA</span>');\n continue;\n }\n\n switch (avcStream[i] & 0x1F) {\n case 0x01:\n result.push('slice_layer_without_partitioning_rbsp');\n break;\n case 0x05:\n result.push('slice_layer_without_partitioning_rbsp_idr');\n break;\n case 0x06:\n result.push('sei_rbsp');\n break;\n case 0x07:\n result.push('seq_parameter_set_rbsp');\n break;\n case 0x08:\n result.push('pic_parameter_set_rbsp');\n break;\n case 0x09:\n result.push('access_unit_delimiter_rbsp');\n break;\n default:\n result.push('UNKNOWN NAL - ' + avcStream[i] & 0x1F);\n break;\n }\n }\n return result;\n },\n\n // registry of handlers for individual mp4 box types\n parse = {\n // codingname, not a first-class box type. stsd entries share the\n // same format as real boxes so the parsing infrastructure can be\n // shared\n avc1: function(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength);\n return {\n dataReferenceIndex: view.getUint16(6),\n width: view.getUint16(24),\n height: view.getUint16(26),\n horizresolution: view.getUint16(28) + (view.getUint16(30) / 16),\n vertresolution: view.getUint16(32) + (view.getUint16(34) / 16),\n frameCount: view.getUint16(40),\n depth: view.getUint16(74),\n config: inspectMp4(data.subarray(78, data.byteLength))\n };\n },\n avcC: function(data) {\n var\n view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n configurationVersion: data[0],\n avcProfileIndication: data[1],\n profileCompatibility: data[2],\n avcLevelIndication: data[3],\n lengthSizeMinusOne: data[4] & 0x03,\n sps: [],\n pps: []\n },\n numOfSequenceParameterSets = data[5] & 0x1f,\n numOfPictureParameterSets,\n nalSize,\n offset,\n i;\n\n // iterate past any SPSs\n offset = 6;\n for (i = 0; i < numOfSequenceParameterSets; i++) {\n nalSize = view.getUint16(offset);\n offset += 2;\n result.sps.push(new Uint8Array(data.subarray(offset, offset + nalSize)));\n offset += nalSize;\n }\n // iterate past any PPSs\n numOfPictureParameterSets = data[offset];\n offset++;\n for (i = 0; i < numOfPictureParameterSets; i++) {\n nalSize = view.getUint16(offset);\n offset += 2;\n result.pps.push(new Uint8Array(data.subarray(offset, offset + nalSize)));\n offset += nalSize;\n }\n return result;\n },\n btrt: function(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength);\n return {\n bufferSizeDB: view.getUint32(0),\n maxBitrate: view.getUint32(4),\n avgBitrate: view.getUint32(8)\n };\n },\n esds: function(data) {\n return {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n esId: (data[6] << 8) | data[7],\n streamPriority: data[8] & 0x1f,\n decoderConfig: {\n objectProfileIndication: data[11],\n streamType: (data[12] >>> 2) & 0x3f,\n bufferSize: (data[13] << 16) | (data[14] << 8) | data[15],\n maxBitrate: (data[16] << 24) |\n (data[17] << 16) |\n (data[18] << 8) |\n data[19],\n avgBitrate: (data[20] << 24) |\n (data[21] << 16) |\n (data[22] << 8) |\n data[23],\n decoderConfigDescriptor: {\n tag: data[24],\n length: data[25],\n audioObjectType: (data[26] >>> 3) & 0x1f,\n samplingFrequencyIndex: ((data[26] & 0x07) << 1) |\n ((data[27] >>> 7) & 0x01),\n channelConfiguration: (data[27] >>> 3) & 0x0f\n }\n }\n };\n },\n ftyp: function(data) {\n var\n view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n majorBrand: parseType(data.subarray(0, 4)),\n minorVersion: view.getUint32(4),\n compatibleBrands: []\n },\n i = 8;\n while (i < data.byteLength) {\n result.compatibleBrands.push(parseType(data.subarray(i, i + 4)));\n i += 4;\n }\n return result;\n },\n dinf: function(data) {\n return {\n boxes: inspectMp4(data)\n };\n },\n dref: function(data) {\n return {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n dataReferences: inspectMp4(data.subarray(8))\n };\n },\n hdlr: function(data) {\n var\n view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n version: view.getUint8(0),\n flags: new Uint8Array(data.subarray(1, 4)),\n handlerType: parseType(data.subarray(8, 12)),\n name: ''\n },\n i = 8;\n\n // parse out the name field\n for (i = 24; i < data.byteLength; i++) {\n if (data[i] === 0x00) {\n // the name field is null-terminated\n i++;\n break;\n }\n result.name += String.fromCharCode(data[i]);\n }\n // decode UTF-8 to javascript's internal representation\n // see http://ecmanaut.blogspot.com/2006/07/encoding-decoding-utf8-in-javascript.html\n result.name = decodeURIComponent(escape(result.name));\n\n return result;\n },\n mdat: function(data) {\n return {\n byteLength: data.byteLength,\n nals: nalParse(data)\n };\n },\n mdhd: function(data) {\n var\n view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n i = 4,\n language,\n result = {\n version: view.getUint8(0),\n flags: new Uint8Array(data.subarray(1, 4)),\n language: ''\n };\n if (result.version === 1) {\n i += 4;\n result.creationTime = parseMp4Date(view.getUint32(i)); // truncating top 4 bytes\n i += 8;\n result.modificationTime = parseMp4Date(view.getUint32(i)); // truncating top 4 bytes\n i += 4;\n result.timescale = view.getUint32(i);\n i += 8;\n result.duration = view.getUint32(i); // truncating top 4 bytes\n } else {\n result.creationTime = parseMp4Date(view.getUint32(i));\n i += 4;\n result.modificationTime = parseMp4Date(view.getUint32(i));\n i += 4;\n result.timescale = view.getUint32(i);\n i += 4;\n result.duration = view.getUint32(i);\n }\n i += 4;\n // language is stored as an ISO-639-2/T code in an array of three 5-bit fields\n // each field is the packed difference between its ASCII value and 0x60\n language = view.getUint16(i);\n result.language += String.fromCharCode((language >> 10) + 0x60);\n result.language += String.fromCharCode(((language & 0x03e0) >> 5) + 0x60);\n result.language += String.fromCharCode((language & 0x1f) + 0x60);\n\n return result;\n },\n mdia: function(data) {\n return {\n boxes: inspectMp4(data)\n };\n },\n mfhd: function(data) {\n return {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n sequenceNumber: (data[4] << 24) |\n (data[5] << 16) |\n (data[6] << 8) |\n (data[7])\n };\n },\n minf: function(data) {\n return {\n boxes: inspectMp4(data)\n };\n },\n // codingname, not a first-class box type. stsd entries share the\n // same format as real boxes so the parsing infrastructure can be\n // shared\n mp4a: function(data) {\n var\n view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n // 6 bytes reserved\n dataReferenceIndex: view.getUint16(6),\n // 4 + 4 bytes reserved\n channelcount: view.getUint16(16),\n samplesize: view.getUint16(18),\n // 2 bytes pre_defined\n // 2 bytes reserved\n samplerate: view.getUint16(24) + (view.getUint16(26) / 65536)\n };\n\n // if there are more bytes to process, assume this is an ISO/IEC\n // 14496-14 MP4AudioSampleEntry and parse the ESDBox\n if (data.byteLength > 28) {\n result.streamDescriptor = inspectMp4(data.subarray(28))[0];\n }\n return result;\n },\n moof: function(data) {\n return {\n boxes: inspectMp4(data)\n };\n },\n moov: function(data) {\n return {\n boxes: inspectMp4(data)\n };\n },\n mvex: function(data) {\n return {\n boxes: inspectMp4(data)\n };\n },\n mvhd: function(data) {\n var\n view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n i = 4,\n result = {\n version: view.getUint8(0),\n flags: new Uint8Array(data.subarray(1, 4))\n };\n\n if (result.version === 1) {\n i += 4;\n result.creationTime = parseMp4Date(view.getUint32(i)); // truncating top 4 bytes\n i += 8;\n result.modificationTime = parseMp4Date(view.getUint32(i)); // truncating top 4 bytes\n i += 4;\n result.timescale = view.getUint32(i);\n i += 8;\n result.duration = view.getUint32(i); // truncating top 4 bytes\n } else {\n result.creationTime = parseMp4Date(view.getUint32(i));\n i += 4;\n result.modificationTime = parseMp4Date(view.getUint32(i));\n i += 4;\n result.timescale = view.getUint32(i);\n i += 4;\n result.duration = view.getUint32(i);\n }\n i += 4;\n\n // convert fixed-point, base 16 back to a number\n result.rate = view.getUint16(i) + (view.getUint16(i + 2) / 16);\n i += 4;\n result.volume = view.getUint8(i) + (view.getUint8(i + 1) / 8);\n i += 2;\n i += 2;\n i += 2 * 4;\n result.matrix = new Uint32Array(data.subarray(i, i + (9 * 4)));\n i += 9 * 4;\n i += 6 * 4;\n result.nextTrackId = view.getUint32(i);\n return result;\n },\n pdin: function(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength);\n return {\n version: view.getUint8(0),\n flags: new Uint8Array(data.subarray(1, 4)),\n rate: view.getUint32(4),\n initialDelay: view.getUint32(8)\n };\n },\n sdtp: function(data) {\n var\n result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n samples: []\n }, i;\n\n for (i = 4; i < data.byteLength; i++) {\n result.samples.push({\n dependsOn: (data[i] & 0x30) >> 4,\n isDependedOn: (data[i] & 0x0c) >> 2,\n hasRedundancy: data[i] & 0x03\n });\n }\n return result;\n },\n sidx: function(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n references: [],\n referenceId: view.getUint32(4),\n timescale: view.getUint32(8),\n earliestPresentationTime: view.getUint32(12),\n firstOffset: view.getUint32(16)\n },\n referenceCount = view.getUint16(22),\n i;\n\n for (i = 24; referenceCount; i += 12, referenceCount--) {\n result.references.push({\n referenceType: (data[i] & 0x80) >>> 7,\n referencedSize: view.getUint32(i) & 0x7FFFFFFF,\n subsegmentDuration: view.getUint32(i + 4),\n startsWithSap: !!(data[i + 8] & 0x80),\n sapType: (data[i + 8] & 0x70) >>> 4,\n sapDeltaTime: view.getUint32(i + 8) & 0x0FFFFFFF\n });\n }\n\n return result;\n },\n smhd: function(data) {\n return {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n balance: data[4] + (data[5] / 256)\n };\n },\n stbl: function(data) {\n return {\n boxes: inspectMp4(data)\n };\n },\n stco: function(data) {\n var\n view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n chunkOffsets: []\n },\n entryCount = view.getUint32(4),\n i;\n for (i = 8; entryCount; i += 4, entryCount--) {\n result.chunkOffsets.push(view.getUint32(i));\n }\n return result;\n },\n stsc: function(data) {\n var\n view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n entryCount = view.getUint32(4),\n result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n sampleToChunks: []\n },\n i;\n for (i = 8; entryCount; i += 12, entryCount--) {\n result.sampleToChunks.push({\n firstChunk: view.getUint32(i),\n samplesPerChunk: view.getUint32(i + 4),\n sampleDescriptionIndex: view.getUint32(i + 8)\n });\n }\n return result;\n },\n stsd: function(data) {\n return {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n sampleDescriptions: inspectMp4(data.subarray(8))\n };\n },\n stsz: function(data) {\n var\n view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n sampleSize: view.getUint32(4),\n entries: []\n },\n i;\n for (i = 12; i < data.byteLength; i += 4) {\n result.entries.push(view.getUint32(i));\n }\n return result;\n },\n stts: function(data) {\n var\n view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n timeToSamples: []\n },\n entryCount = view.getUint32(4),\n i;\n\n for (i = 8; entryCount; i += 8, entryCount--) {\n result.timeToSamples.push({\n sampleCount: view.getUint32(i),\n sampleDelta: view.getUint32(i + 4)\n });\n }\n return result;\n },\n styp: function(data) {\n return parse.ftyp(data);\n },\n tfdt: function(data) {\n var result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n baseMediaDecodeTime: data[4] << 24 | data[5] << 16 | data[6] << 8 | data[7]\n };\n if (result.version === 1) {\n result.baseMediaDecodeTime *= Math.pow(2, 32);\n result.baseMediaDecodeTime += data[8] << 24 | data[9] << 16 | data[10] << 8 | data[11];\n }\n return result;\n },\n tfhd: function(data) {\n var\n view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n trackId: view.getUint32(4)\n },\n baseDataOffsetPresent = result.flags[2] & 0x01,\n sampleDescriptionIndexPresent = result.flags[2] & 0x02,\n defaultSampleDurationPresent = result.flags[2] & 0x08,\n defaultSampleSizePresent = result.flags[2] & 0x10,\n defaultSampleFlagsPresent = result.flags[2] & 0x20,\n durationIsEmpty = result.flags[0] & 0x010000,\n defaultBaseIsMoof = result.flags[0] & 0x020000,\n i;\n\n i = 8;\n if (baseDataOffsetPresent) {\n i += 4; // truncate top 4 bytes\n // FIXME: should we read the full 64 bits?\n result.baseDataOffset = view.getUint32(12);\n i += 4;\n }\n if (sampleDescriptionIndexPresent) {\n result.sampleDescriptionIndex = view.getUint32(i);\n i += 4;\n }\n if (defaultSampleDurationPresent) {\n result.defaultSampleDuration = view.getUint32(i);\n i += 4;\n }\n if (defaultSampleSizePresent) {\n result.defaultSampleSize = view.getUint32(i);\n i += 4;\n }\n if (defaultSampleFlagsPresent) {\n result.defaultSampleFlags = view.getUint32(i);\n }\n if (durationIsEmpty) {\n result.durationIsEmpty = true;\n }\n if (!baseDataOffsetPresent && defaultBaseIsMoof) {\n result.baseDataOffsetIsMoof = true;\n }\n return result;\n },\n tkhd: function(data) {\n var\n view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n i = 4,\n result = {\n version: view.getUint8(0),\n flags: new Uint8Array(data.subarray(1, 4))\n };\n if (result.version === 1) {\n i += 4;\n result.creationTime = parseMp4Date(view.getUint32(i)); // truncating top 4 bytes\n i += 8;\n result.modificationTime = parseMp4Date(view.getUint32(i)); // truncating top 4 bytes\n i += 4;\n result.trackId = view.getUint32(i);\n i += 4;\n i += 8;\n result.duration = view.getUint32(i); // truncating top 4 bytes\n } else {\n result.creationTime = parseMp4Date(view.getUint32(i));\n i += 4;\n result.modificationTime = parseMp4Date(view.getUint32(i));\n i += 4;\n result.trackId = view.getUint32(i);\n i += 4;\n i += 4;\n result.duration = view.getUint32(i);\n }\n i += 4;\n i += 2 * 4;\n result.layer = view.getUint16(i);\n i += 2;\n result.alternateGroup = view.getUint16(i);\n i += 2;\n // convert fixed-point, base 16 back to a number\n result.volume = view.getUint8(i) + (view.getUint8(i + 1) / 8);\n i += 2;\n i += 2;\n result.matrix = new Uint32Array(data.subarray(i, i + (9 * 4)));\n i += 9 * 4;\n result.width = view.getUint16(i) + (view.getUint16(i + 2) / 16);\n i += 4;\n result.height = view.getUint16(i) + (view.getUint16(i + 2) / 16);\n return result;\n },\n traf: function(data) {\n return {\n boxes: inspectMp4(data)\n };\n },\n trak: function(data) {\n return {\n boxes: inspectMp4(data)\n };\n },\n trex: function(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength);\n return {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n trackId: view.getUint32(4),\n defaultSampleDescriptionIndex: view.getUint32(8),\n defaultSampleDuration: view.getUint32(12),\n defaultSampleSize: view.getUint32(16),\n sampleDependsOn: data[20] & 0x03,\n sampleIsDependedOn: (data[21] & 0xc0) >> 6,\n sampleHasRedundancy: (data[21] & 0x30) >> 4,\n samplePaddingValue: (data[21] & 0x0e) >> 1,\n sampleIsDifferenceSample: !!(data[21] & 0x01),\n sampleDegradationPriority: view.getUint16(22)\n };\n },\n trun: function(data) {\n var\n result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n samples: []\n },\n view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n // Flag interpretation\n dataOffsetPresent = result.flags[2] & 0x01, // compare with 2nd byte of 0x1\n firstSampleFlagsPresent = result.flags[2] & 0x04, // compare with 2nd byte of 0x4\n sampleDurationPresent = result.flags[1] & 0x01, // compare with 2nd byte of 0x100\n sampleSizePresent = result.flags[1] & 0x02, // compare with 2nd byte of 0x200\n sampleFlagsPresent = result.flags[1] & 0x04, // compare with 2nd byte of 0x400\n sampleCompositionTimeOffsetPresent = result.flags[1] & 0x08, // compare with 2nd byte of 0x800\n sampleCount = view.getUint32(4),\n offset = 8,\n sample;\n\n if (dataOffsetPresent) {\n // 32 bit signed integer\n result.dataOffset = view.getInt32(offset);\n offset += 4;\n }\n\n // Overrides the flags for the first sample only. The order of\n // optional values will be: duration, size, compositionTimeOffset\n if (firstSampleFlagsPresent && sampleCount) {\n sample = {\n flags: parseSampleFlags(data.subarray(offset, offset + 4))\n };\n offset += 4;\n if (sampleDurationPresent) {\n sample.duration = view.getUint32(offset);\n offset += 4;\n }\n if (sampleSizePresent) {\n sample.size = view.getUint32(offset);\n offset += 4;\n }\n if (sampleCompositionTimeOffsetPresent) {\n // Note: this should be a signed int if version is 1\n sample.compositionTimeOffset = view.getUint32(offset);\n offset += 4;\n }\n result.samples.push(sample);\n sampleCount--;\n }\n\n while (sampleCount--) {\n sample = {};\n if (sampleDurationPresent) {\n sample.duration = view.getUint32(offset);\n offset += 4;\n }\n if (sampleSizePresent) {\n sample.size = view.getUint32(offset);\n offset += 4;\n }\n if (sampleFlagsPresent) {\n sample.flags = parseSampleFlags(data.subarray(offset, offset + 4));\n offset += 4;\n }\n if (sampleCompositionTimeOffsetPresent) {\n // Note: this should be a signed int if version is 1\n sample.compositionTimeOffset = view.getUint32(offset);\n offset += 4;\n }\n result.samples.push(sample);\n }\n return result;\n },\n 'url ': function(data) {\n return {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4))\n };\n },\n vmhd: function(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength);\n return {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n graphicsmode: view.getUint16(4),\n opcolor: new Uint16Array([view.getUint16(6),\n view.getUint16(8),\n view.getUint16(10)])\n };\n }\n };\n\n\n/**\n * Return a javascript array of box objects parsed from an ISO base\n * media file.\n * @param data {Uint8Array} the binary data of the media to be inspected\n * @return {array} a javascript array of potentially nested box objects\n */\ninspectMp4 = function(data) {\n var\n i = 0,\n result = [],\n view,\n size,\n type,\n end,\n box;\n\n // Convert data from Uint8Array to ArrayBuffer, to follow Dataview API\n var ab = new ArrayBuffer(data.length);\n var v = new Uint8Array(ab);\n for (var z = 0; z < data.length; ++z) {\n v[z] = data[z];\n }\n view = new DataView(ab);\n\n while (i < data.byteLength) {\n // parse box data\n size = view.getUint32(i);\n type = parseType(data.subarray(i + 4, i + 8));\n end = size > 1 ? i + size : data.byteLength;\n\n // parse type-specific data\n box = (parse[type] || function(data) {\n return {\n data: data\n };\n })(data.subarray(i + 8, end));\n box.size = size;\n box.type = type;\n\n // store this box and move to the next\n result.push(box);\n i = end;\n }\n return result;\n};\n\n/**\n * Returns a textual representation of the javascript represtentation\n * of an MP4 file. You can use it as an alternative to\n * JSON.stringify() to compare inspected MP4s.\n * @param inspectedMp4 {array} the parsed array of boxes in an MP4\n * file\n * @param depth {number} (optional) the number of ancestor boxes of\n * the elements of inspectedMp4. Assumed to be zero if unspecified.\n * @return {string} a text representation of the parsed MP4\n */\ntextifyMp4 = function(inspectedMp4, depth) {\n var indent;\n depth = depth || 0;\n indent = new Array(depth * 2 + 1).join(' ');\n\n // iterate over all the boxes\n return inspectedMp4.map(function(box, index) {\n\n // list the box type first at the current indentation level\n return indent + box.type + '\\n' +\n\n // the type is already included and handle child boxes separately\n Object.keys(box).filter(function(key) {\n return key !== 'type' && key !== 'boxes';\n\n // output all the box properties\n }).map(function(key) {\n var prefix = indent + ' ' + key + ': ',\n value = box[key];\n\n // print out raw bytes as hexademical\n if (value instanceof Uint8Array || value instanceof Uint32Array) {\n var bytes = Array.prototype.slice.call(new Uint8Array(value.buffer, value.byteOffset, value.byteLength))\n .map(function(byte) {\n return ' ' + ('00' + byte.toString(16)).slice(-2);\n }).join('').match(/.{1,24}/g);\n if (!bytes) {\n return prefix + '<>';\n }\n if (bytes.length === 1) {\n return prefix + '<' + bytes.join('').slice(1) + '>';\n }\n return prefix + '<\\n' + bytes.map(function(line) {\n return indent + ' ' + line;\n }).join('\\n') + '\\n' + indent + ' >';\n }\n\n // stringify generic objects\n return prefix +\n JSON.stringify(value, null, 2)\n .split('\\n').map(function(line, index) {\n if (index === 0) {\n return line;\n }\n return indent + ' ' + line;\n }).join('\\n');\n }).join('\\n') +\n\n // recursively textify the child boxes\n (box.boxes ? '\\n' + textifyMp4(box.boxes, depth + 1) : '');\n }).join('\\n');\n};\n\nmodule.exports = {\n inspect: inspectMp4,\n textify: textifyMp4,\n parseTfdt: parse.tfdt,\n parseHdlr: parse.hdlr,\n parseTfhd: parse.tfhd,\n parseTrun: parse.trun\n};\n","/**\n * mux.js\n *\n * Copyright (c) 2016 Brightcove\n * All rights reserved.\n *\n * Parse mpeg2 transport stream packets to extract basic timing information\n */\n'use strict';\n\nvar StreamTypes = require('../m2ts/stream-types.js');\nvar handleRollover = require('../m2ts/timestamp-rollover-stream.js').handleRollover;\nvar probe = {};\nprobe.ts = require('../m2ts/probe.js');\nprobe.aac = require('../aac/utils.js');\n\n\nvar\n PES_TIMESCALE = 90000,\n MP2T_PACKET_LENGTH = 188, // bytes\n SYNC_BYTE = 0x47;\n\n/**\n * walks through segment data looking for pat and pmt packets to parse out\n * program map table information\n */\nvar parsePsi_ = function(bytes, pmt) {\n var\n startIndex = 0,\n endIndex = MP2T_PACKET_LENGTH,\n packet, type;\n\n while (endIndex < bytes.byteLength) {\n // Look for a pair of start and end sync bytes in the data..\n if (bytes[startIndex] === SYNC_BYTE && bytes[endIndex] === SYNC_BYTE) {\n // We found a packet\n packet = bytes.subarray(startIndex, endIndex);\n type = probe.ts.parseType(packet, pmt.pid);\n\n switch (type) {\n case 'pat':\n if (!pmt.pid) {\n pmt.pid = probe.ts.parsePat(packet);\n }\n break;\n case 'pmt':\n if (!pmt.table) {\n pmt.table = probe.ts.parsePmt(packet);\n }\n break;\n default:\n break;\n }\n\n // Found the pat and pmt, we can stop walking the segment\n if (pmt.pid && pmt.table) {\n return;\n }\n\n startIndex += MP2T_PACKET_LENGTH;\n endIndex += MP2T_PACKET_LENGTH;\n continue;\n }\n\n // If we get here, we have somehow become de-synchronized and we need to step\n // forward one byte at a time until we find a pair of sync bytes that denote\n // a packet\n startIndex++;\n endIndex++;\n }\n};\n\n/**\n * walks through the segment data from the start and end to get timing information\n * for the first and last audio pes packets\n */\nvar parseAudioPes_ = function(bytes, pmt, result) {\n var\n startIndex = 0,\n endIndex = MP2T_PACKET_LENGTH,\n packet, type, pesType, pusi, parsed;\n\n var endLoop = false;\n\n // Start walking from start of segment to get first audio packet\n while (endIndex <= bytes.byteLength) {\n // Look for a pair of start and end sync bytes in the data..\n if (bytes[startIndex] === SYNC_BYTE &&\n (bytes[endIndex] === SYNC_BYTE || endIndex === bytes.byteLength)) {\n // We found a packet\n packet = bytes.subarray(startIndex, endIndex);\n type = probe.ts.parseType(packet, pmt.pid);\n\n switch (type) {\n case 'pes':\n pesType = probe.ts.parsePesType(packet, pmt.table);\n pusi = probe.ts.parsePayloadUnitStartIndicator(packet);\n if (pesType === 'audio' && pusi) {\n parsed = probe.ts.parsePesTime(packet);\n if (parsed) {\n parsed.type = 'audio';\n result.audio.push(parsed);\n endLoop = true;\n }\n }\n break;\n default:\n break;\n }\n\n if (endLoop) {\n break;\n }\n\n startIndex += MP2T_PACKET_LENGTH;\n endIndex += MP2T_PACKET_LENGTH;\n continue;\n }\n\n // If we get here, we have somehow become de-synchronized and we need to step\n // forward one byte at a time until we find a pair of sync bytes that denote\n // a packet\n startIndex++;\n endIndex++;\n }\n\n // Start walking from end of segment to get last audio packet\n endIndex = bytes.byteLength;\n startIndex = endIndex - MP2T_PACKET_LENGTH;\n endLoop = false;\n while (startIndex >= 0) {\n // Look for a pair of start and end sync bytes in the data..\n if (bytes[startIndex] === SYNC_BYTE &&\n (bytes[endIndex] === SYNC_BYTE || endIndex === bytes.byteLength)) {\n // We found a packet\n packet = bytes.subarray(startIndex, endIndex);\n type = probe.ts.parseType(packet, pmt.pid);\n\n switch (type) {\n case 'pes':\n pesType = probe.ts.parsePesType(packet, pmt.table);\n pusi = probe.ts.parsePayloadUnitStartIndicator(packet);\n if (pesType === 'audio' && pusi) {\n parsed = probe.ts.parsePesTime(packet);\n if (parsed) {\n parsed.type = 'audio';\n result.audio.push(parsed);\n endLoop = true;\n }\n }\n break;\n default:\n break;\n }\n\n if (endLoop) {\n break;\n }\n\n startIndex -= MP2T_PACKET_LENGTH;\n endIndex -= MP2T_PACKET_LENGTH;\n continue;\n }\n\n // If we get here, we have somehow become de-synchronized and we need to step\n // forward one byte at a time until we find a pair of sync bytes that denote\n // a packet\n startIndex--;\n endIndex--;\n }\n};\n\n/**\n * walks through the segment data from the start and end to get timing information\n * for the first and last video pes packets as well as timing information for the first\n * key frame.\n */\nvar parseVideoPes_ = function(bytes, pmt, result) {\n var\n startIndex = 0,\n endIndex = MP2T_PACKET_LENGTH,\n packet, type, pesType, pusi, parsed, frame, i, pes;\n\n var endLoop = false;\n\n var currentFrame = {\n data: [],\n size: 0\n };\n\n // Start walking from start of segment to get first video packet\n while (endIndex < bytes.byteLength) {\n // Look for a pair of start and end sync bytes in the data..\n if (bytes[startIndex] === SYNC_BYTE && bytes[endIndex] === SYNC_BYTE) {\n // We found a packet\n packet = bytes.subarray(startIndex, endIndex);\n type = probe.ts.parseType(packet, pmt.pid);\n\n switch (type) {\n case 'pes':\n pesType = probe.ts.parsePesType(packet, pmt.table);\n pusi = probe.ts.parsePayloadUnitStartIndicator(packet);\n if (pesType === 'video') {\n if (pusi && !endLoop) {\n parsed = probe.ts.parsePesTime(packet);\n if (parsed) {\n parsed.type = 'video';\n result.video.push(parsed);\n endLoop = true;\n }\n }\n if (!result.firstKeyFrame) {\n if (pusi) {\n if (currentFrame.size !== 0) {\n frame = new Uint8Array(currentFrame.size);\n i = 0;\n while (currentFrame.data.length) {\n pes = currentFrame.data.shift();\n frame.set(pes, i);\n i += pes.byteLength;\n }\n if (probe.ts.videoPacketContainsKeyFrame(frame)) {\n result.firstKeyFrame = probe.ts.parsePesTime(frame);\n result.firstKeyFrame.type = 'video';\n }\n currentFrame.size = 0;\n }\n }\n currentFrame.data.push(packet);\n currentFrame.size += packet.byteLength;\n }\n }\n break;\n default:\n break;\n }\n\n if (endLoop && result.firstKeyFrame) {\n break;\n }\n\n startIndex += MP2T_PACKET_LENGTH;\n endIndex += MP2T_PACKET_LENGTH;\n continue;\n }\n\n // If we get here, we have somehow become de-synchronized and we need to step\n // forward one byte at a time until we find a pair of sync bytes that denote\n // a packet\n startIndex++;\n endIndex++;\n }\n\n // Start walking from end of segment to get last video packet\n endIndex = bytes.byteLength;\n startIndex = endIndex - MP2T_PACKET_LENGTH;\n endLoop = false;\n while (startIndex >= 0) {\n // Look for a pair of start and end sync bytes in the data..\n if (bytes[startIndex] === SYNC_BYTE && bytes[endIndex] === SYNC_BYTE) {\n // We found a packet\n packet = bytes.subarray(startIndex, endIndex);\n type = probe.ts.parseType(packet, pmt.pid);\n\n switch (type) {\n case 'pes':\n pesType = probe.ts.parsePesType(packet, pmt.table);\n pusi = probe.ts.parsePayloadUnitStartIndicator(packet);\n if (pesType === 'video' && pusi) {\n parsed = probe.ts.parsePesTime(packet);\n if (parsed) {\n parsed.type = 'video';\n result.video.push(parsed);\n endLoop = true;\n }\n }\n break;\n default:\n break;\n }\n\n if (endLoop) {\n break;\n }\n\n startIndex -= MP2T_PACKET_LENGTH;\n endIndex -= MP2T_PACKET_LENGTH;\n continue;\n }\n\n // If we get here, we have somehow become de-synchronized and we need to step\n // forward one byte at a time until we find a pair of sync bytes that denote\n // a packet\n startIndex--;\n endIndex--;\n }\n};\n\n/**\n * Adjusts the timestamp information for the segment to account for\n * rollover and convert to seconds based on pes packet timescale (90khz clock)\n */\nvar adjustTimestamp_ = function(segmentInfo, baseTimestamp) {\n if (segmentInfo.audio && segmentInfo.audio.length) {\n var audioBaseTimestamp = baseTimestamp;\n if (typeof audioBaseTimestamp === 'undefined') {\n audioBaseTimestamp = segmentInfo.audio[0].dts;\n }\n segmentInfo.audio.forEach(function(info) {\n info.dts = handleRollover(info.dts, audioBaseTimestamp);\n info.pts = handleRollover(info.pts, audioBaseTimestamp);\n // time in seconds\n info.dtsTime = info.dts / PES_TIMESCALE;\n info.ptsTime = info.pts / PES_TIMESCALE;\n });\n }\n\n if (segmentInfo.video && segmentInfo.video.length) {\n var videoBaseTimestamp = baseTimestamp;\n if (typeof videoBaseTimestamp === 'undefined') {\n videoBaseTimestamp = segmentInfo.video[0].dts;\n }\n segmentInfo.video.forEach(function(info) {\n info.dts = handleRollover(info.dts, videoBaseTimestamp);\n info.pts = handleRollover(info.pts, videoBaseTimestamp);\n // time in seconds\n info.dtsTime = info.dts / PES_TIMESCALE;\n info.ptsTime = info.pts / PES_TIMESCALE;\n });\n if (segmentInfo.firstKeyFrame) {\n var frame = segmentInfo.firstKeyFrame;\n frame.dts = handleRollover(frame.dts, videoBaseTimestamp);\n frame.pts = handleRollover(frame.pts, videoBaseTimestamp);\n // time in seconds\n frame.dtsTime = frame.dts / PES_TIMESCALE;\n frame.ptsTime = frame.dts / PES_TIMESCALE;\n }\n }\n};\n\n/**\n * inspects the aac data stream for start and end time information\n */\nvar inspectAac_ = function(bytes) {\n var\n endLoop = false,\n audioCount = 0,\n sampleRate = null,\n timestamp = null,\n frameSize = 0,\n byteIndex = 0,\n packet;\n\n while (bytes.length - byteIndex >= 3) {\n var type = probe.aac.parseType(bytes, byteIndex);\n switch (type) {\n case 'timed-metadata':\n // Exit early because we don't have enough to parse\n // the ID3 tag header\n if (bytes.length - byteIndex < 10) {\n endLoop = true;\n break;\n }\n\n frameSize = probe.aac.parseId3TagSize(bytes, byteIndex);\n\n // Exit early if we don't have enough in the buffer\n // to emit a full packet\n if (frameSize > bytes.length) {\n endLoop = true;\n break;\n }\n if (timestamp === null) {\n packet = bytes.subarray(byteIndex, byteIndex + frameSize);\n timestamp = probe.aac.parseAacTimestamp(packet);\n }\n byteIndex += frameSize;\n break;\n case 'audio':\n // Exit early because we don't have enough to parse\n // the ADTS frame header\n if (bytes.length - byteIndex < 7) {\n endLoop = true;\n break;\n }\n\n frameSize = probe.aac.parseAdtsSize(bytes, byteIndex);\n\n // Exit early if we don't have enough in the buffer\n // to emit a full packet\n if (frameSize > bytes.length) {\n endLoop = true;\n break;\n }\n if (sampleRate === null) {\n packet = bytes.subarray(byteIndex, byteIndex + frameSize);\n sampleRate = probe.aac.parseSampleRate(packet);\n }\n audioCount++;\n byteIndex += frameSize;\n break;\n default:\n byteIndex++;\n break;\n }\n if (endLoop) {\n return null;\n }\n }\n if (sampleRate === null || timestamp === null) {\n return null;\n }\n\n var audioTimescale = PES_TIMESCALE / sampleRate;\n\n var result = {\n audio: [\n {\n type: 'audio',\n dts: timestamp,\n pts: timestamp\n },\n {\n type: 'audio',\n dts: timestamp + (audioCount * 1024 * audioTimescale),\n pts: timestamp + (audioCount * 1024 * audioTimescale)\n }\n ]\n };\n\n return result;\n};\n\n/**\n * inspects the transport stream segment data for start and end time information\n * of the audio and video tracks (when present) as well as the first key frame's\n * start time.\n */\nvar inspectTs_ = function(bytes) {\n var pmt = {\n pid: null,\n table: null\n };\n\n var result = {};\n\n parsePsi_(bytes, pmt);\n\n for (var pid in pmt.table) {\n if (pmt.table.hasOwnProperty(pid)) {\n var type = pmt.table[pid];\n switch (type) {\n case StreamTypes.H264_STREAM_TYPE:\n result.video = [];\n parseVideoPes_(bytes, pmt, result);\n if (result.video.length === 0) {\n delete result.video;\n }\n break;\n case StreamTypes.ADTS_STREAM_TYPE:\n result.audio = [];\n parseAudioPes_(bytes, pmt, result);\n if (result.audio.length === 0) {\n delete result.audio;\n }\n break;\n default:\n break;\n }\n }\n }\n return result;\n};\n\n/**\n * Inspects segment byte data and returns an object with start and end timing information\n *\n * @param {Uint8Array} bytes The segment byte data\n * @param {Number} baseTimestamp Relative reference timestamp used when adjusting frame\n * timestamps for rollover. This value must be in 90khz clock.\n * @return {Object} Object containing start and end frame timing info of segment.\n */\nvar inspect = function(bytes, baseTimestamp) {\n var isAacData = probe.aac.isLikelyAacData(bytes);\n\n var result;\n\n if (isAacData) {\n result = inspectAac_(bytes);\n } else {\n result = inspectTs_(bytes);\n }\n\n if (!result || (!result.audio && !result.video)) {\n return null;\n }\n\n adjustTimestamp_(result, baseTimestamp);\n\n return result;\n};\n\nmodule.exports = {\n inspect: inspect,\n parseAudioPes_: parseAudioPes_\n};\n","var toUnsigned = function(value) {\n return value >>> 0;\n};\n\nmodule.exports = {\n toUnsigned: toUnsigned\n};\n","var\n ONE_SECOND_IN_TS = 90000, // 90kHz clock\n secondsToVideoTs,\n secondsToAudioTs,\n videoTsToSeconds,\n audioTsToSeconds,\n audioTsToVideoTs,\n videoTsToAudioTs;\n\nsecondsToVideoTs = function(seconds) {\n return seconds * ONE_SECOND_IN_TS;\n};\n\nsecondsToAudioTs = function(seconds, sampleRate) {\n return seconds * sampleRate;\n};\n\nvideoTsToSeconds = function(timestamp) {\n return timestamp / ONE_SECOND_IN_TS;\n};\n\naudioTsToSeconds = function(timestamp, sampleRate) {\n return timestamp / sampleRate;\n};\n\naudioTsToVideoTs = function(timestamp, sampleRate) {\n return secondsToVideoTs(audioTsToSeconds(timestamp, sampleRate));\n};\n\nvideoTsToAudioTs = function(timestamp, sampleRate) {\n return secondsToAudioTs(videoTsToSeconds(timestamp), sampleRate);\n};\n\nmodule.exports = {\n secondsToVideoTs: secondsToVideoTs,\n secondsToAudioTs: secondsToAudioTs,\n videoTsToSeconds: videoTsToSeconds,\n audioTsToSeconds: audioTsToSeconds,\n audioTsToVideoTs: audioTsToVideoTs,\n videoTsToAudioTs: videoTsToAudioTs\n};\n","'use strict';\n\nvar ExpGolomb;\n\n/**\n * Parser for exponential Golomb codes, a variable-bitwidth number encoding\n * scheme used by h264.\n */\nExpGolomb = function(workingData) {\n var\n // the number of bytes left to examine in workingData\n workingBytesAvailable = workingData.byteLength,\n\n // the current word being examined\n workingWord = 0, // :uint\n\n // the number of bits left to examine in the current word\n workingBitsAvailable = 0; // :uint;\n\n // ():uint\n this.length = function() {\n return (8 * workingBytesAvailable);\n };\n\n // ():uint\n this.bitsAvailable = function() {\n return (8 * workingBytesAvailable) + workingBitsAvailable;\n };\n\n // ():void\n this.loadWord = function() {\n var\n position = workingData.byteLength - workingBytesAvailable,\n workingBytes = new Uint8Array(4),\n availableBytes = Math.min(4, workingBytesAvailable);\n\n if (availableBytes === 0) {\n throw new Error('no bytes available');\n }\n\n workingBytes.set(workingData.subarray(position,\n position + availableBytes));\n workingWord = new DataView(workingBytes.buffer).getUint32(0);\n\n // track the amount of workingData that has been processed\n workingBitsAvailable = availableBytes * 8;\n workingBytesAvailable -= availableBytes;\n };\n\n // (count:int):void\n this.skipBits = function(count) {\n var skipBytes; // :int\n if (workingBitsAvailable > count) {\n workingWord <<= count;\n workingBitsAvailable -= count;\n } else {\n count -= workingBitsAvailable;\n skipBytes = Math.floor(count / 8);\n\n count -= (skipBytes * 8);\n workingBytesAvailable -= skipBytes;\n\n this.loadWord();\n\n workingWord <<= count;\n workingBitsAvailable -= count;\n }\n };\n\n // (size:int):uint\n this.readBits = function(size) {\n var\n bits = Math.min(workingBitsAvailable, size), // :uint\n valu = workingWord >>> (32 - bits); // :uint\n // if size > 31, handle error\n workingBitsAvailable -= bits;\n if (workingBitsAvailable > 0) {\n workingWord <<= bits;\n } else if (workingBytesAvailable > 0) {\n this.loadWord();\n }\n\n bits = size - bits;\n if (bits > 0) {\n return valu << bits | this.readBits(bits);\n }\n return valu;\n };\n\n // ():uint\n this.skipLeadingZeros = function() {\n var leadingZeroCount; // :uint\n for (leadingZeroCount = 0; leadingZeroCount < workingBitsAvailable; ++leadingZeroCount) {\n if ((workingWord & (0x80000000 >>> leadingZeroCount)) !== 0) {\n // the first bit of working word is 1\n workingWord <<= leadingZeroCount;\n workingBitsAvailable -= leadingZeroCount;\n return leadingZeroCount;\n }\n }\n\n // we exhausted workingWord and still have not found a 1\n this.loadWord();\n return leadingZeroCount + this.skipLeadingZeros();\n };\n\n // ():void\n this.skipUnsignedExpGolomb = function() {\n this.skipBits(1 + this.skipLeadingZeros());\n };\n\n // ():void\n this.skipExpGolomb = function() {\n this.skipBits(1 + this.skipLeadingZeros());\n };\n\n // ():uint\n this.readUnsignedExpGolomb = function() {\n var clz = this.skipLeadingZeros(); // :uint\n return this.readBits(clz + 1) - 1;\n };\n\n // ():int\n this.readExpGolomb = function() {\n var valu = this.readUnsignedExpGolomb(); // :int\n if (0x01 & valu) {\n // the number is odd if the low order bit is set\n return (1 + valu) >>> 1; // add 1 to make it even, and divide by 2\n }\n return -1 * (valu >>> 1); // divide by two then make it negative\n };\n\n // Some convenience functions\n // :Boolean\n this.readBoolean = function() {\n return this.readBits(1) === 1;\n };\n\n // ():int\n this.readUnsignedByte = function() {\n return this.readBits(8);\n };\n\n this.loadWord();\n};\n\nmodule.exports = ExpGolomb;\n","/**\n * mux.js\n *\n * Copyright (c) 2014 Brightcove\n * All rights reserved.\n *\n * A lightweight readable stream implemention that handles event dispatching.\n * Objects that inherit from streams should call init in their constructors.\n */\n'use strict';\n\nvar Stream = function() {\n this.init = function() {\n var listeners = {};\n /**\n * Add a listener for a specified event type.\n * @param type {string} the event name\n * @param listener {function} the callback to be invoked when an event of\n * the specified type occurs\n */\n this.on = function(type, listener) {\n if (!listeners[type]) {\n listeners[type] = [];\n }\n listeners[type] = listeners[type].concat(listener);\n };\n /**\n * Remove a listener for a specified event type.\n * @param type {string} the event name\n * @param listener {function} a function previously registered for this\n * type of event through `on`\n */\n this.off = function(type, listener) {\n var index;\n if (!listeners[type]) {\n return false;\n }\n index = listeners[type].indexOf(listener);\n listeners[type] = listeners[type].slice();\n listeners[type].splice(index, 1);\n return index > -1;\n };\n /**\n * Trigger an event of the specified type on this stream. Any additional\n * arguments to this function are passed as parameters to event listeners.\n * @param type {string} the event name\n */\n this.trigger = function(type) {\n var callbacks, i, length, args;\n callbacks = listeners[type];\n if (!callbacks) {\n return;\n }\n // Slicing the arguments on every invocation of this method\n // can add a significant amount of overhead. Avoid the\n // intermediate object creation for the common case of a\n // single callback argument\n if (arguments.length === 2) {\n length = callbacks.length;\n for (i = 0; i < length; ++i) {\n callbacks[i].call(this, arguments[1]);\n }\n } else {\n args = [];\n i = arguments.length;\n for (i = 1; i < arguments.length; ++i) {\n args.push(arguments[i]);\n }\n length = callbacks.length;\n for (i = 0; i < length; ++i) {\n callbacks[i].apply(this, args);\n }\n }\n };\n /**\n * Destroys the stream and cleans up.\n */\n this.dispose = function() {\n listeners = {};\n };\n };\n};\n\n/**\n * Forwards all `data` events on this stream to the destination stream. The\n * destination stream should provide a method `push` to receive the data\n * events as they arrive.\n * @param destination {stream} the stream that will receive all `data` events\n * @param autoFlush {boolean} if false, we will not call `flush` on the destination\n * when the current stream emits a 'done' event\n * @see http://nodejs.org/api/stream.html#stream_readable_pipe_destination_options\n */\nStream.prototype.pipe = function(destination) {\n this.on('data', function(data) {\n destination.push(data);\n });\n\n this.on('done', function(flushSource) {\n destination.flush(flushSource);\n });\n\n return destination;\n};\n\n// Default stream functions that are expected to be overridden to perform\n// actual work. These are provided by the prototype as a sort of no-op\n// implementation so that we don't have to check for their existence in the\n// `pipe` function above.\nStream.prototype.push = function(data) {\n this.trigger('data', data);\n};\n\nStream.prototype.flush = function(flushSource) {\n this.trigger('done', flushSource);\n};\n\nmodule.exports = Stream;\n","var trim = require('trim')\n , forEach = require('for-each')\n , isArray = function(arg) {\n return Object.prototype.toString.call(arg) === '[object Array]';\n }\n\nmodule.exports = function (headers) {\n if (!headers)\n return {}\n\n var result = {}\n\n forEach(\n trim(headers).split('\\n')\n , function (row) {\n var index = row.indexOf(':')\n , key = trim(row.slice(0, index)).toLowerCase()\n , value = trim(row.slice(index + 1))\n\n if (typeof(result[key]) === 'undefined') {\n result[key] = value\n } else if (isArray(result[key])) {\n result[key].push(value)\n } else {\n result[key] = [ result[key], value ]\n }\n }\n )\n\n return result\n}","module.exports = SafeParseTuple\n\nfunction SafeParseTuple(obj, reviver) {\n var json\n var error = null\n\n try {\n json = JSON.parse(obj, reviver)\n } catch (err) {\n error = err\n }\n\n return [error, json]\n}\n","\nexports = module.exports = trim;\n\nfunction trim(str){\n return str.replace(/^\\s*|\\s*$/g, '');\n}\n\nexports.left = function(str){\n return str.replace(/^\\s*/, '');\n};\n\nexports.right = function(str){\n return str.replace(/\\s*$/, '');\n};\n","function clean (s) {\n return s.replace(/\\n\\r?\\s*/g, '')\n}\n\n\nmodule.exports = function tsml (sa) {\n var s = ''\n , i = 0\n\n for (; i < arguments.length; i++)\n s += clean(sa[i]) + (arguments[i + 1] || '')\n\n return s\n}","// see https://tools.ietf.org/html/rfc1808\n\n/* jshint ignore:start */\n(function(root) { \n/* jshint ignore:end */\n\n var URL_REGEX = /^((?:[a-zA-Z0-9+\\-.]+:)?)(\\/\\/[^\\/?#]*)?((?:[^\\/\\?#]*\\/)*.*?)??(;.*?)?(\\?.*?)?(#.*?)?$/;\n var FIRST_SEGMENT_REGEX = /^([^\\/?#]*)(.*)$/;\n var SLASH_DOT_REGEX = /(?:\\/|^)\\.(?=\\/)/g;\n var SLASH_DOT_DOT_REGEX = /(?:\\/|^)\\.\\.\\/(?!\\.\\.\\/).*?(?=\\/)/g;\n\n var URLToolkit = { // jshint ignore:line\n // If opts.alwaysNormalize is true then the path will always be normalized even when it starts with / or //\n // E.g\n // With opts.alwaysNormalize = false (default, spec compliant)\n // http://a.com/b/cd + /e/f/../g => http://a.com/e/f/../g\n // With opts.alwaysNormalize = true (not spec compliant)\n // http://a.com/b/cd + /e/f/../g => http://a.com/e/g\n buildAbsoluteURL: function(baseURL, relativeURL, opts) {\n opts = opts || {};\n // remove any remaining space and CRLF\n baseURL = baseURL.trim();\n relativeURL = relativeURL.trim();\n if (!relativeURL) {\n // 2a) If the embedded URL is entirely empty, it inherits the\n // entire base URL (i.e., is set equal to the base URL)\n // and we are done.\n if (!opts.alwaysNormalize) {\n return baseURL;\n }\n var basePartsForNormalise = URLToolkit.parseURL(baseURL);\n if (!basePartsForNormalise) {\n throw new Error('Error trying to parse base URL.');\n }\n basePartsForNormalise.path = URLToolkit.normalizePath(basePartsForNormalise.path);\n return URLToolkit.buildURLFromParts(basePartsForNormalise);\n }\n var relativeParts = URLToolkit.parseURL(relativeURL);\n if (!relativeParts) {\n throw new Error('Error trying to parse relative URL.');\n }\n if (relativeParts.scheme) {\n // 2b) If the embedded URL starts with a scheme name, it is\n // interpreted as an absolute URL and we are done.\n if (!opts.alwaysNormalize) {\n return relativeURL;\n }\n relativeParts.path = URLToolkit.normalizePath(relativeParts.path);\n return URLToolkit.buildURLFromParts(relativeParts);\n }\n var baseParts = URLToolkit.parseURL(baseURL);\n if (!baseParts) {\n throw new Error('Error trying to parse base URL.');\n }\n if (!baseParts.netLoc && baseParts.path && baseParts.path[0] !== '/') {\n // If netLoc missing and path doesn't start with '/', assume everthing before the first '/' is the netLoc\n // This causes 'example.com/a' to be handled as '//example.com/a' instead of '/example.com/a'\n var pathParts = FIRST_SEGMENT_REGEX.exec(baseParts.path);\n baseParts.netLoc = pathParts[1];\n baseParts.path = pathParts[2];\n }\n if (baseParts.netLoc && !baseParts.path) {\n baseParts.path = '/';\n }\n var builtParts = {\n // 2c) Otherwise, the embedded URL inherits the scheme of\n // the base URL.\n scheme: baseParts.scheme,\n netLoc: relativeParts.netLoc,\n path: null,\n params: relativeParts.params,\n query: relativeParts.query,\n fragment: relativeParts.fragment\n };\n if (!relativeParts.netLoc) {\n // 3) If the embedded URL's <net_loc> is non-empty, we skip to\n // Step 7. Otherwise, the embedded URL inherits the <net_loc>\n // (if any) of the base URL.\n builtParts.netLoc = baseParts.netLoc;\n // 4) If the embedded URL path is preceded by a slash \"/\", the\n // path is not relative and we skip to Step 7.\n if (relativeParts.path[0] !== '/') {\n if (!relativeParts.path) {\n // 5) If the embedded URL path is empty (and not preceded by a\n // slash), then the embedded URL inherits the base URL path\n builtParts.path = baseParts.path;\n // 5a) if the embedded URL's <params> is non-empty, we skip to\n // step 7; otherwise, it inherits the <params> of the base\n // URL (if any) and\n if (!relativeParts.params) {\n builtParts.params = baseParts.params;\n // 5b) if the embedded URL's <query> is non-empty, we skip to\n // step 7; otherwise, it inherits the <query> of the base\n // URL (if any) and we skip to step 7.\n if (!relativeParts.query) {\n builtParts.query = baseParts.query;\n }\n }\n } else {\n // 6) The last segment of the base URL's path (anything\n // following the rightmost slash \"/\", or the entire path if no\n // slash is present) is removed and the embedded URL's path is\n // appended in its place.\n var baseURLPath = baseParts.path;\n var newPath = baseURLPath.substring(0, baseURLPath.lastIndexOf('/') + 1) + relativeParts.path;\n builtParts.path = URLToolkit.normalizePath(newPath);\n }\n }\n }\n if (builtParts.path === null) {\n builtParts.path = opts.alwaysNormalize ? URLToolkit.normalizePath(relativeParts.path) : relativeParts.path;\n }\n return URLToolkit.buildURLFromParts(builtParts);\n },\n parseURL: function(url) {\n var parts = URL_REGEX.exec(url);\n if (!parts) {\n return null;\n }\n return {\n scheme: parts[1] || '',\n netLoc: parts[2] || '',\n path: parts[3] || '',\n params: parts[4] || '',\n query: parts[5] || '',\n fragment: parts[6] || ''\n };\n },\n normalizePath: function(path) {\n // The following operations are\n // then applied, in order, to the new path:\n // 6a) All occurrences of \"./\", where \".\" is a complete path\n // segment, are removed.\n // 6b) If the path ends with \".\" as a complete path segment,\n // that \".\" is removed.\n path = path.split('').reverse().join('').replace(SLASH_DOT_REGEX, '');\n // 6c) All occurrences of \"<segment>/../\", where <segment> is a\n // complete path segment not equal to \"..\", are removed.\n // Removal of these path segments is performed iteratively,\n // removing the leftmost matching pattern on each iteration,\n // until no matching pattern remains.\n // 6d) If the path ends with \"<segment>/..\", where <segment> is a\n // complete path segment not equal to \"..\", that\n // \"<segment>/..\" is removed.\n while (path.length !== (path = path.replace(SLASH_DOT_DOT_REGEX, '')).length) {} // jshint ignore:line\n return path.split('').reverse().join('');\n },\n buildURLFromParts: function(parts) {\n return parts.scheme + parts.netLoc + parts.path + parts.params + parts.query + parts.fragment;\n }\n };\n\n/* jshint ignore:start */\n if(typeof exports === 'object' && typeof module === 'object')\n module.exports = URLToolkit;\n else if(typeof define === 'function' && define.amd)\n define([], function() { return URLToolkit; });\n else if(typeof exports === 'object')\n exports[\"URLToolkit\"] = URLToolkit;\n else\n root[\"URLToolkit\"] = URLToolkit;\n})(this);\n/* jshint ignore:end */\n","var classCallCheck = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};\n\n\n\n\n\n\n\n\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\n\n\nvar inherits = function (subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n};\n\n\n\n\n\n\n\n\n\n\n\nvar possibleConstructorReturn = function (self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n};\n\n/**\n * @file stream.js\n */\n/**\n * A lightweight readable stream implemention that handles event dispatching.\n *\n * @class Stream\n */\nvar Stream = function () {\n function Stream() {\n classCallCheck(this, Stream);\n\n this.listeners = {};\n }\n\n /**\n * Add a listener for a specified event type.\n *\n * @param {String} type the event name\n * @param {Function} listener the callback to be invoked when an event of\n * the specified type occurs\n */\n\n\n Stream.prototype.on = function on(type, listener) {\n if (!this.listeners[type]) {\n this.listeners[type] = [];\n }\n this.listeners[type].push(listener);\n };\n\n /**\n * Remove a listener for a specified event type.\n *\n * @param {String} type the event name\n * @param {Function} listener a function previously registered for this\n * type of event through `on`\n * @return {Boolean} if we could turn it off or not\n */\n\n\n Stream.prototype.off = function off(type, listener) {\n if (!this.listeners[type]) {\n return false;\n }\n\n var index = this.listeners[type].indexOf(listener);\n\n this.listeners[type].splice(index, 1);\n return index > -1;\n };\n\n /**\n * Trigger an event of the specified type on this stream. Any additional\n * arguments to this function are passed as parameters to event listeners.\n *\n * @param {String} type the event name\n */\n\n\n Stream.prototype.trigger = function trigger(type) {\n var callbacks = this.listeners[type];\n var i = void 0;\n var length = void 0;\n var args = void 0;\n\n if (!callbacks) {\n return;\n }\n // Slicing the arguments on every invocation of this method\n // can add a significant amount of overhead. Avoid the\n // intermediate object creation for the common case of a\n // single callback argument\n if (arguments.length === 2) {\n length = callbacks.length;\n for (i = 0; i < length; ++i) {\n callbacks[i].call(this, arguments[1]);\n }\n } else {\n args = Array.prototype.slice.call(arguments, 1);\n length = callbacks.length;\n for (i = 0; i < length; ++i) {\n callbacks[i].apply(this, args);\n }\n }\n };\n\n /**\n * Destroys the stream and cleans up.\n */\n\n\n Stream.prototype.dispose = function dispose() {\n this.listeners = {};\n };\n /**\n * Forwards all `data` events on this stream to the destination stream. The\n * destination stream should provide a method `push` to receive the data\n * events as they arrive.\n *\n * @param {Stream} destination the stream that will receive all `data` events\n * @see http://nodejs.org/api/stream.html#stream_readable_pipe_destination_options\n */\n\n\n Stream.prototype.pipe = function pipe(destination) {\n this.on('data', function (data) {\n destination.push(data);\n });\n };\n\n return Stream;\n}();\n\n/**\n * @file m3u8/line-stream.js\n */\n/**\n * A stream that buffers string input and generates a `data` event for each\n * line.\n *\n * @class LineStream\n * @extends Stream\n */\n\nvar LineStream = function (_Stream) {\n inherits(LineStream, _Stream);\n\n function LineStream() {\n classCallCheck(this, LineStream);\n\n var _this = possibleConstructorReturn(this, _Stream.call(this));\n\n _this.buffer = '';\n return _this;\n }\n\n /**\n * Add new data to be parsed.\n *\n * @param {String} data the text to process\n */\n\n\n LineStream.prototype.push = function push(data) {\n var nextNewline = void 0;\n\n this.buffer += data;\n nextNewline = this.buffer.indexOf('\\n');\n\n for (; nextNewline > -1; nextNewline = this.buffer.indexOf('\\n')) {\n this.trigger('data', this.buffer.substring(0, nextNewline));\n this.buffer = this.buffer.substring(nextNewline + 1);\n }\n };\n\n return LineStream;\n}(Stream);\n\n/**\n * @file m3u8/parse-stream.js\n */\n/**\n * \"forgiving\" attribute list psuedo-grammar:\n * attributes -> keyvalue (',' keyvalue)*\n * keyvalue -> key '=' value\n * key -> [^=]*\n * value -> '\"' [^\"]* '\"' | [^,]*\n */\nvar attributeSeparator = function attributeSeparator() {\n var key = '[^=]*';\n var value = '\"[^\"]*\"|[^,]*';\n var keyvalue = '(?:' + key + ')=(?:' + value + ')';\n\n return new RegExp('(?:^|,)(' + keyvalue + ')');\n};\n\n/**\n * Parse attributes from a line given the seperator\n *\n * @param {String} attributes the attibute line to parse\n */\nvar parseAttributes = function parseAttributes(attributes) {\n // split the string using attributes as the separator\n var attrs = attributes.split(attributeSeparator());\n var result = {};\n var i = attrs.length;\n var attr = void 0;\n\n while (i--) {\n // filter out unmatched portions of the string\n if (attrs[i] === '') {\n continue;\n }\n\n // split the key and value\n attr = /([^=]*)=(.*)/.exec(attrs[i]).slice(1);\n // trim whitespace and remove optional quotes around the value\n attr[0] = attr[0].replace(/^\\s+|\\s+$/g, '');\n attr[1] = attr[1].replace(/^\\s+|\\s+$/g, '');\n attr[1] = attr[1].replace(/^['\"](.*)['\"]$/g, '$1');\n result[attr[0]] = attr[1];\n }\n return result;\n};\n\n/**\n * A line-level M3U8 parser event stream. It expects to receive input one\n * line at a time and performs a context-free parse of its contents. A stream\n * interpretation of a manifest can be useful if the manifest is expected to\n * be too large to fit comfortably into memory or the entirety of the input\n * is not immediately available. Otherwise, it's probably much easier to work\n * with a regular `Parser` object.\n *\n * Produces `data` events with an object that captures the parser's\n * interpretation of the input. That object has a property `tag` that is one\n * of `uri`, `comment`, or `tag`. URIs only have a single additional\n * property, `line`, which captures the entirety of the input without\n * interpretation. Comments similarly have a single additional property\n * `text` which is the input without the leading `#`.\n *\n * Tags always have a property `tagType` which is the lower-cased version of\n * the M3U8 directive without the `#EXT` or `#EXT-X-` prefix. For instance,\n * `#EXT-X-MEDIA-SEQUENCE` becomes `media-sequence` when parsed. Unrecognized\n * tags are given the tag type `unknown` and a single additional property\n * `data` with the remainder of the input.\n *\n * @class ParseStream\n * @extends Stream\n */\n\nvar ParseStream = function (_Stream) {\n inherits(ParseStream, _Stream);\n\n function ParseStream() {\n classCallCheck(this, ParseStream);\n\n var _this = possibleConstructorReturn(this, _Stream.call(this));\n\n _this.customParsers = [];\n return _this;\n }\n\n /**\n * Parses an additional line of input.\n *\n * @param {String} line a single line of an M3U8 file to parse\n */\n\n\n ParseStream.prototype.push = function push(line) {\n var match = void 0;\n var event = void 0;\n\n // strip whitespace\n line = line.replace(/^[\\u0000\\s]+|[\\u0000\\s]+$/g, '');\n if (line.length === 0) {\n // ignore empty lines\n return;\n }\n\n // URIs\n if (line[0] !== '#') {\n this.trigger('data', {\n type: 'uri',\n uri: line\n });\n return;\n }\n\n for (var i = 0; i < this.customParsers.length; i++) {\n if (this.customParsers[i].call(this, line)) {\n return;\n }\n }\n\n // Comments\n if (line.indexOf('#EXT') !== 0) {\n this.trigger('data', {\n type: 'comment',\n text: line.slice(1)\n });\n return;\n }\n\n // strip off any carriage returns here so the regex matching\n // doesn't have to account for them.\n line = line.replace('\\r', '');\n\n // Tags\n match = /^#EXTM3U/.exec(line);\n if (match) {\n this.trigger('data', {\n type: 'tag',\n tagType: 'm3u'\n });\n return;\n }\n match = /^#EXTINF:?([0-9\\.]*)?,?(.*)?$/.exec(line);\n if (match) {\n event = {\n type: 'tag',\n tagType: 'inf'\n };\n if (match[1]) {\n event.duration = parseFloat(match[1]);\n }\n if (match[2]) {\n event.title = match[2];\n }\n this.trigger('data', event);\n return;\n }\n match = /^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(line);\n if (match) {\n event = {\n type: 'tag',\n tagType: 'targetduration'\n };\n if (match[1]) {\n event.duration = parseInt(match[1], 10);\n }\n this.trigger('data', event);\n return;\n }\n match = /^#ZEN-TOTAL-DURATION:?([0-9.]*)?/.exec(line);\n if (match) {\n event = {\n type: 'tag',\n tagType: 'totalduration'\n };\n if (match[1]) {\n event.duration = parseInt(match[1], 10);\n }\n this.trigger('data', event);\n return;\n }\n match = /^#EXT-X-VERSION:?([0-9.]*)?/.exec(line);\n if (match) {\n event = {\n type: 'tag',\n tagType: 'version'\n };\n if (match[1]) {\n event.version = parseInt(match[1], 10);\n }\n this.trigger('data', event);\n return;\n }\n match = /^#EXT-X-MEDIA-SEQUENCE:?(\\-?[0-9.]*)?/.exec(line);\n if (match) {\n event = {\n type: 'tag',\n tagType: 'media-sequence'\n };\n if (match[1]) {\n event.number = parseInt(match[1], 10);\n }\n this.trigger('data', event);\n return;\n }\n match = /^#EXT-X-DISCONTINUITY-SEQUENCE:?(\\-?[0-9.]*)?/.exec(line);\n if (match) {\n event = {\n type: 'tag',\n tagType: 'discontinuity-sequence'\n };\n if (match[1]) {\n event.number = parseInt(match[1], 10);\n }\n this.trigger('data', event);\n return;\n }\n match = /^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(line);\n if (match) {\n event = {\n type: 'tag',\n tagType: 'playlist-type'\n };\n if (match[1]) {\n event.playlistType = match[1];\n }\n this.trigger('data', event);\n return;\n }\n match = /^#EXT-X-BYTERANGE:?([0-9.]*)?@?([0-9.]*)?/.exec(line);\n if (match) {\n event = {\n type: 'tag',\n tagType: 'byterange'\n };\n if (match[1]) {\n event.length = parseInt(match[1], 10);\n }\n if (match[2]) {\n event.offset = parseInt(match[2], 10);\n }\n this.trigger('data', event);\n return;\n }\n match = /^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(line);\n if (match) {\n event = {\n type: 'tag',\n tagType: 'allow-cache'\n };\n if (match[1]) {\n event.allowed = !/NO/.test(match[1]);\n }\n this.trigger('data', event);\n return;\n }\n match = /^#EXT-X-MAP:?(.*)$/.exec(line);\n if (match) {\n event = {\n type: 'tag',\n tagType: 'map'\n };\n\n if (match[1]) {\n var attributes = parseAttributes(match[1]);\n\n if (attributes.URI) {\n event.uri = attributes.URI;\n }\n if (attributes.BYTERANGE) {\n var _attributes$BYTERANGE = attributes.BYTERANGE.split('@'),\n length = _attributes$BYTERANGE[0],\n offset = _attributes$BYTERANGE[1];\n\n event.byterange = {};\n if (length) {\n event.byterange.length = parseInt(length, 10);\n }\n if (offset) {\n event.byterange.offset = parseInt(offset, 10);\n }\n }\n }\n\n this.trigger('data', event);\n return;\n }\n match = /^#EXT-X-STREAM-INF:?(.*)$/.exec(line);\n if (match) {\n event = {\n type: 'tag',\n tagType: 'stream-inf'\n };\n if (match[1]) {\n event.attributes = parseAttributes(match[1]);\n\n if (event.attributes.RESOLUTION) {\n var split = event.attributes.RESOLUTION.split('x');\n var resolution = {};\n\n if (split[0]) {\n resolution.width = parseInt(split[0], 10);\n }\n if (split[1]) {\n resolution.height = parseInt(split[1], 10);\n }\n event.attributes.RESOLUTION = resolution;\n }\n if (event.attributes.BANDWIDTH) {\n event.attributes.BANDWIDTH = parseInt(event.attributes.BANDWIDTH, 10);\n }\n if (event.attributes['PROGRAM-ID']) {\n event.attributes['PROGRAM-ID'] = parseInt(event.attributes['PROGRAM-ID'], 10);\n }\n }\n this.trigger('data', event);\n return;\n }\n match = /^#EXT-X-MEDIA:?(.*)$/.exec(line);\n if (match) {\n event = {\n type: 'tag',\n tagType: 'media'\n };\n if (match[1]) {\n event.attributes = parseAttributes(match[1]);\n }\n this.trigger('data', event);\n return;\n }\n match = /^#EXT-X-ENDLIST/.exec(line);\n if (match) {\n this.trigger('data', {\n type: 'tag',\n tagType: 'endlist'\n });\n return;\n }\n match = /^#EXT-X-DISCONTINUITY/.exec(line);\n if (match) {\n this.trigger('data', {\n type: 'tag',\n tagType: 'discontinuity'\n });\n return;\n }\n match = /^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(line);\n if (match) {\n event = {\n type: 'tag',\n tagType: 'program-date-time'\n };\n if (match[1]) {\n event.dateTimeString = match[1];\n event.dateTimeObject = new Date(match[1]);\n }\n this.trigger('data', event);\n return;\n }\n match = /^#EXT-X-KEY:?(.*)$/.exec(line);\n if (match) {\n event = {\n type: 'tag',\n tagType: 'key'\n };\n if (match[1]) {\n event.attributes = parseAttributes(match[1]);\n // parse the IV string into a Uint32Array\n if (event.attributes.IV) {\n if (event.attributes.IV.substring(0, 2).toLowerCase() === '0x') {\n event.attributes.IV = event.attributes.IV.substring(2);\n }\n\n event.attributes.IV = event.attributes.IV.match(/.{8}/g);\n event.attributes.IV[0] = parseInt(event.attributes.IV[0], 16);\n event.attributes.IV[1] = parseInt(event.attributes.IV[1], 16);\n event.attributes.IV[2] = parseInt(event.attributes.IV[2], 16);\n event.attributes.IV[3] = parseInt(event.attributes.IV[3], 16);\n event.attributes.IV = new Uint32Array(event.attributes.IV);\n }\n }\n this.trigger('data', event);\n return;\n }\n match = /^#EXT-X-START:?(.*)$/.exec(line);\n if (match) {\n event = {\n type: 'tag',\n tagType: 'start'\n };\n if (match[1]) {\n event.attributes = parseAttributes(match[1]);\n\n event.attributes['TIME-OFFSET'] = parseFloat(event.attributes['TIME-OFFSET']);\n event.attributes.PRECISE = /YES/.test(event.attributes.PRECISE);\n }\n this.trigger('data', event);\n return;\n }\n match = /^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(line);\n if (match) {\n event = {\n type: 'tag',\n tagType: 'cue-out-cont'\n };\n if (match[1]) {\n event.data = match[1];\n } else {\n event.data = '';\n }\n this.trigger('data', event);\n return;\n }\n match = /^#EXT-X-CUE-OUT:?(.*)?$/.exec(line);\n if (match) {\n event = {\n type: 'tag',\n tagType: 'cue-out'\n };\n if (match[1]) {\n event.data = match[1];\n } else {\n event.data = '';\n }\n this.trigger('data', event);\n return;\n }\n match = /^#EXT-X-CUE-IN:?(.*)?$/.exec(line);\n if (match) {\n event = {\n type: 'tag',\n tagType: 'cue-in'\n };\n if (match[1]) {\n event.data = match[1];\n } else {\n event.data = '';\n }\n this.trigger('data', event);\n return;\n }\n\n // unknown tag type\n this.trigger('data', {\n type: 'tag',\n data: line.slice(4)\n });\n };\n\n /**\n * Add a parser for custom headers\n *\n * @param {Object} options a map of options for the added parser\n * @param {RegExp} options.expression a regular expression to match the custom header\n * @param {string} options.customType the custom type to register to the output\n * @param {Function} [options.dataParser] function to parse the line into an object\n * @param {boolean} [options.segment] should tag data be attached to the segment object\n */\n\n\n ParseStream.prototype.addParser = function addParser(_ref) {\n var _this2 = this;\n\n var expression = _ref.expression,\n customType = _ref.customType,\n dataParser = _ref.dataParser,\n segment = _ref.segment;\n\n if (typeof dataParser !== 'function') {\n dataParser = function dataParser(line) {\n return line;\n };\n }\n this.customParsers.push(function (line) {\n var match = expression.exec(line);\n\n if (match) {\n _this2.trigger('data', {\n type: 'custom',\n data: dataParser(line),\n customType: customType,\n segment: segment\n });\n return true;\n }\n });\n };\n\n return ParseStream;\n}(Stream);\n\n/**\n * @file m3u8/parser.js\n */\n/**\n * A parser for M3U8 files. The current interpretation of the input is\n * exposed as a property `manifest` on parser objects. It's just two lines to\n * create and parse a manifest once you have the contents available as a string:\n *\n * ```js\n * var parser = new m3u8.Parser();\n * parser.push(xhr.responseText);\n * ```\n *\n * New input can later be applied to update the manifest object by calling\n * `push` again.\n *\n * The parser attempts to create a usable manifest object even if the\n * underlying input is somewhat nonsensical. It emits `info` and `warning`\n * events during the parse if it encounters input that seems invalid or\n * requires some property of the manifest object to be defaulted.\n *\n * @class Parser\n * @extends Stream\n */\n\nvar Parser = function (_Stream) {\n inherits(Parser, _Stream);\n\n function Parser() {\n classCallCheck(this, Parser);\n\n var _this = possibleConstructorReturn(this, _Stream.call(this));\n\n _this.lineStream = new LineStream();\n _this.parseStream = new ParseStream();\n _this.lineStream.pipe(_this.parseStream);\n\n /* eslint-disable consistent-this */\n var self = _this;\n /* eslint-enable consistent-this */\n var uris = [];\n var currentUri = {};\n // if specified, the active EXT-X-MAP definition\n var currentMap = void 0;\n // if specified, the active decryption key\n var _key = void 0;\n var noop = function noop() {};\n var defaultMediaGroups = {\n 'AUDIO': {},\n 'VIDEO': {},\n 'CLOSED-CAPTIONS': {},\n 'SUBTITLES': {}\n };\n // group segments into numbered timelines delineated by discontinuities\n var currentTimeline = 0;\n\n // the manifest is empty until the parse stream begins delivering data\n _this.manifest = {\n allowCache: true,\n discontinuityStarts: [],\n segments: []\n };\n\n // update the manifest with the m3u8 entry from the parse stream\n _this.parseStream.on('data', function (entry) {\n var mediaGroup = void 0;\n var rendition = void 0;\n\n ({\n tag: function tag() {\n // switch based on the tag type\n (({\n 'allow-cache': function allowCache() {\n this.manifest.allowCache = entry.allowed;\n if (!('allowed' in entry)) {\n this.trigger('info', {\n message: 'defaulting allowCache to YES'\n });\n this.manifest.allowCache = true;\n }\n },\n byterange: function byterange() {\n var byterange = {};\n\n if ('length' in entry) {\n currentUri.byterange = byterange;\n byterange.length = entry.length;\n\n if (!('offset' in entry)) {\n this.trigger('info', {\n message: 'defaulting offset to zero'\n });\n entry.offset = 0;\n }\n }\n if ('offset' in entry) {\n currentUri.byterange = byterange;\n byterange.offset = entry.offset;\n }\n },\n endlist: function endlist() {\n this.manifest.endList = true;\n },\n inf: function inf() {\n if (!('mediaSequence' in this.manifest)) {\n this.manifest.mediaSequence = 0;\n this.trigger('info', {\n message: 'defaulting media sequence to zero'\n });\n }\n if (!('discontinuitySequence' in this.manifest)) {\n this.manifest.discontinuitySequence = 0;\n this.trigger('info', {\n message: 'defaulting discontinuity sequence to zero'\n });\n }\n if (entry.duration > 0) {\n currentUri.duration = entry.duration;\n }\n\n if (entry.duration === 0) {\n currentUri.duration = 0.01;\n this.trigger('info', {\n message: 'updating zero segment duration to a small value'\n });\n }\n\n this.manifest.segments = uris;\n },\n key: function key() {\n if (!entry.attributes) {\n this.trigger('warn', {\n message: 'ignoring key declaration without attribute list'\n });\n return;\n }\n // clear the active encryption key\n if (entry.attributes.METHOD === 'NONE') {\n _key = null;\n return;\n }\n if (!entry.attributes.URI) {\n this.trigger('warn', {\n message: 'ignoring key declaration without URI'\n });\n return;\n }\n if (!entry.attributes.METHOD) {\n this.trigger('warn', {\n message: 'defaulting key method to AES-128'\n });\n }\n\n // setup an encryption key for upcoming segments\n _key = {\n method: entry.attributes.METHOD || 'AES-128',\n uri: entry.attributes.URI\n };\n\n if (typeof entry.attributes.IV !== 'undefined') {\n _key.iv = entry.attributes.IV;\n }\n },\n 'media-sequence': function mediaSequence() {\n if (!isFinite(entry.number)) {\n this.trigger('warn', {\n message: 'ignoring invalid media sequence: ' + entry.number\n });\n return;\n }\n this.manifest.mediaSequence = entry.number;\n },\n 'discontinuity-sequence': function discontinuitySequence() {\n if (!isFinite(entry.number)) {\n this.trigger('warn', {\n message: 'ignoring invalid discontinuity sequence: ' + entry.number\n });\n return;\n }\n this.manifest.discontinuitySequence = entry.number;\n currentTimeline = entry.number;\n },\n 'playlist-type': function playlistType() {\n if (!/VOD|EVENT/.test(entry.playlistType)) {\n this.trigger('warn', {\n message: 'ignoring unknown playlist type: ' + entry.playlist\n });\n return;\n }\n this.manifest.playlistType = entry.playlistType;\n },\n map: function map() {\n currentMap = {};\n if (entry.uri) {\n currentMap.uri = entry.uri;\n }\n if (entry.byterange) {\n currentMap.byterange = entry.byterange;\n }\n },\n 'stream-inf': function streamInf() {\n this.manifest.playlists = uris;\n this.manifest.mediaGroups = this.manifest.mediaGroups || defaultMediaGroups;\n\n if (!entry.attributes) {\n this.trigger('warn', {\n message: 'ignoring empty stream-inf attributes'\n });\n return;\n }\n\n if (!currentUri.attributes) {\n currentUri.attributes = {};\n }\n _extends(currentUri.attributes, entry.attributes);\n },\n media: function media() {\n this.manifest.mediaGroups = this.manifest.mediaGroups || defaultMediaGroups;\n\n if (!(entry.attributes && entry.attributes.TYPE && entry.attributes['GROUP-ID'] && entry.attributes.NAME)) {\n this.trigger('warn', {\n message: 'ignoring incomplete or missing media group'\n });\n return;\n }\n\n // find the media group, creating defaults as necessary\n var mediaGroupType = this.manifest.mediaGroups[entry.attributes.TYPE];\n\n mediaGroupType[entry.attributes['GROUP-ID']] = mediaGroupType[entry.attributes['GROUP-ID']] || {};\n mediaGroup = mediaGroupType[entry.attributes['GROUP-ID']];\n\n // collect the rendition metadata\n rendition = {\n 'default': /yes/i.test(entry.attributes.DEFAULT)\n };\n if (rendition['default']) {\n rendition.autoselect = true;\n } else {\n rendition.autoselect = /yes/i.test(entry.attributes.AUTOSELECT);\n }\n if (entry.attributes.LANGUAGE) {\n rendition.language = entry.attributes.LANGUAGE;\n }\n if (entry.attributes.URI) {\n rendition.uri = entry.attributes.URI;\n }\n if (entry.attributes['INSTREAM-ID']) {\n rendition.instreamId = entry.attributes['INSTREAM-ID'];\n }\n if (entry.attributes.CHARACTERISTICS) {\n rendition.characteristics = entry.attributes.CHARACTERISTICS;\n }\n if (entry.attributes.FORCED) {\n rendition.forced = /yes/i.test(entry.attributes.FORCED);\n }\n\n // insert the new rendition\n mediaGroup[entry.attributes.NAME] = rendition;\n },\n discontinuity: function discontinuity() {\n currentTimeline += 1;\n currentUri.discontinuity = true;\n this.manifest.discontinuityStarts.push(uris.length);\n },\n 'program-date-time': function programDateTime() {\n if (typeof this.manifest.dateTimeString === 'undefined') {\n // PROGRAM-DATE-TIME is a media-segment tag, but for backwards\n // compatibility, we add the first occurence of the PROGRAM-DATE-TIME tag\n // to the manifest object\n // TODO: Consider removing this in future major version\n this.manifest.dateTimeString = entry.dateTimeString;\n this.manifest.dateTimeObject = entry.dateTimeObject;\n }\n\n currentUri.dateTimeString = entry.dateTimeString;\n currentUri.dateTimeObject = entry.dateTimeObject;\n },\n targetduration: function targetduration() {\n if (!isFinite(entry.duration) || entry.duration < 0) {\n this.trigger('warn', {\n message: 'ignoring invalid target duration: ' + entry.duration\n });\n return;\n }\n this.manifest.targetDuration = entry.duration;\n },\n totalduration: function totalduration() {\n if (!isFinite(entry.duration) || entry.duration < 0) {\n this.trigger('warn', {\n message: 'ignoring invalid total duration: ' + entry.duration\n });\n return;\n }\n this.manifest.totalDuration = entry.duration;\n },\n start: function start() {\n if (!entry.attributes || isNaN(entry.attributes['TIME-OFFSET'])) {\n this.trigger('warn', {\n message: 'ignoring start declaration without appropriate attribute list'\n });\n return;\n }\n this.manifest.start = {\n timeOffset: entry.attributes['TIME-OFFSET'],\n precise: entry.attributes.PRECISE\n };\n },\n 'cue-out': function cueOut() {\n currentUri.cueOut = entry.data;\n },\n 'cue-out-cont': function cueOutCont() {\n currentUri.cueOutCont = entry.data;\n },\n 'cue-in': function cueIn() {\n currentUri.cueIn = entry.data;\n }\n })[entry.tagType] || noop).call(self);\n },\n uri: function uri() {\n currentUri.uri = entry.uri;\n uris.push(currentUri);\n\n // if no explicit duration was declared, use the target duration\n if (this.manifest.targetDuration && !('duration' in currentUri)) {\n this.trigger('warn', {\n message: 'defaulting segment duration to the target duration'\n });\n currentUri.duration = this.manifest.targetDuration;\n }\n // annotate with encryption information, if necessary\n if (_key) {\n currentUri.key = _key;\n }\n currentUri.timeline = currentTimeline;\n // annotate with initialization segment information, if necessary\n if (currentMap) {\n currentUri.map = currentMap;\n }\n\n // prepare for the next URI\n currentUri = {};\n },\n comment: function comment() {\n // comments are not important for playback\n },\n custom: function custom() {\n // if this is segment-level data attach the output to the segment\n if (entry.segment) {\n currentUri.custom = currentUri.custom || {};\n currentUri.custom[entry.customType] = entry.data;\n // if this is manifest-level data attach to the top level manifest object\n } else {\n this.manifest.custom = this.manifest.custom || {};\n this.manifest.custom[entry.customType] = entry.data;\n }\n }\n })[entry.type].call(self);\n });\n return _this;\n }\n\n /**\n * Parse the input string and update the manifest object.\n *\n * @param {String} chunk a potentially incomplete portion of the manifest\n */\n\n\n Parser.prototype.push = function push(chunk) {\n this.lineStream.push(chunk);\n };\n\n /**\n * Flush any remaining input. This can be handy if the last line of an M3U8\n * manifest did not contain a trailing newline but the file has been\n * completely received.\n */\n\n\n Parser.prototype.end = function end() {\n // flush any buffered input\n this.lineStream.push('\\n');\n };\n /**\n * Add an additional parser for non-standard tags\n *\n * @param {Object} options a map of options for the added parser\n * @param {RegExp} options.expression a regular expression to match the custom header\n * @param {string} options.type the type to register to the output\n * @param {Function} [options.dataParser] function to parse the line into an object\n * @param {boolean} [options.segment] should tag data be attached to the segment object\n */\n\n\n Parser.prototype.addParser = function addParser(options) {\n this.parseStream.addParser(options);\n };\n\n return Parser;\n}(Stream);\n\n/**\n * @file m3u8/index.js\n *\n * Utilities for parsing M3U8 files. If the entire manifest is available,\n * `Parser` will create an object representation with enough detail for managing\n * playback. `ParseStream` and `LineStream` are lower-level parsing primitives\n * that do not assume the entirety of the manifest is ready and expose a\n * ReadableStream-like interface.\n */\n\nexport { LineStream, ParseStream, Parser };\n","/*! @name mpd-parser @version 0.7.0 @license Apache-2.0 */\nimport window$1 from 'global/window';\n\nvar version = \"0.7.0\";\n\nvar isObject = function isObject(obj) {\n return !!obj && typeof obj === 'object';\n};\n\nvar merge = function merge() {\n for (var _len = arguments.length, objects = new Array(_len), _key = 0; _key < _len; _key++) {\n objects[_key] = arguments[_key];\n }\n\n return objects.reduce(function (result, source) {\n Object.keys(source).forEach(function (key) {\n if (Array.isArray(result[key]) && Array.isArray(source[key])) {\n result[key] = result[key].concat(source[key]);\n } else if (isObject(result[key]) && isObject(source[key])) {\n result[key] = merge(result[key], source[key]);\n } else {\n result[key] = source[key];\n }\n });\n return result;\n }, {});\n};\nvar values = function values(o) {\n return Object.keys(o).map(function (k) {\n return o[k];\n });\n};\n\nvar range = function range(start, end) {\n var result = [];\n\n for (var i = start; i < end; i++) {\n result.push(i);\n }\n\n return result;\n};\nvar flatten = function flatten(lists) {\n return lists.reduce(function (x, y) {\n return x.concat(y);\n }, []);\n};\nvar from = function from(list) {\n if (!list.length) {\n return [];\n }\n\n var result = [];\n\n for (var i = 0; i < list.length; i++) {\n result.push(list[i]);\n }\n\n return result;\n};\nvar findIndexes = function findIndexes(l, key) {\n return l.reduce(function (a, e, i) {\n if (e[key]) {\n a.push(i);\n }\n\n return a;\n }, []);\n};\n\nvar mergeDiscontiguousPlaylists = function mergeDiscontiguousPlaylists(playlists) {\n var mergedPlaylists = values(playlists.reduce(function (acc, playlist) {\n // assuming playlist IDs are the same across periods\n // TODO: handle multiperiod where representation sets are not the same\n // across periods\n var name = playlist.attributes.id + (playlist.attributes.lang || ''); // Periods after first\n\n if (acc[name]) {\n var _acc$name$segments;\n\n // first segment of subsequent periods signal a discontinuity\n playlist.segments[0].discontinuity = true;\n\n (_acc$name$segments = acc[name].segments).push.apply(_acc$name$segments, playlist.segments); // bubble up contentProtection, this assumes all DRM content\n // has the same contentProtection\n\n\n if (playlist.attributes.contentProtection) {\n acc[name].attributes.contentProtection = playlist.attributes.contentProtection;\n }\n } else {\n // first Period\n acc[name] = playlist;\n }\n\n return acc;\n }, {}));\n return mergedPlaylists.map(function (playlist) {\n playlist.discontinuityStarts = findIndexes(playlist.segments, 'discontinuity');\n return playlist;\n });\n};\n\nvar formatAudioPlaylist = function formatAudioPlaylist(_ref) {\n var _attributes;\n\n var attributes = _ref.attributes,\n segments = _ref.segments;\n var playlist = {\n attributes: (_attributes = {\n NAME: attributes.id,\n BANDWIDTH: attributes.bandwidth,\n CODECS: attributes.codecs\n }, _attributes['PROGRAM-ID'] = 1, _attributes),\n uri: '',\n endList: (attributes.type || 'static') === 'static',\n timeline: attributes.periodIndex,\n resolvedUri: '',\n targetDuration: attributes.duration,\n segments: segments,\n mediaSequence: segments.length ? segments[0].number : 1\n };\n\n if (attributes.contentProtection) {\n playlist.contentProtection = attributes.contentProtection;\n }\n\n return playlist;\n};\nvar formatVttPlaylist = function formatVttPlaylist(_ref2) {\n var _attributes2;\n\n var attributes = _ref2.attributes,\n segments = _ref2.segments;\n\n if (typeof segments === 'undefined') {\n // vtt tracks may use single file in BaseURL\n segments = [{\n uri: attributes.baseUrl,\n timeline: attributes.periodIndex,\n resolvedUri: attributes.baseUrl || '',\n duration: attributes.sourceDuration,\n number: 0\n }]; // targetDuration should be the same duration as the only segment\n\n attributes.duration = attributes.sourceDuration;\n }\n\n return {\n attributes: (_attributes2 = {\n NAME: attributes.id,\n BANDWIDTH: attributes.bandwidth\n }, _attributes2['PROGRAM-ID'] = 1, _attributes2),\n uri: '',\n endList: (attributes.type || 'static') === 'static',\n timeline: attributes.periodIndex,\n resolvedUri: attributes.baseUrl || '',\n targetDuration: attributes.duration,\n segments: segments,\n mediaSequence: segments.length ? segments[0].number : 1\n };\n};\nvar organizeAudioPlaylists = function organizeAudioPlaylists(playlists) {\n return playlists.reduce(function (a, playlist) {\n var role = playlist.attributes.role && playlist.attributes.role.value || 'main';\n var language = playlist.attributes.lang || '';\n var label = 'main';\n\n if (language) {\n label = playlist.attributes.lang + \" (\" + role + \")\";\n } // skip if we already have the highest quality audio for a language\n\n\n if (a[label] && a[label].playlists[0].attributes.BANDWIDTH > playlist.attributes.bandwidth) {\n return a;\n }\n\n a[label] = {\n language: language,\n autoselect: true,\n default: role === 'main',\n playlists: [formatAudioPlaylist(playlist)],\n uri: ''\n };\n return a;\n }, {});\n};\nvar organizeVttPlaylists = function organizeVttPlaylists(playlists) {\n return playlists.reduce(function (a, playlist) {\n var label = playlist.attributes.lang || 'text'; // skip if we already have subtitles\n\n if (a[label]) {\n return a;\n }\n\n a[label] = {\n language: label,\n default: false,\n autoselect: false,\n playlists: [formatVttPlaylist(playlist)],\n uri: ''\n };\n return a;\n }, {});\n};\nvar formatVideoPlaylist = function formatVideoPlaylist(_ref3) {\n var _attributes3;\n\n var attributes = _ref3.attributes,\n segments = _ref3.segments;\n var playlist = {\n attributes: (_attributes3 = {\n NAME: attributes.id,\n AUDIO: 'audio',\n SUBTITLES: 'subs',\n RESOLUTION: {\n width: attributes.width,\n height: attributes.height\n },\n CODECS: attributes.codecs,\n BANDWIDTH: attributes.bandwidth\n }, _attributes3['PROGRAM-ID'] = 1, _attributes3),\n uri: '',\n endList: (attributes.type || 'static') === 'static',\n timeline: attributes.periodIndex,\n resolvedUri: '',\n targetDuration: attributes.duration,\n segments: segments,\n mediaSequence: segments.length ? segments[0].number : 1\n };\n\n if (attributes.contentProtection) {\n playlist.contentProtection = attributes.contentProtection;\n }\n\n return playlist;\n};\nvar toM3u8 = function toM3u8(dashPlaylists) {\n var _mediaGroups;\n\n if (!dashPlaylists.length) {\n return {};\n } // grab all master attributes\n\n\n var _dashPlaylists$0$attr = dashPlaylists[0].attributes,\n duration = _dashPlaylists$0$attr.sourceDuration,\n _dashPlaylists$0$attr2 = _dashPlaylists$0$attr.minimumUpdatePeriod,\n minimumUpdatePeriod = _dashPlaylists$0$attr2 === void 0 ? 0 : _dashPlaylists$0$attr2;\n\n var videoOnly = function videoOnly(_ref4) {\n var attributes = _ref4.attributes;\n return attributes.mimeType === 'video/mp4' || attributes.contentType === 'video';\n };\n\n var audioOnly = function audioOnly(_ref5) {\n var attributes = _ref5.attributes;\n return attributes.mimeType === 'audio/mp4' || attributes.contentType === 'audio';\n };\n\n var vttOnly = function vttOnly(_ref6) {\n var attributes = _ref6.attributes;\n return attributes.mimeType === 'text/vtt' || attributes.contentType === 'text';\n };\n\n var videoPlaylists = mergeDiscontiguousPlaylists(dashPlaylists.filter(videoOnly)).map(formatVideoPlaylist);\n var audioPlaylists = mergeDiscontiguousPlaylists(dashPlaylists.filter(audioOnly));\n var vttPlaylists = dashPlaylists.filter(vttOnly);\n var master = {\n allowCache: true,\n discontinuityStarts: [],\n segments: [],\n endList: true,\n mediaGroups: (_mediaGroups = {\n AUDIO: {},\n VIDEO: {}\n }, _mediaGroups['CLOSED-CAPTIONS'] = {}, _mediaGroups.SUBTITLES = {}, _mediaGroups),\n uri: '',\n duration: duration,\n playlists: videoPlaylists,\n minimumUpdatePeriod: minimumUpdatePeriod * 1000\n };\n\n if (audioPlaylists.length) {\n master.mediaGroups.AUDIO.audio = organizeAudioPlaylists(audioPlaylists);\n }\n\n if (vttPlaylists.length) {\n master.mediaGroups.SUBTITLES.subs = organizeVttPlaylists(vttPlaylists);\n }\n\n return master;\n};\n\nvar commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nfunction createCommonjsModule(fn, module) {\n\treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n}\n\nvar urlToolkit = createCommonjsModule(function (module, exports) {\n// see https://tools.ietf.org/html/rfc1808\n\n/* jshint ignore:start */\n(function(root) { \n/* jshint ignore:end */\n\n var URL_REGEX = /^((?:[a-zA-Z0-9+\\-.]+:)?)(\\/\\/[^\\/?#]*)?((?:[^\\/\\?#]*\\/)*.*?)??(;.*?)?(\\?.*?)?(#.*?)?$/;\n var FIRST_SEGMENT_REGEX = /^([^\\/?#]*)(.*)$/;\n var SLASH_DOT_REGEX = /(?:\\/|^)\\.(?=\\/)/g;\n var SLASH_DOT_DOT_REGEX = /(?:\\/|^)\\.\\.\\/(?!\\.\\.\\/).*?(?=\\/)/g;\n\n var URLToolkit = { // jshint ignore:line\n // If opts.alwaysNormalize is true then the path will always be normalized even when it starts with / or //\n // E.g\n // With opts.alwaysNormalize = false (default, spec compliant)\n // http://a.com/b/cd + /e/f/../g => http://a.com/e/f/../g\n // With opts.alwaysNormalize = true (not spec compliant)\n // http://a.com/b/cd + /e/f/../g => http://a.com/e/g\n buildAbsoluteURL: function(baseURL, relativeURL, opts) {\n opts = opts || {};\n // remove any remaining space and CRLF\n baseURL = baseURL.trim();\n relativeURL = relativeURL.trim();\n if (!relativeURL) {\n // 2a) If the embedded URL is entirely empty, it inherits the\n // entire base URL (i.e., is set equal to the base URL)\n // and we are done.\n if (!opts.alwaysNormalize) {\n return baseURL;\n }\n var basePartsForNormalise = URLToolkit.parseURL(baseURL);\n if (!basePartsForNormalise) {\n throw new Error('Error trying to parse base URL.');\n }\n basePartsForNormalise.path = URLToolkit.normalizePath(basePartsForNormalise.path);\n return URLToolkit.buildURLFromParts(basePartsForNormalise);\n }\n var relativeParts = URLToolkit.parseURL(relativeURL);\n if (!relativeParts) {\n throw new Error('Error trying to parse relative URL.');\n }\n if (relativeParts.scheme) {\n // 2b) If the embedded URL starts with a scheme name, it is\n // interpreted as an absolute URL and we are done.\n if (!opts.alwaysNormalize) {\n return relativeURL;\n }\n relativeParts.path = URLToolkit.normalizePath(relativeParts.path);\n return URLToolkit.buildURLFromParts(relativeParts);\n }\n var baseParts = URLToolkit.parseURL(baseURL);\n if (!baseParts) {\n throw new Error('Error trying to parse base URL.');\n }\n if (!baseParts.netLoc && baseParts.path && baseParts.path[0] !== '/') {\n // If netLoc missing and path doesn't start with '/', assume everthing before the first '/' is the netLoc\n // This causes 'example.com/a' to be handled as '//example.com/a' instead of '/example.com/a'\n var pathParts = FIRST_SEGMENT_REGEX.exec(baseParts.path);\n baseParts.netLoc = pathParts[1];\n baseParts.path = pathParts[2];\n }\n if (baseParts.netLoc && !baseParts.path) {\n baseParts.path = '/';\n }\n var builtParts = {\n // 2c) Otherwise, the embedded URL inherits the scheme of\n // the base URL.\n scheme: baseParts.scheme,\n netLoc: relativeParts.netLoc,\n path: null,\n params: relativeParts.params,\n query: relativeParts.query,\n fragment: relativeParts.fragment\n };\n if (!relativeParts.netLoc) {\n // 3) If the embedded URL's <net_loc> is non-empty, we skip to\n // Step 7. Otherwise, the embedded URL inherits the <net_loc>\n // (if any) of the base URL.\n builtParts.netLoc = baseParts.netLoc;\n // 4) If the embedded URL path is preceded by a slash \"/\", the\n // path is not relative and we skip to Step 7.\n if (relativeParts.path[0] !== '/') {\n if (!relativeParts.path) {\n // 5) If the embedded URL path is empty (and not preceded by a\n // slash), then the embedded URL inherits the base URL path\n builtParts.path = baseParts.path;\n // 5a) if the embedded URL's <params> is non-empty, we skip to\n // step 7; otherwise, it inherits the <params> of the base\n // URL (if any) and\n if (!relativeParts.params) {\n builtParts.params = baseParts.params;\n // 5b) if the embedded URL's <query> is non-empty, we skip to\n // step 7; otherwise, it inherits the <query> of the base\n // URL (if any) and we skip to step 7.\n if (!relativeParts.query) {\n builtParts.query = baseParts.query;\n }\n }\n } else {\n // 6) The last segment of the base URL's path (anything\n // following the rightmost slash \"/\", or the entire path if no\n // slash is present) is removed and the embedded URL's path is\n // appended in its place.\n var baseURLPath = baseParts.path;\n var newPath = baseURLPath.substring(0, baseURLPath.lastIndexOf('/') + 1) + relativeParts.path;\n builtParts.path = URLToolkit.normalizePath(newPath);\n }\n }\n }\n if (builtParts.path === null) {\n builtParts.path = opts.alwaysNormalize ? URLToolkit.normalizePath(relativeParts.path) : relativeParts.path;\n }\n return URLToolkit.buildURLFromParts(builtParts);\n },\n parseURL: function(url) {\n var parts = URL_REGEX.exec(url);\n if (!parts) {\n return null;\n }\n return {\n scheme: parts[1] || '',\n netLoc: parts[2] || '',\n path: parts[3] || '',\n params: parts[4] || '',\n query: parts[5] || '',\n fragment: parts[6] || ''\n };\n },\n normalizePath: function(path) {\n // The following operations are\n // then applied, in order, to the new path:\n // 6a) All occurrences of \"./\", where \".\" is a complete path\n // segment, are removed.\n // 6b) If the path ends with \".\" as a complete path segment,\n // that \".\" is removed.\n path = path.split('').reverse().join('').replace(SLASH_DOT_REGEX, '');\n // 6c) All occurrences of \"<segment>/../\", where <segment> is a\n // complete path segment not equal to \"..\", are removed.\n // Removal of these path segments is performed iteratively,\n // removing the leftmost matching pattern on each iteration,\n // until no matching pattern remains.\n // 6d) If the path ends with \"<segment>/..\", where <segment> is a\n // complete path segment not equal to \"..\", that\n // \"<segment>/..\" is removed.\n while (path.length !== (path = path.replace(SLASH_DOT_DOT_REGEX, '')).length) {} // jshint ignore:line\n return path.split('').reverse().join('');\n },\n buildURLFromParts: function(parts) {\n return parts.scheme + parts.netLoc + parts.path + parts.params + parts.query + parts.fragment;\n }\n };\n\n/* jshint ignore:start */\n module.exports = URLToolkit;\n})(commonjsGlobal);\n/* jshint ignore:end */\n});\n\nvar resolveUrl = function resolveUrl(baseUrl, relativeUrl) {\n // return early if we don't need to resolve\n if (/^[a-z]+:/i.test(relativeUrl)) {\n return relativeUrl;\n } // if the base URL is relative then combine with the current location\n\n\n if (!/\\/\\//i.test(baseUrl)) {\n baseUrl = urlToolkit.buildAbsoluteURL(window$1.location.href, baseUrl);\n }\n\n return urlToolkit.buildAbsoluteURL(baseUrl, relativeUrl);\n};\n\n/**\n * @typedef {Object} SingleUri\n * @property {string} uri - relative location of segment\n * @property {string} resolvedUri - resolved location of segment\n * @property {Object} byterange - Object containing information on how to make byte range\n * requests following byte-range-spec per RFC2616.\n * @property {String} byterange.length - length of range request\n * @property {String} byterange.offset - byte offset of range request\n *\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.1\n */\n\n/**\n * Converts a URLType node (5.3.9.2.3 Table 13) to a segment object\n * that conforms to how m3u8-parser is structured\n *\n * @see https://github.com/videojs/m3u8-parser\n *\n * @param {string} baseUrl - baseUrl provided by <BaseUrl> nodes\n * @param {string} source - source url for segment\n * @param {string} range - optional range used for range calls, follows\n * @return {SingleUri} full segment information transformed into a format similar\n * to m3u8-parser\n */\n\nvar urlTypeToSegment = function urlTypeToSegment(_ref) {\n var _ref$baseUrl = _ref.baseUrl,\n baseUrl = _ref$baseUrl === void 0 ? '' : _ref$baseUrl,\n _ref$source = _ref.source,\n source = _ref$source === void 0 ? '' : _ref$source,\n _ref$range = _ref.range,\n range = _ref$range === void 0 ? '' : _ref$range;\n var init = {\n uri: source,\n resolvedUri: resolveUrl(baseUrl || '', source)\n };\n\n if (range) {\n var ranges = range.split('-');\n var startRange = parseInt(ranges[0], 10);\n var endRange = parseInt(ranges[1], 10);\n init.byterange = {\n length: endRange - startRange,\n offset: startRange\n };\n }\n\n return init;\n};\n\n/**\n * Calculates the R (repetition) value for a live stream (for the final segment\n * in a manifest where the r value is negative 1)\n *\n * @param {Object} attributes\n * Object containing all inherited attributes from parent elements with attribute\n * names as keys\n * @param {number} time\n * current time (typically the total time up until the final segment)\n * @param {number} duration\n * duration property for the given <S />\n *\n * @return {number}\n * R value to reach the end of the given period\n */\nvar getLiveRValue = function getLiveRValue(attributes, time, duration) {\n var NOW = attributes.NOW,\n clientOffset = attributes.clientOffset,\n availabilityStartTime = attributes.availabilityStartTime,\n _attributes$timescale = attributes.timescale,\n timescale = _attributes$timescale === void 0 ? 1 : _attributes$timescale,\n _attributes$start = attributes.start,\n start = _attributes$start === void 0 ? 0 : _attributes$start,\n _attributes$minimumUp = attributes.minimumUpdatePeriod,\n minimumUpdatePeriod = _attributes$minimumUp === void 0 ? 0 : _attributes$minimumUp;\n var now = (NOW + clientOffset) / 1000;\n var periodStartWC = availabilityStartTime + start;\n var periodEndWC = now + minimumUpdatePeriod;\n var periodDuration = periodEndWC - periodStartWC;\n return Math.ceil((periodDuration * timescale - time) / duration);\n};\n/**\n * Uses information provided by SegmentTemplate.SegmentTimeline to determine segment\n * timing and duration\n *\n * @param {Object} attributes\n * Object containing all inherited attributes from parent elements with attribute\n * names as keys\n * @param {Object[]} segmentTimeline\n * List of objects representing the attributes of each S element contained within\n *\n * @return {{number: number, duration: number, time: number, timeline: number}[]}\n * List of Objects with segment timing and duration info\n */\n\n\nvar parseByTimeline = function parseByTimeline(attributes, segmentTimeline) {\n var _attributes$type = attributes.type,\n type = _attributes$type === void 0 ? 'static' : _attributes$type,\n _attributes$minimumUp2 = attributes.minimumUpdatePeriod,\n minimumUpdatePeriod = _attributes$minimumUp2 === void 0 ? 0 : _attributes$minimumUp2,\n _attributes$media = attributes.media,\n media = _attributes$media === void 0 ? '' : _attributes$media,\n sourceDuration = attributes.sourceDuration,\n _attributes$timescale2 = attributes.timescale,\n timescale = _attributes$timescale2 === void 0 ? 1 : _attributes$timescale2,\n _attributes$startNumb = attributes.startNumber,\n startNumber = _attributes$startNumb === void 0 ? 1 : _attributes$startNumb,\n timeline = attributes.periodIndex;\n var segments = [];\n var time = -1;\n\n for (var sIndex = 0; sIndex < segmentTimeline.length; sIndex++) {\n var S = segmentTimeline[sIndex];\n var duration = S.d;\n var repeat = S.r || 0;\n var segmentTime = S.t || 0;\n\n if (time < 0) {\n // first segment\n time = segmentTime;\n }\n\n if (segmentTime && segmentTime > time) {\n // discontinuity\n // TODO: How to handle this type of discontinuity\n // timeline++ here would treat it like HLS discontuity and content would\n // get appended without gap\n // E.G.\n // <S t=\"0\" d=\"1\" />\n // <S d=\"1\" />\n // <S d=\"1\" />\n // <S t=\"5\" d=\"1\" />\n // would have $Time$ values of [0, 1, 2, 5]\n // should this be appened at time positions [0, 1, 2, 3],(#EXT-X-DISCONTINUITY)\n // or [0, 1, 2, gap, gap, 5]? (#EXT-X-GAP)\n // does the value of sourceDuration consider this when calculating arbitrary\n // negative @r repeat value?\n // E.G. Same elements as above with this added at the end\n // <S d=\"1\" r=\"-1\" />\n // with a sourceDuration of 10\n // Would the 2 gaps be included in the time duration calculations resulting in\n // 8 segments with $Time$ values of [0, 1, 2, 5, 6, 7, 8, 9] or 10 segments\n // with $Time$ values of [0, 1, 2, 5, 6, 7, 8, 9, 10, 11] ?\n time = segmentTime;\n }\n\n var count = void 0;\n\n if (repeat < 0) {\n var nextS = sIndex + 1;\n\n if (nextS === segmentTimeline.length) {\n // last segment\n if (type === 'dynamic' && minimumUpdatePeriod > 0 && media.indexOf('$Number$') > 0) {\n count = getLiveRValue(attributes, time, duration);\n } else {\n // TODO: This may be incorrect depending on conclusion of TODO above\n count = (sourceDuration * timescale - time) / duration;\n }\n } else {\n count = (segmentTimeline[nextS].t - time) / duration;\n }\n } else {\n count = repeat + 1;\n }\n\n var end = startNumber + segments.length + count;\n var number = startNumber + segments.length;\n\n while (number < end) {\n segments.push({\n number: number,\n duration: duration / timescale,\n time: time,\n timeline: timeline\n });\n time += duration;\n number++;\n }\n }\n\n return segments;\n};\n\n/**\n * Functions for calculating the range of available segments in static and dynamic\n * manifests.\n */\n\nvar segmentRange = {\n /**\n * Returns the entire range of available segments for a static MPD\n *\n * @param {Object} attributes\n * Inheritied MPD attributes\n * @return {{ start: number, end: number }}\n * The start and end numbers for available segments\n */\n static: function _static(attributes) {\n var duration = attributes.duration,\n _attributes$timescale = attributes.timescale,\n timescale = _attributes$timescale === void 0 ? 1 : _attributes$timescale,\n sourceDuration = attributes.sourceDuration;\n return {\n start: 0,\n end: Math.ceil(sourceDuration / (duration / timescale))\n };\n },\n\n /**\n * Returns the current live window range of available segments for a dynamic MPD\n *\n * @param {Object} attributes\n * Inheritied MPD attributes\n * @return {{ start: number, end: number }}\n * The start and end numbers for available segments\n */\n dynamic: function dynamic(attributes) {\n var NOW = attributes.NOW,\n clientOffset = attributes.clientOffset,\n availabilityStartTime = attributes.availabilityStartTime,\n _attributes$timescale2 = attributes.timescale,\n timescale = _attributes$timescale2 === void 0 ? 1 : _attributes$timescale2,\n duration = attributes.duration,\n _attributes$start = attributes.start,\n start = _attributes$start === void 0 ? 0 : _attributes$start,\n _attributes$minimumUp = attributes.minimumUpdatePeriod,\n minimumUpdatePeriod = _attributes$minimumUp === void 0 ? 0 : _attributes$minimumUp,\n _attributes$timeShift = attributes.timeShiftBufferDepth,\n timeShiftBufferDepth = _attributes$timeShift === void 0 ? Infinity : _attributes$timeShift;\n var now = (NOW + clientOffset) / 1000;\n var periodStartWC = availabilityStartTime + start;\n var periodEndWC = now + minimumUpdatePeriod;\n var periodDuration = periodEndWC - periodStartWC;\n var segmentCount = Math.ceil(periodDuration * timescale / duration);\n var availableStart = Math.floor((now - periodStartWC - timeShiftBufferDepth) * timescale / duration);\n var availableEnd = Math.floor((now - periodStartWC) * timescale / duration);\n return {\n start: Math.max(0, availableStart),\n end: Math.min(segmentCount, availableEnd)\n };\n }\n};\n/**\n * Maps a range of numbers to objects with information needed to build the corresponding\n * segment list\n *\n * @name toSegmentsCallback\n * @function\n * @param {number} number\n * Number of the segment\n * @param {number} index\n * Index of the number in the range list\n * @return {{ number: Number, duration: Number, timeline: Number, time: Number }}\n * Object with segment timing and duration info\n */\n\n/**\n * Returns a callback for Array.prototype.map for mapping a range of numbers to\n * information needed to build the segment list.\n *\n * @param {Object} attributes\n * Inherited MPD attributes\n * @return {toSegmentsCallback}\n * Callback map function\n */\n\nvar toSegments = function toSegments(attributes) {\n return function (number, index) {\n var duration = attributes.duration,\n _attributes$timescale3 = attributes.timescale,\n timescale = _attributes$timescale3 === void 0 ? 1 : _attributes$timescale3,\n periodIndex = attributes.periodIndex,\n _attributes$startNumb = attributes.startNumber,\n startNumber = _attributes$startNumb === void 0 ? 1 : _attributes$startNumb;\n return {\n number: startNumber + number,\n duration: duration / timescale,\n timeline: periodIndex,\n time: index * duration\n };\n };\n};\n/**\n * Returns a list of objects containing segment timing and duration info used for\n * building the list of segments. This uses the @duration attribute specified\n * in the MPD manifest to derive the range of segments.\n *\n * @param {Object} attributes\n * Inherited MPD attributes\n * @return {{number: number, duration: number, time: number, timeline: number}[]}\n * List of Objects with segment timing and duration info\n */\n\nvar parseByDuration = function parseByDuration(attributes) {\n var _attributes$type = attributes.type,\n type = _attributes$type === void 0 ? 'static' : _attributes$type,\n duration = attributes.duration,\n _attributes$timescale4 = attributes.timescale,\n timescale = _attributes$timescale4 === void 0 ? 1 : _attributes$timescale4,\n sourceDuration = attributes.sourceDuration;\n\n var _segmentRange$type = segmentRange[type](attributes),\n start = _segmentRange$type.start,\n end = _segmentRange$type.end;\n\n var segments = range(start, end).map(toSegments(attributes));\n\n if (type === 'static') {\n var index = segments.length - 1; // final segment may be less than full segment duration\n\n segments[index].duration = sourceDuration - duration / timescale * index;\n }\n\n return segments;\n};\n\nvar identifierPattern = /\\$([A-z]*)(?:(%0)([0-9]+)d)?\\$/g;\n/**\n * Replaces template identifiers with corresponding values. To be used as the callback\n * for String.prototype.replace\n *\n * @name replaceCallback\n * @function\n * @param {string} match\n * Entire match of identifier\n * @param {string} identifier\n * Name of matched identifier\n * @param {string} format\n * Format tag string. Its presence indicates that padding is expected\n * @param {string} width\n * Desired length of the replaced value. Values less than this width shall be left\n * zero padded\n * @return {string}\n * Replacement for the matched identifier\n */\n\n/**\n * Returns a function to be used as a callback for String.prototype.replace to replace\n * template identifiers\n *\n * @param {Obect} values\n * Object containing values that shall be used to replace known identifiers\n * @param {number} values.RepresentationID\n * Value of the Representation@id attribute\n * @param {number} values.Number\n * Number of the corresponding segment\n * @param {number} values.Bandwidth\n * Value of the Representation@bandwidth attribute.\n * @param {number} values.Time\n * Timestamp value of the corresponding segment\n * @return {replaceCallback}\n * Callback to be used with String.prototype.replace to replace identifiers\n */\n\nvar identifierReplacement = function identifierReplacement(values) {\n return function (match, identifier, format, width) {\n if (match === '$$') {\n // escape sequence\n return '$';\n }\n\n if (typeof values[identifier] === 'undefined') {\n return match;\n }\n\n var value = '' + values[identifier];\n\n if (identifier === 'RepresentationID') {\n // Format tag shall not be present with RepresentationID\n return value;\n }\n\n if (!format) {\n width = 1;\n } else {\n width = parseInt(width, 10);\n }\n\n if (value.length >= width) {\n return value;\n }\n\n return \"\" + new Array(width - value.length + 1).join('0') + value;\n };\n};\n/**\n * Constructs a segment url from a template string\n *\n * @param {string} url\n * Template string to construct url from\n * @param {Obect} values\n * Object containing values that shall be used to replace known identifiers\n * @param {number} values.RepresentationID\n * Value of the Representation@id attribute\n * @param {number} values.Number\n * Number of the corresponding segment\n * @param {number} values.Bandwidth\n * Value of the Representation@bandwidth attribute.\n * @param {number} values.Time\n * Timestamp value of the corresponding segment\n * @return {string}\n * Segment url with identifiers replaced\n */\n\nvar constructTemplateUrl = function constructTemplateUrl(url, values) {\n return url.replace(identifierPattern, identifierReplacement(values));\n};\n/**\n * Generates a list of objects containing timing and duration information about each\n * segment needed to generate segment uris and the complete segment object\n *\n * @param {Object} attributes\n * Object containing all inherited attributes from parent elements with attribute\n * names as keys\n * @param {Object[]|undefined} segmentTimeline\n * List of objects representing the attributes of each S element contained within\n * the SegmentTimeline element\n * @return {{number: number, duration: number, time: number, timeline: number}[]}\n * List of Objects with segment timing and duration info\n */\n\nvar parseTemplateInfo = function parseTemplateInfo(attributes, segmentTimeline) {\n if (!attributes.duration && !segmentTimeline) {\n // if neither @duration or SegmentTimeline are present, then there shall be exactly\n // one media segment\n return [{\n number: attributes.startNumber || 1,\n duration: attributes.sourceDuration,\n time: 0,\n timeline: attributes.periodIndex\n }];\n }\n\n if (attributes.duration) {\n return parseByDuration(attributes);\n }\n\n return parseByTimeline(attributes, segmentTimeline);\n};\n/**\n * Generates a list of segments using information provided by the SegmentTemplate element\n *\n * @param {Object} attributes\n * Object containing all inherited attributes from parent elements with attribute\n * names as keys\n * @param {Object[]|undefined} segmentTimeline\n * List of objects representing the attributes of each S element contained within\n * the SegmentTimeline element\n * @return {Object[]}\n * List of segment objects\n */\n\nvar segmentsFromTemplate = function segmentsFromTemplate(attributes, segmentTimeline) {\n var templateValues = {\n RepresentationID: attributes.id,\n Bandwidth: attributes.bandwidth || 0\n };\n var _attributes$initializ = attributes.initialization,\n initialization = _attributes$initializ === void 0 ? {\n sourceURL: '',\n range: ''\n } : _attributes$initializ;\n var mapSegment = urlTypeToSegment({\n baseUrl: attributes.baseUrl,\n source: constructTemplateUrl(initialization.sourceURL, templateValues),\n range: initialization.range\n });\n var segments = parseTemplateInfo(attributes, segmentTimeline);\n return segments.map(function (segment) {\n templateValues.Number = segment.number;\n templateValues.Time = segment.time;\n var uri = constructTemplateUrl(attributes.media || '', templateValues);\n return {\n uri: uri,\n timeline: segment.timeline,\n duration: segment.duration,\n resolvedUri: resolveUrl(attributes.baseUrl || '', uri),\n map: mapSegment,\n number: segment.number\n };\n });\n};\n\nvar errors = {\n INVALID_NUMBER_OF_PERIOD: 'INVALID_NUMBER_OF_PERIOD',\n DASH_EMPTY_MANIFEST: 'DASH_EMPTY_MANIFEST',\n DASH_INVALID_XML: 'DASH_INVALID_XML',\n NO_BASE_URL: 'NO_BASE_URL',\n MISSING_SEGMENT_INFORMATION: 'MISSING_SEGMENT_INFORMATION',\n SEGMENT_TIME_UNSPECIFIED: 'SEGMENT_TIME_UNSPECIFIED',\n UNSUPPORTED_UTC_TIMING_SCHEME: 'UNSUPPORTED_UTC_TIMING_SCHEME'\n};\n\n/**\n * Converts a <SegmentUrl> (of type URLType from the DASH spec 5.3.9.2 Table 14)\n * to an object that matches the output of a segment in videojs/mpd-parser\n *\n * @param {Object} attributes\n * Object containing all inherited attributes from parent elements with attribute\n * names as keys\n * @param {Object} segmentUrl\n * <SegmentURL> node to translate into a segment object\n * @return {Object} translated segment object\n */\n\nvar SegmentURLToSegmentObject = function SegmentURLToSegmentObject(attributes, segmentUrl) {\n var baseUrl = attributes.baseUrl,\n _attributes$initializ = attributes.initialization,\n initialization = _attributes$initializ === void 0 ? {} : _attributes$initializ;\n var initSegment = urlTypeToSegment({\n baseUrl: baseUrl,\n source: initialization.sourceURL,\n range: initialization.range\n });\n var segment = urlTypeToSegment({\n baseUrl: baseUrl,\n source: segmentUrl.media,\n range: segmentUrl.mediaRange\n });\n segment.map = initSegment;\n return segment;\n};\n/**\n * Generates a list of segments using information provided by the SegmentList element\n * SegmentList (DASH SPEC Section 5.3.9.3.2) contains a set of <SegmentURL> nodes. Each\n * node should be translated into segment.\n *\n * @param {Object} attributes\n * Object containing all inherited attributes from parent elements with attribute\n * names as keys\n * @param {Object[]|undefined} segmentTimeline\n * List of objects representing the attributes of each S element contained within\n * the SegmentTimeline element\n * @return {Object.<Array>} list of segments\n */\n\n\nvar segmentsFromList = function segmentsFromList(attributes, segmentTimeline) {\n var duration = attributes.duration,\n _attributes$segmentUr = attributes.segmentUrls,\n segmentUrls = _attributes$segmentUr === void 0 ? [] : _attributes$segmentUr; // Per spec (5.3.9.2.1) no way to determine segment duration OR\n // if both SegmentTimeline and @duration are defined, it is outside of spec.\n\n if (!duration && !segmentTimeline || duration && segmentTimeline) {\n throw new Error(errors.SEGMENT_TIME_UNSPECIFIED);\n }\n\n var segmentUrlMap = segmentUrls.map(function (segmentUrlObject) {\n return SegmentURLToSegmentObject(attributes, segmentUrlObject);\n });\n var segmentTimeInfo;\n\n if (duration) {\n segmentTimeInfo = parseByDuration(attributes);\n }\n\n if (segmentTimeline) {\n segmentTimeInfo = parseByTimeline(attributes, segmentTimeline);\n }\n\n var segments = segmentTimeInfo.map(function (segmentTime, index) {\n if (segmentUrlMap[index]) {\n var segment = segmentUrlMap[index];\n segment.timeline = segmentTime.timeline;\n segment.duration = segmentTime.duration;\n segment.number = segmentTime.number;\n return segment;\n } // Since we're mapping we should get rid of any blank segments (in case\n // the given SegmentTimeline is handling for more elements than we have\n // SegmentURLs for).\n\n }).filter(function (segment) {\n return segment;\n });\n return segments;\n};\n\n/**\n * Translates SegmentBase into a set of segments.\n * (DASH SPEC Section 5.3.9.3.2) contains a set of <SegmentURL> nodes. Each\n * node should be translated into segment.\n *\n * @param {Object} attributes\n * Object containing all inherited attributes from parent elements with attribute\n * names as keys\n * @return {Object.<Array>} list of segments\n */\n\nvar segmentsFromBase = function segmentsFromBase(attributes) {\n var baseUrl = attributes.baseUrl,\n _attributes$initializ = attributes.initialization,\n initialization = _attributes$initializ === void 0 ? {} : _attributes$initializ,\n sourceDuration = attributes.sourceDuration,\n _attributes$timescale = attributes.timescale,\n timescale = _attributes$timescale === void 0 ? 1 : _attributes$timescale,\n _attributes$indexRang = attributes.indexRange,\n indexRange = _attributes$indexRang === void 0 ? '' : _attributes$indexRang,\n duration = attributes.duration; // base url is required for SegmentBase to work, per spec (Section 5.3.9.2.1)\n\n if (!baseUrl) {\n throw new Error(errors.NO_BASE_URL);\n }\n\n var initSegment = urlTypeToSegment({\n baseUrl: baseUrl,\n source: initialization.sourceURL,\n range: initialization.range\n });\n var segment = urlTypeToSegment({\n baseUrl: baseUrl,\n source: baseUrl,\n range: indexRange\n });\n segment.map = initSegment; // If there is a duration, use it, otherwise use the given duration of the source\n // (since SegmentBase is only for one total segment)\n\n if (duration) {\n var segmentTimeInfo = parseByDuration(attributes);\n\n if (segmentTimeInfo.length) {\n segment.duration = segmentTimeInfo[0].duration;\n segment.timeline = segmentTimeInfo[0].timeline;\n }\n } else if (sourceDuration) {\n segment.duration = sourceDuration / timescale;\n segment.timeline = 0;\n } // This is used for mediaSequence\n\n\n segment.number = 0;\n return [segment];\n};\n\nvar generateSegments = function generateSegments(_ref) {\n var attributes = _ref.attributes,\n segmentInfo = _ref.segmentInfo;\n var segmentAttributes;\n var segmentsFn;\n\n if (segmentInfo.template) {\n segmentsFn = segmentsFromTemplate;\n segmentAttributes = merge(attributes, segmentInfo.template);\n } else if (segmentInfo.base) {\n segmentsFn = segmentsFromBase;\n segmentAttributes = merge(attributes, segmentInfo.base);\n } else if (segmentInfo.list) {\n segmentsFn = segmentsFromList;\n segmentAttributes = merge(attributes, segmentInfo.list);\n }\n\n if (!segmentsFn) {\n return {\n attributes: attributes\n };\n }\n\n var segments = segmentsFn(segmentAttributes, segmentInfo.timeline); // The @duration attribute will be used to determin the playlist's targetDuration which\n // must be in seconds. Since we've generated the segment list, we no longer need\n // @duration to be in @timescale units, so we can convert it here.\n\n if (segmentAttributes.duration) {\n var _segmentAttributes = segmentAttributes,\n duration = _segmentAttributes.duration,\n _segmentAttributes$ti = _segmentAttributes.timescale,\n timescale = _segmentAttributes$ti === void 0 ? 1 : _segmentAttributes$ti;\n segmentAttributes.duration = duration / timescale;\n } else if (segments.length) {\n // if there is no @duration attribute, use the largest segment duration as\n // as target duration\n segmentAttributes.duration = segments.reduce(function (max, segment) {\n return Math.max(max, Math.ceil(segment.duration));\n }, 0);\n } else {\n segmentAttributes.duration = 0;\n }\n\n return {\n attributes: segmentAttributes,\n segments: segments\n };\n};\nvar toPlaylists = function toPlaylists(representations) {\n return representations.map(generateSegments);\n};\n\nvar findChildren = function findChildren(element, name) {\n return from(element.childNodes).filter(function (_ref) {\n var tagName = _ref.tagName;\n return tagName === name;\n });\n};\nvar getContent = function getContent(element) {\n return element.textContent.trim();\n};\n\nvar parseDuration = function parseDuration(str) {\n var SECONDS_IN_YEAR = 365 * 24 * 60 * 60;\n var SECONDS_IN_MONTH = 30 * 24 * 60 * 60;\n var SECONDS_IN_DAY = 24 * 60 * 60;\n var SECONDS_IN_HOUR = 60 * 60;\n var SECONDS_IN_MIN = 60; // P10Y10M10DT10H10M10.1S\n\n var durationRegex = /P(?:(\\d*)Y)?(?:(\\d*)M)?(?:(\\d*)D)?(?:T(?:(\\d*)H)?(?:(\\d*)M)?(?:([\\d.]*)S)?)?/;\n var match = durationRegex.exec(str);\n\n if (!match) {\n return 0;\n }\n\n var _match$slice = match.slice(1),\n year = _match$slice[0],\n month = _match$slice[1],\n day = _match$slice[2],\n hour = _match$slice[3],\n minute = _match$slice[4],\n second = _match$slice[5];\n\n return parseFloat(year || 0) * SECONDS_IN_YEAR + parseFloat(month || 0) * SECONDS_IN_MONTH + parseFloat(day || 0) * SECONDS_IN_DAY + parseFloat(hour || 0) * SECONDS_IN_HOUR + parseFloat(minute || 0) * SECONDS_IN_MIN + parseFloat(second || 0);\n};\nvar parseDate = function parseDate(str) {\n // Date format without timezone according to ISO 8601\n // YYY-MM-DDThh:mm:ss.ssssss\n var dateRegex = /^\\d+-\\d+-\\d+T\\d+:\\d+:\\d+(\\.\\d+)?$/; // If the date string does not specifiy a timezone, we must specifiy UTC. This is\n // expressed by ending with 'Z'\n\n if (dateRegex.test(str)) {\n str += 'Z';\n }\n\n return Date.parse(str);\n};\n\nvar parsers = {\n /**\n * Specifies the duration of the entire Media Presentation. Format is a duration string\n * as specified in ISO 8601\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The duration in seconds\n */\n mediaPresentationDuration: function mediaPresentationDuration(value) {\n return parseDuration(value);\n },\n\n /**\n * Specifies the Segment availability start time for all Segments referred to in this\n * MPD. For a dynamic manifest, it specifies the anchor for the earliest availability\n * time. Format is a date string as specified in ISO 8601\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The date as seconds from unix epoch\n */\n availabilityStartTime: function availabilityStartTime(value) {\n return parseDate(value) / 1000;\n },\n\n /**\n * Specifies the smallest period between potential changes to the MPD. Format is a\n * duration string as specified in ISO 8601\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The duration in seconds\n */\n minimumUpdatePeriod: function minimumUpdatePeriod(value) {\n return parseDuration(value);\n },\n\n /**\n * Specifies the duration of the smallest time shifting buffer for any Representation\n * in the MPD. Format is a duration string as specified in ISO 8601\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The duration in seconds\n */\n timeShiftBufferDepth: function timeShiftBufferDepth(value) {\n return parseDuration(value);\n },\n\n /**\n * Specifies the PeriodStart time of the Period relative to the availabilityStarttime.\n * Format is a duration string as specified in ISO 8601\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The duration in seconds\n */\n start: function start(value) {\n return parseDuration(value);\n },\n\n /**\n * Specifies the width of the visual presentation\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The parsed width\n */\n width: function width(value) {\n return parseInt(value, 10);\n },\n\n /**\n * Specifies the height of the visual presentation\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The parsed height\n */\n height: function height(value) {\n return parseInt(value, 10);\n },\n\n /**\n * Specifies the bitrate of the representation\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The parsed bandwidth\n */\n bandwidth: function bandwidth(value) {\n return parseInt(value, 10);\n },\n\n /**\n * Specifies the number of the first Media Segment in this Representation in the Period\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The parsed number\n */\n startNumber: function startNumber(value) {\n return parseInt(value, 10);\n },\n\n /**\n * Specifies the timescale in units per seconds\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The aprsed timescale\n */\n timescale: function timescale(value) {\n return parseInt(value, 10);\n },\n\n /**\n * Specifies the constant approximate Segment duration\n * NOTE: The <Period> element also contains an @duration attribute. This duration\n * specifies the duration of the Period. This attribute is currently not\n * supported by the rest of the parser, however we still check for it to prevent\n * errors.\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The parsed duration\n */\n duration: function duration(value) {\n var parsedValue = parseInt(value, 10);\n\n if (isNaN(parsedValue)) {\n return parseDuration(value);\n }\n\n return parsedValue;\n },\n\n /**\n * Specifies the Segment duration, in units of the value of the @timescale.\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The parsed duration\n */\n d: function d(value) {\n return parseInt(value, 10);\n },\n\n /**\n * Specifies the MPD start time, in @timescale units, the first Segment in the series\n * starts relative to the beginning of the Period\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The parsed time\n */\n t: function t(value) {\n return parseInt(value, 10);\n },\n\n /**\n * Specifies the repeat count of the number of following contiguous Segments with the\n * same duration expressed by the value of @d\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The parsed number\n */\n r: function r(value) {\n return parseInt(value, 10);\n },\n\n /**\n * Default parser for all other attributes. Acts as a no-op and just returns the value\n * as a string\n *\n * @param {string} value\n * value of attribute as a string\n * @return {string}\n * Unparsed value\n */\n DEFAULT: function DEFAULT(value) {\n return value;\n }\n};\n/**\n * Gets all the attributes and values of the provided node, parses attributes with known\n * types, and returns an object with attribute names mapped to values.\n *\n * @param {Node} el\n * The node to parse attributes from\n * @return {Object}\n * Object with all attributes of el parsed\n */\n\nvar parseAttributes = function parseAttributes(el) {\n if (!(el && el.attributes)) {\n return {};\n }\n\n return from(el.attributes).reduce(function (a, e) {\n var parseFn = parsers[e.name] || parsers.DEFAULT;\n a[e.name] = parseFn(e.value);\n return a;\n }, {});\n};\n\nfunction decodeB64ToUint8Array(b64Text) {\n var decodedString = window$1.atob(b64Text);\n var array = new Uint8Array(decodedString.length);\n\n for (var i = 0; i < decodedString.length; i++) {\n array[i] = decodedString.charCodeAt(i);\n }\n\n return array;\n}\n\nvar keySystemsMap = {\n 'urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b': 'org.w3.clearkey',\n 'urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed': 'com.widevine.alpha',\n 'urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95': 'com.microsoft.playready',\n 'urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb': 'com.adobe.primetime'\n};\n/**\n * Builds a list of urls that is the product of the reference urls and BaseURL values\n *\n * @param {string[]} referenceUrls\n * List of reference urls to resolve to\n * @param {Node[]} baseUrlElements\n * List of BaseURL nodes from the mpd\n * @return {string[]}\n * List of resolved urls\n */\n\nvar buildBaseUrls = function buildBaseUrls(referenceUrls, baseUrlElements) {\n if (!baseUrlElements.length) {\n return referenceUrls;\n }\n\n return flatten(referenceUrls.map(function (reference) {\n return baseUrlElements.map(function (baseUrlElement) {\n return resolveUrl(reference, getContent(baseUrlElement));\n });\n }));\n};\n/**\n * Contains all Segment information for its containing AdaptationSet\n *\n * @typedef {Object} SegmentInformation\n * @property {Object|undefined} template\n * Contains the attributes for the SegmentTemplate node\n * @property {Object[]|undefined} timeline\n * Contains a list of atrributes for each S node within the SegmentTimeline node\n * @property {Object|undefined} list\n * Contains the attributes for the SegmentList node\n * @property {Object|undefined} base\n * Contains the attributes for the SegmentBase node\n */\n\n/**\n * Returns all available Segment information contained within the AdaptationSet node\n *\n * @param {Node} adaptationSet\n * The AdaptationSet node to get Segment information from\n * @return {SegmentInformation}\n * The Segment information contained within the provided AdaptationSet\n */\n\nvar getSegmentInformation = function getSegmentInformation(adaptationSet) {\n var segmentTemplate = findChildren(adaptationSet, 'SegmentTemplate')[0];\n var segmentList = findChildren(adaptationSet, 'SegmentList')[0];\n var segmentUrls = segmentList && findChildren(segmentList, 'SegmentURL').map(function (s) {\n return merge({\n tag: 'SegmentURL'\n }, parseAttributes(s));\n });\n var segmentBase = findChildren(adaptationSet, 'SegmentBase')[0];\n var segmentTimelineParentNode = segmentList || segmentTemplate;\n var segmentTimeline = segmentTimelineParentNode && findChildren(segmentTimelineParentNode, 'SegmentTimeline')[0];\n var segmentInitializationParentNode = segmentList || segmentBase || segmentTemplate;\n var segmentInitialization = segmentInitializationParentNode && findChildren(segmentInitializationParentNode, 'Initialization')[0]; // SegmentTemplate is handled slightly differently, since it can have both\n // @initialization and an <Initialization> node. @initialization can be templated,\n // while the node can have a url and range specified. If the <SegmentTemplate> has\n // both @initialization and an <Initialization> subelement we opt to override with\n // the node, as this interaction is not defined in the spec.\n\n var template = segmentTemplate && parseAttributes(segmentTemplate);\n\n if (template && segmentInitialization) {\n template.initialization = segmentInitialization && parseAttributes(segmentInitialization);\n } else if (template && template.initialization) {\n // If it is @initialization we convert it to an object since this is the format that\n // later functions will rely on for the initialization segment. This is only valid\n // for <SegmentTemplate>\n template.initialization = {\n sourceURL: template.initialization\n };\n }\n\n var segmentInfo = {\n template: template,\n timeline: segmentTimeline && findChildren(segmentTimeline, 'S').map(function (s) {\n return parseAttributes(s);\n }),\n list: segmentList && merge(parseAttributes(segmentList), {\n segmentUrls: segmentUrls,\n initialization: parseAttributes(segmentInitialization)\n }),\n base: segmentBase && merge(parseAttributes(segmentBase), {\n initialization: parseAttributes(segmentInitialization)\n })\n };\n Object.keys(segmentInfo).forEach(function (key) {\n if (!segmentInfo[key]) {\n delete segmentInfo[key];\n }\n });\n return segmentInfo;\n};\n/**\n * Contains Segment information and attributes needed to construct a Playlist object\n * from a Representation\n *\n * @typedef {Object} RepresentationInformation\n * @property {SegmentInformation} segmentInfo\n * Segment information for this Representation\n * @property {Object} attributes\n * Inherited attributes for this Representation\n */\n\n/**\n * Maps a Representation node to an object containing Segment information and attributes\n *\n * @name inheritBaseUrlsCallback\n * @function\n * @param {Node} representation\n * Representation node from the mpd\n * @return {RepresentationInformation}\n * Representation information needed to construct a Playlist object\n */\n\n/**\n * Returns a callback for Array.prototype.map for mapping Representation nodes to\n * Segment information and attributes using inherited BaseURL nodes.\n *\n * @param {Object} adaptationSetAttributes\n * Contains attributes inherited by the AdaptationSet\n * @param {string[]} adaptationSetBaseUrls\n * Contains list of resolved base urls inherited by the AdaptationSet\n * @param {SegmentInformation} adaptationSetSegmentInfo\n * Contains Segment information for the AdaptationSet\n * @return {inheritBaseUrlsCallback}\n * Callback map function\n */\n\nvar inheritBaseUrls = function inheritBaseUrls(adaptationSetAttributes, adaptationSetBaseUrls, adaptationSetSegmentInfo) {\n return function (representation) {\n var repBaseUrlElements = findChildren(representation, 'BaseURL');\n var repBaseUrls = buildBaseUrls(adaptationSetBaseUrls, repBaseUrlElements);\n var attributes = merge(adaptationSetAttributes, parseAttributes(representation));\n var representationSegmentInfo = getSegmentInformation(representation);\n return repBaseUrls.map(function (baseUrl) {\n return {\n segmentInfo: merge(adaptationSetSegmentInfo, representationSegmentInfo),\n attributes: merge(attributes, {\n baseUrl: baseUrl\n })\n };\n });\n };\n};\n/**\n * Tranforms a series of content protection nodes to\n * an object containing pssh data by key system\n *\n * @param {Node[]} contentProtectionNodes\n * Content protection nodes\n * @return {Object}\n * Object containing pssh data by key system\n */\n\nvar generateKeySystemInformation = function generateKeySystemInformation(contentProtectionNodes) {\n return contentProtectionNodes.reduce(function (acc, node) {\n var attributes = parseAttributes(node);\n var keySystem = keySystemsMap[attributes.schemeIdUri];\n\n if (keySystem) {\n acc[keySystem] = {\n attributes: attributes\n };\n var psshNode = findChildren(node, 'cenc:pssh')[0];\n\n if (psshNode) {\n var pssh = getContent(psshNode);\n var psshBuffer = pssh && decodeB64ToUint8Array(pssh);\n acc[keySystem].pssh = psshBuffer;\n }\n }\n\n return acc;\n }, {});\n};\n/**\n * Maps an AdaptationSet node to a list of Representation information objects\n *\n * @name toRepresentationsCallback\n * @function\n * @param {Node} adaptationSet\n * AdaptationSet node from the mpd\n * @return {RepresentationInformation[]}\n * List of objects containing Representaion information\n */\n\n/**\n * Returns a callback for Array.prototype.map for mapping AdaptationSet nodes to a list of\n * Representation information objects\n *\n * @param {Object} periodAttributes\n * Contains attributes inherited by the Period\n * @param {string[]} periodBaseUrls\n * Contains list of resolved base urls inherited by the Period\n * @param {string[]} periodSegmentInfo\n * Contains Segment Information at the period level\n * @return {toRepresentationsCallback}\n * Callback map function\n */\n\n\nvar toRepresentations = function toRepresentations(periodAttributes, periodBaseUrls, periodSegmentInfo) {\n return function (adaptationSet) {\n var adaptationSetAttributes = parseAttributes(adaptationSet);\n var adaptationSetBaseUrls = buildBaseUrls(periodBaseUrls, findChildren(adaptationSet, 'BaseURL'));\n var role = findChildren(adaptationSet, 'Role')[0];\n var roleAttributes = {\n role: parseAttributes(role)\n };\n var attrs = merge(periodAttributes, adaptationSetAttributes, roleAttributes);\n var contentProtection = generateKeySystemInformation(findChildren(adaptationSet, 'ContentProtection'));\n\n if (Object.keys(contentProtection).length) {\n attrs = merge(attrs, {\n contentProtection: contentProtection\n });\n }\n\n var segmentInfo = getSegmentInformation(adaptationSet);\n var representations = findChildren(adaptationSet, 'Representation');\n var adaptationSetSegmentInfo = merge(periodSegmentInfo, segmentInfo);\n return flatten(representations.map(inheritBaseUrls(attrs, adaptationSetBaseUrls, adaptationSetSegmentInfo)));\n };\n};\n/**\n * Maps an Period node to a list of Representation inforamtion objects for all\n * AdaptationSet nodes contained within the Period\n *\n * @name toAdaptationSetsCallback\n * @function\n * @param {Node} period\n * Period node from the mpd\n * @param {number} periodIndex\n * Index of the Period within the mpd\n * @return {RepresentationInformation[]}\n * List of objects containing Representaion information\n */\n\n/**\n * Returns a callback for Array.prototype.map for mapping Period nodes to a list of\n * Representation information objects\n *\n * @param {Object} mpdAttributes\n * Contains attributes inherited by the mpd\n * @param {string[]} mpdBaseUrls\n * Contains list of resolved base urls inherited by the mpd\n * @return {toAdaptationSetsCallback}\n * Callback map function\n */\n\nvar toAdaptationSets = function toAdaptationSets(mpdAttributes, mpdBaseUrls) {\n return function (period, index) {\n var periodBaseUrls = buildBaseUrls(mpdBaseUrls, findChildren(period, 'BaseURL'));\n var periodAtt = parseAttributes(period);\n var parsedPeriodId = parseInt(periodAtt.id, 10); // fallback to mapping index if Period@id is not a number\n\n var periodIndex = window$1.isNaN(parsedPeriodId) ? index : parsedPeriodId;\n var periodAttributes = merge(mpdAttributes, {\n periodIndex: periodIndex\n });\n var adaptationSets = findChildren(period, 'AdaptationSet');\n var periodSegmentInfo = getSegmentInformation(period);\n return flatten(adaptationSets.map(toRepresentations(periodAttributes, periodBaseUrls, periodSegmentInfo)));\n };\n};\n/**\n * Traverses the mpd xml tree to generate a list of Representation information objects\n * that have inherited attributes from parent nodes\n *\n * @param {Node} mpd\n * The root node of the mpd\n * @param {Object} options\n * Available options for inheritAttributes\n * @param {string} options.manifestUri\n * The uri source of the mpd\n * @param {number} options.NOW\n * Current time per DASH IOP. Default is current time in ms since epoch\n * @param {number} options.clientOffset\n * Client time difference from NOW (in milliseconds)\n * @return {RepresentationInformation[]}\n * List of objects containing Representation information\n */\n\nvar inheritAttributes = function inheritAttributes(mpd, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$manifestUri = _options.manifestUri,\n manifestUri = _options$manifestUri === void 0 ? '' : _options$manifestUri,\n _options$NOW = _options.NOW,\n NOW = _options$NOW === void 0 ? Date.now() : _options$NOW,\n _options$clientOffset = _options.clientOffset,\n clientOffset = _options$clientOffset === void 0 ? 0 : _options$clientOffset;\n var periods = findChildren(mpd, 'Period');\n\n if (!periods.length) {\n throw new Error(errors.INVALID_NUMBER_OF_PERIOD);\n }\n\n var mpdAttributes = parseAttributes(mpd);\n var mpdBaseUrls = buildBaseUrls([manifestUri], findChildren(mpd, 'BaseURL'));\n mpdAttributes.sourceDuration = mpdAttributes.mediaPresentationDuration || 0;\n mpdAttributes.NOW = NOW;\n mpdAttributes.clientOffset = clientOffset;\n return flatten(periods.map(toAdaptationSets(mpdAttributes, mpdBaseUrls)));\n};\n\nvar stringToMpdXml = function stringToMpdXml(manifestString) {\n if (manifestString === '') {\n throw new Error(errors.DASH_EMPTY_MANIFEST);\n }\n\n var parser = new window$1.DOMParser();\n var xml = parser.parseFromString(manifestString, 'application/xml');\n var mpd = xml && xml.documentElement.tagName === 'MPD' ? xml.documentElement : null;\n\n if (!mpd || mpd && mpd.getElementsByTagName('parsererror').length > 0) {\n throw new Error(errors.DASH_INVALID_XML);\n }\n\n return mpd;\n};\n\n/**\n * Parses the manifest for a UTCTiming node, returning the nodes attributes if found\n *\n * @param {string} mpd\n * XML string of the MPD manifest\n * @return {Object|null}\n * Attributes of UTCTiming node specified in the manifest. Null if none found\n */\n\nvar parseUTCTimingScheme = function parseUTCTimingScheme(mpd) {\n var UTCTimingNode = findChildren(mpd, 'UTCTiming')[0];\n\n if (!UTCTimingNode) {\n return null;\n }\n\n var attributes = parseAttributes(UTCTimingNode);\n\n switch (attributes.schemeIdUri) {\n case 'urn:mpeg:dash:utc:http-head:2014':\n case 'urn:mpeg:dash:utc:http-head:2012':\n attributes.method = 'HEAD';\n break;\n\n case 'urn:mpeg:dash:utc:http-xsdate:2014':\n case 'urn:mpeg:dash:utc:http-iso:2014':\n case 'urn:mpeg:dash:utc:http-xsdate:2012':\n case 'urn:mpeg:dash:utc:http-iso:2012':\n attributes.method = 'GET';\n break;\n\n case 'urn:mpeg:dash:utc:direct:2014':\n case 'urn:mpeg:dash:utc:direct:2012':\n attributes.method = 'DIRECT';\n attributes.value = Date.parse(attributes.value);\n break;\n\n case 'urn:mpeg:dash:utc:http-ntp:2014':\n case 'urn:mpeg:dash:utc:ntp:2014':\n case 'urn:mpeg:dash:utc:sntp:2014':\n default:\n throw new Error(errors.UNSUPPORTED_UTC_TIMING_SCHEME);\n }\n\n return attributes;\n};\n\nvar VERSION = version;\nvar parse = function parse(manifestString, options) {\n return toM3u8(toPlaylists(inheritAttributes(stringToMpdXml(manifestString), options)));\n};\n/**\n * Parses the manifest for a UTCTiming node, returning the nodes attributes if found\n *\n * @param {string} manifestString\n * XML string of the MPD manifest\n * @return {Object|null}\n * Attributes of UTCTiming node specified in the manifest. Null if none found\n */\n\nvar parseUTCTiming = function parseUTCTiming(manifestString) {\n return parseUTCTimingScheme(stringToMpdXml(manifestString));\n};\n\nexport { VERSION, parse, parseUTCTiming };\n","/*\n * pkcs7.pad\n * https://github.com/brightcove/pkcs7\n *\n * Copyright (c) 2014 Brightcove\n * Licensed under the apache2 license.\n */\n\nvar PADDING = void 0;\n\n/**\n * Returns a new Uint8Array that is padded with PKCS#7 padding.\n * @param plaintext {Uint8Array} the input bytes before encryption\n * @return {Uint8Array} the padded bytes\n * @see http://tools.ietf.org/html/rfc5652\n */\nfunction pad(plaintext) {\n var padding = PADDING[plaintext.byteLength % 16 || 0];\n var result = new Uint8Array(plaintext.byteLength + padding.length);\n\n result.set(plaintext);\n result.set(padding, plaintext.byteLength);\n\n return result;\n}\n\n// pre-define the padding values\nPADDING = [[16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16], [15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15], [14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14], [13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13], [12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12], [11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11], [10, 10, 10, 10, 10, 10, 10, 10, 10, 10], [9, 9, 9, 9, 9, 9, 9, 9, 9], [8, 8, 8, 8, 8, 8, 8, 8], [7, 7, 7, 7, 7, 7, 7], [6, 6, 6, 6, 6, 6], [5, 5, 5, 5, 5], [4, 4, 4, 4], [3, 3, 3], [2, 2], [1]];\n\n/**\n * Returns the subarray of a Uint8Array without PKCS#7 padding.\n * @param padded {Uint8Array} unencrypted bytes that have been padded\n * @return {Uint8Array} the unpadded bytes\n * @see http://tools.ietf.org/html/rfc5652\n */\nfunction unpad(padded) {\n return padded.subarray(0, padded.byteLength - padded[padded.byteLength - 1]);\n}\n\nvar version = \"1.0.2\";\n\nexport { pad, unpad, version as VERSION };\n","import { unpad } from 'pkcs7';\n\nvar classCallCheck = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};\n\nvar createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\n\n\n\n\n\n\n\n\nvar inherits = function (subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n};\n\n\n\n\n\n\n\n\n\n\n\nvar possibleConstructorReturn = function (self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n};\n\n/**\n * @file aes.js\n *\n * This file contains an adaptation of the AES decryption algorithm\n * from the Standford Javascript Cryptography Library. That work is\n * covered by the following copyright and permissions notice:\n *\n * Copyright 2009-2010 Emily Stark, Mike Hamburg, Dan Boneh.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following\n * disclaimer in the documentation and/or other materials provided\n * with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * The views and conclusions contained in the software and documentation\n * are those of the authors and should not be interpreted as representing\n * official policies, either expressed or implied, of the authors.\n */\n\n/**\n * Expand the S-box tables.\n *\n * @private\n */\nvar precompute = function precompute() {\n var tables = [[[], [], [], [], []], [[], [], [], [], []]];\n var encTable = tables[0];\n var decTable = tables[1];\n var sbox = encTable[4];\n var sboxInv = decTable[4];\n var i = void 0;\n var x = void 0;\n var xInv = void 0;\n var d = [];\n var th = [];\n var x2 = void 0;\n var x4 = void 0;\n var x8 = void 0;\n var s = void 0;\n var tEnc = void 0;\n var tDec = void 0;\n\n // Compute double and third tables\n for (i = 0; i < 256; i++) {\n th[(d[i] = i << 1 ^ (i >> 7) * 283) ^ i] = i;\n }\n\n for (x = xInv = 0; !sbox[x]; x ^= x2 || 1, xInv = th[xInv] || 1) {\n // Compute sbox\n s = xInv ^ xInv << 1 ^ xInv << 2 ^ xInv << 3 ^ xInv << 4;\n s = s >> 8 ^ s & 255 ^ 99;\n sbox[x] = s;\n sboxInv[s] = x;\n\n // Compute MixColumns\n x8 = d[x4 = d[x2 = d[x]]];\n tDec = x8 * 0x1010101 ^ x4 * 0x10001 ^ x2 * 0x101 ^ x * 0x1010100;\n tEnc = d[s] * 0x101 ^ s * 0x1010100;\n\n for (i = 0; i < 4; i++) {\n encTable[i][x] = tEnc = tEnc << 24 ^ tEnc >>> 8;\n decTable[i][s] = tDec = tDec << 24 ^ tDec >>> 8;\n }\n }\n\n // Compactify. Considerable speedup on Firefox.\n for (i = 0; i < 5; i++) {\n encTable[i] = encTable[i].slice(0);\n decTable[i] = decTable[i].slice(0);\n }\n return tables;\n};\nvar aesTables = null;\n\n/**\n * Schedule out an AES key for both encryption and decryption. This\n * is a low-level class. Use a cipher mode to do bulk encryption.\n *\n * @class AES\n * @param key {Array} The key as an array of 4, 6 or 8 words.\n */\n\nvar AES = function () {\n function AES(key) {\n classCallCheck(this, AES);\n\n /**\n * The expanded S-box and inverse S-box tables. These will be computed\n * on the client so that we don't have to send them down the wire.\n *\n * There are two tables, _tables[0] is for encryption and\n * _tables[1] is for decryption.\n *\n * The first 4 sub-tables are the expanded S-box with MixColumns. The\n * last (_tables[01][4]) is the S-box itself.\n *\n * @private\n */\n // if we have yet to precompute the S-box tables\n // do so now\n if (!aesTables) {\n aesTables = precompute();\n }\n // then make a copy of that object for use\n this._tables = [[aesTables[0][0].slice(), aesTables[0][1].slice(), aesTables[0][2].slice(), aesTables[0][3].slice(), aesTables[0][4].slice()], [aesTables[1][0].slice(), aesTables[1][1].slice(), aesTables[1][2].slice(), aesTables[1][3].slice(), aesTables[1][4].slice()]];\n var i = void 0;\n var j = void 0;\n var tmp = void 0;\n var encKey = void 0;\n var decKey = void 0;\n var sbox = this._tables[0][4];\n var decTable = this._tables[1];\n var keyLen = key.length;\n var rcon = 1;\n\n if (keyLen !== 4 && keyLen !== 6 && keyLen !== 8) {\n throw new Error('Invalid aes key size');\n }\n\n encKey = key.slice(0);\n decKey = [];\n this._key = [encKey, decKey];\n\n // schedule encryption keys\n for (i = keyLen; i < 4 * keyLen + 28; i++) {\n tmp = encKey[i - 1];\n\n // apply sbox\n if (i % keyLen === 0 || keyLen === 8 && i % keyLen === 4) {\n tmp = sbox[tmp >>> 24] << 24 ^ sbox[tmp >> 16 & 255] << 16 ^ sbox[tmp >> 8 & 255] << 8 ^ sbox[tmp & 255];\n\n // shift rows and add rcon\n if (i % keyLen === 0) {\n tmp = tmp << 8 ^ tmp >>> 24 ^ rcon << 24;\n rcon = rcon << 1 ^ (rcon >> 7) * 283;\n }\n }\n\n encKey[i] = encKey[i - keyLen] ^ tmp;\n }\n\n // schedule decryption keys\n for (j = 0; i; j++, i--) {\n tmp = encKey[j & 3 ? i : i - 4];\n if (i <= 4 || j < 4) {\n decKey[j] = tmp;\n } else {\n decKey[j] = decTable[0][sbox[tmp >>> 24]] ^ decTable[1][sbox[tmp >> 16 & 255]] ^ decTable[2][sbox[tmp >> 8 & 255]] ^ decTable[3][sbox[tmp & 255]];\n }\n }\n }\n\n /**\n * Decrypt 16 bytes, specified as four 32-bit words.\n *\n * @param {Number} encrypted0 the first word to decrypt\n * @param {Number} encrypted1 the second word to decrypt\n * @param {Number} encrypted2 the third word to decrypt\n * @param {Number} encrypted3 the fourth word to decrypt\n * @param {Int32Array} out the array to write the decrypted words\n * into\n * @param {Number} offset the offset into the output array to start\n * writing results\n * @return {Array} The plaintext.\n */\n\n\n AES.prototype.decrypt = function decrypt(encrypted0, encrypted1, encrypted2, encrypted3, out, offset) {\n var key = this._key[1];\n // state variables a,b,c,d are loaded with pre-whitened data\n var a = encrypted0 ^ key[0];\n var b = encrypted3 ^ key[1];\n var c = encrypted2 ^ key[2];\n var d = encrypted1 ^ key[3];\n var a2 = void 0;\n var b2 = void 0;\n var c2 = void 0;\n\n // key.length === 2 ?\n var nInnerRounds = key.length / 4 - 2;\n var i = void 0;\n var kIndex = 4;\n var table = this._tables[1];\n\n // load up the tables\n var table0 = table[0];\n var table1 = table[1];\n var table2 = table[2];\n var table3 = table[3];\n var sbox = table[4];\n\n // Inner rounds. Cribbed from OpenSSL.\n for (i = 0; i < nInnerRounds; i++) {\n a2 = table0[a >>> 24] ^ table1[b >> 16 & 255] ^ table2[c >> 8 & 255] ^ table3[d & 255] ^ key[kIndex];\n b2 = table0[b >>> 24] ^ table1[c >> 16 & 255] ^ table2[d >> 8 & 255] ^ table3[a & 255] ^ key[kIndex + 1];\n c2 = table0[c >>> 24] ^ table1[d >> 16 & 255] ^ table2[a >> 8 & 255] ^ table3[b & 255] ^ key[kIndex + 2];\n d = table0[d >>> 24] ^ table1[a >> 16 & 255] ^ table2[b >> 8 & 255] ^ table3[c & 255] ^ key[kIndex + 3];\n kIndex += 4;\n a = a2;b = b2;c = c2;\n }\n\n // Last round.\n for (i = 0; i < 4; i++) {\n out[(3 & -i) + offset] = sbox[a >>> 24] << 24 ^ sbox[b >> 16 & 255] << 16 ^ sbox[c >> 8 & 255] << 8 ^ sbox[d & 255] ^ key[kIndex++];\n a2 = a;a = b;b = c;c = d;d = a2;\n }\n };\n\n return AES;\n}();\n\n/**\n * @file stream.js\n */\n/**\n * A lightweight readable stream implemention that handles event dispatching.\n *\n * @class Stream\n */\nvar Stream = function () {\n function Stream() {\n classCallCheck(this, Stream);\n\n this.listeners = {};\n }\n\n /**\n * Add a listener for a specified event type.\n *\n * @param {String} type the event name\n * @param {Function} listener the callback to be invoked when an event of\n * the specified type occurs\n */\n\n\n Stream.prototype.on = function on(type, listener) {\n if (!this.listeners[type]) {\n this.listeners[type] = [];\n }\n this.listeners[type].push(listener);\n };\n\n /**\n * Remove a listener for a specified event type.\n *\n * @param {String} type the event name\n * @param {Function} listener a function previously registered for this\n * type of event through `on`\n * @return {Boolean} if we could turn it off or not\n */\n\n\n Stream.prototype.off = function off(type, listener) {\n if (!this.listeners[type]) {\n return false;\n }\n\n var index = this.listeners[type].indexOf(listener);\n\n this.listeners[type].splice(index, 1);\n return index > -1;\n };\n\n /**\n * Trigger an event of the specified type on this stream. Any additional\n * arguments to this function are passed as parameters to event listeners.\n *\n * @param {String} type the event name\n */\n\n\n Stream.prototype.trigger = function trigger(type) {\n var callbacks = this.listeners[type];\n\n if (!callbacks) {\n return;\n }\n\n // Slicing the arguments on every invocation of this method\n // can add a significant amount of overhead. Avoid the\n // intermediate object creation for the common case of a\n // single callback argument\n if (arguments.length === 2) {\n var length = callbacks.length;\n\n for (var i = 0; i < length; ++i) {\n callbacks[i].call(this, arguments[1]);\n }\n } else {\n var args = Array.prototype.slice.call(arguments, 1);\n var _length = callbacks.length;\n\n for (var _i = 0; _i < _length; ++_i) {\n callbacks[_i].apply(this, args);\n }\n }\n };\n\n /**\n * Destroys the stream and cleans up.\n */\n\n\n Stream.prototype.dispose = function dispose() {\n this.listeners = {};\n };\n /**\n * Forwards all `data` events on this stream to the destination stream. The\n * destination stream should provide a method `push` to receive the data\n * events as they arrive.\n *\n * @param {Stream} destination the stream that will receive all `data` events\n * @see http://nodejs.org/api/stream.html#stream_readable_pipe_destination_options\n */\n\n\n Stream.prototype.pipe = function pipe(destination) {\n this.on('data', function (data) {\n destination.push(data);\n });\n };\n\n return Stream;\n}();\n\n/**\n * @file async-stream.js\n */\n/**\n * A wrapper around the Stream class to use setTiemout\n * and run stream \"jobs\" Asynchronously\n *\n * @class AsyncStream\n * @extends Stream\n */\n\nvar AsyncStream = function (_Stream) {\n inherits(AsyncStream, _Stream);\n\n function AsyncStream() {\n classCallCheck(this, AsyncStream);\n\n var _this = possibleConstructorReturn(this, _Stream.call(this, Stream));\n\n _this.jobs = [];\n _this.delay = 1;\n _this.timeout_ = null;\n return _this;\n }\n\n /**\n * process an async job\n *\n * @private\n */\n\n\n AsyncStream.prototype.processJob_ = function processJob_() {\n this.jobs.shift()();\n if (this.jobs.length) {\n this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay);\n } else {\n this.timeout_ = null;\n }\n };\n\n /**\n * push a job into the stream\n *\n * @param {Function} job the job to push into the stream\n */\n\n\n AsyncStream.prototype.push = function push(job) {\n this.jobs.push(job);\n if (!this.timeout_) {\n this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay);\n }\n };\n\n return AsyncStream;\n}(Stream);\n\n/**\n * @file decrypter.js\n *\n * An asynchronous implementation of AES-128 CBC decryption with\n * PKCS#7 padding.\n */\n\n/**\n * Convert network-order (big-endian) bytes into their little-endian\n * representation.\n */\nvar ntoh = function ntoh(word) {\n return word << 24 | (word & 0xff00) << 8 | (word & 0xff0000) >> 8 | word >>> 24;\n};\n\n/**\n * Decrypt bytes using AES-128 with CBC and PKCS#7 padding.\n *\n * @param {Uint8Array} encrypted the encrypted bytes\n * @param {Uint32Array} key the bytes of the decryption key\n * @param {Uint32Array} initVector the initialization vector (IV) to\n * use for the first round of CBC.\n * @return {Uint8Array} the decrypted bytes\n *\n * @see http://en.wikipedia.org/wiki/Advanced_Encryption_Standard\n * @see http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Cipher_Block_Chaining_.28CBC.29\n * @see https://tools.ietf.org/html/rfc2315\n */\nvar decrypt = function decrypt(encrypted, key, initVector) {\n // word-level access to the encrypted bytes\n var encrypted32 = new Int32Array(encrypted.buffer, encrypted.byteOffset, encrypted.byteLength >> 2);\n\n var decipher = new AES(Array.prototype.slice.call(key));\n\n // byte and word-level access for the decrypted output\n var decrypted = new Uint8Array(encrypted.byteLength);\n var decrypted32 = new Int32Array(decrypted.buffer);\n\n // temporary variables for working with the IV, encrypted, and\n // decrypted data\n var init0 = void 0;\n var init1 = void 0;\n var init2 = void 0;\n var init3 = void 0;\n var encrypted0 = void 0;\n var encrypted1 = void 0;\n var encrypted2 = void 0;\n var encrypted3 = void 0;\n\n // iteration variable\n var wordIx = void 0;\n\n // pull out the words of the IV to ensure we don't modify the\n // passed-in reference and easier access\n init0 = initVector[0];\n init1 = initVector[1];\n init2 = initVector[2];\n init3 = initVector[3];\n\n // decrypt four word sequences, applying cipher-block chaining (CBC)\n // to each decrypted block\n for (wordIx = 0; wordIx < encrypted32.length; wordIx += 4) {\n // convert big-endian (network order) words into little-endian\n // (javascript order)\n encrypted0 = ntoh(encrypted32[wordIx]);\n encrypted1 = ntoh(encrypted32[wordIx + 1]);\n encrypted2 = ntoh(encrypted32[wordIx + 2]);\n encrypted3 = ntoh(encrypted32[wordIx + 3]);\n\n // decrypt the block\n decipher.decrypt(encrypted0, encrypted1, encrypted2, encrypted3, decrypted32, wordIx);\n\n // XOR with the IV, and restore network byte-order to obtain the\n // plaintext\n decrypted32[wordIx] = ntoh(decrypted32[wordIx] ^ init0);\n decrypted32[wordIx + 1] = ntoh(decrypted32[wordIx + 1] ^ init1);\n decrypted32[wordIx + 2] = ntoh(decrypted32[wordIx + 2] ^ init2);\n decrypted32[wordIx + 3] = ntoh(decrypted32[wordIx + 3] ^ init3);\n\n // setup the IV for the next round\n init0 = encrypted0;\n init1 = encrypted1;\n init2 = encrypted2;\n init3 = encrypted3;\n }\n\n return decrypted;\n};\n\n/**\n * The `Decrypter` class that manages decryption of AES\n * data through `AsyncStream` objects and the `decrypt`\n * function\n *\n * @param {Uint8Array} encrypted the encrypted bytes\n * @param {Uint32Array} key the bytes of the decryption key\n * @param {Uint32Array} initVector the initialization vector (IV) to\n * @param {Function} done the function to run when done\n * @class Decrypter\n */\n\nvar Decrypter = function () {\n function Decrypter(encrypted, key, initVector, done) {\n classCallCheck(this, Decrypter);\n\n var step = Decrypter.STEP;\n var encrypted32 = new Int32Array(encrypted.buffer);\n var decrypted = new Uint8Array(encrypted.byteLength);\n var i = 0;\n\n this.asyncStream_ = new AsyncStream();\n\n // split up the encryption job and do the individual chunks asynchronously\n this.asyncStream_.push(this.decryptChunk_(encrypted32.subarray(i, i + step), key, initVector, decrypted));\n for (i = step; i < encrypted32.length; i += step) {\n initVector = new Uint32Array([ntoh(encrypted32[i - 4]), ntoh(encrypted32[i - 3]), ntoh(encrypted32[i - 2]), ntoh(encrypted32[i - 1])]);\n this.asyncStream_.push(this.decryptChunk_(encrypted32.subarray(i, i + step), key, initVector, decrypted));\n }\n // invoke the done() callback when everything is finished\n this.asyncStream_.push(function () {\n // remove pkcs#7 padding from the decrypted bytes\n done(null, unpad(decrypted));\n });\n }\n\n /**\n * a getter for step the maximum number of bytes to process at one time\n *\n * @return {Number} the value of step 32000\n */\n\n\n /**\n * @private\n */\n Decrypter.prototype.decryptChunk_ = function decryptChunk_(encrypted, key, initVector, decrypted) {\n return function () {\n var bytes = decrypt(encrypted, key, initVector);\n\n decrypted.set(bytes, encrypted.byteOffset);\n };\n };\n\n createClass(Decrypter, null, [{\n key: 'STEP',\n get: function get$$1() {\n // 4 * 8000;\n return 32000;\n }\n }]);\n return Decrypter;\n}();\n\n/**\n * @file index.js\n *\n * Index module to easily import the primary components of AES-128\n * decryption. Like this:\n *\n * ```js\n * import {Decrypter, decrypt, AsyncStream} from 'aes-decrypter';\n * ```\n */\n\nexport { decrypt, Decrypter, AsyncStream };\n","/**\n * @license\n * Video.js 7.4.1 <http://videojs.com/>\n * Copyright Brightcove, Inc. <https://www.brightcove.com/>\n * Available under Apache License Version 2.0\n * <https://github.com/videojs/video.js/blob/master/LICENSE>\n *\n * Includes vtt.js <https://github.com/mozilla/vtt.js>\n * Available under Apache License Version 2.0\n * <https://github.com/mozilla/vtt.js/blob/master/LICENSE>\n */\n\nimport safeParseTuple from 'safe-json-parse/tuple';\nimport vtt from 'videojs-vtt.js';\nimport tsml from 'tsml';\nimport xhr from 'xhr';\nimport URLToolkit from 'url-toolkit';\nimport window$1 from 'global/window';\nimport { Parser } from 'm3u8-parser';\nimport document from 'global/document';\nimport { parse, parseUTCTiming } from 'mpd-parser';\nimport mp4probe from 'mux.js/lib/mp4/probe';\nimport { CaptionParser } from 'mux.js/lib/mp4';\nimport tsInspector from 'mux.js/lib/tools/ts-inspector.js';\nimport { Decrypter, AsyncStream, decrypt } from 'aes-decrypter';\n\nvar version = \"7.4.1\";\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _construct(Parent, args, Class) {\n if (isNativeReflectConstruct()) {\n _construct = Reflect.construct;\n } else {\n _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) _setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n }\n\n return _construct.apply(null, arguments);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _taggedTemplateLiteralLoose(strings, raw) {\n if (!raw) {\n raw = strings.slice(0);\n }\n\n strings.raw = raw;\n return strings;\n}\n\n/**\n * @file create-logger.js\n * @module create-logger\n */\n\nvar history = [];\n/**\n * Log messages to the console and history based on the type of message\n *\n * @private\n * @param {string} type\n * The name of the console method to use.\n *\n * @param {Array} args\n * The arguments to be passed to the matching console method.\n */\n\nvar LogByTypeFactory = function LogByTypeFactory(name, log) {\n return function (type, level, args) {\n var lvl = log.levels[level];\n var lvlRegExp = new RegExp(\"^(\" + lvl + \")$\");\n\n if (type !== 'log') {\n // Add the type to the front of the message when it's not \"log\".\n args.unshift(type.toUpperCase() + ':');\n } // Add console prefix after adding to history.\n\n\n args.unshift(name + ':'); // Add a clone of the args at this point to history.\n\n if (history) {\n history.push([].concat(args));\n } // If there's no console then don't try to output messages, but they will\n // still be stored in history.\n\n\n if (!window$1.console) {\n return;\n } // Was setting these once outside of this function, but containing them\n // in the function makes it easier to test cases where console doesn't exist\n // when the module is executed.\n\n\n var fn = window$1.console[type];\n\n if (!fn && type === 'debug') {\n // Certain browsers don't have support for console.debug. For those, we\n // should default to the closest comparable log.\n fn = window$1.console.info || window$1.console.log;\n } // Bail out if there's no console or if this type is not allowed by the\n // current logging level.\n\n\n if (!fn || !lvl || !lvlRegExp.test(type)) {\n return;\n }\n\n fn[Array.isArray(args) ? 'apply' : 'call'](window$1.console, args);\n };\n};\n\nfunction createLogger(name) {\n // This is the private tracking variable for logging level.\n var level = 'info'; // the curried logByType bound to the specific log and history\n\n var logByType;\n /**\n * Logs plain debug messages. Similar to `console.log`.\n *\n * Due to [limitations](https://github.com/jsdoc3/jsdoc/issues/955#issuecomment-313829149)\n * of our JSDoc template, we cannot properly document this as both a function\n * and a namespace, so its function signature is documented here.\n *\n * #### Arguments\n * ##### *args\n * Mixed[]\n *\n * Any combination of values that could be passed to `console.log()`.\n *\n * #### Return Value\n *\n * `undefined`\n *\n * @namespace\n * @param {Mixed[]} args\n * One or more messages or objects that should be logged.\n */\n\n var log = function log() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n logByType('log', level, args);\n }; // This is the logByType helper that the logging methods below use\n\n\n logByType = LogByTypeFactory(name, log);\n /**\n * Create a new sublogger which chains the old name to the new name.\n *\n * For example, doing `videojs.log.createLogger('player')` and then using that logger will log the following:\n * ```js\n * mylogger('foo');\n * // > VIDEOJS: player: foo\n * ```\n *\n * @param {string} name\n * The name to add call the new logger\n * @return {Object}\n */\n\n log.createLogger = function (subname) {\n return createLogger(name + ': ' + subname);\n };\n /**\n * Enumeration of available logging levels, where the keys are the level names\n * and the values are `|`-separated strings containing logging methods allowed\n * in that logging level. These strings are used to create a regular expression\n * matching the function name being called.\n *\n * Levels provided by Video.js are:\n *\n * - `off`: Matches no calls. Any value that can be cast to `false` will have\n * this effect. The most restrictive.\n * - `all`: Matches only Video.js-provided functions (`debug`, `log`,\n * `log.warn`, and `log.error`).\n * - `debug`: Matches `log.debug`, `log`, `log.warn`, and `log.error` calls.\n * - `info` (default): Matches `log`, `log.warn`, and `log.error` calls.\n * - `warn`: Matches `log.warn` and `log.error` calls.\n * - `error`: Matches only `log.error` calls.\n *\n * @type {Object}\n */\n\n\n log.levels = {\n all: 'debug|log|warn|error',\n off: '',\n debug: 'debug|log|warn|error',\n info: 'log|warn|error',\n warn: 'warn|error',\n error: 'error',\n DEFAULT: level\n };\n /**\n * Get or set the current logging level.\n *\n * If a string matching a key from {@link module:log.levels} is provided, acts\n * as a setter.\n *\n * @param {string} [lvl]\n * Pass a valid level to set a new logging level.\n *\n * @return {string}\n * The current logging level.\n */\n\n log.level = function (lvl) {\n if (typeof lvl === 'string') {\n if (!log.levels.hasOwnProperty(lvl)) {\n throw new Error(\"\\\"\" + lvl + \"\\\" in not a valid log level\");\n }\n\n level = lvl;\n }\n\n return level;\n };\n /**\n * Returns an array containing everything that has been logged to the history.\n *\n * This array is a shallow clone of the internal history record. However, its\n * contents are _not_ cloned; so, mutating objects inside this array will\n * mutate them in history.\n *\n * @return {Array}\n */\n\n\n log.history = function () {\n return history ? [].concat(history) : [];\n };\n /**\n * Allows you to filter the history by the given logger name\n *\n * @param {string} fname\n * The name to filter by\n *\n * @return {Array}\n * The filtered list to return\n */\n\n\n log.history.filter = function (fname) {\n return (history || []).filter(function (historyItem) {\n // if the first item in each historyItem includes `fname`, then it's a match\n return new RegExp(\".*\" + fname + \".*\").test(historyItem[0]);\n });\n };\n /**\n * Clears the internal history tracking, but does not prevent further history\n * tracking.\n */\n\n\n log.history.clear = function () {\n if (history) {\n history.length = 0;\n }\n };\n /**\n * Disable history tracking if it is currently enabled.\n */\n\n\n log.history.disable = function () {\n if (history !== null) {\n history.length = 0;\n history = null;\n }\n };\n /**\n * Enable history tracking if it is currently disabled.\n */\n\n\n log.history.enable = function () {\n if (history === null) {\n history = [];\n }\n };\n /**\n * Logs error messages. Similar to `console.error`.\n *\n * @param {Mixed[]} args\n * One or more messages or objects that should be logged as an error\n */\n\n\n log.error = function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return logByType('error', level, args);\n };\n /**\n * Logs warning messages. Similar to `console.warn`.\n *\n * @param {Mixed[]} args\n * One or more messages or objects that should be logged as a warning.\n */\n\n\n log.warn = function () {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n return logByType('warn', level, args);\n };\n /**\n * Logs debug messages. Similar to `console.debug`, but may also act as a comparable\n * log if `console.debug` is not available\n *\n * @param {Mixed[]} args\n * One or more messages or objects that should be logged as debug.\n */\n\n\n log.debug = function () {\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n\n return logByType('debug', level, args);\n };\n\n return log;\n}\n\n/**\n * @file log.js\n * @module log\n */\nvar log = createLogger('VIDEOJS');\nvar createLogger$1 = log.createLogger;\n\n/**\n * @file obj.js\n * @module obj\n */\n\n/**\n * @callback obj:EachCallback\n *\n * @param {Mixed} value\n * The current key for the object that is being iterated over.\n *\n * @param {string} key\n * The current key-value for object that is being iterated over\n */\n\n/**\n * @callback obj:ReduceCallback\n *\n * @param {Mixed} accum\n * The value that is accumulating over the reduce loop.\n *\n * @param {Mixed} value\n * The current key for the object that is being iterated over.\n *\n * @param {string} key\n * The current key-value for object that is being iterated over\n *\n * @return {Mixed}\n * The new accumulated value.\n */\nvar toString = Object.prototype.toString;\n/**\n * Get the keys of an Object\n *\n * @param {Object}\n * The Object to get the keys from\n *\n * @return {string[]}\n * An array of the keys from the object. Returns an empty array if the\n * object passed in was invalid or had no keys.\n *\n * @private\n */\n\nvar keys = function keys(object) {\n return isObject(object) ? Object.keys(object) : [];\n};\n/**\n * Array-like iteration for objects.\n *\n * @param {Object} object\n * The object to iterate over\n *\n * @param {obj:EachCallback} fn\n * The callback function which is called for each key in the object.\n */\n\n\nfunction each(object, fn) {\n keys(object).forEach(function (key) {\n return fn(object[key], key);\n });\n}\n/**\n * Array-like reduce for objects.\n *\n * @param {Object} object\n * The Object that you want to reduce.\n *\n * @param {Function} fn\n * A callback function which is called for each key in the object. It\n * receives the accumulated value and the per-iteration value and key\n * as arguments.\n *\n * @param {Mixed} [initial = 0]\n * Starting value\n *\n * @return {Mixed}\n * The final accumulated value.\n */\n\nfunction reduce(object, fn, initial) {\n if (initial === void 0) {\n initial = 0;\n }\n\n return keys(object).reduce(function (accum, key) {\n return fn(accum, object[key], key);\n }, initial);\n}\n/**\n * Object.assign-style object shallow merge/extend.\n *\n * @param {Object} target\n * @param {Object} ...sources\n * @return {Object}\n */\n\nfunction assign(target) {\n for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n sources[_key - 1] = arguments[_key];\n }\n\n if (Object.assign) {\n return Object.assign.apply(Object, [target].concat(sources));\n }\n\n sources.forEach(function (source) {\n if (!source) {\n return;\n }\n\n each(source, function (value, key) {\n target[key] = value;\n });\n });\n return target;\n}\n/**\n * Returns whether a value is an object of any kind - including DOM nodes,\n * arrays, regular expressions, etc. Not functions, though.\n *\n * This avoids the gotcha where using `typeof` on a `null` value\n * results in `'object'`.\n *\n * @param {Object} value\n * @return {boolean}\n */\n\nfunction isObject(value) {\n return !!value && typeof value === 'object';\n}\n/**\n * Returns whether an object appears to be a \"plain\" object - that is, a\n * direct instance of `Object`.\n *\n * @param {Object} value\n * @return {boolean}\n */\n\nfunction isPlain(value) {\n return isObject(value) && toString.call(value) === '[object Object]' && value.constructor === Object;\n}\n\n/**\n * @file computed-style.js\n * @module computed-style\n */\n/**\n * A safe getComputedStyle.\n *\n * This is needed because in Firefox, if the player is loaded in an iframe with\n * `display:none`, then `getComputedStyle` returns `null`, so, we do a\n * null-check to make sure that the player doesn't break in these cases.\n *\n * @function\n * @param {Element} el\n * The element you want the computed style of\n *\n * @param {string} prop\n * The property name you want\n *\n * @see https://bugzilla.mozilla.org/show_bug.cgi?id=548397\n */\n\nfunction computedStyle(el, prop) {\n if (!el || !prop) {\n return '';\n }\n\n if (typeof window$1.getComputedStyle === 'function') {\n var cs = window$1.getComputedStyle(el);\n return cs ? cs[prop] : '';\n }\n\n return '';\n}\n\nfunction _templateObject() {\n var data = _taggedTemplateLiteralLoose([\"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 \", \".\"]);\n\n _templateObject = function _templateObject() {\n return data;\n };\n\n return data;\n}\n/**\n * Detect if a value is a string with any non-whitespace characters.\n *\n * @private\n * @param {string} str\n * The string to check\n *\n * @return {boolean}\n * Will be `true` if the string is non-blank, `false` otherwise.\n *\n */\n\nfunction isNonBlankString(str) {\n return typeof str === 'string' && /\\S/.test(str);\n}\n/**\n * Throws an error if the passed string has whitespace. This is used by\n * class methods to be relatively consistent with the classList API.\n *\n * @private\n * @param {string} str\n * The string to check for whitespace.\n *\n * @throws {Error}\n * Throws an error if there is whitespace in the string.\n */\n\n\nfunction throwIfWhitespace(str) {\n if (/\\s/.test(str)) {\n throw new Error('class has illegal whitespace characters');\n }\n}\n/**\n * Produce a regular expression for matching a className within an elements className.\n *\n * @private\n * @param {string} className\n * The className to generate the RegExp for.\n *\n * @return {RegExp}\n * The RegExp that will check for a specific `className` in an elements\n * className.\n */\n\n\nfunction classRegExp(className) {\n return new RegExp('(^|\\\\s)' + className + '($|\\\\s)');\n}\n/**\n * Whether the current DOM interface appears to be real (i.e. not simulated).\n *\n * @return {boolean}\n * Will be `true` if the DOM appears to be real, `false` otherwise.\n */\n\n\nfunction isReal() {\n // Both document and window will never be undefined thanks to `global`.\n return document === window$1.document;\n}\n/**\n * Determines, via duck typing, whether or not a value is a DOM element.\n *\n * @param {Mixed} value\n * The value to check.\n *\n * @return {boolean}\n * Will be `true` if the value is a DOM element, `false` otherwise.\n */\n\nfunction isEl(value) {\n return isObject(value) && value.nodeType === 1;\n}\n/**\n * Determines if the current DOM is embedded in an iframe.\n *\n * @return {boolean}\n * Will be `true` if the DOM is embedded in an iframe, `false`\n * otherwise.\n */\n\nfunction isInFrame() {\n // We need a try/catch here because Safari will throw errors when attempting\n // to get either `parent` or `self`\n try {\n return window$1.parent !== window$1.self;\n } catch (x) {\n return true;\n }\n}\n/**\n * Creates functions to query the DOM using a given method.\n *\n * @private\n * @param {string} method\n * The method to create the query with.\n *\n * @return {Function}\n * The query method\n */\n\nfunction createQuerier(method) {\n return function (selector, context) {\n if (!isNonBlankString(selector)) {\n return document[method](null);\n }\n\n if (isNonBlankString(context)) {\n context = document.querySelector(context);\n }\n\n var ctx = isEl(context) ? context : document;\n return ctx[method] && ctx[method](selector);\n };\n}\n/**\n * Creates an element and applies properties, attributes, and inserts content.\n *\n * @param {string} [tagName='div']\n * Name of tag to be created.\n *\n * @param {Object} [properties={}]\n * Element properties to be applied.\n *\n * @param {Object} [attributes={}]\n * Element attributes to be applied.\n *\n * @param {module:dom~ContentDescriptor} content\n * A content descriptor object.\n *\n * @return {Element}\n * The element that was created.\n */\n\n\nfunction createEl(tagName, properties, attributes, content) {\n if (tagName === void 0) {\n tagName = 'div';\n }\n\n if (properties === void 0) {\n properties = {};\n }\n\n if (attributes === void 0) {\n attributes = {};\n }\n\n var el = document.createElement(tagName);\n Object.getOwnPropertyNames(properties).forEach(function (propName) {\n var val = properties[propName]; // See #2176\n // We originally were accepting both properties and attributes in the\n // same object, but that doesn't work so well.\n\n if (propName.indexOf('aria-') !== -1 || propName === 'role' || propName === 'type') {\n log.warn(tsml(_templateObject(), propName, val));\n el.setAttribute(propName, val); // Handle textContent since it's not supported everywhere and we have a\n // method for it.\n } else if (propName === 'textContent') {\n textContent(el, val);\n } else {\n el[propName] = val;\n }\n });\n Object.getOwnPropertyNames(attributes).forEach(function (attrName) {\n el.setAttribute(attrName, attributes[attrName]);\n });\n\n if (content) {\n appendContent(el, content);\n }\n\n return el;\n}\n/**\n * Injects text into an element, replacing any existing contents entirely.\n *\n * @param {Element} el\n * The element to add text content into\n *\n * @param {string} text\n * The text content to add.\n *\n * @return {Element}\n * The element with added text content.\n */\n\nfunction textContent(el, text) {\n if (typeof el.textContent === 'undefined') {\n el.innerText = text;\n } else {\n el.textContent = text;\n }\n\n return el;\n}\n/**\n * Insert an element as the first child node of another\n *\n * @param {Element} child\n * Element to insert\n *\n * @param {Element} parent\n * Element to insert child into\n */\n\nfunction prependTo(child, parent) {\n if (parent.firstChild) {\n parent.insertBefore(child, parent.firstChild);\n } else {\n parent.appendChild(child);\n }\n}\n/**\n * Check if an element has a class name.\n *\n * @param {Element} element\n * Element to check\n *\n * @param {string} classToCheck\n * Class name to check for\n *\n * @return {boolean}\n * Will be `true` if the element has a class, `false` otherwise.\n *\n * @throws {Error}\n * Throws an error if `classToCheck` has white space.\n */\n\nfunction hasClass(element, classToCheck) {\n throwIfWhitespace(classToCheck);\n\n if (element.classList) {\n return element.classList.contains(classToCheck);\n }\n\n return classRegExp(classToCheck).test(element.className);\n}\n/**\n * Add a class name to an element.\n *\n * @param {Element} element\n * Element to add class name to.\n *\n * @param {string} classToAdd\n * Class name to add.\n *\n * @return {Element}\n * The DOM element with the added class name.\n */\n\nfunction addClass(element, classToAdd) {\n if (element.classList) {\n element.classList.add(classToAdd); // Don't need to `throwIfWhitespace` here because `hasElClass` will do it\n // in the case of classList not being supported.\n } else if (!hasClass(element, classToAdd)) {\n element.className = (element.className + ' ' + classToAdd).trim();\n }\n\n return element;\n}\n/**\n * Remove a class name from an element.\n *\n * @param {Element} element\n * Element to remove a class name from.\n *\n * @param {string} classToRemove\n * Class name to remove\n *\n * @return {Element}\n * The DOM element with class name removed.\n */\n\nfunction removeClass(element, classToRemove) {\n if (element.classList) {\n element.classList.remove(classToRemove);\n } else {\n throwIfWhitespace(classToRemove);\n element.className = element.className.split(/\\s+/).filter(function (c) {\n return c !== classToRemove;\n }).join(' ');\n }\n\n return element;\n}\n/**\n * The callback definition for toggleClass.\n *\n * @callback module:dom~PredicateCallback\n * @param {Element} element\n * The DOM element of the Component.\n *\n * @param {string} classToToggle\n * The `className` that wants to be toggled\n *\n * @return {boolean|undefined}\n * If `true` is returned, the `classToToggle` will be added to the\n * `element`. If `false`, the `classToToggle` will be removed from\n * the `element`. If `undefined`, the callback will be ignored.\n */\n\n/**\n * Adds or removes a class name to/from an element depending on an optional\n * condition or the presence/absence of the class name.\n *\n * @param {Element} element\n * The element to toggle a class name on.\n *\n * @param {string} classToToggle\n * The class that should be toggled.\n *\n * @param {boolean|module:dom~PredicateCallback} [predicate]\n * See the return value for {@link module:dom~PredicateCallback}\n *\n * @return {Element}\n * The element with a class that has been toggled.\n */\n\nfunction toggleClass(element, classToToggle, predicate) {\n // This CANNOT use `classList` internally because IE11 does not support the\n // second parameter to the `classList.toggle()` method! Which is fine because\n // `classList` will be used by the add/remove functions.\n var has = hasClass(element, classToToggle);\n\n if (typeof predicate === 'function') {\n predicate = predicate(element, classToToggle);\n }\n\n if (typeof predicate !== 'boolean') {\n predicate = !has;\n } // If the necessary class operation matches the current state of the\n // element, no action is required.\n\n\n if (predicate === has) {\n return;\n }\n\n if (predicate) {\n addClass(element, classToToggle);\n } else {\n removeClass(element, classToToggle);\n }\n\n return element;\n}\n/**\n * Apply attributes to an HTML element.\n *\n * @param {Element} el\n * Element to add attributes to.\n *\n * @param {Object} [attributes]\n * Attributes to be applied.\n */\n\nfunction setAttributes(el, attributes) {\n Object.getOwnPropertyNames(attributes).forEach(function (attrName) {\n var attrValue = attributes[attrName];\n\n if (attrValue === null || typeof attrValue === 'undefined' || attrValue === false) {\n el.removeAttribute(attrName);\n } else {\n el.setAttribute(attrName, attrValue === true ? '' : attrValue);\n }\n });\n}\n/**\n * Get an element's attribute values, as defined on the HTML tag.\n *\n * Attributes are not the same as properties. They're defined on the tag\n * or with setAttribute.\n *\n * @param {Element} tag\n * Element from which to get tag attributes.\n *\n * @return {Object}\n * All attributes of the element. Boolean attributes will be `true` or\n * `false`, others will be strings.\n */\n\nfunction getAttributes(tag) {\n var obj = {}; // known boolean attributes\n // we can check for matching boolean properties, but not all browsers\n // and not all tags know about these attributes, so, we still want to check them manually\n\n var knownBooleans = ',' + 'autoplay,controls,playsinline,loop,muted,default,defaultMuted' + ',';\n\n if (tag && tag.attributes && tag.attributes.length > 0) {\n var attrs = tag.attributes;\n\n for (var i = attrs.length - 1; i >= 0; i--) {\n var attrName = attrs[i].name;\n var attrVal = attrs[i].value; // check for known booleans\n // the matching element property will return a value for typeof\n\n if (typeof tag[attrName] === 'boolean' || knownBooleans.indexOf(',' + attrName + ',') !== -1) {\n // the value of an included boolean attribute is typically an empty\n // string ('') which would equal false if we just check for a false value.\n // we also don't want support bad code like autoplay='false'\n attrVal = attrVal !== null ? true : false;\n }\n\n obj[attrName] = attrVal;\n }\n }\n\n return obj;\n}\n/**\n * Get the value of an element's attribute.\n *\n * @param {Element} el\n * A DOM element.\n *\n * @param {string} attribute\n * Attribute to get the value of.\n *\n * @return {string}\n * The value of the attribute.\n */\n\nfunction getAttribute(el, attribute) {\n return el.getAttribute(attribute);\n}\n/**\n * Set the value of an element's attribute.\n *\n * @param {Element} el\n * A DOM element.\n *\n * @param {string} attribute\n * Attribute to set.\n *\n * @param {string} value\n * Value to set the attribute to.\n */\n\nfunction setAttribute(el, attribute, value) {\n el.setAttribute(attribute, value);\n}\n/**\n * Remove an element's attribute.\n *\n * @param {Element} el\n * A DOM element.\n *\n * @param {string} attribute\n * Attribute to remove.\n */\n\nfunction removeAttribute(el, attribute) {\n el.removeAttribute(attribute);\n}\n/**\n * Attempt to block the ability to select text.\n */\n\nfunction blockTextSelection() {\n document.body.focus();\n\n document.onselectstart = function () {\n return false;\n };\n}\n/**\n * Turn off text selection blocking.\n */\n\nfunction unblockTextSelection() {\n document.onselectstart = function () {\n return true;\n };\n}\n/**\n * Identical to the native `getBoundingClientRect` function, but ensures that\n * the method is supported at all (it is in all browsers we claim to support)\n * and that the element is in the DOM before continuing.\n *\n * This wrapper function also shims properties which are not provided by some\n * older browsers (namely, IE8).\n *\n * Additionally, some browsers do not support adding properties to a\n * `ClientRect`/`DOMRect` object; so, we shallow-copy it with the standard\n * properties (except `x` and `y` which are not widely supported). This helps\n * avoid implementations where keys are non-enumerable.\n *\n * @param {Element} el\n * Element whose `ClientRect` we want to calculate.\n *\n * @return {Object|undefined}\n * Always returns a plain object - or `undefined` if it cannot.\n */\n\nfunction getBoundingClientRect(el) {\n if (el && el.getBoundingClientRect && el.parentNode) {\n var rect = el.getBoundingClientRect();\n var result = {};\n ['bottom', 'height', 'left', 'right', 'top', 'width'].forEach(function (k) {\n if (rect[k] !== undefined) {\n result[k] = rect[k];\n }\n });\n\n if (!result.height) {\n result.height = parseFloat(computedStyle(el, 'height'));\n }\n\n if (!result.width) {\n result.width = parseFloat(computedStyle(el, 'width'));\n }\n\n return result;\n }\n}\n/**\n * Represents the position of a DOM element on the page.\n *\n * @typedef {Object} module:dom~Position\n *\n * @property {number} left\n * Pixels to the left.\n *\n * @property {number} top\n * Pixels from the top.\n */\n\n/**\n * Get the position of an element in the DOM.\n *\n * Uses `getBoundingClientRect` technique from John Resig.\n *\n * @see http://ejohn.org/blog/getboundingclientrect-is-awesome/\n *\n * @param {Element} el\n * Element from which to get offset.\n *\n * @return {module:dom~Position}\n * The position of the element that was passed in.\n */\n\nfunction findPosition(el) {\n var box;\n\n if (el.getBoundingClientRect && el.parentNode) {\n box = el.getBoundingClientRect();\n }\n\n if (!box) {\n return {\n left: 0,\n top: 0\n };\n }\n\n var docEl = document.documentElement;\n var body = document.body;\n var clientLeft = docEl.clientLeft || body.clientLeft || 0;\n var scrollLeft = window$1.pageXOffset || body.scrollLeft;\n var left = box.left + scrollLeft - clientLeft;\n var clientTop = docEl.clientTop || body.clientTop || 0;\n var scrollTop = window$1.pageYOffset || body.scrollTop;\n var top = box.top + scrollTop - clientTop; // Android sometimes returns slightly off decimal values, so need to round\n\n return {\n left: Math.round(left),\n top: Math.round(top)\n };\n}\n/**\n * Represents x and y coordinates for a DOM element or mouse pointer.\n *\n * @typedef {Object} module:dom~Coordinates\n *\n * @property {number} x\n * x coordinate in pixels\n *\n * @property {number} y\n * y coordinate in pixels\n */\n\n/**\n * Get the pointer position within an element.\n *\n * The base on the coordinates are the bottom left of the element.\n *\n * @param {Element} el\n * Element on which to get the pointer position on.\n *\n * @param {EventTarget~Event} event\n * Event object.\n *\n * @return {module:dom~Coordinates}\n * A coordinates object corresponding to the mouse position.\n *\n */\n\nfunction getPointerPosition(el, event) {\n var position = {};\n var box = findPosition(el);\n var boxW = el.offsetWidth;\n var boxH = el.offsetHeight;\n var boxY = box.top;\n var boxX = box.left;\n var pageY = event.pageY;\n var pageX = event.pageX;\n\n if (event.changedTouches) {\n pageX = event.changedTouches[0].pageX;\n pageY = event.changedTouches[0].pageY;\n }\n\n position.y = Math.max(0, Math.min(1, (boxY - pageY + boxH) / boxH));\n position.x = Math.max(0, Math.min(1, (pageX - boxX) / boxW));\n return position;\n}\n/**\n * Determines, via duck typing, whether or not a value is a text node.\n *\n * @param {Mixed} value\n * Check if this value is a text node.\n *\n * @return {boolean}\n * Will be `true` if the value is a text node, `false` otherwise.\n */\n\nfunction isTextNode(value) {\n return isObject(value) && value.nodeType === 3;\n}\n/**\n * Empties the contents of an element.\n *\n * @param {Element} el\n * The element to empty children from\n *\n * @return {Element}\n * The element with no children\n */\n\nfunction emptyEl(el) {\n while (el.firstChild) {\n el.removeChild(el.firstChild);\n }\n\n return el;\n}\n/**\n * This is a mixed value that describes content to be injected into the DOM\n * via some method. It can be of the following types:\n *\n * Type | Description\n * -----------|-------------\n * `string` | The value will be normalized into a text node.\n * `Element` | The value will be accepted as-is.\n * `TextNode` | The value will be accepted as-is.\n * `Array` | A one-dimensional array of strings, elements, text nodes, or functions. These functions should return a string, element, or text node (any other return value, like an array, will be ignored).\n * `Function` | A function, which is expected to return a string, element, text node, or array - any of the other possible values described above. This means that a content descriptor could be a function that returns an array of functions, but those second-level functions must return strings, elements, or text nodes.\n *\n * @typedef {string|Element|TextNode|Array|Function} module:dom~ContentDescriptor\n */\n\n/**\n * Normalizes content for eventual insertion into the DOM.\n *\n * This allows a wide range of content definition methods, but helps protect\n * from falling into the trap of simply writing to `innerHTML`, which could\n * be an XSS concern.\n *\n * The content for an element can be passed in multiple types and\n * combinations, whose behavior is as follows:\n *\n * @param {module:dom~ContentDescriptor} content\n * A content descriptor value.\n *\n * @return {Array}\n * All of the content that was passed in, normalized to an array of\n * elements or text nodes.\n */\n\nfunction normalizeContent(content) {\n // First, invoke content if it is a function. If it produces an array,\n // that needs to happen before normalization.\n if (typeof content === 'function') {\n content = content();\n } // Next up, normalize to an array, so one or many items can be normalized,\n // filtered, and returned.\n\n\n return (Array.isArray(content) ? content : [content]).map(function (value) {\n // First, invoke value if it is a function to produce a new value,\n // which will be subsequently normalized to a Node of some kind.\n if (typeof value === 'function') {\n value = value();\n }\n\n if (isEl(value) || isTextNode(value)) {\n return value;\n }\n\n if (typeof value === 'string' && /\\S/.test(value)) {\n return document.createTextNode(value);\n }\n }).filter(function (value) {\n return value;\n });\n}\n/**\n * Normalizes and appends content to an element.\n *\n * @param {Element} el\n * Element to append normalized content to.\n *\n * @param {module:dom~ContentDescriptor} content\n * A content descriptor value.\n *\n * @return {Element}\n * The element with appended normalized content.\n */\n\nfunction appendContent(el, content) {\n normalizeContent(content).forEach(function (node) {\n return el.appendChild(node);\n });\n return el;\n}\n/**\n * Normalizes and inserts content into an element; this is identical to\n * `appendContent()`, except it empties the element first.\n *\n * @param {Element} el\n * Element to insert normalized content into.\n *\n * @param {module:dom~ContentDescriptor} content\n * A content descriptor value.\n *\n * @return {Element}\n * The element with inserted normalized content.\n */\n\nfunction insertContent(el, content) {\n return appendContent(emptyEl(el), content);\n}\n/**\n * Check if an event was a single left click.\n *\n * @param {EventTarget~Event} event\n * Event object.\n *\n * @return {boolean}\n * Will be `true` if a single left click, `false` otherwise.\n */\n\nfunction isSingleLeftClick(event) {\n // Note: if you create something draggable, be sure to\n // call it on both `mousedown` and `mousemove` event,\n // otherwise `mousedown` should be enough for a button\n if (event.button === undefined && event.buttons === undefined) {\n // Why do we need `buttons` ?\n // Because, middle mouse sometimes have this:\n // e.button === 0 and e.buttons === 4\n // Furthermore, we want to prevent combination click, something like\n // HOLD middlemouse then left click, that would be\n // e.button === 0, e.buttons === 5\n // just `button` is not gonna work\n // Alright, then what this block does ?\n // this is for chrome `simulate mobile devices`\n // I want to support this as well\n return true;\n }\n\n if (event.button === 0 && event.buttons === undefined) {\n // Touch screen, sometimes on some specific device, `buttons`\n // doesn't have anything (safari on ios, blackberry...)\n return true;\n }\n\n if (event.button !== 0 || event.buttons !== 1) {\n // This is the reason we have those if else block above\n // if any special case we can catch and let it slide\n // we do it above, when get to here, this definitely\n // is-not-left-click\n return false;\n }\n\n return true;\n}\n/**\n * Finds a single DOM element matching `selector` within the optional\n * `context` of another DOM element (defaulting to `document`).\n *\n * @param {string} selector\n * A valid CSS selector, which will be passed to `querySelector`.\n *\n * @param {Element|String} [context=document]\n * A DOM element within which to query. Can also be a selector\n * string in which case the first matching element will be used\n * as context. If missing (or no element matches selector), falls\n * back to `document`.\n *\n * @return {Element|null}\n * The element that was found or null.\n */\n\nvar $ = createQuerier('querySelector');\n/**\n * Finds a all DOM elements matching `selector` within the optional\n * `context` of another DOM element (defaulting to `document`).\n *\n * @param {string} selector\n * A valid CSS selector, which will be passed to `querySelectorAll`.\n *\n * @param {Element|String} [context=document]\n * A DOM element within which to query. Can also be a selector\n * string in which case the first matching element will be used\n * as context. If missing (or no element matches selector), falls\n * back to `document`.\n *\n * @return {NodeList}\n * A element list of elements that were found. Will be empty if none\n * were found.\n *\n */\n\nvar $$ = createQuerier('querySelectorAll');\n\nvar Dom = /*#__PURE__*/Object.freeze({\n isReal: isReal,\n isEl: isEl,\n isInFrame: isInFrame,\n createEl: createEl,\n textContent: textContent,\n prependTo: prependTo,\n hasClass: hasClass,\n addClass: addClass,\n removeClass: removeClass,\n toggleClass: toggleClass,\n setAttributes: setAttributes,\n getAttributes: getAttributes,\n getAttribute: getAttribute,\n setAttribute: setAttribute,\n removeAttribute: removeAttribute,\n blockTextSelection: blockTextSelection,\n unblockTextSelection: unblockTextSelection,\n getBoundingClientRect: getBoundingClientRect,\n findPosition: findPosition,\n getPointerPosition: getPointerPosition,\n isTextNode: isTextNode,\n emptyEl: emptyEl,\n normalizeContent: normalizeContent,\n appendContent: appendContent,\n insertContent: insertContent,\n isSingleLeftClick: isSingleLeftClick,\n $: $,\n $$: $$\n});\n\n/**\n * @file guid.js\n * @module guid\n */\n\n/**\n * Unique ID for an element or function\n * @type {Number}\n */\nvar _guid = 1;\n/**\n * Get a unique auto-incrementing ID by number that has not been returned before.\n *\n * @return {number}\n * A new unique ID.\n */\n\nfunction newGUID() {\n return _guid++;\n}\n\n/**\n * @file dom-data.js\n * @module dom-data\n */\n/**\n * Element Data Store.\n *\n * Allows for binding data to an element without putting it directly on the\n * element. Ex. Event listeners are stored here.\n * (also from jsninja.com, slightly modified and updated for closure compiler)\n *\n * @type {Object}\n * @private\n */\n\nvar elData = {};\n/*\n * Unique attribute name to store an element's guid in\n *\n * @type {String}\n * @constant\n * @private\n */\n\nvar elIdAttr = 'vdata' + new Date().getTime();\n/**\n * Returns the cache object where data for an element is stored\n *\n * @param {Element} el\n * Element to store data for.\n *\n * @return {Object}\n * The cache object for that el that was passed in.\n */\n\nfunction getData(el) {\n var id = el[elIdAttr];\n\n if (!id) {\n id = el[elIdAttr] = newGUID();\n }\n\n if (!elData[id]) {\n elData[id] = {};\n }\n\n return elData[id];\n}\n/**\n * Returns whether or not an element has cached data\n *\n * @param {Element} el\n * Check if this element has cached data.\n *\n * @return {boolean}\n * - True if the DOM element has cached data.\n * - False otherwise.\n */\n\nfunction hasData(el) {\n var id = el[elIdAttr];\n\n if (!id) {\n return false;\n }\n\n return !!Object.getOwnPropertyNames(elData[id]).length;\n}\n/**\n * Delete data for the element from the cache and the guid attr from getElementById\n *\n * @param {Element} el\n * Remove cached data for this element.\n */\n\nfunction removeData(el) {\n var id = el[elIdAttr];\n\n if (!id) {\n return;\n } // Remove all stored data\n\n\n delete elData[id]; // Remove the elIdAttr property from the DOM node\n\n try {\n delete el[elIdAttr];\n } catch (e) {\n if (el.removeAttribute) {\n el.removeAttribute(elIdAttr);\n } else {\n // IE doesn't appear to support removeAttribute on the document element\n el[elIdAttr] = null;\n }\n }\n}\n\n/**\n * @file events.js. An Event System (John Resig - Secrets of a JS Ninja http://jsninja.com/)\n * (Original book version wasn't completely usable, so fixed some things and made Closure Compiler compatible)\n * This should work very similarly to jQuery's events, however it's based off the book version which isn't as\n * robust as jquery's, so there's probably some differences.\n *\n * @file events.js\n * @module events\n */\n/**\n * Clean up the listener cache and dispatchers\n *\n * @param {Element|Object} elem\n * Element to clean up\n *\n * @param {string} type\n * Type of event to clean up\n */\n\nfunction _cleanUpEvents(elem, type) {\n var data = getData(elem); // Remove the events of a particular type if there are none left\n\n if (data.handlers[type].length === 0) {\n delete data.handlers[type]; // data.handlers[type] = null;\n // Setting to null was causing an error with data.handlers\n // Remove the meta-handler from the element\n\n if (elem.removeEventListener) {\n elem.removeEventListener(type, data.dispatcher, false);\n } else if (elem.detachEvent) {\n elem.detachEvent('on' + type, data.dispatcher);\n }\n } // Remove the events object if there are no types left\n\n\n if (Object.getOwnPropertyNames(data.handlers).length <= 0) {\n delete data.handlers;\n delete data.dispatcher;\n delete data.disabled;\n } // Finally remove the element data if there is no data left\n\n\n if (Object.getOwnPropertyNames(data).length === 0) {\n removeData(elem);\n }\n}\n/**\n * Loops through an array of event types and calls the requested method for each type.\n *\n * @param {Function} fn\n * The event method we want to use.\n *\n * @param {Element|Object} elem\n * Element or object to bind listeners to\n *\n * @param {string} type\n * Type of event to bind to.\n *\n * @param {EventTarget~EventListener} callback\n * Event listener.\n */\n\n\nfunction _handleMultipleEvents(fn, elem, types, callback) {\n types.forEach(function (type) {\n // Call the event method for each one of the types\n fn(elem, type, callback);\n });\n}\n/**\n * Fix a native event to have standard property values\n *\n * @param {Object} event\n * Event object to fix.\n *\n * @return {Object}\n * Fixed event object.\n */\n\n\nfunction fixEvent(event) {\n function returnTrue() {\n return true;\n }\n\n function returnFalse() {\n return false;\n } // Test if fixing up is needed\n // Used to check if !event.stopPropagation instead of isPropagationStopped\n // But native events return true for stopPropagation, but don't have\n // other expected methods like isPropagationStopped. Seems to be a problem\n // with the Javascript Ninja code. So we're just overriding all events now.\n\n\n if (!event || !event.isPropagationStopped) {\n var old = event || window$1.event;\n event = {}; // Clone the old object so that we can modify the values event = {};\n // IE8 Doesn't like when you mess with native event properties\n // Firefox returns false for event.hasOwnProperty('type') and other props\n // which makes copying more difficult.\n // TODO: Probably best to create a whitelist of event props\n\n for (var key in old) {\n // Safari 6.0.3 warns you if you try to copy deprecated layerX/Y\n // Chrome warns you if you try to copy deprecated keyboardEvent.keyLocation\n // and webkitMovementX/Y\n if (key !== 'layerX' && key !== 'layerY' && key !== 'keyLocation' && key !== 'webkitMovementX' && key !== 'webkitMovementY') {\n // Chrome 32+ warns if you try to copy deprecated returnValue, but\n // we still want to if preventDefault isn't supported (IE8).\n if (!(key === 'returnValue' && old.preventDefault)) {\n event[key] = old[key];\n }\n }\n } // The event occurred on this element\n\n\n if (!event.target) {\n event.target = event.srcElement || document;\n } // Handle which other element the event is related to\n\n\n if (!event.relatedTarget) {\n event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;\n } // Stop the default browser action\n\n\n event.preventDefault = function () {\n if (old.preventDefault) {\n old.preventDefault();\n }\n\n event.returnValue = false;\n old.returnValue = false;\n event.defaultPrevented = true;\n };\n\n event.defaultPrevented = false; // Stop the event from bubbling\n\n event.stopPropagation = function () {\n if (old.stopPropagation) {\n old.stopPropagation();\n }\n\n event.cancelBubble = true;\n old.cancelBubble = true;\n event.isPropagationStopped = returnTrue;\n };\n\n event.isPropagationStopped = returnFalse; // Stop the event from bubbling and executing other handlers\n\n event.stopImmediatePropagation = function () {\n if (old.stopImmediatePropagation) {\n old.stopImmediatePropagation();\n }\n\n event.isImmediatePropagationStopped = returnTrue;\n event.stopPropagation();\n };\n\n event.isImmediatePropagationStopped = returnFalse; // Handle mouse position\n\n if (event.clientX !== null && event.clientX !== undefined) {\n var doc = document.documentElement;\n var body = document.body;\n event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);\n event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);\n } // Handle key presses\n\n\n event.which = event.charCode || event.keyCode; // Fix button for mouse clicks:\n // 0 == left; 1 == middle; 2 == right\n\n if (event.button !== null && event.button !== undefined) {\n // The following is disabled because it does not pass videojs-standard\n // and... yikes.\n\n /* eslint-disable */\n event.button = event.button & 1 ? 0 : event.button & 4 ? 1 : event.button & 2 ? 2 : 0;\n /* eslint-enable */\n }\n } // Returns fixed-up instance\n\n\n return event;\n}\n/**\n * Whether passive event listeners are supported\n */\n\nvar _supportsPassive = false;\n\n(function () {\n try {\n var opts = Object.defineProperty({}, 'passive', {\n get: function get() {\n _supportsPassive = true;\n }\n });\n window$1.addEventListener('test', null, opts);\n window$1.removeEventListener('test', null, opts);\n } catch (e) {// disregard\n }\n})();\n/**\n * Touch events Chrome expects to be passive\n */\n\n\nvar passiveEvents = ['touchstart', 'touchmove'];\n/**\n * Add an event listener to element\n * It stores the handler function in a separate cache object\n * and adds a generic handler to the element's event,\n * along with a unique id (guid) to the element.\n *\n * @param {Element|Object} elem\n * Element or object to bind listeners to\n *\n * @param {string|string[]} type\n * Type of event to bind to.\n *\n * @param {EventTarget~EventListener} fn\n * Event listener.\n */\n\nfunction on(elem, type, fn) {\n if (Array.isArray(type)) {\n return _handleMultipleEvents(on, elem, type, fn);\n }\n\n var data = getData(elem); // We need a place to store all our handler data\n\n if (!data.handlers) {\n data.handlers = {};\n }\n\n if (!data.handlers[type]) {\n data.handlers[type] = [];\n }\n\n if (!fn.guid) {\n fn.guid = newGUID();\n }\n\n data.handlers[type].push(fn);\n\n if (!data.dispatcher) {\n data.disabled = false;\n\n data.dispatcher = function (event, hash) {\n if (data.disabled) {\n return;\n }\n\n event = fixEvent(event);\n var handlers = data.handlers[event.type];\n\n if (handlers) {\n // Copy handlers so if handlers are added/removed during the process it doesn't throw everything off.\n var handlersCopy = handlers.slice(0);\n\n for (var m = 0, n = handlersCopy.length; m < n; m++) {\n if (event.isImmediatePropagationStopped()) {\n break;\n } else {\n try {\n handlersCopy[m].call(elem, event, hash);\n } catch (e) {\n log.error(e);\n }\n }\n }\n }\n };\n }\n\n if (data.handlers[type].length === 1) {\n if (elem.addEventListener) {\n var options = false;\n\n if (_supportsPassive && passiveEvents.indexOf(type) > -1) {\n options = {\n passive: true\n };\n }\n\n elem.addEventListener(type, data.dispatcher, options);\n } else if (elem.attachEvent) {\n elem.attachEvent('on' + type, data.dispatcher);\n }\n }\n}\n/**\n * Removes event listeners from an element\n *\n * @param {Element|Object} elem\n * Object to remove listeners from.\n *\n * @param {string|string[]} [type]\n * Type of listener to remove. Don't include to remove all events from element.\n *\n * @param {EventTarget~EventListener} [fn]\n * Specific listener to remove. Don't include to remove listeners for an event\n * type.\n */\n\nfunction off(elem, type, fn) {\n // Don't want to add a cache object through getElData if not needed\n if (!hasData(elem)) {\n return;\n }\n\n var data = getData(elem); // If no events exist, nothing to unbind\n\n if (!data.handlers) {\n return;\n }\n\n if (Array.isArray(type)) {\n return _handleMultipleEvents(off, elem, type, fn);\n } // Utility function\n\n\n var removeType = function removeType(el, t) {\n data.handlers[t] = [];\n\n _cleanUpEvents(el, t);\n }; // Are we removing all bound events?\n\n\n if (type === undefined) {\n for (var t in data.handlers) {\n if (Object.prototype.hasOwnProperty.call(data.handlers || {}, t)) {\n removeType(elem, t);\n }\n }\n\n return;\n }\n\n var handlers = data.handlers[type]; // If no handlers exist, nothing to unbind\n\n if (!handlers) {\n return;\n } // If no listener was provided, remove all listeners for type\n\n\n if (!fn) {\n removeType(elem, type);\n return;\n } // We're only removing a single handler\n\n\n if (fn.guid) {\n for (var n = 0; n < handlers.length; n++) {\n if (handlers[n].guid === fn.guid) {\n handlers.splice(n--, 1);\n }\n }\n }\n\n _cleanUpEvents(elem, type);\n}\n/**\n * Trigger an event for an element\n *\n * @param {Element|Object} elem\n * Element to trigger an event on\n *\n * @param {EventTarget~Event|string} event\n * A string (the type) or an event object with a type attribute\n *\n * @param {Object} [hash]\n * data hash to pass along with the event\n *\n * @return {boolean|undefined}\n * Returns the opposite of `defaultPrevented` if default was\n * prevented. Otherwise, returns `undefined`\n */\n\nfunction trigger(elem, event, hash) {\n // Fetches element data and a reference to the parent (for bubbling).\n // Don't want to add a data object to cache for every parent,\n // so checking hasElData first.\n var elemData = hasData(elem) ? getData(elem) : {};\n var parent = elem.parentNode || elem.ownerDocument; // type = event.type || event,\n // handler;\n // If an event name was passed as a string, creates an event out of it\n\n if (typeof event === 'string') {\n event = {\n type: event,\n target: elem\n };\n } else if (!event.target) {\n event.target = elem;\n } // Normalizes the event properties.\n\n\n event = fixEvent(event); // If the passed element has a dispatcher, executes the established handlers.\n\n if (elemData.dispatcher) {\n elemData.dispatcher.call(elem, event, hash);\n } // Unless explicitly stopped or the event does not bubble (e.g. media events)\n // recursively calls this function to bubble the event up the DOM.\n\n\n if (parent && !event.isPropagationStopped() && event.bubbles === true) {\n trigger.call(null, parent, event, hash); // If at the top of the DOM, triggers the default action unless disabled.\n } else if (!parent && !event.defaultPrevented) {\n var targetData = getData(event.target); // Checks if the target has a default action for this event.\n\n if (event.target[event.type]) {\n // Temporarily disables event dispatching on the target as we have already executed the handler.\n targetData.disabled = true; // Executes the default action.\n\n if (typeof event.target[event.type] === 'function') {\n event.target[event.type]();\n } // Re-enables event dispatching.\n\n\n targetData.disabled = false;\n }\n } // Inform the triggerer if the default was prevented by returning false\n\n\n return !event.defaultPrevented;\n}\n/**\n * Trigger a listener only once for an event.\n *\n * @param {Element|Object} elem\n * Element or object to bind to.\n *\n * @param {string|string[]} type\n * Name/type of event\n *\n * @param {Event~EventListener} fn\n * Event listener function\n */\n\nfunction one(elem, type, fn) {\n if (Array.isArray(type)) {\n return _handleMultipleEvents(one, elem, type, fn);\n }\n\n var func = function func() {\n off(elem, type, func);\n fn.apply(this, arguments);\n }; // copy the guid to the new function so it can removed using the original function's ID\n\n\n func.guid = fn.guid = fn.guid || newGUID();\n on(elem, type, func);\n}\n\nvar Events = /*#__PURE__*/Object.freeze({\n fixEvent: fixEvent,\n on: on,\n off: off,\n trigger: trigger,\n one: one\n});\n\n/**\n * @file setup.js - Functions for setting up a player without\n * user interaction based on the data-setup `attribute` of the video tag.\n *\n * @module setup\n */\nvar _windowLoaded = false;\nvar videojs;\n/**\n * Set up any tags that have a data-setup `attribute` when the player is started.\n */\n\nvar autoSetup = function autoSetup() {\n // Protect against breakage in non-browser environments and check global autoSetup option.\n if (!isReal() || videojs.options.autoSetup === false) {\n return;\n }\n\n var vids = Array.prototype.slice.call(document.getElementsByTagName('video'));\n var audios = Array.prototype.slice.call(document.getElementsByTagName('audio'));\n var divs = Array.prototype.slice.call(document.getElementsByTagName('video-js'));\n var mediaEls = vids.concat(audios, divs); // Check if any media elements exist\n\n if (mediaEls && mediaEls.length > 0) {\n for (var i = 0, e = mediaEls.length; i < e; i++) {\n var mediaEl = mediaEls[i]; // Check if element exists, has getAttribute func.\n\n if (mediaEl && mediaEl.getAttribute) {\n // Make sure this player hasn't already been set up.\n if (mediaEl.player === undefined) {\n var options = mediaEl.getAttribute('data-setup'); // Check if data-setup attr exists.\n // We only auto-setup if they've added the data-setup attr.\n\n if (options !== null) {\n // Create new video.js instance.\n videojs(mediaEl);\n }\n } // If getAttribute isn't defined, we need to wait for the DOM.\n\n } else {\n autoSetupTimeout(1);\n break;\n }\n } // No videos were found, so keep looping unless page is finished loading.\n\n } else if (!_windowLoaded) {\n autoSetupTimeout(1);\n }\n};\n/**\n * Wait until the page is loaded before running autoSetup. This will be called in\n * autoSetup if `hasLoaded` returns false.\n *\n * @param {number} wait\n * How long to wait in ms\n *\n * @param {module:videojs} [vjs]\n * The videojs library function\n */\n\n\nfunction autoSetupTimeout(wait, vjs) {\n if (vjs) {\n videojs = vjs;\n }\n\n window$1.setTimeout(autoSetup, wait);\n}\n\nif (isReal() && document.readyState === 'complete') {\n _windowLoaded = true;\n} else {\n /**\n * Listen for the load event on window, and set _windowLoaded to true.\n *\n * @listens load\n */\n one(window$1, 'load', function () {\n _windowLoaded = true;\n });\n}\n\n/**\n * @file stylesheet.js\n * @module stylesheet\n */\n/**\n * Create a DOM syle element given a className for it.\n *\n * @param {string} className\n * The className to add to the created style element.\n *\n * @return {Element}\n * The element that was created.\n */\n\nvar createStyleElement = function createStyleElement(className) {\n var style = document.createElement('style');\n style.className = className;\n return style;\n};\n/**\n * Add text to a DOM element.\n *\n * @param {Element} el\n * The Element to add text content to.\n *\n * @param {string} content\n * The text to add to the element.\n */\n\nvar setTextContent = function setTextContent(el, content) {\n if (el.styleSheet) {\n el.styleSheet.cssText = content;\n } else {\n el.textContent = content;\n }\n};\n\n/**\n * @file fn.js\n * @module fn\n */\n/**\n * Bind (a.k.a proxy or context). A simple method for changing the context of\n * a function.\n *\n * It also stores a unique id on the function so it can be easily removed from\n * events.\n *\n * @function\n * @param {Mixed} context\n * The object to bind as scope.\n *\n * @param {Function} fn\n * The function to be bound to a scope.\n *\n * @param {number} [uid]\n * An optional unique ID for the function to be set\n *\n * @return {Function}\n * The new function that will be bound into the context given\n */\n\nvar bind = function bind(context, fn, uid) {\n // Make sure the function has a unique ID\n if (!fn.guid) {\n fn.guid = newGUID();\n } // Create the new function that changes the context\n\n\n var bound = function bound() {\n return fn.apply(context, arguments);\n }; // Allow for the ability to individualize this function\n // Needed in the case where multiple objects might share the same prototype\n // IF both items add an event listener with the same function, then you try to remove just one\n // it will remove both because they both have the same guid.\n // when using this, you need to use the bind method when you remove the listener as well.\n // currently used in text tracks\n\n\n bound.guid = uid ? uid + '_' + fn.guid : fn.guid;\n return bound;\n};\n/**\n * Wraps the given function, `fn`, with a new function that only invokes `fn`\n * at most once per every `wait` milliseconds.\n *\n * @function\n * @param {Function} fn\n * The function to be throttled.\n *\n * @param {Number} wait\n * The number of milliseconds by which to throttle.\n *\n * @return {Function}\n */\n\nvar throttle = function throttle(fn, wait) {\n var last = Date.now();\n\n var throttled = function throttled() {\n var now = Date.now();\n\n if (now - last >= wait) {\n fn.apply(void 0, arguments);\n last = now;\n }\n };\n\n return throttled;\n};\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked.\n *\n * Inspired by lodash and underscore implementations.\n *\n * @function\n * @param {Function} func\n * The function to wrap with debounce behavior.\n *\n * @param {number} wait\n * The number of milliseconds to wait after the last invocation.\n *\n * @param {boolean} [immediate]\n * Whether or not to invoke the function immediately upon creation.\n *\n * @param {Object} [context=window]\n * The \"context\" in which the debounced function should debounce. For\n * example, if this function should be tied to a Video.js player,\n * the player can be passed here. Alternatively, defaults to the\n * global `window` object.\n *\n * @return {Function}\n * A debounced function.\n */\n\nvar debounce = function debounce(func, wait, immediate, context) {\n if (context === void 0) {\n context = window$1;\n }\n\n var timeout;\n\n var cancel = function cancel() {\n context.clearTimeout(timeout);\n timeout = null;\n };\n /* eslint-disable consistent-this */\n\n\n var debounced = function debounced() {\n var self = this;\n var args = arguments;\n\n var _later = function later() {\n timeout = null;\n _later = null;\n\n if (!immediate) {\n func.apply(self, args);\n }\n };\n\n if (!timeout && immediate) {\n func.apply(self, args);\n }\n\n context.clearTimeout(timeout);\n timeout = context.setTimeout(_later, wait);\n };\n /* eslint-enable consistent-this */\n\n\n debounced.cancel = cancel;\n return debounced;\n};\n\n/**\n * @file src/js/event-target.js\n */\n/**\n * `EventTarget` is a class that can have the same API as the DOM `EventTarget`. It\n * adds shorthand functions that wrap around lengthy functions. For example:\n * the `on` function is a wrapper around `addEventListener`.\n *\n * @see [EventTarget Spec]{@link https://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-EventTarget}\n * @class EventTarget\n */\n\nvar EventTarget = function EventTarget() {};\n/**\n * A Custom DOM event.\n *\n * @typedef {Object} EventTarget~Event\n * @see [Properties]{@link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent}\n */\n\n/**\n * All event listeners should follow the following format.\n *\n * @callback EventTarget~EventListener\n * @this {EventTarget}\n *\n * @param {EventTarget~Event} event\n * the event that triggered this function\n *\n * @param {Object} [hash]\n * hash of data sent during the event\n */\n\n/**\n * An object containing event names as keys and booleans as values.\n *\n * > NOTE: If an event name is set to a true value here {@link EventTarget#trigger}\n * will have extra functionality. See that function for more information.\n *\n * @property EventTarget.prototype.allowedEvents_\n * @private\n */\n\n\nEventTarget.prototype.allowedEvents_ = {};\n/**\n * Adds an `event listener` to an instance of an `EventTarget`. An `event listener` is a\n * function that will get called when an event with a certain name gets triggered.\n *\n * @param {string|string[]} type\n * An event name or an array of event names.\n *\n * @param {EventTarget~EventListener} fn\n * The function to call with `EventTarget`s\n */\n\nEventTarget.prototype.on = function (type, fn) {\n // Remove the addEventListener alias before calling Events.on\n // so we don't get into an infinite type loop\n var ael = this.addEventListener;\n\n this.addEventListener = function () {};\n\n on(this, type, fn);\n this.addEventListener = ael;\n};\n/**\n * An alias of {@link EventTarget#on}. Allows `EventTarget` to mimic\n * the standard DOM API.\n *\n * @function\n * @see {@link EventTarget#on}\n */\n\n\nEventTarget.prototype.addEventListener = EventTarget.prototype.on;\n/**\n * Removes an `event listener` for a specific event from an instance of `EventTarget`.\n * This makes it so that the `event listener` will no longer get called when the\n * named event happens.\n *\n * @param {string|string[]} type\n * An event name or an array of event names.\n *\n * @param {EventTarget~EventListener} fn\n * The function to remove.\n */\n\nEventTarget.prototype.off = function (type, fn) {\n off(this, type, fn);\n};\n/**\n * An alias of {@link EventTarget#off}. Allows `EventTarget` to mimic\n * the standard DOM API.\n *\n * @function\n * @see {@link EventTarget#off}\n */\n\n\nEventTarget.prototype.removeEventListener = EventTarget.prototype.off;\n/**\n * This function will add an `event listener` that gets triggered only once. After the\n * first trigger it will get removed. This is like adding an `event listener`\n * with {@link EventTarget#on} that calls {@link EventTarget#off} on itself.\n *\n * @param {string|string[]} type\n * An event name or an array of event names.\n *\n * @param {EventTarget~EventListener} fn\n * The function to be called once for each event name.\n */\n\nEventTarget.prototype.one = function (type, fn) {\n // Remove the addEventListener alialing Events.on\n // so we don't get into an infinite type loop\n var ael = this.addEventListener;\n\n this.addEventListener = function () {};\n\n one(this, type, fn);\n this.addEventListener = ael;\n};\n/**\n * This function causes an event to happen. This will then cause any `event listeners`\n * that are waiting for that event, to get called. If there are no `event listeners`\n * for an event then nothing will happen.\n *\n * If the name of the `Event` that is being triggered is in `EventTarget.allowedEvents_`.\n * Trigger will also call the `on` + `uppercaseEventName` function.\n *\n * Example:\n * 'click' is in `EventTarget.allowedEvents_`, so, trigger will attempt to call\n * `onClick` if it exists.\n *\n * @param {string|EventTarget~Event|Object} event\n * The name of the event, an `Event`, or an object with a key of type set to\n * an event name.\n */\n\n\nEventTarget.prototype.trigger = function (event) {\n var type = event.type || event;\n\n if (typeof event === 'string') {\n event = {\n type: type\n };\n }\n\n event = fixEvent(event);\n\n if (this.allowedEvents_[type] && this['on' + type]) {\n this['on' + type](event);\n }\n\n trigger(this, event);\n};\n/**\n * An alias of {@link EventTarget#trigger}. Allows `EventTarget` to mimic\n * the standard DOM API.\n *\n * @function\n * @see {@link EventTarget#trigger}\n */\n\n\nEventTarget.prototype.dispatchEvent = EventTarget.prototype.trigger;\nvar EVENT_MAP;\n\nEventTarget.prototype.queueTrigger = function (event) {\n var _this = this;\n\n // only set up EVENT_MAP if it'll be used\n if (!EVENT_MAP) {\n EVENT_MAP = new Map();\n }\n\n var type = event.type || event;\n var map = EVENT_MAP.get(this);\n\n if (!map) {\n map = new Map();\n EVENT_MAP.set(this, map);\n }\n\n var oldTimeout = map.get(type);\n map.delete(type);\n window$1.clearTimeout(oldTimeout);\n var timeout = window$1.setTimeout(function () {\n // if we cleared out all timeouts for the current target, delete its map\n if (map.size === 0) {\n map = null;\n EVENT_MAP.delete(_this);\n }\n\n _this.trigger(event);\n }, 0);\n map.set(type, timeout);\n};\n\n/**\n * @file mixins/evented.js\n * @module evented\n */\n/**\n * Returns whether or not an object has had the evented mixin applied.\n *\n * @param {Object} object\n * An object to test.\n *\n * @return {boolean}\n * Whether or not the object appears to be evented.\n */\n\nvar isEvented = function isEvented(object) {\n return object instanceof EventTarget || !!object.eventBusEl_ && ['on', 'one', 'off', 'trigger'].every(function (k) {\n return typeof object[k] === 'function';\n });\n};\n/**\n * Adds a callback to run after the evented mixin applied.\n *\n * @param {Object} object\n * An object to Add\n * @param {Function} callback\n * The callback to run.\n */\n\n\nvar addEventedCallback = function addEventedCallback(target, callback) {\n if (isEvented(target)) {\n callback();\n } else {\n if (!target.eventedCallbacks) {\n target.eventedCallbacks = [];\n }\n\n target.eventedCallbacks.push(callback);\n }\n};\n/**\n * Whether a value is a valid event type - non-empty string or array.\n *\n * @private\n * @param {string|Array} type\n * The type value to test.\n *\n * @return {boolean}\n * Whether or not the type is a valid event type.\n */\n\n\nvar isValidEventType = function isValidEventType(type) {\n return (// The regex here verifies that the `type` contains at least one non-\n // whitespace character.\n typeof type === 'string' && /\\S/.test(type) || Array.isArray(type) && !!type.length\n );\n};\n/**\n * Validates a value to determine if it is a valid event target. Throws if not.\n *\n * @private\n * @throws {Error}\n * If the target does not appear to be a valid event target.\n *\n * @param {Object} target\n * The object to test.\n */\n\n\nvar validateTarget = function validateTarget(target) {\n if (!target.nodeName && !isEvented(target)) {\n throw new Error('Invalid target; must be a DOM node or evented object.');\n }\n};\n/**\n * Validates a value to determine if it is a valid event target. Throws if not.\n *\n * @private\n * @throws {Error}\n * If the type does not appear to be a valid event type.\n *\n * @param {string|Array} type\n * The type to test.\n */\n\n\nvar validateEventType = function validateEventType(type) {\n if (!isValidEventType(type)) {\n throw new Error('Invalid event type; must be a non-empty string or array.');\n }\n};\n/**\n * Validates a value to determine if it is a valid listener. Throws if not.\n *\n * @private\n * @throws {Error}\n * If the listener is not a function.\n *\n * @param {Function} listener\n * The listener to test.\n */\n\n\nvar validateListener = function validateListener(listener) {\n if (typeof listener !== 'function') {\n throw new Error('Invalid listener; must be a function.');\n }\n};\n/**\n * Takes an array of arguments given to `on()` or `one()`, validates them, and\n * normalizes them into an object.\n *\n * @private\n * @param {Object} self\n * The evented object on which `on()` or `one()` was called. This\n * object will be bound as the `this` value for the listener.\n *\n * @param {Array} args\n * An array of arguments passed to `on()` or `one()`.\n *\n * @return {Object}\n * An object containing useful values for `on()` or `one()` calls.\n */\n\n\nvar normalizeListenArgs = function normalizeListenArgs(self, args) {\n // If the number of arguments is less than 3, the target is always the\n // evented object itself.\n var isTargetingSelf = args.length < 3 || args[0] === self || args[0] === self.eventBusEl_;\n var target;\n var type;\n var listener;\n\n if (isTargetingSelf) {\n target = self.eventBusEl_; // Deal with cases where we got 3 arguments, but we are still listening to\n // the evented object itself.\n\n if (args.length >= 3) {\n args.shift();\n }\n\n type = args[0];\n listener = args[1];\n } else {\n target = args[0];\n type = args[1];\n listener = args[2];\n }\n\n validateTarget(target);\n validateEventType(type);\n validateListener(listener);\n listener = bind(self, listener);\n return {\n isTargetingSelf: isTargetingSelf,\n target: target,\n type: type,\n listener: listener\n };\n};\n/**\n * Adds the listener to the event type(s) on the target, normalizing for\n * the type of target.\n *\n * @private\n * @param {Element|Object} target\n * A DOM node or evented object.\n *\n * @param {string} method\n * The event binding method to use (\"on\" or \"one\").\n *\n * @param {string|Array} type\n * One or more event type(s).\n *\n * @param {Function} listener\n * A listener function.\n */\n\n\nvar listen = function listen(target, method, type, listener) {\n validateTarget(target);\n\n if (target.nodeName) {\n Events[method](target, type, listener);\n } else {\n target[method](type, listener);\n }\n};\n/**\n * Contains methods that provide event capabilities to an object which is passed\n * to {@link module:evented|evented}.\n *\n * @mixin EventedMixin\n */\n\n\nvar EventedMixin = {\n /**\n * Add a listener to an event (or events) on this object or another evented\n * object.\n *\n * @param {string|Array|Element|Object} targetOrType\n * If this is a string or array, it represents the event type(s)\n * that will trigger the listener.\n *\n * Another evented object can be passed here instead, which will\n * cause the listener to listen for events on _that_ object.\n *\n * In either case, the listener's `this` value will be bound to\n * this object.\n *\n * @param {string|Array|Function} typeOrListener\n * If the first argument was a string or array, this should be the\n * listener function. Otherwise, this is a string or array of event\n * type(s).\n *\n * @param {Function} [listener]\n * If the first argument was another evented object, this will be\n * the listener function.\n */\n on: function on$$1() {\n var _this = this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var _normalizeListenArgs = normalizeListenArgs(this, args),\n isTargetingSelf = _normalizeListenArgs.isTargetingSelf,\n target = _normalizeListenArgs.target,\n type = _normalizeListenArgs.type,\n listener = _normalizeListenArgs.listener;\n\n listen(target, 'on', type, listener); // If this object is listening to another evented object.\n\n if (!isTargetingSelf) {\n // If this object is disposed, remove the listener.\n var removeListenerOnDispose = function removeListenerOnDispose() {\n return _this.off(target, type, listener);\n }; // Use the same function ID as the listener so we can remove it later it\n // using the ID of the original listener.\n\n\n removeListenerOnDispose.guid = listener.guid; // Add a listener to the target's dispose event as well. This ensures\n // that if the target is disposed BEFORE this object, we remove the\n // removal listener that was just added. Otherwise, we create a memory leak.\n\n var removeRemoverOnTargetDispose = function removeRemoverOnTargetDispose() {\n return _this.off('dispose', removeListenerOnDispose);\n }; // Use the same function ID as the listener so we can remove it later\n // it using the ID of the original listener.\n\n\n removeRemoverOnTargetDispose.guid = listener.guid;\n listen(this, 'on', 'dispose', removeListenerOnDispose);\n listen(target, 'on', 'dispose', removeRemoverOnTargetDispose);\n }\n },\n\n /**\n * Add a listener to an event (or events) on this object or another evented\n * object. The listener will only be called once and then removed.\n *\n * @param {string|Array|Element|Object} targetOrType\n * If this is a string or array, it represents the event type(s)\n * that will trigger the listener.\n *\n * Another evented object can be passed here instead, which will\n * cause the listener to listen for events on _that_ object.\n *\n * In either case, the listener's `this` value will be bound to\n * this object.\n *\n * @param {string|Array|Function} typeOrListener\n * If the first argument was a string or array, this should be the\n * listener function. Otherwise, this is a string or array of event\n * type(s).\n *\n * @param {Function} [listener]\n * If the first argument was another evented object, this will be\n * the listener function.\n */\n one: function one$$1() {\n var _this2 = this;\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n var _normalizeListenArgs2 = normalizeListenArgs(this, args),\n isTargetingSelf = _normalizeListenArgs2.isTargetingSelf,\n target = _normalizeListenArgs2.target,\n type = _normalizeListenArgs2.type,\n listener = _normalizeListenArgs2.listener; // Targeting this evented object.\n\n\n if (isTargetingSelf) {\n listen(target, 'one', type, listener); // Targeting another evented object.\n } else {\n var wrapper = function wrapper() {\n _this2.off(target, type, wrapper);\n\n for (var _len3 = arguments.length, largs = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n largs[_key3] = arguments[_key3];\n }\n\n listener.apply(null, largs);\n }; // Use the same function ID as the listener so we can remove it later\n // it using the ID of the original listener.\n\n\n wrapper.guid = listener.guid;\n listen(target, 'one', type, wrapper);\n }\n },\n\n /**\n * Removes listener(s) from event(s) on an evented object.\n *\n * @param {string|Array|Element|Object} [targetOrType]\n * If this is a string or array, it represents the event type(s).\n *\n * Another evented object can be passed here instead, in which case\n * ALL 3 arguments are _required_.\n *\n * @param {string|Array|Function} [typeOrListener]\n * If the first argument was a string or array, this may be the\n * listener function. Otherwise, this is a string or array of event\n * type(s).\n *\n * @param {Function} [listener]\n * If the first argument was another evented object, this will be\n * the listener function; otherwise, _all_ listeners bound to the\n * event type(s) will be removed.\n */\n off: function off$$1(targetOrType, typeOrListener, listener) {\n // Targeting this evented object.\n if (!targetOrType || isValidEventType(targetOrType)) {\n off(this.eventBusEl_, targetOrType, typeOrListener); // Targeting another evented object.\n } else {\n var target = targetOrType;\n var type = typeOrListener; // Fail fast and in a meaningful way!\n\n validateTarget(target);\n validateEventType(type);\n validateListener(listener); // Ensure there's at least a guid, even if the function hasn't been used\n\n listener = bind(this, listener); // Remove the dispose listener on this evented object, which was given\n // the same guid as the event listener in on().\n\n this.off('dispose', listener);\n\n if (target.nodeName) {\n off(target, type, listener);\n off(target, 'dispose', listener);\n } else if (isEvented(target)) {\n target.off(type, listener);\n target.off('dispose', listener);\n }\n }\n },\n\n /**\n * Fire an event on this evented object, causing its listeners to be called.\n *\n * @param {string|Object} event\n * An event type or an object with a type property.\n *\n * @param {Object} [hash]\n * An additional object to pass along to listeners.\n *\n * @return {boolean}\n * Whether or not the default behavior was prevented.\n */\n trigger: function trigger$$1(event, hash) {\n return trigger(this.eventBusEl_, event, hash);\n }\n};\n/**\n * Applies {@link module:evented~EventedMixin|EventedMixin} to a target object.\n *\n * @param {Object} target\n * The object to which to add event methods.\n *\n * @param {Object} [options={}]\n * Options for customizing the mixin behavior.\n *\n * @param {string} [options.eventBusKey]\n * By default, adds a `eventBusEl_` DOM element to the target object,\n * which is used as an event bus. If the target object already has a\n * DOM element that should be used, pass its key here.\n *\n * @return {Object}\n * The target object.\n */\n\nfunction evented(target, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n eventBusKey = _options.eventBusKey; // Set or create the eventBusEl_.\n\n if (eventBusKey) {\n if (!target[eventBusKey].nodeName) {\n throw new Error(\"The eventBusKey \\\"\" + eventBusKey + \"\\\" does not refer to an element.\");\n }\n\n target.eventBusEl_ = target[eventBusKey];\n } else {\n target.eventBusEl_ = createEl('span', {\n className: 'vjs-event-bus'\n });\n }\n\n assign(target, EventedMixin);\n\n if (target.eventedCallbacks) {\n target.eventedCallbacks.forEach(function (callback) {\n callback();\n });\n } // When any evented object is disposed, it removes all its listeners.\n\n\n target.on('dispose', function () {\n target.off();\n window$1.setTimeout(function () {\n target.eventBusEl_ = null;\n }, 0);\n });\n return target;\n}\n\n/**\n * @file mixins/stateful.js\n * @module stateful\n */\n/**\n * Contains methods that provide statefulness to an object which is passed\n * to {@link module:stateful}.\n *\n * @mixin StatefulMixin\n */\n\nvar StatefulMixin = {\n /**\n * A hash containing arbitrary keys and values representing the state of\n * the object.\n *\n * @type {Object}\n */\n state: {},\n\n /**\n * Set the state of an object by mutating its\n * {@link module:stateful~StatefulMixin.state|state} object in place.\n *\n * @fires module:stateful~StatefulMixin#statechanged\n * @param {Object|Function} stateUpdates\n * A new set of properties to shallow-merge into the plugin state.\n * Can be a plain object or a function returning a plain object.\n *\n * @return {Object|undefined}\n * An object containing changes that occurred. If no changes\n * occurred, returns `undefined`.\n */\n setState: function setState(stateUpdates) {\n var _this = this;\n\n // Support providing the `stateUpdates` state as a function.\n if (typeof stateUpdates === 'function') {\n stateUpdates = stateUpdates();\n }\n\n var changes;\n each(stateUpdates, function (value, key) {\n // Record the change if the value is different from what's in the\n // current state.\n if (_this.state[key] !== value) {\n changes = changes || {};\n changes[key] = {\n from: _this.state[key],\n to: value\n };\n }\n\n _this.state[key] = value;\n }); // Only trigger \"statechange\" if there were changes AND we have a trigger\n // function. This allows us to not require that the target object be an\n // evented object.\n\n if (changes && isEvented(this)) {\n /**\n * An event triggered on an object that is both\n * {@link module:stateful|stateful} and {@link module:evented|evented}\n * indicating that its state has changed.\n *\n * @event module:stateful~StatefulMixin#statechanged\n * @type {Object}\n * @property {Object} changes\n * A hash containing the properties that were changed and\n * the values they were changed `from` and `to`.\n */\n this.trigger({\n changes: changes,\n type: 'statechanged'\n });\n }\n\n return changes;\n }\n};\n/**\n * Applies {@link module:stateful~StatefulMixin|StatefulMixin} to a target\n * object.\n *\n * If the target object is {@link module:evented|evented} and has a\n * `handleStateChanged` method, that method will be automatically bound to the\n * `statechanged` event on itself.\n *\n * @param {Object} target\n * The object to be made stateful.\n *\n * @param {Object} [defaultState]\n * A default set of properties to populate the newly-stateful object's\n * `state` property.\n *\n * @return {Object}\n * Returns the `target`.\n */\n\nfunction stateful(target, defaultState) {\n assign(target, StatefulMixin); // This happens after the mixing-in because we need to replace the `state`\n // added in that step.\n\n target.state = assign({}, target.state, defaultState); // Auto-bind the `handleStateChanged` method of the target object if it exists.\n\n if (typeof target.handleStateChanged === 'function' && isEvented(target)) {\n target.on('statechanged', target.handleStateChanged);\n }\n\n return target;\n}\n\n/**\n * @file to-title-case.js\n * @module to-title-case\n */\n\n/**\n * Uppercase the first letter of a string.\n *\n * @param {string} string\n * String to be uppercased\n *\n * @return {string}\n * The string with an uppercased first letter\n */\nfunction toTitleCase(string) {\n if (typeof string !== 'string') {\n return string;\n }\n\n return string.charAt(0).toUpperCase() + string.slice(1);\n}\n/**\n * Compares the TitleCase versions of the two strings for equality.\n *\n * @param {string} str1\n * The first string to compare\n *\n * @param {string} str2\n * The second string to compare\n *\n * @return {boolean}\n * Whether the TitleCase versions of the strings are equal\n */\n\nfunction titleCaseEquals(str1, str2) {\n return toTitleCase(str1) === toTitleCase(str2);\n}\n\n/**\n * @file merge-options.js\n * @module merge-options\n */\n/**\n * Merge two objects recursively.\n *\n * Performs a deep merge like\n * {@link https://lodash.com/docs/4.17.10#merge|lodash.merge}, but only merges\n * plain objects (not arrays, elements, or anything else).\n *\n * Non-plain object values will be copied directly from the right-most\n * argument.\n *\n * @static\n * @param {Object[]} sources\n * One or more objects to merge into a new object.\n *\n * @return {Object}\n * A new object that is the merged result of all sources.\n */\n\nfunction mergeOptions() {\n var result = {};\n\n for (var _len = arguments.length, sources = new Array(_len), _key = 0; _key < _len; _key++) {\n sources[_key] = arguments[_key];\n }\n\n sources.forEach(function (source) {\n if (!source) {\n return;\n }\n\n each(source, function (value, key) {\n if (!isPlain(value)) {\n result[key] = value;\n return;\n }\n\n if (!isPlain(result[key])) {\n result[key] = {};\n }\n\n result[key] = mergeOptions(result[key], value);\n });\n });\n return result;\n}\n\n/**\n * Player Component - Base class for all UI objects\n *\n * @file component.js\n */\n/**\n * Base class for all UI Components.\n * Components are UI objects which represent both a javascript object and an element\n * in the DOM. They can be children of other components, and can have\n * children themselves.\n *\n * Components can also use methods from {@link EventTarget}\n */\n\nvar Component =\n/*#__PURE__*/\nfunction () {\n /**\n * A callback that is called when a component is ready. Does not have any\n * paramters and any callback value will be ignored.\n *\n * @callback Component~ReadyCallback\n * @this Component\n */\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Object[]} [options.children]\n * An array of children objects to intialize this component with. Children objects have\n * a name property that will be used if more than one component of the same type needs to be\n * added.\n *\n * @param {Component~ReadyCallback} [ready]\n * Function that gets called when the `Component` is ready.\n */\n function Component(player, options, ready) {\n // The component might be the player itself and we can't pass `this` to super\n if (!player && this.play) {\n this.player_ = player = this; // eslint-disable-line\n } else {\n this.player_ = player;\n } // Make a copy of prototype.options_ to protect against overriding defaults\n\n\n this.options_ = mergeOptions({}, this.options_); // Updated options with supplied options\n\n options = this.options_ = mergeOptions(this.options_, options); // Get ID from options or options element if one is supplied\n\n this.id_ = options.id || options.el && options.el.id; // If there was no ID from the options, generate one\n\n if (!this.id_) {\n // Don't require the player ID function in the case of mock players\n var id = player && player.id && player.id() || 'no_player';\n this.id_ = id + \"_component_\" + newGUID();\n }\n\n this.name_ = options.name || null; // Create element if one wasn't provided in options\n\n if (options.el) {\n this.el_ = options.el;\n } else if (options.createEl !== false) {\n this.el_ = this.createEl();\n } // if evented is anything except false, we want to mixin in evented\n\n\n if (options.evented !== false) {\n // Make this an evented object and use `el_`, if available, as its event bus\n evented(this, {\n eventBusKey: this.el_ ? 'el_' : null\n });\n }\n\n stateful(this, this.constructor.defaultState);\n this.children_ = [];\n this.childIndex_ = {};\n this.childNameIndex_ = {}; // Add any child components in options\n\n if (options.initChildren !== false) {\n this.initChildren();\n }\n\n this.ready(ready); // Don't want to trigger ready here or it will before init is actually\n // finished for all children that run this constructor\n\n if (options.reportTouchActivity !== false) {\n this.enableTouchActivity();\n }\n }\n /**\n * Dispose of the `Component` and all child components.\n *\n * @fires Component#dispose\n */\n\n\n var _proto = Component.prototype;\n\n _proto.dispose = function dispose() {\n /**\n * Triggered when a `Component` is disposed.\n *\n * @event Component#dispose\n * @type {EventTarget~Event}\n *\n * @property {boolean} [bubbles=false]\n * set to false so that the close event does not\n * bubble up\n */\n this.trigger({\n type: 'dispose',\n bubbles: false\n }); // Dispose all children.\n\n if (this.children_) {\n for (var i = this.children_.length - 1; i >= 0; i--) {\n if (this.children_[i].dispose) {\n this.children_[i].dispose();\n }\n }\n } // Delete child references\n\n\n this.children_ = null;\n this.childIndex_ = null;\n this.childNameIndex_ = null;\n\n if (this.el_) {\n // Remove element from DOM\n if (this.el_.parentNode) {\n this.el_.parentNode.removeChild(this.el_);\n }\n\n removeData(this.el_);\n this.el_ = null;\n } // remove reference to the player after disposing of the element\n\n\n this.player_ = null;\n };\n /**\n * Return the {@link Player} that the `Component` has attached to.\n *\n * @return {Player}\n * The player that this `Component` has attached to.\n */\n\n\n _proto.player = function player() {\n return this.player_;\n };\n /**\n * Deep merge of options objects with new options.\n * > Note: When both `obj` and `options` contain properties whose values are objects.\n * The two properties get merged using {@link module:mergeOptions}\n *\n * @param {Object} obj\n * The object that contains new options.\n *\n * @return {Object}\n * A new object of `this.options_` and `obj` merged together.\n *\n * @deprecated since version 5\n */\n\n\n _proto.options = function options(obj) {\n log.warn('this.options() has been deprecated and will be moved to the constructor in 6.0');\n\n if (!obj) {\n return this.options_;\n }\n\n this.options_ = mergeOptions(this.options_, obj);\n return this.options_;\n };\n /**\n * Get the `Component`s DOM element\n *\n * @return {Element}\n * The DOM element for this `Component`.\n */\n\n\n _proto.el = function el() {\n return this.el_;\n };\n /**\n * Create the `Component`s DOM element.\n *\n * @param {string} [tagName]\n * Element's DOM node type. e.g. 'div'\n *\n * @param {Object} [properties]\n * An object of properties that should be set.\n *\n * @param {Object} [attributes]\n * An object of attributes that should be set.\n *\n * @return {Element}\n * The element that gets created.\n */\n\n\n _proto.createEl = function createEl$$1(tagName, properties, attributes) {\n return createEl(tagName, properties, attributes);\n };\n /**\n * Localize a string given the string in english.\n *\n * If tokens are provided, it'll try and run a simple token replacement on the provided string.\n * The tokens it looks for look like `{1}` with the index being 1-indexed into the tokens array.\n *\n * If a `defaultValue` is provided, it'll use that over `string`,\n * if a value isn't found in provided language files.\n * This is useful if you want to have a descriptive key for token replacement\n * but have a succinct localized string and not require `en.json` to be included.\n *\n * Currently, it is used for the progress bar timing.\n * ```js\n * {\n * \"progress bar timing: currentTime={1} duration={2}\": \"{1} of {2}\"\n * }\n * ```\n * It is then used like so:\n * ```js\n * this.localize('progress bar timing: currentTime={1} duration{2}',\n * [this.player_.currentTime(), this.player_.duration()],\n * '{1} of {2}');\n * ```\n *\n * Which outputs something like: `01:23 of 24:56`.\n *\n *\n * @param {string} string\n * The string to localize and the key to lookup in the language files.\n * @param {string[]} [tokens]\n * If the current item has token replacements, provide the tokens here.\n * @param {string} [defaultValue]\n * Defaults to `string`. Can be a default value to use for token replacement\n * if the lookup key is needed to be separate.\n *\n * @return {string}\n * The localized string or if no localization exists the english string.\n */\n\n\n _proto.localize = function localize(string, tokens, defaultValue) {\n if (defaultValue === void 0) {\n defaultValue = string;\n }\n\n var code = this.player_.language && this.player_.language();\n var languages = this.player_.languages && this.player_.languages();\n var language = languages && languages[code];\n var primaryCode = code && code.split('-')[0];\n var primaryLang = languages && languages[primaryCode];\n var localizedString = defaultValue;\n\n if (language && language[string]) {\n localizedString = language[string];\n } else if (primaryLang && primaryLang[string]) {\n localizedString = primaryLang[string];\n }\n\n if (tokens) {\n localizedString = localizedString.replace(/\\{(\\d+)\\}/g, function (match, index) {\n var value = tokens[index - 1];\n var ret = value;\n\n if (typeof value === 'undefined') {\n ret = match;\n }\n\n return ret;\n });\n }\n\n return localizedString;\n };\n /**\n * Return the `Component`s DOM element. This is where children get inserted.\n * This will usually be the the same as the element returned in {@link Component#el}.\n *\n * @return {Element}\n * The content element for this `Component`.\n */\n\n\n _proto.contentEl = function contentEl() {\n return this.contentEl_ || this.el_;\n };\n /**\n * Get this `Component`s ID\n *\n * @return {string}\n * The id of this `Component`\n */\n\n\n _proto.id = function id() {\n return this.id_;\n };\n /**\n * Get the `Component`s name. The name gets used to reference the `Component`\n * and is set during registration.\n *\n * @return {string}\n * The name of this `Component`.\n */\n\n\n _proto.name = function name() {\n return this.name_;\n };\n /**\n * Get an array of all child components\n *\n * @return {Array}\n * The children\n */\n\n\n _proto.children = function children() {\n return this.children_;\n };\n /**\n * Returns the child `Component` with the given `id`.\n *\n * @param {string} id\n * The id of the child `Component` to get.\n *\n * @return {Component|undefined}\n * The child `Component` with the given `id` or undefined.\n */\n\n\n _proto.getChildById = function getChildById(id) {\n return this.childIndex_[id];\n };\n /**\n * Returns the child `Component` with the given `name`.\n *\n * @param {string} name\n * The name of the child `Component` to get.\n *\n * @return {Component|undefined}\n * The child `Component` with the given `name` or undefined.\n */\n\n\n _proto.getChild = function getChild(name) {\n if (!name) {\n return;\n }\n\n name = toTitleCase(name);\n return this.childNameIndex_[name];\n };\n /**\n * Add a child `Component` inside the current `Component`.\n *\n *\n * @param {string|Component} child\n * The name or instance of a child to add.\n *\n * @param {Object} [options={}]\n * The key/value store of options that will get passed to children of\n * the child.\n *\n * @param {number} [index=this.children_.length]\n * The index to attempt to add a child into.\n *\n * @return {Component}\n * The `Component` that gets added as a child. When using a string the\n * `Component` will get created by this process.\n */\n\n\n _proto.addChild = function addChild(child, options, index) {\n if (options === void 0) {\n options = {};\n }\n\n if (index === void 0) {\n index = this.children_.length;\n }\n\n var component;\n var componentName; // If child is a string, create component with options\n\n if (typeof child === 'string') {\n componentName = toTitleCase(child);\n var componentClassName = options.componentClass || componentName; // Set name through options\n\n options.name = componentName; // Create a new object & element for this controls set\n // If there's no .player_, this is a player\n\n var ComponentClass = Component.getComponent(componentClassName);\n\n if (!ComponentClass) {\n throw new Error(\"Component \" + componentClassName + \" does not exist\");\n } // data stored directly on the videojs object may be\n // misidentified as a component to retain\n // backwards-compatibility with 4.x. check to make sure the\n // component class can be instantiated.\n\n\n if (typeof ComponentClass !== 'function') {\n return null;\n }\n\n component = new ComponentClass(this.player_ || this, options); // child is a component instance\n } else {\n component = child;\n }\n\n this.children_.splice(index, 0, component);\n\n if (typeof component.id === 'function') {\n this.childIndex_[component.id()] = component;\n } // If a name wasn't used to create the component, check if we can use the\n // name function of the component\n\n\n componentName = componentName || component.name && toTitleCase(component.name());\n\n if (componentName) {\n this.childNameIndex_[componentName] = component;\n } // Add the UI object's element to the container div (box)\n // Having an element is not required\n\n\n if (typeof component.el === 'function' && component.el()) {\n var childNodes = this.contentEl().children;\n var refNode = childNodes[index] || null;\n this.contentEl().insertBefore(component.el(), refNode);\n } // Return so it can stored on parent object if desired.\n\n\n return component;\n };\n /**\n * Remove a child `Component` from this `Component`s list of children. Also removes\n * the child `Component`s element from this `Component`s element.\n *\n * @param {Component} component\n * The child `Component` to remove.\n */\n\n\n _proto.removeChild = function removeChild(component) {\n if (typeof component === 'string') {\n component = this.getChild(component);\n }\n\n if (!component || !this.children_) {\n return;\n }\n\n var childFound = false;\n\n for (var i = this.children_.length - 1; i >= 0; i--) {\n if (this.children_[i] === component) {\n childFound = true;\n this.children_.splice(i, 1);\n break;\n }\n }\n\n if (!childFound) {\n return;\n }\n\n this.childIndex_[component.id()] = null;\n this.childNameIndex_[component.name()] = null;\n var compEl = component.el();\n\n if (compEl && compEl.parentNode === this.contentEl()) {\n this.contentEl().removeChild(component.el());\n }\n };\n /**\n * Add and initialize default child `Component`s based upon options.\n */\n\n\n _proto.initChildren = function initChildren() {\n var _this = this;\n\n var children = this.options_.children;\n\n if (children) {\n // `this` is `parent`\n var parentOptions = this.options_;\n\n var handleAdd = function handleAdd(child) {\n var name = child.name;\n var opts = child.opts; // Allow options for children to be set at the parent options\n // e.g. videojs(id, { controlBar: false });\n // instead of videojs(id, { children: { controlBar: false });\n\n if (parentOptions[name] !== undefined) {\n opts = parentOptions[name];\n } // Allow for disabling default components\n // e.g. options['children']['posterImage'] = false\n\n\n if (opts === false) {\n return;\n } // Allow options to be passed as a simple boolean if no configuration\n // is necessary.\n\n\n if (opts === true) {\n opts = {};\n } // We also want to pass the original player options\n // to each component as well so they don't need to\n // reach back into the player for options later.\n\n\n opts.playerOptions = _this.options_.playerOptions; // Create and add the child component.\n // Add a direct reference to the child by name on the parent instance.\n // If two of the same component are used, different names should be supplied\n // for each\n\n var newChild = _this.addChild(name, opts);\n\n if (newChild) {\n _this[name] = newChild;\n }\n }; // Allow for an array of children details to passed in the options\n\n\n var workingChildren;\n var Tech = Component.getComponent('Tech');\n\n if (Array.isArray(children)) {\n workingChildren = children;\n } else {\n workingChildren = Object.keys(children);\n }\n\n workingChildren // children that are in this.options_ but also in workingChildren would\n // give us extra children we do not want. So, we want to filter them out.\n .concat(Object.keys(this.options_).filter(function (child) {\n return !workingChildren.some(function (wchild) {\n if (typeof wchild === 'string') {\n return child === wchild;\n }\n\n return child === wchild.name;\n });\n })).map(function (child) {\n var name;\n var opts;\n\n if (typeof child === 'string') {\n name = child;\n opts = children[name] || _this.options_[name] || {};\n } else {\n name = child.name;\n opts = child;\n }\n\n return {\n name: name,\n opts: opts\n };\n }).filter(function (child) {\n // we have to make sure that child.name isn't in the techOrder since\n // techs are registerd as Components but can't aren't compatible\n // See https://github.com/videojs/video.js/issues/2772\n var c = Component.getComponent(child.opts.componentClass || toTitleCase(child.name));\n return c && !Tech.isTech(c);\n }).forEach(handleAdd);\n }\n };\n /**\n * Builds the default DOM class name. Should be overriden by sub-components.\n *\n * @return {string}\n * The DOM class name for this object.\n *\n * @abstract\n */\n\n\n _proto.buildCSSClass = function buildCSSClass() {\n // Child classes can include a function that does:\n // return 'CLASS NAME' + this._super();\n return '';\n };\n /**\n * Bind a listener to the component's ready state.\n * Different from event listeners in that if the ready event has already happened\n * it will trigger the function immediately.\n *\n * @return {Component}\n * Returns itself; method can be chained.\n */\n\n\n _proto.ready = function ready(fn, sync) {\n if (sync === void 0) {\n sync = false;\n }\n\n if (!fn) {\n return;\n }\n\n if (!this.isReady_) {\n this.readyQueue_ = this.readyQueue_ || [];\n this.readyQueue_.push(fn);\n return;\n }\n\n if (sync) {\n fn.call(this);\n } else {\n // Call the function asynchronously by default for consistency\n this.setTimeout(fn, 1);\n }\n };\n /**\n * Trigger all the ready listeners for this `Component`.\n *\n * @fires Component#ready\n */\n\n\n _proto.triggerReady = function triggerReady() {\n this.isReady_ = true; // Ensure ready is triggered asynchronously\n\n this.setTimeout(function () {\n var readyQueue = this.readyQueue_; // Reset Ready Queue\n\n this.readyQueue_ = [];\n\n if (readyQueue && readyQueue.length > 0) {\n readyQueue.forEach(function (fn) {\n fn.call(this);\n }, this);\n } // Allow for using event listeners also\n\n /**\n * Triggered when a `Component` is ready.\n *\n * @event Component#ready\n * @type {EventTarget~Event}\n */\n\n\n this.trigger('ready');\n }, 1);\n };\n /**\n * Find a single DOM element matching a `selector`. This can be within the `Component`s\n * `contentEl()` or another custom context.\n *\n * @param {string} selector\n * A valid CSS selector, which will be passed to `querySelector`.\n *\n * @param {Element|string} [context=this.contentEl()]\n * A DOM element within which to query. Can also be a selector string in\n * which case the first matching element will get used as context. If\n * missing `this.contentEl()` gets used. If `this.contentEl()` returns\n * nothing it falls back to `document`.\n *\n * @return {Element|null}\n * the dom element that was found, or null\n *\n * @see [Information on CSS Selectors](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_Started/Selectors)\n */\n\n\n _proto.$ = function $$$1(selector, context) {\n return $(selector, context || this.contentEl());\n };\n /**\n * Finds all DOM element matching a `selector`. This can be within the `Component`s\n * `contentEl()` or another custom context.\n *\n * @param {string} selector\n * A valid CSS selector, which will be passed to `querySelectorAll`.\n *\n * @param {Element|string} [context=this.contentEl()]\n * A DOM element within which to query. Can also be a selector string in\n * which case the first matching element will get used as context. If\n * missing `this.contentEl()` gets used. If `this.contentEl()` returns\n * nothing it falls back to `document`.\n *\n * @return {NodeList}\n * a list of dom elements that were found\n *\n * @see [Information on CSS Selectors](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_Started/Selectors)\n */\n\n\n _proto.$$ = function $$$$1(selector, context) {\n return $$(selector, context || this.contentEl());\n };\n /**\n * Check if a component's element has a CSS class name.\n *\n * @param {string} classToCheck\n * CSS class name to check.\n *\n * @return {boolean}\n * - True if the `Component` has the class.\n * - False if the `Component` does not have the class`\n */\n\n\n _proto.hasClass = function hasClass$$1(classToCheck) {\n return hasClass(this.el_, classToCheck);\n };\n /**\n * Add a CSS class name to the `Component`s element.\n *\n * @param {string} classToAdd\n * CSS class name to add\n */\n\n\n _proto.addClass = function addClass$$1(classToAdd) {\n addClass(this.el_, classToAdd);\n };\n /**\n * Remove a CSS class name from the `Component`s element.\n *\n * @param {string} classToRemove\n * CSS class name to remove\n */\n\n\n _proto.removeClass = function removeClass$$1(classToRemove) {\n removeClass(this.el_, classToRemove);\n };\n /**\n * Add or remove a CSS class name from the component's element.\n * - `classToToggle` gets added when {@link Component#hasClass} would return false.\n * - `classToToggle` gets removed when {@link Component#hasClass} would return true.\n *\n * @param {string} classToToggle\n * The class to add or remove based on (@link Component#hasClass}\n *\n * @param {boolean|Dom~predicate} [predicate]\n * An {@link Dom~predicate} function or a boolean\n */\n\n\n _proto.toggleClass = function toggleClass$$1(classToToggle, predicate) {\n toggleClass(this.el_, classToToggle, predicate);\n };\n /**\n * Show the `Component`s element if it is hidden by removing the\n * 'vjs-hidden' class name from it.\n */\n\n\n _proto.show = function show() {\n this.removeClass('vjs-hidden');\n };\n /**\n * Hide the `Component`s element if it is currently showing by adding the\n * 'vjs-hidden` class name to it.\n */\n\n\n _proto.hide = function hide() {\n this.addClass('vjs-hidden');\n };\n /**\n * Lock a `Component`s element in its visible state by adding the 'vjs-lock-showing'\n * class name to it. Used during fadeIn/fadeOut.\n *\n * @private\n */\n\n\n _proto.lockShowing = function lockShowing() {\n this.addClass('vjs-lock-showing');\n };\n /**\n * Unlock a `Component`s element from its visible state by removing the 'vjs-lock-showing'\n * class name from it. Used during fadeIn/fadeOut.\n *\n * @private\n */\n\n\n _proto.unlockShowing = function unlockShowing() {\n this.removeClass('vjs-lock-showing');\n };\n /**\n * Get the value of an attribute on the `Component`s element.\n *\n * @param {string} attribute\n * Name of the attribute to get the value from.\n *\n * @return {string|null}\n * - The value of the attribute that was asked for.\n * - Can be an empty string on some browsers if the attribute does not exist\n * or has no value\n * - Most browsers will return null if the attibute does not exist or has\n * no value.\n *\n * @see [DOM API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttribute}\n */\n\n\n _proto.getAttribute = function getAttribute$$1(attribute) {\n return getAttribute(this.el_, attribute);\n };\n /**\n * Set the value of an attribute on the `Component`'s element\n *\n * @param {string} attribute\n * Name of the attribute to set.\n *\n * @param {string} value\n * Value to set the attribute to.\n *\n * @see [DOM API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttribute}\n */\n\n\n _proto.setAttribute = function setAttribute$$1(attribute, value) {\n setAttribute(this.el_, attribute, value);\n };\n /**\n * Remove an attribute from the `Component`s element.\n *\n * @param {string} attribute\n * Name of the attribute to remove.\n *\n * @see [DOM API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Element/removeAttribute}\n */\n\n\n _proto.removeAttribute = function removeAttribute$$1(attribute) {\n removeAttribute(this.el_, attribute);\n };\n /**\n * Get or set the width of the component based upon the CSS styles.\n * See {@link Component#dimension} for more detailed information.\n *\n * @param {number|string} [num]\n * The width that you want to set postfixed with '%', 'px' or nothing.\n *\n * @param {boolean} [skipListeners]\n * Skip the componentresize event trigger\n *\n * @return {number|string}\n * The width when getting, zero if there is no width. Can be a string\n * postpixed with '%' or 'px'.\n */\n\n\n _proto.width = function width(num, skipListeners) {\n return this.dimension('width', num, skipListeners);\n };\n /**\n * Get or set the height of the component based upon the CSS styles.\n * See {@link Component#dimension} for more detailed information.\n *\n * @param {number|string} [num]\n * The height that you want to set postfixed with '%', 'px' or nothing.\n *\n * @param {boolean} [skipListeners]\n * Skip the componentresize event trigger\n *\n * @return {number|string}\n * The width when getting, zero if there is no width. Can be a string\n * postpixed with '%' or 'px'.\n */\n\n\n _proto.height = function height(num, skipListeners) {\n return this.dimension('height', num, skipListeners);\n };\n /**\n * Set both the width and height of the `Component` element at the same time.\n *\n * @param {number|string} width\n * Width to set the `Component`s element to.\n *\n * @param {number|string} height\n * Height to set the `Component`s element to.\n */\n\n\n _proto.dimensions = function dimensions(width, height) {\n // Skip componentresize listeners on width for optimization\n this.width(width, true);\n this.height(height);\n };\n /**\n * Get or set width or height of the `Component` element. This is the shared code\n * for the {@link Component#width} and {@link Component#height}.\n *\n * Things to know:\n * - If the width or height in an number this will return the number postfixed with 'px'.\n * - If the width/height is a percent this will return the percent postfixed with '%'\n * - Hidden elements have a width of 0 with `window.getComputedStyle`. This function\n * defaults to the `Component`s `style.width` and falls back to `window.getComputedStyle`.\n * See [this]{@link http://www.foliotek.com/devblog/getting-the-width-of-a-hidden-element-with-jquery-using-width/}\n * for more information\n * - If you want the computed style of the component, use {@link Component#currentWidth}\n * and {@link {Component#currentHeight}\n *\n * @fires Component#componentresize\n *\n * @param {string} widthOrHeight\n 8 'width' or 'height'\n *\n * @param {number|string} [num]\n 8 New dimension\n *\n * @param {boolean} [skipListeners]\n * Skip componentresize event trigger\n *\n * @return {number}\n * The dimension when getting or 0 if unset\n */\n\n\n _proto.dimension = function dimension(widthOrHeight, num, skipListeners) {\n if (num !== undefined) {\n // Set to zero if null or literally NaN (NaN !== NaN)\n if (num === null || num !== num) {\n num = 0;\n } // Check if using css width/height (% or px) and adjust\n\n\n if (('' + num).indexOf('%') !== -1 || ('' + num).indexOf('px') !== -1) {\n this.el_.style[widthOrHeight] = num;\n } else if (num === 'auto') {\n this.el_.style[widthOrHeight] = '';\n } else {\n this.el_.style[widthOrHeight] = num + 'px';\n } // skipListeners allows us to avoid triggering the resize event when setting both width and height\n\n\n if (!skipListeners) {\n /**\n * Triggered when a component is resized.\n *\n * @event Component#componentresize\n * @type {EventTarget~Event}\n */\n this.trigger('componentresize');\n }\n\n return;\n } // Not setting a value, so getting it\n // Make sure element exists\n\n\n if (!this.el_) {\n return 0;\n } // Get dimension value from style\n\n\n var val = this.el_.style[widthOrHeight];\n var pxIndex = val.indexOf('px');\n\n if (pxIndex !== -1) {\n // Return the pixel value with no 'px'\n return parseInt(val.slice(0, pxIndex), 10);\n } // No px so using % or no style was set, so falling back to offsetWidth/height\n // If component has display:none, offset will return 0\n // TODO: handle display:none and no dimension style using px\n\n\n return parseInt(this.el_['offset' + toTitleCase(widthOrHeight)], 10);\n };\n /**\n * Get the computed width or the height of the component's element.\n *\n * Uses `window.getComputedStyle`.\n *\n * @param {string} widthOrHeight\n * A string containing 'width' or 'height'. Whichever one you want to get.\n *\n * @return {number}\n * The dimension that gets asked for or 0 if nothing was set\n * for that dimension.\n */\n\n\n _proto.currentDimension = function currentDimension(widthOrHeight) {\n var computedWidthOrHeight = 0;\n\n if (widthOrHeight !== 'width' && widthOrHeight !== 'height') {\n throw new Error('currentDimension only accepts width or height value');\n }\n\n if (typeof window$1.getComputedStyle === 'function') {\n var computedStyle = window$1.getComputedStyle(this.el_);\n computedWidthOrHeight = computedStyle.getPropertyValue(widthOrHeight) || computedStyle[widthOrHeight];\n } // remove 'px' from variable and parse as integer\n\n\n computedWidthOrHeight = parseFloat(computedWidthOrHeight); // if the computed value is still 0, it's possible that the browser is lying\n // and we want to check the offset values.\n // This code also runs wherever getComputedStyle doesn't exist.\n\n if (computedWidthOrHeight === 0) {\n var rule = \"offset\" + toTitleCase(widthOrHeight);\n computedWidthOrHeight = this.el_[rule];\n }\n\n return computedWidthOrHeight;\n };\n /**\n * An object that contains width and height values of the `Component`s\n * computed style. Uses `window.getComputedStyle`.\n *\n * @typedef {Object} Component~DimensionObject\n *\n * @property {number} width\n * The width of the `Component`s computed style.\n *\n * @property {number} height\n * The height of the `Component`s computed style.\n */\n\n /**\n * Get an object that contains computed width and height values of the\n * component's element.\n *\n * Uses `window.getComputedStyle`.\n *\n * @return {Component~DimensionObject}\n * The computed dimensions of the component's element.\n */\n\n\n _proto.currentDimensions = function currentDimensions() {\n return {\n width: this.currentDimension('width'),\n height: this.currentDimension('height')\n };\n };\n /**\n * Get the computed width of the component's element.\n *\n * Uses `window.getComputedStyle`.\n *\n * @return {number}\n * The computed width of the component's element.\n */\n\n\n _proto.currentWidth = function currentWidth() {\n return this.currentDimension('width');\n };\n /**\n * Get the computed height of the component's element.\n *\n * Uses `window.getComputedStyle`.\n *\n * @return {number}\n * The computed height of the component's element.\n */\n\n\n _proto.currentHeight = function currentHeight() {\n return this.currentDimension('height');\n };\n /**\n * Set the focus to this component\n */\n\n\n _proto.focus = function focus() {\n this.el_.focus();\n };\n /**\n * Remove the focus from this component\n */\n\n\n _proto.blur = function blur() {\n this.el_.blur();\n };\n /**\n * Emit a 'tap' events when touch event support gets detected. This gets used to\n * support toggling the controls through a tap on the video. They get enabled\n * because every sub-component would have extra overhead otherwise.\n *\n * @private\n * @fires Component#tap\n * @listens Component#touchstart\n * @listens Component#touchmove\n * @listens Component#touchleave\n * @listens Component#touchcancel\n * @listens Component#touchend\n */\n\n\n _proto.emitTapEvents = function emitTapEvents() {\n // Track the start time so we can determine how long the touch lasted\n var touchStart = 0;\n var firstTouch = null; // Maximum movement allowed during a touch event to still be considered a tap\n // Other popular libs use anywhere from 2 (hammer.js) to 15,\n // so 10 seems like a nice, round number.\n\n var tapMovementThreshold = 10; // The maximum length a touch can be while still being considered a tap\n\n var touchTimeThreshold = 200;\n var couldBeTap;\n this.on('touchstart', function (event) {\n // If more than one finger, don't consider treating this as a click\n if (event.touches.length === 1) {\n // Copy pageX/pageY from the object\n firstTouch = {\n pageX: event.touches[0].pageX,\n pageY: event.touches[0].pageY\n }; // Record start time so we can detect a tap vs. \"touch and hold\"\n\n touchStart = new Date().getTime(); // Reset couldBeTap tracking\n\n couldBeTap = true;\n }\n });\n this.on('touchmove', function (event) {\n // If more than one finger, don't consider treating this as a click\n if (event.touches.length > 1) {\n couldBeTap = false;\n } else if (firstTouch) {\n // Some devices will throw touchmoves for all but the slightest of taps.\n // So, if we moved only a small distance, this could still be a tap\n var xdiff = event.touches[0].pageX - firstTouch.pageX;\n var ydiff = event.touches[0].pageY - firstTouch.pageY;\n var touchDistance = Math.sqrt(xdiff * xdiff + ydiff * ydiff);\n\n if (touchDistance > tapMovementThreshold) {\n couldBeTap = false;\n }\n }\n });\n\n var noTap = function noTap() {\n couldBeTap = false;\n }; // TODO: Listen to the original target. http://youtu.be/DujfpXOKUp8?t=13m8s\n\n\n this.on('touchleave', noTap);\n this.on('touchcancel', noTap); // When the touch ends, measure how long it took and trigger the appropriate\n // event\n\n this.on('touchend', function (event) {\n firstTouch = null; // Proceed only if the touchmove/leave/cancel event didn't happen\n\n if (couldBeTap === true) {\n // Measure how long the touch lasted\n var touchTime = new Date().getTime() - touchStart; // Make sure the touch was less than the threshold to be considered a tap\n\n if (touchTime < touchTimeThreshold) {\n // Don't let browser turn this into a click\n event.preventDefault();\n /**\n * Triggered when a `Component` is tapped.\n *\n * @event Component#tap\n * @type {EventTarget~Event}\n */\n\n this.trigger('tap'); // It may be good to copy the touchend event object and change the\n // type to tap, if the other event properties aren't exact after\n // Events.fixEvent runs (e.g. event.target)\n }\n }\n });\n };\n /**\n * This function reports user activity whenever touch events happen. This can get\n * turned off by any sub-components that wants touch events to act another way.\n *\n * Report user touch activity when touch events occur. User activity gets used to\n * determine when controls should show/hide. It is simple when it comes to mouse\n * events, because any mouse event should show the controls. So we capture mouse\n * events that bubble up to the player and report activity when that happens.\n * With touch events it isn't as easy as `touchstart` and `touchend` toggle player\n * controls. So touch events can't help us at the player level either.\n *\n * User activity gets checked asynchronously. So what could happen is a tap event\n * on the video turns the controls off. Then the `touchend` event bubbles up to\n * the player. Which, if it reported user activity, would turn the controls right\n * back on. We also don't want to completely block touch events from bubbling up.\n * Furthermore a `touchmove` event and anything other than a tap, should not turn\n * controls back on.\n *\n * @listens Component#touchstart\n * @listens Component#touchmove\n * @listens Component#touchend\n * @listens Component#touchcancel\n */\n\n\n _proto.enableTouchActivity = function enableTouchActivity() {\n // Don't continue if the root player doesn't support reporting user activity\n if (!this.player() || !this.player().reportUserActivity) {\n return;\n } // listener for reporting that the user is active\n\n\n var report = bind(this.player(), this.player().reportUserActivity);\n var touchHolding;\n this.on('touchstart', function () {\n report(); // For as long as the they are touching the device or have their mouse down,\n // we consider them active even if they're not moving their finger or mouse.\n // So we want to continue to update that they are active\n\n this.clearInterval(touchHolding); // report at the same interval as activityCheck\n\n touchHolding = this.setInterval(report, 250);\n });\n\n var touchEnd = function touchEnd(event) {\n report(); // stop the interval that maintains activity if the touch is holding\n\n this.clearInterval(touchHolding);\n };\n\n this.on('touchmove', report);\n this.on('touchend', touchEnd);\n this.on('touchcancel', touchEnd);\n };\n /**\n * A callback that has no parameters and is bound into `Component`s context.\n *\n * @callback Component~GenericCallback\n * @this Component\n */\n\n /**\n * Creates a function that runs after an `x` millisecond timeout. This function is a\n * wrapper around `window.setTimeout`. There are a few reasons to use this one\n * instead though:\n * 1. It gets cleared via {@link Component#clearTimeout} when\n * {@link Component#dispose} gets called.\n * 2. The function callback will gets turned into a {@link Component~GenericCallback}\n *\n * > Note: You can't use `window.clearTimeout` on the id returned by this function. This\n * will cause its dispose listener not to get cleaned up! Please use\n * {@link Component#clearTimeout} or {@link Component#dispose} instead.\n *\n * @param {Component~GenericCallback} fn\n * The function that will be run after `timeout`.\n *\n * @param {number} timeout\n * Timeout in milliseconds to delay before executing the specified function.\n *\n * @return {number}\n * Returns a timeout ID that gets used to identify the timeout. It can also\n * get used in {@link Component#clearTimeout} to clear the timeout that\n * was set.\n *\n * @listens Component#dispose\n * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setTimeout}\n */\n\n\n _proto.setTimeout = function setTimeout(fn, timeout) {\n var _this2 = this;\n\n // declare as variables so they are properly available in timeout function\n // eslint-disable-next-line\n var timeoutId, disposeFn;\n fn = bind(this, fn);\n timeoutId = window$1.setTimeout(function () {\n _this2.off('dispose', disposeFn);\n\n fn();\n }, timeout);\n\n disposeFn = function disposeFn() {\n return _this2.clearTimeout(timeoutId);\n };\n\n disposeFn.guid = \"vjs-timeout-\" + timeoutId;\n this.on('dispose', disposeFn);\n return timeoutId;\n };\n /**\n * Clears a timeout that gets created via `window.setTimeout` or\n * {@link Component#setTimeout}. If you set a timeout via {@link Component#setTimeout}\n * use this function instead of `window.clearTimout`. If you don't your dispose\n * listener will not get cleaned up until {@link Component#dispose}!\n *\n * @param {number} timeoutId\n * The id of the timeout to clear. The return value of\n * {@link Component#setTimeout} or `window.setTimeout`.\n *\n * @return {number}\n * Returns the timeout id that was cleared.\n *\n * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/clearTimeout}\n */\n\n\n _proto.clearTimeout = function clearTimeout(timeoutId) {\n window$1.clearTimeout(timeoutId);\n\n var disposeFn = function disposeFn() {};\n\n disposeFn.guid = \"vjs-timeout-\" + timeoutId;\n this.off('dispose', disposeFn);\n return timeoutId;\n };\n /**\n * Creates a function that gets run every `x` milliseconds. This function is a wrapper\n * around `window.setInterval`. There are a few reasons to use this one instead though.\n * 1. It gets cleared via {@link Component#clearInterval} when\n * {@link Component#dispose} gets called.\n * 2. The function callback will be a {@link Component~GenericCallback}\n *\n * @param {Component~GenericCallback} fn\n * The function to run every `x` seconds.\n *\n * @param {number} interval\n * Execute the specified function every `x` milliseconds.\n *\n * @return {number}\n * Returns an id that can be used to identify the interval. It can also be be used in\n * {@link Component#clearInterval} to clear the interval.\n *\n * @listens Component#dispose\n * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setInterval}\n */\n\n\n _proto.setInterval = function setInterval(fn, interval) {\n var _this3 = this;\n\n fn = bind(this, fn);\n var intervalId = window$1.setInterval(fn, interval);\n\n var disposeFn = function disposeFn() {\n return _this3.clearInterval(intervalId);\n };\n\n disposeFn.guid = \"vjs-interval-\" + intervalId;\n this.on('dispose', disposeFn);\n return intervalId;\n };\n /**\n * Clears an interval that gets created via `window.setInterval` or\n * {@link Component#setInterval}. If you set an inteval via {@link Component#setInterval}\n * use this function instead of `window.clearInterval`. If you don't your dispose\n * listener will not get cleaned up until {@link Component#dispose}!\n *\n * @param {number} intervalId\n * The id of the interval to clear. The return value of\n * {@link Component#setInterval} or `window.setInterval`.\n *\n * @return {number}\n * Returns the interval id that was cleared.\n *\n * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/clearInterval}\n */\n\n\n _proto.clearInterval = function clearInterval(intervalId) {\n window$1.clearInterval(intervalId);\n\n var disposeFn = function disposeFn() {};\n\n disposeFn.guid = \"vjs-interval-\" + intervalId;\n this.off('dispose', disposeFn);\n return intervalId;\n };\n /**\n * Queues up a callback to be passed to requestAnimationFrame (rAF), but\n * with a few extra bonuses:\n *\n * - Supports browsers that do not support rAF by falling back to\n * {@link Component#setTimeout}.\n *\n * - The callback is turned into a {@link Component~GenericCallback} (i.e.\n * bound to the component).\n *\n * - Automatic cancellation of the rAF callback is handled if the component\n * is disposed before it is called.\n *\n * @param {Component~GenericCallback} fn\n * A function that will be bound to this component and executed just\n * before the browser's next repaint.\n *\n * @return {number}\n * Returns an rAF ID that gets used to identify the timeout. It can\n * also be used in {@link Component#cancelAnimationFrame} to cancel\n * the animation frame callback.\n *\n * @listens Component#dispose\n * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame}\n */\n\n\n _proto.requestAnimationFrame = function requestAnimationFrame(fn) {\n var _this4 = this;\n\n // declare as variables so they are properly available in rAF function\n // eslint-disable-next-line\n var id, disposeFn;\n\n if (this.supportsRaf_) {\n fn = bind(this, fn);\n id = window$1.requestAnimationFrame(function () {\n _this4.off('dispose', disposeFn);\n\n fn();\n });\n\n disposeFn = function disposeFn() {\n return _this4.cancelAnimationFrame(id);\n };\n\n disposeFn.guid = \"vjs-raf-\" + id;\n this.on('dispose', disposeFn);\n return id;\n } // Fall back to using a timer.\n\n\n return this.setTimeout(fn, 1000 / 60);\n };\n /**\n * Cancels a queued callback passed to {@link Component#requestAnimationFrame}\n * (rAF).\n *\n * If you queue an rAF callback via {@link Component#requestAnimationFrame},\n * use this function instead of `window.cancelAnimationFrame`. If you don't,\n * your dispose listener will not get cleaned up until {@link Component#dispose}!\n *\n * @param {number} id\n * The rAF ID to clear. The return value of {@link Component#requestAnimationFrame}.\n *\n * @return {number}\n * Returns the rAF ID that was cleared.\n *\n * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/window/cancelAnimationFrame}\n */\n\n\n _proto.cancelAnimationFrame = function cancelAnimationFrame(id) {\n if (this.supportsRaf_) {\n window$1.cancelAnimationFrame(id);\n\n var disposeFn = function disposeFn() {};\n\n disposeFn.guid = \"vjs-raf-\" + id;\n this.off('dispose', disposeFn);\n return id;\n } // Fall back to using a timer.\n\n\n return this.clearTimeout(id);\n };\n /**\n * Register a `Component` with `videojs` given the name and the component.\n *\n * > NOTE: {@link Tech}s should not be registered as a `Component`. {@link Tech}s\n * should be registered using {@link Tech.registerTech} or\n * {@link videojs:videojs.registerTech}.\n *\n * > NOTE: This function can also be seen on videojs as\n * {@link videojs:videojs.registerComponent}.\n *\n * @param {string} name\n * The name of the `Component` to register.\n *\n * @param {Component} ComponentToRegister\n * The `Component` class to register.\n *\n * @return {Component}\n * The `Component` that was registered.\n */\n\n\n Component.registerComponent = function registerComponent(name, ComponentToRegister) {\n if (typeof name !== 'string' || !name) {\n throw new Error(\"Illegal component name, \\\"\" + name + \"\\\"; must be a non-empty string.\");\n }\n\n var Tech = Component.getComponent('Tech'); // We need to make sure this check is only done if Tech has been registered.\n\n var isTech = Tech && Tech.isTech(ComponentToRegister);\n var isComp = Component === ComponentToRegister || Component.prototype.isPrototypeOf(ComponentToRegister.prototype);\n\n if (isTech || !isComp) {\n var reason;\n\n if (isTech) {\n reason = 'techs must be registered using Tech.registerTech()';\n } else {\n reason = 'must be a Component subclass';\n }\n\n throw new Error(\"Illegal component, \\\"\" + name + \"\\\"; \" + reason + \".\");\n }\n\n name = toTitleCase(name);\n\n if (!Component.components_) {\n Component.components_ = {};\n }\n\n var Player = Component.getComponent('Player');\n\n if (name === 'Player' && Player && Player.players) {\n var players = Player.players;\n var playerNames = Object.keys(players); // If we have players that were disposed, then their name will still be\n // in Players.players. So, we must loop through and verify that the value\n // for each item is not null. This allows registration of the Player component\n // after all players have been disposed or before any were created.\n\n if (players && playerNames.length > 0 && playerNames.map(function (pname) {\n return players[pname];\n }).every(Boolean)) {\n throw new Error('Can not register Player component after player has been created.');\n }\n }\n\n Component.components_[name] = ComponentToRegister;\n return ComponentToRegister;\n };\n /**\n * Get a `Component` based on the name it was registered with.\n *\n * @param {string} name\n * The Name of the component to get.\n *\n * @return {Component}\n * The `Component` that got registered under the given name.\n *\n * @deprecated In `videojs` 6 this will not return `Component`s that were not\n * registered using {@link Component.registerComponent}. Currently we\n * check the global `videojs` object for a `Component` name and\n * return that if it exists.\n */\n\n\n Component.getComponent = function getComponent(name) {\n if (!name) {\n return;\n }\n\n name = toTitleCase(name);\n\n if (Component.components_ && Component.components_[name]) {\n return Component.components_[name];\n }\n };\n\n return Component;\n}();\n/**\n * Whether or not this component supports `requestAnimationFrame`.\n *\n * This is exposed primarily for testing purposes.\n *\n * @private\n * @type {Boolean}\n */\n\n\nComponent.prototype.supportsRaf_ = typeof window$1.requestAnimationFrame === 'function' && typeof window$1.cancelAnimationFrame === 'function';\nComponent.registerComponent('Component', Component);\n\n/**\n * @file browser.js\n * @module browser\n */\nvar USER_AGENT = window$1.navigator && window$1.navigator.userAgent || '';\nvar webkitVersionMap = /AppleWebKit\\/([\\d.]+)/i.exec(USER_AGENT);\nvar appleWebkitVersion = webkitVersionMap ? parseFloat(webkitVersionMap.pop()) : null;\n/**\n * Whether or not this device is an iPad.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_IPAD = /iPad/i.test(USER_AGENT);\n/**\n * Whether or not this device is an iPhone.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n// The Facebook app's UIWebView identifies as both an iPhone and iPad, so\n// to identify iPhones, we need to exclude iPads.\n// http://artsy.github.io/blog/2012/10/18/the-perils-of-ios-user-agent-sniffing/\n\nvar IS_IPHONE = /iPhone/i.test(USER_AGENT) && !IS_IPAD;\n/**\n * Whether or not this device is an iPod.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_IPOD = /iPod/i.test(USER_AGENT);\n/**\n * Whether or not this is an iOS device.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_IOS = IS_IPHONE || IS_IPAD || IS_IPOD;\n/**\n * The detected iOS version - or `null`.\n *\n * @static\n * @const\n * @type {string|null}\n */\n\nvar IOS_VERSION = function () {\n var match = USER_AGENT.match(/OS (\\d+)_/i);\n\n if (match && match[1]) {\n return match[1];\n }\n\n return null;\n}();\n/**\n * Whether or not this is an Android device.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_ANDROID = /Android/i.test(USER_AGENT);\n/**\n * The detected Android version - or `null`.\n *\n * @static\n * @const\n * @type {number|string|null}\n */\n\nvar ANDROID_VERSION = function () {\n // This matches Android Major.Minor.Patch versions\n // ANDROID_VERSION is Major.Minor as a Number, if Minor isn't available, then only Major is returned\n var match = USER_AGENT.match(/Android (\\d+)(?:\\.(\\d+))?(?:\\.(\\d+))*/i);\n\n if (!match) {\n return null;\n }\n\n var major = match[1] && parseFloat(match[1]);\n var minor = match[2] && parseFloat(match[2]);\n\n if (major && minor) {\n return parseFloat(match[1] + '.' + match[2]);\n } else if (major) {\n return major;\n }\n\n return null;\n}();\n/**\n * Whether or not this is a native Android browser.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_NATIVE_ANDROID = IS_ANDROID && ANDROID_VERSION < 5 && appleWebkitVersion < 537;\n/**\n * Whether or not this is Mozilla Firefox.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_FIREFOX = /Firefox/i.test(USER_AGENT);\n/**\n * Whether or not this is Microsoft Edge.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_EDGE = /Edge/i.test(USER_AGENT);\n/**\n * Whether or not this is Google Chrome.\n *\n * This will also be `true` for Chrome on iOS, which will have different support\n * as it is actually Safari under the hood.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_CHROME = !IS_EDGE && (/Chrome/i.test(USER_AGENT) || /CriOS/i.test(USER_AGENT));\n/**\n * The detected Google Chrome version - or `null`.\n *\n * @static\n * @const\n * @type {number|null}\n */\n\nvar CHROME_VERSION = function () {\n var match = USER_AGENT.match(/(Chrome|CriOS)\\/(\\d+)/);\n\n if (match && match[2]) {\n return parseFloat(match[2]);\n }\n\n return null;\n}();\n/**\n * The detected Internet Explorer version - or `null`.\n *\n * @static\n * @const\n * @type {number|null}\n */\n\nvar IE_VERSION = function () {\n var result = /MSIE\\s(\\d+)\\.\\d/.exec(USER_AGENT);\n var version = result && parseFloat(result[1]);\n\n if (!version && /Trident\\/7.0/i.test(USER_AGENT) && /rv:11.0/.test(USER_AGENT)) {\n // IE 11 has a different user agent string than other IE versions\n version = 11.0;\n }\n\n return version;\n}();\n/**\n * Whether or not this is desktop Safari.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_SAFARI = /Safari/i.test(USER_AGENT) && !IS_CHROME && !IS_ANDROID && !IS_EDGE;\n/**\n * Whether or not this is any flavor of Safari - including iOS.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_ANY_SAFARI = (IS_SAFARI || IS_IOS) && !IS_CHROME;\n/**\n * Whether or not this device is touch-enabled.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar TOUCH_ENABLED = isReal() && ('ontouchstart' in window$1 || window$1.navigator.maxTouchPoints || window$1.DocumentTouch && window$1.document instanceof window$1.DocumentTouch);\n\nvar browser = /*#__PURE__*/Object.freeze({\n IS_IPAD: IS_IPAD,\n IS_IPHONE: IS_IPHONE,\n IS_IPOD: IS_IPOD,\n IS_IOS: IS_IOS,\n IOS_VERSION: IOS_VERSION,\n IS_ANDROID: IS_ANDROID,\n ANDROID_VERSION: ANDROID_VERSION,\n IS_NATIVE_ANDROID: IS_NATIVE_ANDROID,\n IS_FIREFOX: IS_FIREFOX,\n IS_EDGE: IS_EDGE,\n IS_CHROME: IS_CHROME,\n CHROME_VERSION: CHROME_VERSION,\n IE_VERSION: IE_VERSION,\n IS_SAFARI: IS_SAFARI,\n IS_ANY_SAFARI: IS_ANY_SAFARI,\n TOUCH_ENABLED: TOUCH_ENABLED\n});\n\n/**\n * @file time-ranges.js\n * @module time-ranges\n */\n\n/**\n * Returns the time for the specified index at the start or end\n * of a TimeRange object.\n *\n * @typedef {Function} TimeRangeIndex\n *\n * @param {number} [index=0]\n * The range number to return the time for.\n *\n * @return {number}\n * The time offset at the specified index.\n *\n * @deprecated The index argument must be provided.\n * In the future, leaving it out will throw an error.\n */\n\n/**\n * An object that contains ranges of time.\n *\n * @typedef {Object} TimeRange\n *\n * @property {number} length\n * The number of time ranges represented by this object.\n *\n * @property {module:time-ranges~TimeRangeIndex} start\n * Returns the time offset at which a specified time range begins.\n *\n * @property {module:time-ranges~TimeRangeIndex} end\n * Returns the time offset at which a specified time range ends.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/TimeRanges\n */\n\n/**\n * Check if any of the time ranges are over the maximum index.\n *\n * @private\n * @param {string} fnName\n * The function name to use for logging\n *\n * @param {number} index\n * The index to check\n *\n * @param {number} maxIndex\n * The maximum possible index\n *\n * @throws {Error} if the timeRanges provided are over the maxIndex\n */\nfunction rangeCheck(fnName, index, maxIndex) {\n if (typeof index !== 'number' || index < 0 || index > maxIndex) {\n throw new Error(\"Failed to execute '\" + fnName + \"' on 'TimeRanges': The index provided (\" + index + \") is non-numeric or out of bounds (0-\" + maxIndex + \").\");\n }\n}\n/**\n * Get the time for the specified index at the start or end\n * of a TimeRange object.\n *\n * @private\n * @param {string} fnName\n * The function name to use for logging\n *\n * @param {string} valueIndex\n * The property that should be used to get the time. should be\n * 'start' or 'end'\n *\n * @param {Array} ranges\n * An array of time ranges\n *\n * @param {Array} [rangeIndex=0]\n * The index to start the search at\n *\n * @return {number}\n * The time that offset at the specified index.\n *\n * @deprecated rangeIndex must be set to a value, in the future this will throw an error.\n * @throws {Error} if rangeIndex is more than the length of ranges\n */\n\n\nfunction getRange(fnName, valueIndex, ranges, rangeIndex) {\n rangeCheck(fnName, rangeIndex, ranges.length - 1);\n return ranges[rangeIndex][valueIndex];\n}\n/**\n * Create a time range object given ranges of time.\n *\n * @private\n * @param {Array} [ranges]\n * An array of time ranges.\n */\n\n\nfunction createTimeRangesObj(ranges) {\n if (ranges === undefined || ranges.length === 0) {\n return {\n length: 0,\n start: function start() {\n throw new Error('This TimeRanges object is empty');\n },\n end: function end() {\n throw new Error('This TimeRanges object is empty');\n }\n };\n }\n\n return {\n length: ranges.length,\n start: getRange.bind(null, 'start', 0, ranges),\n end: getRange.bind(null, 'end', 1, ranges)\n };\n}\n/**\n * Create a `TimeRange` object which mimics an\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/TimeRanges|HTML5 TimeRanges instance}.\n *\n * @param {number|Array[]} start\n * The start of a single range (a number) or an array of ranges (an\n * array of arrays of two numbers each).\n *\n * @param {number} end\n * The end of a single range. Cannot be used with the array form of\n * the `start` argument.\n */\n\n\nfunction createTimeRanges(start, end) {\n if (Array.isArray(start)) {\n return createTimeRangesObj(start);\n } else if (start === undefined || end === undefined) {\n return createTimeRangesObj();\n }\n\n return createTimeRangesObj([[start, end]]);\n}\n\n/**\n * @file buffer.js\n * @module buffer\n */\n/**\n * Compute the percentage of the media that has been buffered.\n *\n * @param {TimeRange} buffered\n * The current `TimeRange` object representing buffered time ranges\n *\n * @param {number} duration\n * Total duration of the media\n *\n * @return {number}\n * Percent buffered of the total duration in decimal form.\n */\n\nfunction bufferedPercent(buffered, duration) {\n var bufferedDuration = 0;\n var start;\n var end;\n\n if (!duration) {\n return 0;\n }\n\n if (!buffered || !buffered.length) {\n buffered = createTimeRanges(0, 0);\n }\n\n for (var i = 0; i < buffered.length; i++) {\n start = buffered.start(i);\n end = buffered.end(i); // buffered end can be bigger than duration by a very small fraction\n\n if (end > duration) {\n end = duration;\n }\n\n bufferedDuration += end - start;\n }\n\n return bufferedDuration / duration;\n}\n\n/**\n * @file fullscreen-api.js\n * @module fullscreen-api\n * @private\n */\n/**\n * Store the browser-specific methods for the fullscreen API.\n *\n * @type {Object}\n * @see [Specification]{@link https://fullscreen.spec.whatwg.org}\n * @see [Map Approach From Screenfull.js]{@link https://github.com/sindresorhus/screenfull.js}\n */\n\nvar FullscreenApi = {}; // browser API methods\n\nvar apiMap = [['requestFullscreen', 'exitFullscreen', 'fullscreenElement', 'fullscreenEnabled', 'fullscreenchange', 'fullscreenerror'], // WebKit\n['webkitRequestFullscreen', 'webkitExitFullscreen', 'webkitFullscreenElement', 'webkitFullscreenEnabled', 'webkitfullscreenchange', 'webkitfullscreenerror'], // Old WebKit (Safari 5.1)\n['webkitRequestFullScreen', 'webkitCancelFullScreen', 'webkitCurrentFullScreenElement', 'webkitCancelFullScreen', 'webkitfullscreenchange', 'webkitfullscreenerror'], // Mozilla\n['mozRequestFullScreen', 'mozCancelFullScreen', 'mozFullScreenElement', 'mozFullScreenEnabled', 'mozfullscreenchange', 'mozfullscreenerror'], // Microsoft\n['msRequestFullscreen', 'msExitFullscreen', 'msFullscreenElement', 'msFullscreenEnabled', 'MSFullscreenChange', 'MSFullscreenError']];\nvar specApi = apiMap[0];\nvar browserApi; // determine the supported set of functions\n\nfor (var i = 0; i < apiMap.length; i++) {\n // check for exitFullscreen function\n if (apiMap[i][1] in document) {\n browserApi = apiMap[i];\n break;\n }\n} // map the browser API names to the spec API names\n\n\nif (browserApi) {\n for (var _i = 0; _i < browserApi.length; _i++) {\n FullscreenApi[specApi[_i]] = browserApi[_i];\n }\n}\n\n/**\n * @file media-error.js\n */\n/**\n * A Custom `MediaError` class which mimics the standard HTML5 `MediaError` class.\n *\n * @param {number|string|Object|MediaError} value\n * This can be of multiple types:\n * - number: should be a standard error code\n * - string: an error message (the code will be 0)\n * - Object: arbitrary properties\n * - `MediaError` (native): used to populate a video.js `MediaError` object\n * - `MediaError` (video.js): will return itself if it's already a\n * video.js `MediaError` object.\n *\n * @see [MediaError Spec]{@link https://dev.w3.org/html5/spec-author-view/video.html#mediaerror}\n * @see [Encrypted MediaError Spec]{@link https://www.w3.org/TR/2013/WD-encrypted-media-20130510/#error-codes}\n *\n * @class MediaError\n */\n\nfunction MediaError(value) {\n // Allow redundant calls to this constructor to avoid having `instanceof`\n // checks peppered around the code.\n if (value instanceof MediaError) {\n return value;\n }\n\n if (typeof value === 'number') {\n this.code = value;\n } else if (typeof value === 'string') {\n // default code is zero, so this is a custom error\n this.message = value;\n } else if (isObject(value)) {\n // We assign the `code` property manually because native `MediaError` objects\n // do not expose it as an own/enumerable property of the object.\n if (typeof value.code === 'number') {\n this.code = value.code;\n }\n\n assign(this, value);\n }\n\n if (!this.message) {\n this.message = MediaError.defaultMessages[this.code] || '';\n }\n}\n/**\n * The error code that refers two one of the defined `MediaError` types\n *\n * @type {Number}\n */\n\n\nMediaError.prototype.code = 0;\n/**\n * An optional message that to show with the error. Message is not part of the HTML5\n * video spec but allows for more informative custom errors.\n *\n * @type {String}\n */\n\nMediaError.prototype.message = '';\n/**\n * An optional status code that can be set by plugins to allow even more detail about\n * the error. For example a plugin might provide a specific HTTP status code and an\n * error message for that code. Then when the plugin gets that error this class will\n * know how to display an error message for it. This allows a custom message to show\n * up on the `Player` error overlay.\n *\n * @type {Array}\n */\n\nMediaError.prototype.status = null;\n/**\n * Errors indexed by the W3C standard. The order **CANNOT CHANGE**! See the\n * specification listed under {@link MediaError} for more information.\n *\n * @enum {array}\n * @readonly\n * @property {string} 0 - MEDIA_ERR_CUSTOM\n * @property {string} 1 - MEDIA_ERR_ABORTED\n * @property {string} 2 - MEDIA_ERR_NETWORK\n * @property {string} 3 - MEDIA_ERR_DECODE\n * @property {string} 4 - MEDIA_ERR_SRC_NOT_SUPPORTED\n * @property {string} 5 - MEDIA_ERR_ENCRYPTED\n */\n\nMediaError.errorTypes = ['MEDIA_ERR_CUSTOM', 'MEDIA_ERR_ABORTED', 'MEDIA_ERR_NETWORK', 'MEDIA_ERR_DECODE', 'MEDIA_ERR_SRC_NOT_SUPPORTED', 'MEDIA_ERR_ENCRYPTED'];\n/**\n * The default `MediaError` messages based on the {@link MediaError.errorTypes}.\n *\n * @type {Array}\n * @constant\n */\n\nMediaError.defaultMessages = {\n 1: 'You aborted the media playback',\n 2: 'A network error caused the media download to fail part-way.',\n 3: 'The media playback was aborted due to a corruption problem or because the media used features your browser did not support.',\n 4: 'The media could not be loaded, either because the server or network failed or because the format is not supported.',\n 5: 'The media is encrypted and we do not have the keys to decrypt it.'\n}; // Add types as properties on MediaError\n// e.g. MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED = 4;\n\nfor (var errNum = 0; errNum < MediaError.errorTypes.length; errNum++) {\n MediaError[MediaError.errorTypes[errNum]] = errNum; // values should be accessible on both the class and instance\n\n MediaError.prototype[MediaError.errorTypes[errNum]] = errNum;\n} // jsdocs for instance/static members added above\n\n/**\n * Returns whether an object is `Promise`-like (i.e. has a `then` method).\n *\n * @param {Object} value\n * An object that may or may not be `Promise`-like.\n *\n * @return {boolean}\n * Whether or not the object is `Promise`-like.\n */\nfunction isPromise(value) {\n return value !== undefined && value !== null && typeof value.then === 'function';\n}\n/**\n * Silence a Promise-like object.\n *\n * This is useful for avoiding non-harmful, but potentially confusing \"uncaught\n * play promise\" rejection error messages.\n *\n * @param {Object} value\n * An object that may or may not be `Promise`-like.\n */\n\nfunction silencePromise(value) {\n if (isPromise(value)) {\n value.then(null, function (e) {});\n }\n}\n\n/**\n * @file text-track-list-converter.js Utilities for capturing text track state and\n * re-creating tracks based on a capture.\n *\n * @module text-track-list-converter\n */\n\n/**\n * Examine a single {@link TextTrack} and return a JSON-compatible javascript object that\n * represents the {@link TextTrack}'s state.\n *\n * @param {TextTrack} track\n * The text track to query.\n *\n * @return {Object}\n * A serializable javascript representation of the TextTrack.\n * @private\n */\nvar trackToJson_ = function trackToJson_(track) {\n var ret = ['kind', 'label', 'language', 'id', 'inBandMetadataTrackDispatchType', 'mode', 'src'].reduce(function (acc, prop, i) {\n if (track[prop]) {\n acc[prop] = track[prop];\n }\n\n return acc;\n }, {\n cues: track.cues && Array.prototype.map.call(track.cues, function (cue) {\n return {\n startTime: cue.startTime,\n endTime: cue.endTime,\n text: cue.text,\n id: cue.id\n };\n })\n });\n return ret;\n};\n/**\n * Examine a {@link Tech} and return a JSON-compatible javascript array that represents the\n * state of all {@link TextTrack}s currently configured. The return array is compatible with\n * {@link text-track-list-converter:jsonToTextTracks}.\n *\n * @param {Tech} tech\n * The tech object to query\n *\n * @return {Array}\n * A serializable javascript representation of the {@link Tech}s\n * {@link TextTrackList}.\n */\n\n\nvar textTracksToJson = function textTracksToJson(tech) {\n var trackEls = tech.$$('track');\n var trackObjs = Array.prototype.map.call(trackEls, function (t) {\n return t.track;\n });\n var tracks = Array.prototype.map.call(trackEls, function (trackEl) {\n var json = trackToJson_(trackEl.track);\n\n if (trackEl.src) {\n json.src = trackEl.src;\n }\n\n return json;\n });\n return tracks.concat(Array.prototype.filter.call(tech.textTracks(), function (track) {\n return trackObjs.indexOf(track) === -1;\n }).map(trackToJson_));\n};\n/**\n * Create a set of remote {@link TextTrack}s on a {@link Tech} based on an array of javascript\n * object {@link TextTrack} representations.\n *\n * @param {Array} json\n * An array of `TextTrack` representation objects, like those that would be\n * produced by `textTracksToJson`.\n *\n * @param {Tech} tech\n * The `Tech` to create the `TextTrack`s on.\n */\n\n\nvar jsonToTextTracks = function jsonToTextTracks(json, tech) {\n json.forEach(function (track) {\n var addedTrack = tech.addRemoteTextTrack(track).track;\n\n if (!track.src && track.cues) {\n track.cues.forEach(function (cue) {\n return addedTrack.addCue(cue);\n });\n }\n });\n return tech.textTracks();\n};\n\nvar textTrackConverter = {\n textTracksToJson: textTracksToJson,\n jsonToTextTracks: jsonToTextTracks,\n trackToJson_: trackToJson_\n};\n\nvar MODAL_CLASS_NAME = 'vjs-modal-dialog';\nvar ESC = 27;\n/**\n * The `ModalDialog` displays over the video and its controls, which blocks\n * interaction with the player until it is closed.\n *\n * Modal dialogs include a \"Close\" button and will close when that button\n * is activated - or when ESC is pressed anywhere.\n *\n * @extends Component\n */\n\nvar ModalDialog =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(ModalDialog, _Component);\n\n /**\n * Create an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Mixed} [options.content=undefined]\n * Provide customized content for this modal.\n *\n * @param {string} [options.description]\n * A text description for the modal, primarily for accessibility.\n *\n * @param {boolean} [options.fillAlways=false]\n * Normally, modals are automatically filled only the first time\n * they open. This tells the modal to refresh its content\n * every time it opens.\n *\n * @param {string} [options.label]\n * A text label for the modal, primarily for accessibility.\n *\n * @param {boolean} [options.temporary=true]\n * If `true`, the modal can only be opened once; it will be\n * disposed as soon as it's closed.\n *\n * @param {boolean} [options.uncloseable=false]\n * If `true`, the user will not be able to close the modal\n * through the UI in the normal ways. Programmatic closing is\n * still possible.\n */\n function ModalDialog(player, options) {\n var _this;\n\n _this = _Component.call(this, player, options) || this;\n _this.opened_ = _this.hasBeenOpened_ = _this.hasBeenFilled_ = false;\n\n _this.closeable(!_this.options_.uncloseable);\n\n _this.content(_this.options_.content); // Make sure the contentEl is defined AFTER any children are initialized\n // because we only want the contents of the modal in the contentEl\n // (not the UI elements like the close button).\n\n\n _this.contentEl_ = createEl('div', {\n className: MODAL_CLASS_NAME + \"-content\"\n }, {\n role: 'document'\n });\n _this.descEl_ = createEl('p', {\n className: MODAL_CLASS_NAME + \"-description vjs-control-text\",\n id: _this.el().getAttribute('aria-describedby')\n });\n textContent(_this.descEl_, _this.description());\n\n _this.el_.appendChild(_this.descEl_);\n\n _this.el_.appendChild(_this.contentEl_);\n\n return _this;\n }\n /**\n * Create the `ModalDialog`'s DOM element\n *\n * @return {Element}\n * The DOM element that gets created.\n */\n\n\n var _proto = ModalDialog.prototype;\n\n _proto.createEl = function createEl$$1() {\n return _Component.prototype.createEl.call(this, 'div', {\n className: this.buildCSSClass(),\n tabIndex: -1\n }, {\n 'aria-describedby': this.id() + \"_description\",\n 'aria-hidden': 'true',\n 'aria-label': this.label(),\n 'role': 'dialog'\n });\n };\n\n _proto.dispose = function dispose() {\n this.contentEl_ = null;\n this.descEl_ = null;\n this.previouslyActiveEl_ = null;\n\n _Component.prototype.dispose.call(this);\n };\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n _proto.buildCSSClass = function buildCSSClass() {\n return MODAL_CLASS_NAME + \" vjs-hidden \" + _Component.prototype.buildCSSClass.call(this);\n };\n /**\n * Handles `keydown` events on the document, looking for ESC, which closes\n * the modal.\n *\n * @param {EventTarget~Event} e\n * The keypress that triggered this event.\n *\n * @listens keydown\n */\n\n\n _proto.handleKeyPress = function handleKeyPress(e) {\n if (e.which === ESC && this.closeable()) {\n this.close();\n }\n };\n /**\n * Returns the label string for this modal. Primarily used for accessibility.\n *\n * @return {string}\n * the localized or raw label of this modal.\n */\n\n\n _proto.label = function label() {\n return this.localize(this.options_.label || 'Modal Window');\n };\n /**\n * Returns the description string for this modal. Primarily used for\n * accessibility.\n *\n * @return {string}\n * The localized or raw description of this modal.\n */\n\n\n _proto.description = function description() {\n var desc = this.options_.description || this.localize('This is a modal window.'); // Append a universal closeability message if the modal is closeable.\n\n if (this.closeable()) {\n desc += ' ' + this.localize('This modal can be closed by pressing the Escape key or activating the close button.');\n }\n\n return desc;\n };\n /**\n * Opens the modal.\n *\n * @fires ModalDialog#beforemodalopen\n * @fires ModalDialog#modalopen\n */\n\n\n _proto.open = function open() {\n if (!this.opened_) {\n var player = this.player();\n /**\n * Fired just before a `ModalDialog` is opened.\n *\n * @event ModalDialog#beforemodalopen\n * @type {EventTarget~Event}\n */\n\n this.trigger('beforemodalopen');\n this.opened_ = true; // Fill content if the modal has never opened before and\n // never been filled.\n\n if (this.options_.fillAlways || !this.hasBeenOpened_ && !this.hasBeenFilled_) {\n this.fill();\n } // If the player was playing, pause it and take note of its previously\n // playing state.\n\n\n this.wasPlaying_ = !player.paused();\n\n if (this.options_.pauseOnOpen && this.wasPlaying_) {\n player.pause();\n }\n\n if (this.closeable()) {\n this.on(this.el_.ownerDocument, 'keydown', bind(this, this.handleKeyPress));\n } // Hide controls and note if they were enabled.\n\n\n this.hadControls_ = player.controls();\n player.controls(false);\n this.show();\n this.conditionalFocus_();\n this.el().setAttribute('aria-hidden', 'false');\n /**\n * Fired just after a `ModalDialog` is opened.\n *\n * @event ModalDialog#modalopen\n * @type {EventTarget~Event}\n */\n\n this.trigger('modalopen');\n this.hasBeenOpened_ = true;\n }\n };\n /**\n * If the `ModalDialog` is currently open or closed.\n *\n * @param {boolean} [value]\n * If given, it will open (`true`) or close (`false`) the modal.\n *\n * @return {boolean}\n * the current open state of the modaldialog\n */\n\n\n _proto.opened = function opened(value) {\n if (typeof value === 'boolean') {\n this[value ? 'open' : 'close']();\n }\n\n return this.opened_;\n };\n /**\n * Closes the modal, does nothing if the `ModalDialog` is\n * not open.\n *\n * @fires ModalDialog#beforemodalclose\n * @fires ModalDialog#modalclose\n */\n\n\n _proto.close = function close() {\n if (!this.opened_) {\n return;\n }\n\n var player = this.player();\n /**\n * Fired just before a `ModalDialog` is closed.\n *\n * @event ModalDialog#beforemodalclose\n * @type {EventTarget~Event}\n */\n\n this.trigger('beforemodalclose');\n this.opened_ = false;\n\n if (this.wasPlaying_ && this.options_.pauseOnOpen) {\n player.play();\n }\n\n if (this.closeable()) {\n this.off(this.el_.ownerDocument, 'keydown', bind(this, this.handleKeyPress));\n }\n\n if (this.hadControls_) {\n player.controls(true);\n }\n\n this.hide();\n this.el().setAttribute('aria-hidden', 'true');\n /**\n * Fired just after a `ModalDialog` is closed.\n *\n * @event ModalDialog#modalclose\n * @type {EventTarget~Event}\n */\n\n this.trigger('modalclose');\n this.conditionalBlur_();\n\n if (this.options_.temporary) {\n this.dispose();\n }\n };\n /**\n * Check to see if the `ModalDialog` is closeable via the UI.\n *\n * @param {boolean} [value]\n * If given as a boolean, it will set the `closeable` option.\n *\n * @return {boolean}\n * Returns the final value of the closable option.\n */\n\n\n _proto.closeable = function closeable(value) {\n if (typeof value === 'boolean') {\n var closeable = this.closeable_ = !!value;\n var close = this.getChild('closeButton'); // If this is being made closeable and has no close button, add one.\n\n if (closeable && !close) {\n // The close button should be a child of the modal - not its\n // content element, so temporarily change the content element.\n var temp = this.contentEl_;\n this.contentEl_ = this.el_;\n close = this.addChild('closeButton', {\n controlText: 'Close Modal Dialog'\n });\n this.contentEl_ = temp;\n this.on(close, 'close', this.close);\n } // If this is being made uncloseable and has a close button, remove it.\n\n\n if (!closeable && close) {\n this.off(close, 'close', this.close);\n this.removeChild(close);\n close.dispose();\n }\n }\n\n return this.closeable_;\n };\n /**\n * Fill the modal's content element with the modal's \"content\" option.\n * The content element will be emptied before this change takes place.\n */\n\n\n _proto.fill = function fill() {\n this.fillWith(this.content());\n };\n /**\n * Fill the modal's content element with arbitrary content.\n * The content element will be emptied before this change takes place.\n *\n * @fires ModalDialog#beforemodalfill\n * @fires ModalDialog#modalfill\n *\n * @param {Mixed} [content]\n * The same rules apply to this as apply to the `content` option.\n */\n\n\n _proto.fillWith = function fillWith(content) {\n var contentEl = this.contentEl();\n var parentEl = contentEl.parentNode;\n var nextSiblingEl = contentEl.nextSibling;\n /**\n * Fired just before a `ModalDialog` is filled with content.\n *\n * @event ModalDialog#beforemodalfill\n * @type {EventTarget~Event}\n */\n\n this.trigger('beforemodalfill');\n this.hasBeenFilled_ = true; // Detach the content element from the DOM before performing\n // manipulation to avoid modifying the live DOM multiple times.\n\n parentEl.removeChild(contentEl);\n this.empty();\n insertContent(contentEl, content);\n /**\n * Fired just after a `ModalDialog` is filled with content.\n *\n * @event ModalDialog#modalfill\n * @type {EventTarget~Event}\n */\n\n this.trigger('modalfill'); // Re-inject the re-filled content element.\n\n if (nextSiblingEl) {\n parentEl.insertBefore(contentEl, nextSiblingEl);\n } else {\n parentEl.appendChild(contentEl);\n } // make sure that the close button is last in the dialog DOM\n\n\n var closeButton = this.getChild('closeButton');\n\n if (closeButton) {\n parentEl.appendChild(closeButton.el_);\n }\n };\n /**\n * Empties the content element. This happens anytime the modal is filled.\n *\n * @fires ModalDialog#beforemodalempty\n * @fires ModalDialog#modalempty\n */\n\n\n _proto.empty = function empty() {\n /**\n * Fired just before a `ModalDialog` is emptied.\n *\n * @event ModalDialog#beforemodalempty\n * @type {EventTarget~Event}\n */\n this.trigger('beforemodalempty');\n emptyEl(this.contentEl());\n /**\n * Fired just after a `ModalDialog` is emptied.\n *\n * @event ModalDialog#modalempty\n * @type {EventTarget~Event}\n */\n\n this.trigger('modalempty');\n };\n /**\n * Gets or sets the modal content, which gets normalized before being\n * rendered into the DOM.\n *\n * This does not update the DOM or fill the modal, but it is called during\n * that process.\n *\n * @param {Mixed} [value]\n * If defined, sets the internal content value to be used on the\n * next call(s) to `fill`. This value is normalized before being\n * inserted. To \"clear\" the internal content value, pass `null`.\n *\n * @return {Mixed}\n * The current content of the modal dialog\n */\n\n\n _proto.content = function content(value) {\n if (typeof value !== 'undefined') {\n this.content_ = value;\n }\n\n return this.content_;\n };\n /**\n * conditionally focus the modal dialog if focus was previously on the player.\n *\n * @private\n */\n\n\n _proto.conditionalFocus_ = function conditionalFocus_() {\n var activeEl = document.activeElement;\n var playerEl = this.player_.el_;\n this.previouslyActiveEl_ = null;\n\n if (playerEl.contains(activeEl) || playerEl === activeEl) {\n this.previouslyActiveEl_ = activeEl;\n this.focus();\n this.on(document, 'keydown', this.handleKeyDown);\n }\n };\n /**\n * conditionally blur the element and refocus the last focused element\n *\n * @private\n */\n\n\n _proto.conditionalBlur_ = function conditionalBlur_() {\n if (this.previouslyActiveEl_) {\n this.previouslyActiveEl_.focus();\n this.previouslyActiveEl_ = null;\n }\n\n this.off(document, 'keydown', this.handleKeyDown);\n };\n /**\n * Keydown handler. Attached when modal is focused.\n *\n * @listens keydown\n */\n\n\n _proto.handleKeyDown = function handleKeyDown(event) {\n // exit early if it isn't a tab key\n if (event.which !== 9) {\n return;\n }\n\n var focusableEls = this.focusableEls_();\n var activeEl = this.el_.querySelector(':focus');\n var focusIndex;\n\n for (var i = 0; i < focusableEls.length; i++) {\n if (activeEl === focusableEls[i]) {\n focusIndex = i;\n break;\n }\n }\n\n if (document.activeElement === this.el_) {\n focusIndex = 0;\n }\n\n if (event.shiftKey && focusIndex === 0) {\n focusableEls[focusableEls.length - 1].focus();\n event.preventDefault();\n } else if (!event.shiftKey && focusIndex === focusableEls.length - 1) {\n focusableEls[0].focus();\n event.preventDefault();\n }\n };\n /**\n * get all focusable elements\n *\n * @private\n */\n\n\n _proto.focusableEls_ = function focusableEls_() {\n var allChildren = this.el_.querySelectorAll('*');\n return Array.prototype.filter.call(allChildren, function (child) {\n return (child instanceof window$1.HTMLAnchorElement || child instanceof window$1.HTMLAreaElement) && child.hasAttribute('href') || (child instanceof window$1.HTMLInputElement || child instanceof window$1.HTMLSelectElement || child instanceof window$1.HTMLTextAreaElement || child instanceof window$1.HTMLButtonElement) && !child.hasAttribute('disabled') || child instanceof window$1.HTMLIFrameElement || child instanceof window$1.HTMLObjectElement || child instanceof window$1.HTMLEmbedElement || child.hasAttribute('tabindex') && child.getAttribute('tabindex') !== -1 || child.hasAttribute('contenteditable');\n });\n };\n\n return ModalDialog;\n}(Component);\n/**\n * Default options for `ModalDialog` default options.\n *\n * @type {Object}\n * @private\n */\n\n\nModalDialog.prototype.options_ = {\n pauseOnOpen: true,\n temporary: true\n};\nComponent.registerComponent('ModalDialog', ModalDialog);\n\n/**\n * Common functionaliy between {@link TextTrackList}, {@link AudioTrackList}, and\n * {@link VideoTrackList}\n *\n * @extends EventTarget\n */\n\nvar TrackList =\n/*#__PURE__*/\nfunction (_EventTarget) {\n _inheritsLoose(TrackList, _EventTarget);\n\n /**\n * Create an instance of this class\n *\n * @param {Track[]} tracks\n * A list of tracks to initialize the list with.\n *\n * @abstract\n */\n function TrackList(tracks) {\n var _this;\n\n if (tracks === void 0) {\n tracks = [];\n }\n\n _this = _EventTarget.call(this) || this;\n _this.tracks_ = [];\n /**\n * @memberof TrackList\n * @member {number} length\n * The current number of `Track`s in the this Trackist.\n * @instance\n */\n\n Object.defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), 'length', {\n get: function get() {\n return this.tracks_.length;\n }\n });\n\n for (var i = 0; i < tracks.length; i++) {\n _this.addTrack(tracks[i]);\n }\n\n return _this;\n }\n /**\n * Add a {@link Track} to the `TrackList`\n *\n * @param {Track} track\n * The audio, video, or text track to add to the list.\n *\n * @fires TrackList#addtrack\n */\n\n\n var _proto = TrackList.prototype;\n\n _proto.addTrack = function addTrack(track) {\n var index = this.tracks_.length;\n\n if (!('' + index in this)) {\n Object.defineProperty(this, index, {\n get: function get() {\n return this.tracks_[index];\n }\n });\n } // Do not add duplicate tracks\n\n\n if (this.tracks_.indexOf(track) === -1) {\n this.tracks_.push(track);\n /**\n * Triggered when a track is added to a track list.\n *\n * @event TrackList#addtrack\n * @type {EventTarget~Event}\n * @property {Track} track\n * A reference to track that was added.\n */\n\n this.trigger({\n track: track,\n type: 'addtrack'\n });\n }\n };\n /**\n * Remove a {@link Track} from the `TrackList`\n *\n * @param {Track} rtrack\n * The audio, video, or text track to remove from the list.\n *\n * @fires TrackList#removetrack\n */\n\n\n _proto.removeTrack = function removeTrack(rtrack) {\n var track;\n\n for (var i = 0, l = this.length; i < l; i++) {\n if (this[i] === rtrack) {\n track = this[i];\n\n if (track.off) {\n track.off();\n }\n\n this.tracks_.splice(i, 1);\n break;\n }\n }\n\n if (!track) {\n return;\n }\n /**\n * Triggered when a track is removed from track list.\n *\n * @event TrackList#removetrack\n * @type {EventTarget~Event}\n * @property {Track} track\n * A reference to track that was removed.\n */\n\n\n this.trigger({\n track: track,\n type: 'removetrack'\n });\n };\n /**\n * Get a Track from the TrackList by a tracks id\n *\n * @param {string} id - the id of the track to get\n * @method getTrackById\n * @return {Track}\n * @private\n */\n\n\n _proto.getTrackById = function getTrackById(id) {\n var result = null;\n\n for (var i = 0, l = this.length; i < l; i++) {\n var track = this[i];\n\n if (track.id === id) {\n result = track;\n break;\n }\n }\n\n return result;\n };\n\n return TrackList;\n}(EventTarget);\n/**\n * Triggered when a different track is selected/enabled.\n *\n * @event TrackList#change\n * @type {EventTarget~Event}\n */\n\n/**\n * Events that can be called with on + eventName. See {@link EventHandler}.\n *\n * @property {Object} TrackList#allowedEvents_\n * @private\n */\n\n\nTrackList.prototype.allowedEvents_ = {\n change: 'change',\n addtrack: 'addtrack',\n removetrack: 'removetrack'\n}; // emulate attribute EventHandler support to allow for feature detection\n\nfor (var event in TrackList.prototype.allowedEvents_) {\n TrackList.prototype['on' + event] = null;\n}\n\n/**\n * Anywhere we call this function we diverge from the spec\n * as we only support one enabled audiotrack at a time\n *\n * @param {AudioTrackList} list\n * list to work on\n *\n * @param {AudioTrack} track\n * The track to skip\n *\n * @private\n */\n\nvar disableOthers = function disableOthers(list, track) {\n for (var i = 0; i < list.length; i++) {\n if (!Object.keys(list[i]).length || track.id === list[i].id) {\n continue;\n } // another audio track is enabled, disable it\n\n\n list[i].enabled = false;\n }\n};\n/**\n * The current list of {@link AudioTrack} for a media file.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#audiotracklist}\n * @extends TrackList\n */\n\n\nvar AudioTrackList =\n/*#__PURE__*/\nfunction (_TrackList) {\n _inheritsLoose(AudioTrackList, _TrackList);\n\n /**\n * Create an instance of this class.\n *\n * @param {AudioTrack[]} [tracks=[]]\n * A list of `AudioTrack` to instantiate the list with.\n */\n function AudioTrackList(tracks) {\n var _this;\n\n if (tracks === void 0) {\n tracks = [];\n }\n\n // make sure only 1 track is enabled\n // sorted from last index to first index\n for (var i = tracks.length - 1; i >= 0; i--) {\n if (tracks[i].enabled) {\n disableOthers(tracks, tracks[i]);\n break;\n }\n }\n\n _this = _TrackList.call(this, tracks) || this;\n _this.changing_ = false;\n return _this;\n }\n /**\n * Add an {@link AudioTrack} to the `AudioTrackList`.\n *\n * @param {AudioTrack} track\n * The AudioTrack to add to the list\n *\n * @fires TrackList#addtrack\n */\n\n\n var _proto = AudioTrackList.prototype;\n\n _proto.addTrack = function addTrack(track) {\n var _this2 = this;\n\n if (track.enabled) {\n disableOthers(this, track);\n }\n\n _TrackList.prototype.addTrack.call(this, track); // native tracks don't have this\n\n\n if (!track.addEventListener) {\n return;\n }\n /**\n * @listens AudioTrack#enabledchange\n * @fires TrackList#change\n */\n\n\n track.addEventListener('enabledchange', function () {\n // when we are disabling other tracks (since we don't support\n // more than one track at a time) we will set changing_\n // to true so that we don't trigger additional change events\n if (_this2.changing_) {\n return;\n }\n\n _this2.changing_ = true;\n disableOthers(_this2, track);\n _this2.changing_ = false;\n\n _this2.trigger('change');\n });\n };\n\n return AudioTrackList;\n}(TrackList);\n\n/**\n * Un-select all other {@link VideoTrack}s that are selected.\n *\n * @param {VideoTrackList} list\n * list to work on\n *\n * @param {VideoTrack} track\n * The track to skip\n *\n * @private\n */\n\nvar disableOthers$1 = function disableOthers(list, track) {\n for (var i = 0; i < list.length; i++) {\n if (!Object.keys(list[i]).length || track.id === list[i].id) {\n continue;\n } // another video track is enabled, disable it\n\n\n list[i].selected = false;\n }\n};\n/**\n * The current list of {@link VideoTrack} for a video.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#videotracklist}\n * @extends TrackList\n */\n\n\nvar VideoTrackList =\n/*#__PURE__*/\nfunction (_TrackList) {\n _inheritsLoose(VideoTrackList, _TrackList);\n\n /**\n * Create an instance of this class.\n *\n * @param {VideoTrack[]} [tracks=[]]\n * A list of `VideoTrack` to instantiate the list with.\n */\n function VideoTrackList(tracks) {\n var _this;\n\n if (tracks === void 0) {\n tracks = [];\n }\n\n // make sure only 1 track is enabled\n // sorted from last index to first index\n for (var i = tracks.length - 1; i >= 0; i--) {\n if (tracks[i].selected) {\n disableOthers$1(tracks, tracks[i]);\n break;\n }\n }\n\n _this = _TrackList.call(this, tracks) || this;\n _this.changing_ = false;\n /**\n * @member {number} VideoTrackList#selectedIndex\n * The current index of the selected {@link VideoTrack`}.\n */\n\n Object.defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), 'selectedIndex', {\n get: function get() {\n for (var _i = 0; _i < this.length; _i++) {\n if (this[_i].selected) {\n return _i;\n }\n }\n\n return -1;\n },\n set: function set() {}\n });\n return _this;\n }\n /**\n * Add a {@link VideoTrack} to the `VideoTrackList`.\n *\n * @param {VideoTrack} track\n * The VideoTrack to add to the list\n *\n * @fires TrackList#addtrack\n */\n\n\n var _proto = VideoTrackList.prototype;\n\n _proto.addTrack = function addTrack(track) {\n var _this2 = this;\n\n if (track.selected) {\n disableOthers$1(this, track);\n }\n\n _TrackList.prototype.addTrack.call(this, track); // native tracks don't have this\n\n\n if (!track.addEventListener) {\n return;\n }\n /**\n * @listens VideoTrack#selectedchange\n * @fires TrackList#change\n */\n\n\n track.addEventListener('selectedchange', function () {\n if (_this2.changing_) {\n return;\n }\n\n _this2.changing_ = true;\n disableOthers$1(_this2, track);\n _this2.changing_ = false;\n\n _this2.trigger('change');\n });\n };\n\n return VideoTrackList;\n}(TrackList);\n\n/**\n * The current list of {@link TextTrack} for a media file.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#texttracklist}\n * @extends TrackList\n */\n\nvar TextTrackList =\n/*#__PURE__*/\nfunction (_TrackList) {\n _inheritsLoose(TextTrackList, _TrackList);\n\n function TextTrackList() {\n return _TrackList.apply(this, arguments) || this;\n }\n\n var _proto = TextTrackList.prototype;\n\n /**\n * Add a {@link TextTrack} to the `TextTrackList`\n *\n * @param {TextTrack} track\n * The text track to add to the list.\n *\n * @fires TrackList#addtrack\n */\n _proto.addTrack = function addTrack(track) {\n _TrackList.prototype.addTrack.call(this, track);\n /**\n * @listens TextTrack#modechange\n * @fires TrackList#change\n */\n\n\n track.addEventListener('modechange', bind(this, function () {\n this.queueTrigger('change');\n }));\n var nonLanguageTextTrackKind = ['metadata', 'chapters'];\n\n if (nonLanguageTextTrackKind.indexOf(track.kind) === -1) {\n track.addEventListener('modechange', bind(this, function () {\n this.trigger('selectedlanguagechange');\n }));\n }\n };\n\n return TextTrackList;\n}(TrackList);\n\n/**\n * @file html-track-element-list.js\n */\n\n/**\n * The current list of {@link HtmlTrackElement}s.\n */\nvar HtmlTrackElementList =\n/*#__PURE__*/\nfunction () {\n /**\n * Create an instance of this class.\n *\n * @param {HtmlTrackElement[]} [tracks=[]]\n * A list of `HtmlTrackElement` to instantiate the list with.\n */\n function HtmlTrackElementList(trackElements) {\n if (trackElements === void 0) {\n trackElements = [];\n }\n\n this.trackElements_ = [];\n /**\n * @memberof HtmlTrackElementList\n * @member {number} length\n * The current number of `Track`s in the this Trackist.\n * @instance\n */\n\n Object.defineProperty(this, 'length', {\n get: function get() {\n return this.trackElements_.length;\n }\n });\n\n for (var i = 0, length = trackElements.length; i < length; i++) {\n this.addTrackElement_(trackElements[i]);\n }\n }\n /**\n * Add an {@link HtmlTrackElement} to the `HtmlTrackElementList`\n *\n * @param {HtmlTrackElement} trackElement\n * The track element to add to the list.\n *\n * @private\n */\n\n\n var _proto = HtmlTrackElementList.prototype;\n\n _proto.addTrackElement_ = function addTrackElement_(trackElement) {\n var index = this.trackElements_.length;\n\n if (!('' + index in this)) {\n Object.defineProperty(this, index, {\n get: function get() {\n return this.trackElements_[index];\n }\n });\n } // Do not add duplicate elements\n\n\n if (this.trackElements_.indexOf(trackElement) === -1) {\n this.trackElements_.push(trackElement);\n }\n };\n /**\n * Get an {@link HtmlTrackElement} from the `HtmlTrackElementList` given an\n * {@link TextTrack}.\n *\n * @param {TextTrack} track\n * The track associated with a track element.\n *\n * @return {HtmlTrackElement|undefined}\n * The track element that was found or undefined.\n *\n * @private\n */\n\n\n _proto.getTrackElementByTrack_ = function getTrackElementByTrack_(track) {\n var trackElement_;\n\n for (var i = 0, length = this.trackElements_.length; i < length; i++) {\n if (track === this.trackElements_[i].track) {\n trackElement_ = this.trackElements_[i];\n break;\n }\n }\n\n return trackElement_;\n };\n /**\n * Remove a {@link HtmlTrackElement} from the `HtmlTrackElementList`\n *\n * @param {HtmlTrackElement} trackElement\n * The track element to remove from the list.\n *\n * @private\n */\n\n\n _proto.removeTrackElement_ = function removeTrackElement_(trackElement) {\n for (var i = 0, length = this.trackElements_.length; i < length; i++) {\n if (trackElement === this.trackElements_[i]) {\n this.trackElements_.splice(i, 1);\n break;\n }\n }\n };\n\n return HtmlTrackElementList;\n}();\n\n/**\n * @file text-track-cue-list.js\n */\n\n/**\n * @typedef {Object} TextTrackCueList~TextTrackCue\n *\n * @property {string} id\n * The unique id for this text track cue\n *\n * @property {number} startTime\n * The start time for this text track cue\n *\n * @property {number} endTime\n * The end time for this text track cue\n *\n * @property {boolean} pauseOnExit\n * Pause when the end time is reached if true.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#texttrackcue}\n */\n\n/**\n * A List of TextTrackCues.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#texttrackcuelist}\n */\nvar TextTrackCueList =\n/*#__PURE__*/\nfunction () {\n /**\n * Create an instance of this class..\n *\n * @param {Array} cues\n * A list of cues to be initialized with\n */\n function TextTrackCueList(cues) {\n TextTrackCueList.prototype.setCues_.call(this, cues);\n /**\n * @memberof TextTrackCueList\n * @member {number} length\n * The current number of `TextTrackCue`s in the TextTrackCueList.\n * @instance\n */\n\n Object.defineProperty(this, 'length', {\n get: function get() {\n return this.length_;\n }\n });\n }\n /**\n * A setter for cues in this list. Creates getters\n * an an index for the cues.\n *\n * @param {Array} cues\n * An array of cues to set\n *\n * @private\n */\n\n\n var _proto = TextTrackCueList.prototype;\n\n _proto.setCues_ = function setCues_(cues) {\n var oldLength = this.length || 0;\n var i = 0;\n var l = cues.length;\n this.cues_ = cues;\n this.length_ = cues.length;\n\n var defineProp = function defineProp(index) {\n if (!('' + index in this)) {\n Object.defineProperty(this, '' + index, {\n get: function get() {\n return this.cues_[index];\n }\n });\n }\n };\n\n if (oldLength < l) {\n i = oldLength;\n\n for (; i < l; i++) {\n defineProp.call(this, i);\n }\n }\n };\n /**\n * Get a `TextTrackCue` that is currently in the `TextTrackCueList` by id.\n *\n * @param {string} id\n * The id of the cue that should be searched for.\n *\n * @return {TextTrackCueList~TextTrackCue|null}\n * A single cue or null if none was found.\n */\n\n\n _proto.getCueById = function getCueById(id) {\n var result = null;\n\n for (var i = 0, l = this.length; i < l; i++) {\n var cue = this[i];\n\n if (cue.id === id) {\n result = cue;\n break;\n }\n }\n\n return result;\n };\n\n return TextTrackCueList;\n}();\n\n/**\n * @file track-kinds.js\n */\n\n/**\n * All possible `VideoTrackKind`s\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-videotrack-kind\n * @typedef VideoTrack~Kind\n * @enum\n */\nvar VideoTrackKind = {\n alternative: 'alternative',\n captions: 'captions',\n main: 'main',\n sign: 'sign',\n subtitles: 'subtitles',\n commentary: 'commentary'\n};\n/**\n * All possible `AudioTrackKind`s\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-audiotrack-kind\n * @typedef AudioTrack~Kind\n * @enum\n */\n\nvar AudioTrackKind = {\n 'alternative': 'alternative',\n 'descriptions': 'descriptions',\n 'main': 'main',\n 'main-desc': 'main-desc',\n 'translation': 'translation',\n 'commentary': 'commentary'\n};\n/**\n * All possible `TextTrackKind`s\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-texttrack-kind\n * @typedef TextTrack~Kind\n * @enum\n */\n\nvar TextTrackKind = {\n subtitles: 'subtitles',\n captions: 'captions',\n descriptions: 'descriptions',\n chapters: 'chapters',\n metadata: 'metadata'\n};\n/**\n * All possible `TextTrackMode`s\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#texttrackmode\n * @typedef TextTrack~Mode\n * @enum\n */\n\nvar TextTrackMode = {\n disabled: 'disabled',\n hidden: 'hidden',\n showing: 'showing'\n};\n\n/**\n * A Track class that contains all of the common functionality for {@link AudioTrack},\n * {@link VideoTrack}, and {@link TextTrack}.\n *\n * > Note: This class should not be used directly\n *\n * @see {@link https://html.spec.whatwg.org/multipage/embedded-content.html}\n * @extends EventTarget\n * @abstract\n */\n\nvar Track =\n/*#__PURE__*/\nfunction (_EventTarget) {\n _inheritsLoose(Track, _EventTarget);\n\n /**\n * Create an instance of this class.\n *\n * @param {Object} [options={}]\n * Object of option names and values\n *\n * @param {string} [options.kind='']\n * A valid kind for the track type you are creating.\n *\n * @param {string} [options.id='vjs_track_' + Guid.newGUID()]\n * A unique id for this AudioTrack.\n *\n * @param {string} [options.label='']\n * The menu label for this track.\n *\n * @param {string} [options.language='']\n * A valid two character language code.\n *\n * @abstract\n */\n function Track(options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n _this = _EventTarget.call(this) || this;\n var trackProps = {\n id: options.id || 'vjs_track_' + newGUID(),\n kind: options.kind || '',\n label: options.label || '',\n language: options.language || ''\n };\n /**\n * @memberof Track\n * @member {string} id\n * The id of this track. Cannot be changed after creation.\n * @instance\n *\n * @readonly\n */\n\n /**\n * @memberof Track\n * @member {string} kind\n * The kind of track that this is. Cannot be changed after creation.\n * @instance\n *\n * @readonly\n */\n\n /**\n * @memberof Track\n * @member {string} label\n * The label of this track. Cannot be changed after creation.\n * @instance\n *\n * @readonly\n */\n\n /**\n * @memberof Track\n * @member {string} language\n * The two letter language code for this track. Cannot be changed after\n * creation.\n * @instance\n *\n * @readonly\n */\n\n var _loop = function _loop(key) {\n Object.defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), key, {\n get: function get() {\n return trackProps[key];\n },\n set: function set() {}\n });\n };\n\n for (var key in trackProps) {\n _loop(key);\n }\n\n return _this;\n }\n\n return Track;\n}(EventTarget);\n\n/**\n * @file url.js\n * @module url\n */\n/**\n * @typedef {Object} url:URLObject\n *\n * @property {string} protocol\n * The protocol of the url that was parsed.\n *\n * @property {string} hostname\n * The hostname of the url that was parsed.\n *\n * @property {string} port\n * The port of the url that was parsed.\n *\n * @property {string} pathname\n * The pathname of the url that was parsed.\n *\n * @property {string} search\n * The search query of the url that was parsed.\n *\n * @property {string} hash\n * The hash of the url that was parsed.\n *\n * @property {string} host\n * The host of the url that was parsed.\n */\n\n/**\n * Resolve and parse the elements of a URL.\n *\n * @function\n * @param {String} url\n * The url to parse\n *\n * @return {url:URLObject}\n * An object of url details\n */\n\nvar parseUrl = function parseUrl(url) {\n var props = ['protocol', 'hostname', 'port', 'pathname', 'search', 'hash', 'host']; // add the url to an anchor and let the browser parse the URL\n\n var a = document.createElement('a');\n a.href = url; // IE8 (and 9?) Fix\n // ie8 doesn't parse the URL correctly until the anchor is actually\n // added to the body, and an innerHTML is needed to trigger the parsing\n\n var addToBody = a.host === '' && a.protocol !== 'file:';\n var div;\n\n if (addToBody) {\n div = document.createElement('div');\n div.innerHTML = \"<a href=\\\"\" + url + \"\\\"></a>\";\n a = div.firstChild; // prevent the div from affecting layout\n\n div.setAttribute('style', 'display:none; position:absolute;');\n document.body.appendChild(div);\n } // Copy the specific URL properties to a new object\n // This is also needed for IE8 because the anchor loses its\n // properties when it's removed from the dom\n\n\n var details = {};\n\n for (var i = 0; i < props.length; i++) {\n details[props[i]] = a[props[i]];\n } // IE9 adds the port to the host property unlike everyone else. If\n // a port identifier is added for standard ports, strip it.\n\n\n if (details.protocol === 'http:') {\n details.host = details.host.replace(/:80$/, '');\n }\n\n if (details.protocol === 'https:') {\n details.host = details.host.replace(/:443$/, '');\n }\n\n if (!details.protocol) {\n details.protocol = window$1.location.protocol;\n }\n\n if (addToBody) {\n document.body.removeChild(div);\n }\n\n return details;\n};\n/**\n * Get absolute version of relative URL. Used to tell Flash the correct URL.\n *\n * @function\n * @param {string} url\n * URL to make absolute\n *\n * @return {string}\n * Absolute URL\n *\n * @see http://stackoverflow.com/questions/470832/getting-an-absolute-url-from-a-relative-one-ie6-issue\n */\n\nvar getAbsoluteURL = function getAbsoluteURL(url) {\n // Check if absolute URL\n if (!url.match(/^https?:\\/\\//)) {\n // Convert to absolute URL. Flash hosted off-site needs an absolute URL.\n var div = document.createElement('div');\n div.innerHTML = \"<a href=\\\"\" + url + \"\\\">x</a>\";\n url = div.firstChild.href;\n }\n\n return url;\n};\n/**\n * Returns the extension of the passed file name. It will return an empty string\n * if passed an invalid path.\n *\n * @function\n * @param {string} path\n * The fileName path like '/path/to/file.mp4'\n *\n * @returns {string}\n * The extension in lower case or an empty string if no\n * extension could be found.\n */\n\nvar getFileExtension = function getFileExtension(path) {\n if (typeof path === 'string') {\n var splitPathRe = /^(\\/?)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?)(\\.([^\\.\\/\\?]+)))(?:[\\/]*|[\\?].*)$/i;\n var pathParts = splitPathRe.exec(path);\n\n if (pathParts) {\n return pathParts.pop().toLowerCase();\n }\n }\n\n return '';\n};\n/**\n * Returns whether the url passed is a cross domain request or not.\n *\n * @function\n * @param {string} url\n * The url to check.\n *\n * @return {boolean}\n * Whether it is a cross domain request or not.\n */\n\nvar isCrossOrigin = function isCrossOrigin(url) {\n var winLoc = window$1.location;\n var urlInfo = parseUrl(url); // IE8 protocol relative urls will return ':' for protocol\n\n var srcProtocol = urlInfo.protocol === ':' ? winLoc.protocol : urlInfo.protocol; // Check if url is for another domain/origin\n // IE8 doesn't know location.origin, so we won't rely on it here\n\n var crossOrigin = srcProtocol + urlInfo.host !== winLoc.protocol + winLoc.host;\n return crossOrigin;\n};\n\nvar Url = /*#__PURE__*/Object.freeze({\n parseUrl: parseUrl,\n getAbsoluteURL: getAbsoluteURL,\n getFileExtension: getFileExtension,\n isCrossOrigin: isCrossOrigin\n});\n\n/**\n * Takes a webvtt file contents and parses it into cues\n *\n * @param {string} srcContent\n * webVTT file contents\n *\n * @param {TextTrack} track\n * TextTrack to add cues to. Cues come from the srcContent.\n *\n * @private\n */\n\nvar parseCues = function parseCues(srcContent, track) {\n var parser = new window$1.WebVTT.Parser(window$1, window$1.vttjs, window$1.WebVTT.StringDecoder());\n var errors = [];\n\n parser.oncue = function (cue) {\n track.addCue(cue);\n };\n\n parser.onparsingerror = function (error) {\n errors.push(error);\n };\n\n parser.onflush = function () {\n track.trigger({\n type: 'loadeddata',\n target: track\n });\n };\n\n parser.parse(srcContent);\n\n if (errors.length > 0) {\n if (window$1.console && window$1.console.groupCollapsed) {\n window$1.console.groupCollapsed(\"Text Track parsing errors for \" + track.src);\n }\n\n errors.forEach(function (error) {\n return log.error(error);\n });\n\n if (window$1.console && window$1.console.groupEnd) {\n window$1.console.groupEnd();\n }\n }\n\n parser.flush();\n};\n/**\n * Load a `TextTrack` from a specified url.\n *\n * @param {string} src\n * Url to load track from.\n *\n * @param {TextTrack} track\n * Track to add cues to. Comes from the content at the end of `url`.\n *\n * @private\n */\n\n\nvar loadTrack = function loadTrack(src, track) {\n var opts = {\n uri: src\n };\n var crossOrigin = isCrossOrigin(src);\n\n if (crossOrigin) {\n opts.cors = crossOrigin;\n }\n\n xhr(opts, bind(this, function (err, response, responseBody) {\n if (err) {\n return log.error(err, response);\n }\n\n track.loaded_ = true; // Make sure that vttjs has loaded, otherwise, wait till it finished loading\n // NOTE: this is only used for the alt/video.novtt.js build\n\n if (typeof window$1.WebVTT !== 'function') {\n if (track.tech_) {\n var loadHandler = function loadHandler() {\n return parseCues(responseBody, track);\n };\n\n track.tech_.on('vttjsloaded', loadHandler);\n track.tech_.on('vttjserror', function () {\n log.error(\"vttjs failed to load, stopping trying to process \" + track.src);\n track.tech_.off('vttjsloaded', loadHandler);\n });\n }\n } else {\n parseCues(responseBody, track);\n }\n }));\n};\n/**\n * A representation of a single `TextTrack`.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#texttrack}\n * @extends Track\n */\n\n\nvar TextTrack =\n/*#__PURE__*/\nfunction (_Track) {\n _inheritsLoose(TextTrack, _Track);\n\n /**\n * Create an instance of this class.\n *\n * @param {Object} options={}\n * Object of option names and values\n *\n * @param {Tech} options.tech\n * A reference to the tech that owns this TextTrack.\n *\n * @param {TextTrack~Kind} [options.kind='subtitles']\n * A valid text track kind.\n *\n * @param {TextTrack~Mode} [options.mode='disabled']\n * A valid text track mode.\n *\n * @param {string} [options.id='vjs_track_' + Guid.newGUID()]\n * A unique id for this TextTrack.\n *\n * @param {string} [options.label='']\n * The menu label for this track.\n *\n * @param {string} [options.language='']\n * A valid two character language code.\n *\n * @param {string} [options.srclang='']\n * A valid two character language code. An alternative, but deprioritized\n * version of `options.language`\n *\n * @param {string} [options.src]\n * A url to TextTrack cues.\n *\n * @param {boolean} [options.default]\n * If this track should default to on or off.\n */\n function TextTrack(options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n if (!options.tech) {\n throw new Error('A tech was not provided.');\n }\n\n var settings = mergeOptions(options, {\n kind: TextTrackKind[options.kind] || 'subtitles',\n language: options.language || options.srclang || ''\n });\n var mode = TextTrackMode[settings.mode] || 'disabled';\n var default_ = settings.default;\n\n if (settings.kind === 'metadata' || settings.kind === 'chapters') {\n mode = 'hidden';\n }\n\n _this = _Track.call(this, settings) || this;\n _this.tech_ = settings.tech;\n _this.cues_ = [];\n _this.activeCues_ = [];\n var cues = new TextTrackCueList(_this.cues_);\n var activeCues = new TextTrackCueList(_this.activeCues_);\n var changed = false;\n var timeupdateHandler = bind(_assertThisInitialized(_assertThisInitialized(_this)), function () {\n // Accessing this.activeCues for the side-effects of updating itself\n // due to it's nature as a getter function. Do not remove or cues will\n // stop updating!\n // Use the setter to prevent deletion from uglify (pure_getters rule)\n this.activeCues = this.activeCues;\n\n if (changed) {\n this.trigger('cuechange');\n changed = false;\n }\n });\n\n if (mode !== 'disabled') {\n _this.tech_.ready(function () {\n _this.tech_.on('timeupdate', timeupdateHandler);\n }, true);\n }\n\n Object.defineProperties(_assertThisInitialized(_assertThisInitialized(_this)), {\n /**\n * @memberof TextTrack\n * @member {boolean} default\n * If this track was set to be on or off by default. Cannot be changed after\n * creation.\n * @instance\n *\n * @readonly\n */\n default: {\n get: function get() {\n return default_;\n },\n set: function set() {}\n },\n\n /**\n * @memberof TextTrack\n * @member {string} mode\n * Set the mode of this TextTrack to a valid {@link TextTrack~Mode}. Will\n * not be set if setting to an invalid mode.\n * @instance\n *\n * @fires TextTrack#modechange\n */\n mode: {\n get: function get() {\n return mode;\n },\n set: function set(newMode) {\n var _this2 = this;\n\n if (!TextTrackMode[newMode]) {\n return;\n }\n\n mode = newMode;\n\n if (mode !== 'disabled') {\n this.tech_.ready(function () {\n _this2.tech_.on('timeupdate', timeupdateHandler);\n }, true);\n } else {\n this.tech_.off('timeupdate', timeupdateHandler);\n }\n /**\n * An event that fires when mode changes on this track. This allows\n * the TextTrackList that holds this track to act accordingly.\n *\n * > Note: This is not part of the spec!\n *\n * @event TextTrack#modechange\n * @type {EventTarget~Event}\n */\n\n\n this.trigger('modechange');\n }\n },\n\n /**\n * @memberof TextTrack\n * @member {TextTrackCueList} cues\n * The text track cue list for this TextTrack.\n * @instance\n */\n cues: {\n get: function get() {\n if (!this.loaded_) {\n return null;\n }\n\n return cues;\n },\n set: function set() {}\n },\n\n /**\n * @memberof TextTrack\n * @member {TextTrackCueList} activeCues\n * The list text track cues that are currently active for this TextTrack.\n * @instance\n */\n activeCues: {\n get: function get() {\n if (!this.loaded_) {\n return null;\n } // nothing to do\n\n\n if (this.cues.length === 0) {\n return activeCues;\n }\n\n var ct = this.tech_.currentTime();\n var active = [];\n\n for (var i = 0, l = this.cues.length; i < l; i++) {\n var cue = this.cues[i];\n\n if (cue.startTime <= ct && cue.endTime >= ct) {\n active.push(cue);\n } else if (cue.startTime === cue.endTime && cue.startTime <= ct && cue.startTime + 0.5 >= ct) {\n active.push(cue);\n }\n }\n\n changed = false;\n\n if (active.length !== this.activeCues_.length) {\n changed = true;\n } else {\n for (var _i = 0; _i < active.length; _i++) {\n if (this.activeCues_.indexOf(active[_i]) === -1) {\n changed = true;\n }\n }\n }\n\n this.activeCues_ = active;\n activeCues.setCues_(this.activeCues_);\n return activeCues;\n },\n // /!\\ Keep this setter empty (see the timeupdate handler above)\n set: function set() {}\n }\n });\n\n if (settings.src) {\n _this.src = settings.src;\n loadTrack(settings.src, _assertThisInitialized(_assertThisInitialized(_this)));\n } else {\n _this.loaded_ = true;\n }\n\n return _this;\n }\n /**\n * Add a cue to the internal list of cues.\n *\n * @param {TextTrack~Cue} cue\n * The cue to add to our internal list\n */\n\n\n var _proto = TextTrack.prototype;\n\n _proto.addCue = function addCue(originalCue) {\n var cue = originalCue;\n\n if (window$1.vttjs && !(originalCue instanceof window$1.vttjs.VTTCue)) {\n cue = new window$1.vttjs.VTTCue(originalCue.startTime, originalCue.endTime, originalCue.text);\n\n for (var prop in originalCue) {\n if (!(prop in cue)) {\n cue[prop] = originalCue[prop];\n }\n } // make sure that `id` is copied over\n\n\n cue.id = originalCue.id;\n cue.originalCue_ = originalCue;\n }\n\n var tracks = this.tech_.textTracks();\n\n for (var i = 0; i < tracks.length; i++) {\n if (tracks[i] !== this) {\n tracks[i].removeCue(cue);\n }\n }\n\n this.cues_.push(cue);\n this.cues.setCues_(this.cues_);\n };\n /**\n * Remove a cue from our internal list\n *\n * @param {TextTrack~Cue} removeCue\n * The cue to remove from our internal list\n */\n\n\n _proto.removeCue = function removeCue(_removeCue) {\n var i = this.cues_.length;\n\n while (i--) {\n var cue = this.cues_[i];\n\n if (cue === _removeCue || cue.originalCue_ && cue.originalCue_ === _removeCue) {\n this.cues_.splice(i, 1);\n this.cues.setCues_(this.cues_);\n break;\n }\n }\n };\n\n return TextTrack;\n}(Track);\n/**\n * cuechange - One or more cues in the track have become active or stopped being active.\n */\n\n\nTextTrack.prototype.allowedEvents_ = {\n cuechange: 'cuechange'\n};\n\n/**\n * A representation of a single `AudioTrack`. If it is part of an {@link AudioTrackList}\n * only one `AudioTrack` in the list will be enabled at a time.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#audiotrack}\n * @extends Track\n */\n\nvar AudioTrack =\n/*#__PURE__*/\nfunction (_Track) {\n _inheritsLoose(AudioTrack, _Track);\n\n /**\n * Create an instance of this class.\n *\n * @param {Object} [options={}]\n * Object of option names and values\n *\n * @param {AudioTrack~Kind} [options.kind='']\n * A valid audio track kind\n *\n * @param {string} [options.id='vjs_track_' + Guid.newGUID()]\n * A unique id for this AudioTrack.\n *\n * @param {string} [options.label='']\n * The menu label for this track.\n *\n * @param {string} [options.language='']\n * A valid two character language code.\n *\n * @param {boolean} [options.enabled]\n * If this track is the one that is currently playing. If this track is part of\n * an {@link AudioTrackList}, only one {@link AudioTrack} will be enabled.\n */\n function AudioTrack(options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n var settings = mergeOptions(options, {\n kind: AudioTrackKind[options.kind] || ''\n });\n _this = _Track.call(this, settings) || this;\n var enabled = false;\n /**\n * @memberof AudioTrack\n * @member {boolean} enabled\n * If this `AudioTrack` is enabled or not. When setting this will\n * fire {@link AudioTrack#enabledchange} if the state of enabled is changed.\n * @instance\n *\n * @fires VideoTrack#selectedchange\n */\n\n Object.defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), 'enabled', {\n get: function get() {\n return enabled;\n },\n set: function set(newEnabled) {\n // an invalid or unchanged value\n if (typeof newEnabled !== 'boolean' || newEnabled === enabled) {\n return;\n }\n\n enabled = newEnabled;\n /**\n * An event that fires when enabled changes on this track. This allows\n * the AudioTrackList that holds this track to act accordingly.\n *\n * > Note: This is not part of the spec! Native tracks will do\n * this internally without an event.\n *\n * @event AudioTrack#enabledchange\n * @type {EventTarget~Event}\n */\n\n this.trigger('enabledchange');\n }\n }); // if the user sets this track to selected then\n // set selected to that true value otherwise\n // we keep it false\n\n if (settings.enabled) {\n _this.enabled = settings.enabled;\n }\n\n _this.loaded_ = true;\n return _this;\n }\n\n return AudioTrack;\n}(Track);\n\n/**\n * A representation of a single `VideoTrack`.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#videotrack}\n * @extends Track\n */\n\nvar VideoTrack =\n/*#__PURE__*/\nfunction (_Track) {\n _inheritsLoose(VideoTrack, _Track);\n\n /**\n * Create an instance of this class.\n *\n * @param {Object} [options={}]\n * Object of option names and values\n *\n * @param {string} [options.kind='']\n * A valid {@link VideoTrack~Kind}\n *\n * @param {string} [options.id='vjs_track_' + Guid.newGUID()]\n * A unique id for this AudioTrack.\n *\n * @param {string} [options.label='']\n * The menu label for this track.\n *\n * @param {string} [options.language='']\n * A valid two character language code.\n *\n * @param {boolean} [options.selected]\n * If this track is the one that is currently playing.\n */\n function VideoTrack(options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n var settings = mergeOptions(options, {\n kind: VideoTrackKind[options.kind] || ''\n });\n _this = _Track.call(this, settings) || this;\n var selected = false;\n /**\n * @memberof VideoTrack\n * @member {boolean} selected\n * If this `VideoTrack` is selected or not. When setting this will\n * fire {@link VideoTrack#selectedchange} if the state of selected changed.\n * @instance\n *\n * @fires VideoTrack#selectedchange\n */\n\n Object.defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), 'selected', {\n get: function get() {\n return selected;\n },\n set: function set(newSelected) {\n // an invalid or unchanged value\n if (typeof newSelected !== 'boolean' || newSelected === selected) {\n return;\n }\n\n selected = newSelected;\n /**\n * An event that fires when selected changes on this track. This allows\n * the VideoTrackList that holds this track to act accordingly.\n *\n * > Note: This is not part of the spec! Native tracks will do\n * this internally without an event.\n *\n * @event VideoTrack#selectedchange\n * @type {EventTarget~Event}\n */\n\n this.trigger('selectedchange');\n }\n }); // if the user sets this track to selected then\n // set selected to that true value otherwise\n // we keep it false\n\n if (settings.selected) {\n _this.selected = settings.selected;\n }\n\n return _this;\n }\n\n return VideoTrack;\n}(Track);\n\n/**\n * @memberof HTMLTrackElement\n * @typedef {HTMLTrackElement~ReadyState}\n * @enum {number}\n */\n\nvar NONE = 0;\nvar LOADING = 1;\nvar LOADED = 2;\nvar ERROR = 3;\n/**\n * A single track represented in the DOM.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#htmltrackelement}\n * @extends EventTarget\n */\n\nvar HTMLTrackElement =\n/*#__PURE__*/\nfunction (_EventTarget) {\n _inheritsLoose(HTMLTrackElement, _EventTarget);\n\n /**\n * Create an instance of this class.\n *\n * @param {Object} options={}\n * Object of option names and values\n *\n * @param {Tech} options.tech\n * A reference to the tech that owns this HTMLTrackElement.\n *\n * @param {TextTrack~Kind} [options.kind='subtitles']\n * A valid text track kind.\n *\n * @param {TextTrack~Mode} [options.mode='disabled']\n * A valid text track mode.\n *\n * @param {string} [options.id='vjs_track_' + Guid.newGUID()]\n * A unique id for this TextTrack.\n *\n * @param {string} [options.label='']\n * The menu label for this track.\n *\n * @param {string} [options.language='']\n * A valid two character language code.\n *\n * @param {string} [options.srclang='']\n * A valid two character language code. An alternative, but deprioritized\n * vesion of `options.language`\n *\n * @param {string} [options.src]\n * A url to TextTrack cues.\n *\n * @param {boolean} [options.default]\n * If this track should default to on or off.\n */\n function HTMLTrackElement(options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n _this = _EventTarget.call(this) || this;\n var readyState;\n var track = new TextTrack(options);\n _this.kind = track.kind;\n _this.src = track.src;\n _this.srclang = track.language;\n _this.label = track.label;\n _this.default = track.default;\n Object.defineProperties(_assertThisInitialized(_assertThisInitialized(_this)), {\n /**\n * @memberof HTMLTrackElement\n * @member {HTMLTrackElement~ReadyState} readyState\n * The current ready state of the track element.\n * @instance\n */\n readyState: {\n get: function get() {\n return readyState;\n }\n },\n\n /**\n * @memberof HTMLTrackElement\n * @member {TextTrack} track\n * The underlying TextTrack object.\n * @instance\n *\n */\n track: {\n get: function get() {\n return track;\n }\n }\n });\n readyState = NONE;\n /**\n * @listens TextTrack#loadeddata\n * @fires HTMLTrackElement#load\n */\n\n track.addEventListener('loadeddata', function () {\n readyState = LOADED;\n\n _this.trigger({\n type: 'load',\n target: _assertThisInitialized(_assertThisInitialized(_this))\n });\n });\n return _this;\n }\n\n return HTMLTrackElement;\n}(EventTarget);\n\nHTMLTrackElement.prototype.allowedEvents_ = {\n load: 'load'\n};\nHTMLTrackElement.NONE = NONE;\nHTMLTrackElement.LOADING = LOADING;\nHTMLTrackElement.LOADED = LOADED;\nHTMLTrackElement.ERROR = ERROR;\n\n/*\n * This file contains all track properties that are used in\n * player.js, tech.js, html5.js and possibly other techs in the future.\n */\n\nvar NORMAL = {\n audio: {\n ListClass: AudioTrackList,\n TrackClass: AudioTrack,\n capitalName: 'Audio'\n },\n video: {\n ListClass: VideoTrackList,\n TrackClass: VideoTrack,\n capitalName: 'Video'\n },\n text: {\n ListClass: TextTrackList,\n TrackClass: TextTrack,\n capitalName: 'Text'\n }\n};\nObject.keys(NORMAL).forEach(function (type) {\n NORMAL[type].getterName = type + \"Tracks\";\n NORMAL[type].privateName = type + \"Tracks_\";\n});\nvar REMOTE = {\n remoteText: {\n ListClass: TextTrackList,\n TrackClass: TextTrack,\n capitalName: 'RemoteText',\n getterName: 'remoteTextTracks',\n privateName: 'remoteTextTracks_'\n },\n remoteTextEl: {\n ListClass: HtmlTrackElementList,\n TrackClass: HTMLTrackElement,\n capitalName: 'RemoteTextTrackEls',\n getterName: 'remoteTextTrackEls',\n privateName: 'remoteTextTrackEls_'\n }\n};\nvar ALL = mergeOptions(NORMAL, REMOTE);\nREMOTE.names = Object.keys(REMOTE);\nNORMAL.names = Object.keys(NORMAL);\nALL.names = [].concat(REMOTE.names).concat(NORMAL.names);\n\n/**\n * An Object containing a structure like: `{src: 'url', type: 'mimetype'}` or string\n * that just contains the src url alone.\n * * `var SourceObject = {src: 'http://ex.com/video.mp4', type: 'video/mp4'};`\n * `var SourceString = 'http://example.com/some-video.mp4';`\n *\n * @typedef {Object|string} Tech~SourceObject\n *\n * @property {string} src\n * The url to the source\n *\n * @property {string} type\n * The mime type of the source\n */\n\n/**\n * A function used by {@link Tech} to create a new {@link TextTrack}.\n *\n * @private\n *\n * @param {Tech} self\n * An instance of the Tech class.\n *\n * @param {string} kind\n * `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata)\n *\n * @param {string} [label]\n * Label to identify the text track\n *\n * @param {string} [language]\n * Two letter language abbreviation\n *\n * @param {Object} [options={}]\n * An object with additional text track options\n *\n * @return {TextTrack}\n * The text track that was created.\n */\n\nfunction createTrackHelper(self, kind, label, language, options) {\n if (options === void 0) {\n options = {};\n }\n\n var tracks = self.textTracks();\n options.kind = kind;\n\n if (label) {\n options.label = label;\n }\n\n if (language) {\n options.language = language;\n }\n\n options.tech = self;\n var track = new ALL.text.TrackClass(options);\n tracks.addTrack(track);\n return track;\n}\n/**\n * This is the base class for media playback technology controllers, such as\n * {@link Flash} and {@link HTML5}\n *\n * @extends Component\n */\n\n\nvar Tech =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(Tech, _Component);\n\n /**\n * Create an instance of this Tech.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Component~ReadyCallback} ready\n * Callback function to call when the `HTML5` Tech is ready.\n */\n function Tech(options, ready) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n if (ready === void 0) {\n ready = function ready() {};\n }\n\n // we don't want the tech to report user activity automatically.\n // This is done manually in addControlsListeners\n options.reportTouchActivity = false;\n _this = _Component.call(this, null, options, ready) || this; // keep track of whether the current source has played at all to\n // implement a very limited played()\n\n _this.hasStarted_ = false;\n\n _this.on('playing', function () {\n this.hasStarted_ = true;\n });\n\n _this.on('loadstart', function () {\n this.hasStarted_ = false;\n });\n\n ALL.names.forEach(function (name) {\n var props = ALL[name];\n\n if (options && options[props.getterName]) {\n _this[props.privateName] = options[props.getterName];\n }\n }); // Manually track progress in cases where the browser/flash player doesn't report it.\n\n if (!_this.featuresProgressEvents) {\n _this.manualProgressOn();\n } // Manually track timeupdates in cases where the browser/flash player doesn't report it.\n\n\n if (!_this.featuresTimeupdateEvents) {\n _this.manualTimeUpdatesOn();\n }\n\n ['Text', 'Audio', 'Video'].forEach(function (track) {\n if (options[\"native\" + track + \"Tracks\"] === false) {\n _this[\"featuresNative\" + track + \"Tracks\"] = false;\n }\n });\n\n if (options.nativeCaptions === false || options.nativeTextTracks === false) {\n _this.featuresNativeTextTracks = false;\n } else if (options.nativeCaptions === true || options.nativeTextTracks === true) {\n _this.featuresNativeTextTracks = true;\n }\n\n if (!_this.featuresNativeTextTracks) {\n _this.emulateTextTracks();\n }\n\n _this.autoRemoteTextTracks_ = new ALL.text.ListClass();\n\n _this.initTrackListeners(); // Turn on component tap events only if not using native controls\n\n\n if (!options.nativeControlsForTouch) {\n _this.emitTapEvents();\n }\n\n if (_this.constructor) {\n _this.name_ = _this.constructor.name || 'Unknown Tech';\n }\n\n return _this;\n }\n /**\n * A special function to trigger source set in a way that will allow player\n * to re-trigger if the player or tech are not ready yet.\n *\n * @fires Tech#sourceset\n * @param {string} src The source string at the time of the source changing.\n */\n\n\n var _proto = Tech.prototype;\n\n _proto.triggerSourceset = function triggerSourceset(src) {\n var _this2 = this;\n\n if (!this.isReady_) {\n // on initial ready we have to trigger source set\n // 1ms after ready so that player can watch for it.\n this.one('ready', function () {\n return _this2.setTimeout(function () {\n return _this2.triggerSourceset(src);\n }, 1);\n });\n }\n /**\n * Fired when the source is set on the tech causing the media element\n * to reload.\n *\n * @see {@link Player#event:sourceset}\n * @event Tech#sourceset\n * @type {EventTarget~Event}\n */\n\n\n this.trigger({\n src: src,\n type: 'sourceset'\n });\n };\n /* Fallbacks for unsupported event types\n ================================================================================ */\n\n /**\n * Polyfill the `progress` event for browsers that don't support it natively.\n *\n * @see {@link Tech#trackProgress}\n */\n\n\n _proto.manualProgressOn = function manualProgressOn() {\n this.on('durationchange', this.onDurationChange);\n this.manualProgress = true; // Trigger progress watching when a source begins loading\n\n this.one('ready', this.trackProgress);\n };\n /**\n * Turn off the polyfill for `progress` events that was created in\n * {@link Tech#manualProgressOn}\n */\n\n\n _proto.manualProgressOff = function manualProgressOff() {\n this.manualProgress = false;\n this.stopTrackingProgress();\n this.off('durationchange', this.onDurationChange);\n };\n /**\n * This is used to trigger a `progress` event when the buffered percent changes. It\n * sets an interval function that will be called every 500 milliseconds to check if the\n * buffer end percent has changed.\n *\n * > This function is called by {@link Tech#manualProgressOn}\n *\n * @param {EventTarget~Event} event\n * The `ready` event that caused this to run.\n *\n * @listens Tech#ready\n * @fires Tech#progress\n */\n\n\n _proto.trackProgress = function trackProgress(event) {\n this.stopTrackingProgress();\n this.progressInterval = this.setInterval(bind(this, function () {\n // Don't trigger unless buffered amount is greater than last time\n var numBufferedPercent = this.bufferedPercent();\n\n if (this.bufferedPercent_ !== numBufferedPercent) {\n /**\n * See {@link Player#progress}\n *\n * @event Tech#progress\n * @type {EventTarget~Event}\n */\n this.trigger('progress');\n }\n\n this.bufferedPercent_ = numBufferedPercent;\n\n if (numBufferedPercent === 1) {\n this.stopTrackingProgress();\n }\n }), 500);\n };\n /**\n * Update our internal duration on a `durationchange` event by calling\n * {@link Tech#duration}.\n *\n * @param {EventTarget~Event} event\n * The `durationchange` event that caused this to run.\n *\n * @listens Tech#durationchange\n */\n\n\n _proto.onDurationChange = function onDurationChange(event) {\n this.duration_ = this.duration();\n };\n /**\n * Get and create a `TimeRange` object for buffering.\n *\n * @return {TimeRange}\n * The time range object that was created.\n */\n\n\n _proto.buffered = function buffered() {\n return createTimeRanges(0, 0);\n };\n /**\n * Get the percentage of the current video that is currently buffered.\n *\n * @return {number}\n * A number from 0 to 1 that represents the decimal percentage of the\n * video that is buffered.\n *\n */\n\n\n _proto.bufferedPercent = function bufferedPercent$$1() {\n return bufferedPercent(this.buffered(), this.duration_);\n };\n /**\n * Turn off the polyfill for `progress` events that was created in\n * {@link Tech#manualProgressOn}\n * Stop manually tracking progress events by clearing the interval that was set in\n * {@link Tech#trackProgress}.\n */\n\n\n _proto.stopTrackingProgress = function stopTrackingProgress() {\n this.clearInterval(this.progressInterval);\n };\n /**\n * Polyfill the `timeupdate` event for browsers that don't support it.\n *\n * @see {@link Tech#trackCurrentTime}\n */\n\n\n _proto.manualTimeUpdatesOn = function manualTimeUpdatesOn() {\n this.manualTimeUpdates = true;\n this.on('play', this.trackCurrentTime);\n this.on('pause', this.stopTrackingCurrentTime);\n };\n /**\n * Turn off the polyfill for `timeupdate` events that was created in\n * {@link Tech#manualTimeUpdatesOn}\n */\n\n\n _proto.manualTimeUpdatesOff = function manualTimeUpdatesOff() {\n this.manualTimeUpdates = false;\n this.stopTrackingCurrentTime();\n this.off('play', this.trackCurrentTime);\n this.off('pause', this.stopTrackingCurrentTime);\n };\n /**\n * Sets up an interval function to track current time and trigger `timeupdate` every\n * 250 milliseconds.\n *\n * @listens Tech#play\n * @triggers Tech#timeupdate\n */\n\n\n _proto.trackCurrentTime = function trackCurrentTime() {\n if (this.currentTimeInterval) {\n this.stopTrackingCurrentTime();\n }\n\n this.currentTimeInterval = this.setInterval(function () {\n /**\n * Triggered at an interval of 250ms to indicated that time is passing in the video.\n *\n * @event Tech#timeupdate\n * @type {EventTarget~Event}\n */\n this.trigger({\n type: 'timeupdate',\n target: this,\n manuallyTriggered: true\n }); // 42 = 24 fps // 250 is what Webkit uses // FF uses 15\n }, 250);\n };\n /**\n * Stop the interval function created in {@link Tech#trackCurrentTime} so that the\n * `timeupdate` event is no longer triggered.\n *\n * @listens {Tech#pause}\n */\n\n\n _proto.stopTrackingCurrentTime = function stopTrackingCurrentTime() {\n this.clearInterval(this.currentTimeInterval); // #1002 - if the video ends right before the next timeupdate would happen,\n // the progress bar won't make it all the way to the end\n\n this.trigger({\n type: 'timeupdate',\n target: this,\n manuallyTriggered: true\n });\n };\n /**\n * Turn off all event polyfills, clear the `Tech`s {@link AudioTrackList},\n * {@link VideoTrackList}, and {@link TextTrackList}, and dispose of this Tech.\n *\n * @fires Component#dispose\n */\n\n\n _proto.dispose = function dispose() {\n // clear out all tracks because we can't reuse them between techs\n this.clearTracks(NORMAL.names); // Turn off any manual progress or timeupdate tracking\n\n if (this.manualProgress) {\n this.manualProgressOff();\n }\n\n if (this.manualTimeUpdates) {\n this.manualTimeUpdatesOff();\n }\n\n _Component.prototype.dispose.call(this);\n };\n /**\n * Clear out a single `TrackList` or an array of `TrackLists` given their names.\n *\n * > Note: Techs without source handlers should call this between sources for `video`\n * & `audio` tracks. You don't want to use them between tracks!\n *\n * @param {string[]|string} types\n * TrackList names to clear, valid names are `video`, `audio`, and\n * `text`.\n */\n\n\n _proto.clearTracks = function clearTracks(types) {\n var _this3 = this;\n\n types = [].concat(types); // clear out all tracks because we can't reuse them between techs\n\n types.forEach(function (type) {\n var list = _this3[type + \"Tracks\"]() || [];\n var i = list.length;\n\n while (i--) {\n var track = list[i];\n\n if (type === 'text') {\n _this3.removeRemoteTextTrack(track);\n }\n\n list.removeTrack(track);\n }\n });\n };\n /**\n * Remove any TextTracks added via addRemoteTextTrack that are\n * flagged for automatic garbage collection\n */\n\n\n _proto.cleanupAutoTextTracks = function cleanupAutoTextTracks() {\n var list = this.autoRemoteTextTracks_ || [];\n var i = list.length;\n\n while (i--) {\n var track = list[i];\n this.removeRemoteTextTrack(track);\n }\n };\n /**\n * Reset the tech, which will removes all sources and reset the internal readyState.\n *\n * @abstract\n */\n\n\n _proto.reset = function reset() {};\n /**\n * Get or set an error on the Tech.\n *\n * @param {MediaError} [err]\n * Error to set on the Tech\n *\n * @return {MediaError|null}\n * The current error object on the tech, or null if there isn't one.\n */\n\n\n _proto.error = function error(err) {\n if (err !== undefined) {\n this.error_ = new MediaError(err);\n this.trigger('error');\n }\n\n return this.error_;\n };\n /**\n * Returns the `TimeRange`s that have been played through for the current source.\n *\n * > NOTE: This implementation is incomplete. It does not track the played `TimeRange`.\n * It only checks whether the source has played at all or not.\n *\n * @return {TimeRange}\n * - A single time range if this video has played\n * - An empty set of ranges if not.\n */\n\n\n _proto.played = function played() {\n if (this.hasStarted_) {\n return createTimeRanges(0, 0);\n }\n\n return createTimeRanges();\n };\n /**\n * Causes a manual time update to occur if {@link Tech#manualTimeUpdatesOn} was\n * previously called.\n *\n * @fires Tech#timeupdate\n */\n\n\n _proto.setCurrentTime = function setCurrentTime() {\n // improve the accuracy of manual timeupdates\n if (this.manualTimeUpdates) {\n /**\n * A manual `timeupdate` event.\n *\n * @event Tech#timeupdate\n * @type {EventTarget~Event}\n */\n this.trigger({\n type: 'timeupdate',\n target: this,\n manuallyTriggered: true\n });\n }\n };\n /**\n * Turn on listeners for {@link VideoTrackList}, {@link {AudioTrackList}, and\n * {@link TextTrackList} events.\n *\n * This adds {@link EventTarget~EventListeners} for `addtrack`, and `removetrack`.\n *\n * @fires Tech#audiotrackchange\n * @fires Tech#videotrackchange\n * @fires Tech#texttrackchange\n */\n\n\n _proto.initTrackListeners = function initTrackListeners() {\n var _this4 = this;\n\n /**\n * Triggered when tracks are added or removed on the Tech {@link AudioTrackList}\n *\n * @event Tech#audiotrackchange\n * @type {EventTarget~Event}\n */\n\n /**\n * Triggered when tracks are added or removed on the Tech {@link VideoTrackList}\n *\n * @event Tech#videotrackchange\n * @type {EventTarget~Event}\n */\n\n /**\n * Triggered when tracks are added or removed on the Tech {@link TextTrackList}\n *\n * @event Tech#texttrackchange\n * @type {EventTarget~Event}\n */\n NORMAL.names.forEach(function (name) {\n var props = NORMAL[name];\n\n var trackListChanges = function trackListChanges() {\n _this4.trigger(name + \"trackchange\");\n };\n\n var tracks = _this4[props.getterName]();\n\n tracks.addEventListener('removetrack', trackListChanges);\n tracks.addEventListener('addtrack', trackListChanges);\n\n _this4.on('dispose', function () {\n tracks.removeEventListener('removetrack', trackListChanges);\n tracks.removeEventListener('addtrack', trackListChanges);\n });\n });\n };\n /**\n * Emulate TextTracks using vtt.js if necessary\n *\n * @fires Tech#vttjsloaded\n * @fires Tech#vttjserror\n */\n\n\n _proto.addWebVttScript_ = function addWebVttScript_() {\n var _this5 = this;\n\n if (window$1.WebVTT) {\n return;\n } // Initially, Tech.el_ is a child of a dummy-div wait until the Component system\n // signals that the Tech is ready at which point Tech.el_ is part of the DOM\n // before inserting the WebVTT script\n\n\n if (document.body.contains(this.el())) {\n // load via require if available and vtt.js script location was not passed in\n // as an option. novtt builds will turn the above require call into an empty object\n // which will cause this if check to always fail.\n if (!this.options_['vtt.js'] && isPlain(vtt) && Object.keys(vtt).length > 0) {\n this.trigger('vttjsloaded');\n return;\n } // load vtt.js via the script location option or the cdn of no location was\n // passed in\n\n\n var script = document.createElement('script');\n script.src = this.options_['vtt.js'] || 'https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js';\n\n script.onload = function () {\n /**\n * Fired when vtt.js is loaded.\n *\n * @event Tech#vttjsloaded\n * @type {EventTarget~Event}\n */\n _this5.trigger('vttjsloaded');\n };\n\n script.onerror = function () {\n /**\n * Fired when vtt.js was not loaded due to an error\n *\n * @event Tech#vttjsloaded\n * @type {EventTarget~Event}\n */\n _this5.trigger('vttjserror');\n };\n\n this.on('dispose', function () {\n script.onload = null;\n script.onerror = null;\n }); // but have not loaded yet and we set it to true before the inject so that\n // we don't overwrite the injected window.WebVTT if it loads right away\n\n window$1.WebVTT = true;\n this.el().parentNode.appendChild(script);\n } else {\n this.ready(this.addWebVttScript_);\n }\n };\n /**\n * Emulate texttracks\n *\n */\n\n\n _proto.emulateTextTracks = function emulateTextTracks() {\n var _this6 = this;\n\n var tracks = this.textTracks();\n var remoteTracks = this.remoteTextTracks();\n\n var handleAddTrack = function handleAddTrack(e) {\n return tracks.addTrack(e.track);\n };\n\n var handleRemoveTrack = function handleRemoveTrack(e) {\n return tracks.removeTrack(e.track);\n };\n\n remoteTracks.on('addtrack', handleAddTrack);\n remoteTracks.on('removetrack', handleRemoveTrack);\n this.addWebVttScript_();\n\n var updateDisplay = function updateDisplay() {\n return _this6.trigger('texttrackchange');\n };\n\n var textTracksChanges = function textTracksChanges() {\n updateDisplay();\n\n for (var i = 0; i < tracks.length; i++) {\n var track = tracks[i];\n track.removeEventListener('cuechange', updateDisplay);\n\n if (track.mode === 'showing') {\n track.addEventListener('cuechange', updateDisplay);\n }\n }\n };\n\n textTracksChanges();\n tracks.addEventListener('change', textTracksChanges);\n tracks.addEventListener('addtrack', textTracksChanges);\n tracks.addEventListener('removetrack', textTracksChanges);\n this.on('dispose', function () {\n remoteTracks.off('addtrack', handleAddTrack);\n remoteTracks.off('removetrack', handleRemoveTrack);\n tracks.removeEventListener('change', textTracksChanges);\n tracks.removeEventListener('addtrack', textTracksChanges);\n tracks.removeEventListener('removetrack', textTracksChanges);\n\n for (var i = 0; i < tracks.length; i++) {\n var track = tracks[i];\n track.removeEventListener('cuechange', updateDisplay);\n }\n });\n };\n /**\n * Create and returns a remote {@link TextTrack} object.\n *\n * @param {string} kind\n * `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata)\n *\n * @param {string} [label]\n * Label to identify the text track\n *\n * @param {string} [language]\n * Two letter language abbreviation\n *\n * @return {TextTrack}\n * The TextTrack that gets created.\n */\n\n\n _proto.addTextTrack = function addTextTrack(kind, label, language) {\n if (!kind) {\n throw new Error('TextTrack kind is required but was not provided');\n }\n\n return createTrackHelper(this, kind, label, language);\n };\n /**\n * Create an emulated TextTrack for use by addRemoteTextTrack\n *\n * This is intended to be overridden by classes that inherit from\n * Tech in order to create native or custom TextTracks.\n *\n * @param {Object} options\n * The object should contain the options to initialize the TextTrack with.\n *\n * @param {string} [options.kind]\n * `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata).\n *\n * @param {string} [options.label].\n * Label to identify the text track\n *\n * @param {string} [options.language]\n * Two letter language abbreviation.\n *\n * @return {HTMLTrackElement}\n * The track element that gets created.\n */\n\n\n _proto.createRemoteTextTrack = function createRemoteTextTrack(options) {\n var track = mergeOptions(options, {\n tech: this\n });\n return new REMOTE.remoteTextEl.TrackClass(track);\n };\n /**\n * Creates a remote text track object and returns an html track element.\n *\n * > Note: This can be an emulated {@link HTMLTrackElement} or a native one.\n *\n * @param {Object} options\n * See {@link Tech#createRemoteTextTrack} for more detailed properties.\n *\n * @param {boolean} [manualCleanup=true]\n * - When false: the TextTrack will be automatically removed from the video\n * element whenever the source changes\n * - When True: The TextTrack will have to be cleaned up manually\n *\n * @return {HTMLTrackElement}\n * An Html Track Element.\n *\n * @deprecated The default functionality for this function will be equivalent\n * to \"manualCleanup=false\" in the future. The manualCleanup parameter will\n * also be removed.\n */\n\n\n _proto.addRemoteTextTrack = function addRemoteTextTrack(options, manualCleanup) {\n var _this7 = this;\n\n if (options === void 0) {\n options = {};\n }\n\n var htmlTrackElement = this.createRemoteTextTrack(options);\n\n if (manualCleanup !== true && manualCleanup !== false) {\n // deprecation warning\n log.warn('Calling addRemoteTextTrack without explicitly setting the \"manualCleanup\" parameter to `true` is deprecated and default to `false` in future version of video.js');\n manualCleanup = true;\n } // store HTMLTrackElement and TextTrack to remote list\n\n\n this.remoteTextTrackEls().addTrackElement_(htmlTrackElement);\n this.remoteTextTracks().addTrack(htmlTrackElement.track);\n\n if (manualCleanup !== true) {\n // create the TextTrackList if it doesn't exist\n this.ready(function () {\n return _this7.autoRemoteTextTracks_.addTrack(htmlTrackElement.track);\n });\n }\n\n return htmlTrackElement;\n };\n /**\n * Remove a remote text track from the remote `TextTrackList`.\n *\n * @param {TextTrack} track\n * `TextTrack` to remove from the `TextTrackList`\n */\n\n\n _proto.removeRemoteTextTrack = function removeRemoteTextTrack(track) {\n var trackElement = this.remoteTextTrackEls().getTrackElementByTrack_(track); // remove HTMLTrackElement and TextTrack from remote list\n\n this.remoteTextTrackEls().removeTrackElement_(trackElement);\n this.remoteTextTracks().removeTrack(track);\n this.autoRemoteTextTracks_.removeTrack(track);\n };\n /**\n * Gets available media playback quality metrics as specified by the W3C's Media\n * Playback Quality API.\n *\n * @see [Spec]{@link https://wicg.github.io/media-playback-quality}\n *\n * @return {Object}\n * An object with supported media playback quality metrics\n *\n * @abstract\n */\n\n\n _proto.getVideoPlaybackQuality = function getVideoPlaybackQuality() {\n return {};\n };\n /**\n * A method to set a poster from a `Tech`.\n *\n * @abstract\n */\n\n\n _proto.setPoster = function setPoster() {};\n /**\n * A method to check for the presence of the 'playsinline' <video> attribute.\n *\n * @abstract\n */\n\n\n _proto.playsinline = function playsinline() {};\n /**\n * A method to set or unset the 'playsinline' <video> attribute.\n *\n * @abstract\n */\n\n\n _proto.setPlaysinline = function setPlaysinline() {};\n /**\n * Attempt to force override of native audio tracks.\n *\n * @param {boolean} override - If set to true native audio will be overridden,\n * otherwise native audio will potentially be used.\n *\n * @abstract\n */\n\n\n _proto.overrideNativeAudioTracks = function overrideNativeAudioTracks() {};\n /**\n * Attempt to force override of native video tracks.\n *\n * @param {boolean} override - If set to true native video will be overridden,\n * otherwise native video will potentially be used.\n *\n * @abstract\n */\n\n\n _proto.overrideNativeVideoTracks = function overrideNativeVideoTracks() {};\n /*\n * Check if the tech can support the given mime-type.\n *\n * The base tech does not support any type, but source handlers might\n * overwrite this.\n *\n * @param {string} type\n * The mimetype to check for support\n *\n * @return {string}\n * 'probably', 'maybe', or empty string\n *\n * @see [Spec]{@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/canPlayType}\n *\n * @abstract\n */\n\n\n _proto.canPlayType = function canPlayType() {\n return '';\n };\n /**\n * Check if the type is supported by this tech.\n *\n * The base tech does not support any type, but source handlers might\n * overwrite this.\n *\n * @param {string} type\n * The media type to check\n * @return {string} Returns the native video element's response\n */\n\n\n Tech.canPlayType = function canPlayType() {\n return '';\n };\n /**\n * Check if the tech can support the given source\n *\n * @param {Object} srcObj\n * The source object\n * @param {Object} options\n * The options passed to the tech\n * @return {string} 'probably', 'maybe', or '' (empty string)\n */\n\n\n Tech.canPlaySource = function canPlaySource(srcObj, options) {\n return Tech.canPlayType(srcObj.type);\n };\n /*\n * Return whether the argument is a Tech or not.\n * Can be passed either a Class like `Html5` or a instance like `player.tech_`\n *\n * @param {Object} component\n * The item to check\n *\n * @return {boolean}\n * Whether it is a tech or not\n * - True if it is a tech\n * - False if it is not\n */\n\n\n Tech.isTech = function isTech(component) {\n return component.prototype instanceof Tech || component instanceof Tech || component === Tech;\n };\n /**\n * Registers a `Tech` into a shared list for videojs.\n *\n * @param {string} name\n * Name of the `Tech` to register.\n *\n * @param {Object} tech\n * The `Tech` class to register.\n */\n\n\n Tech.registerTech = function registerTech(name, tech) {\n if (!Tech.techs_) {\n Tech.techs_ = {};\n }\n\n if (!Tech.isTech(tech)) {\n throw new Error(\"Tech \" + name + \" must be a Tech\");\n }\n\n if (!Tech.canPlayType) {\n throw new Error('Techs must have a static canPlayType method on them');\n }\n\n if (!Tech.canPlaySource) {\n throw new Error('Techs must have a static canPlaySource method on them');\n }\n\n name = toTitleCase(name);\n Tech.techs_[name] = tech;\n\n if (name !== 'Tech') {\n // camel case the techName for use in techOrder\n Tech.defaultTechOrder_.push(name);\n }\n\n return tech;\n };\n /**\n * Get a `Tech` from the shared list by name.\n *\n * @param {string} name\n * `camelCase` or `TitleCase` name of the Tech to get\n *\n * @return {Tech|undefined}\n * The `Tech` or undefined if there was no tech with the name requested.\n */\n\n\n Tech.getTech = function getTech(name) {\n if (!name) {\n return;\n }\n\n name = toTitleCase(name);\n\n if (Tech.techs_ && Tech.techs_[name]) {\n return Tech.techs_[name];\n }\n\n if (window$1 && window$1.videojs && window$1.videojs[name]) {\n log.warn(\"The \" + name + \" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)\");\n return window$1.videojs[name];\n }\n };\n\n return Tech;\n}(Component);\n/**\n * Get the {@link VideoTrackList}\n *\n * @returns {VideoTrackList}\n * @method Tech.prototype.videoTracks\n */\n\n/**\n * Get the {@link AudioTrackList}\n *\n * @returns {AudioTrackList}\n * @method Tech.prototype.audioTracks\n */\n\n/**\n * Get the {@link TextTrackList}\n *\n * @returns {TextTrackList}\n * @method Tech.prototype.textTracks\n */\n\n/**\n * Get the remote element {@link TextTrackList}\n *\n * @returns {TextTrackList}\n * @method Tech.prototype.remoteTextTracks\n */\n\n/**\n * Get the remote element {@link HtmlTrackElementList}\n *\n * @returns {HtmlTrackElementList}\n * @method Tech.prototype.remoteTextTrackEls\n */\n\n\nALL.names.forEach(function (name) {\n var props = ALL[name];\n\n Tech.prototype[props.getterName] = function () {\n this[props.privateName] = this[props.privateName] || new props.ListClass();\n return this[props.privateName];\n };\n});\n/**\n * List of associated text tracks\n *\n * @type {TextTrackList}\n * @private\n * @property Tech#textTracks_\n */\n\n/**\n * List of associated audio tracks.\n *\n * @type {AudioTrackList}\n * @private\n * @property Tech#audioTracks_\n */\n\n/**\n * List of associated video tracks.\n *\n * @type {VideoTrackList}\n * @private\n * @property Tech#videoTracks_\n */\n\n/**\n * Boolean indicating whether the `Tech` supports volume control.\n *\n * @type {boolean}\n * @default\n */\n\nTech.prototype.featuresVolumeControl = true;\n/**\n * Boolean indicating whether the `Tech` supports muting volume.\n *\n * @type {bolean}\n * @default\n */\n\nTech.prototype.featuresMuteControl = true;\n/**\n * Boolean indicating whether the `Tech` supports fullscreen resize control.\n * Resizing plugins using request fullscreen reloads the plugin\n *\n * @type {boolean}\n * @default\n */\n\nTech.prototype.featuresFullscreenResize = false;\n/**\n * Boolean indicating whether the `Tech` supports changing the speed at which the video\n * plays. Examples:\n * - Set player to play 2x (twice) as fast\n * - Set player to play 0.5x (half) as fast\n *\n * @type {boolean}\n * @default\n */\n\nTech.prototype.featuresPlaybackRate = false;\n/**\n * Boolean indicating whether the `Tech` supports the `progress` event. This is currently\n * not triggered by video-js-swf. This will be used to determine if\n * {@link Tech#manualProgressOn} should be called.\n *\n * @type {boolean}\n * @default\n */\n\nTech.prototype.featuresProgressEvents = false;\n/**\n * Boolean indicating whether the `Tech` supports the `sourceset` event.\n *\n * A tech should set this to `true` and then use {@link Tech#triggerSourceset}\n * to trigger a {@link Tech#event:sourceset} at the earliest time after getting\n * a new source.\n *\n * @type {boolean}\n * @default\n */\n\nTech.prototype.featuresSourceset = false;\n/**\n * Boolean indicating whether the `Tech` supports the `timeupdate` event. This is currently\n * not triggered by video-js-swf. This will be used to determine if\n * {@link Tech#manualTimeUpdates} should be called.\n *\n * @type {boolean}\n * @default\n */\n\nTech.prototype.featuresTimeupdateEvents = false;\n/**\n * Boolean indicating whether the `Tech` supports the native `TextTrack`s.\n * This will help us integrate with native `TextTrack`s if the browser supports them.\n *\n * @type {boolean}\n * @default\n */\n\nTech.prototype.featuresNativeTextTracks = false;\n/**\n * A functional mixin for techs that want to use the Source Handler pattern.\n * Source handlers are scripts for handling specific formats.\n * The source handler pattern is used for adaptive formats (HLS, DASH) that\n * manually load video data and feed it into a Source Buffer (Media Source Extensions)\n * Example: `Tech.withSourceHandlers.call(MyTech);`\n *\n * @param {Tech} _Tech\n * The tech to add source handler functions to.\n *\n * @mixes Tech~SourceHandlerAdditions\n */\n\nTech.withSourceHandlers = function (_Tech) {\n /**\n * Register a source handler\n *\n * @param {Function} handler\n * The source handler class\n *\n * @param {number} [index]\n * Register it at the following index\n */\n _Tech.registerSourceHandler = function (handler, index) {\n var handlers = _Tech.sourceHandlers;\n\n if (!handlers) {\n handlers = _Tech.sourceHandlers = [];\n }\n\n if (index === undefined) {\n // add to the end of the list\n index = handlers.length;\n }\n\n handlers.splice(index, 0, handler);\n };\n /**\n * Check if the tech can support the given type. Also checks the\n * Techs sourceHandlers.\n *\n * @param {string} type\n * The mimetype to check.\n *\n * @return {string}\n * 'probably', 'maybe', or '' (empty string)\n */\n\n\n _Tech.canPlayType = function (type) {\n var handlers = _Tech.sourceHandlers || [];\n var can;\n\n for (var i = 0; i < handlers.length; i++) {\n can = handlers[i].canPlayType(type);\n\n if (can) {\n return can;\n }\n }\n\n return '';\n };\n /**\n * Returns the first source handler that supports the source.\n *\n * TODO: Answer question: should 'probably' be prioritized over 'maybe'\n *\n * @param {Tech~SourceObject} source\n * The source object\n *\n * @param {Object} options\n * The options passed to the tech\n *\n * @return {SourceHandler|null}\n * The first source handler that supports the source or null if\n * no SourceHandler supports the source\n */\n\n\n _Tech.selectSourceHandler = function (source, options) {\n var handlers = _Tech.sourceHandlers || [];\n var can;\n\n for (var i = 0; i < handlers.length; i++) {\n can = handlers[i].canHandleSource(source, options);\n\n if (can) {\n return handlers[i];\n }\n }\n\n return null;\n };\n /**\n * Check if the tech can support the given source.\n *\n * @param {Tech~SourceObject} srcObj\n * The source object\n *\n * @param {Object} options\n * The options passed to the tech\n *\n * @return {string}\n * 'probably', 'maybe', or '' (empty string)\n */\n\n\n _Tech.canPlaySource = function (srcObj, options) {\n var sh = _Tech.selectSourceHandler(srcObj, options);\n\n if (sh) {\n return sh.canHandleSource(srcObj, options);\n }\n\n return '';\n };\n /**\n * When using a source handler, prefer its implementation of\n * any function normally provided by the tech.\n */\n\n\n var deferrable = ['seekable', 'seeking', 'duration'];\n /**\n * A wrapper around {@link Tech#seekable} that will call a `SourceHandler`s seekable\n * function if it exists, with a fallback to the Techs seekable function.\n *\n * @method _Tech.seekable\n */\n\n /**\n * A wrapper around {@link Tech#duration} that will call a `SourceHandler`s duration\n * function if it exists, otherwise it will fallback to the techs duration function.\n *\n * @method _Tech.duration\n */\n\n deferrable.forEach(function (fnName) {\n var originalFn = this[fnName];\n\n if (typeof originalFn !== 'function') {\n return;\n }\n\n this[fnName] = function () {\n if (this.sourceHandler_ && this.sourceHandler_[fnName]) {\n return this.sourceHandler_[fnName].apply(this.sourceHandler_, arguments);\n }\n\n return originalFn.apply(this, arguments);\n };\n }, _Tech.prototype);\n /**\n * Create a function for setting the source using a source object\n * and source handlers.\n * Should never be called unless a source handler was found.\n *\n * @param {Tech~SourceObject} source\n * A source object with src and type keys\n */\n\n _Tech.prototype.setSource = function (source) {\n var sh = _Tech.selectSourceHandler(source, this.options_);\n\n if (!sh) {\n // Fall back to a native source hander when unsupported sources are\n // deliberately set\n if (_Tech.nativeSourceHandler) {\n sh = _Tech.nativeSourceHandler;\n } else {\n log.error('No source handler found for the current source.');\n }\n } // Dispose any existing source handler\n\n\n this.disposeSourceHandler();\n this.off('dispose', this.disposeSourceHandler);\n\n if (sh !== _Tech.nativeSourceHandler) {\n this.currentSource_ = source;\n }\n\n this.sourceHandler_ = sh.handleSource(source, this, this.options_);\n this.on('dispose', this.disposeSourceHandler);\n };\n /**\n * Clean up any existing SourceHandlers and listeners when the Tech is disposed.\n *\n * @listens Tech#dispose\n */\n\n\n _Tech.prototype.disposeSourceHandler = function () {\n // if we have a source and get another one\n // then we are loading something new\n // than clear all of our current tracks\n if (this.currentSource_) {\n this.clearTracks(['audio', 'video']);\n this.currentSource_ = null;\n } // always clean up auto-text tracks\n\n\n this.cleanupAutoTextTracks();\n\n if (this.sourceHandler_) {\n if (this.sourceHandler_.dispose) {\n this.sourceHandler_.dispose();\n }\n\n this.sourceHandler_ = null;\n }\n };\n}; // The base Tech class needs to be registered as a Component. It is the only\n// Tech that can be registered as a Component.\n\n\nComponent.registerComponent('Tech', Tech);\nTech.registerTech('Tech', Tech);\n/**\n * A list of techs that should be added to techOrder on Players\n *\n * @private\n */\n\nTech.defaultTechOrder_ = [];\n\n/**\n * @file middleware.js\n * @module middleware\n */\nvar middlewares = {};\nvar middlewareInstances = {};\nvar TERMINATOR = {};\n/**\n * A middleware object is a plain JavaScript object that has methods that\n * match the {@link Tech} methods found in the lists of allowed\n * {@link module:middleware.allowedGetters|getters},\n * {@link module:middleware.allowedSetters|setters}, and\n * {@link module:middleware.allowedMediators|mediators}.\n *\n * @typedef {Object} MiddlewareObject\n */\n\n/**\n * A middleware factory function that should return a\n * {@link module:middleware~MiddlewareObject|MiddlewareObject}.\n *\n * This factory will be called for each player when needed, with the player\n * passed in as an argument.\n *\n * @callback MiddlewareFactory\n * @param {Player} player\n * A Video.js player.\n */\n\n/**\n * Define a middleware that the player should use by way of a factory function\n * that returns a middleware object.\n *\n * @param {string} type\n * The MIME type to match or `\"*\"` for all MIME types.\n *\n * @param {MiddlewareFactory} middleware\n * A middleware factory function that will be executed for\n * matching types.\n */\n\nfunction use(type, middleware) {\n middlewares[type] = middlewares[type] || [];\n middlewares[type].push(middleware);\n}\n/**\n * Asynchronously sets a source using middleware by recursing through any\n * matching middlewares and calling `setSource` on each, passing along the\n * previous returned value each time.\n *\n * @param {Player} player\n * A {@link Player} instance.\n *\n * @param {Tech~SourceObject} src\n * A source object.\n *\n * @param {Function}\n * The next middleware to run.\n */\n\nfunction setSource(player, src, next) {\n player.setTimeout(function () {\n return setSourceHelper(src, middlewares[src.type], next, player);\n }, 1);\n}\n/**\n * When the tech is set, passes the tech to each middleware's `setTech` method.\n *\n * @param {Object[]} middleware\n * An array of middleware instances.\n *\n * @param {Tech} tech\n * A Video.js tech.\n */\n\nfunction setTech(middleware, tech) {\n middleware.forEach(function (mw) {\n return mw.setTech && mw.setTech(tech);\n });\n}\n/**\n * Calls a getter on the tech first, through each middleware\n * from right to left to the player.\n *\n * @param {Object[]} middleware\n * An array of middleware instances.\n *\n * @param {Tech} tech\n * The current tech.\n *\n * @param {string} method\n * A method name.\n *\n * @return {Mixed}\n * The final value from the tech after middleware has intercepted it.\n */\n\nfunction get(middleware, tech, method) {\n return middleware.reduceRight(middlewareIterator(method), tech[method]());\n}\n/**\n * Takes the argument given to the player and calls the setter method on each\n * middleware from left to right to the tech.\n *\n * @param {Object[]} middleware\n * An array of middleware instances.\n *\n * @param {Tech} tech\n * The current tech.\n *\n * @param {string} method\n * A method name.\n *\n * @param {Mixed} arg\n * The value to set on the tech.\n *\n * @return {Mixed}\n * The return value of the `method` of the `tech`.\n */\n\nfunction set$1(middleware, tech, method, arg) {\n return tech[method](middleware.reduce(middlewareIterator(method), arg));\n}\n/**\n * Takes the argument given to the player and calls the `call` version of the\n * method on each middleware from left to right.\n *\n * Then, call the passed in method on the tech and return the result unchanged\n * back to the player, through middleware, this time from right to left.\n *\n * @param {Object[]} middleware\n * An array of middleware instances.\n *\n * @param {Tech} tech\n * The current tech.\n *\n * @param {string} method\n * A method name.\n *\n * @param {Mixed} arg\n * The value to set on the tech.\n *\n * @return {Mixed}\n * The return value of the `method` of the `tech`, regardless of the\n * return values of middlewares.\n */\n\nfunction mediate(middleware, tech, method, arg) {\n if (arg === void 0) {\n arg = null;\n }\n\n var callMethod = 'call' + toTitleCase(method);\n var middlewareValue = middleware.reduce(middlewareIterator(callMethod), arg);\n var terminated = middlewareValue === TERMINATOR;\n var returnValue = terminated ? null : tech[method](middlewareValue);\n executeRight(middleware, method, returnValue, terminated);\n return returnValue;\n}\n/**\n * Enumeration of allowed getters where the keys are method names.\n *\n * @type {Object}\n */\n\nvar allowedGetters = {\n buffered: 1,\n currentTime: 1,\n duration: 1,\n seekable: 1,\n played: 1,\n paused: 1\n};\n/**\n * Enumeration of allowed setters where the keys are method names.\n *\n * @type {Object}\n */\n\nvar allowedSetters = {\n setCurrentTime: 1\n};\n/**\n * Enumeration of allowed mediators where the keys are method names.\n *\n * @type {Object}\n */\n\nvar allowedMediators = {\n play: 1,\n pause: 1\n};\n\nfunction middlewareIterator(method) {\n return function (value, mw) {\n // if the previous middleware terminated, pass along the termination\n if (value === TERMINATOR) {\n return TERMINATOR;\n }\n\n if (mw[method]) {\n return mw[method](value);\n }\n\n return value;\n };\n}\n\nfunction executeRight(mws, method, value, terminated) {\n for (var i = mws.length - 1; i >= 0; i--) {\n var mw = mws[i];\n\n if (mw[method]) {\n mw[method](terminated, value);\n }\n }\n}\n/**\n * Clear the middleware cache for a player.\n *\n * @param {Player} player\n * A {@link Player} instance.\n */\n\n\nfunction clearCacheForPlayer(player) {\n middlewareInstances[player.id()] = null;\n}\n/**\n * {\n * [playerId]: [[mwFactory, mwInstance], ...]\n * }\n *\n * @private\n */\n\nfunction getOrCreateFactory(player, mwFactory) {\n var mws = middlewareInstances[player.id()];\n var mw = null;\n\n if (mws === undefined || mws === null) {\n mw = mwFactory(player);\n middlewareInstances[player.id()] = [[mwFactory, mw]];\n return mw;\n }\n\n for (var i = 0; i < mws.length; i++) {\n var _mws$i = mws[i],\n mwf = _mws$i[0],\n mwi = _mws$i[1];\n\n if (mwf !== mwFactory) {\n continue;\n }\n\n mw = mwi;\n }\n\n if (mw === null) {\n mw = mwFactory(player);\n mws.push([mwFactory, mw]);\n }\n\n return mw;\n}\n\nfunction setSourceHelper(src, middleware, next, player, acc, lastRun) {\n if (src === void 0) {\n src = {};\n }\n\n if (middleware === void 0) {\n middleware = [];\n }\n\n if (acc === void 0) {\n acc = [];\n }\n\n if (lastRun === void 0) {\n lastRun = false;\n }\n\n var _middleware = middleware,\n mwFactory = _middleware[0],\n mwrest = _middleware.slice(1); // if mwFactory is a string, then we're at a fork in the road\n\n\n if (typeof mwFactory === 'string') {\n setSourceHelper(src, middlewares[mwFactory], next, player, acc, lastRun); // if we have an mwFactory, call it with the player to get the mw,\n // then call the mw's setSource method\n } else if (mwFactory) {\n var mw = getOrCreateFactory(player, mwFactory); // if setSource isn't present, implicitly select this middleware\n\n if (!mw.setSource) {\n acc.push(mw);\n return setSourceHelper(src, mwrest, next, player, acc, lastRun);\n }\n\n mw.setSource(assign({}, src), function (err, _src) {\n // something happened, try the next middleware on the current level\n // make sure to use the old src\n if (err) {\n return setSourceHelper(src, mwrest, next, player, acc, lastRun);\n } // we've succeeded, now we need to go deeper\n\n\n acc.push(mw); // if it's the same type, continue down the current chain\n // otherwise, we want to go down the new chain\n\n setSourceHelper(_src, src.type === _src.type ? mwrest : middlewares[_src.type], next, player, acc, lastRun);\n });\n } else if (mwrest.length) {\n setSourceHelper(src, mwrest, next, player, acc, lastRun);\n } else if (lastRun) {\n next(src, acc);\n } else {\n setSourceHelper(src, middlewares['*'], next, player, acc, true);\n }\n}\n\n/**\n * Mimetypes\n *\n * @see http://hul.harvard.edu/ois/////systems/wax/wax-public-help/mimetypes.htm\n * @typedef Mimetypes~Kind\n * @enum\n */\n\nvar MimetypesKind = {\n opus: 'video/ogg',\n ogv: 'video/ogg',\n mp4: 'video/mp4',\n mov: 'video/mp4',\n m4v: 'video/mp4',\n mkv: 'video/x-matroska',\n mp3: 'audio/mpeg',\n aac: 'audio/aac',\n oga: 'audio/ogg',\n m3u8: 'application/x-mpegURL'\n};\n/**\n * Get the mimetype of a given src url if possible\n *\n * @param {string} src\n * The url to the src\n *\n * @return {string}\n * return the mimetype if it was known or empty string otherwise\n */\n\nvar getMimetype = function getMimetype(src) {\n if (src === void 0) {\n src = '';\n }\n\n var ext = getFileExtension(src);\n var mimetype = MimetypesKind[ext.toLowerCase()];\n return mimetype || '';\n};\n/**\n * Find the mime type of a given source string if possible. Uses the player\n * source cache.\n *\n * @param {Player} player\n * The player object\n *\n * @param {string} src\n * The source string\n *\n * @return {string}\n * The type that was found\n */\n\nvar findMimetype = function findMimetype(player, src) {\n if (!src) {\n return '';\n } // 1. check for the type in the `source` cache\n\n\n if (player.cache_.source.src === src && player.cache_.source.type) {\n return player.cache_.source.type;\n } // 2. see if we have this source in our `currentSources` cache\n\n\n var matchingSources = player.cache_.sources.filter(function (s) {\n return s.src === src;\n });\n\n if (matchingSources.length) {\n return matchingSources[0].type;\n } // 3. look for the src url in source elements and use the type there\n\n\n var sources = player.$$('source');\n\n for (var i = 0; i < sources.length; i++) {\n var s = sources[i];\n\n if (s.type && s.src && s.src === src) {\n return s.type;\n }\n } // 4. finally fallback to our list of mime types based on src url extension\n\n\n return getMimetype(src);\n};\n\n/**\n * @module filter-source\n */\n/**\n * Filter out single bad source objects or multiple source objects in an\n * array. Also flattens nested source object arrays into a 1 dimensional\n * array of source objects.\n *\n * @param {Tech~SourceObject|Tech~SourceObject[]} src\n * The src object to filter\n *\n * @return {Tech~SourceObject[]}\n * An array of sourceobjects containing only valid sources\n *\n * @private\n */\n\nvar filterSource = function filterSource(src) {\n // traverse array\n if (Array.isArray(src)) {\n var newsrc = [];\n src.forEach(function (srcobj) {\n srcobj = filterSource(srcobj);\n\n if (Array.isArray(srcobj)) {\n newsrc = newsrc.concat(srcobj);\n } else if (isObject(srcobj)) {\n newsrc.push(srcobj);\n }\n });\n src = newsrc;\n } else if (typeof src === 'string' && src.trim()) {\n // convert string into object\n src = [fixSource({\n src: src\n })];\n } else if (isObject(src) && typeof src.src === 'string' && src.src && src.src.trim()) {\n // src is already valid\n src = [fixSource(src)];\n } else {\n // invalid source, turn it into an empty array\n src = [];\n }\n\n return src;\n};\n/**\n * Checks src mimetype, adding it when possible\n *\n * @param {Tech~SourceObject} src\n * The src object to check\n * @return {Tech~SourceObject}\n * src Object with known type\n */\n\n\nfunction fixSource(src) {\n var mimetype = getMimetype(src.src);\n\n if (!src.type && mimetype) {\n src.type = mimetype;\n }\n\n return src;\n}\n\n/**\n * The `MediaLoader` is the `Component` that decides which playback technology to load\n * when a player is initialized.\n *\n * @extends Component\n */\n\nvar MediaLoader =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(MediaLoader, _Component);\n\n /**\n * Create an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should attach to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Component~ReadyCallback} [ready]\n * The function that is run when this component is ready.\n */\n function MediaLoader(player, options, ready) {\n var _this;\n\n // MediaLoader has no element\n var options_ = mergeOptions({\n createEl: false\n }, options);\n _this = _Component.call(this, player, options_, ready) || this; // If there are no sources when the player is initialized,\n // load the first supported playback technology.\n\n if (!options.playerOptions.sources || options.playerOptions.sources.length === 0) {\n for (var i = 0, j = options.playerOptions.techOrder; i < j.length; i++) {\n var techName = toTitleCase(j[i]);\n var tech = Tech.getTech(techName); // Support old behavior of techs being registered as components.\n // Remove once that deprecated behavior is removed.\n\n if (!techName) {\n tech = Component.getComponent(techName);\n } // Check if the browser supports this technology\n\n\n if (tech && tech.isSupported()) {\n player.loadTech_(techName);\n break;\n }\n }\n } else {\n // Loop through playback technologies (HTML5, Flash) and check for support.\n // Then load the best source.\n // A few assumptions here:\n // All playback technologies respect preload false.\n player.src(options.playerOptions.sources);\n }\n\n return _this;\n }\n\n return MediaLoader;\n}(Component);\n\nComponent.registerComponent('MediaLoader', MediaLoader);\n\n/**\n * Clickable Component which is clickable or keyboard actionable,\n * but is not a native HTML button.\n *\n * @extends Component\n */\n\nvar ClickableComponent =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(ClickableComponent, _Component);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function ClickableComponent(player, options) {\n var _this;\n\n _this = _Component.call(this, player, options) || this;\n\n _this.emitTapEvents();\n\n _this.enable();\n\n return _this;\n }\n /**\n * Create the `Component`s DOM element.\n *\n * @param {string} [tag=div]\n * The element's node type.\n *\n * @param {Object} [props={}]\n * An object of properties that should be set on the element.\n *\n * @param {Object} [attributes={}]\n * An object of attributes that should be set on the element.\n *\n * @return {Element}\n * The element that gets created.\n */\n\n\n var _proto = ClickableComponent.prototype;\n\n _proto.createEl = function createEl$$1(tag, props, attributes) {\n if (tag === void 0) {\n tag = 'div';\n }\n\n if (props === void 0) {\n props = {};\n }\n\n if (attributes === void 0) {\n attributes = {};\n }\n\n props = assign({\n innerHTML: '<span aria-hidden=\"true\" class=\"vjs-icon-placeholder\"></span>',\n className: this.buildCSSClass(),\n tabIndex: 0\n }, props);\n\n if (tag === 'button') {\n log.error(\"Creating a ClickableComponent with an HTML element of \" + tag + \" is not supported; use a Button instead.\");\n } // Add ARIA attributes for clickable element which is not a native HTML button\n\n\n attributes = assign({\n role: 'button'\n }, attributes);\n this.tabIndex_ = props.tabIndex;\n\n var el = _Component.prototype.createEl.call(this, tag, props, attributes);\n\n this.createControlTextEl(el);\n return el;\n };\n\n _proto.dispose = function dispose() {\n // remove controlTextEl_ on dispose\n this.controlTextEl_ = null;\n\n _Component.prototype.dispose.call(this);\n };\n /**\n * Create a control text element on this `Component`\n *\n * @param {Element} [el]\n * Parent element for the control text.\n *\n * @return {Element}\n * The control text element that gets created.\n */\n\n\n _proto.createControlTextEl = function createControlTextEl(el) {\n this.controlTextEl_ = createEl('span', {\n className: 'vjs-control-text'\n }, {\n // let the screen reader user know that the text of the element may change\n 'aria-live': 'polite'\n });\n\n if (el) {\n el.appendChild(this.controlTextEl_);\n }\n\n this.controlText(this.controlText_, el);\n return this.controlTextEl_;\n };\n /**\n * Get or set the localize text to use for the controls on the `Component`.\n *\n * @param {string} [text]\n * Control text for element.\n *\n * @param {Element} [el=this.el()]\n * Element to set the title on.\n *\n * @return {string}\n * - The control text when getting\n */\n\n\n _proto.controlText = function controlText(text, el) {\n if (el === void 0) {\n el = this.el();\n }\n\n if (text === undefined) {\n return this.controlText_ || 'Need Text';\n }\n\n var localizedText = this.localize(text);\n this.controlText_ = text;\n textContent(this.controlTextEl_, localizedText);\n\n if (!this.nonIconControl) {\n // Set title attribute if only an icon is shown\n el.setAttribute('title', localizedText);\n }\n };\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-control vjs-button \" + _Component.prototype.buildCSSClass.call(this);\n };\n /**\n * Enable this `Component`s element.\n */\n\n\n _proto.enable = function enable() {\n if (!this.enabled_) {\n this.enabled_ = true;\n this.removeClass('vjs-disabled');\n this.el_.setAttribute('aria-disabled', 'false');\n\n if (typeof this.tabIndex_ !== 'undefined') {\n this.el_.setAttribute('tabIndex', this.tabIndex_);\n }\n\n this.on(['tap', 'click'], this.handleClick);\n this.on('focus', this.handleFocus);\n this.on('blur', this.handleBlur);\n }\n };\n /**\n * Disable this `Component`s element.\n */\n\n\n _proto.disable = function disable() {\n this.enabled_ = false;\n this.addClass('vjs-disabled');\n this.el_.setAttribute('aria-disabled', 'true');\n\n if (typeof this.tabIndex_ !== 'undefined') {\n this.el_.removeAttribute('tabIndex');\n }\n\n this.off(['tap', 'click'], this.handleClick);\n this.off('focus', this.handleFocus);\n this.off('blur', this.handleBlur);\n };\n /**\n * This gets called when a `ClickableComponent` gets:\n * - Clicked (via the `click` event, listening starts in the constructor)\n * - Tapped (via the `tap` event, listening starts in the constructor)\n * - The following things happen in order:\n * 1. {@link ClickableComponent#handleFocus} is called via a `focus` event on the\n * `ClickableComponent`.\n * 2. {@link ClickableComponent#handleFocus} adds a listener for `keydown` on using\n * {@link ClickableComponent#handleKeyPress}.\n * 3. `ClickableComponent` has not had a `blur` event (`blur` means that focus was lost). The user presses\n * the space or enter key.\n * 4. {@link ClickableComponent#handleKeyPress} calls this function with the `keydown`\n * event as a parameter.\n *\n * @param {EventTarget~Event} event\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n * @abstract\n */\n\n\n _proto.handleClick = function handleClick(event) {};\n /**\n * This gets called when a `ClickableComponent` gains focus via a `focus` event.\n * Turns on listening for `keydown` events. When they happen it\n * calls `this.handleKeyPress`.\n *\n * @param {EventTarget~Event} event\n * The `focus` event that caused this function to be called.\n *\n * @listens focus\n */\n\n\n _proto.handleFocus = function handleFocus(event) {\n on(document, 'keydown', bind(this, this.handleKeyPress));\n };\n /**\n * Called when this ClickableComponent has focus and a key gets pressed down. By\n * default it will call `this.handleClick` when the key is space or enter.\n *\n * @param {EventTarget~Event} event\n * The `keydown` event that caused this function to be called.\n *\n * @listens keydown\n */\n\n\n _proto.handleKeyPress = function handleKeyPress(event) {\n // Support Space (32) or Enter (13) key operation to fire a click event\n if (event.which === 32 || event.which === 13) {\n event.preventDefault();\n this.trigger('click');\n } else if (_Component.prototype.handleKeyPress) {\n // Pass keypress handling up for unsupported keys\n _Component.prototype.handleKeyPress.call(this, event);\n }\n };\n /**\n * Called when a `ClickableComponent` loses focus. Turns off the listener for\n * `keydown` events. Which Stops `this.handleKeyPress` from getting called.\n *\n * @param {EventTarget~Event} event\n * The `blur` event that caused this function to be called.\n *\n * @listens blur\n */\n\n\n _proto.handleBlur = function handleBlur(event) {\n off(document, 'keydown', bind(this, this.handleKeyPress));\n };\n\n return ClickableComponent;\n}(Component);\n\nComponent.registerComponent('ClickableComponent', ClickableComponent);\n\n/**\n * A `ClickableComponent` that handles showing the poster image for the player.\n *\n * @extends ClickableComponent\n */\n\nvar PosterImage =\n/*#__PURE__*/\nfunction (_ClickableComponent) {\n _inheritsLoose(PosterImage, _ClickableComponent);\n\n /**\n * Create an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should attach to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function PosterImage(player, options) {\n var _this;\n\n _this = _ClickableComponent.call(this, player, options) || this;\n\n _this.update();\n\n player.on('posterchange', bind(_assertThisInitialized(_assertThisInitialized(_this)), _this.update));\n return _this;\n }\n /**\n * Clean up and dispose of the `PosterImage`.\n */\n\n\n var _proto = PosterImage.prototype;\n\n _proto.dispose = function dispose() {\n this.player().off('posterchange', this.update);\n\n _ClickableComponent.prototype.dispose.call(this);\n };\n /**\n * Create the `PosterImage`s DOM element.\n *\n * @return {Element}\n * The element that gets created.\n */\n\n\n _proto.createEl = function createEl$$1() {\n var el = createEl('div', {\n className: 'vjs-poster',\n // Don't want poster to be tabbable.\n tabIndex: -1\n });\n return el;\n };\n /**\n * An {@link EventTarget~EventListener} for {@link Player#posterchange} events.\n *\n * @listens Player#posterchange\n *\n * @param {EventTarget~Event} [event]\n * The `Player#posterchange` event that triggered this function.\n */\n\n\n _proto.update = function update(event) {\n var url = this.player().poster();\n this.setSrc(url); // If there's no poster source we should display:none on this component\n // so it's not still clickable or right-clickable\n\n if (url) {\n this.show();\n } else {\n this.hide();\n }\n };\n /**\n * Set the source of the `PosterImage` depending on the display method.\n *\n * @param {string} url\n * The URL to the source for the `PosterImage`.\n */\n\n\n _proto.setSrc = function setSrc(url) {\n var backgroundImage = ''; // Any falsy value should stay as an empty string, otherwise\n // this will throw an extra error\n\n if (url) {\n backgroundImage = \"url(\\\"\" + url + \"\\\")\";\n }\n\n this.el_.style.backgroundImage = backgroundImage;\n };\n /**\n * An {@link EventTarget~EventListener} for clicks on the `PosterImage`. See\n * {@link ClickableComponent#handleClick} for instances where this will be triggered.\n *\n * @listens tap\n * @listens click\n * @listens keydown\n *\n * @param {EventTarget~Event} event\n + The `click`, `tap` or `keydown` event that caused this function to be called.\n */\n\n\n _proto.handleClick = function handleClick(event) {\n // We don't want a click to trigger playback when controls are disabled\n if (!this.player_.controls()) {\n return;\n }\n\n if (this.player_.paused()) {\n silencePromise(this.player_.play());\n } else {\n this.player_.pause();\n }\n };\n\n return PosterImage;\n}(ClickableComponent);\n\nComponent.registerComponent('PosterImage', PosterImage);\n\nvar darkGray = '#222';\nvar lightGray = '#ccc';\nvar fontMap = {\n monospace: 'monospace',\n sansSerif: 'sans-serif',\n serif: 'serif',\n monospaceSansSerif: '\"Andale Mono\", \"Lucida Console\", monospace',\n monospaceSerif: '\"Courier New\", monospace',\n proportionalSansSerif: 'sans-serif',\n proportionalSerif: 'serif',\n casual: '\"Comic Sans MS\", Impact, fantasy',\n script: '\"Monotype Corsiva\", cursive',\n smallcaps: '\"Andale Mono\", \"Lucida Console\", monospace, sans-serif'\n};\n/**\n * Construct an rgba color from a given hex color code.\n *\n * @param {number} color\n * Hex number for color, like #f0e or #f604e2.\n *\n * @param {number} opacity\n * Value for opacity, 0.0 - 1.0.\n *\n * @return {string}\n * The rgba color that was created, like 'rgba(255, 0, 0, 0.3)'.\n */\n\nfunction constructColor(color, opacity) {\n var hex;\n\n if (color.length === 4) {\n // color looks like \"#f0e\"\n hex = color[1] + color[1] + color[2] + color[2] + color[3] + color[3];\n } else if (color.length === 7) {\n // color looks like \"#f604e2\"\n hex = color.slice(1);\n } else {\n throw new Error('Invalid color code provided, ' + color + '; must be formatted as e.g. #f0e or #f604e2.');\n }\n\n return 'rgba(' + parseInt(hex.slice(0, 2), 16) + ',' + parseInt(hex.slice(2, 4), 16) + ',' + parseInt(hex.slice(4, 6), 16) + ',' + opacity + ')';\n}\n/**\n * Try to update the style of a DOM element. Some style changes will throw an error,\n * particularly in IE8. Those should be noops.\n *\n * @param {Element} el\n * The DOM element to be styled.\n *\n * @param {string} style\n * The CSS property on the element that should be styled.\n *\n * @param {string} rule\n * The style rule that should be applied to the property.\n *\n * @private\n */\n\nfunction tryUpdateStyle(el, style, rule) {\n try {\n el.style[style] = rule;\n } catch (e) {\n // Satisfies linter.\n return;\n }\n}\n/**\n * The component for displaying text track cues.\n *\n * @extends Component\n */\n\n\nvar TextTrackDisplay =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(TextTrackDisplay, _Component);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Component~ReadyCallback} [ready]\n * The function to call when `TextTrackDisplay` is ready.\n */\n function TextTrackDisplay(player, options, ready) {\n var _this;\n\n _this = _Component.call(this, player, options, ready) || this;\n var updateDisplayHandler = bind(_assertThisInitialized(_assertThisInitialized(_this)), _this.updateDisplay);\n player.on('loadstart', bind(_assertThisInitialized(_assertThisInitialized(_this)), _this.toggleDisplay));\n player.on('texttrackchange', updateDisplayHandler);\n player.on('loadedmetadata', bind(_assertThisInitialized(_assertThisInitialized(_this)), _this.preselectTrack)); // This used to be called during player init, but was causing an error\n // if a track should show by default and the display hadn't loaded yet.\n // Should probably be moved to an external track loader when we support\n // tracks that don't need a display.\n\n player.ready(bind(_assertThisInitialized(_assertThisInitialized(_this)), function () {\n if (player.tech_ && player.tech_.featuresNativeTextTracks) {\n this.hide();\n return;\n }\n\n player.on('fullscreenchange', updateDisplayHandler);\n player.on('playerresize', updateDisplayHandler);\n window$1.addEventListener('orientationchange', updateDisplayHandler);\n player.on('dispose', function () {\n return window$1.removeEventListener('orientationchange', updateDisplayHandler);\n });\n var tracks = this.options_.playerOptions.tracks || [];\n\n for (var i = 0; i < tracks.length; i++) {\n this.player_.addRemoteTextTrack(tracks[i], true);\n }\n\n this.preselectTrack();\n }));\n return _this;\n }\n /**\n * Preselect a track following this precedence:\n * - matches the previously selected {@link TextTrack}'s language and kind\n * - matches the previously selected {@link TextTrack}'s language only\n * - is the first default captions track\n * - is the first default descriptions track\n *\n * @listens Player#loadstart\n */\n\n\n var _proto = TextTrackDisplay.prototype;\n\n _proto.preselectTrack = function preselectTrack() {\n var modes = {\n captions: 1,\n subtitles: 1\n };\n var trackList = this.player_.textTracks();\n var userPref = this.player_.cache_.selectedLanguage;\n var firstDesc;\n var firstCaptions;\n var preferredTrack;\n\n for (var i = 0; i < trackList.length; i++) {\n var track = trackList[i];\n\n if (userPref && userPref.enabled && userPref.language && userPref.language === track.language && track.kind in modes) {\n // Always choose the track that matches both language and kind\n if (track.kind === userPref.kind) {\n preferredTrack = track; // or choose the first track that matches language\n } else if (!preferredTrack) {\n preferredTrack = track;\n } // clear everything if offTextTrackMenuItem was clicked\n\n } else if (userPref && !userPref.enabled) {\n preferredTrack = null;\n firstDesc = null;\n firstCaptions = null;\n } else if (track.default) {\n if (track.kind === 'descriptions' && !firstDesc) {\n firstDesc = track;\n } else if (track.kind in modes && !firstCaptions) {\n firstCaptions = track;\n }\n }\n } // The preferredTrack matches the user preference and takes\n // precedence over all the other tracks.\n // So, display the preferredTrack before the first default track\n // and the subtitles/captions track before the descriptions track\n\n\n if (preferredTrack) {\n preferredTrack.mode = 'showing';\n } else if (firstCaptions) {\n firstCaptions.mode = 'showing';\n } else if (firstDesc) {\n firstDesc.mode = 'showing';\n }\n };\n /**\n * Turn display of {@link TextTrack}'s from the current state into the other state.\n * There are only two states:\n * - 'shown'\n * - 'hidden'\n *\n * @listens Player#loadstart\n */\n\n\n _proto.toggleDisplay = function toggleDisplay() {\n if (this.player_.tech_ && this.player_.tech_.featuresNativeTextTracks) {\n this.hide();\n } else {\n this.show();\n }\n };\n /**\n * Create the {@link Component}'s DOM element.\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n _proto.createEl = function createEl() {\n return _Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-text-track-display'\n }, {\n 'aria-live': 'off',\n 'aria-atomic': 'true'\n });\n };\n /**\n * Clear all displayed {@link TextTrack}s.\n */\n\n\n _proto.clearDisplay = function clearDisplay() {\n if (typeof window$1.WebVTT === 'function') {\n window$1.WebVTT.processCues(window$1, [], this.el_);\n }\n };\n /**\n * Update the displayed TextTrack when a either a {@link Player#texttrackchange} or\n * a {@link Player#fullscreenchange} is fired.\n *\n * @listens Player#texttrackchange\n * @listens Player#fullscreenchange\n */\n\n\n _proto.updateDisplay = function updateDisplay() {\n var tracks = this.player_.textTracks();\n this.clearDisplay(); // Track display prioritization model: if multiple tracks are 'showing',\n // display the first 'subtitles' or 'captions' track which is 'showing',\n // otherwise display the first 'descriptions' track which is 'showing'\n\n var descriptionsTrack = null;\n var captionsSubtitlesTrack = null;\n var i = tracks.length;\n\n while (i--) {\n var track = tracks[i];\n\n if (track.mode === 'showing') {\n if (track.kind === 'descriptions') {\n descriptionsTrack = track;\n } else {\n captionsSubtitlesTrack = track;\n }\n }\n }\n\n if (captionsSubtitlesTrack) {\n if (this.getAttribute('aria-live') !== 'off') {\n this.setAttribute('aria-live', 'off');\n }\n\n this.updateForTrack(captionsSubtitlesTrack);\n } else if (descriptionsTrack) {\n if (this.getAttribute('aria-live') !== 'assertive') {\n this.setAttribute('aria-live', 'assertive');\n }\n\n this.updateForTrack(descriptionsTrack);\n }\n };\n /**\n * Add an {@link TextTrack} to to the {@link Tech}s {@link TextTrackList}.\n *\n * @param {TextTrack} track\n * Text track object to be added to the list.\n */\n\n\n _proto.updateForTrack = function updateForTrack(track) {\n if (typeof window$1.WebVTT !== 'function' || !track.activeCues) {\n return;\n }\n\n var cues = [];\n\n for (var _i = 0; _i < track.activeCues.length; _i++) {\n cues.push(track.activeCues[_i]);\n }\n\n window$1.WebVTT.processCues(window$1, cues, this.el_);\n\n if (!this.player_.textTrackSettings) {\n return;\n }\n\n var overrides = this.player_.textTrackSettings.getValues();\n var i = cues.length;\n\n while (i--) {\n var cue = cues[i];\n\n if (!cue) {\n continue;\n }\n\n var cueDiv = cue.displayState;\n\n if (overrides.color) {\n cueDiv.firstChild.style.color = overrides.color;\n }\n\n if (overrides.textOpacity) {\n tryUpdateStyle(cueDiv.firstChild, 'color', constructColor(overrides.color || '#fff', overrides.textOpacity));\n }\n\n if (overrides.backgroundColor) {\n cueDiv.firstChild.style.backgroundColor = overrides.backgroundColor;\n }\n\n if (overrides.backgroundOpacity) {\n tryUpdateStyle(cueDiv.firstChild, 'backgroundColor', constructColor(overrides.backgroundColor || '#000', overrides.backgroundOpacity));\n }\n\n if (overrides.windowColor) {\n if (overrides.windowOpacity) {\n tryUpdateStyle(cueDiv, 'backgroundColor', constructColor(overrides.windowColor, overrides.windowOpacity));\n } else {\n cueDiv.style.backgroundColor = overrides.windowColor;\n }\n }\n\n if (overrides.edgeStyle) {\n if (overrides.edgeStyle === 'dropshadow') {\n cueDiv.firstChild.style.textShadow = \"2px 2px 3px \" + darkGray + \", 2px 2px 4px \" + darkGray + \", 2px 2px 5px \" + darkGray;\n } else if (overrides.edgeStyle === 'raised') {\n cueDiv.firstChild.style.textShadow = \"1px 1px \" + darkGray + \", 2px 2px \" + darkGray + \", 3px 3px \" + darkGray;\n } else if (overrides.edgeStyle === 'depressed') {\n cueDiv.firstChild.style.textShadow = \"1px 1px \" + lightGray + \", 0 1px \" + lightGray + \", -1px -1px \" + darkGray + \", 0 -1px \" + darkGray;\n } else if (overrides.edgeStyle === 'uniform') {\n cueDiv.firstChild.style.textShadow = \"0 0 4px \" + darkGray + \", 0 0 4px \" + darkGray + \", 0 0 4px \" + darkGray + \", 0 0 4px \" + darkGray;\n }\n }\n\n if (overrides.fontPercent && overrides.fontPercent !== 1) {\n var fontSize = window$1.parseFloat(cueDiv.style.fontSize);\n cueDiv.style.fontSize = fontSize * overrides.fontPercent + 'px';\n cueDiv.style.height = 'auto';\n cueDiv.style.top = 'auto';\n cueDiv.style.bottom = '2px';\n }\n\n if (overrides.fontFamily && overrides.fontFamily !== 'default') {\n if (overrides.fontFamily === 'small-caps') {\n cueDiv.firstChild.style.fontVariant = 'small-caps';\n } else {\n cueDiv.firstChild.style.fontFamily = fontMap[overrides.fontFamily];\n }\n }\n }\n };\n\n return TextTrackDisplay;\n}(Component);\n\nComponent.registerComponent('TextTrackDisplay', TextTrackDisplay);\n\n/**\n * A loading spinner for use during waiting/loading events.\n *\n * @extends Component\n */\n\nvar LoadingSpinner =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(LoadingSpinner, _Component);\n\n function LoadingSpinner() {\n return _Component.apply(this, arguments) || this;\n }\n\n var _proto = LoadingSpinner.prototype;\n\n /**\n * Create the `LoadingSpinner`s DOM element.\n *\n * @return {Element}\n * The dom element that gets created.\n */\n _proto.createEl = function createEl$$1() {\n var isAudio = this.player_.isAudio();\n var playerType = this.localize(isAudio ? 'Audio Player' : 'Video Player');\n var controlText = createEl('span', {\n className: 'vjs-control-text',\n innerHTML: this.localize('{1} is loading.', [playerType])\n });\n\n var el = _Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-loading-spinner',\n dir: 'ltr'\n });\n\n el.appendChild(controlText);\n return el;\n };\n\n return LoadingSpinner;\n}(Component);\n\nComponent.registerComponent('LoadingSpinner', LoadingSpinner);\n\n/**\n * Base class for all buttons.\n *\n * @extends ClickableComponent\n */\n\nvar Button =\n/*#__PURE__*/\nfunction (_ClickableComponent) {\n _inheritsLoose(Button, _ClickableComponent);\n\n function Button() {\n return _ClickableComponent.apply(this, arguments) || this;\n }\n\n var _proto = Button.prototype;\n\n /**\n * Create the `Button`s DOM element.\n *\n * @param {string} [tag=\"button\"]\n * The element's node type. This argument is IGNORED: no matter what\n * is passed, it will always create a `button` element.\n *\n * @param {Object} [props={}]\n * An object of properties that should be set on the element.\n *\n * @param {Object} [attributes={}]\n * An object of attributes that should be set on the element.\n *\n * @return {Element}\n * The element that gets created.\n */\n _proto.createEl = function createEl(tag, props, attributes) {\n if (props === void 0) {\n props = {};\n }\n\n if (attributes === void 0) {\n attributes = {};\n }\n\n tag = 'button';\n props = assign({\n innerHTML: '<span aria-hidden=\"true\" class=\"vjs-icon-placeholder\"></span>',\n className: this.buildCSSClass()\n }, props); // Add attributes for button element\n\n attributes = assign({\n // Necessary since the default button type is \"submit\"\n type: 'button'\n }, attributes);\n var el = Component.prototype.createEl.call(this, tag, props, attributes);\n this.createControlTextEl(el);\n return el;\n };\n /**\n * Add a child `Component` inside of this `Button`.\n *\n * @param {string|Component} child\n * The name or instance of a child to add.\n *\n * @param {Object} [options={}]\n * The key/value store of options that will get passed to children of\n * the child.\n *\n * @return {Component}\n * The `Component` that gets added as a child. When using a string the\n * `Component` will get created by this process.\n *\n * @deprecated since version 5\n */\n\n\n _proto.addChild = function addChild(child, options) {\n if (options === void 0) {\n options = {};\n }\n\n var className = this.constructor.name;\n log.warn(\"Adding an actionable (user controllable) child to a Button (\" + className + \") is not supported; use a ClickableComponent instead.\"); // Avoid the error message generated by ClickableComponent's addChild method\n\n return Component.prototype.addChild.call(this, child, options);\n };\n /**\n * Enable the `Button` element so that it can be activated or clicked. Use this with\n * {@link Button#disable}.\n */\n\n\n _proto.enable = function enable() {\n _ClickableComponent.prototype.enable.call(this);\n\n this.el_.removeAttribute('disabled');\n };\n /**\n * Disable the `Button` element so that it cannot be activated or clicked. Use this with\n * {@link Button#enable}.\n */\n\n\n _proto.disable = function disable() {\n _ClickableComponent.prototype.disable.call(this);\n\n this.el_.setAttribute('disabled', 'disabled');\n };\n /**\n * This gets called when a `Button` has focus and `keydown` is triggered via a key\n * press.\n *\n * @param {EventTarget~Event} event\n * The event that caused this function to get called.\n *\n * @listens keydown\n */\n\n\n _proto.handleKeyPress = function handleKeyPress(event) {\n // Ignore Space (32) or Enter (13) key operation, which is handled by the browser for a button.\n if (event.which === 32 || event.which === 13) {\n return;\n } // Pass keypress handling up for unsupported keys\n\n\n _ClickableComponent.prototype.handleKeyPress.call(this, event);\n };\n\n return Button;\n}(ClickableComponent);\n\nComponent.registerComponent('Button', Button);\n\n/**\n * The initial play button that shows before the video has played. The hiding of the\n * `BigPlayButton` get done via CSS and `Player` states.\n *\n * @extends Button\n */\n\nvar BigPlayButton =\n/*#__PURE__*/\nfunction (_Button) {\n _inheritsLoose(BigPlayButton, _Button);\n\n function BigPlayButton(player, options) {\n var _this;\n\n _this = _Button.call(this, player, options) || this;\n _this.mouseused_ = false;\n\n _this.on('mousedown', _this.handleMouseDown);\n\n return _this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object. Always returns 'vjs-big-play-button'.\n */\n\n\n var _proto = BigPlayButton.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return 'vjs-big-play-button';\n };\n /**\n * This gets called when a `BigPlayButton` \"clicked\". See {@link ClickableComponent}\n * for more detailed information on what a click can be.\n *\n * @param {EventTarget~Event} event\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n\n\n _proto.handleClick = function handleClick(event) {\n var playPromise = this.player_.play(); // exit early if clicked via the mouse\n\n if (this.mouseused_ && event.clientX && event.clientY) {\n silencePromise(playPromise);\n return;\n }\n\n var cb = this.player_.getChild('controlBar');\n var playToggle = cb && cb.getChild('playToggle');\n\n if (!playToggle) {\n this.player_.focus();\n return;\n }\n\n var playFocus = function playFocus() {\n return playToggle.focus();\n };\n\n if (isPromise(playPromise)) {\n playPromise.then(playFocus, function () {});\n } else {\n this.setTimeout(playFocus, 1);\n }\n };\n\n _proto.handleKeyPress = function handleKeyPress(event) {\n this.mouseused_ = false;\n\n _Button.prototype.handleKeyPress.call(this, event);\n };\n\n _proto.handleMouseDown = function handleMouseDown(event) {\n this.mouseused_ = true;\n };\n\n return BigPlayButton;\n}(Button);\n/**\n * The text that should display over the `BigPlayButton`s controls. Added to for localization.\n *\n * @type {string}\n * @private\n */\n\n\nBigPlayButton.prototype.controlText_ = 'Play Video';\nComponent.registerComponent('BigPlayButton', BigPlayButton);\n\n/**\n * The `CloseButton` is a `{@link Button}` that fires a `close` event when\n * it gets clicked.\n *\n * @extends Button\n */\n\nvar CloseButton =\n/*#__PURE__*/\nfunction (_Button) {\n _inheritsLoose(CloseButton, _Button);\n\n /**\n * Creates an instance of the this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function CloseButton(player, options) {\n var _this;\n\n _this = _Button.call(this, player, options) || this;\n\n _this.controlText(options && options.controlText || _this.localize('Close'));\n\n return _this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n var _proto = CloseButton.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-close-button \" + _Button.prototype.buildCSSClass.call(this);\n };\n /**\n * This gets called when a `CloseButton` gets clicked. See\n * {@link ClickableComponent#handleClick} for more information on when this will be\n * triggered\n *\n * @param {EventTarget~Event} event\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n * @fires CloseButton#close\n */\n\n\n _proto.handleClick = function handleClick(event) {\n /**\n * Triggered when the a `CloseButton` is clicked.\n *\n * @event CloseButton#close\n * @type {EventTarget~Event}\n *\n * @property {boolean} [bubbles=false]\n * set to false so that the close event does not\n * bubble up to parents if there is no listener\n */\n this.trigger({\n type: 'close',\n bubbles: false\n });\n };\n\n return CloseButton;\n}(Button);\n\nComponent.registerComponent('CloseButton', CloseButton);\n\n/**\n * Button to toggle between play and pause.\n *\n * @extends Button\n */\n\nvar PlayToggle =\n/*#__PURE__*/\nfunction (_Button) {\n _inheritsLoose(PlayToggle, _Button);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options={}]\n * The key/value store of player options.\n */\n function PlayToggle(player, options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n _this = _Button.call(this, player, options) || this; // show or hide replay icon\n\n options.replay = options.replay === undefined || options.replay;\n\n _this.on(player, 'play', _this.handlePlay);\n\n _this.on(player, 'pause', _this.handlePause);\n\n if (options.replay) {\n _this.on(player, 'ended', _this.handleEnded);\n }\n\n return _this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n var _proto = PlayToggle.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-play-control \" + _Button.prototype.buildCSSClass.call(this);\n };\n /**\n * This gets called when an `PlayToggle` is \"clicked\". See\n * {@link ClickableComponent} for more detailed information on what a click can be.\n *\n * @param {EventTarget~Event} [event]\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n\n\n _proto.handleClick = function handleClick(event) {\n if (this.player_.paused()) {\n this.player_.play();\n } else {\n this.player_.pause();\n }\n };\n /**\n * This gets called once after the video has ended and the user seeks so that\n * we can change the replay button back to a play button.\n *\n * @param {EventTarget~Event} [event]\n * The event that caused this function to run.\n *\n * @listens Player#seeked\n */\n\n\n _proto.handleSeeked = function handleSeeked(event) {\n this.removeClass('vjs-ended');\n\n if (this.player_.paused()) {\n this.handlePause(event);\n } else {\n this.handlePlay(event);\n }\n };\n /**\n * Add the vjs-playing class to the element so it can change appearance.\n *\n * @param {EventTarget~Event} [event]\n * The event that caused this function to run.\n *\n * @listens Player#play\n */\n\n\n _proto.handlePlay = function handlePlay(event) {\n this.removeClass('vjs-ended');\n this.removeClass('vjs-paused');\n this.addClass('vjs-playing'); // change the button text to \"Pause\"\n\n this.controlText('Pause');\n };\n /**\n * Add the vjs-paused class to the element so it can change appearance.\n *\n * @param {EventTarget~Event} [event]\n * The event that caused this function to run.\n *\n * @listens Player#pause\n */\n\n\n _proto.handlePause = function handlePause(event) {\n this.removeClass('vjs-playing');\n this.addClass('vjs-paused'); // change the button text to \"Play\"\n\n this.controlText('Play');\n };\n /**\n * Add the vjs-ended class to the element so it can change appearance\n *\n * @param {EventTarget~Event} [event]\n * The event that caused this function to run.\n *\n * @listens Player#ended\n */\n\n\n _proto.handleEnded = function handleEnded(event) {\n this.removeClass('vjs-playing');\n this.addClass('vjs-ended'); // change the button text to \"Replay\"\n\n this.controlText('Replay'); // on the next seek remove the replay button\n\n this.one(this.player_, 'seeked', this.handleSeeked);\n };\n\n return PlayToggle;\n}(Button);\n/**\n * The text that should display over the `PlayToggle`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\n\nPlayToggle.prototype.controlText_ = 'Play';\nComponent.registerComponent('PlayToggle', PlayToggle);\n\n/**\n * @file format-time.js\n * @module format-time\n */\n\n/**\n * Format seconds as a time string, H:MM:SS or M:SS. Supplying a guide (in\n * seconds) will force a number of leading zeros to cover the length of the\n * guide.\n *\n * @private\n * @param {number} seconds\n * Number of seconds to be turned into a string\n *\n * @param {number} guide\n * Number (in seconds) to model the string after\n *\n * @return {string}\n * Time formatted as H:MM:SS or M:SS\n */\nvar defaultImplementation = function defaultImplementation(seconds, guide) {\n seconds = seconds < 0 ? 0 : seconds;\n var s = Math.floor(seconds % 60);\n var m = Math.floor(seconds / 60 % 60);\n var h = Math.floor(seconds / 3600);\n var gm = Math.floor(guide / 60 % 60);\n var gh = Math.floor(guide / 3600); // handle invalid times\n\n if (isNaN(seconds) || seconds === Infinity) {\n // '-' is false for all relational operators (e.g. <, >=) so this setting\n // will add the minimum number of fields specified by the guide\n h = m = s = '-';\n } // Check if we need to show hours\n\n\n h = h > 0 || gh > 0 ? h + ':' : ''; // If hours are showing, we may need to add a leading zero.\n // Always show at least one digit of minutes.\n\n m = ((h || gm >= 10) && m < 10 ? '0' + m : m) + ':'; // Check if leading zero is need for seconds\n\n s = s < 10 ? '0' + s : s;\n return h + m + s;\n}; // Internal pointer to the current implementation.\n\n\nvar implementation = defaultImplementation;\n/**\n * Replaces the default formatTime implementation with a custom implementation.\n *\n * @param {Function} customImplementation\n * A function which will be used in place of the default formatTime\n * implementation. Will receive the current time in seconds and the\n * guide (in seconds) as arguments.\n */\n\nfunction setFormatTime(customImplementation) {\n implementation = customImplementation;\n}\n/**\n * Resets formatTime to the default implementation.\n */\n\nfunction resetFormatTime() {\n implementation = defaultImplementation;\n}\n/**\n * Delegates to either the default time formatting function or a custom\n * function supplied via `setFormatTime`.\n *\n * Formats seconds as a time string (H:MM:SS or M:SS). Supplying a\n * guide (in seconds) will force a number of leading zeros to cover the\n * length of the guide.\n *\n * @static\n * @example formatTime(125, 600) === \"02:05\"\n * @param {number} seconds\n * Number of seconds to be turned into a string\n *\n * @param {number} guide\n * Number (in seconds) to model the string after\n *\n * @return {string}\n * Time formatted as H:MM:SS or M:SS\n */\n\nfunction formatTime(seconds, guide) {\n if (guide === void 0) {\n guide = seconds;\n }\n\n return implementation(seconds, guide);\n}\n\n/**\n * Displays time information about the video\n *\n * @extends Component\n */\n\nvar TimeDisplay =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(TimeDisplay, _Component);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function TimeDisplay(player, options) {\n var _this;\n\n _this = _Component.call(this, player, options) || this;\n _this.throttledUpdateContent = throttle(bind(_assertThisInitialized(_assertThisInitialized(_this)), _this.updateContent), 25);\n\n _this.on(player, 'timeupdate', _this.throttledUpdateContent);\n\n return _this;\n }\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n var _proto = TimeDisplay.prototype;\n\n _proto.createEl = function createEl$$1(plainName) {\n var className = this.buildCSSClass();\n\n var el = _Component.prototype.createEl.call(this, 'div', {\n className: className + \" vjs-time-control vjs-control\",\n innerHTML: \"<span class=\\\"vjs-control-text\\\" role=\\\"presentation\\\">\" + this.localize(this.labelText_) + \"\\xA0</span>\"\n });\n\n this.contentEl_ = createEl('span', {\n className: className + \"-display\"\n }, {\n // tell screen readers not to automatically read the time as it changes\n 'aria-live': 'off',\n // span elements have no implicit role, but some screen readers (notably VoiceOver)\n // treat them as a break between items in the DOM when using arrow keys\n // (or left-to-right swipes on iOS) to read contents of a page. Using\n // role='presentation' causes VoiceOver to NOT treat this span as a break.\n 'role': 'presentation'\n });\n this.updateTextNode_();\n el.appendChild(this.contentEl_);\n return el;\n };\n\n _proto.dispose = function dispose() {\n this.contentEl_ = null;\n this.textNode_ = null;\n\n _Component.prototype.dispose.call(this);\n };\n /**\n * Updates the \"remaining time\" text node with new content using the\n * contents of the `formattedTime_` property.\n *\n * @private\n */\n\n\n _proto.updateTextNode_ = function updateTextNode_() {\n if (!this.contentEl_) {\n return;\n }\n\n while (this.contentEl_.firstChild) {\n this.contentEl_.removeChild(this.contentEl_.firstChild);\n }\n\n this.textNode_ = document.createTextNode(this.formattedTime_ || this.formatTime_(0));\n this.contentEl_.appendChild(this.textNode_);\n };\n /**\n * Generates a formatted time for this component to use in display.\n *\n * @param {number} time\n * A numeric time, in seconds.\n *\n * @return {string}\n * A formatted time\n *\n * @private\n */\n\n\n _proto.formatTime_ = function formatTime_(time) {\n return formatTime(time);\n };\n /**\n * Updates the time display text node if it has what was passed in changed\n * the formatted time.\n *\n * @param {number} time\n * The time to update to\n *\n * @private\n */\n\n\n _proto.updateFormattedTime_ = function updateFormattedTime_(time) {\n var formattedTime = this.formatTime_(time);\n\n if (formattedTime === this.formattedTime_) {\n return;\n }\n\n this.formattedTime_ = formattedTime;\n this.requestAnimationFrame(this.updateTextNode_);\n };\n /**\n * To be filled out in the child class, should update the displayed time\n * in accordance with the fact that the current time has changed.\n *\n * @param {EventTarget~Event} [event]\n * The `timeupdate` event that caused this to run.\n *\n * @listens Player#timeupdate\n */\n\n\n _proto.updateContent = function updateContent(event) {};\n\n return TimeDisplay;\n}(Component);\n/**\n * The text that is added to the `TimeDisplay` for screen reader users.\n *\n * @type {string}\n * @private\n */\n\n\nTimeDisplay.prototype.labelText_ = 'Time';\n/**\n * The text that should display over the `TimeDisplay`s controls. Added to for localization.\n *\n * @type {string}\n * @private\n *\n * @deprecated in v7; controlText_ is not used in non-active display Components\n */\n\nTimeDisplay.prototype.controlText_ = 'Time';\nComponent.registerComponent('TimeDisplay', TimeDisplay);\n\n/**\n * Displays the current time\n *\n * @extends Component\n */\n\nvar CurrentTimeDisplay =\n/*#__PURE__*/\nfunction (_TimeDisplay) {\n _inheritsLoose(CurrentTimeDisplay, _TimeDisplay);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function CurrentTimeDisplay(player, options) {\n var _this;\n\n _this = _TimeDisplay.call(this, player, options) || this;\n\n _this.on(player, 'ended', _this.handleEnded);\n\n return _this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n var _proto = CurrentTimeDisplay.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return 'vjs-current-time';\n };\n /**\n * Update current time display\n *\n * @param {EventTarget~Event} [event]\n * The `timeupdate` event that caused this function to run.\n *\n * @listens Player#timeupdate\n */\n\n\n _proto.updateContent = function updateContent(event) {\n // Allows for smooth scrubbing, when player can't keep up.\n var time = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime();\n this.updateFormattedTime_(time);\n };\n /**\n * When the player fires ended there should be no time left. Sadly\n * this is not always the case, lets make it seem like that is the case\n * for users.\n *\n * @param {EventTarget~Event} [event]\n * The `ended` event that caused this to run.\n *\n * @listens Player#ended\n */\n\n\n _proto.handleEnded = function handleEnded(event) {\n if (!this.player_.duration()) {\n return;\n }\n\n this.updateFormattedTime_(this.player_.duration());\n };\n\n return CurrentTimeDisplay;\n}(TimeDisplay);\n/**\n * The text that is added to the `CurrentTimeDisplay` for screen reader users.\n *\n * @type {string}\n * @private\n */\n\n\nCurrentTimeDisplay.prototype.labelText_ = 'Current Time';\n/**\n * The text that should display over the `CurrentTimeDisplay`s controls. Added to for localization.\n *\n * @type {string}\n * @private\n *\n * @deprecated in v7; controlText_ is not used in non-active display Components\n */\n\nCurrentTimeDisplay.prototype.controlText_ = 'Current Time';\nComponent.registerComponent('CurrentTimeDisplay', CurrentTimeDisplay);\n\n/**\n * Displays the duration\n *\n * @extends Component\n */\n\nvar DurationDisplay =\n/*#__PURE__*/\nfunction (_TimeDisplay) {\n _inheritsLoose(DurationDisplay, _TimeDisplay);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function DurationDisplay(player, options) {\n var _this;\n\n _this = _TimeDisplay.call(this, player, options) || this; // we do not want to/need to throttle duration changes,\n // as they should always display the changed duration as\n // it has changed\n\n _this.on(player, 'durationchange', _this.updateContent); // Listen to loadstart because the player duration is reset when a new media element is loaded,\n // but the durationchange on the user agent will not fire.\n // @see [Spec]{@link https://www.w3.org/TR/2011/WD-html5-20110113/video.html#media-element-load-algorithm}\n\n\n _this.on(player, 'loadstart', _this.updateContent); // Also listen for timeupdate (in the parent) and loadedmetadata because removing those\n // listeners could have broken dependent applications/libraries. These\n // can likely be removed for 7.0.\n\n\n _this.on(player, 'loadedmetadata', _this.throttledUpdateContent);\n\n return _this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n var _proto = DurationDisplay.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return 'vjs-duration';\n };\n /**\n * Update duration time display.\n *\n * @param {EventTarget~Event} [event]\n * The `durationchange`, `timeupdate`, or `loadedmetadata` event that caused\n * this function to be called.\n *\n * @listens Player#durationchange\n * @listens Player#timeupdate\n * @listens Player#loadedmetadata\n */\n\n\n _proto.updateContent = function updateContent(event) {\n var duration = this.player_.duration();\n\n if (this.duration_ !== duration) {\n this.duration_ = duration;\n this.updateFormattedTime_(duration);\n }\n };\n\n return DurationDisplay;\n}(TimeDisplay);\n/**\n * The text that is added to the `DurationDisplay` for screen reader users.\n *\n * @type {string}\n * @private\n */\n\n\nDurationDisplay.prototype.labelText_ = 'Duration';\n/**\n * The text that should display over the `DurationDisplay`s controls. Added to for localization.\n *\n * @type {string}\n * @private\n *\n * @deprecated in v7; controlText_ is not used in non-active display Components\n */\n\nDurationDisplay.prototype.controlText_ = 'Duration';\nComponent.registerComponent('DurationDisplay', DurationDisplay);\n\n/**\n * The separator between the current time and duration.\n * Can be hidden if it's not needed in the design.\n *\n * @extends Component\n */\n\nvar TimeDivider =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(TimeDivider, _Component);\n\n function TimeDivider() {\n return _Component.apply(this, arguments) || this;\n }\n\n var _proto = TimeDivider.prototype;\n\n /**\n * Create the component's DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n _proto.createEl = function createEl() {\n return _Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-time-control vjs-time-divider',\n innerHTML: '<div><span>/</span></div>'\n }, {\n // this element and its contents can be hidden from assistive techs since\n // it is made extraneous by the announcement of the control text\n // for the current time and duration displays\n 'aria-hidden': true\n });\n };\n\n return TimeDivider;\n}(Component);\n\nComponent.registerComponent('TimeDivider', TimeDivider);\n\n/**\n * Displays the time left in the video\n *\n * @extends Component\n */\n\nvar RemainingTimeDisplay =\n/*#__PURE__*/\nfunction (_TimeDisplay) {\n _inheritsLoose(RemainingTimeDisplay, _TimeDisplay);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function RemainingTimeDisplay(player, options) {\n var _this;\n\n _this = _TimeDisplay.call(this, player, options) || this;\n\n _this.on(player, 'durationchange', _this.throttledUpdateContent);\n\n _this.on(player, 'ended', _this.handleEnded);\n\n return _this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n var _proto = RemainingTimeDisplay.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return 'vjs-remaining-time';\n };\n /**\n * The remaining time display prefixes numbers with a \"minus\" character.\n *\n * @param {number} time\n * A numeric time, in seconds.\n *\n * @return {string}\n * A formatted time\n *\n * @private\n */\n\n\n _proto.formatTime_ = function formatTime_(time) {\n // TODO: The \"-\" should be decorative, and not announced by a screen reader\n return '-' + _TimeDisplay.prototype.formatTime_.call(this, time);\n };\n /**\n * Update remaining time display.\n *\n * @param {EventTarget~Event} [event]\n * The `timeupdate` or `durationchange` event that caused this to run.\n *\n * @listens Player#timeupdate\n * @listens Player#durationchange\n */\n\n\n _proto.updateContent = function updateContent(event) {\n if (!this.player_.duration()) {\n return;\n } // @deprecated We should only use remainingTimeDisplay\n // as of video.js 7\n\n\n if (this.player_.remainingTimeDisplay) {\n this.updateFormattedTime_(this.player_.remainingTimeDisplay());\n } else {\n this.updateFormattedTime_(this.player_.remainingTime());\n }\n };\n /**\n * When the player fires ended there should be no time left. Sadly\n * this is not always the case, lets make it seem like that is the case\n * for users.\n *\n * @param {EventTarget~Event} [event]\n * The `ended` event that caused this to run.\n *\n * @listens Player#ended\n */\n\n\n _proto.handleEnded = function handleEnded(event) {\n if (!this.player_.duration()) {\n return;\n }\n\n this.updateFormattedTime_(0);\n };\n\n return RemainingTimeDisplay;\n}(TimeDisplay);\n/**\n * The text that is added to the `RemainingTimeDisplay` for screen reader users.\n *\n * @type {string}\n * @private\n */\n\n\nRemainingTimeDisplay.prototype.labelText_ = 'Remaining Time';\n/**\n * The text that should display over the `RemainingTimeDisplay`s controls. Added to for localization.\n *\n * @type {string}\n * @private\n *\n * @deprecated in v7; controlText_ is not used in non-active display Components\n */\n\nRemainingTimeDisplay.prototype.controlText_ = 'Remaining Time';\nComponent.registerComponent('RemainingTimeDisplay', RemainingTimeDisplay);\n\n/**\n * Displays the live indicator when duration is Infinity.\n *\n * @extends Component\n */\n\nvar LiveDisplay =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(LiveDisplay, _Component);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function LiveDisplay(player, options) {\n var _this;\n\n _this = _Component.call(this, player, options) || this;\n\n _this.updateShowing();\n\n _this.on(_this.player(), 'durationchange', _this.updateShowing);\n\n return _this;\n }\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n var _proto = LiveDisplay.prototype;\n\n _proto.createEl = function createEl$$1() {\n var el = _Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-live-control vjs-control'\n });\n\n this.contentEl_ = createEl('div', {\n className: 'vjs-live-display',\n innerHTML: \"<span class=\\\"vjs-control-text\\\">\" + this.localize('Stream Type') + \"\\xA0</span>\" + this.localize('LIVE')\n }, {\n 'aria-live': 'off'\n });\n el.appendChild(this.contentEl_);\n return el;\n };\n\n _proto.dispose = function dispose() {\n this.contentEl_ = null;\n\n _Component.prototype.dispose.call(this);\n };\n /**\n * Check the duration to see if the LiveDisplay should be showing or not. Then show/hide\n * it accordingly\n *\n * @param {EventTarget~Event} [event]\n * The {@link Player#durationchange} event that caused this function to run.\n *\n * @listens Player#durationchange\n */\n\n\n _proto.updateShowing = function updateShowing(event) {\n if (this.player().duration() === Infinity) {\n this.show();\n } else {\n this.hide();\n }\n };\n\n return LiveDisplay;\n}(Component);\n\nComponent.registerComponent('LiveDisplay', LiveDisplay);\n\n/**\n * Displays the live indicator when duration is Infinity.\n *\n * @extends Component\n */\n\nvar SeekToLive =\n/*#__PURE__*/\nfunction (_Button) {\n _inheritsLoose(SeekToLive, _Button);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function SeekToLive(player, options) {\n var _this;\n\n _this = _Button.call(this, player, options) || this;\n\n _this.updateLiveEdgeStatus();\n\n if (_this.player_.liveTracker) {\n _this.on(_this.player_.liveTracker, 'liveedgechange', _this.updateLiveEdgeStatus);\n }\n\n return _this;\n }\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n var _proto = SeekToLive.prototype;\n\n _proto.createEl = function createEl$$1() {\n var el = _Button.prototype.createEl.call(this, 'button', {\n className: 'vjs-seek-to-live-control vjs-control'\n });\n\n this.textEl_ = createEl('span', {\n className: 'vjs-seek-to-live-text',\n innerHTML: this.localize('LIVE')\n }, {\n 'aria-hidden': 'true'\n });\n el.appendChild(this.textEl_);\n return el;\n };\n /**\n * Update the state of this button if we are at the live edge\n * or not\n */\n\n\n _proto.updateLiveEdgeStatus = function updateLiveEdgeStatus(e) {\n // default to live edge\n if (!this.player_.liveTracker || this.player_.liveTracker.atLiveEdge()) {\n this.setAttribute('aria-disabled', true);\n this.addClass('vjs-at-live-edge');\n this.controlText('Seek to live, currently playing live');\n } else {\n this.setAttribute('aria-disabled', false);\n this.removeClass('vjs-at-live-edge');\n this.controlText('Seek to live, currently behind live');\n }\n };\n /**\n * On click bring us as near to the live point as possible.\n * This requires that we wait for the next `live-seekable-change`\n * event which will happen every segment length seconds.\n */\n\n\n _proto.handleClick = function handleClick() {\n this.player_.liveTracker.seekToLiveEdge();\n };\n /**\n * Dispose of the element and stop tracking\n */\n\n\n _proto.dispose = function dispose() {\n if (this.player_.liveTracker) {\n this.off(this.player_.liveTracker, 'liveedgechange', this.updateLiveEdgeStatus);\n }\n\n this.textEl_ = null;\n\n _Button.prototype.dispose.call(this);\n };\n\n return SeekToLive;\n}(Button);\n\nSeekToLive.prototype.controlText_ = 'Seek to live, currently playing live';\nComponent.registerComponent('SeekToLive', SeekToLive);\n\n/**\n * The base functionality for a slider. Can be vertical or horizontal.\n * For instance the volume bar or the seek bar on a video is a slider.\n *\n * @extends Component\n */\n\nvar Slider =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(Slider, _Component);\n\n /**\n * Create an instance of this class\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function Slider(player, options) {\n var _this;\n\n _this = _Component.call(this, player, options) || this; // Set property names to bar to match with the child Slider class is looking for\n\n _this.bar = _this.getChild(_this.options_.barName); // Set a horizontal or vertical class on the slider depending on the slider type\n\n _this.vertical(!!_this.options_.vertical);\n\n _this.enable();\n\n return _this;\n }\n /**\n * Are controls are currently enabled for this slider or not.\n *\n * @return {boolean}\n * true if controls are enabled, false otherwise\n */\n\n\n var _proto = Slider.prototype;\n\n _proto.enabled = function enabled() {\n return this.enabled_;\n };\n /**\n * Enable controls for this slider if they are disabled\n */\n\n\n _proto.enable = function enable() {\n if (this.enabled()) {\n return;\n }\n\n this.on('mousedown', this.handleMouseDown);\n this.on('touchstart', this.handleMouseDown);\n this.on('focus', this.handleFocus);\n this.on('blur', this.handleBlur);\n this.on('click', this.handleClick);\n this.on(this.player_, 'controlsvisible', this.update);\n\n if (this.playerEvent) {\n this.on(this.player_, this.playerEvent, this.update);\n }\n\n this.removeClass('disabled');\n this.setAttribute('tabindex', 0);\n this.enabled_ = true;\n };\n /**\n * Disable controls for this slider if they are enabled\n */\n\n\n _proto.disable = function disable() {\n if (!this.enabled()) {\n return;\n }\n\n var doc = this.bar.el_.ownerDocument;\n this.off('mousedown', this.handleMouseDown);\n this.off('touchstart', this.handleMouseDown);\n this.off('focus', this.handleFocus);\n this.off('blur', this.handleBlur);\n this.off('click', this.handleClick);\n this.off(this.player_, 'controlsvisible', this.update);\n this.off(doc, 'mousemove', this.handleMouseMove);\n this.off(doc, 'mouseup', this.handleMouseUp);\n this.off(doc, 'touchmove', this.handleMouseMove);\n this.off(doc, 'touchend', this.handleMouseUp);\n this.removeAttribute('tabindex');\n this.addClass('disabled');\n\n if (this.playerEvent) {\n this.off(this.player_, this.playerEvent, this.update);\n }\n\n this.enabled_ = false;\n };\n /**\n * Create the `Slider`s DOM element.\n *\n * @param {string} type\n * Type of element to create.\n *\n * @param {Object} [props={}]\n * List of properties in Object form.\n *\n * @param {Object} [attributes={}]\n * list of attributes in Object form.\n *\n * @return {Element}\n * The element that gets created.\n */\n\n\n _proto.createEl = function createEl$$1(type, props, attributes) {\n if (props === void 0) {\n props = {};\n }\n\n if (attributes === void 0) {\n attributes = {};\n }\n\n // Add the slider element class to all sub classes\n props.className = props.className + ' vjs-slider';\n props = assign({\n tabIndex: 0\n }, props);\n attributes = assign({\n 'role': 'slider',\n 'aria-valuenow': 0,\n 'aria-valuemin': 0,\n 'aria-valuemax': 100,\n 'tabIndex': 0\n }, attributes);\n return _Component.prototype.createEl.call(this, type, props, attributes);\n };\n /**\n * Handle `mousedown` or `touchstart` events on the `Slider`.\n *\n * @param {EventTarget~Event} event\n * `mousedown` or `touchstart` event that triggered this function\n *\n * @listens mousedown\n * @listens touchstart\n * @fires Slider#slideractive\n */\n\n\n _proto.handleMouseDown = function handleMouseDown(event) {\n var doc = this.bar.el_.ownerDocument;\n\n if (event.type === 'mousedown') {\n event.preventDefault();\n } // Do not call preventDefault() on touchstart in Chrome\n // to avoid console warnings. Use a 'touch-action: none' style\n // instead to prevent unintented scrolling.\n // https://developers.google.com/web/updates/2017/01/scrolling-intervention\n\n\n if (event.type === 'touchstart' && !IS_CHROME) {\n event.preventDefault();\n }\n\n blockTextSelection();\n this.addClass('vjs-sliding');\n /**\n * Triggered when the slider is in an active state\n *\n * @event Slider#slideractive\n * @type {EventTarget~Event}\n */\n\n this.trigger('slideractive');\n this.on(doc, 'mousemove', this.handleMouseMove);\n this.on(doc, 'mouseup', this.handleMouseUp);\n this.on(doc, 'touchmove', this.handleMouseMove);\n this.on(doc, 'touchend', this.handleMouseUp);\n this.handleMouseMove(event);\n };\n /**\n * Handle the `mousemove`, `touchmove`, and `mousedown` events on this `Slider`.\n * The `mousemove` and `touchmove` events will only only trigger this function during\n * `mousedown` and `touchstart`. This is due to {@link Slider#handleMouseDown} and\n * {@link Slider#handleMouseUp}.\n *\n * @param {EventTarget~Event} event\n * `mousedown`, `mousemove`, `touchstart`, or `touchmove` event that triggered\n * this function\n *\n * @listens mousemove\n * @listens touchmove\n */\n\n\n _proto.handleMouseMove = function handleMouseMove(event) {};\n /**\n * Handle `mouseup` or `touchend` events on the `Slider`.\n *\n * @param {EventTarget~Event} event\n * `mouseup` or `touchend` event that triggered this function.\n *\n * @listens touchend\n * @listens mouseup\n * @fires Slider#sliderinactive\n */\n\n\n _proto.handleMouseUp = function handleMouseUp() {\n var doc = this.bar.el_.ownerDocument;\n unblockTextSelection();\n this.removeClass('vjs-sliding');\n /**\n * Triggered when the slider is no longer in an active state.\n *\n * @event Slider#sliderinactive\n * @type {EventTarget~Event}\n */\n\n this.trigger('sliderinactive');\n this.off(doc, 'mousemove', this.handleMouseMove);\n this.off(doc, 'mouseup', this.handleMouseUp);\n this.off(doc, 'touchmove', this.handleMouseMove);\n this.off(doc, 'touchend', this.handleMouseUp);\n this.update();\n };\n /**\n * Update the progress bar of the `Slider`.\n *\n * @return {number}\n * The percentage of progress the progress bar represents as a\n * number from 0 to 1.\n */\n\n\n _proto.update = function update() {\n // In VolumeBar init we have a setTimeout for update that pops and update\n // to the end of the execution stack. The player is destroyed before then\n // update will cause an error\n if (!this.el_) {\n return;\n } // If scrubbing, we could use a cached value to make the handle keep up\n // with the user's mouse. On HTML5 browsers scrubbing is really smooth, but\n // some flash players are slow, so we might want to utilize this later.\n // var progress = (this.player_.scrubbing()) ? this.player_.getCache().currentTime / this.player_.duration() : this.player_.currentTime() / this.player_.duration();\n\n\n var progress = this.getPercent();\n var bar = this.bar; // If there's no bar...\n\n if (!bar) {\n return;\n } // Protect against no duration and other division issues\n\n\n if (typeof progress !== 'number' || progress !== progress || progress < 0 || progress === Infinity) {\n progress = 0;\n } // Convert to a percentage for setting\n\n\n var percentage = (progress * 100).toFixed(2) + '%';\n var style = bar.el().style; // Set the new bar width or height\n\n if (this.vertical()) {\n style.height = percentage;\n } else {\n style.width = percentage;\n }\n\n return progress;\n };\n /**\n * Calculate distance for slider\n *\n * @param {EventTarget~Event} event\n * The event that caused this function to run.\n *\n * @return {number}\n * The current position of the Slider.\n * - position.x for vertical `Slider`s\n * - position.y for horizontal `Slider`s\n */\n\n\n _proto.calculateDistance = function calculateDistance(event) {\n var position = getPointerPosition(this.el_, event);\n\n if (this.vertical()) {\n return position.y;\n }\n\n return position.x;\n };\n /**\n * Handle a `focus` event on this `Slider`.\n *\n * @param {EventTarget~Event} event\n * The `focus` event that caused this function to run.\n *\n * @listens focus\n */\n\n\n _proto.handleFocus = function handleFocus() {\n this.on(this.bar.el_.ownerDocument, 'keydown', this.handleKeyPress);\n };\n /**\n * Handle a `keydown` event on the `Slider`. Watches for left, rigth, up, and down\n * arrow keys. This function will only be called when the slider has focus. See\n * {@link Slider#handleFocus} and {@link Slider#handleBlur}.\n *\n * @param {EventTarget~Event} event\n * the `keydown` event that caused this function to run.\n *\n * @listens keydown\n */\n\n\n _proto.handleKeyPress = function handleKeyPress(event) {\n // Left and Down Arrows\n if (event.which === 37 || event.which === 40) {\n event.preventDefault();\n this.stepBack(); // Up and Right Arrows\n } else if (event.which === 38 || event.which === 39) {\n event.preventDefault();\n this.stepForward();\n }\n };\n /**\n * Handle a `blur` event on this `Slider`.\n *\n * @param {EventTarget~Event} event\n * The `blur` event that caused this function to run.\n *\n * @listens blur\n */\n\n\n _proto.handleBlur = function handleBlur() {\n this.off(this.bar.el_.ownerDocument, 'keydown', this.handleKeyPress);\n };\n /**\n * Listener for click events on slider, used to prevent clicks\n * from bubbling up to parent elements like button menus.\n *\n * @param {Object} event\n * Event that caused this object to run\n */\n\n\n _proto.handleClick = function handleClick(event) {\n event.stopImmediatePropagation();\n event.preventDefault();\n };\n /**\n * Get/set if slider is horizontal for vertical\n *\n * @param {boolean} [bool]\n * - true if slider is vertical,\n * - false is horizontal\n *\n * @return {boolean}\n * - true if slider is vertical, and getting\n * - false if the slider is horizontal, and getting\n */\n\n\n _proto.vertical = function vertical(bool) {\n if (bool === undefined) {\n return this.vertical_ || false;\n }\n\n this.vertical_ = !!bool;\n\n if (this.vertical_) {\n this.addClass('vjs-slider-vertical');\n } else {\n this.addClass('vjs-slider-horizontal');\n }\n };\n\n return Slider;\n}(Component);\n\nComponent.registerComponent('Slider', Slider);\n\n/**\n * Shows loading progress\n *\n * @extends Component\n */\n\nvar LoadProgressBar =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(LoadProgressBar, _Component);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function LoadProgressBar(player, options) {\n var _this;\n\n _this = _Component.call(this, player, options) || this;\n _this.partEls_ = [];\n\n _this.on(player, 'progress', _this.update);\n\n return _this;\n }\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n var _proto = LoadProgressBar.prototype;\n\n _proto.createEl = function createEl$$1() {\n return _Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-load-progress',\n innerHTML: \"<span class=\\\"vjs-control-text\\\"><span>\" + this.localize('Loaded') + \"</span>: <span class=\\\"vjs-control-text-loaded-percentage\\\">0%</span></span>\"\n });\n };\n\n _proto.dispose = function dispose() {\n this.partEls_ = null;\n\n _Component.prototype.dispose.call(this);\n };\n /**\n * Update progress bar\n *\n * @param {EventTarget~Event} [event]\n * The `progress` event that caused this function to run.\n *\n * @listens Player#progress\n */\n\n\n _proto.update = function update(event) {\n var liveTracker = this.player_.liveTracker;\n var buffered = this.player_.buffered();\n var duration = liveTracker && liveTracker.isLive() ? liveTracker.seekableEnd() : this.player_.duration();\n var bufferedEnd = this.player_.bufferedEnd();\n var children = this.partEls_;\n var controlTextPercentage = this.$('.vjs-control-text-loaded-percentage'); // get the percent width of a time compared to the total end\n\n var percentify = function percentify(time, end, rounded) {\n // no NaN\n var percent = time / end || 0;\n percent = (percent >= 1 ? 1 : percent) * 100;\n\n if (rounded) {\n percent = percent.toFixed(2);\n }\n\n return percent + '%';\n }; // update the width of the progress bar\n\n\n this.el_.style.width = percentify(bufferedEnd, duration); // update the control-text\n\n textContent(controlTextPercentage, percentify(bufferedEnd, duration, true)); // add child elements to represent the individual buffered time ranges\n\n for (var i = 0; i < buffered.length; i++) {\n var start = buffered.start(i);\n var end = buffered.end(i);\n var part = children[i];\n\n if (!part) {\n part = this.el_.appendChild(createEl());\n children[i] = part;\n } // set the percent based on the width of the progress bar (bufferedEnd)\n\n\n part.style.left = percentify(start, bufferedEnd);\n part.style.width = percentify(end - start, bufferedEnd);\n } // remove unused buffered range elements\n\n\n for (var _i = children.length; _i > buffered.length; _i--) {\n this.el_.removeChild(children[_i - 1]);\n }\n\n children.length = buffered.length;\n };\n\n return LoadProgressBar;\n}(Component);\n\nComponent.registerComponent('LoadProgressBar', LoadProgressBar);\n\n/**\n * Time tooltips display a time above the progress bar.\n *\n * @extends Component\n */\n\nvar TimeTooltip =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(TimeTooltip, _Component);\n\n function TimeTooltip() {\n return _Component.apply(this, arguments) || this;\n }\n\n var _proto = TimeTooltip.prototype;\n\n /**\n * Create the time tooltip DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n _proto.createEl = function createEl$$1() {\n return _Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-time-tooltip'\n }, {\n 'aria-hidden': 'true'\n });\n };\n /**\n * Updates the position of the time tooltip relative to the `SeekBar`.\n *\n * @param {Object} seekBarRect\n * The `ClientRect` for the {@link SeekBar} element.\n *\n * @param {number} seekBarPoint\n * A number from 0 to 1, representing a horizontal reference point\n * from the left edge of the {@link SeekBar}\n */\n\n\n _proto.update = function update(seekBarRect, seekBarPoint, content) {\n var tooltipRect = getBoundingClientRect(this.el_);\n var playerRect = getBoundingClientRect(this.player_.el());\n var seekBarPointPx = seekBarRect.width * seekBarPoint; // do nothing if either rect isn't available\n // for example, if the player isn't in the DOM for testing\n\n if (!playerRect || !tooltipRect) {\n return;\n } // This is the space left of the `seekBarPoint` available within the bounds\n // of the player. We calculate any gap between the left edge of the player\n // and the left edge of the `SeekBar` and add the number of pixels in the\n // `SeekBar` before hitting the `seekBarPoint`\n\n\n var spaceLeftOfPoint = seekBarRect.left - playerRect.left + seekBarPointPx; // This is the space right of the `seekBarPoint` available within the bounds\n // of the player. We calculate the number of pixels from the `seekBarPoint`\n // to the right edge of the `SeekBar` and add to that any gap between the\n // right edge of the `SeekBar` and the player.\n\n var spaceRightOfPoint = seekBarRect.width - seekBarPointPx + (playerRect.right - seekBarRect.right); // This is the number of pixels by which the tooltip will need to be pulled\n // further to the right to center it over the `seekBarPoint`.\n\n var pullTooltipBy = tooltipRect.width / 2; // Adjust the `pullTooltipBy` distance to the left or right depending on\n // the results of the space calculations above.\n\n if (spaceLeftOfPoint < pullTooltipBy) {\n pullTooltipBy += pullTooltipBy - spaceLeftOfPoint;\n } else if (spaceRightOfPoint < pullTooltipBy) {\n pullTooltipBy = spaceRightOfPoint;\n } // Due to the imprecision of decimal/ratio based calculations and varying\n // rounding behaviors, there are cases where the spacing adjustment is off\n // by a pixel or two. This adds insurance to these calculations.\n\n\n if (pullTooltipBy < 0) {\n pullTooltipBy = 0;\n } else if (pullTooltipBy > tooltipRect.width) {\n pullTooltipBy = tooltipRect.width;\n }\n\n this.el_.style.right = \"-\" + pullTooltipBy + \"px\";\n textContent(this.el_, content);\n };\n /**\n * Updates the position of the time tooltip relative to the `SeekBar`.\n *\n * @param {Object} seekBarRect\n * The `ClientRect` for the {@link SeekBar} element.\n *\n * @param {number} seekBarPoint\n * A number from 0 to 1, representing a horizontal reference point\n * from the left edge of the {@link SeekBar}\n *\n * @param {number} time\n * The time to update the tooltip to, not used during live playback\n *\n * @param {Function} cb\n * A function that will be called during the request animation frame\n * for tooltips that need to do additional animations from the default\n */\n\n\n _proto.updateTime = function updateTime(seekBarRect, seekBarPoint, time, cb) {\n var _this = this;\n\n // If there is an existing rAF ID, cancel it so we don't over-queue.\n if (this.rafId_) {\n this.cancelAnimationFrame(this.rafId_);\n }\n\n this.rafId_ = this.requestAnimationFrame(function () {\n var content;\n\n var duration = _this.player_.duration();\n\n if (_this.player_.liveTracker && _this.player_.liveTracker.isLive()) {\n var liveWindow = _this.player_.liveTracker.liveWindow();\n\n var secondsBehind = liveWindow - seekBarPoint * liveWindow;\n content = (secondsBehind < 1 ? '' : '-') + formatTime(secondsBehind, liveWindow);\n } else {\n content = formatTime(time, duration);\n }\n\n _this.update(seekBarRect, seekBarPoint, content);\n\n if (cb) {\n cb();\n }\n });\n };\n\n return TimeTooltip;\n}(Component);\n\nComponent.registerComponent('TimeTooltip', TimeTooltip);\n\n/**\n * Used by {@link SeekBar} to display media playback progress as part of the\n * {@link ProgressControl}.\n *\n * @extends Component\n */\n\nvar PlayProgressBar =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(PlayProgressBar, _Component);\n\n function PlayProgressBar() {\n return _Component.apply(this, arguments) || this;\n }\n\n var _proto = PlayProgressBar.prototype;\n\n /**\n * Create the the DOM element for this class.\n *\n * @return {Element}\n * The element that was created.\n */\n _proto.createEl = function createEl() {\n return _Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-play-progress vjs-slider-bar'\n }, {\n 'aria-hidden': 'true'\n });\n };\n /**\n * Enqueues updates to its own DOM as well as the DOM of its\n * {@link TimeTooltip} child.\n *\n * @param {Object} seekBarRect\n * The `ClientRect` for the {@link SeekBar} element.\n *\n * @param {number} seekBarPoint\n * A number from 0 to 1, representing a horizontal reference point\n * from the left edge of the {@link SeekBar}\n */\n\n\n _proto.update = function update(seekBarRect, seekBarPoint) {\n var timeTooltip = this.getChild('timeTooltip');\n\n if (!timeTooltip) {\n return;\n }\n\n var time = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime();\n timeTooltip.updateTime(seekBarRect, seekBarPoint, time);\n };\n\n return PlayProgressBar;\n}(Component);\n/**\n * Default options for {@link PlayProgressBar}.\n *\n * @type {Object}\n * @private\n */\n\n\nPlayProgressBar.prototype.options_ = {\n children: []\n}; // Time tooltips should not be added to a player on mobile devices\n\nif (!IS_IOS && !IS_ANDROID) {\n PlayProgressBar.prototype.options_.children.push('timeTooltip');\n}\n\nComponent.registerComponent('PlayProgressBar', PlayProgressBar);\n\n/**\n * The {@link MouseTimeDisplay} component tracks mouse movement over the\n * {@link ProgressControl}. It displays an indicator and a {@link TimeTooltip}\n * indicating the time which is represented by a given point in the\n * {@link ProgressControl}.\n *\n * @extends Component\n */\n\nvar MouseTimeDisplay =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(MouseTimeDisplay, _Component);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The {@link Player} that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function MouseTimeDisplay(player, options) {\n var _this;\n\n _this = _Component.call(this, player, options) || this;\n _this.update = throttle(bind(_assertThisInitialized(_assertThisInitialized(_this)), _this.update), 25);\n return _this;\n }\n /**\n * Create the DOM element for this class.\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n var _proto = MouseTimeDisplay.prototype;\n\n _proto.createEl = function createEl() {\n return _Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-mouse-display'\n });\n };\n /**\n * Enqueues updates to its own DOM as well as the DOM of its\n * {@link TimeTooltip} child.\n *\n * @param {Object} seekBarRect\n * The `ClientRect` for the {@link SeekBar} element.\n *\n * @param {number} seekBarPoint\n * A number from 0 to 1, representing a horizontal reference point\n * from the left edge of the {@link SeekBar}\n */\n\n\n _proto.update = function update(seekBarRect, seekBarPoint) {\n var _this2 = this;\n\n var time = seekBarPoint * this.player_.duration();\n this.getChild('timeTooltip').updateTime(seekBarRect, seekBarPoint, time, function () {\n _this2.el_.style.left = seekBarRect.width * seekBarPoint + \"px\";\n });\n };\n\n return MouseTimeDisplay;\n}(Component);\n/**\n * Default options for `MouseTimeDisplay`\n *\n * @type {Object}\n * @private\n */\n\n\nMouseTimeDisplay.prototype.options_ = {\n children: ['timeTooltip']\n};\nComponent.registerComponent('MouseTimeDisplay', MouseTimeDisplay);\n\nvar STEP_SECONDS = 5; // The interval at which the bar should update as it progresses.\n\nvar UPDATE_REFRESH_INTERVAL = 30;\n/**\n * Seek bar and container for the progress bars. Uses {@link PlayProgressBar}\n * as its `bar`.\n *\n * @extends Slider\n */\n\nvar SeekBar =\n/*#__PURE__*/\nfunction (_Slider) {\n _inheritsLoose(SeekBar, _Slider);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function SeekBar(player, options) {\n var _this;\n\n _this = _Slider.call(this, player, options) || this;\n\n _this.setEventHandlers_();\n\n return _this;\n }\n /**\n * Sets the event handlers\n *\n * @private\n */\n\n\n var _proto = SeekBar.prototype;\n\n _proto.setEventHandlers_ = function setEventHandlers_() {\n var _this2 = this;\n\n this.update = throttle(bind(this, this.update), UPDATE_REFRESH_INTERVAL);\n this.on(this.player_, 'timeupdate', this.update);\n this.on(this.player_, 'ended', this.handleEnded);\n this.on(this.player_, 'durationchange', this.update);\n\n if (this.player_.liveTracker) {\n this.on(this.player_.liveTracker, 'liveedgechange', this.update);\n } // when playing, let's ensure we smoothly update the play progress bar\n // via an interval\n\n\n this.updateInterval = null;\n this.on(this.player_, ['playing'], function () {\n _this2.clearInterval(_this2.updateInterval);\n\n _this2.updateInterval = _this2.setInterval(function () {\n _this2.requestAnimationFrame(function () {\n _this2.update();\n });\n }, UPDATE_REFRESH_INTERVAL);\n });\n this.on(this.player_, ['ended', 'pause', 'waiting'], function (e) {\n if (_this2.player_.liveTracker && _this2.player_.liveTracker.isLive() && e.type !== 'ended') {\n return;\n }\n\n _this2.clearInterval(_this2.updateInterval);\n });\n this.on(this.player_, ['timeupdate', 'ended'], this.update);\n };\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n _proto.createEl = function createEl$$1() {\n return _Slider.prototype.createEl.call(this, 'div', {\n className: 'vjs-progress-holder'\n }, {\n 'aria-label': this.localize('Progress Bar')\n });\n };\n /**\n * This function updates the play progress bar and accessibility\n * attributes to whatever is passed in.\n *\n * @param {number} currentTime\n * The currentTime value that should be used for accessibility\n *\n * @param {number} percent\n * The percentage as a decimal that the bar should be filled from 0-1.\n *\n * @private\n */\n\n\n _proto.update_ = function update_(currentTime, percent) {\n var liveTracker = this.player_.liveTracker;\n var duration = this.player_.duration();\n\n if (liveTracker && liveTracker.isLive()) {\n duration = this.player_.liveTracker.liveCurrentTime();\n }\n\n if (liveTracker && liveTracker.seekableEnd() === Infinity) {\n this.disable();\n } else {\n this.enable();\n } // machine readable value of progress bar (percentage complete)\n\n\n this.el_.setAttribute('aria-valuenow', (percent * 100).toFixed(2)); // human readable value of progress bar (time complete)\n\n this.el_.setAttribute('aria-valuetext', this.localize('progress bar timing: currentTime={1} duration={2}', [formatTime(currentTime, duration), formatTime(duration, duration)], '{1} of {2}')); // Update the `PlayProgressBar`.\n\n this.bar.update(getBoundingClientRect(this.el_), percent);\n };\n /**\n * Update the seek bar's UI.\n *\n * @param {EventTarget~Event} [event]\n * The `timeupdate` or `ended` event that caused this to run.\n *\n * @listens Player#timeupdate\n *\n * @return {number}\n * The current percent at a number from 0-1\n */\n\n\n _proto.update = function update(event) {\n var percent = _Slider.prototype.update.call(this);\n\n this.update_(this.getCurrentTime_(), percent);\n return percent;\n };\n /**\n * Get the value of current time but allows for smooth scrubbing,\n * when player can't keep up.\n *\n * @return {number}\n * The current time value to display\n *\n * @private\n */\n\n\n _proto.getCurrentTime_ = function getCurrentTime_() {\n return this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime();\n };\n /**\n * We want the seek bar to be full on ended\n * no matter what the actual internal values are. so we force it.\n *\n * @param {EventTarget~Event} [event]\n * The `timeupdate` or `ended` event that caused this to run.\n *\n * @listens Player#ended\n */\n\n\n _proto.handleEnded = function handleEnded(event) {\n this.update_(this.player_.duration(), 1);\n };\n /**\n * Get the percentage of media played so far.\n *\n * @return {number}\n * The percentage of media played so far (0 to 1).\n */\n\n\n _proto.getPercent = function getPercent() {\n var currentTime = this.getCurrentTime_();\n var percent;\n var liveTracker = this.player_.liveTracker;\n\n if (liveTracker && liveTracker.isLive()) {\n percent = (currentTime - liveTracker.seekableStart()) / liveTracker.liveWindow(); // prevent the percent from changing at the live edge\n\n if (liveTracker.atLiveEdge()) {\n percent = 1;\n }\n } else {\n percent = currentTime / this.player_.duration();\n }\n\n return percent >= 1 ? 1 : percent || 0;\n };\n /**\n * Handle mouse down on seek bar\n *\n * @param {EventTarget~Event} event\n * The `mousedown` event that caused this to run.\n *\n * @listens mousedown\n */\n\n\n _proto.handleMouseDown = function handleMouseDown(event) {\n if (!isSingleLeftClick(event)) {\n return;\n } // Stop event propagation to prevent double fire in progress-control.js\n\n\n event.stopPropagation();\n this.player_.scrubbing(true);\n this.videoWasPlaying = !this.player_.paused();\n this.player_.pause();\n\n _Slider.prototype.handleMouseDown.call(this, event);\n };\n /**\n * Handle mouse move on seek bar\n *\n * @param {EventTarget~Event} event\n * The `mousemove` event that caused this to run.\n *\n * @listens mousemove\n */\n\n\n _proto.handleMouseMove = function handleMouseMove(event) {\n if (!isSingleLeftClick(event)) {\n return;\n }\n\n var newTime;\n var distance = this.calculateDistance(event);\n var liveTracker = this.player_.liveTracker;\n\n if (!liveTracker || !liveTracker.isLive()) {\n newTime = distance * this.player_.duration(); // Don't let video end while scrubbing.\n\n if (newTime === this.player_.duration()) {\n newTime = newTime - 0.1;\n }\n } else {\n var seekableStart = liveTracker.seekableStart();\n var seekableEnd = liveTracker.liveCurrentTime();\n newTime = seekableStart + distance * liveTracker.liveWindow(); // Don't let video end while scrubbing.\n\n if (newTime >= seekableEnd) {\n newTime = seekableEnd;\n } // Compensate for precision differences so that currentTime is not less\n // than seekable start\n\n\n if (newTime <= seekableStart) {\n newTime = seekableStart + 0.1;\n } // On android seekableEnd can be Infinity sometimes,\n // this will cause newTime to be Infinity, which is\n // not a valid currentTime.\n\n\n if (newTime === Infinity) {\n return;\n }\n } // Set new time (tell player to seek to new time)\n\n\n this.player_.currentTime(newTime);\n };\n\n _proto.enable = function enable() {\n _Slider.prototype.enable.call(this);\n\n var mouseTimeDisplay = this.getChild('mouseTimeDisplay');\n\n if (!mouseTimeDisplay) {\n return;\n }\n\n mouseTimeDisplay.show();\n };\n\n _proto.disable = function disable() {\n _Slider.prototype.disable.call(this);\n\n var mouseTimeDisplay = this.getChild('mouseTimeDisplay');\n\n if (!mouseTimeDisplay) {\n return;\n }\n\n mouseTimeDisplay.hide();\n };\n /**\n * Handle mouse up on seek bar\n *\n * @param {EventTarget~Event} event\n * The `mouseup` event that caused this to run.\n *\n * @listens mouseup\n */\n\n\n _proto.handleMouseUp = function handleMouseUp(event) {\n _Slider.prototype.handleMouseUp.call(this, event); // Stop event propagation to prevent double fire in progress-control.js\n\n\n if (event) {\n event.stopPropagation();\n }\n\n this.player_.scrubbing(false);\n /**\n * Trigger timeupdate because we're done seeking and the time has changed.\n * This is particularly useful for if the player is paused to time the time displays.\n *\n * @event Tech#timeupdate\n * @type {EventTarget~Event}\n */\n\n this.player_.trigger({\n type: 'timeupdate',\n target: this,\n manuallyTriggered: true\n });\n\n if (this.videoWasPlaying) {\n silencePromise(this.player_.play());\n }\n };\n /**\n * Move more quickly fast forward for keyboard-only users\n */\n\n\n _proto.stepForward = function stepForward() {\n this.player_.currentTime(this.player_.currentTime() + STEP_SECONDS);\n };\n /**\n * Move more quickly rewind for keyboard-only users\n */\n\n\n _proto.stepBack = function stepBack() {\n this.player_.currentTime(this.player_.currentTime() - STEP_SECONDS);\n };\n /**\n * Toggles the playback state of the player\n * This gets called when enter or space is used on the seekbar\n *\n * @param {EventTarget~Event} event\n * The `keydown` event that caused this function to be called\n *\n */\n\n\n _proto.handleAction = function handleAction(event) {\n if (this.player_.paused()) {\n this.player_.play();\n } else {\n this.player_.pause();\n }\n };\n /**\n * Called when this SeekBar has focus and a key gets pressed down. By\n * default it will call `this.handleAction` when the key is space or enter.\n *\n * @param {EventTarget~Event} event\n * The `keydown` event that caused this function to be called.\n *\n * @listens keydown\n */\n\n\n _proto.handleKeyPress = function handleKeyPress(event) {\n // Support Space (32) or Enter (13) key operation to fire a click event\n if (event.which === 32 || event.which === 13) {\n event.preventDefault();\n this.handleAction(event);\n } else if (_Slider.prototype.handleKeyPress) {\n // Pass keypress handling up for unsupported keys\n _Slider.prototype.handleKeyPress.call(this, event);\n }\n };\n\n return SeekBar;\n}(Slider);\n/**\n * Default options for the `SeekBar`\n *\n * @type {Object}\n * @private\n */\n\n\nSeekBar.prototype.options_ = {\n children: ['loadProgressBar', 'playProgressBar'],\n barName: 'playProgressBar'\n}; // MouseTimeDisplay tooltips should not be added to a player on mobile devices\n\nif (!IS_IOS && !IS_ANDROID) {\n SeekBar.prototype.options_.children.splice(1, 0, 'mouseTimeDisplay');\n}\n/**\n * Call the update event for this Slider when this event happens on the player.\n *\n * @type {string}\n */\n\n\nSeekBar.prototype.playerEvent = 'timeupdate';\nComponent.registerComponent('SeekBar', SeekBar);\n\n/**\n * The Progress Control component contains the seek bar, load progress,\n * and play progress.\n *\n * @extends Component\n */\n\nvar ProgressControl =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(ProgressControl, _Component);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function ProgressControl(player, options) {\n var _this;\n\n _this = _Component.call(this, player, options) || this;\n _this.handleMouseMove = throttle(bind(_assertThisInitialized(_assertThisInitialized(_this)), _this.handleMouseMove), 25);\n _this.throttledHandleMouseSeek = throttle(bind(_assertThisInitialized(_assertThisInitialized(_this)), _this.handleMouseSeek), 25);\n\n _this.enable();\n\n return _this;\n }\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n var _proto = ProgressControl.prototype;\n\n _proto.createEl = function createEl$$1() {\n return _Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-progress-control vjs-control'\n });\n };\n /**\n * When the mouse moves over the `ProgressControl`, the pointer position\n * gets passed down to the `MouseTimeDisplay` component.\n *\n * @param {EventTarget~Event} event\n * The `mousemove` event that caused this function to run.\n *\n * @listen mousemove\n */\n\n\n _proto.handleMouseMove = function handleMouseMove(event) {\n var seekBar = this.getChild('seekBar');\n\n if (seekBar) {\n var mouseTimeDisplay = seekBar.getChild('mouseTimeDisplay');\n var seekBarEl = seekBar.el();\n var seekBarRect = getBoundingClientRect(seekBarEl);\n var seekBarPoint = getPointerPosition(seekBarEl, event).x; // The default skin has a gap on either side of the `SeekBar`. This means\n // that it's possible to trigger this behavior outside the boundaries of\n // the `SeekBar`. This ensures we stay within it at all times.\n\n if (seekBarPoint > 1) {\n seekBarPoint = 1;\n } else if (seekBarPoint < 0) {\n seekBarPoint = 0;\n }\n\n if (mouseTimeDisplay) {\n mouseTimeDisplay.update(seekBarRect, seekBarPoint);\n }\n }\n };\n /**\n * A throttled version of the {@link ProgressControl#handleMouseSeek} listener.\n *\n * @method ProgressControl#throttledHandleMouseSeek\n * @param {EventTarget~Event} event\n * The `mousemove` event that caused this function to run.\n *\n * @listen mousemove\n * @listen touchmove\n */\n\n /**\n * Handle `mousemove` or `touchmove` events on the `ProgressControl`.\n *\n * @param {EventTarget~Event} event\n * `mousedown` or `touchstart` event that triggered this function\n *\n * @listens mousemove\n * @listens touchmove\n */\n\n\n _proto.handleMouseSeek = function handleMouseSeek(event) {\n var seekBar = this.getChild('seekBar');\n\n if (seekBar) {\n seekBar.handleMouseMove(event);\n }\n };\n /**\n * Are controls are currently enabled for this progress control.\n *\n * @return {boolean}\n * true if controls are enabled, false otherwise\n */\n\n\n _proto.enabled = function enabled() {\n return this.enabled_;\n };\n /**\n * Disable all controls on the progress control and its children\n */\n\n\n _proto.disable = function disable() {\n this.children().forEach(function (child) {\n return child.disable && child.disable();\n });\n\n if (!this.enabled()) {\n return;\n }\n\n this.off(['mousedown', 'touchstart'], this.handleMouseDown);\n this.off(this.el_, 'mousemove', this.handleMouseMove);\n this.handleMouseUp();\n this.addClass('disabled');\n this.enabled_ = false;\n };\n /**\n * Enable all controls on the progress control and its children\n */\n\n\n _proto.enable = function enable() {\n this.children().forEach(function (child) {\n return child.enable && child.enable();\n });\n\n if (this.enabled()) {\n return;\n }\n\n this.on(['mousedown', 'touchstart'], this.handleMouseDown);\n this.on(this.el_, 'mousemove', this.handleMouseMove);\n this.removeClass('disabled');\n this.enabled_ = true;\n };\n /**\n * Handle `mousedown` or `touchstart` events on the `ProgressControl`.\n *\n * @param {EventTarget~Event} event\n * `mousedown` or `touchstart` event that triggered this function\n *\n * @listens mousedown\n * @listens touchstart\n */\n\n\n _proto.handleMouseDown = function handleMouseDown(event) {\n var doc = this.el_.ownerDocument;\n var seekBar = this.getChild('seekBar');\n\n if (seekBar) {\n seekBar.handleMouseDown(event);\n }\n\n this.on(doc, 'mousemove', this.throttledHandleMouseSeek);\n this.on(doc, 'touchmove', this.throttledHandleMouseSeek);\n this.on(doc, 'mouseup', this.handleMouseUp);\n this.on(doc, 'touchend', this.handleMouseUp);\n };\n /**\n * Handle `mouseup` or `touchend` events on the `ProgressControl`.\n *\n * @param {EventTarget~Event} event\n * `mouseup` or `touchend` event that triggered this function.\n *\n * @listens touchend\n * @listens mouseup\n */\n\n\n _proto.handleMouseUp = function handleMouseUp(event) {\n var doc = this.el_.ownerDocument;\n var seekBar = this.getChild('seekBar');\n\n if (seekBar) {\n seekBar.handleMouseUp(event);\n }\n\n this.off(doc, 'mousemove', this.throttledHandleMouseSeek);\n this.off(doc, 'touchmove', this.throttledHandleMouseSeek);\n this.off(doc, 'mouseup', this.handleMouseUp);\n this.off(doc, 'touchend', this.handleMouseUp);\n };\n\n return ProgressControl;\n}(Component);\n/**\n * Default options for `ProgressControl`\n *\n * @type {Object}\n * @private\n */\n\n\nProgressControl.prototype.options_ = {\n children: ['seekBar']\n};\nComponent.registerComponent('ProgressControl', ProgressControl);\n\n/**\n * Toggle fullscreen video\n *\n * @extends Button\n */\n\nvar FullscreenToggle =\n/*#__PURE__*/\nfunction (_Button) {\n _inheritsLoose(FullscreenToggle, _Button);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function FullscreenToggle(player, options) {\n var _this;\n\n _this = _Button.call(this, player, options) || this;\n\n _this.on(player, 'fullscreenchange', _this.handleFullscreenChange);\n\n if (document[FullscreenApi.fullscreenEnabled] === false) {\n _this.disable();\n }\n\n return _this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n var _proto = FullscreenToggle.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-fullscreen-control \" + _Button.prototype.buildCSSClass.call(this);\n };\n /**\n * Handles fullscreenchange on the player and change control text accordingly.\n *\n * @param {EventTarget~Event} [event]\n * The {@link Player#fullscreenchange} event that caused this function to be\n * called.\n *\n * @listens Player#fullscreenchange\n */\n\n\n _proto.handleFullscreenChange = function handleFullscreenChange(event) {\n if (this.player_.isFullscreen()) {\n this.controlText('Non-Fullscreen');\n } else {\n this.controlText('Fullscreen');\n }\n };\n /**\n * This gets called when an `FullscreenToggle` is \"clicked\". See\n * {@link ClickableComponent} for more detailed information on what a click can be.\n *\n * @param {EventTarget~Event} [event]\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n\n\n _proto.handleClick = function handleClick(event) {\n if (!this.player_.isFullscreen()) {\n this.player_.requestFullscreen();\n } else {\n this.player_.exitFullscreen();\n }\n };\n\n return FullscreenToggle;\n}(Button);\n/**\n * The text that should display over the `FullscreenToggle`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\n\nFullscreenToggle.prototype.controlText_ = 'Fullscreen';\nComponent.registerComponent('FullscreenToggle', FullscreenToggle);\n\n/**\n * Check if volume control is supported and if it isn't hide the\n * `Component` that was passed using the `vjs-hidden` class.\n *\n * @param {Component} self\n * The component that should be hidden if volume is unsupported\n *\n * @param {Player} player\n * A reference to the player\n *\n * @private\n */\nvar checkVolumeSupport = function checkVolumeSupport(self, player) {\n // hide volume controls when they're not supported by the current tech\n if (player.tech_ && !player.tech_.featuresVolumeControl) {\n self.addClass('vjs-hidden');\n }\n\n self.on(player, 'loadstart', function () {\n if (!player.tech_.featuresVolumeControl) {\n self.addClass('vjs-hidden');\n } else {\n self.removeClass('vjs-hidden');\n }\n });\n};\n\n/**\n * Shows volume level\n *\n * @extends Component\n */\n\nvar VolumeLevel =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(VolumeLevel, _Component);\n\n function VolumeLevel() {\n return _Component.apply(this, arguments) || this;\n }\n\n var _proto = VolumeLevel.prototype;\n\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n _proto.createEl = function createEl() {\n return _Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-volume-level',\n innerHTML: '<span class=\"vjs-control-text\"></span>'\n });\n };\n\n return VolumeLevel;\n}(Component);\n\nComponent.registerComponent('VolumeLevel', VolumeLevel);\n\n/**\n * The bar that contains the volume level and can be clicked on to adjust the level\n *\n * @extends Slider\n */\n\nvar VolumeBar =\n/*#__PURE__*/\nfunction (_Slider) {\n _inheritsLoose(VolumeBar, _Slider);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function VolumeBar(player, options) {\n var _this;\n\n _this = _Slider.call(this, player, options) || this;\n\n _this.on('slideractive', _this.updateLastVolume_);\n\n _this.on(player, 'volumechange', _this.updateARIAAttributes);\n\n player.ready(function () {\n return _this.updateARIAAttributes();\n });\n return _this;\n }\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n var _proto = VolumeBar.prototype;\n\n _proto.createEl = function createEl$$1() {\n return _Slider.prototype.createEl.call(this, 'div', {\n className: 'vjs-volume-bar vjs-slider-bar'\n }, {\n 'aria-label': this.localize('Volume Level'),\n 'aria-live': 'polite'\n });\n };\n /**\n * Handle mouse down on volume bar\n *\n * @param {EventTarget~Event} event\n * The `mousedown` event that caused this to run.\n *\n * @listens mousedown\n */\n\n\n _proto.handleMouseDown = function handleMouseDown(event) {\n if (!isSingleLeftClick(event)) {\n return;\n }\n\n _Slider.prototype.handleMouseDown.call(this, event);\n };\n /**\n * Handle movement events on the {@link VolumeMenuButton}.\n *\n * @param {EventTarget~Event} event\n * The event that caused this function to run.\n *\n * @listens mousemove\n */\n\n\n _proto.handleMouseMove = function handleMouseMove(event) {\n if (!isSingleLeftClick(event)) {\n return;\n }\n\n this.checkMuted();\n this.player_.volume(this.calculateDistance(event));\n };\n /**\n * If the player is muted unmute it.\n */\n\n\n _proto.checkMuted = function checkMuted() {\n if (this.player_.muted()) {\n this.player_.muted(false);\n }\n };\n /**\n * Get percent of volume level\n *\n * @return {number}\n * Volume level percent as a decimal number.\n */\n\n\n _proto.getPercent = function getPercent() {\n if (this.player_.muted()) {\n return 0;\n }\n\n return this.player_.volume();\n };\n /**\n * Increase volume level for keyboard users\n */\n\n\n _proto.stepForward = function stepForward() {\n this.checkMuted();\n this.player_.volume(this.player_.volume() + 0.1);\n };\n /**\n * Decrease volume level for keyboard users\n */\n\n\n _proto.stepBack = function stepBack() {\n this.checkMuted();\n this.player_.volume(this.player_.volume() - 0.1);\n };\n /**\n * Update ARIA accessibility attributes\n *\n * @param {EventTarget~Event} [event]\n * The `volumechange` event that caused this function to run.\n *\n * @listens Player#volumechange\n */\n\n\n _proto.updateARIAAttributes = function updateARIAAttributes(event) {\n var ariaValue = this.player_.muted() ? 0 : this.volumeAsPercentage_();\n this.el_.setAttribute('aria-valuenow', ariaValue);\n this.el_.setAttribute('aria-valuetext', ariaValue + '%');\n };\n /**\n * Returns the current value of the player volume as a percentage\n *\n * @private\n */\n\n\n _proto.volumeAsPercentage_ = function volumeAsPercentage_() {\n return Math.round(this.player_.volume() * 100);\n };\n /**\n * When user starts dragging the VolumeBar, store the volume and listen for\n * the end of the drag. When the drag ends, if the volume was set to zero,\n * set lastVolume to the stored volume.\n *\n * @listens slideractive\n * @private\n */\n\n\n _proto.updateLastVolume_ = function updateLastVolume_() {\n var _this2 = this;\n\n var volumeBeforeDrag = this.player_.volume();\n this.one('sliderinactive', function () {\n if (_this2.player_.volume() === 0) {\n _this2.player_.lastVolume_(volumeBeforeDrag);\n }\n });\n };\n\n return VolumeBar;\n}(Slider);\n/**\n * Default options for the `VolumeBar`\n *\n * @type {Object}\n * @private\n */\n\n\nVolumeBar.prototype.options_ = {\n children: ['volumeLevel'],\n barName: 'volumeLevel'\n};\n/**\n * Call the update event for this Slider when this event happens on the player.\n *\n * @type {string}\n */\n\nVolumeBar.prototype.playerEvent = 'volumechange';\nComponent.registerComponent('VolumeBar', VolumeBar);\n\n/**\n * The component for controlling the volume level\n *\n * @extends Component\n */\n\nvar VolumeControl =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(VolumeControl, _Component);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options={}]\n * The key/value store of player options.\n */\n function VolumeControl(player, options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n options.vertical = options.vertical || false; // Pass the vertical option down to the VolumeBar if\n // the VolumeBar is turned on.\n\n if (typeof options.volumeBar === 'undefined' || isPlain(options.volumeBar)) {\n options.volumeBar = options.volumeBar || {};\n options.volumeBar.vertical = options.vertical;\n }\n\n _this = _Component.call(this, player, options) || this; // hide this control if volume support is missing\n\n checkVolumeSupport(_assertThisInitialized(_assertThisInitialized(_this)), player);\n _this.throttledHandleMouseMove = throttle(bind(_assertThisInitialized(_assertThisInitialized(_this)), _this.handleMouseMove), 25);\n\n _this.on('mousedown', _this.handleMouseDown);\n\n _this.on('touchstart', _this.handleMouseDown); // while the slider is active (the mouse has been pressed down and\n // is dragging) or in focus we do not want to hide the VolumeBar\n\n\n _this.on(_this.volumeBar, ['focus', 'slideractive'], function () {\n _this.volumeBar.addClass('vjs-slider-active');\n\n _this.addClass('vjs-slider-active');\n\n _this.trigger('slideractive');\n });\n\n _this.on(_this.volumeBar, ['blur', 'sliderinactive'], function () {\n _this.volumeBar.removeClass('vjs-slider-active');\n\n _this.removeClass('vjs-slider-active');\n\n _this.trigger('sliderinactive');\n });\n\n return _this;\n }\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n var _proto = VolumeControl.prototype;\n\n _proto.createEl = function createEl() {\n var orientationClass = 'vjs-volume-horizontal';\n\n if (this.options_.vertical) {\n orientationClass = 'vjs-volume-vertical';\n }\n\n return _Component.prototype.createEl.call(this, 'div', {\n className: \"vjs-volume-control vjs-control \" + orientationClass\n });\n };\n /**\n * Handle `mousedown` or `touchstart` events on the `VolumeControl`.\n *\n * @param {EventTarget~Event} event\n * `mousedown` or `touchstart` event that triggered this function\n *\n * @listens mousedown\n * @listens touchstart\n */\n\n\n _proto.handleMouseDown = function handleMouseDown(event) {\n var doc = this.el_.ownerDocument;\n this.on(doc, 'mousemove', this.throttledHandleMouseMove);\n this.on(doc, 'touchmove', this.throttledHandleMouseMove);\n this.on(doc, 'mouseup', this.handleMouseUp);\n this.on(doc, 'touchend', this.handleMouseUp);\n };\n /**\n * Handle `mouseup` or `touchend` events on the `VolumeControl`.\n *\n * @param {EventTarget~Event} event\n * `mouseup` or `touchend` event that triggered this function.\n *\n * @listens touchend\n * @listens mouseup\n */\n\n\n _proto.handleMouseUp = function handleMouseUp(event) {\n var doc = this.el_.ownerDocument;\n this.off(doc, 'mousemove', this.throttledHandleMouseMove);\n this.off(doc, 'touchmove', this.throttledHandleMouseMove);\n this.off(doc, 'mouseup', this.handleMouseUp);\n this.off(doc, 'touchend', this.handleMouseUp);\n };\n /**\n * Handle `mousedown` or `touchstart` events on the `VolumeControl`.\n *\n * @param {EventTarget~Event} event\n * `mousedown` or `touchstart` event that triggered this function\n *\n * @listens mousedown\n * @listens touchstart\n */\n\n\n _proto.handleMouseMove = function handleMouseMove(event) {\n this.volumeBar.handleMouseMove(event);\n };\n\n return VolumeControl;\n}(Component);\n/**\n * Default options for the `VolumeControl`\n *\n * @type {Object}\n * @private\n */\n\n\nVolumeControl.prototype.options_ = {\n children: ['volumeBar']\n};\nComponent.registerComponent('VolumeControl', VolumeControl);\n\n/**\n * Check if muting volume is supported and if it isn't hide the mute toggle\n * button.\n *\n * @param {Component} self\n * A reference to the mute toggle button\n *\n * @param {Player} player\n * A reference to the player\n *\n * @private\n */\nvar checkMuteSupport = function checkMuteSupport(self, player) {\n // hide mute toggle button if it's not supported by the current tech\n if (player.tech_ && !player.tech_.featuresMuteControl) {\n self.addClass('vjs-hidden');\n }\n\n self.on(player, 'loadstart', function () {\n if (!player.tech_.featuresMuteControl) {\n self.addClass('vjs-hidden');\n } else {\n self.removeClass('vjs-hidden');\n }\n });\n};\n\n/**\n * A button component for muting the audio.\n *\n * @extends Button\n */\n\nvar MuteToggle =\n/*#__PURE__*/\nfunction (_Button) {\n _inheritsLoose(MuteToggle, _Button);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function MuteToggle(player, options) {\n var _this;\n\n _this = _Button.call(this, player, options) || this; // hide this control if volume support is missing\n\n checkMuteSupport(_assertThisInitialized(_assertThisInitialized(_this)), player);\n\n _this.on(player, ['loadstart', 'volumechange'], _this.update);\n\n return _this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n var _proto = MuteToggle.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-mute-control \" + _Button.prototype.buildCSSClass.call(this);\n };\n /**\n * This gets called when an `MuteToggle` is \"clicked\". See\n * {@link ClickableComponent} for more detailed information on what a click can be.\n *\n * @param {EventTarget~Event} [event]\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n\n\n _proto.handleClick = function handleClick(event) {\n var vol = this.player_.volume();\n var lastVolume = this.player_.lastVolume_();\n\n if (vol === 0) {\n var volumeToSet = lastVolume < 0.1 ? 0.1 : lastVolume;\n this.player_.volume(volumeToSet);\n this.player_.muted(false);\n } else {\n this.player_.muted(this.player_.muted() ? false : true);\n }\n };\n /**\n * Update the `MuteToggle` button based on the state of `volume` and `muted`\n * on the player.\n *\n * @param {EventTarget~Event} [event]\n * The {@link Player#loadstart} event if this function was called\n * through an event.\n *\n * @listens Player#loadstart\n * @listens Player#volumechange\n */\n\n\n _proto.update = function update(event) {\n this.updateIcon_();\n this.updateControlText_();\n };\n /**\n * Update the appearance of the `MuteToggle` icon.\n *\n * Possible states (given `level` variable below):\n * - 0: crossed out\n * - 1: zero bars of volume\n * - 2: one bar of volume\n * - 3: two bars of volume\n *\n * @private\n */\n\n\n _proto.updateIcon_ = function updateIcon_() {\n var vol = this.player_.volume();\n var level = 3; // in iOS when a player is loaded with muted attribute\n // and volume is changed with a native mute button\n // we want to make sure muted state is updated\n\n if (IS_IOS) {\n this.player_.muted(this.player_.tech_.el_.muted);\n }\n\n if (vol === 0 || this.player_.muted()) {\n level = 0;\n } else if (vol < 0.33) {\n level = 1;\n } else if (vol < 0.67) {\n level = 2;\n } // TODO improve muted icon classes\n\n\n for (var i = 0; i < 4; i++) {\n removeClass(this.el_, \"vjs-vol-\" + i);\n }\n\n addClass(this.el_, \"vjs-vol-\" + level);\n };\n /**\n * If `muted` has changed on the player, update the control text\n * (`title` attribute on `vjs-mute-control` element and content of\n * `vjs-control-text` element).\n *\n * @private\n */\n\n\n _proto.updateControlText_ = function updateControlText_() {\n var soundOff = this.player_.muted() || this.player_.volume() === 0;\n var text = soundOff ? 'Unmute' : 'Mute';\n\n if (this.controlText() !== text) {\n this.controlText(text);\n }\n };\n\n return MuteToggle;\n}(Button);\n/**\n * The text that should display over the `MuteToggle`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\n\nMuteToggle.prototype.controlText_ = 'Mute';\nComponent.registerComponent('MuteToggle', MuteToggle);\n\n/**\n * A Component to contain the MuteToggle and VolumeControl so that\n * they can work together.\n *\n * @extends Component\n */\n\nvar VolumePanel =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(VolumePanel, _Component);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options={}]\n * The key/value store of player options.\n */\n function VolumePanel(player, options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n if (typeof options.inline !== 'undefined') {\n options.inline = options.inline;\n } else {\n options.inline = true;\n } // pass the inline option down to the VolumeControl as vertical if\n // the VolumeControl is on.\n\n\n if (typeof options.volumeControl === 'undefined' || isPlain(options.volumeControl)) {\n options.volumeControl = options.volumeControl || {};\n options.volumeControl.vertical = !options.inline;\n }\n\n _this = _Component.call(this, player, options) || this;\n\n _this.on(player, ['loadstart'], _this.volumePanelState_); // while the slider is active (the mouse has been pressed down and\n // is dragging) we do not want to hide the VolumeBar\n\n\n _this.on(_this.volumeControl, ['slideractive'], _this.sliderActive_);\n\n _this.on(_this.volumeControl, ['sliderinactive'], _this.sliderInactive_);\n\n return _this;\n }\n /**\n * Add vjs-slider-active class to the VolumePanel\n *\n * @listens VolumeControl#slideractive\n * @private\n */\n\n\n var _proto = VolumePanel.prototype;\n\n _proto.sliderActive_ = function sliderActive_() {\n this.addClass('vjs-slider-active');\n };\n /**\n * Removes vjs-slider-active class to the VolumePanel\n *\n * @listens VolumeControl#sliderinactive\n * @private\n */\n\n\n _proto.sliderInactive_ = function sliderInactive_() {\n this.removeClass('vjs-slider-active');\n };\n /**\n * Adds vjs-hidden or vjs-mute-toggle-only to the VolumePanel\n * depending on MuteToggle and VolumeControl state\n *\n * @listens Player#loadstart\n * @private\n */\n\n\n _proto.volumePanelState_ = function volumePanelState_() {\n // hide volume panel if neither volume control or mute toggle\n // are displayed\n if (this.volumeControl.hasClass('vjs-hidden') && this.muteToggle.hasClass('vjs-hidden')) {\n this.addClass('vjs-hidden');\n } // if only mute toggle is visible we don't want\n // volume panel expanding when hovered or active\n\n\n if (this.volumeControl.hasClass('vjs-hidden') && !this.muteToggle.hasClass('vjs-hidden')) {\n this.addClass('vjs-mute-toggle-only');\n }\n };\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n _proto.createEl = function createEl() {\n var orientationClass = 'vjs-volume-panel-horizontal';\n\n if (!this.options_.inline) {\n orientationClass = 'vjs-volume-panel-vertical';\n }\n\n return _Component.prototype.createEl.call(this, 'div', {\n className: \"vjs-volume-panel vjs-control \" + orientationClass\n });\n };\n\n return VolumePanel;\n}(Component);\n/**\n * Default options for the `VolumeControl`\n *\n * @type {Object}\n * @private\n */\n\n\nVolumePanel.prototype.options_ = {\n children: ['muteToggle', 'volumeControl']\n};\nComponent.registerComponent('VolumePanel', VolumePanel);\n\n/**\n * The Menu component is used to build popup menus, including subtitle and\n * captions selection menus.\n *\n * @extends Component\n */\n\nvar Menu =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(Menu, _Component);\n\n /**\n * Create an instance of this class.\n *\n * @param {Player} player\n * the player that this component should attach to\n *\n * @param {Object} [options]\n * Object of option names and values\n *\n */\n function Menu(player, options) {\n var _this;\n\n _this = _Component.call(this, player, options) || this;\n\n if (options) {\n _this.menuButton_ = options.menuButton;\n }\n\n _this.focusedChild_ = -1;\n\n _this.on('keydown', _this.handleKeyPress);\n\n return _this;\n }\n /**\n * Add a {@link MenuItem} to the menu.\n *\n * @param {Object|string} component\n * The name or instance of the `MenuItem` to add.\n *\n */\n\n\n var _proto = Menu.prototype;\n\n _proto.addItem = function addItem(component) {\n this.addChild(component);\n component.on('blur', bind(this, this.handleBlur));\n component.on(['tap', 'click'], bind(this, function (event) {\n // Unpress the associated MenuButton, and move focus back to it\n if (this.menuButton_) {\n this.menuButton_.unpressButton(); // don't focus menu button if item is a caption settings item\n // because focus will move elsewhere\n\n if (component.name() !== 'CaptionSettingsMenuItem') {\n this.menuButton_.focus();\n }\n }\n }));\n };\n /**\n * Create the `Menu`s DOM element.\n *\n * @return {Element}\n * the element that was created\n */\n\n\n _proto.createEl = function createEl$$1() {\n var contentElType = this.options_.contentElType || 'ul';\n this.contentEl_ = createEl(contentElType, {\n className: 'vjs-menu-content'\n });\n this.contentEl_.setAttribute('role', 'menu');\n\n var el = _Component.prototype.createEl.call(this, 'div', {\n append: this.contentEl_,\n className: 'vjs-menu'\n });\n\n el.appendChild(this.contentEl_); // Prevent clicks from bubbling up. Needed for Menu Buttons,\n // where a click on the parent is significant\n\n on(el, 'click', function (event) {\n event.preventDefault();\n event.stopImmediatePropagation();\n });\n return el;\n };\n\n _proto.dispose = function dispose() {\n this.contentEl_ = null;\n\n _Component.prototype.dispose.call(this);\n };\n /**\n * Called when a `MenuItem` loses focus.\n *\n * @param {EventTarget~Event} event\n * The `blur` event that caused this function to be called.\n *\n * @listens blur\n */\n\n\n _proto.handleBlur = function handleBlur(event) {\n var relatedTarget = event.relatedTarget || document.activeElement; // Close menu popup when a user clicks outside the menu\n\n if (!this.children().some(function (element) {\n return element.el() === relatedTarget;\n })) {\n var btn = this.menuButton_;\n\n if (btn && btn.buttonPressed_ && relatedTarget !== btn.el().firstChild) {\n btn.unpressButton();\n }\n }\n };\n /**\n * Handle a `keydown` event on this menu. This listener is added in the constructor.\n *\n * @param {EventTarget~Event} event\n * A `keydown` event that happened on the menu.\n *\n * @listens keydown\n */\n\n\n _proto.handleKeyPress = function handleKeyPress(event) {\n // Left and Down Arrows\n if (event.which === 37 || event.which === 40) {\n event.preventDefault();\n this.stepForward(); // Up and Right Arrows\n } else if (event.which === 38 || event.which === 39) {\n event.preventDefault();\n this.stepBack();\n }\n };\n /**\n * Move to next (lower) menu item for keyboard users.\n */\n\n\n _proto.stepForward = function stepForward() {\n var stepChild = 0;\n\n if (this.focusedChild_ !== undefined) {\n stepChild = this.focusedChild_ + 1;\n }\n\n this.focus(stepChild);\n };\n /**\n * Move to previous (higher) menu item for keyboard users.\n */\n\n\n _proto.stepBack = function stepBack() {\n var stepChild = 0;\n\n if (this.focusedChild_ !== undefined) {\n stepChild = this.focusedChild_ - 1;\n }\n\n this.focus(stepChild);\n };\n /**\n * Set focus on a {@link MenuItem} in the `Menu`.\n *\n * @param {Object|string} [item=0]\n * Index of child item set focus on.\n */\n\n\n _proto.focus = function focus(item) {\n if (item === void 0) {\n item = 0;\n }\n\n var children = this.children().slice();\n var haveTitle = children.length && children[0].className && /vjs-menu-title/.test(children[0].className);\n\n if (haveTitle) {\n children.shift();\n }\n\n if (children.length > 0) {\n if (item < 0) {\n item = 0;\n } else if (item >= children.length) {\n item = children.length - 1;\n }\n\n this.focusedChild_ = item;\n children[item].el_.focus();\n }\n };\n\n return Menu;\n}(Component);\n\nComponent.registerComponent('Menu', Menu);\n\n/**\n * A `MenuButton` class for any popup {@link Menu}.\n *\n * @extends Component\n */\n\nvar MenuButton =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(MenuButton, _Component);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options={}]\n * The key/value store of player options.\n */\n function MenuButton(player, options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n _this = _Component.call(this, player, options) || this;\n _this.menuButton_ = new Button(player, options);\n\n _this.menuButton_.controlText(_this.controlText_);\n\n _this.menuButton_.el_.setAttribute('aria-haspopup', 'true'); // Add buildCSSClass values to the button, not the wrapper\n\n\n var buttonClass = Button.prototype.buildCSSClass();\n _this.menuButton_.el_.className = _this.buildCSSClass() + ' ' + buttonClass;\n\n _this.menuButton_.removeClass('vjs-control');\n\n _this.addChild(_this.menuButton_);\n\n _this.update();\n\n _this.enabled_ = true;\n\n _this.on(_this.menuButton_, 'tap', _this.handleClick);\n\n _this.on(_this.menuButton_, 'click', _this.handleClick);\n\n _this.on(_this.menuButton_, 'focus', _this.handleFocus);\n\n _this.on(_this.menuButton_, 'blur', _this.handleBlur);\n\n _this.on(_this.menuButton_, 'mouseenter', function () {\n _this.menu.show();\n });\n\n _this.on('keydown', _this.handleSubmenuKeyPress);\n\n return _this;\n }\n /**\n * Update the menu based on the current state of its items.\n */\n\n\n var _proto = MenuButton.prototype;\n\n _proto.update = function update() {\n var menu = this.createMenu();\n\n if (this.menu) {\n this.menu.dispose();\n this.removeChild(this.menu);\n }\n\n this.menu = menu;\n this.addChild(menu);\n /**\n * Track the state of the menu button\n *\n * @type {Boolean}\n * @private\n */\n\n this.buttonPressed_ = false;\n this.menuButton_.el_.setAttribute('aria-expanded', 'false');\n\n if (this.items && this.items.length <= this.hideThreshold_) {\n this.hide();\n } else {\n this.show();\n }\n };\n /**\n * Create the menu and add all items to it.\n *\n * @return {Menu}\n * The constructed menu\n */\n\n\n _proto.createMenu = function createMenu() {\n var menu = new Menu(this.player_, {\n menuButton: this\n });\n /**\n * Hide the menu if the number of items is less than or equal to this threshold. This defaults\n * to 0 and whenever we add items which can be hidden to the menu we'll increment it. We list\n * it here because every time we run `createMenu` we need to reset the value.\n *\n * @protected\n * @type {Number}\n */\n\n this.hideThreshold_ = 0; // Add a title list item to the top\n\n if (this.options_.title) {\n var title = createEl('li', {\n className: 'vjs-menu-title',\n innerHTML: toTitleCase(this.options_.title),\n tabIndex: -1\n });\n this.hideThreshold_ += 1;\n menu.children_.unshift(title);\n prependTo(title, menu.contentEl());\n }\n\n this.items = this.createItems();\n\n if (this.items) {\n // Add menu items to the menu\n for (var i = 0; i < this.items.length; i++) {\n menu.addItem(this.items[i]);\n }\n }\n\n return menu;\n };\n /**\n * Create the list of menu items. Specific to each subclass.\n *\n * @abstract\n */\n\n\n _proto.createItems = function createItems() {};\n /**\n * Create the `MenuButtons`s DOM element.\n *\n * @return {Element}\n * The element that gets created.\n */\n\n\n _proto.createEl = function createEl$$1() {\n return _Component.prototype.createEl.call(this, 'div', {\n className: this.buildWrapperCSSClass()\n }, {});\n };\n /**\n * Allow sub components to stack CSS class names for the wrapper element\n *\n * @return {string}\n * The constructed wrapper DOM `className`\n */\n\n\n _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {\n var menuButtonClass = 'vjs-menu-button'; // If the inline option is passed, we want to use different styles altogether.\n\n if (this.options_.inline === true) {\n menuButtonClass += '-inline';\n } else {\n menuButtonClass += '-popup';\n } // TODO: Fix the CSS so that this isn't necessary\n\n\n var buttonClass = Button.prototype.buildCSSClass();\n return \"vjs-menu-button \" + menuButtonClass + \" \" + buttonClass + \" \" + _Component.prototype.buildCSSClass.call(this);\n };\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n _proto.buildCSSClass = function buildCSSClass() {\n var menuButtonClass = 'vjs-menu-button'; // If the inline option is passed, we want to use different styles altogether.\n\n if (this.options_.inline === true) {\n menuButtonClass += '-inline';\n } else {\n menuButtonClass += '-popup';\n }\n\n return \"vjs-menu-button \" + menuButtonClass + \" \" + _Component.prototype.buildCSSClass.call(this);\n };\n /**\n * Get or set the localized control text that will be used for accessibility.\n *\n * > NOTE: This will come from the internal `menuButton_` element.\n *\n * @param {string} [text]\n * Control text for element.\n *\n * @param {Element} [el=this.menuButton_.el()]\n * Element to set the title on.\n *\n * @return {string}\n * - The control text when getting\n */\n\n\n _proto.controlText = function controlText(text, el) {\n if (el === void 0) {\n el = this.menuButton_.el();\n }\n\n return this.menuButton_.controlText(text, el);\n };\n /**\n * Handle a click on a `MenuButton`.\n * See {@link ClickableComponent#handleClick} for instances where this is called.\n *\n * @param {EventTarget~Event} event\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n\n\n _proto.handleClick = function handleClick(event) {\n if (this.buttonPressed_) {\n this.unpressButton();\n } else {\n this.pressButton();\n }\n };\n /**\n * Set the focus to the actual button, not to this element\n */\n\n\n _proto.focus = function focus() {\n this.menuButton_.focus();\n };\n /**\n * Remove the focus from the actual button, not this element\n */\n\n\n _proto.blur = function blur() {\n this.menuButton_.blur();\n };\n /**\n * This gets called when a `MenuButton` gains focus via a `focus` event.\n * Turns on listening for `keydown` events. When they happen it\n * calls `this.handleKeyPress`.\n *\n * @param {EventTarget~Event} event\n * The `focus` event that caused this function to be called.\n *\n * @listens focus\n */\n\n\n _proto.handleFocus = function handleFocus() {\n on(document, 'keydown', bind(this, this.handleKeyPress));\n };\n /**\n * Called when a `MenuButton` loses focus. Turns off the listener for\n * `keydown` events. Which Stops `this.handleKeyPress` from getting called.\n *\n * @param {EventTarget~Event} event\n * The `blur` event that caused this function to be called.\n *\n * @listens blur\n */\n\n\n _proto.handleBlur = function handleBlur() {\n off(document, 'keydown', bind(this, this.handleKeyPress));\n };\n /**\n * Handle tab, escape, down arrow, and up arrow keys for `MenuButton`. See\n * {@link ClickableComponent#handleKeyPress} for instances where this is called.\n *\n * @param {EventTarget~Event} event\n * The `keydown` event that caused this function to be called.\n *\n * @listens keydown\n */\n\n\n _proto.handleKeyPress = function handleKeyPress(event) {\n // Escape (27) key or Tab (9) key unpress the 'button'\n if (event.which === 27 || event.which === 9) {\n if (this.buttonPressed_) {\n this.unpressButton();\n } // Don't preventDefault for Tab key - we still want to lose focus\n\n\n if (event.which !== 9) {\n event.preventDefault(); // Set focus back to the menu button's button\n\n this.menuButton_.el_.focus();\n } // Enter (13) or Up (38) key or Down (40) key press the 'button'\n\n } else if (event.which === 13 || event.which === 38 || event.which === 40) {\n if (!this.buttonPressed_) {\n this.pressButton();\n event.preventDefault();\n }\n }\n };\n /**\n * Handle a `keydown` event on a sub-menu. The listener for this is added in\n * the constructor.\n *\n * @param {EventTarget~Event} event\n * Key press event\n *\n * @listens keydown\n */\n\n\n _proto.handleSubmenuKeyPress = function handleSubmenuKeyPress(event) {\n // Escape (27) key or Tab (9) key unpress the 'button'\n if (event.which === 27 || event.which === 9) {\n if (this.buttonPressed_) {\n this.unpressButton();\n } // Don't preventDefault for Tab key - we still want to lose focus\n\n\n if (event.which !== 9) {\n event.preventDefault(); // Set focus back to the menu button's button\n\n this.menuButton_.el_.focus();\n }\n }\n };\n /**\n * Put the current `MenuButton` into a pressed state.\n */\n\n\n _proto.pressButton = function pressButton() {\n if (this.enabled_) {\n this.buttonPressed_ = true;\n this.menu.show();\n this.menu.lockShowing();\n this.menuButton_.el_.setAttribute('aria-expanded', 'true'); // set the focus into the submenu, except on iOS where it is resulting in\n // undesired scrolling behavior when the player is in an iframe\n\n if (IS_IOS && isInFrame()) {\n // Return early so that the menu isn't focused\n return;\n }\n\n this.menu.focus();\n }\n };\n /**\n * Take the current `MenuButton` out of a pressed state.\n */\n\n\n _proto.unpressButton = function unpressButton() {\n if (this.enabled_) {\n this.buttonPressed_ = false;\n this.menu.unlockShowing();\n this.menu.hide();\n this.menuButton_.el_.setAttribute('aria-expanded', 'false');\n }\n };\n /**\n * Disable the `MenuButton`. Don't allow it to be clicked.\n */\n\n\n _proto.disable = function disable() {\n this.unpressButton();\n this.enabled_ = false;\n this.addClass('vjs-disabled');\n this.menuButton_.disable();\n };\n /**\n * Enable the `MenuButton`. Allow it to be clicked.\n */\n\n\n _proto.enable = function enable() {\n this.enabled_ = true;\n this.removeClass('vjs-disabled');\n this.menuButton_.enable();\n };\n\n return MenuButton;\n}(Component);\n\nComponent.registerComponent('MenuButton', MenuButton);\n\n/**\n * The base class for buttons that toggle specific track types (e.g. subtitles).\n *\n * @extends MenuButton\n */\n\nvar TrackButton =\n/*#__PURE__*/\nfunction (_MenuButton) {\n _inheritsLoose(TrackButton, _MenuButton);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function TrackButton(player, options) {\n var _this;\n\n var tracks = options.tracks;\n _this = _MenuButton.call(this, player, options) || this;\n\n if (_this.items.length <= 1) {\n _this.hide();\n }\n\n if (!tracks) {\n return _assertThisInitialized(_this);\n }\n\n var updateHandler = bind(_assertThisInitialized(_assertThisInitialized(_this)), _this.update);\n tracks.addEventListener('removetrack', updateHandler);\n tracks.addEventListener('addtrack', updateHandler);\n\n _this.player_.on('ready', updateHandler);\n\n _this.player_.on('dispose', function () {\n tracks.removeEventListener('removetrack', updateHandler);\n tracks.removeEventListener('addtrack', updateHandler);\n });\n\n return _this;\n }\n\n return TrackButton;\n}(MenuButton);\n\nComponent.registerComponent('TrackButton', TrackButton);\n\n/**\n * The component for a menu item. `<li>`\n *\n * @extends ClickableComponent\n */\n\nvar MenuItem =\n/*#__PURE__*/\nfunction (_ClickableComponent) {\n _inheritsLoose(MenuItem, _ClickableComponent);\n\n /**\n * Creates an instance of the this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options={}]\n * The key/value store of player options.\n *\n */\n function MenuItem(player, options) {\n var _this;\n\n _this = _ClickableComponent.call(this, player, options) || this;\n _this.selectable = options.selectable;\n _this.isSelected_ = options.selected || false;\n _this.multiSelectable = options.multiSelectable;\n\n _this.selected(_this.isSelected_);\n\n if (_this.selectable) {\n if (_this.multiSelectable) {\n _this.el_.setAttribute('role', 'menuitemcheckbox');\n } else {\n _this.el_.setAttribute('role', 'menuitemradio');\n }\n } else {\n _this.el_.setAttribute('role', 'menuitem');\n }\n\n return _this;\n }\n /**\n * Create the `MenuItem's DOM element\n *\n * @param {string} [type=li]\n * Element's node type, not actually used, always set to `li`.\n *\n * @param {Object} [props={}]\n * An object of properties that should be set on the element\n *\n * @param {Object} [attrs={}]\n * An object of attributes that should be set on the element\n *\n * @return {Element}\n * The element that gets created.\n */\n\n\n var _proto = MenuItem.prototype;\n\n _proto.createEl = function createEl(type, props, attrs) {\n // The control is textual, not just an icon\n this.nonIconControl = true;\n return _ClickableComponent.prototype.createEl.call(this, 'li', assign({\n className: 'vjs-menu-item',\n innerHTML: \"<span class=\\\"vjs-menu-item-text\\\">\" + this.localize(this.options_.label) + \"</span>\",\n tabIndex: -1\n }, props), attrs);\n };\n /**\n * Any click on a `MenuItem` puts it into the selected state.\n * See {@link ClickableComponent#handleClick} for instances where this is called.\n *\n * @param {EventTarget~Event} event\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n\n\n _proto.handleClick = function handleClick(event) {\n this.selected(true);\n };\n /**\n * Set the state for this menu item as selected or not.\n *\n * @param {boolean} selected\n * if the menu item is selected or not\n */\n\n\n _proto.selected = function selected(_selected) {\n if (this.selectable) {\n if (_selected) {\n this.addClass('vjs-selected');\n this.el_.setAttribute('aria-checked', 'true'); // aria-checked isn't fully supported by browsers/screen readers,\n // so indicate selected state to screen reader in the control text.\n\n this.controlText(', selected');\n this.isSelected_ = true;\n } else {\n this.removeClass('vjs-selected');\n this.el_.setAttribute('aria-checked', 'false'); // Indicate un-selected state to screen reader\n\n this.controlText('');\n this.isSelected_ = false;\n }\n }\n };\n\n return MenuItem;\n}(ClickableComponent);\n\nComponent.registerComponent('MenuItem', MenuItem);\n\n/**\n * The specific menu item type for selecting a language within a text track kind\n *\n * @extends MenuItem\n */\n\nvar TextTrackMenuItem =\n/*#__PURE__*/\nfunction (_MenuItem) {\n _inheritsLoose(TextTrackMenuItem, _MenuItem);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function TextTrackMenuItem(player, options) {\n var _this;\n\n var track = options.track;\n var tracks = player.textTracks(); // Modify options for parent MenuItem class's init.\n\n options.label = track.label || track.language || 'Unknown';\n options.selected = track.mode === 'showing';\n _this = _MenuItem.call(this, player, options) || this;\n _this.track = track;\n\n var changeHandler = function changeHandler() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this.handleTracksChange.apply(_assertThisInitialized(_assertThisInitialized(_this)), args);\n };\n\n var selectedLanguageChangeHandler = function selectedLanguageChangeHandler() {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n _this.handleSelectedLanguageChange.apply(_assertThisInitialized(_assertThisInitialized(_this)), args);\n };\n\n player.on(['loadstart', 'texttrackchange'], changeHandler);\n tracks.addEventListener('change', changeHandler);\n tracks.addEventListener('selectedlanguagechange', selectedLanguageChangeHandler);\n\n _this.on('dispose', function () {\n player.off(['loadstart', 'texttrackchange'], changeHandler);\n tracks.removeEventListener('change', changeHandler);\n tracks.removeEventListener('selectedlanguagechange', selectedLanguageChangeHandler);\n }); // iOS7 doesn't dispatch change events to TextTrackLists when an\n // associated track's mode changes. Without something like\n // Object.observe() (also not present on iOS7), it's not\n // possible to detect changes to the mode attribute and polyfill\n // the change event. As a poor substitute, we manually dispatch\n // change events whenever the controls modify the mode.\n\n\n if (tracks.onchange === undefined) {\n var event;\n\n _this.on(['tap', 'click'], function () {\n if (typeof window$1.Event !== 'object') {\n // Android 2.3 throws an Illegal Constructor error for window.Event\n try {\n event = new window$1.Event('change');\n } catch (err) {// continue regardless of error\n }\n }\n\n if (!event) {\n event = document.createEvent('Event');\n event.initEvent('change', true, true);\n }\n\n tracks.dispatchEvent(event);\n });\n } // set the default state based on current tracks\n\n\n _this.handleTracksChange();\n\n return _this;\n }\n /**\n * This gets called when an `TextTrackMenuItem` is \"clicked\". See\n * {@link ClickableComponent} for more detailed information on what a click can be.\n *\n * @param {EventTarget~Event} event\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n\n\n var _proto = TextTrackMenuItem.prototype;\n\n _proto.handleClick = function handleClick(event) {\n var kind = this.track.kind;\n var kinds = this.track.kinds;\n var tracks = this.player_.textTracks();\n\n if (!kinds) {\n kinds = [kind];\n }\n\n _MenuItem.prototype.handleClick.call(this, event);\n\n if (!tracks) {\n return;\n }\n\n for (var i = 0; i < tracks.length; i++) {\n var track = tracks[i];\n\n if (track === this.track && kinds.indexOf(track.kind) > -1) {\n if (track.mode !== 'showing') {\n track.mode = 'showing';\n }\n } else if (track.mode !== 'disabled') {\n track.mode = 'disabled';\n }\n }\n };\n /**\n * Handle text track list change\n *\n * @param {EventTarget~Event} event\n * The `change` event that caused this function to be called.\n *\n * @listens TextTrackList#change\n */\n\n\n _proto.handleTracksChange = function handleTracksChange(event) {\n var shouldBeSelected = this.track.mode === 'showing'; // Prevent redundant selected() calls because they may cause\n // screen readers to read the appended control text unnecessarily\n\n if (shouldBeSelected !== this.isSelected_) {\n this.selected(shouldBeSelected);\n }\n };\n\n _proto.handleSelectedLanguageChange = function handleSelectedLanguageChange(event) {\n if (this.track.mode === 'showing') {\n var selectedLanguage = this.player_.cache_.selectedLanguage; // Don't replace the kind of track across the same language\n\n if (selectedLanguage && selectedLanguage.enabled && selectedLanguage.language === this.track.language && selectedLanguage.kind !== this.track.kind) {\n return;\n }\n\n this.player_.cache_.selectedLanguage = {\n enabled: true,\n language: this.track.language,\n kind: this.track.kind\n };\n }\n };\n\n _proto.dispose = function dispose() {\n // remove reference to track object on dispose\n this.track = null;\n\n _MenuItem.prototype.dispose.call(this);\n };\n\n return TextTrackMenuItem;\n}(MenuItem);\n\nComponent.registerComponent('TextTrackMenuItem', TextTrackMenuItem);\n\n/**\n * A special menu item for turning of a specific type of text track\n *\n * @extends TextTrackMenuItem\n */\n\nvar OffTextTrackMenuItem =\n/*#__PURE__*/\nfunction (_TextTrackMenuItem) {\n _inheritsLoose(OffTextTrackMenuItem, _TextTrackMenuItem);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function OffTextTrackMenuItem(player, options) {\n // Create pseudo track info\n // Requires options['kind']\n options.track = {\n player: player,\n kind: options.kind,\n kinds: options.kinds,\n default: false,\n mode: 'disabled'\n };\n\n if (!options.kinds) {\n options.kinds = [options.kind];\n }\n\n if (options.label) {\n options.track.label = options.label;\n } else {\n options.track.label = options.kinds.join(' and ') + ' off';\n } // MenuItem is selectable\n\n\n options.selectable = true; // MenuItem is NOT multiSelectable (i.e. only one can be marked \"selected\" at a time)\n\n options.multiSelectable = false;\n return _TextTrackMenuItem.call(this, player, options) || this;\n }\n /**\n * Handle text track change\n *\n * @param {EventTarget~Event} event\n * The event that caused this function to run\n */\n\n\n var _proto = OffTextTrackMenuItem.prototype;\n\n _proto.handleTracksChange = function handleTracksChange(event) {\n var tracks = this.player().textTracks();\n var shouldBeSelected = true;\n\n for (var i = 0, l = tracks.length; i < l; i++) {\n var track = tracks[i];\n\n if (this.options_.kinds.indexOf(track.kind) > -1 && track.mode === 'showing') {\n shouldBeSelected = false;\n break;\n }\n } // Prevent redundant selected() calls because they may cause\n // screen readers to read the appended control text unnecessarily\n\n\n if (shouldBeSelected !== this.isSelected_) {\n this.selected(shouldBeSelected);\n }\n };\n\n _proto.handleSelectedLanguageChange = function handleSelectedLanguageChange(event) {\n var tracks = this.player().textTracks();\n var allHidden = true;\n\n for (var i = 0, l = tracks.length; i < l; i++) {\n var track = tracks[i];\n\n if (['captions', 'descriptions', 'subtitles'].indexOf(track.kind) > -1 && track.mode === 'showing') {\n allHidden = false;\n break;\n }\n }\n\n if (allHidden) {\n this.player_.cache_.selectedLanguage = {\n enabled: false\n };\n }\n };\n\n return OffTextTrackMenuItem;\n}(TextTrackMenuItem);\n\nComponent.registerComponent('OffTextTrackMenuItem', OffTextTrackMenuItem);\n\n/**\n * The base class for buttons that toggle specific text track types (e.g. subtitles)\n *\n * @extends MenuButton\n */\n\nvar TextTrackButton =\n/*#__PURE__*/\nfunction (_TrackButton) {\n _inheritsLoose(TextTrackButton, _TrackButton);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options={}]\n * The key/value store of player options.\n */\n function TextTrackButton(player, options) {\n if (options === void 0) {\n options = {};\n }\n\n options.tracks = player.textTracks();\n return _TrackButton.call(this, player, options) || this;\n }\n /**\n * Create a menu item for each text track\n *\n * @param {TextTrackMenuItem[]} [items=[]]\n * Existing array of items to use during creation\n *\n * @return {TextTrackMenuItem[]}\n * Array of menu items that were created\n */\n\n\n var _proto = TextTrackButton.prototype;\n\n _proto.createItems = function createItems(items, TrackMenuItem) {\n if (items === void 0) {\n items = [];\n }\n\n if (TrackMenuItem === void 0) {\n TrackMenuItem = TextTrackMenuItem;\n }\n\n // Label is an override for the [track] off label\n // USed to localise captions/subtitles\n var label;\n\n if (this.label_) {\n label = this.label_ + \" off\";\n } // Add an OFF menu item to turn all tracks off\n\n\n items.push(new OffTextTrackMenuItem(this.player_, {\n kinds: this.kinds_,\n kind: this.kind_,\n label: label\n }));\n this.hideThreshold_ += 1;\n var tracks = this.player_.textTracks();\n\n if (!Array.isArray(this.kinds_)) {\n this.kinds_ = [this.kind_];\n }\n\n for (var i = 0; i < tracks.length; i++) {\n var track = tracks[i]; // only add tracks that are of an appropriate kind and have a label\n\n if (this.kinds_.indexOf(track.kind) > -1) {\n var item = new TrackMenuItem(this.player_, {\n track: track,\n // MenuItem is selectable\n selectable: true,\n // MenuItem is NOT multiSelectable (i.e. only one can be marked \"selected\" at a time)\n multiSelectable: false\n });\n item.addClass(\"vjs-\" + track.kind + \"-menu-item\");\n items.push(item);\n }\n }\n\n return items;\n };\n\n return TextTrackButton;\n}(TrackButton);\n\nComponent.registerComponent('TextTrackButton', TextTrackButton);\n\n/**\n * The chapter track menu item\n *\n * @extends MenuItem\n */\n\nvar ChaptersTrackMenuItem =\n/*#__PURE__*/\nfunction (_MenuItem) {\n _inheritsLoose(ChaptersTrackMenuItem, _MenuItem);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function ChaptersTrackMenuItem(player, options) {\n var _this;\n\n var track = options.track;\n var cue = options.cue;\n var currentTime = player.currentTime(); // Modify options for parent MenuItem class's init.\n\n options.selectable = true;\n options.multiSelectable = false;\n options.label = cue.text;\n options.selected = cue.startTime <= currentTime && currentTime < cue.endTime;\n _this = _MenuItem.call(this, player, options) || this;\n _this.track = track;\n _this.cue = cue;\n track.addEventListener('cuechange', bind(_assertThisInitialized(_assertThisInitialized(_this)), _this.update));\n return _this;\n }\n /**\n * This gets called when an `ChaptersTrackMenuItem` is \"clicked\". See\n * {@link ClickableComponent} for more detailed information on what a click can be.\n *\n * @param {EventTarget~Event} [event]\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n\n\n var _proto = ChaptersTrackMenuItem.prototype;\n\n _proto.handleClick = function handleClick(event) {\n _MenuItem.prototype.handleClick.call(this);\n\n this.player_.currentTime(this.cue.startTime);\n this.update(this.cue.startTime);\n };\n /**\n * Update chapter menu item\n *\n * @param {EventTarget~Event} [event]\n * The `cuechange` event that caused this function to run.\n *\n * @listens TextTrack#cuechange\n */\n\n\n _proto.update = function update(event) {\n var cue = this.cue;\n var currentTime = this.player_.currentTime(); // vjs.log(currentTime, cue.startTime);\n\n this.selected(cue.startTime <= currentTime && currentTime < cue.endTime);\n };\n\n return ChaptersTrackMenuItem;\n}(MenuItem);\n\nComponent.registerComponent('ChaptersTrackMenuItem', ChaptersTrackMenuItem);\n\n/**\n * The button component for toggling and selecting chapters\n * Chapters act much differently than other text tracks\n * Cues are navigation vs. other tracks of alternative languages\n *\n * @extends TextTrackButton\n */\n\nvar ChaptersButton =\n/*#__PURE__*/\nfunction (_TextTrackButton) {\n _inheritsLoose(ChaptersButton, _TextTrackButton);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Component~ReadyCallback} [ready]\n * The function to call when this function is ready.\n */\n function ChaptersButton(player, options, ready) {\n return _TextTrackButton.call(this, player, options, ready) || this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n var _proto = ChaptersButton.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-chapters-button \" + _TextTrackButton.prototype.buildCSSClass.call(this);\n };\n\n _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {\n return \"vjs-chapters-button \" + _TextTrackButton.prototype.buildWrapperCSSClass.call(this);\n };\n /**\n * Update the menu based on the current state of its items.\n *\n * @param {EventTarget~Event} [event]\n * An event that triggered this function to run.\n *\n * @listens TextTrackList#addtrack\n * @listens TextTrackList#removetrack\n * @listens TextTrackList#change\n */\n\n\n _proto.update = function update(event) {\n if (!this.track_ || event && (event.type === 'addtrack' || event.type === 'removetrack')) {\n this.setTrack(this.findChaptersTrack());\n }\n\n _TextTrackButton.prototype.update.call(this);\n };\n /**\n * Set the currently selected track for the chapters button.\n *\n * @param {TextTrack} track\n * The new track to select. Nothing will change if this is the currently selected\n * track.\n */\n\n\n _proto.setTrack = function setTrack(track) {\n if (this.track_ === track) {\n return;\n }\n\n if (!this.updateHandler_) {\n this.updateHandler_ = this.update.bind(this);\n } // here this.track_ refers to the old track instance\n\n\n if (this.track_) {\n var remoteTextTrackEl = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);\n\n if (remoteTextTrackEl) {\n remoteTextTrackEl.removeEventListener('load', this.updateHandler_);\n }\n\n this.track_ = null;\n }\n\n this.track_ = track; // here this.track_ refers to the new track instance\n\n if (this.track_) {\n this.track_.mode = 'hidden';\n\n var _remoteTextTrackEl = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);\n\n if (_remoteTextTrackEl) {\n _remoteTextTrackEl.addEventListener('load', this.updateHandler_);\n }\n }\n };\n /**\n * Find the track object that is currently in use by this ChaptersButton\n *\n * @return {TextTrack|undefined}\n * The current track or undefined if none was found.\n */\n\n\n _proto.findChaptersTrack = function findChaptersTrack() {\n var tracks = this.player_.textTracks() || [];\n\n for (var i = tracks.length - 1; i >= 0; i--) {\n // We will always choose the last track as our chaptersTrack\n var track = tracks[i];\n\n if (track.kind === this.kind_) {\n return track;\n }\n }\n };\n /**\n * Get the caption for the ChaptersButton based on the track label. This will also\n * use the current tracks localized kind as a fallback if a label does not exist.\n *\n * @return {string}\n * The tracks current label or the localized track kind.\n */\n\n\n _proto.getMenuCaption = function getMenuCaption() {\n if (this.track_ && this.track_.label) {\n return this.track_.label;\n }\n\n return this.localize(toTitleCase(this.kind_));\n };\n /**\n * Create menu from chapter track\n *\n * @return {Menu}\n * New menu for the chapter buttons\n */\n\n\n _proto.createMenu = function createMenu() {\n this.options_.title = this.getMenuCaption();\n return _TextTrackButton.prototype.createMenu.call(this);\n };\n /**\n * Create a menu item for each text track\n *\n * @return {TextTrackMenuItem[]}\n * Array of menu items\n */\n\n\n _proto.createItems = function createItems() {\n var items = [];\n\n if (!this.track_) {\n return items;\n }\n\n var cues = this.track_.cues;\n\n if (!cues) {\n return items;\n }\n\n for (var i = 0, l = cues.length; i < l; i++) {\n var cue = cues[i];\n var mi = new ChaptersTrackMenuItem(this.player_, {\n track: this.track_,\n cue: cue\n });\n items.push(mi);\n }\n\n return items;\n };\n\n return ChaptersButton;\n}(TextTrackButton);\n/**\n * `kind` of TextTrack to look for to associate it with this menu.\n *\n * @type {string}\n * @private\n */\n\n\nChaptersButton.prototype.kind_ = 'chapters';\n/**\n * The text that should display over the `ChaptersButton`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\nChaptersButton.prototype.controlText_ = 'Chapters';\nComponent.registerComponent('ChaptersButton', ChaptersButton);\n\n/**\n * The button component for toggling and selecting descriptions\n *\n * @extends TextTrackButton\n */\n\nvar DescriptionsButton =\n/*#__PURE__*/\nfunction (_TextTrackButton) {\n _inheritsLoose(DescriptionsButton, _TextTrackButton);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Component~ReadyCallback} [ready]\n * The function to call when this component is ready.\n */\n function DescriptionsButton(player, options, ready) {\n var _this;\n\n _this = _TextTrackButton.call(this, player, options, ready) || this;\n var tracks = player.textTracks();\n var changeHandler = bind(_assertThisInitialized(_assertThisInitialized(_this)), _this.handleTracksChange);\n tracks.addEventListener('change', changeHandler);\n\n _this.on('dispose', function () {\n tracks.removeEventListener('change', changeHandler);\n });\n\n return _this;\n }\n /**\n * Handle text track change\n *\n * @param {EventTarget~Event} event\n * The event that caused this function to run\n *\n * @listens TextTrackList#change\n */\n\n\n var _proto = DescriptionsButton.prototype;\n\n _proto.handleTracksChange = function handleTracksChange(event) {\n var tracks = this.player().textTracks();\n var disabled = false; // Check whether a track of a different kind is showing\n\n for (var i = 0, l = tracks.length; i < l; i++) {\n var track = tracks[i];\n\n if (track.kind !== this.kind_ && track.mode === 'showing') {\n disabled = true;\n break;\n }\n } // If another track is showing, disable this menu button\n\n\n if (disabled) {\n this.disable();\n } else {\n this.enable();\n }\n };\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-descriptions-button \" + _TextTrackButton.prototype.buildCSSClass.call(this);\n };\n\n _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {\n return \"vjs-descriptions-button \" + _TextTrackButton.prototype.buildWrapperCSSClass.call(this);\n };\n\n return DescriptionsButton;\n}(TextTrackButton);\n/**\n * `kind` of TextTrack to look for to associate it with this menu.\n *\n * @type {string}\n * @private\n */\n\n\nDescriptionsButton.prototype.kind_ = 'descriptions';\n/**\n * The text that should display over the `DescriptionsButton`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\nDescriptionsButton.prototype.controlText_ = 'Descriptions';\nComponent.registerComponent('DescriptionsButton', DescriptionsButton);\n\n/**\n * The button component for toggling and selecting subtitles\n *\n * @extends TextTrackButton\n */\n\nvar SubtitlesButton =\n/*#__PURE__*/\nfunction (_TextTrackButton) {\n _inheritsLoose(SubtitlesButton, _TextTrackButton);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Component~ReadyCallback} [ready]\n * The function to call when this component is ready.\n */\n function SubtitlesButton(player, options, ready) {\n return _TextTrackButton.call(this, player, options, ready) || this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n var _proto = SubtitlesButton.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-subtitles-button \" + _TextTrackButton.prototype.buildCSSClass.call(this);\n };\n\n _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {\n return \"vjs-subtitles-button \" + _TextTrackButton.prototype.buildWrapperCSSClass.call(this);\n };\n\n return SubtitlesButton;\n}(TextTrackButton);\n/**\n * `kind` of TextTrack to look for to associate it with this menu.\n *\n * @type {string}\n * @private\n */\n\n\nSubtitlesButton.prototype.kind_ = 'subtitles';\n/**\n * The text that should display over the `SubtitlesButton`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\nSubtitlesButton.prototype.controlText_ = 'Subtitles';\nComponent.registerComponent('SubtitlesButton', SubtitlesButton);\n\n/**\n * The menu item for caption track settings menu\n *\n * @extends TextTrackMenuItem\n */\n\nvar CaptionSettingsMenuItem =\n/*#__PURE__*/\nfunction (_TextTrackMenuItem) {\n _inheritsLoose(CaptionSettingsMenuItem, _TextTrackMenuItem);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function CaptionSettingsMenuItem(player, options) {\n var _this;\n\n options.track = {\n player: player,\n kind: options.kind,\n label: options.kind + ' settings',\n selectable: false,\n default: false,\n mode: 'disabled'\n }; // CaptionSettingsMenuItem has no concept of 'selected'\n\n options.selectable = false;\n options.name = 'CaptionSettingsMenuItem';\n _this = _TextTrackMenuItem.call(this, player, options) || this;\n\n _this.addClass('vjs-texttrack-settings');\n\n _this.controlText(', opens ' + options.kind + ' settings dialog');\n\n return _this;\n }\n /**\n * This gets called when an `CaptionSettingsMenuItem` is \"clicked\". See\n * {@link ClickableComponent} for more detailed information on what a click can be.\n *\n * @param {EventTarget~Event} [event]\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n\n\n var _proto = CaptionSettingsMenuItem.prototype;\n\n _proto.handleClick = function handleClick(event) {\n this.player().getChild('textTrackSettings').open();\n };\n\n return CaptionSettingsMenuItem;\n}(TextTrackMenuItem);\n\nComponent.registerComponent('CaptionSettingsMenuItem', CaptionSettingsMenuItem);\n\n/**\n * The button component for toggling and selecting captions\n *\n * @extends TextTrackButton\n */\n\nvar CaptionsButton =\n/*#__PURE__*/\nfunction (_TextTrackButton) {\n _inheritsLoose(CaptionsButton, _TextTrackButton);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Component~ReadyCallback} [ready]\n * The function to call when this component is ready.\n */\n function CaptionsButton(player, options, ready) {\n return _TextTrackButton.call(this, player, options, ready) || this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n var _proto = CaptionsButton.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-captions-button \" + _TextTrackButton.prototype.buildCSSClass.call(this);\n };\n\n _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {\n return \"vjs-captions-button \" + _TextTrackButton.prototype.buildWrapperCSSClass.call(this);\n };\n /**\n * Create caption menu items\n *\n * @return {CaptionSettingsMenuItem[]}\n * The array of current menu items.\n */\n\n\n _proto.createItems = function createItems() {\n var items = [];\n\n if (!(this.player().tech_ && this.player().tech_.featuresNativeTextTracks) && this.player().getChild('textTrackSettings')) {\n items.push(new CaptionSettingsMenuItem(this.player_, {\n kind: this.kind_\n }));\n this.hideThreshold_ += 1;\n }\n\n return _TextTrackButton.prototype.createItems.call(this, items);\n };\n\n return CaptionsButton;\n}(TextTrackButton);\n/**\n * `kind` of TextTrack to look for to associate it with this menu.\n *\n * @type {string}\n * @private\n */\n\n\nCaptionsButton.prototype.kind_ = 'captions';\n/**\n * The text that should display over the `CaptionsButton`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\nCaptionsButton.prototype.controlText_ = 'Captions';\nComponent.registerComponent('CaptionsButton', CaptionsButton);\n\n/**\n * SubsCapsMenuItem has an [cc] icon to distinguish captions from subtitles\n * in the SubsCapsMenu.\n *\n * @extends TextTrackMenuItem\n */\n\nvar SubsCapsMenuItem =\n/*#__PURE__*/\nfunction (_TextTrackMenuItem) {\n _inheritsLoose(SubsCapsMenuItem, _TextTrackMenuItem);\n\n function SubsCapsMenuItem() {\n return _TextTrackMenuItem.apply(this, arguments) || this;\n }\n\n var _proto = SubsCapsMenuItem.prototype;\n\n _proto.createEl = function createEl(type, props, attrs) {\n var innerHTML = \"<span class=\\\"vjs-menu-item-text\\\">\" + this.localize(this.options_.label);\n\n if (this.options_.track.kind === 'captions') {\n innerHTML += \"\\n <span aria-hidden=\\\"true\\\" class=\\\"vjs-icon-placeholder\\\"></span>\\n <span class=\\\"vjs-control-text\\\"> \" + this.localize('Captions') + \"</span>\\n \";\n }\n\n innerHTML += '</span>';\n\n var el = _TextTrackMenuItem.prototype.createEl.call(this, type, assign({\n innerHTML: innerHTML\n }, props), attrs);\n\n return el;\n };\n\n return SubsCapsMenuItem;\n}(TextTrackMenuItem);\n\nComponent.registerComponent('SubsCapsMenuItem', SubsCapsMenuItem);\n\n/**\n * The button component for toggling and selecting captions and/or subtitles\n *\n * @extends TextTrackButton\n */\n\nvar SubsCapsButton =\n/*#__PURE__*/\nfunction (_TextTrackButton) {\n _inheritsLoose(SubsCapsButton, _TextTrackButton);\n\n function SubsCapsButton(player, options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n _this = _TextTrackButton.call(this, player, options) || this; // Although North America uses \"captions\" in most cases for\n // \"captions and subtitles\" other locales use \"subtitles\"\n\n _this.label_ = 'subtitles';\n\n if (['en', 'en-us', 'en-ca', 'fr-ca'].indexOf(_this.player_.language_) > -1) {\n _this.label_ = 'captions';\n }\n\n _this.menuButton_.controlText(toTitleCase(_this.label_));\n\n return _this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n var _proto = SubsCapsButton.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-subs-caps-button \" + _TextTrackButton.prototype.buildCSSClass.call(this);\n };\n\n _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {\n return \"vjs-subs-caps-button \" + _TextTrackButton.prototype.buildWrapperCSSClass.call(this);\n };\n /**\n * Create caption/subtitles menu items\n *\n * @return {CaptionSettingsMenuItem[]}\n * The array of current menu items.\n */\n\n\n _proto.createItems = function createItems() {\n var items = [];\n\n if (!(this.player().tech_ && this.player().tech_.featuresNativeTextTracks) && this.player().getChild('textTrackSettings')) {\n items.push(new CaptionSettingsMenuItem(this.player_, {\n kind: this.label_\n }));\n this.hideThreshold_ += 1;\n }\n\n items = _TextTrackButton.prototype.createItems.call(this, items, SubsCapsMenuItem);\n return items;\n };\n\n return SubsCapsButton;\n}(TextTrackButton);\n/**\n * `kind`s of TextTrack to look for to associate it with this menu.\n *\n * @type {array}\n * @private\n */\n\n\nSubsCapsButton.prototype.kinds_ = ['captions', 'subtitles'];\n/**\n * The text that should display over the `SubsCapsButton`s controls.\n *\n *\n * @type {string}\n * @private\n */\n\nSubsCapsButton.prototype.controlText_ = 'Subtitles';\nComponent.registerComponent('SubsCapsButton', SubsCapsButton);\n\n/**\n * An {@link AudioTrack} {@link MenuItem}\n *\n * @extends MenuItem\n */\n\nvar AudioTrackMenuItem =\n/*#__PURE__*/\nfunction (_MenuItem) {\n _inheritsLoose(AudioTrackMenuItem, _MenuItem);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function AudioTrackMenuItem(player, options) {\n var _this;\n\n var track = options.track;\n var tracks = player.audioTracks(); // Modify options for parent MenuItem class's init.\n\n options.label = track.label || track.language || 'Unknown';\n options.selected = track.enabled;\n _this = _MenuItem.call(this, player, options) || this;\n _this.track = track;\n\n _this.addClass(\"vjs-\" + track.kind + \"-menu-item\");\n\n var changeHandler = function changeHandler() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this.handleTracksChange.apply(_assertThisInitialized(_assertThisInitialized(_this)), args);\n };\n\n tracks.addEventListener('change', changeHandler);\n\n _this.on('dispose', function () {\n tracks.removeEventListener('change', changeHandler);\n });\n\n return _this;\n }\n\n var _proto = AudioTrackMenuItem.prototype;\n\n _proto.createEl = function createEl(type, props, attrs) {\n var innerHTML = \"<span class=\\\"vjs-menu-item-text\\\">\" + this.localize(this.options_.label);\n\n if (this.options_.track.kind === 'main-desc') {\n innerHTML += \"\\n <span aria-hidden=\\\"true\\\" class=\\\"vjs-icon-placeholder\\\"></span>\\n <span class=\\\"vjs-control-text\\\"> \" + this.localize('Descriptions') + \"</span>\\n \";\n }\n\n innerHTML += '</span>';\n\n var el = _MenuItem.prototype.createEl.call(this, type, assign({\n innerHTML: innerHTML\n }, props), attrs);\n\n return el;\n };\n /**\n * This gets called when an `AudioTrackMenuItem is \"clicked\". See {@link ClickableComponent}\n * for more detailed information on what a click can be.\n *\n * @param {EventTarget~Event} [event]\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n\n\n _proto.handleClick = function handleClick(event) {\n var tracks = this.player_.audioTracks();\n\n _MenuItem.prototype.handleClick.call(this, event);\n\n for (var i = 0; i < tracks.length; i++) {\n var track = tracks[i];\n track.enabled = track === this.track;\n }\n };\n /**\n * Handle any {@link AudioTrack} change.\n *\n * @param {EventTarget~Event} [event]\n * The {@link AudioTrackList#change} event that caused this to run.\n *\n * @listens AudioTrackList#change\n */\n\n\n _proto.handleTracksChange = function handleTracksChange(event) {\n this.selected(this.track.enabled);\n };\n\n return AudioTrackMenuItem;\n}(MenuItem);\n\nComponent.registerComponent('AudioTrackMenuItem', AudioTrackMenuItem);\n\n/**\n * The base class for buttons that toggle specific {@link AudioTrack} types.\n *\n * @extends TrackButton\n */\n\nvar AudioTrackButton =\n/*#__PURE__*/\nfunction (_TrackButton) {\n _inheritsLoose(AudioTrackButton, _TrackButton);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options={}]\n * The key/value store of player options.\n */\n function AudioTrackButton(player, options) {\n if (options === void 0) {\n options = {};\n }\n\n options.tracks = player.audioTracks();\n return _TrackButton.call(this, player, options) || this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n var _proto = AudioTrackButton.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-audio-button \" + _TrackButton.prototype.buildCSSClass.call(this);\n };\n\n _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {\n return \"vjs-audio-button \" + _TrackButton.prototype.buildWrapperCSSClass.call(this);\n };\n /**\n * Create a menu item for each audio track\n *\n * @param {AudioTrackMenuItem[]} [items=[]]\n * An array of existing menu items to use.\n *\n * @return {AudioTrackMenuItem[]}\n * An array of menu items\n */\n\n\n _proto.createItems = function createItems(items) {\n if (items === void 0) {\n items = [];\n }\n\n // if there's only one audio track, there no point in showing it\n this.hideThreshold_ = 1;\n var tracks = this.player_.audioTracks();\n\n for (var i = 0; i < tracks.length; i++) {\n var track = tracks[i];\n items.push(new AudioTrackMenuItem(this.player_, {\n track: track,\n // MenuItem is selectable\n selectable: true,\n // MenuItem is NOT multiSelectable (i.e. only one can be marked \"selected\" at a time)\n multiSelectable: false\n }));\n }\n\n return items;\n };\n\n return AudioTrackButton;\n}(TrackButton);\n/**\n * The text that should display over the `AudioTrackButton`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\n\nAudioTrackButton.prototype.controlText_ = 'Audio Track';\nComponent.registerComponent('AudioTrackButton', AudioTrackButton);\n\n/**\n * The specific menu item type for selecting a playback rate.\n *\n * @extends MenuItem\n */\n\nvar PlaybackRateMenuItem =\n/*#__PURE__*/\nfunction (_MenuItem) {\n _inheritsLoose(PlaybackRateMenuItem, _MenuItem);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function PlaybackRateMenuItem(player, options) {\n var _this;\n\n var label = options.rate;\n var rate = parseFloat(label, 10); // Modify options for parent MenuItem class's init.\n\n options.label = label;\n options.selected = rate === 1;\n options.selectable = true;\n options.multiSelectable = false;\n _this = _MenuItem.call(this, player, options) || this;\n _this.label = label;\n _this.rate = rate;\n\n _this.on(player, 'ratechange', _this.update);\n\n return _this;\n }\n /**\n * This gets called when an `PlaybackRateMenuItem` is \"clicked\". See\n * {@link ClickableComponent} for more detailed information on what a click can be.\n *\n * @param {EventTarget~Event} [event]\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n\n\n var _proto = PlaybackRateMenuItem.prototype;\n\n _proto.handleClick = function handleClick(event) {\n _MenuItem.prototype.handleClick.call(this);\n\n this.player().playbackRate(this.rate);\n };\n /**\n * Update the PlaybackRateMenuItem when the playbackrate changes.\n *\n * @param {EventTarget~Event} [event]\n * The `ratechange` event that caused this function to run.\n *\n * @listens Player#ratechange\n */\n\n\n _proto.update = function update(event) {\n this.selected(this.player().playbackRate() === this.rate);\n };\n\n return PlaybackRateMenuItem;\n}(MenuItem);\n/**\n * The text that should display over the `PlaybackRateMenuItem`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\n\nPlaybackRateMenuItem.prototype.contentElType = 'button';\nComponent.registerComponent('PlaybackRateMenuItem', PlaybackRateMenuItem);\n\n/**\n * The component for controlling the playback rate.\n *\n * @extends MenuButton\n */\n\nvar PlaybackRateMenuButton =\n/*#__PURE__*/\nfunction (_MenuButton) {\n _inheritsLoose(PlaybackRateMenuButton, _MenuButton);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function PlaybackRateMenuButton(player, options) {\n var _this;\n\n _this = _MenuButton.call(this, player, options) || this;\n\n _this.updateVisibility();\n\n _this.updateLabel();\n\n _this.on(player, 'loadstart', _this.updateVisibility);\n\n _this.on(player, 'ratechange', _this.updateLabel);\n\n return _this;\n }\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n var _proto = PlaybackRateMenuButton.prototype;\n\n _proto.createEl = function createEl$$1() {\n var el = _MenuButton.prototype.createEl.call(this);\n\n this.labelEl_ = createEl('div', {\n className: 'vjs-playback-rate-value',\n innerHTML: '1x'\n });\n el.appendChild(this.labelEl_);\n return el;\n };\n\n _proto.dispose = function dispose() {\n this.labelEl_ = null;\n\n _MenuButton.prototype.dispose.call(this);\n };\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-playback-rate \" + _MenuButton.prototype.buildCSSClass.call(this);\n };\n\n _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {\n return \"vjs-playback-rate \" + _MenuButton.prototype.buildWrapperCSSClass.call(this);\n };\n /**\n * Create the playback rate menu\n *\n * @return {Menu}\n * Menu object populated with {@link PlaybackRateMenuItem}s\n */\n\n\n _proto.createMenu = function createMenu() {\n var menu = new Menu(this.player());\n var rates = this.playbackRates();\n\n if (rates) {\n for (var i = rates.length - 1; i >= 0; i--) {\n menu.addChild(new PlaybackRateMenuItem(this.player(), {\n rate: rates[i] + 'x'\n }));\n }\n }\n\n return menu;\n };\n /**\n * Updates ARIA accessibility attributes\n */\n\n\n _proto.updateARIAAttributes = function updateARIAAttributes() {\n // Current playback rate\n this.el().setAttribute('aria-valuenow', this.player().playbackRate());\n };\n /**\n * This gets called when an `PlaybackRateMenuButton` is \"clicked\". See\n * {@link ClickableComponent} for more detailed information on what a click can be.\n *\n * @param {EventTarget~Event} [event]\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n\n\n _proto.handleClick = function handleClick(event) {\n // select next rate option\n var currentRate = this.player().playbackRate();\n var rates = this.playbackRates(); // this will select first one if the last one currently selected\n\n var newRate = rates[0];\n\n for (var i = 0; i < rates.length; i++) {\n if (rates[i] > currentRate) {\n newRate = rates[i];\n break;\n }\n }\n\n this.player().playbackRate(newRate);\n };\n /**\n * Get possible playback rates\n *\n * @return {Array}\n * All possible playback rates\n */\n\n\n _proto.playbackRates = function playbackRates() {\n return this.options_.playbackRates || this.options_.playerOptions && this.options_.playerOptions.playbackRates;\n };\n /**\n * Get whether playback rates is supported by the tech\n * and an array of playback rates exists\n *\n * @return {boolean}\n * Whether changing playback rate is supported\n */\n\n\n _proto.playbackRateSupported = function playbackRateSupported() {\n return this.player().tech_ && this.player().tech_.featuresPlaybackRate && this.playbackRates() && this.playbackRates().length > 0;\n };\n /**\n * Hide playback rate controls when they're no playback rate options to select\n *\n * @param {EventTarget~Event} [event]\n * The event that caused this function to run.\n *\n * @listens Player#loadstart\n */\n\n\n _proto.updateVisibility = function updateVisibility(event) {\n if (this.playbackRateSupported()) {\n this.removeClass('vjs-hidden');\n } else {\n this.addClass('vjs-hidden');\n }\n };\n /**\n * Update button label when rate changed\n *\n * @param {EventTarget~Event} [event]\n * The event that caused this function to run.\n *\n * @listens Player#ratechange\n */\n\n\n _proto.updateLabel = function updateLabel(event) {\n if (this.playbackRateSupported()) {\n this.labelEl_.innerHTML = this.player().playbackRate() + 'x';\n }\n };\n\n return PlaybackRateMenuButton;\n}(MenuButton);\n/**\n * The text that should display over the `FullscreenToggle`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\n\nPlaybackRateMenuButton.prototype.controlText_ = 'Playback Rate';\nComponent.registerComponent('PlaybackRateMenuButton', PlaybackRateMenuButton);\n\n/**\n * Just an empty spacer element that can be used as an append point for plugins, etc.\n * Also can be used to create space between elements when necessary.\n *\n * @extends Component\n */\n\nvar Spacer =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(Spacer, _Component);\n\n function Spacer() {\n return _Component.apply(this, arguments) || this;\n }\n\n var _proto = Spacer.prototype;\n\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-spacer \" + _Component.prototype.buildCSSClass.call(this);\n };\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n _proto.createEl = function createEl() {\n return _Component.prototype.createEl.call(this, 'div', {\n className: this.buildCSSClass()\n });\n };\n\n return Spacer;\n}(Component);\n\nComponent.registerComponent('Spacer', Spacer);\n\n/**\n * Spacer specifically meant to be used as an insertion point for new plugins, etc.\n *\n * @extends Spacer\n */\n\nvar CustomControlSpacer =\n/*#__PURE__*/\nfunction (_Spacer) {\n _inheritsLoose(CustomControlSpacer, _Spacer);\n\n function CustomControlSpacer() {\n return _Spacer.apply(this, arguments) || this;\n }\n\n var _proto = CustomControlSpacer.prototype;\n\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-custom-control-spacer \" + _Spacer.prototype.buildCSSClass.call(this);\n };\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n _proto.createEl = function createEl() {\n var el = _Spacer.prototype.createEl.call(this, {\n className: this.buildCSSClass()\n }); // No-flex/table-cell mode requires there be some content\n // in the cell to fill the remaining space of the table.\n\n\n el.innerHTML = \"\\xA0\";\n return el;\n };\n\n return CustomControlSpacer;\n}(Spacer);\n\nComponent.registerComponent('CustomControlSpacer', CustomControlSpacer);\n\n/**\n * Container of main controls.\n *\n * @extends Component\n */\n\nvar ControlBar =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(ControlBar, _Component);\n\n function ControlBar() {\n return _Component.apply(this, arguments) || this;\n }\n\n var _proto = ControlBar.prototype;\n\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n _proto.createEl = function createEl() {\n return _Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-control-bar',\n dir: 'ltr'\n });\n };\n\n return ControlBar;\n}(Component);\n/**\n * Default options for `ControlBar`\n *\n * @type {Object}\n * @private\n */\n\n\nControlBar.prototype.options_ = {\n children: ['playToggle', 'volumePanel', 'currentTimeDisplay', 'timeDivider', 'durationDisplay', 'progressControl', 'liveDisplay', 'seekToLive', 'remainingTimeDisplay', 'customControlSpacer', 'playbackRateMenuButton', 'chaptersButton', 'descriptionsButton', 'subsCapsButton', 'audioTrackButton', 'fullscreenToggle']\n};\nComponent.registerComponent('ControlBar', ControlBar);\n\n/**\n * A display that indicates an error has occurred. This means that the video\n * is unplayable.\n *\n * @extends ModalDialog\n */\n\nvar ErrorDisplay =\n/*#__PURE__*/\nfunction (_ModalDialog) {\n _inheritsLoose(ErrorDisplay, _ModalDialog);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function ErrorDisplay(player, options) {\n var _this;\n\n _this = _ModalDialog.call(this, player, options) || this;\n\n _this.on(player, 'error', _this.open);\n\n return _this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n *\n * @deprecated Since version 5.\n */\n\n\n var _proto = ErrorDisplay.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-error-display \" + _ModalDialog.prototype.buildCSSClass.call(this);\n };\n /**\n * Gets the localized error message based on the `Player`s error.\n *\n * @return {string}\n * The `Player`s error message localized or an empty string.\n */\n\n\n _proto.content = function content() {\n var error = this.player().error();\n return error ? this.localize(error.message) : '';\n };\n\n return ErrorDisplay;\n}(ModalDialog);\n/**\n * The default options for an `ErrorDisplay`.\n *\n * @private\n */\n\n\nErrorDisplay.prototype.options_ = mergeOptions(ModalDialog.prototype.options_, {\n pauseOnOpen: false,\n fillAlways: true,\n temporary: false,\n uncloseable: true\n});\nComponent.registerComponent('ErrorDisplay', ErrorDisplay);\n\nvar LOCAL_STORAGE_KEY = 'vjs-text-track-settings';\nvar COLOR_BLACK = ['#000', 'Black'];\nvar COLOR_BLUE = ['#00F', 'Blue'];\nvar COLOR_CYAN = ['#0FF', 'Cyan'];\nvar COLOR_GREEN = ['#0F0', 'Green'];\nvar COLOR_MAGENTA = ['#F0F', 'Magenta'];\nvar COLOR_RED = ['#F00', 'Red'];\nvar COLOR_WHITE = ['#FFF', 'White'];\nvar COLOR_YELLOW = ['#FF0', 'Yellow'];\nvar OPACITY_OPAQUE = ['1', 'Opaque'];\nvar OPACITY_SEMI = ['0.5', 'Semi-Transparent'];\nvar OPACITY_TRANS = ['0', 'Transparent']; // Configuration for the various <select> elements in the DOM of this component.\n//\n// Possible keys include:\n//\n// `default`:\n// The default option index. Only needs to be provided if not zero.\n// `parser`:\n// A function which is used to parse the value from the selected option in\n// a customized way.\n// `selector`:\n// The selector used to find the associated <select> element.\n\nvar selectConfigs = {\n backgroundColor: {\n selector: '.vjs-bg-color > select',\n id: 'captions-background-color-%s',\n label: 'Color',\n options: [COLOR_BLACK, COLOR_WHITE, COLOR_RED, COLOR_GREEN, COLOR_BLUE, COLOR_YELLOW, COLOR_MAGENTA, COLOR_CYAN]\n },\n backgroundOpacity: {\n selector: '.vjs-bg-opacity > select',\n id: 'captions-background-opacity-%s',\n label: 'Transparency',\n options: [OPACITY_OPAQUE, OPACITY_SEMI, OPACITY_TRANS]\n },\n color: {\n selector: '.vjs-fg-color > select',\n id: 'captions-foreground-color-%s',\n label: 'Color',\n options: [COLOR_WHITE, COLOR_BLACK, COLOR_RED, COLOR_GREEN, COLOR_BLUE, COLOR_YELLOW, COLOR_MAGENTA, COLOR_CYAN]\n },\n edgeStyle: {\n selector: '.vjs-edge-style > select',\n id: '%s',\n label: 'Text Edge Style',\n options: [['none', 'None'], ['raised', 'Raised'], ['depressed', 'Depressed'], ['uniform', 'Uniform'], ['dropshadow', 'Dropshadow']]\n },\n fontFamily: {\n selector: '.vjs-font-family > select',\n id: 'captions-font-family-%s',\n label: 'Font Family',\n options: [['proportionalSansSerif', 'Proportional Sans-Serif'], ['monospaceSansSerif', 'Monospace Sans-Serif'], ['proportionalSerif', 'Proportional Serif'], ['monospaceSerif', 'Monospace Serif'], ['casual', 'Casual'], ['script', 'Script'], ['small-caps', 'Small Caps']]\n },\n fontPercent: {\n selector: '.vjs-font-percent > select',\n id: 'captions-font-size-%s',\n label: 'Font Size',\n options: [['0.50', '50%'], ['0.75', '75%'], ['1.00', '100%'], ['1.25', '125%'], ['1.50', '150%'], ['1.75', '175%'], ['2.00', '200%'], ['3.00', '300%'], ['4.00', '400%']],\n default: 2,\n parser: function parser(v) {\n return v === '1.00' ? null : Number(v);\n }\n },\n textOpacity: {\n selector: '.vjs-text-opacity > select',\n id: 'captions-foreground-opacity-%s',\n label: 'Transparency',\n options: [OPACITY_OPAQUE, OPACITY_SEMI]\n },\n // Options for this object are defined below.\n windowColor: {\n selector: '.vjs-window-color > select',\n id: 'captions-window-color-%s',\n label: 'Color'\n },\n // Options for this object are defined below.\n windowOpacity: {\n selector: '.vjs-window-opacity > select',\n id: 'captions-window-opacity-%s',\n label: 'Transparency',\n options: [OPACITY_TRANS, OPACITY_SEMI, OPACITY_OPAQUE]\n }\n};\nselectConfigs.windowColor.options = selectConfigs.backgroundColor.options;\n/**\n * Get the actual value of an option.\n *\n * @param {string} value\n * The value to get\n *\n * @param {Function} [parser]\n * Optional function to adjust the value.\n *\n * @return {Mixed}\n * - Will be `undefined` if no value exists\n * - Will be `undefined` if the given value is \"none\".\n * - Will be the actual value otherwise.\n *\n * @private\n */\n\nfunction parseOptionValue(value, parser) {\n if (parser) {\n value = parser(value);\n }\n\n if (value && value !== 'none') {\n return value;\n }\n}\n/**\n * Gets the value of the selected <option> element within a <select> element.\n *\n * @param {Element} el\n * the element to look in\n *\n * @param {Function} [parser]\n * Optional function to adjust the value.\n *\n * @return {Mixed}\n * - Will be `undefined` if no value exists\n * - Will be `undefined` if the given value is \"none\".\n * - Will be the actual value otherwise.\n *\n * @private\n */\n\n\nfunction getSelectedOptionValue(el, parser) {\n var value = el.options[el.options.selectedIndex].value;\n return parseOptionValue(value, parser);\n}\n/**\n * Sets the selected <option> element within a <select> element based on a\n * given value.\n *\n * @param {Element} el\n * The element to look in.\n *\n * @param {string} value\n * the property to look on.\n *\n * @param {Function} [parser]\n * Optional function to adjust the value before comparing.\n *\n * @private\n */\n\n\nfunction setSelectedOption(el, value, parser) {\n if (!value) {\n return;\n }\n\n for (var i = 0; i < el.options.length; i++) {\n if (parseOptionValue(el.options[i].value, parser) === value) {\n el.selectedIndex = i;\n break;\n }\n }\n}\n/**\n * Manipulate Text Tracks settings.\n *\n * @extends ModalDialog\n */\n\n\nvar TextTrackSettings =\n/*#__PURE__*/\nfunction (_ModalDialog) {\n _inheritsLoose(TextTrackSettings, _ModalDialog);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function TextTrackSettings(player, options) {\n var _this;\n\n options.temporary = false;\n _this = _ModalDialog.call(this, player, options) || this;\n _this.updateDisplay = bind(_assertThisInitialized(_assertThisInitialized(_this)), _this.updateDisplay); // fill the modal and pretend we have opened it\n\n _this.fill();\n\n _this.hasBeenOpened_ = _this.hasBeenFilled_ = true;\n _this.endDialog = createEl('p', {\n className: 'vjs-control-text',\n textContent: _this.localize('End of dialog window.')\n });\n\n _this.el().appendChild(_this.endDialog);\n\n _this.setDefaults(); // Grab `persistTextTrackSettings` from the player options if not passed in child options\n\n\n if (options.persistTextTrackSettings === undefined) {\n _this.options_.persistTextTrackSettings = _this.options_.playerOptions.persistTextTrackSettings;\n }\n\n _this.on(_this.$('.vjs-done-button'), 'click', function () {\n _this.saveSettings();\n\n _this.close();\n });\n\n _this.on(_this.$('.vjs-default-button'), 'click', function () {\n _this.setDefaults();\n\n _this.updateDisplay();\n });\n\n each(selectConfigs, function (config) {\n _this.on(_this.$(config.selector), 'change', _this.updateDisplay);\n });\n\n if (_this.options_.persistTextTrackSettings) {\n _this.restoreSettings();\n }\n\n return _this;\n }\n\n var _proto = TextTrackSettings.prototype;\n\n _proto.dispose = function dispose() {\n this.endDialog = null;\n\n _ModalDialog.prototype.dispose.call(this);\n };\n /**\n * Create a <select> element with configured options.\n *\n * @param {string} key\n * Configuration key to use during creation.\n *\n * @return {string}\n * An HTML string.\n *\n * @private\n */\n\n\n _proto.createElSelect_ = function createElSelect_(key, legendId, type) {\n var _this2 = this;\n\n if (legendId === void 0) {\n legendId = '';\n }\n\n if (type === void 0) {\n type = 'label';\n }\n\n var config = selectConfigs[key];\n var id = config.id.replace('%s', this.id_);\n var selectLabelledbyIds = [legendId, id].join(' ').trim();\n return [\"<\" + type + \" id=\\\"\" + id + \"\\\" class=\\\"\" + (type === 'label' ? 'vjs-label' : '') + \"\\\">\", this.localize(config.label), \"</\" + type + \">\", \"<select aria-labelledby=\\\"\" + selectLabelledbyIds + \"\\\">\"].concat(config.options.map(function (o) {\n var optionId = id + '-' + o[1].replace(/\\W+/g, '');\n return [\"<option id=\\\"\" + optionId + \"\\\" value=\\\"\" + o[0] + \"\\\" \", \"aria-labelledby=\\\"\" + selectLabelledbyIds + \" \" + optionId + \"\\\">\", _this2.localize(o[1]), '</option>'].join('');\n })).concat('</select>').join('');\n };\n /**\n * Create foreground color element for the component\n *\n * @return {string}\n * An HTML string.\n *\n * @private\n */\n\n\n _proto.createElFgColor_ = function createElFgColor_() {\n var legendId = \"captions-text-legend-\" + this.id_;\n return ['<fieldset class=\"vjs-fg-color vjs-track-setting\">', \"<legend id=\\\"\" + legendId + \"\\\">\", this.localize('Text'), '</legend>', this.createElSelect_('color', legendId), '<span class=\"vjs-text-opacity vjs-opacity\">', this.createElSelect_('textOpacity', legendId), '</span>', '</fieldset>'].join('');\n };\n /**\n * Create background color element for the component\n *\n * @return {string}\n * An HTML string.\n *\n * @private\n */\n\n\n _proto.createElBgColor_ = function createElBgColor_() {\n var legendId = \"captions-background-\" + this.id_;\n return ['<fieldset class=\"vjs-bg-color vjs-track-setting\">', \"<legend id=\\\"\" + legendId + \"\\\">\", this.localize('Background'), '</legend>', this.createElSelect_('backgroundColor', legendId), '<span class=\"vjs-bg-opacity vjs-opacity\">', this.createElSelect_('backgroundOpacity', legendId), '</span>', '</fieldset>'].join('');\n };\n /**\n * Create window color element for the component\n *\n * @return {string}\n * An HTML string.\n *\n * @private\n */\n\n\n _proto.createElWinColor_ = function createElWinColor_() {\n var legendId = \"captions-window-\" + this.id_;\n return ['<fieldset class=\"vjs-window-color vjs-track-setting\">', \"<legend id=\\\"\" + legendId + \"\\\">\", this.localize('Window'), '</legend>', this.createElSelect_('windowColor', legendId), '<span class=\"vjs-window-opacity vjs-opacity\">', this.createElSelect_('windowOpacity', legendId), '</span>', '</fieldset>'].join('');\n };\n /**\n * Create color elements for the component\n *\n * @return {Element}\n * The element that was created\n *\n * @private\n */\n\n\n _proto.createElColors_ = function createElColors_() {\n return createEl('div', {\n className: 'vjs-track-settings-colors',\n innerHTML: [this.createElFgColor_(), this.createElBgColor_(), this.createElWinColor_()].join('')\n });\n };\n /**\n * Create font elements for the component\n *\n * @return {Element}\n * The element that was created.\n *\n * @private\n */\n\n\n _proto.createElFont_ = function createElFont_() {\n return createEl('div', {\n className: 'vjs-track-settings-font',\n innerHTML: ['<fieldset class=\"vjs-font-percent vjs-track-setting\">', this.createElSelect_('fontPercent', '', 'legend'), '</fieldset>', '<fieldset class=\"vjs-edge-style vjs-track-setting\">', this.createElSelect_('edgeStyle', '', 'legend'), '</fieldset>', '<fieldset class=\"vjs-font-family vjs-track-setting\">', this.createElSelect_('fontFamily', '', 'legend'), '</fieldset>'].join('')\n });\n };\n /**\n * Create controls for the component\n *\n * @return {Element}\n * The element that was created.\n *\n * @private\n */\n\n\n _proto.createElControls_ = function createElControls_() {\n var defaultsDescription = this.localize('restore all settings to the default values');\n return createEl('div', {\n className: 'vjs-track-settings-controls',\n innerHTML: [\"<button type=\\\"button\\\" class=\\\"vjs-default-button\\\" title=\\\"\" + defaultsDescription + \"\\\">\", this.localize('Reset'), \"<span class=\\\"vjs-control-text\\\"> \" + defaultsDescription + \"</span>\", '</button>', \"<button type=\\\"button\\\" class=\\\"vjs-done-button\\\">\" + this.localize('Done') + \"</button>\"].join('')\n });\n };\n\n _proto.content = function content() {\n return [this.createElColors_(), this.createElFont_(), this.createElControls_()];\n };\n\n _proto.label = function label() {\n return this.localize('Caption Settings Dialog');\n };\n\n _proto.description = function description() {\n return this.localize('Beginning of dialog window. Escape will cancel and close the window.');\n };\n\n _proto.buildCSSClass = function buildCSSClass() {\n return _ModalDialog.prototype.buildCSSClass.call(this) + ' vjs-text-track-settings';\n };\n /**\n * Gets an object of text track settings (or null).\n *\n * @return {Object}\n * An object with config values parsed from the DOM or localStorage.\n */\n\n\n _proto.getValues = function getValues() {\n var _this3 = this;\n\n return reduce(selectConfigs, function (accum, config, key) {\n var value = getSelectedOptionValue(_this3.$(config.selector), config.parser);\n\n if (value !== undefined) {\n accum[key] = value;\n }\n\n return accum;\n }, {});\n };\n /**\n * Sets text track settings from an object of values.\n *\n * @param {Object} values\n * An object with config values parsed from the DOM or localStorage.\n */\n\n\n _proto.setValues = function setValues(values) {\n var _this4 = this;\n\n each(selectConfigs, function (config, key) {\n setSelectedOption(_this4.$(config.selector), values[key], config.parser);\n });\n };\n /**\n * Sets all `<select>` elements to their default values.\n */\n\n\n _proto.setDefaults = function setDefaults() {\n var _this5 = this;\n\n each(selectConfigs, function (config) {\n var index = config.hasOwnProperty('default') ? config.default : 0;\n _this5.$(config.selector).selectedIndex = index;\n });\n };\n /**\n * Restore texttrack settings from localStorage\n */\n\n\n _proto.restoreSettings = function restoreSettings() {\n var values;\n\n try {\n values = JSON.parse(window$1.localStorage.getItem(LOCAL_STORAGE_KEY));\n } catch (err) {\n log.warn(err);\n }\n\n if (values) {\n this.setValues(values);\n }\n };\n /**\n * Save text track settings to localStorage\n */\n\n\n _proto.saveSettings = function saveSettings() {\n if (!this.options_.persistTextTrackSettings) {\n return;\n }\n\n var values = this.getValues();\n\n try {\n if (Object.keys(values).length) {\n window$1.localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(values));\n } else {\n window$1.localStorage.removeItem(LOCAL_STORAGE_KEY);\n }\n } catch (err) {\n log.warn(err);\n }\n };\n /**\n * Update display of text track settings\n */\n\n\n _proto.updateDisplay = function updateDisplay() {\n var ttDisplay = this.player_.getChild('textTrackDisplay');\n\n if (ttDisplay) {\n ttDisplay.updateDisplay();\n }\n };\n /**\n * conditionally blur the element and refocus the captions button\n *\n * @private\n */\n\n\n _proto.conditionalBlur_ = function conditionalBlur_() {\n this.previouslyActiveEl_ = null;\n this.off(document, 'keydown', this.handleKeyDown);\n var cb = this.player_.controlBar;\n var subsCapsBtn = cb && cb.subsCapsButton;\n var ccBtn = cb && cb.captionsButton;\n\n if (subsCapsBtn) {\n subsCapsBtn.focus();\n } else if (ccBtn) {\n ccBtn.focus();\n }\n };\n\n return TextTrackSettings;\n}(ModalDialog);\n\nComponent.registerComponent('TextTrackSettings', TextTrackSettings);\n\n/**\n * A Resize Manager. It is in charge of triggering `playerresize` on the player in the right conditions.\n *\n * It'll either create an iframe and use a debounced resize handler on it or use the new {@link https://wicg.github.io/ResizeObserver/|ResizeObserver}.\n *\n * If the ResizeObserver is available natively, it will be used. A polyfill can be passed in as an option.\n * If a `playerresize` event is not needed, the ResizeManager component can be removed from the player, see the example below.\n * @example <caption>How to disable the resize manager</caption>\n * const player = videojs('#vid', {\n * resizeManager: false\n * });\n *\n * @see {@link https://wicg.github.io/ResizeObserver/|ResizeObserver specification}\n *\n * @extends Component\n */\n\nvar ResizeManager =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(ResizeManager, _Component);\n\n /**\n * Create the ResizeManager.\n *\n * @param {Object} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of ResizeManager options.\n *\n * @param {Object} [options.ResizeObserver]\n * A polyfill for ResizeObserver can be passed in here.\n * If this is set to null it will ignore the native ResizeObserver and fall back to the iframe fallback.\n */\n function ResizeManager(player, options) {\n var _this;\n\n var RESIZE_OBSERVER_AVAILABLE = options.ResizeObserver || window$1.ResizeObserver; // if `null` was passed, we want to disable the ResizeObserver\n\n if (options.ResizeObserver === null) {\n RESIZE_OBSERVER_AVAILABLE = false;\n } // Only create an element when ResizeObserver isn't available\n\n\n var options_ = mergeOptions({\n createEl: !RESIZE_OBSERVER_AVAILABLE,\n reportTouchActivity: false\n }, options);\n _this = _Component.call(this, player, options_) || this;\n _this.ResizeObserver = options.ResizeObserver || window$1.ResizeObserver;\n _this.loadListener_ = null;\n _this.resizeObserver_ = null;\n _this.debouncedHandler_ = debounce(function () {\n _this.resizeHandler();\n }, 100, false, _assertThisInitialized(_assertThisInitialized(_this)));\n\n if (RESIZE_OBSERVER_AVAILABLE) {\n _this.resizeObserver_ = new _this.ResizeObserver(_this.debouncedHandler_);\n\n _this.resizeObserver_.observe(player.el());\n } else {\n _this.loadListener_ = function () {\n if (!_this.el_ || !_this.el_.contentWindow) {\n return;\n }\n\n on(_this.el_.contentWindow, 'resize', _this.debouncedHandler_);\n };\n\n _this.one('load', _this.loadListener_);\n }\n\n return _this;\n }\n\n var _proto = ResizeManager.prototype;\n\n _proto.createEl = function createEl() {\n return _Component.prototype.createEl.call(this, 'iframe', {\n className: 'vjs-resize-manager'\n });\n };\n /**\n * Called when a resize is triggered on the iframe or a resize is observed via the ResizeObserver\n *\n * @fires Player#playerresize\n */\n\n\n _proto.resizeHandler = function resizeHandler() {\n /**\n * Called when the player size has changed\n *\n * @event Player#playerresize\n * @type {EventTarget~Event}\n */\n // make sure player is still around to trigger\n // prevents this from causing an error after dispose\n if (!this.player_ || !this.player_.trigger) {\n return;\n }\n\n this.player_.trigger('playerresize');\n };\n\n _proto.dispose = function dispose() {\n if (this.debouncedHandler_) {\n this.debouncedHandler_.cancel();\n }\n\n if (this.resizeObserver_) {\n if (this.player_.el()) {\n this.resizeObserver_.unobserve(this.player_.el());\n }\n\n this.resizeObserver_.disconnect();\n }\n\n if (this.el_ && this.el_.contentWindow) {\n off(this.el_.contentWindow, 'resize', this.debouncedHandler_);\n }\n\n if (this.loadListener_) {\n this.off('load', this.loadListener_);\n }\n\n this.ResizeObserver = null;\n this.resizeObserver = null;\n this.debouncedHandler_ = null;\n this.loadListener_ = null;\n };\n\n return ResizeManager;\n}(Component);\n\nComponent.registerComponent('ResizeManager', ResizeManager);\n\n/* track when we are at the live edge, and other helpers for live playback */\n\nvar LiveTracker =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(LiveTracker, _Component);\n\n function LiveTracker(player, options) {\n var _this;\n\n // LiveTracker does not need an element\n var options_ = mergeOptions({\n createEl: false\n }, options);\n _this = _Component.call(this, player, options_) || this;\n\n _this.reset_();\n\n _this.on(_this.player_, 'durationchange', _this.handleDurationchange);\n\n return _this;\n }\n\n var _proto = LiveTracker.prototype;\n\n _proto.isBehind_ = function isBehind_() {\n // don't report that we are behind until a timeupdate has been seen\n if (!this.timeupdateSeen_) {\n return false;\n }\n\n var liveCurrentTime = this.liveCurrentTime();\n var currentTime = this.player_.currentTime();\n var seekableIncrement = this.seekableIncrement_; // the live edge window is the amount of seconds away from live\n // that a player can be, but still be considered live.\n // we add 0.07 because the live tracking happens every 30ms\n // and we want some wiggle room for short segment live playback\n\n var liveEdgeWindow = seekableIncrement * 2 + 0.07; // on Android liveCurrentTime can bee Infinity, because seekableEnd\n // can be Infinity, so we handle that case.\n\n return liveCurrentTime !== Infinity && liveCurrentTime - liveEdgeWindow >= currentTime;\n }; // all the functionality for tracking when seek end changes\n // and for tracking how far past seek end we should be\n\n\n _proto.trackLive_ = function trackLive_() {\n this.pastSeekEnd_ = this.pastSeekEnd_;\n var seekable = this.player_.seekable(); // skip undefined seekable\n\n if (!seekable || !seekable.length) {\n return;\n }\n\n var newSeekEnd = this.seekableEnd(); // we can only tell if we are behind live, when seekable changes\n // once we detect that seekable has changed we check the new seek\n // end against current time, with a fudge value of half a second.\n\n if (newSeekEnd !== this.lastSeekEnd_) {\n if (this.lastSeekEnd_) {\n this.seekableIncrement_ = Math.abs(newSeekEnd - this.lastSeekEnd_);\n }\n\n this.pastSeekEnd_ = 0;\n this.lastSeekEnd_ = newSeekEnd;\n this.trigger('seekableendchange');\n }\n\n this.pastSeekEnd_ = this.pastSeekEnd() + 0.03;\n\n if (this.isBehind_() !== this.behindLiveEdge()) {\n this.behindLiveEdge_ = this.isBehind_();\n this.trigger('liveedgechange');\n }\n };\n /**\n * handle a durationchange event on the player\n * and start/stop tracking accordingly.\n */\n\n\n _proto.handleDurationchange = function handleDurationchange() {\n if (this.player_.duration() === Infinity) {\n this.startTracking();\n } else {\n this.stopTracking();\n }\n };\n /**\n * start tracking live playback\n */\n\n\n _proto.startTracking = function startTracking() {\n var _this2 = this;\n\n if (this.isTracking()) {\n return;\n }\n\n this.trackingInterval_ = this.setInterval(this.trackLive_, 30);\n this.trackLive_();\n this.on(this.player_, 'play', this.trackLive_);\n this.on(this.player_, 'pause', this.trackLive_);\n this.one(this.player_, 'play', this.handlePlay); // this is to prevent showing that we are not live\n // before a video starts to play\n\n if (!this.timeupdateSeen_) {\n this.handleTimeupdate = function () {\n _this2.timeupdateSeen_ = true;\n _this2.handleTimeupdate = null;\n };\n\n this.one(this.player_, 'timeupdate', this.handleTimeupdate);\n }\n };\n\n _proto.handlePlay = function handlePlay() {\n this.one(this.player_, 'timeupdate', this.seekToLiveEdge);\n };\n /**\n * Stop tracking, and set all internal variables to\n * their initial value.\n */\n\n\n _proto.reset_ = function reset_() {\n this.pastSeekEnd_ = 0;\n this.lastSeekEnd_ = null;\n this.behindLiveEdge_ = null;\n this.timeupdateSeen_ = false;\n this.clearInterval(this.trackingInterval_);\n this.trackingInterval_ = null;\n this.seekableIncrement_ = 12;\n this.off(this.player_, 'play', this.trackLive_);\n this.off(this.player_, 'pause', this.trackLive_);\n this.off(this.player_, 'play', this.handlePlay);\n this.off(this.player_, 'timeupdate', this.seekToLiveEdge);\n\n if (this.handleTimeupdate) {\n this.off(this.player_, 'timeupdate', this.handleTimeupdate);\n this.handleTimeupdate = null;\n }\n };\n /**\n * stop tracking live playback\n */\n\n\n _proto.stopTracking = function stopTracking() {\n if (!this.isTracking()) {\n return;\n }\n\n this.reset_();\n };\n /**\n * A helper to get the player seekable end\n * so that we don't have to null check everywhere\n */\n\n\n _proto.seekableEnd = function seekableEnd() {\n var seekable = this.player_.seekable();\n var seekableEnds = [];\n var i = seekable ? seekable.length : 0;\n\n while (i--) {\n seekableEnds.push(seekable.end(i));\n } // grab the furthest seekable end after sorting, or if there are none\n // default to Infinity\n\n\n return seekableEnds.length ? seekableEnds.sort()[seekableEnds.length - 1] : Infinity;\n };\n /**\n * A helper to get the player seekable start\n * so that we don't have to null check everywhere\n */\n\n\n _proto.seekableStart = function seekableStart() {\n var seekable = this.player_.seekable();\n var seekableStarts = [];\n var i = seekable ? seekable.length : 0;\n\n while (i--) {\n seekableStarts.push(seekable.start(i));\n } // grab the first seekable start after sorting, or if there are none\n // default to 0\n\n\n return seekableStarts.length ? seekableStarts.sort()[0] : 0;\n };\n /**\n * Get the live time window\n */\n\n\n _proto.liveWindow = function liveWindow() {\n var liveCurrentTime = this.liveCurrentTime();\n\n if (liveCurrentTime === Infinity) {\n return Infinity;\n }\n\n return liveCurrentTime - this.seekableStart();\n };\n /**\n * Determines if the player is live, only checks if this component\n * is tracking live playback or not\n */\n\n\n _proto.isLive = function isLive() {\n return this.isTracking();\n };\n /**\n * Determines if currentTime is at the live edge and won't fall behind\n * on each seekableendchange\n */\n\n\n _proto.atLiveEdge = function atLiveEdge() {\n return !this.behindLiveEdge();\n };\n /**\n * get what we expect the live current time to be\n */\n\n\n _proto.liveCurrentTime = function liveCurrentTime() {\n return this.pastSeekEnd() + this.seekableEnd();\n };\n /**\n * Returns how far past seek end we expect current time to be\n */\n\n\n _proto.pastSeekEnd = function pastSeekEnd() {\n return this.pastSeekEnd_;\n };\n /**\n * If we are currently behind the live edge, aka currentTime will be\n * behind on a seekableendchange\n */\n\n\n _proto.behindLiveEdge = function behindLiveEdge() {\n return this.behindLiveEdge_;\n };\n\n _proto.isTracking = function isTracking() {\n return typeof this.trackingInterval_ === 'number';\n };\n /**\n * Seek to the live edge if we are behind the live edge\n */\n\n\n _proto.seekToLiveEdge = function seekToLiveEdge() {\n if (this.atLiveEdge()) {\n return;\n }\n\n this.player_.currentTime(this.liveCurrentTime());\n\n if (this.player_.paused()) {\n this.player_.play();\n }\n };\n\n _proto.dispose = function dispose() {\n this.stopTracking();\n\n _Component.prototype.dispose.call(this);\n };\n\n return LiveTracker;\n}(Component);\n\nComponent.registerComponent('LiveTracker', LiveTracker);\n\n/**\n * This function is used to fire a sourceset when there is something\n * similar to `mediaEl.load()` being called. It will try to find the source via\n * the `src` attribute and then the `<source>` elements. It will then fire `sourceset`\n * with the source that was found or empty string if we cannot know. If it cannot\n * find a source then `sourceset` will not be fired.\n *\n * @param {Html5} tech\n * The tech object that sourceset was setup on\n *\n * @return {boolean}\n * returns false if the sourceset was not fired and true otherwise.\n */\n\nvar sourcesetLoad = function sourcesetLoad(tech) {\n var el = tech.el(); // if `el.src` is set, that source will be loaded.\n\n if (el.hasAttribute('src')) {\n tech.triggerSourceset(el.src);\n return true;\n }\n /**\n * Since there isn't a src property on the media element, source elements will be used for\n * implementing the source selection algorithm. This happens asynchronously and\n * for most cases were there is more than one source we cannot tell what source will\n * be loaded, without re-implementing the source selection algorithm. At this time we are not\n * going to do that. There are three special cases that we do handle here though:\n *\n * 1. If there are no sources, do not fire `sourceset`.\n * 2. If there is only one `<source>` with a `src` property/attribute that is our `src`\n * 3. If there is more than one `<source>` but all of them have the same `src` url.\n * That will be our src.\n */\n\n\n var sources = tech.$$('source');\n var srcUrls = [];\n var src = ''; // if there are no sources, do not fire sourceset\n\n if (!sources.length) {\n return false;\n } // only count valid/non-duplicate source elements\n\n\n for (var i = 0; i < sources.length; i++) {\n var url = sources[i].src;\n\n if (url && srcUrls.indexOf(url) === -1) {\n srcUrls.push(url);\n }\n } // there were no valid sources\n\n\n if (!srcUrls.length) {\n return false;\n } // there is only one valid source element url\n // use that\n\n\n if (srcUrls.length === 1) {\n src = srcUrls[0];\n }\n\n tech.triggerSourceset(src);\n return true;\n};\n/**\n * our implementation of an `innerHTML` descriptor for browsers\n * that do not have one.\n */\n\n\nvar innerHTMLDescriptorPolyfill = Object.defineProperty({}, 'innerHTML', {\n get: function get() {\n return this.cloneNode(true).innerHTML;\n },\n set: function set(v) {\n // make a dummy node to use innerHTML on\n var dummy = document.createElement(this.nodeName.toLowerCase()); // set innerHTML to the value provided\n\n dummy.innerHTML = v; // make a document fragment to hold the nodes from dummy\n\n var docFrag = document.createDocumentFragment(); // copy all of the nodes created by the innerHTML on dummy\n // to the document fragment\n\n while (dummy.childNodes.length) {\n docFrag.appendChild(dummy.childNodes[0]);\n } // remove content\n\n\n this.innerText = ''; // now we add all of that html in one by appending the\n // document fragment. This is how innerHTML does it.\n\n window$1.Element.prototype.appendChild.call(this, docFrag); // then return the result that innerHTML's setter would\n\n return this.innerHTML;\n }\n});\n/**\n * Get a property descriptor given a list of priorities and the\n * property to get.\n */\n\nvar getDescriptor = function getDescriptor(priority, prop) {\n var descriptor = {};\n\n for (var i = 0; i < priority.length; i++) {\n descriptor = Object.getOwnPropertyDescriptor(priority[i], prop);\n\n if (descriptor && descriptor.set && descriptor.get) {\n break;\n }\n }\n\n descriptor.enumerable = true;\n descriptor.configurable = true;\n return descriptor;\n};\n\nvar getInnerHTMLDescriptor = function getInnerHTMLDescriptor(tech) {\n return getDescriptor([tech.el(), window$1.HTMLMediaElement.prototype, window$1.Element.prototype, innerHTMLDescriptorPolyfill], 'innerHTML');\n};\n/**\n * Patches browser internal functions so that we can tell synchronously\n * if a `<source>` was appended to the media element. For some reason this\n * causes a `sourceset` if the the media element is ready and has no source.\n * This happens when:\n * - The page has just loaded and the media element does not have a source.\n * - The media element was emptied of all sources, then `load()` was called.\n *\n * It does this by patching the following functions/properties when they are supported:\n *\n * - `append()` - can be used to add a `<source>` element to the media element\n * - `appendChild()` - can be used to add a `<source>` element to the media element\n * - `insertAdjacentHTML()` - can be used to add a `<source>` element to the media element\n * - `innerHTML` - can be used to add a `<source>` element to the media element\n *\n * @param {Html5} tech\n * The tech object that sourceset is being setup on.\n */\n\n\nvar firstSourceWatch = function firstSourceWatch(tech) {\n var el = tech.el(); // make sure firstSourceWatch isn't setup twice.\n\n if (el.resetSourceWatch_) {\n return;\n }\n\n var old = {};\n var innerDescriptor = getInnerHTMLDescriptor(tech);\n\n var appendWrapper = function appendWrapper(appendFn) {\n return function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var retval = appendFn.apply(el, args);\n sourcesetLoad(tech);\n return retval;\n };\n };\n\n ['append', 'appendChild', 'insertAdjacentHTML'].forEach(function (k) {\n if (!el[k]) {\n return;\n } // store the old function\n\n\n old[k] = el[k]; // call the old function with a sourceset if a source\n // was loaded\n\n el[k] = appendWrapper(old[k]);\n });\n Object.defineProperty(el, 'innerHTML', mergeOptions(innerDescriptor, {\n set: appendWrapper(innerDescriptor.set)\n }));\n\n el.resetSourceWatch_ = function () {\n el.resetSourceWatch_ = null;\n Object.keys(old).forEach(function (k) {\n el[k] = old[k];\n });\n Object.defineProperty(el, 'innerHTML', innerDescriptor);\n }; // on the first sourceset, we need to revert our changes\n\n\n tech.one('sourceset', el.resetSourceWatch_);\n};\n/**\n * our implementation of a `src` descriptor for browsers\n * that do not have one.\n */\n\n\nvar srcDescriptorPolyfill = Object.defineProperty({}, 'src', {\n get: function get() {\n if (this.hasAttribute('src')) {\n return getAbsoluteURL(window$1.Element.prototype.getAttribute.call(this, 'src'));\n }\n\n return '';\n },\n set: function set(v) {\n window$1.Element.prototype.setAttribute.call(this, 'src', v);\n return v;\n }\n});\n\nvar getSrcDescriptor = function getSrcDescriptor(tech) {\n return getDescriptor([tech.el(), window$1.HTMLMediaElement.prototype, srcDescriptorPolyfill], 'src');\n};\n/**\n * setup `sourceset` handling on the `Html5` tech. This function\n * patches the following element properties/functions:\n *\n * - `src` - to determine when `src` is set\n * - `setAttribute()` - to determine when `src` is set\n * - `load()` - this re-triggers the source selection algorithm, and can\n * cause a sourceset.\n *\n * If there is no source when we are adding `sourceset` support or during a `load()`\n * we also patch the functions listed in `firstSourceWatch`.\n *\n * @param {Html5} tech\n * The tech to patch\n */\n\n\nvar setupSourceset = function setupSourceset(tech) {\n if (!tech.featuresSourceset) {\n return;\n }\n\n var el = tech.el(); // make sure sourceset isn't setup twice.\n\n if (el.resetSourceset_) {\n return;\n }\n\n var srcDescriptor = getSrcDescriptor(tech);\n var oldSetAttribute = el.setAttribute;\n var oldLoad = el.load;\n Object.defineProperty(el, 'src', mergeOptions(srcDescriptor, {\n set: function set(v) {\n var retval = srcDescriptor.set.call(el, v); // we use the getter here to get the actual value set on src\n\n tech.triggerSourceset(el.src);\n return retval;\n }\n }));\n\n el.setAttribute = function (n, v) {\n var retval = oldSetAttribute.call(el, n, v);\n\n if (/src/i.test(n)) {\n tech.triggerSourceset(el.src);\n }\n\n return retval;\n };\n\n el.load = function () {\n var retval = oldLoad.call(el); // if load was called, but there was no source to fire\n // sourceset on. We have to watch for a source append\n // as that can trigger a `sourceset` when the media element\n // has no source\n\n if (!sourcesetLoad(tech)) {\n tech.triggerSourceset('');\n firstSourceWatch(tech);\n }\n\n return retval;\n };\n\n if (el.currentSrc) {\n tech.triggerSourceset(el.currentSrc);\n } else if (!sourcesetLoad(tech)) {\n firstSourceWatch(tech);\n }\n\n el.resetSourceset_ = function () {\n el.resetSourceset_ = null;\n el.load = oldLoad;\n el.setAttribute = oldSetAttribute;\n Object.defineProperty(el, 'src', srcDescriptor);\n\n if (el.resetSourceWatch_) {\n el.resetSourceWatch_();\n }\n };\n};\n\nfunction _templateObject$1() {\n var data = _taggedTemplateLiteralLoose([\"Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\\n This may prevent text tracks from loading.\"]);\n\n _templateObject$1 = function _templateObject() {\n return data;\n };\n\n return data;\n}\n/**\n * HTML5 Media Controller - Wrapper for HTML5 Media API\n *\n * @mixes Tech~SourceHandlerAdditions\n * @extends Tech\n */\n\nvar Html5 =\n/*#__PURE__*/\nfunction (_Tech) {\n _inheritsLoose(Html5, _Tech);\n\n /**\n * Create an instance of this Tech.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Component~ReadyCallback} ready\n * Callback function to call when the `HTML5` Tech is ready.\n */\n function Html5(options, ready) {\n var _this;\n\n _this = _Tech.call(this, options, ready) || this;\n var source = options.source;\n var crossoriginTracks = false; // Set the source if one is provided\n // 1) Check if the source is new (if not, we want to keep the original so playback isn't interrupted)\n // 2) Check to see if the network state of the tag was failed at init, and if so, reset the source\n // anyway so the error gets fired.\n\n if (source && (_this.el_.currentSrc !== source.src || options.tag && options.tag.initNetworkState_ === 3)) {\n _this.setSource(source);\n } else {\n _this.handleLateInit_(_this.el_);\n } // setup sourceset after late sourceset/init\n\n\n if (options.enableSourceset) {\n _this.setupSourcesetHandling_();\n }\n\n if (_this.el_.hasChildNodes()) {\n var nodes = _this.el_.childNodes;\n var nodesLength = nodes.length;\n var removeNodes = [];\n\n while (nodesLength--) {\n var node = nodes[nodesLength];\n var nodeName = node.nodeName.toLowerCase();\n\n if (nodeName === 'track') {\n if (!_this.featuresNativeTextTracks) {\n // Empty video tag tracks so the built-in player doesn't use them also.\n // This may not be fast enough to stop HTML5 browsers from reading the tags\n // so we'll need to turn off any default tracks if we're manually doing\n // captions and subtitles. videoElement.textTracks\n removeNodes.push(node);\n } else {\n // store HTMLTrackElement and TextTrack to remote list\n _this.remoteTextTrackEls().addTrackElement_(node);\n\n _this.remoteTextTracks().addTrack(node.track);\n\n _this.textTracks().addTrack(node.track);\n\n if (!crossoriginTracks && !_this.el_.hasAttribute('crossorigin') && isCrossOrigin(node.src)) {\n crossoriginTracks = true;\n }\n }\n }\n }\n\n for (var i = 0; i < removeNodes.length; i++) {\n _this.el_.removeChild(removeNodes[i]);\n }\n }\n\n _this.proxyNativeTracks_();\n\n if (_this.featuresNativeTextTracks && crossoriginTracks) {\n log.warn(tsml(_templateObject$1()));\n } // prevent iOS Safari from disabling metadata text tracks during native playback\n\n\n _this.restoreMetadataTracksInIOSNativePlayer_(); // Determine if native controls should be used\n // Our goal should be to get the custom controls on mobile solid everywhere\n // so we can remove this all together. Right now this will block custom\n // controls on touch enabled laptops like the Chrome Pixel\n\n\n if ((TOUCH_ENABLED || IS_IPHONE || IS_NATIVE_ANDROID) && options.nativeControlsForTouch === true) {\n _this.setControls(true);\n } // on iOS, we want to proxy `webkitbeginfullscreen` and `webkitendfullscreen`\n // into a `fullscreenchange` event\n\n\n _this.proxyWebkitFullscreen_();\n\n _this.triggerReady();\n\n return _this;\n }\n /**\n * Dispose of `HTML5` media element and remove all tracks.\n */\n\n\n var _proto = Html5.prototype;\n\n _proto.dispose = function dispose() {\n if (this.el_ && this.el_.resetSourceset_) {\n this.el_.resetSourceset_();\n }\n\n Html5.disposeMediaElement(this.el_);\n this.options_ = null; // tech will handle clearing of the emulated track list\n\n _Tech.prototype.dispose.call(this);\n };\n /**\n * Modify the media element so that we can detect when\n * the source is changed. Fires `sourceset` just after the source has changed\n */\n\n\n _proto.setupSourcesetHandling_ = function setupSourcesetHandling_() {\n setupSourceset(this);\n };\n /**\n * When a captions track is enabled in the iOS Safari native player, all other\n * tracks are disabled (including metadata tracks), which nulls all of their\n * associated cue points. This will restore metadata tracks to their pre-fullscreen\n * state in those cases so that cue points are not needlessly lost.\n *\n * @private\n */\n\n\n _proto.restoreMetadataTracksInIOSNativePlayer_ = function restoreMetadataTracksInIOSNativePlayer_() {\n var textTracks = this.textTracks();\n var metadataTracksPreFullscreenState; // captures a snapshot of every metadata track's current state\n\n var takeMetadataTrackSnapshot = function takeMetadataTrackSnapshot() {\n metadataTracksPreFullscreenState = [];\n\n for (var i = 0; i < textTracks.length; i++) {\n var track = textTracks[i];\n\n if (track.kind === 'metadata') {\n metadataTracksPreFullscreenState.push({\n track: track,\n storedMode: track.mode\n });\n }\n }\n }; // snapshot each metadata track's initial state, and update the snapshot\n // each time there is a track 'change' event\n\n\n takeMetadataTrackSnapshot();\n textTracks.addEventListener('change', takeMetadataTrackSnapshot);\n this.on('dispose', function () {\n return textTracks.removeEventListener('change', takeMetadataTrackSnapshot);\n });\n\n var restoreTrackMode = function restoreTrackMode() {\n for (var i = 0; i < metadataTracksPreFullscreenState.length; i++) {\n var storedTrack = metadataTracksPreFullscreenState[i];\n\n if (storedTrack.track.mode === 'disabled' && storedTrack.track.mode !== storedTrack.storedMode) {\n storedTrack.track.mode = storedTrack.storedMode;\n }\n } // we only want this handler to be executed on the first 'change' event\n\n\n textTracks.removeEventListener('change', restoreTrackMode);\n }; // when we enter fullscreen playback, stop updating the snapshot and\n // restore all track modes to their pre-fullscreen state\n\n\n this.on('webkitbeginfullscreen', function () {\n textTracks.removeEventListener('change', takeMetadataTrackSnapshot); // remove the listener before adding it just in case it wasn't previously removed\n\n textTracks.removeEventListener('change', restoreTrackMode);\n textTracks.addEventListener('change', restoreTrackMode);\n }); // start updating the snapshot again after leaving fullscreen\n\n this.on('webkitendfullscreen', function () {\n // remove the listener before adding it just in case it wasn't previously removed\n textTracks.removeEventListener('change', takeMetadataTrackSnapshot);\n textTracks.addEventListener('change', takeMetadataTrackSnapshot); // remove the restoreTrackMode handler in case it wasn't triggered during fullscreen playback\n\n textTracks.removeEventListener('change', restoreTrackMode);\n });\n };\n /**\n * Attempt to force override of tracks for the given type\n *\n * @param {string} type - Track type to override, possible values include 'Audio',\n * 'Video', and 'Text'.\n * @param {boolean} override - If set to true native audio/video will be overridden,\n * otherwise native audio/video will potentially be used.\n * @private\n */\n\n\n _proto.overrideNative_ = function overrideNative_(type, override) {\n var _this2 = this;\n\n // If there is no behavioral change don't add/remove listeners\n if (override !== this[\"featuresNative\" + type + \"Tracks\"]) {\n return;\n }\n\n var lowerCaseType = type.toLowerCase();\n\n if (this[lowerCaseType + \"TracksListeners_\"]) {\n Object.keys(this[lowerCaseType + \"TracksListeners_\"]).forEach(function (eventName) {\n var elTracks = _this2.el()[lowerCaseType + \"Tracks\"];\n\n elTracks.removeEventListener(eventName, _this2[lowerCaseType + \"TracksListeners_\"][eventName]);\n });\n }\n\n this[\"featuresNative\" + type + \"Tracks\"] = !override;\n this[lowerCaseType + \"TracksListeners_\"] = null;\n this.proxyNativeTracksForType_(lowerCaseType);\n };\n /**\n * Attempt to force override of native audio tracks.\n *\n * @param {boolean} override - If set to true native audio will be overridden,\n * otherwise native audio will potentially be used.\n */\n\n\n _proto.overrideNativeAudioTracks = function overrideNativeAudioTracks(override) {\n this.overrideNative_('Audio', override);\n };\n /**\n * Attempt to force override of native video tracks.\n *\n * @param {boolean} override - If set to true native video will be overridden,\n * otherwise native video will potentially be used.\n */\n\n\n _proto.overrideNativeVideoTracks = function overrideNativeVideoTracks(override) {\n this.overrideNative_('Video', override);\n };\n /**\n * Proxy native track list events for the given type to our track\n * lists if the browser we are playing in supports that type of track list.\n *\n * @param {string} name - Track type; values include 'audio', 'video', and 'text'\n * @private\n */\n\n\n _proto.proxyNativeTracksForType_ = function proxyNativeTracksForType_(name) {\n var _this3 = this;\n\n var props = NORMAL[name];\n var elTracks = this.el()[props.getterName];\n var techTracks = this[props.getterName]();\n\n if (!this[\"featuresNative\" + props.capitalName + \"Tracks\"] || !elTracks || !elTracks.addEventListener) {\n return;\n }\n\n var listeners = {\n change: function change(e) {\n techTracks.trigger({\n type: 'change',\n target: techTracks,\n currentTarget: techTracks,\n srcElement: techTracks\n });\n },\n addtrack: function addtrack(e) {\n techTracks.addTrack(e.track);\n },\n removetrack: function removetrack(e) {\n techTracks.removeTrack(e.track);\n }\n };\n\n var removeOldTracks = function removeOldTracks() {\n var removeTracks = [];\n\n for (var i = 0; i < techTracks.length; i++) {\n var found = false;\n\n for (var j = 0; j < elTracks.length; j++) {\n if (elTracks[j] === techTracks[i]) {\n found = true;\n break;\n }\n }\n\n if (!found) {\n removeTracks.push(techTracks[i]);\n }\n }\n\n while (removeTracks.length) {\n techTracks.removeTrack(removeTracks.shift());\n }\n };\n\n this[props.getterName + 'Listeners_'] = listeners;\n Object.keys(listeners).forEach(function (eventName) {\n var listener = listeners[eventName];\n elTracks.addEventListener(eventName, listener);\n\n _this3.on('dispose', function (e) {\n return elTracks.removeEventListener(eventName, listener);\n });\n }); // Remove (native) tracks that are not used anymore\n\n this.on('loadstart', removeOldTracks);\n this.on('dispose', function (e) {\n return _this3.off('loadstart', removeOldTracks);\n });\n };\n /**\n * Proxy all native track list events to our track lists if the browser we are playing\n * in supports that type of track list.\n *\n * @private\n */\n\n\n _proto.proxyNativeTracks_ = function proxyNativeTracks_() {\n var _this4 = this;\n\n NORMAL.names.forEach(function (name) {\n _this4.proxyNativeTracksForType_(name);\n });\n };\n /**\n * Create the `Html5` Tech's DOM element.\n *\n * @return {Element}\n * The element that gets created.\n */\n\n\n _proto.createEl = function createEl$$1() {\n var el = this.options_.tag; // Check if this browser supports moving the element into the box.\n // On the iPhone video will break if you move the element,\n // So we have to create a brand new element.\n // If we ingested the player div, we do not need to move the media element.\n\n if (!el || !(this.options_.playerElIngest || this.movingMediaElementInDOM)) {\n // If the original tag is still there, clone and remove it.\n if (el) {\n var clone = el.cloneNode(true);\n\n if (el.parentNode) {\n el.parentNode.insertBefore(clone, el);\n }\n\n Html5.disposeMediaElement(el);\n el = clone;\n } else {\n el = document.createElement('video'); // determine if native controls should be used\n\n var tagAttributes = this.options_.tag && getAttributes(this.options_.tag);\n var attributes = mergeOptions({}, tagAttributes);\n\n if (!TOUCH_ENABLED || this.options_.nativeControlsForTouch !== true) {\n delete attributes.controls;\n }\n\n setAttributes(el, assign(attributes, {\n id: this.options_.techId,\n class: 'vjs-tech'\n }));\n }\n\n el.playerId = this.options_.playerId;\n }\n\n if (typeof this.options_.preload !== 'undefined') {\n setAttribute(el, 'preload', this.options_.preload);\n } // Update specific tag settings, in case they were overridden\n // `autoplay` has to be *last* so that `muted` and `playsinline` are present\n // when iOS/Safari or other browsers attempt to autoplay.\n\n\n var settingsAttrs = ['loop', 'muted', 'playsinline', 'autoplay'];\n\n for (var i = 0; i < settingsAttrs.length; i++) {\n var attr = settingsAttrs[i];\n var value = this.options_[attr];\n\n if (typeof value !== 'undefined') {\n if (value) {\n setAttribute(el, attr, attr);\n } else {\n removeAttribute(el, attr);\n }\n\n el[attr] = value;\n }\n }\n\n return el;\n };\n /**\n * This will be triggered if the loadstart event has already fired, before videojs was\n * ready. Two known examples of when this can happen are:\n * 1. If we're loading the playback object after it has started loading\n * 2. The media is already playing the (often with autoplay on) then\n *\n * This function will fire another loadstart so that videojs can catchup.\n *\n * @fires Tech#loadstart\n *\n * @return {undefined}\n * returns nothing.\n */\n\n\n _proto.handleLateInit_ = function handleLateInit_(el) {\n if (el.networkState === 0 || el.networkState === 3) {\n // The video element hasn't started loading the source yet\n // or didn't find a source\n return;\n }\n\n if (el.readyState === 0) {\n // NetworkState is set synchronously BUT loadstart is fired at the\n // end of the current stack, usually before setInterval(fn, 0).\n // So at this point we know loadstart may have already fired or is\n // about to fire, and either way the player hasn't seen it yet.\n // We don't want to fire loadstart prematurely here and cause a\n // double loadstart so we'll wait and see if it happens between now\n // and the next loop, and fire it if not.\n // HOWEVER, we also want to make sure it fires before loadedmetadata\n // which could also happen between now and the next loop, so we'll\n // watch for that also.\n var loadstartFired = false;\n\n var setLoadstartFired = function setLoadstartFired() {\n loadstartFired = true;\n };\n\n this.on('loadstart', setLoadstartFired);\n\n var triggerLoadstart = function triggerLoadstart() {\n // We did miss the original loadstart. Make sure the player\n // sees loadstart before loadedmetadata\n if (!loadstartFired) {\n this.trigger('loadstart');\n }\n };\n\n this.on('loadedmetadata', triggerLoadstart);\n this.ready(function () {\n this.off('loadstart', setLoadstartFired);\n this.off('loadedmetadata', triggerLoadstart);\n\n if (!loadstartFired) {\n // We did miss the original native loadstart. Fire it now.\n this.trigger('loadstart');\n }\n });\n return;\n } // From here on we know that loadstart already fired and we missed it.\n // The other readyState events aren't as much of a problem if we double\n // them, so not going to go to as much trouble as loadstart to prevent\n // that unless we find reason to.\n\n\n var eventsToTrigger = ['loadstart']; // loadedmetadata: newly equal to HAVE_METADATA (1) or greater\n\n eventsToTrigger.push('loadedmetadata'); // loadeddata: newly increased to HAVE_CURRENT_DATA (2) or greater\n\n if (el.readyState >= 2) {\n eventsToTrigger.push('loadeddata');\n } // canplay: newly increased to HAVE_FUTURE_DATA (3) or greater\n\n\n if (el.readyState >= 3) {\n eventsToTrigger.push('canplay');\n } // canplaythrough: newly equal to HAVE_ENOUGH_DATA (4)\n\n\n if (el.readyState >= 4) {\n eventsToTrigger.push('canplaythrough');\n } // We still need to give the player time to add event listeners\n\n\n this.ready(function () {\n eventsToTrigger.forEach(function (type) {\n this.trigger(type);\n }, this);\n });\n };\n /**\n * Set current time for the `HTML5` tech.\n *\n * @param {number} seconds\n * Set the current time of the media to this.\n */\n\n\n _proto.setCurrentTime = function setCurrentTime(seconds) {\n try {\n this.el_.currentTime = seconds;\n } catch (e) {\n log(e, 'Video is not ready. (Video.js)'); // this.warning(VideoJS.warnings.videoNotReady);\n }\n };\n /**\n * Get the current duration of the HTML5 media element.\n *\n * @return {number}\n * The duration of the media or 0 if there is no duration.\n */\n\n\n _proto.duration = function duration() {\n var _this5 = this;\n\n // Android Chrome will report duration as Infinity for VOD HLS until after\n // playback has started, which triggers the live display erroneously.\n // Return NaN if playback has not started and trigger a durationupdate once\n // the duration can be reliably known.\n if (this.el_.duration === Infinity && IS_ANDROID && IS_CHROME && this.el_.currentTime === 0) {\n // Wait for the first `timeupdate` with currentTime > 0 - there may be\n // several with 0\n var checkProgress = function checkProgress() {\n if (_this5.el_.currentTime > 0) {\n // Trigger durationchange for genuinely live video\n if (_this5.el_.duration === Infinity) {\n _this5.trigger('durationchange');\n }\n\n _this5.off('timeupdate', checkProgress);\n }\n };\n\n this.on('timeupdate', checkProgress);\n return NaN;\n }\n\n return this.el_.duration || NaN;\n };\n /**\n * Get the current width of the HTML5 media element.\n *\n * @return {number}\n * The width of the HTML5 media element.\n */\n\n\n _proto.width = function width() {\n return this.el_.offsetWidth;\n };\n /**\n * Get the current height of the HTML5 media element.\n *\n * @return {number}\n * The height of the HTML5 media element.\n */\n\n\n _proto.height = function height() {\n return this.el_.offsetHeight;\n };\n /**\n * Proxy iOS `webkitbeginfullscreen` and `webkitendfullscreen` into\n * `fullscreenchange` event.\n *\n * @private\n * @fires fullscreenchange\n * @listens webkitendfullscreen\n * @listens webkitbeginfullscreen\n * @listens webkitbeginfullscreen\n */\n\n\n _proto.proxyWebkitFullscreen_ = function proxyWebkitFullscreen_() {\n var _this6 = this;\n\n if (!('webkitDisplayingFullscreen' in this.el_)) {\n return;\n }\n\n var endFn = function endFn() {\n this.trigger('fullscreenchange', {\n isFullscreen: false\n });\n };\n\n var beginFn = function beginFn() {\n if ('webkitPresentationMode' in this.el_ && this.el_.webkitPresentationMode !== 'picture-in-picture') {\n this.one('webkitendfullscreen', endFn);\n this.trigger('fullscreenchange', {\n isFullscreen: true\n });\n }\n };\n\n this.on('webkitbeginfullscreen', beginFn);\n this.on('dispose', function () {\n _this6.off('webkitbeginfullscreen', beginFn);\n\n _this6.off('webkitendfullscreen', endFn);\n });\n };\n /**\n * Check if fullscreen is supported on the current playback device.\n *\n * @return {boolean}\n * - True if fullscreen is supported.\n * - False if fullscreen is not supported.\n */\n\n\n _proto.supportsFullScreen = function supportsFullScreen() {\n if (typeof this.el_.webkitEnterFullScreen === 'function') {\n var userAgent = window$1.navigator && window$1.navigator.userAgent || ''; // Seems to be broken in Chromium/Chrome && Safari in Leopard\n\n if (/Android/.test(userAgent) || !/Chrome|Mac OS X 10.5/.test(userAgent)) {\n return true;\n }\n }\n\n return false;\n };\n /**\n * Request that the `HTML5` Tech enter fullscreen.\n */\n\n\n _proto.enterFullScreen = function enterFullScreen() {\n var video = this.el_;\n\n if (video.paused && video.networkState <= video.HAVE_METADATA) {\n // attempt to prime the video element for programmatic access\n // this isn't necessary on the desktop but shouldn't hurt\n this.el_.play(); // playing and pausing synchronously during the transition to fullscreen\n // can get iOS ~6.1 devices into a play/pause loop\n\n this.setTimeout(function () {\n video.pause();\n video.webkitEnterFullScreen();\n }, 0);\n } else {\n video.webkitEnterFullScreen();\n }\n };\n /**\n * Request that the `HTML5` Tech exit fullscreen.\n */\n\n\n _proto.exitFullScreen = function exitFullScreen() {\n this.el_.webkitExitFullScreen();\n };\n /**\n * A getter/setter for the `Html5` Tech's source object.\n * > Note: Please use {@link Html5#setSource}\n *\n * @param {Tech~SourceObject} [src]\n * The source object you want to set on the `HTML5` techs element.\n *\n * @return {Tech~SourceObject|undefined}\n * - The current source object when a source is not passed in.\n * - undefined when setting\n *\n * @deprecated Since version 5.\n */\n\n\n _proto.src = function src(_src) {\n if (_src === undefined) {\n return this.el_.src;\n } // Setting src through `src` instead of `setSrc` will be deprecated\n\n\n this.setSrc(_src);\n };\n /**\n * Reset the tech by removing all sources and then calling\n * {@link Html5.resetMediaElement}.\n */\n\n\n _proto.reset = function reset() {\n Html5.resetMediaElement(this.el_);\n };\n /**\n * Get the current source on the `HTML5` Tech. Falls back to returning the source from\n * the HTML5 media element.\n *\n * @return {Tech~SourceObject}\n * The current source object from the HTML5 tech. With a fallback to the\n * elements source.\n */\n\n\n _proto.currentSrc = function currentSrc() {\n if (this.currentSource_) {\n return this.currentSource_.src;\n }\n\n return this.el_.currentSrc;\n };\n /**\n * Set controls attribute for the HTML5 media Element.\n *\n * @param {string} val\n * Value to set the controls attribute to\n */\n\n\n _proto.setControls = function setControls(val) {\n this.el_.controls = !!val;\n };\n /**\n * Create and returns a remote {@link TextTrack} object.\n *\n * @param {string} kind\n * `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata)\n *\n * @param {string} [label]\n * Label to identify the text track\n *\n * @param {string} [language]\n * Two letter language abbreviation\n *\n * @return {TextTrack}\n * The TextTrack that gets created.\n */\n\n\n _proto.addTextTrack = function addTextTrack(kind, label, language) {\n if (!this.featuresNativeTextTracks) {\n return _Tech.prototype.addTextTrack.call(this, kind, label, language);\n }\n\n return this.el_.addTextTrack(kind, label, language);\n };\n /**\n * Creates either native TextTrack or an emulated TextTrack depending\n * on the value of `featuresNativeTextTracks`\n *\n * @param {Object} options\n * The object should contain the options to initialize the TextTrack with.\n *\n * @param {string} [options.kind]\n * `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata).\n *\n * @param {string} [options.label]\n * Label to identify the text track\n *\n * @param {string} [options.language]\n * Two letter language abbreviation.\n *\n * @param {boolean} [options.default]\n * Default this track to on.\n *\n * @param {string} [options.id]\n * The internal id to assign this track.\n *\n * @param {string} [options.src]\n * A source url for the track.\n *\n * @return {HTMLTrackElement}\n * The track element that gets created.\n */\n\n\n _proto.createRemoteTextTrack = function createRemoteTextTrack(options) {\n if (!this.featuresNativeTextTracks) {\n return _Tech.prototype.createRemoteTextTrack.call(this, options);\n }\n\n var htmlTrackElement = document.createElement('track');\n\n if (options.kind) {\n htmlTrackElement.kind = options.kind;\n }\n\n if (options.label) {\n htmlTrackElement.label = options.label;\n }\n\n if (options.language || options.srclang) {\n htmlTrackElement.srclang = options.language || options.srclang;\n }\n\n if (options.default) {\n htmlTrackElement.default = options.default;\n }\n\n if (options.id) {\n htmlTrackElement.id = options.id;\n }\n\n if (options.src) {\n htmlTrackElement.src = options.src;\n }\n\n return htmlTrackElement;\n };\n /**\n * Creates a remote text track object and returns an html track element.\n *\n * @param {Object} options The object should contain values for\n * kind, language, label, and src (location of the WebVTT file)\n * @param {boolean} [manualCleanup=true] if set to false, the TextTrack will be\n * automatically removed from the video element whenever the source changes\n * @return {HTMLTrackElement} An Html Track Element.\n * This can be an emulated {@link HTMLTrackElement} or a native one.\n * @deprecated The default value of the \"manualCleanup\" parameter will default\n * to \"false\" in upcoming versions of Video.js\n */\n\n\n _proto.addRemoteTextTrack = function addRemoteTextTrack(options, manualCleanup) {\n var htmlTrackElement = _Tech.prototype.addRemoteTextTrack.call(this, options, manualCleanup);\n\n if (this.featuresNativeTextTracks) {\n this.el().appendChild(htmlTrackElement);\n }\n\n return htmlTrackElement;\n };\n /**\n * Remove remote `TextTrack` from `TextTrackList` object\n *\n * @param {TextTrack} track\n * `TextTrack` object to remove\n */\n\n\n _proto.removeRemoteTextTrack = function removeRemoteTextTrack(track) {\n _Tech.prototype.removeRemoteTextTrack.call(this, track);\n\n if (this.featuresNativeTextTracks) {\n var tracks = this.$$('track');\n var i = tracks.length;\n\n while (i--) {\n if (track === tracks[i] || track === tracks[i].track) {\n this.el().removeChild(tracks[i]);\n }\n }\n }\n };\n /**\n * Gets available media playback quality metrics as specified by the W3C's Media\n * Playback Quality API.\n *\n * @see [Spec]{@link https://wicg.github.io/media-playback-quality}\n *\n * @return {Object}\n * An object with supported media playback quality metrics\n */\n\n\n _proto.getVideoPlaybackQuality = function getVideoPlaybackQuality() {\n if (typeof this.el().getVideoPlaybackQuality === 'function') {\n return this.el().getVideoPlaybackQuality();\n }\n\n var videoPlaybackQuality = {};\n\n if (typeof this.el().webkitDroppedFrameCount !== 'undefined' && typeof this.el().webkitDecodedFrameCount !== 'undefined') {\n videoPlaybackQuality.droppedVideoFrames = this.el().webkitDroppedFrameCount;\n videoPlaybackQuality.totalVideoFrames = this.el().webkitDecodedFrameCount;\n }\n\n if (window$1.performance && typeof window$1.performance.now === 'function') {\n videoPlaybackQuality.creationTime = window$1.performance.now();\n } else if (window$1.performance && window$1.performance.timing && typeof window$1.performance.timing.navigationStart === 'number') {\n videoPlaybackQuality.creationTime = window$1.Date.now() - window$1.performance.timing.navigationStart;\n }\n\n return videoPlaybackQuality;\n };\n\n return Html5;\n}(Tech);\n/* HTML5 Support Testing ---------------------------------------------------- */\n\n\nif (isReal()) {\n /**\n * Element for testing browser HTML5 media capabilities\n *\n * @type {Element}\n * @constant\n * @private\n */\n Html5.TEST_VID = document.createElement('video');\n var track = document.createElement('track');\n track.kind = 'captions';\n track.srclang = 'en';\n track.label = 'English';\n Html5.TEST_VID.appendChild(track);\n}\n/**\n * Check if HTML5 media is supported by this browser/device.\n *\n * @return {boolean}\n * - True if HTML5 media is supported.\n * - False if HTML5 media is not supported.\n */\n\n\nHtml5.isSupported = function () {\n // IE with no Media Player is a LIAR! (#984)\n try {\n Html5.TEST_VID.volume = 0.5;\n } catch (e) {\n return false;\n }\n\n return !!(Html5.TEST_VID && Html5.TEST_VID.canPlayType);\n};\n/**\n * Check if the tech can support the given type\n *\n * @param {string} type\n * The mimetype to check\n * @return {string} 'probably', 'maybe', or '' (empty string)\n */\n\n\nHtml5.canPlayType = function (type) {\n return Html5.TEST_VID.canPlayType(type);\n};\n/**\n * Check if the tech can support the given source\n *\n * @param {Object} srcObj\n * The source object\n * @param {Object} options\n * The options passed to the tech\n * @return {string} 'probably', 'maybe', or '' (empty string)\n */\n\n\nHtml5.canPlaySource = function (srcObj, options) {\n return Html5.canPlayType(srcObj.type);\n};\n/**\n * Check if the volume can be changed in this browser/device.\n * Volume cannot be changed in a lot of mobile devices.\n * Specifically, it can't be changed from 1 on iOS.\n *\n * @return {boolean}\n * - True if volume can be controlled\n * - False otherwise\n */\n\n\nHtml5.canControlVolume = function () {\n // IE will error if Windows Media Player not installed #3315\n try {\n var volume = Html5.TEST_VID.volume;\n Html5.TEST_VID.volume = volume / 2 + 0.1;\n return volume !== Html5.TEST_VID.volume;\n } catch (e) {\n return false;\n }\n};\n/**\n * Check if the volume can be muted in this browser/device.\n * Some devices, e.g. iOS, don't allow changing volume\n * but permits muting/unmuting.\n *\n * @return {bolean}\n * - True if volume can be muted\n * - False otherwise\n */\n\n\nHtml5.canMuteVolume = function () {\n try {\n var muted = Html5.TEST_VID.muted; // in some versions of iOS muted property doesn't always\n // work, so we want to set both property and attribute\n\n Html5.TEST_VID.muted = !muted;\n\n if (Html5.TEST_VID.muted) {\n setAttribute(Html5.TEST_VID, 'muted', 'muted');\n } else {\n removeAttribute(Html5.TEST_VID, 'muted', 'muted');\n }\n\n return muted !== Html5.TEST_VID.muted;\n } catch (e) {\n return false;\n }\n};\n/**\n * Check if the playback rate can be changed in this browser/device.\n *\n * @return {boolean}\n * - True if playback rate can be controlled\n * - False otherwise\n */\n\n\nHtml5.canControlPlaybackRate = function () {\n // Playback rate API is implemented in Android Chrome, but doesn't do anything\n // https://github.com/videojs/video.js/issues/3180\n if (IS_ANDROID && IS_CHROME && CHROME_VERSION < 58) {\n return false;\n } // IE will error if Windows Media Player not installed #3315\n\n\n try {\n var playbackRate = Html5.TEST_VID.playbackRate;\n Html5.TEST_VID.playbackRate = playbackRate / 2 + 0.1;\n return playbackRate !== Html5.TEST_VID.playbackRate;\n } catch (e) {\n return false;\n }\n};\n/**\n * Check if we can override a video/audio elements attributes, with\n * Object.defineProperty.\n *\n * @return {boolean}\n * - True if builtin attributes can be overridden\n * - False otherwise\n */\n\n\nHtml5.canOverrideAttributes = function () {\n // if we cannot overwrite the src/innerHTML property, there is no support\n // iOS 7 safari for instance cannot do this.\n try {\n var noop = function noop() {};\n\n Object.defineProperty(document.createElement('video'), 'src', {\n get: noop,\n set: noop\n });\n Object.defineProperty(document.createElement('audio'), 'src', {\n get: noop,\n set: noop\n });\n Object.defineProperty(document.createElement('video'), 'innerHTML', {\n get: noop,\n set: noop\n });\n Object.defineProperty(document.createElement('audio'), 'innerHTML', {\n get: noop,\n set: noop\n });\n } catch (e) {\n return false;\n }\n\n return true;\n};\n/**\n * Check to see if native `TextTrack`s are supported by this browser/device.\n *\n * @return {boolean}\n * - True if native `TextTrack`s are supported.\n * - False otherwise\n */\n\n\nHtml5.supportsNativeTextTracks = function () {\n return IS_ANY_SAFARI || IS_IOS && IS_CHROME;\n};\n/**\n * Check to see if native `VideoTrack`s are supported by this browser/device\n *\n * @return {boolean}\n * - True if native `VideoTrack`s are supported.\n * - False otherwise\n */\n\n\nHtml5.supportsNativeVideoTracks = function () {\n return !!(Html5.TEST_VID && Html5.TEST_VID.videoTracks);\n};\n/**\n * Check to see if native `AudioTrack`s are supported by this browser/device\n *\n * @return {boolean}\n * - True if native `AudioTrack`s are supported.\n * - False otherwise\n */\n\n\nHtml5.supportsNativeAudioTracks = function () {\n return !!(Html5.TEST_VID && Html5.TEST_VID.audioTracks);\n};\n/**\n * An array of events available on the Html5 tech.\n *\n * @private\n * @type {Array}\n */\n\n\nHtml5.Events = ['loadstart', 'suspend', 'abort', 'error', 'emptied', 'stalled', 'loadedmetadata', 'loadeddata', 'canplay', 'canplaythrough', 'playing', 'waiting', 'seeking', 'seeked', 'ended', 'durationchange', 'timeupdate', 'progress', 'play', 'pause', 'ratechange', 'resize', 'volumechange'];\n/**\n * Boolean indicating whether the `Tech` supports volume control.\n *\n * @type {boolean}\n * @default {@link Html5.canControlVolume}\n */\n\nHtml5.prototype.featuresVolumeControl = Html5.canControlVolume();\n/**\n * Boolean indicating whether the `Tech` supports muting volume.\n *\n * @type {bolean}\n * @default {@link Html5.canMuteVolume}\n */\n\nHtml5.prototype.featuresMuteControl = Html5.canMuteVolume();\n/**\n * Boolean indicating whether the `Tech` supports changing the speed at which the media\n * plays. Examples:\n * - Set player to play 2x (twice) as fast\n * - Set player to play 0.5x (half) as fast\n *\n * @type {boolean}\n * @default {@link Html5.canControlPlaybackRate}\n */\n\nHtml5.prototype.featuresPlaybackRate = Html5.canControlPlaybackRate();\n/**\n * Boolean indicating whether the `Tech` supports the `sourceset` event.\n *\n * @type {boolean}\n * @default\n */\n\nHtml5.prototype.featuresSourceset = Html5.canOverrideAttributes();\n/**\n * Boolean indicating whether the `HTML5` tech currently supports the media element\n * moving in the DOM. iOS breaks if you move the media element, so this is set this to\n * false there. Everywhere else this should be true.\n *\n * @type {boolean}\n * @default\n */\n\nHtml5.prototype.movingMediaElementInDOM = !IS_IOS; // TODO: Previous comment: No longer appears to be used. Can probably be removed.\n// Is this true?\n\n/**\n * Boolean indicating whether the `HTML5` tech currently supports automatic media resize\n * when going into fullscreen.\n *\n * @type {boolean}\n * @default\n */\n\nHtml5.prototype.featuresFullscreenResize = true;\n/**\n * Boolean indicating whether the `HTML5` tech currently supports the progress event.\n * If this is false, manual `progress` events will be triggered instead.\n *\n * @type {boolean}\n * @default\n */\n\nHtml5.prototype.featuresProgressEvents = true;\n/**\n * Boolean indicating whether the `HTML5` tech currently supports the timeupdate event.\n * If this is false, manual `timeupdate` events will be triggered instead.\n *\n * @default\n */\n\nHtml5.prototype.featuresTimeupdateEvents = true;\n/**\n * Boolean indicating whether the `HTML5` tech currently supports native `TextTrack`s.\n *\n * @type {boolean}\n * @default {@link Html5.supportsNativeTextTracks}\n */\n\nHtml5.prototype.featuresNativeTextTracks = Html5.supportsNativeTextTracks();\n/**\n * Boolean indicating whether the `HTML5` tech currently supports native `VideoTrack`s.\n *\n * @type {boolean}\n * @default {@link Html5.supportsNativeVideoTracks}\n */\n\nHtml5.prototype.featuresNativeVideoTracks = Html5.supportsNativeVideoTracks();\n/**\n * Boolean indicating whether the `HTML5` tech currently supports native `AudioTrack`s.\n *\n * @type {boolean}\n * @default {@link Html5.supportsNativeAudioTracks}\n */\n\nHtml5.prototype.featuresNativeAudioTracks = Html5.supportsNativeAudioTracks(); // HTML5 Feature detection and Device Fixes --------------------------------- //\n\nvar canPlayType = Html5.TEST_VID && Html5.TEST_VID.constructor.prototype.canPlayType;\nvar mpegurlRE = /^application\\/(?:x-|vnd\\.apple\\.)mpegurl/i;\n\nHtml5.patchCanPlayType = function () {\n // Android 4.0 and above can play HLS to some extent but it reports being unable to do so\n // Firefox and Chrome report correctly\n if (ANDROID_VERSION >= 4.0 && !IS_FIREFOX && !IS_CHROME) {\n Html5.TEST_VID.constructor.prototype.canPlayType = function (type) {\n if (type && mpegurlRE.test(type)) {\n return 'maybe';\n }\n\n return canPlayType.call(this, type);\n };\n }\n};\n\nHtml5.unpatchCanPlayType = function () {\n var r = Html5.TEST_VID.constructor.prototype.canPlayType;\n Html5.TEST_VID.constructor.prototype.canPlayType = canPlayType;\n return r;\n}; // by default, patch the media element\n\n\nHtml5.patchCanPlayType();\n\nHtml5.disposeMediaElement = function (el) {\n if (!el) {\n return;\n }\n\n if (el.parentNode) {\n el.parentNode.removeChild(el);\n } // remove any child track or source nodes to prevent their loading\n\n\n while (el.hasChildNodes()) {\n el.removeChild(el.firstChild);\n } // remove any src reference. not setting `src=''` because that causes a warning\n // in firefox\n\n\n el.removeAttribute('src'); // force the media element to update its loading state by calling load()\n // however IE on Windows 7N has a bug that throws an error so need a try/catch (#793)\n\n if (typeof el.load === 'function') {\n // wrapping in an iife so it's not deoptimized (#1060#discussion_r10324473)\n (function () {\n try {\n el.load();\n } catch (e) {// not supported\n }\n })();\n }\n};\n\nHtml5.resetMediaElement = function (el) {\n if (!el) {\n return;\n }\n\n var sources = el.querySelectorAll('source');\n var i = sources.length;\n\n while (i--) {\n el.removeChild(sources[i]);\n } // remove any src reference.\n // not setting `src=''` because that throws an error\n\n\n el.removeAttribute('src');\n\n if (typeof el.load === 'function') {\n // wrapping in an iife so it's not deoptimized (#1060#discussion_r10324473)\n (function () {\n try {\n el.load();\n } catch (e) {// satisfy linter\n }\n })();\n }\n};\n/* Native HTML5 element property wrapping ----------------------------------- */\n// Wrap native boolean attributes with getters that check both property and attribute\n// The list is as followed:\n// muted, defaultMuted, autoplay, controls, loop, playsinline\n\n\n[\n/**\n * Get the value of `muted` from the media element. `muted` indicates\n * that the volume for the media should be set to silent. This does not actually change\n * the `volume` attribute.\n *\n * @method Html5#muted\n * @return {boolean}\n * - True if the value of `volume` should be ignored and the audio set to silent.\n * - False if the value of `volume` should be used.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-muted}\n */\n'muted',\n/**\n * Get the value of `defaultMuted` from the media element. `defaultMuted` indicates\n * whether the media should start muted or not. Only changes the default state of the\n * media. `muted` and `defaultMuted` can have different values. {@link Html5#muted} indicates the\n * current state.\n *\n * @method Html5#defaultMuted\n * @return {boolean}\n * - The value of `defaultMuted` from the media element.\n * - True indicates that the media should start muted.\n * - False indicates that the media should not start muted\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-defaultmuted}\n */\n'defaultMuted',\n/**\n * Get the value of `autoplay` from the media element. `autoplay` indicates\n * that the media should start to play as soon as the page is ready.\n *\n * @method Html5#autoplay\n * @return {boolean}\n * - The value of `autoplay` from the media element.\n * - True indicates that the media should start as soon as the page loads.\n * - False indicates that the media should not start as soon as the page loads.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-autoplay}\n */\n'autoplay',\n/**\n * Get the value of `controls` from the media element. `controls` indicates\n * whether the native media controls should be shown or hidden.\n *\n * @method Html5#controls\n * @return {boolean}\n * - The value of `controls` from the media element.\n * - True indicates that native controls should be showing.\n * - False indicates that native controls should be hidden.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-controls}\n */\n'controls',\n/**\n * Get the value of `loop` from the media element. `loop` indicates\n * that the media should return to the start of the media and continue playing once\n * it reaches the end.\n *\n * @method Html5#loop\n * @return {boolean}\n * - The value of `loop` from the media element.\n * - True indicates that playback should seek back to start once\n * the end of a media is reached.\n * - False indicates that playback should not loop back to the start when the\n * end of the media is reached.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-loop}\n */\n'loop',\n/**\n * Get the value of `playsinline` from the media element. `playsinline` indicates\n * to the browser that non-fullscreen playback is preferred when fullscreen\n * playback is the native default, such as in iOS Safari.\n *\n * @method Html5#playsinline\n * @return {boolean}\n * - The value of `playsinline` from the media element.\n * - True indicates that the media should play inline.\n * - False indicates that the media should not play inline.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/#attr-video-playsinline}\n */\n'playsinline'].forEach(function (prop) {\n Html5.prototype[prop] = function () {\n return this.el_[prop] || this.el_.hasAttribute(prop);\n };\n}); // Wrap native boolean attributes with setters that set both property and attribute\n// The list is as followed:\n// setMuted, setDefaultMuted, setAutoplay, setLoop, setPlaysinline\n// setControls is special-cased above\n\n[\n/**\n * Set the value of `muted` on the media element. `muted` indicates that the current\n * audio level should be silent.\n *\n * @method Html5#setMuted\n * @param {boolean} muted\n * - True if the audio should be set to silent\n * - False otherwise\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-muted}\n */\n'muted',\n/**\n * Set the value of `defaultMuted` on the media element. `defaultMuted` indicates that the current\n * audio level should be silent, but will only effect the muted level on intial playback..\n *\n * @method Html5.prototype.setDefaultMuted\n * @param {boolean} defaultMuted\n * - True if the audio should be set to silent\n * - False otherwise\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-defaultmuted}\n */\n'defaultMuted',\n/**\n * Set the value of `autoplay` on the media element. `autoplay` indicates\n * that the media should start to play as soon as the page is ready.\n *\n * @method Html5#setAutoplay\n * @param {boolean} autoplay\n * - True indicates that the media should start as soon as the page loads.\n * - False indicates that the media should not start as soon as the page loads.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-autoplay}\n */\n'autoplay',\n/**\n * Set the value of `loop` on the media element. `loop` indicates\n * that the media should return to the start of the media and continue playing once\n * it reaches the end.\n *\n * @method Html5#setLoop\n * @param {boolean} loop\n * - True indicates that playback should seek back to start once\n * the end of a media is reached.\n * - False indicates that playback should not loop back to the start when the\n * end of the media is reached.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-loop}\n */\n'loop',\n/**\n * Set the value of `playsinline` from the media element. `playsinline` indicates\n * to the browser that non-fullscreen playback is preferred when fullscreen\n * playback is the native default, such as in iOS Safari.\n *\n * @method Html5#setPlaysinline\n * @param {boolean} playsinline\n * - True indicates that the media should play inline.\n * - False indicates that the media should not play inline.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/#attr-video-playsinline}\n */\n'playsinline'].forEach(function (prop) {\n Html5.prototype['set' + toTitleCase(prop)] = function (v) {\n this.el_[prop] = v;\n\n if (v) {\n this.el_.setAttribute(prop, prop);\n } else {\n this.el_.removeAttribute(prop);\n }\n };\n}); // Wrap native properties with a getter\n// The list is as followed\n// paused, currentTime, buffered, volume, poster, preload, error, seeking\n// seekable, ended, playbackRate, defaultPlaybackRate, played, networkState\n// readyState, videoWidth, videoHeight\n\n[\n/**\n * Get the value of `paused` from the media element. `paused` indicates whether the media element\n * is currently paused or not.\n *\n * @method Html5#paused\n * @return {boolean}\n * The value of `paused` from the media element.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-paused}\n */\n'paused',\n/**\n * Get the value of `currentTime` from the media element. `currentTime` indicates\n * the current second that the media is at in playback.\n *\n * @method Html5#currentTime\n * @return {number}\n * The value of `currentTime` from the media element.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-currenttime}\n */\n'currentTime',\n/**\n * Get the value of `buffered` from the media element. `buffered` is a `TimeRange`\n * object that represents the parts of the media that are already downloaded and\n * available for playback.\n *\n * @method Html5#buffered\n * @return {TimeRange}\n * The value of `buffered` from the media element.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-buffered}\n */\n'buffered',\n/**\n * Get the value of `volume` from the media element. `volume` indicates\n * the current playback volume of audio for a media. `volume` will be a value from 0\n * (silent) to 1 (loudest and default).\n *\n * @method Html5#volume\n * @return {number}\n * The value of `volume` from the media element. Value will be between 0-1.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-a-volume}\n */\n'volume',\n/**\n * Get the value of `poster` from the media element. `poster` indicates\n * that the url of an image file that can/will be shown when no media data is available.\n *\n * @method Html5#poster\n * @return {string}\n * The value of `poster` from the media element. Value will be a url to an\n * image.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-video-poster}\n */\n'poster',\n/**\n * Get the value of `preload` from the media element. `preload` indicates\n * what should download before the media is interacted with. It can have the following\n * values:\n * - none: nothing should be downloaded\n * - metadata: poster and the first few frames of the media may be downloaded to get\n * media dimensions and other metadata\n * - auto: allow the media and metadata for the media to be downloaded before\n * interaction\n *\n * @method Html5#preload\n * @return {string}\n * The value of `preload` from the media element. Will be 'none', 'metadata',\n * or 'auto'.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-preload}\n */\n'preload',\n/**\n * Get the value of the `error` from the media element. `error` indicates any\n * MediaError that may have occurred during playback. If error returns null there is no\n * current error.\n *\n * @method Html5#error\n * @return {MediaError|null}\n * The value of `error` from the media element. Will be `MediaError` if there\n * is a current error and null otherwise.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-error}\n */\n'error',\n/**\n * Get the value of `seeking` from the media element. `seeking` indicates whether the\n * media is currently seeking to a new position or not.\n *\n * @method Html5#seeking\n * @return {boolean}\n * - The value of `seeking` from the media element.\n * - True indicates that the media is currently seeking to a new position.\n * - False indicates that the media is not seeking to a new position at this time.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-seeking}\n */\n'seeking',\n/**\n * Get the value of `seekable` from the media element. `seekable` returns a\n * `TimeRange` object indicating ranges of time that can currently be `seeked` to.\n *\n * @method Html5#seekable\n * @return {TimeRange}\n * The value of `seekable` from the media element. A `TimeRange` object\n * indicating the current ranges of time that can be seeked to.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-seekable}\n */\n'seekable',\n/**\n * Get the value of `ended` from the media element. `ended` indicates whether\n * the media has reached the end or not.\n *\n * @method Html5#ended\n * @return {boolean}\n * - The value of `ended` from the media element.\n * - True indicates that the media has ended.\n * - False indicates that the media has not ended.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-ended}\n */\n'ended',\n/**\n * Get the value of `playbackRate` from the media element. `playbackRate` indicates\n * the rate at which the media is currently playing back. Examples:\n * - if playbackRate is set to 2, media will play twice as fast.\n * - if playbackRate is set to 0.5, media will play half as fast.\n *\n * @method Html5#playbackRate\n * @return {number}\n * The value of `playbackRate` from the media element. A number indicating\n * the current playback speed of the media, where 1 is normal speed.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-playbackrate}\n */\n'playbackRate',\n/**\n * Get the value of `defaultPlaybackRate` from the media element. `defaultPlaybackRate` indicates\n * the rate at which the media is currently playing back. This value will not indicate the current\n * `playbackRate` after playback has started, use {@link Html5#playbackRate} for that.\n *\n * Examples:\n * - if defaultPlaybackRate is set to 2, media will play twice as fast.\n * - if defaultPlaybackRate is set to 0.5, media will play half as fast.\n *\n * @method Html5.prototype.defaultPlaybackRate\n * @return {number}\n * The value of `defaultPlaybackRate` from the media element. A number indicating\n * the current playback speed of the media, where 1 is normal speed.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-playbackrate}\n */\n'defaultPlaybackRate',\n/**\n * Get the value of `played` from the media element. `played` returns a `TimeRange`\n * object representing points in the media timeline that have been played.\n *\n * @method Html5#played\n * @return {TimeRange}\n * The value of `played` from the media element. A `TimeRange` object indicating\n * the ranges of time that have been played.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-played}\n */\n'played',\n/**\n * Get the value of `networkState` from the media element. `networkState` indicates\n * the current network state. It returns an enumeration from the following list:\n * - 0: NETWORK_EMPTY\n * - 1: NETWORK_IDLE\n * - 2: NETWORK_LOADING\n * - 3: NETWORK_NO_SOURCE\n *\n * @method Html5#networkState\n * @return {number}\n * The value of `networkState` from the media element. This will be a number\n * from the list in the description.\n *\n * @see [Spec] {@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-networkstate}\n */\n'networkState',\n/**\n * Get the value of `readyState` from the media element. `readyState` indicates\n * the current state of the media element. It returns an enumeration from the\n * following list:\n * - 0: HAVE_NOTHING\n * - 1: HAVE_METADATA\n * - 2: HAVE_CURRENT_DATA\n * - 3: HAVE_FUTURE_DATA\n * - 4: HAVE_ENOUGH_DATA\n *\n * @method Html5#readyState\n * @return {number}\n * The value of `readyState` from the media element. This will be a number\n * from the list in the description.\n *\n * @see [Spec] {@link https://www.w3.org/TR/html5/embedded-content-0.html#ready-states}\n */\n'readyState',\n/**\n * Get the value of `videoWidth` from the video element. `videoWidth` indicates\n * the current width of the video in css pixels.\n *\n * @method Html5#videoWidth\n * @return {number}\n * The value of `videoWidth` from the video element. This will be a number\n * in css pixels.\n *\n * @see [Spec] {@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-video-videowidth}\n */\n'videoWidth',\n/**\n * Get the value of `videoHeight` from the video element. `videoHeight` indicates\n * the current height of the video in css pixels.\n *\n * @method Html5#videoHeight\n * @return {number}\n * The value of `videoHeight` from the video element. This will be a number\n * in css pixels.\n *\n * @see [Spec] {@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-video-videowidth}\n */\n'videoHeight'].forEach(function (prop) {\n Html5.prototype[prop] = function () {\n return this.el_[prop];\n };\n}); // Wrap native properties with a setter in this format:\n// set + toTitleCase(name)\n// The list is as follows:\n// setVolume, setSrc, setPoster, setPreload, setPlaybackRate, setDefaultPlaybackRate\n\n[\n/**\n * Set the value of `volume` on the media element. `volume` indicates the current\n * audio level as a percentage in decimal form. This means that 1 is 100%, 0.5 is 50%, and\n * so on.\n *\n * @method Html5#setVolume\n * @param {number} percentAsDecimal\n * The volume percent as a decimal. Valid range is from 0-1.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-a-volume}\n */\n'volume',\n/**\n * Set the value of `src` on the media element. `src` indicates the current\n * {@link Tech~SourceObject} for the media.\n *\n * @method Html5#setSrc\n * @param {Tech~SourceObject} src\n * The source object to set as the current source.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-src}\n */\n'src',\n/**\n * Set the value of `poster` on the media element. `poster` is the url to\n * an image file that can/will be shown when no media data is available.\n *\n * @method Html5#setPoster\n * @param {string} poster\n * The url to an image that should be used as the `poster` for the media\n * element.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-poster}\n */\n'poster',\n/**\n * Set the value of `preload` on the media element. `preload` indicates\n * what should download before the media is interacted with. It can have the following\n * values:\n * - none: nothing should be downloaded\n * - metadata: poster and the first few frames of the media may be downloaded to get\n * media dimensions and other metadata\n * - auto: allow the media and metadata for the media to be downloaded before\n * interaction\n *\n * @method Html5#setPreload\n * @param {string} preload\n * The value of `preload` to set on the media element. Must be 'none', 'metadata',\n * or 'auto'.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-preload}\n */\n'preload',\n/**\n * Set the value of `playbackRate` on the media element. `playbackRate` indicates\n * the rate at which the media should play back. Examples:\n * - if playbackRate is set to 2, media will play twice as fast.\n * - if playbackRate is set to 0.5, media will play half as fast.\n *\n * @method Html5#setPlaybackRate\n * @return {number}\n * The value of `playbackRate` from the media element. A number indicating\n * the current playback speed of the media, where 1 is normal speed.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-playbackrate}\n */\n'playbackRate',\n/**\n * Set the value of `defaultPlaybackRate` on the media element. `defaultPlaybackRate` indicates\n * the rate at which the media should play back upon initial startup. Changing this value\n * after a video has started will do nothing. Instead you should used {@link Html5#setPlaybackRate}.\n *\n * Example Values:\n * - if playbackRate is set to 2, media will play twice as fast.\n * - if playbackRate is set to 0.5, media will play half as fast.\n *\n * @method Html5.prototype.setDefaultPlaybackRate\n * @return {number}\n * The value of `defaultPlaybackRate` from the media element. A number indicating\n * the current playback speed of the media, where 1 is normal speed.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-defaultplaybackrate}\n */\n'defaultPlaybackRate'].forEach(function (prop) {\n Html5.prototype['set' + toTitleCase(prop)] = function (v) {\n this.el_[prop] = v;\n };\n}); // wrap native functions with a function\n// The list is as follows:\n// pause, load, play\n\n[\n/**\n * A wrapper around the media elements `pause` function. This will call the `HTML5`\n * media elements `pause` function.\n *\n * @method Html5#pause\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-pause}\n */\n'pause',\n/**\n * A wrapper around the media elements `load` function. This will call the `HTML5`s\n * media element `load` function.\n *\n * @method Html5#load\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-load}\n */\n'load',\n/**\n * A wrapper around the media elements `play` function. This will call the `HTML5`s\n * media element `play` function.\n *\n * @method Html5#play\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-play}\n */\n'play'].forEach(function (prop) {\n Html5.prototype[prop] = function () {\n return this.el_[prop]();\n };\n});\nTech.withSourceHandlers(Html5);\n/**\n * Native source handler for Html5, simply passes the source to the media element.\n *\n * @property {Tech~SourceObject} source\n * The source object\n *\n * @property {Html5} tech\n * The instance of the HTML5 tech.\n */\n\nHtml5.nativeSourceHandler = {};\n/**\n * Check if the media element can play the given mime type.\n *\n * @param {string} type\n * The mimetype to check\n *\n * @return {string}\n * 'probably', 'maybe', or '' (empty string)\n */\n\nHtml5.nativeSourceHandler.canPlayType = function (type) {\n // IE without MediaPlayer throws an error (#519)\n try {\n return Html5.TEST_VID.canPlayType(type);\n } catch (e) {\n return '';\n }\n};\n/**\n * Check if the media element can handle a source natively.\n *\n * @param {Tech~SourceObject} source\n * The source object\n *\n * @param {Object} [options]\n * Options to be passed to the tech.\n *\n * @return {string}\n * 'probably', 'maybe', or '' (empty string).\n */\n\n\nHtml5.nativeSourceHandler.canHandleSource = function (source, options) {\n // If a type was provided we should rely on that\n if (source.type) {\n return Html5.nativeSourceHandler.canPlayType(source.type); // If no type, fall back to checking 'video/[EXTENSION]'\n } else if (source.src) {\n var ext = getFileExtension(source.src);\n return Html5.nativeSourceHandler.canPlayType(\"video/\" + ext);\n }\n\n return '';\n};\n/**\n * Pass the source to the native media element.\n *\n * @param {Tech~SourceObject} source\n * The source object\n *\n * @param {Html5} tech\n * The instance of the Html5 tech\n *\n * @param {Object} [options]\n * The options to pass to the source\n */\n\n\nHtml5.nativeSourceHandler.handleSource = function (source, tech, options) {\n tech.setSrc(source.src);\n};\n/**\n * A noop for the native dispose function, as cleanup is not needed.\n */\n\n\nHtml5.nativeSourceHandler.dispose = function () {}; // Register the native source handler\n\n\nHtml5.registerSourceHandler(Html5.nativeSourceHandler);\nTech.registerTech('Html5', Html5);\n\nfunction _templateObject$2() {\n var data = _taggedTemplateLiteralLoose([\"\\n Using the tech directly can be dangerous. I hope you know what you're doing.\\n See https://github.com/videojs/video.js/issues/2617 for more info.\\n \"]);\n\n _templateObject$2 = function _templateObject() {\n return data;\n };\n\n return data;\n}\n// on the player when they happen\n\nvar TECH_EVENTS_RETRIGGER = [\n/**\n * Fired while the user agent is downloading media data.\n *\n * @event Player#progress\n * @type {EventTarget~Event}\n */\n\n/**\n * Retrigger the `progress` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechProgress_\n * @fires Player#progress\n * @listens Tech#progress\n */\n'progress',\n/**\n * Fires when the loading of an audio/video is aborted.\n *\n * @event Player#abort\n * @type {EventTarget~Event}\n */\n\n/**\n * Retrigger the `abort` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechAbort_\n * @fires Player#abort\n * @listens Tech#abort\n */\n'abort',\n/**\n * Fires when the browser is intentionally not getting media data.\n *\n * @event Player#suspend\n * @type {EventTarget~Event}\n */\n\n/**\n * Retrigger the `suspend` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechSuspend_\n * @fires Player#suspend\n * @listens Tech#suspend\n */\n'suspend',\n/**\n * Fires when the current playlist is empty.\n *\n * @event Player#emptied\n * @type {EventTarget~Event}\n */\n\n/**\n * Retrigger the `emptied` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechEmptied_\n * @fires Player#emptied\n * @listens Tech#emptied\n */\n'emptied',\n/**\n * Fires when the browser is trying to get media data, but data is not available.\n *\n * @event Player#stalled\n * @type {EventTarget~Event}\n */\n\n/**\n * Retrigger the `stalled` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechStalled_\n * @fires Player#stalled\n * @listens Tech#stalled\n */\n'stalled',\n/**\n * Fires when the browser has loaded meta data for the audio/video.\n *\n * @event Player#loadedmetadata\n * @type {EventTarget~Event}\n */\n\n/**\n * Retrigger the `stalled` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechLoadedmetadata_\n * @fires Player#loadedmetadata\n * @listens Tech#loadedmetadata\n */\n'loadedmetadata',\n/**\n * Fires when the browser has loaded the current frame of the audio/video.\n *\n * @event Player#loadeddata\n * @type {event}\n */\n\n/**\n * Retrigger the `loadeddata` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechLoaddeddata_\n * @fires Player#loadeddata\n * @listens Tech#loadeddata\n */\n'loadeddata',\n/**\n * Fires when the current playback position has changed.\n *\n * @event Player#timeupdate\n * @type {event}\n */\n\n/**\n * Retrigger the `timeupdate` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechTimeUpdate_\n * @fires Player#timeupdate\n * @listens Tech#timeupdate\n */\n'timeupdate',\n/**\n * Fires when the video's intrinsic dimensions change\n *\n * @event Player#resize\n * @type {event}\n */\n\n/**\n * Retrigger the `resize` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechResize_\n * @fires Player#resize\n * @listens Tech#resize\n */\n'resize',\n/**\n * Fires when the volume has been changed\n *\n * @event Player#volumechange\n * @type {event}\n */\n\n/**\n * Retrigger the `volumechange` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechVolumechange_\n * @fires Player#volumechange\n * @listens Tech#volumechange\n */\n'volumechange',\n/**\n * Fires when the text track has been changed\n *\n * @event Player#texttrackchange\n * @type {event}\n */\n\n/**\n * Retrigger the `texttrackchange` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechTexttrackchange_\n * @fires Player#texttrackchange\n * @listens Tech#texttrackchange\n */\n'texttrackchange']; // events to queue when playback rate is zero\n// this is a hash for the sole purpose of mapping non-camel-cased event names\n// to camel-cased function names\n\nvar TECH_EVENTS_QUEUE = {\n canplay: 'CanPlay',\n canplaythrough: 'CanPlayThrough',\n playing: 'Playing',\n seeked: 'Seeked'\n};\nvar BREAKPOINT_ORDER = ['tiny', 'xsmall', 'small', 'medium', 'large', 'xlarge', 'huge'];\nvar BREAKPOINT_CLASSES = {}; // grep: vjs-layout-tiny\n// grep: vjs-layout-x-small\n// grep: vjs-layout-small\n// grep: vjs-layout-medium\n// grep: vjs-layout-large\n// grep: vjs-layout-x-large\n// grep: vjs-layout-huge\n\nBREAKPOINT_ORDER.forEach(function (k) {\n var v = k.charAt(0) === 'x' ? \"x-\" + k.substring(1) : k;\n BREAKPOINT_CLASSES[k] = \"vjs-layout-\" + v;\n});\nvar DEFAULT_BREAKPOINTS = {\n tiny: 210,\n xsmall: 320,\n small: 425,\n medium: 768,\n large: 1440,\n xlarge: 2560,\n huge: Infinity\n};\n/**\n * An instance of the `Player` class is created when any of the Video.js setup methods\n * are used to initialize a video.\n *\n * After an instance has been created it can be accessed globally in two ways:\n * 1. By calling `videojs('example_video_1');`\n * 2. By using it directly via `videojs.players.example_video_1;`\n *\n * @extends Component\n */\n\nvar Player =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(Player, _Component);\n\n /**\n * Create an instance of this class.\n *\n * @param {Element} tag\n * The original video DOM element used for configuring options.\n *\n * @param {Object} [options]\n * Object of option names and values.\n *\n * @param {Component~ReadyCallback} [ready]\n * Ready callback function.\n */\n function Player(tag, options, ready) {\n var _this;\n\n // Make sure tag ID exists\n tag.id = tag.id || options.id || \"vjs_video_\" + newGUID(); // Set Options\n // The options argument overrides options set in the video tag\n // which overrides globally set options.\n // This latter part coincides with the load order\n // (tag must exist before Player)\n\n options = assign(Player.getTagSettings(tag), options); // Delay the initialization of children because we need to set up\n // player properties first, and can't use `this` before `super()`\n\n options.initChildren = false; // Same with creating the element\n\n options.createEl = false; // don't auto mixin the evented mixin\n\n options.evented = false; // we don't want the player to report touch activity on itself\n // see enableTouchActivity in Component\n\n options.reportTouchActivity = false; // If language is not set, get the closest lang attribute\n\n if (!options.language) {\n if (typeof tag.closest === 'function') {\n var closest = tag.closest('[lang]');\n\n if (closest && closest.getAttribute) {\n options.language = closest.getAttribute('lang');\n }\n } else {\n var element = tag;\n\n while (element && element.nodeType === 1) {\n if (getAttributes(element).hasOwnProperty('lang')) {\n options.language = element.getAttribute('lang');\n break;\n }\n\n element = element.parentNode;\n }\n }\n } // Run base component initializing with new options\n\n\n _this = _Component.call(this, null, options, ready) || this; // create logger\n\n _this.log = createLogger$1(_this.id_); // Tracks when a tech changes the poster\n\n _this.isPosterFromTech_ = false; // Holds callback info that gets queued when playback rate is zero\n // and a seek is happening\n\n _this.queuedCallbacks_ = []; // Turn off API access because we're loading a new tech that might load asynchronously\n\n _this.isReady_ = false; // Init state hasStarted_\n\n _this.hasStarted_ = false; // Init state userActive_\n\n _this.userActive_ = false; // if the global option object was accidentally blown away by\n // someone, bail early with an informative error\n\n if (!_this.options_ || !_this.options_.techOrder || !_this.options_.techOrder.length) {\n throw new Error('No techOrder specified. Did you overwrite ' + 'videojs.options instead of just changing the ' + 'properties you want to override?');\n } // Store the original tag used to set options\n\n\n _this.tag = tag; // Store the tag attributes used to restore html5 element\n\n _this.tagAttributes = tag && getAttributes(tag); // Update current language\n\n _this.language(_this.options_.language); // Update Supported Languages\n\n\n if (options.languages) {\n // Normalise player option languages to lowercase\n var languagesToLower = {};\n Object.getOwnPropertyNames(options.languages).forEach(function (name$$1) {\n languagesToLower[name$$1.toLowerCase()] = options.languages[name$$1];\n });\n _this.languages_ = languagesToLower;\n } else {\n _this.languages_ = Player.prototype.options_.languages;\n } // Cache for video property values.\n\n\n _this.cache_ = {}; // Set poster\n\n _this.poster_ = options.poster || ''; // Set controls\n\n _this.controls_ = !!options.controls; // Set default values for lastVolume\n\n _this.cache_.lastVolume = 1; // Original tag settings stored in options\n // now remove immediately so native controls don't flash.\n // May be turned back on by HTML5 tech if nativeControlsForTouch is true\n\n tag.controls = false;\n tag.removeAttribute('controls'); // the attribute overrides the option\n\n if (tag.hasAttribute('autoplay')) {\n _this.options_.autoplay = true;\n } else {\n // otherwise use the setter to validate and\n // set the correct value.\n _this.autoplay(_this.options_.autoplay);\n }\n /*\n * Store the internal state of scrubbing\n *\n * @private\n * @return {Boolean} True if the user is scrubbing\n */\n\n\n _this.scrubbing_ = false;\n _this.el_ = _this.createEl(); // Set default value for lastPlaybackRate\n\n _this.cache_.lastPlaybackRate = _this.defaultPlaybackRate(); // Make this an evented object and use `el_` as its event bus.\n\n evented(_assertThisInitialized(_assertThisInitialized(_this)), {\n eventBusKey: 'el_'\n });\n\n if (_this.fluid_) {\n _this.on('playerreset', _this.updateStyleEl_);\n } // We also want to pass the original player options to each component and plugin\n // as well so they don't need to reach back into the player for options later.\n // We also need to do another copy of this.options_ so we don't end up with\n // an infinite loop.\n\n\n var playerOptionsCopy = mergeOptions(_this.options_); // Load plugins\n\n if (options.plugins) {\n var plugins = options.plugins;\n Object.keys(plugins).forEach(function (name$$1) {\n if (typeof this[name$$1] === 'function') {\n this[name$$1](plugins[name$$1]);\n } else {\n throw new Error(\"plugin \\\"\" + name$$1 + \"\\\" does not exist\");\n }\n }, _assertThisInitialized(_assertThisInitialized(_this)));\n }\n\n _this.options_.playerOptions = playerOptionsCopy;\n _this.middleware_ = [];\n\n _this.initChildren(); // Set isAudio based on whether or not an audio tag was used\n\n\n _this.isAudio(tag.nodeName.toLowerCase() === 'audio'); // Update controls className. Can't do this when the controls are initially\n // set because the element doesn't exist yet.\n\n\n if (_this.controls()) {\n _this.addClass('vjs-controls-enabled');\n } else {\n _this.addClass('vjs-controls-disabled');\n } // Set ARIA label and region role depending on player type\n\n\n _this.el_.setAttribute('role', 'region');\n\n if (_this.isAudio()) {\n _this.el_.setAttribute('aria-label', _this.localize('Audio Player'));\n } else {\n _this.el_.setAttribute('aria-label', _this.localize('Video Player'));\n }\n\n if (_this.isAudio()) {\n _this.addClass('vjs-audio');\n }\n\n if (_this.flexNotSupported_()) {\n _this.addClass('vjs-no-flex');\n } // TODO: Make this smarter. Toggle user state between touching/mousing\n // using events, since devices can have both touch and mouse events.\n // if (browser.TOUCH_ENABLED) {\n // this.addClass('vjs-touch-enabled');\n // }\n // iOS Safari has broken hover handling\n\n\n if (!IS_IOS) {\n _this.addClass('vjs-workinghover');\n } // Make player easily findable by ID\n\n\n Player.players[_this.id_] = _assertThisInitialized(_assertThisInitialized(_this)); // Add a major version class to aid css in plugins\n\n var majorVersion = version.split('.')[0];\n\n _this.addClass(\"vjs-v\" + majorVersion); // When the player is first initialized, trigger activity so components\n // like the control bar show themselves if needed\n\n\n _this.userActive(true);\n\n _this.reportUserActivity();\n\n _this.one('play', _this.listenForUserActivity_);\n\n _this.on('fullscreenchange', _this.handleFullscreenChange_);\n\n _this.on('stageclick', _this.handleStageClick_);\n\n _this.breakpoints(_this.options_.breakpoints);\n\n _this.responsive(_this.options_.responsive);\n\n _this.changingSrc_ = false;\n _this.playWaitingForReady_ = false;\n _this.playOnLoadstart_ = null;\n return _this;\n }\n /**\n * Destroys the video player and does any necessary cleanup.\n *\n * This is especially helpful if you are dynamically adding and removing videos\n * to/from the DOM.\n *\n * @fires Player#dispose\n */\n\n\n var _proto = Player.prototype;\n\n _proto.dispose = function dispose() {\n /**\n * Called when the player is being disposed of.\n *\n * @event Player#dispose\n * @type {EventTarget~Event}\n */\n this.trigger('dispose'); // prevent dispose from being called twice\n\n this.off('dispose');\n\n if (this.styleEl_ && this.styleEl_.parentNode) {\n this.styleEl_.parentNode.removeChild(this.styleEl_);\n this.styleEl_ = null;\n } // Kill reference to this player\n\n\n Player.players[this.id_] = null;\n\n if (this.tag && this.tag.player) {\n this.tag.player = null;\n }\n\n if (this.el_ && this.el_.player) {\n this.el_.player = null;\n }\n\n if (this.tech_) {\n this.tech_.dispose();\n this.isPosterFromTech_ = false;\n this.poster_ = '';\n }\n\n if (this.playerElIngest_) {\n this.playerElIngest_ = null;\n }\n\n if (this.tag) {\n this.tag = null;\n }\n\n clearCacheForPlayer(this); // the actual .el_ is removed here\n\n _Component.prototype.dispose.call(this);\n };\n /**\n * Create the `Player`'s DOM element.\n *\n * @return {Element}\n * The DOM element that gets created.\n */\n\n\n _proto.createEl = function createEl$$1() {\n var tag = this.tag;\n var el;\n var playerElIngest = this.playerElIngest_ = tag.parentNode && tag.parentNode.hasAttribute && tag.parentNode.hasAttribute('data-vjs-player');\n var divEmbed = this.tag.tagName.toLowerCase() === 'video-js';\n\n if (playerElIngest) {\n el = this.el_ = tag.parentNode;\n } else if (!divEmbed) {\n el = this.el_ = _Component.prototype.createEl.call(this, 'div');\n } // Copy over all the attributes from the tag, including ID and class\n // ID will now reference player box, not the video tag\n\n\n var attrs = getAttributes(tag);\n\n if (divEmbed) {\n el = this.el_ = tag;\n tag = this.tag = document.createElement('video');\n\n while (el.children.length) {\n tag.appendChild(el.firstChild);\n }\n\n if (!hasClass(el, 'video-js')) {\n addClass(el, 'video-js');\n }\n\n el.appendChild(tag);\n playerElIngest = this.playerElIngest_ = el; // move properties over from our custom `video-js` element\n // to our new `video` element. This will move things like\n // `src` or `controls` that were set via js before the player\n // was initialized.\n\n Object.keys(el).forEach(function (k) {\n tag[k] = el[k];\n });\n } // set tabindex to -1 to remove the video element from the focus order\n\n\n tag.setAttribute('tabindex', '-1');\n attrs.tabindex = '-1'; // Workaround for #4583 (JAWS+IE doesn't announce BPB or play button)\n // See https://github.com/FreedomScientific/VFO-standards-support/issues/78\n // Note that we can't detect if JAWS is being used, but this ARIA attribute\n // doesn't change behavior of IE11 if JAWS is not being used\n\n if (IE_VERSION) {\n tag.setAttribute('role', 'application');\n attrs.role = 'application';\n } // Remove width/height attrs from tag so CSS can make it 100% width/height\n\n\n tag.removeAttribute('width');\n tag.removeAttribute('height');\n\n if ('width' in attrs) {\n delete attrs.width;\n }\n\n if ('height' in attrs) {\n delete attrs.height;\n }\n\n Object.getOwnPropertyNames(attrs).forEach(function (attr) {\n // don't copy over the class attribute to the player element when we're in a div embed\n // the class is already set up properly in the divEmbed case\n // and we want to make sure that the `video-js` class doesn't get lost\n if (!(divEmbed && attr === 'class')) {\n el.setAttribute(attr, attrs[attr]);\n }\n\n if (divEmbed) {\n tag.setAttribute(attr, attrs[attr]);\n }\n }); // Update tag id/class for use as HTML5 playback tech\n // Might think we should do this after embedding in container so .vjs-tech class\n // doesn't flash 100% width/height, but class only applies with .video-js parent\n\n tag.playerId = tag.id;\n tag.id += '_html5_api';\n tag.className = 'vjs-tech'; // Make player findable on elements\n\n tag.player = el.player = this; // Default state of video is paused\n\n this.addClass('vjs-paused'); // Add a style element in the player that we'll use to set the width/height\n // of the player in a way that's still overrideable by CSS, just like the\n // video element\n\n if (window$1.VIDEOJS_NO_DYNAMIC_STYLE !== true) {\n this.styleEl_ = createStyleElement('vjs-styles-dimensions');\n var defaultsStyleEl = $('.vjs-styles-defaults');\n var head = $('head');\n head.insertBefore(this.styleEl_, defaultsStyleEl ? defaultsStyleEl.nextSibling : head.firstChild);\n }\n\n this.fill_ = false;\n this.fluid_ = false; // Pass in the width/height/aspectRatio options which will update the style el\n\n this.width(this.options_.width);\n this.height(this.options_.height);\n this.fill(this.options_.fill);\n this.fluid(this.options_.fluid);\n this.aspectRatio(this.options_.aspectRatio); // Hide any links within the video/audio tag,\n // because IE doesn't hide them completely from screen readers.\n\n var links = tag.getElementsByTagName('a');\n\n for (var i = 0; i < links.length; i++) {\n var linkEl = links.item(i);\n addClass(linkEl, 'vjs-hidden');\n linkEl.setAttribute('hidden', 'hidden');\n } // insertElFirst seems to cause the networkState to flicker from 3 to 2, so\n // keep track of the original for later so we can know if the source originally failed\n\n\n tag.initNetworkState_ = tag.networkState; // Wrap video tag in div (el/box) container\n\n if (tag.parentNode && !playerElIngest) {\n tag.parentNode.insertBefore(el, tag);\n } // insert the tag as the first child of the player element\n // then manually add it to the children array so that this.addChild\n // will work properly for other components\n //\n // Breaks iPhone, fixed in HTML5 setup.\n\n\n prependTo(tag, el);\n this.children_.unshift(tag); // Set lang attr on player to ensure CSS :lang() in consistent with player\n // if it's been set to something different to the doc\n\n this.el_.setAttribute('lang', this.language_);\n this.el_ = el;\n return el;\n };\n /**\n * A getter/setter for the `Player`'s width. Returns the player's configured value.\n * To get the current width use `currentWidth()`.\n *\n * @param {number} [value]\n * The value to set the `Player`'s width to.\n *\n * @return {number}\n * The current width of the `Player` when getting.\n */\n\n\n _proto.width = function width(value) {\n return this.dimension('width', value);\n };\n /**\n * A getter/setter for the `Player`'s height. Returns the player's configured value.\n * To get the current height use `currentheight()`.\n *\n * @param {number} [value]\n * The value to set the `Player`'s heigth to.\n *\n * @return {number}\n * The current height of the `Player` when getting.\n */\n\n\n _proto.height = function height(value) {\n return this.dimension('height', value);\n };\n /**\n * A getter/setter for the `Player`'s width & height.\n *\n * @param {string} dimension\n * This string can be:\n * - 'width'\n * - 'height'\n *\n * @param {number} [value]\n * Value for dimension specified in the first argument.\n *\n * @return {number}\n * The dimension arguments value when getting (width/height).\n */\n\n\n _proto.dimension = function dimension(_dimension, value) {\n var privDimension = _dimension + '_';\n\n if (value === undefined) {\n return this[privDimension] || 0;\n }\n\n if (value === '') {\n // If an empty string is given, reset the dimension to be automatic\n this[privDimension] = undefined;\n this.updateStyleEl_();\n return;\n }\n\n var parsedVal = parseFloat(value);\n\n if (isNaN(parsedVal)) {\n log.error(\"Improper value \\\"\" + value + \"\\\" supplied for for \" + _dimension);\n return;\n }\n\n this[privDimension] = parsedVal;\n this.updateStyleEl_();\n };\n /**\n * A getter/setter/toggler for the vjs-fluid `className` on the `Player`.\n *\n * Turning this on will turn off fill mode.\n *\n * @param {boolean} [bool]\n * - A value of true adds the class.\n * - A value of false removes the class.\n * - No value will be a getter.\n *\n * @return {boolean|undefined}\n * - The value of fluid when getting.\n * - `undefined` when setting.\n */\n\n\n _proto.fluid = function fluid(bool) {\n if (bool === undefined) {\n return !!this.fluid_;\n }\n\n this.fluid_ = !!bool;\n\n if (isEvented(this)) {\n this.off('playerreset', this.updateStyleEl_);\n }\n\n if (bool) {\n this.addClass('vjs-fluid');\n this.fill(false);\n addEventedCallback(function () {\n this.on('playerreset', this.updateStyleEl_);\n });\n } else {\n this.removeClass('vjs-fluid');\n }\n\n this.updateStyleEl_();\n };\n /**\n * A getter/setter/toggler for the vjs-fill `className` on the `Player`.\n *\n * Turning this on will turn off fluid mode.\n *\n * @param {boolean} [bool]\n * - A value of true adds the class.\n * - A value of false removes the class.\n * - No value will be a getter.\n *\n * @return {boolean|undefined}\n * - The value of fluid when getting.\n * - `undefined` when setting.\n */\n\n\n _proto.fill = function fill(bool) {\n if (bool === undefined) {\n return !!this.fill_;\n }\n\n this.fill_ = !!bool;\n\n if (bool) {\n this.addClass('vjs-fill');\n this.fluid(false);\n } else {\n this.removeClass('vjs-fill');\n }\n };\n /**\n * Get/Set the aspect ratio\n *\n * @param {string} [ratio]\n * Aspect ratio for player\n *\n * @return {string|undefined}\n * returns the current aspect ratio when getting\n */\n\n /**\n * A getter/setter for the `Player`'s aspect ratio.\n *\n * @param {string} [ratio]\n * The value to set the `Player's aspect ratio to.\n *\n * @return {string|undefined}\n * - The current aspect ratio of the `Player` when getting.\n * - undefined when setting\n */\n\n\n _proto.aspectRatio = function aspectRatio(ratio) {\n if (ratio === undefined) {\n return this.aspectRatio_;\n } // Check for width:height format\n\n\n if (!/^\\d+\\:\\d+$/.test(ratio)) {\n throw new Error('Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.');\n }\n\n this.aspectRatio_ = ratio; // We're assuming if you set an aspect ratio you want fluid mode,\n // because in fixed mode you could calculate width and height yourself.\n\n this.fluid(true);\n this.updateStyleEl_();\n };\n /**\n * Update styles of the `Player` element (height, width and aspect ratio).\n *\n * @private\n * @listens Tech#loadedmetadata\n */\n\n\n _proto.updateStyleEl_ = function updateStyleEl_() {\n if (window$1.VIDEOJS_NO_DYNAMIC_STYLE === true) {\n var _width = typeof this.width_ === 'number' ? this.width_ : this.options_.width;\n\n var _height = typeof this.height_ === 'number' ? this.height_ : this.options_.height;\n\n var techEl = this.tech_ && this.tech_.el();\n\n if (techEl) {\n if (_width >= 0) {\n techEl.width = _width;\n }\n\n if (_height >= 0) {\n techEl.height = _height;\n }\n }\n\n return;\n }\n\n var width;\n var height;\n var aspectRatio;\n var idClass; // The aspect ratio is either used directly or to calculate width and height.\n\n if (this.aspectRatio_ !== undefined && this.aspectRatio_ !== 'auto') {\n // Use any aspectRatio that's been specifically set\n aspectRatio = this.aspectRatio_;\n } else if (this.videoWidth() > 0) {\n // Otherwise try to get the aspect ratio from the video metadata\n aspectRatio = this.videoWidth() + ':' + this.videoHeight();\n } else {\n // Or use a default. The video element's is 2:1, but 16:9 is more common.\n aspectRatio = '16:9';\n } // Get the ratio as a decimal we can use to calculate dimensions\n\n\n var ratioParts = aspectRatio.split(':');\n var ratioMultiplier = ratioParts[1] / ratioParts[0];\n\n if (this.width_ !== undefined) {\n // Use any width that's been specifically set\n width = this.width_;\n } else if (this.height_ !== undefined) {\n // Or calulate the width from the aspect ratio if a height has been set\n width = this.height_ / ratioMultiplier;\n } else {\n // Or use the video's metadata, or use the video el's default of 300\n width = this.videoWidth() || 300;\n }\n\n if (this.height_ !== undefined) {\n // Use any height that's been specifically set\n height = this.height_;\n } else {\n // Otherwise calculate the height from the ratio and the width\n height = width * ratioMultiplier;\n } // Ensure the CSS class is valid by starting with an alpha character\n\n\n if (/^[^a-zA-Z]/.test(this.id())) {\n idClass = 'dimensions-' + this.id();\n } else {\n idClass = this.id() + '-dimensions';\n } // Ensure the right class is still on the player for the style element\n\n\n this.addClass(idClass);\n setTextContent(this.styleEl_, \"\\n .\" + idClass + \" {\\n width: \" + width + \"px;\\n height: \" + height + \"px;\\n }\\n\\n .\" + idClass + \".vjs-fluid {\\n padding-top: \" + ratioMultiplier * 100 + \"%;\\n }\\n \");\n };\n /**\n * Load/Create an instance of playback {@link Tech} including element\n * and API methods. Then append the `Tech` element in `Player` as a child.\n *\n * @param {string} techName\n * name of the playback technology\n *\n * @param {string} source\n * video source\n *\n * @private\n */\n\n\n _proto.loadTech_ = function loadTech_(techName, source) {\n var _this2 = this;\n\n // Pause and remove current playback technology\n if (this.tech_) {\n this.unloadTech_();\n }\n\n var titleTechName = toTitleCase(techName);\n var camelTechName = techName.charAt(0).toLowerCase() + techName.slice(1); // get rid of the HTML5 video tag as soon as we are using another tech\n\n if (titleTechName !== 'Html5' && this.tag) {\n Tech.getTech('Html5').disposeMediaElement(this.tag);\n this.tag.player = null;\n this.tag = null;\n }\n\n this.techName_ = titleTechName; // Turn off API access because we're loading a new tech that might load asynchronously\n\n this.isReady_ = false; // if autoplay is a string we pass false to the tech\n // because the player is going to handle autoplay on `loadstart`\n\n var autoplay = typeof this.autoplay() === 'string' ? false : this.autoplay(); // Grab tech-specific options from player options and add source and parent element to use.\n\n var techOptions = {\n source: source,\n autoplay: autoplay,\n 'nativeControlsForTouch': this.options_.nativeControlsForTouch,\n 'playerId': this.id(),\n 'techId': this.id() + \"_\" + camelTechName + \"_api\",\n 'playsinline': this.options_.playsinline,\n 'preload': this.options_.preload,\n 'loop': this.options_.loop,\n 'muted': this.options_.muted,\n 'poster': this.poster(),\n 'language': this.language(),\n 'playerElIngest': this.playerElIngest_ || false,\n 'vtt.js': this.options_['vtt.js'],\n 'canOverridePoster': !!this.options_.techCanOverridePoster,\n 'enableSourceset': this.options_.enableSourceset\n };\n ALL.names.forEach(function (name$$1) {\n var props = ALL[name$$1];\n techOptions[props.getterName] = _this2[props.privateName];\n });\n assign(techOptions, this.options_[titleTechName]);\n assign(techOptions, this.options_[camelTechName]);\n assign(techOptions, this.options_[techName.toLowerCase()]);\n\n if (this.tag) {\n techOptions.tag = this.tag;\n }\n\n if (source && source.src === this.cache_.src && this.cache_.currentTime > 0) {\n techOptions.startTime = this.cache_.currentTime;\n } // Initialize tech instance\n\n\n var TechClass = Tech.getTech(techName);\n\n if (!TechClass) {\n throw new Error(\"No Tech named '\" + titleTechName + \"' exists! '\" + titleTechName + \"' should be registered using videojs.registerTech()'\");\n }\n\n this.tech_ = new TechClass(techOptions); // player.triggerReady is always async, so don't need this to be async\n\n this.tech_.ready(bind(this, this.handleTechReady_), true);\n textTrackConverter.jsonToTextTracks(this.textTracksJson_ || [], this.tech_); // Listen to all HTML5-defined events and trigger them on the player\n\n TECH_EVENTS_RETRIGGER.forEach(function (event) {\n _this2.on(_this2.tech_, event, _this2[\"handleTech\" + toTitleCase(event) + \"_\"]);\n });\n Object.keys(TECH_EVENTS_QUEUE).forEach(function (event) {\n _this2.on(_this2.tech_, event, function (eventObj) {\n if (_this2.tech_.playbackRate() === 0 && _this2.tech_.seeking()) {\n _this2.queuedCallbacks_.push({\n callback: _this2[\"handleTech\" + TECH_EVENTS_QUEUE[event] + \"_\"].bind(_this2),\n event: eventObj\n });\n\n return;\n }\n\n _this2[\"handleTech\" + TECH_EVENTS_QUEUE[event] + \"_\"](eventObj);\n });\n });\n this.on(this.tech_, 'loadstart', this.handleTechLoadStart_);\n this.on(this.tech_, 'sourceset', this.handleTechSourceset_);\n this.on(this.tech_, 'waiting', this.handleTechWaiting_);\n this.on(this.tech_, 'ended', this.handleTechEnded_);\n this.on(this.tech_, 'seeking', this.handleTechSeeking_);\n this.on(this.tech_, 'play', this.handleTechPlay_);\n this.on(this.tech_, 'firstplay', this.handleTechFirstPlay_);\n this.on(this.tech_, 'pause', this.handleTechPause_);\n this.on(this.tech_, 'durationchange', this.handleTechDurationChange_);\n this.on(this.tech_, 'fullscreenchange', this.handleTechFullscreenChange_);\n this.on(this.tech_, 'error', this.handleTechError_);\n this.on(this.tech_, 'loadedmetadata', this.updateStyleEl_);\n this.on(this.tech_, 'posterchange', this.handleTechPosterChange_);\n this.on(this.tech_, 'textdata', this.handleTechTextData_);\n this.on(this.tech_, 'ratechange', this.handleTechRateChange_);\n this.usingNativeControls(this.techGet_('controls'));\n\n if (this.controls() && !this.usingNativeControls()) {\n this.addTechControlsListeners_();\n } // Add the tech element in the DOM if it was not already there\n // Make sure to not insert the original video element if using Html5\n\n\n if (this.tech_.el().parentNode !== this.el() && (titleTechName !== 'Html5' || !this.tag)) {\n prependTo(this.tech_.el(), this.el());\n } // Get rid of the original video tag reference after the first tech is loaded\n\n\n if (this.tag) {\n this.tag.player = null;\n this.tag = null;\n }\n };\n /**\n * Unload and dispose of the current playback {@link Tech}.\n *\n * @private\n */\n\n\n _proto.unloadTech_ = function unloadTech_() {\n var _this3 = this;\n\n // Save the current text tracks so that we can reuse the same text tracks with the next tech\n ALL.names.forEach(function (name$$1) {\n var props = ALL[name$$1];\n _this3[props.privateName] = _this3[props.getterName]();\n });\n this.textTracksJson_ = textTrackConverter.textTracksToJson(this.tech_);\n this.isReady_ = false;\n this.tech_.dispose();\n this.tech_ = false;\n\n if (this.isPosterFromTech_) {\n this.poster_ = '';\n this.trigger('posterchange');\n }\n\n this.isPosterFromTech_ = false;\n };\n /**\n * Return a reference to the current {@link Tech}.\n * It will print a warning by default about the danger of using the tech directly\n * but any argument that is passed in will silence the warning.\n *\n * @param {*} [safety]\n * Anything passed in to silence the warning\n *\n * @return {Tech}\n * The Tech\n */\n\n\n _proto.tech = function tech(safety) {\n if (safety === undefined) {\n log.warn(tsml(_templateObject$2()));\n }\n\n return this.tech_;\n };\n /**\n * Set up click and touch listeners for the playback element\n *\n * - On desktops: a click on the video itself will toggle playback\n * - On mobile devices: a click on the video toggles controls\n * which is done by toggling the user state between active and\n * inactive\n * - A tap can signal that a user has become active or has become inactive\n * e.g. a quick tap on an iPhone movie should reveal the controls. Another\n * quick tap should hide them again (signaling the user is in an inactive\n * viewing state)\n * - In addition to this, we still want the user to be considered inactive after\n * a few seconds of inactivity.\n *\n * > Note: the only part of iOS interaction we can't mimic with this setup\n * is a touch and hold on the video element counting as activity in order to\n * keep the controls showing, but that shouldn't be an issue. A touch and hold\n * on any controls will still keep the user active\n *\n * @private\n */\n\n\n _proto.addTechControlsListeners_ = function addTechControlsListeners_() {\n // Make sure to remove all the previous listeners in case we are called multiple times.\n this.removeTechControlsListeners_(); // Some browsers (Chrome & IE) don't trigger a click on a flash swf, but do\n // trigger mousedown/up.\n // http://stackoverflow.com/questions/1444562/javascript-onclick-event-over-flash-object\n // Any touch events are set to block the mousedown event from happening\n\n this.on(this.tech_, 'mousedown', this.handleTechClick_);\n this.on(this.tech_, 'dblclick', this.handleTechDoubleClick_); // If the controls were hidden we don't want that to change without a tap event\n // so we'll check if the controls were already showing before reporting user\n // activity\n\n this.on(this.tech_, 'touchstart', this.handleTechTouchStart_);\n this.on(this.tech_, 'touchmove', this.handleTechTouchMove_);\n this.on(this.tech_, 'touchend', this.handleTechTouchEnd_); // The tap listener needs to come after the touchend listener because the tap\n // listener cancels out any reportedUserActivity when setting userActive(false)\n\n this.on(this.tech_, 'tap', this.handleTechTap_);\n };\n /**\n * Remove the listeners used for click and tap controls. This is needed for\n * toggling to controls disabled, where a tap/touch should do nothing.\n *\n * @private\n */\n\n\n _proto.removeTechControlsListeners_ = function removeTechControlsListeners_() {\n // We don't want to just use `this.off()` because there might be other needed\n // listeners added by techs that extend this.\n this.off(this.tech_, 'tap', this.handleTechTap_);\n this.off(this.tech_, 'touchstart', this.handleTechTouchStart_);\n this.off(this.tech_, 'touchmove', this.handleTechTouchMove_);\n this.off(this.tech_, 'touchend', this.handleTechTouchEnd_);\n this.off(this.tech_, 'mousedown', this.handleTechClick_);\n this.off(this.tech_, 'dblclick', this.handleTechDoubleClick_);\n };\n /**\n * Player waits for the tech to be ready\n *\n * @private\n */\n\n\n _proto.handleTechReady_ = function handleTechReady_() {\n this.triggerReady(); // Keep the same volume as before\n\n if (this.cache_.volume) {\n this.techCall_('setVolume', this.cache_.volume);\n } // Look if the tech found a higher resolution poster while loading\n\n\n this.handleTechPosterChange_(); // Update the duration if available\n\n this.handleTechDurationChange_();\n };\n /**\n * Retrigger the `loadstart` event that was triggered by the {@link Tech}. This\n * function will also trigger {@link Player#firstplay} if it is the first loadstart\n * for a video.\n *\n * @fires Player#loadstart\n * @fires Player#firstplay\n * @listens Tech#loadstart\n * @private\n */\n\n\n _proto.handleTechLoadStart_ = function handleTechLoadStart_() {\n // TODO: Update to use `emptied` event instead. See #1277.\n this.removeClass('vjs-ended');\n this.removeClass('vjs-seeking'); // reset the error state\n\n this.error(null); // Update the duration\n\n this.handleTechDurationChange_(); // If it's already playing we want to trigger a firstplay event now.\n // The firstplay event relies on both the play and loadstart events\n // which can happen in any order for a new source\n\n if (!this.paused()) {\n /**\n * Fired when the user agent begins looking for media data\n *\n * @event Player#loadstart\n * @type {EventTarget~Event}\n */\n this.trigger('loadstart');\n this.trigger('firstplay');\n } else {\n // reset the hasStarted state\n this.hasStarted(false);\n this.trigger('loadstart');\n } // autoplay happens after loadstart for the browser,\n // so we mimic that behavior\n\n\n this.manualAutoplay_(this.autoplay());\n };\n /**\n * Handle autoplay string values, rather than the typical boolean\n * values that should be handled by the tech. Note that this is not\n * part of any specification. Valid values and what they do can be\n * found on the autoplay getter at Player#autoplay()\n */\n\n\n _proto.manualAutoplay_ = function manualAutoplay_(type) {\n var _this4 = this;\n\n if (!this.tech_ || typeof type !== 'string') {\n return;\n }\n\n var muted = function muted() {\n var previouslyMuted = _this4.muted();\n\n _this4.muted(true);\n\n var playPromise = _this4.play();\n\n if (!playPromise || !playPromise.then || !playPromise.catch) {\n return;\n }\n\n return playPromise.catch(function (e) {\n // restore old value of muted on failure\n _this4.muted(previouslyMuted);\n });\n };\n\n var promise;\n\n if (type === 'any') {\n promise = this.play();\n\n if (promise && promise.then && promise.catch) {\n promise.catch(function () {\n return muted();\n });\n }\n } else if (type === 'muted') {\n promise = muted();\n } else {\n promise = this.play();\n }\n\n if (!promise || !promise.then || !promise.catch) {\n return;\n }\n\n return promise.then(function () {\n _this4.trigger({\n type: 'autoplay-success',\n autoplay: type\n });\n }).catch(function (e) {\n _this4.trigger({\n type: 'autoplay-failure',\n autoplay: type\n });\n });\n };\n /**\n * Update the internal source caches so that we return the correct source from\n * `src()`, `currentSource()`, and `currentSources()`.\n *\n * > Note: `currentSources` will not be updated if the source that is passed in exists\n * in the current `currentSources` cache.\n *\n *\n * @param {Tech~SourceObject} srcObj\n * A string or object source to update our caches to.\n */\n\n\n _proto.updateSourceCaches_ = function updateSourceCaches_(srcObj) {\n if (srcObj === void 0) {\n srcObj = '';\n }\n\n var src = srcObj;\n var type = '';\n\n if (typeof src !== 'string') {\n src = srcObj.src;\n type = srcObj.type;\n } // make sure all the caches are set to default values\n // to prevent null checking\n\n\n this.cache_.source = this.cache_.source || {};\n this.cache_.sources = this.cache_.sources || []; // try to get the type of the src that was passed in\n\n if (src && !type) {\n type = findMimetype(this, src);\n } // update `currentSource` cache always\n\n\n this.cache_.source = mergeOptions({}, srcObj, {\n src: src,\n type: type\n });\n var matchingSources = this.cache_.sources.filter(function (s) {\n return s.src && s.src === src;\n });\n var sourceElSources = [];\n var sourceEls = this.$$('source');\n var matchingSourceEls = [];\n\n for (var i = 0; i < sourceEls.length; i++) {\n var sourceObj = getAttributes(sourceEls[i]);\n sourceElSources.push(sourceObj);\n\n if (sourceObj.src && sourceObj.src === src) {\n matchingSourceEls.push(sourceObj.src);\n }\n } // if we have matching source els but not matching sources\n // the current source cache is not up to date\n\n\n if (matchingSourceEls.length && !matchingSources.length) {\n this.cache_.sources = sourceElSources; // if we don't have matching source or source els set the\n // sources cache to the `currentSource` cache\n } else if (!matchingSources.length) {\n this.cache_.sources = [this.cache_.source];\n } // update the tech `src` cache\n\n\n this.cache_.src = src;\n };\n /**\n * *EXPERIMENTAL* Fired when the source is set or changed on the {@link Tech}\n * causing the media element to reload.\n *\n * It will fire for the initial source and each subsequent source.\n * This event is a custom event from Video.js and is triggered by the {@link Tech}.\n *\n * The event object for this event contains a `src` property that will contain the source\n * that was available when the event was triggered. This is generally only necessary if Video.js\n * is switching techs while the source was being changed.\n *\n * It is also fired when `load` is called on the player (or media element)\n * because the {@link https://html.spec.whatwg.org/multipage/media.html#dom-media-load|specification for `load`}\n * says that the resource selection algorithm needs to be aborted and restarted.\n * In this case, it is very likely that the `src` property will be set to the\n * empty string `\"\"` to indicate we do not know what the source will be but\n * that it is changing.\n *\n * *This event is currently still experimental and may change in minor releases.*\n * __To use this, pass `enableSourceset` option to the player.__\n *\n * @event Player#sourceset\n * @type {EventTarget~Event}\n * @prop {string} src\n * The source url available when the `sourceset` was triggered.\n * It will be an empty string if we cannot know what the source is\n * but know that the source will change.\n */\n\n /**\n * Retrigger the `sourceset` event that was triggered by the {@link Tech}.\n *\n * @fires Player#sourceset\n * @listens Tech#sourceset\n * @private\n */\n\n\n _proto.handleTechSourceset_ = function handleTechSourceset_(event) {\n var _this5 = this;\n\n // only update the source cache when the source\n // was not updated using the player api\n if (!this.changingSrc_) {\n var updateSourceCaches = function updateSourceCaches(src) {\n return _this5.updateSourceCaches_(src);\n };\n\n var playerSrc = this.currentSource().src;\n var eventSrc = event.src; // if we have a playerSrc that is not a blob, and a tech src that is a blob\n\n if (playerSrc && !/^blob:/.test(playerSrc) && /^blob:/.test(eventSrc)) {\n // if both the tech source and the player source were updated we assume\n // something like @videojs/http-streaming did the sourceset and skip updating the source cache.\n if (!this.lastSource_ || this.lastSource_.tech !== eventSrc && this.lastSource_.player !== playerSrc) {\n updateSourceCaches = function updateSourceCaches() {};\n }\n } // update the source to the intial source right away\n // in some cases this will be empty string\n\n\n updateSourceCaches(eventSrc); // if the `sourceset` `src` was an empty string\n // wait for a `loadstart` to update the cache to `currentSrc`.\n // If a sourceset happens before a `loadstart`, we reset the state\n // as this function will be called again.\n\n if (!event.src) {\n var updateCache = function updateCache(e) {\n if (e.type !== 'sourceset') {\n var techSrc = _this5.techGet('currentSrc');\n\n _this5.lastSource_.tech = techSrc;\n\n _this5.updateSourceCaches_(techSrc);\n }\n\n _this5.tech_.off(['sourceset', 'loadstart'], updateCache);\n };\n\n this.tech_.one(['sourceset', 'loadstart'], updateCache);\n }\n }\n\n this.lastSource_ = {\n player: this.currentSource().src,\n tech: event.src\n };\n this.trigger({\n src: event.src,\n type: 'sourceset'\n });\n };\n /**\n * Add/remove the vjs-has-started class\n *\n * @fires Player#firstplay\n *\n * @param {boolean} request\n * - true: adds the class\n * - false: remove the class\n *\n * @return {boolean}\n * the boolean value of hasStarted_\n */\n\n\n _proto.hasStarted = function hasStarted(request) {\n if (request === undefined) {\n // act as getter, if we have no request to change\n return this.hasStarted_;\n }\n\n if (request === this.hasStarted_) {\n return;\n }\n\n this.hasStarted_ = request;\n\n if (this.hasStarted_) {\n this.addClass('vjs-has-started');\n this.trigger('firstplay');\n } else {\n this.removeClass('vjs-has-started');\n }\n };\n /**\n * Fired whenever the media begins or resumes playback\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-play}\n * @fires Player#play\n * @listens Tech#play\n * @private\n */\n\n\n _proto.handleTechPlay_ = function handleTechPlay_() {\n this.removeClass('vjs-ended');\n this.removeClass('vjs-paused');\n this.addClass('vjs-playing'); // hide the poster when the user hits play\n\n this.hasStarted(true);\n /**\n * Triggered whenever an {@link Tech#play} event happens. Indicates that\n * playback has started or resumed.\n *\n * @event Player#play\n * @type {EventTarget~Event}\n */\n\n this.trigger('play');\n };\n /**\n * Retrigger the `ratechange` event that was triggered by the {@link Tech}.\n *\n * If there were any events queued while the playback rate was zero, fire\n * those events now.\n *\n * @private\n * @method Player#handleTechRateChange_\n * @fires Player#ratechange\n * @listens Tech#ratechange\n */\n\n\n _proto.handleTechRateChange_ = function handleTechRateChange_() {\n if (this.tech_.playbackRate() > 0 && this.cache_.lastPlaybackRate === 0) {\n this.queuedCallbacks_.forEach(function (queued) {\n return queued.callback(queued.event);\n });\n this.queuedCallbacks_ = [];\n }\n\n this.cache_.lastPlaybackRate = this.tech_.playbackRate();\n /**\n * Fires when the playing speed of the audio/video is changed\n *\n * @event Player#ratechange\n * @type {event}\n */\n\n this.trigger('ratechange');\n };\n /**\n * Retrigger the `waiting` event that was triggered by the {@link Tech}.\n *\n * @fires Player#waiting\n * @listens Tech#waiting\n * @private\n */\n\n\n _proto.handleTechWaiting_ = function handleTechWaiting_() {\n var _this6 = this;\n\n this.addClass('vjs-waiting');\n /**\n * A readyState change on the DOM element has caused playback to stop.\n *\n * @event Player#waiting\n * @type {EventTarget~Event}\n */\n\n this.trigger('waiting'); // Browsers may emit a timeupdate event after a waiting event. In order to prevent\n // premature removal of the waiting class, wait for the time to change.\n\n var timeWhenWaiting = this.currentTime();\n\n var timeUpdateListener = function timeUpdateListener() {\n if (timeWhenWaiting !== _this6.currentTime()) {\n _this6.removeClass('vjs-waiting');\n\n _this6.off('timeupdate', timeUpdateListener);\n }\n };\n\n this.on('timeupdate', timeUpdateListener);\n };\n /**\n * Retrigger the `canplay` event that was triggered by the {@link Tech}.\n * > Note: This is not consistent between browsers. See #1351\n *\n * @fires Player#canplay\n * @listens Tech#canplay\n * @private\n */\n\n\n _proto.handleTechCanPlay_ = function handleTechCanPlay_() {\n this.removeClass('vjs-waiting');\n /**\n * The media has a readyState of HAVE_FUTURE_DATA or greater.\n *\n * @event Player#canplay\n * @type {EventTarget~Event}\n */\n\n this.trigger('canplay');\n };\n /**\n * Retrigger the `canplaythrough` event that was triggered by the {@link Tech}.\n *\n * @fires Player#canplaythrough\n * @listens Tech#canplaythrough\n * @private\n */\n\n\n _proto.handleTechCanPlayThrough_ = function handleTechCanPlayThrough_() {\n this.removeClass('vjs-waiting');\n /**\n * The media has a readyState of HAVE_ENOUGH_DATA or greater. This means that the\n * entire media file can be played without buffering.\n *\n * @event Player#canplaythrough\n * @type {EventTarget~Event}\n */\n\n this.trigger('canplaythrough');\n };\n /**\n * Retrigger the `playing` event that was triggered by the {@link Tech}.\n *\n * @fires Player#playing\n * @listens Tech#playing\n * @private\n */\n\n\n _proto.handleTechPlaying_ = function handleTechPlaying_() {\n this.removeClass('vjs-waiting');\n /**\n * The media is no longer blocked from playback, and has started playing.\n *\n * @event Player#playing\n * @type {EventTarget~Event}\n */\n\n this.trigger('playing');\n };\n /**\n * Retrigger the `seeking` event that was triggered by the {@link Tech}.\n *\n * @fires Player#seeking\n * @listens Tech#seeking\n * @private\n */\n\n\n _proto.handleTechSeeking_ = function handleTechSeeking_() {\n this.addClass('vjs-seeking');\n /**\n * Fired whenever the player is jumping to a new time\n *\n * @event Player#seeking\n * @type {EventTarget~Event}\n */\n\n this.trigger('seeking');\n };\n /**\n * Retrigger the `seeked` event that was triggered by the {@link Tech}.\n *\n * @fires Player#seeked\n * @listens Tech#seeked\n * @private\n */\n\n\n _proto.handleTechSeeked_ = function handleTechSeeked_() {\n this.removeClass('vjs-seeking');\n /**\n * Fired when the player has finished jumping to a new time\n *\n * @event Player#seeked\n * @type {EventTarget~Event}\n */\n\n this.trigger('seeked');\n };\n /**\n * Retrigger the `firstplay` event that was triggered by the {@link Tech}.\n *\n * @fires Player#firstplay\n * @listens Tech#firstplay\n * @deprecated As of 6.0 firstplay event is deprecated.\n * As of 6.0 passing the `starttime` option to the player and the firstplay event are deprecated.\n * @private\n */\n\n\n _proto.handleTechFirstPlay_ = function handleTechFirstPlay_() {\n // If the first starttime attribute is specified\n // then we will start at the given offset in seconds\n if (this.options_.starttime) {\n log.warn('Passing the `starttime` option to the player will be deprecated in 6.0');\n this.currentTime(this.options_.starttime);\n }\n\n this.addClass('vjs-has-started');\n /**\n * Fired the first time a video is played. Not part of the HLS spec, and this is\n * probably not the best implementation yet, so use sparingly. If you don't have a\n * reason to prevent playback, use `myPlayer.one('play');` instead.\n *\n * @event Player#firstplay\n * @deprecated As of 6.0 firstplay event is deprecated.\n * @type {EventTarget~Event}\n */\n\n this.trigger('firstplay');\n };\n /**\n * Retrigger the `pause` event that was triggered by the {@link Tech}.\n *\n * @fires Player#pause\n * @listens Tech#pause\n * @private\n */\n\n\n _proto.handleTechPause_ = function handleTechPause_() {\n this.removeClass('vjs-playing');\n this.addClass('vjs-paused');\n /**\n * Fired whenever the media has been paused\n *\n * @event Player#pause\n * @type {EventTarget~Event}\n */\n\n this.trigger('pause');\n };\n /**\n * Retrigger the `ended` event that was triggered by the {@link Tech}.\n *\n * @fires Player#ended\n * @listens Tech#ended\n * @private\n */\n\n\n _proto.handleTechEnded_ = function handleTechEnded_() {\n this.addClass('vjs-ended');\n\n if (this.options_.loop) {\n this.currentTime(0);\n this.play();\n } else if (!this.paused()) {\n this.pause();\n }\n /**\n * Fired when the end of the media resource is reached (currentTime == duration)\n *\n * @event Player#ended\n * @type {EventTarget~Event}\n */\n\n\n this.trigger('ended');\n };\n /**\n * Fired when the duration of the media resource is first known or changed\n *\n * @listens Tech#durationchange\n * @private\n */\n\n\n _proto.handleTechDurationChange_ = function handleTechDurationChange_() {\n this.duration(this.techGet_('duration'));\n };\n /**\n * Handle a click on the media element to play/pause\n *\n * @param {EventTarget~Event} event\n * the event that caused this function to trigger\n *\n * @listens Tech#mousedown\n * @private\n */\n\n\n _proto.handleTechClick_ = function handleTechClick_(event) {\n if (!isSingleLeftClick(event)) {\n return;\n } // When controls are disabled a click should not toggle playback because\n // the click is considered a control\n\n\n if (!this.controls_) {\n return;\n }\n\n if (this.paused()) {\n silencePromise(this.play());\n } else {\n this.pause();\n }\n };\n /**\n * Handle a double-click on the media element to enter/exit fullscreen\n *\n * @param {EventTarget~Event} event\n * the event that caused this function to trigger\n *\n * @listens Tech#dblclick\n * @private\n */\n\n\n _proto.handleTechDoubleClick_ = function handleTechDoubleClick_(event) {\n if (!this.controls_) {\n return;\n } // we do not want to toggle fullscreen state\n // when double-clicking inside a control bar or a modal\n\n\n var inAllowedEls = Array.prototype.some.call(this.$$('.vjs-control-bar, .vjs-modal-dialog'), function (el) {\n return el.contains(event.target);\n });\n\n if (!inAllowedEls) {\n if (this.isFullscreen()) {\n this.exitFullscreen();\n } else {\n this.requestFullscreen();\n }\n }\n };\n /**\n * Handle a tap on the media element. It will toggle the user\n * activity state, which hides and shows the controls.\n *\n * @listens Tech#tap\n * @private\n */\n\n\n _proto.handleTechTap_ = function handleTechTap_() {\n this.userActive(!this.userActive());\n };\n /**\n * Handle touch to start\n *\n * @listens Tech#touchstart\n * @private\n */\n\n\n _proto.handleTechTouchStart_ = function handleTechTouchStart_() {\n this.userWasActive = this.userActive();\n };\n /**\n * Handle touch to move\n *\n * @listens Tech#touchmove\n * @private\n */\n\n\n _proto.handleTechTouchMove_ = function handleTechTouchMove_() {\n if (this.userWasActive) {\n this.reportUserActivity();\n }\n };\n /**\n * Handle touch to end\n *\n * @param {EventTarget~Event} event\n * the touchend event that triggered\n * this function\n *\n * @listens Tech#touchend\n * @private\n */\n\n\n _proto.handleTechTouchEnd_ = function handleTechTouchEnd_(event) {\n // Stop the mouse events from also happening\n event.preventDefault();\n };\n /**\n * Fired when the player switches in or out of fullscreen mode\n *\n * @private\n * @listens Player#fullscreenchange\n */\n\n\n _proto.handleFullscreenChange_ = function handleFullscreenChange_() {\n if (this.isFullscreen()) {\n this.addClass('vjs-fullscreen');\n } else {\n this.removeClass('vjs-fullscreen');\n }\n };\n /**\n * native click events on the SWF aren't triggered on IE11, Win8.1RT\n * use stageclick events triggered from inside the SWF instead\n *\n * @private\n * @listens stageclick\n */\n\n\n _proto.handleStageClick_ = function handleStageClick_() {\n this.reportUserActivity();\n };\n /**\n * Handle Tech Fullscreen Change\n *\n * @param {EventTarget~Event} event\n * the fullscreenchange event that triggered this function\n *\n * @param {Object} data\n * the data that was sent with the event\n *\n * @private\n * @listens Tech#fullscreenchange\n * @fires Player#fullscreenchange\n */\n\n\n _proto.handleTechFullscreenChange_ = function handleTechFullscreenChange_(event, data) {\n if (data) {\n this.isFullscreen(data.isFullscreen);\n }\n /**\n * Fired when going in and out of fullscreen.\n *\n * @event Player#fullscreenchange\n * @type {EventTarget~Event}\n */\n\n\n this.trigger('fullscreenchange');\n };\n /**\n * Fires when an error occurred during the loading of an audio/video.\n *\n * @private\n * @listens Tech#error\n */\n\n\n _proto.handleTechError_ = function handleTechError_() {\n var error = this.tech_.error();\n this.error(error);\n };\n /**\n * Retrigger the `textdata` event that was triggered by the {@link Tech}.\n *\n * @fires Player#textdata\n * @listens Tech#textdata\n * @private\n */\n\n\n _proto.handleTechTextData_ = function handleTechTextData_() {\n var data = null;\n\n if (arguments.length > 1) {\n data = arguments[1];\n }\n /**\n * Fires when we get a textdata event from tech\n *\n * @event Player#textdata\n * @type {EventTarget~Event}\n */\n\n\n this.trigger('textdata', data);\n };\n /**\n * Get object for cached values.\n *\n * @return {Object}\n * get the current object cache\n */\n\n\n _proto.getCache = function getCache() {\n return this.cache_;\n };\n /**\n * Pass values to the playback tech\n *\n * @param {string} [method]\n * the method to call\n *\n * @param {Object} arg\n * the argument to pass\n *\n * @private\n */\n\n\n _proto.techCall_ = function techCall_(method, arg) {\n // If it's not ready yet, call method when it is\n this.ready(function () {\n if (method in allowedSetters) {\n return set$1(this.middleware_, this.tech_, method, arg);\n } else if (method in allowedMediators) {\n return mediate(this.middleware_, this.tech_, method, arg);\n }\n\n try {\n if (this.tech_) {\n this.tech_[method](arg);\n }\n } catch (e) {\n log(e);\n throw e;\n }\n }, true);\n };\n /**\n * Get calls can't wait for the tech, and sometimes don't need to.\n *\n * @param {string} method\n * Tech method\n *\n * @return {Function|undefined}\n * the method or undefined\n *\n * @private\n */\n\n\n _proto.techGet_ = function techGet_(method) {\n if (!this.tech_ || !this.tech_.isReady_) {\n return;\n }\n\n if (method in allowedGetters) {\n return get(this.middleware_, this.tech_, method);\n } else if (method in allowedMediators) {\n return mediate(this.middleware_, this.tech_, method);\n } // Flash likes to die and reload when you hide or reposition it.\n // In these cases the object methods go away and we get errors.\n // When that happens we'll catch the errors and inform tech that it's not ready any more.\n\n\n try {\n return this.tech_[method]();\n } catch (e) {\n // When building additional tech libs, an expected method may not be defined yet\n if (this.tech_[method] === undefined) {\n log(\"Video.js: \" + method + \" method not defined for \" + this.techName_ + \" playback technology.\", e);\n throw e;\n } // When a method isn't available on the object it throws a TypeError\n\n\n if (e.name === 'TypeError') {\n log(\"Video.js: \" + method + \" unavailable on \" + this.techName_ + \" playback technology element.\", e);\n this.tech_.isReady_ = false;\n throw e;\n } // If error unknown, just log and throw\n\n\n log(e);\n throw e;\n }\n };\n /**\n * Attempt to begin playback at the first opportunity.\n *\n * @return {Promise|undefined}\n * Returns a promise if the browser supports Promises (or one\n * was passed in as an option). This promise will be resolved on\n * the return value of play. If this is undefined it will fulfill the\n * promise chain otherwise the promise chain will be fulfilled when\n * the promise from play is fulfilled.\n */\n\n\n _proto.play = function play() {\n var _this7 = this;\n\n var PromiseClass = this.options_.Promise || window$1.Promise;\n\n if (PromiseClass) {\n return new PromiseClass(function (resolve) {\n _this7.play_(resolve);\n });\n }\n\n return this.play_();\n };\n /**\n * The actual logic for play, takes a callback that will be resolved on the\n * return value of play. This allows us to resolve to the play promise if there\n * is one on modern browsers.\n *\n * @private\n * @param {Function} [callback]\n * The callback that should be called when the techs play is actually called\n */\n\n\n _proto.play_ = function play_(callback) {\n var _this8 = this;\n\n if (callback === void 0) {\n callback = silencePromise;\n }\n\n // If this is called while we have a play queued up on a loadstart, remove\n // that listener to avoid getting in a potentially bad state.\n if (this.playOnLoadstart_) {\n this.off('loadstart', this.playOnLoadstart_);\n } // If the player/tech is not ready, queue up another call to `play()` for\n // when it is. This will loop back into this method for another attempt at\n // playback when the tech is ready.\n\n\n if (!this.isReady_) {\n // Bail out if we're already waiting for `ready`!\n if (this.playWaitingForReady_) {\n return;\n }\n\n this.playWaitingForReady_ = true;\n this.ready(function () {\n _this8.playWaitingForReady_ = false;\n callback(_this8.play());\n }); // If the player/tech is ready and we have a source, we can attempt playback.\n } else if (!this.changingSrc_ && (this.src() || this.currentSrc())) {\n callback(this.techGet_('play'));\n return; // If the tech is ready, but we do not have a source, we'll need to wait\n // for both the `ready` and a `loadstart` when the source is finally\n // resolved by middleware and set on the player.\n //\n // This can happen if `play()` is called while changing sources or before\n // one has been set on the player.\n } else {\n this.playOnLoadstart_ = function () {\n _this8.playOnLoadstart_ = null;\n callback(_this8.play());\n };\n\n this.one('loadstart', this.playOnLoadstart_);\n }\n };\n /**\n * Pause the video playback\n *\n * @return {Player}\n * A reference to the player object this function was called on\n */\n\n\n _proto.pause = function pause() {\n this.techCall_('pause');\n };\n /**\n * Check if the player is paused or has yet to play\n *\n * @return {boolean}\n * - false: if the media is currently playing\n * - true: if media is not currently playing\n */\n\n\n _proto.paused = function paused() {\n // The initial state of paused should be true (in Safari it's actually false)\n return this.techGet_('paused') === false ? false : true;\n };\n /**\n * Get a TimeRange object representing the current ranges of time that the user\n * has played.\n *\n * @return {TimeRange}\n * A time range object that represents all the increments of time that have\n * been played.\n */\n\n\n _proto.played = function played() {\n return this.techGet_('played') || createTimeRanges(0, 0);\n };\n /**\n * Returns whether or not the user is \"scrubbing\". Scrubbing is\n * when the user has clicked the progress bar handle and is\n * dragging it along the progress bar.\n *\n * @param {boolean} [isScrubbing]\n * whether the user is or is not scrubbing\n *\n * @return {boolean}\n * The value of scrubbing when getting\n */\n\n\n _proto.scrubbing = function scrubbing(isScrubbing) {\n if (typeof isScrubbing === 'undefined') {\n return this.scrubbing_;\n }\n\n this.scrubbing_ = !!isScrubbing;\n\n if (isScrubbing) {\n this.addClass('vjs-scrubbing');\n } else {\n this.removeClass('vjs-scrubbing');\n }\n };\n /**\n * Get or set the current time (in seconds)\n *\n * @param {number|string} [seconds]\n * The time to seek to in seconds\n *\n * @return {number}\n * - the current time in seconds when getting\n */\n\n\n _proto.currentTime = function currentTime(seconds) {\n if (typeof seconds !== 'undefined') {\n if (seconds < 0) {\n seconds = 0;\n }\n\n this.techCall_('setCurrentTime', seconds);\n return;\n } // cache last currentTime and return. default to 0 seconds\n //\n // Caching the currentTime is meant to prevent a massive amount of reads on the tech's\n // currentTime when scrubbing, but may not provide much performance benefit afterall.\n // Should be tested. Also something has to read the actual current time or the cache will\n // never get updated.\n\n\n this.cache_.currentTime = this.techGet_('currentTime') || 0;\n return this.cache_.currentTime;\n };\n /**\n * Normally gets the length in time of the video in seconds;\n * in all but the rarest use cases an argument will NOT be passed to the method\n *\n * > **NOTE**: The video must have started loading before the duration can be\n * known, and in the case of Flash, may not be known until the video starts\n * playing.\n *\n * @fires Player#durationchange\n *\n * @param {number} [seconds]\n * The duration of the video to set in seconds\n *\n * @return {number}\n * - The duration of the video in seconds when getting\n */\n\n\n _proto.duration = function duration(seconds) {\n if (seconds === undefined) {\n // return NaN if the duration is not known\n return this.cache_.duration !== undefined ? this.cache_.duration : NaN;\n }\n\n seconds = parseFloat(seconds); // Standardize on Infinity for signaling video is live\n\n if (seconds < 0) {\n seconds = Infinity;\n }\n\n if (seconds !== this.cache_.duration) {\n // Cache the last set value for optimized scrubbing (esp. Flash)\n this.cache_.duration = seconds;\n\n if (seconds === Infinity) {\n this.addClass('vjs-live');\n\n if (this.options_.liveui && this.player_.liveTracker) {\n this.addClass('vjs-liveui');\n }\n } else {\n this.removeClass('vjs-live');\n this.removeClass('vjs-liveui');\n }\n\n if (!isNaN(seconds)) {\n // Do not fire durationchange unless the duration value is known.\n // @see [Spec]{@link https://www.w3.org/TR/2011/WD-html5-20110113/video.html#media-element-load-algorithm}\n\n /**\n * @event Player#durationchange\n * @type {EventTarget~Event}\n */\n this.trigger('durationchange');\n }\n }\n };\n /**\n * Calculates how much time is left in the video. Not part\n * of the native video API.\n *\n * @return {number}\n * The time remaining in seconds\n */\n\n\n _proto.remainingTime = function remainingTime() {\n return this.duration() - this.currentTime();\n };\n /**\n * A remaining time function that is intented to be used when\n * the time is to be displayed directly to the user.\n *\n * @return {number}\n * The rounded time remaining in seconds\n */\n\n\n _proto.remainingTimeDisplay = function remainingTimeDisplay() {\n return Math.floor(this.duration()) - Math.floor(this.currentTime());\n }; //\n // Kind of like an array of portions of the video that have been downloaded.\n\n /**\n * Get a TimeRange object with an array of the times of the video\n * that have been downloaded. If you just want the percent of the\n * video that's been downloaded, use bufferedPercent.\n *\n * @see [Buffered Spec]{@link http://dev.w3.org/html5/spec/video.html#dom-media-buffered}\n *\n * @return {TimeRange}\n * A mock TimeRange object (following HTML spec)\n */\n\n\n _proto.buffered = function buffered() {\n var buffered = this.techGet_('buffered');\n\n if (!buffered || !buffered.length) {\n buffered = createTimeRanges(0, 0);\n }\n\n return buffered;\n };\n /**\n * Get the percent (as a decimal) of the video that's been downloaded.\n * This method is not a part of the native HTML video API.\n *\n * @return {number}\n * A decimal between 0 and 1 representing the percent\n * that is buffered 0 being 0% and 1 being 100%\n */\n\n\n _proto.bufferedPercent = function bufferedPercent$$1() {\n return bufferedPercent(this.buffered(), this.duration());\n };\n /**\n * Get the ending time of the last buffered time range\n * This is used in the progress bar to encapsulate all time ranges.\n *\n * @return {number}\n * The end of the last buffered time range\n */\n\n\n _proto.bufferedEnd = function bufferedEnd() {\n var buffered = this.buffered();\n var duration = this.duration();\n var end = buffered.end(buffered.length - 1);\n\n if (end > duration) {\n end = duration;\n }\n\n return end;\n };\n /**\n * Get or set the current volume of the media\n *\n * @param {number} [percentAsDecimal]\n * The new volume as a decimal percent:\n * - 0 is muted/0%/off\n * - 1.0 is 100%/full\n * - 0.5 is half volume or 50%\n *\n * @return {number}\n * The current volume as a percent when getting\n */\n\n\n _proto.volume = function volume(percentAsDecimal) {\n var vol;\n\n if (percentAsDecimal !== undefined) {\n // Force value to between 0 and 1\n vol = Math.max(0, Math.min(1, parseFloat(percentAsDecimal)));\n this.cache_.volume = vol;\n this.techCall_('setVolume', vol);\n\n if (vol > 0) {\n this.lastVolume_(vol);\n }\n\n return;\n } // Default to 1 when returning current volume.\n\n\n vol = parseFloat(this.techGet_('volume'));\n return isNaN(vol) ? 1 : vol;\n };\n /**\n * Get the current muted state, or turn mute on or off\n *\n * @param {boolean} [muted]\n * - true to mute\n * - false to unmute\n *\n * @return {boolean}\n * - true if mute is on and getting\n * - false if mute is off and getting\n */\n\n\n _proto.muted = function muted(_muted) {\n if (_muted !== undefined) {\n this.techCall_('setMuted', _muted);\n return;\n }\n\n return this.techGet_('muted') || false;\n };\n /**\n * Get the current defaultMuted state, or turn defaultMuted on or off. defaultMuted\n * indicates the state of muted on initial playback.\n *\n * ```js\n * var myPlayer = videojs('some-player-id');\n *\n * myPlayer.src(\"http://www.example.com/path/to/video.mp4\");\n *\n * // get, should be false\n * console.log(myPlayer.defaultMuted());\n * // set to true\n * myPlayer.defaultMuted(true);\n * // get should be true\n * console.log(myPlayer.defaultMuted());\n * ```\n *\n * @param {boolean} [defaultMuted]\n * - true to mute\n * - false to unmute\n *\n * @return {boolean|Player}\n * - true if defaultMuted is on and getting\n * - false if defaultMuted is off and getting\n * - A reference to the current player when setting\n */\n\n\n _proto.defaultMuted = function defaultMuted(_defaultMuted) {\n if (_defaultMuted !== undefined) {\n return this.techCall_('setDefaultMuted', _defaultMuted);\n }\n\n return this.techGet_('defaultMuted') || false;\n };\n /**\n * Get the last volume, or set it\n *\n * @param {number} [percentAsDecimal]\n * The new last volume as a decimal percent:\n * - 0 is muted/0%/off\n * - 1.0 is 100%/full\n * - 0.5 is half volume or 50%\n *\n * @return {number}\n * the current value of lastVolume as a percent when getting\n *\n * @private\n */\n\n\n _proto.lastVolume_ = function lastVolume_(percentAsDecimal) {\n if (percentAsDecimal !== undefined && percentAsDecimal !== 0) {\n this.cache_.lastVolume = percentAsDecimal;\n return;\n }\n\n return this.cache_.lastVolume;\n };\n /**\n * Check if current tech can support native fullscreen\n * (e.g. with built in controls like iOS, so not our flash swf)\n *\n * @return {boolean}\n * if native fullscreen is supported\n */\n\n\n _proto.supportsFullScreen = function supportsFullScreen() {\n return this.techGet_('supportsFullScreen') || false;\n };\n /**\n * Check if the player is in fullscreen mode or tell the player that it\n * is or is not in fullscreen mode.\n *\n * > NOTE: As of the latest HTML5 spec, isFullscreen is no longer an official\n * property and instead document.fullscreenElement is used. But isFullscreen is\n * still a valuable property for internal player workings.\n *\n * @param {boolean} [isFS]\n * Set the players current fullscreen state\n *\n * @return {boolean}\n * - true if fullscreen is on and getting\n * - false if fullscreen is off and getting\n */\n\n\n _proto.isFullscreen = function isFullscreen(isFS) {\n if (isFS !== undefined) {\n this.isFullscreen_ = !!isFS;\n return;\n }\n\n return !!this.isFullscreen_;\n };\n /**\n * Increase the size of the video to full screen\n * In some browsers, full screen is not supported natively, so it enters\n * \"full window mode\", where the video fills the browser window.\n * In browsers and devices that support native full screen, sometimes the\n * browser's default controls will be shown, and not the Video.js custom skin.\n * This includes most mobile devices (iOS, Android) and older versions of\n * Safari.\n *\n * @fires Player#fullscreenchange\n */\n\n\n _proto.requestFullscreen = function requestFullscreen() {\n var fsApi = FullscreenApi;\n this.isFullscreen(true);\n\n if (fsApi.requestFullscreen) {\n // the browser supports going fullscreen at the element level so we can\n // take the controls fullscreen as well as the video\n // Trigger fullscreenchange event after change\n // We have to specifically add this each time, and remove\n // when canceling fullscreen. Otherwise if there's multiple\n // players on a page, they would all be reacting to the same fullscreen\n // events\n on(document, fsApi.fullscreenchange, bind(this, function documentFullscreenChange(e) {\n this.isFullscreen(document[fsApi.fullscreenElement]); // If cancelling fullscreen, remove event listener.\n\n if (this.isFullscreen() === false) {\n off(document, fsApi.fullscreenchange, documentFullscreenChange);\n }\n /**\n * @event Player#fullscreenchange\n * @type {EventTarget~Event}\n */\n\n\n this.trigger('fullscreenchange');\n }));\n this.el_[fsApi.requestFullscreen]();\n } else if (this.tech_.supportsFullScreen()) {\n // we can't take the video.js controls fullscreen but we can go fullscreen\n // with native controls\n this.techCall_('enterFullScreen');\n } else {\n // fullscreen isn't supported so we'll just stretch the video element to\n // fill the viewport\n this.enterFullWindow();\n /**\n * @event Player#fullscreenchange\n * @type {EventTarget~Event}\n */\n\n this.trigger('fullscreenchange');\n }\n };\n /**\n * Return the video to its normal size after having been in full screen mode\n *\n * @fires Player#fullscreenchange\n */\n\n\n _proto.exitFullscreen = function exitFullscreen() {\n var fsApi = FullscreenApi;\n this.isFullscreen(false); // Check for browser element fullscreen support\n\n if (fsApi.requestFullscreen) {\n document[fsApi.exitFullscreen]();\n } else if (this.tech_.supportsFullScreen()) {\n this.techCall_('exitFullScreen');\n } else {\n this.exitFullWindow();\n /**\n * @event Player#fullscreenchange\n * @type {EventTarget~Event}\n */\n\n this.trigger('fullscreenchange');\n }\n };\n /**\n * When fullscreen isn't supported we can stretch the\n * video container to as wide as the browser will let us.\n *\n * @fires Player#enterFullWindow\n */\n\n\n _proto.enterFullWindow = function enterFullWindow() {\n this.isFullWindow = true; // Storing original doc overflow value to return to when fullscreen is off\n\n this.docOrigOverflow = document.documentElement.style.overflow; // Add listener for esc key to exit fullscreen\n\n on(document, 'keydown', bind(this, this.fullWindowOnEscKey)); // Hide any scroll bars\n\n document.documentElement.style.overflow = 'hidden'; // Apply fullscreen styles\n\n addClass(document.body, 'vjs-full-window');\n /**\n * @event Player#enterFullWindow\n * @type {EventTarget~Event}\n */\n\n this.trigger('enterFullWindow');\n };\n /**\n * Check for call to either exit full window or\n * full screen on ESC key\n *\n * @param {string} event\n * Event to check for key press\n */\n\n\n _proto.fullWindowOnEscKey = function fullWindowOnEscKey(event) {\n if (event.keyCode === 27) {\n if (this.isFullscreen() === true) {\n this.exitFullscreen();\n } else {\n this.exitFullWindow();\n }\n }\n };\n /**\n * Exit full window\n *\n * @fires Player#exitFullWindow\n */\n\n\n _proto.exitFullWindow = function exitFullWindow() {\n this.isFullWindow = false;\n off(document, 'keydown', this.fullWindowOnEscKey); // Unhide scroll bars.\n\n document.documentElement.style.overflow = this.docOrigOverflow; // Remove fullscreen styles\n\n removeClass(document.body, 'vjs-full-window'); // Resize the box, controller, and poster to original sizes\n // this.positionAll();\n\n /**\n * @event Player#exitFullWindow\n * @type {EventTarget~Event}\n */\n\n this.trigger('exitFullWindow');\n };\n /**\n * Check whether the player can play a given mimetype\n *\n * @see https://www.w3.org/TR/2011/WD-html5-20110113/video.html#dom-navigator-canplaytype\n *\n * @param {string} type\n * The mimetype to check\n *\n * @return {string}\n * 'probably', 'maybe', or '' (empty string)\n */\n\n\n _proto.canPlayType = function canPlayType(type) {\n var can; // Loop through each playback technology in the options order\n\n for (var i = 0, j = this.options_.techOrder; i < j.length; i++) {\n var techName = j[i];\n var tech = Tech.getTech(techName); // Support old behavior of techs being registered as components.\n // Remove once that deprecated behavior is removed.\n\n if (!tech) {\n tech = Component.getComponent(techName);\n } // Check if the current tech is defined before continuing\n\n\n if (!tech) {\n log.error(\"The \\\"\" + techName + \"\\\" tech is undefined. Skipped browser support check for that tech.\");\n continue;\n } // Check if the browser supports this technology\n\n\n if (tech.isSupported()) {\n can = tech.canPlayType(type);\n\n if (can) {\n return can;\n }\n }\n }\n\n return '';\n };\n /**\n * Select source based on tech-order or source-order\n * Uses source-order selection if `options.sourceOrder` is truthy. Otherwise,\n * defaults to tech-order selection\n *\n * @param {Array} sources\n * The sources for a media asset\n *\n * @return {Object|boolean}\n * Object of source and tech order or false\n */\n\n\n _proto.selectSource = function selectSource(sources) {\n var _this9 = this;\n\n // Get only the techs specified in `techOrder` that exist and are supported by the\n // current platform\n var techs = this.options_.techOrder.map(function (techName) {\n return [techName, Tech.getTech(techName)];\n }).filter(function (_ref) {\n var techName = _ref[0],\n tech = _ref[1];\n\n // Check if the current tech is defined before continuing\n if (tech) {\n // Check if the browser supports this technology\n return tech.isSupported();\n }\n\n log.error(\"The \\\"\" + techName + \"\\\" tech is undefined. Skipped browser support check for that tech.\");\n return false;\n }); // Iterate over each `innerArray` element once per `outerArray` element and execute\n // `tester` with both. If `tester` returns a non-falsy value, exit early and return\n // that value.\n\n var findFirstPassingTechSourcePair = function findFirstPassingTechSourcePair(outerArray, innerArray, tester) {\n var found;\n outerArray.some(function (outerChoice) {\n return innerArray.some(function (innerChoice) {\n found = tester(outerChoice, innerChoice);\n\n if (found) {\n return true;\n }\n });\n });\n return found;\n };\n\n var foundSourceAndTech;\n\n var flip = function flip(fn) {\n return function (a, b) {\n return fn(b, a);\n };\n };\n\n var finder = function finder(_ref2, source) {\n var techName = _ref2[0],\n tech = _ref2[1];\n\n if (tech.canPlaySource(source, _this9.options_[techName.toLowerCase()])) {\n return {\n source: source,\n tech: techName\n };\n }\n }; // Depending on the truthiness of `options.sourceOrder`, we swap the order of techs and sources\n // to select from them based on their priority.\n\n\n if (this.options_.sourceOrder) {\n // Source-first ordering\n foundSourceAndTech = findFirstPassingTechSourcePair(sources, techs, flip(finder));\n } else {\n // Tech-first ordering\n foundSourceAndTech = findFirstPassingTechSourcePair(techs, sources, finder);\n }\n\n return foundSourceAndTech || false;\n };\n /**\n * Get or set the video source.\n *\n * @param {Tech~SourceObject|Tech~SourceObject[]|string} [source]\n * A SourceObject, an array of SourceObjects, or a string referencing\n * a URL to a media source. It is _highly recommended_ that an object\n * or array of objects is used here, so that source selection\n * algorithms can take the `type` into account.\n *\n * If not provided, this method acts as a getter.\n *\n * @return {string|undefined}\n * If the `source` argument is missing, returns the current source\n * URL. Otherwise, returns nothing/undefined.\n */\n\n\n _proto.src = function src(source) {\n var _this10 = this;\n\n // getter usage\n if (typeof source === 'undefined') {\n return this.cache_.src || '';\n } // filter out invalid sources and turn our source into\n // an array of source objects\n\n\n var sources = filterSource(source); // if a source was passed in then it is invalid because\n // it was filtered to a zero length Array. So we have to\n // show an error\n\n if (!sources.length) {\n this.setTimeout(function () {\n this.error({\n code: 4,\n message: this.localize(this.options_.notSupportedMessage)\n });\n }, 0);\n return;\n } // intial sources\n\n\n this.changingSrc_ = true;\n this.cache_.sources = sources;\n this.updateSourceCaches_(sources[0]); // middlewareSource is the source after it has been changed by middleware\n\n setSource(this, sources[0], function (middlewareSource, mws) {\n _this10.middleware_ = mws; // since sourceSet is async we have to update the cache again after we select a source since\n // the source that is selected could be out of order from the cache update above this callback.\n\n _this10.cache_.sources = sources;\n\n _this10.updateSourceCaches_(middlewareSource);\n\n var err = _this10.src_(middlewareSource);\n\n if (err) {\n if (sources.length > 1) {\n return _this10.src(sources.slice(1));\n }\n\n _this10.changingSrc_ = false; // We need to wrap this in a timeout to give folks a chance to add error event handlers\n\n _this10.setTimeout(function () {\n this.error({\n code: 4,\n message: this.localize(this.options_.notSupportedMessage)\n });\n }, 0); // we could not find an appropriate tech, but let's still notify the delegate that this is it\n // this needs a better comment about why this is needed\n\n\n _this10.triggerReady();\n\n return;\n }\n\n setTech(mws, _this10.tech_);\n });\n };\n /**\n * Set the source object on the tech, returns a boolean that indicates whether\n * there is a tech that can play the source or not\n *\n * @param {Tech~SourceObject} source\n * The source object to set on the Tech\n *\n * @return {boolean}\n * - True if there is no Tech to playback this source\n * - False otherwise\n *\n * @private\n */\n\n\n _proto.src_ = function src_(source) {\n var _this11 = this;\n\n var sourceTech = this.selectSource([source]);\n\n if (!sourceTech) {\n return true;\n }\n\n if (!titleCaseEquals(sourceTech.tech, this.techName_)) {\n this.changingSrc_ = true; // load this technology with the chosen source\n\n this.loadTech_(sourceTech.tech, sourceTech.source);\n this.tech_.ready(function () {\n _this11.changingSrc_ = false;\n });\n return false;\n } // wait until the tech is ready to set the source\n // and set it synchronously if possible (#2326)\n\n\n this.ready(function () {\n // The setSource tech method was added with source handlers\n // so older techs won't support it\n // We need to check the direct prototype for the case where subclasses\n // of the tech do not support source handlers\n if (this.tech_.constructor.prototype.hasOwnProperty('setSource')) {\n this.techCall_('setSource', source);\n } else {\n this.techCall_('src', source.src);\n }\n\n this.changingSrc_ = false;\n }, true);\n return false;\n };\n /**\n * Begin loading the src data.\n */\n\n\n _proto.load = function load() {\n this.techCall_('load');\n };\n /**\n * Reset the player. Loads the first tech in the techOrder,\n * removes all the text tracks in the existing `tech`,\n * and calls `reset` on the `tech`.\n */\n\n\n _proto.reset = function reset() {\n if (this.tech_) {\n this.tech_.clearTracks('text');\n }\n\n this.loadTech_(this.options_.techOrder[0], null);\n this.techCall_('reset');\n\n if (isEvented(this)) {\n this.trigger('playerreset');\n }\n };\n /**\n * Returns all of the current source objects.\n *\n * @return {Tech~SourceObject[]}\n * The current source objects\n */\n\n\n _proto.currentSources = function currentSources() {\n var source = this.currentSource();\n var sources = []; // assume `{}` or `{ src }`\n\n if (Object.keys(source).length !== 0) {\n sources.push(source);\n }\n\n return this.cache_.sources || sources;\n };\n /**\n * Returns the current source object.\n *\n * @return {Tech~SourceObject}\n * The current source object\n */\n\n\n _proto.currentSource = function currentSource() {\n return this.cache_.source || {};\n };\n /**\n * Returns the fully qualified URL of the current source value e.g. http://mysite.com/video.mp4\n * Can be used in conjunction with `currentType` to assist in rebuilding the current source object.\n *\n * @return {string}\n * The current source\n */\n\n\n _proto.currentSrc = function currentSrc() {\n return this.currentSource() && this.currentSource().src || '';\n };\n /**\n * Get the current source type e.g. video/mp4\n * This can allow you rebuild the current source object so that you could load the same\n * source and tech later\n *\n * @return {string}\n * The source MIME type\n */\n\n\n _proto.currentType = function currentType() {\n return this.currentSource() && this.currentSource().type || '';\n };\n /**\n * Get or set the preload attribute\n *\n * @param {boolean} [value]\n * - true means that we should preload\n * - false means that we should not preload\n *\n * @return {string}\n * The preload attribute value when getting\n */\n\n\n _proto.preload = function preload(value) {\n if (value !== undefined) {\n this.techCall_('setPreload', value);\n this.options_.preload = value;\n return;\n }\n\n return this.techGet_('preload');\n };\n /**\n * Get or set the autoplay option. When this is a boolean it will\n * modify the attribute on the tech. When this is a string the attribute on\n * the tech will be removed and `Player` will handle autoplay on loadstarts.\n *\n * @param {boolean|string} [value]\n * - true: autoplay using the browser behavior\n * - false: do not autoplay\n * - 'play': call play() on every loadstart\n * - 'muted': call muted() then play() on every loadstart\n * - 'any': call play() on every loadstart. if that fails call muted() then play().\n * - *: values other than those listed here will be set `autoplay` to true\n *\n * @return {boolean|string}\n * The current value of autoplay when getting\n */\n\n\n _proto.autoplay = function autoplay(value) {\n // getter usage\n if (value === undefined) {\n return this.options_.autoplay || false;\n }\n\n var techAutoplay; // if the value is a valid string set it to that\n\n if (typeof value === 'string' && /(any|play|muted)/.test(value)) {\n this.options_.autoplay = value;\n this.manualAutoplay_(value);\n techAutoplay = false; // any falsy value sets autoplay to false in the browser,\n // lets do the same\n } else if (!value) {\n this.options_.autoplay = false; // any other value (ie truthy) sets autoplay to true\n } else {\n this.options_.autoplay = true;\n }\n\n techAutoplay = techAutoplay || this.options_.autoplay; // if we don't have a tech then we do not queue up\n // a setAutoplay call on tech ready. We do this because the\n // autoplay option will be passed in the constructor and we\n // do not need to set it twice\n\n if (this.tech_) {\n this.techCall_('setAutoplay', techAutoplay);\n }\n };\n /**\n * Set or unset the playsinline attribute.\n * Playsinline tells the browser that non-fullscreen playback is preferred.\n *\n * @param {boolean} [value]\n * - true means that we should try to play inline by default\n * - false means that we should use the browser's default playback mode,\n * which in most cases is inline. iOS Safari is a notable exception\n * and plays fullscreen by default.\n *\n * @return {string|Player}\n * - the current value of playsinline\n * - the player when setting\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/#attr-video-playsinline}\n */\n\n\n _proto.playsinline = function playsinline(value) {\n if (value !== undefined) {\n this.techCall_('setPlaysinline', value);\n this.options_.playsinline = value;\n return this;\n }\n\n return this.techGet_('playsinline');\n };\n /**\n * Get or set the loop attribute on the video element.\n *\n * @param {boolean} [value]\n * - true means that we should loop the video\n * - false means that we should not loop the video\n *\n * @return {string}\n * The current value of loop when getting\n */\n\n\n _proto.loop = function loop(value) {\n if (value !== undefined) {\n this.techCall_('setLoop', value);\n this.options_.loop = value;\n return;\n }\n\n return this.techGet_('loop');\n };\n /**\n * Get or set the poster image source url\n *\n * @fires Player#posterchange\n *\n * @param {string} [src]\n * Poster image source URL\n *\n * @return {string}\n * The current value of poster when getting\n */\n\n\n _proto.poster = function poster(src) {\n if (src === undefined) {\n return this.poster_;\n } // The correct way to remove a poster is to set as an empty string\n // other falsey values will throw errors\n\n\n if (!src) {\n src = '';\n }\n\n if (src === this.poster_) {\n return;\n } // update the internal poster variable\n\n\n this.poster_ = src; // update the tech's poster\n\n this.techCall_('setPoster', src);\n this.isPosterFromTech_ = false; // alert components that the poster has been set\n\n /**\n * This event fires when the poster image is changed on the player.\n *\n * @event Player#posterchange\n * @type {EventTarget~Event}\n */\n\n this.trigger('posterchange');\n };\n /**\n * Some techs (e.g. YouTube) can provide a poster source in an\n * asynchronous way. We want the poster component to use this\n * poster source so that it covers up the tech's controls.\n * (YouTube's play button). However we only want to use this\n * source if the player user hasn't set a poster through\n * the normal APIs.\n *\n * @fires Player#posterchange\n * @listens Tech#posterchange\n * @private\n */\n\n\n _proto.handleTechPosterChange_ = function handleTechPosterChange_() {\n if ((!this.poster_ || this.options_.techCanOverridePoster) && this.tech_ && this.tech_.poster) {\n var newPoster = this.tech_.poster() || '';\n\n if (newPoster !== this.poster_) {\n this.poster_ = newPoster;\n this.isPosterFromTech_ = true; // Let components know the poster has changed\n\n this.trigger('posterchange');\n }\n }\n };\n /**\n * Get or set whether or not the controls are showing.\n *\n * @fires Player#controlsenabled\n *\n * @param {boolean} [bool]\n * - true to turn controls on\n * - false to turn controls off\n *\n * @return {boolean}\n * The current value of controls when getting\n */\n\n\n _proto.controls = function controls(bool) {\n if (bool === undefined) {\n return !!this.controls_;\n }\n\n bool = !!bool; // Don't trigger a change event unless it actually changed\n\n if (this.controls_ === bool) {\n return;\n }\n\n this.controls_ = bool;\n\n if (this.usingNativeControls()) {\n this.techCall_('setControls', bool);\n }\n\n if (this.controls_) {\n this.removeClass('vjs-controls-disabled');\n this.addClass('vjs-controls-enabled');\n /**\n * @event Player#controlsenabled\n * @type {EventTarget~Event}\n */\n\n this.trigger('controlsenabled');\n\n if (!this.usingNativeControls()) {\n this.addTechControlsListeners_();\n }\n } else {\n this.removeClass('vjs-controls-enabled');\n this.addClass('vjs-controls-disabled');\n /**\n * @event Player#controlsdisabled\n * @type {EventTarget~Event}\n */\n\n this.trigger('controlsdisabled');\n\n if (!this.usingNativeControls()) {\n this.removeTechControlsListeners_();\n }\n }\n };\n /**\n * Toggle native controls on/off. Native controls are the controls built into\n * devices (e.g. default iPhone controls), Flash, or other techs\n * (e.g. Vimeo Controls)\n * **This should only be set by the current tech, because only the tech knows\n * if it can support native controls**\n *\n * @fires Player#usingnativecontrols\n * @fires Player#usingcustomcontrols\n *\n * @param {boolean} [bool]\n * - true to turn native controls on\n * - false to turn native controls off\n *\n * @return {boolean}\n * The current value of native controls when getting\n */\n\n\n _proto.usingNativeControls = function usingNativeControls(bool) {\n if (bool === undefined) {\n return !!this.usingNativeControls_;\n }\n\n bool = !!bool; // Don't trigger a change event unless it actually changed\n\n if (this.usingNativeControls_ === bool) {\n return;\n }\n\n this.usingNativeControls_ = bool;\n\n if (this.usingNativeControls_) {\n this.addClass('vjs-using-native-controls');\n /**\n * player is using the native device controls\n *\n * @event Player#usingnativecontrols\n * @type {EventTarget~Event}\n */\n\n this.trigger('usingnativecontrols');\n } else {\n this.removeClass('vjs-using-native-controls');\n /**\n * player is using the custom HTML controls\n *\n * @event Player#usingcustomcontrols\n * @type {EventTarget~Event}\n */\n\n this.trigger('usingcustomcontrols');\n }\n };\n /**\n * Set or get the current MediaError\n *\n * @fires Player#error\n *\n * @param {MediaError|string|number} [err]\n * A MediaError or a string/number to be turned\n * into a MediaError\n *\n * @return {MediaError|null}\n * The current MediaError when getting (or null)\n */\n\n\n _proto.error = function error(err) {\n if (err === undefined) {\n return this.error_ || null;\n } // restoring to default\n\n\n if (err === null) {\n this.error_ = err;\n this.removeClass('vjs-error');\n\n if (this.errorDisplay) {\n this.errorDisplay.close();\n }\n\n return;\n }\n\n this.error_ = new MediaError(err); // add the vjs-error classname to the player\n\n this.addClass('vjs-error'); // log the name of the error type and any message\n // IE11 logs \"[object object]\" and required you to expand message to see error object\n\n log.error(\"(CODE:\" + this.error_.code + \" \" + MediaError.errorTypes[this.error_.code] + \")\", this.error_.message, this.error_);\n /**\n * @event Player#error\n * @type {EventTarget~Event}\n */\n\n this.trigger('error');\n return;\n };\n /**\n * Report user activity\n *\n * @param {Object} event\n * Event object\n */\n\n\n _proto.reportUserActivity = function reportUserActivity(event) {\n this.userActivity_ = true;\n };\n /**\n * Get/set if user is active\n *\n * @fires Player#useractive\n * @fires Player#userinactive\n *\n * @param {boolean} [bool]\n * - true if the user is active\n * - false if the user is inactive\n *\n * @return {boolean}\n * The current value of userActive when getting\n */\n\n\n _proto.userActive = function userActive(bool) {\n if (bool === undefined) {\n return this.userActive_;\n }\n\n bool = !!bool;\n\n if (bool === this.userActive_) {\n return;\n }\n\n this.userActive_ = bool;\n\n if (this.userActive_) {\n this.userActivity_ = true;\n this.removeClass('vjs-user-inactive');\n this.addClass('vjs-user-active');\n /**\n * @event Player#useractive\n * @type {EventTarget~Event}\n */\n\n this.trigger('useractive');\n return;\n } // Chrome/Safari/IE have bugs where when you change the cursor it can\n // trigger a mousemove event. This causes an issue when you're hiding\n // the cursor when the user is inactive, and a mousemove signals user\n // activity. Making it impossible to go into inactive mode. Specifically\n // this happens in fullscreen when we really need to hide the cursor.\n //\n // When this gets resolved in ALL browsers it can be removed\n // https://code.google.com/p/chromium/issues/detail?id=103041\n\n\n if (this.tech_) {\n this.tech_.one('mousemove', function (e) {\n e.stopPropagation();\n e.preventDefault();\n });\n }\n\n this.userActivity_ = false;\n this.removeClass('vjs-user-active');\n this.addClass('vjs-user-inactive');\n /**\n * @event Player#userinactive\n * @type {EventTarget~Event}\n */\n\n this.trigger('userinactive');\n };\n /**\n * Listen for user activity based on timeout value\n *\n * @private\n */\n\n\n _proto.listenForUserActivity_ = function listenForUserActivity_() {\n var mouseInProgress;\n var lastMoveX;\n var lastMoveY;\n var handleActivity = bind(this, this.reportUserActivity);\n\n var handleMouseMove = function handleMouseMove(e) {\n // #1068 - Prevent mousemove spamming\n // Chrome Bug: https://code.google.com/p/chromium/issues/detail?id=366970\n if (e.screenX !== lastMoveX || e.screenY !== lastMoveY) {\n lastMoveX = e.screenX;\n lastMoveY = e.screenY;\n handleActivity();\n }\n };\n\n var handleMouseDown = function handleMouseDown() {\n handleActivity(); // For as long as the they are touching the device or have their mouse down,\n // we consider them active even if they're not moving their finger or mouse.\n // So we want to continue to update that they are active\n\n this.clearInterval(mouseInProgress); // Setting userActivity=true now and setting the interval to the same time\n // as the activityCheck interval (250) should ensure we never miss the\n // next activityCheck\n\n mouseInProgress = this.setInterval(handleActivity, 250);\n };\n\n var handleMouseUp = function handleMouseUp(event) {\n handleActivity(); // Stop the interval that maintains activity if the mouse/touch is down\n\n this.clearInterval(mouseInProgress);\n }; // Any mouse movement will be considered user activity\n\n\n this.on('mousedown', handleMouseDown);\n this.on('mousemove', handleMouseMove);\n this.on('mouseup', handleMouseUp); // Listen for keyboard navigation\n // Shouldn't need to use inProgress interval because of key repeat\n\n this.on('keydown', handleActivity);\n this.on('keyup', handleActivity); // Run an interval every 250 milliseconds instead of stuffing everything into\n // the mousemove/touchmove function itself, to prevent performance degradation.\n // `this.reportUserActivity` simply sets this.userActivity_ to true, which\n // then gets picked up by this loop\n // http://ejohn.org/blog/learning-from-twitter/\n\n var inactivityTimeout;\n this.setInterval(function () {\n // Check to see if mouse/touch activity has happened\n if (!this.userActivity_) {\n return;\n } // Reset the activity tracker\n\n\n this.userActivity_ = false; // If the user state was inactive, set the state to active\n\n this.userActive(true); // Clear any existing inactivity timeout to start the timer over\n\n this.clearTimeout(inactivityTimeout);\n var timeout = this.options_.inactivityTimeout;\n\n if (timeout <= 0) {\n return;\n } // In <timeout> milliseconds, if no more activity has occurred the\n // user will be considered inactive\n\n\n inactivityTimeout = this.setTimeout(function () {\n // Protect against the case where the inactivityTimeout can trigger just\n // before the next user activity is picked up by the activity check loop\n // causing a flicker\n if (!this.userActivity_) {\n this.userActive(false);\n }\n }, timeout);\n }, 250);\n };\n /**\n * Gets or sets the current playback rate. A playback rate of\n * 1.0 represents normal speed and 0.5 would indicate half-speed\n * playback, for instance.\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-playbackrate\n *\n * @param {number} [rate]\n * New playback rate to set.\n *\n * @return {number}\n * The current playback rate when getting or 1.0\n */\n\n\n _proto.playbackRate = function playbackRate(rate) {\n if (rate !== undefined) {\n // NOTE: this.cache_.lastPlaybackRate is set from the tech handler\n // that is registered above\n this.techCall_('setPlaybackRate', rate);\n return;\n }\n\n if (this.tech_ && this.tech_.featuresPlaybackRate) {\n return this.cache_.lastPlaybackRate || this.techGet_('playbackRate');\n }\n\n return 1.0;\n };\n /**\n * Gets or sets the current default playback rate. A default playback rate of\n * 1.0 represents normal speed and 0.5 would indicate half-speed playback, for instance.\n * defaultPlaybackRate will only represent what the initial playbackRate of a video was, not\n * not the current playbackRate.\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-defaultplaybackrate\n *\n * @param {number} [rate]\n * New default playback rate to set.\n *\n * @return {number|Player}\n * - The default playback rate when getting or 1.0\n * - the player when setting\n */\n\n\n _proto.defaultPlaybackRate = function defaultPlaybackRate(rate) {\n if (rate !== undefined) {\n return this.techCall_('setDefaultPlaybackRate', rate);\n }\n\n if (this.tech_ && this.tech_.featuresPlaybackRate) {\n return this.techGet_('defaultPlaybackRate');\n }\n\n return 1.0;\n };\n /**\n * Gets or sets the audio flag\n *\n * @param {boolean} bool\n * - true signals that this is an audio player\n * - false signals that this is not an audio player\n *\n * @return {boolean}\n * The current value of isAudio when getting\n */\n\n\n _proto.isAudio = function isAudio(bool) {\n if (bool !== undefined) {\n this.isAudio_ = !!bool;\n return;\n }\n\n return !!this.isAudio_;\n };\n /**\n * A helper method for adding a {@link TextTrack} to our\n * {@link TextTrackList}.\n *\n * In addition to the W3C settings we allow adding additional info through options.\n *\n * @see http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-addtexttrack\n *\n * @param {string} [kind]\n * the kind of TextTrack you are adding\n *\n * @param {string} [label]\n * the label to give the TextTrack label\n *\n * @param {string} [language]\n * the language to set on the TextTrack\n *\n * @return {TextTrack|undefined}\n * the TextTrack that was added or undefined\n * if there is no tech\n */\n\n\n _proto.addTextTrack = function addTextTrack(kind, label, language) {\n if (this.tech_) {\n return this.tech_.addTextTrack(kind, label, language);\n }\n };\n /**\n * Create a remote {@link TextTrack} and an {@link HTMLTrackElement}. It will\n * automatically removed from the video element whenever the source changes, unless\n * manualCleanup is set to false.\n *\n * @param {Object} options\n * Options to pass to {@link HTMLTrackElement} during creation. See\n * {@link HTMLTrackElement} for object properties that you should use.\n *\n * @param {boolean} [manualCleanup=true] if set to false, the TextTrack will be\n *\n * @return {HtmlTrackElement}\n * the HTMLTrackElement that was created and added\n * to the HtmlTrackElementList and the remote\n * TextTrackList\n *\n * @deprecated The default value of the \"manualCleanup\" parameter will default\n * to \"false\" in upcoming versions of Video.js\n */\n\n\n _proto.addRemoteTextTrack = function addRemoteTextTrack(options, manualCleanup) {\n if (this.tech_) {\n return this.tech_.addRemoteTextTrack(options, manualCleanup);\n }\n };\n /**\n * Remove a remote {@link TextTrack} from the respective\n * {@link TextTrackList} and {@link HtmlTrackElementList}.\n *\n * @param {Object} track\n * Remote {@link TextTrack} to remove\n *\n * @return {undefined}\n * does not return anything\n */\n\n\n _proto.removeRemoteTextTrack = function removeRemoteTextTrack(obj) {\n if (obj === void 0) {\n obj = {};\n }\n\n var _obj = obj,\n track = _obj.track;\n\n if (!track) {\n track = obj;\n } // destructure the input into an object with a track argument, defaulting to arguments[0]\n // default the whole argument to an empty object if nothing was passed in\n\n\n if (this.tech_) {\n return this.tech_.removeRemoteTextTrack(track);\n }\n };\n /**\n * Gets available media playback quality metrics as specified by the W3C's Media\n * Playback Quality API.\n *\n * @see [Spec]{@link https://wicg.github.io/media-playback-quality}\n *\n * @return {Object|undefined}\n * An object with supported media playback quality metrics or undefined if there\n * is no tech or the tech does not support it.\n */\n\n\n _proto.getVideoPlaybackQuality = function getVideoPlaybackQuality() {\n return this.techGet_('getVideoPlaybackQuality');\n };\n /**\n * Get video width\n *\n * @return {number}\n * current video width\n */\n\n\n _proto.videoWidth = function videoWidth() {\n return this.tech_ && this.tech_.videoWidth && this.tech_.videoWidth() || 0;\n };\n /**\n * Get video height\n *\n * @return {number}\n * current video height\n */\n\n\n _proto.videoHeight = function videoHeight() {\n return this.tech_ && this.tech_.videoHeight && this.tech_.videoHeight() || 0;\n };\n /**\n * The player's language code\n * NOTE: The language should be set in the player options if you want the\n * the controls to be built with a specific language. Changing the language\n * later will not update controls text.\n *\n * @param {string} [code]\n * the language code to set the player to\n *\n * @return {string}\n * The current language code when getting\n */\n\n\n _proto.language = function language(code) {\n if (code === undefined) {\n return this.language_;\n }\n\n this.language_ = String(code).toLowerCase();\n };\n /**\n * Get the player's language dictionary\n * Merge every time, because a newly added plugin might call videojs.addLanguage() at any time\n * Languages specified directly in the player options have precedence\n *\n * @return {Array}\n * An array of of supported languages\n */\n\n\n _proto.languages = function languages() {\n return mergeOptions(Player.prototype.options_.languages, this.languages_);\n };\n /**\n * returns a JavaScript object reperesenting the current track\n * information. **DOES not return it as JSON**\n *\n * @return {Object}\n * Object representing the current of track info\n */\n\n\n _proto.toJSON = function toJSON() {\n var options = mergeOptions(this.options_);\n var tracks = options.tracks;\n options.tracks = [];\n\n for (var i = 0; i < tracks.length; i++) {\n var track = tracks[i]; // deep merge tracks and null out player so no circular references\n\n track = mergeOptions(track);\n track.player = undefined;\n options.tracks[i] = track;\n }\n\n return options;\n };\n /**\n * Creates a simple modal dialog (an instance of the {@link ModalDialog}\n * component) that immediately overlays the player with arbitrary\n * content and removes itself when closed.\n *\n * @param {string|Function|Element|Array|null} content\n * Same as {@link ModalDialog#content}'s param of the same name.\n * The most straight-forward usage is to provide a string or DOM\n * element.\n *\n * @param {Object} [options]\n * Extra options which will be passed on to the {@link ModalDialog}.\n *\n * @return {ModalDialog}\n * the {@link ModalDialog} that was created\n */\n\n\n _proto.createModal = function createModal(content, options) {\n var _this12 = this;\n\n options = options || {};\n options.content = content || '';\n var modal = new ModalDialog(this, options);\n this.addChild(modal);\n modal.on('dispose', function () {\n _this12.removeChild(modal);\n });\n modal.open();\n return modal;\n };\n /**\n * Change breakpoint classes when the player resizes.\n *\n * @private\n */\n\n\n _proto.updateCurrentBreakpoint_ = function updateCurrentBreakpoint_() {\n if (!this.responsive()) {\n return;\n }\n\n var currentBreakpoint = this.currentBreakpoint();\n var currentWidth = this.currentWidth();\n\n for (var i = 0; i < BREAKPOINT_ORDER.length; i++) {\n var candidateBreakpoint = BREAKPOINT_ORDER[i];\n var maxWidth = this.breakpoints_[candidateBreakpoint];\n\n if (currentWidth <= maxWidth) {\n // The current breakpoint did not change, nothing to do.\n if (currentBreakpoint === candidateBreakpoint) {\n return;\n } // Only remove a class if there is a current breakpoint.\n\n\n if (currentBreakpoint) {\n this.removeClass(BREAKPOINT_CLASSES[currentBreakpoint]);\n }\n\n this.addClass(BREAKPOINT_CLASSES[candidateBreakpoint]);\n this.breakpoint_ = candidateBreakpoint;\n break;\n }\n }\n };\n /**\n * Removes the current breakpoint.\n *\n * @private\n */\n\n\n _proto.removeCurrentBreakpoint_ = function removeCurrentBreakpoint_() {\n var className = this.currentBreakpointClass();\n this.breakpoint_ = '';\n\n if (className) {\n this.removeClass(className);\n }\n };\n /**\n * Get or set breakpoints on the player.\n *\n * Calling this method with an object or `true` will remove any previous\n * custom breakpoints and start from the defaults again.\n *\n * @param {Object|boolean} [breakpoints]\n * If an object is given, it can be used to provide custom\n * breakpoints. If `true` is given, will set default breakpoints.\n * If this argument is not given, will simply return the current\n * breakpoints.\n *\n * @param {number} [breakpoints.tiny]\n * The maximum width for the \"vjs-layout-tiny\" class.\n *\n * @param {number} [breakpoints.xsmall]\n * The maximum width for the \"vjs-layout-x-small\" class.\n *\n * @param {number} [breakpoints.small]\n * The maximum width for the \"vjs-layout-small\" class.\n *\n * @param {number} [breakpoints.medium]\n * The maximum width for the \"vjs-layout-medium\" class.\n *\n * @param {number} [breakpoints.large]\n * The maximum width for the \"vjs-layout-large\" class.\n *\n * @param {number} [breakpoints.xlarge]\n * The maximum width for the \"vjs-layout-x-large\" class.\n *\n * @param {number} [breakpoints.huge]\n * The maximum width for the \"vjs-layout-huge\" class.\n *\n * @return {Object}\n * An object mapping breakpoint names to maximum width values.\n */\n\n\n _proto.breakpoints = function breakpoints(_breakpoints) {\n // Used as a getter.\n if (_breakpoints === undefined) {\n return assign(this.breakpoints_);\n }\n\n this.breakpoint_ = '';\n this.breakpoints_ = assign({}, DEFAULT_BREAKPOINTS, _breakpoints); // When breakpoint definitions change, we need to update the currently\n // selected breakpoint.\n\n this.updateCurrentBreakpoint_(); // Clone the breakpoints before returning.\n\n return assign(this.breakpoints_);\n };\n /**\n * Get or set a flag indicating whether or not this player should adjust\n * its UI based on its dimensions.\n *\n * @param {boolean} value\n * Should be `true` if the player should adjust its UI based on its\n * dimensions; otherwise, should be `false`.\n *\n * @return {boolean}\n * Will be `true` if this player should adjust its UI based on its\n * dimensions; otherwise, will be `false`.\n */\n\n\n _proto.responsive = function responsive(value) {\n // Used as a getter.\n if (value === undefined) {\n return this.responsive_;\n }\n\n value = Boolean(value);\n var current = this.responsive_; // Nothing changed.\n\n if (value === current) {\n return;\n } // The value actually changed, set it.\n\n\n this.responsive_ = value; // Start listening for breakpoints and set the initial breakpoint if the\n // player is now responsive.\n\n if (value) {\n this.on('playerresize', this.updateCurrentBreakpoint_);\n this.updateCurrentBreakpoint_(); // Stop listening for breakpoints if the player is no longer responsive.\n } else {\n this.off('playerresize', this.updateCurrentBreakpoint_);\n this.removeCurrentBreakpoint_();\n }\n\n return value;\n };\n /**\n * Get current breakpoint name, if any.\n *\n * @return {string}\n * If there is currently a breakpoint set, returns a the key from the\n * breakpoints object matching it. Otherwise, returns an empty string.\n */\n\n\n _proto.currentBreakpoint = function currentBreakpoint() {\n return this.breakpoint_;\n };\n /**\n * Get the current breakpoint class name.\n *\n * @return {string}\n * The matching class name (e.g. `\"vjs-layout-tiny\"` or\n * `\"vjs-layout-large\"`) for the current breakpoint. Empty string if\n * there is no current breakpoint.\n */\n\n\n _proto.currentBreakpointClass = function currentBreakpointClass() {\n return BREAKPOINT_CLASSES[this.breakpoint_] || '';\n };\n /**\n * Gets tag settings\n *\n * @param {Element} tag\n * The player tag\n *\n * @return {Object}\n * An object containing all of the settings\n * for a player tag\n */\n\n\n Player.getTagSettings = function getTagSettings(tag) {\n var baseOptions = {\n sources: [],\n tracks: []\n };\n var tagOptions = getAttributes(tag);\n var dataSetup = tagOptions['data-setup'];\n\n if (hasClass(tag, 'vjs-fill')) {\n tagOptions.fill = true;\n }\n\n if (hasClass(tag, 'vjs-fluid')) {\n tagOptions.fluid = true;\n } // Check if data-setup attr exists.\n\n\n if (dataSetup !== null) {\n // Parse options JSON\n // If empty string, make it a parsable json object.\n var _safeParseTuple = safeParseTuple(dataSetup || '{}'),\n err = _safeParseTuple[0],\n data = _safeParseTuple[1];\n\n if (err) {\n log.error(err);\n }\n\n assign(tagOptions, data);\n }\n\n assign(baseOptions, tagOptions); // Get tag children settings\n\n if (tag.hasChildNodes()) {\n var children = tag.childNodes;\n\n for (var i = 0, j = children.length; i < j; i++) {\n var child = children[i]; // Change case needed: http://ejohn.org/blog/nodename-case-sensitivity/\n\n var childName = child.nodeName.toLowerCase();\n\n if (childName === 'source') {\n baseOptions.sources.push(getAttributes(child));\n } else if (childName === 'track') {\n baseOptions.tracks.push(getAttributes(child));\n }\n }\n }\n\n return baseOptions;\n };\n /**\n * Determine whether or not flexbox is supported\n *\n * @return {boolean}\n * - true if flexbox is supported\n * - false if flexbox is not supported\n */\n\n\n _proto.flexNotSupported_ = function flexNotSupported_() {\n var elem = document.createElement('i'); // Note: We don't actually use flexBasis (or flexOrder), but it's one of the more\n // common flex features that we can rely on when checking for flex support.\n\n return !('flexBasis' in elem.style || 'webkitFlexBasis' in elem.style || 'mozFlexBasis' in elem.style || 'msFlexBasis' in elem.style || // IE10-specific (2012 flex spec), available for completeness\n 'msFlexOrder' in elem.style);\n };\n\n return Player;\n}(Component);\n/**\n * Get the {@link VideoTrackList}\n * @link https://html.spec.whatwg.org/multipage/embedded-content.html#videotracklist\n *\n * @return {VideoTrackList}\n * the current video track list\n *\n * @method Player.prototype.videoTracks\n */\n\n/**\n * Get the {@link AudioTrackList}\n * @link https://html.spec.whatwg.org/multipage/embedded-content.html#audiotracklist\n *\n * @return {AudioTrackList}\n * the current audio track list\n *\n * @method Player.prototype.audioTracks\n */\n\n/**\n * Get the {@link TextTrackList}\n *\n * @link http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-texttracks\n *\n * @return {TextTrackList}\n * the current text track list\n *\n * @method Player.prototype.textTracks\n */\n\n/**\n * Get the remote {@link TextTrackList}\n *\n * @return {TextTrackList}\n * The current remote text track list\n *\n * @method Player.prototype.remoteTextTracks\n */\n\n/**\n * Get the remote {@link HtmlTrackElementList} tracks.\n *\n * @return {HtmlTrackElementList}\n * The current remote text track element list\n *\n * @method Player.prototype.remoteTextTrackEls\n */\n\n\nALL.names.forEach(function (name$$1) {\n var props = ALL[name$$1];\n\n Player.prototype[props.getterName] = function () {\n if (this.tech_) {\n return this.tech_[props.getterName]();\n } // if we have not yet loadTech_, we create {video,audio,text}Tracks_\n // these will be passed to the tech during loading\n\n\n this[props.privateName] = this[props.privateName] || new props.ListClass();\n return this[props.privateName];\n };\n});\n/**\n * Global enumeration of players.\n *\n * The keys are the player IDs and the values are either the {@link Player}\n * instance or `null` for disposed players.\n *\n * @type {Object}\n */\n\nPlayer.players = {};\nvar navigator = window$1.navigator;\n/*\n * Player instance options, surfaced using options\n * options = Player.prototype.options_\n * Make changes in options, not here.\n *\n * @type {Object}\n * @private\n */\n\nPlayer.prototype.options_ = {\n // Default order of fallback technology\n techOrder: Tech.defaultTechOrder_,\n html5: {},\n flash: {},\n // default inactivity timeout\n inactivityTimeout: 2000,\n // default playback rates\n playbackRates: [],\n // Add playback rate selection by adding rates\n // 'playbackRates': [0.5, 1, 1.5, 2],\n liveui: false,\n // Included control sets\n children: ['mediaLoader', 'posterImage', 'textTrackDisplay', 'loadingSpinner', 'bigPlayButton', 'liveTracker', 'controlBar', 'errorDisplay', 'textTrackSettings', 'resizeManager'],\n language: navigator && (navigator.languages && navigator.languages[0] || navigator.userLanguage || navigator.language) || 'en',\n // locales and their language translations\n languages: {},\n // Default message to show when a video cannot be played.\n notSupportedMessage: 'No compatible source was found for this media.',\n breakpoints: {},\n responsive: false\n};\n[\n/**\n * Returns whether or not the player is in the \"ended\" state.\n *\n * @return {Boolean} True if the player is in the ended state, false if not.\n * @method Player#ended\n */\n'ended',\n/**\n * Returns whether or not the player is in the \"seeking\" state.\n *\n * @return {Boolean} True if the player is in the seeking state, false if not.\n * @method Player#seeking\n */\n'seeking',\n/**\n * Returns the TimeRanges of the media that are currently available\n * for seeking to.\n *\n * @return {TimeRanges} the seekable intervals of the media timeline\n * @method Player#seekable\n */\n'seekable',\n/**\n * Returns the current state of network activity for the element, from\n * the codes in the list below.\n * - NETWORK_EMPTY (numeric value 0)\n * The element has not yet been initialised. All attributes are in\n * their initial states.\n * - NETWORK_IDLE (numeric value 1)\n * The element's resource selection algorithm is active and has\n * selected a resource, but it is not actually using the network at\n * this time.\n * - NETWORK_LOADING (numeric value 2)\n * The user agent is actively trying to download data.\n * - NETWORK_NO_SOURCE (numeric value 3)\n * The element's resource selection algorithm is active, but it has\n * not yet found a resource to use.\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#network-states\n * @return {number} the current network activity state\n * @method Player#networkState\n */\n'networkState',\n/**\n * Returns a value that expresses the current state of the element\n * with respect to rendering the current playback position, from the\n * codes in the list below.\n * - HAVE_NOTHING (numeric value 0)\n * No information regarding the media resource is available.\n * - HAVE_METADATA (numeric value 1)\n * Enough of the resource has been obtained that the duration of the\n * resource is available.\n * - HAVE_CURRENT_DATA (numeric value 2)\n * Data for the immediate current playback position is available.\n * - HAVE_FUTURE_DATA (numeric value 3)\n * Data for the immediate current playback position is available, as\n * well as enough data for the user agent to advance the current\n * playback position in the direction of playback.\n * - HAVE_ENOUGH_DATA (numeric value 4)\n * The user agent estimates that enough data is available for\n * playback to proceed uninterrupted.\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-readystate\n * @return {number} the current playback rendering state\n * @method Player#readyState\n */\n'readyState'].forEach(function (fn) {\n Player.prototype[fn] = function () {\n return this.techGet_(fn);\n };\n});\nTECH_EVENTS_RETRIGGER.forEach(function (event) {\n Player.prototype[\"handleTech\" + toTitleCase(event) + \"_\"] = function () {\n return this.trigger(event);\n };\n});\n/**\n * Fired when the player has initial duration and dimension information\n *\n * @event Player#loadedmetadata\n * @type {EventTarget~Event}\n */\n\n/**\n * Fired when the player has downloaded data at the current playback position\n *\n * @event Player#loadeddata\n * @type {EventTarget~Event}\n */\n\n/**\n * Fired when the current playback position has changed *\n * During playback this is fired every 15-250 milliseconds, depending on the\n * playback technology in use.\n *\n * @event Player#timeupdate\n * @type {EventTarget~Event}\n */\n\n/**\n * Fired when the volume changes\n *\n * @event Player#volumechange\n * @type {EventTarget~Event}\n */\n\n/**\n * Reports whether or not a player has a plugin available.\n *\n * This does not report whether or not the plugin has ever been initialized\n * on this player. For that, [usingPlugin]{@link Player#usingPlugin}.\n *\n * @method Player#hasPlugin\n * @param {string} name\n * The name of a plugin.\n *\n * @return {boolean}\n * Whether or not this player has the requested plugin available.\n */\n\n/**\n * Reports whether or not a player is using a plugin by name.\n *\n * For basic plugins, this only reports whether the plugin has _ever_ been\n * initialized on this player.\n *\n * @method Player#usingPlugin\n * @param {string} name\n * The name of a plugin.\n *\n * @return {boolean}\n * Whether or not this player is using the requested plugin.\n */\n\nComponent.registerComponent('Player', Player);\n\n/**\n * The base plugin name.\n *\n * @private\n * @constant\n * @type {string}\n */\n\nvar BASE_PLUGIN_NAME = 'plugin';\n/**\n * The key on which a player's active plugins cache is stored.\n *\n * @private\n * @constant\n * @type {string}\n */\n\nvar PLUGIN_CACHE_KEY = 'activePlugins_';\n/**\n * Stores registered plugins in a private space.\n *\n * @private\n * @type {Object}\n */\n\nvar pluginStorage = {};\n/**\n * Reports whether or not a plugin has been registered.\n *\n * @private\n * @param {string} name\n * The name of a plugin.\n *\n * @return {boolean}\n * Whether or not the plugin has been registered.\n */\n\nvar pluginExists = function pluginExists(name) {\n return pluginStorage.hasOwnProperty(name);\n};\n/**\n * Get a single registered plugin by name.\n *\n * @private\n * @param {string} name\n * The name of a plugin.\n *\n * @return {Function|undefined}\n * The plugin (or undefined).\n */\n\n\nvar getPlugin = function getPlugin(name) {\n return pluginExists(name) ? pluginStorage[name] : undefined;\n};\n/**\n * Marks a plugin as \"active\" on a player.\n *\n * Also, ensures that the player has an object for tracking active plugins.\n *\n * @private\n * @param {Player} player\n * A Video.js player instance.\n *\n * @param {string} name\n * The name of a plugin.\n */\n\n\nvar markPluginAsActive = function markPluginAsActive(player, name) {\n player[PLUGIN_CACHE_KEY] = player[PLUGIN_CACHE_KEY] || {};\n player[PLUGIN_CACHE_KEY][name] = true;\n};\n/**\n * Triggers a pair of plugin setup events.\n *\n * @private\n * @param {Player} player\n * A Video.js player instance.\n *\n * @param {Plugin~PluginEventHash} hash\n * A plugin event hash.\n *\n * @param {boolean} [before]\n * If true, prefixes the event name with \"before\". In other words,\n * use this to trigger \"beforepluginsetup\" instead of \"pluginsetup\".\n */\n\n\nvar triggerSetupEvent = function triggerSetupEvent(player, hash, before) {\n var eventName = (before ? 'before' : '') + 'pluginsetup';\n player.trigger(eventName, hash);\n player.trigger(eventName + ':' + hash.name, hash);\n};\n/**\n * Takes a basic plugin function and returns a wrapper function which marks\n * on the player that the plugin has been activated.\n *\n * @private\n * @param {string} name\n * The name of the plugin.\n *\n * @param {Function} plugin\n * The basic plugin.\n *\n * @return {Function}\n * A wrapper function for the given plugin.\n */\n\n\nvar createBasicPlugin = function createBasicPlugin(name, plugin) {\n var basicPluginWrapper = function basicPluginWrapper() {\n // We trigger the \"beforepluginsetup\" and \"pluginsetup\" events on the player\n // regardless, but we want the hash to be consistent with the hash provided\n // for advanced plugins.\n //\n // The only potentially counter-intuitive thing here is the `instance` in\n // the \"pluginsetup\" event is the value returned by the `plugin` function.\n triggerSetupEvent(this, {\n name: name,\n plugin: plugin,\n instance: null\n }, true);\n var instance = plugin.apply(this, arguments);\n markPluginAsActive(this, name);\n triggerSetupEvent(this, {\n name: name,\n plugin: plugin,\n instance: instance\n });\n return instance;\n };\n\n Object.keys(plugin).forEach(function (prop) {\n basicPluginWrapper[prop] = plugin[prop];\n });\n return basicPluginWrapper;\n};\n/**\n * Takes a plugin sub-class and returns a factory function for generating\n * instances of it.\n *\n * This factory function will replace itself with an instance of the requested\n * sub-class of Plugin.\n *\n * @private\n * @param {string} name\n * The name of the plugin.\n *\n * @param {Plugin} PluginSubClass\n * The advanced plugin.\n *\n * @return {Function}\n */\n\n\nvar createPluginFactory = function createPluginFactory(name, PluginSubClass) {\n // Add a `name` property to the plugin prototype so that each plugin can\n // refer to itself by name.\n PluginSubClass.prototype.name = name;\n return function () {\n triggerSetupEvent(this, {\n name: name,\n plugin: PluginSubClass,\n instance: null\n }, true);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var instance = _construct(PluginSubClass, [this].concat(args)); // The plugin is replaced by a function that returns the current instance.\n\n\n this[name] = function () {\n return instance;\n };\n\n triggerSetupEvent(this, instance.getEventHash());\n return instance;\n };\n};\n/**\n * Parent class for all advanced plugins.\n *\n * @mixes module:evented~EventedMixin\n * @mixes module:stateful~StatefulMixin\n * @fires Player#beforepluginsetup\n * @fires Player#beforepluginsetup:$name\n * @fires Player#pluginsetup\n * @fires Player#pluginsetup:$name\n * @listens Player#dispose\n * @throws {Error}\n * If attempting to instantiate the base {@link Plugin} class\n * directly instead of via a sub-class.\n */\n\n\nvar Plugin =\n/*#__PURE__*/\nfunction () {\n /**\n * Creates an instance of this class.\n *\n * Sub-classes should call `super` to ensure plugins are properly initialized.\n *\n * @param {Player} player\n * A Video.js player instance.\n */\n function Plugin(player) {\n if (this.constructor === Plugin) {\n throw new Error('Plugin must be sub-classed; not directly instantiated.');\n }\n\n this.player = player; // Make this object evented, but remove the added `trigger` method so we\n // use the prototype version instead.\n\n evented(this);\n delete this.trigger;\n stateful(this, this.constructor.defaultState);\n markPluginAsActive(player, this.name); // Auto-bind the dispose method so we can use it as a listener and unbind\n // it later easily.\n\n this.dispose = bind(this, this.dispose); // If the player is disposed, dispose the plugin.\n\n player.on('dispose', this.dispose);\n }\n /**\n * Get the version of the plugin that was set on <pluginName>.VERSION\n */\n\n\n var _proto = Plugin.prototype;\n\n _proto.version = function version() {\n return this.constructor.VERSION;\n };\n /**\n * Each event triggered by plugins includes a hash of additional data with\n * conventional properties.\n *\n * This returns that object or mutates an existing hash.\n *\n * @param {Object} [hash={}]\n * An object to be used as event an event hash.\n *\n * @return {Plugin~PluginEventHash}\n * An event hash object with provided properties mixed-in.\n */\n\n\n _proto.getEventHash = function getEventHash(hash) {\n if (hash === void 0) {\n hash = {};\n }\n\n hash.name = this.name;\n hash.plugin = this.constructor;\n hash.instance = this;\n return hash;\n };\n /**\n * Triggers an event on the plugin object and overrides\n * {@link module:evented~EventedMixin.trigger|EventedMixin.trigger}.\n *\n * @param {string|Object} event\n * An event type or an object with a type property.\n *\n * @param {Object} [hash={}]\n * Additional data hash to merge with a\n * {@link Plugin~PluginEventHash|PluginEventHash}.\n *\n * @return {boolean}\n * Whether or not default was prevented.\n */\n\n\n _proto.trigger = function trigger$$1(event, hash) {\n if (hash === void 0) {\n hash = {};\n }\n\n return trigger(this.eventBusEl_, event, this.getEventHash(hash));\n };\n /**\n * Handles \"statechanged\" events on the plugin. No-op by default, override by\n * subclassing.\n *\n * @abstract\n * @param {Event} e\n * An event object provided by a \"statechanged\" event.\n *\n * @param {Object} e.changes\n * An object describing changes that occurred with the \"statechanged\"\n * event.\n */\n\n\n _proto.handleStateChanged = function handleStateChanged(e) {};\n /**\n * Disposes a plugin.\n *\n * Subclasses can override this if they want, but for the sake of safety,\n * it's probably best to subscribe the \"dispose\" event.\n *\n * @fires Plugin#dispose\n */\n\n\n _proto.dispose = function dispose() {\n var name = this.name,\n player = this.player;\n /**\n * Signals that a advanced plugin is about to be disposed.\n *\n * @event Plugin#dispose\n * @type {EventTarget~Event}\n */\n\n this.trigger('dispose');\n this.off();\n player.off('dispose', this.dispose); // Eliminate any possible sources of leaking memory by clearing up\n // references between the player and the plugin instance and nulling out\n // the plugin's state and replacing methods with a function that throws.\n\n player[PLUGIN_CACHE_KEY][name] = false;\n this.player = this.state = null; // Finally, replace the plugin name on the player with a new factory\n // function, so that the plugin is ready to be set up again.\n\n player[name] = createPluginFactory(name, pluginStorage[name]);\n };\n /**\n * Determines if a plugin is a basic plugin (i.e. not a sub-class of `Plugin`).\n *\n * @param {string|Function} plugin\n * If a string, matches the name of a plugin. If a function, will be\n * tested directly.\n *\n * @return {boolean}\n * Whether or not a plugin is a basic plugin.\n */\n\n\n Plugin.isBasic = function isBasic(plugin) {\n var p = typeof plugin === 'string' ? getPlugin(plugin) : plugin;\n return typeof p === 'function' && !Plugin.prototype.isPrototypeOf(p.prototype);\n };\n /**\n * Register a Video.js plugin.\n *\n * @param {string} name\n * The name of the plugin to be registered. Must be a string and\n * must not match an existing plugin or a method on the `Player`\n * prototype.\n *\n * @param {Function} plugin\n * A sub-class of `Plugin` or a function for basic plugins.\n *\n * @return {Function}\n * For advanced plugins, a factory function for that plugin. For\n * basic plugins, a wrapper function that initializes the plugin.\n */\n\n\n Plugin.registerPlugin = function registerPlugin(name, plugin) {\n if (typeof name !== 'string') {\n throw new Error(\"Illegal plugin name, \\\"\" + name + \"\\\", must be a string, was \" + typeof name + \".\");\n }\n\n if (pluginExists(name)) {\n log.warn(\"A plugin named \\\"\" + name + \"\\\" already exists. You may want to avoid re-registering plugins!\");\n } else if (Player.prototype.hasOwnProperty(name)) {\n throw new Error(\"Illegal plugin name, \\\"\" + name + \"\\\", cannot share a name with an existing player method!\");\n }\n\n if (typeof plugin !== 'function') {\n throw new Error(\"Illegal plugin for \\\"\" + name + \"\\\", must be a function, was \" + typeof plugin + \".\");\n }\n\n pluginStorage[name] = plugin; // Add a player prototype method for all sub-classed plugins (but not for\n // the base Plugin class).\n\n if (name !== BASE_PLUGIN_NAME) {\n if (Plugin.isBasic(plugin)) {\n Player.prototype[name] = createBasicPlugin(name, plugin);\n } else {\n Player.prototype[name] = createPluginFactory(name, plugin);\n }\n }\n\n return plugin;\n };\n /**\n * De-register a Video.js plugin.\n *\n * @param {string} name\n * The name of the plugin to be de-registered. Must be a string that\n * matches an existing plugin.\n *\n * @throws {Error}\n * If an attempt is made to de-register the base plugin.\n */\n\n\n Plugin.deregisterPlugin = function deregisterPlugin(name) {\n if (name === BASE_PLUGIN_NAME) {\n throw new Error('Cannot de-register base plugin.');\n }\n\n if (pluginExists(name)) {\n delete pluginStorage[name];\n delete Player.prototype[name];\n }\n };\n /**\n * Gets an object containing multiple Video.js plugins.\n *\n * @param {Array} [names]\n * If provided, should be an array of plugin names. Defaults to _all_\n * plugin names.\n *\n * @return {Object|undefined}\n * An object containing plugin(s) associated with their name(s) or\n * `undefined` if no matching plugins exist).\n */\n\n\n Plugin.getPlugins = function getPlugins(names) {\n if (names === void 0) {\n names = Object.keys(pluginStorage);\n }\n\n var result;\n names.forEach(function (name) {\n var plugin = getPlugin(name);\n\n if (plugin) {\n result = result || {};\n result[name] = plugin;\n }\n });\n return result;\n };\n /**\n * Gets a plugin's version, if available\n *\n * @param {string} name\n * The name of a plugin.\n *\n * @return {string}\n * The plugin's version or an empty string.\n */\n\n\n Plugin.getPluginVersion = function getPluginVersion(name) {\n var plugin = getPlugin(name);\n return plugin && plugin.VERSION || '';\n };\n\n return Plugin;\n}();\n/**\n * Gets a plugin by name if it exists.\n *\n * @static\n * @method getPlugin\n * @memberOf Plugin\n * @param {string} name\n * The name of a plugin.\n *\n * @returns {Function|undefined}\n * The plugin (or `undefined`).\n */\n\n\nPlugin.getPlugin = getPlugin;\n/**\n * The name of the base plugin class as it is registered.\n *\n * @type {string}\n */\n\nPlugin.BASE_PLUGIN_NAME = BASE_PLUGIN_NAME;\nPlugin.registerPlugin(BASE_PLUGIN_NAME, Plugin);\n/**\n * Documented in player.js\n *\n * @ignore\n */\n\nPlayer.prototype.usingPlugin = function (name) {\n return !!this[PLUGIN_CACHE_KEY] && this[PLUGIN_CACHE_KEY][name] === true;\n};\n/**\n * Documented in player.js\n *\n * @ignore\n */\n\n\nPlayer.prototype.hasPlugin = function (name) {\n return !!pluginExists(name);\n};\n/**\n * Signals that a plugin is about to be set up on a player.\n *\n * @event Player#beforepluginsetup\n * @type {Plugin~PluginEventHash}\n */\n\n/**\n * Signals that a plugin is about to be set up on a player - by name. The name\n * is the name of the plugin.\n *\n * @event Player#beforepluginsetup:$name\n * @type {Plugin~PluginEventHash}\n */\n\n/**\n * Signals that a plugin has just been set up on a player.\n *\n * @event Player#pluginsetup\n * @type {Plugin~PluginEventHash}\n */\n\n/**\n * Signals that a plugin has just been set up on a player - by name. The name\n * is the name of the plugin.\n *\n * @event Player#pluginsetup:$name\n * @type {Plugin~PluginEventHash}\n */\n\n/**\n * @typedef {Object} Plugin~PluginEventHash\n *\n * @property {string} instance\n * For basic plugins, the return value of the plugin function. For\n * advanced plugins, the plugin instance on which the event is fired.\n *\n * @property {string} name\n * The name of the plugin.\n *\n * @property {string} plugin\n * For basic plugins, the plugin function. For advanced plugins, the\n * plugin class/constructor.\n */\n\n/**\n * @file extend.js\n * @module extend\n */\n\n/**\n * A combination of node inherits and babel's inherits (after transpile).\n * Both work the same but node adds `super_` to the subClass\n * and Bable adds the superClass as __proto__. Both seem useful.\n *\n * @param {Object} subClass\n * The class to inherit to\n *\n * @param {Object} superClass\n * The class to inherit from\n *\n * @private\n */\nvar _inherits$1 = function _inherits(subClass, superClass) {\n if (typeof superClass !== 'function' && superClass !== null) {\n throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n\n if (superClass) {\n // node\n subClass.super_ = superClass;\n }\n};\n/**\n * Used to subclass an existing class by emulating ES subclassing using the\n * `extends` keyword.\n *\n * @function\n * @example\n * var MyComponent = videojs.extend(videojs.getComponent('Component'), {\n * myCustomMethod: function() {\n * // Do things in my method.\n * }\n * });\n *\n * @param {Function} superClass\n * The class to inherit from\n *\n * @param {Object} [subClassMethods={}]\n * Methods of the new class\n *\n * @return {Function}\n * The new class with subClassMethods that inherited superClass.\n */\n\n\nvar extend = function extend(superClass, subClassMethods) {\n if (subClassMethods === void 0) {\n subClassMethods = {};\n }\n\n var subClass = function subClass() {\n superClass.apply(this, arguments);\n };\n\n var methods = {};\n\n if (typeof subClassMethods === 'object') {\n if (subClassMethods.constructor !== Object.prototype.constructor) {\n subClass = subClassMethods.constructor;\n }\n\n methods = subClassMethods;\n } else if (typeof subClassMethods === 'function') {\n subClass = subClassMethods;\n }\n\n _inherits$1(subClass, superClass); // Extend subObj's prototype with functions and other properties from props\n\n\n for (var name in methods) {\n if (methods.hasOwnProperty(name)) {\n subClass.prototype[name] = methods[name];\n }\n }\n\n return subClass;\n};\n\n/**\n * @file video.js\n * @module videojs\n */\n/**\n * Normalize an `id` value by trimming off a leading `#`\n *\n * @private\n * @param {string} id\n * A string, maybe with a leading `#`.\n *\n * @return {string}\n * The string, without any leading `#`.\n */\n\nvar normalizeId = function normalizeId(id) {\n return id.indexOf('#') === 0 ? id.slice(1) : id;\n};\n/**\n * The `videojs()` function doubles as the main function for users to create a\n * {@link Player} instance as well as the main library namespace.\n *\n * It can also be used as a getter for a pre-existing {@link Player} instance.\n * However, we _strongly_ recommend using `videojs.getPlayer()` for this\n * purpose because it avoids any potential for unintended initialization.\n *\n * Due to [limitations](https://github.com/jsdoc3/jsdoc/issues/955#issuecomment-313829149)\n * of our JSDoc template, we cannot properly document this as both a function\n * and a namespace, so its function signature is documented here.\n *\n * #### Arguments\n * ##### id\n * string|Element, **required**\n *\n * Video element or video element ID.\n *\n * ##### options\n * Object, optional\n *\n * Options object for providing settings.\n * See: [Options Guide](https://docs.videojs.com/tutorial-options.html).\n *\n * ##### ready\n * {@link Component~ReadyCallback}, optional\n *\n * A function to be called when the {@link Player} and {@link Tech} are ready.\n *\n * #### Return Value\n *\n * The `videojs()` function returns a {@link Player} instance.\n *\n * @namespace\n *\n * @borrows AudioTrack as AudioTrack\n * @borrows Component.getComponent as getComponent\n * @borrows module:computed-style~computedStyle as computedStyle\n * @borrows module:events.on as on\n * @borrows module:events.one as one\n * @borrows module:events.off as off\n * @borrows module:events.trigger as trigger\n * @borrows EventTarget as EventTarget\n * @borrows module:extend~extend as extend\n * @borrows module:fn.bind as bind\n * @borrows module:format-time.formatTime as formatTime\n * @borrows module:format-time.resetFormatTime as resetFormatTime\n * @borrows module:format-time.setFormatTime as setFormatTime\n * @borrows module:merge-options.mergeOptions as mergeOptions\n * @borrows module:middleware.use as use\n * @borrows Player.players as players\n * @borrows Plugin.registerPlugin as registerPlugin\n * @borrows Plugin.deregisterPlugin as deregisterPlugin\n * @borrows Plugin.getPlugins as getPlugins\n * @borrows Plugin.getPlugin as getPlugin\n * @borrows Plugin.getPluginVersion as getPluginVersion\n * @borrows Tech.getTech as getTech\n * @borrows Tech.registerTech as registerTech\n * @borrows TextTrack as TextTrack\n * @borrows module:time-ranges.createTimeRanges as createTimeRange\n * @borrows module:time-ranges.createTimeRanges as createTimeRanges\n * @borrows module:url.isCrossOrigin as isCrossOrigin\n * @borrows module:url.parseUrl as parseUrl\n * @borrows VideoTrack as VideoTrack\n *\n * @param {string|Element} id\n * Video element or video element ID.\n *\n * @param {Object} [options]\n * Options object for providing settings.\n * See: [Options Guide](https://docs.videojs.com/tutorial-options.html).\n *\n * @param {Component~ReadyCallback} [ready]\n * A function to be called when the {@link Player} and {@link Tech} are\n * ready.\n *\n * @return {Player}\n * The `videojs()` function returns a {@link Player|Player} instance.\n */\n\n\nfunction videojs$1(id, options, ready) {\n var player = videojs$1.getPlayer(id);\n\n if (player) {\n if (options) {\n log.warn(\"Player \\\"\" + id + \"\\\" is already initialised. Options will not be applied.\");\n }\n\n if (ready) {\n player.ready(ready);\n }\n\n return player;\n }\n\n var el = typeof id === 'string' ? $('#' + normalizeId(id)) : id;\n\n if (!isEl(el)) {\n throw new TypeError('The element or ID supplied is not valid. (videojs)');\n }\n\n if (!document.body.contains(el)) {\n log.warn('The element supplied is not included in the DOM');\n }\n\n options = options || {};\n videojs$1.hooks('beforesetup').forEach(function (hookFunction) {\n var opts = hookFunction(el, mergeOptions(options));\n\n if (!isObject(opts) || Array.isArray(opts)) {\n log.error('please return an object in beforesetup hooks');\n return;\n }\n\n options = mergeOptions(options, opts);\n }); // We get the current \"Player\" component here in case an integration has\n // replaced it with a custom player.\n\n var PlayerComponent = Component.getComponent('Player');\n player = new PlayerComponent(el, options, ready);\n videojs$1.hooks('setup').forEach(function (hookFunction) {\n return hookFunction(player);\n });\n return player;\n}\n/**\n * An Object that contains lifecycle hooks as keys which point to an array\n * of functions that are run when a lifecycle is triggered\n *\n * @private\n */\n\n\nvideojs$1.hooks_ = {};\n/**\n * Get a list of hooks for a specific lifecycle\n *\n * @param {string} type\n * the lifecyle to get hooks from\n *\n * @param {Function|Function[]} [fn]\n * Optionally add a hook (or hooks) to the lifecycle that your are getting.\n *\n * @return {Array}\n * an array of hooks, or an empty array if there are none.\n */\n\nvideojs$1.hooks = function (type, fn) {\n videojs$1.hooks_[type] = videojs$1.hooks_[type] || [];\n\n if (fn) {\n videojs$1.hooks_[type] = videojs$1.hooks_[type].concat(fn);\n }\n\n return videojs$1.hooks_[type];\n};\n/**\n * Add a function hook to a specific videojs lifecycle.\n *\n * @param {string} type\n * the lifecycle to hook the function to.\n *\n * @param {Function|Function[]}\n * The function or array of functions to attach.\n */\n\n\nvideojs$1.hook = function (type, fn) {\n videojs$1.hooks(type, fn);\n};\n/**\n * Add a function hook that will only run once to a specific videojs lifecycle.\n *\n * @param {string} type\n * the lifecycle to hook the function to.\n *\n * @param {Function|Function[]}\n * The function or array of functions to attach.\n */\n\n\nvideojs$1.hookOnce = function (type, fn) {\n videojs$1.hooks(type, [].concat(fn).map(function (original) {\n var wrapper = function wrapper() {\n videojs$1.removeHook(type, wrapper);\n return original.apply(void 0, arguments);\n };\n\n return wrapper;\n }));\n};\n/**\n * Remove a hook from a specific videojs lifecycle.\n *\n * @param {string} type\n * the lifecycle that the function hooked to\n *\n * @param {Function} fn\n * The hooked function to remove\n *\n * @return {boolean}\n * The function that was removed or undef\n */\n\n\nvideojs$1.removeHook = function (type, fn) {\n var index = videojs$1.hooks(type).indexOf(fn);\n\n if (index <= -1) {\n return false;\n }\n\n videojs$1.hooks_[type] = videojs$1.hooks_[type].slice();\n videojs$1.hooks_[type].splice(index, 1);\n return true;\n}; // Add default styles\n\n\nif (window$1.VIDEOJS_NO_DYNAMIC_STYLE !== true && isReal()) {\n var style$1 = $('.vjs-styles-defaults');\n\n if (!style$1) {\n style$1 = createStyleElement('vjs-styles-defaults');\n var head = $('head');\n\n if (head) {\n head.insertBefore(style$1, head.firstChild);\n }\n\n setTextContent(style$1, \"\\n .video-js {\\n width: 300px;\\n height: 150px;\\n }\\n\\n .vjs-fluid {\\n padding-top: 56.25%\\n }\\n \");\n }\n} // Run Auto-load players\n// You have to wait at least once in case this script is loaded after your\n// video in the DOM (weird behavior only with minified version)\n\n\nautoSetupTimeout(1, videojs$1);\n/**\n * Current Video.js version. Follows [semantic versioning](https://semver.org/).\n *\n * @type {string}\n */\n\nvideojs$1.VERSION = version;\n/**\n * The global options object. These are the settings that take effect\n * if no overrides are specified when the player is created.\n *\n * @type {Object}\n */\n\nvideojs$1.options = Player.prototype.options_;\n/**\n * Get an object with the currently created players, keyed by player ID\n *\n * @return {Object}\n * The created players\n */\n\nvideojs$1.getPlayers = function () {\n return Player.players;\n};\n/**\n * Get a single player based on an ID or DOM element.\n *\n * This is useful if you want to check if an element or ID has an associated\n * Video.js player, but not create one if it doesn't.\n *\n * @param {string|Element} id\n * An HTML element - `<video>`, `<audio>`, or `<video-js>` -\n * or a string matching the `id` of such an element.\n *\n * @return {Player|undefined}\n * A player instance or `undefined` if there is no player instance\n * matching the argument.\n */\n\n\nvideojs$1.getPlayer = function (id) {\n var players = Player.players;\n var tag;\n\n if (typeof id === 'string') {\n var nId = normalizeId(id);\n var player = players[nId];\n\n if (player) {\n return player;\n }\n\n tag = $('#' + nId);\n } else {\n tag = id;\n }\n\n if (isEl(tag)) {\n var _tag = tag,\n _player = _tag.player,\n playerId = _tag.playerId; // Element may have a `player` property referring to an already created\n // player instance. If so, return that.\n\n if (_player || players[playerId]) {\n return _player || players[playerId];\n }\n }\n};\n/**\n * Returns an array of all current players.\n *\n * @return {Array}\n * An array of all players. The array will be in the order that\n * `Object.keys` provides, which could potentially vary between\n * JavaScript engines.\n *\n */\n\n\nvideojs$1.getAllPlayers = function () {\n return (// Disposed players leave a key with a `null` value, so we need to make sure\n // we filter those out.\n Object.keys(Player.players).map(function (k) {\n return Player.players[k];\n }).filter(Boolean)\n );\n};\n\nvideojs$1.players = Player.players;\nvideojs$1.getComponent = Component.getComponent;\n/**\n * Register a component so it can referred to by name. Used when adding to other\n * components, either through addChild `component.addChild('myComponent')` or through\n * default children options `{ children: ['myComponent'] }`.\n *\n * > NOTE: You could also just initialize the component before adding.\n * `component.addChild(new MyComponent());`\n *\n * @param {string} name\n * The class name of the component\n *\n * @param {Component} comp\n * The component class\n *\n * @return {Component}\n * The newly registered component\n */\n\nvideojs$1.registerComponent = function (name$$1, comp) {\n if (Tech.isTech(comp)) {\n log.warn(\"The \" + name$$1 + \" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)\");\n }\n\n Component.registerComponent.call(Component, name$$1, comp);\n};\n\nvideojs$1.getTech = Tech.getTech;\nvideojs$1.registerTech = Tech.registerTech;\nvideojs$1.use = use;\n/**\n * An object that can be returned by a middleware to signify\n * that the middleware is being terminated.\n *\n * @type {object}\n * @property {object} middleware.TERMINATOR\n */\n\nObject.defineProperty(videojs$1, 'middleware', {\n value: {},\n writeable: false,\n enumerable: true\n});\nObject.defineProperty(videojs$1.middleware, 'TERMINATOR', {\n value: TERMINATOR,\n writeable: false,\n enumerable: true\n});\n/**\n * A reference to the {@link module:browser|browser utility module} as an object.\n *\n * @type {Object}\n * @see {@link module:browser|browser}\n */\n\nvideojs$1.browser = browser;\n/**\n * Use {@link module:browser.TOUCH_ENABLED|browser.TOUCH_ENABLED} instead; only\n * included for backward-compatibility with 4.x.\n *\n * @deprecated Since version 5.0, use {@link module:browser.TOUCH_ENABLED|browser.TOUCH_ENABLED instead.\n * @type {boolean}\n */\n\nvideojs$1.TOUCH_ENABLED = TOUCH_ENABLED;\nvideojs$1.extend = extend;\nvideojs$1.mergeOptions = mergeOptions;\nvideojs$1.bind = bind;\nvideojs$1.registerPlugin = Plugin.registerPlugin;\nvideojs$1.deregisterPlugin = Plugin.deregisterPlugin;\n/**\n * Deprecated method to register a plugin with Video.js\n *\n * @deprecated videojs.plugin() is deprecated; use videojs.registerPlugin() instead\n *\n * @param {string} name\n * The plugin name\n *\n * @param {Plugin|Function} plugin\n * The plugin sub-class or function\n */\n\nvideojs$1.plugin = function (name$$1, plugin) {\n log.warn('videojs.plugin() is deprecated; use videojs.registerPlugin() instead');\n return Plugin.registerPlugin(name$$1, plugin);\n};\n\nvideojs$1.getPlugins = Plugin.getPlugins;\nvideojs$1.getPlugin = Plugin.getPlugin;\nvideojs$1.getPluginVersion = Plugin.getPluginVersion;\n/**\n * Adding languages so that they're available to all players.\n * Example: `videojs.addLanguage('es', { 'Hello': 'Hola' });`\n *\n * @param {string} code\n * The language code or dictionary property\n *\n * @param {Object} data\n * The data values to be translated\n *\n * @return {Object}\n * The resulting language dictionary object\n */\n\nvideojs$1.addLanguage = function (code, data) {\n var _mergeOptions;\n\n code = ('' + code).toLowerCase();\n videojs$1.options.languages = mergeOptions(videojs$1.options.languages, (_mergeOptions = {}, _mergeOptions[code] = data, _mergeOptions));\n return videojs$1.options.languages[code];\n};\n/**\n * A reference to the {@link module:log|log utility module} as an object.\n *\n * @type {Function}\n * @see {@link module:log|log}\n */\n\n\nvideojs$1.log = log;\nvideojs$1.createLogger = createLogger$1;\nvideojs$1.createTimeRange = videojs$1.createTimeRanges = createTimeRanges;\nvideojs$1.formatTime = formatTime;\nvideojs$1.setFormatTime = setFormatTime;\nvideojs$1.resetFormatTime = resetFormatTime;\nvideojs$1.parseUrl = parseUrl;\nvideojs$1.isCrossOrigin = isCrossOrigin;\nvideojs$1.EventTarget = EventTarget;\nvideojs$1.on = on;\nvideojs$1.one = one;\nvideojs$1.off = off;\nvideojs$1.trigger = trigger;\n/**\n * A cross-browser XMLHttpRequest wrapper.\n *\n * @function\n * @param {Object} options\n * Settings for the request.\n *\n * @return {XMLHttpRequest|XDomainRequest}\n * The request object.\n *\n * @see https://github.com/Raynos/xhr\n */\n\nvideojs$1.xhr = xhr;\nvideojs$1.TextTrack = TextTrack;\nvideojs$1.AudioTrack = AudioTrack;\nvideojs$1.VideoTrack = VideoTrack;\n['isEl', 'isTextNode', 'createEl', 'hasClass', 'addClass', 'removeClass', 'toggleClass', 'setAttributes', 'getAttributes', 'emptyEl', 'appendContent', 'insertContent'].forEach(function (k) {\n videojs$1[k] = function () {\n log.warn(\"videojs.\" + k + \"() is deprecated; use videojs.dom.\" + k + \"() instead\");\n return Dom[k].apply(null, arguments);\n };\n});\nvideojs$1.computedStyle = computedStyle;\n/**\n * A reference to the {@link module:dom|DOM utility module} as an object.\n *\n * @type {Object}\n * @see {@link module:dom|dom}\n */\n\nvideojs$1.dom = Dom;\n/**\n * A reference to the {@link module:url|URL utility module} as an object.\n *\n * @type {Object}\n * @see {@link module:url|url}\n */\n\nvideojs$1.url = Url;\n\n/**\n * @videojs/http-streaming\n * @version 1.5.1\n * @copyright 2018 Brightcove, Inc\n * @license Apache-2.0\n */\n/**\n * @file resolve-url.js\n */\n\nvar resolveUrl = function resolveUrl(baseURL, relativeURL) {\n // return early if we don't need to resolve\n if (/^[a-z]+:/i.test(relativeURL)) {\n return relativeURL;\n } // if the base URL is relative then combine with the current location\n\n\n if (!/\\/\\//i.test(baseURL)) {\n baseURL = URLToolkit.buildAbsoluteURL(window$1.location.href, baseURL);\n }\n\n return URLToolkit.buildAbsoluteURL(baseURL, relativeURL);\n};\n\nvar classCallCheck = function classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};\n\nvar createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\nvar get$1 = function get(object, property, receiver) {\n if (object === null) object = Function.prototype;\n var desc = Object.getOwnPropertyDescriptor(object, property);\n\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n\n if (parent === null) {\n return undefined;\n } else {\n return get(parent, property, receiver);\n }\n } else if (\"value\" in desc) {\n return desc.value;\n } else {\n var getter = desc.get;\n\n if (getter === undefined) {\n return undefined;\n }\n\n return getter.call(receiver);\n }\n};\n\nvar inherits = function inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n};\n\nvar possibleConstructorReturn = function possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n};\n\nvar slicedToArray = function () {\n function sliceIterator(arr, i) {\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"]) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n }\n\n return function (arr, i) {\n if (Array.isArray(arr)) {\n return arr;\n } else if (Symbol.iterator in Object(arr)) {\n return sliceIterator(arr, i);\n } else {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n }\n };\n}();\n/**\n * @file playlist-loader.js\n *\n * A state machine that manages the loading, caching, and updating of\n * M3U8 playlists.\n *\n */\n\n\nvar mergeOptions$1 = videojs$1.mergeOptions,\n EventTarget$1 = videojs$1.EventTarget,\n log$1 = videojs$1.log;\n/**\n * Loops through all supported media groups in master and calls the provided\n * callback for each group\n *\n * @param {Object} master\n * The parsed master manifest object\n * @param {Function} callback\n * Callback to call for each media group\n */\n\nvar forEachMediaGroup = function forEachMediaGroup(master, callback) {\n ['AUDIO', 'SUBTITLES'].forEach(function (mediaType) {\n for (var groupKey in master.mediaGroups[mediaType]) {\n for (var labelKey in master.mediaGroups[mediaType][groupKey]) {\n var mediaProperties = master.mediaGroups[mediaType][groupKey][labelKey];\n callback(mediaProperties, mediaType, groupKey, labelKey);\n }\n }\n });\n};\n/**\n * Returns a new array of segments that is the result of merging\n * properties from an older list of segments onto an updated\n * list. No properties on the updated playlist will be overridden.\n *\n * @param {Array} original the outdated list of segments\n * @param {Array} update the updated list of segments\n * @param {Number=} offset the index of the first update\n * segment in the original segment list. For non-live playlists,\n * this should always be zero and does not need to be\n * specified. For live playlists, it should be the difference\n * between the media sequence numbers in the original and updated\n * playlists.\n * @return a list of merged segment objects\n */\n\n\nvar updateSegments = function updateSegments(original, update, offset) {\n var result = update.slice();\n offset = offset || 0;\n var length = Math.min(original.length, update.length + offset);\n\n for (var i = offset; i < length; i++) {\n result[i - offset] = mergeOptions$1(original[i], result[i - offset]);\n }\n\n return result;\n};\n\nvar resolveSegmentUris = function resolveSegmentUris(segment, baseUri) {\n if (!segment.resolvedUri) {\n segment.resolvedUri = resolveUrl(baseUri, segment.uri);\n }\n\n if (segment.key && !segment.key.resolvedUri) {\n segment.key.resolvedUri = resolveUrl(baseUri, segment.key.uri);\n }\n\n if (segment.map && !segment.map.resolvedUri) {\n segment.map.resolvedUri = resolveUrl(baseUri, segment.map.uri);\n }\n};\n/**\n * Returns a new master playlist that is the result of merging an\n * updated media playlist into the original version. If the\n * updated media playlist does not match any of the playlist\n * entries in the original master playlist, null is returned.\n *\n * @param {Object} master a parsed master M3U8 object\n * @param {Object} media a parsed media M3U8 object\n * @return {Object} a new object that represents the original\n * master playlist with the updated media playlist merged in, or\n * null if the merge produced no change.\n */\n\n\nvar updateMaster = function updateMaster(master, media) {\n var result = mergeOptions$1(master, {});\n var playlist = result.playlists[media.uri];\n\n if (!playlist) {\n return null;\n } // consider the playlist unchanged if the number of segments is equal and the media\n // sequence number is unchanged\n\n\n if (playlist.segments && media.segments && playlist.segments.length === media.segments.length && playlist.mediaSequence === media.mediaSequence) {\n return null;\n }\n\n var mergedPlaylist = mergeOptions$1(playlist, media); // if the update could overlap existing segment information, merge the two segment lists\n\n if (playlist.segments) {\n mergedPlaylist.segments = updateSegments(playlist.segments, media.segments, media.mediaSequence - playlist.mediaSequence);\n } // resolve any segment URIs to prevent us from having to do it later\n\n\n mergedPlaylist.segments.forEach(function (segment) {\n resolveSegmentUris(segment, mergedPlaylist.resolvedUri);\n }); // TODO Right now in the playlists array there are two references to each playlist, one\n // that is referenced by index, and one by URI. The index reference may no longer be\n // necessary.\n\n for (var i = 0; i < result.playlists.length; i++) {\n if (result.playlists[i].uri === media.uri) {\n result.playlists[i] = mergedPlaylist;\n }\n }\n\n result.playlists[media.uri] = mergedPlaylist;\n return result;\n};\n\nvar setupMediaPlaylists = function setupMediaPlaylists(master) {\n // setup by-URI lookups and resolve media playlist URIs\n var i = master.playlists.length;\n\n while (i--) {\n var playlist = master.playlists[i];\n master.playlists[playlist.uri] = playlist;\n playlist.resolvedUri = resolveUrl(master.uri, playlist.uri);\n playlist.id = i;\n\n if (!playlist.attributes) {\n // Although the spec states an #EXT-X-STREAM-INF tag MUST have a\n // BANDWIDTH attribute, we can play the stream without it. This means a poorly\n // formatted master playlist may not have an attribute list. An attributes\n // property is added here to prevent undefined references when we encounter\n // this scenario.\n playlist.attributes = {};\n log$1.warn('Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.');\n }\n }\n};\n\nvar resolveMediaGroupUris = function resolveMediaGroupUris(master) {\n forEachMediaGroup(master, function (properties) {\n if (properties.uri) {\n properties.resolvedUri = resolveUrl(master.uri, properties.uri);\n }\n });\n};\n/**\n * Calculates the time to wait before refreshing a live playlist\n *\n * @param {Object} media\n * The current media\n * @param {Boolean} update\n * True if there were any updates from the last refresh, false otherwise\n * @return {Number}\n * The time in ms to wait before refreshing the live playlist\n */\n\n\nvar refreshDelay = function refreshDelay(media, update) {\n var lastSegment = media.segments[media.segments.length - 1];\n var delay = void 0;\n\n if (update && lastSegment && lastSegment.duration) {\n delay = lastSegment.duration * 1000;\n } else {\n // if the playlist is unchanged since the last reload or last segment duration\n // cannot be determined, try again after half the target duration\n delay = (media.targetDuration || 10) * 500;\n }\n\n return delay;\n};\n/**\n * Load a playlist from a remote location\n *\n * @class PlaylistLoader\n * @extends Stream\n * @param {String} srcUrl the url to start with\n * @param {Boolean} withCredentials the withCredentials xhr option\n * @constructor\n */\n\n\nvar PlaylistLoader = function (_EventTarget) {\n inherits(PlaylistLoader, _EventTarget);\n\n function PlaylistLoader(srcUrl, hls, withCredentials) {\n classCallCheck(this, PlaylistLoader);\n\n var _this = possibleConstructorReturn(this, (PlaylistLoader.__proto__ || Object.getPrototypeOf(PlaylistLoader)).call(this));\n\n _this.srcUrl = srcUrl;\n _this.hls_ = hls;\n _this.withCredentials = withCredentials;\n\n if (!_this.srcUrl) {\n throw new Error('A non-empty playlist URL is required');\n } // initialize the loader state\n\n\n _this.state = 'HAVE_NOTHING'; // live playlist staleness timeout\n\n _this.on('mediaupdatetimeout', function () {\n if (_this.state !== 'HAVE_METADATA') {\n // only refresh the media playlist if no other activity is going on\n return;\n }\n\n _this.state = 'HAVE_CURRENT_METADATA';\n _this.request = _this.hls_.xhr({\n uri: resolveUrl(_this.master.uri, _this.media().uri),\n withCredentials: _this.withCredentials\n }, function (error, req) {\n // disposed\n if (!_this.request) {\n return;\n }\n\n if (error) {\n return _this.playlistRequestError(_this.request, _this.media().uri, 'HAVE_METADATA');\n }\n\n _this.haveMetadata(_this.request, _this.media().uri);\n });\n });\n\n return _this;\n }\n\n createClass(PlaylistLoader, [{\n key: 'playlistRequestError',\n value: function playlistRequestError(xhr$$1, url, startingState) {\n // any in-flight request is now finished\n this.request = null;\n\n if (startingState) {\n this.state = startingState;\n }\n\n this.error = {\n playlist: this.master.playlists[url],\n status: xhr$$1.status,\n message: 'HLS playlist request error at URL: ' + url,\n responseText: xhr$$1.responseText,\n code: xhr$$1.status >= 500 ? 4 : 2\n };\n this.trigger('error');\n } // update the playlist loader's state in response to a new or\n // updated playlist.\n\n }, {\n key: 'haveMetadata',\n value: function haveMetadata(xhr$$1, url) {\n var _this2 = this; // any in-flight request is now finished\n\n\n this.request = null;\n this.state = 'HAVE_METADATA';\n var parser = new Parser();\n parser.push(xhr$$1.responseText);\n parser.end();\n parser.manifest.uri = url; // m3u8-parser does not attach an attributes property to media playlists so make\n // sure that the property is attached to avoid undefined reference errors\n\n parser.manifest.attributes = parser.manifest.attributes || {}; // merge this playlist into the master\n\n var update = updateMaster(this.master, parser.manifest);\n this.targetDuration = parser.manifest.targetDuration;\n\n if (update) {\n this.master = update;\n this.media_ = this.master.playlists[parser.manifest.uri];\n } else {\n this.trigger('playlistunchanged');\n } // refresh live playlists after a target duration passes\n\n\n if (!this.media().endList) {\n window$1.clearTimeout(this.mediaUpdateTimeout);\n this.mediaUpdateTimeout = window$1.setTimeout(function () {\n _this2.trigger('mediaupdatetimeout');\n }, refreshDelay(this.media(), !!update));\n }\n\n this.trigger('loadedplaylist');\n }\n /**\n * Abort any outstanding work and clean up.\n */\n\n }, {\n key: 'dispose',\n value: function dispose() {\n this.stopRequest();\n window$1.clearTimeout(this.mediaUpdateTimeout);\n }\n }, {\n key: 'stopRequest',\n value: function stopRequest() {\n if (this.request) {\n var oldRequest = this.request;\n this.request = null;\n oldRequest.onreadystatechange = null;\n oldRequest.abort();\n }\n }\n /**\n * When called without any arguments, returns the currently\n * active media playlist. When called with a single argument,\n * triggers the playlist loader to asynchronously switch to the\n * specified media playlist. Calling this method while the\n * loader is in the HAVE_NOTHING causes an error to be emitted\n * but otherwise has no effect.\n *\n * @param {Object=} playlist the parsed media playlist\n * object to switch to\n * @return {Playlist} the current loaded media\n */\n\n }, {\n key: 'media',\n value: function media(playlist) {\n var _this3 = this; // getter\n\n\n if (!playlist) {\n return this.media_;\n } // setter\n\n\n if (this.state === 'HAVE_NOTHING') {\n throw new Error('Cannot switch media playlist from ' + this.state);\n }\n\n var startingState = this.state; // find the playlist object if the target playlist has been\n // specified by URI\n\n if (typeof playlist === 'string') {\n if (!this.master.playlists[playlist]) {\n throw new Error('Unknown playlist URI: ' + playlist);\n }\n\n playlist = this.master.playlists[playlist];\n }\n\n var mediaChange = !this.media_ || playlist.uri !== this.media_.uri; // switch to fully loaded playlists immediately\n\n if (this.master.playlists[playlist.uri].endList) {\n // abort outstanding playlist requests\n if (this.request) {\n this.request.onreadystatechange = null;\n this.request.abort();\n this.request = null;\n }\n\n this.state = 'HAVE_METADATA';\n this.media_ = playlist; // trigger media change if the active media has been updated\n\n if (mediaChange) {\n this.trigger('mediachanging');\n this.trigger('mediachange');\n }\n\n return;\n } // switching to the active playlist is a no-op\n\n\n if (!mediaChange) {\n return;\n }\n\n this.state = 'SWITCHING_MEDIA'; // there is already an outstanding playlist request\n\n if (this.request) {\n if (resolveUrl(this.master.uri, playlist.uri) === this.request.url) {\n // requesting to switch to the same playlist multiple times\n // has no effect after the first\n return;\n }\n\n this.request.onreadystatechange = null;\n this.request.abort();\n this.request = null;\n } // request the new playlist\n\n\n if (this.media_) {\n this.trigger('mediachanging');\n }\n\n this.request = this.hls_.xhr({\n uri: resolveUrl(this.master.uri, playlist.uri),\n withCredentials: this.withCredentials\n }, function (error, req) {\n // disposed\n if (!_this3.request) {\n return;\n }\n\n if (error) {\n return _this3.playlistRequestError(_this3.request, playlist.uri, startingState);\n }\n\n _this3.haveMetadata(req, playlist.uri); // fire loadedmetadata the first time a media playlist is loaded\n\n\n if (startingState === 'HAVE_MASTER') {\n _this3.trigger('loadedmetadata');\n } else {\n _this3.trigger('mediachange');\n }\n });\n }\n /**\n * pause loading of the playlist\n */\n\n }, {\n key: 'pause',\n value: function pause() {\n this.stopRequest();\n window$1.clearTimeout(this.mediaUpdateTimeout);\n\n if (this.state === 'HAVE_NOTHING') {\n // If we pause the loader before any data has been retrieved, its as if we never\n // started, so reset to an unstarted state.\n this.started = false;\n } // Need to restore state now that no activity is happening\n\n\n if (this.state === 'SWITCHING_MEDIA') {\n // if the loader was in the process of switching media, it should either return to\n // HAVE_MASTER or HAVE_METADATA depending on if the loader has loaded a media\n // playlist yet. This is determined by the existence of loader.media_\n if (this.media_) {\n this.state = 'HAVE_METADATA';\n } else {\n this.state = 'HAVE_MASTER';\n }\n } else if (this.state === 'HAVE_CURRENT_METADATA') {\n this.state = 'HAVE_METADATA';\n }\n }\n /**\n * start loading of the playlist\n */\n\n }, {\n key: 'load',\n value: function load(isFinalRendition) {\n var _this4 = this;\n\n window$1.clearTimeout(this.mediaUpdateTimeout);\n var media = this.media();\n\n if (isFinalRendition) {\n var delay = media ? media.targetDuration / 2 * 1000 : 5 * 1000;\n this.mediaUpdateTimeout = window$1.setTimeout(function () {\n return _this4.load();\n }, delay);\n return;\n }\n\n if (!this.started) {\n this.start();\n return;\n }\n\n if (media && !media.endList) {\n this.trigger('mediaupdatetimeout');\n } else {\n this.trigger('loadedplaylist');\n }\n }\n /**\n * start loading of the playlist\n */\n\n }, {\n key: 'start',\n value: function start() {\n var _this5 = this;\n\n this.started = true; // request the specified URL\n\n this.request = this.hls_.xhr({\n uri: this.srcUrl,\n withCredentials: this.withCredentials\n }, function (error, req) {\n // disposed\n if (!_this5.request) {\n return;\n } // clear the loader's request reference\n\n\n _this5.request = null;\n\n if (error) {\n _this5.error = {\n status: req.status,\n message: 'HLS playlist request error at URL: ' + _this5.srcUrl,\n responseText: req.responseText,\n // MEDIA_ERR_NETWORK\n code: 2\n };\n\n if (_this5.state === 'HAVE_NOTHING') {\n _this5.started = false;\n }\n\n return _this5.trigger('error');\n }\n\n var parser = new Parser();\n parser.push(req.responseText);\n parser.end();\n _this5.state = 'HAVE_MASTER';\n parser.manifest.uri = _this5.srcUrl; // loaded a master playlist\n\n if (parser.manifest.playlists) {\n _this5.master = parser.manifest;\n setupMediaPlaylists(_this5.master);\n resolveMediaGroupUris(_this5.master);\n\n _this5.trigger('loadedplaylist');\n\n if (!_this5.request) {\n // no media playlist was specifically selected so start\n // from the first listed one\n _this5.media(parser.manifest.playlists[0]);\n }\n\n return;\n } // loaded a media playlist\n // infer a master playlist if none was previously requested\n\n\n _this5.master = {\n mediaGroups: {\n 'AUDIO': {},\n 'VIDEO': {},\n 'CLOSED-CAPTIONS': {},\n 'SUBTITLES': {}\n },\n uri: window$1.location.href,\n playlists: [{\n uri: _this5.srcUrl,\n id: 0\n }]\n };\n _this5.master.playlists[_this5.srcUrl] = _this5.master.playlists[0];\n _this5.master.playlists[0].resolvedUri = _this5.srcUrl; // m3u8-parser does not attach an attributes property to media playlists so make\n // sure that the property is attached to avoid undefined reference errors\n\n _this5.master.playlists[0].attributes = _this5.master.playlists[0].attributes || {};\n\n _this5.haveMetadata(req, _this5.srcUrl);\n\n return _this5.trigger('loadedmetadata');\n });\n }\n }]);\n return PlaylistLoader;\n}(EventTarget$1);\n/**\n * @file playlist.js\n *\n * Playlist related utilities.\n */\n\n\nvar createTimeRange = videojs$1.createTimeRange;\n/**\n * walk backward until we find a duration we can use\n * or return a failure\n *\n * @param {Playlist} playlist the playlist to walk through\n * @param {Number} endSequence the mediaSequence to stop walking on\n */\n\nvar backwardDuration = function backwardDuration(playlist, endSequence) {\n var result = 0;\n var i = endSequence - playlist.mediaSequence; // if a start time is available for segment immediately following\n // the interval, use it\n\n var segment = playlist.segments[i]; // Walk backward until we find the latest segment with timeline\n // information that is earlier than endSequence\n\n if (segment) {\n if (typeof segment.start !== 'undefined') {\n return {\n result: segment.start,\n precise: true\n };\n }\n\n if (typeof segment.end !== 'undefined') {\n return {\n result: segment.end - segment.duration,\n precise: true\n };\n }\n }\n\n while (i--) {\n segment = playlist.segments[i];\n\n if (typeof segment.end !== 'undefined') {\n return {\n result: result + segment.end,\n precise: true\n };\n }\n\n result += segment.duration;\n\n if (typeof segment.start !== 'undefined') {\n return {\n result: result + segment.start,\n precise: true\n };\n }\n }\n\n return {\n result: result,\n precise: false\n };\n};\n/**\n * walk forward until we find a duration we can use\n * or return a failure\n *\n * @param {Playlist} playlist the playlist to walk through\n * @param {Number} endSequence the mediaSequence to stop walking on\n */\n\n\nvar forwardDuration = function forwardDuration(playlist, endSequence) {\n var result = 0;\n var segment = void 0;\n var i = endSequence - playlist.mediaSequence; // Walk forward until we find the earliest segment with timeline\n // information\n\n for (; i < playlist.segments.length; i++) {\n segment = playlist.segments[i];\n\n if (typeof segment.start !== 'undefined') {\n return {\n result: segment.start - result,\n precise: true\n };\n }\n\n result += segment.duration;\n\n if (typeof segment.end !== 'undefined') {\n return {\n result: segment.end - result,\n precise: true\n };\n }\n } // indicate we didn't find a useful duration estimate\n\n\n return {\n result: -1,\n precise: false\n };\n};\n/**\n * Calculate the media duration from the segments associated with a\n * playlist. The duration of a subinterval of the available segments\n * may be calculated by specifying an end index.\n *\n * @param {Object} playlist a media playlist object\n * @param {Number=} endSequence an exclusive upper boundary\n * for the playlist. Defaults to playlist length.\n * @param {Number} expired the amount of time that has dropped\n * off the front of the playlist in a live scenario\n * @return {Number} the duration between the first available segment\n * and end index.\n */\n\n\nvar intervalDuration = function intervalDuration(playlist, endSequence, expired) {\n var backward = void 0;\n var forward = void 0;\n\n if (typeof endSequence === 'undefined') {\n endSequence = playlist.mediaSequence + playlist.segments.length;\n }\n\n if (endSequence < playlist.mediaSequence) {\n return 0;\n } // do a backward walk to estimate the duration\n\n\n backward = backwardDuration(playlist, endSequence);\n\n if (backward.precise) {\n // if we were able to base our duration estimate on timing\n // information provided directly from the Media Source, return\n // it\n return backward.result;\n } // walk forward to see if a precise duration estimate can be made\n // that way\n\n\n forward = forwardDuration(playlist, endSequence);\n\n if (forward.precise) {\n // we found a segment that has been buffered and so it's\n // position is known precisely\n return forward.result;\n } // return the less-precise, playlist-based duration estimate\n\n\n return backward.result + expired;\n};\n/**\n * Calculates the duration of a playlist. If a start and end index\n * are specified, the duration will be for the subset of the media\n * timeline between those two indices. The total duration for live\n * playlists is always Infinity.\n *\n * @param {Object} playlist a media playlist object\n * @param {Number=} endSequence an exclusive upper\n * boundary for the playlist. Defaults to the playlist media\n * sequence number plus its length.\n * @param {Number=} expired the amount of time that has\n * dropped off the front of the playlist in a live scenario\n * @return {Number} the duration between the start index and end\n * index.\n */\n\n\nvar duration = function duration(playlist, endSequence, expired) {\n if (!playlist) {\n return 0;\n }\n\n if (typeof expired !== 'number') {\n expired = 0;\n } // if a slice of the total duration is not requested, use\n // playlist-level duration indicators when they're present\n\n\n if (typeof endSequence === 'undefined') {\n // if present, use the duration specified in the playlist\n if (playlist.totalDuration) {\n return playlist.totalDuration;\n } // duration should be Infinity for live playlists\n\n\n if (!playlist.endList) {\n return window$1.Infinity;\n }\n } // calculate the total duration based on the segment durations\n\n\n return intervalDuration(playlist, endSequence, expired);\n};\n/**\n * Calculate the time between two indexes in the current playlist\n * neight the start- nor the end-index need to be within the current\n * playlist in which case, the targetDuration of the playlist is used\n * to approximate the durations of the segments\n *\n * @param {Object} playlist a media playlist object\n * @param {Number} startIndex\n * @param {Number} endIndex\n * @return {Number} the number of seconds between startIndex and endIndex\n */\n\n\nvar sumDurations = function sumDurations(playlist, startIndex, endIndex) {\n var durations = 0;\n\n if (startIndex > endIndex) {\n var _ref = [endIndex, startIndex];\n startIndex = _ref[0];\n endIndex = _ref[1];\n }\n\n if (startIndex < 0) {\n for (var i = startIndex; i < Math.min(0, endIndex); i++) {\n durations += playlist.targetDuration;\n }\n\n startIndex = 0;\n }\n\n for (var _i = startIndex; _i < endIndex; _i++) {\n durations += playlist.segments[_i].duration;\n }\n\n return durations;\n};\n/**\n * Determines the media index of the segment corresponding to the safe edge of the live\n * window which is the duration of the last segment plus 2 target durations from the end\n * of the playlist.\n *\n * @param {Object} playlist\n * a media playlist object\n * @return {Number}\n * The media index of the segment at the safe live point. 0 if there is no \"safe\"\n * point.\n * @function safeLiveIndex\n */\n\n\nvar safeLiveIndex = function safeLiveIndex(playlist) {\n if (!playlist.segments.length) {\n return 0;\n }\n\n var i = playlist.segments.length - 1;\n var distanceFromEnd = playlist.segments[i].duration || playlist.targetDuration;\n var safeDistance = distanceFromEnd + playlist.targetDuration * 2;\n\n while (i--) {\n distanceFromEnd += playlist.segments[i].duration;\n\n if (distanceFromEnd >= safeDistance) {\n break;\n }\n }\n\n return Math.max(0, i);\n};\n/**\n * Calculates the playlist end time\n *\n * @param {Object} playlist a media playlist object\n * @param {Number=} expired the amount of time that has\n * dropped off the front of the playlist in a live scenario\n * @param {Boolean|false} useSafeLiveEnd a boolean value indicating whether or not the\n * playlist end calculation should consider the safe live end\n * (truncate the playlist end by three segments). This is normally\n * used for calculating the end of the playlist's seekable range.\n * @returns {Number} the end time of playlist\n * @function playlistEnd\n */\n\n\nvar playlistEnd = function playlistEnd(playlist, expired, useSafeLiveEnd) {\n if (!playlist || !playlist.segments) {\n return null;\n }\n\n if (playlist.endList) {\n return duration(playlist);\n }\n\n if (expired === null) {\n return null;\n }\n\n expired = expired || 0;\n var endSequence = useSafeLiveEnd ? safeLiveIndex(playlist) : playlist.segments.length;\n return intervalDuration(playlist, playlist.mediaSequence + endSequence, expired);\n};\n/**\n * Calculates the interval of time that is currently seekable in a\n * playlist. The returned time ranges are relative to the earliest\n * moment in the specified playlist that is still available. A full\n * seekable implementation for live streams would need to offset\n * these values by the duration of content that has expired from the\n * stream.\n *\n * @param {Object} playlist a media playlist object\n * dropped off the front of the playlist in a live scenario\n * @param {Number=} expired the amount of time that has\n * dropped off the front of the playlist in a live scenario\n * @return {TimeRanges} the periods of time that are valid targets\n * for seeking\n */\n\n\nvar seekable = function seekable(playlist, expired) {\n var useSafeLiveEnd = true;\n var seekableStart = expired || 0;\n var seekableEnd = playlistEnd(playlist, expired, useSafeLiveEnd);\n\n if (seekableEnd === null) {\n return createTimeRange();\n }\n\n return createTimeRange(seekableStart, seekableEnd);\n};\n\nvar isWholeNumber = function isWholeNumber(num) {\n return num - Math.floor(num) === 0;\n};\n\nvar roundSignificantDigit = function roundSignificantDigit(increment, num) {\n // If we have a whole number, just add 1 to it\n if (isWholeNumber(num)) {\n return num + increment * 0.1;\n }\n\n var numDecimalDigits = num.toString().split('.')[1].length;\n\n for (var i = 1; i <= numDecimalDigits; i++) {\n var scale = Math.pow(10, i);\n var temp = num * scale;\n\n if (isWholeNumber(temp) || i === numDecimalDigits) {\n return (temp + increment) / scale;\n }\n }\n};\n\nvar ceilLeastSignificantDigit = roundSignificantDigit.bind(null, 1);\nvar floorLeastSignificantDigit = roundSignificantDigit.bind(null, -1);\n/**\n * Determine the index and estimated starting time of the segment that\n * contains a specified playback position in a media playlist.\n *\n * @param {Object} playlist the media playlist to query\n * @param {Number} currentTime The number of seconds since the earliest\n * possible position to determine the containing segment for\n * @param {Number} startIndex\n * @param {Number} startTime\n * @return {Object}\n */\n\nvar getMediaInfoForTime = function getMediaInfoForTime(playlist, currentTime, startIndex, startTime) {\n var i = void 0;\n var segment = void 0;\n var numSegments = playlist.segments.length;\n var time = currentTime - startTime;\n\n if (time < 0) {\n // Walk backward from startIndex in the playlist, adding durations\n // until we find a segment that contains `time` and return it\n if (startIndex > 0) {\n for (i = startIndex - 1; i >= 0; i--) {\n segment = playlist.segments[i];\n time += floorLeastSignificantDigit(segment.duration);\n\n if (time > 0) {\n return {\n mediaIndex: i,\n startTime: startTime - sumDurations(playlist, startIndex, i)\n };\n }\n }\n } // We were unable to find a good segment within the playlist\n // so select the first segment\n\n\n return {\n mediaIndex: 0,\n startTime: currentTime\n };\n } // When startIndex is negative, we first walk forward to first segment\n // adding target durations. If we \"run out of time\" before getting to\n // the first segment, return the first segment\n\n\n if (startIndex < 0) {\n for (i = startIndex; i < 0; i++) {\n time -= playlist.targetDuration;\n\n if (time < 0) {\n return {\n mediaIndex: 0,\n startTime: currentTime\n };\n }\n }\n\n startIndex = 0;\n } // Walk forward from startIndex in the playlist, subtracting durations\n // until we find a segment that contains `time` and return it\n\n\n for (i = startIndex; i < numSegments; i++) {\n segment = playlist.segments[i];\n time -= ceilLeastSignificantDigit(segment.duration);\n\n if (time < 0) {\n return {\n mediaIndex: i,\n startTime: startTime + sumDurations(playlist, startIndex, i)\n };\n }\n } // We are out of possible candidates so load the last one...\n\n\n return {\n mediaIndex: numSegments - 1,\n startTime: currentTime\n };\n};\n/**\n * Check whether the playlist is blacklisted or not.\n *\n * @param {Object} playlist the media playlist object\n * @return {boolean} whether the playlist is blacklisted or not\n * @function isBlacklisted\n */\n\n\nvar isBlacklisted = function isBlacklisted(playlist) {\n return playlist.excludeUntil && playlist.excludeUntil > Date.now();\n};\n/**\n * Check whether the playlist is compatible with current playback configuration or has\n * been blacklisted permanently for being incompatible.\n *\n * @param {Object} playlist the media playlist object\n * @return {boolean} whether the playlist is incompatible or not\n * @function isIncompatible\n */\n\n\nvar isIncompatible = function isIncompatible(playlist) {\n return playlist.excludeUntil && playlist.excludeUntil === Infinity;\n};\n/**\n * Check whether the playlist is enabled or not.\n *\n * @param {Object} playlist the media playlist object\n * @return {boolean} whether the playlist is enabled or not\n * @function isEnabled\n */\n\n\nvar isEnabled = function isEnabled(playlist) {\n var blacklisted = isBlacklisted(playlist);\n return !playlist.disabled && !blacklisted;\n};\n/**\n * Check whether the playlist has been manually disabled through the representations api.\n *\n * @param {Object} playlist the media playlist object\n * @return {boolean} whether the playlist is disabled manually or not\n * @function isDisabled\n */\n\n\nvar isDisabled = function isDisabled(playlist) {\n return playlist.disabled;\n};\n/**\n * Returns whether the current playlist is an AES encrypted HLS stream\n *\n * @return {Boolean} true if it's an AES encrypted HLS stream\n */\n\n\nvar isAes = function isAes(media) {\n for (var i = 0; i < media.segments.length; i++) {\n if (media.segments[i].key) {\n return true;\n }\n }\n\n return false;\n};\n/**\n * Returns whether the current playlist contains fMP4\n *\n * @return {Boolean} true if the playlist contains fMP4\n */\n\n\nvar isFmp4 = function isFmp4(media) {\n for (var i = 0; i < media.segments.length; i++) {\n if (media.segments[i].map) {\n return true;\n }\n }\n\n return false;\n};\n/**\n * Checks if the playlist has a value for the specified attribute\n *\n * @param {String} attr\n * Attribute to check for\n * @param {Object} playlist\n * The media playlist object\n * @return {Boolean}\n * Whether the playlist contains a value for the attribute or not\n * @function hasAttribute\n */\n\n\nvar hasAttribute = function hasAttribute(attr, playlist) {\n return playlist.attributes && playlist.attributes[attr];\n};\n/**\n * Estimates the time required to complete a segment download from the specified playlist\n *\n * @param {Number} segmentDuration\n * Duration of requested segment\n * @param {Number} bandwidth\n * Current measured bandwidth of the player\n * @param {Object} playlist\n * The media playlist object\n * @param {Number=} bytesReceived\n * Number of bytes already received for the request. Defaults to 0\n * @return {Number|NaN}\n * The estimated time to request the segment. NaN if bandwidth information for\n * the given playlist is unavailable\n * @function estimateSegmentRequestTime\n */\n\n\nvar estimateSegmentRequestTime = function estimateSegmentRequestTime(segmentDuration, bandwidth, playlist) {\n var bytesReceived = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n\n if (!hasAttribute('BANDWIDTH', playlist)) {\n return NaN;\n }\n\n var size = segmentDuration * playlist.attributes.BANDWIDTH;\n return (size - bytesReceived * 8) / bandwidth;\n};\n/*\n * Returns whether the current playlist is the lowest rendition\n *\n * @return {Boolean} true if on lowest rendition\n */\n\n\nvar isLowestEnabledRendition = function isLowestEnabledRendition(master, media) {\n if (master.playlists.length === 1) {\n return true;\n }\n\n var currentBandwidth = media.attributes.BANDWIDTH || Number.MAX_VALUE;\n return master.playlists.filter(function (playlist) {\n if (!isEnabled(playlist)) {\n return false;\n }\n\n return (playlist.attributes.BANDWIDTH || 0) < currentBandwidth;\n }).length === 0;\n}; // exports\n\n\nvar Playlist = {\n duration: duration,\n seekable: seekable,\n safeLiveIndex: safeLiveIndex,\n getMediaInfoForTime: getMediaInfoForTime,\n isEnabled: isEnabled,\n isDisabled: isDisabled,\n isBlacklisted: isBlacklisted,\n isIncompatible: isIncompatible,\n playlistEnd: playlistEnd,\n isAes: isAes,\n isFmp4: isFmp4,\n hasAttribute: hasAttribute,\n estimateSegmentRequestTime: estimateSegmentRequestTime,\n isLowestEnabledRendition: isLowestEnabledRendition\n};\n/**\n * @file xhr.js\n */\n\nvar videojsXHR = videojs$1.xhr,\n mergeOptions$1$1 = videojs$1.mergeOptions;\n\nvar xhrFactory = function xhrFactory() {\n var xhr$$1 = function XhrFunction(options, callback) {\n // Add a default timeout for all hls requests\n options = mergeOptions$1$1({\n timeout: 45e3\n }, options); // Allow an optional user-specified function to modify the option\n // object before we construct the xhr request\n\n var beforeRequest = XhrFunction.beforeRequest || videojs$1.Hls.xhr.beforeRequest;\n\n if (beforeRequest && typeof beforeRequest === 'function') {\n var newOptions = beforeRequest(options);\n\n if (newOptions) {\n options = newOptions;\n }\n }\n\n var request = videojsXHR(options, function (error, response) {\n var reqResponse = request.response;\n\n if (!error && reqResponse) {\n request.responseTime = Date.now();\n request.roundTripTime = request.responseTime - request.requestTime;\n request.bytesReceived = reqResponse.byteLength || reqResponse.length;\n\n if (!request.bandwidth) {\n request.bandwidth = Math.floor(request.bytesReceived / request.roundTripTime * 8 * 1000);\n }\n }\n\n if (response.headers) {\n request.responseHeaders = response.headers;\n } // videojs.xhr now uses a specific code on the error\n // object to signal that a request has timed out instead\n // of setting a boolean on the request object\n\n\n if (error && error.code === 'ETIMEDOUT') {\n request.timedout = true;\n } // videojs.xhr no longer considers status codes outside of 200 and 0\n // (for file uris) to be errors, but the old XHR did, so emulate that\n // behavior. Status 206 may be used in response to byterange requests.\n\n\n if (!error && !request.aborted && response.statusCode !== 200 && response.statusCode !== 206 && response.statusCode !== 0) {\n error = new Error('XHR Failed with a response of: ' + (request && (reqResponse || request.responseText)));\n }\n\n callback(error, request);\n });\n var originalAbort = request.abort;\n\n request.abort = function () {\n request.aborted = true;\n return originalAbort.apply(request, arguments);\n };\n\n request.uri = options.uri;\n request.requestTime = Date.now();\n return request;\n };\n\n return xhr$$1;\n};\n/**\n * @file bin-utils.js\n */\n\n/**\n * convert a TimeRange to text\n *\n * @param {TimeRange} range the timerange to use for conversion\n * @param {Number} i the iterator on the range to convert\n */\n\n\nvar textRange = function textRange(range, i) {\n return range.start(i) + '-' + range.end(i);\n};\n/**\n * format a number as hex string\n *\n * @param {Number} e The number\n * @param {Number} i the iterator\n */\n\n\nvar formatHexString = function formatHexString(e, i) {\n var value = e.toString(16);\n return '00'.substring(0, 2 - value.length) + value + (i % 2 ? ' ' : '');\n};\n\nvar formatAsciiString = function formatAsciiString(e) {\n if (e >= 0x20 && e < 0x7e) {\n return String.fromCharCode(e);\n }\n\n return '.';\n};\n/**\n * Creates an object for sending to a web worker modifying properties that are TypedArrays\n * into a new object with seperated properties for the buffer, byteOffset, and byteLength.\n *\n * @param {Object} message\n * Object of properties and values to send to the web worker\n * @return {Object}\n * Modified message with TypedArray values expanded\n * @function createTransferableMessage\n */\n\n\nvar createTransferableMessage = function createTransferableMessage(message) {\n var transferable = {};\n Object.keys(message).forEach(function (key) {\n var value = message[key];\n\n if (ArrayBuffer.isView(value)) {\n transferable[key] = {\n bytes: value.buffer,\n byteOffset: value.byteOffset,\n byteLength: value.byteLength\n };\n } else {\n transferable[key] = value;\n }\n });\n return transferable;\n};\n/**\n * Returns a unique string identifier for a media initialization\n * segment.\n */\n\n\nvar initSegmentId = function initSegmentId(initSegment) {\n var byterange = initSegment.byterange || {\n length: Infinity,\n offset: 0\n };\n return [byterange.length, byterange.offset, initSegment.resolvedUri].join(',');\n};\n/**\n * utils to help dump binary data to the console\n */\n\n\nvar hexDump = function hexDump(data) {\n var bytes = Array.prototype.slice.call(data);\n var step = 16;\n var result = '';\n var hex = void 0;\n var ascii = void 0;\n\n for (var j = 0; j < bytes.length / step; j++) {\n hex = bytes.slice(j * step, j * step + step).map(formatHexString).join('');\n ascii = bytes.slice(j * step, j * step + step).map(formatAsciiString).join('');\n result += hex + ' ' + ascii + '\\n';\n }\n\n return result;\n};\n\nvar tagDump = function tagDump(_ref) {\n var bytes = _ref.bytes;\n return hexDump(bytes);\n};\n\nvar textRanges = function textRanges(ranges) {\n var result = '';\n var i = void 0;\n\n for (i = 0; i < ranges.length; i++) {\n result += textRange(ranges, i) + ' ';\n }\n\n return result;\n};\n\nvar utils =\n/*#__PURE__*/\nObject.freeze({\n createTransferableMessage: createTransferableMessage,\n initSegmentId: initSegmentId,\n hexDump: hexDump,\n tagDump: tagDump,\n textRanges: textRanges\n});\n/**\n * @file time.js\n */\n\n/**\n * Checks whether a given time is within a segment based on its start time\n * and duration. For playerTime, the requested time is in seconds, for\n * streamTime, the time is a Date object.\n *\n * @param {Date|Number} requestedTime Time to check is within a segment\n * @param {\"stream\" | \"player\"} type Whether passing in a playerTime or streamTime\n * @param {Date|Number} segmentStart The start time of the segment\n * @param {Number} duration Segment duration in seconds\n */\n\nvar timeWithinSegment = function timeWithinSegment(requestedTime, type, segmentStart, duration) {\n var endTime = void 0;\n\n if (type === 'stream') {\n endTime = new Date(duration * 1000 + segmentStart.getTime());\n var requestedTimeString = requestedTime.toISOString();\n var segmentTimeString = segmentStart.toISOString();\n var endTimeString = endTime.toISOString();\n return segmentTimeString <= requestedTimeString && requestedTimeString <= endTimeString;\n } else if (type === 'player') {\n endTime = duration + segmentStart;\n return segmentStart <= requestedTime && requestedTime <= endTime;\n }\n};\n/**\n * Finds a segment that contains the time requested. This might be an estimate or\n * an accurate match.\n *\n * @param {Date|Number} time The streamTime or playerTime to find a matching segment for\n * @param {\"stream\" | \"player\"} type Either the playerTime or streamTime\n * @param {Object} playlist A playlist object\n * @return {Object} match\n * @return {Object} match.segment The matched segment from the playlist\n * @return {Date|Number} match.estimatedStart The estimated start time of the segment\n * @return {\"accurate\" | \"estimate\"} match.type Whether the match is estimated or accurate\n */\n\n\nvar findSegmentForTime = function findSegmentForTime(time, type, playlist) {\n if (!playlist.segments || playlist.segments.length === 0) {\n return null;\n }\n\n if (type !== 'player' && type !== 'stream') {\n return null;\n }\n\n var manifestTime = 0;\n\n for (var i = 0; i < playlist.segments.length; i++) {\n var segment = playlist.segments[i];\n var estimatedEnd = manifestTime + segment.duration;\n var segmentStart = void 0;\n var estimatedStart = void 0;\n\n if (type === 'player') {\n segmentStart = segment.start;\n estimatedStart = manifestTime;\n } else {\n // we can rely on the program date time being accurate\n segmentStart = segment.dateTimeObject;\n estimatedStart = segment.dateTimeObject;\n }\n\n var timeWithinSegmentEnd = typeof segment.start !== 'undefined' && typeof segment.end !== 'undefined' && timeWithinSegment(time, type, segmentStart, segment.end - segment.start);\n var timeWithinSegmentDuration = timeWithinSegment(time, type, estimatedStart, segment.duration);\n\n if (timeWithinSegmentEnd) {\n return {\n segment: segment,\n estimatedStart: estimatedStart,\n type: 'accurate'\n };\n } else if (timeWithinSegmentDuration) {\n return {\n segment: segment,\n estimatedStart: estimatedStart,\n type: 'estimate'\n };\n }\n\n manifestTime = estimatedEnd;\n }\n\n return null;\n};\n/**\n * Finds a segment that contains the given player time(in seconds).\n *\n * @param {Number} time The player time to find a match for\n * @param {Object} playlist A playlist object to search within\n */\n\n\nvar findSegmentForPlayerTime = function findSegmentForPlayerTime(time, playlist) {\n // Assumptions:\n // - there will always be a segment.duration\n // - we can start from zero\n // - segments are in time order\n // - segment.start and segment.end only come\n // from syncController\n return findSegmentForTime(time, 'player', playlist);\n};\n/**\n * Finds a segment that contains the stream time give as an ISO-8601 string.\n *\n * @param {String} streamTime The ISO-8601 streamTime to find a match for\n * @param {Object} playlist A playlist object to search within\n */\n\n\nvar findSegmentForStreamTime = function findSegmentForStreamTime(streamTime, playlist) {\n var dateTimeObject = void 0;\n\n try {\n dateTimeObject = new Date(streamTime);\n } catch (e) {\n // TODO something here?\n return null;\n } // Assumptions:\n // - verifyProgramDateTimeTags has already been run\n // - live streams have been started\n\n\n return findSegmentForTime(dateTimeObject, 'stream', playlist);\n};\n/**\n * Gives the offset of the comparisonTimestamp from the streamTime timestamp in seconds.\n * If the offset returned is positive, the streamTime occurs before the comparisonTimestamp.\n * If the offset is negative, the streamTime occurs before the comparisonTimestamp.\n *\n * @param {String} comparisonTimeStamp An ISO-8601 timestamp to compare against\n * @param {String} streamTime The streamTime as an ISO-8601 string\n * @return {Number} offset\n */\n\n\nvar getOffsetFromTimestamp = function getOffsetFromTimestamp(comparisonTimeStamp, streamTime) {\n var segmentDateTime = void 0;\n var streamDateTime = void 0;\n\n try {\n segmentDateTime = new Date(comparisonTimeStamp);\n streamDateTime = new Date(streamTime);\n } catch (e) {// TODO handle error\n }\n\n var segmentTimeEpoch = segmentDateTime.getTime();\n var streamTimeEpoch = streamDateTime.getTime();\n return (streamTimeEpoch - segmentTimeEpoch) / 1000;\n};\n/**\n * Checks that all segments in this playlist have programDateTime tags.\n *\n * @param {Object} playlist A playlist object\n */\n\n\nvar verifyProgramDateTimeTags = function verifyProgramDateTimeTags(playlist) {\n if (!playlist.segments || playlist.segments.length === 0) {\n return false;\n }\n\n for (var i = 0; i < playlist.segments.length; i++) {\n var segment = playlist.segments[i];\n\n if (!segment.dateTimeObject) {\n return false;\n }\n }\n\n return true;\n};\n/**\n * Returns the streamTime of the media given a playlist and a playerTime.\n * The playlist must have programDateTime tags for a programDateTime tag to be returned.\n * If the segments containing the time requested have not been buffered yet, an estimate\n * may be returned to the callback.\n *\n * @param {Object} args\n * @param {Object} args.playlist A playlist object to search within\n * @param {Number} time A playerTime in seconds\n * @param {Function} callback(err, streamTime)\n * @returns {String} err.message A detailed error message\n * @returns {Object} streamTime\n * @returns {Number} streamTime.mediaSeconds The streamTime in seconds\n * @returns {String} streamTime.programDateTime The streamTime as an ISO-8601 String\n */\n\n\nvar getStreamTime = function getStreamTime(_ref) {\n var playlist = _ref.playlist,\n _ref$time = _ref.time,\n time = _ref$time === undefined ? undefined : _ref$time,\n callback = _ref.callback;\n\n if (!callback) {\n throw new Error('getStreamTime: callback must be provided');\n }\n\n if (!playlist || time === undefined) {\n return callback({\n message: 'getStreamTime: playlist and time must be provided'\n });\n }\n\n var matchedSegment = findSegmentForPlayerTime(time, playlist);\n\n if (!matchedSegment) {\n return callback({\n message: 'valid streamTime was not found'\n });\n }\n\n if (matchedSegment.type === 'estimate') {\n return callback({\n message: 'Accurate streamTime could not be determined. Please seek to e.seekTime and try again',\n seekTime: matchedSegment.estimatedStart\n });\n }\n\n var streamTime = {\n mediaSeconds: time\n };\n\n if (matchedSegment.segment.dateTimeObject) {\n // TODO this is currently the time of the beginning of the\n // segment. This still needs to be modified to be offset\n // by the time requested.\n streamTime.programDateTime = matchedSegment.segment.dateTimeObject.toISOString();\n }\n\n return callback(null, streamTime);\n};\n/**\n * Seeks in the player to a time that matches the given streamTime ISO-8601 string.\n *\n * @param {Object} args\n * @param {String} args.streamTime A streamTime to seek to as an ISO-8601 String\n * @param {Object} args.playlist A playlist to look within\n * @param {Number} args.retryCount The number of times to try for an accurate seek. Default is 2.\n * @param {Function} args.seekTo A method to perform a seek\n * @param {Boolean} args.pauseAfterSeek Whether to end in a paused state after seeking. Default is true.\n * @param {Object} args.tech The tech to seek on\n * @param {Function} args.callback(err, newTime) A callback to return the new time to\n * @returns {String} err.message A detailed error message\n * @returns {Number} newTime The exact time that was seeked to in seconds\n */\n\n\nvar seekToStreamTime = function seekToStreamTime(_ref2) {\n var streamTime = _ref2.streamTime,\n playlist = _ref2.playlist,\n _ref2$retryCount = _ref2.retryCount,\n retryCount = _ref2$retryCount === undefined ? 2 : _ref2$retryCount,\n seekTo = _ref2.seekTo,\n _ref2$pauseAfterSeek = _ref2.pauseAfterSeek,\n pauseAfterSeek = _ref2$pauseAfterSeek === undefined ? true : _ref2$pauseAfterSeek,\n tech = _ref2.tech,\n callback = _ref2.callback;\n\n if (!callback) {\n throw new Error('seekToStreamTime: callback must be provided');\n }\n\n if (typeof streamTime === 'undefined' || !playlist || !seekTo) {\n return callback({\n message: 'seekToStreamTime: streamTime, seekTo and playlist must be provided'\n });\n }\n\n if (!playlist.endList && !tech.hasStarted_) {\n return callback({\n message: 'player must be playing a live stream to start buffering'\n });\n }\n\n if (!verifyProgramDateTimeTags(playlist)) {\n return callback({\n message: 'programDateTime tags must be provided in the manifest ' + playlist.resolvedUri\n });\n }\n\n var matchedSegment = findSegmentForStreamTime(streamTime, playlist); // no match\n\n if (!matchedSegment) {\n return callback({\n message: streamTime + ' was not found in the stream'\n });\n }\n\n if (matchedSegment.type === 'estimate') {\n // we've run out of retries\n if (retryCount === 0) {\n return callback({\n message: streamTime + ' is not buffered yet. Try again'\n });\n }\n\n return seekToStreamTime({\n streamTime: streamTime,\n playlist: playlist,\n retryCount: retryCount - 1,\n seekTo: seekTo,\n pauseAfterSeek: pauseAfterSeek,\n tech: tech,\n callback: callback\n });\n }\n\n var segment = matchedSegment.segment;\n var mediaOffset = getOffsetFromTimestamp(segment.dateTimeObject, streamTime);\n var seekToTime = segment.start + mediaOffset;\n\n var seekedCallback = function seekedCallback() {\n return callback(null, tech.currentTime());\n }; // listen for seeked event\n\n\n tech.one('seeked', seekedCallback); // pause before seeking as video.js will restore this state\n\n if (pauseAfterSeek) {\n tech.pause();\n }\n\n seekTo(seekToTime);\n};\n/**\n * ranges\n *\n * Utilities for working with TimeRanges.\n *\n */\n// Fudge factor to account for TimeRanges rounding\n\n\nvar TIME_FUDGE_FACTOR = 1 / 30; // Comparisons between time values such as current time and the end of the buffered range\n// can be misleading because of precision differences or when the current media has poorly\n// aligned audio and video, which can cause values to be slightly off from what you would\n// expect. This value is what we consider to be safe to use in such comparisons to account\n// for these scenarios.\n\nvar SAFE_TIME_DELTA = TIME_FUDGE_FACTOR * 3;\n\nvar filterRanges = function filterRanges(timeRanges, predicate) {\n var results = [];\n var i = void 0;\n\n if (timeRanges && timeRanges.length) {\n // Search for ranges that match the predicate\n for (i = 0; i < timeRanges.length; i++) {\n if (predicate(timeRanges.start(i), timeRanges.end(i))) {\n results.push([timeRanges.start(i), timeRanges.end(i)]);\n }\n }\n }\n\n return videojs$1.createTimeRanges(results);\n};\n/**\n * Attempts to find the buffered TimeRange that contains the specified\n * time.\n * @param {TimeRanges} buffered - the TimeRanges object to query\n * @param {number} time - the time to filter on.\n * @returns {TimeRanges} a new TimeRanges object\n */\n\n\nvar findRange = function findRange(buffered, time) {\n return filterRanges(buffered, function (start, end) {\n return start - TIME_FUDGE_FACTOR <= time && end + TIME_FUDGE_FACTOR >= time;\n });\n};\n/**\n * Returns the TimeRanges that begin later than the specified time.\n * @param {TimeRanges} timeRanges - the TimeRanges object to query\n * @param {number} time - the time to filter on.\n * @returns {TimeRanges} a new TimeRanges object.\n */\n\n\nvar findNextRange = function findNextRange(timeRanges, time) {\n return filterRanges(timeRanges, function (start) {\n return start - TIME_FUDGE_FACTOR >= time;\n });\n};\n/**\n * Returns gaps within a list of TimeRanges\n * @param {TimeRanges} buffered - the TimeRanges object\n * @return {TimeRanges} a TimeRanges object of gaps\n */\n\n\nvar findGaps = function findGaps(buffered) {\n if (buffered.length < 2) {\n return videojs$1.createTimeRanges();\n }\n\n var ranges = [];\n\n for (var i = 1; i < buffered.length; i++) {\n var start = buffered.end(i - 1);\n var end = buffered.start(i);\n ranges.push([start, end]);\n }\n\n return videojs$1.createTimeRanges(ranges);\n};\n/**\n * Gets a human readable string for a TimeRange\n *\n * @param {TimeRange} range\n * @returns {String} a human readable string\n */\n\n\nvar printableRange = function printableRange(range) {\n var strArr = [];\n\n if (!range || !range.length) {\n return '';\n }\n\n for (var i = 0; i < range.length; i++) {\n strArr.push(range.start(i) + ' => ' + range.end(i));\n }\n\n return strArr.join(', ');\n};\n/**\n * Calculates the amount of time left in seconds until the player hits the end of the\n * buffer and causes a rebuffer\n *\n * @param {TimeRange} buffered\n * The state of the buffer\n * @param {Numnber} currentTime\n * The current time of the player\n * @param {Number} playbackRate\n * The current playback rate of the player. Defaults to 1.\n * @return {Number}\n * Time until the player has to start rebuffering in seconds.\n * @function timeUntilRebuffer\n */\n\n\nvar timeUntilRebuffer = function timeUntilRebuffer(buffered, currentTime) {\n var playbackRate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n var bufferedEnd = buffered.length ? buffered.end(buffered.length - 1) : 0;\n return (bufferedEnd - currentTime) / playbackRate;\n};\n/**\n * Converts a TimeRanges object into an array representation\n * @param {TimeRanges} timeRanges\n * @returns {Array}\n */\n\n\nvar timeRangesToArray = function timeRangesToArray(timeRanges) {\n var timeRangesList = [];\n\n for (var i = 0; i < timeRanges.length; i++) {\n timeRangesList.push({\n start: timeRanges.start(i),\n end: timeRanges.end(i)\n });\n }\n\n return timeRangesList;\n};\n/**\n * @file create-text-tracks-if-necessary.js\n */\n\n/**\n * Create text tracks on video.js if they exist on a segment.\n *\n * @param {Object} sourceBuffer the VSB or FSB\n * @param {Object} mediaSource the HTML media source\n * @param {Object} segment the segment that may contain the text track\n * @private\n */\n\n\nvar createTextTracksIfNecessary = function createTextTracksIfNecessary(sourceBuffer, mediaSource, segment) {\n var player = mediaSource.player_; // create an in-band caption track if one is present in the segment\n\n if (segment.captions && segment.captions.length) {\n if (!sourceBuffer.inbandTextTracks_) {\n sourceBuffer.inbandTextTracks_ = {};\n }\n\n for (var trackId in segment.captionStreams) {\n if (!sourceBuffer.inbandTextTracks_[trackId]) {\n player.tech_.trigger({\n type: 'usage',\n name: 'hls-608'\n });\n var track = player.textTracks().getTrackById(trackId);\n\n if (track) {\n // Resuse an existing track with a CC# id because this was\n // very likely created by videojs-contrib-hls from information\n // in the m3u8 for us to use\n sourceBuffer.inbandTextTracks_[trackId] = track;\n } else {\n // Otherwise, create a track with the default `CC#` label and\n // without a language\n sourceBuffer.inbandTextTracks_[trackId] = player.addRemoteTextTrack({\n kind: 'captions',\n id: trackId,\n label: trackId\n }, false).track;\n }\n }\n }\n }\n\n if (segment.metadata && segment.metadata.length && !sourceBuffer.metadataTrack_) {\n sourceBuffer.metadataTrack_ = player.addRemoteTextTrack({\n kind: 'metadata',\n label: 'Timed Metadata'\n }, false).track;\n sourceBuffer.metadataTrack_.inBandMetadataTrackDispatchType = segment.metadata.dispatchType;\n }\n};\n/**\n * @file remove-cues-from-track.js\n */\n\n/**\n * Remove cues from a track on video.js.\n *\n * @param {Double} start start of where we should remove the cue\n * @param {Double} end end of where the we should remove the cue\n * @param {Object} track the text track to remove the cues from\n * @private\n */\n\n\nvar removeCuesFromTrack = function removeCuesFromTrack(start, end, track) {\n var i = void 0;\n var cue = void 0;\n\n if (!track) {\n return;\n }\n\n if (!track.cues) {\n return;\n }\n\n i = track.cues.length;\n\n while (i--) {\n cue = track.cues[i]; // Remove any overlapping cue\n\n if (cue.startTime <= end && cue.endTime >= start) {\n track.removeCue(cue);\n }\n }\n};\n/**\n * @file add-text-track-data.js\n */\n\n/**\n * Define properties on a cue for backwards compatability,\n * but warn the user that the way that they are using it\n * is depricated and will be removed at a later date.\n *\n * @param {Cue} cue the cue to add the properties on\n * @private\n */\n\n\nvar deprecateOldCue = function deprecateOldCue(cue) {\n Object.defineProperties(cue.frame, {\n id: {\n get: function get() {\n videojs$1.log.warn('cue.frame.id is deprecated. Use cue.value.key instead.');\n return cue.value.key;\n }\n },\n value: {\n get: function get() {\n videojs$1.log.warn('cue.frame.value is deprecated. Use cue.value.data instead.');\n return cue.value.data;\n }\n },\n privateData: {\n get: function get() {\n videojs$1.log.warn('cue.frame.privateData is deprecated. Use cue.value.data instead.');\n return cue.value.data;\n }\n }\n });\n};\n\nvar durationOfVideo = function durationOfVideo(duration) {\n var dur = void 0;\n\n if (isNaN(duration) || Math.abs(duration) === Infinity) {\n dur = Number.MAX_VALUE;\n } else {\n dur = duration;\n }\n\n return dur;\n};\n/**\n * Add text track data to a source handler given the captions and\n * metadata from the buffer.\n *\n * @param {Object} sourceHandler the virtual source buffer\n * @param {Array} captionArray an array of caption data\n * @param {Array} metadataArray an array of meta data\n * @private\n */\n\n\nvar addTextTrackData = function addTextTrackData(sourceHandler, captionArray, metadataArray) {\n var Cue = window$1.WebKitDataCue || window$1.VTTCue;\n\n if (captionArray) {\n captionArray.forEach(function (caption) {\n var track = caption.stream;\n this.inbandTextTracks_[track].addCue(new Cue(caption.startTime + this.timestampOffset, caption.endTime + this.timestampOffset, caption.text));\n }, sourceHandler);\n }\n\n if (metadataArray) {\n var videoDuration = durationOfVideo(sourceHandler.mediaSource_.duration);\n metadataArray.forEach(function (metadata) {\n var time = metadata.cueTime + this.timestampOffset;\n metadata.frames.forEach(function (frame) {\n var cue = new Cue(time, time, frame.value || frame.url || frame.data || '');\n cue.frame = frame;\n cue.value = frame;\n deprecateOldCue(cue);\n this.metadataTrack_.addCue(cue);\n }, this);\n }, sourceHandler); // Updating the metadeta cues so that\n // the endTime of each cue is the startTime of the next cue\n // the endTime of last cue is the duration of the video\n\n if (sourceHandler.metadataTrack_ && sourceHandler.metadataTrack_.cues && sourceHandler.metadataTrack_.cues.length) {\n var cues = sourceHandler.metadataTrack_.cues;\n var cuesArray = []; // Create a copy of the TextTrackCueList...\n // ...disregarding cues with a falsey value\n\n for (var i = 0; i < cues.length; i++) {\n if (cues[i]) {\n cuesArray.push(cues[i]);\n }\n } // Group cues by their startTime value\n\n\n var cuesGroupedByStartTime = cuesArray.reduce(function (obj, cue) {\n var timeSlot = obj[cue.startTime] || [];\n timeSlot.push(cue);\n obj[cue.startTime] = timeSlot;\n return obj;\n }, {}); // Sort startTimes by ascending order\n\n var sortedStartTimes = Object.keys(cuesGroupedByStartTime).sort(function (a, b) {\n return Number(a) - Number(b);\n }); // Map each cue group's endTime to the next group's startTime\n\n sortedStartTimes.forEach(function (startTime, idx) {\n var cueGroup = cuesGroupedByStartTime[startTime];\n var nextTime = Number(sortedStartTimes[idx + 1]) || videoDuration; // Map each cue's endTime the next group's startTime\n\n cueGroup.forEach(function (cue) {\n cue.endTime = nextTime;\n });\n });\n }\n }\n};\n\nvar win = typeof window !== 'undefined' ? window : {},\n TARGET = typeof Symbol === 'undefined' ? '__target' : Symbol(),\n SCRIPT_TYPE = 'application/javascript',\n BlobBuilder = win.BlobBuilder || win.WebKitBlobBuilder || win.MozBlobBuilder || win.MSBlobBuilder,\n URL = win.URL || win.webkitURL || URL && URL.msURL,\n Worker = win.Worker;\n/**\n * Returns a wrapper around Web Worker code that is constructible.\n *\n * @function shimWorker\n *\n * @param { String } filename The name of the file\n * @param { Function } fn Function wrapping the code of the worker\n */\n\nfunction shimWorker(filename, fn) {\n return function ShimWorker(forceFallback) {\n var o = this;\n\n if (!fn) {\n return new Worker(filename);\n } else if (Worker && !forceFallback) {\n // Convert the function's inner code to a string to construct the worker\n var source = fn.toString().replace(/^function.+?{/, '').slice(0, -1),\n objURL = createSourceObject(source);\n this[TARGET] = new Worker(objURL);\n wrapTerminate(this[TARGET], objURL);\n return this[TARGET];\n } else {\n var selfShim = {\n postMessage: function postMessage(m) {\n if (o.onmessage) {\n setTimeout(function () {\n o.onmessage({\n data: m,\n target: selfShim\n });\n });\n }\n }\n };\n fn.call(selfShim);\n\n this.postMessage = function (m) {\n setTimeout(function () {\n selfShim.onmessage({\n data: m,\n target: o\n });\n });\n };\n\n this.isThisThread = true;\n }\n };\n} // Test Worker capabilities\n\n\nif (Worker) {\n var testWorker,\n objURL = createSourceObject('self.onmessage = function () {}'),\n testArray = new Uint8Array(1);\n\n try {\n testWorker = new Worker(objURL); // Native browser on some Samsung devices throws for transferables, let's detect it\n\n testWorker.postMessage(testArray, [testArray.buffer]);\n } catch (e) {\n Worker = null;\n } finally {\n URL.revokeObjectURL(objURL);\n\n if (testWorker) {\n testWorker.terminate();\n }\n }\n}\n\nfunction createSourceObject(str) {\n try {\n return URL.createObjectURL(new Blob([str], {\n type: SCRIPT_TYPE\n }));\n } catch (e) {\n var blob = new BlobBuilder();\n blob.append(str);\n return URL.createObjectURL(blob.getBlob(type));\n }\n}\n\nfunction wrapTerminate(worker, objURL) {\n if (!worker || !objURL) return;\n var term = worker.terminate;\n worker.objURL = objURL;\n\n worker.terminate = function () {\n if (worker.objURL) URL.revokeObjectURL(worker.objURL);\n term.call(worker);\n };\n}\n\nvar TransmuxWorker = new shimWorker(\"./transmuxer-worker.worker.js\", function (window, document$$1) {\n var self = this;\n\n var transmuxerWorker = function () {\n /**\n * mux.js\n *\n * Copyright (c) 2015 Brightcove\n * All rights reserved.\n *\n * Functions that generate fragmented MP4s suitable for use with Media\n * Source Extensions.\n */\n var UINT32_MAX = Math.pow(2, 32) - 1;\n var box, dinf, esds, ftyp, mdat, mfhd, minf, moof, moov, mvex, mvhd, trak, tkhd, mdia, mdhd, hdlr, sdtp, stbl, stsd, traf, trex, trun, types, MAJOR_BRAND, MINOR_VERSION, AVC1_BRAND, VIDEO_HDLR, AUDIO_HDLR, HDLR_TYPES, VMHD, SMHD, DREF, STCO, STSC, STSZ, STTS; // pre-calculate constants\n\n (function () {\n var i;\n types = {\n avc1: [],\n // codingname\n avcC: [],\n btrt: [],\n dinf: [],\n dref: [],\n esds: [],\n ftyp: [],\n hdlr: [],\n mdat: [],\n mdhd: [],\n mdia: [],\n mfhd: [],\n minf: [],\n moof: [],\n moov: [],\n mp4a: [],\n // codingname\n mvex: [],\n mvhd: [],\n sdtp: [],\n smhd: [],\n stbl: [],\n stco: [],\n stsc: [],\n stsd: [],\n stsz: [],\n stts: [],\n styp: [],\n tfdt: [],\n tfhd: [],\n traf: [],\n trak: [],\n trun: [],\n trex: [],\n tkhd: [],\n vmhd: []\n }; // In environments where Uint8Array is undefined (e.g., IE8), skip set up so that we\n // don't throw an error\n\n if (typeof Uint8Array === 'undefined') {\n return;\n }\n\n for (i in types) {\n if (types.hasOwnProperty(i)) {\n types[i] = [i.charCodeAt(0), i.charCodeAt(1), i.charCodeAt(2), i.charCodeAt(3)];\n }\n }\n\n MAJOR_BRAND = new Uint8Array(['i'.charCodeAt(0), 's'.charCodeAt(0), 'o'.charCodeAt(0), 'm'.charCodeAt(0)]);\n AVC1_BRAND = new Uint8Array(['a'.charCodeAt(0), 'v'.charCodeAt(0), 'c'.charCodeAt(0), '1'.charCodeAt(0)]);\n MINOR_VERSION = new Uint8Array([0, 0, 0, 1]);\n VIDEO_HDLR = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, // pre_defined\n 0x76, 0x69, 0x64, 0x65, // handler_type: 'vide'\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x56, 0x69, 0x64, 0x65, 0x6f, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'VideoHandler'\n ]);\n AUDIO_HDLR = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, // pre_defined\n 0x73, 0x6f, 0x75, 0x6e, // handler_type: 'soun'\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'SoundHandler'\n ]);\n HDLR_TYPES = {\n video: VIDEO_HDLR,\n audio: AUDIO_HDLR\n };\n DREF = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x01, // entry_count\n 0x00, 0x00, 0x00, 0x0c, // entry_size\n 0x75, 0x72, 0x6c, 0x20, // 'url' type\n 0x00, // version 0\n 0x00, 0x00, 0x01 // entry_flags\n ]);\n SMHD = new Uint8Array([0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, // balance, 0 means centered\n 0x00, 0x00 // reserved\n ]);\n STCO = new Uint8Array([0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00 // entry_count\n ]);\n STSC = STCO;\n STSZ = new Uint8Array([0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, // sample_size\n 0x00, 0x00, 0x00, 0x00 // sample_count\n ]);\n STTS = STCO;\n VMHD = new Uint8Array([0x00, // version\n 0x00, 0x00, 0x01, // flags\n 0x00, 0x00, // graphicsmode\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // opcolor\n ]);\n })();\n\n box = function box(type) {\n var payload = [],\n size = 0,\n i,\n result,\n view;\n\n for (i = 1; i < arguments.length; i++) {\n payload.push(arguments[i]);\n }\n\n i = payload.length; // calculate the total size we need to allocate\n\n while (i--) {\n size += payload[i].byteLength;\n }\n\n result = new Uint8Array(size + 8);\n view = new DataView(result.buffer, result.byteOffset, result.byteLength);\n view.setUint32(0, result.byteLength);\n result.set(type, 4); // copy the payload into the result\n\n for (i = 0, size = 8; i < payload.length; i++) {\n result.set(payload[i], size);\n size += payload[i].byteLength;\n }\n\n return result;\n };\n\n dinf = function dinf() {\n return box(types.dinf, box(types.dref, DREF));\n };\n\n esds = function esds(track) {\n return box(types.esds, new Uint8Array([0x00, // version\n 0x00, 0x00, 0x00, // flags\n // ES_Descriptor\n 0x03, // tag, ES_DescrTag\n 0x19, // length\n 0x00, 0x00, // ES_ID\n 0x00, // streamDependenceFlag, URL_flag, reserved, streamPriority\n // DecoderConfigDescriptor\n 0x04, // tag, DecoderConfigDescrTag\n 0x11, // length\n 0x40, // object type\n 0x15, // streamType\n 0x00, 0x06, 0x00, // bufferSizeDB\n 0x00, 0x00, 0xda, 0xc0, // maxBitrate\n 0x00, 0x00, 0xda, 0xc0, // avgBitrate\n // DecoderSpecificInfo\n 0x05, // tag, DecoderSpecificInfoTag\n 0x02, // length\n // ISO/IEC 14496-3, AudioSpecificConfig\n // for samplingFrequencyIndex see ISO/IEC 13818-7:2006, 8.1.3.2.2, Table 35\n track.audioobjecttype << 3 | track.samplingfrequencyindex >>> 1, track.samplingfrequencyindex << 7 | track.channelcount << 3, 0x06, 0x01, 0x02 // GASpecificConfig\n ]));\n };\n\n ftyp = function ftyp() {\n return box(types.ftyp, MAJOR_BRAND, MINOR_VERSION, MAJOR_BRAND, AVC1_BRAND);\n };\n\n hdlr = function hdlr(type) {\n return box(types.hdlr, HDLR_TYPES[type]);\n };\n\n mdat = function mdat(data) {\n return box(types.mdat, data);\n };\n\n mdhd = function mdhd(track) {\n var result = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x02, // creation_time\n 0x00, 0x00, 0x00, 0x03, // modification_time\n 0x00, 0x01, 0x5f, 0x90, // timescale, 90,000 \"ticks\" per second\n track.duration >>> 24 & 0xFF, track.duration >>> 16 & 0xFF, track.duration >>> 8 & 0xFF, track.duration & 0xFF, // duration\n 0x55, 0xc4, // 'und' language (undetermined)\n 0x00, 0x00]); // Use the sample rate from the track metadata, when it is\n // defined. The sample rate can be parsed out of an ADTS header, for\n // instance.\n\n if (track.samplerate) {\n result[12] = track.samplerate >>> 24 & 0xFF;\n result[13] = track.samplerate >>> 16 & 0xFF;\n result[14] = track.samplerate >>> 8 & 0xFF;\n result[15] = track.samplerate & 0xFF;\n }\n\n return box(types.mdhd, result);\n };\n\n mdia = function mdia(track) {\n return box(types.mdia, mdhd(track), hdlr(track.type), minf(track));\n };\n\n mfhd = function mfhd(sequenceNumber) {\n return box(types.mfhd, new Uint8Array([0x00, 0x00, 0x00, 0x00, // flags\n (sequenceNumber & 0xFF000000) >> 24, (sequenceNumber & 0xFF0000) >> 16, (sequenceNumber & 0xFF00) >> 8, sequenceNumber & 0xFF // sequence_number\n ]));\n };\n\n minf = function minf(track) {\n return box(types.minf, track.type === 'video' ? box(types.vmhd, VMHD) : box(types.smhd, SMHD), dinf(), stbl(track));\n };\n\n moof = function moof(sequenceNumber, tracks) {\n var trackFragments = [],\n i = tracks.length; // build traf boxes for each track fragment\n\n while (i--) {\n trackFragments[i] = traf(tracks[i]);\n }\n\n return box.apply(null, [types.moof, mfhd(sequenceNumber)].concat(trackFragments));\n };\n /**\n * Returns a movie box.\n * @param tracks {array} the tracks associated with this movie\n * @see ISO/IEC 14496-12:2012(E), section 8.2.1\n */\n\n\n moov = function moov(tracks) {\n var i = tracks.length,\n boxes = [];\n\n while (i--) {\n boxes[i] = trak(tracks[i]);\n }\n\n return box.apply(null, [types.moov, mvhd(0xffffffff)].concat(boxes).concat(mvex(tracks)));\n };\n\n mvex = function mvex(tracks) {\n var i = tracks.length,\n boxes = [];\n\n while (i--) {\n boxes[i] = trex(tracks[i]);\n }\n\n return box.apply(null, [types.mvex].concat(boxes));\n };\n\n mvhd = function mvhd(duration) {\n var bytes = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x01, // creation_time\n 0x00, 0x00, 0x00, 0x02, // modification_time\n 0x00, 0x01, 0x5f, 0x90, // timescale, 90,000 \"ticks\" per second\n (duration & 0xFF000000) >> 24, (duration & 0xFF0000) >> 16, (duration & 0xFF00) >> 8, duration & 0xFF, // duration\n 0x00, 0x01, 0x00, 0x00, // 1.0 rate\n 0x01, 0x00, // 1.0 volume\n 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // pre_defined\n 0xff, 0xff, 0xff, 0xff // next_track_ID\n ]);\n return box(types.mvhd, bytes);\n };\n\n sdtp = function sdtp(track) {\n var samples = track.samples || [],\n bytes = new Uint8Array(4 + samples.length),\n flags,\n i; // leave the full box header (4 bytes) all zero\n // write the sample table\n\n for (i = 0; i < samples.length; i++) {\n flags = samples[i].flags;\n bytes[i + 4] = flags.dependsOn << 4 | flags.isDependedOn << 2 | flags.hasRedundancy;\n }\n\n return box(types.sdtp, bytes);\n };\n\n stbl = function stbl(track) {\n return box(types.stbl, stsd(track), box(types.stts, STTS), box(types.stsc, STSC), box(types.stsz, STSZ), box(types.stco, STCO));\n };\n\n (function () {\n var videoSample, audioSample;\n\n stsd = function stsd(track) {\n return box(types.stsd, new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x01]), track.type === 'video' ? videoSample(track) : audioSample(track));\n };\n\n videoSample = function videoSample(track) {\n var sps = track.sps || [],\n pps = track.pps || [],\n sequenceParameterSets = [],\n pictureParameterSets = [],\n i; // assemble the SPSs\n\n for (i = 0; i < sps.length; i++) {\n sequenceParameterSets.push((sps[i].byteLength & 0xFF00) >>> 8);\n sequenceParameterSets.push(sps[i].byteLength & 0xFF); // sequenceParameterSetLength\n\n sequenceParameterSets = sequenceParameterSets.concat(Array.prototype.slice.call(sps[i])); // SPS\n } // assemble the PPSs\n\n\n for (i = 0; i < pps.length; i++) {\n pictureParameterSets.push((pps[i].byteLength & 0xFF00) >>> 8);\n pictureParameterSets.push(pps[i].byteLength & 0xFF);\n pictureParameterSets = pictureParameterSets.concat(Array.prototype.slice.call(pps[i]));\n }\n\n return box(types.avc1, new Uint8Array([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // data_reference_index\n 0x00, 0x00, // pre_defined\n 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // pre_defined\n (track.width & 0xff00) >> 8, track.width & 0xff, // width\n (track.height & 0xff00) >> 8, track.height & 0xff, // height\n 0x00, 0x48, 0x00, 0x00, // horizresolution\n 0x00, 0x48, 0x00, 0x00, // vertresolution\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // frame_count\n 0x13, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x6a, 0x73, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x2d, 0x68, 0x6c, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // compressorname\n 0x00, 0x18, // depth = 24\n 0x11, 0x11 // pre_defined = -1\n ]), box(types.avcC, new Uint8Array([0x01, // configurationVersion\n track.profileIdc, // AVCProfileIndication\n track.profileCompatibility, // profile_compatibility\n track.levelIdc, // AVCLevelIndication\n 0xff // lengthSizeMinusOne, hard-coded to 4 bytes\n ].concat([sps.length // numOfSequenceParameterSets\n ]).concat(sequenceParameterSets).concat([pps.length // numOfPictureParameterSets\n ]).concat(pictureParameterSets))), // \"PPS\"\n box(types.btrt, new Uint8Array([0x00, 0x1c, 0x9c, 0x80, // bufferSizeDB\n 0x00, 0x2d, 0xc6, 0xc0, // maxBitrate\n 0x00, 0x2d, 0xc6, 0xc0])) // avgBitrate\n );\n };\n\n audioSample = function audioSample(track) {\n return box(types.mp4a, new Uint8Array([// SampleEntry, ISO/IEC 14496-12\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // data_reference_index\n // AudioSampleEntry, ISO/IEC 14496-12\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n (track.channelcount & 0xff00) >> 8, track.channelcount & 0xff, // channelcount\n (track.samplesize & 0xff00) >> 8, track.samplesize & 0xff, // samplesize\n 0x00, 0x00, // pre_defined\n 0x00, 0x00, // reserved\n (track.samplerate & 0xff00) >> 8, track.samplerate & 0xff, 0x00, 0x00 // samplerate, 16.16\n // MP4AudioSampleEntry, ISO/IEC 14496-14\n ]), esds(track));\n };\n })();\n\n tkhd = function tkhd(track) {\n var result = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x07, // flags\n 0x00, 0x00, 0x00, 0x00, // creation_time\n 0x00, 0x00, 0x00, 0x00, // modification_time\n (track.id & 0xFF000000) >> 24, (track.id & 0xFF0000) >> 16, (track.id & 0xFF00) >> 8, track.id & 0xFF, // track_ID\n 0x00, 0x00, 0x00, 0x00, // reserved\n (track.duration & 0xFF000000) >> 24, (track.duration & 0xFF0000) >> 16, (track.duration & 0xFF00) >> 8, track.duration & 0xFF, // duration\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, // layer\n 0x00, 0x00, // alternate_group\n 0x01, 0x00, // non-audio track volume\n 0x00, 0x00, // reserved\n 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix\n (track.width & 0xFF00) >> 8, track.width & 0xFF, 0x00, 0x00, // width\n (track.height & 0xFF00) >> 8, track.height & 0xFF, 0x00, 0x00 // height\n ]);\n return box(types.tkhd, result);\n };\n /**\n * Generate a track fragment (traf) box. A traf box collects metadata\n * about tracks in a movie fragment (moof) box.\n */\n\n\n traf = function traf(track) {\n var trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun, sampleDependencyTable, dataOffset, upperWordBaseMediaDecodeTime, lowerWordBaseMediaDecodeTime;\n trackFragmentHeader = box(types.tfhd, new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x3a, // flags\n (track.id & 0xFF000000) >> 24, (track.id & 0xFF0000) >> 16, (track.id & 0xFF00) >> 8, track.id & 0xFF, // track_ID\n 0x00, 0x00, 0x00, 0x01, // sample_description_index\n 0x00, 0x00, 0x00, 0x00, // default_sample_duration\n 0x00, 0x00, 0x00, 0x00, // default_sample_size\n 0x00, 0x00, 0x00, 0x00 // default_sample_flags\n ]));\n upperWordBaseMediaDecodeTime = Math.floor(track.baseMediaDecodeTime / (UINT32_MAX + 1));\n lowerWordBaseMediaDecodeTime = Math.floor(track.baseMediaDecodeTime % (UINT32_MAX + 1));\n trackFragmentDecodeTime = box(types.tfdt, new Uint8Array([0x01, // version 1\n 0x00, 0x00, 0x00, // flags\n // baseMediaDecodeTime\n upperWordBaseMediaDecodeTime >>> 24 & 0xFF, upperWordBaseMediaDecodeTime >>> 16 & 0xFF, upperWordBaseMediaDecodeTime >>> 8 & 0xFF, upperWordBaseMediaDecodeTime & 0xFF, lowerWordBaseMediaDecodeTime >>> 24 & 0xFF, lowerWordBaseMediaDecodeTime >>> 16 & 0xFF, lowerWordBaseMediaDecodeTime >>> 8 & 0xFF, lowerWordBaseMediaDecodeTime & 0xFF])); // the data offset specifies the number of bytes from the start of\n // the containing moof to the first payload byte of the associated\n // mdat\n\n dataOffset = 32 + // tfhd\n 20 + // tfdt\n 8 + // traf header\n 16 + // mfhd\n 8 + // moof header\n 8; // mdat header\n // audio tracks require less metadata\n\n if (track.type === 'audio') {\n trackFragmentRun = trun(track, dataOffset);\n return box(types.traf, trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun);\n } // video tracks should contain an independent and disposable samples\n // box (sdtp)\n // generate one and adjust offsets to match\n\n\n sampleDependencyTable = sdtp(track);\n trackFragmentRun = trun(track, sampleDependencyTable.length + dataOffset);\n return box(types.traf, trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun, sampleDependencyTable);\n };\n /**\n * Generate a track box.\n * @param track {object} a track definition\n * @return {Uint8Array} the track box\n */\n\n\n trak = function trak(track) {\n track.duration = track.duration || 0xffffffff;\n return box(types.trak, tkhd(track), mdia(track));\n };\n\n trex = function trex(track) {\n var result = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n (track.id & 0xFF000000) >> 24, (track.id & 0xFF0000) >> 16, (track.id & 0xFF00) >> 8, track.id & 0xFF, // track_ID\n 0x00, 0x00, 0x00, 0x01, // default_sample_description_index\n 0x00, 0x00, 0x00, 0x00, // default_sample_duration\n 0x00, 0x00, 0x00, 0x00, // default_sample_size\n 0x00, 0x01, 0x00, 0x01 // default_sample_flags\n ]); // the last two bytes of default_sample_flags is the sample\n // degradation priority, a hint about the importance of this sample\n // relative to others. Lower the degradation priority for all sample\n // types other than video.\n\n if (track.type !== 'video') {\n result[result.length - 1] = 0x00;\n }\n\n return box(types.trex, result);\n };\n\n (function () {\n var audioTrun, videoTrun, trunHeader; // This method assumes all samples are uniform. That is, if a\n // duration is present for the first sample, it will be present for\n // all subsequent samples.\n // see ISO/IEC 14496-12:2012, Section 8.8.8.1\n\n trunHeader = function trunHeader(samples, offset) {\n var durationPresent = 0,\n sizePresent = 0,\n flagsPresent = 0,\n compositionTimeOffset = 0; // trun flag constants\n\n if (samples.length) {\n if (samples[0].duration !== undefined) {\n durationPresent = 0x1;\n }\n\n if (samples[0].size !== undefined) {\n sizePresent = 0x2;\n }\n\n if (samples[0].flags !== undefined) {\n flagsPresent = 0x4;\n }\n\n if (samples[0].compositionTimeOffset !== undefined) {\n compositionTimeOffset = 0x8;\n }\n }\n\n return [0x00, // version 0\n 0x00, durationPresent | sizePresent | flagsPresent | compositionTimeOffset, 0x01, // flags\n (samples.length & 0xFF000000) >>> 24, (samples.length & 0xFF0000) >>> 16, (samples.length & 0xFF00) >>> 8, samples.length & 0xFF, // sample_count\n (offset & 0xFF000000) >>> 24, (offset & 0xFF0000) >>> 16, (offset & 0xFF00) >>> 8, offset & 0xFF // data_offset\n ];\n };\n\n videoTrun = function videoTrun(track, offset) {\n var bytes, samples, sample, i;\n samples = track.samples || [];\n offset += 8 + 12 + 16 * samples.length;\n bytes = trunHeader(samples, offset);\n\n for (i = 0; i < samples.length; i++) {\n sample = samples[i];\n bytes = bytes.concat([(sample.duration & 0xFF000000) >>> 24, (sample.duration & 0xFF0000) >>> 16, (sample.duration & 0xFF00) >>> 8, sample.duration & 0xFF, // sample_duration\n (sample.size & 0xFF000000) >>> 24, (sample.size & 0xFF0000) >>> 16, (sample.size & 0xFF00) >>> 8, sample.size & 0xFF, // sample_size\n sample.flags.isLeading << 2 | sample.flags.dependsOn, sample.flags.isDependedOn << 6 | sample.flags.hasRedundancy << 4 | sample.flags.paddingValue << 1 | sample.flags.isNonSyncSample, sample.flags.degradationPriority & 0xF0 << 8, sample.flags.degradationPriority & 0x0F, // sample_flags\n (sample.compositionTimeOffset & 0xFF000000) >>> 24, (sample.compositionTimeOffset & 0xFF0000) >>> 16, (sample.compositionTimeOffset & 0xFF00) >>> 8, sample.compositionTimeOffset & 0xFF // sample_composition_time_offset\n ]);\n }\n\n return box(types.trun, new Uint8Array(bytes));\n };\n\n audioTrun = function audioTrun(track, offset) {\n var bytes, samples, sample, i;\n samples = track.samples || [];\n offset += 8 + 12 + 8 * samples.length;\n bytes = trunHeader(samples, offset);\n\n for (i = 0; i < samples.length; i++) {\n sample = samples[i];\n bytes = bytes.concat([(sample.duration & 0xFF000000) >>> 24, (sample.duration & 0xFF0000) >>> 16, (sample.duration & 0xFF00) >>> 8, sample.duration & 0xFF, // sample_duration\n (sample.size & 0xFF000000) >>> 24, (sample.size & 0xFF0000) >>> 16, (sample.size & 0xFF00) >>> 8, sample.size & 0xFF]); // sample_size\n }\n\n return box(types.trun, new Uint8Array(bytes));\n };\n\n trun = function trun(track, offset) {\n if (track.type === 'audio') {\n return audioTrun(track, offset);\n }\n\n return videoTrun(track, offset);\n };\n })();\n\n var mp4Generator = {\n ftyp: ftyp,\n mdat: mdat,\n moof: moof,\n moov: moov,\n initSegment: function initSegment(tracks) {\n var fileType = ftyp(),\n movie = moov(tracks),\n result;\n result = new Uint8Array(fileType.byteLength + movie.byteLength);\n result.set(fileType);\n result.set(movie, fileType.byteLength);\n return result;\n }\n };\n\n var toUnsigned = function toUnsigned(value) {\n return value >>> 0;\n };\n\n var bin = {\n toUnsigned: toUnsigned\n };\n var toUnsigned$1 = bin.toUnsigned;\n\n var _findBox, parseType, timescale, startTime, getVideoTrackIds; // Find the data for a box specified by its path\n\n\n _findBox = function findBox(data, path) {\n var results = [],\n i,\n size,\n type,\n end,\n subresults;\n\n if (!path.length) {\n // short-circuit the search for empty paths\n return null;\n }\n\n for (i = 0; i < data.byteLength;) {\n size = toUnsigned$1(data[i] << 24 | data[i + 1] << 16 | data[i + 2] << 8 | data[i + 3]);\n type = parseType(data.subarray(i + 4, i + 8));\n end = size > 1 ? i + size : data.byteLength;\n\n if (type === path[0]) {\n if (path.length === 1) {\n // this is the end of the path and we've found the box we were\n // looking for\n results.push(data.subarray(i + 8, end));\n } else {\n // recursively search for the next box along the path\n subresults = _findBox(data.subarray(i + 8, end), path.slice(1));\n\n if (subresults.length) {\n results = results.concat(subresults);\n }\n }\n }\n\n i = end;\n } // we've finished searching all of data\n\n\n return results;\n };\n /**\n * Returns the string representation of an ASCII encoded four byte buffer.\n * @param buffer {Uint8Array} a four-byte buffer to translate\n * @return {string} the corresponding string\n */\n\n\n parseType = function parseType(buffer) {\n var result = '';\n result += String.fromCharCode(buffer[0]);\n result += String.fromCharCode(buffer[1]);\n result += String.fromCharCode(buffer[2]);\n result += String.fromCharCode(buffer[3]);\n return result;\n };\n /**\n * Parses an MP4 initialization segment and extracts the timescale\n * values for any declared tracks. Timescale values indicate the\n * number of clock ticks per second to assume for time-based values\n * elsewhere in the MP4.\n *\n * To determine the start time of an MP4, you need two pieces of\n * information: the timescale unit and the earliest base media decode\n * time. Multiple timescales can be specified within an MP4 but the\n * base media decode time is always expressed in the timescale from\n * the media header box for the track:\n * ```\n * moov > trak > mdia > mdhd.timescale\n * ```\n * @param init {Uint8Array} the bytes of the init segment\n * @return {object} a hash of track ids to timescale values or null if\n * the init segment is malformed.\n */\n\n\n timescale = function timescale(init) {\n var result = {},\n traks = _findBox(init, ['moov', 'trak']); // mdhd timescale\n\n\n return traks.reduce(function (result, trak) {\n var tkhd, version, index, id, mdhd;\n tkhd = _findBox(trak, ['tkhd'])[0];\n\n if (!tkhd) {\n return null;\n }\n\n version = tkhd[0];\n index = version === 0 ? 12 : 20;\n id = toUnsigned$1(tkhd[index] << 24 | tkhd[index + 1] << 16 | tkhd[index + 2] << 8 | tkhd[index + 3]);\n mdhd = _findBox(trak, ['mdia', 'mdhd'])[0];\n\n if (!mdhd) {\n return null;\n }\n\n version = mdhd[0];\n index = version === 0 ? 12 : 20;\n result[id] = toUnsigned$1(mdhd[index] << 24 | mdhd[index + 1] << 16 | mdhd[index + 2] << 8 | mdhd[index + 3]);\n return result;\n }, result);\n };\n /**\n * Determine the base media decode start time, in seconds, for an MP4\n * fragment. If multiple fragments are specified, the earliest time is\n * returned.\n *\n * The base media decode time can be parsed from track fragment\n * metadata:\n * ```\n * moof > traf > tfdt.baseMediaDecodeTime\n * ```\n * It requires the timescale value from the mdhd to interpret.\n *\n * @param timescale {object} a hash of track ids to timescale values.\n * @return {number} the earliest base media decode start time for the\n * fragment, in seconds\n */\n\n\n startTime = function startTime(timescale, fragment) {\n var trafs, baseTimes, result; // we need info from two childrend of each track fragment box\n\n trafs = _findBox(fragment, ['moof', 'traf']); // determine the start times for each track\n\n baseTimes = [].concat.apply([], trafs.map(function (traf) {\n return _findBox(traf, ['tfhd']).map(function (tfhd) {\n var id, scale, baseTime; // get the track id from the tfhd\n\n id = toUnsigned$1(tfhd[4] << 24 | tfhd[5] << 16 | tfhd[6] << 8 | tfhd[7]); // assume a 90kHz clock if no timescale was specified\n\n scale = timescale[id] || 90e3; // get the base media decode time from the tfdt\n\n baseTime = _findBox(traf, ['tfdt']).map(function (tfdt) {\n var version, result;\n version = tfdt[0];\n result = toUnsigned$1(tfdt[4] << 24 | tfdt[5] << 16 | tfdt[6] << 8 | tfdt[7]);\n\n if (version === 1) {\n result *= Math.pow(2, 32);\n result += toUnsigned$1(tfdt[8] << 24 | tfdt[9] << 16 | tfdt[10] << 8 | tfdt[11]);\n }\n\n return result;\n })[0];\n baseTime = baseTime || Infinity; // convert base time to seconds\n\n return baseTime / scale;\n });\n })); // return the minimum\n\n result = Math.min.apply(null, baseTimes);\n return isFinite(result) ? result : 0;\n };\n /**\n * Find the trackIds of the video tracks in this source.\n * Found by parsing the Handler Reference and Track Header Boxes:\n * moov > trak > mdia > hdlr\n * moov > trak > tkhd\n *\n * @param {Uint8Array} init - The bytes of the init segment for this source\n * @return {Number[]} A list of trackIds\n *\n * @see ISO-BMFF-12/2015, Section 8.4.3\n **/\n\n\n getVideoTrackIds = function getVideoTrackIds(init) {\n var traks = _findBox(init, ['moov', 'trak']);\n\n var videoTrackIds = [];\n traks.forEach(function (trak) {\n var hdlrs = _findBox(trak, ['mdia', 'hdlr']);\n\n var tkhds = _findBox(trak, ['tkhd']);\n\n hdlrs.forEach(function (hdlr, index) {\n var handlerType = parseType(hdlr.subarray(8, 12));\n var tkhd = tkhds[index];\n var view;\n var version;\n var trackId;\n\n if (handlerType === 'vide') {\n view = new DataView(tkhd.buffer, tkhd.byteOffset, tkhd.byteLength);\n version = view.getUint8(0);\n trackId = version === 0 ? view.getUint32(12) : view.getUint32(20);\n videoTrackIds.push(trackId);\n }\n });\n });\n return videoTrackIds;\n };\n\n var probe = {\n findBox: _findBox,\n parseType: parseType,\n timescale: timescale,\n startTime: startTime,\n videoTrackIds: getVideoTrackIds\n };\n /**\n * mux.js\n *\n * Copyright (c) 2014 Brightcove\n * All rights reserved.\n *\n * A lightweight readable stream implemention that handles event dispatching.\n * Objects that inherit from streams should call init in their constructors.\n */\n\n var Stream = function Stream() {\n this.init = function () {\n var listeners = {};\n /**\n * Add a listener for a specified event type.\n * @param type {string} the event name\n * @param listener {function} the callback to be invoked when an event of\n * the specified type occurs\n */\n\n this.on = function (type, listener) {\n if (!listeners[type]) {\n listeners[type] = [];\n }\n\n listeners[type] = listeners[type].concat(listener);\n };\n /**\n * Remove a listener for a specified event type.\n * @param type {string} the event name\n * @param listener {function} a function previously registered for this\n * type of event through `on`\n */\n\n\n this.off = function (type, listener) {\n var index;\n\n if (!listeners[type]) {\n return false;\n }\n\n index = listeners[type].indexOf(listener);\n listeners[type] = listeners[type].slice();\n listeners[type].splice(index, 1);\n return index > -1;\n };\n /**\n * Trigger an event of the specified type on this stream. Any additional\n * arguments to this function are passed as parameters to event listeners.\n * @param type {string} the event name\n */\n\n\n this.trigger = function (type) {\n var callbacks, i, length, args;\n callbacks = listeners[type];\n\n if (!callbacks) {\n return;\n } // Slicing the arguments on every invocation of this method\n // can add a significant amount of overhead. Avoid the\n // intermediate object creation for the common case of a\n // single callback argument\n\n\n if (arguments.length === 2) {\n length = callbacks.length;\n\n for (i = 0; i < length; ++i) {\n callbacks[i].call(this, arguments[1]);\n }\n } else {\n args = [];\n i = arguments.length;\n\n for (i = 1; i < arguments.length; ++i) {\n args.push(arguments[i]);\n }\n\n length = callbacks.length;\n\n for (i = 0; i < length; ++i) {\n callbacks[i].apply(this, args);\n }\n }\n };\n /**\n * Destroys the stream and cleans up.\n */\n\n\n this.dispose = function () {\n listeners = {};\n };\n };\n };\n /**\n * Forwards all `data` events on this stream to the destination stream. The\n * destination stream should provide a method `push` to receive the data\n * events as they arrive.\n * @param destination {stream} the stream that will receive all `data` events\n * @param autoFlush {boolean} if false, we will not call `flush` on the destination\n * when the current stream emits a 'done' event\n * @see http://nodejs.org/api/stream.html#stream_readable_pipe_destination_options\n */\n\n\n Stream.prototype.pipe = function (destination) {\n this.on('data', function (data) {\n destination.push(data);\n });\n this.on('done', function (flushSource) {\n destination.flush(flushSource);\n });\n return destination;\n }; // Default stream functions that are expected to be overridden to perform\n // actual work. These are provided by the prototype as a sort of no-op\n // implementation so that we don't have to check for their existence in the\n // `pipe` function above.\n\n\n Stream.prototype.push = function (data) {\n this.trigger('data', data);\n };\n\n Stream.prototype.flush = function (flushSource) {\n this.trigger('done', flushSource);\n };\n\n var stream = Stream; // Convert an array of nal units into an array of frames with each frame being\n // composed of the nal units that make up that frame\n // Also keep track of cummulative data about the frame from the nal units such\n // as the frame duration, starting pts, etc.\n\n var groupNalsIntoFrames = function groupNalsIntoFrames(nalUnits) {\n var i,\n currentNal,\n currentFrame = [],\n frames = [];\n currentFrame.byteLength = 0;\n\n for (i = 0; i < nalUnits.length; i++) {\n currentNal = nalUnits[i]; // Split on 'aud'-type nal units\n\n if (currentNal.nalUnitType === 'access_unit_delimiter_rbsp') {\n // Since the very first nal unit is expected to be an AUD\n // only push to the frames array when currentFrame is not empty\n if (currentFrame.length) {\n currentFrame.duration = currentNal.dts - currentFrame.dts;\n frames.push(currentFrame);\n }\n\n currentFrame = [currentNal];\n currentFrame.byteLength = currentNal.data.byteLength;\n currentFrame.pts = currentNal.pts;\n currentFrame.dts = currentNal.dts;\n } else {\n // Specifically flag key frames for ease of use later\n if (currentNal.nalUnitType === 'slice_layer_without_partitioning_rbsp_idr') {\n currentFrame.keyFrame = true;\n }\n\n currentFrame.duration = currentNal.dts - currentFrame.dts;\n currentFrame.byteLength += currentNal.data.byteLength;\n currentFrame.push(currentNal);\n }\n } // For the last frame, use the duration of the previous frame if we\n // have nothing better to go on\n\n\n if (frames.length && (!currentFrame.duration || currentFrame.duration <= 0)) {\n currentFrame.duration = frames[frames.length - 1].duration;\n } // Push the final frame\n\n\n frames.push(currentFrame);\n return frames;\n }; // Convert an array of frames into an array of Gop with each Gop being composed\n // of the frames that make up that Gop\n // Also keep track of cummulative data about the Gop from the frames such as the\n // Gop duration, starting pts, etc.\n\n\n var groupFramesIntoGops = function groupFramesIntoGops(frames) {\n var i,\n currentFrame,\n currentGop = [],\n gops = []; // We must pre-set some of the values on the Gop since we\n // keep running totals of these values\n\n currentGop.byteLength = 0;\n currentGop.nalCount = 0;\n currentGop.duration = 0;\n currentGop.pts = frames[0].pts;\n currentGop.dts = frames[0].dts; // store some metadata about all the Gops\n\n gops.byteLength = 0;\n gops.nalCount = 0;\n gops.duration = 0;\n gops.pts = frames[0].pts;\n gops.dts = frames[0].dts;\n\n for (i = 0; i < frames.length; i++) {\n currentFrame = frames[i];\n\n if (currentFrame.keyFrame) {\n // Since the very first frame is expected to be an keyframe\n // only push to the gops array when currentGop is not empty\n if (currentGop.length) {\n gops.push(currentGop);\n gops.byteLength += currentGop.byteLength;\n gops.nalCount += currentGop.nalCount;\n gops.duration += currentGop.duration;\n }\n\n currentGop = [currentFrame];\n currentGop.nalCount = currentFrame.length;\n currentGop.byteLength = currentFrame.byteLength;\n currentGop.pts = currentFrame.pts;\n currentGop.dts = currentFrame.dts;\n currentGop.duration = currentFrame.duration;\n } else {\n currentGop.duration += currentFrame.duration;\n currentGop.nalCount += currentFrame.length;\n currentGop.byteLength += currentFrame.byteLength;\n currentGop.push(currentFrame);\n }\n }\n\n if (gops.length && currentGop.duration <= 0) {\n currentGop.duration = gops[gops.length - 1].duration;\n }\n\n gops.byteLength += currentGop.byteLength;\n gops.nalCount += currentGop.nalCount;\n gops.duration += currentGop.duration; // push the final Gop\n\n gops.push(currentGop);\n return gops;\n };\n /*\n * Search for the first keyframe in the GOPs and throw away all frames\n * until that keyframe. Then extend the duration of the pulled keyframe\n * and pull the PTS and DTS of the keyframe so that it covers the time\n * range of the frames that were disposed.\n *\n * @param {Array} gops video GOPs\n * @returns {Array} modified video GOPs\n */\n\n\n var extendFirstKeyFrame = function extendFirstKeyFrame(gops) {\n var currentGop;\n\n if (!gops[0][0].keyFrame && gops.length > 1) {\n // Remove the first GOP\n currentGop = gops.shift();\n gops.byteLength -= currentGop.byteLength;\n gops.nalCount -= currentGop.nalCount; // Extend the first frame of what is now the\n // first gop to cover the time period of the\n // frames we just removed\n\n gops[0][0].dts = currentGop.dts;\n gops[0][0].pts = currentGop.pts;\n gops[0][0].duration += currentGop.duration;\n }\n\n return gops;\n };\n /**\n * Default sample object\n * see ISO/IEC 14496-12:2012, section 8.6.4.3\n */\n\n\n var createDefaultSample = function createDefaultSample() {\n return {\n size: 0,\n flags: {\n isLeading: 0,\n dependsOn: 1,\n isDependedOn: 0,\n hasRedundancy: 0,\n degradationPriority: 0,\n isNonSyncSample: 1\n }\n };\n };\n /*\n * Collates information from a video frame into an object for eventual\n * entry into an MP4 sample table.\n *\n * @param {Object} frame the video frame\n * @param {Number} dataOffset the byte offset to position the sample\n * @return {Object} object containing sample table info for a frame\n */\n\n\n var sampleForFrame = function sampleForFrame(frame, dataOffset) {\n var sample = createDefaultSample();\n sample.dataOffset = dataOffset;\n sample.compositionTimeOffset = frame.pts - frame.dts;\n sample.duration = frame.duration;\n sample.size = 4 * frame.length; // Space for nal unit size\n\n sample.size += frame.byteLength;\n\n if (frame.keyFrame) {\n sample.flags.dependsOn = 2;\n sample.flags.isNonSyncSample = 0;\n }\n\n return sample;\n }; // generate the track's sample table from an array of gops\n\n\n var generateSampleTable = function generateSampleTable(gops, baseDataOffset) {\n var h,\n i,\n sample,\n currentGop,\n currentFrame,\n dataOffset = baseDataOffset || 0,\n samples = [];\n\n for (h = 0; h < gops.length; h++) {\n currentGop = gops[h];\n\n for (i = 0; i < currentGop.length; i++) {\n currentFrame = currentGop[i];\n sample = sampleForFrame(currentFrame, dataOffset);\n dataOffset += sample.size;\n samples.push(sample);\n }\n }\n\n return samples;\n }; // generate the track's raw mdat data from an array of gops\n\n\n var concatenateNalData = function concatenateNalData(gops) {\n var h,\n i,\n j,\n currentGop,\n currentFrame,\n currentNal,\n dataOffset = 0,\n nalsByteLength = gops.byteLength,\n numberOfNals = gops.nalCount,\n totalByteLength = nalsByteLength + 4 * numberOfNals,\n data = new Uint8Array(totalByteLength),\n view = new DataView(data.buffer); // For each Gop..\n\n for (h = 0; h < gops.length; h++) {\n currentGop = gops[h]; // For each Frame..\n\n for (i = 0; i < currentGop.length; i++) {\n currentFrame = currentGop[i]; // For each NAL..\n\n for (j = 0; j < currentFrame.length; j++) {\n currentNal = currentFrame[j];\n view.setUint32(dataOffset, currentNal.data.byteLength);\n dataOffset += 4;\n data.set(currentNal.data, dataOffset);\n dataOffset += currentNal.data.byteLength;\n }\n }\n }\n\n return data;\n };\n\n var frameUtils = {\n groupNalsIntoFrames: groupNalsIntoFrames,\n groupFramesIntoGops: groupFramesIntoGops,\n extendFirstKeyFrame: extendFirstKeyFrame,\n generateSampleTable: generateSampleTable,\n concatenateNalData: concatenateNalData\n };\n var highPrefix = [33, 16, 5, 32, 164, 27];\n var lowPrefix = [33, 65, 108, 84, 1, 2, 4, 8, 168, 2, 4, 8, 17, 191, 252];\n\n var zeroFill = function zeroFill(count) {\n var a = [];\n\n while (count--) {\n a.push(0);\n }\n\n return a;\n };\n\n var makeTable = function makeTable(metaTable) {\n return Object.keys(metaTable).reduce(function (obj, key) {\n obj[key] = new Uint8Array(metaTable[key].reduce(function (arr, part) {\n return arr.concat(part);\n }, []));\n return obj;\n }, {});\n }; // Frames-of-silence to use for filling in missing AAC frames\n\n\n var coneOfSilence = {\n 96000: [highPrefix, [227, 64], zeroFill(154), [56]],\n 88200: [highPrefix, [231], zeroFill(170), [56]],\n 64000: [highPrefix, [248, 192], zeroFill(240), [56]],\n 48000: [highPrefix, [255, 192], zeroFill(268), [55, 148, 128], zeroFill(54), [112]],\n 44100: [highPrefix, [255, 192], zeroFill(268), [55, 163, 128], zeroFill(84), [112]],\n 32000: [highPrefix, [255, 192], zeroFill(268), [55, 234], zeroFill(226), [112]],\n 24000: [highPrefix, [255, 192], zeroFill(268), [55, 255, 128], zeroFill(268), [111, 112], zeroFill(126), [224]],\n 16000: [highPrefix, [255, 192], zeroFill(268), [55, 255, 128], zeroFill(268), [111, 255], zeroFill(269), [223, 108], zeroFill(195), [1, 192]],\n 12000: [lowPrefix, zeroFill(268), [3, 127, 248], zeroFill(268), [6, 255, 240], zeroFill(268), [13, 255, 224], zeroFill(268), [27, 253, 128], zeroFill(259), [56]],\n 11025: [lowPrefix, zeroFill(268), [3, 127, 248], zeroFill(268), [6, 255, 240], zeroFill(268), [13, 255, 224], zeroFill(268), [27, 255, 192], zeroFill(268), [55, 175, 128], zeroFill(108), [112]],\n 8000: [lowPrefix, zeroFill(268), [3, 121, 16], zeroFill(47), [7]]\n };\n var silence = makeTable(coneOfSilence);\n var ONE_SECOND_IN_TS = 90000,\n // 90kHz clock\n secondsToVideoTs,\n secondsToAudioTs,\n videoTsToSeconds,\n audioTsToSeconds,\n audioTsToVideoTs,\n videoTsToAudioTs;\n\n secondsToVideoTs = function secondsToVideoTs(seconds) {\n return seconds * ONE_SECOND_IN_TS;\n };\n\n secondsToAudioTs = function secondsToAudioTs(seconds, sampleRate) {\n return seconds * sampleRate;\n };\n\n videoTsToSeconds = function videoTsToSeconds(timestamp) {\n return timestamp / ONE_SECOND_IN_TS;\n };\n\n audioTsToSeconds = function audioTsToSeconds(timestamp, sampleRate) {\n return timestamp / sampleRate;\n };\n\n audioTsToVideoTs = function audioTsToVideoTs(timestamp, sampleRate) {\n return secondsToVideoTs(audioTsToSeconds(timestamp, sampleRate));\n };\n\n videoTsToAudioTs = function videoTsToAudioTs(timestamp, sampleRate) {\n return secondsToAudioTs(videoTsToSeconds(timestamp), sampleRate);\n };\n\n var clock = {\n secondsToVideoTs: secondsToVideoTs,\n secondsToAudioTs: secondsToAudioTs,\n videoTsToSeconds: videoTsToSeconds,\n audioTsToSeconds: audioTsToSeconds,\n audioTsToVideoTs: audioTsToVideoTs,\n videoTsToAudioTs: videoTsToAudioTs\n };\n var ONE_SECOND_IN_TS$1 = 90000; // 90kHz clock\n\n /**\n * Sum the `byteLength` properties of the data in each AAC frame\n */\n\n var sumFrameByteLengths = function sumFrameByteLengths(array) {\n var i,\n currentObj,\n sum = 0; // sum the byteLength's all each nal unit in the frame\n\n for (i = 0; i < array.length; i++) {\n currentObj = array[i];\n sum += currentObj.data.byteLength;\n }\n\n return sum;\n }; // Possibly pad (prefix) the audio track with silence if appending this track\n // would lead to the introduction of a gap in the audio buffer\n\n\n var prefixWithSilence = function prefixWithSilence(track, frames, audioAppendStartTs, videoBaseMediaDecodeTime) {\n var baseMediaDecodeTimeTs,\n frameDuration = 0,\n audioGapDuration = 0,\n audioFillFrameCount = 0,\n audioFillDuration = 0,\n silentFrame,\n i;\n\n if (!frames.length) {\n return;\n }\n\n baseMediaDecodeTimeTs = clock.audioTsToVideoTs(track.baseMediaDecodeTime, track.samplerate); // determine frame clock duration based on sample rate, round up to avoid overfills\n\n frameDuration = Math.ceil(ONE_SECOND_IN_TS$1 / (track.samplerate / 1024));\n\n if (audioAppendStartTs && videoBaseMediaDecodeTime) {\n // insert the shortest possible amount (audio gap or audio to video gap)\n audioGapDuration = baseMediaDecodeTimeTs - Math.max(audioAppendStartTs, videoBaseMediaDecodeTime); // number of full frames in the audio gap\n\n audioFillFrameCount = Math.floor(audioGapDuration / frameDuration);\n audioFillDuration = audioFillFrameCount * frameDuration;\n } // don't attempt to fill gaps smaller than a single frame or larger\n // than a half second\n\n\n if (audioFillFrameCount < 1 || audioFillDuration > ONE_SECOND_IN_TS$1 / 2) {\n return;\n }\n\n silentFrame = silence[track.samplerate];\n\n if (!silentFrame) {\n // we don't have a silent frame pregenerated for the sample rate, so use a frame\n // from the content instead\n silentFrame = frames[0].data;\n }\n\n for (i = 0; i < audioFillFrameCount; i++) {\n frames.splice(i, 0, {\n data: silentFrame\n });\n }\n\n track.baseMediaDecodeTime -= Math.floor(clock.videoTsToAudioTs(audioFillDuration, track.samplerate));\n }; // If the audio segment extends before the earliest allowed dts\n // value, remove AAC frames until starts at or after the earliest\n // allowed DTS so that we don't end up with a negative baseMedia-\n // DecodeTime for the audio track\n\n\n var trimAdtsFramesByEarliestDts = function trimAdtsFramesByEarliestDts(adtsFrames, track, earliestAllowedDts) {\n if (track.minSegmentDts >= earliestAllowedDts) {\n return adtsFrames;\n } // We will need to recalculate the earliest segment Dts\n\n\n track.minSegmentDts = Infinity;\n return adtsFrames.filter(function (currentFrame) {\n // If this is an allowed frame, keep it and record it's Dts\n if (currentFrame.dts >= earliestAllowedDts) {\n track.minSegmentDts = Math.min(track.minSegmentDts, currentFrame.dts);\n track.minSegmentPts = track.minSegmentDts;\n return true;\n } // Otherwise, discard it\n\n\n return false;\n });\n }; // generate the track's raw mdat data from an array of frames\n\n\n var generateSampleTable$1 = function generateSampleTable(frames) {\n var i,\n currentFrame,\n samples = [];\n\n for (i = 0; i < frames.length; i++) {\n currentFrame = frames[i];\n samples.push({\n size: currentFrame.data.byteLength,\n duration: 1024 // For AAC audio, all samples contain 1024 samples\n\n });\n }\n\n return samples;\n }; // generate the track's sample table from an array of frames\n\n\n var concatenateFrameData = function concatenateFrameData(frames) {\n var i,\n currentFrame,\n dataOffset = 0,\n data = new Uint8Array(sumFrameByteLengths(frames));\n\n for (i = 0; i < frames.length; i++) {\n currentFrame = frames[i];\n data.set(currentFrame.data, dataOffset);\n dataOffset += currentFrame.data.byteLength;\n }\n\n return data;\n };\n\n var audioFrameUtils = {\n prefixWithSilence: prefixWithSilence,\n trimAdtsFramesByEarliestDts: trimAdtsFramesByEarliestDts,\n generateSampleTable: generateSampleTable$1,\n concatenateFrameData: concatenateFrameData\n };\n var ONE_SECOND_IN_TS$2 = 90000; // 90kHz clock\n\n /**\n * Store information about the start and end of the track and the\n * duration for each frame/sample we process in order to calculate\n * the baseMediaDecodeTime\n */\n\n var collectDtsInfo = function collectDtsInfo(track, data) {\n if (typeof data.pts === 'number') {\n if (track.timelineStartInfo.pts === undefined) {\n track.timelineStartInfo.pts = data.pts;\n }\n\n if (track.minSegmentPts === undefined) {\n track.minSegmentPts = data.pts;\n } else {\n track.minSegmentPts = Math.min(track.minSegmentPts, data.pts);\n }\n\n if (track.maxSegmentPts === undefined) {\n track.maxSegmentPts = data.pts;\n } else {\n track.maxSegmentPts = Math.max(track.maxSegmentPts, data.pts);\n }\n }\n\n if (typeof data.dts === 'number') {\n if (track.timelineStartInfo.dts === undefined) {\n track.timelineStartInfo.dts = data.dts;\n }\n\n if (track.minSegmentDts === undefined) {\n track.minSegmentDts = data.dts;\n } else {\n track.minSegmentDts = Math.min(track.minSegmentDts, data.dts);\n }\n\n if (track.maxSegmentDts === undefined) {\n track.maxSegmentDts = data.dts;\n } else {\n track.maxSegmentDts = Math.max(track.maxSegmentDts, data.dts);\n }\n }\n };\n /**\n * Clear values used to calculate the baseMediaDecodeTime between\n * tracks\n */\n\n\n var clearDtsInfo = function clearDtsInfo(track) {\n delete track.minSegmentDts;\n delete track.maxSegmentDts;\n delete track.minSegmentPts;\n delete track.maxSegmentPts;\n };\n /**\n * Calculate the track's baseMediaDecodeTime based on the earliest\n * DTS the transmuxer has ever seen and the minimum DTS for the\n * current track\n * @param track {object} track metadata configuration\n * @param keepOriginalTimestamps {boolean} If true, keep the timestamps\n * in the source; false to adjust the first segment to start at 0.\n */\n\n\n var calculateTrackBaseMediaDecodeTime = function calculateTrackBaseMediaDecodeTime(track, keepOriginalTimestamps) {\n var baseMediaDecodeTime,\n scale,\n minSegmentDts = track.minSegmentDts; // Optionally adjust the time so the first segment starts at zero.\n\n if (!keepOriginalTimestamps) {\n minSegmentDts -= track.timelineStartInfo.dts;\n } // track.timelineStartInfo.baseMediaDecodeTime is the location, in time, where\n // we want the start of the first segment to be placed\n\n\n baseMediaDecodeTime = track.timelineStartInfo.baseMediaDecodeTime; // Add to that the distance this segment is from the very first\n\n baseMediaDecodeTime += minSegmentDts; // baseMediaDecodeTime must not become negative\n\n baseMediaDecodeTime = Math.max(0, baseMediaDecodeTime);\n\n if (track.type === 'audio') {\n // Audio has a different clock equal to the sampling_rate so we need to\n // scale the PTS values into the clock rate of the track\n scale = track.samplerate / ONE_SECOND_IN_TS$2;\n baseMediaDecodeTime *= scale;\n baseMediaDecodeTime = Math.floor(baseMediaDecodeTime);\n }\n\n return baseMediaDecodeTime;\n };\n\n var trackDecodeInfo = {\n clearDtsInfo: clearDtsInfo,\n calculateTrackBaseMediaDecodeTime: calculateTrackBaseMediaDecodeTime,\n collectDtsInfo: collectDtsInfo\n };\n /**\n * mux.js\n *\n * Copyright (c) 2015 Brightcove\n * All rights reserved.\n *\n * Reads in-band caption information from a video elementary\n * stream. Captions must follow the CEA-708 standard for injection\n * into an MPEG-2 transport streams.\n * @see https://en.wikipedia.org/wiki/CEA-708\n * @see https://www.gpo.gov/fdsys/pkg/CFR-2007-title47-vol1/pdf/CFR-2007-title47-vol1-sec15-119.pdf\n */\n // Supplemental enhancement information (SEI) NAL units have a\n // payload type field to indicate how they are to be\n // interpreted. CEAS-708 caption content is always transmitted with\n // payload type 0x04.\n\n var USER_DATA_REGISTERED_ITU_T_T35 = 4,\n RBSP_TRAILING_BITS = 128;\n /**\n * Parse a supplemental enhancement information (SEI) NAL unit.\n * Stops parsing once a message of type ITU T T35 has been found.\n *\n * @param bytes {Uint8Array} the bytes of a SEI NAL unit\n * @return {object} the parsed SEI payload\n * @see Rec. ITU-T H.264, 7.3.2.3.1\n */\n\n var parseSei = function parseSei(bytes) {\n var i = 0,\n result = {\n payloadType: -1,\n payloadSize: 0\n },\n payloadType = 0,\n payloadSize = 0; // go through the sei_rbsp parsing each each individual sei_message\n\n while (i < bytes.byteLength) {\n // stop once we have hit the end of the sei_rbsp\n if (bytes[i] === RBSP_TRAILING_BITS) {\n break;\n } // Parse payload type\n\n\n while (bytes[i] === 0xFF) {\n payloadType += 255;\n i++;\n }\n\n payloadType += bytes[i++]; // Parse payload size\n\n while (bytes[i] === 0xFF) {\n payloadSize += 255;\n i++;\n }\n\n payloadSize += bytes[i++]; // this sei_message is a 608/708 caption so save it and break\n // there can only ever be one caption message in a frame's sei\n\n if (!result.payload && payloadType === USER_DATA_REGISTERED_ITU_T_T35) {\n result.payloadType = payloadType;\n result.payloadSize = payloadSize;\n result.payload = bytes.subarray(i, i + payloadSize);\n break;\n } // skip the payload and parse the next message\n\n\n i += payloadSize;\n payloadType = 0;\n payloadSize = 0;\n }\n\n return result;\n }; // see ANSI/SCTE 128-1 (2013), section 8.1\n\n\n var parseUserData = function parseUserData(sei) {\n // itu_t_t35_contry_code must be 181 (United States) for\n // captions\n if (sei.payload[0] !== 181) {\n return null;\n } // itu_t_t35_provider_code should be 49 (ATSC) for captions\n\n\n if ((sei.payload[1] << 8 | sei.payload[2]) !== 49) {\n return null;\n } // the user_identifier should be \"GA94\" to indicate ATSC1 data\n\n\n if (String.fromCharCode(sei.payload[3], sei.payload[4], sei.payload[5], sei.payload[6]) !== 'GA94') {\n return null;\n } // finally, user_data_type_code should be 0x03 for caption data\n\n\n if (sei.payload[7] !== 0x03) {\n return null;\n } // return the user_data_type_structure and strip the trailing\n // marker bits\n\n\n return sei.payload.subarray(8, sei.payload.length - 1);\n }; // see CEA-708-D, section 4.4\n\n\n var parseCaptionPackets = function parseCaptionPackets(pts, userData) {\n var results = [],\n i,\n count,\n offset,\n data; // if this is just filler, return immediately\n\n if (!(userData[0] & 0x40)) {\n return results;\n } // parse out the cc_data_1 and cc_data_2 fields\n\n\n count = userData[0] & 0x1f;\n\n for (i = 0; i < count; i++) {\n offset = i * 3;\n data = {\n type: userData[offset + 2] & 0x03,\n pts: pts\n }; // capture cc data when cc_valid is 1\n\n if (userData[offset + 2] & 0x04) {\n data.ccData = userData[offset + 3] << 8 | userData[offset + 4];\n results.push(data);\n }\n }\n\n return results;\n };\n\n var discardEmulationPreventionBytes = function discardEmulationPreventionBytes(data) {\n var length = data.byteLength,\n emulationPreventionBytesPositions = [],\n i = 1,\n newLength,\n newData; // Find all `Emulation Prevention Bytes`\n\n while (i < length - 2) {\n if (data[i] === 0 && data[i + 1] === 0 && data[i + 2] === 0x03) {\n emulationPreventionBytesPositions.push(i + 2);\n i += 2;\n } else {\n i++;\n }\n } // If no Emulation Prevention Bytes were found just return the original\n // array\n\n\n if (emulationPreventionBytesPositions.length === 0) {\n return data;\n } // Create a new array to hold the NAL unit data\n\n\n newLength = length - emulationPreventionBytesPositions.length;\n newData = new Uint8Array(newLength);\n var sourceIndex = 0;\n\n for (i = 0; i < newLength; sourceIndex++, i++) {\n if (sourceIndex === emulationPreventionBytesPositions[0]) {\n // Skip this byte\n sourceIndex++; // Remove this position index\n\n emulationPreventionBytesPositions.shift();\n }\n\n newData[i] = data[sourceIndex];\n }\n\n return newData;\n }; // exports\n\n\n var captionPacketParser = {\n parseSei: parseSei,\n parseUserData: parseUserData,\n parseCaptionPackets: parseCaptionPackets,\n discardEmulationPreventionBytes: discardEmulationPreventionBytes,\n USER_DATA_REGISTERED_ITU_T_T35: USER_DATA_REGISTERED_ITU_T_T35\n }; // -----------------\n // Link To Transport\n // -----------------\n\n var CaptionStream = function CaptionStream() {\n CaptionStream.prototype.init.call(this);\n this.captionPackets_ = [];\n this.ccStreams_ = [new Cea608Stream(0, 0), // eslint-disable-line no-use-before-define\n new Cea608Stream(0, 1), // eslint-disable-line no-use-before-define\n new Cea608Stream(1, 0), // eslint-disable-line no-use-before-define\n new Cea608Stream(1, 1) // eslint-disable-line no-use-before-define\n ];\n this.reset(); // forward data and done events from CCs to this CaptionStream\n\n this.ccStreams_.forEach(function (cc) {\n cc.on('data', this.trigger.bind(this, 'data'));\n cc.on('done', this.trigger.bind(this, 'done'));\n }, this);\n };\n\n CaptionStream.prototype = new stream();\n\n CaptionStream.prototype.push = function (event) {\n var sei, userData, newCaptionPackets; // only examine SEI NALs\n\n if (event.nalUnitType !== 'sei_rbsp') {\n return;\n } // parse the sei\n\n\n sei = captionPacketParser.parseSei(event.escapedRBSP); // ignore everything but user_data_registered_itu_t_t35\n\n if (sei.payloadType !== captionPacketParser.USER_DATA_REGISTERED_ITU_T_T35) {\n return;\n } // parse out the user data payload\n\n\n userData = captionPacketParser.parseUserData(sei); // ignore unrecognized userData\n\n if (!userData) {\n return;\n } // Sometimes, the same segment # will be downloaded twice. To stop the\n // caption data from being processed twice, we track the latest dts we've\n // received and ignore everything with a dts before that. However, since\n // data for a specific dts can be split across packets on either side of\n // a segment boundary, we need to make sure we *don't* ignore the packets\n // from the *next* segment that have dts === this.latestDts_. By constantly\n // tracking the number of packets received with dts === this.latestDts_, we\n // know how many should be ignored once we start receiving duplicates.\n\n\n if (event.dts < this.latestDts_) {\n // We've started getting older data, so set the flag.\n this.ignoreNextEqualDts_ = true;\n return;\n } else if (event.dts === this.latestDts_ && this.ignoreNextEqualDts_) {\n this.numSameDts_--;\n\n if (!this.numSameDts_) {\n // We've received the last duplicate packet, time to start processing again\n this.ignoreNextEqualDts_ = false;\n }\n\n return;\n } // parse out CC data packets and save them for later\n\n\n newCaptionPackets = captionPacketParser.parseCaptionPackets(event.pts, userData);\n this.captionPackets_ = this.captionPackets_.concat(newCaptionPackets);\n\n if (this.latestDts_ !== event.dts) {\n this.numSameDts_ = 0;\n }\n\n this.numSameDts_++;\n this.latestDts_ = event.dts;\n };\n\n CaptionStream.prototype.flush = function () {\n // make sure we actually parsed captions before proceeding\n if (!this.captionPackets_.length) {\n this.ccStreams_.forEach(function (cc) {\n cc.flush();\n }, this);\n return;\n } // In Chrome, the Array#sort function is not stable so add a\n // presortIndex that we can use to ensure we get a stable-sort\n\n\n this.captionPackets_.forEach(function (elem, idx) {\n elem.presortIndex = idx;\n }); // sort caption byte-pairs based on their PTS values\n\n this.captionPackets_.sort(function (a, b) {\n if (a.pts === b.pts) {\n return a.presortIndex - b.presortIndex;\n }\n\n return a.pts - b.pts;\n });\n this.captionPackets_.forEach(function (packet) {\n if (packet.type < 2) {\n // Dispatch packet to the right Cea608Stream\n this.dispatchCea608Packet(packet);\n } // this is where an 'else' would go for a dispatching packets\n // to a theoretical Cea708Stream that handles SERVICEn data\n\n }, this);\n this.captionPackets_.length = 0;\n this.ccStreams_.forEach(function (cc) {\n cc.flush();\n }, this);\n return;\n };\n\n CaptionStream.prototype.reset = function () {\n this.latestDts_ = null;\n this.ignoreNextEqualDts_ = false;\n this.numSameDts_ = 0;\n this.activeCea608Channel_ = [null, null];\n this.ccStreams_.forEach(function (ccStream) {\n ccStream.reset();\n });\n };\n\n CaptionStream.prototype.dispatchCea608Packet = function (packet) {\n // NOTE: packet.type is the CEA608 field\n if (this.setsChannel1Active(packet)) {\n this.activeCea608Channel_[packet.type] = 0;\n } else if (this.setsChannel2Active(packet)) {\n this.activeCea608Channel_[packet.type] = 1;\n }\n\n if (this.activeCea608Channel_[packet.type] === null) {\n // If we haven't received anything to set the active channel, discard the\n // data; we don't want jumbled captions\n return;\n }\n\n this.ccStreams_[(packet.type << 1) + this.activeCea608Channel_[packet.type]].push(packet);\n };\n\n CaptionStream.prototype.setsChannel1Active = function (packet) {\n return (packet.ccData & 0x7800) === 0x1000;\n };\n\n CaptionStream.prototype.setsChannel2Active = function (packet) {\n return (packet.ccData & 0x7800) === 0x1800;\n }; // ----------------------\n // Session to Application\n // ----------------------\n // This hash maps non-ASCII, special, and extended character codes to their\n // proper Unicode equivalent. The first keys that are only a single byte\n // are the non-standard ASCII characters, which simply map the CEA608 byte\n // to the standard ASCII/Unicode. The two-byte keys that follow are the CEA608\n // character codes, but have their MSB bitmasked with 0x03 so that a lookup\n // can be performed regardless of the field and data channel on which the\n // character code was received.\n\n\n var CHARACTER_TRANSLATION = {\n 0x2a: 0xe1,\n // á\n 0x5c: 0xe9,\n // é\n 0x5e: 0xed,\n // í\n 0x5f: 0xf3,\n // ó\n 0x60: 0xfa,\n // ú\n 0x7b: 0xe7,\n // ç\n 0x7c: 0xf7,\n // ÷\n 0x7d: 0xd1,\n // Ñ\n 0x7e: 0xf1,\n // ñ\n 0x7f: 0x2588,\n // █\n 0x0130: 0xae,\n // ®\n 0x0131: 0xb0,\n // °\n 0x0132: 0xbd,\n // ½\n 0x0133: 0xbf,\n // ¿\n 0x0134: 0x2122,\n // ™\n 0x0135: 0xa2,\n // ¢\n 0x0136: 0xa3,\n // £\n 0x0137: 0x266a,\n // ♪\n 0x0138: 0xe0,\n // à\n 0x0139: 0xa0,\n //\n 0x013a: 0xe8,\n // è\n 0x013b: 0xe2,\n // â\n 0x013c: 0xea,\n // ê\n 0x013d: 0xee,\n // î\n 0x013e: 0xf4,\n // ô\n 0x013f: 0xfb,\n // û\n 0x0220: 0xc1,\n // Á\n 0x0221: 0xc9,\n // É\n 0x0222: 0xd3,\n // Ó\n 0x0223: 0xda,\n // Ú\n 0x0224: 0xdc,\n // Ü\n 0x0225: 0xfc,\n // ü\n 0x0226: 0x2018,\n // ‘\n 0x0227: 0xa1,\n // ¡\n 0x0228: 0x2a,\n // *\n 0x0229: 0x27,\n // '\n 0x022a: 0x2014,\n // —\n 0x022b: 0xa9,\n // ©\n 0x022c: 0x2120,\n // ℠\n 0x022d: 0x2022,\n // •\n 0x022e: 0x201c,\n // “\n 0x022f: 0x201d,\n // ”\n 0x0230: 0xc0,\n // À\n 0x0231: 0xc2,\n // Â\n 0x0232: 0xc7,\n // Ç\n 0x0233: 0xc8,\n // È\n 0x0234: 0xca,\n // Ê\n 0x0235: 0xcb,\n // Ë\n 0x0236: 0xeb,\n // ë\n 0x0237: 0xce,\n // Î\n 0x0238: 0xcf,\n // Ï\n 0x0239: 0xef,\n // ï\n 0x023a: 0xd4,\n // Ô\n 0x023b: 0xd9,\n // Ù\n 0x023c: 0xf9,\n // ù\n 0x023d: 0xdb,\n // Û\n 0x023e: 0xab,\n // «\n 0x023f: 0xbb,\n // »\n 0x0320: 0xc3,\n // Ã\n 0x0321: 0xe3,\n // ã\n 0x0322: 0xcd,\n // Í\n 0x0323: 0xcc,\n // Ì\n 0x0324: 0xec,\n // ì\n 0x0325: 0xd2,\n // Ò\n 0x0326: 0xf2,\n // ò\n 0x0327: 0xd5,\n // Õ\n 0x0328: 0xf5,\n // õ\n 0x0329: 0x7b,\n // {\n 0x032a: 0x7d,\n // }\n 0x032b: 0x5c,\n // \\\n 0x032c: 0x5e,\n // ^\n 0x032d: 0x5f,\n // _\n 0x032e: 0x7c,\n // |\n 0x032f: 0x7e,\n // ~\n 0x0330: 0xc4,\n // Ä\n 0x0331: 0xe4,\n // ä\n 0x0332: 0xd6,\n // Ö\n 0x0333: 0xf6,\n // ö\n 0x0334: 0xdf,\n // ß\n 0x0335: 0xa5,\n // ¥\n 0x0336: 0xa4,\n // ¤\n 0x0337: 0x2502,\n // │\n 0x0338: 0xc5,\n // Å\n 0x0339: 0xe5,\n // å\n 0x033a: 0xd8,\n // Ø\n 0x033b: 0xf8,\n // ø\n 0x033c: 0x250c,\n // ┌\n 0x033d: 0x2510,\n // ┐\n 0x033e: 0x2514,\n // └\n 0x033f: 0x2518 // ┘\n\n };\n\n var getCharFromCode = function getCharFromCode(code) {\n if (code === null) {\n return '';\n }\n\n code = CHARACTER_TRANSLATION[code] || code;\n return String.fromCharCode(code);\n }; // the index of the last row in a CEA-608 display buffer\n\n\n var BOTTOM_ROW = 14; // This array is used for mapping PACs -> row #, since there's no way of\n // getting it through bit logic.\n\n var ROWS = [0x1100, 0x1120, 0x1200, 0x1220, 0x1500, 0x1520, 0x1600, 0x1620, 0x1700, 0x1720, 0x1000, 0x1300, 0x1320, 0x1400, 0x1420]; // CEA-608 captions are rendered onto a 34x15 matrix of character\n // cells. The \"bottom\" row is the last element in the outer array.\n\n var createDisplayBuffer = function createDisplayBuffer() {\n var result = [],\n i = BOTTOM_ROW + 1;\n\n while (i--) {\n result.push('');\n }\n\n return result;\n };\n\n var Cea608Stream = function Cea608Stream(field, dataChannel) {\n Cea608Stream.prototype.init.call(this);\n this.field_ = field || 0;\n this.dataChannel_ = dataChannel || 0;\n this.name_ = 'CC' + ((this.field_ << 1 | this.dataChannel_) + 1);\n this.setConstants();\n this.reset();\n\n this.push = function (packet) {\n var data, swap, char0, char1, text; // remove the parity bits\n\n data = packet.ccData & 0x7f7f; // ignore duplicate control codes; the spec demands they're sent twice\n\n if (data === this.lastControlCode_) {\n this.lastControlCode_ = null;\n return;\n } // Store control codes\n\n\n if ((data & 0xf000) === 0x1000) {\n this.lastControlCode_ = data;\n } else if (data !== this.PADDING_) {\n this.lastControlCode_ = null;\n }\n\n char0 = data >>> 8;\n char1 = data & 0xff;\n\n if (data === this.PADDING_) {\n return;\n } else if (data === this.RESUME_CAPTION_LOADING_) {\n this.mode_ = 'popOn';\n } else if (data === this.END_OF_CAPTION_) {\n // If an EOC is received while in paint-on mode, the displayed caption\n // text should be swapped to non-displayed memory as if it was a pop-on\n // caption. Because of that, we should explicitly switch back to pop-on\n // mode\n this.mode_ = 'popOn';\n this.clearFormatting(packet.pts); // if a caption was being displayed, it's gone now\n\n this.flushDisplayed(packet.pts); // flip memory\n\n swap = this.displayed_;\n this.displayed_ = this.nonDisplayed_;\n this.nonDisplayed_ = swap; // start measuring the time to display the caption\n\n this.startPts_ = packet.pts;\n } else if (data === this.ROLL_UP_2_ROWS_) {\n this.rollUpRows_ = 2;\n this.setRollUp(packet.pts);\n } else if (data === this.ROLL_UP_3_ROWS_) {\n this.rollUpRows_ = 3;\n this.setRollUp(packet.pts);\n } else if (data === this.ROLL_UP_4_ROWS_) {\n this.rollUpRows_ = 4;\n this.setRollUp(packet.pts);\n } else if (data === this.CARRIAGE_RETURN_) {\n this.clearFormatting(packet.pts);\n this.flushDisplayed(packet.pts);\n this.shiftRowsUp_();\n this.startPts_ = packet.pts;\n } else if (data === this.BACKSPACE_) {\n if (this.mode_ === 'popOn') {\n this.nonDisplayed_[this.row_] = this.nonDisplayed_[this.row_].slice(0, -1);\n } else {\n this.displayed_[this.row_] = this.displayed_[this.row_].slice(0, -1);\n }\n } else if (data === this.ERASE_DISPLAYED_MEMORY_) {\n this.flushDisplayed(packet.pts);\n this.displayed_ = createDisplayBuffer();\n } else if (data === this.ERASE_NON_DISPLAYED_MEMORY_) {\n this.nonDisplayed_ = createDisplayBuffer();\n } else if (data === this.RESUME_DIRECT_CAPTIONING_) {\n if (this.mode_ !== 'paintOn') {\n // NOTE: This should be removed when proper caption positioning is\n // implemented\n this.flushDisplayed(packet.pts);\n this.displayed_ = createDisplayBuffer();\n }\n\n this.mode_ = 'paintOn';\n this.startPts_ = packet.pts; // Append special characters to caption text\n } else if (this.isSpecialCharacter(char0, char1)) {\n // Bitmask char0 so that we can apply character transformations\n // regardless of field and data channel.\n // Then byte-shift to the left and OR with char1 so we can pass the\n // entire character code to `getCharFromCode`.\n char0 = (char0 & 0x03) << 8;\n text = getCharFromCode(char0 | char1);\n this[this.mode_](packet.pts, text);\n this.column_++; // Append extended characters to caption text\n } else if (this.isExtCharacter(char0, char1)) {\n // Extended characters always follow their \"non-extended\" equivalents.\n // IE if a \"è\" is desired, you'll always receive \"eè\"; non-compliant\n // decoders are supposed to drop the \"è\", while compliant decoders\n // backspace the \"e\" and insert \"è\".\n // Delete the previous character\n if (this.mode_ === 'popOn') {\n this.nonDisplayed_[this.row_] = this.nonDisplayed_[this.row_].slice(0, -1);\n } else {\n this.displayed_[this.row_] = this.displayed_[this.row_].slice(0, -1);\n } // Bitmask char0 so that we can apply character transformations\n // regardless of field and data channel.\n // Then byte-shift to the left and OR with char1 so we can pass the\n // entire character code to `getCharFromCode`.\n\n\n char0 = (char0 & 0x03) << 8;\n text = getCharFromCode(char0 | char1);\n this[this.mode_](packet.pts, text);\n this.column_++; // Process mid-row codes\n } else if (this.isMidRowCode(char0, char1)) {\n // Attributes are not additive, so clear all formatting\n this.clearFormatting(packet.pts); // According to the standard, mid-row codes\n // should be replaced with spaces, so add one now\n\n this[this.mode_](packet.pts, ' ');\n this.column_++;\n\n if ((char1 & 0xe) === 0xe) {\n this.addFormatting(packet.pts, ['i']);\n }\n\n if ((char1 & 0x1) === 0x1) {\n this.addFormatting(packet.pts, ['u']);\n } // Detect offset control codes and adjust cursor\n\n } else if (this.isOffsetControlCode(char0, char1)) {\n // Cursor position is set by indent PAC (see below) in 4-column\n // increments, with an additional offset code of 1-3 to reach any\n // of the 32 columns specified by CEA-608. So all we need to do\n // here is increment the column cursor by the given offset.\n this.column_ += char1 & 0x03; // Detect PACs (Preamble Address Codes)\n } else if (this.isPAC(char0, char1)) {\n // There's no logic for PAC -> row mapping, so we have to just\n // find the row code in an array and use its index :(\n var row = ROWS.indexOf(data & 0x1f20); // Configure the caption window if we're in roll-up mode\n\n if (this.mode_ === 'rollUp') {\n // This implies that the base row is incorrectly set.\n // As per the recommendation in CEA-608(Base Row Implementation), defer to the number\n // of roll-up rows set.\n if (row - this.rollUpRows_ + 1 < 0) {\n row = this.rollUpRows_ - 1;\n }\n\n this.setRollUp(packet.pts, row);\n }\n\n if (row !== this.row_) {\n // formatting is only persistent for current row\n this.clearFormatting(packet.pts);\n this.row_ = row;\n } // All PACs can apply underline, so detect and apply\n // (All odd-numbered second bytes set underline)\n\n\n if (char1 & 0x1 && this.formatting_.indexOf('u') === -1) {\n this.addFormatting(packet.pts, ['u']);\n }\n\n if ((data & 0x10) === 0x10) {\n // We've got an indent level code. Each successive even number\n // increments the column cursor by 4, so we can get the desired\n // column position by bit-shifting to the right (to get n/2)\n // and multiplying by 4.\n this.column_ = ((data & 0xe) >> 1) * 4;\n }\n\n if (this.isColorPAC(char1)) {\n // it's a color code, though we only support white, which\n // can be either normal or italicized. white italics can be\n // either 0x4e or 0x6e depending on the row, so we just\n // bitwise-and with 0xe to see if italics should be turned on\n if ((char1 & 0xe) === 0xe) {\n this.addFormatting(packet.pts, ['i']);\n }\n } // We have a normal character in char0, and possibly one in char1\n\n } else if (this.isNormalChar(char0)) {\n if (char1 === 0x00) {\n char1 = null;\n }\n\n text = getCharFromCode(char0);\n text += getCharFromCode(char1);\n this[this.mode_](packet.pts, text);\n this.column_ += text.length;\n } // finish data processing\n\n };\n };\n\n Cea608Stream.prototype = new stream(); // Trigger a cue point that captures the current state of the\n // display buffer\n\n Cea608Stream.prototype.flushDisplayed = function (pts) {\n var content = this.displayed_ // remove spaces from the start and end of the string\n .map(function (row) {\n try {\n return row.trim();\n } catch (e) {\n // Ordinarily, this shouldn't happen. However, caption\n // parsing errors should not throw exceptions and\n // break playback.\n // eslint-disable-next-line no-console\n console.error('Skipping malformed caption.');\n return '';\n }\n }) // combine all text rows to display in one cue\n .join('\\n') // and remove blank rows from the start and end, but not the middle\n .replace(/^\\n+|\\n+$/g, '');\n\n if (content.length) {\n this.trigger('data', {\n startPts: this.startPts_,\n endPts: pts,\n text: content,\n stream: this.name_\n });\n }\n };\n /**\n * Zero out the data, used for startup and on seek\n */\n\n\n Cea608Stream.prototype.reset = function () {\n this.mode_ = 'popOn'; // When in roll-up mode, the index of the last row that will\n // actually display captions. If a caption is shifted to a row\n // with a lower index than this, it is cleared from the display\n // buffer\n\n this.topRow_ = 0;\n this.startPts_ = 0;\n this.displayed_ = createDisplayBuffer();\n this.nonDisplayed_ = createDisplayBuffer();\n this.lastControlCode_ = null; // Track row and column for proper line-breaking and spacing\n\n this.column_ = 0;\n this.row_ = BOTTOM_ROW;\n this.rollUpRows_ = 2; // This variable holds currently-applied formatting\n\n this.formatting_ = [];\n };\n /**\n * Sets up control code and related constants for this instance\n */\n\n\n Cea608Stream.prototype.setConstants = function () {\n // The following attributes have these uses:\n // ext_ : char0 for mid-row codes, and the base for extended\n // chars (ext_+0, ext_+1, and ext_+2 are char0s for\n // extended codes)\n // control_: char0 for control codes, except byte-shifted to the\n // left so that we can do this.control_ | CONTROL_CODE\n // offset_: char0 for tab offset codes\n //\n // It's also worth noting that control codes, and _only_ control codes,\n // differ between field 1 and field2. Field 2 control codes are always\n // their field 1 value plus 1. That's why there's the \"| field\" on the\n // control value.\n if (this.dataChannel_ === 0) {\n this.BASE_ = 0x10;\n this.EXT_ = 0x11;\n this.CONTROL_ = (0x14 | this.field_) << 8;\n this.OFFSET_ = 0x17;\n } else if (this.dataChannel_ === 1) {\n this.BASE_ = 0x18;\n this.EXT_ = 0x19;\n this.CONTROL_ = (0x1c | this.field_) << 8;\n this.OFFSET_ = 0x1f;\n } // Constants for the LSByte command codes recognized by Cea608Stream. This\n // list is not exhaustive. For a more comprehensive listing and semantics see\n // http://www.gpo.gov/fdsys/pkg/CFR-2010-title47-vol1/pdf/CFR-2010-title47-vol1-sec15-119.pdf\n // Padding\n\n\n this.PADDING_ = 0x0000; // Pop-on Mode\n\n this.RESUME_CAPTION_LOADING_ = this.CONTROL_ | 0x20;\n this.END_OF_CAPTION_ = this.CONTROL_ | 0x2f; // Roll-up Mode\n\n this.ROLL_UP_2_ROWS_ = this.CONTROL_ | 0x25;\n this.ROLL_UP_3_ROWS_ = this.CONTROL_ | 0x26;\n this.ROLL_UP_4_ROWS_ = this.CONTROL_ | 0x27;\n this.CARRIAGE_RETURN_ = this.CONTROL_ | 0x2d; // paint-on mode\n\n this.RESUME_DIRECT_CAPTIONING_ = this.CONTROL_ | 0x29; // Erasure\n\n this.BACKSPACE_ = this.CONTROL_ | 0x21;\n this.ERASE_DISPLAYED_MEMORY_ = this.CONTROL_ | 0x2c;\n this.ERASE_NON_DISPLAYED_MEMORY_ = this.CONTROL_ | 0x2e;\n };\n /**\n * Detects if the 2-byte packet data is a special character\n *\n * Special characters have a second byte in the range 0x30 to 0x3f,\n * with the first byte being 0x11 (for data channel 1) or 0x19 (for\n * data channel 2).\n *\n * @param {Integer} char0 The first byte\n * @param {Integer} char1 The second byte\n * @return {Boolean} Whether the 2 bytes are an special character\n */\n\n\n Cea608Stream.prototype.isSpecialCharacter = function (char0, char1) {\n return char0 === this.EXT_ && char1 >= 0x30 && char1 <= 0x3f;\n };\n /**\n * Detects if the 2-byte packet data is an extended character\n *\n * Extended characters have a second byte in the range 0x20 to 0x3f,\n * with the first byte being 0x12 or 0x13 (for data channel 1) or\n * 0x1a or 0x1b (for data channel 2).\n *\n * @param {Integer} char0 The first byte\n * @param {Integer} char1 The second byte\n * @return {Boolean} Whether the 2 bytes are an extended character\n */\n\n\n Cea608Stream.prototype.isExtCharacter = function (char0, char1) {\n return (char0 === this.EXT_ + 1 || char0 === this.EXT_ + 2) && char1 >= 0x20 && char1 <= 0x3f;\n };\n /**\n * Detects if the 2-byte packet is a mid-row code\n *\n * Mid-row codes have a second byte in the range 0x20 to 0x2f, with\n * the first byte being 0x11 (for data channel 1) or 0x19 (for data\n * channel 2).\n *\n * @param {Integer} char0 The first byte\n * @param {Integer} char1 The second byte\n * @return {Boolean} Whether the 2 bytes are a mid-row code\n */\n\n\n Cea608Stream.prototype.isMidRowCode = function (char0, char1) {\n return char0 === this.EXT_ && char1 >= 0x20 && char1 <= 0x2f;\n };\n /**\n * Detects if the 2-byte packet is an offset control code\n *\n * Offset control codes have a second byte in the range 0x21 to 0x23,\n * with the first byte being 0x17 (for data channel 1) or 0x1f (for\n * data channel 2).\n *\n * @param {Integer} char0 The first byte\n * @param {Integer} char1 The second byte\n * @return {Boolean} Whether the 2 bytes are an offset control code\n */\n\n\n Cea608Stream.prototype.isOffsetControlCode = function (char0, char1) {\n return char0 === this.OFFSET_ && char1 >= 0x21 && char1 <= 0x23;\n };\n /**\n * Detects if the 2-byte packet is a Preamble Address Code\n *\n * PACs have a first byte in the range 0x10 to 0x17 (for data channel 1)\n * or 0x18 to 0x1f (for data channel 2), with the second byte in the\n * range 0x40 to 0x7f.\n *\n * @param {Integer} char0 The first byte\n * @param {Integer} char1 The second byte\n * @return {Boolean} Whether the 2 bytes are a PAC\n */\n\n\n Cea608Stream.prototype.isPAC = function (char0, char1) {\n return char0 >= this.BASE_ && char0 < this.BASE_ + 8 && char1 >= 0x40 && char1 <= 0x7f;\n };\n /**\n * Detects if a packet's second byte is in the range of a PAC color code\n *\n * PAC color codes have the second byte be in the range 0x40 to 0x4f, or\n * 0x60 to 0x6f.\n *\n * @param {Integer} char1 The second byte\n * @return {Boolean} Whether the byte is a color PAC\n */\n\n\n Cea608Stream.prototype.isColorPAC = function (char1) {\n return char1 >= 0x40 && char1 <= 0x4f || char1 >= 0x60 && char1 <= 0x7f;\n };\n /**\n * Detects if a single byte is in the range of a normal character\n *\n * Normal text bytes are in the range 0x20 to 0x7f.\n *\n * @param {Integer} char The byte\n * @return {Boolean} Whether the byte is a normal character\n */\n\n\n Cea608Stream.prototype.isNormalChar = function (char) {\n return char >= 0x20 && char <= 0x7f;\n };\n /**\n * Configures roll-up\n *\n * @param {Integer} pts Current PTS\n * @param {Integer} newBaseRow Used by PACs to slide the current window to\n * a new position\n */\n\n\n Cea608Stream.prototype.setRollUp = function (pts, newBaseRow) {\n // Reset the base row to the bottom row when switching modes\n if (this.mode_ !== 'rollUp') {\n this.row_ = BOTTOM_ROW;\n this.mode_ = 'rollUp'; // Spec says to wipe memories when switching to roll-up\n\n this.flushDisplayed(pts);\n this.nonDisplayed_ = createDisplayBuffer();\n this.displayed_ = createDisplayBuffer();\n }\n\n if (newBaseRow !== undefined && newBaseRow !== this.row_) {\n // move currently displayed captions (up or down) to the new base row\n for (var i = 0; i < this.rollUpRows_; i++) {\n this.displayed_[newBaseRow - i] = this.displayed_[this.row_ - i];\n this.displayed_[this.row_ - i] = '';\n }\n }\n\n if (newBaseRow === undefined) {\n newBaseRow = this.row_;\n }\n\n this.topRow_ = newBaseRow - this.rollUpRows_ + 1;\n }; // Adds the opening HTML tag for the passed character to the caption text,\n // and keeps track of it for later closing\n\n\n Cea608Stream.prototype.addFormatting = function (pts, format) {\n this.formatting_ = this.formatting_.concat(format);\n var text = format.reduce(function (text, format) {\n return text + '<' + format + '>';\n }, '');\n this[this.mode_](pts, text);\n }; // Adds HTML closing tags for current formatting to caption text and\n // clears remembered formatting\n\n\n Cea608Stream.prototype.clearFormatting = function (pts) {\n if (!this.formatting_.length) {\n return;\n }\n\n var text = this.formatting_.reverse().reduce(function (text, format) {\n return text + '</' + format + '>';\n }, '');\n this.formatting_ = [];\n this[this.mode_](pts, text);\n }; // Mode Implementations\n\n\n Cea608Stream.prototype.popOn = function (pts, text) {\n var baseRow = this.nonDisplayed_[this.row_]; // buffer characters\n\n baseRow += text;\n this.nonDisplayed_[this.row_] = baseRow;\n };\n\n Cea608Stream.prototype.rollUp = function (pts, text) {\n var baseRow = this.displayed_[this.row_];\n baseRow += text;\n this.displayed_[this.row_] = baseRow;\n };\n\n Cea608Stream.prototype.shiftRowsUp_ = function () {\n var i; // clear out inactive rows\n\n for (i = 0; i < this.topRow_; i++) {\n this.displayed_[i] = '';\n }\n\n for (i = this.row_ + 1; i < BOTTOM_ROW + 1; i++) {\n this.displayed_[i] = '';\n } // shift displayed rows up\n\n\n for (i = this.topRow_; i < this.row_; i++) {\n this.displayed_[i] = this.displayed_[i + 1];\n } // clear out the bottom row\n\n\n this.displayed_[this.row_] = '';\n };\n\n Cea608Stream.prototype.paintOn = function (pts, text) {\n var baseRow = this.displayed_[this.row_];\n baseRow += text;\n this.displayed_[this.row_] = baseRow;\n }; // exports\n\n\n var captionStream = {\n CaptionStream: CaptionStream,\n Cea608Stream: Cea608Stream\n };\n var streamTypes = {\n H264_STREAM_TYPE: 0x1B,\n ADTS_STREAM_TYPE: 0x0F,\n METADATA_STREAM_TYPE: 0x15\n };\n var MAX_TS = 8589934592;\n var RO_THRESH = 4294967296;\n\n var handleRollover = function handleRollover(value, reference) {\n var direction = 1;\n\n if (value > reference) {\n // If the current timestamp value is greater than our reference timestamp and we detect a\n // timestamp rollover, this means the roll over is happening in the opposite direction.\n // Example scenario: Enter a long stream/video just after a rollover occurred. The reference\n // point will be set to a small number, e.g. 1. The user then seeks backwards over the\n // rollover point. In loading this segment, the timestamp values will be very large,\n // e.g. 2^33 - 1. Since this comes before the data we loaded previously, we want to adjust\n // the time stamp to be `value - 2^33`.\n direction = -1;\n } // Note: A seek forwards or back that is greater than the RO_THRESH (2^32, ~13 hours) will\n // cause an incorrect adjustment.\n\n\n while (Math.abs(reference - value) > RO_THRESH) {\n value += direction * MAX_TS;\n }\n\n return value;\n };\n\n var TimestampRolloverStream = function TimestampRolloverStream(type) {\n var lastDTS, referenceDTS;\n TimestampRolloverStream.prototype.init.call(this);\n this.type_ = type;\n\n this.push = function (data) {\n if (data.type !== this.type_) {\n return;\n }\n\n if (referenceDTS === undefined) {\n referenceDTS = data.dts;\n }\n\n data.dts = handleRollover(data.dts, referenceDTS);\n data.pts = handleRollover(data.pts, referenceDTS);\n lastDTS = data.dts;\n this.trigger('data', data);\n };\n\n this.flush = function () {\n referenceDTS = lastDTS;\n this.trigger('done');\n };\n\n this.discontinuity = function () {\n referenceDTS = void 0;\n lastDTS = void 0;\n };\n };\n\n TimestampRolloverStream.prototype = new stream();\n var timestampRolloverStream = {\n TimestampRolloverStream: TimestampRolloverStream,\n handleRollover: handleRollover\n };\n\n var percentEncode = function percentEncode(bytes, start, end) {\n var i,\n result = '';\n\n for (i = start; i < end; i++) {\n result += '%' + ('00' + bytes[i].toString(16)).slice(-2);\n }\n\n return result;\n },\n // return the string representation of the specified byte range,\n // interpreted as UTf-8.\n parseUtf8 = function parseUtf8(bytes, start, end) {\n return decodeURIComponent(percentEncode(bytes, start, end));\n },\n // return the string representation of the specified byte range,\n // interpreted as ISO-8859-1.\n parseIso88591 = function parseIso88591(bytes, start, end) {\n return unescape(percentEncode(bytes, start, end)); // jshint ignore:line\n },\n parseSyncSafeInteger = function parseSyncSafeInteger(data) {\n return data[0] << 21 | data[1] << 14 | data[2] << 7 | data[3];\n },\n tagParsers = {\n TXXX: function TXXX(tag) {\n var i;\n\n if (tag.data[0] !== 3) {\n // ignore frames with unrecognized character encodings\n return;\n }\n\n for (i = 1; i < tag.data.length; i++) {\n if (tag.data[i] === 0) {\n // parse the text fields\n tag.description = parseUtf8(tag.data, 1, i); // do not include the null terminator in the tag value\n\n tag.value = parseUtf8(tag.data, i + 1, tag.data.length).replace(/\\0*$/, '');\n break;\n }\n }\n\n tag.data = tag.value;\n },\n WXXX: function WXXX(tag) {\n var i;\n\n if (tag.data[0] !== 3) {\n // ignore frames with unrecognized character encodings\n return;\n }\n\n for (i = 1; i < tag.data.length; i++) {\n if (tag.data[i] === 0) {\n // parse the description and URL fields\n tag.description = parseUtf8(tag.data, 1, i);\n tag.url = parseUtf8(tag.data, i + 1, tag.data.length);\n break;\n }\n }\n },\n PRIV: function PRIV(tag) {\n var i;\n\n for (i = 0; i < tag.data.length; i++) {\n if (tag.data[i] === 0) {\n // parse the description and URL fields\n tag.owner = parseIso88591(tag.data, 0, i);\n break;\n }\n }\n\n tag.privateData = tag.data.subarray(i + 1);\n tag.data = tag.privateData;\n }\n },\n _MetadataStream;\n\n _MetadataStream = function MetadataStream(options) {\n var settings = {\n debug: !!(options && options.debug),\n // the bytes of the program-level descriptor field in MP2T\n // see ISO/IEC 13818-1:2013 (E), section 2.6 \"Program and\n // program element descriptors\"\n descriptor: options && options.descriptor\n },\n // the total size in bytes of the ID3 tag being parsed\n tagSize = 0,\n // tag data that is not complete enough to be parsed\n buffer = [],\n // the total number of bytes currently in the buffer\n bufferSize = 0,\n i;\n\n _MetadataStream.prototype.init.call(this); // calculate the text track in-band metadata track dispatch type\n // https://html.spec.whatwg.org/multipage/embedded-content.html#steps-to-expose-a-media-resource-specific-text-track\n\n\n this.dispatchType = streamTypes.METADATA_STREAM_TYPE.toString(16);\n\n if (settings.descriptor) {\n for (i = 0; i < settings.descriptor.length; i++) {\n this.dispatchType += ('00' + settings.descriptor[i].toString(16)).slice(-2);\n }\n }\n\n this.push = function (chunk) {\n var tag, frameStart, frameSize, frame, i, frameHeader;\n\n if (chunk.type !== 'timed-metadata') {\n return;\n } // if data_alignment_indicator is set in the PES header,\n // we must have the start of a new ID3 tag. Assume anything\n // remaining in the buffer was malformed and throw it out\n\n\n if (chunk.dataAlignmentIndicator) {\n bufferSize = 0;\n buffer.length = 0;\n } // ignore events that don't look like ID3 data\n\n\n if (buffer.length === 0 && (chunk.data.length < 10 || chunk.data[0] !== 'I'.charCodeAt(0) || chunk.data[1] !== 'D'.charCodeAt(0) || chunk.data[2] !== '3'.charCodeAt(0))) {\n if (settings.debug) {\n // eslint-disable-next-line no-console\n console.log('Skipping unrecognized metadata packet');\n }\n\n return;\n } // add this chunk to the data we've collected so far\n\n\n buffer.push(chunk);\n bufferSize += chunk.data.byteLength; // grab the size of the entire frame from the ID3 header\n\n if (buffer.length === 1) {\n // the frame size is transmitted as a 28-bit integer in the\n // last four bytes of the ID3 header.\n // The most significant bit of each byte is dropped and the\n // results concatenated to recover the actual value.\n tagSize = parseSyncSafeInteger(chunk.data.subarray(6, 10)); // ID3 reports the tag size excluding the header but it's more\n // convenient for our comparisons to include it\n\n tagSize += 10;\n } // if the entire frame has not arrived, wait for more data\n\n\n if (bufferSize < tagSize) {\n return;\n } // collect the entire frame so it can be parsed\n\n\n tag = {\n data: new Uint8Array(tagSize),\n frames: [],\n pts: buffer[0].pts,\n dts: buffer[0].dts\n };\n\n for (i = 0; i < tagSize;) {\n tag.data.set(buffer[0].data.subarray(0, tagSize - i), i);\n i += buffer[0].data.byteLength;\n bufferSize -= buffer[0].data.byteLength;\n buffer.shift();\n } // find the start of the first frame and the end of the tag\n\n\n frameStart = 10;\n\n if (tag.data[5] & 0x40) {\n // advance the frame start past the extended header\n frameStart += 4; // header size field\n\n frameStart += parseSyncSafeInteger(tag.data.subarray(10, 14)); // clip any padding off the end\n\n tagSize -= parseSyncSafeInteger(tag.data.subarray(16, 20));\n } // parse one or more ID3 frames\n // http://id3.org/id3v2.3.0#ID3v2_frame_overview\n\n\n do {\n // determine the number of bytes in this frame\n frameSize = parseSyncSafeInteger(tag.data.subarray(frameStart + 4, frameStart + 8));\n\n if (frameSize < 1) {\n // eslint-disable-next-line no-console\n return console.log('Malformed ID3 frame encountered. Skipping metadata parsing.');\n }\n\n frameHeader = String.fromCharCode(tag.data[frameStart], tag.data[frameStart + 1], tag.data[frameStart + 2], tag.data[frameStart + 3]);\n frame = {\n id: frameHeader,\n data: tag.data.subarray(frameStart + 10, frameStart + frameSize + 10)\n };\n frame.key = frame.id;\n\n if (tagParsers[frame.id]) {\n tagParsers[frame.id](frame); // handle the special PRIV frame used to indicate the start\n // time for raw AAC data\n\n if (frame.owner === 'com.apple.streaming.transportStreamTimestamp') {\n var d = frame.data,\n size = (d[3] & 0x01) << 30 | d[4] << 22 | d[5] << 14 | d[6] << 6 | d[7] >>> 2;\n size *= 4;\n size += d[7] & 0x03;\n frame.timeStamp = size; // in raw AAC, all subsequent data will be timestamped based\n // on the value of this frame\n // we couldn't have known the appropriate pts and dts before\n // parsing this ID3 tag so set those values now\n\n if (tag.pts === undefined && tag.dts === undefined) {\n tag.pts = frame.timeStamp;\n tag.dts = frame.timeStamp;\n }\n\n this.trigger('timestamp', frame);\n }\n }\n\n tag.frames.push(frame);\n frameStart += 10; // advance past the frame header\n\n frameStart += frameSize; // advance past the frame body\n } while (frameStart < tagSize);\n\n this.trigger('data', tag);\n };\n };\n\n _MetadataStream.prototype = new stream();\n var metadataStream = _MetadataStream;\n var TimestampRolloverStream$1 = timestampRolloverStream.TimestampRolloverStream; // object types\n\n var _TransportPacketStream, _TransportParseStream, _ElementaryStream; // constants\n\n\n var MP2T_PACKET_LENGTH = 188,\n // bytes\n SYNC_BYTE = 0x47;\n /**\n * Splits an incoming stream of binary data into MPEG-2 Transport\n * Stream packets.\n */\n\n _TransportPacketStream = function TransportPacketStream() {\n var buffer = new Uint8Array(MP2T_PACKET_LENGTH),\n bytesInBuffer = 0;\n\n _TransportPacketStream.prototype.init.call(this); // Deliver new bytes to the stream.\n\n /**\n * Split a stream of data into M2TS packets\n **/\n\n\n this.push = function (bytes) {\n var startIndex = 0,\n endIndex = MP2T_PACKET_LENGTH,\n everything; // If there are bytes remaining from the last segment, prepend them to the\n // bytes that were pushed in\n\n if (bytesInBuffer) {\n everything = new Uint8Array(bytes.byteLength + bytesInBuffer);\n everything.set(buffer.subarray(0, bytesInBuffer));\n everything.set(bytes, bytesInBuffer);\n bytesInBuffer = 0;\n } else {\n everything = bytes;\n } // While we have enough data for a packet\n\n\n while (endIndex < everything.byteLength) {\n // Look for a pair of start and end sync bytes in the data..\n if (everything[startIndex] === SYNC_BYTE && everything[endIndex] === SYNC_BYTE) {\n // We found a packet so emit it and jump one whole packet forward in\n // the stream\n this.trigger('data', everything.subarray(startIndex, endIndex));\n startIndex += MP2T_PACKET_LENGTH;\n endIndex += MP2T_PACKET_LENGTH;\n continue;\n } // If we get here, we have somehow become de-synchronized and we need to step\n // forward one byte at a time until we find a pair of sync bytes that denote\n // a packet\n\n\n startIndex++;\n endIndex++;\n } // If there was some data left over at the end of the segment that couldn't\n // possibly be a whole packet, keep it because it might be the start of a packet\n // that continues in the next segment\n\n\n if (startIndex < everything.byteLength) {\n buffer.set(everything.subarray(startIndex), 0);\n bytesInBuffer = everything.byteLength - startIndex;\n }\n };\n /**\n * Passes identified M2TS packets to the TransportParseStream to be parsed\n **/\n\n\n this.flush = function () {\n // If the buffer contains a whole packet when we are being flushed, emit it\n // and empty the buffer. Otherwise hold onto the data because it may be\n // important for decoding the next segment\n if (bytesInBuffer === MP2T_PACKET_LENGTH && buffer[0] === SYNC_BYTE) {\n this.trigger('data', buffer);\n bytesInBuffer = 0;\n }\n\n this.trigger('done');\n };\n };\n\n _TransportPacketStream.prototype = new stream();\n /**\n * Accepts an MP2T TransportPacketStream and emits data events with parsed\n * forms of the individual transport stream packets.\n */\n\n _TransportParseStream = function TransportParseStream() {\n var parsePsi, parsePat, parsePmt, self;\n\n _TransportParseStream.prototype.init.call(this);\n\n self = this;\n this.packetsWaitingForPmt = [];\n this.programMapTable = undefined;\n\n parsePsi = function parsePsi(payload, psi) {\n var offset = 0; // PSI packets may be split into multiple sections and those\n // sections may be split into multiple packets. If a PSI\n // section starts in this packet, the payload_unit_start_indicator\n // will be true and the first byte of the payload will indicate\n // the offset from the current position to the start of the\n // section.\n\n if (psi.payloadUnitStartIndicator) {\n offset += payload[offset] + 1;\n }\n\n if (psi.type === 'pat') {\n parsePat(payload.subarray(offset), psi);\n } else {\n parsePmt(payload.subarray(offset), psi);\n }\n };\n\n parsePat = function parsePat(payload, pat) {\n pat.section_number = payload[7]; // eslint-disable-line camelcase\n\n pat.last_section_number = payload[8]; // eslint-disable-line camelcase\n // skip the PSI header and parse the first PMT entry\n\n self.pmtPid = (payload[10] & 0x1F) << 8 | payload[11];\n pat.pmtPid = self.pmtPid;\n };\n /**\n * Parse out the relevant fields of a Program Map Table (PMT).\n * @param payload {Uint8Array} the PMT-specific portion of an MP2T\n * packet. The first byte in this array should be the table_id\n * field.\n * @param pmt {object} the object that should be decorated with\n * fields parsed from the PMT.\n */\n\n\n parsePmt = function parsePmt(payload, pmt) {\n var sectionLength, tableEnd, programInfoLength, offset; // PMTs can be sent ahead of the time when they should actually\n // take effect. We don't believe this should ever be the case\n // for HLS but we'll ignore \"forward\" PMT declarations if we see\n // them. Future PMT declarations have the current_next_indicator\n // set to zero.\n\n if (!(payload[5] & 0x01)) {\n return;\n } // overwrite any existing program map table\n\n\n self.programMapTable = {\n video: null,\n audio: null,\n 'timed-metadata': {}\n }; // the mapping table ends at the end of the current section\n\n sectionLength = (payload[1] & 0x0f) << 8 | payload[2];\n tableEnd = 3 + sectionLength - 4; // to determine where the table is, we have to figure out how\n // long the program info descriptors are\n\n programInfoLength = (payload[10] & 0x0f) << 8 | payload[11]; // advance the offset to the first entry in the mapping table\n\n offset = 12 + programInfoLength;\n\n while (offset < tableEnd) {\n var streamType = payload[offset];\n var pid = (payload[offset + 1] & 0x1F) << 8 | payload[offset + 2]; // only map a single elementary_pid for audio and video stream types\n // TODO: should this be done for metadata too? for now maintain behavior of\n // multiple metadata streams\n\n if (streamType === streamTypes.H264_STREAM_TYPE && self.programMapTable.video === null) {\n self.programMapTable.video = pid;\n } else if (streamType === streamTypes.ADTS_STREAM_TYPE && self.programMapTable.audio === null) {\n self.programMapTable.audio = pid;\n } else if (streamType === streamTypes.METADATA_STREAM_TYPE) {\n // map pid to stream type for metadata streams\n self.programMapTable['timed-metadata'][pid] = streamType;\n } // move to the next table entry\n // skip past the elementary stream descriptors, if present\n\n\n offset += ((payload[offset + 3] & 0x0F) << 8 | payload[offset + 4]) + 5;\n } // record the map on the packet as well\n\n\n pmt.programMapTable = self.programMapTable;\n };\n /**\n * Deliver a new MP2T packet to the next stream in the pipeline.\n */\n\n\n this.push = function (packet) {\n var result = {},\n offset = 4;\n result.payloadUnitStartIndicator = !!(packet[1] & 0x40); // pid is a 13-bit field starting at the last bit of packet[1]\n\n result.pid = packet[1] & 0x1f;\n result.pid <<= 8;\n result.pid |= packet[2]; // if an adaption field is present, its length is specified by the\n // fifth byte of the TS packet header. The adaptation field is\n // used to add stuffing to PES packets that don't fill a complete\n // TS packet, and to specify some forms of timing and control data\n // that we do not currently use.\n\n if ((packet[3] & 0x30) >>> 4 > 0x01) {\n offset += packet[offset] + 1;\n } // parse the rest of the packet based on the type\n\n\n if (result.pid === 0) {\n result.type = 'pat';\n parsePsi(packet.subarray(offset), result);\n this.trigger('data', result);\n } else if (result.pid === this.pmtPid) {\n result.type = 'pmt';\n parsePsi(packet.subarray(offset), result);\n this.trigger('data', result); // if there are any packets waiting for a PMT to be found, process them now\n\n while (this.packetsWaitingForPmt.length) {\n this.processPes_.apply(this, this.packetsWaitingForPmt.shift());\n }\n } else if (this.programMapTable === undefined) {\n // When we have not seen a PMT yet, defer further processing of\n // PES packets until one has been parsed\n this.packetsWaitingForPmt.push([packet, offset, result]);\n } else {\n this.processPes_(packet, offset, result);\n }\n };\n\n this.processPes_ = function (packet, offset, result) {\n // set the appropriate stream type\n if (result.pid === this.programMapTable.video) {\n result.streamType = streamTypes.H264_STREAM_TYPE;\n } else if (result.pid === this.programMapTable.audio) {\n result.streamType = streamTypes.ADTS_STREAM_TYPE;\n } else {\n // if not video or audio, it is timed-metadata or unknown\n // if unknown, streamType will be undefined\n result.streamType = this.programMapTable['timed-metadata'][result.pid];\n }\n\n result.type = 'pes';\n result.data = packet.subarray(offset);\n this.trigger('data', result);\n };\n };\n\n _TransportParseStream.prototype = new stream();\n _TransportParseStream.STREAM_TYPES = {\n h264: 0x1b,\n adts: 0x0f\n };\n /**\n * Reconsistutes program elementary stream (PES) packets from parsed\n * transport stream packets. That is, if you pipe an\n * mp2t.TransportParseStream into a mp2t.ElementaryStream, the output\n * events will be events which capture the bytes for individual PES\n * packets plus relevant metadata that has been extracted from the\n * container.\n */\n\n _ElementaryStream = function ElementaryStream() {\n var self = this,\n // PES packet fragments\n video = {\n data: [],\n size: 0\n },\n audio = {\n data: [],\n size: 0\n },\n timedMetadata = {\n data: [],\n size: 0\n },\n parsePes = function parsePes(payload, pes) {\n var ptsDtsFlags; // get the packet length, this will be 0 for video\n\n pes.packetLength = 6 + (payload[4] << 8 | payload[5]); // find out if this packets starts a new keyframe\n\n pes.dataAlignmentIndicator = (payload[6] & 0x04) !== 0; // PES packets may be annotated with a PTS value, or a PTS value\n // and a DTS value. Determine what combination of values is\n // available to work with.\n\n ptsDtsFlags = payload[7]; // PTS and DTS are normally stored as a 33-bit number. Javascript\n // performs all bitwise operations on 32-bit integers but javascript\n // supports a much greater range (52-bits) of integer using standard\n // mathematical operations.\n // We construct a 31-bit value using bitwise operators over the 31\n // most significant bits and then multiply by 4 (equal to a left-shift\n // of 2) before we add the final 2 least significant bits of the\n // timestamp (equal to an OR.)\n\n if (ptsDtsFlags & 0xC0) {\n // the PTS and DTS are not written out directly. For information\n // on how they are encoded, see\n // http://dvd.sourceforge.net/dvdinfo/pes-hdr.html\n pes.pts = (payload[9] & 0x0E) << 27 | (payload[10] & 0xFF) << 20 | (payload[11] & 0xFE) << 12 | (payload[12] & 0xFF) << 5 | (payload[13] & 0xFE) >>> 3;\n pes.pts *= 4; // Left shift by 2\n\n pes.pts += (payload[13] & 0x06) >>> 1; // OR by the two LSBs\n\n pes.dts = pes.pts;\n\n if (ptsDtsFlags & 0x40) {\n pes.dts = (payload[14] & 0x0E) << 27 | (payload[15] & 0xFF) << 20 | (payload[16] & 0xFE) << 12 | (payload[17] & 0xFF) << 5 | (payload[18] & 0xFE) >>> 3;\n pes.dts *= 4; // Left shift by 2\n\n pes.dts += (payload[18] & 0x06) >>> 1; // OR by the two LSBs\n }\n } // the data section starts immediately after the PES header.\n // pes_header_data_length specifies the number of header bytes\n // that follow the last byte of the field.\n\n\n pes.data = payload.subarray(9 + payload[8]);\n },\n\n /**\n * Pass completely parsed PES packets to the next stream in the pipeline\n **/\n flushStream = function flushStream(stream$$1, type, forceFlush) {\n var packetData = new Uint8Array(stream$$1.size),\n event = {\n type: type\n },\n i = 0,\n offset = 0,\n packetFlushable = false,\n fragment; // do nothing if there is not enough buffered data for a complete\n // PES header\n\n if (!stream$$1.data.length || stream$$1.size < 9) {\n return;\n }\n\n event.trackId = stream$$1.data[0].pid; // reassemble the packet\n\n for (i = 0; i < stream$$1.data.length; i++) {\n fragment = stream$$1.data[i];\n packetData.set(fragment.data, offset);\n offset += fragment.data.byteLength;\n } // parse assembled packet's PES header\n\n\n parsePes(packetData, event); // non-video PES packets MUST have a non-zero PES_packet_length\n // check that there is enough stream data to fill the packet\n\n packetFlushable = type === 'video' || event.packetLength <= stream$$1.size; // flush pending packets if the conditions are right\n\n if (forceFlush || packetFlushable) {\n stream$$1.size = 0;\n stream$$1.data.length = 0;\n } // only emit packets that are complete. this is to avoid assembling\n // incomplete PES packets due to poor segmentation\n\n\n if (packetFlushable) {\n self.trigger('data', event);\n }\n };\n\n _ElementaryStream.prototype.init.call(this);\n /**\n * Identifies M2TS packet types and parses PES packets using metadata\n * parsed from the PMT\n **/\n\n\n this.push = function (data) {\n ({\n pat: function pat() {// we have to wait for the PMT to arrive as well before we\n // have any meaningful metadata\n },\n pes: function pes() {\n var stream$$1, streamType;\n\n switch (data.streamType) {\n case streamTypes.H264_STREAM_TYPE:\n case streamTypes.H264_STREAM_TYPE:\n stream$$1 = video;\n streamType = 'video';\n break;\n\n case streamTypes.ADTS_STREAM_TYPE:\n stream$$1 = audio;\n streamType = 'audio';\n break;\n\n case streamTypes.METADATA_STREAM_TYPE:\n stream$$1 = timedMetadata;\n streamType = 'timed-metadata';\n break;\n\n default:\n // ignore unknown stream types\n return;\n } // if a new packet is starting, we can flush the completed\n // packet\n\n\n if (data.payloadUnitStartIndicator) {\n flushStream(stream$$1, streamType, true);\n } // buffer this fragment until we are sure we've received the\n // complete payload\n\n\n stream$$1.data.push(data);\n stream$$1.size += data.data.byteLength;\n },\n pmt: function pmt() {\n var event = {\n type: 'metadata',\n tracks: []\n },\n programMapTable = data.programMapTable; // translate audio and video streams to tracks\n\n if (programMapTable.video !== null) {\n event.tracks.push({\n timelineStartInfo: {\n baseMediaDecodeTime: 0\n },\n id: +programMapTable.video,\n codec: 'avc',\n type: 'video'\n });\n }\n\n if (programMapTable.audio !== null) {\n event.tracks.push({\n timelineStartInfo: {\n baseMediaDecodeTime: 0\n },\n id: +programMapTable.audio,\n codec: 'adts',\n type: 'audio'\n });\n }\n\n self.trigger('data', event);\n }\n })[data.type]();\n };\n /**\n * Flush any remaining input. Video PES packets may be of variable\n * length. Normally, the start of a new video packet can trigger the\n * finalization of the previous packet. That is not possible if no\n * more video is forthcoming, however. In that case, some other\n * mechanism (like the end of the file) has to be employed. When it is\n * clear that no additional data is forthcoming, calling this method\n * will flush the buffered packets.\n */\n\n\n this.flush = function () {\n // !!THIS ORDER IS IMPORTANT!!\n // video first then audio\n flushStream(video, 'video');\n flushStream(audio, 'audio');\n flushStream(timedMetadata, 'timed-metadata');\n this.trigger('done');\n };\n };\n\n _ElementaryStream.prototype = new stream();\n var m2ts = {\n PAT_PID: 0x0000,\n MP2T_PACKET_LENGTH: MP2T_PACKET_LENGTH,\n TransportPacketStream: _TransportPacketStream,\n TransportParseStream: _TransportParseStream,\n ElementaryStream: _ElementaryStream,\n TimestampRolloverStream: TimestampRolloverStream$1,\n CaptionStream: captionStream.CaptionStream,\n Cea608Stream: captionStream.Cea608Stream,\n MetadataStream: metadataStream\n };\n\n for (var type in streamTypes) {\n if (streamTypes.hasOwnProperty(type)) {\n m2ts[type] = streamTypes[type];\n }\n }\n\n var m2ts_1 = m2ts;\n\n var _AdtsStream;\n\n var ADTS_SAMPLING_FREQUENCIES = [96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350];\n /*\n * Accepts a ElementaryStream and emits data events with parsed\n * AAC Audio Frames of the individual packets. Input audio in ADTS\n * format is unpacked and re-emitted as AAC frames.\n *\n * @see http://wiki.multimedia.cx/index.php?title=ADTS\n * @see http://wiki.multimedia.cx/?title=Understanding_AAC\n */\n\n _AdtsStream = function AdtsStream() {\n var buffer;\n\n _AdtsStream.prototype.init.call(this);\n\n this.push = function (packet) {\n var i = 0,\n frameNum = 0,\n frameLength,\n protectionSkipBytes,\n frameEnd,\n oldBuffer,\n sampleCount,\n adtsFrameDuration;\n\n if (packet.type !== 'audio') {\n // ignore non-audio data\n return;\n } // Prepend any data in the buffer to the input data so that we can parse\n // aac frames the cross a PES packet boundary\n\n\n if (buffer) {\n oldBuffer = buffer;\n buffer = new Uint8Array(oldBuffer.byteLength + packet.data.byteLength);\n buffer.set(oldBuffer);\n buffer.set(packet.data, oldBuffer.byteLength);\n } else {\n buffer = packet.data;\n } // unpack any ADTS frames which have been fully received\n // for details on the ADTS header, see http://wiki.multimedia.cx/index.php?title=ADTS\n\n\n while (i + 5 < buffer.length) {\n // Loook for the start of an ADTS header..\n if (buffer[i] !== 0xFF || (buffer[i + 1] & 0xF6) !== 0xF0) {\n // If a valid header was not found, jump one forward and attempt to\n // find a valid ADTS header starting at the next byte\n i++;\n continue;\n } // The protection skip bit tells us if we have 2 bytes of CRC data at the\n // end of the ADTS header\n\n\n protectionSkipBytes = (~buffer[i + 1] & 0x01) * 2; // Frame length is a 13 bit integer starting 16 bits from the\n // end of the sync sequence\n\n frameLength = (buffer[i + 3] & 0x03) << 11 | buffer[i + 4] << 3 | (buffer[i + 5] & 0xe0) >> 5;\n sampleCount = ((buffer[i + 6] & 0x03) + 1) * 1024;\n adtsFrameDuration = sampleCount * 90000 / ADTS_SAMPLING_FREQUENCIES[(buffer[i + 2] & 0x3c) >>> 2];\n frameEnd = i + frameLength; // If we don't have enough data to actually finish this ADTS frame, return\n // and wait for more data\n\n if (buffer.byteLength < frameEnd) {\n return;\n } // Otherwise, deliver the complete AAC frame\n\n\n this.trigger('data', {\n pts: packet.pts + frameNum * adtsFrameDuration,\n dts: packet.dts + frameNum * adtsFrameDuration,\n sampleCount: sampleCount,\n audioobjecttype: (buffer[i + 2] >>> 6 & 0x03) + 1,\n channelcount: (buffer[i + 2] & 1) << 2 | (buffer[i + 3] & 0xc0) >>> 6,\n samplerate: ADTS_SAMPLING_FREQUENCIES[(buffer[i + 2] & 0x3c) >>> 2],\n samplingfrequencyindex: (buffer[i + 2] & 0x3c) >>> 2,\n // assume ISO/IEC 14496-12 AudioSampleEntry default of 16\n samplesize: 16,\n data: buffer.subarray(i + 7 + protectionSkipBytes, frameEnd)\n }); // If the buffer is empty, clear it and return\n\n if (buffer.byteLength === frameEnd) {\n buffer = undefined;\n return;\n }\n\n frameNum++; // Remove the finished frame from the buffer and start the process again\n\n buffer = buffer.subarray(frameEnd);\n }\n };\n\n this.flush = function () {\n this.trigger('done');\n };\n };\n\n _AdtsStream.prototype = new stream();\n var adts = _AdtsStream;\n var ExpGolomb;\n /**\n * Parser for exponential Golomb codes, a variable-bitwidth number encoding\n * scheme used by h264.\n */\n\n ExpGolomb = function ExpGolomb(workingData) {\n var // the number of bytes left to examine in workingData\n workingBytesAvailable = workingData.byteLength,\n // the current word being examined\n workingWord = 0,\n // :uint\n // the number of bits left to examine in the current word\n workingBitsAvailable = 0; // :uint;\n // ():uint\n\n this.length = function () {\n return 8 * workingBytesAvailable;\n }; // ():uint\n\n\n this.bitsAvailable = function () {\n return 8 * workingBytesAvailable + workingBitsAvailable;\n }; // ():void\n\n\n this.loadWord = function () {\n var position = workingData.byteLength - workingBytesAvailable,\n workingBytes = new Uint8Array(4),\n availableBytes = Math.min(4, workingBytesAvailable);\n\n if (availableBytes === 0) {\n throw new Error('no bytes available');\n }\n\n workingBytes.set(workingData.subarray(position, position + availableBytes));\n workingWord = new DataView(workingBytes.buffer).getUint32(0); // track the amount of workingData that has been processed\n\n workingBitsAvailable = availableBytes * 8;\n workingBytesAvailable -= availableBytes;\n }; // (count:int):void\n\n\n this.skipBits = function (count) {\n var skipBytes; // :int\n\n if (workingBitsAvailable > count) {\n workingWord <<= count;\n workingBitsAvailable -= count;\n } else {\n count -= workingBitsAvailable;\n skipBytes = Math.floor(count / 8);\n count -= skipBytes * 8;\n workingBytesAvailable -= skipBytes;\n this.loadWord();\n workingWord <<= count;\n workingBitsAvailable -= count;\n }\n }; // (size:int):uint\n\n\n this.readBits = function (size) {\n var bits = Math.min(workingBitsAvailable, size),\n // :uint\n valu = workingWord >>> 32 - bits; // :uint\n // if size > 31, handle error\n\n workingBitsAvailable -= bits;\n\n if (workingBitsAvailable > 0) {\n workingWord <<= bits;\n } else if (workingBytesAvailable > 0) {\n this.loadWord();\n }\n\n bits = size - bits;\n\n if (bits > 0) {\n return valu << bits | this.readBits(bits);\n }\n\n return valu;\n }; // ():uint\n\n\n this.skipLeadingZeros = function () {\n var leadingZeroCount; // :uint\n\n for (leadingZeroCount = 0; leadingZeroCount < workingBitsAvailable; ++leadingZeroCount) {\n if ((workingWord & 0x80000000 >>> leadingZeroCount) !== 0) {\n // the first bit of working word is 1\n workingWord <<= leadingZeroCount;\n workingBitsAvailable -= leadingZeroCount;\n return leadingZeroCount;\n }\n } // we exhausted workingWord and still have not found a 1\n\n\n this.loadWord();\n return leadingZeroCount + this.skipLeadingZeros();\n }; // ():void\n\n\n this.skipUnsignedExpGolomb = function () {\n this.skipBits(1 + this.skipLeadingZeros());\n }; // ():void\n\n\n this.skipExpGolomb = function () {\n this.skipBits(1 + this.skipLeadingZeros());\n }; // ():uint\n\n\n this.readUnsignedExpGolomb = function () {\n var clz = this.skipLeadingZeros(); // :uint\n\n return this.readBits(clz + 1) - 1;\n }; // ():int\n\n\n this.readExpGolomb = function () {\n var valu = this.readUnsignedExpGolomb(); // :int\n\n if (0x01 & valu) {\n // the number is odd if the low order bit is set\n return 1 + valu >>> 1; // add 1 to make it even, and divide by 2\n }\n\n return -1 * (valu >>> 1); // divide by two then make it negative\n }; // Some convenience functions\n // :Boolean\n\n\n this.readBoolean = function () {\n return this.readBits(1) === 1;\n }; // ():int\n\n\n this.readUnsignedByte = function () {\n return this.readBits(8);\n };\n\n this.loadWord();\n };\n\n var expGolomb = ExpGolomb;\n\n var _H264Stream, _NalByteStream;\n\n var PROFILES_WITH_OPTIONAL_SPS_DATA;\n /**\n * Accepts a NAL unit byte stream and unpacks the embedded NAL units.\n */\n\n _NalByteStream = function NalByteStream() {\n var syncPoint = 0,\n i,\n buffer;\n\n _NalByteStream.prototype.init.call(this);\n /*\n * Scans a byte stream and triggers a data event with the NAL units found.\n * @param {Object} data Event received from H264Stream\n * @param {Uint8Array} data.data The h264 byte stream to be scanned\n *\n * @see H264Stream.push\n */\n\n\n this.push = function (data) {\n var swapBuffer;\n\n if (!buffer) {\n buffer = data.data;\n } else {\n swapBuffer = new Uint8Array(buffer.byteLength + data.data.byteLength);\n swapBuffer.set(buffer);\n swapBuffer.set(data.data, buffer.byteLength);\n buffer = swapBuffer;\n } // Rec. ITU-T H.264, Annex B\n // scan for NAL unit boundaries\n // a match looks like this:\n // 0 0 1 .. NAL .. 0 0 1\n // ^ sync point ^ i\n // or this:\n // 0 0 1 .. NAL .. 0 0 0\n // ^ sync point ^ i\n // advance the sync point to a NAL start, if necessary\n\n\n for (; syncPoint < buffer.byteLength - 3; syncPoint++) {\n if (buffer[syncPoint + 2] === 1) {\n // the sync point is properly aligned\n i = syncPoint + 5;\n break;\n }\n }\n\n while (i < buffer.byteLength) {\n // look at the current byte to determine if we've hit the end of\n // a NAL unit boundary\n switch (buffer[i]) {\n case 0:\n // skip past non-sync sequences\n if (buffer[i - 1] !== 0) {\n i += 2;\n break;\n } else if (buffer[i - 2] !== 0) {\n i++;\n break;\n } // deliver the NAL unit if it isn't empty\n\n\n if (syncPoint + 3 !== i - 2) {\n this.trigger('data', buffer.subarray(syncPoint + 3, i - 2));\n } // drop trailing zeroes\n\n\n do {\n i++;\n } while (buffer[i] !== 1 && i < buffer.length);\n\n syncPoint = i - 2;\n i += 3;\n break;\n\n case 1:\n // skip past non-sync sequences\n if (buffer[i - 1] !== 0 || buffer[i - 2] !== 0) {\n i += 3;\n break;\n } // deliver the NAL unit\n\n\n this.trigger('data', buffer.subarray(syncPoint + 3, i - 2));\n syncPoint = i - 2;\n i += 3;\n break;\n\n default:\n // the current byte isn't a one or zero, so it cannot be part\n // of a sync sequence\n i += 3;\n break;\n }\n } // filter out the NAL units that were delivered\n\n\n buffer = buffer.subarray(syncPoint);\n i -= syncPoint;\n syncPoint = 0;\n };\n\n this.flush = function () {\n // deliver the last buffered NAL unit\n if (buffer && buffer.byteLength > 3) {\n this.trigger('data', buffer.subarray(syncPoint + 3));\n } // reset the stream state\n\n\n buffer = null;\n syncPoint = 0;\n this.trigger('done');\n };\n };\n\n _NalByteStream.prototype = new stream(); // values of profile_idc that indicate additional fields are included in the SPS\n // see Recommendation ITU-T H.264 (4/2013),\n // 7.3.2.1.1 Sequence parameter set data syntax\n\n PROFILES_WITH_OPTIONAL_SPS_DATA = {\n 100: true,\n 110: true,\n 122: true,\n 244: true,\n 44: true,\n 83: true,\n 86: true,\n 118: true,\n 128: true,\n 138: true,\n 139: true,\n 134: true\n };\n /**\n * Accepts input from a ElementaryStream and produces H.264 NAL unit data\n * events.\n */\n\n _H264Stream = function H264Stream() {\n var nalByteStream = new _NalByteStream(),\n self,\n trackId,\n currentPts,\n currentDts,\n discardEmulationPreventionBytes,\n readSequenceParameterSet,\n skipScalingList;\n\n _H264Stream.prototype.init.call(this);\n\n self = this;\n /*\n * Pushes a packet from a stream onto the NalByteStream\n *\n * @param {Object} packet - A packet received from a stream\n * @param {Uint8Array} packet.data - The raw bytes of the packet\n * @param {Number} packet.dts - Decode timestamp of the packet\n * @param {Number} packet.pts - Presentation timestamp of the packet\n * @param {Number} packet.trackId - The id of the h264 track this packet came from\n * @param {('video'|'audio')} packet.type - The type of packet\n *\n */\n\n this.push = function (packet) {\n if (packet.type !== 'video') {\n return;\n }\n\n trackId = packet.trackId;\n currentPts = packet.pts;\n currentDts = packet.dts;\n nalByteStream.push(packet);\n };\n /*\n * Identify NAL unit types and pass on the NALU, trackId, presentation and decode timestamps\n * for the NALUs to the next stream component.\n * Also, preprocess caption and sequence parameter NALUs.\n *\n * @param {Uint8Array} data - A NAL unit identified by `NalByteStream.push`\n * @see NalByteStream.push\n */\n\n\n nalByteStream.on('data', function (data) {\n var event = {\n trackId: trackId,\n pts: currentPts,\n dts: currentDts,\n data: data\n };\n\n switch (data[0] & 0x1f) {\n case 0x05:\n event.nalUnitType = 'slice_layer_without_partitioning_rbsp_idr';\n break;\n\n case 0x06:\n event.nalUnitType = 'sei_rbsp';\n event.escapedRBSP = discardEmulationPreventionBytes(data.subarray(1));\n break;\n\n case 0x07:\n event.nalUnitType = 'seq_parameter_set_rbsp';\n event.escapedRBSP = discardEmulationPreventionBytes(data.subarray(1));\n event.config = readSequenceParameterSet(event.escapedRBSP);\n break;\n\n case 0x08:\n event.nalUnitType = 'pic_parameter_set_rbsp';\n break;\n\n case 0x09:\n event.nalUnitType = 'access_unit_delimiter_rbsp';\n break;\n\n default:\n break;\n } // This triggers data on the H264Stream\n\n\n self.trigger('data', event);\n });\n nalByteStream.on('done', function () {\n self.trigger('done');\n });\n\n this.flush = function () {\n nalByteStream.flush();\n };\n /**\n * Advance the ExpGolomb decoder past a scaling list. The scaling\n * list is optionally transmitted as part of a sequence parameter\n * set and is not relevant to transmuxing.\n * @param count {number} the number of entries in this scaling list\n * @param expGolombDecoder {object} an ExpGolomb pointed to the\n * start of a scaling list\n * @see Recommendation ITU-T H.264, Section 7.3.2.1.1.1\n */\n\n\n skipScalingList = function skipScalingList(count, expGolombDecoder) {\n var lastScale = 8,\n nextScale = 8,\n j,\n deltaScale;\n\n for (j = 0; j < count; j++) {\n if (nextScale !== 0) {\n deltaScale = expGolombDecoder.readExpGolomb();\n nextScale = (lastScale + deltaScale + 256) % 256;\n }\n\n lastScale = nextScale === 0 ? lastScale : nextScale;\n }\n };\n /**\n * Expunge any \"Emulation Prevention\" bytes from a \"Raw Byte\n * Sequence Payload\"\n * @param data {Uint8Array} the bytes of a RBSP from a NAL\n * unit\n * @return {Uint8Array} the RBSP without any Emulation\n * Prevention Bytes\n */\n\n\n discardEmulationPreventionBytes = function discardEmulationPreventionBytes(data) {\n var length = data.byteLength,\n emulationPreventionBytesPositions = [],\n i = 1,\n newLength,\n newData; // Find all `Emulation Prevention Bytes`\n\n while (i < length - 2) {\n if (data[i] === 0 && data[i + 1] === 0 && data[i + 2] === 0x03) {\n emulationPreventionBytesPositions.push(i + 2);\n i += 2;\n } else {\n i++;\n }\n } // If no Emulation Prevention Bytes were found just return the original\n // array\n\n\n if (emulationPreventionBytesPositions.length === 0) {\n return data;\n } // Create a new array to hold the NAL unit data\n\n\n newLength = length - emulationPreventionBytesPositions.length;\n newData = new Uint8Array(newLength);\n var sourceIndex = 0;\n\n for (i = 0; i < newLength; sourceIndex++, i++) {\n if (sourceIndex === emulationPreventionBytesPositions[0]) {\n // Skip this byte\n sourceIndex++; // Remove this position index\n\n emulationPreventionBytesPositions.shift();\n }\n\n newData[i] = data[sourceIndex];\n }\n\n return newData;\n };\n /**\n * Read a sequence parameter set and return some interesting video\n * properties. A sequence parameter set is the H264 metadata that\n * describes the properties of upcoming video frames.\n * @param data {Uint8Array} the bytes of a sequence parameter set\n * @return {object} an object with configuration parsed from the\n * sequence parameter set, including the dimensions of the\n * associated video frames.\n */\n\n\n readSequenceParameterSet = function readSequenceParameterSet(data) {\n var frameCropLeftOffset = 0,\n frameCropRightOffset = 0,\n frameCropTopOffset = 0,\n frameCropBottomOffset = 0,\n sarScale = 1,\n expGolombDecoder,\n profileIdc,\n levelIdc,\n profileCompatibility,\n chromaFormatIdc,\n picOrderCntType,\n numRefFramesInPicOrderCntCycle,\n picWidthInMbsMinus1,\n picHeightInMapUnitsMinus1,\n frameMbsOnlyFlag,\n scalingListCount,\n sarRatio,\n aspectRatioIdc,\n i;\n expGolombDecoder = new expGolomb(data);\n profileIdc = expGolombDecoder.readUnsignedByte(); // profile_idc\n\n profileCompatibility = expGolombDecoder.readUnsignedByte(); // constraint_set[0-5]_flag\n\n levelIdc = expGolombDecoder.readUnsignedByte(); // level_idc u(8)\n\n expGolombDecoder.skipUnsignedExpGolomb(); // seq_parameter_set_id\n // some profiles have more optional data we don't need\n\n if (PROFILES_WITH_OPTIONAL_SPS_DATA[profileIdc]) {\n chromaFormatIdc = expGolombDecoder.readUnsignedExpGolomb();\n\n if (chromaFormatIdc === 3) {\n expGolombDecoder.skipBits(1); // separate_colour_plane_flag\n }\n\n expGolombDecoder.skipUnsignedExpGolomb(); // bit_depth_luma_minus8\n\n expGolombDecoder.skipUnsignedExpGolomb(); // bit_depth_chroma_minus8\n\n expGolombDecoder.skipBits(1); // qpprime_y_zero_transform_bypass_flag\n\n if (expGolombDecoder.readBoolean()) {\n // seq_scaling_matrix_present_flag\n scalingListCount = chromaFormatIdc !== 3 ? 8 : 12;\n\n for (i = 0; i < scalingListCount; i++) {\n if (expGolombDecoder.readBoolean()) {\n // seq_scaling_list_present_flag[ i ]\n if (i < 6) {\n skipScalingList(16, expGolombDecoder);\n } else {\n skipScalingList(64, expGolombDecoder);\n }\n }\n }\n }\n }\n\n expGolombDecoder.skipUnsignedExpGolomb(); // log2_max_frame_num_minus4\n\n picOrderCntType = expGolombDecoder.readUnsignedExpGolomb();\n\n if (picOrderCntType === 0) {\n expGolombDecoder.readUnsignedExpGolomb(); // log2_max_pic_order_cnt_lsb_minus4\n } else if (picOrderCntType === 1) {\n expGolombDecoder.skipBits(1); // delta_pic_order_always_zero_flag\n\n expGolombDecoder.skipExpGolomb(); // offset_for_non_ref_pic\n\n expGolombDecoder.skipExpGolomb(); // offset_for_top_to_bottom_field\n\n numRefFramesInPicOrderCntCycle = expGolombDecoder.readUnsignedExpGolomb();\n\n for (i = 0; i < numRefFramesInPicOrderCntCycle; i++) {\n expGolombDecoder.skipExpGolomb(); // offset_for_ref_frame[ i ]\n }\n }\n\n expGolombDecoder.skipUnsignedExpGolomb(); // max_num_ref_frames\n\n expGolombDecoder.skipBits(1); // gaps_in_frame_num_value_allowed_flag\n\n picWidthInMbsMinus1 = expGolombDecoder.readUnsignedExpGolomb();\n picHeightInMapUnitsMinus1 = expGolombDecoder.readUnsignedExpGolomb();\n frameMbsOnlyFlag = expGolombDecoder.readBits(1);\n\n if (frameMbsOnlyFlag === 0) {\n expGolombDecoder.skipBits(1); // mb_adaptive_frame_field_flag\n }\n\n expGolombDecoder.skipBits(1); // direct_8x8_inference_flag\n\n if (expGolombDecoder.readBoolean()) {\n // frame_cropping_flag\n frameCropLeftOffset = expGolombDecoder.readUnsignedExpGolomb();\n frameCropRightOffset = expGolombDecoder.readUnsignedExpGolomb();\n frameCropTopOffset = expGolombDecoder.readUnsignedExpGolomb();\n frameCropBottomOffset = expGolombDecoder.readUnsignedExpGolomb();\n }\n\n if (expGolombDecoder.readBoolean()) {\n // vui_parameters_present_flag\n if (expGolombDecoder.readBoolean()) {\n // aspect_ratio_info_present_flag\n aspectRatioIdc = expGolombDecoder.readUnsignedByte();\n\n switch (aspectRatioIdc) {\n case 1:\n sarRatio = [1, 1];\n break;\n\n case 2:\n sarRatio = [12, 11];\n break;\n\n case 3:\n sarRatio = [10, 11];\n break;\n\n case 4:\n sarRatio = [16, 11];\n break;\n\n case 5:\n sarRatio = [40, 33];\n break;\n\n case 6:\n sarRatio = [24, 11];\n break;\n\n case 7:\n sarRatio = [20, 11];\n break;\n\n case 8:\n sarRatio = [32, 11];\n break;\n\n case 9:\n sarRatio = [80, 33];\n break;\n\n case 10:\n sarRatio = [18, 11];\n break;\n\n case 11:\n sarRatio = [15, 11];\n break;\n\n case 12:\n sarRatio = [64, 33];\n break;\n\n case 13:\n sarRatio = [160, 99];\n break;\n\n case 14:\n sarRatio = [4, 3];\n break;\n\n case 15:\n sarRatio = [3, 2];\n break;\n\n case 16:\n sarRatio = [2, 1];\n break;\n\n case 255:\n {\n sarRatio = [expGolombDecoder.readUnsignedByte() << 8 | expGolombDecoder.readUnsignedByte(), expGolombDecoder.readUnsignedByte() << 8 | expGolombDecoder.readUnsignedByte()];\n break;\n }\n }\n\n if (sarRatio) {\n sarScale = sarRatio[0] / sarRatio[1];\n }\n }\n }\n\n return {\n profileIdc: profileIdc,\n levelIdc: levelIdc,\n profileCompatibility: profileCompatibility,\n width: Math.ceil(((picWidthInMbsMinus1 + 1) * 16 - frameCropLeftOffset * 2 - frameCropRightOffset * 2) * sarScale),\n height: (2 - frameMbsOnlyFlag) * (picHeightInMapUnitsMinus1 + 1) * 16 - frameCropTopOffset * 2 - frameCropBottomOffset * 2\n };\n };\n };\n\n _H264Stream.prototype = new stream();\n var h264 = {\n H264Stream: _H264Stream,\n NalByteStream: _NalByteStream\n };\n /**\n * mux.js\n *\n * Copyright (c) 2016 Brightcove\n * All rights reserved.\n *\n * Utilities to detect basic properties and metadata about Aac data.\n */\n\n var ADTS_SAMPLING_FREQUENCIES$1 = [96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350];\n\n var isLikelyAacData = function isLikelyAacData(data) {\n if (data[0] === 'I'.charCodeAt(0) && data[1] === 'D'.charCodeAt(0) && data[2] === '3'.charCodeAt(0)) {\n return true;\n }\n\n return false;\n };\n\n var parseSyncSafeInteger$1 = function parseSyncSafeInteger(data) {\n return data[0] << 21 | data[1] << 14 | data[2] << 7 | data[3];\n }; // return a percent-encoded representation of the specified byte range\n // @see http://en.wikipedia.org/wiki/Percent-encoding\n\n\n var percentEncode$1 = function percentEncode(bytes, start, end) {\n var i,\n result = '';\n\n for (i = start; i < end; i++) {\n result += '%' + ('00' + bytes[i].toString(16)).slice(-2);\n }\n\n return result;\n }; // return the string representation of the specified byte range,\n // interpreted as ISO-8859-1.\n\n\n var parseIso88591$1 = function parseIso88591(bytes, start, end) {\n return unescape(percentEncode$1(bytes, start, end)); // jshint ignore:line\n };\n\n var parseId3TagSize = function parseId3TagSize(header, byteIndex) {\n var returnSize = header[byteIndex + 6] << 21 | header[byteIndex + 7] << 14 | header[byteIndex + 8] << 7 | header[byteIndex + 9],\n flags = header[byteIndex + 5],\n footerPresent = (flags & 16) >> 4;\n\n if (footerPresent) {\n return returnSize + 20;\n }\n\n return returnSize + 10;\n };\n\n var parseAdtsSize = function parseAdtsSize(header, byteIndex) {\n var lowThree = (header[byteIndex + 5] & 0xE0) >> 5,\n middle = header[byteIndex + 4] << 3,\n highTwo = header[byteIndex + 3] & 0x3 << 11;\n return highTwo | middle | lowThree;\n };\n\n var parseType$1 = function parseType(header, byteIndex) {\n if (header[byteIndex] === 'I'.charCodeAt(0) && header[byteIndex + 1] === 'D'.charCodeAt(0) && header[byteIndex + 2] === '3'.charCodeAt(0)) {\n return 'timed-metadata';\n } else if (header[byteIndex] & 0xff === 0xff && (header[byteIndex + 1] & 0xf0) === 0xf0) {\n return 'audio';\n }\n\n return null;\n };\n\n var parseSampleRate = function parseSampleRate(packet) {\n var i = 0;\n\n while (i + 5 < packet.length) {\n if (packet[i] !== 0xFF || (packet[i + 1] & 0xF6) !== 0xF0) {\n // If a valid header was not found, jump one forward and attempt to\n // find a valid ADTS header starting at the next byte\n i++;\n continue;\n }\n\n return ADTS_SAMPLING_FREQUENCIES$1[(packet[i + 2] & 0x3c) >>> 2];\n }\n\n return null;\n };\n\n var parseAacTimestamp = function parseAacTimestamp(packet) {\n var frameStart, frameSize, frame, frameHeader; // find the start of the first frame and the end of the tag\n\n frameStart = 10;\n\n if (packet[5] & 0x40) {\n // advance the frame start past the extended header\n frameStart += 4; // header size field\n\n frameStart += parseSyncSafeInteger$1(packet.subarray(10, 14));\n } // parse one or more ID3 frames\n // http://id3.org/id3v2.3.0#ID3v2_frame_overview\n\n\n do {\n // determine the number of bytes in this frame\n frameSize = parseSyncSafeInteger$1(packet.subarray(frameStart + 4, frameStart + 8));\n\n if (frameSize < 1) {\n return null;\n }\n\n frameHeader = String.fromCharCode(packet[frameStart], packet[frameStart + 1], packet[frameStart + 2], packet[frameStart + 3]);\n\n if (frameHeader === 'PRIV') {\n frame = packet.subarray(frameStart + 10, frameStart + frameSize + 10);\n\n for (var i = 0; i < frame.byteLength; i++) {\n if (frame[i] === 0) {\n var owner = parseIso88591$1(frame, 0, i);\n\n if (owner === 'com.apple.streaming.transportStreamTimestamp') {\n var d = frame.subarray(i + 1);\n var size = (d[3] & 0x01) << 30 | d[4] << 22 | d[5] << 14 | d[6] << 6 | d[7] >>> 2;\n size *= 4;\n size += d[7] & 0x03;\n return size;\n }\n\n break;\n }\n }\n }\n\n frameStart += 10; // advance past the frame header\n\n frameStart += frameSize; // advance past the frame body\n } while (frameStart < packet.byteLength);\n\n return null;\n };\n\n var utils = {\n isLikelyAacData: isLikelyAacData,\n parseId3TagSize: parseId3TagSize,\n parseAdtsSize: parseAdtsSize,\n parseType: parseType$1,\n parseSampleRate: parseSampleRate,\n parseAacTimestamp: parseAacTimestamp\n }; // Constants\n\n var _AacStream;\n /**\n * Splits an incoming stream of binary data into ADTS and ID3 Frames.\n */\n\n\n _AacStream = function AacStream() {\n var everything = new Uint8Array(),\n timeStamp = 0;\n\n _AacStream.prototype.init.call(this);\n\n this.setTimestamp = function (timestamp) {\n timeStamp = timestamp;\n };\n\n this.push = function (bytes) {\n var frameSize = 0,\n byteIndex = 0,\n bytesLeft,\n chunk,\n packet,\n tempLength; // If there are bytes remaining from the last segment, prepend them to the\n // bytes that were pushed in\n\n if (everything.length) {\n tempLength = everything.length;\n everything = new Uint8Array(bytes.byteLength + tempLength);\n everything.set(everything.subarray(0, tempLength));\n everything.set(bytes, tempLength);\n } else {\n everything = bytes;\n }\n\n while (everything.length - byteIndex >= 3) {\n if (everything[byteIndex] === 'I'.charCodeAt(0) && everything[byteIndex + 1] === 'D'.charCodeAt(0) && everything[byteIndex + 2] === '3'.charCodeAt(0)) {\n // Exit early because we don't have enough to parse\n // the ID3 tag header\n if (everything.length - byteIndex < 10) {\n break;\n } // check framesize\n\n\n frameSize = utils.parseId3TagSize(everything, byteIndex); // Exit early if we don't have enough in the buffer\n // to emit a full packet\n // Add to byteIndex to support multiple ID3 tags in sequence\n\n if (byteIndex + frameSize > everything.length) {\n break;\n }\n\n chunk = {\n type: 'timed-metadata',\n data: everything.subarray(byteIndex, byteIndex + frameSize)\n };\n this.trigger('data', chunk);\n byteIndex += frameSize;\n continue;\n } else if ((everything[byteIndex] & 0xff) === 0xff && (everything[byteIndex + 1] & 0xf0) === 0xf0) {\n // Exit early because we don't have enough to parse\n // the ADTS frame header\n if (everything.length - byteIndex < 7) {\n break;\n }\n\n frameSize = utils.parseAdtsSize(everything, byteIndex); // Exit early if we don't have enough in the buffer\n // to emit a full packet\n\n if (byteIndex + frameSize > everything.length) {\n break;\n }\n\n packet = {\n type: 'audio',\n data: everything.subarray(byteIndex, byteIndex + frameSize),\n pts: timeStamp,\n dts: timeStamp\n };\n this.trigger('data', packet);\n byteIndex += frameSize;\n continue;\n }\n\n byteIndex++;\n }\n\n bytesLeft = everything.length - byteIndex;\n\n if (bytesLeft > 0) {\n everything = everything.subarray(byteIndex);\n } else {\n everything = new Uint8Array();\n }\n };\n };\n\n _AacStream.prototype = new stream();\n var aac = _AacStream;\n var H264Stream = h264.H264Stream;\n var isLikelyAacData$1 = utils.isLikelyAacData; // constants\n\n var AUDIO_PROPERTIES = ['audioobjecttype', 'channelcount', 'samplerate', 'samplingfrequencyindex', 'samplesize'];\n var VIDEO_PROPERTIES = ['width', 'height', 'profileIdc', 'levelIdc', 'profileCompatibility']; // object types\n\n var _VideoSegmentStream, _AudioSegmentStream, _Transmuxer, _CoalesceStream;\n /**\n * Compare two arrays (even typed) for same-ness\n */\n\n\n var arrayEquals = function arrayEquals(a, b) {\n var i;\n\n if (a.length !== b.length) {\n return false;\n } // compare the value of each element in the array\n\n\n for (i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n\n return true;\n };\n /**\n * Constructs a single-track, ISO BMFF media segment from AAC data\n * events. The output of this stream can be fed to a SourceBuffer\n * configured with a suitable initialization segment.\n * @param track {object} track metadata configuration\n * @param options {object} transmuxer options object\n * @param options.keepOriginalTimestamps {boolean} If true, keep the timestamps\n * in the source; false to adjust the first segment to start at 0.\n */\n\n\n _AudioSegmentStream = function AudioSegmentStream(track, options) {\n var adtsFrames = [],\n sequenceNumber = 0,\n earliestAllowedDts = 0,\n audioAppendStartTs = 0,\n videoBaseMediaDecodeTime = Infinity;\n options = options || {};\n\n _AudioSegmentStream.prototype.init.call(this);\n\n this.push = function (data) {\n trackDecodeInfo.collectDtsInfo(track, data);\n\n if (track) {\n AUDIO_PROPERTIES.forEach(function (prop) {\n track[prop] = data[prop];\n });\n } // buffer audio data until end() is called\n\n\n adtsFrames.push(data);\n };\n\n this.setEarliestDts = function (earliestDts) {\n earliestAllowedDts = earliestDts - track.timelineStartInfo.baseMediaDecodeTime;\n };\n\n this.setVideoBaseMediaDecodeTime = function (baseMediaDecodeTime) {\n videoBaseMediaDecodeTime = baseMediaDecodeTime;\n };\n\n this.setAudioAppendStart = function (timestamp) {\n audioAppendStartTs = timestamp;\n };\n\n this.flush = function () {\n var frames, moof, mdat, boxes; // return early if no audio data has been observed\n\n if (adtsFrames.length === 0) {\n this.trigger('done', 'AudioSegmentStream');\n return;\n }\n\n frames = audioFrameUtils.trimAdtsFramesByEarliestDts(adtsFrames, track, earliestAllowedDts);\n track.baseMediaDecodeTime = trackDecodeInfo.calculateTrackBaseMediaDecodeTime(track, options.keepOriginalTimestamps);\n audioFrameUtils.prefixWithSilence(track, frames, audioAppendStartTs, videoBaseMediaDecodeTime); // we have to build the index from byte locations to\n // samples (that is, adts frames) in the audio data\n\n track.samples = audioFrameUtils.generateSampleTable(frames); // concatenate the audio data to constuct the mdat\n\n mdat = mp4Generator.mdat(audioFrameUtils.concatenateFrameData(frames));\n adtsFrames = [];\n moof = mp4Generator.moof(sequenceNumber, [track]);\n boxes = new Uint8Array(moof.byteLength + mdat.byteLength); // bump the sequence number for next time\n\n sequenceNumber++;\n boxes.set(moof);\n boxes.set(mdat, moof.byteLength);\n trackDecodeInfo.clearDtsInfo(track);\n this.trigger('data', {\n track: track,\n boxes: boxes\n });\n this.trigger('done', 'AudioSegmentStream');\n };\n };\n\n _AudioSegmentStream.prototype = new stream();\n /**\n * Constructs a single-track, ISO BMFF media segment from H264 data\n * events. The output of this stream can be fed to a SourceBuffer\n * configured with a suitable initialization segment.\n * @param track {object} track metadata configuration\n * @param options {object} transmuxer options object\n * @param options.alignGopsAtEnd {boolean} If true, start from the end of the\n * gopsToAlignWith list when attempting to align gop pts\n * @param options.keepOriginalTimestamps {boolean} If true, keep the timestamps\n * in the source; false to adjust the first segment to start at 0.\n */\n\n _VideoSegmentStream = function VideoSegmentStream(track, options) {\n var sequenceNumber = 0,\n nalUnits = [],\n gopsToAlignWith = [],\n config,\n pps;\n options = options || {};\n\n _VideoSegmentStream.prototype.init.call(this);\n\n delete track.minPTS;\n this.gopCache_ = [];\n /**\n * Constructs a ISO BMFF segment given H264 nalUnits\n * @param {Object} nalUnit A data event representing a nalUnit\n * @param {String} nalUnit.nalUnitType\n * @param {Object} nalUnit.config Properties for a mp4 track\n * @param {Uint8Array} nalUnit.data The nalUnit bytes\n * @see lib/codecs/h264.js\n **/\n\n this.push = function (nalUnit) {\n trackDecodeInfo.collectDtsInfo(track, nalUnit); // record the track config\n\n if (nalUnit.nalUnitType === 'seq_parameter_set_rbsp' && !config) {\n config = nalUnit.config;\n track.sps = [nalUnit.data];\n VIDEO_PROPERTIES.forEach(function (prop) {\n track[prop] = config[prop];\n }, this);\n }\n\n if (nalUnit.nalUnitType === 'pic_parameter_set_rbsp' && !pps) {\n pps = nalUnit.data;\n track.pps = [nalUnit.data];\n } // buffer video until flush() is called\n\n\n nalUnits.push(nalUnit);\n };\n /**\n * Pass constructed ISO BMFF track and boxes on to the\n * next stream in the pipeline\n **/\n\n\n this.flush = function () {\n var frames, gopForFusion, gops, moof, mdat, boxes; // Throw away nalUnits at the start of the byte stream until\n // we find the first AUD\n\n while (nalUnits.length) {\n if (nalUnits[0].nalUnitType === 'access_unit_delimiter_rbsp') {\n break;\n }\n\n nalUnits.shift();\n } // Return early if no video data has been observed\n\n\n if (nalUnits.length === 0) {\n this.resetStream_();\n this.trigger('done', 'VideoSegmentStream');\n return;\n } // Organize the raw nal-units into arrays that represent\n // higher-level constructs such as frames and gops\n // (group-of-pictures)\n\n\n frames = frameUtils.groupNalsIntoFrames(nalUnits);\n gops = frameUtils.groupFramesIntoGops(frames); // If the first frame of this fragment is not a keyframe we have\n // a problem since MSE (on Chrome) requires a leading keyframe.\n //\n // We have two approaches to repairing this situation:\n // 1) GOP-FUSION:\n // This is where we keep track of the GOPS (group-of-pictures)\n // from previous fragments and attempt to find one that we can\n // prepend to the current fragment in order to create a valid\n // fragment.\n // 2) KEYFRAME-PULLING:\n // Here we search for the first keyframe in the fragment and\n // throw away all the frames between the start of the fragment\n // and that keyframe. We then extend the duration and pull the\n // PTS of the keyframe forward so that it covers the time range\n // of the frames that were disposed of.\n //\n // #1 is far prefereable over #2 which can cause \"stuttering\" but\n // requires more things to be just right.\n\n if (!gops[0][0].keyFrame) {\n // Search for a gop for fusion from our gopCache\n gopForFusion = this.getGopForFusion_(nalUnits[0], track);\n\n if (gopForFusion) {\n gops.unshift(gopForFusion); // Adjust Gops' metadata to account for the inclusion of the\n // new gop at the beginning\n\n gops.byteLength += gopForFusion.byteLength;\n gops.nalCount += gopForFusion.nalCount;\n gops.pts = gopForFusion.pts;\n gops.dts = gopForFusion.dts;\n gops.duration += gopForFusion.duration;\n } else {\n // If we didn't find a candidate gop fall back to keyframe-pulling\n gops = frameUtils.extendFirstKeyFrame(gops);\n }\n } // Trim gops to align with gopsToAlignWith\n\n\n if (gopsToAlignWith.length) {\n var alignedGops;\n\n if (options.alignGopsAtEnd) {\n alignedGops = this.alignGopsAtEnd_(gops);\n } else {\n alignedGops = this.alignGopsAtStart_(gops);\n }\n\n if (!alignedGops) {\n // save all the nals in the last GOP into the gop cache\n this.gopCache_.unshift({\n gop: gops.pop(),\n pps: track.pps,\n sps: track.sps\n }); // Keep a maximum of 6 GOPs in the cache\n\n this.gopCache_.length = Math.min(6, this.gopCache_.length); // Clear nalUnits\n\n nalUnits = []; // return early no gops can be aligned with desired gopsToAlignWith\n\n this.resetStream_();\n this.trigger('done', 'VideoSegmentStream');\n return;\n } // Some gops were trimmed. clear dts info so minSegmentDts and pts are correct\n // when recalculated before sending off to CoalesceStream\n\n\n trackDecodeInfo.clearDtsInfo(track);\n gops = alignedGops;\n }\n\n trackDecodeInfo.collectDtsInfo(track, gops); // First, we have to build the index from byte locations to\n // samples (that is, frames) in the video data\n\n track.samples = frameUtils.generateSampleTable(gops); // Concatenate the video data and construct the mdat\n\n mdat = mp4Generator.mdat(frameUtils.concatenateNalData(gops));\n track.baseMediaDecodeTime = trackDecodeInfo.calculateTrackBaseMediaDecodeTime(track, options.keepOriginalTimestamps);\n this.trigger('processedGopsInfo', gops.map(function (gop) {\n return {\n pts: gop.pts,\n dts: gop.dts,\n byteLength: gop.byteLength\n };\n })); // save all the nals in the last GOP into the gop cache\n\n this.gopCache_.unshift({\n gop: gops.pop(),\n pps: track.pps,\n sps: track.sps\n }); // Keep a maximum of 6 GOPs in the cache\n\n this.gopCache_.length = Math.min(6, this.gopCache_.length); // Clear nalUnits\n\n nalUnits = [];\n this.trigger('baseMediaDecodeTime', track.baseMediaDecodeTime);\n this.trigger('timelineStartInfo', track.timelineStartInfo);\n moof = mp4Generator.moof(sequenceNumber, [track]); // it would be great to allocate this array up front instead of\n // throwing away hundreds of media segment fragments\n\n boxes = new Uint8Array(moof.byteLength + mdat.byteLength); // Bump the sequence number for next time\n\n sequenceNumber++;\n boxes.set(moof);\n boxes.set(mdat, moof.byteLength);\n this.trigger('data', {\n track: track,\n boxes: boxes\n });\n this.resetStream_(); // Continue with the flush process now\n\n this.trigger('done', 'VideoSegmentStream');\n };\n\n this.resetStream_ = function () {\n trackDecodeInfo.clearDtsInfo(track); // reset config and pps because they may differ across segments\n // for instance, when we are rendition switching\n\n config = undefined;\n pps = undefined;\n }; // Search for a candidate Gop for gop-fusion from the gop cache and\n // return it or return null if no good candidate was found\n\n\n this.getGopForFusion_ = function (nalUnit) {\n var halfSecond = 45000,\n // Half-a-second in a 90khz clock\n allowableOverlap = 10000,\n // About 3 frames @ 30fps\n nearestDistance = Infinity,\n dtsDistance,\n nearestGopObj,\n currentGop,\n currentGopObj,\n i; // Search for the GOP nearest to the beginning of this nal unit\n\n for (i = 0; i < this.gopCache_.length; i++) {\n currentGopObj = this.gopCache_[i];\n currentGop = currentGopObj.gop; // Reject Gops with different SPS or PPS\n\n if (!(track.pps && arrayEquals(track.pps[0], currentGopObj.pps[0])) || !(track.sps && arrayEquals(track.sps[0], currentGopObj.sps[0]))) {\n continue;\n } // Reject Gops that would require a negative baseMediaDecodeTime\n\n\n if (currentGop.dts < track.timelineStartInfo.dts) {\n continue;\n } // The distance between the end of the gop and the start of the nalUnit\n\n\n dtsDistance = nalUnit.dts - currentGop.dts - currentGop.duration; // Only consider GOPS that start before the nal unit and end within\n // a half-second of the nal unit\n\n if (dtsDistance >= -allowableOverlap && dtsDistance <= halfSecond) {\n // Always use the closest GOP we found if there is more than\n // one candidate\n if (!nearestGopObj || nearestDistance > dtsDistance) {\n nearestGopObj = currentGopObj;\n nearestDistance = dtsDistance;\n }\n }\n }\n\n if (nearestGopObj) {\n return nearestGopObj.gop;\n }\n\n return null;\n }; // trim gop list to the first gop found that has a matching pts with a gop in the list\n // of gopsToAlignWith starting from the START of the list\n\n\n this.alignGopsAtStart_ = function (gops) {\n var alignIndex, gopIndex, align, gop, byteLength, nalCount, duration, alignedGops;\n byteLength = gops.byteLength;\n nalCount = gops.nalCount;\n duration = gops.duration;\n alignIndex = gopIndex = 0;\n\n while (alignIndex < gopsToAlignWith.length && gopIndex < gops.length) {\n align = gopsToAlignWith[alignIndex];\n gop = gops[gopIndex];\n\n if (align.pts === gop.pts) {\n break;\n }\n\n if (gop.pts > align.pts) {\n // this current gop starts after the current gop we want to align on, so increment\n // align index\n alignIndex++;\n continue;\n } // current gop starts before the current gop we want to align on. so increment gop\n // index\n\n\n gopIndex++;\n byteLength -= gop.byteLength;\n nalCount -= gop.nalCount;\n duration -= gop.duration;\n }\n\n if (gopIndex === 0) {\n // no gops to trim\n return gops;\n }\n\n if (gopIndex === gops.length) {\n // all gops trimmed, skip appending all gops\n return null;\n }\n\n alignedGops = gops.slice(gopIndex);\n alignedGops.byteLength = byteLength;\n alignedGops.duration = duration;\n alignedGops.nalCount = nalCount;\n alignedGops.pts = alignedGops[0].pts;\n alignedGops.dts = alignedGops[0].dts;\n return alignedGops;\n }; // trim gop list to the first gop found that has a matching pts with a gop in the list\n // of gopsToAlignWith starting from the END of the list\n\n\n this.alignGopsAtEnd_ = function (gops) {\n var alignIndex, gopIndex, align, gop, alignEndIndex, matchFound;\n alignIndex = gopsToAlignWith.length - 1;\n gopIndex = gops.length - 1;\n alignEndIndex = null;\n matchFound = false;\n\n while (alignIndex >= 0 && gopIndex >= 0) {\n align = gopsToAlignWith[alignIndex];\n gop = gops[gopIndex];\n\n if (align.pts === gop.pts) {\n matchFound = true;\n break;\n }\n\n if (align.pts > gop.pts) {\n alignIndex--;\n continue;\n }\n\n if (alignIndex === gopsToAlignWith.length - 1) {\n // gop.pts is greater than the last alignment candidate. If no match is found\n // by the end of this loop, we still want to append gops that come after this\n // point\n alignEndIndex = gopIndex;\n }\n\n gopIndex--;\n }\n\n if (!matchFound && alignEndIndex === null) {\n return null;\n }\n\n var trimIndex;\n\n if (matchFound) {\n trimIndex = gopIndex;\n } else {\n trimIndex = alignEndIndex;\n }\n\n if (trimIndex === 0) {\n return gops;\n }\n\n var alignedGops = gops.slice(trimIndex);\n var metadata = alignedGops.reduce(function (total, gop) {\n total.byteLength += gop.byteLength;\n total.duration += gop.duration;\n total.nalCount += gop.nalCount;\n return total;\n }, {\n byteLength: 0,\n duration: 0,\n nalCount: 0\n });\n alignedGops.byteLength = metadata.byteLength;\n alignedGops.duration = metadata.duration;\n alignedGops.nalCount = metadata.nalCount;\n alignedGops.pts = alignedGops[0].pts;\n alignedGops.dts = alignedGops[0].dts;\n return alignedGops;\n };\n\n this.alignGopsWith = function (newGopsToAlignWith) {\n gopsToAlignWith = newGopsToAlignWith;\n };\n };\n\n _VideoSegmentStream.prototype = new stream();\n /**\n * A Stream that can combine multiple streams (ie. audio & video)\n * into a single output segment for MSE. Also supports audio-only\n * and video-only streams.\n * @param options {object} transmuxer options object\n * @param options.keepOriginalTimestamps {boolean} If true, keep the timestamps\n * in the source; false to adjust the first segment to start at media timeline start.\n */\n\n _CoalesceStream = function CoalesceStream(options, metadataStream) {\n // Number of Tracks per output segment\n // If greater than 1, we combine multiple\n // tracks into a single segment\n this.numberOfTracks = 0;\n this.metadataStream = metadataStream;\n options = options || {};\n\n if (typeof options.remux !== 'undefined') {\n this.remuxTracks = !!options.remux;\n } else {\n this.remuxTracks = true;\n }\n\n if (typeof options.keepOriginalTimestamps === 'boolean') {\n this.keepOriginalTimestamps = options.keepOriginalTimestamps;\n }\n\n this.pendingTracks = [];\n this.videoTrack = null;\n this.pendingBoxes = [];\n this.pendingCaptions = [];\n this.pendingMetadata = [];\n this.pendingBytes = 0;\n this.emittedTracks = 0;\n\n _CoalesceStream.prototype.init.call(this); // Take output from multiple\n\n\n this.push = function (output) {\n // buffer incoming captions until the associated video segment\n // finishes\n if (output.text) {\n return this.pendingCaptions.push(output);\n } // buffer incoming id3 tags until the final flush\n\n\n if (output.frames) {\n return this.pendingMetadata.push(output);\n } // Add this track to the list of pending tracks and store\n // important information required for the construction of\n // the final segment\n\n\n this.pendingTracks.push(output.track);\n this.pendingBoxes.push(output.boxes);\n this.pendingBytes += output.boxes.byteLength;\n\n if (output.track.type === 'video') {\n this.videoTrack = output.track;\n }\n\n if (output.track.type === 'audio') {\n this.audioTrack = output.track;\n }\n };\n };\n\n _CoalesceStream.prototype = new stream();\n\n _CoalesceStream.prototype.flush = function (flushSource) {\n var offset = 0,\n event = {\n captions: [],\n captionStreams: {},\n metadata: [],\n info: {}\n },\n caption,\n id3,\n initSegment,\n timelineStartPts = 0,\n i;\n\n if (this.pendingTracks.length < this.numberOfTracks) {\n if (flushSource !== 'VideoSegmentStream' && flushSource !== 'AudioSegmentStream') {\n // Return because we haven't received a flush from a data-generating\n // portion of the segment (meaning that we have only recieved meta-data\n // or captions.)\n return;\n } else if (this.remuxTracks) {\n // Return until we have enough tracks from the pipeline to remux (if we\n // are remuxing audio and video into a single MP4)\n return;\n } else if (this.pendingTracks.length === 0) {\n // In the case where we receive a flush without any data having been\n // received we consider it an emitted track for the purposes of coalescing\n // `done` events.\n // We do this for the case where there is an audio and video track in the\n // segment but no audio data. (seen in several playlists with alternate\n // audio tracks and no audio present in the main TS segments.)\n this.emittedTracks++;\n\n if (this.emittedTracks >= this.numberOfTracks) {\n this.trigger('done');\n this.emittedTracks = 0;\n }\n\n return;\n }\n }\n\n if (this.videoTrack) {\n timelineStartPts = this.videoTrack.timelineStartInfo.pts;\n VIDEO_PROPERTIES.forEach(function (prop) {\n event.info[prop] = this.videoTrack[prop];\n }, this);\n } else if (this.audioTrack) {\n timelineStartPts = this.audioTrack.timelineStartInfo.pts;\n AUDIO_PROPERTIES.forEach(function (prop) {\n event.info[prop] = this.audioTrack[prop];\n }, this);\n }\n\n if (this.pendingTracks.length === 1) {\n event.type = this.pendingTracks[0].type;\n } else {\n event.type = 'combined';\n }\n\n this.emittedTracks += this.pendingTracks.length;\n initSegment = mp4Generator.initSegment(this.pendingTracks); // Create a new typed array to hold the init segment\n\n event.initSegment = new Uint8Array(initSegment.byteLength); // Create an init segment containing a moov\n // and track definitions\n\n event.initSegment.set(initSegment); // Create a new typed array to hold the moof+mdats\n\n event.data = new Uint8Array(this.pendingBytes); // Append each moof+mdat (one per track) together\n\n for (i = 0; i < this.pendingBoxes.length; i++) {\n event.data.set(this.pendingBoxes[i], offset);\n offset += this.pendingBoxes[i].byteLength;\n } // Translate caption PTS times into second offsets to match the\n // video timeline for the segment, and add track info\n\n\n for (i = 0; i < this.pendingCaptions.length; i++) {\n caption = this.pendingCaptions[i];\n caption.startTime = caption.startPts;\n\n if (!this.keepOriginalTimestamps) {\n caption.startTime -= timelineStartPts;\n }\n\n caption.startTime /= 90e3;\n caption.endTime = caption.endPts;\n\n if (!this.keepOriginalTimestamps) {\n caption.endTime -= timelineStartPts;\n }\n\n caption.endTime /= 90e3;\n event.captionStreams[caption.stream] = true;\n event.captions.push(caption);\n } // Translate ID3 frame PTS times into second offsets to match the\n // video timeline for the segment\n\n\n for (i = 0; i < this.pendingMetadata.length; i++) {\n id3 = this.pendingMetadata[i];\n id3.cueTime = id3.pts;\n\n if (!this.keepOriginalTimestamps) {\n id3.cueTime -= timelineStartPts;\n }\n\n id3.cueTime /= 90e3;\n event.metadata.push(id3);\n } // We add this to every single emitted segment even though we only need\n // it for the first\n\n\n event.metadata.dispatchType = this.metadataStream.dispatchType; // Reset stream state\n\n this.pendingTracks.length = 0;\n this.videoTrack = null;\n this.pendingBoxes.length = 0;\n this.pendingCaptions.length = 0;\n this.pendingBytes = 0;\n this.pendingMetadata.length = 0; // Emit the built segment\n\n this.trigger('data', event); // Only emit `done` if all tracks have been flushed and emitted\n\n if (this.emittedTracks >= this.numberOfTracks) {\n this.trigger('done');\n this.emittedTracks = 0;\n }\n };\n /**\n * A Stream that expects MP2T binary data as input and produces\n * corresponding media segments, suitable for use with Media Source\n * Extension (MSE) implementations that support the ISO BMFF byte\n * stream format, like Chrome.\n */\n\n\n _Transmuxer = function Transmuxer(options) {\n var self = this,\n hasFlushed = true,\n videoTrack,\n audioTrack;\n\n _Transmuxer.prototype.init.call(this);\n\n options = options || {};\n this.baseMediaDecodeTime = options.baseMediaDecodeTime || 0;\n this.transmuxPipeline_ = {};\n\n this.setupAacPipeline = function () {\n var pipeline = {};\n this.transmuxPipeline_ = pipeline;\n pipeline.type = 'aac';\n pipeline.metadataStream = new m2ts_1.MetadataStream(); // set up the parsing pipeline\n\n pipeline.aacStream = new aac();\n pipeline.audioTimestampRolloverStream = new m2ts_1.TimestampRolloverStream('audio');\n pipeline.timedMetadataTimestampRolloverStream = new m2ts_1.TimestampRolloverStream('timed-metadata');\n pipeline.adtsStream = new adts();\n pipeline.coalesceStream = new _CoalesceStream(options, pipeline.metadataStream);\n pipeline.headOfPipeline = pipeline.aacStream;\n pipeline.aacStream.pipe(pipeline.audioTimestampRolloverStream).pipe(pipeline.adtsStream);\n pipeline.aacStream.pipe(pipeline.timedMetadataTimestampRolloverStream).pipe(pipeline.metadataStream).pipe(pipeline.coalesceStream);\n pipeline.metadataStream.on('timestamp', function (frame) {\n pipeline.aacStream.setTimestamp(frame.timeStamp);\n });\n pipeline.aacStream.on('data', function (data) {\n if (data.type === 'timed-metadata' && !pipeline.audioSegmentStream) {\n audioTrack = audioTrack || {\n timelineStartInfo: {\n baseMediaDecodeTime: self.baseMediaDecodeTime\n },\n codec: 'adts',\n type: 'audio'\n }; // hook up the audio segment stream to the first track with aac data\n\n pipeline.coalesceStream.numberOfTracks++;\n pipeline.audioSegmentStream = new _AudioSegmentStream(audioTrack, options); // Set up the final part of the audio pipeline\n\n pipeline.adtsStream.pipe(pipeline.audioSegmentStream).pipe(pipeline.coalesceStream);\n }\n }); // Re-emit any data coming from the coalesce stream to the outside world\n\n pipeline.coalesceStream.on('data', this.trigger.bind(this, 'data')); // Let the consumer know we have finished flushing the entire pipeline\n\n pipeline.coalesceStream.on('done', this.trigger.bind(this, 'done'));\n };\n\n this.setupTsPipeline = function () {\n var pipeline = {};\n this.transmuxPipeline_ = pipeline;\n pipeline.type = 'ts';\n pipeline.metadataStream = new m2ts_1.MetadataStream(); // set up the parsing pipeline\n\n pipeline.packetStream = new m2ts_1.TransportPacketStream();\n pipeline.parseStream = new m2ts_1.TransportParseStream();\n pipeline.elementaryStream = new m2ts_1.ElementaryStream();\n pipeline.videoTimestampRolloverStream = new m2ts_1.TimestampRolloverStream('video');\n pipeline.audioTimestampRolloverStream = new m2ts_1.TimestampRolloverStream('audio');\n pipeline.timedMetadataTimestampRolloverStream = new m2ts_1.TimestampRolloverStream('timed-metadata');\n pipeline.adtsStream = new adts();\n pipeline.h264Stream = new H264Stream();\n pipeline.captionStream = new m2ts_1.CaptionStream();\n pipeline.coalesceStream = new _CoalesceStream(options, pipeline.metadataStream);\n pipeline.headOfPipeline = pipeline.packetStream; // disassemble MPEG2-TS packets into elementary streams\n\n pipeline.packetStream.pipe(pipeline.parseStream).pipe(pipeline.elementaryStream); // !!THIS ORDER IS IMPORTANT!!\n // demux the streams\n\n pipeline.elementaryStream.pipe(pipeline.videoTimestampRolloverStream).pipe(pipeline.h264Stream);\n pipeline.elementaryStream.pipe(pipeline.audioTimestampRolloverStream).pipe(pipeline.adtsStream);\n pipeline.elementaryStream.pipe(pipeline.timedMetadataTimestampRolloverStream).pipe(pipeline.metadataStream).pipe(pipeline.coalesceStream); // Hook up CEA-608/708 caption stream\n\n pipeline.h264Stream.pipe(pipeline.captionStream).pipe(pipeline.coalesceStream);\n pipeline.elementaryStream.on('data', function (data) {\n var i;\n\n if (data.type === 'metadata') {\n i = data.tracks.length; // scan the tracks listed in the metadata\n\n while (i--) {\n if (!videoTrack && data.tracks[i].type === 'video') {\n videoTrack = data.tracks[i];\n videoTrack.timelineStartInfo.baseMediaDecodeTime = self.baseMediaDecodeTime;\n } else if (!audioTrack && data.tracks[i].type === 'audio') {\n audioTrack = data.tracks[i];\n audioTrack.timelineStartInfo.baseMediaDecodeTime = self.baseMediaDecodeTime;\n }\n } // hook up the video segment stream to the first track with h264 data\n\n\n if (videoTrack && !pipeline.videoSegmentStream) {\n pipeline.coalesceStream.numberOfTracks++;\n pipeline.videoSegmentStream = new _VideoSegmentStream(videoTrack, options);\n pipeline.videoSegmentStream.on('timelineStartInfo', function (timelineStartInfo) {\n // When video emits timelineStartInfo data after a flush, we forward that\n // info to the AudioSegmentStream, if it exists, because video timeline\n // data takes precedence.\n if (audioTrack) {\n audioTrack.timelineStartInfo = timelineStartInfo; // On the first segment we trim AAC frames that exist before the\n // very earliest DTS we have seen in video because Chrome will\n // interpret any video track with a baseMediaDecodeTime that is\n // non-zero as a gap.\n\n pipeline.audioSegmentStream.setEarliestDts(timelineStartInfo.dts);\n }\n });\n pipeline.videoSegmentStream.on('processedGopsInfo', self.trigger.bind(self, 'gopInfo'));\n pipeline.videoSegmentStream.on('baseMediaDecodeTime', function (baseMediaDecodeTime) {\n if (audioTrack) {\n pipeline.audioSegmentStream.setVideoBaseMediaDecodeTime(baseMediaDecodeTime);\n }\n }); // Set up the final part of the video pipeline\n\n pipeline.h264Stream.pipe(pipeline.videoSegmentStream).pipe(pipeline.coalesceStream);\n }\n\n if (audioTrack && !pipeline.audioSegmentStream) {\n // hook up the audio segment stream to the first track with aac data\n pipeline.coalesceStream.numberOfTracks++;\n pipeline.audioSegmentStream = new _AudioSegmentStream(audioTrack, options); // Set up the final part of the audio pipeline\n\n pipeline.adtsStream.pipe(pipeline.audioSegmentStream).pipe(pipeline.coalesceStream);\n }\n }\n }); // Re-emit any data coming from the coalesce stream to the outside world\n\n pipeline.coalesceStream.on('data', this.trigger.bind(this, 'data')); // Let the consumer know we have finished flushing the entire pipeline\n\n pipeline.coalesceStream.on('done', this.trigger.bind(this, 'done'));\n }; // hook up the segment streams once track metadata is delivered\n\n\n this.setBaseMediaDecodeTime = function (baseMediaDecodeTime) {\n var pipeline = this.transmuxPipeline_;\n\n if (!options.keepOriginalTimestamps) {\n this.baseMediaDecodeTime = baseMediaDecodeTime;\n }\n\n if (audioTrack) {\n audioTrack.timelineStartInfo.dts = undefined;\n audioTrack.timelineStartInfo.pts = undefined;\n trackDecodeInfo.clearDtsInfo(audioTrack);\n\n if (!options.keepOriginalTimestamps) {\n audioTrack.timelineStartInfo.baseMediaDecodeTime = baseMediaDecodeTime;\n }\n\n if (pipeline.audioTimestampRolloverStream) {\n pipeline.audioTimestampRolloverStream.discontinuity();\n }\n }\n\n if (videoTrack) {\n if (pipeline.videoSegmentStream) {\n pipeline.videoSegmentStream.gopCache_ = [];\n pipeline.videoTimestampRolloverStream.discontinuity();\n }\n\n videoTrack.timelineStartInfo.dts = undefined;\n videoTrack.timelineStartInfo.pts = undefined;\n trackDecodeInfo.clearDtsInfo(videoTrack);\n pipeline.captionStream.reset();\n\n if (!options.keepOriginalTimestamps) {\n videoTrack.timelineStartInfo.baseMediaDecodeTime = baseMediaDecodeTime;\n }\n }\n\n if (pipeline.timedMetadataTimestampRolloverStream) {\n pipeline.timedMetadataTimestampRolloverStream.discontinuity();\n }\n };\n\n this.setAudioAppendStart = function (timestamp) {\n if (audioTrack) {\n this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(timestamp);\n }\n };\n\n this.alignGopsWith = function (gopsToAlignWith) {\n if (videoTrack && this.transmuxPipeline_.videoSegmentStream) {\n this.transmuxPipeline_.videoSegmentStream.alignGopsWith(gopsToAlignWith);\n }\n }; // feed incoming data to the front of the parsing pipeline\n\n\n this.push = function (data) {\n if (hasFlushed) {\n var isAac = isLikelyAacData$1(data);\n\n if (isAac && this.transmuxPipeline_.type !== 'aac') {\n this.setupAacPipeline();\n } else if (!isAac && this.transmuxPipeline_.type !== 'ts') {\n this.setupTsPipeline();\n }\n\n hasFlushed = false;\n }\n\n this.transmuxPipeline_.headOfPipeline.push(data);\n }; // flush any buffered data\n\n\n this.flush = function () {\n hasFlushed = true; // Start at the top of the pipeline and flush all pending work\n\n this.transmuxPipeline_.headOfPipeline.flush();\n }; // Caption data has to be reset when seeking outside buffered range\n\n\n this.resetCaptions = function () {\n if (this.transmuxPipeline_.captionStream) {\n this.transmuxPipeline_.captionStream.reset();\n }\n };\n };\n\n _Transmuxer.prototype = new stream();\n var transmuxer = {\n Transmuxer: _Transmuxer,\n VideoSegmentStream: _VideoSegmentStream,\n AudioSegmentStream: _AudioSegmentStream,\n AUDIO_PROPERTIES: AUDIO_PROPERTIES,\n VIDEO_PROPERTIES: VIDEO_PROPERTIES\n };\n\n var inspectMp4,\n _textifyMp,\n parseType$2 = probe.parseType,\n parseMp4Date = function parseMp4Date(seconds) {\n return new Date(seconds * 1000 - 2082844800000);\n },\n parseSampleFlags = function parseSampleFlags(flags) {\n return {\n isLeading: (flags[0] & 0x0c) >>> 2,\n dependsOn: flags[0] & 0x03,\n isDependedOn: (flags[1] & 0xc0) >>> 6,\n hasRedundancy: (flags[1] & 0x30) >>> 4,\n paddingValue: (flags[1] & 0x0e) >>> 1,\n isNonSyncSample: flags[1] & 0x01,\n degradationPriority: flags[2] << 8 | flags[3]\n };\n },\n nalParse = function nalParse(avcStream) {\n var avcView = new DataView(avcStream.buffer, avcStream.byteOffset, avcStream.byteLength),\n result = [],\n i,\n length;\n\n for (i = 0; i + 4 < avcStream.length; i += length) {\n length = avcView.getUint32(i);\n i += 4; // bail if this doesn't appear to be an H264 stream\n\n if (length <= 0) {\n result.push('<span style=\\'color:red;\\'>MALFORMED DATA</span>');\n continue;\n }\n\n switch (avcStream[i] & 0x1F) {\n case 0x01:\n result.push('slice_layer_without_partitioning_rbsp');\n break;\n\n case 0x05:\n result.push('slice_layer_without_partitioning_rbsp_idr');\n break;\n\n case 0x06:\n result.push('sei_rbsp');\n break;\n\n case 0x07:\n result.push('seq_parameter_set_rbsp');\n break;\n\n case 0x08:\n result.push('pic_parameter_set_rbsp');\n break;\n\n case 0x09:\n result.push('access_unit_delimiter_rbsp');\n break;\n\n default:\n result.push('UNKNOWN NAL - ' + avcStream[i] & 0x1F);\n break;\n }\n }\n\n return result;\n },\n // registry of handlers for individual mp4 box types\n parse$$1 = {\n // codingname, not a first-class box type. stsd entries share the\n // same format as real boxes so the parsing infrastructure can be\n // shared\n avc1: function avc1(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength);\n return {\n dataReferenceIndex: view.getUint16(6),\n width: view.getUint16(24),\n height: view.getUint16(26),\n horizresolution: view.getUint16(28) + view.getUint16(30) / 16,\n vertresolution: view.getUint16(32) + view.getUint16(34) / 16,\n frameCount: view.getUint16(40),\n depth: view.getUint16(74),\n config: inspectMp4(data.subarray(78, data.byteLength))\n };\n },\n avcC: function avcC(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n configurationVersion: data[0],\n avcProfileIndication: data[1],\n profileCompatibility: data[2],\n avcLevelIndication: data[3],\n lengthSizeMinusOne: data[4] & 0x03,\n sps: [],\n pps: []\n },\n numOfSequenceParameterSets = data[5] & 0x1f,\n numOfPictureParameterSets,\n nalSize,\n offset,\n i; // iterate past any SPSs\n\n offset = 6;\n\n for (i = 0; i < numOfSequenceParameterSets; i++) {\n nalSize = view.getUint16(offset);\n offset += 2;\n result.sps.push(new Uint8Array(data.subarray(offset, offset + nalSize)));\n offset += nalSize;\n } // iterate past any PPSs\n\n\n numOfPictureParameterSets = data[offset];\n offset++;\n\n for (i = 0; i < numOfPictureParameterSets; i++) {\n nalSize = view.getUint16(offset);\n offset += 2;\n result.pps.push(new Uint8Array(data.subarray(offset, offset + nalSize)));\n offset += nalSize;\n }\n\n return result;\n },\n btrt: function btrt(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength);\n return {\n bufferSizeDB: view.getUint32(0),\n maxBitrate: view.getUint32(4),\n avgBitrate: view.getUint32(8)\n };\n },\n esds: function esds(data) {\n return {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n esId: data[6] << 8 | data[7],\n streamPriority: data[8] & 0x1f,\n decoderConfig: {\n objectProfileIndication: data[11],\n streamType: data[12] >>> 2 & 0x3f,\n bufferSize: data[13] << 16 | data[14] << 8 | data[15],\n maxBitrate: data[16] << 24 | data[17] << 16 | data[18] << 8 | data[19],\n avgBitrate: data[20] << 24 | data[21] << 16 | data[22] << 8 | data[23],\n decoderConfigDescriptor: {\n tag: data[24],\n length: data[25],\n audioObjectType: data[26] >>> 3 & 0x1f,\n samplingFrequencyIndex: (data[26] & 0x07) << 1 | data[27] >>> 7 & 0x01,\n channelConfiguration: data[27] >>> 3 & 0x0f\n }\n }\n };\n },\n ftyp: function ftyp(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n majorBrand: parseType$2(data.subarray(0, 4)),\n minorVersion: view.getUint32(4),\n compatibleBrands: []\n },\n i = 8;\n\n while (i < data.byteLength) {\n result.compatibleBrands.push(parseType$2(data.subarray(i, i + 4)));\n i += 4;\n }\n\n return result;\n },\n dinf: function dinf(data) {\n return {\n boxes: inspectMp4(data)\n };\n },\n dref: function dref(data) {\n return {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n dataReferences: inspectMp4(data.subarray(8))\n };\n },\n hdlr: function hdlr(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n version: view.getUint8(0),\n flags: new Uint8Array(data.subarray(1, 4)),\n handlerType: parseType$2(data.subarray(8, 12)),\n name: ''\n },\n i = 8; // parse out the name field\n\n for (i = 24; i < data.byteLength; i++) {\n if (data[i] === 0x00) {\n // the name field is null-terminated\n i++;\n break;\n }\n\n result.name += String.fromCharCode(data[i]);\n } // decode UTF-8 to javascript's internal representation\n // see http://ecmanaut.blogspot.com/2006/07/encoding-decoding-utf8-in-javascript.html\n\n\n result.name = decodeURIComponent(escape(result.name));\n return result;\n },\n mdat: function mdat(data) {\n return {\n byteLength: data.byteLength,\n nals: nalParse(data)\n };\n },\n mdhd: function mdhd(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n i = 4,\n language,\n result = {\n version: view.getUint8(0),\n flags: new Uint8Array(data.subarray(1, 4)),\n language: ''\n };\n\n if (result.version === 1) {\n i += 4;\n result.creationTime = parseMp4Date(view.getUint32(i)); // truncating top 4 bytes\n\n i += 8;\n result.modificationTime = parseMp4Date(view.getUint32(i)); // truncating top 4 bytes\n\n i += 4;\n result.timescale = view.getUint32(i);\n i += 8;\n result.duration = view.getUint32(i); // truncating top 4 bytes\n } else {\n result.creationTime = parseMp4Date(view.getUint32(i));\n i += 4;\n result.modificationTime = parseMp4Date(view.getUint32(i));\n i += 4;\n result.timescale = view.getUint32(i);\n i += 4;\n result.duration = view.getUint32(i);\n }\n\n i += 4; // language is stored as an ISO-639-2/T code in an array of three 5-bit fields\n // each field is the packed difference between its ASCII value and 0x60\n\n language = view.getUint16(i);\n result.language += String.fromCharCode((language >> 10) + 0x60);\n result.language += String.fromCharCode(((language & 0x03e0) >> 5) + 0x60);\n result.language += String.fromCharCode((language & 0x1f) + 0x60);\n return result;\n },\n mdia: function mdia(data) {\n return {\n boxes: inspectMp4(data)\n };\n },\n mfhd: function mfhd(data) {\n return {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n sequenceNumber: data[4] << 24 | data[5] << 16 | data[6] << 8 | data[7]\n };\n },\n minf: function minf(data) {\n return {\n boxes: inspectMp4(data)\n };\n },\n // codingname, not a first-class box type. stsd entries share the\n // same format as real boxes so the parsing infrastructure can be\n // shared\n mp4a: function mp4a(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n // 6 bytes reserved\n dataReferenceIndex: view.getUint16(6),\n // 4 + 4 bytes reserved\n channelcount: view.getUint16(16),\n samplesize: view.getUint16(18),\n // 2 bytes pre_defined\n // 2 bytes reserved\n samplerate: view.getUint16(24) + view.getUint16(26) / 65536\n }; // if there are more bytes to process, assume this is an ISO/IEC\n // 14496-14 MP4AudioSampleEntry and parse the ESDBox\n\n if (data.byteLength > 28) {\n result.streamDescriptor = inspectMp4(data.subarray(28))[0];\n }\n\n return result;\n },\n moof: function moof(data) {\n return {\n boxes: inspectMp4(data)\n };\n },\n moov: function moov(data) {\n return {\n boxes: inspectMp4(data)\n };\n },\n mvex: function mvex(data) {\n return {\n boxes: inspectMp4(data)\n };\n },\n mvhd: function mvhd(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n i = 4,\n result = {\n version: view.getUint8(0),\n flags: new Uint8Array(data.subarray(1, 4))\n };\n\n if (result.version === 1) {\n i += 4;\n result.creationTime = parseMp4Date(view.getUint32(i)); // truncating top 4 bytes\n\n i += 8;\n result.modificationTime = parseMp4Date(view.getUint32(i)); // truncating top 4 bytes\n\n i += 4;\n result.timescale = view.getUint32(i);\n i += 8;\n result.duration = view.getUint32(i); // truncating top 4 bytes\n } else {\n result.creationTime = parseMp4Date(view.getUint32(i));\n i += 4;\n result.modificationTime = parseMp4Date(view.getUint32(i));\n i += 4;\n result.timescale = view.getUint32(i);\n i += 4;\n result.duration = view.getUint32(i);\n }\n\n i += 4; // convert fixed-point, base 16 back to a number\n\n result.rate = view.getUint16(i) + view.getUint16(i + 2) / 16;\n i += 4;\n result.volume = view.getUint8(i) + view.getUint8(i + 1) / 8;\n i += 2;\n i += 2;\n i += 2 * 4;\n result.matrix = new Uint32Array(data.subarray(i, i + 9 * 4));\n i += 9 * 4;\n i += 6 * 4;\n result.nextTrackId = view.getUint32(i);\n return result;\n },\n pdin: function pdin(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength);\n return {\n version: view.getUint8(0),\n flags: new Uint8Array(data.subarray(1, 4)),\n rate: view.getUint32(4),\n initialDelay: view.getUint32(8)\n };\n },\n sdtp: function sdtp(data) {\n var result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n samples: []\n },\n i;\n\n for (i = 4; i < data.byteLength; i++) {\n result.samples.push({\n dependsOn: (data[i] & 0x30) >> 4,\n isDependedOn: (data[i] & 0x0c) >> 2,\n hasRedundancy: data[i] & 0x03\n });\n }\n\n return result;\n },\n sidx: function sidx(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n references: [],\n referenceId: view.getUint32(4),\n timescale: view.getUint32(8),\n earliestPresentationTime: view.getUint32(12),\n firstOffset: view.getUint32(16)\n },\n referenceCount = view.getUint16(22),\n i;\n\n for (i = 24; referenceCount; i += 12, referenceCount--) {\n result.references.push({\n referenceType: (data[i] & 0x80) >>> 7,\n referencedSize: view.getUint32(i) & 0x7FFFFFFF,\n subsegmentDuration: view.getUint32(i + 4),\n startsWithSap: !!(data[i + 8] & 0x80),\n sapType: (data[i + 8] & 0x70) >>> 4,\n sapDeltaTime: view.getUint32(i + 8) & 0x0FFFFFFF\n });\n }\n\n return result;\n },\n smhd: function smhd(data) {\n return {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n balance: data[4] + data[5] / 256\n };\n },\n stbl: function stbl(data) {\n return {\n boxes: inspectMp4(data)\n };\n },\n stco: function stco(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n chunkOffsets: []\n },\n entryCount = view.getUint32(4),\n i;\n\n for (i = 8; entryCount; i += 4, entryCount--) {\n result.chunkOffsets.push(view.getUint32(i));\n }\n\n return result;\n },\n stsc: function stsc(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n entryCount = view.getUint32(4),\n result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n sampleToChunks: []\n },\n i;\n\n for (i = 8; entryCount; i += 12, entryCount--) {\n result.sampleToChunks.push({\n firstChunk: view.getUint32(i),\n samplesPerChunk: view.getUint32(i + 4),\n sampleDescriptionIndex: view.getUint32(i + 8)\n });\n }\n\n return result;\n },\n stsd: function stsd(data) {\n return {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n sampleDescriptions: inspectMp4(data.subarray(8))\n };\n },\n stsz: function stsz(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n sampleSize: view.getUint32(4),\n entries: []\n },\n i;\n\n for (i = 12; i < data.byteLength; i += 4) {\n result.entries.push(view.getUint32(i));\n }\n\n return result;\n },\n stts: function stts(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n timeToSamples: []\n },\n entryCount = view.getUint32(4),\n i;\n\n for (i = 8; entryCount; i += 8, entryCount--) {\n result.timeToSamples.push({\n sampleCount: view.getUint32(i),\n sampleDelta: view.getUint32(i + 4)\n });\n }\n\n return result;\n },\n styp: function styp(data) {\n return parse$$1.ftyp(data);\n },\n tfdt: function tfdt(data) {\n var result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n baseMediaDecodeTime: data[4] << 24 | data[5] << 16 | data[6] << 8 | data[7]\n };\n\n if (result.version === 1) {\n result.baseMediaDecodeTime *= Math.pow(2, 32);\n result.baseMediaDecodeTime += data[8] << 24 | data[9] << 16 | data[10] << 8 | data[11];\n }\n\n return result;\n },\n tfhd: function tfhd(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n trackId: view.getUint32(4)\n },\n baseDataOffsetPresent = result.flags[2] & 0x01,\n sampleDescriptionIndexPresent = result.flags[2] & 0x02,\n defaultSampleDurationPresent = result.flags[2] & 0x08,\n defaultSampleSizePresent = result.flags[2] & 0x10,\n defaultSampleFlagsPresent = result.flags[2] & 0x20,\n durationIsEmpty = result.flags[0] & 0x010000,\n defaultBaseIsMoof = result.flags[0] & 0x020000,\n i;\n i = 8;\n\n if (baseDataOffsetPresent) {\n i += 4; // truncate top 4 bytes\n // FIXME: should we read the full 64 bits?\n\n result.baseDataOffset = view.getUint32(12);\n i += 4;\n }\n\n if (sampleDescriptionIndexPresent) {\n result.sampleDescriptionIndex = view.getUint32(i);\n i += 4;\n }\n\n if (defaultSampleDurationPresent) {\n result.defaultSampleDuration = view.getUint32(i);\n i += 4;\n }\n\n if (defaultSampleSizePresent) {\n result.defaultSampleSize = view.getUint32(i);\n i += 4;\n }\n\n if (defaultSampleFlagsPresent) {\n result.defaultSampleFlags = view.getUint32(i);\n }\n\n if (durationIsEmpty) {\n result.durationIsEmpty = true;\n }\n\n if (!baseDataOffsetPresent && defaultBaseIsMoof) {\n result.baseDataOffsetIsMoof = true;\n }\n\n return result;\n },\n tkhd: function tkhd(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n i = 4,\n result = {\n version: view.getUint8(0),\n flags: new Uint8Array(data.subarray(1, 4))\n };\n\n if (result.version === 1) {\n i += 4;\n result.creationTime = parseMp4Date(view.getUint32(i)); // truncating top 4 bytes\n\n i += 8;\n result.modificationTime = parseMp4Date(view.getUint32(i)); // truncating top 4 bytes\n\n i += 4;\n result.trackId = view.getUint32(i);\n i += 4;\n i += 8;\n result.duration = view.getUint32(i); // truncating top 4 bytes\n } else {\n result.creationTime = parseMp4Date(view.getUint32(i));\n i += 4;\n result.modificationTime = parseMp4Date(view.getUint32(i));\n i += 4;\n result.trackId = view.getUint32(i);\n i += 4;\n i += 4;\n result.duration = view.getUint32(i);\n }\n\n i += 4;\n i += 2 * 4;\n result.layer = view.getUint16(i);\n i += 2;\n result.alternateGroup = view.getUint16(i);\n i += 2; // convert fixed-point, base 16 back to a number\n\n result.volume = view.getUint8(i) + view.getUint8(i + 1) / 8;\n i += 2;\n i += 2;\n result.matrix = new Uint32Array(data.subarray(i, i + 9 * 4));\n i += 9 * 4;\n result.width = view.getUint16(i) + view.getUint16(i + 2) / 16;\n i += 4;\n result.height = view.getUint16(i) + view.getUint16(i + 2) / 16;\n return result;\n },\n traf: function traf(data) {\n return {\n boxes: inspectMp4(data)\n };\n },\n trak: function trak(data) {\n return {\n boxes: inspectMp4(data)\n };\n },\n trex: function trex(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength);\n return {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n trackId: view.getUint32(4),\n defaultSampleDescriptionIndex: view.getUint32(8),\n defaultSampleDuration: view.getUint32(12),\n defaultSampleSize: view.getUint32(16),\n sampleDependsOn: data[20] & 0x03,\n sampleIsDependedOn: (data[21] & 0xc0) >> 6,\n sampleHasRedundancy: (data[21] & 0x30) >> 4,\n samplePaddingValue: (data[21] & 0x0e) >> 1,\n sampleIsDifferenceSample: !!(data[21] & 0x01),\n sampleDegradationPriority: view.getUint16(22)\n };\n },\n trun: function trun(data) {\n var result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n samples: []\n },\n view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n // Flag interpretation\n dataOffsetPresent = result.flags[2] & 0x01,\n // compare with 2nd byte of 0x1\n firstSampleFlagsPresent = result.flags[2] & 0x04,\n // compare with 2nd byte of 0x4\n sampleDurationPresent = result.flags[1] & 0x01,\n // compare with 2nd byte of 0x100\n sampleSizePresent = result.flags[1] & 0x02,\n // compare with 2nd byte of 0x200\n sampleFlagsPresent = result.flags[1] & 0x04,\n // compare with 2nd byte of 0x400\n sampleCompositionTimeOffsetPresent = result.flags[1] & 0x08,\n // compare with 2nd byte of 0x800\n sampleCount = view.getUint32(4),\n offset = 8,\n sample;\n\n if (dataOffsetPresent) {\n // 32 bit signed integer\n result.dataOffset = view.getInt32(offset);\n offset += 4;\n } // Overrides the flags for the first sample only. The order of\n // optional values will be: duration, size, compositionTimeOffset\n\n\n if (firstSampleFlagsPresent && sampleCount) {\n sample = {\n flags: parseSampleFlags(data.subarray(offset, offset + 4))\n };\n offset += 4;\n\n if (sampleDurationPresent) {\n sample.duration = view.getUint32(offset);\n offset += 4;\n }\n\n if (sampleSizePresent) {\n sample.size = view.getUint32(offset);\n offset += 4;\n }\n\n if (sampleCompositionTimeOffsetPresent) {\n // Note: this should be a signed int if version is 1\n sample.compositionTimeOffset = view.getUint32(offset);\n offset += 4;\n }\n\n result.samples.push(sample);\n sampleCount--;\n }\n\n while (sampleCount--) {\n sample = {};\n\n if (sampleDurationPresent) {\n sample.duration = view.getUint32(offset);\n offset += 4;\n }\n\n if (sampleSizePresent) {\n sample.size = view.getUint32(offset);\n offset += 4;\n }\n\n if (sampleFlagsPresent) {\n sample.flags = parseSampleFlags(data.subarray(offset, offset + 4));\n offset += 4;\n }\n\n if (sampleCompositionTimeOffsetPresent) {\n // Note: this should be a signed int if version is 1\n sample.compositionTimeOffset = view.getUint32(offset);\n offset += 4;\n }\n\n result.samples.push(sample);\n }\n\n return result;\n },\n 'url ': function url(data) {\n return {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4))\n };\n },\n vmhd: function vmhd(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength);\n return {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n graphicsmode: view.getUint16(4),\n opcolor: new Uint16Array([view.getUint16(6), view.getUint16(8), view.getUint16(10)])\n };\n }\n };\n /**\n * Return a javascript array of box objects parsed from an ISO base\n * media file.\n * @param data {Uint8Array} the binary data of the media to be inspected\n * @return {array} a javascript array of potentially nested box objects\n */\n\n\n inspectMp4 = function inspectMp4(data) {\n var i = 0,\n result = [],\n view,\n size,\n type,\n end,\n box; // Convert data from Uint8Array to ArrayBuffer, to follow Dataview API\n\n var ab = new ArrayBuffer(data.length);\n var v = new Uint8Array(ab);\n\n for (var z = 0; z < data.length; ++z) {\n v[z] = data[z];\n }\n\n view = new DataView(ab);\n\n while (i < data.byteLength) {\n // parse box data\n size = view.getUint32(i);\n type = parseType$2(data.subarray(i + 4, i + 8));\n end = size > 1 ? i + size : data.byteLength; // parse type-specific data\n\n box = (parse$$1[type] || function (data) {\n return {\n data: data\n };\n })(data.subarray(i + 8, end));\n\n box.size = size;\n box.type = type; // store this box and move to the next\n\n result.push(box);\n i = end;\n }\n\n return result;\n };\n /**\n * Returns a textual representation of the javascript represtentation\n * of an MP4 file. You can use it as an alternative to\n * JSON.stringify() to compare inspected MP4s.\n * @param inspectedMp4 {array} the parsed array of boxes in an MP4\n * file\n * @param depth {number} (optional) the number of ancestor boxes of\n * the elements of inspectedMp4. Assumed to be zero if unspecified.\n * @return {string} a text representation of the parsed MP4\n */\n\n\n _textifyMp = function textifyMp4(inspectedMp4, depth) {\n var indent;\n depth = depth || 0;\n indent = new Array(depth * 2 + 1).join(' '); // iterate over all the boxes\n\n return inspectedMp4.map(function (box, index) {\n // list the box type first at the current indentation level\n return indent + box.type + '\\n' + // the type is already included and handle child boxes separately\n Object.keys(box).filter(function (key) {\n return key !== 'type' && key !== 'boxes'; // output all the box properties\n }).map(function (key) {\n var prefix = indent + ' ' + key + ': ',\n value = box[key]; // print out raw bytes as hexademical\n\n if (value instanceof Uint8Array || value instanceof Uint32Array) {\n var bytes = Array.prototype.slice.call(new Uint8Array(value.buffer, value.byteOffset, value.byteLength)).map(function (byte) {\n return ' ' + ('00' + byte.toString(16)).slice(-2);\n }).join('').match(/.{1,24}/g);\n\n if (!bytes) {\n return prefix + '<>';\n }\n\n if (bytes.length === 1) {\n return prefix + '<' + bytes.join('').slice(1) + '>';\n }\n\n return prefix + '<\\n' + bytes.map(function (line) {\n return indent + ' ' + line;\n }).join('\\n') + '\\n' + indent + ' >';\n } // stringify generic objects\n\n\n return prefix + JSON.stringify(value, null, 2).split('\\n').map(function (line, index) {\n if (index === 0) {\n return line;\n }\n\n return indent + ' ' + line;\n }).join('\\n');\n }).join('\\n') + ( // recursively textify the child boxes\n box.boxes ? '\\n' + _textifyMp(box.boxes, depth + 1) : '');\n }).join('\\n');\n };\n\n var mp4Inspector = {\n inspect: inspectMp4,\n textify: _textifyMp,\n parseTfdt: parse$$1.tfdt,\n parseHdlr: parse$$1.hdlr,\n parseTfhd: parse$$1.tfhd,\n parseTrun: parse$$1.trun\n };\n var discardEmulationPreventionBytes$1 = captionPacketParser.discardEmulationPreventionBytes;\n var CaptionStream$1 = captionStream.CaptionStream;\n /**\n * Maps an offset in the mdat to a sample based on the the size of the samples.\n * Assumes that `parseSamples` has been called first.\n *\n * @param {Number} offset - The offset into the mdat\n * @param {Object[]} samples - An array of samples, parsed using `parseSamples`\n * @return {?Object} The matching sample, or null if no match was found.\n *\n * @see ISO-BMFF-12/2015, Section 8.8.8\n **/\n\n var mapToSample = function mapToSample(offset, samples) {\n var approximateOffset = offset;\n\n for (var i = 0; i < samples.length; i++) {\n var sample = samples[i];\n\n if (approximateOffset < sample.size) {\n return sample;\n }\n\n approximateOffset -= sample.size;\n }\n\n return null;\n };\n /**\n * Finds SEI nal units contained in a Media Data Box.\n * Assumes that `parseSamples` has been called first.\n *\n * @param {Uint8Array} avcStream - The bytes of the mdat\n * @param {Object[]} samples - The samples parsed out by `parseSamples`\n * @param {Number} trackId - The trackId of this video track\n * @return {Object[]} seiNals - the parsed SEI NALUs found.\n * The contents of the seiNal should match what is expected by\n * CaptionStream.push (nalUnitType, size, data, escapedRBSP, pts, dts)\n *\n * @see ISO-BMFF-12/2015, Section 8.1.1\n * @see Rec. ITU-T H.264, 7.3.2.3.1\n **/\n\n\n var findSeiNals = function findSeiNals(avcStream, samples, trackId) {\n var avcView = new DataView(avcStream.buffer, avcStream.byteOffset, avcStream.byteLength),\n result = [],\n seiNal,\n i,\n length,\n lastMatchedSample;\n\n for (i = 0; i + 4 < avcStream.length; i += length) {\n length = avcView.getUint32(i);\n i += 4; // Bail if this doesn't appear to be an H264 stream\n\n if (length <= 0) {\n continue;\n }\n\n switch (avcStream[i] & 0x1F) {\n case 0x06:\n var data = avcStream.subarray(i + 1, i + 1 + length);\n var matchingSample = mapToSample(i, samples);\n seiNal = {\n nalUnitType: 'sei_rbsp',\n size: length,\n data: data,\n escapedRBSP: discardEmulationPreventionBytes$1(data),\n trackId: trackId\n };\n\n if (matchingSample) {\n seiNal.pts = matchingSample.pts;\n seiNal.dts = matchingSample.dts;\n lastMatchedSample = matchingSample;\n } else {\n // If a matching sample cannot be found, use the last\n // sample's values as they should be as close as possible\n seiNal.pts = lastMatchedSample.pts;\n seiNal.dts = lastMatchedSample.dts;\n }\n\n result.push(seiNal);\n break;\n\n default:\n break;\n }\n }\n\n return result;\n };\n /**\n * Parses sample information out of Track Run Boxes and calculates\n * the absolute presentation and decode timestamps of each sample.\n *\n * @param {Array<Uint8Array>} truns - The Trun Run boxes to be parsed\n * @param {Number} baseMediaDecodeTime - base media decode time from tfdt\n @see ISO-BMFF-12/2015, Section 8.8.12\n * @param {Object} tfhd - The parsed Track Fragment Header\n * @see inspect.parseTfhd\n * @return {Object[]} the parsed samples\n *\n * @see ISO-BMFF-12/2015, Section 8.8.8\n **/\n\n\n var parseSamples = function parseSamples(truns, baseMediaDecodeTime, tfhd) {\n var currentDts = baseMediaDecodeTime;\n var defaultSampleDuration = tfhd.defaultSampleDuration || 0;\n var defaultSampleSize = tfhd.defaultSampleSize || 0;\n var trackId = tfhd.trackId;\n var allSamples = [];\n truns.forEach(function (trun) {\n // Note: We currently do not parse the sample table as well\n // as the trun. It's possible some sources will require this.\n // moov > trak > mdia > minf > stbl\n var trackRun = mp4Inspector.parseTrun(trun);\n var samples = trackRun.samples;\n samples.forEach(function (sample) {\n if (sample.duration === undefined) {\n sample.duration = defaultSampleDuration;\n }\n\n if (sample.size === undefined) {\n sample.size = defaultSampleSize;\n }\n\n sample.trackId = trackId;\n sample.dts = currentDts;\n\n if (sample.compositionTimeOffset === undefined) {\n sample.compositionTimeOffset = 0;\n }\n\n sample.pts = currentDts + sample.compositionTimeOffset;\n currentDts += sample.duration;\n });\n allSamples = allSamples.concat(samples);\n });\n return allSamples;\n };\n /**\n * Parses out caption nals from an FMP4 segment's video tracks.\n *\n * @param {Uint8Array} segment - The bytes of a single segment\n * @param {Number} videoTrackId - The trackId of a video track in the segment\n * @return {Object.<Number, Object[]>} A mapping of video trackId to\n * a list of seiNals found in that track\n **/\n\n\n var parseCaptionNals = function parseCaptionNals(segment, videoTrackId) {\n // To get the samples\n var trafs = probe.findBox(segment, ['moof', 'traf']); // To get SEI NAL units\n\n var mdats = probe.findBox(segment, ['mdat']);\n var captionNals = {};\n var mdatTrafPairs = []; // Pair up each traf with a mdat as moofs and mdats are in pairs\n\n mdats.forEach(function (mdat, index) {\n var matchingTraf = trafs[index];\n mdatTrafPairs.push({\n mdat: mdat,\n traf: matchingTraf\n });\n });\n mdatTrafPairs.forEach(function (pair) {\n var mdat = pair.mdat;\n var traf = pair.traf;\n var tfhd = probe.findBox(traf, ['tfhd']); // Exactly 1 tfhd per traf\n\n var headerInfo = mp4Inspector.parseTfhd(tfhd[0]);\n var trackId = headerInfo.trackId;\n var tfdt = probe.findBox(traf, ['tfdt']); // Either 0 or 1 tfdt per traf\n\n var baseMediaDecodeTime = tfdt.length > 0 ? mp4Inspector.parseTfdt(tfdt[0]).baseMediaDecodeTime : 0;\n var truns = probe.findBox(traf, ['trun']);\n var samples;\n var seiNals; // Only parse video data for the chosen video track\n\n if (videoTrackId === trackId && truns.length > 0) {\n samples = parseSamples(truns, baseMediaDecodeTime, headerInfo);\n seiNals = findSeiNals(mdat, samples, trackId);\n\n if (!captionNals[trackId]) {\n captionNals[trackId] = [];\n }\n\n captionNals[trackId] = captionNals[trackId].concat(seiNals);\n }\n });\n return captionNals;\n };\n /**\n * Parses out inband captions from an MP4 container and returns\n * caption objects that can be used by WebVTT and the TextTrack API.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/VTTCue\n * @see https://developer.mozilla.org/en-US/docs/Web/API/TextTrack\n * Assumes that `probe.getVideoTrackIds` and `probe.timescale` have been called first\n *\n * @param {Uint8Array} segment - The fmp4 segment containing embedded captions\n * @param {Number} trackId - The id of the video track to parse\n * @param {Number} timescale - The timescale for the video track from the init segment\n *\n * @return {?Object[]} parsedCaptions - A list of captions or null if no video tracks\n * @return {Number} parsedCaptions[].startTime - The time to show the caption in seconds\n * @return {Number} parsedCaptions[].endTime - The time to stop showing the caption in seconds\n * @return {String} parsedCaptions[].text - The visible content of the caption\n **/\n\n\n var parseEmbeddedCaptions = function parseEmbeddedCaptions(segment, trackId, timescale) {\n var seiNals;\n\n if (!trackId) {\n return null;\n }\n\n seiNals = parseCaptionNals(segment, trackId);\n return {\n seiNals: seiNals[trackId],\n timescale: timescale\n };\n };\n /**\n * Converts SEI NALUs into captions that can be used by video.js\n **/\n\n\n var CaptionParser$$1 = function CaptionParser$$1() {\n var isInitialized = false;\n var captionStream$$1; // Stores segments seen before trackId and timescale are set\n\n var segmentCache; // Stores video track ID of the track being parsed\n\n var trackId; // Stores the timescale of the track being parsed\n\n var timescale; // Stores captions parsed so far\n\n var parsedCaptions;\n /**\n * A method to indicate whether a CaptionParser has been initalized\n * @returns {Boolean}\n **/\n\n this.isInitialized = function () {\n return isInitialized;\n };\n /**\n * Initializes the underlying CaptionStream, SEI NAL parsing\n * and management, and caption collection\n **/\n\n\n this.init = function () {\n captionStream$$1 = new CaptionStream$1();\n isInitialized = true; // Collect dispatched captions\n\n captionStream$$1.on('data', function (event) {\n // Convert to seconds in the source's timescale\n event.startTime = event.startPts / timescale;\n event.endTime = event.endPts / timescale;\n parsedCaptions.captions.push(event);\n parsedCaptions.captionStreams[event.stream] = true;\n });\n };\n /**\n * Determines if a new video track will be selected\n * or if the timescale changed\n * @return {Boolean}\n **/\n\n\n this.isNewInit = function (videoTrackIds, timescales) {\n if (videoTrackIds && videoTrackIds.length === 0 || timescales && typeof timescales === 'object' && Object.keys(timescales).length === 0) {\n return false;\n }\n\n return trackId !== videoTrackIds[0] || timescale !== timescales[trackId];\n };\n /**\n * Parses out SEI captions and interacts with underlying\n * CaptionStream to return dispatched captions\n *\n * @param {Uint8Array} segment - The fmp4 segment containing embedded captions\n * @param {Number[]} videoTrackIds - A list of video tracks found in the init segment\n * @param {Object.<Number, Number>} timescales - The timescales found in the init segment\n * @see parseEmbeddedCaptions\n * @see m2ts/caption-stream.js\n **/\n\n\n this.parse = function (segment, videoTrackIds, timescales) {\n var parsedData;\n\n if (!this.isInitialized()) {\n return null; // This is not likely to be a video segment\n } else if (!videoTrackIds || !timescales) {\n return null;\n } else if (this.isNewInit(videoTrackIds, timescales)) {\n // Use the first video track only as there is no\n // mechanism to switch to other video tracks\n trackId = videoTrackIds[0];\n timescale = timescales[trackId]; // If an init segment has not been seen yet, hold onto segment\n // data until we have one\n } else if (!trackId || !timescale) {\n segmentCache.push(segment);\n return null;\n } // Now that a timescale and trackId is set, parse cached segments\n\n\n while (segmentCache.length > 0) {\n var cachedSegment = segmentCache.shift();\n this.parse(cachedSegment, videoTrackIds, timescales);\n }\n\n parsedData = parseEmbeddedCaptions(segment, trackId, timescale);\n\n if (parsedData === null || !parsedData.seiNals) {\n return null;\n }\n\n this.pushNals(parsedData.seiNals); // Force the parsed captions to be dispatched\n\n this.flushStream();\n return parsedCaptions;\n };\n /**\n * Pushes SEI NALUs onto CaptionStream\n * @param {Object[]} nals - A list of SEI nals parsed using `parseCaptionNals`\n * Assumes that `parseCaptionNals` has been called first\n * @see m2ts/caption-stream.js\n **/\n\n\n this.pushNals = function (nals) {\n if (!this.isInitialized() || !nals || nals.length === 0) {\n return null;\n }\n\n nals.forEach(function (nal) {\n captionStream$$1.push(nal);\n });\n };\n /**\n * Flushes underlying CaptionStream to dispatch processed, displayable captions\n * @see m2ts/caption-stream.js\n **/\n\n\n this.flushStream = function () {\n if (!this.isInitialized()) {\n return null;\n }\n\n captionStream$$1.flush();\n };\n /**\n * Reset caption buckets for new data\n **/\n\n\n this.clearParsedCaptions = function () {\n parsedCaptions.captions = [];\n parsedCaptions.captionStreams = {};\n };\n /**\n * Resets underlying CaptionStream\n * @see m2ts/caption-stream.js\n **/\n\n\n this.resetCaptionStream = function () {\n if (!this.isInitialized()) {\n return null;\n }\n\n captionStream$$1.reset();\n };\n /**\n * Convenience method to clear all captions flushed from the\n * CaptionStream and still being parsed\n * @see m2ts/caption-stream.js\n **/\n\n\n this.clearAllCaptions = function () {\n this.clearParsedCaptions();\n this.resetCaptionStream();\n };\n /**\n * Reset caption parser\n **/\n\n\n this.reset = function () {\n segmentCache = [];\n trackId = null;\n timescale = null;\n\n if (!parsedCaptions) {\n parsedCaptions = {\n captions: [],\n // CC1, CC2, CC3, CC4\n captionStreams: {}\n };\n } else {\n this.clearParsedCaptions();\n }\n\n this.resetCaptionStream();\n };\n\n this.reset();\n };\n\n var captionParser = CaptionParser$$1;\n var mp4 = {\n generator: mp4Generator,\n probe: probe,\n Transmuxer: transmuxer.Transmuxer,\n AudioSegmentStream: transmuxer.AudioSegmentStream,\n VideoSegmentStream: transmuxer.VideoSegmentStream,\n CaptionParser: captionParser\n };\n\n var classCallCheck = function classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n };\n\n var createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n }();\n /**\n * @file transmuxer-worker.js\n */\n\n /**\n * Re-emits transmuxer events by converting them into messages to the\n * world outside the worker.\n *\n * @param {Object} transmuxer the transmuxer to wire events on\n * @private\n */\n\n\n var wireTransmuxerEvents = function wireTransmuxerEvents(self, transmuxer) {\n transmuxer.on('data', function (segment) {\n // transfer ownership of the underlying ArrayBuffer\n // instead of doing a copy to save memory\n // ArrayBuffers are transferable but generic TypedArrays are not\n // @link https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers#Passing_data_by_transferring_ownership_(transferable_objects)\n var initArray = segment.initSegment;\n segment.initSegment = {\n data: initArray.buffer,\n byteOffset: initArray.byteOffset,\n byteLength: initArray.byteLength\n };\n var typedArray = segment.data;\n segment.data = typedArray.buffer;\n self.postMessage({\n action: 'data',\n segment: segment,\n byteOffset: typedArray.byteOffset,\n byteLength: typedArray.byteLength\n }, [segment.data]);\n });\n\n if (transmuxer.captionStream) {\n transmuxer.captionStream.on('data', function (caption) {\n self.postMessage({\n action: 'caption',\n data: caption\n });\n });\n }\n\n transmuxer.on('done', function (data) {\n self.postMessage({\n action: 'done'\n });\n });\n transmuxer.on('gopInfo', function (gopInfo) {\n self.postMessage({\n action: 'gopInfo',\n gopInfo: gopInfo\n });\n });\n };\n /**\n * All incoming messages route through this hash. If no function exists\n * to handle an incoming message, then we ignore the message.\n *\n * @class MessageHandlers\n * @param {Object} options the options to initialize with\n */\n\n\n var MessageHandlers = function () {\n function MessageHandlers(self, options) {\n classCallCheck(this, MessageHandlers);\n this.options = options || {};\n this.self = self;\n this.init();\n }\n /**\n * initialize our web worker and wire all the events.\n */\n\n\n createClass(MessageHandlers, [{\n key: 'init',\n value: function init() {\n if (this.transmuxer) {\n this.transmuxer.dispose();\n }\n\n this.transmuxer = new mp4.Transmuxer(this.options);\n wireTransmuxerEvents(this.self, this.transmuxer);\n }\n /**\n * Adds data (a ts segment) to the start of the transmuxer pipeline for\n * processing.\n *\n * @param {ArrayBuffer} data data to push into the muxer\n */\n\n }, {\n key: 'push',\n value: function push(data) {\n // Cast array buffer to correct type for transmuxer\n var segment = new Uint8Array(data.data, data.byteOffset, data.byteLength);\n this.transmuxer.push(segment);\n }\n /**\n * Recreate the transmuxer so that the next segment added via `push`\n * start with a fresh transmuxer.\n */\n\n }, {\n key: 'reset',\n value: function reset() {\n this.init();\n }\n /**\n * Set the value that will be used as the `baseMediaDecodeTime` time for the\n * next segment pushed in. Subsequent segments will have their `baseMediaDecodeTime`\n * set relative to the first based on the PTS values.\n *\n * @param {Object} data used to set the timestamp offset in the muxer\n */\n\n }, {\n key: 'setTimestampOffset',\n value: function setTimestampOffset(data) {\n var timestampOffset = data.timestampOffset || 0;\n this.transmuxer.setBaseMediaDecodeTime(Math.round(timestampOffset * 90000));\n }\n }, {\n key: 'setAudioAppendStart',\n value: function setAudioAppendStart(data) {\n this.transmuxer.setAudioAppendStart(Math.ceil(data.appendStart * 90000));\n }\n /**\n * Forces the pipeline to finish processing the last segment and emit it's\n * results.\n *\n * @param {Object} data event data, not really used\n */\n\n }, {\n key: 'flush',\n value: function flush(data) {\n this.transmuxer.flush();\n }\n }, {\n key: 'resetCaptions',\n value: function resetCaptions() {\n this.transmuxer.resetCaptions();\n }\n }, {\n key: 'alignGopsWith',\n value: function alignGopsWith(data) {\n this.transmuxer.alignGopsWith(data.gopsToAlignWith.slice());\n }\n }]);\n return MessageHandlers;\n }();\n /**\n * Our web wroker interface so that things can talk to mux.js\n * that will be running in a web worker. the scope is passed to this by\n * webworkify.\n *\n * @param {Object} self the scope for the web worker\n */\n\n\n var TransmuxerWorker = function TransmuxerWorker(self) {\n self.onmessage = function (event) {\n if (event.data.action === 'init' && event.data.options) {\n this.messageHandlers = new MessageHandlers(self, event.data.options);\n return;\n }\n\n if (!this.messageHandlers) {\n this.messageHandlers = new MessageHandlers(self);\n }\n\n if (event.data && event.data.action && event.data.action !== 'init') {\n if (this.messageHandlers[event.data.action]) {\n this.messageHandlers[event.data.action](event.data);\n }\n }\n };\n };\n\n var transmuxerWorker = new TransmuxerWorker(self);\n return transmuxerWorker;\n }();\n});\n/**\n * @file - codecs.js - Handles tasks regarding codec strings such as translating them to\n * codec strings, or translating codec strings into objects that can be examined.\n */\n// Default codec parameters if none were provided for video and/or audio\n\nvar defaultCodecs = {\n videoCodec: 'avc1',\n videoObjectTypeIndicator: '.4d400d',\n // AAC-LC\n audioProfile: '2'\n};\n/**\n * Replace the old apple-style `avc1.<dd>.<dd>` codec string with the standard\n * `avc1.<hhhhhh>`\n *\n * @param {Array} codecs an array of codec strings to fix\n * @return {Array} the translated codec array\n * @private\n */\n\nvar translateLegacyCodecs = function translateLegacyCodecs(codecs) {\n return codecs.map(function (codec) {\n return codec.replace(/avc1\\.(\\d+)\\.(\\d+)/i, function (orig, profile, avcLevel) {\n var profileHex = ('00' + Number(profile).toString(16)).slice(-2);\n var avcLevelHex = ('00' + Number(avcLevel).toString(16)).slice(-2);\n return 'avc1.' + profileHex + '00' + avcLevelHex;\n });\n });\n};\n/**\n * Parses a codec string to retrieve the number of codecs specified,\n * the video codec and object type indicator, and the audio profile.\n */\n\n\nvar parseCodecs = function parseCodecs() {\n var codecs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var result = {\n codecCount: 0\n };\n var parsed = void 0;\n result.codecCount = codecs.split(',').length;\n result.codecCount = result.codecCount || 2; // parse the video codec\n\n parsed = /(^|\\s|,)+(avc[13])([^ ,]*)/i.exec(codecs);\n\n if (parsed) {\n result.videoCodec = parsed[2];\n result.videoObjectTypeIndicator = parsed[3];\n } // parse the last field of the audio codec\n\n\n result.audioProfile = /(^|\\s|,)+mp4a.[0-9A-Fa-f]+\\.([0-9A-Fa-f]+)/i.exec(codecs);\n result.audioProfile = result.audioProfile && result.audioProfile[2];\n return result;\n};\n/**\n * Replace codecs in the codec string with the old apple-style `avc1.<dd>.<dd>` to the\n * standard `avc1.<hhhhhh>`.\n *\n * @param codecString {String} the codec string\n * @return {String} the codec string with old apple-style codecs replaced\n *\n * @private\n */\n\n\nvar mapLegacyAvcCodecs = function mapLegacyAvcCodecs(codecString) {\n return codecString.replace(/avc1\\.(\\d+)\\.(\\d+)/i, function (match) {\n return translateLegacyCodecs([match])[0];\n });\n};\n/**\n * Build a media mime-type string from a set of parameters\n * @param {String} type either 'audio' or 'video'\n * @param {String} container either 'mp2t' or 'mp4'\n * @param {Array} codecs an array of codec strings to add\n * @return {String} a valid media mime-type\n */\n\n\nvar makeMimeTypeString = function makeMimeTypeString(type, container, codecs) {\n // The codecs array is filtered so that falsey values are\n // dropped and don't cause Array#join to create spurious\n // commas\n return type + '/' + container + '; codecs=\"' + codecs.filter(function (c) {\n return !!c;\n }).join(', ') + '\"';\n};\n/**\n * Returns the type container based on information in the playlist\n * @param {Playlist} media the current media playlist\n * @return {String} a valid media container type\n */\n\n\nvar getContainerType = function getContainerType(media) {\n // An initialization segment means the media playlist is an iframe\n // playlist or is using the mp4 container. We don't currently\n // support iframe playlists, so assume this is signalling mp4\n // fragments.\n if (media.segments && media.segments.length && media.segments[0].map) {\n return 'mp4';\n }\n\n return 'mp2t';\n};\n/**\n * Returns a set of codec strings parsed from the playlist or the default\n * codec strings if no codecs were specified in the playlist\n * @param {Playlist} media the current media playlist\n * @return {Object} an object with the video and audio codecs\n */\n\n\nvar getCodecs = function getCodecs(media) {\n // if the codecs were explicitly specified, use them instead of the\n // defaults\n var mediaAttributes = media.attributes || {};\n\n if (mediaAttributes.CODECS) {\n return parseCodecs(mediaAttributes.CODECS);\n }\n\n return defaultCodecs;\n};\n\nvar audioProfileFromDefault = function audioProfileFromDefault(master, audioGroupId) {\n if (!master.mediaGroups.AUDIO || !audioGroupId) {\n return null;\n }\n\n var audioGroup = master.mediaGroups.AUDIO[audioGroupId];\n\n if (!audioGroup) {\n return null;\n }\n\n for (var name in audioGroup) {\n var audioType = audioGroup[name];\n\n if (audioType.default && audioType.playlists) {\n // codec should be the same for all playlists within the audio type\n return parseCodecs(audioType.playlists[0].attributes.CODECS).audioProfile;\n }\n }\n\n return null;\n};\n/**\n * Calculates the MIME type strings for a working configuration of\n * SourceBuffers to play variant streams in a master playlist. If\n * there is no possible working configuration, an empty array will be\n * returned.\n *\n * @param master {Object} the m3u8 object for the master playlist\n * @param media {Object} the m3u8 object for the variant playlist\n * @return {Array} the MIME type strings. If the array has more than\n * one entry, the first element should be applied to the video\n * SourceBuffer and the second to the audio SourceBuffer.\n *\n * @private\n */\n\n\nvar mimeTypesForPlaylist = function mimeTypesForPlaylist(master, media) {\n var containerType = getContainerType(media);\n var codecInfo = getCodecs(media);\n var mediaAttributes = media.attributes || {}; // Default condition for a traditional HLS (no demuxed audio/video)\n\n var isMuxed = true;\n var isMaat = false;\n\n if (!media) {\n // Not enough information\n return [];\n }\n\n if (master.mediaGroups.AUDIO && mediaAttributes.AUDIO) {\n var audioGroup = master.mediaGroups.AUDIO[mediaAttributes.AUDIO]; // Handle the case where we are in a multiple-audio track scenario\n\n if (audioGroup) {\n isMaat = true; // Start with the everything demuxed then...\n\n isMuxed = false; // ...check to see if any audio group tracks are muxed (ie. lacking a uri)\n\n for (var groupId in audioGroup) {\n // either a uri is present (if the case of HLS and an external playlist), or\n // playlists is present (in the case of DASH where we don't have external audio\n // playlists)\n if (!audioGroup[groupId].uri && !audioGroup[groupId].playlists) {\n isMuxed = true;\n break;\n }\n }\n }\n } // HLS with multiple-audio tracks must always get an audio codec.\n // Put another way, there is no way to have a video-only multiple-audio HLS!\n\n\n if (isMaat && !codecInfo.audioProfile) {\n if (!isMuxed) {\n // It is possible for codecs to be specified on the audio media group playlist but\n // not on the rendition playlist. This is mostly the case for DASH, where audio and\n // video are always separate (and separately specified).\n codecInfo.audioProfile = audioProfileFromDefault(master, mediaAttributes.AUDIO);\n }\n\n if (!codecInfo.audioProfile) {\n videojs$1.log.warn('Multiple audio tracks present but no audio codec string is specified. ' + 'Attempting to use the default audio codec (mp4a.40.2)');\n codecInfo.audioProfile = defaultCodecs.audioProfile;\n }\n } // Generate the final codec strings from the codec object generated above\n\n\n var codecStrings = {};\n\n if (codecInfo.videoCodec) {\n codecStrings.video = '' + codecInfo.videoCodec + codecInfo.videoObjectTypeIndicator;\n }\n\n if (codecInfo.audioProfile) {\n codecStrings.audio = 'mp4a.40.' + codecInfo.audioProfile;\n } // Finally, make and return an array with proper mime-types depending on\n // the configuration\n\n\n var justAudio = makeMimeTypeString('audio', containerType, [codecStrings.audio]);\n var justVideo = makeMimeTypeString('video', containerType, [codecStrings.video]);\n var bothVideoAudio = makeMimeTypeString('video', containerType, [codecStrings.video, codecStrings.audio]);\n\n if (isMaat) {\n if (!isMuxed && codecStrings.video) {\n return [justVideo, justAudio];\n }\n\n if (!isMuxed && !codecStrings.video) {\n // There is no muxed content and no video codec string, so this is an audio only\n // stream with alternate audio.\n return [justAudio, justAudio];\n } // There exists the possiblity that this will return a `video/container`\n // mime-type for the first entry in the array even when there is only audio.\n // This doesn't appear to be a problem and simplifies the code.\n\n\n return [bothVideoAudio, justAudio];\n } // If there is no video codec at all, always just return a single\n // audio/<container> mime-type\n\n\n if (!codecStrings.video) {\n return [justAudio];\n } // When not using separate audio media groups, audio and video is\n // *always* muxed\n\n\n return [bothVideoAudio];\n};\n/**\n * Parse a content type header into a type and parameters\n * object\n *\n * @param {String} type the content type header\n * @return {Object} the parsed content-type\n * @private\n */\n\n\nvar parseContentType = function parseContentType(type) {\n var object = {\n type: '',\n parameters: {}\n };\n var parameters = type.trim().split(';'); // first parameter should always be content-type\n\n object.type = parameters.shift().trim();\n parameters.forEach(function (parameter) {\n var pair = parameter.trim().split('=');\n\n if (pair.length > 1) {\n var name = pair[0].replace(/\"/g, '').trim();\n var value = pair[1].replace(/\"/g, '').trim();\n object.parameters[name] = value;\n }\n });\n return object;\n};\n/**\n * Check if a codec string refers to an audio codec.\n *\n * @param {String} codec codec string to check\n * @return {Boolean} if this is an audio codec\n * @private\n */\n\n\nvar isAudioCodec = function isAudioCodec(codec) {\n return /mp4a\\.\\d+.\\d+/i.test(codec);\n};\n/**\n * Check if a codec string refers to a video codec.\n *\n * @param {String} codec codec string to check\n * @return {Boolean} if this is a video codec\n * @private\n */\n\n\nvar isVideoCodec = function isVideoCodec(codec) {\n return /avc1\\.[\\da-f]+/i.test(codec);\n};\n/**\n * Returns a list of gops in the buffer that have a pts value of 3 seconds or more in\n * front of current time.\n *\n * @param {Array} buffer\n * The current buffer of gop information\n * @param {Number} currentTime\n * The current time\n * @param {Double} mapping\n * Offset to map display time to stream presentation time\n * @return {Array}\n * List of gops considered safe to append over\n */\n\n\nvar gopsSafeToAlignWith = function gopsSafeToAlignWith(buffer, currentTime, mapping) {\n if (typeof currentTime === 'undefined' || currentTime === null || !buffer.length) {\n return [];\n } // pts value for current time + 3 seconds to give a bit more wiggle room\n\n\n var currentTimePts = Math.ceil((currentTime - mapping + 3) * 90000);\n var i = void 0;\n\n for (i = 0; i < buffer.length; i++) {\n if (buffer[i].pts > currentTimePts) {\n break;\n }\n }\n\n return buffer.slice(i);\n};\n/**\n * Appends gop information (timing and byteLength) received by the transmuxer for the\n * gops appended in the last call to appendBuffer\n *\n * @param {Array} buffer\n * The current buffer of gop information\n * @param {Array} gops\n * List of new gop information\n * @param {boolean} replace\n * If true, replace the buffer with the new gop information. If false, append the\n * new gop information to the buffer in the right location of time.\n * @return {Array}\n * Updated list of gop information\n */\n\n\nvar updateGopBuffer = function updateGopBuffer(buffer, gops, replace) {\n if (!gops.length) {\n return buffer;\n }\n\n if (replace) {\n // If we are in safe append mode, then completely overwrite the gop buffer\n // with the most recent appeneded data. This will make sure that when appending\n // future segments, we only try to align with gops that are both ahead of current\n // time and in the last segment appended.\n return gops.slice();\n }\n\n var start = gops[0].pts;\n var i = 0;\n\n for (i; i < buffer.length; i++) {\n if (buffer[i].pts >= start) {\n break;\n }\n }\n\n return buffer.slice(0, i).concat(gops);\n};\n/**\n * Removes gop information in buffer that overlaps with provided start and end\n *\n * @param {Array} buffer\n * The current buffer of gop information\n * @param {Double} start\n * position to start the remove at\n * @param {Double} end\n * position to end the remove at\n * @param {Double} mapping\n * Offset to map display time to stream presentation time\n */\n\n\nvar removeGopBuffer = function removeGopBuffer(buffer, start, end, mapping) {\n var startPts = Math.ceil((start - mapping) * 90000);\n var endPts = Math.ceil((end - mapping) * 90000);\n var updatedBuffer = buffer.slice();\n var i = buffer.length;\n\n while (i--) {\n if (buffer[i].pts <= endPts) {\n break;\n }\n }\n\n if (i === -1) {\n // no removal because end of remove range is before start of buffer\n return updatedBuffer;\n }\n\n var j = i + 1;\n\n while (j--) {\n if (buffer[j].pts <= startPts) {\n break;\n }\n } // clamp remove range start to 0 index\n\n\n j = Math.max(j, 0);\n updatedBuffer.splice(j, i - j + 1);\n return updatedBuffer;\n};\n\nvar buffered = function buffered(videoBuffer, audioBuffer, audioDisabled) {\n var start = null;\n var end = null;\n var arity = 0;\n var extents = [];\n var ranges = []; // neither buffer has been created yet\n\n if (!videoBuffer && !audioBuffer) {\n return videojs$1.createTimeRange();\n } // only one buffer is configured\n\n\n if (!videoBuffer) {\n return audioBuffer.buffered;\n }\n\n if (!audioBuffer) {\n return videoBuffer.buffered;\n } // both buffers are configured\n\n\n if (audioDisabled) {\n return videoBuffer.buffered;\n } // both buffers are empty\n\n\n if (videoBuffer.buffered.length === 0 && audioBuffer.buffered.length === 0) {\n return videojs$1.createTimeRange();\n } // Handle the case where we have both buffers and create an\n // intersection of the two\n\n\n var videoBuffered = videoBuffer.buffered;\n var audioBuffered = audioBuffer.buffered;\n var count = videoBuffered.length; // A) Gather up all start and end times\n\n while (count--) {\n extents.push({\n time: videoBuffered.start(count),\n type: 'start'\n });\n extents.push({\n time: videoBuffered.end(count),\n type: 'end'\n });\n }\n\n count = audioBuffered.length;\n\n while (count--) {\n extents.push({\n time: audioBuffered.start(count),\n type: 'start'\n });\n extents.push({\n time: audioBuffered.end(count),\n type: 'end'\n });\n } // B) Sort them by time\n\n\n extents.sort(function (a, b) {\n return a.time - b.time;\n }); // C) Go along one by one incrementing arity for start and decrementing\n // arity for ends\n\n for (count = 0; count < extents.length; count++) {\n if (extents[count].type === 'start') {\n arity++; // D) If arity is ever incremented to 2 we are entering an\n // overlapping range\n\n if (arity === 2) {\n start = extents[count].time;\n }\n } else if (extents[count].type === 'end') {\n arity--; // E) If arity is ever decremented to 1 we leaving an\n // overlapping range\n\n if (arity === 1) {\n end = extents[count].time;\n }\n } // F) Record overlapping ranges\n\n\n if (start !== null && end !== null) {\n ranges.push([start, end]);\n start = null;\n end = null;\n }\n }\n\n return videojs$1.createTimeRanges(ranges);\n};\n/**\n * @file virtual-source-buffer.js\n */\n// We create a wrapper around the SourceBuffer so that we can manage the\n// state of the `updating` property manually. We have to do this because\n// Firefox changes `updating` to false long before triggering `updateend`\n// events and that was causing strange problems in videojs-contrib-hls\n\n\nvar makeWrappedSourceBuffer = function makeWrappedSourceBuffer(mediaSource, mimeType) {\n var sourceBuffer = mediaSource.addSourceBuffer(mimeType);\n var wrapper = Object.create(null);\n wrapper.updating = false;\n wrapper.realBuffer_ = sourceBuffer;\n\n var _loop = function _loop(key) {\n if (typeof sourceBuffer[key] === 'function') {\n wrapper[key] = function () {\n return sourceBuffer[key].apply(sourceBuffer, arguments);\n };\n } else if (typeof wrapper[key] === 'undefined') {\n Object.defineProperty(wrapper, key, {\n get: function get$$1() {\n return sourceBuffer[key];\n },\n set: function set$$1(v) {\n return sourceBuffer[key] = v;\n }\n });\n }\n };\n\n for (var key in sourceBuffer) {\n _loop(key);\n }\n\n return wrapper;\n};\n/**\n * VirtualSourceBuffers exist so that we can transmux non native formats\n * into a native format, but keep the same api as a native source buffer.\n * It creates a transmuxer, that works in its own thread (a web worker) and\n * that transmuxer muxes the data into a native format. VirtualSourceBuffer will\n * then send all of that data to the naive sourcebuffer so that it is\n * indestinguishable from a natively supported format.\n *\n * @param {HtmlMediaSource} mediaSource the parent mediaSource\n * @param {Array} codecs array of codecs that we will be dealing with\n * @class VirtualSourceBuffer\n * @extends video.js.EventTarget\n */\n\n\nvar VirtualSourceBuffer = function (_videojs$EventTarget) {\n inherits(VirtualSourceBuffer, _videojs$EventTarget);\n\n function VirtualSourceBuffer(mediaSource, codecs) {\n classCallCheck(this, VirtualSourceBuffer);\n\n var _this = possibleConstructorReturn(this, (VirtualSourceBuffer.__proto__ || Object.getPrototypeOf(VirtualSourceBuffer)).call(this, videojs$1.EventTarget));\n\n _this.timestampOffset_ = 0;\n _this.pendingBuffers_ = [];\n _this.bufferUpdating_ = false;\n _this.mediaSource_ = mediaSource;\n _this.codecs_ = codecs;\n _this.audioCodec_ = null;\n _this.videoCodec_ = null;\n _this.audioDisabled_ = false;\n _this.appendAudioInitSegment_ = true;\n _this.gopBuffer_ = [];\n _this.timeMapping_ = 0;\n _this.safeAppend_ = videojs$1.browser.IE_VERSION >= 11;\n var options = {\n remux: false,\n alignGopsAtEnd: _this.safeAppend_\n };\n\n _this.codecs_.forEach(function (codec) {\n if (isAudioCodec(codec)) {\n _this.audioCodec_ = codec;\n } else if (isVideoCodec(codec)) {\n _this.videoCodec_ = codec;\n }\n }); // append muxed segments to their respective native buffers as\n // soon as they are available\n\n\n _this.transmuxer_ = new TransmuxWorker();\n\n _this.transmuxer_.postMessage({\n action: 'init',\n options: options\n });\n\n _this.transmuxer_.onmessage = function (event) {\n if (event.data.action === 'data') {\n return _this.data_(event);\n }\n\n if (event.data.action === 'done') {\n return _this.done_(event);\n }\n\n if (event.data.action === 'gopInfo') {\n return _this.appendGopInfo_(event);\n }\n }; // this timestampOffset is a property with the side-effect of resetting\n // baseMediaDecodeTime in the transmuxer on the setter\n\n\n Object.defineProperty(_this, 'timestampOffset', {\n get: function get$$1() {\n return this.timestampOffset_;\n },\n set: function set$$1(val) {\n if (typeof val === 'number' && val >= 0) {\n this.timestampOffset_ = val;\n this.appendAudioInitSegment_ = true; // reset gop buffer on timestampoffset as this signals a change in timeline\n\n this.gopBuffer_.length = 0;\n this.timeMapping_ = 0; // We have to tell the transmuxer to set the baseMediaDecodeTime to\n // the desired timestampOffset for the next segment\n\n this.transmuxer_.postMessage({\n action: 'setTimestampOffset',\n timestampOffset: val\n });\n }\n }\n }); // setting the append window affects both source buffers\n\n Object.defineProperty(_this, 'appendWindowStart', {\n get: function get$$1() {\n return (this.videoBuffer_ || this.audioBuffer_).appendWindowStart;\n },\n set: function set$$1(start) {\n if (this.videoBuffer_) {\n this.videoBuffer_.appendWindowStart = start;\n }\n\n if (this.audioBuffer_) {\n this.audioBuffer_.appendWindowStart = start;\n }\n }\n }); // this buffer is \"updating\" if either of its native buffers are\n\n Object.defineProperty(_this, 'updating', {\n get: function get$$1() {\n return !!(this.bufferUpdating_ || !this.audioDisabled_ && this.audioBuffer_ && this.audioBuffer_.updating || this.videoBuffer_ && this.videoBuffer_.updating);\n }\n }); // the buffered property is the intersection of the buffered\n // ranges of the native source buffers\n\n Object.defineProperty(_this, 'buffered', {\n get: function get$$1() {\n return buffered(this.videoBuffer_, this.audioBuffer_, this.audioDisabled_);\n }\n });\n return _this;\n }\n /**\n * When we get a data event from the transmuxer\n * we call this function and handle the data that\n * was sent to us\n *\n * @private\n * @param {Event} event the data event from the transmuxer\n */\n\n\n createClass(VirtualSourceBuffer, [{\n key: 'data_',\n value: function data_(event) {\n var segment = event.data.segment; // Cast ArrayBuffer to TypedArray\n\n segment.data = new Uint8Array(segment.data, event.data.byteOffset, event.data.byteLength);\n segment.initSegment = new Uint8Array(segment.initSegment.data, segment.initSegment.byteOffset, segment.initSegment.byteLength);\n createTextTracksIfNecessary(this, this.mediaSource_, segment); // Add the segments to the pendingBuffers array\n\n this.pendingBuffers_.push(segment);\n return;\n }\n /**\n * When we get a done event from the transmuxer\n * we call this function and we process all\n * of the pending data that we have been saving in the\n * data_ function\n *\n * @private\n * @param {Event} event the done event from the transmuxer\n */\n\n }, {\n key: 'done_',\n value: function done_(event) {\n // Don't process and append data if the mediaSource is closed\n if (this.mediaSource_.readyState === 'closed') {\n this.pendingBuffers_.length = 0;\n return;\n } // All buffers should have been flushed from the muxer\n // start processing anything we have received\n\n\n this.processPendingSegments_();\n return;\n }\n /**\n * Create our internal native audio/video source buffers and add\n * event handlers to them with the following conditions:\n * 1. they do not already exist on the mediaSource\n * 2. this VSB has a codec for them\n *\n * @private\n */\n\n }, {\n key: 'createRealSourceBuffers_',\n value: function createRealSourceBuffers_() {\n var _this2 = this;\n\n var types = ['audio', 'video'];\n types.forEach(function (type) {\n // Don't create a SourceBuffer of this type if we don't have a\n // codec for it\n if (!_this2[type + 'Codec_']) {\n return;\n } // Do nothing if a SourceBuffer of this type already exists\n\n\n if (_this2[type + 'Buffer_']) {\n return;\n }\n\n var buffer = null; // If the mediasource already has a SourceBuffer for the codec\n // use that\n\n if (_this2.mediaSource_[type + 'Buffer_']) {\n buffer = _this2.mediaSource_[type + 'Buffer_']; // In multiple audio track cases, the audio source buffer is disabled\n // on the main VirtualSourceBuffer by the HTMLMediaSource much earlier\n // than createRealSourceBuffers_ is called to create the second\n // VirtualSourceBuffer because that happens as a side-effect of\n // videojs-contrib-hls starting the audioSegmentLoader. As a result,\n // the audioBuffer is essentially \"ownerless\" and no one will toggle\n // the `updating` state back to false once the `updateend` event is received\n //\n // Setting `updating` to false manually will work around this\n // situation and allow work to continue\n\n buffer.updating = false;\n } else {\n var codecProperty = type + 'Codec_';\n var mimeType = type + '/mp4;codecs=\"' + _this2[codecProperty] + '\"';\n buffer = makeWrappedSourceBuffer(_this2.mediaSource_.nativeMediaSource_, mimeType);\n _this2.mediaSource_[type + 'Buffer_'] = buffer;\n }\n\n _this2[type + 'Buffer_'] = buffer; // Wire up the events to the SourceBuffer\n\n ['update', 'updatestart', 'updateend'].forEach(function (event) {\n buffer.addEventListener(event, function () {\n // if audio is disabled\n if (type === 'audio' && _this2.audioDisabled_) {\n return;\n }\n\n if (event === 'updateend') {\n _this2[type + 'Buffer_'].updating = false;\n }\n\n var shouldTrigger = types.every(function (t) {\n // skip checking audio's updating status if audio\n // is not enabled\n if (t === 'audio' && _this2.audioDisabled_) {\n return true;\n } // if the other type if updating we don't trigger\n\n\n if (type !== t && _this2[t + 'Buffer_'] && _this2[t + 'Buffer_'].updating) {\n return false;\n }\n\n return true;\n });\n\n if (shouldTrigger) {\n return _this2.trigger(event);\n }\n });\n });\n });\n }\n /**\n * Emulate the native mediasource function, but our function will\n * send all of the proposed segments to the transmuxer so that we\n * can transmux them before we append them to our internal\n * native source buffers in the correct format.\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/appendBuffer\n * @param {Uint8Array} segment the segment to append to the buffer\n */\n\n }, {\n key: 'appendBuffer',\n value: function appendBuffer(segment) {\n // Start the internal \"updating\" state\n this.bufferUpdating_ = true;\n\n if (this.audioBuffer_ && this.audioBuffer_.buffered.length) {\n var audioBuffered = this.audioBuffer_.buffered;\n this.transmuxer_.postMessage({\n action: 'setAudioAppendStart',\n appendStart: audioBuffered.end(audioBuffered.length - 1)\n });\n }\n\n if (this.videoBuffer_) {\n this.transmuxer_.postMessage({\n action: 'alignGopsWith',\n gopsToAlignWith: gopsSafeToAlignWith(this.gopBuffer_, this.mediaSource_.player_ ? this.mediaSource_.player_.currentTime() : null, this.timeMapping_)\n });\n }\n\n this.transmuxer_.postMessage({\n action: 'push',\n // Send the typed-array of data as an ArrayBuffer so that\n // it can be sent as a \"Transferable\" and avoid the costly\n // memory copy\n data: segment.buffer,\n // To recreate the original typed-array, we need information\n // about what portion of the ArrayBuffer it was a view into\n byteOffset: segment.byteOffset,\n byteLength: segment.byteLength\n }, [segment.buffer]);\n this.transmuxer_.postMessage({\n action: 'flush'\n });\n }\n /**\n * Appends gop information (timing and byteLength) received by the transmuxer for the\n * gops appended in the last call to appendBuffer\n *\n * @param {Event} event\n * The gopInfo event from the transmuxer\n * @param {Array} event.data.gopInfo\n * List of gop info to append\n */\n\n }, {\n key: 'appendGopInfo_',\n value: function appendGopInfo_(event) {\n this.gopBuffer_ = updateGopBuffer(this.gopBuffer_, event.data.gopInfo, this.safeAppend_);\n }\n /**\n * Emulate the native mediasource function and remove parts\n * of the buffer from any of our internal buffers that exist\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/remove\n * @param {Double} start position to start the remove at\n * @param {Double} end position to end the remove at\n */\n\n }, {\n key: 'remove',\n value: function remove(start, end) {\n if (this.videoBuffer_) {\n this.videoBuffer_.updating = true;\n this.videoBuffer_.remove(start, end);\n this.gopBuffer_ = removeGopBuffer(this.gopBuffer_, start, end, this.timeMapping_);\n }\n\n if (!this.audioDisabled_ && this.audioBuffer_) {\n this.audioBuffer_.updating = true;\n this.audioBuffer_.remove(start, end);\n } // Remove Metadata Cues (id3)\n\n\n removeCuesFromTrack(start, end, this.metadataTrack_); // Remove Any Captions\n\n if (this.inbandTextTracks_) {\n for (var track in this.inbandTextTracks_) {\n removeCuesFromTrack(start, end, this.inbandTextTracks_[track]);\n }\n }\n }\n /**\n * Process any segments that the muxer has output\n * Concatenate segments together based on type and append them into\n * their respective sourceBuffers\n *\n * @private\n */\n\n }, {\n key: 'processPendingSegments_',\n value: function processPendingSegments_() {\n var sortedSegments = {\n video: {\n segments: [],\n bytes: 0\n },\n audio: {\n segments: [],\n bytes: 0\n },\n captions: [],\n metadata: []\n }; // Sort segments into separate video/audio arrays and\n // keep track of their total byte lengths\n\n sortedSegments = this.pendingBuffers_.reduce(function (segmentObj, segment) {\n var type = segment.type;\n var data = segment.data;\n var initSegment = segment.initSegment;\n segmentObj[type].segments.push(data);\n segmentObj[type].bytes += data.byteLength;\n segmentObj[type].initSegment = initSegment; // Gather any captions into a single array\n\n if (segment.captions) {\n segmentObj.captions = segmentObj.captions.concat(segment.captions);\n }\n\n if (segment.info) {\n segmentObj[type].info = segment.info;\n } // Gather any metadata into a single array\n\n\n if (segment.metadata) {\n segmentObj.metadata = segmentObj.metadata.concat(segment.metadata);\n }\n\n return segmentObj;\n }, sortedSegments); // Create the real source buffers if they don't exist by now since we\n // finally are sure what tracks are contained in the source\n\n if (!this.videoBuffer_ && !this.audioBuffer_) {\n // Remove any codecs that may have been specified by default but\n // are no longer applicable now\n if (sortedSegments.video.bytes === 0) {\n this.videoCodec_ = null;\n }\n\n if (sortedSegments.audio.bytes === 0) {\n this.audioCodec_ = null;\n }\n\n this.createRealSourceBuffers_();\n }\n\n if (sortedSegments.audio.info) {\n this.mediaSource_.trigger({\n type: 'audioinfo',\n info: sortedSegments.audio.info\n });\n }\n\n if (sortedSegments.video.info) {\n this.mediaSource_.trigger({\n type: 'videoinfo',\n info: sortedSegments.video.info\n });\n }\n\n if (this.appendAudioInitSegment_) {\n if (!this.audioDisabled_ && this.audioBuffer_) {\n sortedSegments.audio.segments.unshift(sortedSegments.audio.initSegment);\n sortedSegments.audio.bytes += sortedSegments.audio.initSegment.byteLength;\n }\n\n this.appendAudioInitSegment_ = false;\n }\n\n var triggerUpdateend = false; // Merge multiple video and audio segments into one and append\n\n if (this.videoBuffer_ && sortedSegments.video.bytes) {\n sortedSegments.video.segments.unshift(sortedSegments.video.initSegment);\n sortedSegments.video.bytes += sortedSegments.video.initSegment.byteLength;\n this.concatAndAppendSegments_(sortedSegments.video, this.videoBuffer_); // TODO: are video tracks the only ones with text tracks?\n\n addTextTrackData(this, sortedSegments.captions, sortedSegments.metadata);\n } else if (this.videoBuffer_ && (this.audioDisabled_ || !this.audioBuffer_)) {\n // The transmuxer did not return any bytes of video, meaning it was all trimmed\n // for gop alignment. Since we have a video buffer and audio is disabled, updateend\n // will never be triggered by this source buffer, which will cause contrib-hls\n // to be stuck forever waiting for updateend. If audio is not disabled, updateend\n // will be triggered by the audio buffer, which will be sent upwards since the video\n // buffer will not be in an updating state.\n triggerUpdateend = true;\n }\n\n if (!this.audioDisabled_ && this.audioBuffer_) {\n this.concatAndAppendSegments_(sortedSegments.audio, this.audioBuffer_);\n }\n\n this.pendingBuffers_.length = 0;\n\n if (triggerUpdateend) {\n this.trigger('updateend');\n } // We are no longer in the internal \"updating\" state\n\n\n this.bufferUpdating_ = false;\n }\n /**\n * Combine all segments into a single Uint8Array and then append them\n * to the destination buffer\n *\n * @param {Object} segmentObj\n * @param {SourceBuffer} destinationBuffer native source buffer to append data to\n * @private\n */\n\n }, {\n key: 'concatAndAppendSegments_',\n value: function concatAndAppendSegments_(segmentObj, destinationBuffer) {\n var offset = 0;\n var tempBuffer = void 0;\n\n if (segmentObj.bytes) {\n tempBuffer = new Uint8Array(segmentObj.bytes); // Combine the individual segments into one large typed-array\n\n segmentObj.segments.forEach(function (segment) {\n tempBuffer.set(segment, offset);\n offset += segment.byteLength;\n });\n\n try {\n destinationBuffer.updating = true;\n destinationBuffer.appendBuffer(tempBuffer);\n } catch (error) {\n if (this.mediaSource_.player_) {\n this.mediaSource_.player_.error({\n code: -3,\n type: 'APPEND_BUFFER_ERR',\n message: error.message,\n originalError: error\n });\n }\n }\n }\n }\n /**\n * Emulate the native mediasource function. abort any soureBuffer\n * actions and throw out any un-appended data.\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/abort\n */\n\n }, {\n key: 'abort',\n value: function abort() {\n if (this.videoBuffer_) {\n this.videoBuffer_.abort();\n }\n\n if (!this.audioDisabled_ && this.audioBuffer_) {\n this.audioBuffer_.abort();\n }\n\n if (this.transmuxer_) {\n this.transmuxer_.postMessage({\n action: 'reset'\n });\n }\n\n this.pendingBuffers_.length = 0;\n this.bufferUpdating_ = false;\n }\n }]);\n return VirtualSourceBuffer;\n}(videojs$1.EventTarget);\n/**\n * @file html-media-source.js\n */\n\n/**\n * Our MediaSource implementation in HTML, mimics native\n * MediaSource where/if possible.\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/API/MediaSource\n * @class HtmlMediaSource\n * @extends videojs.EventTarget\n */\n\n\nvar HtmlMediaSource = function (_videojs$EventTarget) {\n inherits(HtmlMediaSource, _videojs$EventTarget);\n\n function HtmlMediaSource() {\n classCallCheck(this, HtmlMediaSource);\n\n var _this = possibleConstructorReturn(this, (HtmlMediaSource.__proto__ || Object.getPrototypeOf(HtmlMediaSource)).call(this));\n\n var property = void 0;\n _this.nativeMediaSource_ = new window$1.MediaSource(); // delegate to the native MediaSource's methods by default\n\n for (property in _this.nativeMediaSource_) {\n if (!(property in HtmlMediaSource.prototype) && typeof _this.nativeMediaSource_[property] === 'function') {\n _this[property] = _this.nativeMediaSource_[property].bind(_this.nativeMediaSource_);\n }\n } // emulate `duration` and `seekable` until seeking can be\n // handled uniformly for live streams\n // see https://github.com/w3c/media-source/issues/5\n\n\n _this.duration_ = NaN;\n Object.defineProperty(_this, 'duration', {\n get: function get$$1() {\n if (this.duration_ === Infinity) {\n return this.duration_;\n }\n\n return this.nativeMediaSource_.duration;\n },\n set: function set$$1(duration) {\n this.duration_ = duration;\n\n if (duration !== Infinity) {\n this.nativeMediaSource_.duration = duration;\n return;\n }\n }\n });\n Object.defineProperty(_this, 'seekable', {\n get: function get$$1() {\n if (this.duration_ === Infinity) {\n return videojs$1.createTimeRanges([[0, this.nativeMediaSource_.duration]]);\n }\n\n return this.nativeMediaSource_.seekable;\n }\n });\n Object.defineProperty(_this, 'readyState', {\n get: function get$$1() {\n return this.nativeMediaSource_.readyState;\n }\n });\n Object.defineProperty(_this, 'activeSourceBuffers', {\n get: function get$$1() {\n return this.activeSourceBuffers_;\n }\n }); // the list of virtual and native SourceBuffers created by this\n // MediaSource\n\n _this.sourceBuffers = [];\n _this.activeSourceBuffers_ = [];\n /**\n * update the list of active source buffers based upon various\n * imformation from HLS and video.js\n *\n * @private\n */\n\n _this.updateActiveSourceBuffers_ = function () {\n // Retain the reference but empty the array\n _this.activeSourceBuffers_.length = 0; // If there is only one source buffer, then it will always be active and audio will\n // be disabled based on the codec of the source buffer\n\n if (_this.sourceBuffers.length === 1) {\n var sourceBuffer = _this.sourceBuffers[0];\n sourceBuffer.appendAudioInitSegment_ = true;\n sourceBuffer.audioDisabled_ = !sourceBuffer.audioCodec_;\n\n _this.activeSourceBuffers_.push(sourceBuffer);\n\n return;\n } // There are 2 source buffers, a combined (possibly video only) source buffer and\n // and an audio only source buffer.\n // By default, the audio in the combined virtual source buffer is enabled\n // and the audio-only source buffer (if it exists) is disabled.\n\n\n var disableCombined = false;\n var disableAudioOnly = true; // TODO: maybe we can store the sourcebuffers on the track objects?\n // safari may do something like this\n\n for (var i = 0; i < _this.player_.audioTracks().length; i++) {\n var track = _this.player_.audioTracks()[i];\n\n if (track.enabled && track.kind !== 'main') {\n // The enabled track is an alternate audio track so disable the audio in\n // the combined source buffer and enable the audio-only source buffer.\n disableCombined = true;\n disableAudioOnly = false;\n break;\n }\n }\n\n _this.sourceBuffers.forEach(function (sourceBuffer, index) {\n /* eslinst-disable */\n // TODO once codecs are required, we can switch to using the codecs to determine\n // what stream is the video stream, rather than relying on videoTracks\n\n /* eslinst-enable */\n sourceBuffer.appendAudioInitSegment_ = true;\n\n if (sourceBuffer.videoCodec_ && sourceBuffer.audioCodec_) {\n // combined\n sourceBuffer.audioDisabled_ = disableCombined;\n } else if (sourceBuffer.videoCodec_ && !sourceBuffer.audioCodec_) {\n // If the \"combined\" source buffer is video only, then we do not want\n // disable the audio-only source buffer (this is mostly for demuxed\n // audio and video hls)\n sourceBuffer.audioDisabled_ = true;\n disableAudioOnly = false;\n } else if (!sourceBuffer.videoCodec_ && sourceBuffer.audioCodec_) {\n // audio only\n // In the case of audio only with alternate audio and disableAudioOnly is true\n // this means we want to disable the audio on the alternate audio sourcebuffer\n // but not the main \"combined\" source buffer. The \"combined\" source buffer is\n // always at index 0, so this ensures audio won't be disabled in both source\n // buffers.\n sourceBuffer.audioDisabled_ = index ? disableAudioOnly : !disableAudioOnly;\n\n if (sourceBuffer.audioDisabled_) {\n return;\n }\n }\n\n _this.activeSourceBuffers_.push(sourceBuffer);\n });\n };\n\n _this.onPlayerMediachange_ = function () {\n _this.sourceBuffers.forEach(function (sourceBuffer) {\n sourceBuffer.appendAudioInitSegment_ = true;\n });\n };\n\n _this.onHlsReset_ = function () {\n _this.sourceBuffers.forEach(function (sourceBuffer) {\n if (sourceBuffer.transmuxer_) {\n sourceBuffer.transmuxer_.postMessage({\n action: 'resetCaptions'\n });\n }\n });\n };\n\n _this.onHlsSegmentTimeMapping_ = function (event) {\n _this.sourceBuffers.forEach(function (buffer) {\n return buffer.timeMapping_ = event.mapping;\n });\n }; // Re-emit MediaSource events on the polyfill\n\n\n ['sourceopen', 'sourceclose', 'sourceended'].forEach(function (eventName) {\n this.nativeMediaSource_.addEventListener(eventName, this.trigger.bind(this));\n }, _this); // capture the associated player when the MediaSource is\n // successfully attached\n\n _this.on('sourceopen', function (event) {\n // Get the player this MediaSource is attached to\n var video = document.querySelector('[src=\"' + _this.url_ + '\"]');\n\n if (!video) {\n return;\n }\n\n _this.player_ = videojs$1(video.parentNode);\n\n if (!_this.player_) {\n return;\n } // hls-reset is fired by videojs.Hls on to the tech after the main SegmentLoader\n // resets its state and flushes the buffer\n\n\n _this.player_.tech_.on('hls-reset', _this.onHlsReset_); // hls-segment-time-mapping is fired by videojs.Hls on to the tech after the main\n // SegmentLoader inspects an MTS segment and has an accurate stream to display\n // time mapping\n\n\n _this.player_.tech_.on('hls-segment-time-mapping', _this.onHlsSegmentTimeMapping_);\n\n if (_this.player_.audioTracks && _this.player_.audioTracks()) {\n _this.player_.audioTracks().on('change', _this.updateActiveSourceBuffers_);\n\n _this.player_.audioTracks().on('addtrack', _this.updateActiveSourceBuffers_);\n\n _this.player_.audioTracks().on('removetrack', _this.updateActiveSourceBuffers_);\n }\n\n _this.player_.on('mediachange', _this.onPlayerMediachange_);\n });\n\n _this.on('sourceended', function (event) {\n var duration = durationOfVideo(_this.duration);\n\n for (var i = 0; i < _this.sourceBuffers.length; i++) {\n var sourcebuffer = _this.sourceBuffers[i];\n var cues = sourcebuffer.metadataTrack_ && sourcebuffer.metadataTrack_.cues;\n\n if (cues && cues.length) {\n cues[cues.length - 1].endTime = duration;\n }\n }\n }); // explicitly terminate any WebWorkers that were created\n // by SourceHandlers\n\n\n _this.on('sourceclose', function (event) {\n this.sourceBuffers.forEach(function (sourceBuffer) {\n if (sourceBuffer.transmuxer_) {\n sourceBuffer.transmuxer_.terminate();\n }\n });\n this.sourceBuffers.length = 0;\n\n if (!this.player_) {\n return;\n }\n\n if (this.player_.audioTracks && this.player_.audioTracks()) {\n this.player_.audioTracks().off('change', this.updateActiveSourceBuffers_);\n this.player_.audioTracks().off('addtrack', this.updateActiveSourceBuffers_);\n this.player_.audioTracks().off('removetrack', this.updateActiveSourceBuffers_);\n } // We can only change this if the player hasn't been disposed of yet\n // because `off` eventually tries to use the el_ property. If it has\n // been disposed of, then don't worry about it because there are no\n // event handlers left to unbind anyway\n\n\n if (this.player_.el_) {\n this.player_.off('mediachange', this.onPlayerMediachange_);\n }\n\n if (this.player_.tech_ && this.player_.tech_.el_) {\n this.player_.tech_.off('hls-reset', this.onHlsReset_);\n this.player_.tech_.off('hls-segment-time-mapping', this.onHlsSegmentTimeMapping_);\n }\n });\n\n return _this;\n }\n /**\n * Add a range that that can now be seeked to.\n *\n * @param {Double} start where to start the addition\n * @param {Double} end where to end the addition\n * @private\n */\n\n\n createClass(HtmlMediaSource, [{\n key: 'addSeekableRange_',\n value: function addSeekableRange_(start, end) {\n var error = void 0;\n\n if (this.duration !== Infinity) {\n error = new Error('MediaSource.addSeekableRange() can only be invoked ' + 'when the duration is Infinity');\n error.name = 'InvalidStateError';\n error.code = 11;\n throw error;\n }\n\n if (end > this.nativeMediaSource_.duration || isNaN(this.nativeMediaSource_.duration)) {\n this.nativeMediaSource_.duration = end;\n }\n }\n /**\n * Add a source buffer to the media source.\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/addSourceBuffer\n * @param {String} type the content-type of the content\n * @return {Object} the created source buffer\n */\n\n }, {\n key: 'addSourceBuffer',\n value: function addSourceBuffer(type) {\n var buffer = void 0;\n var parsedType = parseContentType(type); // Create a VirtualSourceBuffer to transmux MPEG-2 transport\n // stream segments into fragmented MP4s\n\n if (/^(video|audio)\\/mp2t$/i.test(parsedType.type)) {\n var codecs = [];\n\n if (parsedType.parameters && parsedType.parameters.codecs) {\n codecs = parsedType.parameters.codecs.split(',');\n codecs = translateLegacyCodecs(codecs);\n codecs = codecs.filter(function (codec) {\n return isAudioCodec(codec) || isVideoCodec(codec);\n });\n }\n\n if (codecs.length === 0) {\n codecs = ['avc1.4d400d', 'mp4a.40.2'];\n }\n\n buffer = new VirtualSourceBuffer(this, codecs);\n\n if (this.sourceBuffers.length !== 0) {\n // If another VirtualSourceBuffer already exists, then we are creating a\n // SourceBuffer for an alternate audio track and therefore we know that\n // the source has both an audio and video track.\n // That means we should trigger the manual creation of the real\n // SourceBuffers instead of waiting for the transmuxer to return data\n this.sourceBuffers[0].createRealSourceBuffers_();\n buffer.createRealSourceBuffers_(); // Automatically disable the audio on the first source buffer if\n // a second source buffer is ever created\n\n this.sourceBuffers[0].audioDisabled_ = true;\n }\n } else {\n // delegate to the native implementation\n buffer = this.nativeMediaSource_.addSourceBuffer(type);\n }\n\n this.sourceBuffers.push(buffer);\n return buffer;\n }\n }]);\n return HtmlMediaSource;\n}(videojs$1.EventTarget);\n/**\n * @file videojs-contrib-media-sources.js\n */\n\n\nvar urlCount = 0; // ------------\n// Media Source\n// ------------\n// store references to the media sources so they can be connected\n// to a video element (a swf object)\n// TODO: can we store this somewhere local to this module?\n\nvideojs$1.mediaSources = {};\n/**\n * Provide a method for a swf object to notify JS that a\n * media source is now open.\n *\n * @param {String} msObjectURL string referencing the MSE Object URL\n * @param {String} swfId the swf id\n */\n\nvar open = function open(msObjectURL, swfId) {\n var mediaSource = videojs$1.mediaSources[msObjectURL];\n\n if (mediaSource) {\n mediaSource.trigger({\n type: 'sourceopen',\n swfId: swfId\n });\n } else {\n throw new Error('Media Source not found (Video.js)');\n }\n};\n/**\n * Check to see if the native MediaSource object exists and supports\n * an MP4 container with both H.264 video and AAC-LC audio.\n *\n * @return {Boolean} if native media sources are supported\n */\n\n\nvar supportsNativeMediaSources = function supportsNativeMediaSources() {\n return !!window$1.MediaSource && !!window$1.MediaSource.isTypeSupported && window$1.MediaSource.isTypeSupported('video/mp4;codecs=\"avc1.4d400d,mp4a.40.2\"');\n};\n/**\n * An emulation of the MediaSource API so that we can support\n * native and non-native functionality. returns an instance of\n * HtmlMediaSource.\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/MediaSource\n */\n\n\nvar MediaSource = function MediaSource() {\n this.MediaSource = {\n open: open,\n supportsNativeMediaSources: supportsNativeMediaSources\n };\n\n if (supportsNativeMediaSources()) {\n return new HtmlMediaSource();\n }\n\n throw new Error('Cannot use create a virtual MediaSource for this video');\n};\n\nMediaSource.open = open;\nMediaSource.supportsNativeMediaSources = supportsNativeMediaSources;\n/**\n * A wrapper around the native URL for our MSE object\n * implementation, this object is exposed under videojs.URL\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/API/URL/URL\n */\n\nvar URL$1 = {\n /**\n * A wrapper around the native createObjectURL for our objects.\n * This function maps a native or emulated mediaSource to a blob\n * url so that it can be loaded into video.js\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL\n * @param {MediaSource} object the object to create a blob url to\n */\n createObjectURL: function createObjectURL(object) {\n var objectUrlPrefix = 'blob:vjs-media-source/';\n var url = void 0; // use the native MediaSource to generate an object URL\n\n if (object instanceof HtmlMediaSource) {\n url = window$1.URL.createObjectURL(object.nativeMediaSource_);\n object.url_ = url;\n return url;\n } // if the object isn't an emulated MediaSource, delegate to the\n // native implementation\n\n\n if (!(object instanceof HtmlMediaSource)) {\n url = window$1.URL.createObjectURL(object);\n object.url_ = url;\n return url;\n } // build a URL that can be used to map back to the emulated\n // MediaSource\n\n\n url = objectUrlPrefix + urlCount;\n urlCount++; // setup the mapping back to object\n\n videojs$1.mediaSources[url] = object;\n return url;\n }\n};\nvideojs$1.MediaSource = MediaSource;\nvideojs$1.URL = URL$1;\nvar EventTarget$1$1 = videojs$1.EventTarget,\n mergeOptions$2 = videojs$1.mergeOptions;\n/**\n * Returns a new master manifest that is the result of merging an updated master manifest\n * into the original version.\n *\n * @param {Object} oldMaster\n * The old parsed mpd object\n * @param {Object} newMaster\n * The updated parsed mpd object\n * @return {Object}\n * A new object representing the original master manifest with the updated media\n * playlists merged in\n */\n\nvar updateMaster$1 = function updateMaster$$1(oldMaster, newMaster) {\n var update = mergeOptions$2(oldMaster, {\n // These are top level properties that can be updated\n duration: newMaster.duration,\n minimumUpdatePeriod: newMaster.minimumUpdatePeriod\n }); // First update the playlists in playlist list\n\n for (var i = 0; i < newMaster.playlists.length; i++) {\n var playlistUpdate = updateMaster(update, newMaster.playlists[i]);\n\n if (playlistUpdate) {\n update = playlistUpdate;\n }\n } // Then update media group playlists\n\n\n forEachMediaGroup(newMaster, function (properties, type, group, label) {\n if (properties.playlists && properties.playlists.length) {\n var uri = properties.playlists[0].uri;\n\n var _playlistUpdate = updateMaster(update, properties.playlists[0]);\n\n if (_playlistUpdate) {\n update = _playlistUpdate; // update the playlist reference within media groups\n\n update.mediaGroups[type][group][label].playlists[0] = update.playlists[uri];\n }\n }\n });\n return update;\n};\n\nvar DashPlaylistLoader = function (_EventTarget) {\n inherits(DashPlaylistLoader, _EventTarget); // DashPlaylistLoader must accept either a src url or a playlist because subsequent\n // playlist loader setups from media groups will expect to be able to pass a playlist\n // (since there aren't external URLs to media playlists with DASH)\n\n function DashPlaylistLoader(srcUrlOrPlaylist, hls, withCredentials, masterPlaylistLoader) {\n classCallCheck(this, DashPlaylistLoader);\n\n var _this = possibleConstructorReturn(this, (DashPlaylistLoader.__proto__ || Object.getPrototypeOf(DashPlaylistLoader)).call(this));\n\n _this.hls_ = hls;\n _this.withCredentials = withCredentials;\n\n if (!srcUrlOrPlaylist) {\n throw new Error('A non-empty playlist URL or playlist is required');\n } // event naming?\n\n\n _this.on('minimumUpdatePeriod', function () {\n _this.refreshXml_();\n }); // live playlist staleness timeout\n\n\n _this.on('mediaupdatetimeout', function () {\n _this.refreshMedia_();\n }); // initialize the loader state\n\n\n if (typeof srcUrlOrPlaylist === 'string') {\n _this.srcUrl = srcUrlOrPlaylist;\n _this.state = 'HAVE_NOTHING';\n return possibleConstructorReturn(_this);\n }\n\n _this.masterPlaylistLoader_ = masterPlaylistLoader;\n _this.state = 'HAVE_METADATA';\n _this.started = true; // we only should have one playlist so select it\n\n _this.media(srcUrlOrPlaylist); // trigger async to mimic behavior of HLS, where it must request a playlist\n\n\n window$1.setTimeout(function () {\n _this.trigger('loadedmetadata');\n }, 0);\n return _this;\n }\n\n createClass(DashPlaylistLoader, [{\n key: 'dispose',\n value: function dispose() {\n this.stopRequest();\n window$1.clearTimeout(this.mediaUpdateTimeout);\n }\n }, {\n key: 'stopRequest',\n value: function stopRequest() {\n if (this.request) {\n var oldRequest = this.request;\n this.request = null;\n oldRequest.onreadystatechange = null;\n oldRequest.abort();\n }\n }\n }, {\n key: 'media',\n value: function media(playlist) {\n // getter\n if (!playlist) {\n return this.media_;\n } // setter\n\n\n if (this.state === 'HAVE_NOTHING') {\n throw new Error('Cannot switch media playlist from ' + this.state);\n }\n\n var startingState = this.state; // find the playlist object if the target playlist has been specified by URI\n\n if (typeof playlist === 'string') {\n if (!this.master.playlists[playlist]) {\n throw new Error('Unknown playlist URI: ' + playlist);\n }\n\n playlist = this.master.playlists[playlist];\n }\n\n var mediaChange = !this.media_ || playlist.uri !== this.media_.uri;\n this.state = 'HAVE_METADATA'; // switching to the active playlist is a no-op\n\n if (!mediaChange) {\n return;\n } // switching from an already loaded playlist\n\n\n if (this.media_) {\n this.trigger('mediachanging');\n }\n\n this.media_ = playlist;\n this.refreshMedia_(); // trigger media change if the active media has been updated\n\n if (startingState !== 'HAVE_MASTER') {\n this.trigger('mediachange');\n }\n }\n }, {\n key: 'pause',\n value: function pause() {\n this.stopRequest();\n window$1.clearTimeout(this.mediaUpdateTimeout);\n\n if (this.state === 'HAVE_NOTHING') {\n // If we pause the loader before any data has been retrieved, its as if we never\n // started, so reset to an unstarted state.\n this.started = false;\n }\n }\n }, {\n key: 'load',\n value: function load(isFinalRendition) {\n var _this2 = this;\n\n window$1.clearTimeout(this.mediaUpdateTimeout);\n var media = this.media();\n\n if (isFinalRendition) {\n var delay = media ? media.targetDuration / 2 * 1000 : 5 * 1000;\n this.mediaUpdateTimeout = window$1.setTimeout(function () {\n return _this2.load();\n }, delay);\n return;\n } // because the playlists are internal to the manifest, load should either load the\n // main manifest, or do nothing but trigger an event\n\n\n if (!this.started) {\n this.start();\n return;\n }\n\n this.trigger('loadedplaylist');\n }\n /**\n * Parses the master xml string and updates playlist uri references\n *\n * @return {Object}\n * The parsed mpd manifest object\n */\n\n }, {\n key: 'parseMasterXml',\n value: function parseMasterXml() {\n var master = parse(this.masterXml_, {\n manifestUri: this.srcUrl,\n clientOffset: this.clientOffset_\n });\n master.uri = this.srcUrl; // Set up phony URIs for the playlists since we won't have external URIs for DASH\n // but reference playlists by their URI throughout the project\n // TODO: Should we create the dummy uris in mpd-parser as well (leaning towards yes).\n\n for (var i = 0; i < master.playlists.length; i++) {\n var phonyUri = 'placeholder-uri-' + i;\n master.playlists[i].uri = phonyUri; // set up by URI references\n\n master.playlists[phonyUri] = master.playlists[i];\n } // set up phony URIs for the media group playlists since we won't have external\n // URIs for DASH but reference playlists by their URI throughout the project\n\n\n forEachMediaGroup(master, function (properties, mediaType, groupKey, labelKey) {\n if (properties.playlists && properties.playlists.length) {\n var _phonyUri = 'placeholder-uri-' + mediaType + '-' + groupKey + '-' + labelKey;\n\n properties.playlists[0].uri = _phonyUri; // setup URI references\n\n master.playlists[_phonyUri] = properties.playlists[0];\n }\n });\n setupMediaPlaylists(master);\n resolveMediaGroupUris(master);\n return master;\n }\n }, {\n key: 'start',\n value: function start() {\n var _this3 = this;\n\n this.started = true; // request the specified URL\n\n this.request = this.hls_.xhr({\n uri: this.srcUrl,\n withCredentials: this.withCredentials\n }, function (error, req) {\n // disposed\n if (!_this3.request) {\n return;\n } // clear the loader's request reference\n\n\n _this3.request = null;\n\n if (error) {\n _this3.error = {\n status: req.status,\n message: 'DASH playlist request error at URL: ' + _this3.srcUrl,\n responseText: req.responseText,\n // MEDIA_ERR_NETWORK\n code: 2\n };\n\n if (_this3.state === 'HAVE_NOTHING') {\n _this3.started = false;\n }\n\n return _this3.trigger('error');\n }\n\n _this3.masterXml_ = req.responseText;\n\n if (req.responseHeaders && req.responseHeaders.date) {\n _this3.masterLoaded_ = Date.parse(req.responseHeaders.date);\n } else {\n _this3.masterLoaded_ = Date.now();\n }\n\n _this3.syncClientServerClock_(_this3.onClientServerClockSync_.bind(_this3));\n });\n }\n /**\n * Parses the master xml for UTCTiming node to sync the client clock to the server\n * clock. If the UTCTiming node requires a HEAD or GET request, that request is made.\n *\n * @param {Function} done\n * Function to call when clock sync has completed\n */\n\n }, {\n key: 'syncClientServerClock_',\n value: function syncClientServerClock_(done) {\n var _this4 = this;\n\n var utcTiming = parseUTCTiming(this.masterXml_); // No UTCTiming element found in the mpd. Use Date header from mpd request as the\n // server clock\n\n if (utcTiming === null) {\n this.clientOffset_ = this.masterLoaded_ - Date.now();\n return done();\n }\n\n if (utcTiming.method === 'DIRECT') {\n this.clientOffset_ = utcTiming.value - Date.now();\n return done();\n }\n\n this.request = this.hls_.xhr({\n uri: resolveUrl(this.srcUrl, utcTiming.value),\n method: utcTiming.method,\n withCredentials: this.withCredentials\n }, function (error, req) {\n // disposed\n if (!_this4.request) {\n return;\n }\n\n if (error) {\n // sync request failed, fall back to using date header from mpd\n // TODO: log warning\n _this4.clientOffset_ = _this4.masterLoaded_ - Date.now();\n return done();\n }\n\n var serverTime = void 0;\n\n if (utcTiming.method === 'HEAD') {\n if (!req.responseHeaders || !req.responseHeaders.date) {\n // expected date header not preset, fall back to using date header from mpd\n // TODO: log warning\n serverTime = _this4.masterLoaded_;\n } else {\n serverTime = Date.parse(req.responseHeaders.date);\n }\n } else {\n serverTime = Date.parse(req.responseText);\n }\n\n _this4.clientOffset_ = serverTime - Date.now();\n done();\n });\n }\n /**\n * Handler for after client/server clock synchronization has happened. Sets up\n * xml refresh timer if specificed by the manifest.\n */\n\n }, {\n key: 'onClientServerClockSync_',\n value: function onClientServerClockSync_() {\n var _this5 = this;\n\n this.master = this.parseMasterXml();\n this.state = 'HAVE_MASTER';\n this.trigger('loadedplaylist');\n\n if (!this.media_) {\n // no media playlist was specifically selected so start\n // from the first listed one\n this.media(this.master.playlists[0]);\n } // trigger loadedmetadata to resolve setup of media groups\n // trigger async to mimic behavior of HLS, where it must request a playlist\n\n\n window$1.setTimeout(function () {\n _this5.trigger('loadedmetadata');\n }, 0); // TODO: minimumUpdatePeriod can have a value of 0. Currently the manifest will not\n // be refreshed when this is the case. The inter-op guide says that when the\n // minimumUpdatePeriod is 0, the manifest should outline all currently available\n // segments, but future segments may require an update. I think a good solution\n // would be to update the manifest at the same rate that the media playlists\n // are \"refreshed\", i.e. every targetDuration.\n\n if (this.master.minimumUpdatePeriod) {\n window$1.setTimeout(function () {\n _this5.trigger('minimumUpdatePeriod');\n }, this.master.minimumUpdatePeriod);\n }\n }\n /**\n * Sends request to refresh the master xml and updates the parsed master manifest\n * TODO: Does the client offset need to be recalculated when the xml is refreshed?\n */\n\n }, {\n key: 'refreshXml_',\n value: function refreshXml_() {\n var _this6 = this;\n\n this.request = this.hls_.xhr({\n uri: this.srcUrl,\n withCredentials: this.withCredentials\n }, function (error, req) {\n // disposed\n if (!_this6.request) {\n return;\n } // clear the loader's request reference\n\n\n _this6.request = null;\n\n if (error) {\n _this6.error = {\n status: req.status,\n message: 'DASH playlist request error at URL: ' + _this6.srcUrl,\n responseText: req.responseText,\n // MEDIA_ERR_NETWORK\n code: 2\n };\n\n if (_this6.state === 'HAVE_NOTHING') {\n _this6.started = false;\n }\n\n return _this6.trigger('error');\n }\n\n _this6.masterXml_ = req.responseText;\n\n var newMaster = _this6.parseMasterXml();\n\n _this6.master = updateMaster$1(_this6.master, newMaster);\n window$1.setTimeout(function () {\n _this6.trigger('minimumUpdatePeriod');\n }, _this6.master.minimumUpdatePeriod);\n });\n }\n /**\n * Refreshes the media playlist by re-parsing the master xml and updating playlist\n * references. If this is an alternate loader, the updated parsed manifest is retrieved\n * from the master loader.\n */\n\n }, {\n key: 'refreshMedia_',\n value: function refreshMedia_() {\n var _this7 = this;\n\n var oldMaster = void 0;\n var newMaster = void 0;\n\n if (this.masterPlaylistLoader_) {\n oldMaster = this.masterPlaylistLoader_.master;\n newMaster = this.masterPlaylistLoader_.parseMasterXml();\n } else {\n oldMaster = this.master;\n newMaster = this.parseMasterXml();\n }\n\n var updatedMaster = updateMaster$1(oldMaster, newMaster);\n\n if (updatedMaster) {\n if (this.masterPlaylistLoader_) {\n this.masterPlaylistLoader_.master = updatedMaster;\n } else {\n this.master = updatedMaster;\n }\n\n this.media_ = updatedMaster.playlists[this.media_.uri];\n } else {\n this.trigger('playlistunchanged');\n }\n\n if (!this.media().endList) {\n this.mediaUpdateTimeout = window$1.setTimeout(function () {\n _this7.trigger('mediaupdatetimeout');\n }, refreshDelay(this.media(), !!updatedMaster));\n }\n\n this.trigger('loadedplaylist');\n }\n }]);\n return DashPlaylistLoader;\n}(EventTarget$1$1);\n\nvar logger = function logger(source) {\n if (videojs$1.log.debug) {\n return videojs$1.log.debug.bind(videojs$1, 'VHS:', source + ' >');\n }\n\n return function () {};\n};\n\nfunction noop() {}\n/**\n * @file source-updater.js\n */\n\n/**\n * A queue of callbacks to be serialized and applied when a\n * MediaSource and its associated SourceBuffers are not in the\n * updating state. It is used by the segment loader to update the\n * underlying SourceBuffers when new data is loaded, for instance.\n *\n * @class SourceUpdater\n * @param {MediaSource} mediaSource the MediaSource to create the\n * SourceBuffer from\n * @param {String} mimeType the desired MIME type of the underlying\n * SourceBuffer\n * @param {Object} sourceBufferEmitter an event emitter that fires when a source buffer is\n * added to the media source\n */\n\n\nvar SourceUpdater = function () {\n function SourceUpdater(mediaSource, mimeType, type, sourceBufferEmitter) {\n classCallCheck(this, SourceUpdater);\n this.callbacks_ = [];\n this.pendingCallback_ = null;\n this.timestampOffset_ = 0;\n this.mediaSource = mediaSource;\n this.processedAppend_ = false;\n this.type_ = type;\n this.mimeType_ = mimeType;\n this.logger_ = logger('SourceUpdater[' + type + '][' + mimeType + ']');\n\n if (mediaSource.readyState === 'closed') {\n mediaSource.addEventListener('sourceopen', this.createSourceBuffer_.bind(this, mimeType, sourceBufferEmitter));\n } else {\n this.createSourceBuffer_(mimeType, sourceBufferEmitter);\n }\n }\n\n createClass(SourceUpdater, [{\n key: 'createSourceBuffer_',\n value: function createSourceBuffer_(mimeType, sourceBufferEmitter) {\n var _this = this;\n\n this.sourceBuffer_ = this.mediaSource.addSourceBuffer(mimeType);\n this.logger_('created SourceBuffer');\n\n if (sourceBufferEmitter) {\n sourceBufferEmitter.trigger('sourcebufferadded');\n\n if (this.mediaSource.sourceBuffers.length < 2) {\n // There's another source buffer we must wait for before we can start updating\n // our own (or else we can get into a bad state, i.e., appending video/audio data\n // before the other video/audio source buffer is available and leading to a video\n // or audio only buffer).\n sourceBufferEmitter.on('sourcebufferadded', function () {\n _this.start_();\n });\n return;\n }\n }\n\n this.start_();\n }\n }, {\n key: 'start_',\n value: function start_() {\n var _this2 = this;\n\n this.started_ = true; // run completion handlers and process callbacks as updateend\n // events fire\n\n this.onUpdateendCallback_ = function () {\n var pendingCallback = _this2.pendingCallback_;\n _this2.pendingCallback_ = null;\n\n _this2.logger_('buffered [' + printableRange(_this2.buffered()) + ']');\n\n if (pendingCallback) {\n pendingCallback();\n }\n\n _this2.runCallback_();\n };\n\n this.sourceBuffer_.addEventListener('updateend', this.onUpdateendCallback_);\n this.runCallback_();\n }\n /**\n * Aborts the current segment and resets the segment parser.\n *\n * @param {Function} done function to call when done\n * @see http://w3c.github.io/media-source/#widl-SourceBuffer-abort-void\n */\n\n }, {\n key: 'abort',\n value: function abort(done) {\n var _this3 = this;\n\n if (this.processedAppend_) {\n this.queueCallback_(function () {\n _this3.sourceBuffer_.abort();\n }, done);\n }\n }\n /**\n * Queue an update to append an ArrayBuffer.\n *\n * @param {ArrayBuffer} bytes\n * @param {Function} done the function to call when done\n * @see http://www.w3.org/TR/media-source/#widl-SourceBuffer-appendBuffer-void-ArrayBuffer-data\n */\n\n }, {\n key: 'appendBuffer',\n value: function appendBuffer(bytes, done) {\n var _this4 = this;\n\n this.processedAppend_ = true;\n this.queueCallback_(function () {\n _this4.sourceBuffer_.appendBuffer(bytes);\n }, done);\n }\n /**\n * Indicates what TimeRanges are buffered in the managed SourceBuffer.\n *\n * @see http://www.w3.org/TR/media-source/#widl-SourceBuffer-buffered\n */\n\n }, {\n key: 'buffered',\n value: function buffered() {\n if (!this.sourceBuffer_) {\n return videojs$1.createTimeRanges();\n }\n\n return this.sourceBuffer_.buffered;\n }\n /**\n * Queue an update to remove a time range from the buffer.\n *\n * @param {Number} start where to start the removal\n * @param {Number} end where to end the removal\n * @param {Function} [done=noop] optional callback to be executed when the remove\n * operation is complete\n * @see http://www.w3.org/TR/media-source/#widl-SourceBuffer-remove-void-double-start-unrestricted-double-end\n */\n\n }, {\n key: 'remove',\n value: function remove(start, end) {\n var _this5 = this;\n\n var done = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : noop;\n\n if (this.processedAppend_) {\n this.queueCallback_(function () {\n _this5.logger_('remove [' + start + ' => ' + end + ']');\n\n _this5.sourceBuffer_.remove(start, end);\n }, done);\n }\n }\n /**\n * Whether the underlying sourceBuffer is updating or not\n *\n * @return {Boolean} the updating status of the SourceBuffer\n */\n\n }, {\n key: 'updating',\n value: function updating() {\n return !this.sourceBuffer_ || this.sourceBuffer_.updating || this.pendingCallback_;\n }\n /**\n * Set/get the timestampoffset on the SourceBuffer\n *\n * @return {Number} the timestamp offset\n */\n\n }, {\n key: 'timestampOffset',\n value: function timestampOffset(offset) {\n var _this6 = this;\n\n if (typeof offset !== 'undefined') {\n this.queueCallback_(function () {\n _this6.sourceBuffer_.timestampOffset = offset;\n });\n this.timestampOffset_ = offset;\n }\n\n return this.timestampOffset_;\n }\n /**\n * Queue a callback to run\n */\n\n }, {\n key: 'queueCallback_',\n value: function queueCallback_(callback, done) {\n this.callbacks_.push([callback.bind(this), done]);\n this.runCallback_();\n }\n /**\n * Run a queued callback\n */\n\n }, {\n key: 'runCallback_',\n value: function runCallback_() {\n var callbacks = void 0;\n\n if (!this.updating() && this.callbacks_.length && this.started_) {\n callbacks = this.callbacks_.shift();\n this.pendingCallback_ = callbacks[1];\n callbacks[0]();\n }\n }\n /**\n * dispose of the source updater and the underlying sourceBuffer\n */\n\n }, {\n key: 'dispose',\n value: function dispose() {\n this.sourceBuffer_.removeEventListener('updateend', this.onUpdateendCallback_);\n\n if (this.sourceBuffer_ && this.mediaSource.readyState === 'open') {\n this.sourceBuffer_.abort();\n }\n }\n }]);\n return SourceUpdater;\n}();\n\nvar Config = {\n GOAL_BUFFER_LENGTH: 30,\n MAX_GOAL_BUFFER_LENGTH: 60,\n GOAL_BUFFER_LENGTH_RATE: 1,\n // 0.5 MB/s\n INITIAL_BANDWIDTH: 4194304,\n // A fudge factor to apply to advertised playlist bitrates to account for\n // temporary flucations in client bandwidth\n BANDWIDTH_VARIANCE: 1.2,\n // How much of the buffer must be filled before we consider upswitching\n BUFFER_LOW_WATER_LINE: 0,\n MAX_BUFFER_LOW_WATER_LINE: 30,\n BUFFER_LOW_WATER_LINE_RATE: 1\n};\nvar REQUEST_ERRORS = {\n FAILURE: 2,\n TIMEOUT: -101,\n ABORTED: -102\n};\n/**\n * Turns segment byterange into a string suitable for use in\n * HTTP Range requests\n *\n * @param {Object} byterange - an object with two values defining the start and end\n * of a byte-range\n */\n\nvar byterangeStr = function byterangeStr(byterange) {\n var byterangeStart = void 0;\n var byterangeEnd = void 0; // `byterangeEnd` is one less than `offset + length` because the HTTP range\n // header uses inclusive ranges\n\n byterangeEnd = byterange.offset + byterange.length - 1;\n byterangeStart = byterange.offset;\n return 'bytes=' + byterangeStart + '-' + byterangeEnd;\n};\n/**\n * Defines headers for use in the xhr request for a particular segment.\n *\n * @param {Object} segment - a simplified copy of the segmentInfo object\n * from SegmentLoader\n */\n\n\nvar segmentXhrHeaders = function segmentXhrHeaders(segment) {\n var headers = {};\n\n if (segment.byterange) {\n headers.Range = byterangeStr(segment.byterange);\n }\n\n return headers;\n};\n/**\n * Abort all requests\n *\n * @param {Object} activeXhrs - an object that tracks all XHR requests\n */\n\n\nvar abortAll = function abortAll(activeXhrs) {\n activeXhrs.forEach(function (xhr$$1) {\n xhr$$1.abort();\n });\n};\n/**\n * Gather important bandwidth stats once a request has completed\n *\n * @param {Object} request - the XHR request from which to gather stats\n */\n\n\nvar getRequestStats = function getRequestStats(request) {\n return {\n bandwidth: request.bandwidth,\n bytesReceived: request.bytesReceived || 0,\n roundTripTime: request.roundTripTime || 0\n };\n};\n/**\n * If possible gather bandwidth stats as a request is in\n * progress\n *\n * @param {Event} progressEvent - an event object from an XHR's progress event\n */\n\n\nvar getProgressStats = function getProgressStats(progressEvent) {\n var request = progressEvent.target;\n var roundTripTime = Date.now() - request.requestTime;\n var stats = {\n bandwidth: Infinity,\n bytesReceived: 0,\n roundTripTime: roundTripTime || 0\n };\n stats.bytesReceived = progressEvent.loaded; // This can result in Infinity if stats.roundTripTime is 0 but that is ok\n // because we should only use bandwidth stats on progress to determine when\n // abort a request early due to insufficient bandwidth\n\n stats.bandwidth = Math.floor(stats.bytesReceived / stats.roundTripTime * 8 * 1000);\n return stats;\n};\n/**\n * Handle all error conditions in one place and return an object\n * with all the information\n *\n * @param {Error|null} error - if non-null signals an error occured with the XHR\n * @param {Object} request - the XHR request that possibly generated the error\n */\n\n\nvar handleErrors = function handleErrors(error, request) {\n if (request.timedout) {\n return {\n status: request.status,\n message: 'HLS request timed-out at URL: ' + request.uri,\n code: REQUEST_ERRORS.TIMEOUT,\n xhr: request\n };\n }\n\n if (request.aborted) {\n return {\n status: request.status,\n message: 'HLS request aborted at URL: ' + request.uri,\n code: REQUEST_ERRORS.ABORTED,\n xhr: request\n };\n }\n\n if (error) {\n return {\n status: request.status,\n message: 'HLS request errored at URL: ' + request.uri,\n code: REQUEST_ERRORS.FAILURE,\n xhr: request\n };\n }\n\n return null;\n};\n/**\n * Handle responses for key data and convert the key data to the correct format\n * for the decryption step later\n *\n * @param {Object} segment - a simplified copy of the segmentInfo object\n * from SegmentLoader\n * @param {Function} finishProcessingFn - a callback to execute to continue processing\n * this request\n */\n\n\nvar handleKeyResponse = function handleKeyResponse(segment, finishProcessingFn) {\n return function (error, request) {\n var response = request.response;\n var errorObj = handleErrors(error, request);\n\n if (errorObj) {\n return finishProcessingFn(errorObj, segment);\n }\n\n if (response.byteLength !== 16) {\n return finishProcessingFn({\n status: request.status,\n message: 'Invalid HLS key at URL: ' + request.uri,\n code: REQUEST_ERRORS.FAILURE,\n xhr: request\n }, segment);\n }\n\n var view = new DataView(response);\n segment.key.bytes = new Uint32Array([view.getUint32(0), view.getUint32(4), view.getUint32(8), view.getUint32(12)]);\n return finishProcessingFn(null, segment);\n };\n};\n/**\n * Handle init-segment responses\n *\n * @param {Object} segment - a simplified copy of the segmentInfo object\n * from SegmentLoader\n * @param {Function} finishProcessingFn - a callback to execute to continue processing\n * this request\n */\n\n\nvar handleInitSegmentResponse = function handleInitSegmentResponse(segment, captionParser, finishProcessingFn) {\n return function (error, request) {\n var response = request.response;\n var errorObj = handleErrors(error, request);\n\n if (errorObj) {\n return finishProcessingFn(errorObj, segment);\n } // stop processing if received empty content\n\n\n if (response.byteLength === 0) {\n return finishProcessingFn({\n status: request.status,\n message: 'Empty HLS segment content at URL: ' + request.uri,\n code: REQUEST_ERRORS.FAILURE,\n xhr: request\n }, segment);\n }\n\n segment.map.bytes = new Uint8Array(request.response); // Initialize CaptionParser if it hasn't been yet\n\n if (!captionParser.isInitialized()) {\n captionParser.init();\n }\n\n segment.map.timescales = mp4probe.timescale(segment.map.bytes);\n segment.map.videoTrackIds = mp4probe.videoTrackIds(segment.map.bytes);\n return finishProcessingFn(null, segment);\n };\n};\n/**\n * Response handler for segment-requests being sure to set the correct\n * property depending on whether the segment is encryped or not\n * Also records and keeps track of stats that are used for ABR purposes\n *\n * @param {Object} segment - a simplified copy of the segmentInfo object\n * from SegmentLoader\n * @param {Function} finishProcessingFn - a callback to execute to continue processing\n * this request\n */\n\n\nvar handleSegmentResponse = function handleSegmentResponse(segment, captionParser, finishProcessingFn) {\n return function (error, request) {\n var response = request.response;\n var errorObj = handleErrors(error, request);\n var parsed = void 0;\n\n if (errorObj) {\n return finishProcessingFn(errorObj, segment);\n } // stop processing if received empty content\n\n\n if (response.byteLength === 0) {\n return finishProcessingFn({\n status: request.status,\n message: 'Empty HLS segment content at URL: ' + request.uri,\n code: REQUEST_ERRORS.FAILURE,\n xhr: request\n }, segment);\n }\n\n segment.stats = getRequestStats(request);\n\n if (segment.key) {\n segment.encryptedBytes = new Uint8Array(request.response);\n } else {\n segment.bytes = new Uint8Array(request.response);\n } // This is likely an FMP4 and has the init segment.\n // Run through the CaptionParser in case there are captions.\n\n\n if (segment.map && segment.map.bytes) {\n // Initialize CaptionParser if it hasn't been yet\n if (!captionParser.isInitialized()) {\n captionParser.init();\n }\n\n parsed = captionParser.parse(segment.bytes, segment.map.videoTrackIds, segment.map.timescales);\n\n if (parsed && parsed.captions) {\n segment.captionStreams = parsed.captionStreams;\n segment.fmp4Captions = parsed.captions;\n }\n }\n\n return finishProcessingFn(null, segment);\n };\n};\n/**\n * Decrypt the segment via the decryption web worker\n *\n * @param {WebWorker} decrypter - a WebWorker interface to AES-128 decryption routines\n * @param {Object} segment - a simplified copy of the segmentInfo object\n * from SegmentLoader\n * @param {Function} doneFn - a callback that is executed after decryption has completed\n */\n\n\nvar decryptSegment = function decryptSegment(decrypter, segment, doneFn) {\n var decryptionHandler = function decryptionHandler(event) {\n if (event.data.source === segment.requestId) {\n decrypter.removeEventListener('message', decryptionHandler);\n var decrypted = event.data.decrypted;\n segment.bytes = new Uint8Array(decrypted.bytes, decrypted.byteOffset, decrypted.byteLength);\n return doneFn(null, segment);\n }\n };\n\n decrypter.addEventListener('message', decryptionHandler); // this is an encrypted segment\n // incrementally decrypt the segment\n\n decrypter.postMessage(createTransferableMessage({\n source: segment.requestId,\n encrypted: segment.encryptedBytes,\n key: segment.key.bytes,\n iv: segment.key.iv\n }), [segment.encryptedBytes.buffer, segment.key.bytes.buffer]);\n};\n/**\n * This function waits for all XHRs to finish (with either success or failure)\n * before continueing processing via it's callback. The function gathers errors\n * from each request into a single errors array so that the error status for\n * each request can be examined later.\n *\n * @param {Object} activeXhrs - an object that tracks all XHR requests\n * @param {WebWorker} decrypter - a WebWorker interface to AES-128 decryption routines\n * @param {Function} doneFn - a callback that is executed after all resources have been\n * downloaded and any decryption completed\n */\n\n\nvar waitForCompletion = function waitForCompletion(activeXhrs, decrypter, doneFn) {\n var count = 0;\n var didError = false;\n return function (error, segment) {\n if (didError) {\n return;\n }\n\n if (error) {\n didError = true; // If there are errors, we have to abort any outstanding requests\n\n abortAll(activeXhrs); // Even though the requests above are aborted, and in theory we could wait until we\n // handle the aborted events from those requests, there are some cases where we may\n // never get an aborted event. For instance, if the network connection is lost and\n // there were two requests, the first may have triggered an error immediately, while\n // the second request remains unsent. In that case, the aborted algorithm will not\n // trigger an abort: see https://xhr.spec.whatwg.org/#the-abort()-method\n //\n // We also can't rely on the ready state of the XHR, since the request that\n // triggered the connection error may also show as a ready state of 0 (unsent).\n // Therefore, we have to finish this group of requests immediately after the first\n // seen error.\n\n return doneFn(error, segment);\n }\n\n count += 1;\n\n if (count === activeXhrs.length) {\n // Keep track of when *all* of the requests have completed\n segment.endOfAllRequests = Date.now();\n\n if (segment.encryptedBytes) {\n return decryptSegment(decrypter, segment, doneFn);\n } // Otherwise, everything is ready just continue\n\n\n return doneFn(null, segment);\n }\n };\n};\n/**\n * Simple progress event callback handler that gathers some stats before\n * executing a provided callback with the `segment` object\n *\n * @param {Object} segment - a simplified copy of the segmentInfo object\n * from SegmentLoader\n * @param {Function} progressFn - a callback that is executed each time a progress event\n * is received\n * @param {Event} event - the progress event object from XMLHttpRequest\n */\n\n\nvar handleProgress = function handleProgress(segment, progressFn) {\n return function (event) {\n segment.stats = videojs$1.mergeOptions(segment.stats, getProgressStats(event)); // record the time that we receive the first byte of data\n\n if (!segment.stats.firstBytesReceivedAt && segment.stats.bytesReceived) {\n segment.stats.firstBytesReceivedAt = Date.now();\n }\n\n return progressFn(event, segment);\n };\n};\n/**\n * Load all resources and does any processing necessary for a media-segment\n *\n * Features:\n * decrypts the media-segment if it has a key uri and an iv\n * aborts *all* requests if *any* one request fails\n *\n * The segment object, at minimum, has the following format:\n * {\n * resolvedUri: String,\n * [byterange]: {\n * offset: Number,\n * length: Number\n * },\n * [key]: {\n * resolvedUri: String\n * [byterange]: {\n * offset: Number,\n * length: Number\n * },\n * iv: {\n * bytes: Uint32Array\n * }\n * },\n * [map]: {\n * resolvedUri: String,\n * [byterange]: {\n * offset: Number,\n * length: Number\n * },\n * [bytes]: Uint8Array\n * }\n * }\n * ...where [name] denotes optional properties\n *\n * @param {Function} xhr - an instance of the xhr wrapper in xhr.js\n * @param {Object} xhrOptions - the base options to provide to all xhr requests\n * @param {WebWorker} decryptionWorker - a WebWorker interface to AES-128\n * decryption routines\n * @param {Object} segment - a simplified copy of the segmentInfo object\n * from SegmentLoader\n * @param {Function} progressFn - a callback that receives progress events from the main\n * segment's xhr request\n * @param {Function} doneFn - a callback that is executed only once all requests have\n * succeeded or failed\n * @returns {Function} a function that, when invoked, immediately aborts all\n * outstanding requests\n */\n\n\nvar mediaSegmentRequest = function mediaSegmentRequest(xhr$$1, xhrOptions, decryptionWorker, captionParser, segment, progressFn, doneFn) {\n var activeXhrs = [];\n var finishProcessingFn = waitForCompletion(activeXhrs, decryptionWorker, doneFn); // optionally, request the decryption key\n\n if (segment.key) {\n var keyRequestOptions = videojs$1.mergeOptions(xhrOptions, {\n uri: segment.key.resolvedUri,\n responseType: 'arraybuffer'\n });\n var keyRequestCallback = handleKeyResponse(segment, finishProcessingFn);\n var keyXhr = xhr$$1(keyRequestOptions, keyRequestCallback);\n activeXhrs.push(keyXhr);\n } // optionally, request the associated media init segment\n\n\n if (segment.map && !segment.map.bytes) {\n var initSegmentOptions = videojs$1.mergeOptions(xhrOptions, {\n uri: segment.map.resolvedUri,\n responseType: 'arraybuffer',\n headers: segmentXhrHeaders(segment.map)\n });\n var initSegmentRequestCallback = handleInitSegmentResponse(segment, captionParser, finishProcessingFn);\n var initSegmentXhr = xhr$$1(initSegmentOptions, initSegmentRequestCallback);\n activeXhrs.push(initSegmentXhr);\n }\n\n var segmentRequestOptions = videojs$1.mergeOptions(xhrOptions, {\n uri: segment.resolvedUri,\n responseType: 'arraybuffer',\n headers: segmentXhrHeaders(segment)\n });\n var segmentRequestCallback = handleSegmentResponse(segment, captionParser, finishProcessingFn);\n var segmentXhr = xhr$$1(segmentRequestOptions, segmentRequestCallback);\n segmentXhr.addEventListener('progress', handleProgress(segment, progressFn));\n activeXhrs.push(segmentXhr);\n return function () {\n return abortAll(activeXhrs);\n };\n}; // Utilities\n\n/**\n * Returns the CSS value for the specified property on an element\n * using `getComputedStyle`. Firefox has a long-standing issue where\n * getComputedStyle() may return null when running in an iframe with\n * `display: none`.\n *\n * @see https://bugzilla.mozilla.org/show_bug.cgi?id=548397\n * @param {HTMLElement} el the htmlelement to work on\n * @param {string} the proprety to get the style for\n */\n\n\nvar safeGetComputedStyle = function safeGetComputedStyle(el, property) {\n var result = void 0;\n\n if (!el) {\n return '';\n }\n\n result = window$1.getComputedStyle(el);\n\n if (!result) {\n return '';\n }\n\n return result[property];\n};\n/**\n * Resuable stable sort function\n *\n * @param {Playlists} array\n * @param {Function} sortFn Different comparators\n * @function stableSort\n */\n\n\nvar stableSort = function stableSort(array, sortFn) {\n var newArray = array.slice();\n array.sort(function (left, right) {\n var cmp = sortFn(left, right);\n\n if (cmp === 0) {\n return newArray.indexOf(left) - newArray.indexOf(right);\n }\n\n return cmp;\n });\n};\n/**\n * A comparator function to sort two playlist object by bandwidth.\n *\n * @param {Object} left a media playlist object\n * @param {Object} right a media playlist object\n * @return {Number} Greater than zero if the bandwidth attribute of\n * left is greater than the corresponding attribute of right. Less\n * than zero if the bandwidth of right is greater than left and\n * exactly zero if the two are equal.\n */\n\n\nvar comparePlaylistBandwidth = function comparePlaylistBandwidth(left, right) {\n var leftBandwidth = void 0;\n var rightBandwidth = void 0;\n\n if (left.attributes.BANDWIDTH) {\n leftBandwidth = left.attributes.BANDWIDTH;\n }\n\n leftBandwidth = leftBandwidth || window$1.Number.MAX_VALUE;\n\n if (right.attributes.BANDWIDTH) {\n rightBandwidth = right.attributes.BANDWIDTH;\n }\n\n rightBandwidth = rightBandwidth || window$1.Number.MAX_VALUE;\n return leftBandwidth - rightBandwidth;\n};\n/**\n * A comparator function to sort two playlist object by resolution (width).\n * @param {Object} left a media playlist object\n * @param {Object} right a media playlist object\n * @return {Number} Greater than zero if the resolution.width attribute of\n * left is greater than the corresponding attribute of right. Less\n * than zero if the resolution.width of right is greater than left and\n * exactly zero if the two are equal.\n */\n\n\nvar comparePlaylistResolution = function comparePlaylistResolution(left, right) {\n var leftWidth = void 0;\n var rightWidth = void 0;\n\n if (left.attributes.RESOLUTION && left.attributes.RESOLUTION.width) {\n leftWidth = left.attributes.RESOLUTION.width;\n }\n\n leftWidth = leftWidth || window$1.Number.MAX_VALUE;\n\n if (right.attributes.RESOLUTION && right.attributes.RESOLUTION.width) {\n rightWidth = right.attributes.RESOLUTION.width;\n }\n\n rightWidth = rightWidth || window$1.Number.MAX_VALUE; // NOTE - Fallback to bandwidth sort as appropriate in cases where multiple renditions\n // have the same media dimensions/ resolution\n\n if (leftWidth === rightWidth && left.attributes.BANDWIDTH && right.attributes.BANDWIDTH) {\n return left.attributes.BANDWIDTH - right.attributes.BANDWIDTH;\n }\n\n return leftWidth - rightWidth;\n};\n/**\n * Chooses the appropriate media playlist based on bandwidth and player size\n *\n * @param {Object} master\n * Object representation of the master manifest\n * @param {Number} playerBandwidth\n * Current calculated bandwidth of the player\n * @param {Number} playerWidth\n * Current width of the player element\n * @param {Number} playerHeight\n * Current height of the player element\n * @param {Boolean} limitRenditionByPlayerDimensions\n * True if the player width and height should be used during the selection, false otherwise\n * @return {Playlist} the highest bitrate playlist less than the\n * currently detected bandwidth, accounting for some amount of\n * bandwidth variance\n */\n\n\nvar simpleSelector = function simpleSelector(master, playerBandwidth, playerWidth, playerHeight, limitRenditionByPlayerDimensions) {\n // convert the playlists to an intermediary representation to make comparisons easier\n var sortedPlaylistReps = master.playlists.map(function (playlist) {\n var width = void 0;\n var height = void 0;\n var bandwidth = void 0;\n width = playlist.attributes.RESOLUTION && playlist.attributes.RESOLUTION.width;\n height = playlist.attributes.RESOLUTION && playlist.attributes.RESOLUTION.height;\n bandwidth = playlist.attributes.BANDWIDTH;\n bandwidth = bandwidth || window$1.Number.MAX_VALUE;\n return {\n bandwidth: bandwidth,\n width: width,\n height: height,\n playlist: playlist\n };\n });\n stableSort(sortedPlaylistReps, function (left, right) {\n return left.bandwidth - right.bandwidth;\n }); // filter out any playlists that have been excluded due to\n // incompatible configurations\n\n sortedPlaylistReps = sortedPlaylistReps.filter(function (rep) {\n return !Playlist.isIncompatible(rep.playlist);\n }); // filter out any playlists that have been disabled manually through the representations\n // api or blacklisted temporarily due to playback errors.\n\n var enabledPlaylistReps = sortedPlaylistReps.filter(function (rep) {\n return Playlist.isEnabled(rep.playlist);\n });\n\n if (!enabledPlaylistReps.length) {\n // if there are no enabled playlists, then they have all been blacklisted or disabled\n // by the user through the representations api. In this case, ignore blacklisting and\n // fallback to what the user wants by using playlists the user has not disabled.\n enabledPlaylistReps = sortedPlaylistReps.filter(function (rep) {\n return !Playlist.isDisabled(rep.playlist);\n });\n } // filter out any variant that has greater effective bitrate\n // than the current estimated bandwidth\n\n\n var bandwidthPlaylistReps = enabledPlaylistReps.filter(function (rep) {\n return rep.bandwidth * Config.BANDWIDTH_VARIANCE < playerBandwidth;\n });\n var highestRemainingBandwidthRep = bandwidthPlaylistReps[bandwidthPlaylistReps.length - 1]; // get all of the renditions with the same (highest) bandwidth\n // and then taking the very first element\n\n var bandwidthBestRep = bandwidthPlaylistReps.filter(function (rep) {\n return rep.bandwidth === highestRemainingBandwidthRep.bandwidth;\n })[0]; // if we're not going to limit renditions by player size, make an early decision.\n\n if (limitRenditionByPlayerDimensions === false) {\n var _chosenRep = bandwidthBestRep || enabledPlaylistReps[0] || sortedPlaylistReps[0];\n\n return _chosenRep ? _chosenRep.playlist : null;\n } // filter out playlists without resolution information\n\n\n var haveResolution = bandwidthPlaylistReps.filter(function (rep) {\n return rep.width && rep.height;\n }); // sort variants by resolution\n\n stableSort(haveResolution, function (left, right) {\n return left.width - right.width;\n }); // if we have the exact resolution as the player use it\n\n var resolutionBestRepList = haveResolution.filter(function (rep) {\n return rep.width === playerWidth && rep.height === playerHeight;\n });\n highestRemainingBandwidthRep = resolutionBestRepList[resolutionBestRepList.length - 1]; // ensure that we pick the highest bandwidth variant that have exact resolution\n\n var resolutionBestRep = resolutionBestRepList.filter(function (rep) {\n return rep.bandwidth === highestRemainingBandwidthRep.bandwidth;\n })[0];\n var resolutionPlusOneList = void 0;\n var resolutionPlusOneSmallest = void 0;\n var resolutionPlusOneRep = void 0; // find the smallest variant that is larger than the player\n // if there is no match of exact resolution\n\n if (!resolutionBestRep) {\n resolutionPlusOneList = haveResolution.filter(function (rep) {\n return rep.width > playerWidth || rep.height > playerHeight;\n }); // find all the variants have the same smallest resolution\n\n resolutionPlusOneSmallest = resolutionPlusOneList.filter(function (rep) {\n return rep.width === resolutionPlusOneList[0].width && rep.height === resolutionPlusOneList[0].height;\n }); // ensure that we also pick the highest bandwidth variant that\n // is just-larger-than the video player\n\n highestRemainingBandwidthRep = resolutionPlusOneSmallest[resolutionPlusOneSmallest.length - 1];\n resolutionPlusOneRep = resolutionPlusOneSmallest.filter(function (rep) {\n return rep.bandwidth === highestRemainingBandwidthRep.bandwidth;\n })[0];\n } // fallback chain of variants\n\n\n var chosenRep = resolutionPlusOneRep || resolutionBestRep || bandwidthBestRep || enabledPlaylistReps[0] || sortedPlaylistReps[0];\n return chosenRep ? chosenRep.playlist : null;\n}; // Playlist Selectors\n\n/**\n * Chooses the appropriate media playlist based on the most recent\n * bandwidth estimate and the player size.\n *\n * Expects to be called within the context of an instance of HlsHandler\n *\n * @return {Playlist} the highest bitrate playlist less than the\n * currently detected bandwidth, accounting for some amount of\n * bandwidth variance\n */\n\n\nvar lastBandwidthSelector = function lastBandwidthSelector() {\n return simpleSelector(this.playlists.master, this.systemBandwidth, parseInt(safeGetComputedStyle(this.tech_.el(), 'width'), 10), parseInt(safeGetComputedStyle(this.tech_.el(), 'height'), 10), this.limitRenditionByPlayerDimensions);\n};\n/**\n * Chooses the appropriate media playlist based on the potential to rebuffer\n *\n * @param {Object} settings\n * Object of information required to use this selector\n * @param {Object} settings.master\n * Object representation of the master manifest\n * @param {Number} settings.currentTime\n * The current time of the player\n * @param {Number} settings.bandwidth\n * Current measured bandwidth\n * @param {Number} settings.duration\n * Duration of the media\n * @param {Number} settings.segmentDuration\n * Segment duration to be used in round trip time calculations\n * @param {Number} settings.timeUntilRebuffer\n * Time left in seconds until the player has to rebuffer\n * @param {Number} settings.currentTimeline\n * The current timeline segments are being loaded from\n * @param {SyncController} settings.syncController\n * SyncController for determining if we have a sync point for a given playlist\n * @return {Object|null}\n * {Object} return.playlist\n * The highest bandwidth playlist with the least amount of rebuffering\n * {Number} return.rebufferingImpact\n * The amount of time in seconds switching to this playlist will rebuffer. A\n * negative value means that switching will cause zero rebuffering.\n */\n\n\nvar minRebufferMaxBandwidthSelector = function minRebufferMaxBandwidthSelector(settings) {\n var master = settings.master,\n currentTime = settings.currentTime,\n bandwidth = settings.bandwidth,\n duration$$1 = settings.duration,\n segmentDuration = settings.segmentDuration,\n timeUntilRebuffer = settings.timeUntilRebuffer,\n currentTimeline = settings.currentTimeline,\n syncController = settings.syncController; // filter out any playlists that have been excluded due to\n // incompatible configurations\n\n var compatiblePlaylists = master.playlists.filter(function (playlist) {\n return !Playlist.isIncompatible(playlist);\n }); // filter out any playlists that have been disabled manually through the representations\n // api or blacklisted temporarily due to playback errors.\n\n var enabledPlaylists = compatiblePlaylists.filter(Playlist.isEnabled);\n\n if (!enabledPlaylists.length) {\n // if there are no enabled playlists, then they have all been blacklisted or disabled\n // by the user through the representations api. In this case, ignore blacklisting and\n // fallback to what the user wants by using playlists the user has not disabled.\n enabledPlaylists = compatiblePlaylists.filter(function (playlist) {\n return !Playlist.isDisabled(playlist);\n });\n }\n\n var bandwidthPlaylists = enabledPlaylists.filter(Playlist.hasAttribute.bind(null, 'BANDWIDTH'));\n var rebufferingEstimates = bandwidthPlaylists.map(function (playlist) {\n var syncPoint = syncController.getSyncPoint(playlist, duration$$1, currentTimeline, currentTime); // If there is no sync point for this playlist, switching to it will require a\n // sync request first. This will double the request time\n\n var numRequests = syncPoint ? 1 : 2;\n var requestTimeEstimate = Playlist.estimateSegmentRequestTime(segmentDuration, bandwidth, playlist);\n var rebufferingImpact = requestTimeEstimate * numRequests - timeUntilRebuffer;\n return {\n playlist: playlist,\n rebufferingImpact: rebufferingImpact\n };\n });\n var noRebufferingPlaylists = rebufferingEstimates.filter(function (estimate) {\n return estimate.rebufferingImpact <= 0;\n }); // Sort by bandwidth DESC\n\n stableSort(noRebufferingPlaylists, function (a, b) {\n return comparePlaylistBandwidth(b.playlist, a.playlist);\n });\n\n if (noRebufferingPlaylists.length) {\n return noRebufferingPlaylists[0];\n }\n\n stableSort(rebufferingEstimates, function (a, b) {\n return a.rebufferingImpact - b.rebufferingImpact;\n });\n return rebufferingEstimates[0] || null;\n};\n/**\n * Chooses the appropriate media playlist, which in this case is the lowest bitrate\n * one with video. If no renditions with video exist, return the lowest audio rendition.\n *\n * Expects to be called within the context of an instance of HlsHandler\n *\n * @return {Object|null}\n * {Object} return.playlist\n * The lowest bitrate playlist that contains a video codec. If no such rendition\n * exists pick the lowest audio rendition.\n */\n\n\nvar lowestBitrateCompatibleVariantSelector = function lowestBitrateCompatibleVariantSelector() {\n // filter out any playlists that have been excluded due to\n // incompatible configurations or playback errors\n var playlists = this.playlists.master.playlists.filter(Playlist.isEnabled); // Sort ascending by bitrate\n\n stableSort(playlists, function (a, b) {\n return comparePlaylistBandwidth(a, b);\n }); // Parse and assume that playlists with no video codec have no video\n // (this is not necessarily true, although it is generally true).\n //\n // If an entire manifest has no valid videos everything will get filtered\n // out.\n\n var playlistsWithVideo = playlists.filter(function (playlist) {\n return parseCodecs(playlist.attributes.CODECS).videoCodec;\n });\n return playlistsWithVideo[0] || null;\n};\n/**\n * Create captions text tracks on video.js if they do not exist\n *\n * @param {Object} inbandTextTracks a reference to current inbandTextTracks\n * @param {Object} tech the video.js tech\n * @param {Object} captionStreams the caption streams to create\n * @private\n */\n\n\nvar createCaptionsTrackIfNotExists = function createCaptionsTrackIfNotExists(inbandTextTracks, tech, captionStreams) {\n for (var trackId in captionStreams) {\n if (!inbandTextTracks[trackId]) {\n tech.trigger({\n type: 'usage',\n name: 'hls-608'\n });\n var track = tech.textTracks().getTrackById(trackId);\n\n if (track) {\n // Resuse an existing track with a CC# id because this was\n // very likely created by videojs-contrib-hls from information\n // in the m3u8 for us to use\n inbandTextTracks[trackId] = track;\n } else {\n // Otherwise, create a track with the default `CC#` label and\n // without a language\n inbandTextTracks[trackId] = tech.addRemoteTextTrack({\n kind: 'captions',\n id: trackId,\n label: trackId\n }, false).track;\n }\n }\n }\n};\n\nvar addCaptionData = function addCaptionData(_ref) {\n var inbandTextTracks = _ref.inbandTextTracks,\n captionArray = _ref.captionArray,\n timestampOffset = _ref.timestampOffset;\n\n if (!captionArray) {\n return;\n }\n\n var Cue = window.WebKitDataCue || window.VTTCue;\n captionArray.forEach(function (caption) {\n var track = caption.stream;\n var startTime = caption.startTime;\n var endTime = caption.endTime;\n\n if (!inbandTextTracks[track]) {\n return;\n }\n\n startTime += timestampOffset;\n endTime += timestampOffset;\n inbandTextTracks[track].addCue(new Cue(startTime, endTime, caption.text));\n });\n};\n/**\n * @file segment-loader.js\n */\n// in ms\n\n\nvar CHECK_BUFFER_DELAY = 500;\n/**\n * Determines if we should call endOfStream on the media source based\n * on the state of the buffer or if appened segment was the final\n * segment in the playlist.\n *\n * @param {Object} playlist a media playlist object\n * @param {Object} mediaSource the MediaSource object\n * @param {Number} segmentIndex the index of segment we last appended\n * @returns {Boolean} do we need to call endOfStream on the MediaSource\n */\n\nvar detectEndOfStream = function detectEndOfStream(playlist, mediaSource, segmentIndex) {\n if (!playlist || !mediaSource) {\n return false;\n }\n\n var segments = playlist.segments; // determine a few boolean values to help make the branch below easier\n // to read\n\n var appendedLastSegment = segmentIndex === segments.length; // if we've buffered to the end of the video, we need to call endOfStream\n // so that MediaSources can trigger the `ended` event when it runs out of\n // buffered data instead of waiting for me\n\n return playlist.endList && mediaSource.readyState === 'open' && appendedLastSegment;\n};\n\nvar finite = function finite(num) {\n return typeof num === 'number' && isFinite(num);\n};\n\nvar illegalMediaSwitch = function illegalMediaSwitch(loaderType, startingMedia, newSegmentMedia) {\n // Although these checks should most likely cover non 'main' types, for now it narrows\n // the scope of our checks.\n if (loaderType !== 'main' || !startingMedia || !newSegmentMedia) {\n return null;\n }\n\n if (!newSegmentMedia.containsAudio && !newSegmentMedia.containsVideo) {\n return 'Neither audio nor video found in segment.';\n }\n\n if (startingMedia.containsVideo && !newSegmentMedia.containsVideo) {\n return 'Only audio found in segment when we expected video.' + ' We can\\'t switch to audio only from a stream that had video.' + ' To get rid of this message, please add codec information to the manifest.';\n }\n\n if (!startingMedia.containsVideo && newSegmentMedia.containsVideo) {\n return 'Video found in segment when we expected only audio.' + ' We can\\'t switch to a stream with video from an audio only stream.' + ' To get rid of this message, please add codec information to the manifest.';\n }\n\n return null;\n};\n/**\n * Calculates a time value that is safe to remove from the back buffer without interupting\n * playback.\n *\n * @param {TimeRange} seekable\n * The current seekable range\n * @param {Number} currentTime\n * The current time of the player\n * @param {Number} targetDuration\n * The target duration of the current playlist\n * @return {Number}\n * Time that is safe to remove from the back buffer without interupting playback\n */\n\n\nvar safeBackBufferTrimTime = function safeBackBufferTrimTime(seekable$$1, currentTime, targetDuration) {\n var removeToTime = void 0;\n\n if (seekable$$1.length && seekable$$1.start(0) > 0 && seekable$$1.start(0) < currentTime) {\n // If we have a seekable range use that as the limit for what can be removed safely\n removeToTime = seekable$$1.start(0);\n } else {\n // otherwise remove anything older than 30 seconds before the current play head\n removeToTime = currentTime - 30;\n } // Don't allow removing from the buffer within target duration of current time\n // to avoid the possibility of removing the GOP currently being played which could\n // cause playback stalls.\n\n\n return Math.min(removeToTime, currentTime - targetDuration);\n};\n\nvar segmentInfoString = function segmentInfoString(segmentInfo) {\n var _segmentInfo$segment = segmentInfo.segment,\n start = _segmentInfo$segment.start,\n end = _segmentInfo$segment.end,\n _segmentInfo$playlist = segmentInfo.playlist,\n seq = _segmentInfo$playlist.mediaSequence,\n id = _segmentInfo$playlist.id,\n _segmentInfo$playlist2 = _segmentInfo$playlist.segments,\n segments = _segmentInfo$playlist2 === undefined ? [] : _segmentInfo$playlist2,\n index = segmentInfo.mediaIndex,\n timeline = segmentInfo.timeline;\n return ['appending [' + index + '] of [' + seq + ', ' + (seq + segments.length) + '] from playlist [' + id + ']', '[' + start + ' => ' + end + '] in timeline [' + timeline + ']'].join(' ');\n};\n/**\n * An object that manages segment loading and appending.\n *\n * @class SegmentLoader\n * @param {Object} options required and optional options\n * @extends videojs.EventTarget\n */\n\n\nvar SegmentLoader = function (_videojs$EventTarget) {\n inherits(SegmentLoader, _videojs$EventTarget);\n\n function SegmentLoader(settings) {\n classCallCheck(this, SegmentLoader); // check pre-conditions\n\n var _this = possibleConstructorReturn(this, (SegmentLoader.__proto__ || Object.getPrototypeOf(SegmentLoader)).call(this));\n\n if (!settings) {\n throw new TypeError('Initialization settings are required');\n }\n\n if (typeof settings.currentTime !== 'function') {\n throw new TypeError('No currentTime getter specified');\n }\n\n if (!settings.mediaSource) {\n throw new TypeError('No MediaSource specified');\n } // public properties\n\n\n _this.bandwidth = settings.bandwidth;\n _this.throughput = {\n rate: 0,\n count: 0\n };\n _this.roundTrip = NaN;\n\n _this.resetStats_();\n\n _this.mediaIndex = null; // private settings\n\n _this.hasPlayed_ = settings.hasPlayed;\n _this.currentTime_ = settings.currentTime;\n _this.seekable_ = settings.seekable;\n _this.seeking_ = settings.seeking;\n _this.duration_ = settings.duration;\n _this.mediaSource_ = settings.mediaSource;\n _this.hls_ = settings.hls;\n _this.loaderType_ = settings.loaderType;\n _this.startingMedia_ = void 0;\n _this.segmentMetadataTrack_ = settings.segmentMetadataTrack;\n _this.goalBufferLength_ = settings.goalBufferLength;\n _this.sourceType_ = settings.sourceType;\n _this.inbandTextTracks_ = settings.inbandTextTracks;\n _this.state_ = 'INIT'; // private instance variables\n\n _this.checkBufferTimeout_ = null;\n _this.error_ = void 0;\n _this.currentTimeline_ = -1;\n _this.pendingSegment_ = null;\n _this.mimeType_ = null;\n _this.sourceUpdater_ = null;\n _this.xhrOptions_ = null; // Fragmented mp4 playback\n\n _this.activeInitSegmentId_ = null;\n _this.initSegments_ = {}; // Fmp4 CaptionParser\n\n _this.captionParser_ = new CaptionParser();\n _this.decrypter_ = settings.decrypter; // Manages the tracking and generation of sync-points, mappings\n // between a time in the display time and a segment index within\n // a playlist\n\n _this.syncController_ = settings.syncController;\n _this.syncPoint_ = {\n segmentIndex: 0,\n time: 0\n };\n\n _this.syncController_.on('syncinfoupdate', function () {\n return _this.trigger('syncinfoupdate');\n });\n\n _this.mediaSource_.addEventListener('sourceopen', function () {\n return _this.ended_ = false;\n }); // ...for determining the fetch location\n\n\n _this.fetchAtBuffer_ = false;\n _this.logger_ = logger('SegmentLoader[' + _this.loaderType_ + ']');\n Object.defineProperty(_this, 'state', {\n get: function get$$1() {\n return this.state_;\n },\n set: function set$$1(newState) {\n if (newState !== this.state_) {\n this.logger_(this.state_ + ' -> ' + newState);\n this.state_ = newState;\n }\n }\n });\n return _this;\n }\n /**\n * reset all of our media stats\n *\n * @private\n */\n\n\n createClass(SegmentLoader, [{\n key: 'resetStats_',\n value: function resetStats_() {\n this.mediaBytesTransferred = 0;\n this.mediaRequests = 0;\n this.mediaRequestsAborted = 0;\n this.mediaRequestsTimedout = 0;\n this.mediaRequestsErrored = 0;\n this.mediaTransferDuration = 0;\n this.mediaSecondsLoaded = 0;\n }\n /**\n * dispose of the SegmentLoader and reset to the default state\n */\n\n }, {\n key: 'dispose',\n value: function dispose() {\n this.state = 'DISPOSED';\n this.pause();\n this.abort_();\n\n if (this.sourceUpdater_) {\n this.sourceUpdater_.dispose();\n }\n\n this.resetStats_();\n this.captionParser_.reset();\n }\n /**\n * abort anything that is currently doing on with the SegmentLoader\n * and reset to a default state\n */\n\n }, {\n key: 'abort',\n value: function abort() {\n if (this.state !== 'WAITING') {\n if (this.pendingSegment_) {\n this.pendingSegment_ = null;\n }\n\n return;\n }\n\n this.abort_(); // We aborted the requests we were waiting on, so reset the loader's state to READY\n // since we are no longer \"waiting\" on any requests. XHR callback is not always run\n // when the request is aborted. This will prevent the loader from being stuck in the\n // WAITING state indefinitely.\n\n this.state = 'READY'; // don't wait for buffer check timeouts to begin fetching the\n // next segment\n\n if (!this.paused()) {\n this.monitorBuffer_();\n }\n }\n /**\n * abort all pending xhr requests and null any pending segements\n *\n * @private\n */\n\n }, {\n key: 'abort_',\n value: function abort_() {\n if (this.pendingSegment_) {\n this.pendingSegment_.abortRequests();\n } // clear out the segment being processed\n\n\n this.pendingSegment_ = null;\n }\n /**\n * set an error on the segment loader and null out any pending segements\n *\n * @param {Error} error the error to set on the SegmentLoader\n * @return {Error} the error that was set or that is currently set\n */\n\n }, {\n key: 'error',\n value: function error(_error) {\n if (typeof _error !== 'undefined') {\n this.error_ = _error;\n }\n\n this.pendingSegment_ = null;\n return this.error_;\n }\n }, {\n key: 'endOfStream',\n value: function endOfStream() {\n this.ended_ = true;\n this.pause();\n this.trigger('ended');\n }\n /**\n * Indicates which time ranges are buffered\n *\n * @return {TimeRange}\n * TimeRange object representing the current buffered ranges\n */\n\n }, {\n key: 'buffered_',\n value: function buffered_() {\n if (!this.sourceUpdater_) {\n return videojs$1.createTimeRanges();\n }\n\n return this.sourceUpdater_.buffered();\n }\n /**\n * Gets and sets init segment for the provided map\n *\n * @param {Object} map\n * The map object representing the init segment to get or set\n * @param {Boolean=} set\n * If true, the init segment for the provided map should be saved\n * @return {Object}\n * map object for desired init segment\n */\n\n }, {\n key: 'initSegment',\n value: function initSegment(map) {\n var set$$1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (!map) {\n return null;\n }\n\n var id = initSegmentId(map);\n var storedMap = this.initSegments_[id];\n\n if (set$$1 && !storedMap && map.bytes) {\n this.initSegments_[id] = storedMap = {\n resolvedUri: map.resolvedUri,\n byterange: map.byterange,\n bytes: map.bytes,\n timescales: map.timescales,\n videoTrackIds: map.videoTrackIds\n };\n }\n\n return storedMap || map;\n }\n /**\n * Returns true if all configuration required for loading is present, otherwise false.\n *\n * @return {Boolean} True if the all configuration is ready for loading\n * @private\n */\n\n }, {\n key: 'couldBeginLoading_',\n value: function couldBeginLoading_() {\n return this.playlist_ && ( // the source updater is created when init_ is called, so either having a\n // source updater or being in the INIT state with a mimeType is enough\n // to say we have all the needed configuration to start loading.\n this.sourceUpdater_ || this.mimeType_ && this.state === 'INIT') && !this.paused();\n }\n /**\n * load a playlist and start to fill the buffer\n */\n\n }, {\n key: 'load',\n value: function load() {\n // un-pause\n this.monitorBuffer_(); // if we don't have a playlist yet, keep waiting for one to be\n // specified\n\n if (!this.playlist_) {\n return;\n } // not sure if this is the best place for this\n\n\n this.syncController_.setDateTimeMapping(this.playlist_); // if all the configuration is ready, initialize and begin loading\n\n if (this.state === 'INIT' && this.couldBeginLoading_()) {\n return this.init_();\n } // if we're in the middle of processing a segment already, don't\n // kick off an additional segment request\n\n\n if (!this.couldBeginLoading_() || this.state !== 'READY' && this.state !== 'INIT') {\n return;\n }\n\n this.state = 'READY';\n }\n /**\n * Once all the starting parameters have been specified, begin\n * operation. This method should only be invoked from the INIT\n * state.\n *\n * @private\n */\n\n }, {\n key: 'init_',\n value: function init_() {\n this.state = 'READY';\n this.sourceUpdater_ = new SourceUpdater(this.mediaSource_, this.mimeType_, this.loaderType_, this.sourceBufferEmitter_);\n this.resetEverything();\n return this.monitorBuffer_();\n }\n /**\n * set a playlist on the segment loader\n *\n * @param {PlaylistLoader} media the playlist to set on the segment loader\n */\n\n }, {\n key: 'playlist',\n value: function playlist(newPlaylist) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (!newPlaylist) {\n return;\n }\n\n var oldPlaylist = this.playlist_;\n var segmentInfo = this.pendingSegment_;\n this.playlist_ = newPlaylist;\n this.xhrOptions_ = options; // when we haven't started playing yet, the start of a live playlist\n // is always our zero-time so force a sync update each time the playlist\n // is refreshed from the server\n\n if (!this.hasPlayed_()) {\n newPlaylist.syncInfo = {\n mediaSequence: newPlaylist.mediaSequence,\n time: 0\n };\n }\n\n var oldId = oldPlaylist ? oldPlaylist.id : null;\n this.logger_('playlist update [' + oldId + ' => ' + newPlaylist.id + ']'); // in VOD, this is always a rendition switch (or we updated our syncInfo above)\n // in LIVE, we always want to update with new playlists (including refreshes)\n\n this.trigger('syncinfoupdate'); // if we were unpaused but waiting for a playlist, start\n // buffering now\n\n if (this.state === 'INIT' && this.couldBeginLoading_()) {\n return this.init_();\n }\n\n if (!oldPlaylist || oldPlaylist.uri !== newPlaylist.uri) {\n if (this.mediaIndex !== null) {\n // we must \"resync\" the segment loader when we switch renditions and\n // the segment loader is already synced to the previous rendition\n this.resyncLoader();\n } // the rest of this function depends on `oldPlaylist` being defined\n\n\n return;\n } // we reloaded the same playlist so we are in a live scenario\n // and we will likely need to adjust the mediaIndex\n\n\n var mediaSequenceDiff = newPlaylist.mediaSequence - oldPlaylist.mediaSequence;\n this.logger_('live window shift [' + mediaSequenceDiff + ']'); // update the mediaIndex on the SegmentLoader\n // this is important because we can abort a request and this value must be\n // equal to the last appended mediaIndex\n\n if (this.mediaIndex !== null) {\n this.mediaIndex -= mediaSequenceDiff;\n } // update the mediaIndex on the SegmentInfo object\n // this is important because we will update this.mediaIndex with this value\n // in `handleUpdateEnd_` after the segment has been successfully appended\n\n\n if (segmentInfo) {\n segmentInfo.mediaIndex -= mediaSequenceDiff; // we need to update the referenced segment so that timing information is\n // saved for the new playlist's segment, however, if the segment fell off the\n // playlist, we can leave the old reference and just lose the timing info\n\n if (segmentInfo.mediaIndex >= 0) {\n segmentInfo.segment = newPlaylist.segments[segmentInfo.mediaIndex];\n }\n }\n\n this.syncController_.saveExpiredSegmentInfo(oldPlaylist, newPlaylist);\n }\n /**\n * Prevent the loader from fetching additional segments. If there\n * is a segment request outstanding, it will finish processing\n * before the loader halts. A segment loader can be unpaused by\n * calling load().\n */\n\n }, {\n key: 'pause',\n value: function pause() {\n if (this.checkBufferTimeout_) {\n window$1.clearTimeout(this.checkBufferTimeout_);\n this.checkBufferTimeout_ = null;\n }\n }\n /**\n * Returns whether the segment loader is fetching additional\n * segments when given the opportunity. This property can be\n * modified through calls to pause() and load().\n */\n\n }, {\n key: 'paused',\n value: function paused() {\n return this.checkBufferTimeout_ === null;\n }\n /**\n * create/set the following mimetype on the SourceBuffer through a\n * SourceUpdater\n *\n * @param {String} mimeType the mime type string to use\n * @param {Object} sourceBufferEmitter an event emitter that fires when a source buffer\n * is added to the media source\n */\n\n }, {\n key: 'mimeType',\n value: function mimeType(_mimeType, sourceBufferEmitter) {\n if (this.mimeType_) {\n return;\n }\n\n this.mimeType_ = _mimeType;\n this.sourceBufferEmitter_ = sourceBufferEmitter; // if we were unpaused but waiting for a sourceUpdater, start\n // buffering now\n\n if (this.state === 'INIT' && this.couldBeginLoading_()) {\n this.init_();\n }\n }\n /**\n * Delete all the buffered data and reset the SegmentLoader\n * @param {Function} [done] an optional callback to be executed when the remove\n * operation is complete\n */\n\n }, {\n key: 'resetEverything',\n value: function resetEverything(done) {\n this.ended_ = false;\n this.resetLoader();\n this.remove(0, this.duration_(), done); // clears fmp4 captions\n\n this.captionParser_.clearAllCaptions();\n this.trigger('reseteverything');\n }\n /**\n * Force the SegmentLoader to resync and start loading around the currentTime instead\n * of starting at the end of the buffer\n *\n * Useful for fast quality changes\n */\n\n }, {\n key: 'resetLoader',\n value: function resetLoader() {\n this.fetchAtBuffer_ = false;\n this.resyncLoader();\n }\n /**\n * Force the SegmentLoader to restart synchronization and make a conservative guess\n * before returning to the simple walk-forward method\n */\n\n }, {\n key: 'resyncLoader',\n value: function resyncLoader() {\n this.mediaIndex = null;\n this.syncPoint_ = null;\n this.abort();\n }\n /**\n * Remove any data in the source buffer between start and end times\n * @param {Number} start - the start time of the region to remove from the buffer\n * @param {Number} end - the end time of the region to remove from the buffer\n * @param {Function} [done] - an optional callback to be executed when the remove\n * operation is complete\n */\n\n }, {\n key: 'remove',\n value: function remove(start, end, done) {\n if (this.sourceUpdater_) {\n this.sourceUpdater_.remove(start, end, done);\n }\n\n removeCuesFromTrack(start, end, this.segmentMetadataTrack_);\n\n if (this.inbandTextTracks_) {\n for (var id in this.inbandTextTracks_) {\n removeCuesFromTrack(start, end, this.inbandTextTracks_[id]);\n }\n }\n }\n /**\n * (re-)schedule monitorBufferTick_ to run as soon as possible\n *\n * @private\n */\n\n }, {\n key: 'monitorBuffer_',\n value: function monitorBuffer_() {\n if (this.checkBufferTimeout_) {\n window$1.clearTimeout(this.checkBufferTimeout_);\n }\n\n this.checkBufferTimeout_ = window$1.setTimeout(this.monitorBufferTick_.bind(this), 1);\n }\n /**\n * As long as the SegmentLoader is in the READY state, periodically\n * invoke fillBuffer_().\n *\n * @private\n */\n\n }, {\n key: 'monitorBufferTick_',\n value: function monitorBufferTick_() {\n if (this.state === 'READY') {\n this.fillBuffer_();\n }\n\n if (this.checkBufferTimeout_) {\n window$1.clearTimeout(this.checkBufferTimeout_);\n }\n\n this.checkBufferTimeout_ = window$1.setTimeout(this.monitorBufferTick_.bind(this), CHECK_BUFFER_DELAY);\n }\n /**\n * fill the buffer with segements unless the sourceBuffers are\n * currently updating\n *\n * Note: this function should only ever be called by monitorBuffer_\n * and never directly\n *\n * @private\n */\n\n }, {\n key: 'fillBuffer_',\n value: function fillBuffer_() {\n if (this.sourceUpdater_.updating()) {\n return;\n }\n\n if (!this.syncPoint_) {\n this.syncPoint_ = this.syncController_.getSyncPoint(this.playlist_, this.duration_(), this.currentTimeline_, this.currentTime_());\n } // see if we need to begin loading immediately\n\n\n var segmentInfo = this.checkBuffer_(this.buffered_(), this.playlist_, this.mediaIndex, this.hasPlayed_(), this.currentTime_(), this.syncPoint_);\n\n if (!segmentInfo) {\n return;\n }\n\n var isEndOfStream = detectEndOfStream(this.playlist_, this.mediaSource_, segmentInfo.mediaIndex);\n\n if (isEndOfStream) {\n this.endOfStream();\n return;\n }\n\n if (segmentInfo.mediaIndex === this.playlist_.segments.length - 1 && this.mediaSource_.readyState === 'ended' && !this.seeking_()) {\n return;\n } // We will need to change timestampOffset of the sourceBuffer if either of\n // the following conditions are true:\n // - The segment.timeline !== this.currentTimeline\n // (we are crossing a discontinuity somehow)\n // - The \"timestampOffset\" for the start of this segment is less than\n // the currently set timestampOffset\n // Also, clear captions if we are crossing a discontinuity boundary\n\n\n if (segmentInfo.timeline !== this.currentTimeline_ || segmentInfo.startOfSegment !== null && segmentInfo.startOfSegment < this.sourceUpdater_.timestampOffset()) {\n this.syncController_.reset();\n segmentInfo.timestampOffset = segmentInfo.startOfSegment;\n this.captionParser_.clearAllCaptions();\n }\n\n this.loadSegment_(segmentInfo);\n }\n /**\n * Determines what segment request should be made, given current playback\n * state.\n *\n * @param {TimeRanges} buffered - the state of the buffer\n * @param {Object} playlist - the playlist object to fetch segments from\n * @param {Number} mediaIndex - the previous mediaIndex fetched or null\n * @param {Boolean} hasPlayed - a flag indicating whether we have played or not\n * @param {Number} currentTime - the playback position in seconds\n * @param {Object} syncPoint - a segment info object that describes the\n * @returns {Object} a segment request object that describes the segment to load\n */\n\n }, {\n key: 'checkBuffer_',\n value: function checkBuffer_(buffered, playlist, mediaIndex, hasPlayed, currentTime, syncPoint) {\n var lastBufferedEnd = 0;\n var startOfSegment = void 0;\n\n if (buffered.length) {\n lastBufferedEnd = buffered.end(buffered.length - 1);\n }\n\n var bufferedTime = Math.max(0, lastBufferedEnd - currentTime);\n\n if (!playlist.segments.length) {\n return null;\n } // if there is plenty of content buffered, and the video has\n // been played before relax for awhile\n\n\n if (bufferedTime >= this.goalBufferLength_()) {\n return null;\n } // if the video has not yet played once, and we already have\n // one segment downloaded do nothing\n\n\n if (!hasPlayed && bufferedTime >= 1) {\n return null;\n } // When the syncPoint is null, there is no way of determining a good\n // conservative segment index to fetch from\n // The best thing to do here is to get the kind of sync-point data by\n // making a request\n\n\n if (syncPoint === null) {\n mediaIndex = this.getSyncSegmentCandidate_(playlist);\n return this.generateSegmentInfo_(playlist, mediaIndex, null, true);\n } // Under normal playback conditions fetching is a simple walk forward\n\n\n if (mediaIndex !== null) {\n var segment = playlist.segments[mediaIndex];\n\n if (segment && segment.end) {\n startOfSegment = segment.end;\n } else {\n startOfSegment = lastBufferedEnd;\n }\n\n return this.generateSegmentInfo_(playlist, mediaIndex + 1, startOfSegment, false);\n } // There is a sync-point but the lack of a mediaIndex indicates that\n // we need to make a good conservative guess about which segment to\n // fetch\n\n\n if (this.fetchAtBuffer_) {\n // Find the segment containing the end of the buffer\n var mediaSourceInfo = Playlist.getMediaInfoForTime(playlist, lastBufferedEnd, syncPoint.segmentIndex, syncPoint.time);\n mediaIndex = mediaSourceInfo.mediaIndex;\n startOfSegment = mediaSourceInfo.startTime;\n } else {\n // Find the segment containing currentTime\n var _mediaSourceInfo = Playlist.getMediaInfoForTime(playlist, currentTime, syncPoint.segmentIndex, syncPoint.time);\n\n mediaIndex = _mediaSourceInfo.mediaIndex;\n startOfSegment = _mediaSourceInfo.startTime;\n }\n\n return this.generateSegmentInfo_(playlist, mediaIndex, startOfSegment, false);\n }\n /**\n * The segment loader has no recourse except to fetch a segment in the\n * current playlist and use the internal timestamps in that segment to\n * generate a syncPoint. This function returns a good candidate index\n * for that process.\n *\n * @param {Object} playlist - the playlist object to look for a\n * @returns {Number} An index of a segment from the playlist to load\n */\n\n }, {\n key: 'getSyncSegmentCandidate_',\n value: function getSyncSegmentCandidate_(playlist) {\n var _this2 = this;\n\n if (this.currentTimeline_ === -1) {\n return 0;\n }\n\n var segmentIndexArray = playlist.segments.map(function (s, i) {\n return {\n timeline: s.timeline,\n segmentIndex: i\n };\n }).filter(function (s) {\n return s.timeline === _this2.currentTimeline_;\n });\n\n if (segmentIndexArray.length) {\n return segmentIndexArray[Math.min(segmentIndexArray.length - 1, 1)].segmentIndex;\n }\n\n return Math.max(playlist.segments.length - 1, 0);\n }\n }, {\n key: 'generateSegmentInfo_',\n value: function generateSegmentInfo_(playlist, mediaIndex, startOfSegment, isSyncRequest) {\n if (mediaIndex < 0 || mediaIndex >= playlist.segments.length) {\n return null;\n }\n\n var segment = playlist.segments[mediaIndex];\n return {\n requestId: 'segment-loader-' + Math.random(),\n // resolve the segment URL relative to the playlist\n uri: segment.resolvedUri,\n // the segment's mediaIndex at the time it was requested\n mediaIndex: mediaIndex,\n // whether or not to update the SegmentLoader's state with this\n // segment's mediaIndex\n isSyncRequest: isSyncRequest,\n startOfSegment: startOfSegment,\n // the segment's playlist\n playlist: playlist,\n // unencrypted bytes of the segment\n bytes: null,\n // when a key is defined for this segment, the encrypted bytes\n encryptedBytes: null,\n // The target timestampOffset for this segment when we append it\n // to the source buffer\n timestampOffset: null,\n // The timeline that the segment is in\n timeline: segment.timeline,\n // The expected duration of the segment in seconds\n duration: segment.duration,\n // retain the segment in case the playlist updates while doing an async process\n segment: segment\n };\n }\n /**\n * Determines if the network has enough bandwidth to complete the current segment\n * request in a timely manner. If not, the request will be aborted early and bandwidth\n * updated to trigger a playlist switch.\n *\n * @param {Object} stats\n * Object containing stats about the request timing and size\n * @return {Boolean} True if the request was aborted, false otherwise\n * @private\n */\n\n }, {\n key: 'abortRequestEarly_',\n value: function abortRequestEarly_(stats) {\n if (this.hls_.tech_.paused() || // Don't abort if the current playlist is on the lowestEnabledRendition\n // TODO: Replace using timeout with a boolean indicating whether this playlist is\n // the lowestEnabledRendition.\n !this.xhrOptions_.timeout || // Don't abort if we have no bandwidth information to estimate segment sizes\n !this.playlist_.attributes.BANDWIDTH) {\n return false;\n } // Wait at least 1 second since the first byte of data has been received before\n // using the calculated bandwidth from the progress event to allow the bitrate\n // to stabilize\n\n\n if (Date.now() - (stats.firstBytesReceivedAt || Date.now()) < 1000) {\n return false;\n }\n\n var currentTime = this.currentTime_();\n var measuredBandwidth = stats.bandwidth;\n var segmentDuration = this.pendingSegment_.duration;\n var requestTimeRemaining = Playlist.estimateSegmentRequestTime(segmentDuration, measuredBandwidth, this.playlist_, stats.bytesReceived); // Subtract 1 from the timeUntilRebuffer so we still consider an early abort\n // if we are only left with less than 1 second when the request completes.\n // A negative timeUntilRebuffering indicates we are already rebuffering\n\n var timeUntilRebuffer$$1 = timeUntilRebuffer(this.buffered_(), currentTime, this.hls_.tech_.playbackRate()) - 1; // Only consider aborting early if the estimated time to finish the download\n // is larger than the estimated time until the player runs out of forward buffer\n\n if (requestTimeRemaining <= timeUntilRebuffer$$1) {\n return false;\n }\n\n var switchCandidate = minRebufferMaxBandwidthSelector({\n master: this.hls_.playlists.master,\n currentTime: currentTime,\n bandwidth: measuredBandwidth,\n duration: this.duration_(),\n segmentDuration: segmentDuration,\n timeUntilRebuffer: timeUntilRebuffer$$1,\n currentTimeline: this.currentTimeline_,\n syncController: this.syncController_\n });\n\n if (!switchCandidate) {\n return;\n }\n\n var rebufferingImpact = requestTimeRemaining - timeUntilRebuffer$$1;\n var timeSavedBySwitching = rebufferingImpact - switchCandidate.rebufferingImpact;\n var minimumTimeSaving = 0.5; // If we are already rebuffering, increase the amount of variance we add to the\n // potential round trip time of the new request so that we are not too aggressive\n // with switching to a playlist that might save us a fraction of a second.\n\n if (timeUntilRebuffer$$1 <= TIME_FUDGE_FACTOR) {\n minimumTimeSaving = 1;\n }\n\n if (!switchCandidate.playlist || switchCandidate.playlist.uri === this.playlist_.uri || timeSavedBySwitching < minimumTimeSaving) {\n return false;\n } // set the bandwidth to that of the desired playlist being sure to scale by\n // BANDWIDTH_VARIANCE and add one so the playlist selector does not exclude it\n // don't trigger a bandwidthupdate as the bandwidth is artifial\n\n\n this.bandwidth = switchCandidate.playlist.attributes.BANDWIDTH * Config.BANDWIDTH_VARIANCE + 1;\n this.abort();\n this.trigger('earlyabort');\n return true;\n }\n /**\n * XHR `progress` event handler\n *\n * @param {Event}\n * The XHR `progress` event\n * @param {Object} simpleSegment\n * A simplified segment object copy\n * @private\n */\n\n }, {\n key: 'handleProgress_',\n value: function handleProgress_(event, simpleSegment) {\n if (!this.pendingSegment_ || simpleSegment.requestId !== this.pendingSegment_.requestId || this.abortRequestEarly_(simpleSegment.stats)) {\n return;\n }\n\n this.trigger('progress');\n }\n /**\n * load a specific segment from a request into the buffer\n *\n * @private\n */\n\n }, {\n key: 'loadSegment_',\n value: function loadSegment_(segmentInfo) {\n this.state = 'WAITING';\n this.pendingSegment_ = segmentInfo;\n this.trimBackBuffer_(segmentInfo);\n segmentInfo.abortRequests = mediaSegmentRequest(this.hls_.xhr, this.xhrOptions_, this.decrypter_, this.captionParser_, this.createSimplifiedSegmentObj_(segmentInfo), // progress callback\n this.handleProgress_.bind(this), this.segmentRequestFinished_.bind(this));\n }\n /**\n * trim the back buffer so that we don't have too much data\n * in the source buffer\n *\n * @private\n *\n * @param {Object} segmentInfo - the current segment\n */\n\n }, {\n key: 'trimBackBuffer_',\n value: function trimBackBuffer_(segmentInfo) {\n var removeToTime = safeBackBufferTrimTime(this.seekable_(), this.currentTime_(), this.playlist_.targetDuration || 10); // Chrome has a hard limit of 150MB of\n // buffer and a very conservative \"garbage collector\"\n // We manually clear out the old buffer to ensure\n // we don't trigger the QuotaExceeded error\n // on the source buffer during subsequent appends\n\n if (removeToTime > 0) {\n this.remove(0, removeToTime);\n }\n }\n /**\n * created a simplified copy of the segment object with just the\n * information necessary to perform the XHR and decryption\n *\n * @private\n *\n * @param {Object} segmentInfo - the current segment\n * @returns {Object} a simplified segment object copy\n */\n\n }, {\n key: 'createSimplifiedSegmentObj_',\n value: function createSimplifiedSegmentObj_(segmentInfo) {\n var segment = segmentInfo.segment;\n var simpleSegment = {\n resolvedUri: segment.resolvedUri,\n byterange: segment.byterange,\n requestId: segmentInfo.requestId\n };\n\n if (segment.key) {\n // if the media sequence is greater than 2^32, the IV will be incorrect\n // assuming 10s segments, that would be about 1300 years\n var iv = segment.key.iv || new Uint32Array([0, 0, 0, segmentInfo.mediaIndex + segmentInfo.playlist.mediaSequence]);\n simpleSegment.key = {\n resolvedUri: segment.key.resolvedUri,\n iv: iv\n };\n }\n\n if (segment.map) {\n simpleSegment.map = this.initSegment(segment.map);\n }\n\n return simpleSegment;\n }\n /**\n * Handle the callback from the segmentRequest function and set the\n * associated SegmentLoader state and errors if necessary\n *\n * @private\n */\n\n }, {\n key: 'segmentRequestFinished_',\n value: function segmentRequestFinished_(error, simpleSegment) {\n // every request counts as a media request even if it has been aborted\n // or canceled due to a timeout\n this.mediaRequests += 1;\n\n if (simpleSegment.stats) {\n this.mediaBytesTransferred += simpleSegment.stats.bytesReceived;\n this.mediaTransferDuration += simpleSegment.stats.roundTripTime;\n } // The request was aborted and the SegmentLoader has already been reset\n\n\n if (!this.pendingSegment_) {\n this.mediaRequestsAborted += 1;\n return;\n } // the request was aborted and the SegmentLoader has already started\n // another request. this can happen when the timeout for an aborted\n // request triggers due to a limitation in the XHR library\n // do not count this as any sort of request or we risk double-counting\n\n\n if (simpleSegment.requestId !== this.pendingSegment_.requestId) {\n return;\n } // an error occurred from the active pendingSegment_ so reset everything\n\n\n if (error) {\n this.pendingSegment_ = null;\n this.state = 'READY'; // the requests were aborted just record the aborted stat and exit\n // this is not a true error condition and nothing corrective needs\n // to be done\n\n if (error.code === REQUEST_ERRORS.ABORTED) {\n this.mediaRequestsAborted += 1;\n return;\n }\n\n this.pause(); // the error is really just that at least one of the requests timed-out\n // set the bandwidth to a very low value and trigger an ABR switch to\n // take emergency action\n\n if (error.code === REQUEST_ERRORS.TIMEOUT) {\n this.mediaRequestsTimedout += 1;\n this.bandwidth = 1;\n this.roundTrip = NaN;\n this.trigger('bandwidthupdate');\n return;\n } // if control-flow has arrived here, then the error is real\n // emit an error event to blacklist the current playlist\n\n\n this.mediaRequestsErrored += 1;\n this.error(error);\n this.trigger('error');\n return;\n } // the response was a success so set any bandwidth stats the request\n // generated for ABR purposes\n\n\n this.bandwidth = simpleSegment.stats.bandwidth;\n this.roundTrip = simpleSegment.stats.roundTripTime; // if this request included an initialization segment, save that data\n // to the initSegment cache\n\n if (simpleSegment.map) {\n simpleSegment.map = this.initSegment(simpleSegment.map, true);\n }\n\n this.processSegmentResponse_(simpleSegment);\n }\n /**\n * Move any important data from the simplified segment object\n * back to the real segment object for future phases\n *\n * @private\n */\n\n }, {\n key: 'processSegmentResponse_',\n value: function processSegmentResponse_(simpleSegment) {\n var segmentInfo = this.pendingSegment_;\n segmentInfo.bytes = simpleSegment.bytes;\n\n if (simpleSegment.map) {\n segmentInfo.segment.map.bytes = simpleSegment.map.bytes;\n }\n\n segmentInfo.endOfAllRequests = simpleSegment.endOfAllRequests; // This has fmp4 captions, add them to text tracks\n\n if (simpleSegment.fmp4Captions) {\n createCaptionsTrackIfNotExists(this.inbandTextTracks_, this.hls_.tech_, simpleSegment.captionStreams);\n addCaptionData({\n inbandTextTracks: this.inbandTextTracks_,\n captionArray: simpleSegment.fmp4Captions,\n // fmp4s will not have a timestamp offset\n timestampOffset: 0\n }); // Reset stored captions since we added parsed\n // captions to a text track at this point\n\n this.captionParser_.clearParsedCaptions();\n }\n\n this.handleSegment_();\n }\n /**\n * append a decrypted segement to the SourceBuffer through a SourceUpdater\n *\n * @private\n */\n\n }, {\n key: 'handleSegment_',\n value: function handleSegment_() {\n var _this3 = this;\n\n if (!this.pendingSegment_) {\n this.state = 'READY';\n return;\n }\n\n var segmentInfo = this.pendingSegment_;\n var segment = segmentInfo.segment;\n var timingInfo = this.syncController_.probeSegmentInfo(segmentInfo); // When we have our first timing info, determine what media types this loader is\n // dealing with. Although we're maintaining extra state, it helps to preserve the\n // separation of segment loader from the actual source buffers.\n\n if (typeof this.startingMedia_ === 'undefined' && timingInfo && ( // Guard against cases where we're not getting timing info at all until we are\n // certain that all streams will provide it.\n timingInfo.containsAudio || timingInfo.containsVideo)) {\n this.startingMedia_ = {\n containsAudio: timingInfo.containsAudio,\n containsVideo: timingInfo.containsVideo\n };\n }\n\n var illegalMediaSwitchError = illegalMediaSwitch(this.loaderType_, this.startingMedia_, timingInfo);\n\n if (illegalMediaSwitchError) {\n this.error({\n message: illegalMediaSwitchError,\n blacklistDuration: Infinity\n });\n this.trigger('error');\n return;\n }\n\n if (segmentInfo.isSyncRequest) {\n this.trigger('syncinfoupdate');\n this.pendingSegment_ = null;\n this.state = 'READY';\n return;\n }\n\n if (segmentInfo.timestampOffset !== null && segmentInfo.timestampOffset !== this.sourceUpdater_.timestampOffset()) {\n this.sourceUpdater_.timestampOffset(segmentInfo.timestampOffset); // fired when a timestamp offset is set in HLS (can also identify discontinuities)\n\n this.trigger('timestampoffset');\n }\n\n var timelineMapping = this.syncController_.mappingForTimeline(segmentInfo.timeline);\n\n if (timelineMapping !== null) {\n this.trigger({\n type: 'segmenttimemapping',\n mapping: timelineMapping\n });\n }\n\n this.state = 'APPENDING'; // if the media initialization segment is changing, append it\n // before the content segment\n\n if (segment.map) {\n var initId = initSegmentId(segment.map);\n\n if (!this.activeInitSegmentId_ || this.activeInitSegmentId_ !== initId) {\n var initSegment = this.initSegment(segment.map);\n this.sourceUpdater_.appendBuffer(initSegment.bytes, function () {\n _this3.activeInitSegmentId_ = initId;\n });\n }\n }\n\n segmentInfo.byteLength = segmentInfo.bytes.byteLength;\n\n if (typeof segment.start === 'number' && typeof segment.end === 'number') {\n this.mediaSecondsLoaded += segment.end - segment.start;\n } else {\n this.mediaSecondsLoaded += segment.duration;\n }\n\n this.logger_(segmentInfoString(segmentInfo));\n this.sourceUpdater_.appendBuffer(segmentInfo.bytes, this.handleUpdateEnd_.bind(this));\n }\n /**\n * callback to run when appendBuffer is finished. detects if we are\n * in a good state to do things with the data we got, or if we need\n * to wait for more\n *\n * @private\n */\n\n }, {\n key: 'handleUpdateEnd_',\n value: function handleUpdateEnd_() {\n if (!this.pendingSegment_) {\n this.state = 'READY';\n\n if (!this.paused()) {\n this.monitorBuffer_();\n }\n\n return;\n }\n\n var segmentInfo = this.pendingSegment_;\n var segment = segmentInfo.segment;\n var isWalkingForward = this.mediaIndex !== null;\n this.pendingSegment_ = null;\n this.recordThroughput_(segmentInfo);\n this.addSegmentMetadataCue_(segmentInfo);\n this.state = 'READY';\n this.mediaIndex = segmentInfo.mediaIndex;\n this.fetchAtBuffer_ = true;\n this.currentTimeline_ = segmentInfo.timeline; // We must update the syncinfo to recalculate the seekable range before\n // the following conditional otherwise it may consider this a bad \"guess\"\n // and attempt to resync when the post-update seekable window and live\n // point would mean that this was the perfect segment to fetch\n\n this.trigger('syncinfoupdate'); // If we previously appended a segment that ends more than 3 targetDurations before\n // the currentTime_ that means that our conservative guess was too conservative.\n // In that case, reset the loader state so that we try to use any information gained\n // from the previous request to create a new, more accurate, sync-point.\n\n if (segment.end && this.currentTime_() - segment.end > segmentInfo.playlist.targetDuration * 3) {\n this.resetEverything();\n return;\n } // Don't do a rendition switch unless we have enough time to get a sync segment\n // and conservatively guess\n\n\n if (isWalkingForward) {\n this.trigger('bandwidthupdate');\n }\n\n this.trigger('progress'); // any time an update finishes and the last segment is in the\n // buffer, end the stream. this ensures the \"ended\" event will\n // fire if playback reaches that point.\n\n var isEndOfStream = detectEndOfStream(segmentInfo.playlist, this.mediaSource_, segmentInfo.mediaIndex + 1);\n\n if (isEndOfStream) {\n this.endOfStream();\n }\n\n if (!this.paused()) {\n this.monitorBuffer_();\n }\n }\n /**\n * Records the current throughput of the decrypt, transmux, and append\n * portion of the semgment pipeline. `throughput.rate` is a the cumulative\n * moving average of the throughput. `throughput.count` is the number of\n * data points in the average.\n *\n * @private\n * @param {Object} segmentInfo the object returned by loadSegment\n */\n\n }, {\n key: 'recordThroughput_',\n value: function recordThroughput_(segmentInfo) {\n var rate = this.throughput.rate; // Add one to the time to ensure that we don't accidentally attempt to divide\n // by zero in the case where the throughput is ridiculously high\n\n var segmentProcessingTime = Date.now() - segmentInfo.endOfAllRequests + 1; // Multiply by 8000 to convert from bytes/millisecond to bits/second\n\n var segmentProcessingThroughput = Math.floor(segmentInfo.byteLength / segmentProcessingTime * 8 * 1000); // This is just a cumulative moving average calculation:\n // newAvg = oldAvg + (sample - oldAvg) / (sampleCount + 1)\n\n this.throughput.rate += (segmentProcessingThroughput - rate) / ++this.throughput.count;\n }\n /**\n * Adds a cue to the segment-metadata track with some metadata information about the\n * segment\n *\n * @private\n * @param {Object} segmentInfo\n * the object returned by loadSegment\n * @method addSegmentMetadataCue_\n */\n\n }, {\n key: 'addSegmentMetadataCue_',\n value: function addSegmentMetadataCue_(segmentInfo) {\n if (!this.segmentMetadataTrack_) {\n return;\n }\n\n var segment = segmentInfo.segment;\n var start = segment.start;\n var end = segment.end; // Do not try adding the cue if the start and end times are invalid.\n\n if (!finite(start) || !finite(end)) {\n return;\n }\n\n removeCuesFromTrack(start, end, this.segmentMetadataTrack_);\n var Cue = window$1.WebKitDataCue || window$1.VTTCue;\n var value = {\n dateTimeObject: segment.dateTimeObject,\n dateTimeString: segment.dateTimeString,\n bandwidth: segmentInfo.playlist.attributes.BANDWIDTH,\n resolution: segmentInfo.playlist.attributes.RESOLUTION,\n codecs: segmentInfo.playlist.attributes.CODECS,\n byteLength: segmentInfo.byteLength,\n uri: segmentInfo.uri,\n timeline: segmentInfo.timeline,\n playlist: segmentInfo.playlist.uri,\n start: start,\n end: end\n };\n var data = JSON.stringify(value);\n var cue = new Cue(start, end, data); // Attach the metadata to the value property of the cue to keep consistency between\n // the differences of WebKitDataCue in safari and VTTCue in other browsers\n\n cue.value = value;\n this.segmentMetadataTrack_.addCue(cue);\n }\n }]);\n return SegmentLoader;\n}(videojs$1.EventTarget);\n\nvar uint8ToUtf8 = function uint8ToUtf8(uintArray) {\n return decodeURIComponent(escape(String.fromCharCode.apply(null, uintArray)));\n};\n/**\n * @file vtt-segment-loader.js\n */\n\n\nvar VTT_LINE_TERMINATORS = new Uint8Array('\\n\\n'.split('').map(function (char) {\n return char.charCodeAt(0);\n}));\n/**\n * An object that manages segment loading and appending.\n *\n * @class VTTSegmentLoader\n * @param {Object} options required and optional options\n * @extends videojs.EventTarget\n */\n\nvar VTTSegmentLoader = function (_SegmentLoader) {\n inherits(VTTSegmentLoader, _SegmentLoader);\n\n function VTTSegmentLoader(settings) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n classCallCheck(this, VTTSegmentLoader); // SegmentLoader requires a MediaSource be specified or it will throw an error;\n // however, VTTSegmentLoader has no need of a media source, so delete the reference\n\n var _this = possibleConstructorReturn(this, (VTTSegmentLoader.__proto__ || Object.getPrototypeOf(VTTSegmentLoader)).call(this, settings, options));\n\n _this.mediaSource_ = null;\n _this.subtitlesTrack_ = null;\n return _this;\n }\n /**\n * Indicates which time ranges are buffered\n *\n * @return {TimeRange}\n * TimeRange object representing the current buffered ranges\n */\n\n\n createClass(VTTSegmentLoader, [{\n key: 'buffered_',\n value: function buffered_() {\n if (!this.subtitlesTrack_ || !this.subtitlesTrack_.cues.length) {\n return videojs$1.createTimeRanges();\n }\n\n var cues = this.subtitlesTrack_.cues;\n var start = cues[0].startTime;\n var end = cues[cues.length - 1].startTime;\n return videojs$1.createTimeRanges([[start, end]]);\n }\n /**\n * Gets and sets init segment for the provided map\n *\n * @param {Object} map\n * The map object representing the init segment to get or set\n * @param {Boolean=} set\n * If true, the init segment for the provided map should be saved\n * @return {Object}\n * map object for desired init segment\n */\n\n }, {\n key: 'initSegment',\n value: function initSegment(map) {\n var set$$1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (!map) {\n return null;\n }\n\n var id = initSegmentId(map);\n var storedMap = this.initSegments_[id];\n\n if (set$$1 && !storedMap && map.bytes) {\n // append WebVTT line terminators to the media initialization segment if it exists\n // to follow the WebVTT spec (https://w3c.github.io/webvtt/#file-structure) that\n // requires two or more WebVTT line terminators between the WebVTT header and the\n // rest of the file\n var combinedByteLength = VTT_LINE_TERMINATORS.byteLength + map.bytes.byteLength;\n var combinedSegment = new Uint8Array(combinedByteLength);\n combinedSegment.set(map.bytes);\n combinedSegment.set(VTT_LINE_TERMINATORS, map.bytes.byteLength);\n this.initSegments_[id] = storedMap = {\n resolvedUri: map.resolvedUri,\n byterange: map.byterange,\n bytes: combinedSegment\n };\n }\n\n return storedMap || map;\n }\n /**\n * Returns true if all configuration required for loading is present, otherwise false.\n *\n * @return {Boolean} True if the all configuration is ready for loading\n * @private\n */\n\n }, {\n key: 'couldBeginLoading_',\n value: function couldBeginLoading_() {\n return this.playlist_ && this.subtitlesTrack_ && !this.paused();\n }\n /**\n * Once all the starting parameters have been specified, begin\n * operation. This method should only be invoked from the INIT\n * state.\n *\n * @private\n */\n\n }, {\n key: 'init_',\n value: function init_() {\n this.state = 'READY';\n this.resetEverything();\n return this.monitorBuffer_();\n }\n /**\n * Set a subtitle track on the segment loader to add subtitles to\n *\n * @param {TextTrack=} track\n * The text track to add loaded subtitles to\n * @return {TextTrack}\n * Returns the subtitles track\n */\n\n }, {\n key: 'track',\n value: function track(_track) {\n if (typeof _track === 'undefined') {\n return this.subtitlesTrack_;\n }\n\n this.subtitlesTrack_ = _track; // if we were unpaused but waiting for a sourceUpdater, start\n // buffering now\n\n if (this.state === 'INIT' && this.couldBeginLoading_()) {\n this.init_();\n }\n\n return this.subtitlesTrack_;\n }\n /**\n * Remove any data in the source buffer between start and end times\n * @param {Number} start - the start time of the region to remove from the buffer\n * @param {Number} end - the end time of the region to remove from the buffer\n */\n\n }, {\n key: 'remove',\n value: function remove(start, end) {\n removeCuesFromTrack(start, end, this.subtitlesTrack_);\n }\n /**\n * fill the buffer with segements unless the sourceBuffers are\n * currently updating\n *\n * Note: this function should only ever be called by monitorBuffer_\n * and never directly\n *\n * @private\n */\n\n }, {\n key: 'fillBuffer_',\n value: function fillBuffer_() {\n var _this2 = this;\n\n if (!this.syncPoint_) {\n this.syncPoint_ = this.syncController_.getSyncPoint(this.playlist_, this.duration_(), this.currentTimeline_, this.currentTime_());\n } // see if we need to begin loading immediately\n\n\n var segmentInfo = this.checkBuffer_(this.buffered_(), this.playlist_, this.mediaIndex, this.hasPlayed_(), this.currentTime_(), this.syncPoint_);\n segmentInfo = this.skipEmptySegments_(segmentInfo);\n\n if (!segmentInfo) {\n return;\n }\n\n if (this.syncController_.timestampOffsetForTimeline(segmentInfo.timeline) === null) {\n // We don't have the timestamp offset that we need to sync subtitles.\n // Rerun on a timestamp offset or user interaction.\n var checkTimestampOffset = function checkTimestampOffset() {\n _this2.state = 'READY';\n\n if (!_this2.paused()) {\n // if not paused, queue a buffer check as soon as possible\n _this2.monitorBuffer_();\n }\n };\n\n this.syncController_.one('timestampoffset', checkTimestampOffset);\n this.state = 'WAITING_ON_TIMELINE';\n return;\n }\n\n this.loadSegment_(segmentInfo);\n }\n /**\n * Prevents the segment loader from requesting segments we know contain no subtitles\n * by walking forward until we find the next segment that we don't know whether it is\n * empty or not.\n *\n * @param {Object} segmentInfo\n * a segment info object that describes the current segment\n * @return {Object}\n * a segment info object that describes the current segment\n */\n\n }, {\n key: 'skipEmptySegments_',\n value: function skipEmptySegments_(segmentInfo) {\n while (segmentInfo && segmentInfo.segment.empty) {\n segmentInfo = this.generateSegmentInfo_(segmentInfo.playlist, segmentInfo.mediaIndex + 1, segmentInfo.startOfSegment + segmentInfo.duration, segmentInfo.isSyncRequest);\n }\n\n return segmentInfo;\n }\n /**\n * append a decrypted segement to the SourceBuffer through a SourceUpdater\n *\n * @private\n */\n\n }, {\n key: 'handleSegment_',\n value: function handleSegment_() {\n var _this3 = this;\n\n if (!this.pendingSegment_ || !this.subtitlesTrack_) {\n this.state = 'READY';\n return;\n }\n\n this.state = 'APPENDING';\n var segmentInfo = this.pendingSegment_;\n var segment = segmentInfo.segment; // Make sure that vttjs has loaded, otherwise, wait till it finished loading\n\n if (typeof window$1.WebVTT !== 'function' && this.subtitlesTrack_ && this.subtitlesTrack_.tech_) {\n var loadHandler = function loadHandler() {\n _this3.handleSegment_();\n };\n\n this.state = 'WAITING_ON_VTTJS';\n this.subtitlesTrack_.tech_.one('vttjsloaded', loadHandler);\n this.subtitlesTrack_.tech_.one('vttjserror', function () {\n _this3.subtitlesTrack_.tech_.off('vttjsloaded', loadHandler);\n\n _this3.error({\n message: 'Error loading vtt.js'\n });\n\n _this3.state = 'READY';\n\n _this3.pause();\n\n _this3.trigger('error');\n });\n return;\n }\n\n segment.requested = true;\n\n try {\n this.parseVTTCues_(segmentInfo);\n } catch (e) {\n this.error({\n message: e.message\n });\n this.state = 'READY';\n this.pause();\n return this.trigger('error');\n }\n\n this.updateTimeMapping_(segmentInfo, this.syncController_.timelines[segmentInfo.timeline], this.playlist_);\n\n if (segmentInfo.isSyncRequest) {\n this.trigger('syncinfoupdate');\n this.pendingSegment_ = null;\n this.state = 'READY';\n return;\n }\n\n segmentInfo.byteLength = segmentInfo.bytes.byteLength;\n this.mediaSecondsLoaded += segment.duration;\n\n if (segmentInfo.cues.length) {\n // remove any overlapping cues to prevent doubling\n this.remove(segmentInfo.cues[0].endTime, segmentInfo.cues[segmentInfo.cues.length - 1].endTime);\n }\n\n segmentInfo.cues.forEach(function (cue) {\n _this3.subtitlesTrack_.addCue(cue);\n });\n this.handleUpdateEnd_();\n }\n /**\n * Uses the WebVTT parser to parse the segment response\n *\n * @param {Object} segmentInfo\n * a segment info object that describes the current segment\n * @private\n */\n\n }, {\n key: 'parseVTTCues_',\n value: function parseVTTCues_(segmentInfo) {\n var decoder = void 0;\n var decodeBytesToString = false;\n\n if (typeof window$1.TextDecoder === 'function') {\n decoder = new window$1.TextDecoder('utf8');\n } else {\n decoder = window$1.WebVTT.StringDecoder();\n decodeBytesToString = true;\n }\n\n var parser = new window$1.WebVTT.Parser(window$1, window$1.vttjs, decoder);\n segmentInfo.cues = [];\n segmentInfo.timestampmap = {\n MPEGTS: 0,\n LOCAL: 0\n };\n parser.oncue = segmentInfo.cues.push.bind(segmentInfo.cues);\n\n parser.ontimestampmap = function (map) {\n return segmentInfo.timestampmap = map;\n };\n\n parser.onparsingerror = function (error) {\n videojs$1.log.warn('Error encountered when parsing cues: ' + error.message);\n };\n\n if (segmentInfo.segment.map) {\n var mapData = segmentInfo.segment.map.bytes;\n\n if (decodeBytesToString) {\n mapData = uint8ToUtf8(mapData);\n }\n\n parser.parse(mapData);\n }\n\n var segmentData = segmentInfo.bytes;\n\n if (decodeBytesToString) {\n segmentData = uint8ToUtf8(segmentData);\n }\n\n parser.parse(segmentData);\n parser.flush();\n }\n /**\n * Updates the start and end times of any cues parsed by the WebVTT parser using\n * the information parsed from the X-TIMESTAMP-MAP header and a TS to media time mapping\n * from the SyncController\n *\n * @param {Object} segmentInfo\n * a segment info object that describes the current segment\n * @param {Object} mappingObj\n * object containing a mapping from TS to media time\n * @param {Object} playlist\n * the playlist object containing the segment\n * @private\n */\n\n }, {\n key: 'updateTimeMapping_',\n value: function updateTimeMapping_(segmentInfo, mappingObj, playlist) {\n var segment = segmentInfo.segment;\n\n if (!mappingObj) {\n // If the sync controller does not have a mapping of TS to Media Time for the\n // timeline, then we don't have enough information to update the cue\n // start/end times\n return;\n }\n\n if (!segmentInfo.cues.length) {\n // If there are no cues, we also do not have enough information to figure out\n // segment timing. Mark that the segment contains no cues so we don't re-request\n // an empty segment.\n segment.empty = true;\n return;\n }\n\n var timestampmap = segmentInfo.timestampmap;\n var diff = timestampmap.MPEGTS / 90000 - timestampmap.LOCAL + mappingObj.mapping;\n segmentInfo.cues.forEach(function (cue) {\n // First convert cue time to TS time using the timestamp-map provided within the vtt\n cue.startTime += diff;\n cue.endTime += diff;\n });\n\n if (!playlist.syncInfo) {\n var firstStart = segmentInfo.cues[0].startTime;\n var lastStart = segmentInfo.cues[segmentInfo.cues.length - 1].startTime;\n playlist.syncInfo = {\n mediaSequence: playlist.mediaSequence + segmentInfo.mediaIndex,\n time: Math.min(firstStart, lastStart - segment.duration)\n };\n }\n }\n }]);\n return VTTSegmentLoader;\n}(SegmentLoader);\n/**\n * @file ad-cue-tags.js\n */\n\n/**\n * Searches for an ad cue that overlaps with the given mediaTime\n */\n\n\nvar findAdCue = function findAdCue(track, mediaTime) {\n var cues = track.cues;\n\n for (var i = 0; i < cues.length; i++) {\n var cue = cues[i];\n\n if (mediaTime >= cue.adStartTime && mediaTime <= cue.adEndTime) {\n return cue;\n }\n }\n\n return null;\n};\n\nvar updateAdCues = function updateAdCues(media, track) {\n var offset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n\n if (!media.segments) {\n return;\n }\n\n var mediaTime = offset;\n var cue = void 0;\n\n for (var i = 0; i < media.segments.length; i++) {\n var segment = media.segments[i];\n\n if (!cue) {\n // Since the cues will span for at least the segment duration, adding a fudge\n // factor of half segment duration will prevent duplicate cues from being\n // created when timing info is not exact (e.g. cue start time initialized\n // at 10.006677, but next call mediaTime is 10.003332 )\n cue = findAdCue(track, mediaTime + segment.duration / 2);\n }\n\n if (cue) {\n if ('cueIn' in segment) {\n // Found a CUE-IN so end the cue\n cue.endTime = mediaTime;\n cue.adEndTime = mediaTime;\n mediaTime += segment.duration;\n cue = null;\n continue;\n }\n\n if (mediaTime < cue.endTime) {\n // Already processed this mediaTime for this cue\n mediaTime += segment.duration;\n continue;\n } // otherwise extend cue until a CUE-IN is found\n\n\n cue.endTime += segment.duration;\n } else {\n if ('cueOut' in segment) {\n cue = new window$1.VTTCue(mediaTime, mediaTime + segment.duration, segment.cueOut);\n cue.adStartTime = mediaTime; // Assumes tag format to be\n // #EXT-X-CUE-OUT:30\n\n cue.adEndTime = mediaTime + parseFloat(segment.cueOut);\n track.addCue(cue);\n }\n\n if ('cueOutCont' in segment) {\n // Entered into the middle of an ad cue\n var adOffset = void 0;\n var adTotal = void 0; // Assumes tag formate to be\n // #EXT-X-CUE-OUT-CONT:10/30\n\n var _segment$cueOutCont$s = segment.cueOutCont.split('/').map(parseFloat);\n\n var _segment$cueOutCont$s2 = slicedToArray(_segment$cueOutCont$s, 2);\n\n adOffset = _segment$cueOutCont$s2[0];\n adTotal = _segment$cueOutCont$s2[1];\n cue = new window$1.VTTCue(mediaTime, mediaTime + segment.duration, '');\n cue.adStartTime = mediaTime - adOffset;\n cue.adEndTime = cue.adStartTime + adTotal;\n track.addCue(cue);\n }\n }\n\n mediaTime += segment.duration;\n }\n};\n/**\n * @file sync-controller.js\n */\n\n\nvar tsprobe = tsInspector.inspect;\nvar syncPointStrategies = [// Stategy \"VOD\": Handle the VOD-case where the sync-point is *always*\n// the equivalence display-time 0 === segment-index 0\n{\n name: 'VOD',\n run: function run(syncController, playlist, duration$$1, currentTimeline, currentTime) {\n if (duration$$1 !== Infinity) {\n var syncPoint = {\n time: 0,\n segmentIndex: 0\n };\n return syncPoint;\n }\n\n return null;\n }\n}, // Stategy \"ProgramDateTime\": We have a program-date-time tag in this playlist\n{\n name: 'ProgramDateTime',\n run: function run(syncController, playlist, duration$$1, currentTimeline, currentTime) {\n if (!syncController.datetimeToDisplayTime) {\n return null;\n }\n\n var segments = playlist.segments || [];\n var syncPoint = null;\n var lastDistance = null;\n currentTime = currentTime || 0;\n\n for (var i = 0; i < segments.length; i++) {\n var segment = segments[i];\n\n if (segment.dateTimeObject) {\n var segmentTime = segment.dateTimeObject.getTime() / 1000;\n var segmentStart = segmentTime + syncController.datetimeToDisplayTime;\n var distance = Math.abs(currentTime - segmentStart); // Once the distance begins to increase, we have passed\n // currentTime and can stop looking for better candidates\n\n if (lastDistance !== null && lastDistance < distance) {\n break;\n }\n\n lastDistance = distance;\n syncPoint = {\n time: segmentStart,\n segmentIndex: i\n };\n }\n }\n\n return syncPoint;\n }\n}, // Stategy \"Segment\": We have a known time mapping for a timeline and a\n// segment in the current timeline with timing data\n{\n name: 'Segment',\n run: function run(syncController, playlist, duration$$1, currentTimeline, currentTime) {\n var segments = playlist.segments || [];\n var syncPoint = null;\n var lastDistance = null;\n currentTime = currentTime || 0;\n\n for (var i = 0; i < segments.length; i++) {\n var segment = segments[i];\n\n if (segment.timeline === currentTimeline && typeof segment.start !== 'undefined') {\n var distance = Math.abs(currentTime - segment.start); // Once the distance begins to increase, we have passed\n // currentTime and can stop looking for better candidates\n\n if (lastDistance !== null && lastDistance < distance) {\n break;\n }\n\n if (!syncPoint || lastDistance === null || lastDistance >= distance) {\n lastDistance = distance;\n syncPoint = {\n time: segment.start,\n segmentIndex: i\n };\n }\n }\n }\n\n return syncPoint;\n }\n}, // Stategy \"Discontinuity\": We have a discontinuity with a known\n// display-time\n{\n name: 'Discontinuity',\n run: function run(syncController, playlist, duration$$1, currentTimeline, currentTime) {\n var syncPoint = null;\n currentTime = currentTime || 0;\n\n if (playlist.discontinuityStarts && playlist.discontinuityStarts.length) {\n var lastDistance = null;\n\n for (var i = 0; i < playlist.discontinuityStarts.length; i++) {\n var segmentIndex = playlist.discontinuityStarts[i];\n var discontinuity = playlist.discontinuitySequence + i + 1;\n var discontinuitySync = syncController.discontinuities[discontinuity];\n\n if (discontinuitySync) {\n var distance = Math.abs(currentTime - discontinuitySync.time); // Once the distance begins to increase, we have passed\n // currentTime and can stop looking for better candidates\n\n if (lastDistance !== null && lastDistance < distance) {\n break;\n }\n\n if (!syncPoint || lastDistance === null || lastDistance >= distance) {\n lastDistance = distance;\n syncPoint = {\n time: discontinuitySync.time,\n segmentIndex: segmentIndex\n };\n }\n }\n }\n }\n\n return syncPoint;\n }\n}, // Stategy \"Playlist\": We have a playlist with a known mapping of\n// segment index to display time\n{\n name: 'Playlist',\n run: function run(syncController, playlist, duration$$1, currentTimeline, currentTime) {\n if (playlist.syncInfo) {\n var syncPoint = {\n time: playlist.syncInfo.time,\n segmentIndex: playlist.syncInfo.mediaSequence - playlist.mediaSequence\n };\n return syncPoint;\n }\n\n return null;\n }\n}];\n\nvar SyncController = function (_videojs$EventTarget) {\n inherits(SyncController, _videojs$EventTarget);\n\n function SyncController() {\n classCallCheck(this, SyncController); // Segment Loader state variables...\n // ...for synching across variants\n\n var _this = possibleConstructorReturn(this, (SyncController.__proto__ || Object.getPrototypeOf(SyncController)).call(this));\n\n _this.inspectCache_ = undefined; // ...for synching across variants\n\n _this.timelines = [];\n _this.discontinuities = [];\n _this.datetimeToDisplayTime = null;\n _this.logger_ = logger('SyncController');\n return _this;\n }\n /**\n * Find a sync-point for the playlist specified\n *\n * A sync-point is defined as a known mapping from display-time to\n * a segment-index in the current playlist.\n *\n * @param {Playlist} playlist\n * The playlist that needs a sync-point\n * @param {Number} duration\n * Duration of the MediaSource (Infinite if playing a live source)\n * @param {Number} currentTimeline\n * The last timeline from which a segment was loaded\n * @returns {Object}\n * A sync-point object\n */\n\n\n createClass(SyncController, [{\n key: 'getSyncPoint',\n value: function getSyncPoint(playlist, duration$$1, currentTimeline, currentTime) {\n var syncPoints = this.runStrategies_(playlist, duration$$1, currentTimeline, currentTime);\n\n if (!syncPoints.length) {\n // Signal that we need to attempt to get a sync-point manually\n // by fetching a segment in the playlist and constructing\n // a sync-point from that information\n return null;\n } // Now find the sync-point that is closest to the currentTime because\n // that should result in the most accurate guess about which segment\n // to fetch\n\n\n return this.selectSyncPoint_(syncPoints, {\n key: 'time',\n value: currentTime\n });\n }\n /**\n * Calculate the amount of time that has expired off the playlist during playback\n *\n * @param {Playlist} playlist\n * Playlist object to calculate expired from\n * @param {Number} duration\n * Duration of the MediaSource (Infinity if playling a live source)\n * @returns {Number|null}\n * The amount of time that has expired off the playlist during playback. Null\n * if no sync-points for the playlist can be found.\n */\n\n }, {\n key: 'getExpiredTime',\n value: function getExpiredTime(playlist, duration$$1) {\n if (!playlist || !playlist.segments) {\n return null;\n }\n\n var syncPoints = this.runStrategies_(playlist, duration$$1, playlist.discontinuitySequence, 0); // Without sync-points, there is not enough information to determine the expired time\n\n if (!syncPoints.length) {\n return null;\n }\n\n var syncPoint = this.selectSyncPoint_(syncPoints, {\n key: 'segmentIndex',\n value: 0\n }); // If the sync-point is beyond the start of the playlist, we want to subtract the\n // duration from index 0 to syncPoint.segmentIndex instead of adding.\n\n if (syncPoint.segmentIndex > 0) {\n syncPoint.time *= -1;\n }\n\n return Math.abs(syncPoint.time + sumDurations(playlist, syncPoint.segmentIndex, 0));\n }\n /**\n * Runs each sync-point strategy and returns a list of sync-points returned by the\n * strategies\n *\n * @private\n * @param {Playlist} playlist\n * The playlist that needs a sync-point\n * @param {Number} duration\n * Duration of the MediaSource (Infinity if playing a live source)\n * @param {Number} currentTimeline\n * The last timeline from which a segment was loaded\n * @returns {Array}\n * A list of sync-point objects\n */\n\n }, {\n key: 'runStrategies_',\n value: function runStrategies_(playlist, duration$$1, currentTimeline, currentTime) {\n var syncPoints = []; // Try to find a sync-point in by utilizing various strategies...\n\n for (var i = 0; i < syncPointStrategies.length; i++) {\n var strategy = syncPointStrategies[i];\n var syncPoint = strategy.run(this, playlist, duration$$1, currentTimeline, currentTime);\n\n if (syncPoint) {\n syncPoint.strategy = strategy.name;\n syncPoints.push({\n strategy: strategy.name,\n syncPoint: syncPoint\n });\n }\n }\n\n return syncPoints;\n }\n /**\n * Selects the sync-point nearest the specified target\n *\n * @private\n * @param {Array} syncPoints\n * List of sync-points to select from\n * @param {Object} target\n * Object specifying the property and value we are targeting\n * @param {String} target.key\n * Specifies the property to target. Must be either 'time' or 'segmentIndex'\n * @param {Number} target.value\n * The value to target for the specified key.\n * @returns {Object}\n * The sync-point nearest the target\n */\n\n }, {\n key: 'selectSyncPoint_',\n value: function selectSyncPoint_(syncPoints, target) {\n var bestSyncPoint = syncPoints[0].syncPoint;\n var bestDistance = Math.abs(syncPoints[0].syncPoint[target.key] - target.value);\n var bestStrategy = syncPoints[0].strategy;\n\n for (var i = 1; i < syncPoints.length; i++) {\n var newDistance = Math.abs(syncPoints[i].syncPoint[target.key] - target.value);\n\n if (newDistance < bestDistance) {\n bestDistance = newDistance;\n bestSyncPoint = syncPoints[i].syncPoint;\n bestStrategy = syncPoints[i].strategy;\n }\n }\n\n this.logger_('syncPoint for [' + target.key + ': ' + target.value + '] chosen with strategy' + (' [' + bestStrategy + ']: [time:' + bestSyncPoint.time + ',') + (' segmentIndex:' + bestSyncPoint.segmentIndex + ']'));\n return bestSyncPoint;\n }\n /**\n * Save any meta-data present on the segments when segments leave\n * the live window to the playlist to allow for synchronization at the\n * playlist level later.\n *\n * @param {Playlist} oldPlaylist - The previous active playlist\n * @param {Playlist} newPlaylist - The updated and most current playlist\n */\n\n }, {\n key: 'saveExpiredSegmentInfo',\n value: function saveExpiredSegmentInfo(oldPlaylist, newPlaylist) {\n var mediaSequenceDiff = newPlaylist.mediaSequence - oldPlaylist.mediaSequence; // When a segment expires from the playlist and it has a start time\n // save that information as a possible sync-point reference in future\n\n for (var i = mediaSequenceDiff - 1; i >= 0; i--) {\n var lastRemovedSegment = oldPlaylist.segments[i];\n\n if (lastRemovedSegment && typeof lastRemovedSegment.start !== 'undefined') {\n newPlaylist.syncInfo = {\n mediaSequence: oldPlaylist.mediaSequence + i,\n time: lastRemovedSegment.start\n };\n this.logger_('playlist refresh sync: [time:' + newPlaylist.syncInfo.time + ',' + (' mediaSequence: ' + newPlaylist.syncInfo.mediaSequence + ']'));\n this.trigger('syncinfoupdate');\n break;\n }\n }\n }\n /**\n * Save the mapping from playlist's ProgramDateTime to display. This should\n * only ever happen once at the start of playback.\n *\n * @param {Playlist} playlist - The currently active playlist\n */\n\n }, {\n key: 'setDateTimeMapping',\n value: function setDateTimeMapping(playlist) {\n if (!this.datetimeToDisplayTime && playlist.segments && playlist.segments.length && playlist.segments[0].dateTimeObject) {\n var playlistTimestamp = playlist.segments[0].dateTimeObject.getTime() / 1000;\n this.datetimeToDisplayTime = -playlistTimestamp;\n }\n }\n /**\n * Reset the state of the inspection cache when we do a rendition\n * switch\n */\n\n }, {\n key: 'reset',\n value: function reset() {\n this.inspectCache_ = undefined;\n }\n /**\n * Probe or inspect a fmp4 or an mpeg2-ts segment to determine the start\n * and end of the segment in it's internal \"media time\". Used to generate\n * mappings from that internal \"media time\" to the display time that is\n * shown on the player.\n *\n * @param {SegmentInfo} segmentInfo - The current active request information\n */\n\n }, {\n key: 'probeSegmentInfo',\n value: function probeSegmentInfo(segmentInfo) {\n var segment = segmentInfo.segment;\n var playlist = segmentInfo.playlist;\n var timingInfo = void 0;\n\n if (segment.map) {\n timingInfo = this.probeMp4Segment_(segmentInfo);\n } else {\n timingInfo = this.probeTsSegment_(segmentInfo);\n }\n\n if (timingInfo) {\n if (this.calculateSegmentTimeMapping_(segmentInfo, timingInfo)) {\n this.saveDiscontinuitySyncInfo_(segmentInfo); // If the playlist does not have sync information yet, record that information\n // now with segment timing information\n\n if (!playlist.syncInfo) {\n playlist.syncInfo = {\n mediaSequence: playlist.mediaSequence + segmentInfo.mediaIndex,\n time: segment.start\n };\n }\n }\n }\n\n return timingInfo;\n }\n /**\n * Probe an fmp4 or an mpeg2-ts segment to determine the start of the segment\n * in it's internal \"media time\".\n *\n * @private\n * @param {SegmentInfo} segmentInfo - The current active request information\n * @return {object} The start and end time of the current segment in \"media time\"\n */\n\n }, {\n key: 'probeMp4Segment_',\n value: function probeMp4Segment_(segmentInfo) {\n var segment = segmentInfo.segment;\n var timescales = mp4probe.timescale(segment.map.bytes);\n var startTime = mp4probe.startTime(timescales, segmentInfo.bytes);\n\n if (segmentInfo.timestampOffset !== null) {\n segmentInfo.timestampOffset -= startTime;\n }\n\n return {\n start: startTime,\n end: startTime + segment.duration\n };\n }\n /**\n * Probe an mpeg2-ts segment to determine the start and end of the segment\n * in it's internal \"media time\".\n *\n * @private\n * @param {SegmentInfo} segmentInfo - The current active request information\n * @return {object} The start and end time of the current segment in \"media time\"\n */\n\n }, {\n key: 'probeTsSegment_',\n value: function probeTsSegment_(segmentInfo) {\n var timeInfo = tsprobe(segmentInfo.bytes, this.inspectCache_);\n var segmentStartTime = void 0;\n var segmentEndTime = void 0;\n\n if (!timeInfo) {\n return null;\n }\n\n if (timeInfo.video && timeInfo.video.length === 2) {\n this.inspectCache_ = timeInfo.video[1].dts;\n segmentStartTime = timeInfo.video[0].dtsTime;\n segmentEndTime = timeInfo.video[1].dtsTime;\n } else if (timeInfo.audio && timeInfo.audio.length === 2) {\n this.inspectCache_ = timeInfo.audio[1].dts;\n segmentStartTime = timeInfo.audio[0].dtsTime;\n segmentEndTime = timeInfo.audio[1].dtsTime;\n }\n\n return {\n start: segmentStartTime,\n end: segmentEndTime,\n containsVideo: timeInfo.video && timeInfo.video.length === 2,\n containsAudio: timeInfo.audio && timeInfo.audio.length === 2\n };\n }\n }, {\n key: 'timestampOffsetForTimeline',\n value: function timestampOffsetForTimeline(timeline) {\n if (typeof this.timelines[timeline] === 'undefined') {\n return null;\n }\n\n return this.timelines[timeline].time;\n }\n }, {\n key: 'mappingForTimeline',\n value: function mappingForTimeline(timeline) {\n if (typeof this.timelines[timeline] === 'undefined') {\n return null;\n }\n\n return this.timelines[timeline].mapping;\n }\n /**\n * Use the \"media time\" for a segment to generate a mapping to \"display time\" and\n * save that display time to the segment.\n *\n * @private\n * @param {SegmentInfo} segmentInfo\n * The current active request information\n * @param {object} timingInfo\n * The start and end time of the current segment in \"media time\"\n * @returns {Boolean}\n * Returns false if segment time mapping could not be calculated\n */\n\n }, {\n key: 'calculateSegmentTimeMapping_',\n value: function calculateSegmentTimeMapping_(segmentInfo, timingInfo) {\n var segment = segmentInfo.segment;\n var mappingObj = this.timelines[segmentInfo.timeline];\n\n if (segmentInfo.timestampOffset !== null) {\n mappingObj = {\n time: segmentInfo.startOfSegment,\n mapping: segmentInfo.startOfSegment - timingInfo.start\n };\n this.timelines[segmentInfo.timeline] = mappingObj;\n this.trigger('timestampoffset');\n this.logger_('time mapping for timeline ' + segmentInfo.timeline + ': ' + ('[time: ' + mappingObj.time + '] [mapping: ' + mappingObj.mapping + ']'));\n segment.start = segmentInfo.startOfSegment;\n segment.end = timingInfo.end + mappingObj.mapping;\n } else if (mappingObj) {\n segment.start = timingInfo.start + mappingObj.mapping;\n segment.end = timingInfo.end + mappingObj.mapping;\n } else {\n return false;\n }\n\n return true;\n }\n /**\n * Each time we have discontinuity in the playlist, attempt to calculate the location\n * in display of the start of the discontinuity and save that. We also save an accuracy\n * value so that we save values with the most accuracy (closest to 0.)\n *\n * @private\n * @param {SegmentInfo} segmentInfo - The current active request information\n */\n\n }, {\n key: 'saveDiscontinuitySyncInfo_',\n value: function saveDiscontinuitySyncInfo_(segmentInfo) {\n var playlist = segmentInfo.playlist;\n var segment = segmentInfo.segment; // If the current segment is a discontinuity then we know exactly where\n // the start of the range and it's accuracy is 0 (greater accuracy values\n // mean more approximation)\n\n if (segment.discontinuity) {\n this.discontinuities[segment.timeline] = {\n time: segment.start,\n accuracy: 0\n };\n } else if (playlist.discontinuityStarts && playlist.discontinuityStarts.length) {\n // Search for future discontinuities that we can provide better timing\n // information for and save that information for sync purposes\n for (var i = 0; i < playlist.discontinuityStarts.length; i++) {\n var segmentIndex = playlist.discontinuityStarts[i];\n var discontinuity = playlist.discontinuitySequence + i + 1;\n var mediaIndexDiff = segmentIndex - segmentInfo.mediaIndex;\n var accuracy = Math.abs(mediaIndexDiff);\n\n if (!this.discontinuities[discontinuity] || this.discontinuities[discontinuity].accuracy > accuracy) {\n var time = void 0;\n\n if (mediaIndexDiff < 0) {\n time = segment.start - sumDurations(playlist, segmentInfo.mediaIndex, segmentIndex);\n } else {\n time = segment.end + sumDurations(playlist, segmentInfo.mediaIndex + 1, segmentIndex);\n }\n\n this.discontinuities[discontinuity] = {\n time: time,\n accuracy: accuracy\n };\n }\n }\n }\n }\n }]);\n return SyncController;\n}(videojs$1.EventTarget);\n\nvar Decrypter$1 = new shimWorker(\"./decrypter-worker.worker.js\", function (window, document$$1) {\n var self = this;\n\n var decrypterWorker = function () {\n /*\n * pkcs7.pad\n * https://github.com/brightcove/pkcs7\n *\n * Copyright (c) 2014 Brightcove\n * Licensed under the apache2 license.\n */\n\n /**\n * Returns the subarray of a Uint8Array without PKCS#7 padding.\n * @param padded {Uint8Array} unencrypted bytes that have been padded\n * @return {Uint8Array} the unpadded bytes\n * @see http://tools.ietf.org/html/rfc5652\n */\n function unpad(padded) {\n return padded.subarray(0, padded.byteLength - padded[padded.byteLength - 1]);\n }\n\n var classCallCheck = function classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n };\n\n var createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n }();\n\n var inherits = function inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n };\n\n var possibleConstructorReturn = function possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n };\n /**\n * @file aes.js\n *\n * This file contains an adaptation of the AES decryption algorithm\n * from the Standford Javascript Cryptography Library. That work is\n * covered by the following copyright and permissions notice:\n *\n * Copyright 2009-2010 Emily Stark, Mike Hamburg, Dan Boneh.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following\n * disclaimer in the documentation and/or other materials provided\n * with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * The views and conclusions contained in the software and documentation\n * are those of the authors and should not be interpreted as representing\n * official policies, either expressed or implied, of the authors.\n */\n\n /**\n * Expand the S-box tables.\n *\n * @private\n */\n\n\n var precompute = function precompute() {\n var tables = [[[], [], [], [], []], [[], [], [], [], []]];\n var encTable = tables[0];\n var decTable = tables[1];\n var sbox = encTable[4];\n var sboxInv = decTable[4];\n var i = void 0;\n var x = void 0;\n var xInv = void 0;\n var d = [];\n var th = [];\n var x2 = void 0;\n var x4 = void 0;\n var x8 = void 0;\n var s = void 0;\n var tEnc = void 0;\n var tDec = void 0; // Compute double and third tables\n\n for (i = 0; i < 256; i++) {\n th[(d[i] = i << 1 ^ (i >> 7) * 283) ^ i] = i;\n }\n\n for (x = xInv = 0; !sbox[x]; x ^= x2 || 1, xInv = th[xInv] || 1) {\n // Compute sbox\n s = xInv ^ xInv << 1 ^ xInv << 2 ^ xInv << 3 ^ xInv << 4;\n s = s >> 8 ^ s & 255 ^ 99;\n sbox[x] = s;\n sboxInv[s] = x; // Compute MixColumns\n\n x8 = d[x4 = d[x2 = d[x]]];\n tDec = x8 * 0x1010101 ^ x4 * 0x10001 ^ x2 * 0x101 ^ x * 0x1010100;\n tEnc = d[s] * 0x101 ^ s * 0x1010100;\n\n for (i = 0; i < 4; i++) {\n encTable[i][x] = tEnc = tEnc << 24 ^ tEnc >>> 8;\n decTable[i][s] = tDec = tDec << 24 ^ tDec >>> 8;\n }\n } // Compactify. Considerable speedup on Firefox.\n\n\n for (i = 0; i < 5; i++) {\n encTable[i] = encTable[i].slice(0);\n decTable[i] = decTable[i].slice(0);\n }\n\n return tables;\n };\n\n var aesTables = null;\n /**\n * Schedule out an AES key for both encryption and decryption. This\n * is a low-level class. Use a cipher mode to do bulk encryption.\n *\n * @class AES\n * @param key {Array} The key as an array of 4, 6 or 8 words.\n */\n\n var AES = function () {\n function AES(key) {\n classCallCheck(this, AES);\n /**\n * The expanded S-box and inverse S-box tables. These will be computed\n * on the client so that we don't have to send them down the wire.\n *\n * There are two tables, _tables[0] is for encryption and\n * _tables[1] is for decryption.\n *\n * The first 4 sub-tables are the expanded S-box with MixColumns. The\n * last (_tables[01][4]) is the S-box itself.\n *\n * @private\n */\n // if we have yet to precompute the S-box tables\n // do so now\n\n if (!aesTables) {\n aesTables = precompute();\n } // then make a copy of that object for use\n\n\n this._tables = [[aesTables[0][0].slice(), aesTables[0][1].slice(), aesTables[0][2].slice(), aesTables[0][3].slice(), aesTables[0][4].slice()], [aesTables[1][0].slice(), aesTables[1][1].slice(), aesTables[1][2].slice(), aesTables[1][3].slice(), aesTables[1][4].slice()]];\n var i = void 0;\n var j = void 0;\n var tmp = void 0;\n var encKey = void 0;\n var decKey = void 0;\n var sbox = this._tables[0][4];\n var decTable = this._tables[1];\n var keyLen = key.length;\n var rcon = 1;\n\n if (keyLen !== 4 && keyLen !== 6 && keyLen !== 8) {\n throw new Error('Invalid aes key size');\n }\n\n encKey = key.slice(0);\n decKey = [];\n this._key = [encKey, decKey]; // schedule encryption keys\n\n for (i = keyLen; i < 4 * keyLen + 28; i++) {\n tmp = encKey[i - 1]; // apply sbox\n\n if (i % keyLen === 0 || keyLen === 8 && i % keyLen === 4) {\n tmp = sbox[tmp >>> 24] << 24 ^ sbox[tmp >> 16 & 255] << 16 ^ sbox[tmp >> 8 & 255] << 8 ^ sbox[tmp & 255]; // shift rows and add rcon\n\n if (i % keyLen === 0) {\n tmp = tmp << 8 ^ tmp >>> 24 ^ rcon << 24;\n rcon = rcon << 1 ^ (rcon >> 7) * 283;\n }\n }\n\n encKey[i] = encKey[i - keyLen] ^ tmp;\n } // schedule decryption keys\n\n\n for (j = 0; i; j++, i--) {\n tmp = encKey[j & 3 ? i : i - 4];\n\n if (i <= 4 || j < 4) {\n decKey[j] = tmp;\n } else {\n decKey[j] = decTable[0][sbox[tmp >>> 24]] ^ decTable[1][sbox[tmp >> 16 & 255]] ^ decTable[2][sbox[tmp >> 8 & 255]] ^ decTable[3][sbox[tmp & 255]];\n }\n }\n }\n /**\n * Decrypt 16 bytes, specified as four 32-bit words.\n *\n * @param {Number} encrypted0 the first word to decrypt\n * @param {Number} encrypted1 the second word to decrypt\n * @param {Number} encrypted2 the third word to decrypt\n * @param {Number} encrypted3 the fourth word to decrypt\n * @param {Int32Array} out the array to write the decrypted words\n * into\n * @param {Number} offset the offset into the output array to start\n * writing results\n * @return {Array} The plaintext.\n */\n\n\n AES.prototype.decrypt = function decrypt$$1(encrypted0, encrypted1, encrypted2, encrypted3, out, offset) {\n var key = this._key[1]; // state variables a,b,c,d are loaded with pre-whitened data\n\n var a = encrypted0 ^ key[0];\n var b = encrypted3 ^ key[1];\n var c = encrypted2 ^ key[2];\n var d = encrypted1 ^ key[3];\n var a2 = void 0;\n var b2 = void 0;\n var c2 = void 0; // key.length === 2 ?\n\n var nInnerRounds = key.length / 4 - 2;\n var i = void 0;\n var kIndex = 4;\n var table = this._tables[1]; // load up the tables\n\n var table0 = table[0];\n var table1 = table[1];\n var table2 = table[2];\n var table3 = table[3];\n var sbox = table[4]; // Inner rounds. Cribbed from OpenSSL.\n\n for (i = 0; i < nInnerRounds; i++) {\n a2 = table0[a >>> 24] ^ table1[b >> 16 & 255] ^ table2[c >> 8 & 255] ^ table3[d & 255] ^ key[kIndex];\n b2 = table0[b >>> 24] ^ table1[c >> 16 & 255] ^ table2[d >> 8 & 255] ^ table3[a & 255] ^ key[kIndex + 1];\n c2 = table0[c >>> 24] ^ table1[d >> 16 & 255] ^ table2[a >> 8 & 255] ^ table3[b & 255] ^ key[kIndex + 2];\n d = table0[d >>> 24] ^ table1[a >> 16 & 255] ^ table2[b >> 8 & 255] ^ table3[c & 255] ^ key[kIndex + 3];\n kIndex += 4;\n a = a2;\n b = b2;\n c = c2;\n } // Last round.\n\n\n for (i = 0; i < 4; i++) {\n out[(3 & -i) + offset] = sbox[a >>> 24] << 24 ^ sbox[b >> 16 & 255] << 16 ^ sbox[c >> 8 & 255] << 8 ^ sbox[d & 255] ^ key[kIndex++];\n a2 = a;\n a = b;\n b = c;\n c = d;\n d = a2;\n }\n };\n\n return AES;\n }();\n /**\n * @file stream.js\n */\n\n /**\n * A lightweight readable stream implemention that handles event dispatching.\n *\n * @class Stream\n */\n\n\n var Stream = function () {\n function Stream() {\n classCallCheck(this, Stream);\n this.listeners = {};\n }\n /**\n * Add a listener for a specified event type.\n *\n * @param {String} type the event name\n * @param {Function} listener the callback to be invoked when an event of\n * the specified type occurs\n */\n\n\n Stream.prototype.on = function on(type, listener) {\n if (!this.listeners[type]) {\n this.listeners[type] = [];\n }\n\n this.listeners[type].push(listener);\n };\n /**\n * Remove a listener for a specified event type.\n *\n * @param {String} type the event name\n * @param {Function} listener a function previously registered for this\n * type of event through `on`\n * @return {Boolean} if we could turn it off or not\n */\n\n\n Stream.prototype.off = function off(type, listener) {\n if (!this.listeners[type]) {\n return false;\n }\n\n var index = this.listeners[type].indexOf(listener);\n this.listeners[type].splice(index, 1);\n return index > -1;\n };\n /**\n * Trigger an event of the specified type on this stream. Any additional\n * arguments to this function are passed as parameters to event listeners.\n *\n * @param {String} type the event name\n */\n\n\n Stream.prototype.trigger = function trigger(type) {\n var callbacks = this.listeners[type];\n\n if (!callbacks) {\n return;\n } // Slicing the arguments on every invocation of this method\n // can add a significant amount of overhead. Avoid the\n // intermediate object creation for the common case of a\n // single callback argument\n\n\n if (arguments.length === 2) {\n var length = callbacks.length;\n\n for (var i = 0; i < length; ++i) {\n callbacks[i].call(this, arguments[1]);\n }\n } else {\n var args = Array.prototype.slice.call(arguments, 1);\n var _length = callbacks.length;\n\n for (var _i = 0; _i < _length; ++_i) {\n callbacks[_i].apply(this, args);\n }\n }\n };\n /**\n * Destroys the stream and cleans up.\n */\n\n\n Stream.prototype.dispose = function dispose() {\n this.listeners = {};\n };\n /**\n * Forwards all `data` events on this stream to the destination stream. The\n * destination stream should provide a method `push` to receive the data\n * events as they arrive.\n *\n * @param {Stream} destination the stream that will receive all `data` events\n * @see http://nodejs.org/api/stream.html#stream_readable_pipe_destination_options\n */\n\n\n Stream.prototype.pipe = function pipe(destination) {\n this.on('data', function (data) {\n destination.push(data);\n });\n };\n\n return Stream;\n }();\n /**\n * @file async-stream.js\n */\n\n /**\n * A wrapper around the Stream class to use setTiemout\n * and run stream \"jobs\" Asynchronously\n *\n * @class AsyncStream\n * @extends Stream\n */\n\n\n var AsyncStream$$1 = function (_Stream) {\n inherits(AsyncStream$$1, _Stream);\n\n function AsyncStream$$1() {\n classCallCheck(this, AsyncStream$$1);\n\n var _this = possibleConstructorReturn(this, _Stream.call(this, Stream));\n\n _this.jobs = [];\n _this.delay = 1;\n _this.timeout_ = null;\n return _this;\n }\n /**\n * process an async job\n *\n * @private\n */\n\n\n AsyncStream$$1.prototype.processJob_ = function processJob_() {\n this.jobs.shift()();\n\n if (this.jobs.length) {\n this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay);\n } else {\n this.timeout_ = null;\n }\n };\n /**\n * push a job into the stream\n *\n * @param {Function} job the job to push into the stream\n */\n\n\n AsyncStream$$1.prototype.push = function push(job) {\n this.jobs.push(job);\n\n if (!this.timeout_) {\n this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay);\n }\n };\n\n return AsyncStream$$1;\n }(Stream);\n /**\n * @file decrypter.js\n *\n * An asynchronous implementation of AES-128 CBC decryption with\n * PKCS#7 padding.\n */\n\n /**\n * Convert network-order (big-endian) bytes into their little-endian\n * representation.\n */\n\n\n var ntoh = function ntoh(word) {\n return word << 24 | (word & 0xff00) << 8 | (word & 0xff0000) >> 8 | word >>> 24;\n };\n /**\n * Decrypt bytes using AES-128 with CBC and PKCS#7 padding.\n *\n * @param {Uint8Array} encrypted the encrypted bytes\n * @param {Uint32Array} key the bytes of the decryption key\n * @param {Uint32Array} initVector the initialization vector (IV) to\n * use for the first round of CBC.\n * @return {Uint8Array} the decrypted bytes\n *\n * @see http://en.wikipedia.org/wiki/Advanced_Encryption_Standard\n * @see http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Cipher_Block_Chaining_.28CBC.29\n * @see https://tools.ietf.org/html/rfc2315\n */\n\n\n var decrypt$$1 = function decrypt$$1(encrypted, key, initVector) {\n // word-level access to the encrypted bytes\n var encrypted32 = new Int32Array(encrypted.buffer, encrypted.byteOffset, encrypted.byteLength >> 2);\n var decipher = new AES(Array.prototype.slice.call(key)); // byte and word-level access for the decrypted output\n\n var decrypted = new Uint8Array(encrypted.byteLength);\n var decrypted32 = new Int32Array(decrypted.buffer); // temporary variables for working with the IV, encrypted, and\n // decrypted data\n\n var init0 = void 0;\n var init1 = void 0;\n var init2 = void 0;\n var init3 = void 0;\n var encrypted0 = void 0;\n var encrypted1 = void 0;\n var encrypted2 = void 0;\n var encrypted3 = void 0; // iteration variable\n\n var wordIx = void 0; // pull out the words of the IV to ensure we don't modify the\n // passed-in reference and easier access\n\n init0 = initVector[0];\n init1 = initVector[1];\n init2 = initVector[2];\n init3 = initVector[3]; // decrypt four word sequences, applying cipher-block chaining (CBC)\n // to each decrypted block\n\n for (wordIx = 0; wordIx < encrypted32.length; wordIx += 4) {\n // convert big-endian (network order) words into little-endian\n // (javascript order)\n encrypted0 = ntoh(encrypted32[wordIx]);\n encrypted1 = ntoh(encrypted32[wordIx + 1]);\n encrypted2 = ntoh(encrypted32[wordIx + 2]);\n encrypted3 = ntoh(encrypted32[wordIx + 3]); // decrypt the block\n\n decipher.decrypt(encrypted0, encrypted1, encrypted2, encrypted3, decrypted32, wordIx); // XOR with the IV, and restore network byte-order to obtain the\n // plaintext\n\n decrypted32[wordIx] = ntoh(decrypted32[wordIx] ^ init0);\n decrypted32[wordIx + 1] = ntoh(decrypted32[wordIx + 1] ^ init1);\n decrypted32[wordIx + 2] = ntoh(decrypted32[wordIx + 2] ^ init2);\n decrypted32[wordIx + 3] = ntoh(decrypted32[wordIx + 3] ^ init3); // setup the IV for the next round\n\n init0 = encrypted0;\n init1 = encrypted1;\n init2 = encrypted2;\n init3 = encrypted3;\n }\n\n return decrypted;\n };\n /**\n * The `Decrypter` class that manages decryption of AES\n * data through `AsyncStream` objects and the `decrypt`\n * function\n *\n * @param {Uint8Array} encrypted the encrypted bytes\n * @param {Uint32Array} key the bytes of the decryption key\n * @param {Uint32Array} initVector the initialization vector (IV) to\n * @param {Function} done the function to run when done\n * @class Decrypter\n */\n\n\n var Decrypter$$1 = function () {\n function Decrypter$$1(encrypted, key, initVector, done) {\n classCallCheck(this, Decrypter$$1);\n var step = Decrypter$$1.STEP;\n var encrypted32 = new Int32Array(encrypted.buffer);\n var decrypted = new Uint8Array(encrypted.byteLength);\n var i = 0;\n this.asyncStream_ = new AsyncStream$$1(); // split up the encryption job and do the individual chunks asynchronously\n\n this.asyncStream_.push(this.decryptChunk_(encrypted32.subarray(i, i + step), key, initVector, decrypted));\n\n for (i = step; i < encrypted32.length; i += step) {\n initVector = new Uint32Array([ntoh(encrypted32[i - 4]), ntoh(encrypted32[i - 3]), ntoh(encrypted32[i - 2]), ntoh(encrypted32[i - 1])]);\n this.asyncStream_.push(this.decryptChunk_(encrypted32.subarray(i, i + step), key, initVector, decrypted));\n } // invoke the done() callback when everything is finished\n\n\n this.asyncStream_.push(function () {\n // remove pkcs#7 padding from the decrypted bytes\n done(null, unpad(decrypted));\n });\n }\n /**\n * a getter for step the maximum number of bytes to process at one time\n *\n * @return {Number} the value of step 32000\n */\n\n /**\n * @private\n */\n\n\n Decrypter$$1.prototype.decryptChunk_ = function decryptChunk_(encrypted, key, initVector, decrypted) {\n return function () {\n var bytes = decrypt$$1(encrypted, key, initVector);\n decrypted.set(bytes, encrypted.byteOffset);\n };\n };\n\n createClass(Decrypter$$1, null, [{\n key: 'STEP',\n get: function get$$1() {\n // 4 * 8000;\n return 32000;\n }\n }]);\n return Decrypter$$1;\n }();\n /**\n * @file bin-utils.js\n */\n\n /**\n * Creates an object for sending to a web worker modifying properties that are TypedArrays\n * into a new object with seperated properties for the buffer, byteOffset, and byteLength.\n *\n * @param {Object} message\n * Object of properties and values to send to the web worker\n * @return {Object}\n * Modified message with TypedArray values expanded\n * @function createTransferableMessage\n */\n\n\n var createTransferableMessage = function createTransferableMessage(message) {\n var transferable = {};\n Object.keys(message).forEach(function (key) {\n var value = message[key];\n\n if (ArrayBuffer.isView(value)) {\n transferable[key] = {\n bytes: value.buffer,\n byteOffset: value.byteOffset,\n byteLength: value.byteLength\n };\n } else {\n transferable[key] = value;\n }\n });\n return transferable;\n };\n /**\n * Our web worker interface so that things can talk to aes-decrypter\n * that will be running in a web worker. the scope is passed to this by\n * webworkify.\n *\n * @param {Object} self\n * the scope for the web worker\n */\n\n\n var DecrypterWorker = function DecrypterWorker(self) {\n self.onmessage = function (event) {\n var data = event.data;\n var encrypted = new Uint8Array(data.encrypted.bytes, data.encrypted.byteOffset, data.encrypted.byteLength);\n var key = new Uint32Array(data.key.bytes, data.key.byteOffset, data.key.byteLength / 4);\n var iv = new Uint32Array(data.iv.bytes, data.iv.byteOffset, data.iv.byteLength / 4);\n /* eslint-disable no-new, handle-callback-err */\n\n new Decrypter$$1(encrypted, key, iv, function (err, bytes) {\n self.postMessage(createTransferableMessage({\n source: data.source,\n decrypted: bytes\n }), [bytes.buffer]);\n });\n /* eslint-enable */\n };\n };\n\n var decrypterWorker = new DecrypterWorker(self);\n return decrypterWorker;\n }();\n});\n/**\n * Convert the properties of an HLS track into an audioTrackKind.\n *\n * @private\n */\n\nvar audioTrackKind_ = function audioTrackKind_(properties) {\n var kind = properties.default ? 'main' : 'alternative';\n\n if (properties.characteristics && properties.characteristics.indexOf('public.accessibility.describes-video') >= 0) {\n kind = 'main-desc';\n }\n\n return kind;\n};\n/**\n * Pause provided segment loader and playlist loader if active\n *\n * @param {SegmentLoader} segmentLoader\n * SegmentLoader to pause\n * @param {Object} mediaType\n * Active media type\n * @function stopLoaders\n */\n\n\nvar stopLoaders = function stopLoaders(segmentLoader, mediaType) {\n segmentLoader.abort();\n segmentLoader.pause();\n\n if (mediaType && mediaType.activePlaylistLoader) {\n mediaType.activePlaylistLoader.pause();\n mediaType.activePlaylistLoader = null;\n }\n};\n/**\n * Start loading provided segment loader and playlist loader\n *\n * @param {PlaylistLoader} playlistLoader\n * PlaylistLoader to start loading\n * @param {Object} mediaType\n * Active media type\n * @function startLoaders\n */\n\n\nvar startLoaders = function startLoaders(playlistLoader, mediaType) {\n // Segment loader will be started after `loadedmetadata` or `loadedplaylist` from the\n // playlist loader\n mediaType.activePlaylistLoader = playlistLoader;\n playlistLoader.load();\n};\n/**\n * Returns a function to be called when the media group changes. It performs a\n * non-destructive (preserve the buffer) resync of the SegmentLoader. This is because a\n * change of group is merely a rendition switch of the same content at another encoding,\n * rather than a change of content, such as switching audio from English to Spanish.\n *\n * @param {String} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @return {Function}\n * Handler for a non-destructive resync of SegmentLoader when the active media\n * group changes.\n * @function onGroupChanged\n */\n\n\nvar onGroupChanged = function onGroupChanged(type, settings) {\n return function () {\n var _settings$segmentLoad = settings.segmentLoaders,\n segmentLoader = _settings$segmentLoad[type],\n mainSegmentLoader = _settings$segmentLoad.main,\n mediaType = settings.mediaTypes[type];\n var activeTrack = mediaType.activeTrack();\n var activeGroup = mediaType.activeGroup(activeTrack);\n var previousActiveLoader = mediaType.activePlaylistLoader;\n stopLoaders(segmentLoader, mediaType);\n\n if (!activeGroup) {\n // there is no group active\n return;\n }\n\n if (!activeGroup.playlistLoader) {\n if (previousActiveLoader) {\n // The previous group had a playlist loader but the new active group does not\n // this means we are switching from demuxed to muxed audio. In this case we want to\n // do a destructive reset of the main segment loader and not restart the audio\n // loaders.\n mainSegmentLoader.resetEverything();\n }\n\n return;\n } // Non-destructive resync\n\n\n segmentLoader.resyncLoader();\n startLoaders(activeGroup.playlistLoader, mediaType);\n };\n};\n/**\n * Returns a function to be called when the media track changes. It performs a\n * destructive reset of the SegmentLoader to ensure we start loading as close to\n * currentTime as possible.\n *\n * @param {String} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @return {Function}\n * Handler for a destructive reset of SegmentLoader when the active media\n * track changes.\n * @function onTrackChanged\n */\n\n\nvar onTrackChanged = function onTrackChanged(type, settings) {\n return function () {\n var _settings$segmentLoad2 = settings.segmentLoaders,\n segmentLoader = _settings$segmentLoad2[type],\n mainSegmentLoader = _settings$segmentLoad2.main,\n mediaType = settings.mediaTypes[type];\n var activeTrack = mediaType.activeTrack();\n var activeGroup = mediaType.activeGroup(activeTrack);\n var previousActiveLoader = mediaType.activePlaylistLoader;\n stopLoaders(segmentLoader, mediaType);\n\n if (!activeGroup) {\n // there is no group active so we do not want to restart loaders\n return;\n }\n\n if (!activeGroup.playlistLoader) {\n // when switching from demuxed audio/video to muxed audio/video (noted by no playlist\n // loader for the audio group), we want to do a destructive reset of the main segment\n // loader and not restart the audio loaders\n mainSegmentLoader.resetEverything();\n return;\n }\n\n if (previousActiveLoader === activeGroup.playlistLoader) {\n // Nothing has actually changed. This can happen because track change events can fire\n // multiple times for a \"single\" change. One for enabling the new active track, and\n // one for disabling the track that was active\n startLoaders(activeGroup.playlistLoader, mediaType);\n return;\n }\n\n if (segmentLoader.track) {\n // For WebVTT, set the new text track in the segmentloader\n segmentLoader.track(activeTrack);\n } // destructive reset\n\n\n segmentLoader.resetEverything();\n startLoaders(activeGroup.playlistLoader, mediaType);\n };\n};\n\nvar onError = {\n /**\n * Returns a function to be called when a SegmentLoader or PlaylistLoader encounters\n * an error.\n *\n * @param {String} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @return {Function}\n * Error handler. Logs warning (or error if the playlist is blacklisted) to\n * console and switches back to default audio track.\n * @function onError.AUDIO\n */\n AUDIO: function AUDIO(type, settings) {\n return function () {\n var segmentLoader = settings.segmentLoaders[type],\n mediaType = settings.mediaTypes[type],\n blacklistCurrentPlaylist = settings.blacklistCurrentPlaylist;\n stopLoaders(segmentLoader, mediaType); // switch back to default audio track\n\n var activeTrack = mediaType.activeTrack();\n var activeGroup = mediaType.activeGroup();\n var id = (activeGroup.filter(function (group) {\n return group.default;\n })[0] || activeGroup[0]).id;\n var defaultTrack = mediaType.tracks[id];\n\n if (activeTrack === defaultTrack) {\n // Default track encountered an error. All we can do now is blacklist the current\n // rendition and hope another will switch audio groups\n blacklistCurrentPlaylist({\n message: 'Problem encountered loading the default audio track.'\n });\n return;\n }\n\n videojs$1.log.warn('Problem encountered loading the alternate audio track.' + 'Switching back to default.');\n\n for (var trackId in mediaType.tracks) {\n mediaType.tracks[trackId].enabled = mediaType.tracks[trackId] === defaultTrack;\n }\n\n mediaType.onTrackChanged();\n };\n },\n\n /**\n * Returns a function to be called when a SegmentLoader or PlaylistLoader encounters\n * an error.\n *\n * @param {String} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @return {Function}\n * Error handler. Logs warning to console and disables the active subtitle track\n * @function onError.SUBTITLES\n */\n SUBTITLES: function SUBTITLES(type, settings) {\n return function () {\n var segmentLoader = settings.segmentLoaders[type],\n mediaType = settings.mediaTypes[type];\n videojs$1.log.warn('Problem encountered loading the subtitle track.' + 'Disabling subtitle track.');\n stopLoaders(segmentLoader, mediaType);\n var track = mediaType.activeTrack();\n\n if (track) {\n track.mode = 'disabled';\n }\n\n mediaType.onTrackChanged();\n };\n }\n};\nvar setupListeners = {\n /**\n * Setup event listeners for audio playlist loader\n *\n * @param {String} type\n * MediaGroup type\n * @param {PlaylistLoader|null} playlistLoader\n * PlaylistLoader to register listeners on\n * @param {Object} settings\n * Object containing required information for media groups\n * @function setupListeners.AUDIO\n */\n AUDIO: function AUDIO(type, playlistLoader, settings) {\n if (!playlistLoader) {\n // no playlist loader means audio will be muxed with the video\n return;\n }\n\n var tech = settings.tech,\n requestOptions = settings.requestOptions,\n segmentLoader = settings.segmentLoaders[type];\n playlistLoader.on('loadedmetadata', function () {\n var media = playlistLoader.media();\n segmentLoader.playlist(media, requestOptions); // if the video is already playing, or if this isn't a live video and preload\n // permits, start downloading segments\n\n if (!tech.paused() || media.endList && tech.preload() !== 'none') {\n segmentLoader.load();\n }\n });\n playlistLoader.on('loadedplaylist', function () {\n segmentLoader.playlist(playlistLoader.media(), requestOptions); // If the player isn't paused, ensure that the segment loader is running\n\n if (!tech.paused()) {\n segmentLoader.load();\n }\n });\n playlistLoader.on('error', onError[type](type, settings));\n },\n\n /**\n * Setup event listeners for subtitle playlist loader\n *\n * @param {String} type\n * MediaGroup type\n * @param {PlaylistLoader|null} playlistLoader\n * PlaylistLoader to register listeners on\n * @param {Object} settings\n * Object containing required information for media groups\n * @function setupListeners.SUBTITLES\n */\n SUBTITLES: function SUBTITLES(type, playlistLoader, settings) {\n var tech = settings.tech,\n requestOptions = settings.requestOptions,\n segmentLoader = settings.segmentLoaders[type],\n mediaType = settings.mediaTypes[type];\n playlistLoader.on('loadedmetadata', function () {\n var media = playlistLoader.media();\n segmentLoader.playlist(media, requestOptions);\n segmentLoader.track(mediaType.activeTrack()); // if the video is already playing, or if this isn't a live video and preload\n // permits, start downloading segments\n\n if (!tech.paused() || media.endList && tech.preload() !== 'none') {\n segmentLoader.load();\n }\n });\n playlistLoader.on('loadedplaylist', function () {\n segmentLoader.playlist(playlistLoader.media(), requestOptions); // If the player isn't paused, ensure that the segment loader is running\n\n if (!tech.paused()) {\n segmentLoader.load();\n }\n });\n playlistLoader.on('error', onError[type](type, settings));\n }\n};\n\nvar byGroupId = function byGroupId(type, groupId) {\n return function (playlist) {\n return playlist.attributes[type] === groupId;\n };\n};\n\nvar byResolvedUri = function byResolvedUri(resolvedUri) {\n return function (playlist) {\n return playlist.resolvedUri === resolvedUri;\n };\n};\n\nvar initialize = {\n /**\n * Setup PlaylistLoaders and AudioTracks for the audio groups\n *\n * @param {String} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @function initialize.AUDIO\n */\n 'AUDIO': function AUDIO(type, settings) {\n var hls = settings.hls,\n sourceType = settings.sourceType,\n segmentLoader = settings.segmentLoaders[type],\n withCredentials = settings.requestOptions.withCredentials,\n _settings$master = settings.master,\n mediaGroups = _settings$master.mediaGroups,\n playlists = _settings$master.playlists,\n _settings$mediaTypes$ = settings.mediaTypes[type],\n groups = _settings$mediaTypes$.groups,\n tracks = _settings$mediaTypes$.tracks,\n masterPlaylistLoader = settings.masterPlaylistLoader; // force a default if we have none\n\n if (!mediaGroups[type] || Object.keys(mediaGroups[type]).length === 0) {\n mediaGroups[type] = {\n main: {\n default: {\n default: true\n }\n }\n };\n }\n\n for (var groupId in mediaGroups[type]) {\n if (!groups[groupId]) {\n groups[groupId] = [];\n } // List of playlists that have an AUDIO attribute value matching the current\n // group ID\n\n\n var groupPlaylists = playlists.filter(byGroupId(type, groupId));\n\n for (var variantLabel in mediaGroups[type][groupId]) {\n var properties = mediaGroups[type][groupId][variantLabel]; // List of playlists for the current group ID that have a matching uri with\n // this alternate audio variant\n\n var matchingPlaylists = groupPlaylists.filter(byResolvedUri(properties.resolvedUri));\n\n if (matchingPlaylists.length) {\n // If there is a playlist that has the same uri as this audio variant, assume\n // that the playlist is audio only. We delete the resolvedUri property here\n // to prevent a playlist loader from being created so that we don't have\n // both the main and audio segment loaders loading the same audio segments\n // from the same playlist.\n delete properties.resolvedUri;\n }\n\n var playlistLoader = void 0;\n\n if (properties.resolvedUri) {\n playlistLoader = new PlaylistLoader(properties.resolvedUri, hls, withCredentials);\n } else if (properties.playlists && sourceType === 'dash') {\n playlistLoader = new DashPlaylistLoader(properties.playlists[0], hls, withCredentials, masterPlaylistLoader);\n } else {\n // no resolvedUri means the audio is muxed with the video when using this\n // audio track\n playlistLoader = null;\n }\n\n properties = videojs$1.mergeOptions({\n id: variantLabel,\n playlistLoader: playlistLoader\n }, properties);\n setupListeners[type](type, properties.playlistLoader, settings);\n groups[groupId].push(properties);\n\n if (typeof tracks[variantLabel] === 'undefined') {\n var track = new videojs$1.AudioTrack({\n id: variantLabel,\n kind: audioTrackKind_(properties),\n enabled: false,\n language: properties.language,\n default: properties.default,\n label: variantLabel\n });\n tracks[variantLabel] = track;\n }\n }\n } // setup single error event handler for the segment loader\n\n\n segmentLoader.on('error', onError[type](type, settings));\n },\n\n /**\n * Setup PlaylistLoaders and TextTracks for the subtitle groups\n *\n * @param {String} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @function initialize.SUBTITLES\n */\n 'SUBTITLES': function SUBTITLES(type, settings) {\n var tech = settings.tech,\n hls = settings.hls,\n sourceType = settings.sourceType,\n segmentLoader = settings.segmentLoaders[type],\n withCredentials = settings.requestOptions.withCredentials,\n mediaGroups = settings.master.mediaGroups,\n _settings$mediaTypes$2 = settings.mediaTypes[type],\n groups = _settings$mediaTypes$2.groups,\n tracks = _settings$mediaTypes$2.tracks,\n masterPlaylistLoader = settings.masterPlaylistLoader;\n\n for (var groupId in mediaGroups[type]) {\n if (!groups[groupId]) {\n groups[groupId] = [];\n }\n\n for (var variantLabel in mediaGroups[type][groupId]) {\n if (mediaGroups[type][groupId][variantLabel].forced) {\n // Subtitle playlists with the forced attribute are not selectable in Safari.\n // According to Apple's HLS Authoring Specification:\n // If content has forced subtitles and regular subtitles in a given language,\n // the regular subtitles track in that language MUST contain both the forced\n // subtitles and the regular subtitles for that language.\n // Because of this requirement and that Safari does not add forced subtitles,\n // forced subtitles are skipped here to maintain consistent experience across\n // all platforms\n continue;\n }\n\n var properties = mediaGroups[type][groupId][variantLabel];\n var playlistLoader = void 0;\n\n if (sourceType === 'hls') {\n playlistLoader = new PlaylistLoader(properties.resolvedUri, hls, withCredentials);\n } else if (sourceType === 'dash') {\n playlistLoader = new DashPlaylistLoader(properties.playlists[0], hls, withCredentials, masterPlaylistLoader);\n }\n\n properties = videojs$1.mergeOptions({\n id: variantLabel,\n playlistLoader: playlistLoader\n }, properties);\n setupListeners[type](type, properties.playlistLoader, settings);\n groups[groupId].push(properties);\n\n if (typeof tracks[variantLabel] === 'undefined') {\n var track = tech.addRemoteTextTrack({\n id: variantLabel,\n kind: 'subtitles',\n default: properties.default && properties.autoselect,\n language: properties.language,\n label: variantLabel\n }, false).track;\n tracks[variantLabel] = track;\n }\n }\n } // setup single error event handler for the segment loader\n\n\n segmentLoader.on('error', onError[type](type, settings));\n },\n\n /**\n * Setup TextTracks for the closed-caption groups\n *\n * @param {String} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @function initialize['CLOSED-CAPTIONS']\n */\n 'CLOSED-CAPTIONS': function CLOSEDCAPTIONS(type, settings) {\n var tech = settings.tech,\n mediaGroups = settings.master.mediaGroups,\n _settings$mediaTypes$3 = settings.mediaTypes[type],\n groups = _settings$mediaTypes$3.groups,\n tracks = _settings$mediaTypes$3.tracks;\n\n for (var groupId in mediaGroups[type]) {\n if (!groups[groupId]) {\n groups[groupId] = [];\n }\n\n for (var variantLabel in mediaGroups[type][groupId]) {\n var properties = mediaGroups[type][groupId][variantLabel]; // We only support CEA608 captions for now, so ignore anything that\n // doesn't use a CCx INSTREAM-ID\n\n if (!properties.instreamId.match(/CC\\d/)) {\n continue;\n } // No PlaylistLoader is required for Closed-Captions because the captions are\n // embedded within the video stream\n\n\n groups[groupId].push(videojs$1.mergeOptions({\n id: variantLabel\n }, properties));\n\n if (typeof tracks[variantLabel] === 'undefined') {\n var track = tech.addRemoteTextTrack({\n id: properties.instreamId,\n kind: 'captions',\n default: properties.default && properties.autoselect,\n language: properties.language,\n label: variantLabel\n }, false).track;\n tracks[variantLabel] = track;\n }\n }\n }\n }\n};\n/**\n * Returns a function used to get the active group of the provided type\n *\n * @param {String} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @return {Function}\n * Function that returns the active media group for the provided type. Takes an\n * optional parameter {TextTrack} track. If no track is provided, a list of all\n * variants in the group, otherwise the variant corresponding to the provided\n * track is returned.\n * @function activeGroup\n */\n\nvar activeGroup = function activeGroup(type, settings) {\n return function (track) {\n var masterPlaylistLoader = settings.masterPlaylistLoader,\n groups = settings.mediaTypes[type].groups;\n var media = masterPlaylistLoader.media();\n\n if (!media) {\n return null;\n }\n\n var variants = null;\n\n if (media.attributes[type]) {\n variants = groups[media.attributes[type]];\n }\n\n variants = variants || groups.main;\n\n if (typeof track === 'undefined') {\n return variants;\n }\n\n if (track === null) {\n // An active track was specified so a corresponding group is expected. track === null\n // means no track is currently active so there is no corresponding group\n return null;\n }\n\n return variants.filter(function (props) {\n return props.id === track.id;\n })[0] || null;\n };\n};\n\nvar activeTrack = {\n /**\n * Returns a function used to get the active track of type provided\n *\n * @param {String} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @return {Function}\n * Function that returns the active media track for the provided type. Returns\n * null if no track is active\n * @function activeTrack.AUDIO\n */\n AUDIO: function AUDIO(type, settings) {\n return function () {\n var tracks = settings.mediaTypes[type].tracks;\n\n for (var id in tracks) {\n if (tracks[id].enabled) {\n return tracks[id];\n }\n }\n\n return null;\n };\n },\n\n /**\n * Returns a function used to get the active track of type provided\n *\n * @param {String} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @return {Function}\n * Function that returns the active media track for the provided type. Returns\n * null if no track is active\n * @function activeTrack.SUBTITLES\n */\n SUBTITLES: function SUBTITLES(type, settings) {\n return function () {\n var tracks = settings.mediaTypes[type].tracks;\n\n for (var id in tracks) {\n if (tracks[id].mode === 'showing') {\n return tracks[id];\n }\n }\n\n return null;\n };\n }\n};\n/**\n * Setup PlaylistLoaders and Tracks for media groups (Audio, Subtitles,\n * Closed-Captions) specified in the master manifest.\n *\n * @param {Object} settings\n * Object containing required information for setting up the media groups\n * @param {SegmentLoader} settings.segmentLoaders.AUDIO\n * Audio segment loader\n * @param {SegmentLoader} settings.segmentLoaders.SUBTITLES\n * Subtitle segment loader\n * @param {SegmentLoader} settings.segmentLoaders.main\n * Main segment loader\n * @param {Tech} settings.tech\n * The tech of the player\n * @param {Object} settings.requestOptions\n * XHR request options used by the segment loaders\n * @param {PlaylistLoader} settings.masterPlaylistLoader\n * PlaylistLoader for the master source\n * @param {HlsHandler} settings.hls\n * HLS SourceHandler\n * @param {Object} settings.master\n * The parsed master manifest\n * @param {Object} settings.mediaTypes\n * Object to store the loaders, tracks, and utility methods for each media type\n * @param {Function} settings.blacklistCurrentPlaylist\n * Blacklists the current rendition and forces a rendition switch.\n * @function setupMediaGroups\n */\n\nvar setupMediaGroups = function setupMediaGroups(settings) {\n ['AUDIO', 'SUBTITLES', 'CLOSED-CAPTIONS'].forEach(function (type) {\n initialize[type](type, settings);\n });\n var mediaTypes = settings.mediaTypes,\n masterPlaylistLoader = settings.masterPlaylistLoader,\n tech = settings.tech,\n hls = settings.hls; // setup active group and track getters and change event handlers\n\n ['AUDIO', 'SUBTITLES'].forEach(function (type) {\n mediaTypes[type].activeGroup = activeGroup(type, settings);\n mediaTypes[type].activeTrack = activeTrack[type](type, settings);\n mediaTypes[type].onGroupChanged = onGroupChanged(type, settings);\n mediaTypes[type].onTrackChanged = onTrackChanged(type, settings);\n }); // DO NOT enable the default subtitle or caption track.\n // DO enable the default audio track\n\n var audioGroup = mediaTypes.AUDIO.activeGroup();\n var groupId = (audioGroup.filter(function (group) {\n return group.default;\n })[0] || audioGroup[0]).id;\n mediaTypes.AUDIO.tracks[groupId].enabled = true;\n mediaTypes.AUDIO.onTrackChanged();\n masterPlaylistLoader.on('mediachange', function () {\n ['AUDIO', 'SUBTITLES'].forEach(function (type) {\n return mediaTypes[type].onGroupChanged();\n });\n }); // custom audio track change event handler for usage event\n\n var onAudioTrackChanged = function onAudioTrackChanged() {\n mediaTypes.AUDIO.onTrackChanged();\n tech.trigger({\n type: 'usage',\n name: 'hls-audio-change'\n });\n };\n\n tech.audioTracks().addEventListener('change', onAudioTrackChanged);\n tech.remoteTextTracks().addEventListener('change', mediaTypes.SUBTITLES.onTrackChanged);\n hls.on('dispose', function () {\n tech.audioTracks().removeEventListener('change', onAudioTrackChanged);\n tech.remoteTextTracks().removeEventListener('change', mediaTypes.SUBTITLES.onTrackChanged);\n }); // clear existing audio tracks and add the ones we just created\n\n tech.clearTracks('audio');\n\n for (var id in mediaTypes.AUDIO.tracks) {\n tech.audioTracks().addTrack(mediaTypes.AUDIO.tracks[id]);\n }\n};\n/**\n * Creates skeleton object used to store the loaders, tracks, and utility methods for each\n * media type\n *\n * @return {Object}\n * Object to store the loaders, tracks, and utility methods for each media type\n * @function createMediaTypes\n */\n\n\nvar createMediaTypes = function createMediaTypes() {\n var mediaTypes = {};\n ['AUDIO', 'SUBTITLES', 'CLOSED-CAPTIONS'].forEach(function (type) {\n mediaTypes[type] = {\n groups: {},\n tracks: {},\n activePlaylistLoader: null,\n activeGroup: noop,\n activeTrack: noop,\n onGroupChanged: noop,\n onTrackChanged: noop\n };\n });\n return mediaTypes;\n};\n/**\n * @file master-playlist-controller.js\n */\n\n\nvar ABORT_EARLY_BLACKLIST_SECONDS = 60 * 2;\nvar Hls = void 0; // SegmentLoader stats that need to have each loader's\n// values summed to calculate the final value\n\nvar loaderStats = ['mediaRequests', 'mediaRequestsAborted', 'mediaRequestsTimedout', 'mediaRequestsErrored', 'mediaTransferDuration', 'mediaBytesTransferred'];\n\nvar sumLoaderStat = function sumLoaderStat(stat) {\n return this.audioSegmentLoader_[stat] + this.mainSegmentLoader_[stat];\n};\n/**\n * the master playlist controller controller all interactons\n * between playlists and segmentloaders. At this time this mainly\n * involves a master playlist and a series of audio playlists\n * if they are available\n *\n * @class MasterPlaylistController\n * @extends videojs.EventTarget\n */\n\n\nvar MasterPlaylistController = function (_videojs$EventTarget) {\n inherits(MasterPlaylistController, _videojs$EventTarget);\n\n function MasterPlaylistController(options) {\n classCallCheck(this, MasterPlaylistController);\n\n var _this = possibleConstructorReturn(this, (MasterPlaylistController.__proto__ || Object.getPrototypeOf(MasterPlaylistController)).call(this));\n\n var url = options.url,\n withCredentials = options.withCredentials,\n tech = options.tech,\n bandwidth = options.bandwidth,\n externHls = options.externHls,\n useCueTags = options.useCueTags,\n blacklistDuration = options.blacklistDuration,\n enableLowInitialPlaylist = options.enableLowInitialPlaylist,\n sourceType = options.sourceType,\n seekTo = options.seekTo;\n\n if (!url) {\n throw new Error('A non-empty playlist URL is required');\n }\n\n Hls = externHls;\n _this.withCredentials = withCredentials;\n _this.tech_ = tech;\n _this.hls_ = tech.hls;\n _this.seekTo_ = seekTo;\n _this.sourceType_ = sourceType;\n _this.useCueTags_ = useCueTags;\n _this.blacklistDuration = blacklistDuration;\n _this.enableLowInitialPlaylist = enableLowInitialPlaylist;\n\n if (_this.useCueTags_) {\n _this.cueTagsTrack_ = _this.tech_.addTextTrack('metadata', 'ad-cues');\n _this.cueTagsTrack_.inBandMetadataTrackDispatchType = '';\n }\n\n _this.requestOptions_ = {\n withCredentials: _this.withCredentials,\n timeout: null\n };\n _this.mediaTypes_ = createMediaTypes();\n _this.mediaSource = new videojs$1.MediaSource(); // load the media source into the player\n\n _this.mediaSource.addEventListener('sourceopen', _this.handleSourceOpen_.bind(_this));\n\n _this.seekable_ = videojs$1.createTimeRanges();\n\n _this.hasPlayed_ = function () {\n return false;\n };\n\n _this.syncController_ = new SyncController(options);\n _this.segmentMetadataTrack_ = tech.addRemoteTextTrack({\n kind: 'metadata',\n label: 'segment-metadata'\n }, false).track;\n _this.decrypter_ = new Decrypter$1();\n _this.inbandTextTracks_ = {};\n var segmentLoaderSettings = {\n hls: _this.hls_,\n mediaSource: _this.mediaSource,\n currentTime: _this.tech_.currentTime.bind(_this.tech_),\n seekable: function seekable$$1() {\n return _this.seekable();\n },\n seeking: function seeking() {\n return _this.tech_.seeking();\n },\n duration: function duration$$1() {\n return _this.mediaSource.duration;\n },\n hasPlayed: function hasPlayed() {\n return _this.hasPlayed_();\n },\n goalBufferLength: function goalBufferLength() {\n return _this.goalBufferLength();\n },\n bandwidth: bandwidth,\n syncController: _this.syncController_,\n decrypter: _this.decrypter_,\n sourceType: _this.sourceType_,\n inbandTextTracks: _this.inbandTextTracks_\n };\n _this.masterPlaylistLoader_ = _this.sourceType_ === 'dash' ? new DashPlaylistLoader(url, _this.hls_, _this.withCredentials) : new PlaylistLoader(url, _this.hls_, _this.withCredentials);\n\n _this.setupMasterPlaylistLoaderListeners_(); // setup segment loaders\n // combined audio/video or just video when alternate audio track is selected\n\n\n _this.mainSegmentLoader_ = new SegmentLoader(videojs$1.mergeOptions(segmentLoaderSettings, {\n segmentMetadataTrack: _this.segmentMetadataTrack_,\n loaderType: 'main'\n }), options); // alternate audio track\n\n _this.audioSegmentLoader_ = new SegmentLoader(videojs$1.mergeOptions(segmentLoaderSettings, {\n loaderType: 'audio'\n }), options);\n _this.subtitleSegmentLoader_ = new VTTSegmentLoader(videojs$1.mergeOptions(segmentLoaderSettings, {\n loaderType: 'vtt'\n }), options);\n\n _this.setupSegmentLoaderListeners_(); // Create SegmentLoader stat-getters\n\n\n loaderStats.forEach(function (stat) {\n _this[stat + '_'] = sumLoaderStat.bind(_this, stat);\n });\n _this.logger_ = logger('MPC');\n\n _this.masterPlaylistLoader_.load();\n\n return _this;\n }\n /**\n * Register event handlers on the master playlist loader. A helper\n * function for construction time.\n *\n * @private\n */\n\n\n createClass(MasterPlaylistController, [{\n key: 'setupMasterPlaylistLoaderListeners_',\n value: function setupMasterPlaylistLoaderListeners_() {\n var _this2 = this;\n\n this.masterPlaylistLoader_.on('loadedmetadata', function () {\n var media = _this2.masterPlaylistLoader_.media();\n\n var requestTimeout = _this2.masterPlaylistLoader_.targetDuration * 1.5 * 1000; // If we don't have any more available playlists, we don't want to\n // timeout the request.\n\n if (isLowestEnabledRendition(_this2.masterPlaylistLoader_.master, _this2.masterPlaylistLoader_.media())) {\n _this2.requestOptions_.timeout = 0;\n } else {\n _this2.requestOptions_.timeout = requestTimeout;\n } // if this isn't a live video and preload permits, start\n // downloading segments\n\n\n if (media.endList && _this2.tech_.preload() !== 'none') {\n _this2.mainSegmentLoader_.playlist(media, _this2.requestOptions_);\n\n _this2.mainSegmentLoader_.load();\n }\n\n setupMediaGroups({\n sourceType: _this2.sourceType_,\n segmentLoaders: {\n AUDIO: _this2.audioSegmentLoader_,\n SUBTITLES: _this2.subtitleSegmentLoader_,\n main: _this2.mainSegmentLoader_\n },\n tech: _this2.tech_,\n requestOptions: _this2.requestOptions_,\n masterPlaylistLoader: _this2.masterPlaylistLoader_,\n hls: _this2.hls_,\n master: _this2.master(),\n mediaTypes: _this2.mediaTypes_,\n blacklistCurrentPlaylist: _this2.blacklistCurrentPlaylist.bind(_this2)\n });\n\n _this2.triggerPresenceUsage_(_this2.master(), media);\n\n try {\n _this2.setupSourceBuffers_();\n } catch (e) {\n videojs$1.log.warn('Failed to create SourceBuffers', e);\n return _this2.mediaSource.endOfStream('decode');\n }\n\n _this2.setupFirstPlay();\n\n _this2.trigger('selectedinitialmedia');\n });\n this.masterPlaylistLoader_.on('loadedplaylist', function () {\n var updatedPlaylist = _this2.masterPlaylistLoader_.media();\n\n if (!updatedPlaylist) {\n // blacklist any variants that are not supported by the browser before selecting\n // an initial media as the playlist selectors do not consider browser support\n _this2.excludeUnsupportedVariants_();\n\n var selectedMedia = void 0;\n\n if (_this2.enableLowInitialPlaylist) {\n selectedMedia = _this2.selectInitialPlaylist();\n }\n\n if (!selectedMedia) {\n selectedMedia = _this2.selectPlaylist();\n }\n\n _this2.initialMedia_ = selectedMedia;\n\n _this2.masterPlaylistLoader_.media(_this2.initialMedia_);\n\n return;\n }\n\n if (_this2.useCueTags_) {\n _this2.updateAdCues_(updatedPlaylist);\n } // TODO: Create a new event on the PlaylistLoader that signals\n // that the segments have changed in some way and use that to\n // update the SegmentLoader instead of doing it twice here and\n // on `mediachange`\n\n\n _this2.mainSegmentLoader_.playlist(updatedPlaylist, _this2.requestOptions_);\n\n _this2.updateDuration(); // If the player isn't paused, ensure that the segment loader is running,\n // as it is possible that it was temporarily stopped while waiting for\n // a playlist (e.g., in case the playlist errored and we re-requested it).\n\n\n if (!_this2.tech_.paused()) {\n _this2.mainSegmentLoader_.load();\n\n if (_this2.audioSegmentLoader_) {\n _this2.audioSegmentLoader_.load();\n }\n }\n\n if (!updatedPlaylist.endList) {\n var addSeekableRange = function addSeekableRange() {\n var seekable$$1 = _this2.seekable();\n\n if (seekable$$1.length !== 0) {\n _this2.mediaSource.addSeekableRange_(seekable$$1.start(0), seekable$$1.end(0));\n }\n };\n\n if (_this2.duration() !== Infinity) {\n var onDurationchange = function onDurationchange() {\n if (_this2.duration() === Infinity) {\n addSeekableRange();\n } else {\n _this2.tech_.one('durationchange', onDurationchange);\n }\n };\n\n _this2.tech_.one('durationchange', onDurationchange);\n } else {\n addSeekableRange();\n }\n }\n });\n this.masterPlaylistLoader_.on('error', function () {\n _this2.blacklistCurrentPlaylist(_this2.masterPlaylistLoader_.error);\n });\n this.masterPlaylistLoader_.on('mediachanging', function () {\n _this2.mainSegmentLoader_.abort();\n\n _this2.mainSegmentLoader_.pause();\n });\n this.masterPlaylistLoader_.on('mediachange', function () {\n var media = _this2.masterPlaylistLoader_.media();\n\n var requestTimeout = _this2.masterPlaylistLoader_.targetDuration * 1.5 * 1000; // If we don't have any more available playlists, we don't want to\n // timeout the request.\n\n if (isLowestEnabledRendition(_this2.masterPlaylistLoader_.master, _this2.masterPlaylistLoader_.media())) {\n _this2.requestOptions_.timeout = 0;\n } else {\n _this2.requestOptions_.timeout = requestTimeout;\n } // TODO: Create a new event on the PlaylistLoader that signals\n // that the segments have changed in some way and use that to\n // update the SegmentLoader instead of doing it twice here and\n // on `loadedplaylist`\n\n\n _this2.mainSegmentLoader_.playlist(media, _this2.requestOptions_);\n\n _this2.mainSegmentLoader_.load();\n\n _this2.tech_.trigger({\n type: 'mediachange',\n bubbles: true\n });\n });\n this.masterPlaylistLoader_.on('playlistunchanged', function () {\n var updatedPlaylist = _this2.masterPlaylistLoader_.media();\n\n var playlistOutdated = _this2.stuckAtPlaylistEnd_(updatedPlaylist);\n\n if (playlistOutdated) {\n // Playlist has stopped updating and we're stuck at its end. Try to\n // blacklist it and switch to another playlist in the hope that that\n // one is updating (and give the player a chance to re-adjust to the\n // safe live point).\n _this2.blacklistCurrentPlaylist({\n message: 'Playlist no longer updating.'\n }); // useful for monitoring QoS\n\n\n _this2.tech_.trigger('playliststuck');\n }\n });\n this.masterPlaylistLoader_.on('renditiondisabled', function () {\n _this2.tech_.trigger({\n type: 'usage',\n name: 'hls-rendition-disabled'\n });\n });\n this.masterPlaylistLoader_.on('renditionenabled', function () {\n _this2.tech_.trigger({\n type: 'usage',\n name: 'hls-rendition-enabled'\n });\n });\n }\n /**\n * A helper function for triggerring presence usage events once per source\n *\n * @private\n */\n\n }, {\n key: 'triggerPresenceUsage_',\n value: function triggerPresenceUsage_(master, media) {\n var mediaGroups = master.mediaGroups || {};\n var defaultDemuxed = true;\n var audioGroupKeys = Object.keys(mediaGroups.AUDIO);\n\n for (var mediaGroup in mediaGroups.AUDIO) {\n for (var label in mediaGroups.AUDIO[mediaGroup]) {\n var properties = mediaGroups.AUDIO[mediaGroup][label];\n\n if (!properties.uri) {\n defaultDemuxed = false;\n }\n }\n }\n\n if (defaultDemuxed) {\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-demuxed'\n });\n }\n\n if (Object.keys(mediaGroups.SUBTITLES).length) {\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-webvtt'\n });\n }\n\n if (Hls.Playlist.isAes(media)) {\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-aes'\n });\n }\n\n if (Hls.Playlist.isFmp4(media)) {\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-fmp4'\n });\n }\n\n if (audioGroupKeys.length && Object.keys(mediaGroups.AUDIO[audioGroupKeys[0]]).length > 1) {\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-alternate-audio'\n });\n }\n\n if (this.useCueTags_) {\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-playlist-cue-tags'\n });\n }\n }\n /**\n * Register event handlers on the segment loaders. A helper function\n * for construction time.\n *\n * @private\n */\n\n }, {\n key: 'setupSegmentLoaderListeners_',\n value: function setupSegmentLoaderListeners_() {\n var _this3 = this;\n\n this.mainSegmentLoader_.on('bandwidthupdate', function () {\n var nextPlaylist = _this3.selectPlaylist();\n\n var currentPlaylist = _this3.masterPlaylistLoader_.media();\n\n var buffered = _this3.tech_.buffered();\n\n var forwardBuffer = buffered.length ? buffered.end(buffered.length - 1) - _this3.tech_.currentTime() : 0;\n\n var bufferLowWaterLine = _this3.bufferLowWaterLine(); // If the playlist is live, then we want to not take low water line into account.\n // This is because in LIVE, the player plays 3 segments from the end of the\n // playlist, and if `BUFFER_LOW_WATER_LINE` is greater than the duration availble\n // in those segments, a viewer will never experience a rendition upswitch.\n\n\n if (!currentPlaylist.endList || // For the same reason as LIVE, we ignore the low water line when the VOD\n // duration is below the max potential low water line\n _this3.duration() < Config.MAX_BUFFER_LOW_WATER_LINE || // we want to switch down to lower resolutions quickly to continue playback, but\n nextPlaylist.attributes.BANDWIDTH < currentPlaylist.attributes.BANDWIDTH || // ensure we have some buffer before we switch up to prevent us running out of\n // buffer while loading a higher rendition.\n forwardBuffer >= bufferLowWaterLine) {\n _this3.masterPlaylistLoader_.media(nextPlaylist);\n }\n\n _this3.tech_.trigger('bandwidthupdate');\n });\n this.mainSegmentLoader_.on('progress', function () {\n _this3.trigger('progress');\n });\n this.mainSegmentLoader_.on('error', function () {\n _this3.blacklistCurrentPlaylist(_this3.mainSegmentLoader_.error());\n });\n this.mainSegmentLoader_.on('syncinfoupdate', function () {\n _this3.onSyncInfoUpdate_();\n });\n this.mainSegmentLoader_.on('timestampoffset', function () {\n _this3.tech_.trigger({\n type: 'usage',\n name: 'hls-timestamp-offset'\n });\n });\n this.audioSegmentLoader_.on('syncinfoupdate', function () {\n _this3.onSyncInfoUpdate_();\n });\n this.mainSegmentLoader_.on('ended', function () {\n _this3.onEndOfStream();\n });\n this.mainSegmentLoader_.on('earlyabort', function () {\n _this3.blacklistCurrentPlaylist({\n message: 'Aborted early because there isn\\'t enough bandwidth to complete the ' + 'request without rebuffering.'\n }, ABORT_EARLY_BLACKLIST_SECONDS);\n });\n this.mainSegmentLoader_.on('reseteverything', function () {\n // If playing an MTS stream, a videojs.MediaSource is listening for\n // hls-reset to reset caption parsing state in the transmuxer\n _this3.tech_.trigger('hls-reset');\n });\n this.mainSegmentLoader_.on('segmenttimemapping', function (event) {\n // If playing an MTS stream in html, a videojs.MediaSource is listening for\n // hls-segment-time-mapping update its internal mapping of stream to display time\n _this3.tech_.trigger({\n type: 'hls-segment-time-mapping',\n mapping: event.mapping\n });\n });\n this.audioSegmentLoader_.on('ended', function () {\n _this3.onEndOfStream();\n });\n }\n }, {\n key: 'mediaSecondsLoaded_',\n value: function mediaSecondsLoaded_() {\n return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded + this.mainSegmentLoader_.mediaSecondsLoaded);\n }\n /**\n * Call load on our SegmentLoaders\n */\n\n }, {\n key: 'load',\n value: function load() {\n this.mainSegmentLoader_.load();\n\n if (this.mediaTypes_.AUDIO.activePlaylistLoader) {\n this.audioSegmentLoader_.load();\n }\n\n if (this.mediaTypes_.SUBTITLES.activePlaylistLoader) {\n this.subtitleSegmentLoader_.load();\n }\n }\n /**\n * Re-tune playback quality level for the current player\n * conditions without performing destructive actions, like\n * removing already buffered content\n *\n * @private\n */\n\n }, {\n key: 'smoothQualityChange_',\n value: function smoothQualityChange_() {\n var media = this.selectPlaylist();\n\n if (media !== this.masterPlaylistLoader_.media()) {\n this.masterPlaylistLoader_.media(media);\n this.mainSegmentLoader_.resetLoader(); // don't need to reset audio as it is reset when media changes\n }\n }\n /**\n * Re-tune playback quality level for the current player\n * conditions. This method will perform destructive actions like removing\n * already buffered content in order to readjust the currently active\n * playlist quickly. This is good for manual quality changes\n *\n * @private\n */\n\n }, {\n key: 'fastQualityChange_',\n value: function fastQualityChange_() {\n var _this4 = this;\n\n var media = this.selectPlaylist();\n\n if (media === this.masterPlaylistLoader_.media()) {\n return;\n }\n\n this.masterPlaylistLoader_.media(media); // Delete all buffered data to allow an immediate quality switch, then seek to give\n // the browser a kick to remove any cached frames from the previous rendtion (.04 seconds\n // ahead is roughly the minimum that will accomplish this across a variety of content\n // in IE and Edge, but seeking in place is sufficient on all other browsers)\n // Edge/IE bug: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/14600375/\n // Chrome bug: https://bugs.chromium.org/p/chromium/issues/detail?id=651904\n\n this.mainSegmentLoader_.resetEverything(function () {\n // Since this is not a typical seek, we avoid the seekTo method which can cause segments\n // from the previously enabled rendition to load before the new playlist has finished loading\n if (videojs$1.browser.IE_VERSION || videojs$1.browser.IS_EDGE) {\n _this4.tech_.setCurrentTime(_this4.tech_.currentTime() + 0.04);\n } else {\n _this4.tech_.setCurrentTime(_this4.tech_.currentTime());\n }\n }); // don't need to reset audio as it is reset when media changes\n }\n /**\n * Begin playback.\n */\n\n }, {\n key: 'play',\n value: function play() {\n if (this.setupFirstPlay()) {\n return;\n }\n\n if (this.tech_.ended()) {\n this.seekTo_(0);\n }\n\n if (this.hasPlayed_()) {\n this.load();\n }\n\n var seekable$$1 = this.tech_.seekable(); // if the viewer has paused and we fell out of the live window,\n // seek forward to the live point\n\n if (this.tech_.duration() === Infinity) {\n if (this.tech_.currentTime() < seekable$$1.start(0)) {\n return this.seekTo_(seekable$$1.end(seekable$$1.length - 1));\n }\n }\n }\n /**\n * Seek to the latest media position if this is a live video and the\n * player and video are loaded and initialized.\n */\n\n }, {\n key: 'setupFirstPlay',\n value: function setupFirstPlay() {\n var _this5 = this;\n\n var media = this.masterPlaylistLoader_.media(); // Check that everything is ready to begin buffering for the first call to play\n // If 1) there is no active media\n // 2) the player is paused\n // 3) the first play has already been setup\n // then exit early\n\n if (!media || this.tech_.paused() || this.hasPlayed_()) {\n return false;\n } // when the video is a live stream\n\n\n if (!media.endList) {\n var seekable$$1 = this.seekable();\n\n if (!seekable$$1.length) {\n // without a seekable range, the player cannot seek to begin buffering at the live\n // point\n return false;\n }\n\n if (videojs$1.browser.IE_VERSION && this.tech_.readyState() === 0) {\n // IE11 throws an InvalidStateError if you try to set currentTime while the\n // readyState is 0, so it must be delayed until the tech fires loadedmetadata.\n this.tech_.one('loadedmetadata', function () {\n _this5.trigger('firstplay');\n\n _this5.seekTo_(seekable$$1.end(0));\n\n _this5.hasPlayed_ = function () {\n return true;\n };\n });\n return false;\n } // trigger firstplay to inform the source handler to ignore the next seek event\n\n\n this.trigger('firstplay'); // seek to the live point\n\n this.seekTo_(seekable$$1.end(0));\n }\n\n this.hasPlayed_ = function () {\n return true;\n }; // we can begin loading now that everything is ready\n\n\n this.load();\n return true;\n }\n /**\n * handle the sourceopen event on the MediaSource\n *\n * @private\n */\n\n }, {\n key: 'handleSourceOpen_',\n value: function handleSourceOpen_() {\n // Only attempt to create the source buffer if none already exist.\n // handleSourceOpen is also called when we are \"re-opening\" a source buffer\n // after `endOfStream` has been called (in response to a seek for instance)\n try {\n this.setupSourceBuffers_();\n } catch (e) {\n videojs$1.log.warn('Failed to create Source Buffers', e);\n return this.mediaSource.endOfStream('decode');\n } // if autoplay is enabled, begin playback. This is duplicative of\n // code in video.js but is required because play() must be invoked\n // *after* the media source has opened.\n\n\n if (this.tech_.autoplay()) {\n var playPromise = this.tech_.play(); // Catch/silence error when a pause interrupts a play request\n // on browsers which return a promise\n\n if (typeof playPromise !== 'undefined' && typeof playPromise.then === 'function') {\n playPromise.then(null, function (e) {});\n }\n }\n\n this.trigger('sourceopen');\n }\n /**\n * Calls endOfStream on the media source when all active stream types have called\n * endOfStream\n *\n * @param {string} streamType\n * Stream type of the segment loader that called endOfStream\n * @private\n */\n\n }, {\n key: 'onEndOfStream',\n value: function onEndOfStream() {\n var isEndOfStream = this.mainSegmentLoader_.ended_;\n\n if (this.mediaTypes_.AUDIO.activePlaylistLoader) {\n // if the audio playlist loader exists, then alternate audio is active\n if (!this.mainSegmentLoader_.startingMedia_ || this.mainSegmentLoader_.startingMedia_.containsVideo) {\n // if we do not know if the main segment loader contains video yet or if we\n // definitively know the main segment loader contains video, then we need to wait\n // for both main and audio segment loaders to call endOfStream\n isEndOfStream = isEndOfStream && this.audioSegmentLoader_.ended_;\n } else {\n // otherwise just rely on the audio loader\n isEndOfStream = this.audioSegmentLoader_.ended_;\n }\n }\n\n if (isEndOfStream) {\n this.mediaSource.endOfStream();\n }\n }\n /**\n * Check if a playlist has stopped being updated\n * @param {Object} playlist the media playlist object\n * @return {boolean} whether the playlist has stopped being updated or not\n */\n\n }, {\n key: 'stuckAtPlaylistEnd_',\n value: function stuckAtPlaylistEnd_(playlist) {\n var seekable$$1 = this.seekable();\n\n if (!seekable$$1.length) {\n // playlist doesn't have enough information to determine whether we are stuck\n return false;\n }\n\n var expired = this.syncController_.getExpiredTime(playlist, this.mediaSource.duration);\n\n if (expired === null) {\n return false;\n } // does not use the safe live end to calculate playlist end, since we\n // don't want to say we are stuck while there is still content\n\n\n var absolutePlaylistEnd = Hls.Playlist.playlistEnd(playlist, expired);\n var currentTime = this.tech_.currentTime();\n var buffered = this.tech_.buffered();\n\n if (!buffered.length) {\n // return true if the playhead reached the absolute end of the playlist\n return absolutePlaylistEnd - currentTime <= SAFE_TIME_DELTA;\n }\n\n var bufferedEnd = buffered.end(buffered.length - 1); // return true if there is too little buffer left and buffer has reached absolute\n // end of playlist\n\n return bufferedEnd - currentTime <= SAFE_TIME_DELTA && absolutePlaylistEnd - bufferedEnd <= SAFE_TIME_DELTA;\n }\n /**\n * Blacklists a playlist when an error occurs for a set amount of time\n * making it unavailable for selection by the rendition selection algorithm\n * and then forces a new playlist (rendition) selection.\n *\n * @param {Object=} error an optional error that may include the playlist\n * to blacklist\n * @param {Number=} blacklistDuration an optional number of seconds to blacklist the\n * playlist\n */\n\n }, {\n key: 'blacklistCurrentPlaylist',\n value: function blacklistCurrentPlaylist() {\n var error = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var blacklistDuration = arguments[1];\n var currentPlaylist = void 0;\n var nextPlaylist = void 0; // If the `error` was generated by the playlist loader, it will contain\n // the playlist we were trying to load (but failed) and that should be\n // blacklisted instead of the currently selected playlist which is likely\n // out-of-date in this scenario\n\n currentPlaylist = error.playlist || this.masterPlaylistLoader_.media();\n blacklistDuration = blacklistDuration || error.blacklistDuration || this.blacklistDuration; // If there is no current playlist, then an error occurred while we were\n // trying to load the master OR while we were disposing of the tech\n\n if (!currentPlaylist) {\n this.error = error;\n\n try {\n return this.mediaSource.endOfStream('network');\n } catch (e) {\n return this.trigger('error');\n }\n }\n\n var isFinalRendition = this.masterPlaylistLoader_.master.playlists.filter(isEnabled).length === 1;\n\n if (isFinalRendition) {\n // Never blacklisting this playlist because it's final rendition\n videojs$1.log.warn('Problem encountered with the current ' + 'HLS playlist. Trying again since it is the final playlist.');\n this.tech_.trigger('retryplaylist');\n return this.masterPlaylistLoader_.load(isFinalRendition);\n } // Blacklist this playlist\n\n\n currentPlaylist.excludeUntil = Date.now() + blacklistDuration * 1000;\n this.tech_.trigger('blacklistplaylist');\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-rendition-blacklisted'\n }); // Select a new playlist\n\n nextPlaylist = this.selectPlaylist();\n videojs$1.log.warn('Problem encountered with the current HLS playlist.' + (error.message ? ' ' + error.message : '') + ' Switching to another playlist.');\n return this.masterPlaylistLoader_.media(nextPlaylist);\n }\n /**\n * Pause all segment loaders\n */\n\n }, {\n key: 'pauseLoading',\n value: function pauseLoading() {\n this.mainSegmentLoader_.pause();\n\n if (this.mediaTypes_.AUDIO.activePlaylistLoader) {\n this.audioSegmentLoader_.pause();\n }\n\n if (this.mediaTypes_.SUBTITLES.activePlaylistLoader) {\n this.subtitleSegmentLoader_.pause();\n }\n }\n /**\n * set the current time on all segment loaders\n *\n * @param {TimeRange} currentTime the current time to set\n * @return {TimeRange} the current time\n */\n\n }, {\n key: 'setCurrentTime',\n value: function setCurrentTime(currentTime) {\n var buffered = findRange(this.tech_.buffered(), currentTime);\n\n if (!(this.masterPlaylistLoader_ && this.masterPlaylistLoader_.media())) {\n // return immediately if the metadata is not ready yet\n return 0;\n } // it's clearly an edge-case but don't thrown an error if asked to\n // seek within an empty playlist\n\n\n if (!this.masterPlaylistLoader_.media().segments) {\n return 0;\n } // In flash playback, the segment loaders should be reset on every seek, even\n // in buffer seeks. If the seek location is already buffered, continue buffering as\n // usual\n // TODO: redo this comment\n\n\n if (buffered && buffered.length) {\n return currentTime;\n } // cancel outstanding requests so we begin buffering at the new\n // location\n\n\n this.mainSegmentLoader_.resetEverything();\n this.mainSegmentLoader_.abort();\n\n if (this.mediaTypes_.AUDIO.activePlaylistLoader) {\n this.audioSegmentLoader_.resetEverything();\n this.audioSegmentLoader_.abort();\n }\n\n if (this.mediaTypes_.SUBTITLES.activePlaylistLoader) {\n this.subtitleSegmentLoader_.resetEverything();\n this.subtitleSegmentLoader_.abort();\n } // start segment loader loading in case they are paused\n\n\n this.load();\n }\n /**\n * get the current duration\n *\n * @return {TimeRange} the duration\n */\n\n }, {\n key: 'duration',\n value: function duration$$1() {\n if (!this.masterPlaylistLoader_) {\n return 0;\n }\n\n if (this.mediaSource) {\n return this.mediaSource.duration;\n }\n\n return Hls.Playlist.duration(this.masterPlaylistLoader_.media());\n }\n /**\n * check the seekable range\n *\n * @return {TimeRange} the seekable range\n */\n\n }, {\n key: 'seekable',\n value: function seekable$$1() {\n return this.seekable_;\n }\n }, {\n key: 'onSyncInfoUpdate_',\n value: function onSyncInfoUpdate_() {\n var mainSeekable = void 0;\n var audioSeekable = void 0;\n\n if (!this.masterPlaylistLoader_) {\n return;\n }\n\n var media = this.masterPlaylistLoader_.media();\n\n if (!media) {\n return;\n }\n\n var expired = this.syncController_.getExpiredTime(media, this.mediaSource.duration);\n\n if (expired === null) {\n // not enough information to update seekable\n return;\n }\n\n mainSeekable = Hls.Playlist.seekable(media, expired);\n\n if (mainSeekable.length === 0) {\n return;\n }\n\n if (this.mediaTypes_.AUDIO.activePlaylistLoader) {\n media = this.mediaTypes_.AUDIO.activePlaylistLoader.media();\n expired = this.syncController_.getExpiredTime(media, this.mediaSource.duration);\n\n if (expired === null) {\n return;\n }\n\n audioSeekable = Hls.Playlist.seekable(media, expired);\n\n if (audioSeekable.length === 0) {\n return;\n }\n }\n\n if (!audioSeekable) {\n // seekable has been calculated based on buffering video data so it\n // can be returned directly\n this.seekable_ = mainSeekable;\n } else if (audioSeekable.start(0) > mainSeekable.end(0) || mainSeekable.start(0) > audioSeekable.end(0)) {\n // seekables are pretty far off, rely on main\n this.seekable_ = mainSeekable;\n } else {\n this.seekable_ = videojs$1.createTimeRanges([[audioSeekable.start(0) > mainSeekable.start(0) ? audioSeekable.start(0) : mainSeekable.start(0), audioSeekable.end(0) < mainSeekable.end(0) ? audioSeekable.end(0) : mainSeekable.end(0)]]);\n }\n\n this.logger_('seekable updated [' + printableRange(this.seekable_) + ']');\n this.tech_.trigger('seekablechanged');\n }\n /**\n * Update the player duration\n */\n\n }, {\n key: 'updateDuration',\n value: function updateDuration() {\n var _this6 = this;\n\n var oldDuration = this.mediaSource.duration;\n var newDuration = Hls.Playlist.duration(this.masterPlaylistLoader_.media());\n var buffered = this.tech_.buffered();\n\n var setDuration = function setDuration() {\n _this6.mediaSource.duration = newDuration;\n\n _this6.tech_.trigger('durationchange');\n\n _this6.mediaSource.removeEventListener('sourceopen', setDuration);\n };\n\n if (buffered.length > 0) {\n newDuration = Math.max(newDuration, buffered.end(buffered.length - 1));\n } // if the duration has changed, invalidate the cached value\n\n\n if (oldDuration !== newDuration) {\n // update the duration\n if (this.mediaSource.readyState !== 'open') {\n this.mediaSource.addEventListener('sourceopen', setDuration);\n } else {\n setDuration();\n }\n }\n }\n /**\n * dispose of the MasterPlaylistController and everything\n * that it controls\n */\n\n }, {\n key: 'dispose',\n value: function dispose() {\n var _this7 = this;\n\n this.decrypter_.terminate();\n this.masterPlaylistLoader_.dispose();\n this.mainSegmentLoader_.dispose();\n ['AUDIO', 'SUBTITLES'].forEach(function (type) {\n var groups = _this7.mediaTypes_[type].groups;\n\n for (var id in groups) {\n groups[id].forEach(function (group) {\n if (group.playlistLoader) {\n group.playlistLoader.dispose();\n }\n });\n }\n });\n this.audioSegmentLoader_.dispose();\n this.subtitleSegmentLoader_.dispose();\n }\n /**\n * return the master playlist object if we have one\n *\n * @return {Object} the master playlist object that we parsed\n */\n\n }, {\n key: 'master',\n value: function master() {\n return this.masterPlaylistLoader_.master;\n }\n /**\n * return the currently selected playlist\n *\n * @return {Object} the currently selected playlist object that we parsed\n */\n\n }, {\n key: 'media',\n value: function media() {\n // playlist loader will not return media if it has not been fully loaded\n return this.masterPlaylistLoader_.media() || this.initialMedia_;\n }\n /**\n * setup our internal source buffers on our segment Loaders\n *\n * @private\n */\n\n }, {\n key: 'setupSourceBuffers_',\n value: function setupSourceBuffers_() {\n var media = this.masterPlaylistLoader_.media();\n var mimeTypes = void 0; // wait until a media playlist is available and the Media Source is\n // attached\n\n if (!media || this.mediaSource.readyState !== 'open') {\n return;\n }\n\n mimeTypes = mimeTypesForPlaylist(this.masterPlaylistLoader_.master, media);\n\n if (mimeTypes.length < 1) {\n this.error = 'No compatible SourceBuffer configuration for the variant stream:' + media.resolvedUri;\n return this.mediaSource.endOfStream('decode');\n }\n\n this.configureLoaderMimeTypes_(mimeTypes); // exclude any incompatible variant streams from future playlist\n // selection\n\n this.excludeIncompatibleVariants_(media);\n }\n }, {\n key: 'configureLoaderMimeTypes_',\n value: function configureLoaderMimeTypes_(mimeTypes) {\n // If the content is demuxed, we can't start appending segments to a source buffer\n // until both source buffers are set up, or else the browser may not let us add the\n // second source buffer (it will assume we are playing either audio only or video\n // only).\n var sourceBufferEmitter = // If there is more than one mime type\n mimeTypes.length > 1 && // and the first mime type does not have muxed video and audio\n mimeTypes[0].indexOf(',') === -1 && // and the two mime types are different (they can be the same in the case of audio\n // only with alternate audio)\n mimeTypes[0] !== mimeTypes[1] ? // then we want to wait on the second source buffer\n new videojs$1.EventTarget() : // otherwise there is no need to wait as the content is either audio only,\n // video only, or muxed content.\n null;\n this.mainSegmentLoader_.mimeType(mimeTypes[0], sourceBufferEmitter);\n\n if (mimeTypes[1]) {\n this.audioSegmentLoader_.mimeType(mimeTypes[1], sourceBufferEmitter);\n }\n }\n /**\n * Blacklists playlists with codecs that are unsupported by the browser.\n */\n\n }, {\n key: 'excludeUnsupportedVariants_',\n value: function excludeUnsupportedVariants_() {\n this.master().playlists.forEach(function (variant) {\n if (variant.attributes.CODECS && window$1.MediaSource && window$1.MediaSource.isTypeSupported && !window$1.MediaSource.isTypeSupported('video/mp4; codecs=\"' + mapLegacyAvcCodecs(variant.attributes.CODECS) + '\"')) {\n variant.excludeUntil = Infinity;\n }\n });\n }\n /**\n * Blacklist playlists that are known to be codec or\n * stream-incompatible with the SourceBuffer configuration. For\n * instance, Media Source Extensions would cause the video element to\n * stall waiting for video data if you switched from a variant with\n * video and audio to an audio-only one.\n *\n * @param {Object} media a media playlist compatible with the current\n * set of SourceBuffers. Variants in the current master playlist that\n * do not appear to have compatible codec or stream configurations\n * will be excluded from the default playlist selection algorithm\n * indefinitely.\n * @private\n */\n\n }, {\n key: 'excludeIncompatibleVariants_',\n value: function excludeIncompatibleVariants_(media) {\n var codecCount = 2;\n var videoCodec = null;\n var codecs = void 0;\n\n if (media.attributes.CODECS) {\n codecs = parseCodecs(media.attributes.CODECS);\n videoCodec = codecs.videoCodec;\n codecCount = codecs.codecCount;\n }\n\n this.master().playlists.forEach(function (variant) {\n var variantCodecs = {\n codecCount: 2,\n videoCodec: null\n };\n\n if (variant.attributes.CODECS) {\n variantCodecs = parseCodecs(variant.attributes.CODECS);\n } // if the streams differ in the presence or absence of audio or\n // video, they are incompatible\n\n\n if (variantCodecs.codecCount !== codecCount) {\n variant.excludeUntil = Infinity;\n } // if h.264 is specified on the current playlist, some flavor of\n // it must be specified on all compatible variants\n\n\n if (variantCodecs.videoCodec !== videoCodec) {\n variant.excludeUntil = Infinity;\n }\n });\n }\n }, {\n key: 'updateAdCues_',\n value: function updateAdCues_(media) {\n var offset = 0;\n var seekable$$1 = this.seekable();\n\n if (seekable$$1.length) {\n offset = seekable$$1.start(0);\n }\n\n updateAdCues(media, this.cueTagsTrack_, offset);\n }\n /**\n * Calculates the desired forward buffer length based on current time\n *\n * @return {Number} Desired forward buffer length in seconds\n */\n\n }, {\n key: 'goalBufferLength',\n value: function goalBufferLength() {\n var currentTime = this.tech_.currentTime();\n var initial = Config.GOAL_BUFFER_LENGTH;\n var rate = Config.GOAL_BUFFER_LENGTH_RATE;\n var max = Math.max(initial, Config.MAX_GOAL_BUFFER_LENGTH);\n return Math.min(initial + currentTime * rate, max);\n }\n /**\n * Calculates the desired buffer low water line based on current time\n *\n * @return {Number} Desired buffer low water line in seconds\n */\n\n }, {\n key: 'bufferLowWaterLine',\n value: function bufferLowWaterLine() {\n var currentTime = this.tech_.currentTime();\n var initial = Config.BUFFER_LOW_WATER_LINE;\n var rate = Config.BUFFER_LOW_WATER_LINE_RATE;\n var max = Math.max(initial, Config.MAX_BUFFER_LOW_WATER_LINE);\n return Math.min(initial + currentTime * rate, max);\n }\n }]);\n return MasterPlaylistController;\n}(videojs$1.EventTarget);\n/**\n * Returns a function that acts as the Enable/disable playlist function.\n *\n * @param {PlaylistLoader} loader - The master playlist loader\n * @param {String} playlistUri - uri of the playlist\n * @param {Function} changePlaylistFn - A function to be called after a\n * playlist's enabled-state has been changed. Will NOT be called if a\n * playlist's enabled-state is unchanged\n * @param {Boolean=} enable - Value to set the playlist enabled-state to\n * or if undefined returns the current enabled-state for the playlist\n * @return {Function} Function for setting/getting enabled\n */\n\n\nvar enableFunction = function enableFunction(loader, playlistUri, changePlaylistFn) {\n return function (enable) {\n var playlist = loader.master.playlists[playlistUri];\n var incompatible = isIncompatible(playlist);\n var currentlyEnabled = isEnabled(playlist);\n\n if (typeof enable === 'undefined') {\n return currentlyEnabled;\n }\n\n if (enable) {\n delete playlist.disabled;\n } else {\n playlist.disabled = true;\n }\n\n if (enable !== currentlyEnabled && !incompatible) {\n // Ensure the outside world knows about our changes\n changePlaylistFn();\n\n if (enable) {\n loader.trigger('renditionenabled');\n } else {\n loader.trigger('renditiondisabled');\n }\n }\n\n return enable;\n };\n};\n/**\n * The representation object encapsulates the publicly visible information\n * in a media playlist along with a setter/getter-type function (enabled)\n * for changing the enabled-state of a particular playlist entry\n *\n * @class Representation\n */\n\n\nvar Representation = function Representation(hlsHandler, playlist, id) {\n classCallCheck(this, Representation);\n var mpc = hlsHandler.masterPlaylistController_,\n smoothQualityChange = hlsHandler.options_.smoothQualityChange; // Get a reference to a bound version of the quality change function\n\n var changeType = smoothQualityChange ? 'smooth' : 'fast';\n var qualityChangeFunction = mpc[changeType + 'QualityChange_'].bind(mpc); // some playlist attributes are optional\n\n if (playlist.attributes.RESOLUTION) {\n var resolution = playlist.attributes.RESOLUTION;\n this.width = resolution.width;\n this.height = resolution.height;\n }\n\n this.bandwidth = playlist.attributes.BANDWIDTH; // The id is simply the ordinality of the media playlist\n // within the master playlist\n\n this.id = id; // Partially-apply the enableFunction to create a playlist-\n // specific variant\n\n this.enabled = enableFunction(hlsHandler.playlists, playlist.uri, qualityChangeFunction);\n};\n/**\n * A mixin function that adds the `representations` api to an instance\n * of the HlsHandler class\n * @param {HlsHandler} hlsHandler - An instance of HlsHandler to add the\n * representation API into\n */\n\n\nvar renditionSelectionMixin = function renditionSelectionMixin(hlsHandler) {\n var playlists = hlsHandler.playlists; // Add a single API-specific function to the HlsHandler instance\n\n hlsHandler.representations = function () {\n return playlists.master.playlists.filter(function (media) {\n return !isIncompatible(media);\n }).map(function (e, i) {\n return new Representation(hlsHandler, e, e.uri);\n });\n };\n};\n/**\n * @file playback-watcher.js\n *\n * Playback starts, and now my watch begins. It shall not end until my death. I shall\n * take no wait, hold no uncleared timeouts, father no bad seeks. I shall wear no crowns\n * and win no glory. I shall live and die at my post. I am the corrector of the underflow.\n * I am the watcher of gaps. I am the shield that guards the realms of seekable. I pledge\n * my life and honor to the Playback Watch, for this Player and all the Players to come.\n */\n// Set of events that reset the playback-watcher time check logic and clear the timeout\n\n\nvar timerCancelEvents = ['seeking', 'seeked', 'pause', 'playing', 'error'];\n/**\n * @class PlaybackWatcher\n */\n\nvar PlaybackWatcher = function () {\n /**\n * Represents an PlaybackWatcher object.\n * @constructor\n * @param {object} options an object that includes the tech and settings\n */\n function PlaybackWatcher(options) {\n var _this = this;\n\n classCallCheck(this, PlaybackWatcher);\n this.tech_ = options.tech;\n this.seekable = options.seekable;\n this.seekTo = options.seekTo;\n this.consecutiveUpdates = 0;\n this.lastRecordedTime = null;\n this.timer_ = null;\n this.checkCurrentTimeTimeout_ = null;\n this.logger_ = logger('PlaybackWatcher');\n this.logger_('initialize');\n\n var canPlayHandler = function canPlayHandler() {\n return _this.monitorCurrentTime_();\n };\n\n var waitingHandler = function waitingHandler() {\n return _this.techWaiting_();\n };\n\n var cancelTimerHandler = function cancelTimerHandler() {\n return _this.cancelTimer_();\n };\n\n var fixesBadSeeksHandler = function fixesBadSeeksHandler() {\n return _this.fixesBadSeeks_();\n };\n\n this.tech_.on('seekablechanged', fixesBadSeeksHandler);\n this.tech_.on('waiting', waitingHandler);\n this.tech_.on(timerCancelEvents, cancelTimerHandler);\n this.tech_.on('canplay', canPlayHandler); // Define the dispose function to clean up our events\n\n this.dispose = function () {\n _this.logger_('dispose');\n\n _this.tech_.off('seekablechanged', fixesBadSeeksHandler);\n\n _this.tech_.off('waiting', waitingHandler);\n\n _this.tech_.off(timerCancelEvents, cancelTimerHandler);\n\n _this.tech_.off('canplay', canPlayHandler);\n\n if (_this.checkCurrentTimeTimeout_) {\n window$1.clearTimeout(_this.checkCurrentTimeTimeout_);\n }\n\n _this.cancelTimer_();\n };\n }\n /**\n * Periodically check current time to see if playback stopped\n *\n * @private\n */\n\n\n createClass(PlaybackWatcher, [{\n key: 'monitorCurrentTime_',\n value: function monitorCurrentTime_() {\n this.checkCurrentTime_();\n\n if (this.checkCurrentTimeTimeout_) {\n window$1.clearTimeout(this.checkCurrentTimeTimeout_);\n } // 42 = 24 fps // 250 is what Webkit uses // FF uses 15\n\n\n this.checkCurrentTimeTimeout_ = window$1.setTimeout(this.monitorCurrentTime_.bind(this), 250);\n }\n /**\n * The purpose of this function is to emulate the \"waiting\" event on\n * browsers that do not emit it when they are waiting for more\n * data to continue playback\n *\n * @private\n */\n\n }, {\n key: 'checkCurrentTime_',\n value: function checkCurrentTime_() {\n if (this.tech_.seeking() && this.fixesBadSeeks_()) {\n this.consecutiveUpdates = 0;\n this.lastRecordedTime = this.tech_.currentTime();\n return;\n }\n\n if (this.tech_.paused() || this.tech_.seeking()) {\n return;\n }\n\n var currentTime = this.tech_.currentTime();\n var buffered = this.tech_.buffered();\n\n if (this.lastRecordedTime === currentTime && (!buffered.length || currentTime + SAFE_TIME_DELTA >= buffered.end(buffered.length - 1))) {\n // If current time is at the end of the final buffered region, then any playback\n // stall is most likely caused by buffering in a low bandwidth environment. The tech\n // should fire a `waiting` event in this scenario, but due to browser and tech\n // inconsistencies. Calling `techWaiting_` here allows us to simulate\n // responding to a native `waiting` event when the tech fails to emit one.\n return this.techWaiting_();\n }\n\n if (this.consecutiveUpdates >= 5 && currentTime === this.lastRecordedTime) {\n this.consecutiveUpdates++;\n this.waiting_();\n } else if (currentTime === this.lastRecordedTime) {\n this.consecutiveUpdates++;\n } else {\n this.consecutiveUpdates = 0;\n this.lastRecordedTime = currentTime;\n }\n }\n /**\n * Cancels any pending timers and resets the 'timeupdate' mechanism\n * designed to detect that we are stalled\n *\n * @private\n */\n\n }, {\n key: 'cancelTimer_',\n value: function cancelTimer_() {\n this.consecutiveUpdates = 0;\n\n if (this.timer_) {\n this.logger_('cancelTimer_');\n clearTimeout(this.timer_);\n }\n\n this.timer_ = null;\n }\n /**\n * Fixes situations where there's a bad seek\n *\n * @return {Boolean} whether an action was taken to fix the seek\n * @private\n */\n\n }, {\n key: 'fixesBadSeeks_',\n value: function fixesBadSeeks_() {\n var seeking = this.tech_.seeking();\n var seekable = this.seekable();\n var currentTime = this.tech_.currentTime();\n var seekTo = void 0;\n\n if (seeking && this.afterSeekableWindow_(seekable, currentTime)) {\n var seekableEnd = seekable.end(seekable.length - 1); // sync to live point (if VOD, our seekable was updated and we're simply adjusting)\n\n seekTo = seekableEnd;\n }\n\n if (seeking && this.beforeSeekableWindow_(seekable, currentTime)) {\n var seekableStart = seekable.start(0); // sync to the beginning of the live window\n // provide a buffer of .1 seconds to handle rounding/imprecise numbers\n\n seekTo = seekableStart + SAFE_TIME_DELTA;\n }\n\n if (typeof seekTo !== 'undefined') {\n this.logger_('Trying to seek outside of seekable at time ' + currentTime + ' with ' + ('seekable range ' + printableRange(seekable) + '. Seeking to ') + (seekTo + '.'));\n this.seekTo(seekTo);\n return true;\n }\n\n return false;\n }\n /**\n * Handler for situations when we determine the player is waiting.\n *\n * @private\n */\n\n }, {\n key: 'waiting_',\n value: function waiting_() {\n if (this.techWaiting_()) {\n return;\n } // All tech waiting checks failed. Use last resort correction\n\n\n var currentTime = this.tech_.currentTime();\n var buffered = this.tech_.buffered();\n var currentRange = findRange(buffered, currentTime); // Sometimes the player can stall for unknown reasons within a contiguous buffered\n // region with no indication that anything is amiss (seen in Firefox). Seeking to\n // currentTime is usually enough to kickstart the player. This checks that the player\n // is currently within a buffered region before attempting a corrective seek.\n // Chrome does not appear to continue `timeupdate` events after a `waiting` event\n // until there is ~ 3 seconds of forward buffer available. PlaybackWatcher should also\n // make sure there is ~3 seconds of forward buffer before taking any corrective action\n // to avoid triggering an `unknownwaiting` event when the network is slow.\n\n if (currentRange.length && currentTime + 3 <= currentRange.end(0)) {\n this.cancelTimer_();\n this.seekTo(currentTime);\n this.logger_('Stopped at ' + currentTime + ' while inside a buffered region ' + ('[' + currentRange.start(0) + ' -> ' + currentRange.end(0) + ']. Attempting to resume ') + 'playback by seeking to the current time.'); // unknown waiting corrections may be useful for monitoring QoS\n\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-unknown-waiting'\n });\n return;\n }\n }\n /**\n * Handler for situations when the tech fires a `waiting` event\n *\n * @return {Boolean}\n * True if an action (or none) was needed to correct the waiting. False if no\n * checks passed\n * @private\n */\n\n }, {\n key: 'techWaiting_',\n value: function techWaiting_() {\n var seekable = this.seekable();\n var currentTime = this.tech_.currentTime();\n\n if (this.tech_.seeking() && this.fixesBadSeeks_()) {\n // Tech is seeking or bad seek fixed, no action needed\n return true;\n }\n\n if (this.tech_.seeking() || this.timer_ !== null) {\n // Tech is seeking or already waiting on another action, no action needed\n return true;\n }\n\n if (this.beforeSeekableWindow_(seekable, currentTime)) {\n var livePoint = seekable.end(seekable.length - 1);\n this.logger_('Fell out of live window at time ' + currentTime + '. Seeking to ' + ('live point (seekable end) ' + livePoint));\n this.cancelTimer_();\n this.seekTo(livePoint); // live window resyncs may be useful for monitoring QoS\n\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-live-resync'\n });\n return true;\n }\n\n var buffered = this.tech_.buffered();\n var nextRange = findNextRange(buffered, currentTime);\n\n if (this.videoUnderflow_(nextRange, buffered, currentTime)) {\n // Even though the video underflowed and was stuck in a gap, the audio overplayed\n // the gap, leading currentTime into a buffered range. Seeking to currentTime\n // allows the video to catch up to the audio position without losing any audio\n // (only suffering ~3 seconds of frozen video and a pause in audio playback).\n this.cancelTimer_();\n this.seekTo(currentTime); // video underflow may be useful for monitoring QoS\n\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-video-underflow'\n });\n return true;\n } // check for gap\n\n\n if (nextRange.length > 0) {\n var difference = nextRange.start(0) - currentTime;\n this.logger_('Stopped at ' + currentTime + ', setting timer for ' + difference + ', seeking ' + ('to ' + nextRange.start(0)));\n this.timer_ = setTimeout(this.skipTheGap_.bind(this), difference * 1000, currentTime);\n return true;\n } // All checks failed. Returning false to indicate failure to correct waiting\n\n\n return false;\n }\n }, {\n key: 'afterSeekableWindow_',\n value: function afterSeekableWindow_(seekable, currentTime) {\n if (!seekable.length) {\n // we can't make a solid case if there's no seekable, default to false\n return false;\n }\n\n if (currentTime > seekable.end(seekable.length - 1) + SAFE_TIME_DELTA) {\n return true;\n }\n\n return false;\n }\n }, {\n key: 'beforeSeekableWindow_',\n value: function beforeSeekableWindow_(seekable, currentTime) {\n if (seekable.length && // can't fall before 0 and 0 seekable start identifies VOD stream\n seekable.start(0) > 0 && currentTime < seekable.start(0) - SAFE_TIME_DELTA) {\n return true;\n }\n\n return false;\n }\n }, {\n key: 'videoUnderflow_',\n value: function videoUnderflow_(nextRange, buffered, currentTime) {\n if (nextRange.length === 0) {\n // Even if there is no available next range, there is still a possibility we are\n // stuck in a gap due to video underflow.\n var gap = this.gapFromVideoUnderflow_(buffered, currentTime);\n\n if (gap) {\n this.logger_('Encountered a gap in video from ' + gap.start + ' to ' + gap.end + '. ' + ('Seeking to current time ' + currentTime));\n return true;\n }\n }\n\n return false;\n }\n /**\n * Timer callback. If playback still has not proceeded, then we seek\n * to the start of the next buffered region.\n *\n * @private\n */\n\n }, {\n key: 'skipTheGap_',\n value: function skipTheGap_(scheduledCurrentTime) {\n var buffered = this.tech_.buffered();\n var currentTime = this.tech_.currentTime();\n var nextRange = findNextRange(buffered, currentTime);\n this.cancelTimer_();\n\n if (nextRange.length === 0 || currentTime !== scheduledCurrentTime) {\n return;\n }\n\n this.logger_('skipTheGap_:', 'currentTime:', currentTime, 'scheduled currentTime:', scheduledCurrentTime, 'nextRange start:', nextRange.start(0)); // only seek if we still have not played\n\n this.seekTo(nextRange.start(0) + TIME_FUDGE_FACTOR);\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-gap-skip'\n });\n }\n }, {\n key: 'gapFromVideoUnderflow_',\n value: function gapFromVideoUnderflow_(buffered, currentTime) {\n // At least in Chrome, if there is a gap in the video buffer, the audio will continue\n // playing for ~3 seconds after the video gap starts. This is done to account for\n // video buffer underflow/underrun (note that this is not done when there is audio\n // buffer underflow/underrun -- in that case the video will stop as soon as it\n // encounters the gap, as audio stalls are more noticeable/jarring to a user than\n // video stalls). The player's time will reflect the playthrough of audio, so the\n // time will appear as if we are in a buffered region, even if we are stuck in a\n // \"gap.\"\n //\n // Example:\n // video buffer: 0 => 10.1, 10.2 => 20\n // audio buffer: 0 => 20\n // overall buffer: 0 => 10.1, 10.2 => 20\n // current time: 13\n //\n // Chrome's video froze at 10 seconds, where the video buffer encountered the gap,\n // however, the audio continued playing until it reached ~3 seconds past the gap\n // (13 seconds), at which point it stops as well. Since current time is past the\n // gap, findNextRange will return no ranges.\n //\n // To check for this issue, we see if there is a gap that starts somewhere within\n // a 3 second range (3 seconds +/- 1 second) back from our current time.\n var gaps = findGaps(buffered);\n\n for (var i = 0; i < gaps.length; i++) {\n var start = gaps.start(i);\n var end = gaps.end(i); // gap is starts no more than 4 seconds back\n\n if (currentTime - start < 4 && currentTime - start > 2) {\n return {\n start: start,\n end: end\n };\n }\n }\n\n return null;\n }\n }]);\n return PlaybackWatcher;\n}();\n\nvar defaultOptions = {\n errorInterval: 30,\n getSource: function getSource(next) {\n var tech = this.tech({\n IWillNotUseThisInPlugins: true\n });\n var sourceObj = tech.currentSource_;\n return next(sourceObj);\n }\n};\n/**\n * Main entry point for the plugin\n *\n * @param {Player} player a reference to a videojs Player instance\n * @param {Object} [options] an object with plugin options\n * @private\n */\n\nvar initPlugin = function initPlugin(player, options) {\n var lastCalled = 0;\n var seekTo = 0;\n var localOptions = videojs$1.mergeOptions(defaultOptions, options);\n player.ready(function () {\n player.trigger({\n type: 'usage',\n name: 'hls-error-reload-initialized'\n });\n });\n /**\n * Player modifications to perform that must wait until `loadedmetadata`\n * has been triggered\n *\n * @private\n */\n\n var loadedMetadataHandler = function loadedMetadataHandler() {\n if (seekTo) {\n player.currentTime(seekTo);\n }\n };\n /**\n * Set the source on the player element, play, and seek if necessary\n *\n * @param {Object} sourceObj An object specifying the source url and mime-type to play\n * @private\n */\n\n\n var setSource = function setSource(sourceObj) {\n if (sourceObj === null || sourceObj === undefined) {\n return;\n }\n\n seekTo = player.duration() !== Infinity && player.currentTime() || 0;\n player.one('loadedmetadata', loadedMetadataHandler);\n player.src(sourceObj);\n player.trigger({\n type: 'usage',\n name: 'hls-error-reload'\n });\n player.play();\n };\n /**\n * Attempt to get a source from either the built-in getSource function\n * or a custom function provided via the options\n *\n * @private\n */\n\n\n var errorHandler = function errorHandler() {\n // Do not attempt to reload the source if a source-reload occurred before\n // 'errorInterval' time has elapsed since the last source-reload\n if (Date.now() - lastCalled < localOptions.errorInterval * 1000) {\n player.trigger({\n type: 'usage',\n name: 'hls-error-reload-canceled'\n });\n return;\n }\n\n if (!localOptions.getSource || typeof localOptions.getSource !== 'function') {\n videojs$1.log.error('ERROR: reloadSourceOnError - The option getSource must be a function!');\n return;\n }\n\n lastCalled = Date.now();\n return localOptions.getSource.call(player, setSource);\n };\n /**\n * Unbind any event handlers that were bound by the plugin\n *\n * @private\n */\n\n\n var cleanupEvents = function cleanupEvents() {\n player.off('loadedmetadata', loadedMetadataHandler);\n player.off('error', errorHandler);\n player.off('dispose', cleanupEvents);\n };\n /**\n * Cleanup before re-initializing the plugin\n *\n * @param {Object} [newOptions] an object with plugin options\n * @private\n */\n\n\n var reinitPlugin = function reinitPlugin(newOptions) {\n cleanupEvents();\n initPlugin(player, newOptions);\n };\n\n player.on('error', errorHandler);\n player.on('dispose', cleanupEvents); // Overwrite the plugin function so that we can correctly cleanup before\n // initializing the plugin\n\n player.reloadSourceOnError = reinitPlugin;\n};\n/**\n * Reload the source when an error is detected as long as there\n * wasn't an error previously within the last 30 seconds\n *\n * @param {Object} [options] an object with plugin options\n */\n\n\nvar reloadSourceOnError = function reloadSourceOnError(options) {\n initPlugin(this, options);\n};\n\nvar version$1 = \"1.5.1\"; // since VHS handles HLS and DASH (and in the future, more types), use * to capture all\n\nvideojs$1.use('*', function (player) {\n return {\n setSource: function setSource(srcObj, next) {\n // pass null as the first argument to indicate that the source is not rejected\n next(null, srcObj);\n },\n // VHS needs to know when seeks happen. For external seeks (generated at the player\n // level), this middleware will capture the action. For internal seeks (generated at\n // the tech level), we use a wrapped function so that we can handle it on our own\n // (specified elsewhere).\n setCurrentTime: function setCurrentTime(time) {\n if (player.vhs && player.currentSource().src === player.vhs.source_.src) {\n player.vhs.setCurrentTime(time);\n }\n\n return time;\n },\n // Sync VHS after play requests.\n // This specifically handles replay where the order of actions is\n // play, video element will seek to 0 (skipping the setCurrentTime middleware)\n // then triggers a play event.\n play: function play() {\n if (player.vhs && player.currentSource().src === player.vhs.source_.src) {\n player.vhs.setCurrentTime(player.currentTime());\n }\n }\n };\n});\n/**\n * @file videojs-http-streaming.js\n *\n * The main file for the HLS project.\n * License: https://github.com/videojs/videojs-http-streaming/blob/master/LICENSE\n */\n\nvar Hls$1 = {\n PlaylistLoader: PlaylistLoader,\n Playlist: Playlist,\n Decrypter: Decrypter,\n AsyncStream: AsyncStream,\n decrypt: decrypt,\n utils: utils,\n STANDARD_PLAYLIST_SELECTOR: lastBandwidthSelector,\n INITIAL_PLAYLIST_SELECTOR: lowestBitrateCompatibleVariantSelector,\n comparePlaylistBandwidth: comparePlaylistBandwidth,\n comparePlaylistResolution: comparePlaylistResolution,\n xhr: xhrFactory()\n}; // Define getter/setters for config properites\n\n['GOAL_BUFFER_LENGTH', 'MAX_GOAL_BUFFER_LENGTH', 'GOAL_BUFFER_LENGTH_RATE', 'BUFFER_LOW_WATER_LINE', 'MAX_BUFFER_LOW_WATER_LINE', 'BUFFER_LOW_WATER_LINE_RATE', 'BANDWIDTH_VARIANCE'].forEach(function (prop) {\n Object.defineProperty(Hls$1, prop, {\n get: function get$$1() {\n videojs$1.log.warn('using Hls.' + prop + ' is UNSAFE be sure you know what you are doing');\n return Config[prop];\n },\n set: function set$$1(value) {\n videojs$1.log.warn('using Hls.' + prop + ' is UNSAFE be sure you know what you are doing');\n\n if (typeof value !== 'number' || value < 0) {\n videojs$1.log.warn('value of Hls.' + prop + ' must be greater than or equal to 0');\n return;\n }\n\n Config[prop] = value;\n }\n });\n});\nvar LOCAL_STORAGE_KEY$1 = 'videojs-vhs';\n\nvar simpleTypeFromSourceType = function simpleTypeFromSourceType(type) {\n var mpegurlRE = /^(audio|video|application)\\/(x-|vnd\\.apple\\.)?mpegurl/i;\n\n if (mpegurlRE.test(type)) {\n return 'hls';\n }\n\n var dashRE = /^application\\/dash\\+xml/i;\n\n if (dashRE.test(type)) {\n return 'dash';\n }\n\n return null;\n};\n/**\n * Updates the selectedIndex of the QualityLevelList when a mediachange happens in hls.\n *\n * @param {QualityLevelList} qualityLevels The QualityLevelList to update.\n * @param {PlaylistLoader} playlistLoader PlaylistLoader containing the new media info.\n * @function handleHlsMediaChange\n */\n\n\nvar handleHlsMediaChange = function handleHlsMediaChange(qualityLevels, playlistLoader) {\n var newPlaylist = playlistLoader.media();\n var selectedIndex = -1;\n\n for (var i = 0; i < qualityLevels.length; i++) {\n if (qualityLevels[i].id === newPlaylist.uri) {\n selectedIndex = i;\n break;\n }\n }\n\n qualityLevels.selectedIndex_ = selectedIndex;\n qualityLevels.trigger({\n selectedIndex: selectedIndex,\n type: 'change'\n });\n};\n/**\n * Adds quality levels to list once playlist metadata is available\n *\n * @param {QualityLevelList} qualityLevels The QualityLevelList to attach events to.\n * @param {Object} hls Hls object to listen to for media events.\n * @function handleHlsLoadedMetadata\n */\n\n\nvar handleHlsLoadedMetadata = function handleHlsLoadedMetadata(qualityLevels, hls) {\n hls.representations().forEach(function (rep) {\n qualityLevels.addQualityLevel(rep);\n });\n handleHlsMediaChange(qualityLevels, hls.playlists);\n}; // HLS is a source handler, not a tech. Make sure attempts to use it\n// as one do not cause exceptions.\n\n\nHls$1.canPlaySource = function () {\n return videojs$1.log.warn('HLS is no longer a tech. Please remove it from ' + 'your player\\'s techOrder.');\n};\n\nvar emeKeySystems = function emeKeySystems(keySystemOptions, videoPlaylist, audioPlaylist) {\n if (!keySystemOptions) {\n return keySystemOptions;\n } // upsert the content types based on the selected playlist\n\n\n var keySystemContentTypes = {};\n\n for (var keySystem in keySystemOptions) {\n keySystemContentTypes[keySystem] = {\n audioContentType: 'audio/mp4; codecs=\"' + audioPlaylist.attributes.CODECS + '\"',\n videoContentType: 'video/mp4; codecs=\"' + videoPlaylist.attributes.CODECS + '\"'\n };\n\n if (videoPlaylist.contentProtection && videoPlaylist.contentProtection[keySystem] && videoPlaylist.contentProtection[keySystem].pssh) {\n keySystemContentTypes[keySystem].pssh = videoPlaylist.contentProtection[keySystem].pssh;\n } // videojs-contrib-eme accepts the option of specifying: 'com.some.cdm': 'url'\n // so we need to prevent overwriting the URL entirely\n\n\n if (typeof keySystemOptions[keySystem] === 'string') {\n keySystemContentTypes[keySystem].url = keySystemOptions[keySystem];\n }\n }\n\n return videojs$1.mergeOptions(keySystemOptions, keySystemContentTypes);\n};\n\nvar setupEmeOptions = function setupEmeOptions(hlsHandler) {\n if (hlsHandler.options_.sourceType !== 'dash') {\n return;\n }\n\n var player = videojs$1.players[hlsHandler.tech_.options_.playerId];\n\n if (player.eme) {\n var sourceOptions = emeKeySystems(hlsHandler.source_.keySystems, hlsHandler.playlists.media(), hlsHandler.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader.media());\n\n if (sourceOptions) {\n player.currentSource().keySystems = sourceOptions; // works around https://bugs.chromium.org/p/chromium/issues/detail?id=895449\n\n if (player.eme.initializeMediaKeys) {\n player.eme.initializeMediaKeys();\n }\n }\n }\n};\n\nvar getVhsLocalStorage = function getVhsLocalStorage() {\n if (!window.localStorage) {\n return null;\n }\n\n var storedObject = window.localStorage.getItem(LOCAL_STORAGE_KEY$1);\n\n if (!storedObject) {\n return null;\n }\n\n try {\n return JSON.parse(storedObject);\n } catch (e) {\n // someone may have tampered with the value\n return null;\n }\n};\n\nvar updateVhsLocalStorage = function updateVhsLocalStorage(options) {\n if (!window.localStorage) {\n return false;\n }\n\n var objectToStore = getVhsLocalStorage();\n objectToStore = objectToStore ? videojs$1.mergeOptions(objectToStore, options) : options;\n\n try {\n window.localStorage.setItem(LOCAL_STORAGE_KEY$1, JSON.stringify(objectToStore));\n } catch (e) {\n // Throws if storage is full (e.g., always on iOS 5+ Safari private mode, where\n // storage is set to 0).\n // https://developer.mozilla.org/en-US/docs/Web/API/Storage/setItem#Exceptions\n // No need to perform any operation.\n return false;\n }\n\n return objectToStore;\n};\n/**\n * Whether the browser has built-in HLS support.\n */\n\n\nHls$1.supportsNativeHls = function () {\n var video = document.createElement('video'); // native HLS is definitely not supported if HTML5 video isn't\n\n if (!videojs$1.getTech('Html5').isSupported()) {\n return false;\n } // HLS manifests can go by many mime-types\n\n\n var canPlay = [// Apple santioned\n 'application/vnd.apple.mpegurl', // Apple sanctioned for backwards compatibility\n 'audio/mpegurl', // Very common\n 'audio/x-mpegurl', // Very common\n 'application/x-mpegurl', // Included for completeness\n 'video/x-mpegurl', 'video/mpegurl', 'application/mpegurl'];\n return canPlay.some(function (canItPlay) {\n return /maybe|probably/i.test(video.canPlayType(canItPlay));\n });\n}();\n\nHls$1.supportsNativeDash = function () {\n if (!videojs$1.getTech('Html5').isSupported()) {\n return false;\n }\n\n return /maybe|probably/i.test(document.createElement('video').canPlayType('application/dash+xml'));\n}();\n\nHls$1.supportsTypeNatively = function (type) {\n if (type === 'hls') {\n return Hls$1.supportsNativeHls;\n }\n\n if (type === 'dash') {\n return Hls$1.supportsNativeDash;\n }\n\n return false;\n};\n/**\n * HLS is a source handler, not a tech. Make sure attempts to use it\n * as one do not cause exceptions.\n */\n\n\nHls$1.isSupported = function () {\n return videojs$1.log.warn('HLS is no longer a tech. Please remove it from ' + 'your player\\'s techOrder.');\n};\n\nvar Component$1 = videojs$1.getComponent('Component');\n/**\n * The Hls Handler object, where we orchestrate all of the parts\n * of HLS to interact with video.js\n *\n * @class HlsHandler\n * @extends videojs.Component\n * @param {Object} source the soruce object\n * @param {Tech} tech the parent tech object\n * @param {Object} options optional and required options\n */\n\nvar HlsHandler = function (_Component) {\n inherits(HlsHandler, _Component);\n\n function HlsHandler(source, tech, options) {\n classCallCheck(this, HlsHandler); // tech.player() is deprecated but setup a reference to HLS for\n // backwards-compatibility\n\n var _this = possibleConstructorReturn(this, (HlsHandler.__proto__ || Object.getPrototypeOf(HlsHandler)).call(this, tech, options.hls));\n\n if (tech.options_ && tech.options_.playerId) {\n var _player = videojs$1(tech.options_.playerId);\n\n if (!_player.hasOwnProperty('hls')) {\n Object.defineProperty(_player, 'hls', {\n get: function get$$1() {\n videojs$1.log.warn('player.hls is deprecated. Use player.tech().hls instead.');\n tech.trigger({\n type: 'usage',\n name: 'hls-player-access'\n });\n return _this;\n },\n configurable: true\n });\n } // Set up a reference to the HlsHandler from player.vhs. This allows users to start\n // migrating from player.tech_.hls... to player.vhs... for API access. Although this\n // isn't the most appropriate form of reference for video.js (since all APIs should\n // be provided through core video.js), it is a common pattern for plugins, and vhs\n // will act accordingly.\n\n\n _player.vhs = _this; // deprecated, for backwards compatibility\n\n _player.dash = _this;\n _this.player_ = _player;\n }\n\n _this.tech_ = tech;\n _this.source_ = source;\n _this.stats = {};\n\n _this.setOptions_();\n\n if (_this.options_.overrideNative && tech.overrideNativeAudioTracks && tech.overrideNativeVideoTracks) {\n tech.overrideNativeAudioTracks(true);\n tech.overrideNativeVideoTracks(true);\n } else if (_this.options_.overrideNative && (tech.featuresNativeVideoTracks || tech.featuresNativeAudioTracks)) {\n // overriding native HLS only works if audio tracks have been emulated\n // error early if we're misconfigured\n throw new Error('Overriding native HLS requires emulated tracks. ' + 'See https://git.io/vMpjB');\n } // listen for fullscreenchange events for this player so that we\n // can adjust our quality selection quickly\n\n\n _this.on(document, ['fullscreenchange', 'webkitfullscreenchange', 'mozfullscreenchange', 'MSFullscreenChange'], function (event) {\n var fullscreenElement = document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement;\n\n if (fullscreenElement && fullscreenElement.contains(_this.tech_.el())) {\n _this.masterPlaylistController_.smoothQualityChange_();\n }\n }); // Handle seeking when looping - middleware doesn't handle this seek event from the tech\n\n\n _this.on(_this.tech_, 'seeking', function () {\n if (this.tech_.seeking() && this.tech_.currentTime() === 0 && this.tech_.player_.loop()) {\n this.setCurrentTime(0);\n }\n });\n\n _this.on(_this.tech_, 'error', function () {\n if (this.masterPlaylistController_) {\n this.masterPlaylistController_.pauseLoading();\n }\n });\n\n _this.on(_this.tech_, 'play', _this.play);\n\n return _this;\n }\n\n createClass(HlsHandler, [{\n key: 'setOptions_',\n value: function setOptions_() {\n var _this2 = this; // defaults\n\n\n this.options_.withCredentials = this.options_.withCredentials || false;\n this.options_.limitRenditionByPlayerDimensions = this.options_.limitRenditionByPlayerDimensions === false ? false : true;\n this.options_.smoothQualityChange = this.options_.smoothQualityChange || false;\n this.options_.useBandwidthFromLocalStorage = typeof this.source_.useBandwidthFromLocalStorage !== 'undefined' ? this.source_.useBandwidthFromLocalStorage : this.options_.useBandwidthFromLocalStorage || false;\n\n if (typeof this.options_.blacklistDuration !== 'number') {\n this.options_.blacklistDuration = 5 * 60;\n }\n\n if (typeof this.options_.bandwidth !== 'number') {\n if (this.options_.useBandwidthFromLocalStorage) {\n var storedObject = getVhsLocalStorage();\n\n if (storedObject && storedObject.bandwidth) {\n this.options_.bandwidth = storedObject.bandwidth;\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-bandwidth-from-local-storage'\n });\n }\n\n if (storedObject && storedObject.throughput) {\n this.options_.throughput = storedObject.throughput;\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-throughput-from-local-storage'\n });\n }\n }\n } // if bandwidth was not set by options or pulled from local storage, start playlist\n // selection at a reasonable bandwidth\n\n\n if (typeof this.options_.bandwidth !== 'number') {\n this.options_.bandwidth = Config.INITIAL_BANDWIDTH;\n } // If the bandwidth number is unchanged from the initial setting\n // then this takes precedence over the enableLowInitialPlaylist option\n\n\n this.options_.enableLowInitialPlaylist = this.options_.enableLowInitialPlaylist && this.options_.bandwidth === Config.INITIAL_BANDWIDTH; // grab options passed to player.src\n\n ['withCredentials', 'limitRenditionByPlayerDimensions', 'bandwidth', 'smoothQualityChange'].forEach(function (option) {\n if (typeof _this2.source_[option] !== 'undefined') {\n _this2.options_[option] = _this2.source_[option];\n }\n });\n this.limitRenditionByPlayerDimensions = this.options_.limitRenditionByPlayerDimensions;\n }\n /**\n * called when player.src gets called, handle a new source\n *\n * @param {Object} src the source object to handle\n */\n\n }, {\n key: 'src',\n value: function src(_src, type) {\n var _this3 = this; // do nothing if the src is falsey\n\n\n if (!_src) {\n return;\n }\n\n this.setOptions_(); // add master playlist controller options\n\n this.options_.url = this.source_.src;\n this.options_.tech = this.tech_;\n this.options_.externHls = Hls$1;\n this.options_.sourceType = simpleTypeFromSourceType(type); // Whenever we seek internally, we should update both the tech and call our own\n // setCurrentTime function. This is needed because \"seeking\" events aren't always\n // reliable. External seeks (via the player object) are handled via middleware.\n\n this.options_.seekTo = function (time) {\n _this3.tech_.setCurrentTime(time);\n\n _this3.setCurrentTime(time);\n };\n\n this.masterPlaylistController_ = new MasterPlaylistController(this.options_);\n this.playbackWatcher_ = new PlaybackWatcher(videojs$1.mergeOptions(this.options_, {\n seekable: function seekable$$1() {\n return _this3.seekable();\n }\n }));\n this.masterPlaylistController_.on('error', function () {\n var player = videojs$1.players[_this3.tech_.options_.playerId];\n player.error(_this3.masterPlaylistController_.error);\n }); // `this` in selectPlaylist should be the HlsHandler for backwards\n // compatibility with < v2\n\n this.masterPlaylistController_.selectPlaylist = this.selectPlaylist ? this.selectPlaylist.bind(this) : Hls$1.STANDARD_PLAYLIST_SELECTOR.bind(this);\n this.masterPlaylistController_.selectInitialPlaylist = Hls$1.INITIAL_PLAYLIST_SELECTOR.bind(this); // re-expose some internal objects for backwards compatibility with < v2\n\n this.playlists = this.masterPlaylistController_.masterPlaylistLoader_;\n this.mediaSource = this.masterPlaylistController_.mediaSource; // Proxy assignment of some properties to the master playlist\n // controller. Using a custom property for backwards compatibility\n // with < v2\n\n Object.defineProperties(this, {\n selectPlaylist: {\n get: function get$$1() {\n return this.masterPlaylistController_.selectPlaylist;\n },\n set: function set$$1(selectPlaylist) {\n this.masterPlaylistController_.selectPlaylist = selectPlaylist.bind(this);\n }\n },\n throughput: {\n get: function get$$1() {\n return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate;\n },\n set: function set$$1(throughput) {\n this.masterPlaylistController_.mainSegmentLoader_.throughput.rate = throughput; // By setting `count` to 1 the throughput value becomes the starting value\n // for the cumulative average\n\n this.masterPlaylistController_.mainSegmentLoader_.throughput.count = 1;\n }\n },\n bandwidth: {\n get: function get$$1() {\n return this.masterPlaylistController_.mainSegmentLoader_.bandwidth;\n },\n set: function set$$1(bandwidth) {\n this.masterPlaylistController_.mainSegmentLoader_.bandwidth = bandwidth; // setting the bandwidth manually resets the throughput counter\n // `count` is set to zero that current value of `rate` isn't included\n // in the cumulative average\n\n this.masterPlaylistController_.mainSegmentLoader_.throughput = {\n rate: 0,\n count: 0\n };\n }\n },\n\n /**\n * `systemBandwidth` is a combination of two serial processes bit-rates. The first\n * is the network bitrate provided by `bandwidth` and the second is the bitrate of\n * the entire process after that - decryption, transmuxing, and appending - provided\n * by `throughput`.\n *\n * Since the two process are serial, the overall system bandwidth is given by:\n * sysBandwidth = 1 / (1 / bandwidth + 1 / throughput)\n */\n systemBandwidth: {\n get: function get$$1() {\n var invBandwidth = 1 / (this.bandwidth || 1);\n var invThroughput = void 0;\n\n if (this.throughput > 0) {\n invThroughput = 1 / this.throughput;\n } else {\n invThroughput = 0;\n }\n\n var systemBitrate = Math.floor(1 / (invBandwidth + invThroughput));\n return systemBitrate;\n },\n set: function set$$1() {\n videojs$1.log.error('The \"systemBandwidth\" property is read-only');\n }\n }\n });\n\n if (this.options_.bandwidth) {\n this.bandwidth = this.options_.bandwidth;\n }\n\n if (this.options_.throughput) {\n this.throughput = this.options_.throughput;\n }\n\n Object.defineProperties(this.stats, {\n bandwidth: {\n get: function get$$1() {\n return _this3.bandwidth || 0;\n },\n enumerable: true\n },\n mediaRequests: {\n get: function get$$1() {\n return _this3.masterPlaylistController_.mediaRequests_() || 0;\n },\n enumerable: true\n },\n mediaRequestsAborted: {\n get: function get$$1() {\n return _this3.masterPlaylistController_.mediaRequestsAborted_() || 0;\n },\n enumerable: true\n },\n mediaRequestsTimedout: {\n get: function get$$1() {\n return _this3.masterPlaylistController_.mediaRequestsTimedout_() || 0;\n },\n enumerable: true\n },\n mediaRequestsErrored: {\n get: function get$$1() {\n return _this3.masterPlaylistController_.mediaRequestsErrored_() || 0;\n },\n enumerable: true\n },\n mediaTransferDuration: {\n get: function get$$1() {\n return _this3.masterPlaylistController_.mediaTransferDuration_() || 0;\n },\n enumerable: true\n },\n mediaBytesTransferred: {\n get: function get$$1() {\n return _this3.masterPlaylistController_.mediaBytesTransferred_() || 0;\n },\n enumerable: true\n },\n mediaSecondsLoaded: {\n get: function get$$1() {\n return _this3.masterPlaylistController_.mediaSecondsLoaded_() || 0;\n },\n enumerable: true\n },\n buffered: {\n get: function get$$1() {\n return timeRangesToArray(_this3.tech_.buffered());\n },\n enumerable: true\n },\n currentTime: {\n get: function get$$1() {\n return _this3.tech_.currentTime();\n },\n enumerable: true\n },\n currentSource: {\n get: function get$$1() {\n return _this3.tech_.currentSource_;\n },\n enumerable: true\n },\n currentTech: {\n get: function get$$1() {\n return _this3.tech_.name_;\n },\n enumerable: true\n },\n duration: {\n get: function get$$1() {\n return _this3.tech_.duration();\n },\n enumerable: true\n },\n master: {\n get: function get$$1() {\n return _this3.playlists.master;\n },\n enumerable: true\n },\n playerDimensions: {\n get: function get$$1() {\n return _this3.tech_.currentDimensions();\n },\n enumerable: true\n },\n seekable: {\n get: function get$$1() {\n return timeRangesToArray(_this3.tech_.seekable());\n },\n enumerable: true\n },\n timestamp: {\n get: function get$$1() {\n return Date.now();\n },\n enumerable: true\n },\n videoPlaybackQuality: {\n get: function get$$1() {\n return _this3.tech_.getVideoPlaybackQuality();\n },\n enumerable: true\n }\n });\n this.tech_.one('canplay', this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_));\n this.tech_.on('bandwidthupdate', function () {\n if (_this3.options_.useBandwidthFromLocalStorage) {\n updateVhsLocalStorage({\n bandwidth: _this3.bandwidth,\n throughput: Math.round(_this3.throughput)\n });\n }\n });\n this.masterPlaylistController_.on('selectedinitialmedia', function () {\n // Add the manual rendition mix-in to HlsHandler\n renditionSelectionMixin(_this3);\n setupEmeOptions(_this3);\n }); // the bandwidth of the primary segment loader is our best\n // estimate of overall bandwidth\n\n this.on(this.masterPlaylistController_, 'progress', function () {\n this.tech_.trigger('progress');\n });\n this.tech_.ready(function () {\n return _this3.setupQualityLevels_();\n }); // do nothing if the tech has been disposed already\n // this can occur if someone sets the src in player.ready(), for instance\n\n if (!this.tech_.el()) {\n return;\n }\n\n this.tech_.src(videojs$1.URL.createObjectURL(this.masterPlaylistController_.mediaSource));\n }\n /**\n * Initializes the quality levels and sets listeners to update them.\n *\n * @method setupQualityLevels_\n * @private\n */\n\n }, {\n key: 'setupQualityLevels_',\n value: function setupQualityLevels_() {\n var _this4 = this;\n\n var player = videojs$1.players[this.tech_.options_.playerId];\n\n if (player && player.qualityLevels) {\n this.qualityLevels_ = player.qualityLevels();\n this.masterPlaylistController_.on('selectedinitialmedia', function () {\n handleHlsLoadedMetadata(_this4.qualityLevels_, _this4);\n });\n this.playlists.on('mediachange', function () {\n handleHlsMediaChange(_this4.qualityLevels_, _this4.playlists);\n });\n }\n }\n /**\n * Begin playing the video.\n */\n\n }, {\n key: 'play',\n value: function play() {\n this.masterPlaylistController_.play();\n }\n /**\n * a wrapper around the function in MasterPlaylistController\n */\n\n }, {\n key: 'setCurrentTime',\n value: function setCurrentTime(currentTime) {\n this.masterPlaylistController_.setCurrentTime(currentTime);\n }\n /**\n * a wrapper around the function in MasterPlaylistController\n */\n\n }, {\n key: 'duration',\n value: function duration$$1() {\n return this.masterPlaylistController_.duration();\n }\n /**\n * a wrapper around the function in MasterPlaylistController\n */\n\n }, {\n key: 'seekable',\n value: function seekable$$1() {\n return this.masterPlaylistController_.seekable();\n }\n /**\n * Abort all outstanding work and cleanup.\n */\n\n }, {\n key: 'dispose',\n value: function dispose() {\n if (this.playbackWatcher_) {\n this.playbackWatcher_.dispose();\n }\n\n if (this.masterPlaylistController_) {\n this.masterPlaylistController_.dispose();\n }\n\n if (this.qualityLevels_) {\n this.qualityLevels_.dispose();\n }\n\n if (this.player_) {\n delete this.player_.vhs;\n delete this.player_.dash;\n delete this.player_.hls;\n }\n\n if (this.tech_ && this.tech_.hls) {\n delete this.tech_.hls;\n }\n\n get$1(HlsHandler.prototype.__proto__ || Object.getPrototypeOf(HlsHandler.prototype), 'dispose', this).call(this);\n }\n }, {\n key: 'convertToStreamTime',\n value: function convertToStreamTime(time, callback) {\n return getStreamTime({\n playlist: this.masterPlaylistController_.media(),\n time: time,\n callback: callback\n });\n } // the player must be playing before calling this\n\n }, {\n key: 'seekToStreamTime',\n value: function seekToStreamTime$$1(streamTime, callback) {\n var pauseAfterSeek = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n var retryCount = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 2;\n return seekToStreamTime({\n streamTime: streamTime,\n playlist: this.masterPlaylistController_.media(),\n retryCount: retryCount,\n pauseAfterSeek: pauseAfterSeek,\n seekTo: this.options_.seekTo,\n tech: this.options_.tech,\n callback: callback\n });\n }\n }]);\n return HlsHandler;\n}(Component$1);\n/**\n * The Source Handler object, which informs video.js what additional\n * MIME types are supported and sets up playback. It is registered\n * automatically to the appropriate tech based on the capabilities of\n * the browser it is running in. It is not necessary to use or modify\n * this object in normal usage.\n */\n\n\nvar HlsSourceHandler = {\n name: 'videojs-http-streaming',\n VERSION: version$1,\n canHandleSource: function canHandleSource(srcObj) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var localOptions = videojs$1.mergeOptions(videojs$1.options, options);\n return HlsSourceHandler.canPlayType(srcObj.type, localOptions);\n },\n handleSource: function handleSource(source, tech) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var localOptions = videojs$1.mergeOptions(videojs$1.options, options);\n tech.hls = new HlsHandler(source, tech, localOptions);\n tech.hls.xhr = xhrFactory();\n tech.hls.src(source.src, source.type);\n return tech.hls;\n },\n canPlayType: function canPlayType(type) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var _videojs$mergeOptions = videojs$1.mergeOptions(videojs$1.options, options),\n overrideNative = _videojs$mergeOptions.hls.overrideNative;\n\n var supportedType = simpleTypeFromSourceType(type);\n var canUseMsePlayback = supportedType && (!Hls$1.supportsTypeNatively(supportedType) || overrideNative);\n return canUseMsePlayback ? 'maybe' : '';\n }\n};\n\nif (typeof videojs$1.MediaSource === 'undefined' || typeof videojs$1.URL === 'undefined') {\n videojs$1.MediaSource = MediaSource;\n videojs$1.URL = URL$1;\n} // register source handlers with the appropriate techs\n\n\nif (MediaSource.supportsNativeMediaSources()) {\n videojs$1.getTech('Html5').registerSourceHandler(HlsSourceHandler, 0);\n}\n\nvideojs$1.HlsHandler = HlsHandler;\nvideojs$1.HlsSourceHandler = HlsSourceHandler;\nvideojs$1.Hls = Hls$1;\n\nif (!videojs$1.use) {\n videojs$1.registerComponent('Hls', Hls$1);\n}\n\nvideojs$1.options.hls = videojs$1.options.hls || {};\n\nif (videojs$1.registerPlugin) {\n videojs$1.registerPlugin('reloadSourceOnError', reloadSourceOnError);\n} else {\n videojs$1.plugin('reloadSourceOnError', reloadSourceOnError);\n}\n\nexport default videojs$1;\n","/**\n * Copyright 2013 vtt.js Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Default exports for Node. Export the extended versions of VTTCue and\n// VTTRegion in Node since we likely want the capability to convert back and\n// forth between JSON. If we don't then it's not that big of a deal since we're\n// off browser.\n\nvar window = require('global/window');\n\nvar vttjs = module.exports = {\n WebVTT: require(\"./vtt.js\"),\n VTTCue: require(\"./vttcue.js\"),\n VTTRegion: require(\"./vttregion.js\")\n};\n\nwindow.vttjs = vttjs;\nwindow.WebVTT = vttjs.WebVTT;\n\nvar cueShim = vttjs.VTTCue;\nvar regionShim = vttjs.VTTRegion;\nvar nativeVTTCue = window.VTTCue;\nvar nativeVTTRegion = window.VTTRegion;\n\nvttjs.shim = function() {\n window.VTTCue = cueShim;\n window.VTTRegion = regionShim;\n};\n\nvttjs.restore = function() {\n window.VTTCue = nativeVTTCue;\n window.VTTRegion = nativeVTTRegion;\n};\n\nif (!window.VTTCue) {\n vttjs.shim();\n}\n","/**\n * Copyright 2013 vtt.js Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */\nvar _objCreate = Object.create || (function() {\n function F() {}\n return function(o) {\n if (arguments.length !== 1) {\n throw new Error('Object.create shim only accepts one parameter.');\n }\n F.prototype = o;\n return new F();\n };\n})();\n\n// Creates a new ParserError object from an errorData object. The errorData\n// object should have default code and message properties. The default message\n// property can be overriden by passing in a message parameter.\n// See ParsingError.Errors below for acceptable errors.\nfunction ParsingError(errorData, message) {\n this.name = \"ParsingError\";\n this.code = errorData.code;\n this.message = message || errorData.message;\n}\nParsingError.prototype = _objCreate(Error.prototype);\nParsingError.prototype.constructor = ParsingError;\n\n// ParsingError metadata for acceptable ParsingErrors.\nParsingError.Errors = {\n BadSignature: {\n code: 0,\n message: \"Malformed WebVTT signature.\"\n },\n BadTimeStamp: {\n code: 1,\n message: \"Malformed time stamp.\"\n }\n};\n\n// Try to parse input as a time stamp.\nfunction parseTimeStamp(input) {\n\n function computeSeconds(h, m, s, f) {\n return (h | 0) * 3600 + (m | 0) * 60 + (s | 0) + (f | 0) / 1000;\n }\n\n var m = input.match(/^(\\d+):(\\d{2})(:\\d{2})?\\.(\\d{3})/);\n if (!m) {\n return null;\n }\n\n if (m[3]) {\n // Timestamp takes the form of [hours]:[minutes]:[seconds].[milliseconds]\n return computeSeconds(m[1], m[2], m[3].replace(\":\", \"\"), m[4]);\n } else if (m[1] > 59) {\n // Timestamp takes the form of [hours]:[minutes].[milliseconds]\n // First position is hours as it's over 59.\n return computeSeconds(m[1], m[2], 0, m[4]);\n } else {\n // Timestamp takes the form of [minutes]:[seconds].[milliseconds]\n return computeSeconds(0, m[1], m[2], m[4]);\n }\n}\n\n// A settings object holds key/value pairs and will ignore anything but the first\n// assignment to a specific key.\nfunction Settings() {\n this.values = _objCreate(null);\n}\n\nSettings.prototype = {\n // Only accept the first assignment to any key.\n set: function(k, v) {\n if (!this.get(k) && v !== \"\") {\n this.values[k] = v;\n }\n },\n // Return the value for a key, or a default value.\n // If 'defaultKey' is passed then 'dflt' is assumed to be an object with\n // a number of possible default values as properties where 'defaultKey' is\n // the key of the property that will be chosen; otherwise it's assumed to be\n // a single value.\n get: function(k, dflt, defaultKey) {\n if (defaultKey) {\n return this.has(k) ? this.values[k] : dflt[defaultKey];\n }\n return this.has(k) ? this.values[k] : dflt;\n },\n // Check whether we have a value for a key.\n has: function(k) {\n return k in this.values;\n },\n // Accept a setting if its one of the given alternatives.\n alt: function(k, v, a) {\n for (var n = 0; n < a.length; ++n) {\n if (v === a[n]) {\n this.set(k, v);\n break;\n }\n }\n },\n // Accept a setting if its a valid (signed) integer.\n integer: function(k, v) {\n if (/^-?\\d+$/.test(v)) { // integer\n this.set(k, parseInt(v, 10));\n }\n },\n // Accept a setting if its a valid percentage.\n percent: function(k, v) {\n var m;\n if ((m = v.match(/^([\\d]{1,3})(\\.[\\d]*)?%$/))) {\n v = parseFloat(v);\n if (v >= 0 && v <= 100) {\n this.set(k, v);\n return true;\n }\n }\n return false;\n }\n};\n\n// Helper function to parse input into groups separated by 'groupDelim', and\n// interprete each group as a key/value pair separated by 'keyValueDelim'.\nfunction parseOptions(input, callback, keyValueDelim, groupDelim) {\n var groups = groupDelim ? input.split(groupDelim) : [input];\n for (var i in groups) {\n if (typeof groups[i] !== \"string\") {\n continue;\n }\n var kv = groups[i].split(keyValueDelim);\n if (kv.length !== 2) {\n continue;\n }\n var k = kv[0];\n var v = kv[1];\n callback(k, v);\n }\n}\n\nfunction parseCue(input, cue, regionList) {\n // Remember the original input if we need to throw an error.\n var oInput = input;\n // 4.1 WebVTT timestamp\n function consumeTimeStamp() {\n var ts = parseTimeStamp(input);\n if (ts === null) {\n throw new ParsingError(ParsingError.Errors.BadTimeStamp,\n \"Malformed timestamp: \" + oInput);\n }\n // Remove time stamp from input.\n input = input.replace(/^[^\\sa-zA-Z-]+/, \"\");\n return ts;\n }\n\n // 4.4.2 WebVTT cue settings\n function consumeCueSettings(input, cue) {\n var settings = new Settings();\n\n parseOptions(input, function (k, v) {\n switch (k) {\n case \"region\":\n // Find the last region we parsed with the same region id.\n for (var i = regionList.length - 1; i >= 0; i--) {\n if (regionList[i].id === v) {\n settings.set(k, regionList[i].region);\n break;\n }\n }\n break;\n case \"vertical\":\n settings.alt(k, v, [\"rl\", \"lr\"]);\n break;\n case \"line\":\n var vals = v.split(\",\"),\n vals0 = vals[0];\n settings.integer(k, vals0);\n settings.percent(k, vals0) ? settings.set(\"snapToLines\", false) : null;\n settings.alt(k, vals0, [\"auto\"]);\n if (vals.length === 2) {\n settings.alt(\"lineAlign\", vals[1], [\"start\", \"middle\", \"end\"]);\n }\n break;\n case \"position\":\n vals = v.split(\",\");\n settings.percent(k, vals[0]);\n if (vals.length === 2) {\n settings.alt(\"positionAlign\", vals[1], [\"start\", \"middle\", \"end\"]);\n }\n break;\n case \"size\":\n settings.percent(k, v);\n break;\n case \"align\":\n settings.alt(k, v, [\"start\", \"middle\", \"end\", \"left\", \"right\"]);\n break;\n }\n }, /:/, /\\s/);\n\n // Apply default values for any missing fields.\n cue.region = settings.get(\"region\", null);\n cue.vertical = settings.get(\"vertical\", \"\");\n cue.line = settings.get(\"line\", \"auto\");\n cue.lineAlign = settings.get(\"lineAlign\", \"start\");\n cue.snapToLines = settings.get(\"snapToLines\", true);\n cue.size = settings.get(\"size\", 100);\n cue.align = settings.get(\"align\", \"middle\");\n cue.position = settings.get(\"position\", {\n start: 0,\n left: 0,\n middle: 50,\n end: 100,\n right: 100\n }, cue.align);\n cue.positionAlign = settings.get(\"positionAlign\", {\n start: \"start\",\n left: \"start\",\n middle: \"middle\",\n end: \"end\",\n right: \"end\"\n }, cue.align);\n }\n\n function skipWhitespace() {\n input = input.replace(/^\\s+/, \"\");\n }\n\n // 4.1 WebVTT cue timings.\n skipWhitespace();\n cue.startTime = consumeTimeStamp(); // (1) collect cue start time\n skipWhitespace();\n if (input.substr(0, 3) !== \"-->\") { // (3) next characters must match \"-->\"\n throw new ParsingError(ParsingError.Errors.BadTimeStamp,\n \"Malformed time stamp (time stamps must be separated by '-->'): \" +\n oInput);\n }\n input = input.substr(3);\n skipWhitespace();\n cue.endTime = consumeTimeStamp(); // (5) collect cue end time\n\n // 4.1 WebVTT cue settings list.\n skipWhitespace();\n consumeCueSettings(input, cue);\n}\n\nvar ESCAPE = {\n \"&amp;\": \"&\",\n \"&lt;\": \"<\",\n \"&gt;\": \">\",\n \"&lrm;\": \"\\u200e\",\n \"&rlm;\": \"\\u200f\",\n \"&nbsp;\": \"\\u00a0\"\n};\n\nvar TAG_NAME = {\n c: \"span\",\n i: \"i\",\n b: \"b\",\n u: \"u\",\n ruby: \"ruby\",\n rt: \"rt\",\n v: \"span\",\n lang: \"span\"\n};\n\nvar TAG_ANNOTATION = {\n v: \"title\",\n lang: \"lang\"\n};\n\nvar NEEDS_PARENT = {\n rt: \"ruby\"\n};\n\n// Parse content into a document fragment.\nfunction parseContent(window, input) {\n function nextToken() {\n // Check for end-of-string.\n if (!input) {\n return null;\n }\n\n // Consume 'n' characters from the input.\n function consume(result) {\n input = input.substr(result.length);\n return result;\n }\n\n var m = input.match(/^([^<]*)(<[^>]*>?)?/);\n // If there is some text before the next tag, return it, otherwise return\n // the tag.\n return consume(m[1] ? m[1] : m[2]);\n }\n\n // Unescape a string 's'.\n function unescape1(e) {\n return ESCAPE[e];\n }\n function unescape(s) {\n while ((m = s.match(/&(amp|lt|gt|lrm|rlm|nbsp);/))) {\n s = s.replace(m[0], unescape1);\n }\n return s;\n }\n\n function shouldAdd(current, element) {\n return !NEEDS_PARENT[element.localName] ||\n NEEDS_PARENT[element.localName] === current.localName;\n }\n\n // Create an element for this tag.\n function createElement(type, annotation) {\n var tagName = TAG_NAME[type];\n if (!tagName) {\n return null;\n }\n var element = window.document.createElement(tagName);\n element.localName = tagName;\n var name = TAG_ANNOTATION[type];\n if (name && annotation) {\n element[name] = annotation.trim();\n }\n return element;\n }\n\n var rootDiv = window.document.createElement(\"div\"),\n current = rootDiv,\n t,\n tagStack = [];\n\n while ((t = nextToken()) !== null) {\n if (t[0] === '<') {\n if (t[1] === \"/\") {\n // If the closing tag matches, move back up to the parent node.\n if (tagStack.length &&\n tagStack[tagStack.length - 1] === t.substr(2).replace(\">\", \"\")) {\n tagStack.pop();\n current = current.parentNode;\n }\n // Otherwise just ignore the end tag.\n continue;\n }\n var ts = parseTimeStamp(t.substr(1, t.length - 2));\n var node;\n if (ts) {\n // Timestamps are lead nodes as well.\n node = window.document.createProcessingInstruction(\"timestamp\", ts);\n current.appendChild(node);\n continue;\n }\n var m = t.match(/^<([^.\\s/0-9>]+)(\\.[^\\s\\\\>]+)?([^>\\\\]+)?(\\\\?)>?$/);\n // If we can't parse the tag, skip to the next tag.\n if (!m) {\n continue;\n }\n // Try to construct an element, and ignore the tag if we couldn't.\n node = createElement(m[1], m[3]);\n if (!node) {\n continue;\n }\n // Determine if the tag should be added based on the context of where it\n // is placed in the cuetext.\n if (!shouldAdd(current, node)) {\n continue;\n }\n // Set the class list (as a list of classes, separated by space).\n if (m[2]) {\n node.className = m[2].substr(1).replace('.', ' ');\n }\n // Append the node to the current node, and enter the scope of the new\n // node.\n tagStack.push(m[1]);\n current.appendChild(node);\n current = node;\n continue;\n }\n\n // Text nodes are leaf nodes.\n current.appendChild(window.document.createTextNode(unescape(t)));\n }\n\n return rootDiv;\n}\n\n// This is a list of all the Unicode characters that have a strong\n// right-to-left category. What this means is that these characters are\n// written right-to-left for sure. It was generated by pulling all the strong\n// right-to-left characters out of the Unicode data table. That table can\n// found at: http://www.unicode.org/Public/UNIDATA/UnicodeData.txt\nvar strongRTLRanges = [[0x5be, 0x5be], [0x5c0, 0x5c0], [0x5c3, 0x5c3], [0x5c6, 0x5c6],\n [0x5d0, 0x5ea], [0x5f0, 0x5f4], [0x608, 0x608], [0x60b, 0x60b], [0x60d, 0x60d],\n [0x61b, 0x61b], [0x61e, 0x64a], [0x66d, 0x66f], [0x671, 0x6d5], [0x6e5, 0x6e6],\n [0x6ee, 0x6ef], [0x6fa, 0x70d], [0x70f, 0x710], [0x712, 0x72f], [0x74d, 0x7a5],\n [0x7b1, 0x7b1], [0x7c0, 0x7ea], [0x7f4, 0x7f5], [0x7fa, 0x7fa], [0x800, 0x815],\n [0x81a, 0x81a], [0x824, 0x824], [0x828, 0x828], [0x830, 0x83e], [0x840, 0x858],\n [0x85e, 0x85e], [0x8a0, 0x8a0], [0x8a2, 0x8ac], [0x200f, 0x200f],\n [0xfb1d, 0xfb1d], [0xfb1f, 0xfb28], [0xfb2a, 0xfb36], [0xfb38, 0xfb3c],\n [0xfb3e, 0xfb3e], [0xfb40, 0xfb41], [0xfb43, 0xfb44], [0xfb46, 0xfbc1],\n [0xfbd3, 0xfd3d], [0xfd50, 0xfd8f], [0xfd92, 0xfdc7], [0xfdf0, 0xfdfc],\n [0xfe70, 0xfe74], [0xfe76, 0xfefc], [0x10800, 0x10805], [0x10808, 0x10808],\n [0x1080a, 0x10835], [0x10837, 0x10838], [0x1083c, 0x1083c], [0x1083f, 0x10855],\n [0x10857, 0x1085f], [0x10900, 0x1091b], [0x10920, 0x10939], [0x1093f, 0x1093f],\n [0x10980, 0x109b7], [0x109be, 0x109bf], [0x10a00, 0x10a00], [0x10a10, 0x10a13],\n [0x10a15, 0x10a17], [0x10a19, 0x10a33], [0x10a40, 0x10a47], [0x10a50, 0x10a58],\n [0x10a60, 0x10a7f], [0x10b00, 0x10b35], [0x10b40, 0x10b55], [0x10b58, 0x10b72],\n [0x10b78, 0x10b7f], [0x10c00, 0x10c48], [0x1ee00, 0x1ee03], [0x1ee05, 0x1ee1f],\n [0x1ee21, 0x1ee22], [0x1ee24, 0x1ee24], [0x1ee27, 0x1ee27], [0x1ee29, 0x1ee32],\n [0x1ee34, 0x1ee37], [0x1ee39, 0x1ee39], [0x1ee3b, 0x1ee3b], [0x1ee42, 0x1ee42],\n [0x1ee47, 0x1ee47], [0x1ee49, 0x1ee49], [0x1ee4b, 0x1ee4b], [0x1ee4d, 0x1ee4f],\n [0x1ee51, 0x1ee52], [0x1ee54, 0x1ee54], [0x1ee57, 0x1ee57], [0x1ee59, 0x1ee59],\n [0x1ee5b, 0x1ee5b], [0x1ee5d, 0x1ee5d], [0x1ee5f, 0x1ee5f], [0x1ee61, 0x1ee62],\n [0x1ee64, 0x1ee64], [0x1ee67, 0x1ee6a], [0x1ee6c, 0x1ee72], [0x1ee74, 0x1ee77],\n [0x1ee79, 0x1ee7c], [0x1ee7e, 0x1ee7e], [0x1ee80, 0x1ee89], [0x1ee8b, 0x1ee9b],\n [0x1eea1, 0x1eea3], [0x1eea5, 0x1eea9], [0x1eeab, 0x1eebb], [0x10fffd, 0x10fffd]];\n\nfunction isStrongRTLChar(charCode) {\n for (var i = 0; i < strongRTLRanges.length; i++) {\n var currentRange = strongRTLRanges[i];\n if (charCode >= currentRange[0] && charCode <= currentRange[1]) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction determineBidi(cueDiv) {\n var nodeStack = [],\n text = \"\",\n charCode;\n\n if (!cueDiv || !cueDiv.childNodes) {\n return \"ltr\";\n }\n\n function pushNodes(nodeStack, node) {\n for (var i = node.childNodes.length - 1; i >= 0; i--) {\n nodeStack.push(node.childNodes[i]);\n }\n }\n\n function nextTextNode(nodeStack) {\n if (!nodeStack || !nodeStack.length) {\n return null;\n }\n\n var node = nodeStack.pop(),\n text = node.textContent || node.innerText;\n if (text) {\n // TODO: This should match all unicode type B characters (paragraph\n // separator characters). See issue #115.\n var m = text.match(/^.*(\\n|\\r)/);\n if (m) {\n nodeStack.length = 0;\n return m[0];\n }\n return text;\n }\n if (node.tagName === \"ruby\") {\n return nextTextNode(nodeStack);\n }\n if (node.childNodes) {\n pushNodes(nodeStack, node);\n return nextTextNode(nodeStack);\n }\n }\n\n pushNodes(nodeStack, cueDiv);\n while ((text = nextTextNode(nodeStack))) {\n for (var i = 0; i < text.length; i++) {\n charCode = text.charCodeAt(i);\n if (isStrongRTLChar(charCode)) {\n return \"rtl\";\n }\n }\n }\n return \"ltr\";\n}\n\nfunction computeLinePos(cue) {\n if (typeof cue.line === \"number\" &&\n (cue.snapToLines || (cue.line >= 0 && cue.line <= 100))) {\n return cue.line;\n }\n if (!cue.track || !cue.track.textTrackList ||\n !cue.track.textTrackList.mediaElement) {\n return -1;\n }\n var track = cue.track,\n trackList = track.textTrackList,\n count = 0;\n for (var i = 0; i < trackList.length && trackList[i] !== track; i++) {\n if (trackList[i].mode === \"showing\") {\n count++;\n }\n }\n return ++count * -1;\n}\n\nfunction StyleBox() {\n}\n\n// Apply styles to a div. If there is no div passed then it defaults to the\n// div on 'this'.\nStyleBox.prototype.applyStyles = function(styles, div) {\n div = div || this.div;\n for (var prop in styles) {\n if (styles.hasOwnProperty(prop)) {\n div.style[prop] = styles[prop];\n }\n }\n};\n\nStyleBox.prototype.formatStyle = function(val, unit) {\n return val === 0 ? 0 : val + unit;\n};\n\n// Constructs the computed display state of the cue (a div). Places the div\n// into the overlay which should be a block level element (usually a div).\nfunction CueStyleBox(window, cue, styleOptions) {\n StyleBox.call(this);\n this.cue = cue;\n\n // Parse our cue's text into a DOM tree rooted at 'cueDiv'. This div will\n // have inline positioning and will function as the cue background box.\n this.cueDiv = parseContent(window, cue.text);\n var styles = {\n color: \"rgba(255, 255, 255, 1)\",\n backgroundColor: \"rgba(0, 0, 0, 0.8)\",\n position: \"relative\",\n left: 0,\n right: 0,\n top: 0,\n bottom: 0,\n display: \"inline\",\n writingMode: cue.vertical === \"\" ? \"horizontal-tb\"\n : cue.vertical === \"lr\" ? \"vertical-lr\"\n : \"vertical-rl\",\n unicodeBidi: \"plaintext\"\n };\n\n this.applyStyles(styles, this.cueDiv);\n\n // Create an absolutely positioned div that will be used to position the cue\n // div. Note, all WebVTT cue-setting alignments are equivalent to the CSS\n // mirrors of them except \"middle\" which is \"center\" in CSS.\n this.div = window.document.createElement(\"div\");\n styles = {\n direction: determineBidi(this.cueDiv),\n writingMode: cue.vertical === \"\" ? \"horizontal-tb\"\n : cue.vertical === \"lr\" ? \"vertical-lr\"\n : \"vertical-rl\",\n unicodeBidi: \"plaintext\",\n textAlign: cue.align === \"middle\" ? \"center\" : cue.align,\n font: styleOptions.font,\n whiteSpace: \"pre-line\",\n position: \"absolute\"\n };\n\n this.applyStyles(styles);\n this.div.appendChild(this.cueDiv);\n\n // Calculate the distance from the reference edge of the viewport to the text\n // position of the cue box. The reference edge will be resolved later when\n // the box orientation styles are applied.\n var textPos = 0;\n switch (cue.positionAlign) {\n case \"start\":\n textPos = cue.position;\n break;\n case \"middle\":\n textPos = cue.position - (cue.size / 2);\n break;\n case \"end\":\n textPos = cue.position - cue.size;\n break;\n }\n\n // Horizontal box orientation; textPos is the distance from the left edge of the\n // area to the left edge of the box and cue.size is the distance extending to\n // the right from there.\n if (cue.vertical === \"\") {\n this.applyStyles({\n left: this.formatStyle(textPos, \"%\"),\n width: this.formatStyle(cue.size, \"%\")\n });\n // Vertical box orientation; textPos is the distance from the top edge of the\n // area to the top edge of the box and cue.size is the height extending\n // downwards from there.\n } else {\n this.applyStyles({\n top: this.formatStyle(textPos, \"%\"),\n height: this.formatStyle(cue.size, \"%\")\n });\n }\n\n this.move = function(box) {\n this.applyStyles({\n top: this.formatStyle(box.top, \"px\"),\n bottom: this.formatStyle(box.bottom, \"px\"),\n left: this.formatStyle(box.left, \"px\"),\n right: this.formatStyle(box.right, \"px\"),\n height: this.formatStyle(box.height, \"px\"),\n width: this.formatStyle(box.width, \"px\")\n });\n };\n}\nCueStyleBox.prototype = _objCreate(StyleBox.prototype);\nCueStyleBox.prototype.constructor = CueStyleBox;\n\n// Represents the co-ordinates of an Element in a way that we can easily\n// compute things with such as if it overlaps or intersects with another Element.\n// Can initialize it with either a StyleBox or another BoxPosition.\nfunction BoxPosition(obj) {\n // Either a BoxPosition was passed in and we need to copy it, or a StyleBox\n // was passed in and we need to copy the results of 'getBoundingClientRect'\n // as the object returned is readonly. All co-ordinate values are in reference\n // to the viewport origin (top left).\n var lh, height, width, top;\n if (obj.div) {\n height = obj.div.offsetHeight;\n width = obj.div.offsetWidth;\n top = obj.div.offsetTop;\n\n var rects = (rects = obj.div.childNodes) && (rects = rects[0]) &&\n rects.getClientRects && rects.getClientRects();\n obj = obj.div.getBoundingClientRect();\n // In certain cases the outter div will be slightly larger then the sum of\n // the inner div's lines. This could be due to bold text, etc, on some platforms.\n // In this case we should get the average line height and use that. This will\n // result in the desired behaviour.\n lh = rects ? Math.max((rects[0] && rects[0].height) || 0, obj.height / rects.length)\n : 0;\n\n }\n this.left = obj.left;\n this.right = obj.right;\n this.top = obj.top || top;\n this.height = obj.height || height;\n this.bottom = obj.bottom || (top + (obj.height || height));\n this.width = obj.width || width;\n this.lineHeight = lh !== undefined ? lh : obj.lineHeight;\n}\n\n// Move the box along a particular axis. Optionally pass in an amount to move\n// the box. If no amount is passed then the default is the line height of the\n// box.\nBoxPosition.prototype.move = function(axis, toMove) {\n toMove = toMove !== undefined ? toMove : this.lineHeight;\n switch (axis) {\n case \"+x\":\n this.left += toMove;\n this.right += toMove;\n break;\n case \"-x\":\n this.left -= toMove;\n this.right -= toMove;\n break;\n case \"+y\":\n this.top += toMove;\n this.bottom += toMove;\n break;\n case \"-y\":\n this.top -= toMove;\n this.bottom -= toMove;\n break;\n }\n};\n\n// Check if this box overlaps another box, b2.\nBoxPosition.prototype.overlaps = function(b2) {\n return this.left < b2.right &&\n this.right > b2.left &&\n this.top < b2.bottom &&\n this.bottom > b2.top;\n};\n\n// Check if this box overlaps any other boxes in boxes.\nBoxPosition.prototype.overlapsAny = function(boxes) {\n for (var i = 0; i < boxes.length; i++) {\n if (this.overlaps(boxes[i])) {\n return true;\n }\n }\n return false;\n};\n\n// Check if this box is within another box.\nBoxPosition.prototype.within = function(container) {\n return this.top >= container.top &&\n this.bottom <= container.bottom &&\n this.left >= container.left &&\n this.right <= container.right;\n};\n\n// Check if this box is entirely within the container or it is overlapping\n// on the edge opposite of the axis direction passed. For example, if \"+x\" is\n// passed and the box is overlapping on the left edge of the container, then\n// return true.\nBoxPosition.prototype.overlapsOppositeAxis = function(container, axis) {\n switch (axis) {\n case \"+x\":\n return this.left < container.left;\n case \"-x\":\n return this.right > container.right;\n case \"+y\":\n return this.top < container.top;\n case \"-y\":\n return this.bottom > container.bottom;\n }\n};\n\n// Find the percentage of the area that this box is overlapping with another\n// box.\nBoxPosition.prototype.intersectPercentage = function(b2) {\n var x = Math.max(0, Math.min(this.right, b2.right) - Math.max(this.left, b2.left)),\n y = Math.max(0, Math.min(this.bottom, b2.bottom) - Math.max(this.top, b2.top)),\n intersectArea = x * y;\n return intersectArea / (this.height * this.width);\n};\n\n// Convert the positions from this box to CSS compatible positions using\n// the reference container's positions. This has to be done because this\n// box's positions are in reference to the viewport origin, whereas, CSS\n// values are in referecne to their respective edges.\nBoxPosition.prototype.toCSSCompatValues = function(reference) {\n return {\n top: this.top - reference.top,\n bottom: reference.bottom - this.bottom,\n left: this.left - reference.left,\n right: reference.right - this.right,\n height: this.height,\n width: this.width\n };\n};\n\n// Get an object that represents the box's position without anything extra.\n// Can pass a StyleBox, HTMLElement, or another BoxPositon.\nBoxPosition.getSimpleBoxPosition = function(obj) {\n var height = obj.div ? obj.div.offsetHeight : obj.tagName ? obj.offsetHeight : 0;\n var width = obj.div ? obj.div.offsetWidth : obj.tagName ? obj.offsetWidth : 0;\n var top = obj.div ? obj.div.offsetTop : obj.tagName ? obj.offsetTop : 0;\n\n obj = obj.div ? obj.div.getBoundingClientRect() :\n obj.tagName ? obj.getBoundingClientRect() : obj;\n var ret = {\n left: obj.left,\n right: obj.right,\n top: obj.top || top,\n height: obj.height || height,\n bottom: obj.bottom || (top + (obj.height || height)),\n width: obj.width || width\n };\n return ret;\n};\n\n// Move a StyleBox to its specified, or next best, position. The containerBox\n// is the box that contains the StyleBox, such as a div. boxPositions are\n// a list of other boxes that the styleBox can't overlap with.\nfunction moveBoxToLinePosition(window, styleBox, containerBox, boxPositions) {\n\n // Find the best position for a cue box, b, on the video. The axis parameter\n // is a list of axis, the order of which, it will move the box along. For example:\n // Passing [\"+x\", \"-x\"] will move the box first along the x axis in the positive\n // direction. If it doesn't find a good position for it there it will then move\n // it along the x axis in the negative direction.\n function findBestPosition(b, axis) {\n var bestPosition,\n specifiedPosition = new BoxPosition(b),\n percentage = 1; // Highest possible so the first thing we get is better.\n\n for (var i = 0; i < axis.length; i++) {\n while (b.overlapsOppositeAxis(containerBox, axis[i]) ||\n (b.within(containerBox) && b.overlapsAny(boxPositions))) {\n b.move(axis[i]);\n }\n // We found a spot where we aren't overlapping anything. This is our\n // best position.\n if (b.within(containerBox)) {\n return b;\n }\n var p = b.intersectPercentage(containerBox);\n // If we're outside the container box less then we were on our last try\n // then remember this position as the best position.\n if (percentage > p) {\n bestPosition = new BoxPosition(b);\n percentage = p;\n }\n // Reset the box position to the specified position.\n b = new BoxPosition(specifiedPosition);\n }\n return bestPosition || specifiedPosition;\n }\n\n var boxPosition = new BoxPosition(styleBox),\n cue = styleBox.cue,\n linePos = computeLinePos(cue),\n axis = [];\n\n // If we have a line number to align the cue to.\n if (cue.snapToLines) {\n var size;\n switch (cue.vertical) {\n case \"\":\n axis = [ \"+y\", \"-y\" ];\n size = \"height\";\n break;\n case \"rl\":\n axis = [ \"+x\", \"-x\" ];\n size = \"width\";\n break;\n case \"lr\":\n axis = [ \"-x\", \"+x\" ];\n size = \"width\";\n break;\n }\n\n var step = boxPosition.lineHeight,\n position = step * Math.round(linePos),\n maxPosition = containerBox[size] + step,\n initialAxis = axis[0];\n\n // If the specified intial position is greater then the max position then\n // clamp the box to the amount of steps it would take for the box to\n // reach the max position.\n if (Math.abs(position) > maxPosition) {\n position = position < 0 ? -1 : 1;\n position *= Math.ceil(maxPosition / step) * step;\n }\n\n // If computed line position returns negative then line numbers are\n // relative to the bottom of the video instead of the top. Therefore, we\n // need to increase our initial position by the length or width of the\n // video, depending on the writing direction, and reverse our axis directions.\n if (linePos < 0) {\n position += cue.vertical === \"\" ? containerBox.height : containerBox.width;\n axis = axis.reverse();\n }\n\n // Move the box to the specified position. This may not be its best\n // position.\n boxPosition.move(initialAxis, position);\n\n } else {\n // If we have a percentage line value for the cue.\n var calculatedPercentage = (boxPosition.lineHeight / containerBox.height) * 100;\n\n switch (cue.lineAlign) {\n case \"middle\":\n linePos -= (calculatedPercentage / 2);\n break;\n case \"end\":\n linePos -= calculatedPercentage;\n break;\n }\n\n // Apply initial line position to the cue box.\n switch (cue.vertical) {\n case \"\":\n styleBox.applyStyles({\n top: styleBox.formatStyle(linePos, \"%\")\n });\n break;\n case \"rl\":\n styleBox.applyStyles({\n left: styleBox.formatStyle(linePos, \"%\")\n });\n break;\n case \"lr\":\n styleBox.applyStyles({\n right: styleBox.formatStyle(linePos, \"%\")\n });\n break;\n }\n\n axis = [ \"+y\", \"-x\", \"+x\", \"-y\" ];\n\n // Get the box position again after we've applied the specified positioning\n // to it.\n boxPosition = new BoxPosition(styleBox);\n }\n\n var bestPosition = findBestPosition(boxPosition, axis);\n styleBox.move(bestPosition.toCSSCompatValues(containerBox));\n}\n\nfunction WebVTT() {\n // Nothing\n}\n\n// Helper to allow strings to be decoded instead of the default binary utf8 data.\nWebVTT.StringDecoder = function() {\n return {\n decode: function(data) {\n if (!data) {\n return \"\";\n }\n if (typeof data !== \"string\") {\n throw new Error(\"Error - expected string data.\");\n }\n return decodeURIComponent(encodeURIComponent(data));\n }\n };\n};\n\nWebVTT.convertCueToDOMTree = function(window, cuetext) {\n if (!window || !cuetext) {\n return null;\n }\n return parseContent(window, cuetext);\n};\n\nvar FONT_SIZE_PERCENT = 0.05;\nvar FONT_STYLE = \"sans-serif\";\nvar CUE_BACKGROUND_PADDING = \"1.5%\";\n\n// Runs the processing model over the cues and regions passed to it.\n// @param overlay A block level element (usually a div) that the computed cues\n// and regions will be placed into.\nWebVTT.processCues = function(window, cues, overlay) {\n if (!window || !cues || !overlay) {\n return null;\n }\n\n // Remove all previous children.\n while (overlay.firstChild) {\n overlay.removeChild(overlay.firstChild);\n }\n\n var paddedOverlay = window.document.createElement(\"div\");\n paddedOverlay.style.position = \"absolute\";\n paddedOverlay.style.left = \"0\";\n paddedOverlay.style.right = \"0\";\n paddedOverlay.style.top = \"0\";\n paddedOverlay.style.bottom = \"0\";\n paddedOverlay.style.margin = CUE_BACKGROUND_PADDING;\n overlay.appendChild(paddedOverlay);\n\n // Determine if we need to compute the display states of the cues. This could\n // be the case if a cue's state has been changed since the last computation or\n // if it has not been computed yet.\n function shouldCompute(cues) {\n for (var i = 0; i < cues.length; i++) {\n if (cues[i].hasBeenReset || !cues[i].displayState) {\n return true;\n }\n }\n return false;\n }\n\n // We don't need to recompute the cues' display states. Just reuse them.\n if (!shouldCompute(cues)) {\n for (var i = 0; i < cues.length; i++) {\n paddedOverlay.appendChild(cues[i].displayState);\n }\n return;\n }\n\n var boxPositions = [],\n containerBox = BoxPosition.getSimpleBoxPosition(paddedOverlay),\n fontSize = Math.round(containerBox.height * FONT_SIZE_PERCENT * 100) / 100;\n var styleOptions = {\n font: fontSize + \"px \" + FONT_STYLE\n };\n\n (function() {\n var styleBox, cue;\n\n for (var i = 0; i < cues.length; i++) {\n cue = cues[i];\n\n // Compute the intial position and styles of the cue div.\n styleBox = new CueStyleBox(window, cue, styleOptions);\n paddedOverlay.appendChild(styleBox.div);\n\n // Move the cue div to it's correct line position.\n moveBoxToLinePosition(window, styleBox, containerBox, boxPositions);\n\n // Remember the computed div so that we don't have to recompute it later\n // if we don't have too.\n cue.displayState = styleBox.div;\n\n boxPositions.push(BoxPosition.getSimpleBoxPosition(styleBox));\n }\n })();\n};\n\nWebVTT.Parser = function(window, vttjs, decoder) {\n if (!decoder) {\n decoder = vttjs;\n vttjs = {};\n }\n if (!vttjs) {\n vttjs = {};\n }\n\n this.window = window;\n this.vttjs = vttjs;\n this.state = \"INITIAL\";\n this.buffer = \"\";\n this.decoder = decoder || new TextDecoder(\"utf8\");\n this.regionList = [];\n};\n\nWebVTT.Parser.prototype = {\n // If the error is a ParsingError then report it to the consumer if\n // possible. If it's not a ParsingError then throw it like normal.\n reportOrThrowError: function(e) {\n if (e instanceof ParsingError) {\n this.onparsingerror && this.onparsingerror(e);\n } else {\n throw e;\n }\n },\n parse: function (data) {\n var self = this;\n\n // If there is no data then we won't decode it, but will just try to parse\n // whatever is in buffer already. This may occur in circumstances, for\n // example when flush() is called.\n if (data) {\n // Try to decode the data that we received.\n self.buffer += self.decoder.decode(data, {stream: true});\n }\n\n function collectNextLine() {\n var buffer = self.buffer;\n var pos = 0;\n while (pos < buffer.length && buffer[pos] !== '\\r' && buffer[pos] !== '\\n') {\n ++pos;\n }\n var line = buffer.substr(0, pos);\n // Advance the buffer early in case we fail below.\n if (buffer[pos] === '\\r') {\n ++pos;\n }\n if (buffer[pos] === '\\n') {\n ++pos;\n }\n self.buffer = buffer.substr(pos);\n return line;\n }\n\n // 3.4 WebVTT region and WebVTT region settings syntax\n function parseRegion(input) {\n var settings = new Settings();\n\n parseOptions(input, function (k, v) {\n switch (k) {\n case \"id\":\n settings.set(k, v);\n break;\n case \"width\":\n settings.percent(k, v);\n break;\n case \"lines\":\n settings.integer(k, v);\n break;\n case \"regionanchor\":\n case \"viewportanchor\":\n var xy = v.split(',');\n if (xy.length !== 2) {\n break;\n }\n // We have to make sure both x and y parse, so use a temporary\n // settings object here.\n var anchor = new Settings();\n anchor.percent(\"x\", xy[0]);\n anchor.percent(\"y\", xy[1]);\n if (!anchor.has(\"x\") || !anchor.has(\"y\")) {\n break;\n }\n settings.set(k + \"X\", anchor.get(\"x\"));\n settings.set(k + \"Y\", anchor.get(\"y\"));\n break;\n case \"scroll\":\n settings.alt(k, v, [\"up\"]);\n break;\n }\n }, /=/, /\\s/);\n\n // Create the region, using default values for any values that were not\n // specified.\n if (settings.has(\"id\")) {\n var region = new (self.vttjs.VTTRegion || self.window.VTTRegion)();\n region.width = settings.get(\"width\", 100);\n region.lines = settings.get(\"lines\", 3);\n region.regionAnchorX = settings.get(\"regionanchorX\", 0);\n region.regionAnchorY = settings.get(\"regionanchorY\", 100);\n region.viewportAnchorX = settings.get(\"viewportanchorX\", 0);\n region.viewportAnchorY = settings.get(\"viewportanchorY\", 100);\n region.scroll = settings.get(\"scroll\", \"\");\n // Register the region.\n self.onregion && self.onregion(region);\n // Remember the VTTRegion for later in case we parse any VTTCues that\n // reference it.\n self.regionList.push({\n id: settings.get(\"id\"),\n region: region\n });\n }\n }\n\n // draft-pantos-http-live-streaming-20\n // https://tools.ietf.org/html/draft-pantos-http-live-streaming-20#section-3.5\n // 3.5 WebVTT\n function parseTimestampMap(input) {\n var settings = new Settings();\n\n parseOptions(input, function(k, v) {\n switch(k) {\n case \"MPEGT\":\n settings.integer(k + 'S', v);\n break;\n case \"LOCA\":\n settings.set(k + 'L', parseTimeStamp(v));\n break;\n }\n }, /[^\\d]:/, /,/);\n\n self.ontimestampmap && self.ontimestampmap({\n \"MPEGTS\": settings.get(\"MPEGTS\"),\n \"LOCAL\": settings.get(\"LOCAL\")\n });\n }\n\n // 3.2 WebVTT metadata header syntax\n function parseHeader(input) {\n if (input.match(/X-TIMESTAMP-MAP/)) {\n // This line contains HLS X-TIMESTAMP-MAP metadata\n parseOptions(input, function(k, v) {\n switch(k) {\n case \"X-TIMESTAMP-MAP\":\n parseTimestampMap(v);\n break;\n }\n }, /=/);\n } else {\n parseOptions(input, function (k, v) {\n switch (k) {\n case \"Region\":\n // 3.3 WebVTT region metadata header syntax\n parseRegion(v);\n break;\n }\n }, /:/);\n }\n\n }\n\n // 5.1 WebVTT file parsing.\n try {\n var line;\n if (self.state === \"INITIAL\") {\n // We can't start parsing until we have the first line.\n if (!/\\r\\n|\\n/.test(self.buffer)) {\n return this;\n }\n\n line = collectNextLine();\n\n var m = line.match(/^WEBVTT([ \\t].*)?$/);\n if (!m || !m[0]) {\n throw new ParsingError(ParsingError.Errors.BadSignature);\n }\n\n self.state = \"HEADER\";\n }\n\n var alreadyCollectedLine = false;\n while (self.buffer) {\n // We can't parse a line until we have the full line.\n if (!/\\r\\n|\\n/.test(self.buffer)) {\n return this;\n }\n\n if (!alreadyCollectedLine) {\n line = collectNextLine();\n } else {\n alreadyCollectedLine = false;\n }\n\n switch (self.state) {\n case \"HEADER\":\n // 13-18 - Allow a header (metadata) under the WEBVTT line.\n if (/:/.test(line)) {\n parseHeader(line);\n } else if (!line) {\n // An empty line terminates the header and starts the body (cues).\n self.state = \"ID\";\n }\n continue;\n case \"NOTE\":\n // Ignore NOTE blocks.\n if (!line) {\n self.state = \"ID\";\n }\n continue;\n case \"ID\":\n // Check for the start of NOTE blocks.\n if (/^NOTE($|[ \\t])/.test(line)) {\n self.state = \"NOTE\";\n break;\n }\n // 19-29 - Allow any number of line terminators, then initialize new cue values.\n if (!line) {\n continue;\n }\n self.cue = new (self.vttjs.VTTCue || self.window.VTTCue)(0, 0, \"\");\n self.state = \"CUE\";\n // 30-39 - Check if self line contains an optional identifier or timing data.\n if (line.indexOf(\"-->\") === -1) {\n self.cue.id = line;\n continue;\n }\n // Process line as start of a cue.\n /*falls through*/\n case \"CUE\":\n // 40 - Collect cue timings and settings.\n try {\n parseCue(line, self.cue, self.regionList);\n } catch (e) {\n self.reportOrThrowError(e);\n // In case of an error ignore rest of the cue.\n self.cue = null;\n self.state = \"BADCUE\";\n continue;\n }\n self.state = \"CUETEXT\";\n continue;\n case \"CUETEXT\":\n var hasSubstring = line.indexOf(\"-->\") !== -1;\n // 34 - If we have an empty line then report the cue.\n // 35 - If we have the special substring '-->' then report the cue,\n // but do not collect the line as we need to process the current\n // one as a new cue.\n if (!line || hasSubstring && (alreadyCollectedLine = true)) {\n // We are done parsing self cue.\n self.oncue && self.oncue(self.cue);\n self.cue = null;\n self.state = \"ID\";\n continue;\n }\n if (self.cue.text) {\n self.cue.text += \"\\n\";\n }\n self.cue.text += line;\n continue;\n case \"BADCUE\": // BADCUE\n // 54-62 - Collect and discard the remaining cue.\n if (!line) {\n self.state = \"ID\";\n }\n continue;\n }\n }\n } catch (e) {\n self.reportOrThrowError(e);\n\n // If we are currently parsing a cue, report what we have.\n if (self.state === \"CUETEXT\" && self.cue && self.oncue) {\n self.oncue(self.cue);\n }\n self.cue = null;\n // Enter BADWEBVTT state if header was not parsed correctly otherwise\n // another exception occurred so enter BADCUE state.\n self.state = self.state === \"INITIAL\" ? \"BADWEBVTT\" : \"BADCUE\";\n }\n return this;\n },\n flush: function () {\n var self = this;\n try {\n // Finish decoding the stream.\n self.buffer += self.decoder.decode();\n // Synthesize the end of the current cue or region.\n if (self.cue || self.state === \"HEADER\") {\n self.buffer += \"\\n\\n\";\n self.parse();\n }\n // If we've flushed, parsed, and we're still on the INITIAL state then\n // that means we don't have enough of the stream to parse the first\n // line.\n if (self.state === \"INITIAL\") {\n throw new ParsingError(ParsingError.Errors.BadSignature);\n }\n } catch(e) {\n self.reportOrThrowError(e);\n }\n self.onflush && self.onflush();\n return this;\n }\n};\n\nmodule.exports = WebVTT;\n","/**\n * Copyright 2013 vtt.js Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nvar autoKeyword = \"auto\";\nvar directionSetting = {\n \"\": 1,\n \"lr\": 1,\n \"rl\": 1\n};\nvar alignSetting = {\n \"start\": 1,\n \"middle\": 1,\n \"end\": 1,\n \"left\": 1,\n \"right\": 1\n};\n\nfunction findDirectionSetting(value) {\n if (typeof value !== \"string\") {\n return false;\n }\n var dir = directionSetting[value.toLowerCase()];\n return dir ? value.toLowerCase() : false;\n}\n\nfunction findAlignSetting(value) {\n if (typeof value !== \"string\") {\n return false;\n }\n var align = alignSetting[value.toLowerCase()];\n return align ? value.toLowerCase() : false;\n}\n\nfunction VTTCue(startTime, endTime, text) {\n /**\n * Shim implementation specific properties. These properties are not in\n * the spec.\n */\n\n // Lets us know when the VTTCue's data has changed in such a way that we need\n // to recompute its display state. This lets us compute its display state\n // lazily.\n this.hasBeenReset = false;\n\n /**\n * VTTCue and TextTrackCue properties\n * http://dev.w3.org/html5/webvtt/#vttcue-interface\n */\n\n var _id = \"\";\n var _pauseOnExit = false;\n var _startTime = startTime;\n var _endTime = endTime;\n var _text = text;\n var _region = null;\n var _vertical = \"\";\n var _snapToLines = true;\n var _line = \"auto\";\n var _lineAlign = \"start\";\n var _position = 50;\n var _positionAlign = \"middle\";\n var _size = 50;\n var _align = \"middle\";\n\n Object.defineProperties(this, {\n \"id\": {\n enumerable: true,\n get: function() {\n return _id;\n },\n set: function(value) {\n _id = \"\" + value;\n }\n },\n\n \"pauseOnExit\": {\n enumerable: true,\n get: function() {\n return _pauseOnExit;\n },\n set: function(value) {\n _pauseOnExit = !!value;\n }\n },\n\n \"startTime\": {\n enumerable: true,\n get: function() {\n return _startTime;\n },\n set: function(value) {\n if (typeof value !== \"number\") {\n throw new TypeError(\"Start time must be set to a number.\");\n }\n _startTime = value;\n this.hasBeenReset = true;\n }\n },\n\n \"endTime\": {\n enumerable: true,\n get: function() {\n return _endTime;\n },\n set: function(value) {\n if (typeof value !== \"number\") {\n throw new TypeError(\"End time must be set to a number.\");\n }\n _endTime = value;\n this.hasBeenReset = true;\n }\n },\n\n \"text\": {\n enumerable: true,\n get: function() {\n return _text;\n },\n set: function(value) {\n _text = \"\" + value;\n this.hasBeenReset = true;\n }\n },\n\n \"region\": {\n enumerable: true,\n get: function() {\n return _region;\n },\n set: function(value) {\n _region = value;\n this.hasBeenReset = true;\n }\n },\n\n \"vertical\": {\n enumerable: true,\n get: function() {\n return _vertical;\n },\n set: function(value) {\n var setting = findDirectionSetting(value);\n // Have to check for false because the setting an be an empty string.\n if (setting === false) {\n throw new SyntaxError(\"An invalid or illegal string was specified.\");\n }\n _vertical = setting;\n this.hasBeenReset = true;\n }\n },\n\n \"snapToLines\": {\n enumerable: true,\n get: function() {\n return _snapToLines;\n },\n set: function(value) {\n _snapToLines = !!value;\n this.hasBeenReset = true;\n }\n },\n\n \"line\": {\n enumerable: true,\n get: function() {\n return _line;\n },\n set: function(value) {\n if (typeof value !== \"number\" && value !== autoKeyword) {\n throw new SyntaxError(\"An invalid number or illegal string was specified.\");\n }\n _line = value;\n this.hasBeenReset = true;\n }\n },\n\n \"lineAlign\": {\n enumerable: true,\n get: function() {\n return _lineAlign;\n },\n set: function(value) {\n var setting = findAlignSetting(value);\n if (!setting) {\n throw new SyntaxError(\"An invalid or illegal string was specified.\");\n }\n _lineAlign = setting;\n this.hasBeenReset = true;\n }\n },\n\n \"position\": {\n enumerable: true,\n get: function() {\n return _position;\n },\n set: function(value) {\n if (value < 0 || value > 100) {\n throw new Error(\"Position must be between 0 and 100.\");\n }\n _position = value;\n this.hasBeenReset = true;\n }\n },\n\n \"positionAlign\": {\n enumerable: true,\n get: function() {\n return _positionAlign;\n },\n set: function(value) {\n var setting = findAlignSetting(value);\n if (!setting) {\n throw new SyntaxError(\"An invalid or illegal string was specified.\");\n }\n _positionAlign = setting;\n this.hasBeenReset = true;\n }\n },\n\n \"size\": {\n enumerable: true,\n get: function() {\n return _size;\n },\n set: function(value) {\n if (value < 0 || value > 100) {\n throw new Error(\"Size must be between 0 and 100.\");\n }\n _size = value;\n this.hasBeenReset = true;\n }\n },\n\n \"align\": {\n enumerable: true,\n get: function() {\n return _align;\n },\n set: function(value) {\n var setting = findAlignSetting(value);\n if (!setting) {\n throw new SyntaxError(\"An invalid or illegal string was specified.\");\n }\n _align = setting;\n this.hasBeenReset = true;\n }\n }\n });\n\n /**\n * Other <track> spec defined properties\n */\n\n // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#text-track-cue-display-state\n this.displayState = undefined;\n}\n\n/**\n * VTTCue methods\n */\n\nVTTCue.prototype.getCueAsHTML = function() {\n // Assume WebVTT.convertCueToDOMTree is on the global.\n return WebVTT.convertCueToDOMTree(window, this.text);\n};\n\nmodule.exports = VTTCue;\n","/**\n * Copyright 2013 vtt.js Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nvar scrollSetting = {\n \"\": true,\n \"up\": true\n};\n\nfunction findScrollSetting(value) {\n if (typeof value !== \"string\") {\n return false;\n }\n var scroll = scrollSetting[value.toLowerCase()];\n return scroll ? value.toLowerCase() : false;\n}\n\nfunction isValidPercentValue(value) {\n return typeof value === \"number\" && (value >= 0 && value <= 100);\n}\n\n// VTTRegion shim http://dev.w3.org/html5/webvtt/#vttregion-interface\nfunction VTTRegion() {\n var _width = 100;\n var _lines = 3;\n var _regionAnchorX = 0;\n var _regionAnchorY = 100;\n var _viewportAnchorX = 0;\n var _viewportAnchorY = 100;\n var _scroll = \"\";\n\n Object.defineProperties(this, {\n \"width\": {\n enumerable: true,\n get: function() {\n return _width;\n },\n set: function(value) {\n if (!isValidPercentValue(value)) {\n throw new Error(\"Width must be between 0 and 100.\");\n }\n _width = value;\n }\n },\n \"lines\": {\n enumerable: true,\n get: function() {\n return _lines;\n },\n set: function(value) {\n if (typeof value !== \"number\") {\n throw new TypeError(\"Lines must be set to a number.\");\n }\n _lines = value;\n }\n },\n \"regionAnchorY\": {\n enumerable: true,\n get: function() {\n return _regionAnchorY;\n },\n set: function(value) {\n if (!isValidPercentValue(value)) {\n throw new Error(\"RegionAnchorX must be between 0 and 100.\");\n }\n _regionAnchorY = value;\n }\n },\n \"regionAnchorX\": {\n enumerable: true,\n get: function() {\n return _regionAnchorX;\n },\n set: function(value) {\n if(!isValidPercentValue(value)) {\n throw new Error(\"RegionAnchorY must be between 0 and 100.\");\n }\n _regionAnchorX = value;\n }\n },\n \"viewportAnchorY\": {\n enumerable: true,\n get: function() {\n return _viewportAnchorY;\n },\n set: function(value) {\n if (!isValidPercentValue(value)) {\n throw new Error(\"ViewportAnchorY must be between 0 and 100.\");\n }\n _viewportAnchorY = value;\n }\n },\n \"viewportAnchorX\": {\n enumerable: true,\n get: function() {\n return _viewportAnchorX;\n },\n set: function(value) {\n if (!isValidPercentValue(value)) {\n throw new Error(\"ViewportAnchorX must be between 0 and 100.\");\n }\n _viewportAnchorX = value;\n }\n },\n \"scroll\": {\n enumerable: true,\n get: function() {\n return _scroll;\n },\n set: function(value) {\n var setting = findScrollSetting(value);\n // Have to check for false as an empty string is a legal value.\n if (setting === false) {\n throw new SyntaxError(\"An invalid or illegal string was specified.\");\n }\n _scroll = setting;\n }\n }\n });\n}\n\nmodule.exports = VTTRegion;\n","\"use strict\";\nvar window = require(\"global/window\")\nvar isFunction = require(\"is-function\")\nvar parseHeaders = require(\"parse-headers\")\nvar xtend = require(\"xtend\")\n\nmodule.exports = createXHR\ncreateXHR.XMLHttpRequest = window.XMLHttpRequest || noop\ncreateXHR.XDomainRequest = \"withCredentials\" in (new createXHR.XMLHttpRequest()) ? createXHR.XMLHttpRequest : window.XDomainRequest\n\nforEachArray([\"get\", \"put\", \"post\", \"patch\", \"head\", \"delete\"], function(method) {\n createXHR[method === \"delete\" ? \"del\" : method] = function(uri, options, callback) {\n options = initParams(uri, options, callback)\n options.method = method.toUpperCase()\n return _createXHR(options)\n }\n})\n\nfunction forEachArray(array, iterator) {\n for (var i = 0; i < array.length; i++) {\n iterator(array[i])\n }\n}\n\nfunction isEmpty(obj){\n for(var i in obj){\n if(obj.hasOwnProperty(i)) return false\n }\n return true\n}\n\nfunction initParams(uri, options, callback) {\n var params = uri\n\n if (isFunction(options)) {\n callback = options\n if (typeof uri === \"string\") {\n params = {uri:uri}\n }\n } else {\n params = xtend(options, {uri: uri})\n }\n\n params.callback = callback\n return params\n}\n\nfunction createXHR(uri, options, callback) {\n options = initParams(uri, options, callback)\n return _createXHR(options)\n}\n\nfunction _createXHR(options) {\n if(typeof options.callback === \"undefined\"){\n throw new Error(\"callback argument missing\")\n }\n\n var called = false\n var callback = function cbOnce(err, response, body){\n if(!called){\n called = true\n options.callback(err, response, body)\n }\n }\n\n function readystatechange() {\n if (xhr.readyState === 4) {\n setTimeout(loadFunc, 0)\n }\n }\n\n function getBody() {\n // Chrome with requestType=blob throws errors arround when even testing access to responseText\n var body = undefined\n\n if (xhr.response) {\n body = xhr.response\n } else {\n body = xhr.responseText || getXml(xhr)\n }\n\n if (isJson) {\n try {\n body = JSON.parse(body)\n } catch (e) {}\n }\n\n return body\n }\n\n function errorFunc(evt) {\n clearTimeout(timeoutTimer)\n if(!(evt instanceof Error)){\n evt = new Error(\"\" + (evt || \"Unknown XMLHttpRequest Error\") )\n }\n evt.statusCode = 0\n return callback(evt, failureResponse)\n }\n\n // will load the data & process the response in a special response object\n function loadFunc() {\n if (aborted) return\n var status\n clearTimeout(timeoutTimer)\n if(options.useXDR && xhr.status===undefined) {\n //IE8 CORS GET successful response doesn't have a status field, but body is fine\n status = 200\n } else {\n status = (xhr.status === 1223 ? 204 : xhr.status)\n }\n var response = failureResponse\n var err = null\n\n if (status !== 0){\n response = {\n body: getBody(),\n statusCode: status,\n method: method,\n headers: {},\n url: uri,\n rawRequest: xhr\n }\n if(xhr.getAllResponseHeaders){ //remember xhr can in fact be XDR for CORS in IE\n response.headers = parseHeaders(xhr.getAllResponseHeaders())\n }\n } else {\n err = new Error(\"Internal XMLHttpRequest Error\")\n }\n return callback(err, response, response.body)\n }\n\n var xhr = options.xhr || null\n\n if (!xhr) {\n if (options.cors || options.useXDR) {\n xhr = new createXHR.XDomainRequest()\n }else{\n xhr = new createXHR.XMLHttpRequest()\n }\n }\n\n var key\n var aborted\n var uri = xhr.url = options.uri || options.url\n var method = xhr.method = options.method || \"GET\"\n var body = options.body || options.data\n var headers = xhr.headers = options.headers || {}\n var sync = !!options.sync\n var isJson = false\n var timeoutTimer\n var failureResponse = {\n body: undefined,\n headers: {},\n statusCode: 0,\n method: method,\n url: uri,\n rawRequest: xhr\n }\n\n if (\"json\" in options && options.json !== false) {\n isJson = true\n headers[\"accept\"] || headers[\"Accept\"] || (headers[\"Accept\"] = \"application/json\") //Don't override existing accept header declared by user\n if (method !== \"GET\" && method !== \"HEAD\") {\n headers[\"content-type\"] || headers[\"Content-Type\"] || (headers[\"Content-Type\"] = \"application/json\") //Don't override existing accept header declared by user\n body = JSON.stringify(options.json === true ? body : options.json)\n }\n }\n\n xhr.onreadystatechange = readystatechange\n xhr.onload = loadFunc\n xhr.onerror = errorFunc\n // IE9 must have onprogress be set to a unique function.\n xhr.onprogress = function () {\n // IE must die\n }\n xhr.onabort = function(){\n aborted = true;\n }\n xhr.ontimeout = errorFunc\n xhr.open(method, uri, !sync, options.username, options.password)\n //has to be after open\n if(!sync) {\n xhr.withCredentials = !!options.withCredentials\n }\n // Cannot set timeout with sync request\n // not setting timeout on the xhr object, because of old webkits etc. not handling that correctly\n // both npm's request and jquery 1.x use this kind of timeout, so this is being consistent\n if (!sync && options.timeout > 0 ) {\n timeoutTimer = setTimeout(function(){\n if (aborted) return\n aborted = true//IE9 may still call readystatechange\n xhr.abort(\"timeout\")\n var e = new Error(\"XMLHttpRequest timeout\")\n e.code = \"ETIMEDOUT\"\n errorFunc(e)\n }, options.timeout )\n }\n\n if (xhr.setRequestHeader) {\n for(key in headers){\n if(headers.hasOwnProperty(key)){\n xhr.setRequestHeader(key, headers[key])\n }\n }\n } else if (options.headers && !isEmpty(options.headers)) {\n throw new Error(\"Headers cannot be set on an XDomainRequest object\")\n }\n\n if (\"responseType\" in options) {\n xhr.responseType = options.responseType\n }\n\n if (\"beforeSend\" in options &&\n typeof options.beforeSend === \"function\"\n ) {\n options.beforeSend(xhr)\n }\n\n // Microsoft Edge browser sends \"undefined\" when send is called with undefined value.\n // XMLHttpRequest spec says to pass null as body to indicate no body\n // See https://github.com/naugtur/xhr/issues/100.\n xhr.send(body || null)\n\n return xhr\n\n\n}\n\nfunction getXml(xhr) {\n if (xhr.responseType === \"document\") {\n return xhr.responseXML\n }\n var firefoxBugTakenEffect = xhr.responseXML && xhr.responseXML.documentElement.nodeName === \"parsererror\"\n if (xhr.responseType === \"\" && !firefoxBugTakenEffect) {\n return xhr.responseXML\n }\n\n return null\n}\n\nfunction noop() {}\n","module.exports = extend\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nfunction extend() {\n var target = {}\n\n for (var i = 0; i < arguments.length; i++) {\n var source = arguments[i]\n\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n target[key] = source[key]\n }\n }\n }\n\n return target\n}\n"],"names":["isCallable","toStr","Object","prototype","toString","hasOwnProperty","forEachArray","array","iterator","receiver","i","len","length","call","forEachString","string","charAt","forEachObject","object","k","module","exports","list","thisArg","TypeError","arguments","doccy","topLevel","g","window","minDoc","document","win","self","badArrayLike","isCallableMarker","fnToStr","Function","reflectApply","Reflect","apply","defineProperty","get","_","constructorRegex","isES6ClassFn","value","fnStr","test","e","hasToStringTag","Symbol","toStringTag","documentDotAll","all","undefined","tryFunctionObject","strClass","fn","setTimeout","alert","confirm","prompt","AacStream","Stream","aacUtils","everything","Uint8Array","timeStamp","init","this","setTimestamp","timestamp","push","bytes","bytesLeft","chunk","packet","tempLength","frameSize","byteIndex","byteLength","set","subarray","charCodeAt","parseAdtsSize","type","data","pts","dts","trigger","parseId3TagSize","ADTS_SAMPLING_FREQUENCIES","parseSyncSafeInteger","isLikelyAacData","header","returnSize","lowThree","middle","parseType","parseSampleRate","parseAacTimestamp","frameStart","frame","String","fromCharCode","unescape","start","end","result","slice","percentEncode","d","size","AdtsStream","buffer","frameLength","protectionSkipBytes","frameEnd","oldBuffer","sampleCount","adtsFrameDuration","frameNum","audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize","flush","H264Stream","NalByteStream","PROFILES_WITH_OPTIONAL_SPS_DATA","ExpGolomb","syncPoint","swapBuffer","trackId","currentPts","currentDts","discardEmulationPreventionBytes","readSequenceParameterSet","skipScalingList","nalByteStream","on","event","nalUnitType","escapedRBSP","config","count","expGolombDecoder","j","lastScale","nextScale","readExpGolomb","newLength","newData","emulationPreventionBytesPositions","sourceIndex","shift","profileIdc","levelIdc","profileCompatibility","chromaFormatIdc","picOrderCntType","numRefFramesInPicOrderCntCycle","picWidthInMbsMinus1","picHeightInMapUnitsMinus1","frameMbsOnlyFlag","scalingListCount","sarRatio","frameCropLeftOffset","frameCropRightOffset","frameCropTopOffset","frameCropBottomOffset","sarScale","readUnsignedByte","skipUnsignedExpGolomb","readUnsignedExpGolomb","skipBits","readBoolean","skipExpGolomb","readBits","width","Math","ceil","height","metaTable","highPrefix","lowPrefix","zeroFill","a","coneOfSilence","keys","reduce","obj","key","arr","part","concat","cea708Parser","CaptionStream","captionPackets_","ccStreams_","Cea608Stream","reset","forEach","cc","bind","sei","userData","newCaptionPackets","parseSei","payloadType","USER_DATA_REGISTERED_ITU_T_T35","parseUserData","latestDts_","ignoreNextEqualDts_","numSameDts_","parseCaptionPackets","elem","idx","presortIndex","sort","b","dispatchCea608Packet","activeCea608Channel_","ccStream","setsChannel1Active","setsChannel2Active","ccData","CHARACTER_TRANSLATION","getCharFromCode","code","ROWS","createDisplayBuffer","BOTTOM_ROW","field","dataChannel","field_","dataChannel_","name_","setConstants","swap","char0","char1","text","lastControlCode_","PADDING_","RESUME_CAPTION_LOADING_","mode_","END_OF_CAPTION_","clearFormatting","flushDisplayed","displayed_","nonDisplayed_","startPts_","ROLL_UP_2_ROWS_","rollUpRows_","setRollUp","ROLL_UP_3_ROWS_","ROLL_UP_4_ROWS_","CARRIAGE_RETURN_","shiftRowsUp_","BACKSPACE_","row_","ERASE_DISPLAYED_MEMORY_","ERASE_NON_DISPLAYED_MEMORY_","RESUME_DIRECT_CAPTIONING_","isSpecialCharacter","column_","isExtCharacter","isMidRowCode","addFormatting","isOffsetControlCode","isPAC","row","indexOf","formatting_","isColorPAC","isNormalChar","content","map","trim","console","error","join","replace","startPts","endPts","stream","topRow_","BASE_","EXT_","CONTROL_","OFFSET_","char","newBaseRow","format","reverse","popOn","baseRow","rollUp","paintOn","TransportPacketStream","TransportParseStream","ElementaryStream","StreamTypes","TimestampRolloverStream","m2tsStreamTypes","MP2T_PACKET_LENGTH","bytesInBuffer","startIndex","endIndex","parsePsi","parsePat","parsePmt","packetsWaitingForPmt","programMapTable","payload","psi","offset","payloadUnitStartIndicator","pat","section_number","last_section_number","pmtPid","pmt","tableEnd","video","audio","streamType","pid","H264_STREAM_TYPE","ADTS_STREAM_TYPE","METADATA_STREAM_TYPE","processPes_","STREAM_TYPES","h264","adts","timedMetadata","flushStream","forceFlush","packetFlushable","fragment","packetData","pes","ptsDtsFlags","packetLength","dataAlignmentIndicator","tracks","timelineStartInfo","baseMediaDecodeTime","id","codec","m2ts","PAT_PID","MetadataStream","parseUtf8","decodeURIComponent","tagParsers","TXXX","tag","description","WXXX","url","PRIV","owner","privateData","options","settings","debug","descriptor","tagSize","bufferSize","dispatchType","log","frames","parsePid","parsePayloadUnitStartIndicator","parseAdaptionField","parseNalUnitType","pusi","payloadOffset","parsePesType","parsePesTime","videoPacketContainsKeyFrame","frameBuffer","frameI","frameSyncPoint","foundKeyFrame","handleRollover","reference","direction","abs","lastDTS","referenceDTS","type_","discontinuity","clock","prefixWithSilence","track","audioAppendStartTs","videoBaseMediaDecodeTime","baseMediaDecodeTimeTs","frameDuration","silentFrame","audioGapDuration","audioFillFrameCount","audioFillDuration","audioTsToVideoTs","max","floor","ONE_SECOND_IN_TS","splice","videoTsToAudioTs","trimAdtsFramesByEarliestDts","adtsFrames","earliestAllowedDts","minSegmentDts","Infinity","filter","currentFrame","min","minSegmentPts","generateSampleTable","samples","duration","concatenateFrameData","dataOffset","sum","sumFrameByteLengths","probe","inspect","mapToSample","approximateOffset","sample","parseCaptionNals","segment","videoTrackId","trafs","findBox","mdats","captionNals","mdatTrafPairs","mdat","index","matchingTraf","traf","pair","seiNals","tfhd","headerInfo","parseTfhd","tfdt","parseTfdt","truns","avcStream","seiNal","lastMatchedSample","avcView","DataView","byteOffset","getUint32","matchingSample","findSeiNals","defaultSampleDuration","defaultSampleSize","allSamples","trun","parseTrun","compositionTimeOffset","parseSamples","captionStream","segmentCache","timescale","parsedCaptions","isInitialized","startTime","endTime","captions","captionStreams","isNewInit","videoTrackIds","timescales","parse","parsedData","cachedSegment","parseEmbeddedCaptions","pushNals","nals","nal","clearParsedCaptions","resetCaptionStream","clearAllCaptions","sampleForFrame","flags","isLeading","dependsOn","isDependedOn","hasRedundancy","degradationPriority","isNonSyncSample","keyFrame","groupNalsIntoFrames","nalUnits","currentNal","groupFramesIntoGops","currentGop","gops","nalCount","extendFirstKeyFrame","baseDataOffset","h","concatenateNalData","nalsByteLength","numberOfNals","view","setUint32","generator","Transmuxer","AudioSegmentStream","VideoSegmentStream","CaptionParser","box","dinf","esds","ftyp","mfhd","minf","moof","moov","mvex","mvhd","trak","tkhd","mdia","mdhd","hdlr","sdtp","stbl","stsd","trex","types","MAJOR_BRAND","MINOR_VERSION","AVC1_BRAND","VIDEO_HDLR","AUDIO_HDLR","HDLR_TYPES","VMHD","SMHD","DREF","STCO","STSC","STSZ","STTS","videoSample","audioSample","audioTrun","videoTrun","trunHeader","UINT32_MAX","pow","avc1","avcC","btrt","dref","mp4a","smhd","stco","stsc","stsz","stts","styp","vmhd","sequenceNumber","trackFragments","boxes","sps","pps","sequenceParameterSets","pictureParameterSets","Array","trackFragmentHeader","trackFragmentDecodeTime","trackFragmentRun","sampleDependencyTable","upperWordBaseMediaDecodeTime","lowerWordBaseMediaDecodeTime","durationPresent","sizePresent","flagsPresent","paddingValue","initSegment","fileType","movie","getVideoTrackIds","toUnsigned","path","subresults","results","version","baseTimes","scale","isFinite","traks","hdlrs","tkhds","handlerType","getUint8","clearDtsInfo","maxSegmentDts","maxSegmentPts","calculateTrackBaseMediaDecodeTime","keepOriginalTimestamps","collectDtsInfo","CoalesceStream","mp4","frameUtils","audioFrameUtils","trackDecodeInfo","AUDIO_PROPERTIES","VIDEO_PROPERTIES","arrayEquals","prop","setEarliestDts","earliestDts","setVideoBaseMediaDecodeTime","setAudioAppendStart","gopsToAlignWith","minPTS","gopCache_","nalUnit","gopForFusion","resetStream_","getGopForFusion_","unshift","alignedGops","alignGopsAtEnd","alignGopsAtEnd_","alignGopsAtStart_","gop","pop","dtsDistance","nearestGopObj","currentGopObj","nearestDistance","alignIndex","gopIndex","align","alignEndIndex","matchFound","trimIndex","metadata","total","alignGopsWith","newGopsToAlignWith","metadataStream","numberOfTracks","remux","remuxTracks","pendingTracks","videoTrack","pendingBoxes","pendingCaptions","pendingMetadata","pendingBytes","emittedTracks","output","audioTrack","flushSource","caption","id3","info","timelineStartPts","cueTime","hasFlushed","transmuxPipeline_","setupAacPipeline","pipeline","aacStream","audioTimestampRolloverStream","timedMetadataTimestampRolloverStream","adtsStream","coalesceStream","headOfPipeline","pipe","audioSegmentStream","setupTsPipeline","packetStream","parseStream","elementaryStream","videoTimestampRolloverStream","h264Stream","videoSegmentStream","setBaseMediaDecodeTime","isAac","resetCaptions","payloadSize","inspectMp4","textifyMp4","parseMp4Date","seconds","Date","parseSampleFlags","nalParse","dataReferenceIndex","getUint16","horizresolution","vertresolution","frameCount","depth","numOfPictureParameterSets","nalSize","configurationVersion","avcProfileIndication","avcLevelIndication","lengthSizeMinusOne","numOfSequenceParameterSets","bufferSizeDB","maxBitrate","avgBitrate","esId","streamPriority","decoderConfig","objectProfileIndication","decoderConfigDescriptor","audioObjectType","samplingFrequencyIndex","channelConfiguration","majorBrand","minorVersion","compatibleBrands","dataReferences","name","escape","language","creationTime","modificationTime","streamDescriptor","rate","volume","matrix","Uint32Array","nextTrackId","pdin","initialDelay","sidx","references","referenceId","earliestPresentationTime","firstOffset","referenceCount","referenceType","referencedSize","subsegmentDuration","startsWithSap","sapType","sapDeltaTime","balance","chunkOffsets","entryCount","sampleToChunks","firstChunk","samplesPerChunk","sampleDescriptionIndex","sampleDescriptions","sampleSize","entries","timeToSamples","sampleDelta","baseDataOffsetPresent","sampleDescriptionIndexPresent","defaultSampleDurationPresent","defaultSampleSizePresent","defaultSampleFlagsPresent","durationIsEmpty","defaultBaseIsMoof","defaultSampleFlags","baseDataOffsetIsMoof","layer","alternateGroup","defaultSampleDescriptionIndex","sampleDependsOn","sampleIsDependedOn","sampleHasRedundancy","samplePaddingValue","sampleIsDifferenceSample","sampleDegradationPriority","dataOffsetPresent","firstSampleFlagsPresent","sampleDurationPresent","sampleSizePresent","sampleFlagsPresent","sampleCompositionTimeOffsetPresent","getInt32","graphicsmode","opcolor","Uint16Array","ab","ArrayBuffer","v","z","inspectedMp4","indent","prefix","byte","match","line","JSON","stringify","split","textify","parseHdlr","ts","aac","PES_TIMESCALE","SYNC_BYTE","parseAudioPes_","pesType","parsed","endLoop","table","parseVideoPes_","firstKeyFrame","inspectTs_","parsePsi_","baseTimestamp","audioCount","sampleRate","audioTimescale","inspectAac_","segmentInfo","audioBaseTimestamp","dtsTime","ptsTime","videoBaseTimestamp","adjustTimestamp_","secondsToVideoTs","secondsToAudioTs","videoTsToSeconds","audioTsToSeconds","workingData","workingBytesAvailable","workingWord","workingBitsAvailable","bitsAvailable","loadWord","position","workingBytes","availableBytes","Error","skipBytes","bits","valu","skipLeadingZeros","leadingZeroCount","clz","listeners","listener","off","callbacks","args","dispose","destination","headers","arg","toLowerCase","reviver","json","err","str","left","right","clean","s","sa","URL_REGEX","FIRST_SEGMENT_REGEX","SLASH_DOT_REGEX","SLASH_DOT_DOT_REGEX","URLToolkit","buildAbsoluteURL","baseURL","relativeURL","opts","alwaysNormalize","basePartsForNormalise","parseURL","normalizePath","buildURLFromParts","relativeParts","scheme","baseParts","netLoc","pathParts","exec","builtParts","params","query","baseURLPath","newPath","substring","lastIndexOf","parts","classCallCheck","instance","Constructor","_extends","assign","target","source","inherits","subClass","superClass","create","constructor","enumerable","writable","configurable","setPrototypeOf","__proto__","possibleConstructorReturn","ReferenceError","LineStream","_Stream","_this","nextNewline","parseAttributes","attributes","attrs","RegExp","attr","ParseStream","customParsers","tagType","parseFloat","title","parseInt","number","playlistType","allowed","URI","uri","BYTERANGE","_attributes$BYTERANGE","byterange","RESOLUTION","resolution","BANDWIDTH","dateTimeString","dateTimeObject","IV","PRECISE","addParser","_ref","_this2","expression","customType","dataParser","Parser","lineStream","uris","currentUri","currentMap","_key","noop","defaultMediaGroups","currentTimeline","manifest","allowCache","discontinuityStarts","segments","entry","mediaGroup","rendition","message","endlist","endList","inf","mediaSequence","discontinuitySequence","METHOD","method","iv","playlist","playlists","mediaGroups","media","TYPE","NAME","mediaGroupType","DEFAULT","autoselect","AUTOSELECT","LANGUAGE","instreamId","CHARACTERISTICS","characteristics","FORCED","forced","targetduration","targetDuration","totalduration","totalDuration","isNaN","timeOffset","precise","cueOut","cueOutCont","cueIn","timeline","comment","custom","isObject","merge","_len","objects","isArray","flatten","lists","x","y","from","mergeDiscontiguousPlaylists","o","acc","_acc$name$segments","lang","contentProtection","l","formatAudioPlaylist","_attributes","bandwidth","CODECS","codecs","periodIndex","resolvedUri","formatVideoPlaylist","_ref3","_attributes3","AUDIO","SUBTITLES","toM3u8","dashPlaylists","_mediaGroups","_dashPlaylists$0$attr","sourceDuration","_dashPlaylists$0$attr2","minimumUpdatePeriod","videoPlaylists","_ref4","mimeType","contentType","audioPlaylists","_ref5","vttPlaylists","_ref6","master","VIDEO","role","label","default","subs","_ref2","_attributes2","baseUrl","organizeVttPlaylists","urlToolkit","resolveUrl","relativeUrl","urlTypeToSegment","_ref$baseUrl","_ref$source","_ref$range","range","ranges","startRange","endRange","getLiveRValue","time","NOW","clientOffset","availabilityStartTime","_attributes$timescale","_attributes$start","_attributes$minimumUp","periodDuration","parseByTimeline","segmentTimeline","_attributes$type","_attributes$minimumUp2","_attributes$media","_attributes$timescale2","_attributes$startNumb","startNumber","sIndex","S","repeat","r","segmentTime","t","nextS","segmentRange","static","dynamic","_attributes$timeShift","timeShiftBufferDepth","now","periodStartWC","segmentCount","availableStart","availableEnd","parseByDuration","_attributes$timescale4","_segmentRange$type","_attributes$timescale3","toSegments","identifierPattern","constructTemplateUrl","values","identifier","identifierReplacement","segmentsFromTemplate","templateValues","RepresentationID","Bandwidth","_attributes$initializ","initialization","sourceURL","mapSegment","parseTemplateInfo","Number","Time","errors","segmentsFromList","_attributes$segmentUr","segmentUrls","segmentTimeInfo","segmentUrlMap","segmentUrlObject","segmentUrl","mediaRange","SegmentURLToSegmentObject","segmentsFromBase","_attributes$indexRang","indexRange","generateSegments","segmentAttributes","segmentsFn","template","base","_segmentAttributes","_segmentAttributes$ti","findChildren","element","childNodes","tagName","getContent","textContent","parseDuration","_match$slice","year","month","day","hour","minute","second","parsers","mediaPresentationDuration","parsedValue","el","parseFn","keySystemsMap","buildBaseUrls","referenceUrls","baseUrlElements","baseUrlElement","getSegmentInformation","adaptationSet","segmentTemplate","segmentList","segmentBase","segmentTimelineParentNode","segmentInitializationParentNode","segmentInitialization","generateKeySystemInformation","contentProtectionNodes","node","keySystem","schemeIdUri","psshNode","pssh","psshBuffer","b64Text","decodedString","decodeB64ToUint8Array","toRepresentations","periodAttributes","periodBaseUrls","periodSegmentInfo","adaptationSetAttributes","adaptationSetBaseUrls","roleAttributes","representations","adaptationSetSegmentInfo","representation","repBaseUrlElements","repBaseUrls","representationSegmentInfo","inheritBaseUrls","inheritAttributes","mpd","_options","_options$manifestUri","manifestUri","_options$NOW","_options$clientOffset","periods","mpdAttributes","mpdBaseUrls","period","periodAtt","parsedPeriodId","adaptationSets","toAdaptationSets","stringToMpdXml","manifestString","xml","parseFromString","documentElement","getElementsByTagName","parseUTCTiming","UTCTimingNode","parseUTCTimingScheme","createClass","defineProperties","props","protoProps","staticProps","aesTables","AES","tables","encTable","decTable","sbox","sboxInv","xInv","th","x2","x4","tEnc","tDec","precompute","_tables","tmp","encKey","decKey","keyLen","rcon","decrypt","encrypted0","encrypted1","encrypted2","encrypted3","out","c","a2","b2","c2","nInnerRounds","kIndex","table0","table1","table2","table3","_length","_i","AsyncStream","jobs","delay","timeout_","processJob_","job","ntoh","word","encrypted","initVector","encrypted32","Int32Array","decipher","decrypted","decrypted32","init0","init1","init2","init3","wordIx","Decrypter","done","step","STEP","asyncStream_","decryptChunk_","padded","_inheritsLoose","_setPrototypeOf","p","isNativeReflectConstruct","construct","sham","Proxy","_construct","Parent","Class","_assertThisInitialized","_taggedTemplateLiteralLoose","strings","raw","createLogger","logByType","level","lvl","levels","lvlRegExp","toUpperCase","LogByTypeFactory","subname","warn","history","fname","historyItem","clear","disable","enable","_len2","_key2","_len3","_key3","_len4","_key4","createLogger$1","each","sources","isPlain","computedStyle","cs","_templateObject","isNonBlankString","throwIfWhitespace","isReal","isEl","nodeType","isInFrame","createQuerier","selector","context","ctx","createEl","properties","getOwnPropertyNames","propName","val","setAttribute","attrName","appendContent","innerText","prependTo","child","parent","firstChild","insertBefore","appendChild","hasClass","classToCheck","classList","contains","className","addClass","classToAdd","add","removeClass","classToRemove","remove","toggleClass","classToToggle","predicate","has","setAttributes","attrValue","removeAttribute","getAttributes","knownBooleans","attrVal","getAttribute","attribute","blockTextSelection","unblockTextSelection","getBoundingClientRect","parentNode","rect","findPosition","top","docEl","body","clientLeft","scrollLeft","clientTop","scrollTop","round","getPointerPosition","boxW","offsetWidth","boxH","offsetHeight","boxY","boxX","pageY","pageX","changedTouches","isTextNode","emptyEl","removeChild","normalizeContent","insertContent","isSingleLeftClick","button","buttons","$","$$","Dom","freeze","_guid","newGUID","elData","elIdAttr","getTime","getData","hasData","removeData","_cleanUpEvents","handlers","removeEventListener","dispatcher","detachEvent","disabled","_handleMultipleEvents","callback","fixEvent","returnTrue","returnFalse","isPropagationStopped","old","preventDefault","srcElement","relatedTarget","fromElement","toElement","returnValue","defaultPrevented","stopPropagation","cancelBubble","stopImmediatePropagation","isImmediatePropagationStopped","clientX","doc","clientY","which","charCode","keyCode","_supportsPassive","passiveEvents","guid","hash","handlersCopy","m","n","addEventListener","passive","attachEvent","removeType","elemData","ownerDocument","bubbles","targetData","one","func","videojs","Events","_windowLoaded","autoSetup","vids","audios","divs","mediaEls","mediaEl","autoSetupTimeout","player","wait","vjs","EVENT_MAP","createStyleElement","style","setTextContent","styleSheet","cssText","uid","bound","throttle","last","EventTarget","allowedEvents_","ael","dispatchEvent","queueTrigger","Map","oldTimeout","delete","timeout","isEvented","eventBusEl_","every","isValidEventType","validateTarget","nodeName","validateEventType","validateListener","normalizeListenArgs","isTargetingSelf","listen","EventedMixin","_normalizeListenArgs","removeListenerOnDispose","removeRemoverOnTargetDispose","_normalizeListenArgs2","wrapper","largs","targetOrType","typeOrListener","evented","eventBusKey","eventedCallbacks","StatefulMixin","state","setState","stateUpdates","changes","to","stateful","defaultState","handleStateChanged","toTitleCase","mergeOptions","Component","ready","play","player_","options_","id_","el_","children_","childIndex_","childNameIndex_","initChildren","reportTouchActivity","enableTouchActivity","_proto","localize","tokens","defaultValue","languages","primaryCode","primaryLang","localizedString","ret","contentEl","contentEl_","children","getChildById","getChild","addChild","component","componentName","componentClassName","componentClass","ComponentClass","getComponent","refNode","childFound","compEl","workingChildren","parentOptions","Tech","some","wchild","isTech","playerOptions","newChild","buildCSSClass","sync","isReady_","readyQueue_","triggerReady","readyQueue","show","hide","lockShowing","unlockShowing","num","skipListeners","dimension","dimensions","widthOrHeight","pxIndex","currentDimension","computedWidthOrHeight","getPropertyValue","rule","currentDimensions","currentWidth","currentHeight","focus","blur","emitTapEvents","couldBeTap","touchStart","firstTouch","touches","xdiff","ydiff","sqrt","noTap","reportUserActivity","touchHolding","report","clearInterval","setInterval","touchEnd","timeoutId","disposeFn","clearTimeout","interval","_this3","intervalId","requestAnimationFrame","_this4","supportsRaf_","cancelAnimationFrame","registerComponent","ComponentToRegister","reason","isComp","isPrototypeOf","components_","Player","players","playerNames","pname","Boolean","USER_AGENT","webkitVersionMap","appleWebkitVersion","IS_IPAD","IS_IPHONE","IS_IPOD","IS_IOS","IOS_VERSION","IS_ANDROID","ANDROID_VERSION","major","minor","IS_NATIVE_ANDROID","IS_FIREFOX","IS_EDGE","IS_CHROME","CHROME_VERSION","IE_VERSION","IS_SAFARI","IS_ANY_SAFARI","TOUCH_ENABLED","browser","getRange","fnName","valueIndex","rangeIndex","maxIndex","rangeCheck","createTimeRangesObj","createTimeRanges","bufferedPercent","buffered","bufferedDuration","browserApi","FullscreenApi","apiMap","specApi","MediaError","defaultMessages","status","errorTypes","errNum","isPromise","then","silencePromise","trackToJson_","cues","cue","textTrackConverter","tech","trackEls","trackObjs","trackEl","src","textTracks","addedTrack","addRemoteTextTrack","addCue","ModalDialog","_Component","opened_","hasBeenOpened_","hasBeenFilled_","closeable","uncloseable","MODAL_CLASS_NAME","descEl_","tabIndex","previouslyActiveEl_","handleKeyPress","close","desc","open","fillAlways","fill","wasPlaying_","paused","pauseOnOpen","pause","hadControls_","controls","conditionalFocus_","opened","conditionalBlur_","temporary","closeable_","temp","controlText","fillWith","parentEl","nextSiblingEl","nextSibling","empty","closeButton","content_","activeEl","playerEl","handleKeyDown","focusIndex","focusableEls","focusableEls_","querySelector","shiftKey","allChildren","querySelectorAll","hasAttribute","TrackList","_EventTarget","tracks_","addTrack","removeTrack","rtrack","getTrackById","change","addtrack","removetrack","disableOthers","enabled","AudioTrackList","_TrackList","changing_","disableOthers$1","selected","VideoTrackList","TextTrackList","kind","HtmlTrackElementList","trackElements","trackElements_","addTrackElement_","trackElement","getTrackElementByTrack_","trackElement_","removeTrackElement_","TextTrackCueList","setCues_","length_","oldLength","cues_","defineProp","getCueById","VideoTrackKind","alternative","main","sign","subtitles","commentary","AudioTrackKind","TextTrackKind","descriptions","chapters","TextTrackMode","hidden","showing","Track","trackProps","_loop","parseUrl","href","div","addToBody","host","protocol","innerHTML","details","getAbsoluteURL","getFileExtension","isCrossOrigin","winLoc","urlInfo","Url","parseCues","srcContent","parser","oncue","onparsingerror","onflush","TextTrack","_Track","srclang","mode","default_","tech_","activeCues_","activeCues","changed","timeupdateHandler","newMode","loaded_","ct","currentTime","active","crossOrigin","cors","response","responseBody","loadHandler","loadTrack","originalCue","originalCue_","removeCue","_removeCue","cuechange","AudioTrack","newEnabled","VideoTrack","newSelected","HTMLTrackElement","readyState","load","NONE","LOADING","LOADED","ERROR","NORMAL","ListClass","TrackClass","capitalName","getterName","privateName","REMOTE","remoteText","remoteTextEl","ALL","names","hasStarted_","featuresProgressEvents","manualProgressOn","featuresTimeupdateEvents","manualTimeUpdatesOn","nativeCaptions","nativeTextTracks","featuresNativeTextTracks","emulateTextTracks","autoRemoteTextTracks_","initTrackListeners","nativeControlsForTouch","triggerSourceset","onDurationChange","manualProgress","trackProgress","manualProgressOff","stopTrackingProgress","progressInterval","numBufferedPercent","bufferedPercent_","duration_","manualTimeUpdates","trackCurrentTime","stopTrackingCurrentTime","manualTimeUpdatesOff","currentTimeInterval","manuallyTriggered","clearTracks","removeRemoteTextTrack","cleanupAutoTextTracks","error_","played","setCurrentTime","trackListChanges","addWebVttScript_","_this5","script","onload","onerror","_this6","remoteTracks","remoteTextTracks","handleAddTrack","handleRemoveTrack","updateDisplay","textTracksChanges","addTextTrack","createTrackHelper","createRemoteTextTrack","manualCleanup","_this7","htmlTrackElement","remoteTextTrackEls","getVideoPlaybackQuality","setPoster","playsinline","setPlaysinline","overrideNativeAudioTracks","overrideNativeVideoTracks","canPlayType","canPlaySource","srcObj","registerTech","techs_","defaultTechOrder_","getTech","featuresVolumeControl","featuresMuteControl","featuresFullscreenResize","featuresPlaybackRate","featuresSourceset","withSourceHandlers","_Tech","registerSourceHandler","handler","sourceHandlers","can","selectSourceHandler","canHandleSource","sh","originalFn","sourceHandler_","setSource","nativeSourceHandler","disposeSourceHandler","currentSource_","handleSource","middlewares","middlewareInstances","TERMINATOR","next","setSourceHelper","mediate","middleware","callMethod","middlewareValue","middlewareIterator","terminated","mws","mw","executeRight","allowedGetters","seekable","allowedSetters","allowedMediators","lastRun","_middleware","mwFactory","mwrest","_mws$i","mwf","mwi","getOrCreateFactory","_src","MimetypesKind","opus","ogv","mov","m4v","mkv","mp3","oga","m3u8","getMimetype","ext","filterSource","newsrc","srcobj","fixSource","mimetype","MediaLoader","techOrder","techName","isSupported","loadTech_","ClickableComponent","tabIndex_","createControlTextEl","controlTextEl_","controlText_","localizedText","nonIconControl","enabled_","handleClick","handleFocus","handleBlur","PosterImage","_ClickableComponent","update","poster","setSrc","backgroundImage","fontMap","monospace","sansSerif","serif","monospaceSansSerif","monospaceSerif","proportionalSansSerif","proportionalSerif","casual","smallcaps","constructColor","color","opacity","hex","tryUpdateStyle","TextTrackDisplay","updateDisplayHandler","toggleDisplay","preselectTrack","firstDesc","firstCaptions","preferredTrack","modes","trackList","userPref","cache_","selectedLanguage","clearDisplay","descriptionsTrack","captionsSubtitlesTrack","updateForTrack","textTrackSettings","overrides","getValues","cueDiv","displayState","textOpacity","backgroundColor","backgroundOpacity","windowColor","windowOpacity","edgeStyle","textShadow","fontPercent","fontSize","bottom","fontFamily","fontVariant","LoadingSpinner","isAudio","playerType","dir","Button","BigPlayButton","_Button","mouseused_","handleMouseDown","playPromise","cb","playToggle","playFocus","CloseButton","PlayToggle","replay","handlePlay","handlePause","handleEnded","handleSeeked","defaultImplementation","guide","gm","gh","implementation","formatTime","TimeDisplay","throttledUpdateContent","updateContent","plainName","labelText_","updateTextNode_","textNode_","formattedTime_","formatTime_","updateFormattedTime_","formattedTime","CurrentTimeDisplay","_TimeDisplay","scrubbing","getCache","DurationDisplay","TimeDivider","RemainingTimeDisplay","remainingTimeDisplay","remainingTime","LiveDisplay","updateShowing","SeekToLive","updateLiveEdgeStatus","liveTracker","textEl_","atLiveEdge","seekToLiveEdge","Slider","bar","barName","vertical","playerEvent","handleMouseMove","handleMouseUp","progress","getPercent","percentage","toFixed","calculateDistance","stepBack","stepForward","bool","vertical_","LoadProgressBar","partEls_","isLive","seekableEnd","bufferedEnd","controlTextPercentage","percentify","rounded","percent","TimeTooltip","seekBarRect","seekBarPoint","tooltipRect","playerRect","seekBarPointPx","spaceLeftOfPoint","spaceRightOfPoint","pullTooltipBy","updateTime","rafId_","liveWindow","secondsBehind","PlayProgressBar","timeTooltip","MouseTimeDisplay","SeekBar","_Slider","setEventHandlers_","updateInterval","update_","liveCurrentTime","getCurrentTime_","seekableStart","videoWasPlaying","newTime","distance","mouseTimeDisplay","handleAction","ProgressControl","throttledHandleMouseSeek","handleMouseSeek","seekBar","seekBarEl","FullscreenToggle","handleFullscreenChange","fullscreenEnabled","isFullscreen","exitFullscreen","requestFullscreen","VolumeLevel","VolumeBar","updateLastVolume_","updateARIAAttributes","checkMuted","muted","ariaValue","volumeAsPercentage_","volumeBeforeDrag","lastVolume_","VolumeControl","volumeBar","checkVolumeSupport","throttledHandleMouseMove","orientationClass","MuteToggle","checkMuteSupport","vol","lastVolume","volumeToSet","updateIcon_","updateControlText_","VolumePanel","inline","volumeControl","volumePanelState_","sliderActive_","sliderInactive_","muteToggle","Menu","menuButton_","menuButton","focusedChild_","addItem","unpressButton","contentElType","append","btn","buttonPressed_","stepChild","item","MenuButton","buttonClass","menu","handleSubmenuKeyPress","createMenu","items","hideThreshold_","createItems","buildWrapperCSSClass","menuButtonClass","pressButton","TrackButton","_MenuButton","updateHandler","MenuItem","selectable","isSelected_","multiSelectable","_selected","TextTrackMenuItem","_MenuItem","changeHandler","handleTracksChange","selectedLanguageChangeHandler","handleSelectedLanguageChange","onchange","initEvent","kinds","shouldBeSelected","OffTextTrackMenuItem","_TextTrackMenuItem","allHidden","TextTrackButton","_TrackButton","TrackMenuItem","label_","kinds_","kind_","ChaptersTrackMenuItem","ChaptersButton","_TextTrackButton","track_","setTrack","findChaptersTrack","updateHandler_","remoteTextTrackEl","_remoteTextTrackEl","getMenuCaption","mi","DescriptionsButton","SubtitlesButton","CaptionSettingsMenuItem","CaptionsButton","SubsCapsMenuItem","SubsCapsButton","language_","AudioTrackMenuItem","audioTracks","AudioTrackButton","PlaybackRateMenuItem","playbackRate","PlaybackRateMenuButton","updateVisibility","updateLabel","labelEl_","rates","playbackRates","currentRate","newRate","playbackRateSupported","Spacer","CustomControlSpacer","_Spacer","ControlBar","ErrorDisplay","_ModalDialog","LOCAL_STORAGE_KEY","COLOR_BLACK","COLOR_BLUE","COLOR_CYAN","COLOR_GREEN","COLOR_MAGENTA","COLOR_RED","COLOR_WHITE","COLOR_YELLOW","OPACITY_OPAQUE","OPACITY_SEMI","OPACITY_TRANS","selectConfigs","parseOptionValue","TextTrackSettings","endDialog","setDefaults","persistTextTrackSettings","saveSettings","restoreSettings","createElSelect_","legendId","selectLabelledbyIds","optionId","createElFgColor_","createElBgColor_","createElWinColor_","createElColors_","createElFont_","createElControls_","defaultsDescription","initial","accum","selectedIndex","setValues","setSelectedOption","ttDisplay","controlBar","subsCapsBtn","subsCapsButton","ccBtn","captionsButton","ResizeManager","RESIZE_OBSERVER_AVAILABLE","ResizeObserver","loadListener_","resizeObserver_","debouncedHandler_","immediate","debounced","_later","cancel","debounce","resizeHandler","observe","contentWindow","unobserve","disconnect","resizeObserver","LiveTracker","reset_","handleDurationchange","isBehind_","timeupdateSeen_","seekableIncrement","seekableIncrement_","trackLive_","pastSeekEnd_","newSeekEnd","lastSeekEnd_","pastSeekEnd","behindLiveEdge","behindLiveEdge_","startTracking","stopTracking","isTracking","trackingInterval_","handleTimeupdate","seekableEnds","seekableStarts","sourcesetLoad","srcUrls","innerHTMLDescriptorPolyfill","cloneNode","dummy","docFrag","getDescriptor","priority","getOwnPropertyDescriptor","firstSourceWatch","resetSourceWatch_","innerDescriptor","getInnerHTMLDescriptor","appendWrapper","appendFn","retval","srcDescriptorPolyfill","setupSourceset","resetSourceset_","srcDescriptor","getSrcDescriptor","oldSetAttribute","oldLoad","currentSrc","_templateObject$1","Html5","crossoriginTracks","initNetworkState_","handleLateInit_","enableSourceset","setupSourcesetHandling_","hasChildNodes","nodes","nodesLength","removeNodes","proxyNativeTracks_","restoreMetadataTracksInIOSNativePlayer_","setControls","proxyWebkitFullscreen_","disposeMediaElement","metadataTracksPreFullscreenState","takeMetadataTrackSnapshot","storedMode","restoreTrackMode","storedTrack","overrideNative_","override","lowerCaseType","eventName","proxyNativeTracksForType_","elTracks","techTracks","currentTarget","removeOldTracks","removeTracks","found","playerElIngest","movingMediaElementInDOM","clone","techId","class","playerId","preload","settingsAttrs","networkState","loadstartFired","setLoadstartFired","triggerLoadstart","eventsToTrigger","checkProgress","NaN","endFn","beginFn","webkitPresentationMode","supportsFullScreen","webkitEnterFullScreen","userAgent","enterFullScreen","HAVE_METADATA","exitFullScreen","webkitExitFullScreen","resetMediaElement","videoPlaybackQuality","webkitDroppedFrameCount","webkitDecodedFrameCount","droppedVideoFrames","totalVideoFrames","TEST_VID","canControlVolume","canMuteVolume","canControlPlaybackRate","canOverrideAttributes","supportsNativeTextTracks","supportsNativeVideoTracks","videoTracks","supportsNativeAudioTracks","featuresNativeVideoTracks","featuresNativeAudioTracks","mpegurlRE","_templateObject$2","patchCanPlayType","unpatchCanPlayType","TECH_EVENTS_RETRIGGER","TECH_EVENTS_QUEUE","canplay","canplaythrough","playing","seeked","BREAKPOINT_ORDER","BREAKPOINT_CLASSES","DEFAULT_BREAKPOINTS","tiny","xsmall","small","medium","large","xlarge","huge","getTagSettings","closest","isPosterFromTech_","queuedCallbacks_","userActive_","tagAttributes","languagesToLower","name$$1","languages_","poster_","controls_","autoplay","scrubbing_","lastPlaybackRate","defaultPlaybackRate","fluid_","updateStyleEl_","playerOptionsCopy","plugins","middleware_","flexNotSupported_","majorVersion","userActive","listenForUserActivity_","handleFullscreenChange_","handleStageClick_","breakpoints","responsive","changingSrc_","playWaitingForReady_","playOnLoadstart_","styleEl_","playerElIngest_","divEmbed","tabindex","defaultsStyleEl","head","fill_","fluid","aspectRatio","links","linkEl","_dimension","privDimension","parsedVal","ratio","aspectRatio_","idClass","ratioParts","videoWidth","videoHeight","ratioMultiplier","width_","height_","_width","_height","techEl","unloadTech_","titleTechName","camelTechName","techName_","techOptions","loop","techCanOverridePoster","TechClass","handleTechReady_","textTracksJson_","eventObj","seeking","handleTechLoadStart_","handleTechSourceset_","handleTechWaiting_","handleTechEnded_","handleTechSeeking_","handleTechPlay_","handleTechFirstPlay_","handleTechPause_","handleTechDurationChange_","handleTechFullscreenChange_","handleTechError_","handleTechPosterChange_","handleTechTextData_","handleTechRateChange_","usingNativeControls","techGet_","addTechControlsListeners_","safety","removeTechControlsListeners_","handleTechClick_","handleTechDoubleClick_","handleTechTouchStart_","handleTechTouchMove_","handleTechTouchEnd_","handleTechTap_","techCall_","hasStarted","manualAutoplay_","promise","previouslyMuted","catch","updateSourceCaches_","matchingSources","findMimetype","sourceElSources","sourceEls","matchingSourceEls","sourceObj","updateSourceCaches","playerSrc","currentSource","eventSrc","lastSource_","updateCache","techSrc","techGet","request","queued","timeWhenWaiting","timeUpdateListener","handleTechCanPlay_","handleTechCanPlayThrough_","handleTechPlaying_","handleTechSeeked_","starttime","userWasActive","set$1","reduceRight","PromiseClass","Promise","resolve","play_","_this8","isScrubbing","liveui","percentAsDecimal","_muted","defaultMuted","_defaultMuted","isFS","isFullscreen_","fsApi","fullscreenchange","documentFullscreenChange","fullscreenElement","enterFullWindow","exitFullWindow","isFullWindow","docOrigOverflow","fullWindowOnEscKey","selectSource","_this9","techs","findFirstPassingTechSourcePair","outerArray","innerArray","tester","outerChoice","innerChoice","finder","sourceOrder","flip","_this10","middlewareSource","src_","notSupportedMessage","setTech","str1","str2","_this11","sourceTech","currentSources","currentType","techAutoplay","newPoster","usingNativeControls_","errorDisplay","userActivity_","mouseInProgress","lastMoveX","lastMoveY","inactivityTimeout","handleActivity","screenX","screenY","isAudio_","toJSON","createModal","_this12","modal","updateCurrentBreakpoint_","currentBreakpoint","candidateBreakpoint","breakpoints_","breakpoint_","removeCurrentBreakpoint_","currentBreakpointClass","_breakpoints","responsive_","baseOptions","tagOptions","dataSetup","_safeParseTuple","childName","html5","flash","userLanguage","BASE_PLUGIN_NAME","pluginStorage","pluginExists","getPlugin","markPluginAsActive","triggerSetupEvent","before","createPluginFactory","PluginSubClass","plugin","getEventHash","Plugin","VERSION","isBasic","registerPlugin","basicPluginWrapper","createBasicPlugin","deregisterPlugin","getPlugins","getPluginVersion","usingPlugin","hasPlugin","normalizeId","videojs$1","getPlayer","hooks","hookFunction","PlayerComponent","hooks_","hook","hookOnce","original","removeHook","style$1","getPlayers","nId","_tag","_player","getAllPlayers","comp","use","writeable","extend","subClassMethods","methods","super_","_inherits$1","addLanguage","_mergeOptions","createTimeRange","setFormatTime","customImplementation","resetFormatTime","xhr","dom","get$1","property","getPrototypeOf","getter","slicedToArray","_arr","_n","_d","_e","_s","sliceIterator","mergeOptions$1","EventTarget$1","log$1","forEachMediaGroup","mediaType","groupKey","labelKey","mediaProperties","updateMaster","mergedPlaylist","updateSegments","baseUri","resolveSegmentUris","setupMediaPlaylists","resolveMediaGroupUris","refreshDelay","lastSegment","PlaylistLoader","srcUrl","hls","withCredentials","hls_","req","playlistRequestError","haveMetadata","xhr$$1","startingState","responseText","media_","mediaUpdateTimeout","stopRequest","oldRequest","onreadystatechange","abort","mediaChange","started","isFinalRendition","intervalDuration","endSequence","expired","backward","forward","backwardDuration","forwardDuration","sumDurations","durations","safeLiveIndex","distanceFromEnd","safeDistance","playlistEnd","useSafeLiveEnd","isWholeNumber","roundSignificantDigit","increment","numDecimalDigits","ceilLeastSignificantDigit","floorLeastSignificantDigit","isBlacklisted","excludeUntil","isIncompatible","isEnabled","blacklisted","isLowestEnabledRendition","currentBandwidth","MAX_VALUE","Playlist","getMediaInfoForTime","numSegments","mediaIndex","isDisabled","isAes","isFmp4","estimateSegmentRequestTime","segmentDuration","bytesReceived","videojsXHR","mergeOptions$1$1","xhrFactory","XhrFunction","beforeRequest","Hls","newOptions","reqResponse","responseTime","roundTripTime","requestTime","responseHeaders","timedout","aborted","statusCode","originalAbort","textRange","formatHexString","formatAsciiString","createTransferableMessage","transferable","isView","initSegmentId","hexDump","utils","tagDump","textRanges","timeWithinSegment","requestedTime","segmentStart","requestedTimeString","toISOString","segmentTimeString","endTimeString","findSegmentForTime","manifestTime","estimatedEnd","estimatedStart","timeWithinSegmentEnd","timeWithinSegmentDuration","getStreamTime","_ref$time","matchedSegment","findSegmentForPlayerTime","seekTime","streamTime","mediaSeconds","programDateTime","seekToStreamTime","_ref2$retryCount","retryCount","seekTo","_ref2$pauseAfterSeek","pauseAfterSeek","verifyProgramDateTimeTags","findSegmentForStreamTime","mediaOffset","comparisonTimeStamp","segmentDateTime","streamDateTime","segmentTimeEpoch","getOffsetFromTimestamp","seekToTime","TIME_FUDGE_FACTOR","SAFE_TIME_DELTA","filterRanges","timeRanges","findRange","findNextRange","printableRange","strArr","timeRangesToArray","timeRangesList","removeCuesFromTrack","durationOfVideo","addTextTrackData","sourceHandler","captionArray","metadataArray","Cue","inbandTextTracks_","timestampOffset","videoDuration","mediaSource_","deprecateOldCue","metadataTrack_","cuesArray","cuesGroupedByStartTime","timeSlot","sortedStartTimes","cueGroup","nextTime","TARGET","BlobBuilder","WebKitBlobBuilder","MozBlobBuilder","MSBlobBuilder","URL","webkitURL","msURL","Worker","shimWorker","filename","forceFallback","objURL","createSourceObject","worker","term","terminate","revokeObjectURL","wrapTerminate","selfShim","postMessage","onmessage","isThisThread","testWorker","testArray","createObjectURL","Blob","blob","getBlob","TransmuxWorker","document$$1","_findBox","mp4Generator","toUnsigned$1","silence","ONE_SECOND_IN_TS$1","captionPacketParser","streamTypes","_MetadataStream","timestampRolloverStream","_TransportPacketStream","_TransportParseStream","_ElementaryStream","TimestampRolloverStream$1","stream$$1","_AdtsStream","m2ts_1","_H264Stream","_NalByteStream","expGolomb","_AacStream","_VideoSegmentStream","_AudioSegmentStream","_Transmuxer","_CoalesceStream","isLikelyAacData$1","_textifyMp","transmuxer","parseType$2","parse$$1","mp4Inspector","discardEmulationPreventionBytes$1","CaptionStream$1","captionStream$$1","MessageHandlers","initArray","typedArray","action","gopInfo","wireTransmuxerEvents","appendStart","messageHandlers","defaultCodecs","videoCodec","videoObjectTypeIndicator","audioProfile","translateLegacyCodecs","orig","profile","avcLevel","parseCodecs","codecCount","makeMimeTypeString","container","mimeTypesForPlaylist","containerType","getContainerType","codecInfo","mediaAttributes","getCodecs","isMuxed","isMaat","audioGroup","groupId","audioGroupId","audioType","audioProfileFromDefault","codecStrings","justAudio","justVideo","bothVideoAudio","isAudioCodec","isVideoCodec","gopsSafeToAlignWith","mapping","currentTimePts","VirtualSourceBuffer","_videojs$EventTarget","mediaSource","timestampOffset_","pendingBuffers_","bufferUpdating_","codecs_","audioCodec_","videoCodec_","audioDisabled_","appendAudioInitSegment_","gopBuffer_","timeMapping_","safeAppend_","transmuxer_","data_","done_","appendGopInfo_","videoBuffer_","audioBuffer_","appendWindowStart","updating","videoBuffer","audioBuffer","audioDisabled","arity","extents","videoBuffered","audioBuffered","sourceBuffer","inBandMetadataTrackDispatchType","createTextTracksIfNecessary","processPendingSegments_","addSourceBuffer","realBuffer_","makeWrappedSourceBuffer","nativeMediaSource_","updateGopBuffer","updatedBuffer","removeGopBuffer","sortedSegments","segmentObj","createRealSourceBuffers_","triggerUpdateend","concatAndAppendSegments_","destinationBuffer","tempBuffer","appendBuffer","originalError","HtmlMediaSource","activeSourceBuffers_","sourceBuffers","updateActiveSourceBuffers_","disableCombined","disableAudioOnly","onPlayerMediachange_","onHlsReset_","onHlsSegmentTimeMapping_","url_","sourcebuffer","parsedType","parameters","parameter","parseContentType","urlCount","mediaSources","msObjectURL","swfId","supportsNativeMediaSources","MediaSource","URL$1","EventTarget$1$1","mergeOptions$2","updateMaster$1","oldMaster","newMaster","playlistUpdate","group","_playlistUpdate","DashPlaylistLoader","srcUrlOrPlaylist","masterPlaylistLoader","refreshXml_","refreshMedia_","masterPlaylistLoader_","masterXml_","clientOffset_","phonyUri","_phonyUri","date","masterLoaded_","syncClientServerClock_","onClientServerClockSync_","utcTiming","serverTime","parseMasterXml","updatedMaster","logger","SourceUpdater","sourceBufferEmitter","callbacks_","pendingCallback_","processedAppend_","mimeType_","logger_","createSourceBuffer_","sourceBuffer_","start_","started_","onUpdateendCallback_","pendingCallback","runCallback_","queueCallback_","Config","GOAL_BUFFER_LENGTH","MAX_GOAL_BUFFER_LENGTH","GOAL_BUFFER_LENGTH_RATE","INITIAL_BANDWIDTH","BANDWIDTH_VARIANCE","BUFFER_LOW_WATER_LINE","MAX_BUFFER_LOW_WATER_LINE","BUFFER_LOW_WATER_LINE_RATE","REQUEST_ERRORS","segmentXhrHeaders","byterangeEnd","Range","abortAll","activeXhrs","handleErrors","waitForCompletion","decrypter","doneFn","didError","endOfAllRequests","encryptedBytes","decryptionHandler","requestId","decryptSegment","handleProgress","progressFn","progressEvent","stats","loaded","firstBytesReceivedAt","mediaSegmentRequest","xhrOptions","decryptionWorker","captionParser","finishProcessingFn","keyXhr","responseType","errorObj","handleKeyResponse","initSegmentXhr","handleInitSegmentResponse","segmentXhr","getRequestStats","fmp4Captions","handleSegmentResponse","safeGetComputedStyle","stableSort","sortFn","newArray","cmp","comparePlaylistBandwidth","leftBandwidth","rightBandwidth","detectEndOfStream","segmentIndex","appendedLastSegment","finite","SegmentLoader","throughput","roundTrip","resetStats_","hasPlayed_","hasPlayed","currentTime_","seekable_","seeking_","loaderType_","loaderType","startingMedia_","segmentMetadataTrack_","segmentMetadataTrack","goalBufferLength_","goalBufferLength","sourceType_","sourceType","inbandTextTracks","state_","checkBufferTimeout_","currentTimeline_","pendingSegment_","sourceUpdater_","xhrOptions_","activeInitSegmentId_","initSegments_","captionParser_","decrypter_","syncController_","syncController","syncPoint_","ended_","fetchAtBuffer_","newState","mediaBytesTransferred","mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaSecondsLoaded","abort_","monitorBuffer_","abortRequests","_error","set$$1","storedMap","playlist_","setDateTimeMapping","couldBeginLoading_","init_","sourceBufferEmitter_","resetEverything","newPlaylist","oldPlaylist","syncInfo","oldId","mediaSequenceDiff","saveExpiredSegmentInfo","resyncLoader","_mimeType","resetLoader","monitorBufferTick_","fillBuffer_","getSyncPoint","checkBuffer_","buffered_","endOfStream","startOfSegment","loadSegment_","lastBufferedEnd","bufferedTime","getSyncSegmentCandidate_","generateSegmentInfo_","mediaSourceInfo","_mediaSourceInfo","segmentIndexArray","isSyncRequest","random","measuredBandwidth","requestTimeRemaining","timeUntilRebuffer$$1","timeUntilRebuffer","switchCandidate","duration$$1","compatiblePlaylists","enabledPlaylists","rebufferingEstimates","numRequests","rebufferingImpact","noRebufferingPlaylists","estimate","minRebufferMaxBandwidthSelector","timeSavedBySwitching","minimumTimeSaving","simpleSegment","abortRequestEarly_","trimBackBuffer_","createSimplifiedSegmentObj_","handleProgress_","segmentRequestFinished_","removeToTime","seekable$$1","safeBackBufferTrimTime","processSegmentResponse_","createCaptionsTrackIfNotExists","WebKitDataCue","VTTCue","addCaptionData","handleSegment_","timingInfo","probeSegmentInfo","containsAudio","containsVideo","startingMedia","newSegmentMedia","illegalMediaSwitchError","blacklistDuration","timelineMapping","mappingForTimeline","initId","_segmentInfo$segment","_segmentInfo$playlist","seq","_segmentInfo$playlist2","segmentInfoString","handleUpdateEnd_","isWalkingForward","recordThroughput_","addSegmentMetadataCue_","segmentProcessingTime","segmentProcessingThroughput","uint8ToUtf8","uintArray","VTT_LINE_TERMINATORS","VTTSegmentLoader","_SegmentLoader","subtitlesTrack_","combinedByteLength","combinedSegment","_track","skipEmptySegments_","timestampOffsetForTimeline","requested","parseVTTCues_","updateTimeMapping_","timelines","decoder","decodeBytesToString","timestampmap","MPEGTS","LOCAL","ontimestampmap","mapData","segmentData","mappingObj","diff","firstStart","lastStart","findAdCue","mediaTime","adStartTime","adEndTime","tsprobe","syncPointStrategies","run","datetimeToDisplayTime","lastDistance","discontinuitySync","discontinuities","SyncController","inspectCache_","syncPoints","runStrategies_","selectSyncPoint_","strategy","bestSyncPoint","bestDistance","bestStrategy","newDistance","lastRemovedSegment","playlistTimestamp","probeMp4Segment_","probeTsSegment_","calculateSegmentTimeMapping_","saveDiscontinuitySyncInfo_","timeInfo","segmentStartTime","segmentEndTime","accuracy","mediaIndexDiff","Decrypter$1","AsyncStream$$1","Decrypter$$1","decrypt$$1","audioTrackKind_","stopLoaders","segmentLoader","activePlaylistLoader","startLoaders","playlistLoader","onError","segmentLoaders","mediaTypes","blacklistCurrentPlaylist","activeTrack","activeGroup","defaultTrack","onTrackChanged","setupListeners","requestOptions","byGroupId","byResolvedUri","initialize","_settings$master","_settings$mediaTypes$","groups","groupPlaylists","variantLabel","_settings$mediaTypes$2","_settings$mediaTypes$3","setupMediaGroups","variants","onGroupChanged","_settings$segmentLoad","mainSegmentLoader","previousActiveLoader","_settings$segmentLoad2","onAudioTrackChanged","loaderStats","sumLoaderStat","stat","audioSegmentLoader_","mainSegmentLoader_","MasterPlaylistController","externHls","useCueTags","enableLowInitialPlaylist","seekTo_","useCueTags_","cueTagsTrack_","requestOptions_","mediaTypes_","handleSourceOpen_","segmentLoaderSettings","setupMasterPlaylistLoaderListeners_","subtitleSegmentLoader_","setupSegmentLoaderListeners_","requestTimeout","triggerPresenceUsage_","setupSourceBuffers_","setupFirstPlay","updatedPlaylist","excludeUnsupportedVariants_","selectedMedia","selectInitialPlaylist","selectPlaylist","initialMedia_","updateAdCues_","updateDuration","addSeekableRange","addSeekableRange_","onDurationchange","stuckAtPlaylistEnd_","defaultDemuxed","audioGroupKeys","nextPlaylist","currentPlaylist","forwardBuffer","bufferLowWaterLine","onSyncInfoUpdate_","onEndOfStream","ended","isEndOfStream","getExpiredTime","absolutePlaylistEnd","mainSeekable","audioSeekable","oldDuration","newDuration","setDuration","mimeTypes","configureLoaderMimeTypes_","excludeIncompatibleVariants_","variant","codecString","variantCodecs","adOffset","adTotal","_segment$cueOutCont$s","_segment$cueOutCont$s2","updateAdCues","Representation","hlsHandler","loader","playlistUri","changePlaylistFn","mpc","masterPlaylistController_","qualityChangeFunction","smoothQualityChange","incompatible","currentlyEnabled","timerCancelEvents","PlaybackWatcher","consecutiveUpdates","lastRecordedTime","timer_","checkCurrentTimeTimeout_","canPlayHandler","monitorCurrentTime_","waitingHandler","techWaiting_","cancelTimerHandler","cancelTimer_","fixesBadSeeksHandler","fixesBadSeeks_","checkCurrentTime_","waiting_","afterSeekableWindow_","beforeSeekableWindow_","currentRange","livePoint","nextRange","videoUnderflow_","difference","skipTheGap_","gap","gapFromVideoUnderflow_","scheduledCurrentTime","gaps","findGaps","defaultOptions","errorInterval","getSource","IWillNotUseThisInPlugins","initPlugin","lastCalled","localOptions","loadedMetadataHandler","errorHandler","cleanupEvents","reloadSourceOnError","vhs","source_","Hls$1","STANDARD_PLAYLIST_SELECTOR","playerBandwidth","playerWidth","playerHeight","limitRenditionByPlayerDimensions","sortedPlaylistReps","enabledPlaylistReps","rep","bandwidthPlaylistReps","highestRemainingBandwidthRep","bandwidthBestRep","_chosenRep","haveResolution","resolutionBestRepList","resolutionBestRep","resolutionPlusOneList","resolutionPlusOneSmallest","resolutionPlusOneRep","chosenRep","simpleSelector","systemBandwidth","INITIAL_PLAYLIST_SELECTOR","comparePlaylistResolution","leftWidth","rightWidth","LOCAL_STORAGE_KEY$1","simpleTypeFromSourceType","handleHlsMediaChange","qualityLevels","selectedIndex_","setupEmeOptions","eme","sourceOptions","keySystemOptions","videoPlaylist","audioPlaylist","keySystemContentTypes","audioContentType","videoContentType","emeKeySystems","keySystems","initializeMediaKeys","getVhsLocalStorage","localStorage","storedObject","getItem","supportsNativeHls","canItPlay","supportsNativeDash","supportsTypeNatively","HlsHandler","dash","setOptions_","overrideNative","smoothQualityChange_","pauseLoading","useBandwidthFromLocalStorage","option","playbackWatcher_","invBandwidth","invThroughput","mediaRequests_","mediaRequestsAborted_","mediaRequestsTimedout_","mediaRequestsErrored_","mediaTransferDuration_","mediaBytesTransferred_","mediaSecondsLoaded_","currentTech","playerDimensions","objectToStore","setItem","updateVhsLocalStorage","setupQualityLevels_","qualityLevels_","addQualityLevel","HlsSourceHandler","_videojs$mergeOptions","supportedType","canUseMsePlayback","vttjs","WebVTT","VTTRegion","cueShim","regionShim","nativeVTTCue","nativeVTTRegion","shim","restore","_objCreate","F","ParsingError","errorData","parseTimeStamp","input","computeSeconds","f","Settings","parseOptions","keyValueDelim","groupDelim","kv","parseCue","regionList","oInput","consumeTimeStamp","Errors","BadTimeStamp","skipWhitespace","substr","region","alt","vals","vals0","integer","lineAlign","snapToLines","positionAlign","consumeCueSettings","BadSignature","dflt","defaultKey","ESCAPE","TAG_NAME","u","ruby","rt","TAG_ANNOTATION","NEEDS_PARENT","parseContent","nextToken","unescape1","shouldAdd","current","localName","createElement","annotation","rootDiv","tagStack","createTextNode","createProcessingInstruction","strongRTLRanges","isStrongRTLChar","determineBidi","nodeStack","pushNodes","nextTextNode","StyleBox","CueStyleBox","styleOptions","styles","display","writingMode","unicodeBidi","applyStyles","textAlign","font","whiteSpace","textPos","formatStyle","move","BoxPosition","lh","offsetTop","rects","getClientRects","lineHeight","moveBoxToLinePosition","styleBox","containerBox","boxPositions","boxPosition","linePos","textTrackList","mediaElement","computeLinePos","axis","maxPosition","initialAxis","calculatedPercentage","bestPosition","specifiedPosition","overlapsOppositeAxis","within","overlapsAny","intersectPercentage","findBestPosition","toCSSCompatValues","unit","toMove","overlaps","getSimpleBoxPosition","StringDecoder","decode","encodeURIComponent","convertCueToDOMTree","cuetext","processCues","overlay","paddedOverlay","margin","hasBeenReset","shouldCompute","TextDecoder","reportOrThrowError","collectNextLine","pos","parseHeader","parseTimestampMap","xy","anchor","lines","regionAnchorX","regionAnchorY","viewportAnchorX","viewportAnchorY","scroll","onregion","parseRegion","alreadyCollectedLine","hasSubstring","directionSetting","alignSetting","findAlignSetting","_id","_pauseOnExit","_startTime","_endTime","_text","_region","_vertical","_snapToLines","_line","_lineAlign","_position","_positionAlign","_size","_align","setting","findDirectionSetting","SyntaxError","getCueAsHTML","scrollSetting","isValidPercentValue","_lines","_regionAnchorX","_regionAnchorY","_viewportAnchorX","_viewportAnchorY","_scroll","findScrollSetting","isFunction","parseHeaders","xtend","initParams","createXHR","_createXHR","called","getBody","responseXML","firefoxBugTakenEffect","getXml","isJson","errorFunc","evt","timeoutTimer","failureResponse","loadFunc","useXDR","rawRequest","getAllResponseHeaders","XDomainRequest","XMLHttpRequest","onprogress","onabort","ontimeout","username","password","setRequestHeader","isEmpty","beforeSend","send"],"sourceRoot":""} \ No newline at end of file
+{"version":3,"file":"files_videoplayer-vendors-node_modules_video_js_dist_video_es_js.js?v=f87ebe9feae884a73782","mappings":";kKAEA,IAAIA,EAAa,EAAQ,MAErBC,EAAQC,OAAOC,UAAUC,SACzBC,EAAiBH,OAAOC,UAAUE,eAElCC,EAAe,SAAsBC,EAAOC,EAAUC,GACtD,IAAK,IAAIC,EAAI,EAAGC,EAAMJ,EAAMK,OAAQF,EAAIC,EAAKD,IACrCL,EAAeQ,KAAKN,EAAOG,KACX,MAAZD,EACAD,EAASD,EAAMG,GAAIA,EAAGH,GAEtBC,EAASK,KAAKJ,EAAUF,EAAMG,GAAIA,EAAGH,GAIrD,EAEIO,EAAgB,SAAuBC,EAAQP,EAAUC,GACzD,IAAK,IAAIC,EAAI,EAAGC,EAAMI,EAAOH,OAAQF,EAAIC,EAAKD,IAE1B,MAAZD,EACAD,EAASO,EAAOC,OAAON,GAAIA,EAAGK,GAE9BP,EAASK,KAAKJ,EAAUM,EAAOC,OAAON,GA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AQg7G,WAAWpkC,GAMvBA,EAAIqkC,KAAKp6E,GAAQ,MAEV+1C,CAGX,CA5NAvsF,EAAOC,QAAUivH,EACjBA,EAAUiB,eAAiB1vH,EAAO0vH,gBAyOlC,WAAiB,EAxOjBjB,EAAUgB,eAAiB,oBAAqB,IAAKhB,EAAUiB,eAAoBjB,EAAUiB,eAAiB1vH,EAAOyvH,eAUrH,SAAsB/wH,EAAOC,GACzB,IAAK,IAAIE,EAAI,EAAGA,EAAIH,EAAMK,OAAQF,IAC9BF,EAASD,EAAMG,GAEvB,CAZAJ,CAAa,CAAC,MAAO,MAAO,OAAQ,QAAS,OAAQ,WAAW,SAASi9B,GACrE+yF,EAAqB,WAAX/yF,EAAsB,MAAQA,GAAU,SAASxC,EAAKhkB,EAASwjC,GAGrE,OAFAxjC,EAAUs5G,EAAWt1F,EAAKhkB,EAASwjC,IAC3Bhd,OAASA,EAAOsV,cACjB09E,EAAWx5G,EACtB,CACJ,cChBA3V,EAAOC,QAIP,WAGI,IAFA,IAAIy3B,EAAS,CAAC,EAELp4B,EAAI,EAAGA,EAAIe,UAAUb,OAAQF,IAAK,CACvC,IAAIq4B,EAASt3B,UAAUf,GAEvB,IAAK,IAAIyL,KAAO4sB,EACR14B,EAAeQ,KAAKk4B,EAAQ5sB,KAC5B2sB,EAAO3sB,GAAO4sB,EAAO5sB,GAGjC,CAEA,OAAO2sB,CACX,EAhBA,IAAIz4B,EAAiBH,OAAOC,UAAUE","sources":["webpack:///files_videoplayer/node_modules/for-each/index.js","webpack:///files_videoplayer/node_modules/global/document.js","webpack:///files_videoplayer/node_modules/global/window.js","webpack:///files_videoplayer/node_modules/is-callable/index.js","webpack:///files_videoplayer/node_modules/is-function/index.js","webpack:///files_videoplayer/node_modules/mux.js/lib/aac/index.js","webpack:///files_videoplayer/node_modules/mux.js/lib/aac/utils.js","webpack:///files_videoplayer/node_modules/mux.js/lib/codecs/adts.js","webpack:///files_videoplayer/node_modules/mux.js/lib/codecs/h264.js","webpack:///files_videoplayer/node_modules/mux.js/lib/data/silence.js","webpack:///files_videoplayer/node_modules/mux.js/lib/m2ts/caption-stream.js","webpack:///files_videoplayer/node_modules/mux.js/lib/m2ts/m2ts.js","webpack:///files_videoplayer/node_modules/mux.js/lib/m2ts/metadata-stream.js","webpack:///files_videoplayer/node_modules/mux.js/lib/m2ts/probe.js","webpack:///files_videoplayer/node_modules/mux.js/lib/m2ts/stream-types.js","webpack:///files_videoplayer/node_modules/mux.js/lib/m2ts/timestamp-rollover-stream.js","webpack:///files_videoplayer/node_modules/mux.js/lib/mp4/audio-frame-utils.js","webpack:///files_videoplayer/node_modules/mux.js/lib/mp4/caption-parser.js","webpack:///files_videoplayer/node_modules/mux.js/lib/mp4/frame-utils.js","webpack:///files_videoplayer/node_modules/mux.js/lib/mp4/index.js","webpack:///files_videoplayer/node_modules/mux.js/lib/mp4/mp4-generator.js","webpack:///files_videoplayer/node_modules/mux.js/lib/mp4/probe.js","webpack:///files_videoplayer/node_modules/mux.js/lib/mp4/track-decode-info.js","webpack:///files_videoplayer/node_modules/mux.js/lib/mp4/transmuxer.js","webpack:///files_videoplayer/node_modules/mux.js/lib/tools/caption-packet-parser.js","webpack:///files_videoplayer/node_modules/mux.js/lib/tools/mp4-inspector.js","webpack:///files_videoplayer/node_modules/mux.js/lib/tools/ts-inspector.js","webpack:///files_videoplayer/node_modules/mux.js/lib/utils/bin.js","webpack:///files_videoplayer/node_modules/mux.js/lib/utils/clock.js","webpack:///files_videoplayer/node_modules/mux.js/lib/utils/exp-golomb.js","webpack:///files_videoplayer/node_modules/mux.js/lib/utils/stream.js","webpack:///files_videoplayer/node_modules/parse-headers/parse-headers.js","webpack:///files_videoplayer/node_modules/safe-json-parse/tuple.js","webpack:///files_videoplayer/node_modules/trim/index.js","webpack:///files_videoplayer/node_modules/tsml/tsml.js","webpack:///files_videoplayer/node_modules/url-toolkit/src/url-toolkit.js","webpack:///files_videoplayer/node_modules/m3u8-parser/dist/m3u8-parser.es.js","webpack:///files_videoplayer/node_modules/mpd-parser/dist/mpd-parser.es.js","webpack:///files_videoplayer/node_modules/pkcs7/dist/pkcs7.es.js","webpack:///files_videoplayer/node_modules/aes-decrypter/dist/aes-decrypter.es.js","webpack:///files_videoplayer/node_modules/video.js/dist/video.es.js","webpack:///files_videoplayer/node_modules/videojs-vtt.js/lib/browser-index.js","webpack:///files_videoplayer/node_modules/videojs-vtt.js/lib/vtt.js","webpack:///files_videoplayer/node_modules/videojs-vtt.js/lib/vttcue.js","webpack:///files_videoplayer/node_modules/videojs-vtt.js/lib/vttregion.js","webpack:///files_videoplayer/node_modules/xhr/index.js","webpack:///files_videoplayer/node_modules/xtend/immutable.js"],"sourcesContent":["'use strict';\n\nvar isCallable = require('is-callable');\n\nvar toStr = Object.prototype.toString;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar forEachArray = function forEachArray(array, iterator, receiver) {\n for (var i = 0, len = array.length; i < len; i++) {\n if (hasOwnProperty.call(array, i)) {\n if (receiver == null) {\n iterator(array[i], i, array);\n } else {\n iterator.call(receiver, array[i], i, array);\n }\n }\n }\n};\n\nvar forEachString = function forEachString(string, iterator, receiver) {\n for (var i = 0, len = string.length; i < len; i++) {\n // no such thing as a sparse string.\n if (receiver == null) {\n iterator(string.charAt(i), i, string);\n } else {\n iterator.call(receiver, string.charAt(i), i, string);\n }\n }\n};\n\nvar forEachObject = function forEachObject(object, iterator, receiver) {\n for (var k in object) {\n if (hasOwnProperty.call(object, k)) {\n if (receiver == null) {\n iterator(object[k], k, object);\n } else {\n iterator.call(receiver, object[k], k, object);\n }\n }\n }\n};\n\nvar forEach = function forEach(list, iterator, thisArg) {\n if (!isCallable(iterator)) {\n throw new TypeError('iterator must be a function');\n }\n\n var receiver;\n if (arguments.length >= 3) {\n receiver = thisArg;\n }\n\n if (toStr.call(list) === '[object Array]') {\n forEachArray(list, iterator, receiver);\n } else if (typeof list === 'string') {\n forEachString(list, iterator, receiver);\n } else {\n forEachObject(list, iterator, receiver);\n }\n};\n\nmodule.exports = forEach;\n","var topLevel = typeof global !== 'undefined' ? global :\n typeof window !== 'undefined' ? window : {}\nvar minDoc = require('min-document');\n\nvar doccy;\n\nif (typeof document !== 'undefined') {\n doccy = document;\n} else {\n doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'];\n\n if (!doccy) {\n doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'] = minDoc;\n }\n}\n\nmodule.exports = doccy;\n","var win;\n\nif (typeof window !== \"undefined\") {\n win = window;\n} else if (typeof global !== \"undefined\") {\n win = global;\n} else if (typeof self !== \"undefined\"){\n win = self;\n} else {\n win = {};\n}\n\nmodule.exports = win;\n","'use strict';\n\nvar fnToStr = Function.prototype.toString;\nvar reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply;\nvar badArrayLike;\nvar isCallableMarker;\nif (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') {\n\ttry {\n\t\tbadArrayLike = Object.defineProperty({}, 'length', {\n\t\t\tget: function () {\n\t\t\t\tthrow isCallableMarker;\n\t\t\t}\n\t\t});\n\t\tisCallableMarker = {};\n\t\t// eslint-disable-next-line no-throw-literal\n\t\treflectApply(function () { throw 42; }, null, badArrayLike);\n\t} catch (_) {\n\t\tif (_ !== isCallableMarker) {\n\t\t\treflectApply = null;\n\t\t}\n\t}\n} else {\n\treflectApply = null;\n}\n\nvar constructorRegex = /^\\s*class\\b/;\nvar isES6ClassFn = function isES6ClassFunction(value) {\n\ttry {\n\t\tvar fnStr = fnToStr.call(value);\n\t\treturn constructorRegex.test(fnStr);\n\t} catch (e) {\n\t\treturn false; // not a function\n\t}\n};\n\nvar tryFunctionObject = function tryFunctionToStr(value) {\n\ttry {\n\t\tif (isES6ClassFn(value)) { return false; }\n\t\tfnToStr.call(value);\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\nvar toStr = Object.prototype.toString;\nvar fnClass = '[object Function]';\nvar genClass = '[object GeneratorFunction]';\nvar hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';\n/* globals document: false */\nvar documentDotAll = typeof document === 'object' && typeof document.all === 'undefined' && document.all !== undefined ? document.all : {};\n\nmodule.exports = reflectApply\n\t? function isCallable(value) {\n\t\tif (value === documentDotAll) { return true; }\n\t\tif (!value) { return false; }\n\t\tif (typeof value !== 'function' && typeof value !== 'object') { return false; }\n\t\tif (typeof value === 'function' && !value.prototype) { return true; }\n\t\ttry {\n\t\t\treflectApply(value, null, badArrayLike);\n\t\t} catch (e) {\n\t\t\tif (e !== isCallableMarker) { return false; }\n\t\t}\n\t\treturn !isES6ClassFn(value);\n\t}\n\t: function isCallable(value) {\n\t\tif (value === documentDotAll) { return true; }\n\t\tif (!value) { return false; }\n\t\tif (typeof value !== 'function' && typeof value !== 'object') { return false; }\n\t\tif (typeof value === 'function' && !value.prototype) { return true; }\n\t\tif (hasToStringTag) { return tryFunctionObject(value); }\n\t\tif (isES6ClassFn(value)) { return false; }\n\t\tvar strClass = toStr.call(value);\n\t\treturn strClass === fnClass || strClass === genClass;\n\t};\n","module.exports = isFunction\n\nvar toString = Object.prototype.toString\n\nfunction isFunction (fn) {\n var string = toString.call(fn)\n return string === '[object Function]' ||\n (typeof fn === 'function' && string !== '[object RegExp]') ||\n (typeof window !== 'undefined' &&\n // IE8 and below\n (fn === window.setTimeout ||\n fn === window.alert ||\n fn === window.confirm ||\n fn === window.prompt))\n};\n","/**\n * mux.js\n *\n * Copyright (c) 2016 Brightcove\n * All rights reserved.\n *\n * A stream-based aac to mp4 converter. This utility can be used to\n * deliver mp4s to a SourceBuffer on platforms that support native\n * Media Source Extensions.\n */\n'use strict';\nvar Stream = require('../utils/stream.js');\nvar aacUtils = require('./utils');\n\n// Constants\nvar AacStream;\n\n/**\n * Splits an incoming stream of binary data into ADTS and ID3 Frames.\n */\n\nAacStream = function() {\n var\n everything = new Uint8Array(),\n timeStamp = 0;\n\n AacStream.prototype.init.call(this);\n\n this.setTimestamp = function(timestamp) {\n timeStamp = timestamp;\n };\n\n this.push = function(bytes) {\n var\n frameSize = 0,\n byteIndex = 0,\n bytesLeft,\n chunk,\n packet,\n tempLength;\n\n // If there are bytes remaining from the last segment, prepend them to the\n // bytes that were pushed in\n if (everything.length) {\n tempLength = everything.length;\n everything = new Uint8Array(bytes.byteLength + tempLength);\n everything.set(everything.subarray(0, tempLength));\n everything.set(bytes, tempLength);\n } else {\n everything = bytes;\n }\n\n while (everything.length - byteIndex >= 3) {\n if ((everything[byteIndex] === 'I'.charCodeAt(0)) &&\n (everything[byteIndex + 1] === 'D'.charCodeAt(0)) &&\n (everything[byteIndex + 2] === '3'.charCodeAt(0))) {\n\n // Exit early because we don't have enough to parse\n // the ID3 tag header\n if (everything.length - byteIndex < 10) {\n break;\n }\n\n // check framesize\n frameSize = aacUtils.parseId3TagSize(everything, byteIndex);\n\n // Exit early if we don't have enough in the buffer\n // to emit a full packet\n // Add to byteIndex to support multiple ID3 tags in sequence\n if (byteIndex + frameSize > everything.length) {\n break;\n }\n chunk = {\n type: 'timed-metadata',\n data: everything.subarray(byteIndex, byteIndex + frameSize)\n };\n this.trigger('data', chunk);\n byteIndex += frameSize;\n continue;\n } else if (((everything[byteIndex] & 0xff) === 0xff) &&\n ((everything[byteIndex + 1] & 0xf0) === 0xf0)) {\n\n // Exit early because we don't have enough to parse\n // the ADTS frame header\n if (everything.length - byteIndex < 7) {\n break;\n }\n\n frameSize = aacUtils.parseAdtsSize(everything, byteIndex);\n\n // Exit early if we don't have enough in the buffer\n // to emit a full packet\n if (byteIndex + frameSize > everything.length) {\n break;\n }\n\n packet = {\n type: 'audio',\n data: everything.subarray(byteIndex, byteIndex + frameSize),\n pts: timeStamp,\n dts: timeStamp\n };\n this.trigger('data', packet);\n byteIndex += frameSize;\n continue;\n }\n byteIndex++;\n }\n bytesLeft = everything.length - byteIndex;\n\n if (bytesLeft > 0) {\n everything = everything.subarray(byteIndex);\n } else {\n everything = new Uint8Array();\n }\n };\n};\n\nAacStream.prototype = new Stream();\n\nmodule.exports = AacStream;\n","/**\n * mux.js\n *\n * Copyright (c) 2016 Brightcove\n * All rights reserved.\n *\n * Utilities to detect basic properties and metadata about Aac data.\n */\n'use strict';\n\nvar ADTS_SAMPLING_FREQUENCIES = [\n 96000,\n 88200,\n 64000,\n 48000,\n 44100,\n 32000,\n 24000,\n 22050,\n 16000,\n 12000,\n 11025,\n 8000,\n 7350\n];\n\nvar isLikelyAacData = function(data) {\n if ((data[0] === 'I'.charCodeAt(0)) &&\n (data[1] === 'D'.charCodeAt(0)) &&\n (data[2] === '3'.charCodeAt(0))) {\n return true;\n }\n return false;\n};\n\nvar parseSyncSafeInteger = function(data) {\n return (data[0] << 21) |\n (data[1] << 14) |\n (data[2] << 7) |\n (data[3]);\n};\n\n// return a percent-encoded representation of the specified byte range\n// @see http://en.wikipedia.org/wiki/Percent-encoding\nvar percentEncode = function(bytes, start, end) {\n var i, result = '';\n for (i = start; i < end; i++) {\n result += '%' + ('00' + bytes[i].toString(16)).slice(-2);\n }\n return result;\n};\n\n// return the string representation of the specified byte range,\n// interpreted as ISO-8859-1.\nvar parseIso88591 = function(bytes, start, end) {\n return unescape(percentEncode(bytes, start, end)); // jshint ignore:line\n};\n\nvar parseId3TagSize = function(header, byteIndex) {\n var\n returnSize = (header[byteIndex + 6] << 21) |\n (header[byteIndex + 7] << 14) |\n (header[byteIndex + 8] << 7) |\n (header[byteIndex + 9]),\n flags = header[byteIndex + 5],\n footerPresent = (flags & 16) >> 4;\n\n if (footerPresent) {\n return returnSize + 20;\n }\n return returnSize + 10;\n};\n\nvar parseAdtsSize = function(header, byteIndex) {\n var\n lowThree = (header[byteIndex + 5] & 0xE0) >> 5,\n middle = header[byteIndex + 4] << 3,\n highTwo = header[byteIndex + 3] & 0x3 << 11;\n\n return (highTwo | middle) | lowThree;\n};\n\nvar parseType = function(header, byteIndex) {\n if ((header[byteIndex] === 'I'.charCodeAt(0)) &&\n (header[byteIndex + 1] === 'D'.charCodeAt(0)) &&\n (header[byteIndex + 2] === '3'.charCodeAt(0))) {\n return 'timed-metadata';\n } else if ((header[byteIndex] & 0xff === 0xff) &&\n ((header[byteIndex + 1] & 0xf0) === 0xf0)) {\n return 'audio';\n }\n return null;\n};\n\nvar parseSampleRate = function(packet) {\n var i = 0;\n\n while (i + 5 < packet.length) {\n if (packet[i] !== 0xFF || (packet[i + 1] & 0xF6) !== 0xF0) {\n // If a valid header was not found, jump one forward and attempt to\n // find a valid ADTS header starting at the next byte\n i++;\n continue;\n }\n return ADTS_SAMPLING_FREQUENCIES[(packet[i + 2] & 0x3c) >>> 2];\n }\n\n return null;\n};\n\nvar parseAacTimestamp = function(packet) {\n var frameStart, frameSize, frame, frameHeader;\n\n // find the start of the first frame and the end of the tag\n frameStart = 10;\n if (packet[5] & 0x40) {\n // advance the frame start past the extended header\n frameStart += 4; // header size field\n frameStart += parseSyncSafeInteger(packet.subarray(10, 14));\n }\n\n // parse one or more ID3 frames\n // http://id3.org/id3v2.3.0#ID3v2_frame_overview\n do {\n // determine the number of bytes in this frame\n frameSize = parseSyncSafeInteger(packet.subarray(frameStart + 4, frameStart + 8));\n if (frameSize < 1) {\n return null;\n }\n frameHeader = String.fromCharCode(packet[frameStart],\n packet[frameStart + 1],\n packet[frameStart + 2],\n packet[frameStart + 3]);\n\n if (frameHeader === 'PRIV') {\n frame = packet.subarray(frameStart + 10, frameStart + frameSize + 10);\n\n for (var i = 0; i < frame.byteLength; i++) {\n if (frame[i] === 0) {\n var owner = parseIso88591(frame, 0, i);\n if (owner === 'com.apple.streaming.transportStreamTimestamp') {\n var d = frame.subarray(i + 1);\n var size = ((d[3] & 0x01) << 30) |\n (d[4] << 22) |\n (d[5] << 14) |\n (d[6] << 6) |\n (d[7] >>> 2);\n size *= 4;\n size += d[7] & 0x03;\n\n return size;\n }\n break;\n }\n }\n }\n\n frameStart += 10; // advance past the frame header\n frameStart += frameSize; // advance past the frame body\n } while (frameStart < packet.byteLength);\n return null;\n};\n\nmodule.exports = {\n isLikelyAacData: isLikelyAacData,\n parseId3TagSize: parseId3TagSize,\n parseAdtsSize: parseAdtsSize,\n parseType: parseType,\n parseSampleRate: parseSampleRate,\n parseAacTimestamp: parseAacTimestamp\n};\n","'use strict';\n\nvar Stream = require('../utils/stream.js');\n\nvar AdtsStream;\n\nvar\n ADTS_SAMPLING_FREQUENCIES = [\n 96000,\n 88200,\n 64000,\n 48000,\n 44100,\n 32000,\n 24000,\n 22050,\n 16000,\n 12000,\n 11025,\n 8000,\n 7350\n ];\n\n/*\n * Accepts a ElementaryStream and emits data events with parsed\n * AAC Audio Frames of the individual packets. Input audio in ADTS\n * format is unpacked and re-emitted as AAC frames.\n *\n * @see http://wiki.multimedia.cx/index.php?title=ADTS\n * @see http://wiki.multimedia.cx/?title=Understanding_AAC\n */\nAdtsStream = function() {\n var buffer;\n\n AdtsStream.prototype.init.call(this);\n\n this.push = function(packet) {\n var\n i = 0,\n frameNum = 0,\n frameLength,\n protectionSkipBytes,\n frameEnd,\n oldBuffer,\n sampleCount,\n adtsFrameDuration;\n\n if (packet.type !== 'audio') {\n // ignore non-audio data\n return;\n }\n\n // Prepend any data in the buffer to the input data so that we can parse\n // aac frames the cross a PES packet boundary\n if (buffer) {\n oldBuffer = buffer;\n buffer = new Uint8Array(oldBuffer.byteLength + packet.data.byteLength);\n buffer.set(oldBuffer);\n buffer.set(packet.data, oldBuffer.byteLength);\n } else {\n buffer = packet.data;\n }\n\n // unpack any ADTS frames which have been fully received\n // for details on the ADTS header, see http://wiki.multimedia.cx/index.php?title=ADTS\n while (i + 5 < buffer.length) {\n\n // Loook for the start of an ADTS header..\n if (buffer[i] !== 0xFF || (buffer[i + 1] & 0xF6) !== 0xF0) {\n // If a valid header was not found, jump one forward and attempt to\n // find a valid ADTS header starting at the next byte\n i++;\n continue;\n }\n\n // The protection skip bit tells us if we have 2 bytes of CRC data at the\n // end of the ADTS header\n protectionSkipBytes = (~buffer[i + 1] & 0x01) * 2;\n\n // Frame length is a 13 bit integer starting 16 bits from the\n // end of the sync sequence\n frameLength = ((buffer[i + 3] & 0x03) << 11) |\n (buffer[i + 4] << 3) |\n ((buffer[i + 5] & 0xe0) >> 5);\n\n sampleCount = ((buffer[i + 6] & 0x03) + 1) * 1024;\n adtsFrameDuration = (sampleCount * 90000) /\n ADTS_SAMPLING_FREQUENCIES[(buffer[i + 2] & 0x3c) >>> 2];\n\n frameEnd = i + frameLength;\n\n // If we don't have enough data to actually finish this ADTS frame, return\n // and wait for more data\n if (buffer.byteLength < frameEnd) {\n return;\n }\n\n // Otherwise, deliver the complete AAC frame\n this.trigger('data', {\n pts: packet.pts + (frameNum * adtsFrameDuration),\n dts: packet.dts + (frameNum * adtsFrameDuration),\n sampleCount: sampleCount,\n audioobjecttype: ((buffer[i + 2] >>> 6) & 0x03) + 1,\n channelcount: ((buffer[i + 2] & 1) << 2) |\n ((buffer[i + 3] & 0xc0) >>> 6),\n samplerate: ADTS_SAMPLING_FREQUENCIES[(buffer[i + 2] & 0x3c) >>> 2],\n samplingfrequencyindex: (buffer[i + 2] & 0x3c) >>> 2,\n // assume ISO/IEC 14496-12 AudioSampleEntry default of 16\n samplesize: 16,\n data: buffer.subarray(i + 7 + protectionSkipBytes, frameEnd)\n });\n\n // If the buffer is empty, clear it and return\n if (buffer.byteLength === frameEnd) {\n buffer = undefined;\n return;\n }\n\n frameNum++;\n\n // Remove the finished frame from the buffer and start the process again\n buffer = buffer.subarray(frameEnd);\n }\n };\n this.flush = function() {\n this.trigger('done');\n };\n};\n\nAdtsStream.prototype = new Stream();\n\nmodule.exports = AdtsStream;\n","'use strict';\n\nvar Stream = require('../utils/stream.js');\nvar ExpGolomb = require('../utils/exp-golomb.js');\n\nvar H264Stream, NalByteStream;\nvar PROFILES_WITH_OPTIONAL_SPS_DATA;\n\n/**\n * Accepts a NAL unit byte stream and unpacks the embedded NAL units.\n */\nNalByteStream = function() {\n var\n syncPoint = 0,\n i,\n buffer;\n NalByteStream.prototype.init.call(this);\n\n /*\n * Scans a byte stream and triggers a data event with the NAL units found.\n * @param {Object} data Event received from H264Stream\n * @param {Uint8Array} data.data The h264 byte stream to be scanned\n *\n * @see H264Stream.push\n */\n this.push = function(data) {\n var swapBuffer;\n\n if (!buffer) {\n buffer = data.data;\n } else {\n swapBuffer = new Uint8Array(buffer.byteLength + data.data.byteLength);\n swapBuffer.set(buffer);\n swapBuffer.set(data.data, buffer.byteLength);\n buffer = swapBuffer;\n }\n\n // Rec. ITU-T H.264, Annex B\n // scan for NAL unit boundaries\n\n // a match looks like this:\n // 0 0 1 .. NAL .. 0 0 1\n // ^ sync point ^ i\n // or this:\n // 0 0 1 .. NAL .. 0 0 0\n // ^ sync point ^ i\n\n // advance the sync point to a NAL start, if necessary\n for (; syncPoint < buffer.byteLength - 3; syncPoint++) {\n if (buffer[syncPoint + 2] === 1) {\n // the sync point is properly aligned\n i = syncPoint + 5;\n break;\n }\n }\n\n while (i < buffer.byteLength) {\n // look at the current byte to determine if we've hit the end of\n // a NAL unit boundary\n switch (buffer[i]) {\n case 0:\n // skip past non-sync sequences\n if (buffer[i - 1] !== 0) {\n i += 2;\n break;\n } else if (buffer[i - 2] !== 0) {\n i++;\n break;\n }\n\n // deliver the NAL unit if it isn't empty\n if (syncPoint + 3 !== i - 2) {\n this.trigger('data', buffer.subarray(syncPoint + 3, i - 2));\n }\n\n // drop trailing zeroes\n do {\n i++;\n } while (buffer[i] !== 1 && i < buffer.length);\n syncPoint = i - 2;\n i += 3;\n break;\n case 1:\n // skip past non-sync sequences\n if (buffer[i - 1] !== 0 ||\n buffer[i - 2] !== 0) {\n i += 3;\n break;\n }\n\n // deliver the NAL unit\n this.trigger('data', buffer.subarray(syncPoint + 3, i - 2));\n syncPoint = i - 2;\n i += 3;\n break;\n default:\n // the current byte isn't a one or zero, so it cannot be part\n // of a sync sequence\n i += 3;\n break;\n }\n }\n // filter out the NAL units that were delivered\n buffer = buffer.subarray(syncPoint);\n i -= syncPoint;\n syncPoint = 0;\n };\n\n this.flush = function() {\n // deliver the last buffered NAL unit\n if (buffer && buffer.byteLength > 3) {\n this.trigger('data', buffer.subarray(syncPoint + 3));\n }\n // reset the stream state\n buffer = null;\n syncPoint = 0;\n this.trigger('done');\n };\n};\nNalByteStream.prototype = new Stream();\n\n// values of profile_idc that indicate additional fields are included in the SPS\n// see Recommendation ITU-T H.264 (4/2013),\n// 7.3.2.1.1 Sequence parameter set data syntax\nPROFILES_WITH_OPTIONAL_SPS_DATA = {\n 100: true,\n 110: true,\n 122: true,\n 244: true,\n 44: true,\n 83: true,\n 86: true,\n 118: true,\n 128: true,\n 138: true,\n 139: true,\n 134: true\n};\n\n/**\n * Accepts input from a ElementaryStream and produces H.264 NAL unit data\n * events.\n */\nH264Stream = function() {\n var\n nalByteStream = new NalByteStream(),\n self,\n trackId,\n currentPts,\n currentDts,\n\n discardEmulationPreventionBytes,\n readSequenceParameterSet,\n skipScalingList;\n\n H264Stream.prototype.init.call(this);\n self = this;\n\n /*\n * Pushes a packet from a stream onto the NalByteStream\n *\n * @param {Object} packet - A packet received from a stream\n * @param {Uint8Array} packet.data - The raw bytes of the packet\n * @param {Number} packet.dts - Decode timestamp of the packet\n * @param {Number} packet.pts - Presentation timestamp of the packet\n * @param {Number} packet.trackId - The id of the h264 track this packet came from\n * @param {('video'|'audio')} packet.type - The type of packet\n *\n */\n this.push = function(packet) {\n if (packet.type !== 'video') {\n return;\n }\n trackId = packet.trackId;\n currentPts = packet.pts;\n currentDts = packet.dts;\n\n nalByteStream.push(packet);\n };\n\n /*\n * Identify NAL unit types and pass on the NALU, trackId, presentation and decode timestamps\n * for the NALUs to the next stream component.\n * Also, preprocess caption and sequence parameter NALUs.\n *\n * @param {Uint8Array} data - A NAL unit identified by `NalByteStream.push`\n * @see NalByteStream.push\n */\n nalByteStream.on('data', function(data) {\n var\n event = {\n trackId: trackId,\n pts: currentPts,\n dts: currentDts,\n data: data\n };\n\n switch (data[0] & 0x1f) {\n case 0x05:\n event.nalUnitType = 'slice_layer_without_partitioning_rbsp_idr';\n break;\n case 0x06:\n event.nalUnitType = 'sei_rbsp';\n event.escapedRBSP = discardEmulationPreventionBytes(data.subarray(1));\n break;\n case 0x07:\n event.nalUnitType = 'seq_parameter_set_rbsp';\n event.escapedRBSP = discardEmulationPreventionBytes(data.subarray(1));\n event.config = readSequenceParameterSet(event.escapedRBSP);\n break;\n case 0x08:\n event.nalUnitType = 'pic_parameter_set_rbsp';\n break;\n case 0x09:\n event.nalUnitType = 'access_unit_delimiter_rbsp';\n break;\n\n default:\n break;\n }\n // This triggers data on the H264Stream\n self.trigger('data', event);\n });\n nalByteStream.on('done', function() {\n self.trigger('done');\n });\n\n this.flush = function() {\n nalByteStream.flush();\n };\n\n /**\n * Advance the ExpGolomb decoder past a scaling list. The scaling\n * list is optionally transmitted as part of a sequence parameter\n * set and is not relevant to transmuxing.\n * @param count {number} the number of entries in this scaling list\n * @param expGolombDecoder {object} an ExpGolomb pointed to the\n * start of a scaling list\n * @see Recommendation ITU-T H.264, Section 7.3.2.1.1.1\n */\n skipScalingList = function(count, expGolombDecoder) {\n var\n lastScale = 8,\n nextScale = 8,\n j,\n deltaScale;\n\n for (j = 0; j < count; j++) {\n if (nextScale !== 0) {\n deltaScale = expGolombDecoder.readExpGolomb();\n nextScale = (lastScale + deltaScale + 256) % 256;\n }\n\n lastScale = (nextScale === 0) ? lastScale : nextScale;\n }\n };\n\n /**\n * Expunge any \"Emulation Prevention\" bytes from a \"Raw Byte\n * Sequence Payload\"\n * @param data {Uint8Array} the bytes of a RBSP from a NAL\n * unit\n * @return {Uint8Array} the RBSP without any Emulation\n * Prevention Bytes\n */\n discardEmulationPreventionBytes = function(data) {\n var\n length = data.byteLength,\n emulationPreventionBytesPositions = [],\n i = 1,\n newLength, newData;\n\n // Find all `Emulation Prevention Bytes`\n while (i < length - 2) {\n if (data[i] === 0 && data[i + 1] === 0 && data[i + 2] === 0x03) {\n emulationPreventionBytesPositions.push(i + 2);\n i += 2;\n } else {\n i++;\n }\n }\n\n // If no Emulation Prevention Bytes were found just return the original\n // array\n if (emulationPreventionBytesPositions.length === 0) {\n return data;\n }\n\n // Create a new array to hold the NAL unit data\n newLength = length - emulationPreventionBytesPositions.length;\n newData = new Uint8Array(newLength);\n var sourceIndex = 0;\n\n for (i = 0; i < newLength; sourceIndex++, i++) {\n if (sourceIndex === emulationPreventionBytesPositions[0]) {\n // Skip this byte\n sourceIndex++;\n // Remove this position index\n emulationPreventionBytesPositions.shift();\n }\n newData[i] = data[sourceIndex];\n }\n\n return newData;\n };\n\n /**\n * Read a sequence parameter set and return some interesting video\n * properties. A sequence parameter set is the H264 metadata that\n * describes the properties of upcoming video frames.\n * @param data {Uint8Array} the bytes of a sequence parameter set\n * @return {object} an object with configuration parsed from the\n * sequence parameter set, including the dimensions of the\n * associated video frames.\n */\n readSequenceParameterSet = function(data) {\n var\n frameCropLeftOffset = 0,\n frameCropRightOffset = 0,\n frameCropTopOffset = 0,\n frameCropBottomOffset = 0,\n sarScale = 1,\n expGolombDecoder, profileIdc, levelIdc, profileCompatibility,\n chromaFormatIdc, picOrderCntType,\n numRefFramesInPicOrderCntCycle, picWidthInMbsMinus1,\n picHeightInMapUnitsMinus1,\n frameMbsOnlyFlag,\n scalingListCount,\n sarRatio,\n aspectRatioIdc,\n i;\n\n expGolombDecoder = new ExpGolomb(data);\n profileIdc = expGolombDecoder.readUnsignedByte(); // profile_idc\n profileCompatibility = expGolombDecoder.readUnsignedByte(); // constraint_set[0-5]_flag\n levelIdc = expGolombDecoder.readUnsignedByte(); // level_idc u(8)\n expGolombDecoder.skipUnsignedExpGolomb(); // seq_parameter_set_id\n\n // some profiles have more optional data we don't need\n if (PROFILES_WITH_OPTIONAL_SPS_DATA[profileIdc]) {\n chromaFormatIdc = expGolombDecoder.readUnsignedExpGolomb();\n if (chromaFormatIdc === 3) {\n expGolombDecoder.skipBits(1); // separate_colour_plane_flag\n }\n expGolombDecoder.skipUnsignedExpGolomb(); // bit_depth_luma_minus8\n expGolombDecoder.skipUnsignedExpGolomb(); // bit_depth_chroma_minus8\n expGolombDecoder.skipBits(1); // qpprime_y_zero_transform_bypass_flag\n if (expGolombDecoder.readBoolean()) { // seq_scaling_matrix_present_flag\n scalingListCount = (chromaFormatIdc !== 3) ? 8 : 12;\n for (i = 0; i < scalingListCount; i++) {\n if (expGolombDecoder.readBoolean()) { // seq_scaling_list_present_flag[ i ]\n if (i < 6) {\n skipScalingList(16, expGolombDecoder);\n } else {\n skipScalingList(64, expGolombDecoder);\n }\n }\n }\n }\n }\n\n expGolombDecoder.skipUnsignedExpGolomb(); // log2_max_frame_num_minus4\n picOrderCntType = expGolombDecoder.readUnsignedExpGolomb();\n\n if (picOrderCntType === 0) {\n expGolombDecoder.readUnsignedExpGolomb(); // log2_max_pic_order_cnt_lsb_minus4\n } else if (picOrderCntType === 1) {\n expGolombDecoder.skipBits(1); // delta_pic_order_always_zero_flag\n expGolombDecoder.skipExpGolomb(); // offset_for_non_ref_pic\n expGolombDecoder.skipExpGolomb(); // offset_for_top_to_bottom_field\n numRefFramesInPicOrderCntCycle = expGolombDecoder.readUnsignedExpGolomb();\n for (i = 0; i < numRefFramesInPicOrderCntCycle; i++) {\n expGolombDecoder.skipExpGolomb(); // offset_for_ref_frame[ i ]\n }\n }\n\n expGolombDecoder.skipUnsignedExpGolomb(); // max_num_ref_frames\n expGolombDecoder.skipBits(1); // gaps_in_frame_num_value_allowed_flag\n\n picWidthInMbsMinus1 = expGolombDecoder.readUnsignedExpGolomb();\n picHeightInMapUnitsMinus1 = expGolombDecoder.readUnsignedExpGolomb();\n\n frameMbsOnlyFlag = expGolombDecoder.readBits(1);\n if (frameMbsOnlyFlag === 0) {\n expGolombDecoder.skipBits(1); // mb_adaptive_frame_field_flag\n }\n\n expGolombDecoder.skipBits(1); // direct_8x8_inference_flag\n if (expGolombDecoder.readBoolean()) { // frame_cropping_flag\n frameCropLeftOffset = expGolombDecoder.readUnsignedExpGolomb();\n frameCropRightOffset = expGolombDecoder.readUnsignedExpGolomb();\n frameCropTopOffset = expGolombDecoder.readUnsignedExpGolomb();\n frameCropBottomOffset = expGolombDecoder.readUnsignedExpGolomb();\n }\n if (expGolombDecoder.readBoolean()) {\n // vui_parameters_present_flag\n if (expGolombDecoder.readBoolean()) {\n // aspect_ratio_info_present_flag\n aspectRatioIdc = expGolombDecoder.readUnsignedByte();\n switch (aspectRatioIdc) {\n case 1: sarRatio = [1, 1]; break;\n case 2: sarRatio = [12, 11]; break;\n case 3: sarRatio = [10, 11]; break;\n case 4: sarRatio = [16, 11]; break;\n case 5: sarRatio = [40, 33]; break;\n case 6: sarRatio = [24, 11]; break;\n case 7: sarRatio = [20, 11]; break;\n case 8: sarRatio = [32, 11]; break;\n case 9: sarRatio = [80, 33]; break;\n case 10: sarRatio = [18, 11]; break;\n case 11: sarRatio = [15, 11]; break;\n case 12: sarRatio = [64, 33]; break;\n case 13: sarRatio = [160, 99]; break;\n case 14: sarRatio = [4, 3]; break;\n case 15: sarRatio = [3, 2]; break;\n case 16: sarRatio = [2, 1]; break;\n case 255: {\n sarRatio = [expGolombDecoder.readUnsignedByte() << 8 |\n expGolombDecoder.readUnsignedByte(),\n expGolombDecoder.readUnsignedByte() << 8 |\n expGolombDecoder.readUnsignedByte() ];\n break;\n }\n }\n if (sarRatio) {\n sarScale = sarRatio[0] / sarRatio[1];\n }\n }\n }\n return {\n profileIdc: profileIdc,\n levelIdc: levelIdc,\n profileCompatibility: profileCompatibility,\n width: Math.ceil((((picWidthInMbsMinus1 + 1) * 16) - frameCropLeftOffset * 2 - frameCropRightOffset * 2) * sarScale),\n height: ((2 - frameMbsOnlyFlag) * (picHeightInMapUnitsMinus1 + 1) * 16) - (frameCropTopOffset * 2) - (frameCropBottomOffset * 2)\n };\n };\n\n};\nH264Stream.prototype = new Stream();\n\nmodule.exports = {\n H264Stream: H264Stream,\n NalByteStream: NalByteStream\n};\n","var highPrefix = [33, 16, 5, 32, 164, 27];\nvar lowPrefix = [33, 65, 108, 84, 1, 2, 4, 8, 168, 2, 4, 8, 17, 191, 252];\nvar zeroFill = function(count) {\n var a = [];\n while (count--) {\n a.push(0);\n }\n return a;\n};\n\nvar makeTable = function(metaTable) {\n return Object.keys(metaTable).reduce(function(obj, key) {\n obj[key] = new Uint8Array(metaTable[key].reduce(function(arr, part) {\n return arr.concat(part);\n }, []));\n return obj;\n }, {});\n};\n\n// Frames-of-silence to use for filling in missing AAC frames\nvar coneOfSilence = {\n 96000: [highPrefix, [227, 64], zeroFill(154), [56]],\n 88200: [highPrefix, [231], zeroFill(170), [56]],\n 64000: [highPrefix, [248, 192], zeroFill(240), [56]],\n 48000: [highPrefix, [255, 192], zeroFill(268), [55, 148, 128], zeroFill(54), [112]],\n 44100: [highPrefix, [255, 192], zeroFill(268), [55, 163, 128], zeroFill(84), [112]],\n 32000: [highPrefix, [255, 192], zeroFill(268), [55, 234], zeroFill(226), [112]],\n 24000: [highPrefix, [255, 192], zeroFill(268), [55, 255, 128], zeroFill(268), [111, 112], zeroFill(126), [224]],\n 16000: [highPrefix, [255, 192], zeroFill(268), [55, 255, 128], zeroFill(268), [111, 255], zeroFill(269), [223, 108], zeroFill(195), [1, 192]],\n 12000: [lowPrefix, zeroFill(268), [3, 127, 248], zeroFill(268), [6, 255, 240], zeroFill(268), [13, 255, 224], zeroFill(268), [27, 253, 128], zeroFill(259), [56]],\n 11025: [lowPrefix, zeroFill(268), [3, 127, 248], zeroFill(268), [6, 255, 240], zeroFill(268), [13, 255, 224], zeroFill(268), [27, 255, 192], zeroFill(268), [55, 175, 128], zeroFill(108), [112]],\n 8000: [lowPrefix, zeroFill(268), [3, 121, 16], zeroFill(47), [7]]\n};\n\nmodule.exports = makeTable(coneOfSilence);\n","/**\n * mux.js\n *\n * Copyright (c) 2015 Brightcove\n * All rights reserved.\n *\n * Reads in-band caption information from a video elementary\n * stream. Captions must follow the CEA-708 standard for injection\n * into an MPEG-2 transport streams.\n * @see https://en.wikipedia.org/wiki/CEA-708\n * @see https://www.gpo.gov/fdsys/pkg/CFR-2007-title47-vol1/pdf/CFR-2007-title47-vol1-sec15-119.pdf\n */\n\n'use strict';\n\n// -----------------\n// Link To Transport\n// -----------------\n\nvar Stream = require('../utils/stream');\nvar cea708Parser = require('../tools/caption-packet-parser');\n\nvar CaptionStream = function() {\n\n CaptionStream.prototype.init.call(this);\n\n this.captionPackets_ = [];\n\n this.ccStreams_ = [\n new Cea608Stream(0, 0), // eslint-disable-line no-use-before-define\n new Cea608Stream(0, 1), // eslint-disable-line no-use-before-define\n new Cea608Stream(1, 0), // eslint-disable-line no-use-before-define\n new Cea608Stream(1, 1) // eslint-disable-line no-use-before-define\n ];\n\n this.reset();\n\n // forward data and done events from CCs to this CaptionStream\n this.ccStreams_.forEach(function(cc) {\n cc.on('data', this.trigger.bind(this, 'data'));\n cc.on('done', this.trigger.bind(this, 'done'));\n }, this);\n\n};\n\nCaptionStream.prototype = new Stream();\nCaptionStream.prototype.push = function(event) {\n var sei, userData, newCaptionPackets;\n\n // only examine SEI NALs\n if (event.nalUnitType !== 'sei_rbsp') {\n return;\n }\n\n // parse the sei\n sei = cea708Parser.parseSei(event.escapedRBSP);\n\n // ignore everything but user_data_registered_itu_t_t35\n if (sei.payloadType !== cea708Parser.USER_DATA_REGISTERED_ITU_T_T35) {\n return;\n }\n\n // parse out the user data payload\n userData = cea708Parser.parseUserData(sei);\n\n // ignore unrecognized userData\n if (!userData) {\n return;\n }\n\n // Sometimes, the same segment # will be downloaded twice. To stop the\n // caption data from being processed twice, we track the latest dts we've\n // received and ignore everything with a dts before that. However, since\n // data for a specific dts can be split across packets on either side of\n // a segment boundary, we need to make sure we *don't* ignore the packets\n // from the *next* segment that have dts === this.latestDts_. By constantly\n // tracking the number of packets received with dts === this.latestDts_, we\n // know how many should be ignored once we start receiving duplicates.\n if (event.dts < this.latestDts_) {\n // We've started getting older data, so set the flag.\n this.ignoreNextEqualDts_ = true;\n return;\n } else if ((event.dts === this.latestDts_) && (this.ignoreNextEqualDts_)) {\n this.numSameDts_--;\n if (!this.numSameDts_) {\n // We've received the last duplicate packet, time to start processing again\n this.ignoreNextEqualDts_ = false;\n }\n return;\n }\n\n // parse out CC data packets and save them for later\n newCaptionPackets = cea708Parser.parseCaptionPackets(event.pts, userData);\n this.captionPackets_ = this.captionPackets_.concat(newCaptionPackets);\n if (this.latestDts_ !== event.dts) {\n this.numSameDts_ = 0;\n }\n this.numSameDts_++;\n this.latestDts_ = event.dts;\n};\n\nCaptionStream.prototype.flush = function() {\n // make sure we actually parsed captions before proceeding\n if (!this.captionPackets_.length) {\n this.ccStreams_.forEach(function(cc) {\n cc.flush();\n }, this);\n return;\n }\n\n // In Chrome, the Array#sort function is not stable so add a\n // presortIndex that we can use to ensure we get a stable-sort\n this.captionPackets_.forEach(function(elem, idx) {\n elem.presortIndex = idx;\n });\n\n // sort caption byte-pairs based on their PTS values\n this.captionPackets_.sort(function(a, b) {\n if (a.pts === b.pts) {\n return a.presortIndex - b.presortIndex;\n }\n return a.pts - b.pts;\n });\n\n this.captionPackets_.forEach(function(packet) {\n if (packet.type < 2) {\n // Dispatch packet to the right Cea608Stream\n this.dispatchCea608Packet(packet);\n }\n // this is where an 'else' would go for a dispatching packets\n // to a theoretical Cea708Stream that handles SERVICEn data\n }, this);\n\n this.captionPackets_.length = 0;\n this.ccStreams_.forEach(function(cc) {\n cc.flush();\n }, this);\n return;\n};\n\nCaptionStream.prototype.reset = function() {\n this.latestDts_ = null;\n this.ignoreNextEqualDts_ = false;\n this.numSameDts_ = 0;\n this.activeCea608Channel_ = [null, null];\n this.ccStreams_.forEach(function(ccStream) {\n ccStream.reset();\n });\n};\n\nCaptionStream.prototype.dispatchCea608Packet = function(packet) {\n // NOTE: packet.type is the CEA608 field\n if (this.setsChannel1Active(packet)) {\n this.activeCea608Channel_[packet.type] = 0;\n } else if (this.setsChannel2Active(packet)) {\n this.activeCea608Channel_[packet.type] = 1;\n }\n if (this.activeCea608Channel_[packet.type] === null) {\n // If we haven't received anything to set the active channel, discard the\n // data; we don't want jumbled captions\n return;\n }\n this.ccStreams_[(packet.type << 1) + this.activeCea608Channel_[packet.type]].push(packet);\n};\n\nCaptionStream.prototype.setsChannel1Active = function(packet) {\n return ((packet.ccData & 0x7800) === 0x1000);\n};\nCaptionStream.prototype.setsChannel2Active = function(packet) {\n return ((packet.ccData & 0x7800) === 0x1800);\n};\n\n// ----------------------\n// Session to Application\n// ----------------------\n\n// This hash maps non-ASCII, special, and extended character codes to their\n// proper Unicode equivalent. The first keys that are only a single byte\n// are the non-standard ASCII characters, which simply map the CEA608 byte\n// to the standard ASCII/Unicode. The two-byte keys that follow are the CEA608\n// character codes, but have their MSB bitmasked with 0x03 so that a lookup\n// can be performed regardless of the field and data channel on which the\n// character code was received.\nvar CHARACTER_TRANSLATION = {\n 0x2a: 0xe1, // á\n 0x5c: 0xe9, // é\n 0x5e: 0xed, // í\n 0x5f: 0xf3, // ó\n 0x60: 0xfa, // ú\n 0x7b: 0xe7, // ç\n 0x7c: 0xf7, // ÷\n 0x7d: 0xd1, // Ñ\n 0x7e: 0xf1, // ñ\n 0x7f: 0x2588, // █\n 0x0130: 0xae, // ®\n 0x0131: 0xb0, // °\n 0x0132: 0xbd, // ½\n 0x0133: 0xbf, // ¿\n 0x0134: 0x2122, // ™\n 0x0135: 0xa2, // ¢\n 0x0136: 0xa3, // £\n 0x0137: 0x266a, // ♪\n 0x0138: 0xe0, // à\n 0x0139: 0xa0, //\n 0x013a: 0xe8, // è\n 0x013b: 0xe2, // â\n 0x013c: 0xea, // ê\n 0x013d: 0xee, // î\n 0x013e: 0xf4, // ô\n 0x013f: 0xfb, // û\n 0x0220: 0xc1, // Á\n 0x0221: 0xc9, // É\n 0x0222: 0xd3, // Ó\n 0x0223: 0xda, // Ú\n 0x0224: 0xdc, // Ü\n 0x0225: 0xfc, // ü\n 0x0226: 0x2018, // ‘\n 0x0227: 0xa1, // ¡\n 0x0228: 0x2a, // *\n 0x0229: 0x27, // '\n 0x022a: 0x2014, // —\n 0x022b: 0xa9, // ©\n 0x022c: 0x2120, // ℠\n 0x022d: 0x2022, // •\n 0x022e: 0x201c, // “\n 0x022f: 0x201d, // ”\n 0x0230: 0xc0, // À\n 0x0231: 0xc2, // Â\n 0x0232: 0xc7, // Ç\n 0x0233: 0xc8, // È\n 0x0234: 0xca, // Ê\n 0x0235: 0xcb, // Ë\n 0x0236: 0xeb, // ë\n 0x0237: 0xce, // Î\n 0x0238: 0xcf, // Ï\n 0x0239: 0xef, // ï\n 0x023a: 0xd4, // Ô\n 0x023b: 0xd9, // Ù\n 0x023c: 0xf9, // ù\n 0x023d: 0xdb, // Û\n 0x023e: 0xab, // «\n 0x023f: 0xbb, // »\n 0x0320: 0xc3, // Ã\n 0x0321: 0xe3, // ã\n 0x0322: 0xcd, // Í\n 0x0323: 0xcc, // Ì\n 0x0324: 0xec, // ì\n 0x0325: 0xd2, // Ò\n 0x0326: 0xf2, // ò\n 0x0327: 0xd5, // Õ\n 0x0328: 0xf5, // õ\n 0x0329: 0x7b, // {\n 0x032a: 0x7d, // }\n 0x032b: 0x5c, // \\\n 0x032c: 0x5e, // ^\n 0x032d: 0x5f, // _\n 0x032e: 0x7c, // |\n 0x032f: 0x7e, // ~\n 0x0330: 0xc4, // Ä\n 0x0331: 0xe4, // ä\n 0x0332: 0xd6, // Ö\n 0x0333: 0xf6, // ö\n 0x0334: 0xdf, // ß\n 0x0335: 0xa5, // ¥\n 0x0336: 0xa4, // ¤\n 0x0337: 0x2502, // │\n 0x0338: 0xc5, // Å\n 0x0339: 0xe5, // å\n 0x033a: 0xd8, // Ø\n 0x033b: 0xf8, // ø\n 0x033c: 0x250c, // ┌\n 0x033d: 0x2510, // ┐\n 0x033e: 0x2514, // └\n 0x033f: 0x2518 // ┘\n};\n\nvar getCharFromCode = function(code) {\n if (code === null) {\n return '';\n }\n code = CHARACTER_TRANSLATION[code] || code;\n return String.fromCharCode(code);\n};\n\n// the index of the last row in a CEA-608 display buffer\nvar BOTTOM_ROW = 14;\n\n// This array is used for mapping PACs -> row #, since there's no way of\n// getting it through bit logic.\nvar ROWS = [0x1100, 0x1120, 0x1200, 0x1220, 0x1500, 0x1520, 0x1600, 0x1620,\n 0x1700, 0x1720, 0x1000, 0x1300, 0x1320, 0x1400, 0x1420];\n\n// CEA-608 captions are rendered onto a 34x15 matrix of character\n// cells. The \"bottom\" row is the last element in the outer array.\nvar createDisplayBuffer = function() {\n var result = [], i = BOTTOM_ROW + 1;\n while (i--) {\n result.push('');\n }\n return result;\n};\n\nvar Cea608Stream = function(field, dataChannel) {\n Cea608Stream.prototype.init.call(this);\n\n this.field_ = field || 0;\n this.dataChannel_ = dataChannel || 0;\n\n this.name_ = 'CC' + (((this.field_ << 1) | this.dataChannel_) + 1);\n\n this.setConstants();\n this.reset();\n\n this.push = function(packet) {\n var data, swap, char0, char1, text;\n // remove the parity bits\n data = packet.ccData & 0x7f7f;\n\n // ignore duplicate control codes; the spec demands they're sent twice\n if (data === this.lastControlCode_) {\n this.lastControlCode_ = null;\n return;\n }\n\n // Store control codes\n if ((data & 0xf000) === 0x1000) {\n this.lastControlCode_ = data;\n } else if (data !== this.PADDING_) {\n this.lastControlCode_ = null;\n }\n\n char0 = data >>> 8;\n char1 = data & 0xff;\n\n if (data === this.PADDING_) {\n return;\n\n } else if (data === this.RESUME_CAPTION_LOADING_) {\n this.mode_ = 'popOn';\n\n } else if (data === this.END_OF_CAPTION_) {\n // If an EOC is received while in paint-on mode, the displayed caption\n // text should be swapped to non-displayed memory as if it was a pop-on\n // caption. Because of that, we should explicitly switch back to pop-on\n // mode\n this.mode_ = 'popOn';\n this.clearFormatting(packet.pts);\n // if a caption was being displayed, it's gone now\n this.flushDisplayed(packet.pts);\n\n // flip memory\n swap = this.displayed_;\n this.displayed_ = this.nonDisplayed_;\n this.nonDisplayed_ = swap;\n\n // start measuring the time to display the caption\n this.startPts_ = packet.pts;\n\n } else if (data === this.ROLL_UP_2_ROWS_) {\n this.rollUpRows_ = 2;\n this.setRollUp(packet.pts);\n } else if (data === this.ROLL_UP_3_ROWS_) {\n this.rollUpRows_ = 3;\n this.setRollUp(packet.pts);\n } else if (data === this.ROLL_UP_4_ROWS_) {\n this.rollUpRows_ = 4;\n this.setRollUp(packet.pts);\n } else if (data === this.CARRIAGE_RETURN_) {\n this.clearFormatting(packet.pts);\n this.flushDisplayed(packet.pts);\n this.shiftRowsUp_();\n this.startPts_ = packet.pts;\n\n } else if (data === this.BACKSPACE_) {\n if (this.mode_ === 'popOn') {\n this.nonDisplayed_[this.row_] = this.nonDisplayed_[this.row_].slice(0, -1);\n } else {\n this.displayed_[this.row_] = this.displayed_[this.row_].slice(0, -1);\n }\n } else if (data === this.ERASE_DISPLAYED_MEMORY_) {\n this.flushDisplayed(packet.pts);\n this.displayed_ = createDisplayBuffer();\n } else if (data === this.ERASE_NON_DISPLAYED_MEMORY_) {\n this.nonDisplayed_ = createDisplayBuffer();\n\n } else if (data === this.RESUME_DIRECT_CAPTIONING_) {\n if (this.mode_ !== 'paintOn') {\n // NOTE: This should be removed when proper caption positioning is\n // implemented\n this.flushDisplayed(packet.pts);\n this.displayed_ = createDisplayBuffer();\n }\n this.mode_ = 'paintOn';\n this.startPts_ = packet.pts;\n\n // Append special characters to caption text\n } else if (this.isSpecialCharacter(char0, char1)) {\n // Bitmask char0 so that we can apply character transformations\n // regardless of field and data channel.\n // Then byte-shift to the left and OR with char1 so we can pass the\n // entire character code to `getCharFromCode`.\n char0 = (char0 & 0x03) << 8;\n text = getCharFromCode(char0 | char1);\n this[this.mode_](packet.pts, text);\n this.column_++;\n\n // Append extended characters to caption text\n } else if (this.isExtCharacter(char0, char1)) {\n // Extended characters always follow their \"non-extended\" equivalents.\n // IE if a \"è\" is desired, you'll always receive \"eè\"; non-compliant\n // decoders are supposed to drop the \"è\", while compliant decoders\n // backspace the \"e\" and insert \"è\".\n\n // Delete the previous character\n if (this.mode_ === 'popOn') {\n this.nonDisplayed_[this.row_] = this.nonDisplayed_[this.row_].slice(0, -1);\n } else {\n this.displayed_[this.row_] = this.displayed_[this.row_].slice(0, -1);\n }\n\n // Bitmask char0 so that we can apply character transformations\n // regardless of field and data channel.\n // Then byte-shift to the left and OR with char1 so we can pass the\n // entire character code to `getCharFromCode`.\n char0 = (char0 & 0x03) << 8;\n text = getCharFromCode(char0 | char1);\n this[this.mode_](packet.pts, text);\n this.column_++;\n\n // Process mid-row codes\n } else if (this.isMidRowCode(char0, char1)) {\n // Attributes are not additive, so clear all formatting\n this.clearFormatting(packet.pts);\n\n // According to the standard, mid-row codes\n // should be replaced with spaces, so add one now\n this[this.mode_](packet.pts, ' ');\n this.column_++;\n\n if ((char1 & 0xe) === 0xe) {\n this.addFormatting(packet.pts, ['i']);\n }\n\n if ((char1 & 0x1) === 0x1) {\n this.addFormatting(packet.pts, ['u']);\n }\n\n // Detect offset control codes and adjust cursor\n } else if (this.isOffsetControlCode(char0, char1)) {\n // Cursor position is set by indent PAC (see below) in 4-column\n // increments, with an additional offset code of 1-3 to reach any\n // of the 32 columns specified by CEA-608. So all we need to do\n // here is increment the column cursor by the given offset.\n this.column_ += (char1 & 0x03);\n\n // Detect PACs (Preamble Address Codes)\n } else if (this.isPAC(char0, char1)) {\n\n // There's no logic for PAC -> row mapping, so we have to just\n // find the row code in an array and use its index :(\n var row = ROWS.indexOf(data & 0x1f20);\n\n // Configure the caption window if we're in roll-up mode\n if (this.mode_ === 'rollUp') {\n // This implies that the base row is incorrectly set.\n // As per the recommendation in CEA-608(Base Row Implementation), defer to the number\n // of roll-up rows set.\n if (row - this.rollUpRows_ + 1 < 0) {\n row = this.rollUpRows_ - 1;\n }\n\n this.setRollUp(packet.pts, row);\n }\n\n if (row !== this.row_) {\n // formatting is only persistent for current row\n this.clearFormatting(packet.pts);\n this.row_ = row;\n }\n // All PACs can apply underline, so detect and apply\n // (All odd-numbered second bytes set underline)\n if ((char1 & 0x1) && (this.formatting_.indexOf('u') === -1)) {\n this.addFormatting(packet.pts, ['u']);\n }\n\n if ((data & 0x10) === 0x10) {\n // We've got an indent level code. Each successive even number\n // increments the column cursor by 4, so we can get the desired\n // column position by bit-shifting to the right (to get n/2)\n // and multiplying by 4.\n this.column_ = ((data & 0xe) >> 1) * 4;\n }\n\n if (this.isColorPAC(char1)) {\n // it's a color code, though we only support white, which\n // can be either normal or italicized. white italics can be\n // either 0x4e or 0x6e depending on the row, so we just\n // bitwise-and with 0xe to see if italics should be turned on\n if ((char1 & 0xe) === 0xe) {\n this.addFormatting(packet.pts, ['i']);\n }\n }\n\n // We have a normal character in char0, and possibly one in char1\n } else if (this.isNormalChar(char0)) {\n if (char1 === 0x00) {\n char1 = null;\n }\n text = getCharFromCode(char0);\n text += getCharFromCode(char1);\n this[this.mode_](packet.pts, text);\n this.column_ += text.length;\n\n } // finish data processing\n\n };\n};\nCea608Stream.prototype = new Stream();\n// Trigger a cue point that captures the current state of the\n// display buffer\nCea608Stream.prototype.flushDisplayed = function(pts) {\n var content = this.displayed_\n // remove spaces from the start and end of the string\n .map(function(row) {\n try {\n return row.trim();\n } catch (e) {\n // Ordinarily, this shouldn't happen. However, caption\n // parsing errors should not throw exceptions and\n // break playback.\n // eslint-disable-next-line no-console\n console.error('Skipping malformed caption.');\n return '';\n }\n })\n // combine all text rows to display in one cue\n .join('\\n')\n // and remove blank rows from the start and end, but not the middle\n .replace(/^\\n+|\\n+$/g, '');\n\n if (content.length) {\n this.trigger('data', {\n startPts: this.startPts_,\n endPts: pts,\n text: content,\n stream: this.name_\n });\n }\n};\n\n/**\n * Zero out the data, used for startup and on seek\n */\nCea608Stream.prototype.reset = function() {\n this.mode_ = 'popOn';\n // When in roll-up mode, the index of the last row that will\n // actually display captions. If a caption is shifted to a row\n // with a lower index than this, it is cleared from the display\n // buffer\n this.topRow_ = 0;\n this.startPts_ = 0;\n this.displayed_ = createDisplayBuffer();\n this.nonDisplayed_ = createDisplayBuffer();\n this.lastControlCode_ = null;\n\n // Track row and column for proper line-breaking and spacing\n this.column_ = 0;\n this.row_ = BOTTOM_ROW;\n this.rollUpRows_ = 2;\n\n // This variable holds currently-applied formatting\n this.formatting_ = [];\n};\n\n/**\n * Sets up control code and related constants for this instance\n */\nCea608Stream.prototype.setConstants = function() {\n // The following attributes have these uses:\n // ext_ : char0 for mid-row codes, and the base for extended\n // chars (ext_+0, ext_+1, and ext_+2 are char0s for\n // extended codes)\n // control_: char0 for control codes, except byte-shifted to the\n // left so that we can do this.control_ | CONTROL_CODE\n // offset_: char0 for tab offset codes\n //\n // It's also worth noting that control codes, and _only_ control codes,\n // differ between field 1 and field2. Field 2 control codes are always\n // their field 1 value plus 1. That's why there's the \"| field\" on the\n // control value.\n if (this.dataChannel_ === 0) {\n this.BASE_ = 0x10;\n this.EXT_ = 0x11;\n this.CONTROL_ = (0x14 | this.field_) << 8;\n this.OFFSET_ = 0x17;\n } else if (this.dataChannel_ === 1) {\n this.BASE_ = 0x18;\n this.EXT_ = 0x19;\n this.CONTROL_ = (0x1c | this.field_) << 8;\n this.OFFSET_ = 0x1f;\n }\n\n // Constants for the LSByte command codes recognized by Cea608Stream. This\n // list is not exhaustive. For a more comprehensive listing and semantics see\n // http://www.gpo.gov/fdsys/pkg/CFR-2010-title47-vol1/pdf/CFR-2010-title47-vol1-sec15-119.pdf\n // Padding\n this.PADDING_ = 0x0000;\n // Pop-on Mode\n this.RESUME_CAPTION_LOADING_ = this.CONTROL_ | 0x20;\n this.END_OF_CAPTION_ = this.CONTROL_ | 0x2f;\n // Roll-up Mode\n this.ROLL_UP_2_ROWS_ = this.CONTROL_ | 0x25;\n this.ROLL_UP_3_ROWS_ = this.CONTROL_ | 0x26;\n this.ROLL_UP_4_ROWS_ = this.CONTROL_ | 0x27;\n this.CARRIAGE_RETURN_ = this.CONTROL_ | 0x2d;\n // paint-on mode\n this.RESUME_DIRECT_CAPTIONING_ = this.CONTROL_ | 0x29;\n // Erasure\n this.BACKSPACE_ = this.CONTROL_ | 0x21;\n this.ERASE_DISPLAYED_MEMORY_ = this.CONTROL_ | 0x2c;\n this.ERASE_NON_DISPLAYED_MEMORY_ = this.CONTROL_ | 0x2e;\n};\n\n/**\n * Detects if the 2-byte packet data is a special character\n *\n * Special characters have a second byte in the range 0x30 to 0x3f,\n * with the first byte being 0x11 (for data channel 1) or 0x19 (for\n * data channel 2).\n *\n * @param {Integer} char0 The first byte\n * @param {Integer} char1 The second byte\n * @return {Boolean} Whether the 2 bytes are an special character\n */\nCea608Stream.prototype.isSpecialCharacter = function(char0, char1) {\n return (char0 === this.EXT_ && char1 >= 0x30 && char1 <= 0x3f);\n};\n\n/**\n * Detects if the 2-byte packet data is an extended character\n *\n * Extended characters have a second byte in the range 0x20 to 0x3f,\n * with the first byte being 0x12 or 0x13 (for data channel 1) or\n * 0x1a or 0x1b (for data channel 2).\n *\n * @param {Integer} char0 The first byte\n * @param {Integer} char1 The second byte\n * @return {Boolean} Whether the 2 bytes are an extended character\n */\nCea608Stream.prototype.isExtCharacter = function(char0, char1) {\n return ((char0 === (this.EXT_ + 1) || char0 === (this.EXT_ + 2)) &&\n (char1 >= 0x20 && char1 <= 0x3f));\n};\n\n/**\n * Detects if the 2-byte packet is a mid-row code\n *\n * Mid-row codes have a second byte in the range 0x20 to 0x2f, with\n * the first byte being 0x11 (for data channel 1) or 0x19 (for data\n * channel 2).\n *\n * @param {Integer} char0 The first byte\n * @param {Integer} char1 The second byte\n * @return {Boolean} Whether the 2 bytes are a mid-row code\n */\nCea608Stream.prototype.isMidRowCode = function(char0, char1) {\n return (char0 === this.EXT_ && (char1 >= 0x20 && char1 <= 0x2f));\n};\n\n/**\n * Detects if the 2-byte packet is an offset control code\n *\n * Offset control codes have a second byte in the range 0x21 to 0x23,\n * with the first byte being 0x17 (for data channel 1) or 0x1f (for\n * data channel 2).\n *\n * @param {Integer} char0 The first byte\n * @param {Integer} char1 The second byte\n * @return {Boolean} Whether the 2 bytes are an offset control code\n */\nCea608Stream.prototype.isOffsetControlCode = function(char0, char1) {\n return (char0 === this.OFFSET_ && (char1 >= 0x21 && char1 <= 0x23));\n};\n\n/**\n * Detects if the 2-byte packet is a Preamble Address Code\n *\n * PACs have a first byte in the range 0x10 to 0x17 (for data channel 1)\n * or 0x18 to 0x1f (for data channel 2), with the second byte in the\n * range 0x40 to 0x7f.\n *\n * @param {Integer} char0 The first byte\n * @param {Integer} char1 The second byte\n * @return {Boolean} Whether the 2 bytes are a PAC\n */\nCea608Stream.prototype.isPAC = function(char0, char1) {\n return (char0 >= this.BASE_ && char0 < (this.BASE_ + 8) &&\n (char1 >= 0x40 && char1 <= 0x7f));\n};\n\n/**\n * Detects if a packet's second byte is in the range of a PAC color code\n *\n * PAC color codes have the second byte be in the range 0x40 to 0x4f, or\n * 0x60 to 0x6f.\n *\n * @param {Integer} char1 The second byte\n * @return {Boolean} Whether the byte is a color PAC\n */\nCea608Stream.prototype.isColorPAC = function(char1) {\n return ((char1 >= 0x40 && char1 <= 0x4f) || (char1 >= 0x60 && char1 <= 0x7f));\n};\n\n/**\n * Detects if a single byte is in the range of a normal character\n *\n * Normal text bytes are in the range 0x20 to 0x7f.\n *\n * @param {Integer} char The byte\n * @return {Boolean} Whether the byte is a normal character\n */\nCea608Stream.prototype.isNormalChar = function(char) {\n return (char >= 0x20 && char <= 0x7f);\n};\n\n/**\n * Configures roll-up\n *\n * @param {Integer} pts Current PTS\n * @param {Integer} newBaseRow Used by PACs to slide the current window to\n * a new position\n */\nCea608Stream.prototype.setRollUp = function(pts, newBaseRow) {\n // Reset the base row to the bottom row when switching modes\n if (this.mode_ !== 'rollUp') {\n this.row_ = BOTTOM_ROW;\n this.mode_ = 'rollUp';\n // Spec says to wipe memories when switching to roll-up\n this.flushDisplayed(pts);\n this.nonDisplayed_ = createDisplayBuffer();\n this.displayed_ = createDisplayBuffer();\n }\n\n if (newBaseRow !== undefined && newBaseRow !== this.row_) {\n // move currently displayed captions (up or down) to the new base row\n for (var i = 0; i < this.rollUpRows_; i++) {\n this.displayed_[newBaseRow - i] = this.displayed_[this.row_ - i];\n this.displayed_[this.row_ - i] = '';\n }\n }\n\n if (newBaseRow === undefined) {\n newBaseRow = this.row_;\n }\n\n this.topRow_ = newBaseRow - this.rollUpRows_ + 1;\n};\n\n// Adds the opening HTML tag for the passed character to the caption text,\n// and keeps track of it for later closing\nCea608Stream.prototype.addFormatting = function(pts, format) {\n this.formatting_ = this.formatting_.concat(format);\n var text = format.reduce(function(text, format) {\n return text + '<' + format + '>';\n }, '');\n this[this.mode_](pts, text);\n};\n\n// Adds HTML closing tags for current formatting to caption text and\n// clears remembered formatting\nCea608Stream.prototype.clearFormatting = function(pts) {\n if (!this.formatting_.length) {\n return;\n }\n var text = this.formatting_.reverse().reduce(function(text, format) {\n return text + '</' + format + '>';\n }, '');\n this.formatting_ = [];\n this[this.mode_](pts, text);\n};\n\n// Mode Implementations\nCea608Stream.prototype.popOn = function(pts, text) {\n var baseRow = this.nonDisplayed_[this.row_];\n\n // buffer characters\n baseRow += text;\n this.nonDisplayed_[this.row_] = baseRow;\n};\n\nCea608Stream.prototype.rollUp = function(pts, text) {\n var baseRow = this.displayed_[this.row_];\n\n baseRow += text;\n this.displayed_[this.row_] = baseRow;\n\n};\n\nCea608Stream.prototype.shiftRowsUp_ = function() {\n var i;\n // clear out inactive rows\n for (i = 0; i < this.topRow_; i++) {\n this.displayed_[i] = '';\n }\n for (i = this.row_ + 1; i < BOTTOM_ROW + 1; i++) {\n this.displayed_[i] = '';\n }\n // shift displayed rows up\n for (i = this.topRow_; i < this.row_; i++) {\n this.displayed_[i] = this.displayed_[i + 1];\n }\n // clear out the bottom row\n this.displayed_[this.row_] = '';\n};\n\nCea608Stream.prototype.paintOn = function(pts, text) {\n var baseRow = this.displayed_[this.row_];\n\n baseRow += text;\n this.displayed_[this.row_] = baseRow;\n};\n\n// exports\nmodule.exports = {\n CaptionStream: CaptionStream,\n Cea608Stream: Cea608Stream\n};\n","/**\n * mux.js\n *\n * Copyright (c) 2015 Brightcove\n * All rights reserved.\n *\n * A stream-based mp2t to mp4 converter. This utility can be used to\n * deliver mp4s to a SourceBuffer on platforms that support native\n * Media Source Extensions.\n */\n'use strict';\nvar Stream = require('../utils/stream.js'),\n CaptionStream = require('./caption-stream'),\n StreamTypes = require('./stream-types'),\n TimestampRolloverStream = require('./timestamp-rollover-stream').TimestampRolloverStream;\n\nvar m2tsStreamTypes = require('./stream-types.js');\n\n// object types\nvar TransportPacketStream, TransportParseStream, ElementaryStream;\n\n// constants\nvar\n MP2T_PACKET_LENGTH = 188, // bytes\n SYNC_BYTE = 0x47;\n\n/**\n * Splits an incoming stream of binary data into MPEG-2 Transport\n * Stream packets.\n */\nTransportPacketStream = function() {\n var\n buffer = new Uint8Array(MP2T_PACKET_LENGTH),\n bytesInBuffer = 0;\n\n TransportPacketStream.prototype.init.call(this);\n\n // Deliver new bytes to the stream.\n\n /**\n * Split a stream of data into M2TS packets\n **/\n this.push = function(bytes) {\n var\n startIndex = 0,\n endIndex = MP2T_PACKET_LENGTH,\n everything;\n\n // If there are bytes remaining from the last segment, prepend them to the\n // bytes that were pushed in\n if (bytesInBuffer) {\n everything = new Uint8Array(bytes.byteLength + bytesInBuffer);\n everything.set(buffer.subarray(0, bytesInBuffer));\n everything.set(bytes, bytesInBuffer);\n bytesInBuffer = 0;\n } else {\n everything = bytes;\n }\n\n // While we have enough data for a packet\n while (endIndex < everything.byteLength) {\n // Look for a pair of start and end sync bytes in the data..\n if (everything[startIndex] === SYNC_BYTE && everything[endIndex] === SYNC_BYTE) {\n // We found a packet so emit it and jump one whole packet forward in\n // the stream\n this.trigger('data', everything.subarray(startIndex, endIndex));\n startIndex += MP2T_PACKET_LENGTH;\n endIndex += MP2T_PACKET_LENGTH;\n continue;\n }\n // If we get here, we have somehow become de-synchronized and we need to step\n // forward one byte at a time until we find a pair of sync bytes that denote\n // a packet\n startIndex++;\n endIndex++;\n }\n\n // If there was some data left over at the end of the segment that couldn't\n // possibly be a whole packet, keep it because it might be the start of a packet\n // that continues in the next segment\n if (startIndex < everything.byteLength) {\n buffer.set(everything.subarray(startIndex), 0);\n bytesInBuffer = everything.byteLength - startIndex;\n }\n };\n\n /**\n * Passes identified M2TS packets to the TransportParseStream to be parsed\n **/\n this.flush = function() {\n // If the buffer contains a whole packet when we are being flushed, emit it\n // and empty the buffer. Otherwise hold onto the data because it may be\n // important for decoding the next segment\n if (bytesInBuffer === MP2T_PACKET_LENGTH && buffer[0] === SYNC_BYTE) {\n this.trigger('data', buffer);\n bytesInBuffer = 0;\n }\n this.trigger('done');\n };\n};\nTransportPacketStream.prototype = new Stream();\n\n/**\n * Accepts an MP2T TransportPacketStream and emits data events with parsed\n * forms of the individual transport stream packets.\n */\nTransportParseStream = function() {\n var parsePsi, parsePat, parsePmt, self;\n TransportParseStream.prototype.init.call(this);\n self = this;\n\n this.packetsWaitingForPmt = [];\n this.programMapTable = undefined;\n\n parsePsi = function(payload, psi) {\n var offset = 0;\n\n // PSI packets may be split into multiple sections and those\n // sections may be split into multiple packets. If a PSI\n // section starts in this packet, the payload_unit_start_indicator\n // will be true and the first byte of the payload will indicate\n // the offset from the current position to the start of the\n // section.\n if (psi.payloadUnitStartIndicator) {\n offset += payload[offset] + 1;\n }\n\n if (psi.type === 'pat') {\n parsePat(payload.subarray(offset), psi);\n } else {\n parsePmt(payload.subarray(offset), psi);\n }\n };\n\n parsePat = function(payload, pat) {\n pat.section_number = payload[7]; // eslint-disable-line camelcase\n pat.last_section_number = payload[8]; // eslint-disable-line camelcase\n\n // skip the PSI header and parse the first PMT entry\n self.pmtPid = (payload[10] & 0x1F) << 8 | payload[11];\n pat.pmtPid = self.pmtPid;\n };\n\n /**\n * Parse out the relevant fields of a Program Map Table (PMT).\n * @param payload {Uint8Array} the PMT-specific portion of an MP2T\n * packet. The first byte in this array should be the table_id\n * field.\n * @param pmt {object} the object that should be decorated with\n * fields parsed from the PMT.\n */\n parsePmt = function(payload, pmt) {\n var sectionLength, tableEnd, programInfoLength, offset;\n\n // PMTs can be sent ahead of the time when they should actually\n // take effect. We don't believe this should ever be the case\n // for HLS but we'll ignore \"forward\" PMT declarations if we see\n // them. Future PMT declarations have the current_next_indicator\n // set to zero.\n if (!(payload[5] & 0x01)) {\n return;\n }\n\n // overwrite any existing program map table\n self.programMapTable = {\n video: null,\n audio: null,\n 'timed-metadata': {}\n };\n\n // the mapping table ends at the end of the current section\n sectionLength = (payload[1] & 0x0f) << 8 | payload[2];\n tableEnd = 3 + sectionLength - 4;\n\n // to determine where the table is, we have to figure out how\n // long the program info descriptors are\n programInfoLength = (payload[10] & 0x0f) << 8 | payload[11];\n\n // advance the offset to the first entry in the mapping table\n offset = 12 + programInfoLength;\n while (offset < tableEnd) {\n var streamType = payload[offset];\n var pid = (payload[offset + 1] & 0x1F) << 8 | payload[offset + 2];\n\n // only map a single elementary_pid for audio and video stream types\n // TODO: should this be done for metadata too? for now maintain behavior of\n // multiple metadata streams\n if (streamType === StreamTypes.H264_STREAM_TYPE &&\n self.programMapTable.video === null) {\n self.programMapTable.video = pid;\n } else if (streamType === StreamTypes.ADTS_STREAM_TYPE &&\n self.programMapTable.audio === null) {\n self.programMapTable.audio = pid;\n } else if (streamType === StreamTypes.METADATA_STREAM_TYPE) {\n // map pid to stream type for metadata streams\n self.programMapTable['timed-metadata'][pid] = streamType;\n }\n\n // move to the next table entry\n // skip past the elementary stream descriptors, if present\n offset += ((payload[offset + 3] & 0x0F) << 8 | payload[offset + 4]) + 5;\n }\n\n // record the map on the packet as well\n pmt.programMapTable = self.programMapTable;\n };\n\n /**\n * Deliver a new MP2T packet to the next stream in the pipeline.\n */\n this.push = function(packet) {\n var\n result = {},\n offset = 4;\n\n result.payloadUnitStartIndicator = !!(packet[1] & 0x40);\n\n // pid is a 13-bit field starting at the last bit of packet[1]\n result.pid = packet[1] & 0x1f;\n result.pid <<= 8;\n result.pid |= packet[2];\n\n // if an adaption field is present, its length is specified by the\n // fifth byte of the TS packet header. The adaptation field is\n // used to add stuffing to PES packets that don't fill a complete\n // TS packet, and to specify some forms of timing and control data\n // that we do not currently use.\n if (((packet[3] & 0x30) >>> 4) > 0x01) {\n offset += packet[offset] + 1;\n }\n\n // parse the rest of the packet based on the type\n if (result.pid === 0) {\n result.type = 'pat';\n parsePsi(packet.subarray(offset), result);\n this.trigger('data', result);\n } else if (result.pid === this.pmtPid) {\n result.type = 'pmt';\n parsePsi(packet.subarray(offset), result);\n this.trigger('data', result);\n\n // if there are any packets waiting for a PMT to be found, process them now\n while (this.packetsWaitingForPmt.length) {\n this.processPes_.apply(this, this.packetsWaitingForPmt.shift());\n }\n } else if (this.programMapTable === undefined) {\n // When we have not seen a PMT yet, defer further processing of\n // PES packets until one has been parsed\n this.packetsWaitingForPmt.push([packet, offset, result]);\n } else {\n this.processPes_(packet, offset, result);\n }\n };\n\n this.processPes_ = function(packet, offset, result) {\n // set the appropriate stream type\n if (result.pid === this.programMapTable.video) {\n result.streamType = StreamTypes.H264_STREAM_TYPE;\n } else if (result.pid === this.programMapTable.audio) {\n result.streamType = StreamTypes.ADTS_STREAM_TYPE;\n } else {\n // if not video or audio, it is timed-metadata or unknown\n // if unknown, streamType will be undefined\n result.streamType = this.programMapTable['timed-metadata'][result.pid];\n }\n\n result.type = 'pes';\n result.data = packet.subarray(offset);\n\n this.trigger('data', result);\n };\n\n};\nTransportParseStream.prototype = new Stream();\nTransportParseStream.STREAM_TYPES = {\n h264: 0x1b,\n adts: 0x0f\n};\n\n/**\n * Reconsistutes program elementary stream (PES) packets from parsed\n * transport stream packets. That is, if you pipe an\n * mp2t.TransportParseStream into a mp2t.ElementaryStream, the output\n * events will be events which capture the bytes for individual PES\n * packets plus relevant metadata that has been extracted from the\n * container.\n */\nElementaryStream = function() {\n var\n self = this,\n // PES packet fragments\n video = {\n data: [],\n size: 0\n },\n audio = {\n data: [],\n size: 0\n },\n timedMetadata = {\n data: [],\n size: 0\n },\n parsePes = function(payload, pes) {\n var ptsDtsFlags;\n\n // get the packet length, this will be 0 for video\n pes.packetLength = 6 + ((payload[4] << 8) | payload[5]);\n\n // find out if this packets starts a new keyframe\n pes.dataAlignmentIndicator = (payload[6] & 0x04) !== 0;\n // PES packets may be annotated with a PTS value, or a PTS value\n // and a DTS value. Determine what combination of values is\n // available to work with.\n ptsDtsFlags = payload[7];\n\n // PTS and DTS are normally stored as a 33-bit number. Javascript\n // performs all bitwise operations on 32-bit integers but javascript\n // supports a much greater range (52-bits) of integer using standard\n // mathematical operations.\n // We construct a 31-bit value using bitwise operators over the 31\n // most significant bits and then multiply by 4 (equal to a left-shift\n // of 2) before we add the final 2 least significant bits of the\n // timestamp (equal to an OR.)\n if (ptsDtsFlags & 0xC0) {\n // the PTS and DTS are not written out directly. For information\n // on how they are encoded, see\n // http://dvd.sourceforge.net/dvdinfo/pes-hdr.html\n pes.pts = (payload[9] & 0x0E) << 27 |\n (payload[10] & 0xFF) << 20 |\n (payload[11] & 0xFE) << 12 |\n (payload[12] & 0xFF) << 5 |\n (payload[13] & 0xFE) >>> 3;\n pes.pts *= 4; // Left shift by 2\n pes.pts += (payload[13] & 0x06) >>> 1; // OR by the two LSBs\n pes.dts = pes.pts;\n if (ptsDtsFlags & 0x40) {\n pes.dts = (payload[14] & 0x0E) << 27 |\n (payload[15] & 0xFF) << 20 |\n (payload[16] & 0xFE) << 12 |\n (payload[17] & 0xFF) << 5 |\n (payload[18] & 0xFE) >>> 3;\n pes.dts *= 4; // Left shift by 2\n pes.dts += (payload[18] & 0x06) >>> 1; // OR by the two LSBs\n }\n }\n // the data section starts immediately after the PES header.\n // pes_header_data_length specifies the number of header bytes\n // that follow the last byte of the field.\n pes.data = payload.subarray(9 + payload[8]);\n },\n /**\n * Pass completely parsed PES packets to the next stream in the pipeline\n **/\n flushStream = function(stream, type, forceFlush) {\n var\n packetData = new Uint8Array(stream.size),\n event = {\n type: type\n },\n i = 0,\n offset = 0,\n packetFlushable = false,\n fragment;\n\n // do nothing if there is not enough buffered data for a complete\n // PES header\n if (!stream.data.length || stream.size < 9) {\n return;\n }\n event.trackId = stream.data[0].pid;\n\n // reassemble the packet\n for (i = 0; i < stream.data.length; i++) {\n fragment = stream.data[i];\n\n packetData.set(fragment.data, offset);\n offset += fragment.data.byteLength;\n }\n\n // parse assembled packet's PES header\n parsePes(packetData, event);\n\n // non-video PES packets MUST have a non-zero PES_packet_length\n // check that there is enough stream data to fill the packet\n packetFlushable = type === 'video' || event.packetLength <= stream.size;\n\n // flush pending packets if the conditions are right\n if (forceFlush || packetFlushable) {\n stream.size = 0;\n stream.data.length = 0;\n }\n\n // only emit packets that are complete. this is to avoid assembling\n // incomplete PES packets due to poor segmentation\n if (packetFlushable) {\n self.trigger('data', event);\n }\n };\n\n ElementaryStream.prototype.init.call(this);\n\n /**\n * Identifies M2TS packet types and parses PES packets using metadata\n * parsed from the PMT\n **/\n this.push = function(data) {\n ({\n pat: function() {\n // we have to wait for the PMT to arrive as well before we\n // have any meaningful metadata\n },\n pes: function() {\n var stream, streamType;\n\n switch (data.streamType) {\n case StreamTypes.H264_STREAM_TYPE:\n case m2tsStreamTypes.H264_STREAM_TYPE:\n stream = video;\n streamType = 'video';\n break;\n case StreamTypes.ADTS_STREAM_TYPE:\n stream = audio;\n streamType = 'audio';\n break;\n case StreamTypes.METADATA_STREAM_TYPE:\n stream = timedMetadata;\n streamType = 'timed-metadata';\n break;\n default:\n // ignore unknown stream types\n return;\n }\n\n // if a new packet is starting, we can flush the completed\n // packet\n if (data.payloadUnitStartIndicator) {\n flushStream(stream, streamType, true);\n }\n\n // buffer this fragment until we are sure we've received the\n // complete payload\n stream.data.push(data);\n stream.size += data.data.byteLength;\n },\n pmt: function() {\n var\n event = {\n type: 'metadata',\n tracks: []\n },\n programMapTable = data.programMapTable;\n\n // translate audio and video streams to tracks\n if (programMapTable.video !== null) {\n event.tracks.push({\n timelineStartInfo: {\n baseMediaDecodeTime: 0\n },\n id: +programMapTable.video,\n codec: 'avc',\n type: 'video'\n });\n }\n if (programMapTable.audio !== null) {\n event.tracks.push({\n timelineStartInfo: {\n baseMediaDecodeTime: 0\n },\n id: +programMapTable.audio,\n codec: 'adts',\n type: 'audio'\n });\n }\n\n self.trigger('data', event);\n }\n })[data.type]();\n };\n\n /**\n * Flush any remaining input. Video PES packets may be of variable\n * length. Normally, the start of a new video packet can trigger the\n * finalization of the previous packet. That is not possible if no\n * more video is forthcoming, however. In that case, some other\n * mechanism (like the end of the file) has to be employed. When it is\n * clear that no additional data is forthcoming, calling this method\n * will flush the buffered packets.\n */\n this.flush = function() {\n // !!THIS ORDER IS IMPORTANT!!\n // video first then audio\n flushStream(video, 'video');\n flushStream(audio, 'audio');\n flushStream(timedMetadata, 'timed-metadata');\n this.trigger('done');\n };\n};\nElementaryStream.prototype = new Stream();\n\nvar m2ts = {\n PAT_PID: 0x0000,\n MP2T_PACKET_LENGTH: MP2T_PACKET_LENGTH,\n TransportPacketStream: TransportPacketStream,\n TransportParseStream: TransportParseStream,\n ElementaryStream: ElementaryStream,\n TimestampRolloverStream: TimestampRolloverStream,\n CaptionStream: CaptionStream.CaptionStream,\n Cea608Stream: CaptionStream.Cea608Stream,\n MetadataStream: require('./metadata-stream')\n};\n\nfor (var type in StreamTypes) {\n if (StreamTypes.hasOwnProperty(type)) {\n m2ts[type] = StreamTypes[type];\n }\n}\n\nmodule.exports = m2ts;\n","/**\n * Accepts program elementary stream (PES) data events and parses out\n * ID3 metadata from them, if present.\n * @see http://id3.org/id3v2.3.0\n */\n'use strict';\nvar\n Stream = require('../utils/stream'),\n StreamTypes = require('./stream-types'),\n // return a percent-encoded representation of the specified byte range\n // @see http://en.wikipedia.org/wiki/Percent-encoding\n percentEncode = function(bytes, start, end) {\n var i, result = '';\n for (i = start; i < end; i++) {\n result += '%' + ('00' + bytes[i].toString(16)).slice(-2);\n }\n return result;\n },\n // return the string representation of the specified byte range,\n // interpreted as UTf-8.\n parseUtf8 = function(bytes, start, end) {\n return decodeURIComponent(percentEncode(bytes, start, end));\n },\n // return the string representation of the specified byte range,\n // interpreted as ISO-8859-1.\n parseIso88591 = function(bytes, start, end) {\n return unescape(percentEncode(bytes, start, end)); // jshint ignore:line\n },\n parseSyncSafeInteger = function(data) {\n return (data[0] << 21) |\n (data[1] << 14) |\n (data[2] << 7) |\n (data[3]);\n },\n tagParsers = {\n TXXX: function(tag) {\n var i;\n if (tag.data[0] !== 3) {\n // ignore frames with unrecognized character encodings\n return;\n }\n\n for (i = 1; i < tag.data.length; i++) {\n if (tag.data[i] === 0) {\n // parse the text fields\n tag.description = parseUtf8(tag.data, 1, i);\n // do not include the null terminator in the tag value\n tag.value = parseUtf8(tag.data, i + 1, tag.data.length).replace(/\\0*$/, '');\n break;\n }\n }\n tag.data = tag.value;\n },\n WXXX: function(tag) {\n var i;\n if (tag.data[0] !== 3) {\n // ignore frames with unrecognized character encodings\n return;\n }\n\n for (i = 1; i < tag.data.length; i++) {\n if (tag.data[i] === 0) {\n // parse the description and URL fields\n tag.description = parseUtf8(tag.data, 1, i);\n tag.url = parseUtf8(tag.data, i + 1, tag.data.length);\n break;\n }\n }\n },\n PRIV: function(tag) {\n var i;\n\n for (i = 0; i < tag.data.length; i++) {\n if (tag.data[i] === 0) {\n // parse the description and URL fields\n tag.owner = parseIso88591(tag.data, 0, i);\n break;\n }\n }\n tag.privateData = tag.data.subarray(i + 1);\n tag.data = tag.privateData;\n }\n },\n MetadataStream;\n\nMetadataStream = function(options) {\n var\n settings = {\n debug: !!(options && options.debug),\n\n // the bytes of the program-level descriptor field in MP2T\n // see ISO/IEC 13818-1:2013 (E), section 2.6 \"Program and\n // program element descriptors\"\n descriptor: options && options.descriptor\n },\n // the total size in bytes of the ID3 tag being parsed\n tagSize = 0,\n // tag data that is not complete enough to be parsed\n buffer = [],\n // the total number of bytes currently in the buffer\n bufferSize = 0,\n i;\n\n MetadataStream.prototype.init.call(this);\n\n // calculate the text track in-band metadata track dispatch type\n // https://html.spec.whatwg.org/multipage/embedded-content.html#steps-to-expose-a-media-resource-specific-text-track\n this.dispatchType = StreamTypes.METADATA_STREAM_TYPE.toString(16);\n if (settings.descriptor) {\n for (i = 0; i < settings.descriptor.length; i++) {\n this.dispatchType += ('00' + settings.descriptor[i].toString(16)).slice(-2);\n }\n }\n\n this.push = function(chunk) {\n var tag, frameStart, frameSize, frame, i, frameHeader;\n if (chunk.type !== 'timed-metadata') {\n return;\n }\n\n // if data_alignment_indicator is set in the PES header,\n // we must have the start of a new ID3 tag. Assume anything\n // remaining in the buffer was malformed and throw it out\n if (chunk.dataAlignmentIndicator) {\n bufferSize = 0;\n buffer.length = 0;\n }\n\n // ignore events that don't look like ID3 data\n if (buffer.length === 0 &&\n (chunk.data.length < 10 ||\n chunk.data[0] !== 'I'.charCodeAt(0) ||\n chunk.data[1] !== 'D'.charCodeAt(0) ||\n chunk.data[2] !== '3'.charCodeAt(0))) {\n if (settings.debug) {\n // eslint-disable-next-line no-console\n console.log('Skipping unrecognized metadata packet');\n }\n return;\n }\n\n // add this chunk to the data we've collected so far\n\n buffer.push(chunk);\n bufferSize += chunk.data.byteLength;\n\n // grab the size of the entire frame from the ID3 header\n if (buffer.length === 1) {\n // the frame size is transmitted as a 28-bit integer in the\n // last four bytes of the ID3 header.\n // The most significant bit of each byte is dropped and the\n // results concatenated to recover the actual value.\n tagSize = parseSyncSafeInteger(chunk.data.subarray(6, 10));\n\n // ID3 reports the tag size excluding the header but it's more\n // convenient for our comparisons to include it\n tagSize += 10;\n }\n\n // if the entire frame has not arrived, wait for more data\n if (bufferSize < tagSize) {\n return;\n }\n\n // collect the entire frame so it can be parsed\n tag = {\n data: new Uint8Array(tagSize),\n frames: [],\n pts: buffer[0].pts,\n dts: buffer[0].dts\n };\n for (i = 0; i < tagSize;) {\n tag.data.set(buffer[0].data.subarray(0, tagSize - i), i);\n i += buffer[0].data.byteLength;\n bufferSize -= buffer[0].data.byteLength;\n buffer.shift();\n }\n\n // find the start of the first frame and the end of the tag\n frameStart = 10;\n if (tag.data[5] & 0x40) {\n // advance the frame start past the extended header\n frameStart += 4; // header size field\n frameStart += parseSyncSafeInteger(tag.data.subarray(10, 14));\n\n // clip any padding off the end\n tagSize -= parseSyncSafeInteger(tag.data.subarray(16, 20));\n }\n\n // parse one or more ID3 frames\n // http://id3.org/id3v2.3.0#ID3v2_frame_overview\n do {\n // determine the number of bytes in this frame\n frameSize = parseSyncSafeInteger(tag.data.subarray(frameStart + 4, frameStart + 8));\n if (frameSize < 1) {\n // eslint-disable-next-line no-console\n return console.log('Malformed ID3 frame encountered. Skipping metadata parsing.');\n }\n frameHeader = String.fromCharCode(tag.data[frameStart],\n tag.data[frameStart + 1],\n tag.data[frameStart + 2],\n tag.data[frameStart + 3]);\n\n\n frame = {\n id: frameHeader,\n data: tag.data.subarray(frameStart + 10, frameStart + frameSize + 10)\n };\n frame.key = frame.id;\n if (tagParsers[frame.id]) {\n tagParsers[frame.id](frame);\n\n // handle the special PRIV frame used to indicate the start\n // time for raw AAC data\n if (frame.owner === 'com.apple.streaming.transportStreamTimestamp') {\n var\n d = frame.data,\n size = ((d[3] & 0x01) << 30) |\n (d[4] << 22) |\n (d[5] << 14) |\n (d[6] << 6) |\n (d[7] >>> 2);\n\n size *= 4;\n size += d[7] & 0x03;\n frame.timeStamp = size;\n // in raw AAC, all subsequent data will be timestamped based\n // on the value of this frame\n // we couldn't have known the appropriate pts and dts before\n // parsing this ID3 tag so set those values now\n if (tag.pts === undefined && tag.dts === undefined) {\n tag.pts = frame.timeStamp;\n tag.dts = frame.timeStamp;\n }\n this.trigger('timestamp', frame);\n }\n }\n tag.frames.push(frame);\n\n frameStart += 10; // advance past the frame header\n frameStart += frameSize; // advance past the frame body\n } while (frameStart < tagSize);\n this.trigger('data', tag);\n };\n};\nMetadataStream.prototype = new Stream();\n\nmodule.exports = MetadataStream;\n","/**\n * mux.js\n *\n * Copyright (c) 2016 Brightcove\n * All rights reserved.\n *\n * Utilities to detect basic properties and metadata about TS Segments.\n */\n'use strict';\n\nvar StreamTypes = require('./stream-types.js');\n\nvar parsePid = function(packet) {\n var pid = packet[1] & 0x1f;\n pid <<= 8;\n pid |= packet[2];\n return pid;\n};\n\nvar parsePayloadUnitStartIndicator = function(packet) {\n return !!(packet[1] & 0x40);\n};\n\nvar parseAdaptionField = function(packet) {\n var offset = 0;\n // if an adaption field is present, its length is specified by the\n // fifth byte of the TS packet header. The adaptation field is\n // used to add stuffing to PES packets that don't fill a complete\n // TS packet, and to specify some forms of timing and control data\n // that we do not currently use.\n if (((packet[3] & 0x30) >>> 4) > 0x01) {\n offset += packet[4] + 1;\n }\n return offset;\n};\n\nvar parseType = function(packet, pmtPid) {\n var pid = parsePid(packet);\n if (pid === 0) {\n return 'pat';\n } else if (pid === pmtPid) {\n return 'pmt';\n } else if (pmtPid) {\n return 'pes';\n }\n return null;\n};\n\nvar parsePat = function(packet) {\n var pusi = parsePayloadUnitStartIndicator(packet);\n var offset = 4 + parseAdaptionField(packet);\n\n if (pusi) {\n offset += packet[offset] + 1;\n }\n\n return (packet[offset + 10] & 0x1f) << 8 | packet[offset + 11];\n};\n\nvar parsePmt = function(packet) {\n var programMapTable = {};\n var pusi = parsePayloadUnitStartIndicator(packet);\n var payloadOffset = 4 + parseAdaptionField(packet);\n\n if (pusi) {\n payloadOffset += packet[payloadOffset] + 1;\n }\n\n // PMTs can be sent ahead of the time when they should actually\n // take effect. We don't believe this should ever be the case\n // for HLS but we'll ignore \"forward\" PMT declarations if we see\n // them. Future PMT declarations have the current_next_indicator\n // set to zero.\n if (!(packet[payloadOffset + 5] & 0x01)) {\n return;\n }\n\n var sectionLength, tableEnd, programInfoLength;\n // the mapping table ends at the end of the current section\n sectionLength = (packet[payloadOffset + 1] & 0x0f) << 8 | packet[payloadOffset + 2];\n tableEnd = 3 + sectionLength - 4;\n\n // to determine where the table is, we have to figure out how\n // long the program info descriptors are\n programInfoLength = (packet[payloadOffset + 10] & 0x0f) << 8 | packet[payloadOffset + 11];\n\n // advance the offset to the first entry in the mapping table\n var offset = 12 + programInfoLength;\n while (offset < tableEnd) {\n var i = payloadOffset + offset;\n // add an entry that maps the elementary_pid to the stream_type\n programMapTable[(packet[i + 1] & 0x1F) << 8 | packet[i + 2]] = packet[i];\n\n // move to the next table entry\n // skip past the elementary stream descriptors, if present\n offset += ((packet[i + 3] & 0x0F) << 8 | packet[i + 4]) + 5;\n }\n return programMapTable;\n};\n\nvar parsePesType = function(packet, programMapTable) {\n var pid = parsePid(packet);\n var type = programMapTable[pid];\n switch (type) {\n case StreamTypes.H264_STREAM_TYPE:\n return 'video';\n case StreamTypes.ADTS_STREAM_TYPE:\n return 'audio';\n case StreamTypes.METADATA_STREAM_TYPE:\n return 'timed-metadata';\n default:\n return null;\n }\n};\n\nvar parsePesTime = function(packet) {\n var pusi = parsePayloadUnitStartIndicator(packet);\n if (!pusi) {\n return null;\n }\n\n var offset = 4 + parseAdaptionField(packet);\n\n if (offset >= packet.byteLength) {\n // From the H 222.0 MPEG-TS spec\n // \"For transport stream packets carrying PES packets, stuffing is needed when there\n // is insufficient PES packet data to completely fill the transport stream packet\n // payload bytes. Stuffing is accomplished by defining an adaptation field longer than\n // the sum of the lengths of the data elements in it, so that the payload bytes\n // remaining after the adaptation field exactly accommodates the available PES packet\n // data.\"\n //\n // If the offset is >= the length of the packet, then the packet contains no data\n // and instead is just adaption field stuffing bytes\n return null;\n }\n\n var pes = null;\n var ptsDtsFlags;\n\n // PES packets may be annotated with a PTS value, or a PTS value\n // and a DTS value. Determine what combination of values is\n // available to work with.\n ptsDtsFlags = packet[offset + 7];\n\n // PTS and DTS are normally stored as a 33-bit number. Javascript\n // performs all bitwise operations on 32-bit integers but javascript\n // supports a much greater range (52-bits) of integer using standard\n // mathematical operations.\n // We construct a 31-bit value using bitwise operators over the 31\n // most significant bits and then multiply by 4 (equal to a left-shift\n // of 2) before we add the final 2 least significant bits of the\n // timestamp (equal to an OR.)\n if (ptsDtsFlags & 0xC0) {\n pes = {};\n // the PTS and DTS are not written out directly. For information\n // on how they are encoded, see\n // http://dvd.sourceforge.net/dvdinfo/pes-hdr.html\n pes.pts = (packet[offset + 9] & 0x0E) << 27 |\n (packet[offset + 10] & 0xFF) << 20 |\n (packet[offset + 11] & 0xFE) << 12 |\n (packet[offset + 12] & 0xFF) << 5 |\n (packet[offset + 13] & 0xFE) >>> 3;\n pes.pts *= 4; // Left shift by 2\n pes.pts += (packet[offset + 13] & 0x06) >>> 1; // OR by the two LSBs\n pes.dts = pes.pts;\n if (ptsDtsFlags & 0x40) {\n pes.dts = (packet[offset + 14] & 0x0E) << 27 |\n (packet[offset + 15] & 0xFF) << 20 |\n (packet[offset + 16] & 0xFE) << 12 |\n (packet[offset + 17] & 0xFF) << 5 |\n (packet[offset + 18] & 0xFE) >>> 3;\n pes.dts *= 4; // Left shift by 2\n pes.dts += (packet[offset + 18] & 0x06) >>> 1; // OR by the two LSBs\n }\n }\n return pes;\n};\n\nvar parseNalUnitType = function(type) {\n switch (type) {\n case 0x05:\n return 'slice_layer_without_partitioning_rbsp_idr';\n case 0x06:\n return 'sei_rbsp';\n case 0x07:\n return 'seq_parameter_set_rbsp';\n case 0x08:\n return 'pic_parameter_set_rbsp';\n case 0x09:\n return 'access_unit_delimiter_rbsp';\n default:\n return null;\n }\n};\n\nvar videoPacketContainsKeyFrame = function(packet) {\n var offset = 4 + parseAdaptionField(packet);\n var frameBuffer = packet.subarray(offset);\n var frameI = 0;\n var frameSyncPoint = 0;\n var foundKeyFrame = false;\n var nalType;\n\n // advance the sync point to a NAL start, if necessary\n for (; frameSyncPoint < frameBuffer.byteLength - 3; frameSyncPoint++) {\n if (frameBuffer[frameSyncPoint + 2] === 1) {\n // the sync point is properly aligned\n frameI = frameSyncPoint + 5;\n break;\n }\n }\n\n while (frameI < frameBuffer.byteLength) {\n // look at the current byte to determine if we've hit the end of\n // a NAL unit boundary\n switch (frameBuffer[frameI]) {\n case 0:\n // skip past non-sync sequences\n if (frameBuffer[frameI - 1] !== 0) {\n frameI += 2;\n break;\n } else if (frameBuffer[frameI - 2] !== 0) {\n frameI++;\n break;\n }\n\n if (frameSyncPoint + 3 !== frameI - 2) {\n nalType = parseNalUnitType(frameBuffer[frameSyncPoint + 3] & 0x1f);\n if (nalType === 'slice_layer_without_partitioning_rbsp_idr') {\n foundKeyFrame = true;\n }\n }\n\n // drop trailing zeroes\n do {\n frameI++;\n } while (frameBuffer[frameI] !== 1 && frameI < frameBuffer.length);\n frameSyncPoint = frameI - 2;\n frameI += 3;\n break;\n case 1:\n // skip past non-sync sequences\n if (frameBuffer[frameI - 1] !== 0 ||\n frameBuffer[frameI - 2] !== 0) {\n frameI += 3;\n break;\n }\n\n nalType = parseNalUnitType(frameBuffer[frameSyncPoint + 3] & 0x1f);\n if (nalType === 'slice_layer_without_partitioning_rbsp_idr') {\n foundKeyFrame = true;\n }\n frameSyncPoint = frameI - 2;\n frameI += 3;\n break;\n default:\n // the current byte isn't a one or zero, so it cannot be part\n // of a sync sequence\n frameI += 3;\n break;\n }\n }\n frameBuffer = frameBuffer.subarray(frameSyncPoint);\n frameI -= frameSyncPoint;\n frameSyncPoint = 0;\n // parse the final nal\n if (frameBuffer && frameBuffer.byteLength > 3) {\n nalType = parseNalUnitType(frameBuffer[frameSyncPoint + 3] & 0x1f);\n if (nalType === 'slice_layer_without_partitioning_rbsp_idr') {\n foundKeyFrame = true;\n }\n }\n\n return foundKeyFrame;\n};\n\n\nmodule.exports = {\n parseType: parseType,\n parsePat: parsePat,\n parsePmt: parsePmt,\n parsePayloadUnitStartIndicator: parsePayloadUnitStartIndicator,\n parsePesType: parsePesType,\n parsePesTime: parsePesTime,\n videoPacketContainsKeyFrame: videoPacketContainsKeyFrame\n};\n","'use strict';\n\nmodule.exports = {\n H264_STREAM_TYPE: 0x1B,\n ADTS_STREAM_TYPE: 0x0F,\n METADATA_STREAM_TYPE: 0x15\n};\n","/**\n * mux.js\n *\n * Copyright (c) 2016 Brightcove\n * All rights reserved.\n *\n * Accepts program elementary stream (PES) data events and corrects\n * decode and presentation time stamps to account for a rollover\n * of the 33 bit value.\n */\n\n'use strict';\n\nvar Stream = require('../utils/stream');\n\nvar MAX_TS = 8589934592;\n\nvar RO_THRESH = 4294967296;\n\nvar handleRollover = function(value, reference) {\n var direction = 1;\n\n if (value > reference) {\n // If the current timestamp value is greater than our reference timestamp and we detect a\n // timestamp rollover, this means the roll over is happening in the opposite direction.\n // Example scenario: Enter a long stream/video just after a rollover occurred. The reference\n // point will be set to a small number, e.g. 1. The user then seeks backwards over the\n // rollover point. In loading this segment, the timestamp values will be very large,\n // e.g. 2^33 - 1. Since this comes before the data we loaded previously, we want to adjust\n // the time stamp to be `value - 2^33`.\n direction = -1;\n }\n\n // Note: A seek forwards or back that is greater than the RO_THRESH (2^32, ~13 hours) will\n // cause an incorrect adjustment.\n while (Math.abs(reference - value) > RO_THRESH) {\n value += (direction * MAX_TS);\n }\n\n return value;\n};\n\nvar TimestampRolloverStream = function(type) {\n var lastDTS, referenceDTS;\n\n TimestampRolloverStream.prototype.init.call(this);\n\n this.type_ = type;\n\n this.push = function(data) {\n if (data.type !== this.type_) {\n return;\n }\n\n if (referenceDTS === undefined) {\n referenceDTS = data.dts;\n }\n\n data.dts = handleRollover(data.dts, referenceDTS);\n data.pts = handleRollover(data.pts, referenceDTS);\n\n lastDTS = data.dts;\n\n this.trigger('data', data);\n };\n\n this.flush = function() {\n referenceDTS = lastDTS;\n this.trigger('done');\n };\n\n this.discontinuity = function() {\n referenceDTS = void 0;\n lastDTS = void 0;\n };\n\n};\n\nTimestampRolloverStream.prototype = new Stream();\n\nmodule.exports = {\n TimestampRolloverStream: TimestampRolloverStream,\n handleRollover: handleRollover\n};\n","var coneOfSilence = require('../data/silence');\nvar clock = require('../utils/clock');\n\nvar ONE_SECOND_IN_TS = 90000; // 90kHz clock\n\n/**\n * Sum the `byteLength` properties of the data in each AAC frame\n */\nvar sumFrameByteLengths = function(array) {\n var\n i,\n currentObj,\n sum = 0;\n\n // sum the byteLength's all each nal unit in the frame\n for (i = 0; i < array.length; i++) {\n currentObj = array[i];\n sum += currentObj.data.byteLength;\n }\n\n return sum;\n};\n\n// Possibly pad (prefix) the audio track with silence if appending this track\n// would lead to the introduction of a gap in the audio buffer\nvar prefixWithSilence = function(\n track,\n frames,\n audioAppendStartTs,\n videoBaseMediaDecodeTime\n) {\n var\n baseMediaDecodeTimeTs,\n frameDuration = 0,\n audioGapDuration = 0,\n audioFillFrameCount = 0,\n audioFillDuration = 0,\n silentFrame,\n i;\n\n if (!frames.length) {\n return;\n }\n\n baseMediaDecodeTimeTs =\n clock.audioTsToVideoTs(track.baseMediaDecodeTime, track.samplerate);\n // determine frame clock duration based on sample rate, round up to avoid overfills\n frameDuration = Math.ceil(ONE_SECOND_IN_TS / (track.samplerate / 1024));\n\n if (audioAppendStartTs && videoBaseMediaDecodeTime) {\n // insert the shortest possible amount (audio gap or audio to video gap)\n audioGapDuration =\n baseMediaDecodeTimeTs - Math.max(audioAppendStartTs, videoBaseMediaDecodeTime);\n // number of full frames in the audio gap\n audioFillFrameCount = Math.floor(audioGapDuration / frameDuration);\n audioFillDuration = audioFillFrameCount * frameDuration;\n }\n\n // don't attempt to fill gaps smaller than a single frame or larger\n // than a half second\n if (audioFillFrameCount < 1 || audioFillDuration > ONE_SECOND_IN_TS / 2) {\n return;\n }\n\n silentFrame = coneOfSilence[track.samplerate];\n\n if (!silentFrame) {\n // we don't have a silent frame pregenerated for the sample rate, so use a frame\n // from the content instead\n silentFrame = frames[0].data;\n }\n\n for (i = 0; i < audioFillFrameCount; i++) {\n frames.splice(i, 0, {\n data: silentFrame\n });\n }\n\n track.baseMediaDecodeTime -=\n Math.floor(clock.videoTsToAudioTs(audioFillDuration, track.samplerate));\n};\n\n// If the audio segment extends before the earliest allowed dts\n// value, remove AAC frames until starts at or after the earliest\n// allowed DTS so that we don't end up with a negative baseMedia-\n// DecodeTime for the audio track\nvar trimAdtsFramesByEarliestDts = function(adtsFrames, track, earliestAllowedDts) {\n if (track.minSegmentDts >= earliestAllowedDts) {\n return adtsFrames;\n }\n\n // We will need to recalculate the earliest segment Dts\n track.minSegmentDts = Infinity;\n\n return adtsFrames.filter(function(currentFrame) {\n // If this is an allowed frame, keep it and record it's Dts\n if (currentFrame.dts >= earliestAllowedDts) {\n track.minSegmentDts = Math.min(track.minSegmentDts, currentFrame.dts);\n track.minSegmentPts = track.minSegmentDts;\n return true;\n }\n // Otherwise, discard it\n return false;\n });\n};\n\n// generate the track's raw mdat data from an array of frames\nvar generateSampleTable = function(frames) {\n var\n i,\n currentFrame,\n samples = [];\n\n for (i = 0; i < frames.length; i++) {\n currentFrame = frames[i];\n samples.push({\n size: currentFrame.data.byteLength,\n duration: 1024 // For AAC audio, all samples contain 1024 samples\n });\n }\n return samples;\n};\n\n// generate the track's sample table from an array of frames\nvar concatenateFrameData = function(frames) {\n var\n i,\n currentFrame,\n dataOffset = 0,\n data = new Uint8Array(sumFrameByteLengths(frames));\n\n for (i = 0; i < frames.length; i++) {\n currentFrame = frames[i];\n\n data.set(currentFrame.data, dataOffset);\n dataOffset += currentFrame.data.byteLength;\n }\n return data;\n};\n\nmodule.exports = {\n prefixWithSilence: prefixWithSilence,\n trimAdtsFramesByEarliestDts: trimAdtsFramesByEarliestDts,\n generateSampleTable: generateSampleTable,\n concatenateFrameData: concatenateFrameData\n};\n","/**\n * mux.js\n *\n * Copyright (c) 2015 Brightcove\n * All rights reserved.\n *\n * Reads in-band CEA-708 captions out of FMP4 segments.\n * @see https://en.wikipedia.org/wiki/CEA-708\n */\n'use strict';\n\nvar discardEmulationPreventionBytes = require('../tools/caption-packet-parser').discardEmulationPreventionBytes;\nvar CaptionStream = require('../m2ts/caption-stream').CaptionStream;\nvar probe = require('./probe');\nvar inspect = require('../tools/mp4-inspector');\n\n/**\n * Maps an offset in the mdat to a sample based on the the size of the samples.\n * Assumes that `parseSamples` has been called first.\n *\n * @param {Number} offset - The offset into the mdat\n * @param {Object[]} samples - An array of samples, parsed using `parseSamples`\n * @return {?Object} The matching sample, or null if no match was found.\n *\n * @see ISO-BMFF-12/2015, Section 8.8.8\n **/\nvar mapToSample = function(offset, samples) {\n var approximateOffset = offset;\n\n for (var i = 0; i < samples.length; i++) {\n var sample = samples[i];\n\n if (approximateOffset < sample.size) {\n return sample;\n }\n\n approximateOffset -= sample.size;\n }\n\n return null;\n};\n\n/**\n * Finds SEI nal units contained in a Media Data Box.\n * Assumes that `parseSamples` has been called first.\n *\n * @param {Uint8Array} avcStream - The bytes of the mdat\n * @param {Object[]} samples - The samples parsed out by `parseSamples`\n * @param {Number} trackId - The trackId of this video track\n * @return {Object[]} seiNals - the parsed SEI NALUs found.\n * The contents of the seiNal should match what is expected by\n * CaptionStream.push (nalUnitType, size, data, escapedRBSP, pts, dts)\n *\n * @see ISO-BMFF-12/2015, Section 8.1.1\n * @see Rec. ITU-T H.264, 7.3.2.3.1\n **/\nvar findSeiNals = function(avcStream, samples, trackId) {\n var\n avcView = new DataView(avcStream.buffer, avcStream.byteOffset, avcStream.byteLength),\n result = [],\n seiNal,\n i,\n length,\n lastMatchedSample;\n\n for (i = 0; i + 4 < avcStream.length; i += length) {\n length = avcView.getUint32(i);\n i += 4;\n\n // Bail if this doesn't appear to be an H264 stream\n if (length <= 0) {\n continue;\n }\n\n switch (avcStream[i] & 0x1F) {\n case 0x06:\n var data = avcStream.subarray(i + 1, i + 1 + length);\n var matchingSample = mapToSample(i, samples);\n\n seiNal = {\n nalUnitType: 'sei_rbsp',\n size: length,\n data: data,\n escapedRBSP: discardEmulationPreventionBytes(data),\n trackId: trackId\n };\n\n if (matchingSample) {\n seiNal.pts = matchingSample.pts;\n seiNal.dts = matchingSample.dts;\n lastMatchedSample = matchingSample;\n } else {\n // If a matching sample cannot be found, use the last\n // sample's values as they should be as close as possible\n seiNal.pts = lastMatchedSample.pts;\n seiNal.dts = lastMatchedSample.dts;\n }\n\n result.push(seiNal);\n break;\n default:\n break;\n }\n }\n\n return result;\n};\n\n/**\n * Parses sample information out of Track Run Boxes and calculates\n * the absolute presentation and decode timestamps of each sample.\n *\n * @param {Array<Uint8Array>} truns - The Trun Run boxes to be parsed\n * @param {Number} baseMediaDecodeTime - base media decode time from tfdt\n @see ISO-BMFF-12/2015, Section 8.8.12\n * @param {Object} tfhd - The parsed Track Fragment Header\n * @see inspect.parseTfhd\n * @return {Object[]} the parsed samples\n *\n * @see ISO-BMFF-12/2015, Section 8.8.8\n **/\nvar parseSamples = function(truns, baseMediaDecodeTime, tfhd) {\n var currentDts = baseMediaDecodeTime;\n var defaultSampleDuration = tfhd.defaultSampleDuration || 0;\n var defaultSampleSize = tfhd.defaultSampleSize || 0;\n var trackId = tfhd.trackId;\n var allSamples = [];\n\n truns.forEach(function(trun) {\n // Note: We currently do not parse the sample table as well\n // as the trun. It's possible some sources will require this.\n // moov > trak > mdia > minf > stbl\n var trackRun = inspect.parseTrun(trun);\n var samples = trackRun.samples;\n\n samples.forEach(function(sample) {\n if (sample.duration === undefined) {\n sample.duration = defaultSampleDuration;\n }\n if (sample.size === undefined) {\n sample.size = defaultSampleSize;\n }\n sample.trackId = trackId;\n sample.dts = currentDts;\n if (sample.compositionTimeOffset === undefined) {\n sample.compositionTimeOffset = 0;\n }\n sample.pts = currentDts + sample.compositionTimeOffset;\n\n currentDts += sample.duration;\n });\n\n allSamples = allSamples.concat(samples);\n });\n\n return allSamples;\n};\n\n/**\n * Parses out caption nals from an FMP4 segment's video tracks.\n *\n * @param {Uint8Array} segment - The bytes of a single segment\n * @param {Number} videoTrackId - The trackId of a video track in the segment\n * @return {Object.<Number, Object[]>} A mapping of video trackId to\n * a list of seiNals found in that track\n **/\nvar parseCaptionNals = function(segment, videoTrackId) {\n // To get the samples\n var trafs = probe.findBox(segment, ['moof', 'traf']);\n // To get SEI NAL units\n var mdats = probe.findBox(segment, ['mdat']);\n var captionNals = {};\n var mdatTrafPairs = [];\n\n // Pair up each traf with a mdat as moofs and mdats are in pairs\n mdats.forEach(function(mdat, index) {\n var matchingTraf = trafs[index];\n mdatTrafPairs.push({\n mdat: mdat,\n traf: matchingTraf\n });\n });\n\n mdatTrafPairs.forEach(function(pair) {\n var mdat = pair.mdat;\n var traf = pair.traf;\n var tfhd = probe.findBox(traf, ['tfhd']);\n // Exactly 1 tfhd per traf\n var headerInfo = inspect.parseTfhd(tfhd[0]);\n var trackId = headerInfo.trackId;\n var tfdt = probe.findBox(traf, ['tfdt']);\n // Either 0 or 1 tfdt per traf\n var baseMediaDecodeTime = (tfdt.length > 0) ? inspect.parseTfdt(tfdt[0]).baseMediaDecodeTime : 0;\n var truns = probe.findBox(traf, ['trun']);\n var samples;\n var seiNals;\n\n // Only parse video data for the chosen video track\n if (videoTrackId === trackId && truns.length > 0) {\n samples = parseSamples(truns, baseMediaDecodeTime, headerInfo);\n\n seiNals = findSeiNals(mdat, samples, trackId);\n\n if (!captionNals[trackId]) {\n captionNals[trackId] = [];\n }\n\n captionNals[trackId] = captionNals[trackId].concat(seiNals);\n }\n });\n\n return captionNals;\n};\n\n/**\n * Parses out inband captions from an MP4 container and returns\n * caption objects that can be used by WebVTT and the TextTrack API.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/VTTCue\n * @see https://developer.mozilla.org/en-US/docs/Web/API/TextTrack\n * Assumes that `probe.getVideoTrackIds` and `probe.timescale` have been called first\n *\n * @param {Uint8Array} segment - The fmp4 segment containing embedded captions\n * @param {Number} trackId - The id of the video track to parse\n * @param {Number} timescale - The timescale for the video track from the init segment\n *\n * @return {?Object[]} parsedCaptions - A list of captions or null if no video tracks\n * @return {Number} parsedCaptions[].startTime - The time to show the caption in seconds\n * @return {Number} parsedCaptions[].endTime - The time to stop showing the caption in seconds\n * @return {String} parsedCaptions[].text - The visible content of the caption\n **/\nvar parseEmbeddedCaptions = function(segment, trackId, timescale) {\n var seiNals;\n\n if (!trackId) {\n return null;\n }\n\n seiNals = parseCaptionNals(segment, trackId);\n\n return {\n seiNals: seiNals[trackId],\n timescale: timescale\n };\n};\n\n/**\n * Converts SEI NALUs into captions that can be used by video.js\n **/\nvar CaptionParser = function() {\n var isInitialized = false;\n var captionStream;\n\n // Stores segments seen before trackId and timescale are set\n var segmentCache;\n // Stores video track ID of the track being parsed\n var trackId;\n // Stores the timescale of the track being parsed\n var timescale;\n // Stores captions parsed so far\n var parsedCaptions;\n\n /**\n * A method to indicate whether a CaptionParser has been initalized\n * @returns {Boolean}\n **/\n this.isInitialized = function() {\n return isInitialized;\n };\n\n /**\n * Initializes the underlying CaptionStream, SEI NAL parsing\n * and management, and caption collection\n **/\n this.init = function() {\n captionStream = new CaptionStream();\n isInitialized = true;\n\n // Collect dispatched captions\n captionStream.on('data', function(event) {\n // Convert to seconds in the source's timescale\n event.startTime = event.startPts / timescale;\n event.endTime = event.endPts / timescale;\n\n parsedCaptions.captions.push(event);\n parsedCaptions.captionStreams[event.stream] = true;\n });\n };\n\n /**\n * Determines if a new video track will be selected\n * or if the timescale changed\n * @return {Boolean}\n **/\n this.isNewInit = function(videoTrackIds, timescales) {\n if ((videoTrackIds && videoTrackIds.length === 0) ||\n (timescales && typeof timescales === 'object' &&\n Object.keys(timescales).length === 0)) {\n return false;\n }\n\n return trackId !== videoTrackIds[0] ||\n timescale !== timescales[trackId];\n };\n\n /**\n * Parses out SEI captions and interacts with underlying\n * CaptionStream to return dispatched captions\n *\n * @param {Uint8Array} segment - The fmp4 segment containing embedded captions\n * @param {Number[]} videoTrackIds - A list of video tracks found in the init segment\n * @param {Object.<Number, Number>} timescales - The timescales found in the init segment\n * @see parseEmbeddedCaptions\n * @see m2ts/caption-stream.js\n **/\n this.parse = function(segment, videoTrackIds, timescales) {\n var parsedData;\n\n if (!this.isInitialized()) {\n return null;\n\n // This is not likely to be a video segment\n } else if (!videoTrackIds || !timescales) {\n return null;\n\n } else if (this.isNewInit(videoTrackIds, timescales)) {\n // Use the first video track only as there is no\n // mechanism to switch to other video tracks\n trackId = videoTrackIds[0];\n timescale = timescales[trackId];\n\n // If an init segment has not been seen yet, hold onto segment\n // data until we have one\n } else if (!trackId || !timescale) {\n segmentCache.push(segment);\n return null;\n }\n\n // Now that a timescale and trackId is set, parse cached segments\n while (segmentCache.length > 0) {\n var cachedSegment = segmentCache.shift();\n\n this.parse(cachedSegment, videoTrackIds, timescales);\n }\n\n parsedData = parseEmbeddedCaptions(segment, trackId, timescale);\n\n if (parsedData === null || !parsedData.seiNals) {\n return null;\n }\n\n this.pushNals(parsedData.seiNals);\n // Force the parsed captions to be dispatched\n this.flushStream();\n\n return parsedCaptions;\n };\n\n /**\n * Pushes SEI NALUs onto CaptionStream\n * @param {Object[]} nals - A list of SEI nals parsed using `parseCaptionNals`\n * Assumes that `parseCaptionNals` has been called first\n * @see m2ts/caption-stream.js\n **/\n this.pushNals = function(nals) {\n if (!this.isInitialized() || !nals || nals.length === 0) {\n return null;\n }\n\n nals.forEach(function(nal) {\n captionStream.push(nal);\n });\n };\n\n /**\n * Flushes underlying CaptionStream to dispatch processed, displayable captions\n * @see m2ts/caption-stream.js\n **/\n this.flushStream = function() {\n if (!this.isInitialized()) {\n return null;\n }\n\n captionStream.flush();\n };\n\n /**\n * Reset caption buckets for new data\n **/\n this.clearParsedCaptions = function() {\n parsedCaptions.captions = [];\n parsedCaptions.captionStreams = {};\n };\n\n /**\n * Resets underlying CaptionStream\n * @see m2ts/caption-stream.js\n **/\n this.resetCaptionStream = function() {\n if (!this.isInitialized()) {\n return null;\n }\n\n captionStream.reset();\n };\n\n /**\n * Convenience method to clear all captions flushed from the\n * CaptionStream and still being parsed\n * @see m2ts/caption-stream.js\n **/\n this.clearAllCaptions = function() {\n this.clearParsedCaptions();\n this.resetCaptionStream();\n };\n\n /**\n * Reset caption parser\n **/\n this.reset = function() {\n segmentCache = [];\n trackId = null;\n timescale = null;\n\n if (!parsedCaptions) {\n parsedCaptions = {\n captions: [],\n // CC1, CC2, CC3, CC4\n captionStreams: {}\n };\n } else {\n this.clearParsedCaptions();\n }\n\n this.resetCaptionStream();\n };\n\n this.reset();\n};\n\nmodule.exports = CaptionParser;\n","// Convert an array of nal units into an array of frames with each frame being\n// composed of the nal units that make up that frame\n// Also keep track of cummulative data about the frame from the nal units such\n// as the frame duration, starting pts, etc.\nvar groupNalsIntoFrames = function(nalUnits) {\n var\n i,\n currentNal,\n currentFrame = [],\n frames = [];\n\n currentFrame.byteLength = 0;\n\n for (i = 0; i < nalUnits.length; i++) {\n currentNal = nalUnits[i];\n\n // Split on 'aud'-type nal units\n if (currentNal.nalUnitType === 'access_unit_delimiter_rbsp') {\n // Since the very first nal unit is expected to be an AUD\n // only push to the frames array when currentFrame is not empty\n if (currentFrame.length) {\n currentFrame.duration = currentNal.dts - currentFrame.dts;\n frames.push(currentFrame);\n }\n currentFrame = [currentNal];\n currentFrame.byteLength = currentNal.data.byteLength;\n currentFrame.pts = currentNal.pts;\n currentFrame.dts = currentNal.dts;\n } else {\n // Specifically flag key frames for ease of use later\n if (currentNal.nalUnitType === 'slice_layer_without_partitioning_rbsp_idr') {\n currentFrame.keyFrame = true;\n }\n currentFrame.duration = currentNal.dts - currentFrame.dts;\n currentFrame.byteLength += currentNal.data.byteLength;\n currentFrame.push(currentNal);\n }\n }\n\n // For the last frame, use the duration of the previous frame if we\n // have nothing better to go on\n if (frames.length &&\n (!currentFrame.duration ||\n currentFrame.duration <= 0)) {\n currentFrame.duration = frames[frames.length - 1].duration;\n }\n\n // Push the final frame\n frames.push(currentFrame);\n return frames;\n};\n\n// Convert an array of frames into an array of Gop with each Gop being composed\n// of the frames that make up that Gop\n// Also keep track of cummulative data about the Gop from the frames such as the\n// Gop duration, starting pts, etc.\nvar groupFramesIntoGops = function(frames) {\n var\n i,\n currentFrame,\n currentGop = [],\n gops = [];\n\n // We must pre-set some of the values on the Gop since we\n // keep running totals of these values\n currentGop.byteLength = 0;\n currentGop.nalCount = 0;\n currentGop.duration = 0;\n currentGop.pts = frames[0].pts;\n currentGop.dts = frames[0].dts;\n\n // store some metadata about all the Gops\n gops.byteLength = 0;\n gops.nalCount = 0;\n gops.duration = 0;\n gops.pts = frames[0].pts;\n gops.dts = frames[0].dts;\n\n for (i = 0; i < frames.length; i++) {\n currentFrame = frames[i];\n\n if (currentFrame.keyFrame) {\n // Since the very first frame is expected to be an keyframe\n // only push to the gops array when currentGop is not empty\n if (currentGop.length) {\n gops.push(currentGop);\n gops.byteLength += currentGop.byteLength;\n gops.nalCount += currentGop.nalCount;\n gops.duration += currentGop.duration;\n }\n\n currentGop = [currentFrame];\n currentGop.nalCount = currentFrame.length;\n currentGop.byteLength = currentFrame.byteLength;\n currentGop.pts = currentFrame.pts;\n currentGop.dts = currentFrame.dts;\n currentGop.duration = currentFrame.duration;\n } else {\n currentGop.duration += currentFrame.duration;\n currentGop.nalCount += currentFrame.length;\n currentGop.byteLength += currentFrame.byteLength;\n currentGop.push(currentFrame);\n }\n }\n\n if (gops.length && currentGop.duration <= 0) {\n currentGop.duration = gops[gops.length - 1].duration;\n }\n gops.byteLength += currentGop.byteLength;\n gops.nalCount += currentGop.nalCount;\n gops.duration += currentGop.duration;\n\n // push the final Gop\n gops.push(currentGop);\n return gops;\n};\n\n/*\n * Search for the first keyframe in the GOPs and throw away all frames\n * until that keyframe. Then extend the duration of the pulled keyframe\n * and pull the PTS and DTS of the keyframe so that it covers the time\n * range of the frames that were disposed.\n *\n * @param {Array} gops video GOPs\n * @returns {Array} modified video GOPs\n */\nvar extendFirstKeyFrame = function(gops) {\n var currentGop;\n\n if (!gops[0][0].keyFrame && gops.length > 1) {\n // Remove the first GOP\n currentGop = gops.shift();\n\n gops.byteLength -= currentGop.byteLength;\n gops.nalCount -= currentGop.nalCount;\n\n // Extend the first frame of what is now the\n // first gop to cover the time period of the\n // frames we just removed\n gops[0][0].dts = currentGop.dts;\n gops[0][0].pts = currentGop.pts;\n gops[0][0].duration += currentGop.duration;\n }\n\n return gops;\n};\n\n/**\n * Default sample object\n * see ISO/IEC 14496-12:2012, section 8.6.4.3\n */\nvar createDefaultSample = function() {\n return {\n size: 0,\n flags: {\n isLeading: 0,\n dependsOn: 1,\n isDependedOn: 0,\n hasRedundancy: 0,\n degradationPriority: 0,\n isNonSyncSample: 1\n }\n };\n};\n\n/*\n * Collates information from a video frame into an object for eventual\n * entry into an MP4 sample table.\n *\n * @param {Object} frame the video frame\n * @param {Number} dataOffset the byte offset to position the sample\n * @return {Object} object containing sample table info for a frame\n */\nvar sampleForFrame = function(frame, dataOffset) {\n var sample = createDefaultSample();\n\n sample.dataOffset = dataOffset;\n sample.compositionTimeOffset = frame.pts - frame.dts;\n sample.duration = frame.duration;\n sample.size = 4 * frame.length; // Space for nal unit size\n sample.size += frame.byteLength;\n\n if (frame.keyFrame) {\n sample.flags.dependsOn = 2;\n sample.flags.isNonSyncSample = 0;\n }\n\n return sample;\n};\n\n// generate the track's sample table from an array of gops\nvar generateSampleTable = function(gops, baseDataOffset) {\n var\n h, i,\n sample,\n currentGop,\n currentFrame,\n dataOffset = baseDataOffset || 0,\n samples = [];\n\n for (h = 0; h < gops.length; h++) {\n currentGop = gops[h];\n\n for (i = 0; i < currentGop.length; i++) {\n currentFrame = currentGop[i];\n\n sample = sampleForFrame(currentFrame, dataOffset);\n\n dataOffset += sample.size;\n\n samples.push(sample);\n }\n }\n return samples;\n};\n\n// generate the track's raw mdat data from an array of gops\nvar concatenateNalData = function(gops) {\n var\n h, i, j,\n currentGop,\n currentFrame,\n currentNal,\n dataOffset = 0,\n nalsByteLength = gops.byteLength,\n numberOfNals = gops.nalCount,\n totalByteLength = nalsByteLength + 4 * numberOfNals,\n data = new Uint8Array(totalByteLength),\n view = new DataView(data.buffer);\n\n // For each Gop..\n for (h = 0; h < gops.length; h++) {\n currentGop = gops[h];\n\n // For each Frame..\n for (i = 0; i < currentGop.length; i++) {\n currentFrame = currentGop[i];\n\n // For each NAL..\n for (j = 0; j < currentFrame.length; j++) {\n currentNal = currentFrame[j];\n\n view.setUint32(dataOffset, currentNal.data.byteLength);\n dataOffset += 4;\n data.set(currentNal.data, dataOffset);\n dataOffset += currentNal.data.byteLength;\n }\n }\n }\n return data;\n};\n\nmodule.exports = {\n groupNalsIntoFrames: groupNalsIntoFrames,\n groupFramesIntoGops: groupFramesIntoGops,\n extendFirstKeyFrame: extendFirstKeyFrame,\n generateSampleTable: generateSampleTable,\n concatenateNalData: concatenateNalData\n};\n","module.exports = {\n generator: require('./mp4-generator'),\n probe: require('./probe'),\n Transmuxer: require('./transmuxer').Transmuxer,\n AudioSegmentStream: require('./transmuxer').AudioSegmentStream,\n VideoSegmentStream: require('./transmuxer').VideoSegmentStream,\n CaptionParser: require('./caption-parser')\n};\n","/**\n * mux.js\n *\n * Copyright (c) 2015 Brightcove\n * All rights reserved.\n *\n * Functions that generate fragmented MP4s suitable for use with Media\n * Source Extensions.\n */\n'use strict';\n\nvar UINT32_MAX = Math.pow(2, 32) - 1;\n\nvar box, dinf, esds, ftyp, mdat, mfhd, minf, moof, moov, mvex, mvhd,\n trak, tkhd, mdia, mdhd, hdlr, sdtp, stbl, stsd, traf, trex,\n trun, types, MAJOR_BRAND, MINOR_VERSION, AVC1_BRAND, VIDEO_HDLR,\n AUDIO_HDLR, HDLR_TYPES, VMHD, SMHD, DREF, STCO, STSC, STSZ, STTS;\n\n// pre-calculate constants\n(function() {\n var i;\n types = {\n avc1: [], // codingname\n avcC: [],\n btrt: [],\n dinf: [],\n dref: [],\n esds: [],\n ftyp: [],\n hdlr: [],\n mdat: [],\n mdhd: [],\n mdia: [],\n mfhd: [],\n minf: [],\n moof: [],\n moov: [],\n mp4a: [], // codingname\n mvex: [],\n mvhd: [],\n sdtp: [],\n smhd: [],\n stbl: [],\n stco: [],\n stsc: [],\n stsd: [],\n stsz: [],\n stts: [],\n styp: [],\n tfdt: [],\n tfhd: [],\n traf: [],\n trak: [],\n trun: [],\n trex: [],\n tkhd: [],\n vmhd: []\n };\n\n // In environments where Uint8Array is undefined (e.g., IE8), skip set up so that we\n // don't throw an error\n if (typeof Uint8Array === 'undefined') {\n return;\n }\n\n for (i in types) {\n if (types.hasOwnProperty(i)) {\n types[i] = [\n i.charCodeAt(0),\n i.charCodeAt(1),\n i.charCodeAt(2),\n i.charCodeAt(3)\n ];\n }\n }\n\n MAJOR_BRAND = new Uint8Array([\n 'i'.charCodeAt(0),\n 's'.charCodeAt(0),\n 'o'.charCodeAt(0),\n 'm'.charCodeAt(0)\n ]);\n AVC1_BRAND = new Uint8Array([\n 'a'.charCodeAt(0),\n 'v'.charCodeAt(0),\n 'c'.charCodeAt(0),\n '1'.charCodeAt(0)\n ]);\n MINOR_VERSION = new Uint8Array([0, 0, 0, 1]);\n VIDEO_HDLR = new Uint8Array([\n 0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, // pre_defined\n 0x76, 0x69, 0x64, 0x65, // handler_type: 'vide'\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x56, 0x69, 0x64, 0x65,\n 0x6f, 0x48, 0x61, 0x6e,\n 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'VideoHandler'\n ]);\n AUDIO_HDLR = new Uint8Array([\n 0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, // pre_defined\n 0x73, 0x6f, 0x75, 0x6e, // handler_type: 'soun'\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x53, 0x6f, 0x75, 0x6e,\n 0x64, 0x48, 0x61, 0x6e,\n 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'SoundHandler'\n ]);\n HDLR_TYPES = {\n video: VIDEO_HDLR,\n audio: AUDIO_HDLR\n };\n DREF = new Uint8Array([\n 0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x01, // entry_count\n 0x00, 0x00, 0x00, 0x0c, // entry_size\n 0x75, 0x72, 0x6c, 0x20, // 'url' type\n 0x00, // version 0\n 0x00, 0x00, 0x01 // entry_flags\n ]);\n SMHD = new Uint8Array([\n 0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, // balance, 0 means centered\n 0x00, 0x00 // reserved\n ]);\n STCO = new Uint8Array([\n 0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00 // entry_count\n ]);\n STSC = STCO;\n STSZ = new Uint8Array([\n 0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, // sample_size\n 0x00, 0x00, 0x00, 0x00 // sample_count\n ]);\n STTS = STCO;\n VMHD = new Uint8Array([\n 0x00, // version\n 0x00, 0x00, 0x01, // flags\n 0x00, 0x00, // graphicsmode\n 0x00, 0x00,\n 0x00, 0x00,\n 0x00, 0x00 // opcolor\n ]);\n}());\n\nbox = function(type) {\n var\n payload = [],\n size = 0,\n i,\n result,\n view;\n\n for (i = 1; i < arguments.length; i++) {\n payload.push(arguments[i]);\n }\n\n i = payload.length;\n\n // calculate the total size we need to allocate\n while (i--) {\n size += payload[i].byteLength;\n }\n result = new Uint8Array(size + 8);\n view = new DataView(result.buffer, result.byteOffset, result.byteLength);\n view.setUint32(0, result.byteLength);\n result.set(type, 4);\n\n // copy the payload into the result\n for (i = 0, size = 8; i < payload.length; i++) {\n result.set(payload[i], size);\n size += payload[i].byteLength;\n }\n return result;\n};\n\ndinf = function() {\n return box(types.dinf, box(types.dref, DREF));\n};\n\nesds = function(track) {\n return box(types.esds, new Uint8Array([\n 0x00, // version\n 0x00, 0x00, 0x00, // flags\n\n // ES_Descriptor\n 0x03, // tag, ES_DescrTag\n 0x19, // length\n 0x00, 0x00, // ES_ID\n 0x00, // streamDependenceFlag, URL_flag, reserved, streamPriority\n\n // DecoderConfigDescriptor\n 0x04, // tag, DecoderConfigDescrTag\n 0x11, // length\n 0x40, // object type\n 0x15, // streamType\n 0x00, 0x06, 0x00, // bufferSizeDB\n 0x00, 0x00, 0xda, 0xc0, // maxBitrate\n 0x00, 0x00, 0xda, 0xc0, // avgBitrate\n\n // DecoderSpecificInfo\n 0x05, // tag, DecoderSpecificInfoTag\n 0x02, // length\n // ISO/IEC 14496-3, AudioSpecificConfig\n // for samplingFrequencyIndex see ISO/IEC 13818-7:2006, 8.1.3.2.2, Table 35\n (track.audioobjecttype << 3) | (track.samplingfrequencyindex >>> 1),\n (track.samplingfrequencyindex << 7) | (track.channelcount << 3),\n 0x06, 0x01, 0x02 // GASpecificConfig\n ]));\n};\n\nftyp = function() {\n return box(types.ftyp, MAJOR_BRAND, MINOR_VERSION, MAJOR_BRAND, AVC1_BRAND);\n};\n\nhdlr = function(type) {\n return box(types.hdlr, HDLR_TYPES[type]);\n};\nmdat = function(data) {\n return box(types.mdat, data);\n};\nmdhd = function(track) {\n var result = new Uint8Array([\n 0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x02, // creation_time\n 0x00, 0x00, 0x00, 0x03, // modification_time\n 0x00, 0x01, 0x5f, 0x90, // timescale, 90,000 \"ticks\" per second\n\n (track.duration >>> 24) & 0xFF,\n (track.duration >>> 16) & 0xFF,\n (track.duration >>> 8) & 0xFF,\n track.duration & 0xFF, // duration\n 0x55, 0xc4, // 'und' language (undetermined)\n 0x00, 0x00\n ]);\n\n // Use the sample rate from the track metadata, when it is\n // defined. The sample rate can be parsed out of an ADTS header, for\n // instance.\n if (track.samplerate) {\n result[12] = (track.samplerate >>> 24) & 0xFF;\n result[13] = (track.samplerate >>> 16) & 0xFF;\n result[14] = (track.samplerate >>> 8) & 0xFF;\n result[15] = (track.samplerate) & 0xFF;\n }\n\n return box(types.mdhd, result);\n};\nmdia = function(track) {\n return box(types.mdia, mdhd(track), hdlr(track.type), minf(track));\n};\nmfhd = function(sequenceNumber) {\n return box(types.mfhd, new Uint8Array([\n 0x00,\n 0x00, 0x00, 0x00, // flags\n (sequenceNumber & 0xFF000000) >> 24,\n (sequenceNumber & 0xFF0000) >> 16,\n (sequenceNumber & 0xFF00) >> 8,\n sequenceNumber & 0xFF // sequence_number\n ]));\n};\nminf = function(track) {\n return box(types.minf,\n track.type === 'video' ? box(types.vmhd, VMHD) : box(types.smhd, SMHD),\n dinf(),\n stbl(track));\n};\nmoof = function(sequenceNumber, tracks) {\n var\n trackFragments = [],\n i = tracks.length;\n // build traf boxes for each track fragment\n while (i--) {\n trackFragments[i] = traf(tracks[i]);\n }\n return box.apply(null, [\n types.moof,\n mfhd(sequenceNumber)\n ].concat(trackFragments));\n};\n/**\n * Returns a movie box.\n * @param tracks {array} the tracks associated with this movie\n * @see ISO/IEC 14496-12:2012(E), section 8.2.1\n */\nmoov = function(tracks) {\n var\n i = tracks.length,\n boxes = [];\n\n while (i--) {\n boxes[i] = trak(tracks[i]);\n }\n\n return box.apply(null, [types.moov, mvhd(0xffffffff)].concat(boxes).concat(mvex(tracks)));\n};\nmvex = function(tracks) {\n var\n i = tracks.length,\n boxes = [];\n\n while (i--) {\n boxes[i] = trex(tracks[i]);\n }\n return box.apply(null, [types.mvex].concat(boxes));\n};\nmvhd = function(duration) {\n var\n bytes = new Uint8Array([\n 0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x01, // creation_time\n 0x00, 0x00, 0x00, 0x02, // modification_time\n 0x00, 0x01, 0x5f, 0x90, // timescale, 90,000 \"ticks\" per second\n (duration & 0xFF000000) >> 24,\n (duration & 0xFF0000) >> 16,\n (duration & 0xFF00) >> 8,\n duration & 0xFF, // duration\n 0x00, 0x01, 0x00, 0x00, // 1.0 rate\n 0x01, 0x00, // 1.0 volume\n 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x01, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, // pre_defined\n 0xff, 0xff, 0xff, 0xff // next_track_ID\n ]);\n return box(types.mvhd, bytes);\n};\n\nsdtp = function(track) {\n var\n samples = track.samples || [],\n bytes = new Uint8Array(4 + samples.length),\n flags,\n i;\n\n // leave the full box header (4 bytes) all zero\n\n // write the sample table\n for (i = 0; i < samples.length; i++) {\n flags = samples[i].flags;\n\n bytes[i + 4] = (flags.dependsOn << 4) |\n (flags.isDependedOn << 2) |\n (flags.hasRedundancy);\n }\n\n return box(types.sdtp,\n bytes);\n};\n\nstbl = function(track) {\n return box(types.stbl,\n stsd(track),\n box(types.stts, STTS),\n box(types.stsc, STSC),\n box(types.stsz, STSZ),\n box(types.stco, STCO));\n};\n\n(function() {\n var videoSample, audioSample;\n\n stsd = function(track) {\n\n return box(types.stsd, new Uint8Array([\n 0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x01\n ]), track.type === 'video' ? videoSample(track) : audioSample(track));\n };\n\n videoSample = function(track) {\n var\n sps = track.sps || [],\n pps = track.pps || [],\n sequenceParameterSets = [],\n pictureParameterSets = [],\n i;\n\n // assemble the SPSs\n for (i = 0; i < sps.length; i++) {\n sequenceParameterSets.push((sps[i].byteLength & 0xFF00) >>> 8);\n sequenceParameterSets.push((sps[i].byteLength & 0xFF)); // sequenceParameterSetLength\n sequenceParameterSets = sequenceParameterSets.concat(Array.prototype.slice.call(sps[i])); // SPS\n }\n\n // assemble the PPSs\n for (i = 0; i < pps.length; i++) {\n pictureParameterSets.push((pps[i].byteLength & 0xFF00) >>> 8);\n pictureParameterSets.push((pps[i].byteLength & 0xFF));\n pictureParameterSets = pictureParameterSets.concat(Array.prototype.slice.call(pps[i]));\n }\n\n return box(types.avc1, new Uint8Array([\n 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // data_reference_index\n 0x00, 0x00, // pre_defined\n 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, // pre_defined\n (track.width & 0xff00) >> 8,\n track.width & 0xff, // width\n (track.height & 0xff00) >> 8,\n track.height & 0xff, // height\n 0x00, 0x48, 0x00, 0x00, // horizresolution\n 0x00, 0x48, 0x00, 0x00, // vertresolution\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // frame_count\n 0x13,\n 0x76, 0x69, 0x64, 0x65,\n 0x6f, 0x6a, 0x73, 0x2d,\n 0x63, 0x6f, 0x6e, 0x74,\n 0x72, 0x69, 0x62, 0x2d,\n 0x68, 0x6c, 0x73, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, // compressorname\n 0x00, 0x18, // depth = 24\n 0x11, 0x11 // pre_defined = -1\n ]), box(types.avcC, new Uint8Array([\n 0x01, // configurationVersion\n track.profileIdc, // AVCProfileIndication\n track.profileCompatibility, // profile_compatibility\n track.levelIdc, // AVCLevelIndication\n 0xff // lengthSizeMinusOne, hard-coded to 4 bytes\n ].concat([\n sps.length // numOfSequenceParameterSets\n ]).concat(sequenceParameterSets).concat([\n pps.length // numOfPictureParameterSets\n ]).concat(pictureParameterSets))), // \"PPS\"\n box(types.btrt, new Uint8Array([\n 0x00, 0x1c, 0x9c, 0x80, // bufferSizeDB\n 0x00, 0x2d, 0xc6, 0xc0, // maxBitrate\n 0x00, 0x2d, 0xc6, 0xc0\n ])) // avgBitrate\n );\n };\n\n audioSample = function(track) {\n return box(types.mp4a, new Uint8Array([\n\n // SampleEntry, ISO/IEC 14496-12\n 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // data_reference_index\n\n // AudioSampleEntry, ISO/IEC 14496-12\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n (track.channelcount & 0xff00) >> 8,\n (track.channelcount & 0xff), // channelcount\n\n (track.samplesize & 0xff00) >> 8,\n (track.samplesize & 0xff), // samplesize\n 0x00, 0x00, // pre_defined\n 0x00, 0x00, // reserved\n\n (track.samplerate & 0xff00) >> 8,\n (track.samplerate & 0xff),\n 0x00, 0x00 // samplerate, 16.16\n\n // MP4AudioSampleEntry, ISO/IEC 14496-14\n ]), esds(track));\n };\n}());\n\ntkhd = function(track) {\n var result = new Uint8Array([\n 0x00, // version 0\n 0x00, 0x00, 0x07, // flags\n 0x00, 0x00, 0x00, 0x00, // creation_time\n 0x00, 0x00, 0x00, 0x00, // modification_time\n (track.id & 0xFF000000) >> 24,\n (track.id & 0xFF0000) >> 16,\n (track.id & 0xFF00) >> 8,\n track.id & 0xFF, // track_ID\n 0x00, 0x00, 0x00, 0x00, // reserved\n (track.duration & 0xFF000000) >> 24,\n (track.duration & 0xFF0000) >> 16,\n (track.duration & 0xFF00) >> 8,\n track.duration & 0xFF, // duration\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, // layer\n 0x00, 0x00, // alternate_group\n 0x01, 0x00, // non-audio track volume\n 0x00, 0x00, // reserved\n 0x00, 0x01, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x01, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix\n (track.width & 0xFF00) >> 8,\n track.width & 0xFF,\n 0x00, 0x00, // width\n (track.height & 0xFF00) >> 8,\n track.height & 0xFF,\n 0x00, 0x00 // height\n ]);\n\n return box(types.tkhd, result);\n};\n\n/**\n * Generate a track fragment (traf) box. A traf box collects metadata\n * about tracks in a movie fragment (moof) box.\n */\ntraf = function(track) {\n var trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun,\n sampleDependencyTable, dataOffset,\n upperWordBaseMediaDecodeTime, lowerWordBaseMediaDecodeTime;\n\n trackFragmentHeader = box(types.tfhd, new Uint8Array([\n 0x00, // version 0\n 0x00, 0x00, 0x3a, // flags\n (track.id & 0xFF000000) >> 24,\n (track.id & 0xFF0000) >> 16,\n (track.id & 0xFF00) >> 8,\n (track.id & 0xFF), // track_ID\n 0x00, 0x00, 0x00, 0x01, // sample_description_index\n 0x00, 0x00, 0x00, 0x00, // default_sample_duration\n 0x00, 0x00, 0x00, 0x00, // default_sample_size\n 0x00, 0x00, 0x00, 0x00 // default_sample_flags\n ]));\n\n upperWordBaseMediaDecodeTime = Math.floor(track.baseMediaDecodeTime / (UINT32_MAX + 1));\n lowerWordBaseMediaDecodeTime = Math.floor(track.baseMediaDecodeTime % (UINT32_MAX + 1));\n\n trackFragmentDecodeTime = box(types.tfdt, new Uint8Array([\n 0x01, // version 1\n 0x00, 0x00, 0x00, // flags\n // baseMediaDecodeTime\n (upperWordBaseMediaDecodeTime >>> 24) & 0xFF,\n (upperWordBaseMediaDecodeTime >>> 16) & 0xFF,\n (upperWordBaseMediaDecodeTime >>> 8) & 0xFF,\n upperWordBaseMediaDecodeTime & 0xFF,\n (lowerWordBaseMediaDecodeTime >>> 24) & 0xFF,\n (lowerWordBaseMediaDecodeTime >>> 16) & 0xFF,\n (lowerWordBaseMediaDecodeTime >>> 8) & 0xFF,\n lowerWordBaseMediaDecodeTime & 0xFF\n ]));\n\n // the data offset specifies the number of bytes from the start of\n // the containing moof to the first payload byte of the associated\n // mdat\n dataOffset = (32 + // tfhd\n 20 + // tfdt\n 8 + // traf header\n 16 + // mfhd\n 8 + // moof header\n 8); // mdat header\n\n // audio tracks require less metadata\n if (track.type === 'audio') {\n trackFragmentRun = trun(track, dataOffset);\n return box(types.traf,\n trackFragmentHeader,\n trackFragmentDecodeTime,\n trackFragmentRun);\n }\n\n // video tracks should contain an independent and disposable samples\n // box (sdtp)\n // generate one and adjust offsets to match\n sampleDependencyTable = sdtp(track);\n trackFragmentRun = trun(track,\n sampleDependencyTable.length + dataOffset);\n return box(types.traf,\n trackFragmentHeader,\n trackFragmentDecodeTime,\n trackFragmentRun,\n sampleDependencyTable);\n};\n\n/**\n * Generate a track box.\n * @param track {object} a track definition\n * @return {Uint8Array} the track box\n */\ntrak = function(track) {\n track.duration = track.duration || 0xffffffff;\n return box(types.trak,\n tkhd(track),\n mdia(track));\n};\n\ntrex = function(track) {\n var result = new Uint8Array([\n 0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n (track.id & 0xFF000000) >> 24,\n (track.id & 0xFF0000) >> 16,\n (track.id & 0xFF00) >> 8,\n (track.id & 0xFF), // track_ID\n 0x00, 0x00, 0x00, 0x01, // default_sample_description_index\n 0x00, 0x00, 0x00, 0x00, // default_sample_duration\n 0x00, 0x00, 0x00, 0x00, // default_sample_size\n 0x00, 0x01, 0x00, 0x01 // default_sample_flags\n ]);\n // the last two bytes of default_sample_flags is the sample\n // degradation priority, a hint about the importance of this sample\n // relative to others. Lower the degradation priority for all sample\n // types other than video.\n if (track.type !== 'video') {\n result[result.length - 1] = 0x00;\n }\n\n return box(types.trex, result);\n};\n\n(function() {\n var audioTrun, videoTrun, trunHeader;\n\n // This method assumes all samples are uniform. That is, if a\n // duration is present for the first sample, it will be present for\n // all subsequent samples.\n // see ISO/IEC 14496-12:2012, Section 8.8.8.1\n trunHeader = function(samples, offset) {\n var durationPresent = 0, sizePresent = 0,\n flagsPresent = 0, compositionTimeOffset = 0;\n\n // trun flag constants\n if (samples.length) {\n if (samples[0].duration !== undefined) {\n durationPresent = 0x1;\n }\n if (samples[0].size !== undefined) {\n sizePresent = 0x2;\n }\n if (samples[0].flags !== undefined) {\n flagsPresent = 0x4;\n }\n if (samples[0].compositionTimeOffset !== undefined) {\n compositionTimeOffset = 0x8;\n }\n }\n\n return [\n 0x00, // version 0\n 0x00,\n durationPresent | sizePresent | flagsPresent | compositionTimeOffset,\n 0x01, // flags\n (samples.length & 0xFF000000) >>> 24,\n (samples.length & 0xFF0000) >>> 16,\n (samples.length & 0xFF00) >>> 8,\n samples.length & 0xFF, // sample_count\n (offset & 0xFF000000) >>> 24,\n (offset & 0xFF0000) >>> 16,\n (offset & 0xFF00) >>> 8,\n offset & 0xFF // data_offset\n ];\n };\n\n videoTrun = function(track, offset) {\n var bytes, samples, sample, i;\n\n samples = track.samples || [];\n offset += 8 + 12 + (16 * samples.length);\n\n bytes = trunHeader(samples, offset);\n\n for (i = 0; i < samples.length; i++) {\n sample = samples[i];\n bytes = bytes.concat([\n (sample.duration & 0xFF000000) >>> 24,\n (sample.duration & 0xFF0000) >>> 16,\n (sample.duration & 0xFF00) >>> 8,\n sample.duration & 0xFF, // sample_duration\n (sample.size & 0xFF000000) >>> 24,\n (sample.size & 0xFF0000) >>> 16,\n (sample.size & 0xFF00) >>> 8,\n sample.size & 0xFF, // sample_size\n (sample.flags.isLeading << 2) | sample.flags.dependsOn,\n (sample.flags.isDependedOn << 6) |\n (sample.flags.hasRedundancy << 4) |\n (sample.flags.paddingValue << 1) |\n sample.flags.isNonSyncSample,\n sample.flags.degradationPriority & 0xF0 << 8,\n sample.flags.degradationPriority & 0x0F, // sample_flags\n (sample.compositionTimeOffset & 0xFF000000) >>> 24,\n (sample.compositionTimeOffset & 0xFF0000) >>> 16,\n (sample.compositionTimeOffset & 0xFF00) >>> 8,\n sample.compositionTimeOffset & 0xFF // sample_composition_time_offset\n ]);\n }\n return box(types.trun, new Uint8Array(bytes));\n };\n\n audioTrun = function(track, offset) {\n var bytes, samples, sample, i;\n\n samples = track.samples || [];\n offset += 8 + 12 + (8 * samples.length);\n\n bytes = trunHeader(samples, offset);\n\n for (i = 0; i < samples.length; i++) {\n sample = samples[i];\n bytes = bytes.concat([\n (sample.duration & 0xFF000000) >>> 24,\n (sample.duration & 0xFF0000) >>> 16,\n (sample.duration & 0xFF00) >>> 8,\n sample.duration & 0xFF, // sample_duration\n (sample.size & 0xFF000000) >>> 24,\n (sample.size & 0xFF0000) >>> 16,\n (sample.size & 0xFF00) >>> 8,\n sample.size & 0xFF]); // sample_size\n }\n\n return box(types.trun, new Uint8Array(bytes));\n };\n\n trun = function(track, offset) {\n if (track.type === 'audio') {\n return audioTrun(track, offset);\n }\n\n return videoTrun(track, offset);\n };\n}());\n\nmodule.exports = {\n ftyp: ftyp,\n mdat: mdat,\n moof: moof,\n moov: moov,\n initSegment: function(tracks) {\n var\n fileType = ftyp(),\n movie = moov(tracks),\n result;\n\n result = new Uint8Array(fileType.byteLength + movie.byteLength);\n result.set(fileType);\n result.set(movie, fileType.byteLength);\n return result;\n }\n};\n","/**\n * mux.js\n *\n * Copyright (c) 2015 Brightcove\n * All rights reserved.\n *\n * Utilities to detect basic properties and metadata about MP4s.\n */\n'use strict';\n\nvar toUnsigned = require('../utils/bin').toUnsigned;\nvar findBox, parseType, timescale, startTime, getVideoTrackIds;\n\n// Find the data for a box specified by its path\nfindBox = function(data, path) {\n var results = [],\n i, size, type, end, subresults;\n\n if (!path.length) {\n // short-circuit the search for empty paths\n return null;\n }\n\n for (i = 0; i < data.byteLength;) {\n size = toUnsigned(data[i] << 24 |\n data[i + 1] << 16 |\n data[i + 2] << 8 |\n data[i + 3]);\n\n type = parseType(data.subarray(i + 4, i + 8));\n\n end = size > 1 ? i + size : data.byteLength;\n\n if (type === path[0]) {\n if (path.length === 1) {\n // this is the end of the path and we've found the box we were\n // looking for\n results.push(data.subarray(i + 8, end));\n } else {\n // recursively search for the next box along the path\n subresults = findBox(data.subarray(i + 8, end), path.slice(1));\n if (subresults.length) {\n results = results.concat(subresults);\n }\n }\n }\n i = end;\n }\n\n // we've finished searching all of data\n return results;\n};\n\n/**\n * Returns the string representation of an ASCII encoded four byte buffer.\n * @param buffer {Uint8Array} a four-byte buffer to translate\n * @return {string} the corresponding string\n */\nparseType = function(buffer) {\n var result = '';\n result += String.fromCharCode(buffer[0]);\n result += String.fromCharCode(buffer[1]);\n result += String.fromCharCode(buffer[2]);\n result += String.fromCharCode(buffer[3]);\n return result;\n};\n\n/**\n * Parses an MP4 initialization segment and extracts the timescale\n * values for any declared tracks. Timescale values indicate the\n * number of clock ticks per second to assume for time-based values\n * elsewhere in the MP4.\n *\n * To determine the start time of an MP4, you need two pieces of\n * information: the timescale unit and the earliest base media decode\n * time. Multiple timescales can be specified within an MP4 but the\n * base media decode time is always expressed in the timescale from\n * the media header box for the track:\n * ```\n * moov > trak > mdia > mdhd.timescale\n * ```\n * @param init {Uint8Array} the bytes of the init segment\n * @return {object} a hash of track ids to timescale values or null if\n * the init segment is malformed.\n */\ntimescale = function(init) {\n var\n result = {},\n traks = findBox(init, ['moov', 'trak']);\n\n // mdhd timescale\n return traks.reduce(function(result, trak) {\n var tkhd, version, index, id, mdhd;\n\n tkhd = findBox(trak, ['tkhd'])[0];\n if (!tkhd) {\n return null;\n }\n version = tkhd[0];\n index = version === 0 ? 12 : 20;\n id = toUnsigned(tkhd[index] << 24 |\n tkhd[index + 1] << 16 |\n tkhd[index + 2] << 8 |\n tkhd[index + 3]);\n\n mdhd = findBox(trak, ['mdia', 'mdhd'])[0];\n if (!mdhd) {\n return null;\n }\n version = mdhd[0];\n index = version === 0 ? 12 : 20;\n result[id] = toUnsigned(mdhd[index] << 24 |\n mdhd[index + 1] << 16 |\n mdhd[index + 2] << 8 |\n mdhd[index + 3]);\n return result;\n }, result);\n};\n\n/**\n * Determine the base media decode start time, in seconds, for an MP4\n * fragment. If multiple fragments are specified, the earliest time is\n * returned.\n *\n * The base media decode time can be parsed from track fragment\n * metadata:\n * ```\n * moof > traf > tfdt.baseMediaDecodeTime\n * ```\n * It requires the timescale value from the mdhd to interpret.\n *\n * @param timescale {object} a hash of track ids to timescale values.\n * @return {number} the earliest base media decode start time for the\n * fragment, in seconds\n */\nstartTime = function(timescale, fragment) {\n var trafs, baseTimes, result;\n\n // we need info from two childrend of each track fragment box\n trafs = findBox(fragment, ['moof', 'traf']);\n\n // determine the start times for each track\n baseTimes = [].concat.apply([], trafs.map(function(traf) {\n return findBox(traf, ['tfhd']).map(function(tfhd) {\n var id, scale, baseTime;\n\n // get the track id from the tfhd\n id = toUnsigned(tfhd[4] << 24 |\n tfhd[5] << 16 |\n tfhd[6] << 8 |\n tfhd[7]);\n // assume a 90kHz clock if no timescale was specified\n scale = timescale[id] || 90e3;\n\n // get the base media decode time from the tfdt\n baseTime = findBox(traf, ['tfdt']).map(function(tfdt) {\n var version, result;\n\n version = tfdt[0];\n result = toUnsigned(tfdt[4] << 24 |\n tfdt[5] << 16 |\n tfdt[6] << 8 |\n tfdt[7]);\n if (version === 1) {\n result *= Math.pow(2, 32);\n result += toUnsigned(tfdt[8] << 24 |\n tfdt[9] << 16 |\n tfdt[10] << 8 |\n tfdt[11]);\n }\n return result;\n })[0];\n baseTime = baseTime || Infinity;\n\n // convert base time to seconds\n return baseTime / scale;\n });\n }));\n\n // return the minimum\n result = Math.min.apply(null, baseTimes);\n return isFinite(result) ? result : 0;\n};\n\n/**\n * Find the trackIds of the video tracks in this source.\n * Found by parsing the Handler Reference and Track Header Boxes:\n * moov > trak > mdia > hdlr\n * moov > trak > tkhd\n *\n * @param {Uint8Array} init - The bytes of the init segment for this source\n * @return {Number[]} A list of trackIds\n *\n * @see ISO-BMFF-12/2015, Section 8.4.3\n **/\ngetVideoTrackIds = function(init) {\n var traks = findBox(init, ['moov', 'trak']);\n var videoTrackIds = [];\n\n traks.forEach(function(trak) {\n var hdlrs = findBox(trak, ['mdia', 'hdlr']);\n var tkhds = findBox(trak, ['tkhd']);\n\n hdlrs.forEach(function(hdlr, index) {\n var handlerType = parseType(hdlr.subarray(8, 12));\n var tkhd = tkhds[index];\n var view;\n var version;\n var trackId;\n\n if (handlerType === 'vide') {\n view = new DataView(tkhd.buffer, tkhd.byteOffset, tkhd.byteLength);\n version = view.getUint8(0);\n trackId = (version === 0) ? view.getUint32(12) : view.getUint32(20);\n\n videoTrackIds.push(trackId);\n }\n });\n });\n\n return videoTrackIds;\n};\n\nmodule.exports = {\n findBox: findBox,\n parseType: parseType,\n timescale: timescale,\n startTime: startTime,\n videoTrackIds: getVideoTrackIds\n};\n","var ONE_SECOND_IN_TS = 90000; // 90kHz clock\n\n/**\n * Store information about the start and end of the track and the\n * duration for each frame/sample we process in order to calculate\n * the baseMediaDecodeTime\n */\nvar collectDtsInfo = function(track, data) {\n if (typeof data.pts === 'number') {\n if (track.timelineStartInfo.pts === undefined) {\n track.timelineStartInfo.pts = data.pts;\n }\n\n if (track.minSegmentPts === undefined) {\n track.minSegmentPts = data.pts;\n } else {\n track.minSegmentPts = Math.min(track.minSegmentPts, data.pts);\n }\n\n if (track.maxSegmentPts === undefined) {\n track.maxSegmentPts = data.pts;\n } else {\n track.maxSegmentPts = Math.max(track.maxSegmentPts, data.pts);\n }\n }\n\n if (typeof data.dts === 'number') {\n if (track.timelineStartInfo.dts === undefined) {\n track.timelineStartInfo.dts = data.dts;\n }\n\n if (track.minSegmentDts === undefined) {\n track.minSegmentDts = data.dts;\n } else {\n track.minSegmentDts = Math.min(track.minSegmentDts, data.dts);\n }\n\n if (track.maxSegmentDts === undefined) {\n track.maxSegmentDts = data.dts;\n } else {\n track.maxSegmentDts = Math.max(track.maxSegmentDts, data.dts);\n }\n }\n};\n\n/**\n * Clear values used to calculate the baseMediaDecodeTime between\n * tracks\n */\nvar clearDtsInfo = function(track) {\n delete track.minSegmentDts;\n delete track.maxSegmentDts;\n delete track.minSegmentPts;\n delete track.maxSegmentPts;\n};\n\n/**\n * Calculate the track's baseMediaDecodeTime based on the earliest\n * DTS the transmuxer has ever seen and the minimum DTS for the\n * current track\n * @param track {object} track metadata configuration\n * @param keepOriginalTimestamps {boolean} If true, keep the timestamps\n * in the source; false to adjust the first segment to start at 0.\n */\nvar calculateTrackBaseMediaDecodeTime = function(track, keepOriginalTimestamps) {\n var\n baseMediaDecodeTime,\n scale,\n minSegmentDts = track.minSegmentDts;\n\n // Optionally adjust the time so the first segment starts at zero.\n if (!keepOriginalTimestamps) {\n minSegmentDts -= track.timelineStartInfo.dts;\n }\n\n // track.timelineStartInfo.baseMediaDecodeTime is the location, in time, where\n // we want the start of the first segment to be placed\n baseMediaDecodeTime = track.timelineStartInfo.baseMediaDecodeTime;\n\n // Add to that the distance this segment is from the very first\n baseMediaDecodeTime += minSegmentDts;\n\n // baseMediaDecodeTime must not become negative\n baseMediaDecodeTime = Math.max(0, baseMediaDecodeTime);\n\n if (track.type === 'audio') {\n // Audio has a different clock equal to the sampling_rate so we need to\n // scale the PTS values into the clock rate of the track\n scale = track.samplerate / ONE_SECOND_IN_TS;\n baseMediaDecodeTime *= scale;\n baseMediaDecodeTime = Math.floor(baseMediaDecodeTime);\n }\n\n return baseMediaDecodeTime;\n};\n\nmodule.exports = {\n clearDtsInfo: clearDtsInfo,\n calculateTrackBaseMediaDecodeTime: calculateTrackBaseMediaDecodeTime,\n collectDtsInfo: collectDtsInfo\n};\n","/**\n * mux.js\n *\n * Copyright (c) 2015 Brightcove\n * All rights reserved.\n *\n * A stream-based mp2t to mp4 converter. This utility can be used to\n * deliver mp4s to a SourceBuffer on platforms that support native\n * Media Source Extensions.\n */\n'use strict';\n\nvar Stream = require('../utils/stream.js');\nvar mp4 = require('./mp4-generator.js');\nvar frameUtils = require('./frame-utils');\nvar audioFrameUtils = require('./audio-frame-utils');\nvar trackDecodeInfo = require('./track-decode-info');\nvar m2ts = require('../m2ts/m2ts.js');\nvar AdtsStream = require('../codecs/adts.js');\nvar H264Stream = require('../codecs/h264').H264Stream;\nvar AacStream = require('../aac');\nvar isLikelyAacData = require('../aac/utils').isLikelyAacData;\n\n// constants\nvar AUDIO_PROPERTIES = [\n 'audioobjecttype',\n 'channelcount',\n 'samplerate',\n 'samplingfrequencyindex',\n 'samplesize'\n];\n\nvar VIDEO_PROPERTIES = [\n 'width',\n 'height',\n 'profileIdc',\n 'levelIdc',\n 'profileCompatibility'\n];\n\n// object types\nvar VideoSegmentStream, AudioSegmentStream, Transmuxer, CoalesceStream;\n\n/**\n * Compare two arrays (even typed) for same-ness\n */\nvar arrayEquals = function(a, b) {\n var\n i;\n\n if (a.length !== b.length) {\n return false;\n }\n\n // compare the value of each element in the array\n for (i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n\n return true;\n};\n\n/**\n * Constructs a single-track, ISO BMFF media segment from AAC data\n * events. The output of this stream can be fed to a SourceBuffer\n * configured with a suitable initialization segment.\n * @param track {object} track metadata configuration\n * @param options {object} transmuxer options object\n * @param options.keepOriginalTimestamps {boolean} If true, keep the timestamps\n * in the source; false to adjust the first segment to start at 0.\n */\nAudioSegmentStream = function(track, options) {\n var\n adtsFrames = [],\n sequenceNumber = 0,\n earliestAllowedDts = 0,\n audioAppendStartTs = 0,\n videoBaseMediaDecodeTime = Infinity;\n\n options = options || {};\n\n AudioSegmentStream.prototype.init.call(this);\n\n this.push = function(data) {\n trackDecodeInfo.collectDtsInfo(track, data);\n\n if (track) {\n AUDIO_PROPERTIES.forEach(function(prop) {\n track[prop] = data[prop];\n });\n }\n\n // buffer audio data until end() is called\n adtsFrames.push(data);\n };\n\n this.setEarliestDts = function(earliestDts) {\n earliestAllowedDts = earliestDts - track.timelineStartInfo.baseMediaDecodeTime;\n };\n\n this.setVideoBaseMediaDecodeTime = function(baseMediaDecodeTime) {\n videoBaseMediaDecodeTime = baseMediaDecodeTime;\n };\n\n this.setAudioAppendStart = function(timestamp) {\n audioAppendStartTs = timestamp;\n };\n\n this.flush = function() {\n var\n frames,\n moof,\n mdat,\n boxes;\n\n // return early if no audio data has been observed\n if (adtsFrames.length === 0) {\n this.trigger('done', 'AudioSegmentStream');\n return;\n }\n\n frames = audioFrameUtils.trimAdtsFramesByEarliestDts(\n adtsFrames, track, earliestAllowedDts);\n track.baseMediaDecodeTime = trackDecodeInfo.calculateTrackBaseMediaDecodeTime(\n track, options.keepOriginalTimestamps);\n\n audioFrameUtils.prefixWithSilence(\n track, frames, audioAppendStartTs, videoBaseMediaDecodeTime);\n\n // we have to build the index from byte locations to\n // samples (that is, adts frames) in the audio data\n track.samples = audioFrameUtils.generateSampleTable(frames);\n\n // concatenate the audio data to constuct the mdat\n mdat = mp4.mdat(audioFrameUtils.concatenateFrameData(frames));\n\n adtsFrames = [];\n\n moof = mp4.moof(sequenceNumber, [track]);\n boxes = new Uint8Array(moof.byteLength + mdat.byteLength);\n\n // bump the sequence number for next time\n sequenceNumber++;\n\n boxes.set(moof);\n boxes.set(mdat, moof.byteLength);\n\n trackDecodeInfo.clearDtsInfo(track);\n\n this.trigger('data', {track: track, boxes: boxes});\n this.trigger('done', 'AudioSegmentStream');\n };\n};\n\nAudioSegmentStream.prototype = new Stream();\n\n/**\n * Constructs a single-track, ISO BMFF media segment from H264 data\n * events. The output of this stream can be fed to a SourceBuffer\n * configured with a suitable initialization segment.\n * @param track {object} track metadata configuration\n * @param options {object} transmuxer options object\n * @param options.alignGopsAtEnd {boolean} If true, start from the end of the\n * gopsToAlignWith list when attempting to align gop pts\n * @param options.keepOriginalTimestamps {boolean} If true, keep the timestamps\n * in the source; false to adjust the first segment to start at 0.\n */\nVideoSegmentStream = function(track, options) {\n var\n sequenceNumber = 0,\n nalUnits = [],\n gopsToAlignWith = [],\n config,\n pps;\n\n options = options || {};\n\n VideoSegmentStream.prototype.init.call(this);\n\n delete track.minPTS;\n\n this.gopCache_ = [];\n\n /**\n * Constructs a ISO BMFF segment given H264 nalUnits\n * @param {Object} nalUnit A data event representing a nalUnit\n * @param {String} nalUnit.nalUnitType\n * @param {Object} nalUnit.config Properties for a mp4 track\n * @param {Uint8Array} nalUnit.data The nalUnit bytes\n * @see lib/codecs/h264.js\n **/\n this.push = function(nalUnit) {\n trackDecodeInfo.collectDtsInfo(track, nalUnit);\n\n // record the track config\n if (nalUnit.nalUnitType === 'seq_parameter_set_rbsp' && !config) {\n config = nalUnit.config;\n track.sps = [nalUnit.data];\n\n VIDEO_PROPERTIES.forEach(function(prop) {\n track[prop] = config[prop];\n }, this);\n }\n\n if (nalUnit.nalUnitType === 'pic_parameter_set_rbsp' &&\n !pps) {\n pps = nalUnit.data;\n track.pps = [nalUnit.data];\n }\n\n // buffer video until flush() is called\n nalUnits.push(nalUnit);\n };\n\n /**\n * Pass constructed ISO BMFF track and boxes on to the\n * next stream in the pipeline\n **/\n this.flush = function() {\n var\n frames,\n gopForFusion,\n gops,\n moof,\n mdat,\n boxes;\n\n // Throw away nalUnits at the start of the byte stream until\n // we find the first AUD\n while (nalUnits.length) {\n if (nalUnits[0].nalUnitType === 'access_unit_delimiter_rbsp') {\n break;\n }\n nalUnits.shift();\n }\n\n // Return early if no video data has been observed\n if (nalUnits.length === 0) {\n this.resetStream_();\n this.trigger('done', 'VideoSegmentStream');\n return;\n }\n\n // Organize the raw nal-units into arrays that represent\n // higher-level constructs such as frames and gops\n // (group-of-pictures)\n frames = frameUtils.groupNalsIntoFrames(nalUnits);\n gops = frameUtils.groupFramesIntoGops(frames);\n\n // If the first frame of this fragment is not a keyframe we have\n // a problem since MSE (on Chrome) requires a leading keyframe.\n //\n // We have two approaches to repairing this situation:\n // 1) GOP-FUSION:\n // This is where we keep track of the GOPS (group-of-pictures)\n // from previous fragments and attempt to find one that we can\n // prepend to the current fragment in order to create a valid\n // fragment.\n // 2) KEYFRAME-PULLING:\n // Here we search for the first keyframe in the fragment and\n // throw away all the frames between the start of the fragment\n // and that keyframe. We then extend the duration and pull the\n // PTS of the keyframe forward so that it covers the time range\n // of the frames that were disposed of.\n //\n // #1 is far prefereable over #2 which can cause \"stuttering\" but\n // requires more things to be just right.\n if (!gops[0][0].keyFrame) {\n // Search for a gop for fusion from our gopCache\n gopForFusion = this.getGopForFusion_(nalUnits[0], track);\n\n if (gopForFusion) {\n gops.unshift(gopForFusion);\n // Adjust Gops' metadata to account for the inclusion of the\n // new gop at the beginning\n gops.byteLength += gopForFusion.byteLength;\n gops.nalCount += gopForFusion.nalCount;\n gops.pts = gopForFusion.pts;\n gops.dts = gopForFusion.dts;\n gops.duration += gopForFusion.duration;\n } else {\n // If we didn't find a candidate gop fall back to keyframe-pulling\n gops = frameUtils.extendFirstKeyFrame(gops);\n }\n }\n\n // Trim gops to align with gopsToAlignWith\n if (gopsToAlignWith.length) {\n var alignedGops;\n\n if (options.alignGopsAtEnd) {\n alignedGops = this.alignGopsAtEnd_(gops);\n } else {\n alignedGops = this.alignGopsAtStart_(gops);\n }\n\n if (!alignedGops) {\n // save all the nals in the last GOP into the gop cache\n this.gopCache_.unshift({\n gop: gops.pop(),\n pps: track.pps,\n sps: track.sps\n });\n\n // Keep a maximum of 6 GOPs in the cache\n this.gopCache_.length = Math.min(6, this.gopCache_.length);\n\n // Clear nalUnits\n nalUnits = [];\n\n // return early no gops can be aligned with desired gopsToAlignWith\n this.resetStream_();\n this.trigger('done', 'VideoSegmentStream');\n return;\n }\n\n // Some gops were trimmed. clear dts info so minSegmentDts and pts are correct\n // when recalculated before sending off to CoalesceStream\n trackDecodeInfo.clearDtsInfo(track);\n\n gops = alignedGops;\n }\n\n trackDecodeInfo.collectDtsInfo(track, gops);\n\n // First, we have to build the index from byte locations to\n // samples (that is, frames) in the video data\n track.samples = frameUtils.generateSampleTable(gops);\n\n // Concatenate the video data and construct the mdat\n mdat = mp4.mdat(frameUtils.concatenateNalData(gops));\n\n track.baseMediaDecodeTime = trackDecodeInfo.calculateTrackBaseMediaDecodeTime(\n track, options.keepOriginalTimestamps);\n\n this.trigger('processedGopsInfo', gops.map(function(gop) {\n return {\n pts: gop.pts,\n dts: gop.dts,\n byteLength: gop.byteLength\n };\n }));\n\n // save all the nals in the last GOP into the gop cache\n this.gopCache_.unshift({\n gop: gops.pop(),\n pps: track.pps,\n sps: track.sps\n });\n\n // Keep a maximum of 6 GOPs in the cache\n this.gopCache_.length = Math.min(6, this.gopCache_.length);\n\n // Clear nalUnits\n nalUnits = [];\n\n this.trigger('baseMediaDecodeTime', track.baseMediaDecodeTime);\n this.trigger('timelineStartInfo', track.timelineStartInfo);\n\n moof = mp4.moof(sequenceNumber, [track]);\n\n // it would be great to allocate this array up front instead of\n // throwing away hundreds of media segment fragments\n boxes = new Uint8Array(moof.byteLength + mdat.byteLength);\n\n // Bump the sequence number for next time\n sequenceNumber++;\n\n boxes.set(moof);\n boxes.set(mdat, moof.byteLength);\n\n this.trigger('data', {track: track, boxes: boxes});\n\n this.resetStream_();\n\n // Continue with the flush process now\n this.trigger('done', 'VideoSegmentStream');\n };\n\n this.resetStream_ = function() {\n trackDecodeInfo.clearDtsInfo(track);\n\n // reset config and pps because they may differ across segments\n // for instance, when we are rendition switching\n config = undefined;\n pps = undefined;\n };\n\n // Search for a candidate Gop for gop-fusion from the gop cache and\n // return it or return null if no good candidate was found\n this.getGopForFusion_ = function(nalUnit) {\n var\n halfSecond = 45000, // Half-a-second in a 90khz clock\n allowableOverlap = 10000, // About 3 frames @ 30fps\n nearestDistance = Infinity,\n dtsDistance,\n nearestGopObj,\n currentGop,\n currentGopObj,\n i;\n\n // Search for the GOP nearest to the beginning of this nal unit\n for (i = 0; i < this.gopCache_.length; i++) {\n currentGopObj = this.gopCache_[i];\n currentGop = currentGopObj.gop;\n\n // Reject Gops with different SPS or PPS\n if (!(track.pps && arrayEquals(track.pps[0], currentGopObj.pps[0])) ||\n !(track.sps && arrayEquals(track.sps[0], currentGopObj.sps[0]))) {\n continue;\n }\n\n // Reject Gops that would require a negative baseMediaDecodeTime\n if (currentGop.dts < track.timelineStartInfo.dts) {\n continue;\n }\n\n // The distance between the end of the gop and the start of the nalUnit\n dtsDistance = (nalUnit.dts - currentGop.dts) - currentGop.duration;\n\n // Only consider GOPS that start before the nal unit and end within\n // a half-second of the nal unit\n if (dtsDistance >= -allowableOverlap &&\n dtsDistance <= halfSecond) {\n\n // Always use the closest GOP we found if there is more than\n // one candidate\n if (!nearestGopObj ||\n nearestDistance > dtsDistance) {\n nearestGopObj = currentGopObj;\n nearestDistance = dtsDistance;\n }\n }\n }\n\n if (nearestGopObj) {\n return nearestGopObj.gop;\n }\n return null;\n };\n\n // trim gop list to the first gop found that has a matching pts with a gop in the list\n // of gopsToAlignWith starting from the START of the list\n this.alignGopsAtStart_ = function(gops) {\n var alignIndex, gopIndex, align, gop, byteLength, nalCount, duration, alignedGops;\n\n byteLength = gops.byteLength;\n nalCount = gops.nalCount;\n duration = gops.duration;\n alignIndex = gopIndex = 0;\n\n while (alignIndex < gopsToAlignWith.length && gopIndex < gops.length) {\n align = gopsToAlignWith[alignIndex];\n gop = gops[gopIndex];\n\n if (align.pts === gop.pts) {\n break;\n }\n\n if (gop.pts > align.pts) {\n // this current gop starts after the current gop we want to align on, so increment\n // align index\n alignIndex++;\n continue;\n }\n\n // current gop starts before the current gop we want to align on. so increment gop\n // index\n gopIndex++;\n byteLength -= gop.byteLength;\n nalCount -= gop.nalCount;\n duration -= gop.duration;\n }\n\n if (gopIndex === 0) {\n // no gops to trim\n return gops;\n }\n\n if (gopIndex === gops.length) {\n // all gops trimmed, skip appending all gops\n return null;\n }\n\n alignedGops = gops.slice(gopIndex);\n alignedGops.byteLength = byteLength;\n alignedGops.duration = duration;\n alignedGops.nalCount = nalCount;\n alignedGops.pts = alignedGops[0].pts;\n alignedGops.dts = alignedGops[0].dts;\n\n return alignedGops;\n };\n\n // trim gop list to the first gop found that has a matching pts with a gop in the list\n // of gopsToAlignWith starting from the END of the list\n this.alignGopsAtEnd_ = function(gops) {\n var alignIndex, gopIndex, align, gop, alignEndIndex, matchFound;\n\n alignIndex = gopsToAlignWith.length - 1;\n gopIndex = gops.length - 1;\n alignEndIndex = null;\n matchFound = false;\n\n while (alignIndex >= 0 && gopIndex >= 0) {\n align = gopsToAlignWith[alignIndex];\n gop = gops[gopIndex];\n\n if (align.pts === gop.pts) {\n matchFound = true;\n break;\n }\n\n if (align.pts > gop.pts) {\n alignIndex--;\n continue;\n }\n\n if (alignIndex === gopsToAlignWith.length - 1) {\n // gop.pts is greater than the last alignment candidate. If no match is found\n // by the end of this loop, we still want to append gops that come after this\n // point\n alignEndIndex = gopIndex;\n }\n\n gopIndex--;\n }\n\n if (!matchFound && alignEndIndex === null) {\n return null;\n }\n\n var trimIndex;\n\n if (matchFound) {\n trimIndex = gopIndex;\n } else {\n trimIndex = alignEndIndex;\n }\n\n if (trimIndex === 0) {\n return gops;\n }\n\n var alignedGops = gops.slice(trimIndex);\n var metadata = alignedGops.reduce(function(total, gop) {\n total.byteLength += gop.byteLength;\n total.duration += gop.duration;\n total.nalCount += gop.nalCount;\n return total;\n }, { byteLength: 0, duration: 0, nalCount: 0 });\n\n alignedGops.byteLength = metadata.byteLength;\n alignedGops.duration = metadata.duration;\n alignedGops.nalCount = metadata.nalCount;\n alignedGops.pts = alignedGops[0].pts;\n alignedGops.dts = alignedGops[0].dts;\n\n return alignedGops;\n };\n\n this.alignGopsWith = function(newGopsToAlignWith) {\n gopsToAlignWith = newGopsToAlignWith;\n };\n};\n\nVideoSegmentStream.prototype = new Stream();\n\n/**\n * A Stream that can combine multiple streams (ie. audio & video)\n * into a single output segment for MSE. Also supports audio-only\n * and video-only streams.\n * @param options {object} transmuxer options object\n * @param options.keepOriginalTimestamps {boolean} If true, keep the timestamps\n * in the source; false to adjust the first segment to start at media timeline start.\n */\nCoalesceStream = function(options, metadataStream) {\n // Number of Tracks per output segment\n // If greater than 1, we combine multiple\n // tracks into a single segment\n this.numberOfTracks = 0;\n this.metadataStream = metadataStream;\n\n options = options || {};\n\n if (typeof options.remux !== 'undefined') {\n this.remuxTracks = !!options.remux;\n } else {\n this.remuxTracks = true;\n }\n\n if (typeof options.keepOriginalTimestamps === 'boolean') {\n this.keepOriginalTimestamps = options.keepOriginalTimestamps;\n }\n\n this.pendingTracks = [];\n this.videoTrack = null;\n this.pendingBoxes = [];\n this.pendingCaptions = [];\n this.pendingMetadata = [];\n this.pendingBytes = 0;\n this.emittedTracks = 0;\n\n CoalesceStream.prototype.init.call(this);\n\n // Take output from multiple\n this.push = function(output) {\n // buffer incoming captions until the associated video segment\n // finishes\n if (output.text) {\n return this.pendingCaptions.push(output);\n }\n // buffer incoming id3 tags until the final flush\n if (output.frames) {\n return this.pendingMetadata.push(output);\n }\n\n // Add this track to the list of pending tracks and store\n // important information required for the construction of\n // the final segment\n this.pendingTracks.push(output.track);\n this.pendingBoxes.push(output.boxes);\n this.pendingBytes += output.boxes.byteLength;\n\n if (output.track.type === 'video') {\n this.videoTrack = output.track;\n }\n if (output.track.type === 'audio') {\n this.audioTrack = output.track;\n }\n };\n};\n\nCoalesceStream.prototype = new Stream();\nCoalesceStream.prototype.flush = function(flushSource) {\n var\n offset = 0,\n event = {\n captions: [],\n captionStreams: {},\n metadata: [],\n info: {}\n },\n caption,\n id3,\n initSegment,\n timelineStartPts = 0,\n i;\n\n if (this.pendingTracks.length < this.numberOfTracks) {\n if (flushSource !== 'VideoSegmentStream' &&\n flushSource !== 'AudioSegmentStream') {\n // Return because we haven't received a flush from a data-generating\n // portion of the segment (meaning that we have only recieved meta-data\n // or captions.)\n return;\n } else if (this.remuxTracks) {\n // Return until we have enough tracks from the pipeline to remux (if we\n // are remuxing audio and video into a single MP4)\n return;\n } else if (this.pendingTracks.length === 0) {\n // In the case where we receive a flush without any data having been\n // received we consider it an emitted track for the purposes of coalescing\n // `done` events.\n // We do this for the case where there is an audio and video track in the\n // segment but no audio data. (seen in several playlists with alternate\n // audio tracks and no audio present in the main TS segments.)\n this.emittedTracks++;\n\n if (this.emittedTracks >= this.numberOfTracks) {\n this.trigger('done');\n this.emittedTracks = 0;\n }\n return;\n }\n }\n\n if (this.videoTrack) {\n timelineStartPts = this.videoTrack.timelineStartInfo.pts;\n VIDEO_PROPERTIES.forEach(function(prop) {\n event.info[prop] = this.videoTrack[prop];\n }, this);\n } else if (this.audioTrack) {\n timelineStartPts = this.audioTrack.timelineStartInfo.pts;\n AUDIO_PROPERTIES.forEach(function(prop) {\n event.info[prop] = this.audioTrack[prop];\n }, this);\n }\n\n if (this.pendingTracks.length === 1) {\n event.type = this.pendingTracks[0].type;\n } else {\n event.type = 'combined';\n }\n\n this.emittedTracks += this.pendingTracks.length;\n\n initSegment = mp4.initSegment(this.pendingTracks);\n\n // Create a new typed array to hold the init segment\n event.initSegment = new Uint8Array(initSegment.byteLength);\n\n // Create an init segment containing a moov\n // and track definitions\n event.initSegment.set(initSegment);\n\n // Create a new typed array to hold the moof+mdats\n event.data = new Uint8Array(this.pendingBytes);\n\n // Append each moof+mdat (one per track) together\n for (i = 0; i < this.pendingBoxes.length; i++) {\n event.data.set(this.pendingBoxes[i], offset);\n offset += this.pendingBoxes[i].byteLength;\n }\n\n // Translate caption PTS times into second offsets to match the\n // video timeline for the segment, and add track info\n for (i = 0; i < this.pendingCaptions.length; i++) {\n caption = this.pendingCaptions[i];\n\n caption.startTime = caption.startPts;\n if (!this.keepOriginalTimestamps) {\n caption.startTime -= timelineStartPts;\n }\n caption.startTime /= 90e3;\n\n caption.endTime = caption.endPts;\n if (!this.keepOriginalTimestamps) {\n caption.endTime -= timelineStartPts;\n }\n caption.endTime /= 90e3;\n\n event.captionStreams[caption.stream] = true;\n event.captions.push(caption);\n }\n\n // Translate ID3 frame PTS times into second offsets to match the\n // video timeline for the segment\n for (i = 0; i < this.pendingMetadata.length; i++) {\n id3 = this.pendingMetadata[i];\n\n id3.cueTime = id3.pts;\n if (!this.keepOriginalTimestamps) {\n id3.cueTime -= timelineStartPts;\n }\n id3.cueTime /= 90e3;\n\n event.metadata.push(id3);\n }\n\n // We add this to every single emitted segment even though we only need\n // it for the first\n event.metadata.dispatchType = this.metadataStream.dispatchType;\n\n // Reset stream state\n this.pendingTracks.length = 0;\n this.videoTrack = null;\n this.pendingBoxes.length = 0;\n this.pendingCaptions.length = 0;\n this.pendingBytes = 0;\n this.pendingMetadata.length = 0;\n\n // Emit the built segment\n this.trigger('data', event);\n\n // Only emit `done` if all tracks have been flushed and emitted\n if (this.emittedTracks >= this.numberOfTracks) {\n this.trigger('done');\n this.emittedTracks = 0;\n }\n};\n/**\n * A Stream that expects MP2T binary data as input and produces\n * corresponding media segments, suitable for use with Media Source\n * Extension (MSE) implementations that support the ISO BMFF byte\n * stream format, like Chrome.\n */\nTransmuxer = function(options) {\n var\n self = this,\n hasFlushed = true,\n videoTrack,\n audioTrack;\n\n Transmuxer.prototype.init.call(this);\n\n options = options || {};\n this.baseMediaDecodeTime = options.baseMediaDecodeTime || 0;\n this.transmuxPipeline_ = {};\n\n this.setupAacPipeline = function() {\n var pipeline = {};\n this.transmuxPipeline_ = pipeline;\n\n pipeline.type = 'aac';\n pipeline.metadataStream = new m2ts.MetadataStream();\n\n // set up the parsing pipeline\n pipeline.aacStream = new AacStream();\n pipeline.audioTimestampRolloverStream = new m2ts.TimestampRolloverStream('audio');\n pipeline.timedMetadataTimestampRolloverStream = new m2ts.TimestampRolloverStream('timed-metadata');\n pipeline.adtsStream = new AdtsStream();\n pipeline.coalesceStream = new CoalesceStream(options, pipeline.metadataStream);\n pipeline.headOfPipeline = pipeline.aacStream;\n\n pipeline.aacStream\n .pipe(pipeline.audioTimestampRolloverStream)\n .pipe(pipeline.adtsStream);\n pipeline.aacStream\n .pipe(pipeline.timedMetadataTimestampRolloverStream)\n .pipe(pipeline.metadataStream)\n .pipe(pipeline.coalesceStream);\n\n pipeline.metadataStream.on('timestamp', function(frame) {\n pipeline.aacStream.setTimestamp(frame.timeStamp);\n });\n\n pipeline.aacStream.on('data', function(data) {\n if (data.type === 'timed-metadata' && !pipeline.audioSegmentStream) {\n audioTrack = audioTrack || {\n timelineStartInfo: {\n baseMediaDecodeTime: self.baseMediaDecodeTime\n },\n codec: 'adts',\n type: 'audio'\n };\n // hook up the audio segment stream to the first track with aac data\n pipeline.coalesceStream.numberOfTracks++;\n pipeline.audioSegmentStream = new AudioSegmentStream(audioTrack, options);\n // Set up the final part of the audio pipeline\n pipeline.adtsStream\n .pipe(pipeline.audioSegmentStream)\n .pipe(pipeline.coalesceStream);\n }\n });\n\n // Re-emit any data coming from the coalesce stream to the outside world\n pipeline.coalesceStream.on('data', this.trigger.bind(this, 'data'));\n // Let the consumer know we have finished flushing the entire pipeline\n pipeline.coalesceStream.on('done', this.trigger.bind(this, 'done'));\n };\n\n this.setupTsPipeline = function() {\n var pipeline = {};\n this.transmuxPipeline_ = pipeline;\n\n pipeline.type = 'ts';\n pipeline.metadataStream = new m2ts.MetadataStream();\n\n // set up the parsing pipeline\n pipeline.packetStream = new m2ts.TransportPacketStream();\n pipeline.parseStream = new m2ts.TransportParseStream();\n pipeline.elementaryStream = new m2ts.ElementaryStream();\n pipeline.videoTimestampRolloverStream = new m2ts.TimestampRolloverStream('video');\n pipeline.audioTimestampRolloverStream = new m2ts.TimestampRolloverStream('audio');\n pipeline.timedMetadataTimestampRolloverStream = new m2ts.TimestampRolloverStream('timed-metadata');\n pipeline.adtsStream = new AdtsStream();\n pipeline.h264Stream = new H264Stream();\n pipeline.captionStream = new m2ts.CaptionStream();\n pipeline.coalesceStream = new CoalesceStream(options, pipeline.metadataStream);\n pipeline.headOfPipeline = pipeline.packetStream;\n\n // disassemble MPEG2-TS packets into elementary streams\n pipeline.packetStream\n .pipe(pipeline.parseStream)\n .pipe(pipeline.elementaryStream);\n\n // !!THIS ORDER IS IMPORTANT!!\n // demux the streams\n pipeline.elementaryStream\n .pipe(pipeline.videoTimestampRolloverStream)\n .pipe(pipeline.h264Stream);\n pipeline.elementaryStream\n .pipe(pipeline.audioTimestampRolloverStream)\n .pipe(pipeline.adtsStream);\n\n pipeline.elementaryStream\n .pipe(pipeline.timedMetadataTimestampRolloverStream)\n .pipe(pipeline.metadataStream)\n .pipe(pipeline.coalesceStream);\n\n // Hook up CEA-608/708 caption stream\n pipeline.h264Stream.pipe(pipeline.captionStream)\n .pipe(pipeline.coalesceStream);\n\n pipeline.elementaryStream.on('data', function(data) {\n var i;\n\n if (data.type === 'metadata') {\n i = data.tracks.length;\n\n // scan the tracks listed in the metadata\n while (i--) {\n if (!videoTrack && data.tracks[i].type === 'video') {\n videoTrack = data.tracks[i];\n videoTrack.timelineStartInfo.baseMediaDecodeTime = self.baseMediaDecodeTime;\n } else if (!audioTrack && data.tracks[i].type === 'audio') {\n audioTrack = data.tracks[i];\n audioTrack.timelineStartInfo.baseMediaDecodeTime = self.baseMediaDecodeTime;\n }\n }\n\n // hook up the video segment stream to the first track with h264 data\n if (videoTrack && !pipeline.videoSegmentStream) {\n pipeline.coalesceStream.numberOfTracks++;\n pipeline.videoSegmentStream = new VideoSegmentStream(videoTrack, options);\n\n pipeline.videoSegmentStream.on('timelineStartInfo', function(timelineStartInfo) {\n // When video emits timelineStartInfo data after a flush, we forward that\n // info to the AudioSegmentStream, if it exists, because video timeline\n // data takes precedence.\n if (audioTrack) {\n audioTrack.timelineStartInfo = timelineStartInfo;\n // On the first segment we trim AAC frames that exist before the\n // very earliest DTS we have seen in video because Chrome will\n // interpret any video track with a baseMediaDecodeTime that is\n // non-zero as a gap.\n pipeline.audioSegmentStream.setEarliestDts(timelineStartInfo.dts);\n }\n });\n\n pipeline.videoSegmentStream.on('processedGopsInfo',\n self.trigger.bind(self, 'gopInfo'));\n\n pipeline.videoSegmentStream.on('baseMediaDecodeTime', function(baseMediaDecodeTime) {\n if (audioTrack) {\n pipeline.audioSegmentStream.setVideoBaseMediaDecodeTime(baseMediaDecodeTime);\n }\n });\n\n // Set up the final part of the video pipeline\n pipeline.h264Stream\n .pipe(pipeline.videoSegmentStream)\n .pipe(pipeline.coalesceStream);\n }\n\n if (audioTrack && !pipeline.audioSegmentStream) {\n // hook up the audio segment stream to the first track with aac data\n pipeline.coalesceStream.numberOfTracks++;\n pipeline.audioSegmentStream = new AudioSegmentStream(audioTrack, options);\n\n // Set up the final part of the audio pipeline\n pipeline.adtsStream\n .pipe(pipeline.audioSegmentStream)\n .pipe(pipeline.coalesceStream);\n }\n }\n });\n\n // Re-emit any data coming from the coalesce stream to the outside world\n pipeline.coalesceStream.on('data', this.trigger.bind(this, 'data'));\n // Let the consumer know we have finished flushing the entire pipeline\n pipeline.coalesceStream.on('done', this.trigger.bind(this, 'done'));\n };\n\n // hook up the segment streams once track metadata is delivered\n this.setBaseMediaDecodeTime = function(baseMediaDecodeTime) {\n var pipeline = this.transmuxPipeline_;\n\n if (!options.keepOriginalTimestamps) {\n this.baseMediaDecodeTime = baseMediaDecodeTime;\n }\n\n if (audioTrack) {\n audioTrack.timelineStartInfo.dts = undefined;\n audioTrack.timelineStartInfo.pts = undefined;\n trackDecodeInfo.clearDtsInfo(audioTrack);\n if (!options.keepOriginalTimestamps) {\n audioTrack.timelineStartInfo.baseMediaDecodeTime = baseMediaDecodeTime;\n }\n if (pipeline.audioTimestampRolloverStream) {\n pipeline.audioTimestampRolloverStream.discontinuity();\n }\n }\n if (videoTrack) {\n if (pipeline.videoSegmentStream) {\n pipeline.videoSegmentStream.gopCache_ = [];\n pipeline.videoTimestampRolloverStream.discontinuity();\n }\n videoTrack.timelineStartInfo.dts = undefined;\n videoTrack.timelineStartInfo.pts = undefined;\n trackDecodeInfo.clearDtsInfo(videoTrack);\n pipeline.captionStream.reset();\n if (!options.keepOriginalTimestamps) {\n videoTrack.timelineStartInfo.baseMediaDecodeTime = baseMediaDecodeTime;\n }\n }\n\n if (pipeline.timedMetadataTimestampRolloverStream) {\n pipeline.timedMetadataTimestampRolloverStream.discontinuity();\n }\n };\n\n this.setAudioAppendStart = function(timestamp) {\n if (audioTrack) {\n this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(timestamp);\n }\n };\n\n this.alignGopsWith = function(gopsToAlignWith) {\n if (videoTrack && this.transmuxPipeline_.videoSegmentStream) {\n this.transmuxPipeline_.videoSegmentStream.alignGopsWith(gopsToAlignWith);\n }\n };\n\n // feed incoming data to the front of the parsing pipeline\n this.push = function(data) {\n if (hasFlushed) {\n var isAac = isLikelyAacData(data);\n\n if (isAac && this.transmuxPipeline_.type !== 'aac') {\n this.setupAacPipeline();\n } else if (!isAac && this.transmuxPipeline_.type !== 'ts') {\n this.setupTsPipeline();\n }\n hasFlushed = false;\n }\n this.transmuxPipeline_.headOfPipeline.push(data);\n };\n\n // flush any buffered data\n this.flush = function() {\n hasFlushed = true;\n // Start at the top of the pipeline and flush all pending work\n this.transmuxPipeline_.headOfPipeline.flush();\n };\n\n // Caption data has to be reset when seeking outside buffered range\n this.resetCaptions = function() {\n if (this.transmuxPipeline_.captionStream) {\n this.transmuxPipeline_.captionStream.reset();\n }\n };\n\n};\nTransmuxer.prototype = new Stream();\n\nmodule.exports = {\n Transmuxer: Transmuxer,\n VideoSegmentStream: VideoSegmentStream,\n AudioSegmentStream: AudioSegmentStream,\n AUDIO_PROPERTIES: AUDIO_PROPERTIES,\n VIDEO_PROPERTIES: VIDEO_PROPERTIES\n};\n","/**\n * mux.js\n *\n * Copyright (c) 2015 Brightcove\n * All rights reserved.\n *\n * Reads in-band caption information from a video elementary\n * stream. Captions must follow the CEA-708 standard for injection\n * into an MPEG-2 transport streams.\n * @see https://en.wikipedia.org/wiki/CEA-708\n * @see https://www.gpo.gov/fdsys/pkg/CFR-2007-title47-vol1/pdf/CFR-2007-title47-vol1-sec15-119.pdf\n */\n\n'use strict';\n\n// Supplemental enhancement information (SEI) NAL units have a\n// payload type field to indicate how they are to be\n// interpreted. CEAS-708 caption content is always transmitted with\n// payload type 0x04.\nvar USER_DATA_REGISTERED_ITU_T_T35 = 4,\n RBSP_TRAILING_BITS = 128;\n\n/**\n * Parse a supplemental enhancement information (SEI) NAL unit.\n * Stops parsing once a message of type ITU T T35 has been found.\n *\n * @param bytes {Uint8Array} the bytes of a SEI NAL unit\n * @return {object} the parsed SEI payload\n * @see Rec. ITU-T H.264, 7.3.2.3.1\n */\nvar parseSei = function(bytes) {\n var\n i = 0,\n result = {\n payloadType: -1,\n payloadSize: 0\n },\n payloadType = 0,\n payloadSize = 0;\n\n // go through the sei_rbsp parsing each each individual sei_message\n while (i < bytes.byteLength) {\n // stop once we have hit the end of the sei_rbsp\n if (bytes[i] === RBSP_TRAILING_BITS) {\n break;\n }\n\n // Parse payload type\n while (bytes[i] === 0xFF) {\n payloadType += 255;\n i++;\n }\n payloadType += bytes[i++];\n\n // Parse payload size\n while (bytes[i] === 0xFF) {\n payloadSize += 255;\n i++;\n }\n payloadSize += bytes[i++];\n\n // this sei_message is a 608/708 caption so save it and break\n // there can only ever be one caption message in a frame's sei\n if (!result.payload && payloadType === USER_DATA_REGISTERED_ITU_T_T35) {\n result.payloadType = payloadType;\n result.payloadSize = payloadSize;\n result.payload = bytes.subarray(i, i + payloadSize);\n break;\n }\n\n // skip the payload and parse the next message\n i += payloadSize;\n payloadType = 0;\n payloadSize = 0;\n }\n\n return result;\n};\n\n// see ANSI/SCTE 128-1 (2013), section 8.1\nvar parseUserData = function(sei) {\n // itu_t_t35_contry_code must be 181 (United States) for\n // captions\n if (sei.payload[0] !== 181) {\n return null;\n }\n\n // itu_t_t35_provider_code should be 49 (ATSC) for captions\n if (((sei.payload[1] << 8) | sei.payload[2]) !== 49) {\n return null;\n }\n\n // the user_identifier should be \"GA94\" to indicate ATSC1 data\n if (String.fromCharCode(sei.payload[3],\n sei.payload[4],\n sei.payload[5],\n sei.payload[6]) !== 'GA94') {\n return null;\n }\n\n // finally, user_data_type_code should be 0x03 for caption data\n if (sei.payload[7] !== 0x03) {\n return null;\n }\n\n // return the user_data_type_structure and strip the trailing\n // marker bits\n return sei.payload.subarray(8, sei.payload.length - 1);\n};\n\n// see CEA-708-D, section 4.4\nvar parseCaptionPackets = function(pts, userData) {\n var results = [], i, count, offset, data;\n\n // if this is just filler, return immediately\n if (!(userData[0] & 0x40)) {\n return results;\n }\n\n // parse out the cc_data_1 and cc_data_2 fields\n count = userData[0] & 0x1f;\n for (i = 0; i < count; i++) {\n offset = i * 3;\n data = {\n type: userData[offset + 2] & 0x03,\n pts: pts\n };\n\n // capture cc data when cc_valid is 1\n if (userData[offset + 2] & 0x04) {\n data.ccData = (userData[offset + 3] << 8) | userData[offset + 4];\n results.push(data);\n }\n }\n return results;\n};\n\nvar discardEmulationPreventionBytes = function(data) {\n var\n length = data.byteLength,\n emulationPreventionBytesPositions = [],\n i = 1,\n newLength, newData;\n\n // Find all `Emulation Prevention Bytes`\n while (i < length - 2) {\n if (data[i] === 0 && data[i + 1] === 0 && data[i + 2] === 0x03) {\n emulationPreventionBytesPositions.push(i + 2);\n i += 2;\n } else {\n i++;\n }\n }\n\n // If no Emulation Prevention Bytes were found just return the original\n // array\n if (emulationPreventionBytesPositions.length === 0) {\n return data;\n }\n\n // Create a new array to hold the NAL unit data\n newLength = length - emulationPreventionBytesPositions.length;\n newData = new Uint8Array(newLength);\n var sourceIndex = 0;\n\n for (i = 0; i < newLength; sourceIndex++, i++) {\n if (sourceIndex === emulationPreventionBytesPositions[0]) {\n // Skip this byte\n sourceIndex++;\n // Remove this position index\n emulationPreventionBytesPositions.shift();\n }\n newData[i] = data[sourceIndex];\n }\n\n return newData;\n};\n\n// exports\nmodule.exports = {\n parseSei: parseSei,\n parseUserData: parseUserData,\n parseCaptionPackets: parseCaptionPackets,\n discardEmulationPreventionBytes: discardEmulationPreventionBytes,\n USER_DATA_REGISTERED_ITU_T_T35: USER_DATA_REGISTERED_ITU_T_T35\n};\n","/**\n * mux.js\n *\n * Copyright (c) 2015 Brightcove\n * All rights reserved.\n *\n * Parse the internal MP4 structure into an equivalent javascript\n * object.\n */\n'use strict';\n\nvar\n inspectMp4,\n textifyMp4,\n\n parseType = require('../mp4/probe').parseType,\n parseMp4Date = function(seconds) {\n return new Date(seconds * 1000 - 2082844800000);\n },\n parseSampleFlags = function(flags) {\n return {\n isLeading: (flags[0] & 0x0c) >>> 2,\n dependsOn: flags[0] & 0x03,\n isDependedOn: (flags[1] & 0xc0) >>> 6,\n hasRedundancy: (flags[1] & 0x30) >>> 4,\n paddingValue: (flags[1] & 0x0e) >>> 1,\n isNonSyncSample: flags[1] & 0x01,\n degradationPriority: (flags[2] << 8) | flags[3]\n };\n },\n nalParse = function(avcStream) {\n var\n avcView = new DataView(avcStream.buffer, avcStream.byteOffset, avcStream.byteLength),\n result = [],\n i,\n length;\n for (i = 0; i + 4 < avcStream.length; i += length) {\n length = avcView.getUint32(i);\n i += 4;\n\n // bail if this doesn't appear to be an H264 stream\n if (length <= 0) {\n result.push('<span style=\\'color:red;\\'>MALFORMED DATA</span>');\n continue;\n }\n\n switch (avcStream[i] & 0x1F) {\n case 0x01:\n result.push('slice_layer_without_partitioning_rbsp');\n break;\n case 0x05:\n result.push('slice_layer_without_partitioning_rbsp_idr');\n break;\n case 0x06:\n result.push('sei_rbsp');\n break;\n case 0x07:\n result.push('seq_parameter_set_rbsp');\n break;\n case 0x08:\n result.push('pic_parameter_set_rbsp');\n break;\n case 0x09:\n result.push('access_unit_delimiter_rbsp');\n break;\n default:\n result.push('UNKNOWN NAL - ' + avcStream[i] & 0x1F);\n break;\n }\n }\n return result;\n },\n\n // registry of handlers for individual mp4 box types\n parse = {\n // codingname, not a first-class box type. stsd entries share the\n // same format as real boxes so the parsing infrastructure can be\n // shared\n avc1: function(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength);\n return {\n dataReferenceIndex: view.getUint16(6),\n width: view.getUint16(24),\n height: view.getUint16(26),\n horizresolution: view.getUint16(28) + (view.getUint16(30) / 16),\n vertresolution: view.getUint16(32) + (view.getUint16(34) / 16),\n frameCount: view.getUint16(40),\n depth: view.getUint16(74),\n config: inspectMp4(data.subarray(78, data.byteLength))\n };\n },\n avcC: function(data) {\n var\n view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n configurationVersion: data[0],\n avcProfileIndication: data[1],\n profileCompatibility: data[2],\n avcLevelIndication: data[3],\n lengthSizeMinusOne: data[4] & 0x03,\n sps: [],\n pps: []\n },\n numOfSequenceParameterSets = data[5] & 0x1f,\n numOfPictureParameterSets,\n nalSize,\n offset,\n i;\n\n // iterate past any SPSs\n offset = 6;\n for (i = 0; i < numOfSequenceParameterSets; i++) {\n nalSize = view.getUint16(offset);\n offset += 2;\n result.sps.push(new Uint8Array(data.subarray(offset, offset + nalSize)));\n offset += nalSize;\n }\n // iterate past any PPSs\n numOfPictureParameterSets = data[offset];\n offset++;\n for (i = 0; i < numOfPictureParameterSets; i++) {\n nalSize = view.getUint16(offset);\n offset += 2;\n result.pps.push(new Uint8Array(data.subarray(offset, offset + nalSize)));\n offset += nalSize;\n }\n return result;\n },\n btrt: function(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength);\n return {\n bufferSizeDB: view.getUint32(0),\n maxBitrate: view.getUint32(4),\n avgBitrate: view.getUint32(8)\n };\n },\n esds: function(data) {\n return {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n esId: (data[6] << 8) | data[7],\n streamPriority: data[8] & 0x1f,\n decoderConfig: {\n objectProfileIndication: data[11],\n streamType: (data[12] >>> 2) & 0x3f,\n bufferSize: (data[13] << 16) | (data[14] << 8) | data[15],\n maxBitrate: (data[16] << 24) |\n (data[17] << 16) |\n (data[18] << 8) |\n data[19],\n avgBitrate: (data[20] << 24) |\n (data[21] << 16) |\n (data[22] << 8) |\n data[23],\n decoderConfigDescriptor: {\n tag: data[24],\n length: data[25],\n audioObjectType: (data[26] >>> 3) & 0x1f,\n samplingFrequencyIndex: ((data[26] & 0x07) << 1) |\n ((data[27] >>> 7) & 0x01),\n channelConfiguration: (data[27] >>> 3) & 0x0f\n }\n }\n };\n },\n ftyp: function(data) {\n var\n view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n majorBrand: parseType(data.subarray(0, 4)),\n minorVersion: view.getUint32(4),\n compatibleBrands: []\n },\n i = 8;\n while (i < data.byteLength) {\n result.compatibleBrands.push(parseType(data.subarray(i, i + 4)));\n i += 4;\n }\n return result;\n },\n dinf: function(data) {\n return {\n boxes: inspectMp4(data)\n };\n },\n dref: function(data) {\n return {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n dataReferences: inspectMp4(data.subarray(8))\n };\n },\n hdlr: function(data) {\n var\n view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n version: view.getUint8(0),\n flags: new Uint8Array(data.subarray(1, 4)),\n handlerType: parseType(data.subarray(8, 12)),\n name: ''\n },\n i = 8;\n\n // parse out the name field\n for (i = 24; i < data.byteLength; i++) {\n if (data[i] === 0x00) {\n // the name field is null-terminated\n i++;\n break;\n }\n result.name += String.fromCharCode(data[i]);\n }\n // decode UTF-8 to javascript's internal representation\n // see http://ecmanaut.blogspot.com/2006/07/encoding-decoding-utf8-in-javascript.html\n result.name = decodeURIComponent(escape(result.name));\n\n return result;\n },\n mdat: function(data) {\n return {\n byteLength: data.byteLength,\n nals: nalParse(data)\n };\n },\n mdhd: function(data) {\n var\n view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n i = 4,\n language,\n result = {\n version: view.getUint8(0),\n flags: new Uint8Array(data.subarray(1, 4)),\n language: ''\n };\n if (result.version === 1) {\n i += 4;\n result.creationTime = parseMp4Date(view.getUint32(i)); // truncating top 4 bytes\n i += 8;\n result.modificationTime = parseMp4Date(view.getUint32(i)); // truncating top 4 bytes\n i += 4;\n result.timescale = view.getUint32(i);\n i += 8;\n result.duration = view.getUint32(i); // truncating top 4 bytes\n } else {\n result.creationTime = parseMp4Date(view.getUint32(i));\n i += 4;\n result.modificationTime = parseMp4Date(view.getUint32(i));\n i += 4;\n result.timescale = view.getUint32(i);\n i += 4;\n result.duration = view.getUint32(i);\n }\n i += 4;\n // language is stored as an ISO-639-2/T code in an array of three 5-bit fields\n // each field is the packed difference between its ASCII value and 0x60\n language = view.getUint16(i);\n result.language += String.fromCharCode((language >> 10) + 0x60);\n result.language += String.fromCharCode(((language & 0x03e0) >> 5) + 0x60);\n result.language += String.fromCharCode((language & 0x1f) + 0x60);\n\n return result;\n },\n mdia: function(data) {\n return {\n boxes: inspectMp4(data)\n };\n },\n mfhd: function(data) {\n return {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n sequenceNumber: (data[4] << 24) |\n (data[5] << 16) |\n (data[6] << 8) |\n (data[7])\n };\n },\n minf: function(data) {\n return {\n boxes: inspectMp4(data)\n };\n },\n // codingname, not a first-class box type. stsd entries share the\n // same format as real boxes so the parsing infrastructure can be\n // shared\n mp4a: function(data) {\n var\n view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n // 6 bytes reserved\n dataReferenceIndex: view.getUint16(6),\n // 4 + 4 bytes reserved\n channelcount: view.getUint16(16),\n samplesize: view.getUint16(18),\n // 2 bytes pre_defined\n // 2 bytes reserved\n samplerate: view.getUint16(24) + (view.getUint16(26) / 65536)\n };\n\n // if there are more bytes to process, assume this is an ISO/IEC\n // 14496-14 MP4AudioSampleEntry and parse the ESDBox\n if (data.byteLength > 28) {\n result.streamDescriptor = inspectMp4(data.subarray(28))[0];\n }\n return result;\n },\n moof: function(data) {\n return {\n boxes: inspectMp4(data)\n };\n },\n moov: function(data) {\n return {\n boxes: inspectMp4(data)\n };\n },\n mvex: function(data) {\n return {\n boxes: inspectMp4(data)\n };\n },\n mvhd: function(data) {\n var\n view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n i = 4,\n result = {\n version: view.getUint8(0),\n flags: new Uint8Array(data.subarray(1, 4))\n };\n\n if (result.version === 1) {\n i += 4;\n result.creationTime = parseMp4Date(view.getUint32(i)); // truncating top 4 bytes\n i += 8;\n result.modificationTime = parseMp4Date(view.getUint32(i)); // truncating top 4 bytes\n i += 4;\n result.timescale = view.getUint32(i);\n i += 8;\n result.duration = view.getUint32(i); // truncating top 4 bytes\n } else {\n result.creationTime = parseMp4Date(view.getUint32(i));\n i += 4;\n result.modificationTime = parseMp4Date(view.getUint32(i));\n i += 4;\n result.timescale = view.getUint32(i);\n i += 4;\n result.duration = view.getUint32(i);\n }\n i += 4;\n\n // convert fixed-point, base 16 back to a number\n result.rate = view.getUint16(i) + (view.getUint16(i + 2) / 16);\n i += 4;\n result.volume = view.getUint8(i) + (view.getUint8(i + 1) / 8);\n i += 2;\n i += 2;\n i += 2 * 4;\n result.matrix = new Uint32Array(data.subarray(i, i + (9 * 4)));\n i += 9 * 4;\n i += 6 * 4;\n result.nextTrackId = view.getUint32(i);\n return result;\n },\n pdin: function(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength);\n return {\n version: view.getUint8(0),\n flags: new Uint8Array(data.subarray(1, 4)),\n rate: view.getUint32(4),\n initialDelay: view.getUint32(8)\n };\n },\n sdtp: function(data) {\n var\n result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n samples: []\n }, i;\n\n for (i = 4; i < data.byteLength; i++) {\n result.samples.push({\n dependsOn: (data[i] & 0x30) >> 4,\n isDependedOn: (data[i] & 0x0c) >> 2,\n hasRedundancy: data[i] & 0x03\n });\n }\n return result;\n },\n sidx: function(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n references: [],\n referenceId: view.getUint32(4),\n timescale: view.getUint32(8),\n earliestPresentationTime: view.getUint32(12),\n firstOffset: view.getUint32(16)\n },\n referenceCount = view.getUint16(22),\n i;\n\n for (i = 24; referenceCount; i += 12, referenceCount--) {\n result.references.push({\n referenceType: (data[i] & 0x80) >>> 7,\n referencedSize: view.getUint32(i) & 0x7FFFFFFF,\n subsegmentDuration: view.getUint32(i + 4),\n startsWithSap: !!(data[i + 8] & 0x80),\n sapType: (data[i + 8] & 0x70) >>> 4,\n sapDeltaTime: view.getUint32(i + 8) & 0x0FFFFFFF\n });\n }\n\n return result;\n },\n smhd: function(data) {\n return {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n balance: data[4] + (data[5] / 256)\n };\n },\n stbl: function(data) {\n return {\n boxes: inspectMp4(data)\n };\n },\n stco: function(data) {\n var\n view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n chunkOffsets: []\n },\n entryCount = view.getUint32(4),\n i;\n for (i = 8; entryCount; i += 4, entryCount--) {\n result.chunkOffsets.push(view.getUint32(i));\n }\n return result;\n },\n stsc: function(data) {\n var\n view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n entryCount = view.getUint32(4),\n result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n sampleToChunks: []\n },\n i;\n for (i = 8; entryCount; i += 12, entryCount--) {\n result.sampleToChunks.push({\n firstChunk: view.getUint32(i),\n samplesPerChunk: view.getUint32(i + 4),\n sampleDescriptionIndex: view.getUint32(i + 8)\n });\n }\n return result;\n },\n stsd: function(data) {\n return {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n sampleDescriptions: inspectMp4(data.subarray(8))\n };\n },\n stsz: function(data) {\n var\n view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n sampleSize: view.getUint32(4),\n entries: []\n },\n i;\n for (i = 12; i < data.byteLength; i += 4) {\n result.entries.push(view.getUint32(i));\n }\n return result;\n },\n stts: function(data) {\n var\n view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n timeToSamples: []\n },\n entryCount = view.getUint32(4),\n i;\n\n for (i = 8; entryCount; i += 8, entryCount--) {\n result.timeToSamples.push({\n sampleCount: view.getUint32(i),\n sampleDelta: view.getUint32(i + 4)\n });\n }\n return result;\n },\n styp: function(data) {\n return parse.ftyp(data);\n },\n tfdt: function(data) {\n var result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n baseMediaDecodeTime: data[4] << 24 | data[5] << 16 | data[6] << 8 | data[7]\n };\n if (result.version === 1) {\n result.baseMediaDecodeTime *= Math.pow(2, 32);\n result.baseMediaDecodeTime += data[8] << 24 | data[9] << 16 | data[10] << 8 | data[11];\n }\n return result;\n },\n tfhd: function(data) {\n var\n view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n trackId: view.getUint32(4)\n },\n baseDataOffsetPresent = result.flags[2] & 0x01,\n sampleDescriptionIndexPresent = result.flags[2] & 0x02,\n defaultSampleDurationPresent = result.flags[2] & 0x08,\n defaultSampleSizePresent = result.flags[2] & 0x10,\n defaultSampleFlagsPresent = result.flags[2] & 0x20,\n durationIsEmpty = result.flags[0] & 0x010000,\n defaultBaseIsMoof = result.flags[0] & 0x020000,\n i;\n\n i = 8;\n if (baseDataOffsetPresent) {\n i += 4; // truncate top 4 bytes\n // FIXME: should we read the full 64 bits?\n result.baseDataOffset = view.getUint32(12);\n i += 4;\n }\n if (sampleDescriptionIndexPresent) {\n result.sampleDescriptionIndex = view.getUint32(i);\n i += 4;\n }\n if (defaultSampleDurationPresent) {\n result.defaultSampleDuration = view.getUint32(i);\n i += 4;\n }\n if (defaultSampleSizePresent) {\n result.defaultSampleSize = view.getUint32(i);\n i += 4;\n }\n if (defaultSampleFlagsPresent) {\n result.defaultSampleFlags = view.getUint32(i);\n }\n if (durationIsEmpty) {\n result.durationIsEmpty = true;\n }\n if (!baseDataOffsetPresent && defaultBaseIsMoof) {\n result.baseDataOffsetIsMoof = true;\n }\n return result;\n },\n tkhd: function(data) {\n var\n view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n i = 4,\n result = {\n version: view.getUint8(0),\n flags: new Uint8Array(data.subarray(1, 4))\n };\n if (result.version === 1) {\n i += 4;\n result.creationTime = parseMp4Date(view.getUint32(i)); // truncating top 4 bytes\n i += 8;\n result.modificationTime = parseMp4Date(view.getUint32(i)); // truncating top 4 bytes\n i += 4;\n result.trackId = view.getUint32(i);\n i += 4;\n i += 8;\n result.duration = view.getUint32(i); // truncating top 4 bytes\n } else {\n result.creationTime = parseMp4Date(view.getUint32(i));\n i += 4;\n result.modificationTime = parseMp4Date(view.getUint32(i));\n i += 4;\n result.trackId = view.getUint32(i);\n i += 4;\n i += 4;\n result.duration = view.getUint32(i);\n }\n i += 4;\n i += 2 * 4;\n result.layer = view.getUint16(i);\n i += 2;\n result.alternateGroup = view.getUint16(i);\n i += 2;\n // convert fixed-point, base 16 back to a number\n result.volume = view.getUint8(i) + (view.getUint8(i + 1) / 8);\n i += 2;\n i += 2;\n result.matrix = new Uint32Array(data.subarray(i, i + (9 * 4)));\n i += 9 * 4;\n result.width = view.getUint16(i) + (view.getUint16(i + 2) / 16);\n i += 4;\n result.height = view.getUint16(i) + (view.getUint16(i + 2) / 16);\n return result;\n },\n traf: function(data) {\n return {\n boxes: inspectMp4(data)\n };\n },\n trak: function(data) {\n return {\n boxes: inspectMp4(data)\n };\n },\n trex: function(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength);\n return {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n trackId: view.getUint32(4),\n defaultSampleDescriptionIndex: view.getUint32(8),\n defaultSampleDuration: view.getUint32(12),\n defaultSampleSize: view.getUint32(16),\n sampleDependsOn: data[20] & 0x03,\n sampleIsDependedOn: (data[21] & 0xc0) >> 6,\n sampleHasRedundancy: (data[21] & 0x30) >> 4,\n samplePaddingValue: (data[21] & 0x0e) >> 1,\n sampleIsDifferenceSample: !!(data[21] & 0x01),\n sampleDegradationPriority: view.getUint16(22)\n };\n },\n trun: function(data) {\n var\n result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n samples: []\n },\n view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n // Flag interpretation\n dataOffsetPresent = result.flags[2] & 0x01, // compare with 2nd byte of 0x1\n firstSampleFlagsPresent = result.flags[2] & 0x04, // compare with 2nd byte of 0x4\n sampleDurationPresent = result.flags[1] & 0x01, // compare with 2nd byte of 0x100\n sampleSizePresent = result.flags[1] & 0x02, // compare with 2nd byte of 0x200\n sampleFlagsPresent = result.flags[1] & 0x04, // compare with 2nd byte of 0x400\n sampleCompositionTimeOffsetPresent = result.flags[1] & 0x08, // compare with 2nd byte of 0x800\n sampleCount = view.getUint32(4),\n offset = 8,\n sample;\n\n if (dataOffsetPresent) {\n // 32 bit signed integer\n result.dataOffset = view.getInt32(offset);\n offset += 4;\n }\n\n // Overrides the flags for the first sample only. The order of\n // optional values will be: duration, size, compositionTimeOffset\n if (firstSampleFlagsPresent && sampleCount) {\n sample = {\n flags: parseSampleFlags(data.subarray(offset, offset + 4))\n };\n offset += 4;\n if (sampleDurationPresent) {\n sample.duration = view.getUint32(offset);\n offset += 4;\n }\n if (sampleSizePresent) {\n sample.size = view.getUint32(offset);\n offset += 4;\n }\n if (sampleCompositionTimeOffsetPresent) {\n // Note: this should be a signed int if version is 1\n sample.compositionTimeOffset = view.getUint32(offset);\n offset += 4;\n }\n result.samples.push(sample);\n sampleCount--;\n }\n\n while (sampleCount--) {\n sample = {};\n if (sampleDurationPresent) {\n sample.duration = view.getUint32(offset);\n offset += 4;\n }\n if (sampleSizePresent) {\n sample.size = view.getUint32(offset);\n offset += 4;\n }\n if (sampleFlagsPresent) {\n sample.flags = parseSampleFlags(data.subarray(offset, offset + 4));\n offset += 4;\n }\n if (sampleCompositionTimeOffsetPresent) {\n // Note: this should be a signed int if version is 1\n sample.compositionTimeOffset = view.getUint32(offset);\n offset += 4;\n }\n result.samples.push(sample);\n }\n return result;\n },\n 'url ': function(data) {\n return {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4))\n };\n },\n vmhd: function(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength);\n return {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n graphicsmode: view.getUint16(4),\n opcolor: new Uint16Array([view.getUint16(6),\n view.getUint16(8),\n view.getUint16(10)])\n };\n }\n };\n\n\n/**\n * Return a javascript array of box objects parsed from an ISO base\n * media file.\n * @param data {Uint8Array} the binary data of the media to be inspected\n * @return {array} a javascript array of potentially nested box objects\n */\ninspectMp4 = function(data) {\n var\n i = 0,\n result = [],\n view,\n size,\n type,\n end,\n box;\n\n // Convert data from Uint8Array to ArrayBuffer, to follow Dataview API\n var ab = new ArrayBuffer(data.length);\n var v = new Uint8Array(ab);\n for (var z = 0; z < data.length; ++z) {\n v[z] = data[z];\n }\n view = new DataView(ab);\n\n while (i < data.byteLength) {\n // parse box data\n size = view.getUint32(i);\n type = parseType(data.subarray(i + 4, i + 8));\n end = size > 1 ? i + size : data.byteLength;\n\n // parse type-specific data\n box = (parse[type] || function(data) {\n return {\n data: data\n };\n })(data.subarray(i + 8, end));\n box.size = size;\n box.type = type;\n\n // store this box and move to the next\n result.push(box);\n i = end;\n }\n return result;\n};\n\n/**\n * Returns a textual representation of the javascript represtentation\n * of an MP4 file. You can use it as an alternative to\n * JSON.stringify() to compare inspected MP4s.\n * @param inspectedMp4 {array} the parsed array of boxes in an MP4\n * file\n * @param depth {number} (optional) the number of ancestor boxes of\n * the elements of inspectedMp4. Assumed to be zero if unspecified.\n * @return {string} a text representation of the parsed MP4\n */\ntextifyMp4 = function(inspectedMp4, depth) {\n var indent;\n depth = depth || 0;\n indent = new Array(depth * 2 + 1).join(' ');\n\n // iterate over all the boxes\n return inspectedMp4.map(function(box, index) {\n\n // list the box type first at the current indentation level\n return indent + box.type + '\\n' +\n\n // the type is already included and handle child boxes separately\n Object.keys(box).filter(function(key) {\n return key !== 'type' && key !== 'boxes';\n\n // output all the box properties\n }).map(function(key) {\n var prefix = indent + ' ' + key + ': ',\n value = box[key];\n\n // print out raw bytes as hexademical\n if (value instanceof Uint8Array || value instanceof Uint32Array) {\n var bytes = Array.prototype.slice.call(new Uint8Array(value.buffer, value.byteOffset, value.byteLength))\n .map(function(byte) {\n return ' ' + ('00' + byte.toString(16)).slice(-2);\n }).join('').match(/.{1,24}/g);\n if (!bytes) {\n return prefix + '<>';\n }\n if (bytes.length === 1) {\n return prefix + '<' + bytes.join('').slice(1) + '>';\n }\n return prefix + '<\\n' + bytes.map(function(line) {\n return indent + ' ' + line;\n }).join('\\n') + '\\n' + indent + ' >';\n }\n\n // stringify generic objects\n return prefix +\n JSON.stringify(value, null, 2)\n .split('\\n').map(function(line, index) {\n if (index === 0) {\n return line;\n }\n return indent + ' ' + line;\n }).join('\\n');\n }).join('\\n') +\n\n // recursively textify the child boxes\n (box.boxes ? '\\n' + textifyMp4(box.boxes, depth + 1) : '');\n }).join('\\n');\n};\n\nmodule.exports = {\n inspect: inspectMp4,\n textify: textifyMp4,\n parseTfdt: parse.tfdt,\n parseHdlr: parse.hdlr,\n parseTfhd: parse.tfhd,\n parseTrun: parse.trun\n};\n","/**\n * mux.js\n *\n * Copyright (c) 2016 Brightcove\n * All rights reserved.\n *\n * Parse mpeg2 transport stream packets to extract basic timing information\n */\n'use strict';\n\nvar StreamTypes = require('../m2ts/stream-types.js');\nvar handleRollover = require('../m2ts/timestamp-rollover-stream.js').handleRollover;\nvar probe = {};\nprobe.ts = require('../m2ts/probe.js');\nprobe.aac = require('../aac/utils.js');\n\n\nvar\n PES_TIMESCALE = 90000,\n MP2T_PACKET_LENGTH = 188, // bytes\n SYNC_BYTE = 0x47;\n\n/**\n * walks through segment data looking for pat and pmt packets to parse out\n * program map table information\n */\nvar parsePsi_ = function(bytes, pmt) {\n var\n startIndex = 0,\n endIndex = MP2T_PACKET_LENGTH,\n packet, type;\n\n while (endIndex < bytes.byteLength) {\n // Look for a pair of start and end sync bytes in the data..\n if (bytes[startIndex] === SYNC_BYTE && bytes[endIndex] === SYNC_BYTE) {\n // We found a packet\n packet = bytes.subarray(startIndex, endIndex);\n type = probe.ts.parseType(packet, pmt.pid);\n\n switch (type) {\n case 'pat':\n if (!pmt.pid) {\n pmt.pid = probe.ts.parsePat(packet);\n }\n break;\n case 'pmt':\n if (!pmt.table) {\n pmt.table = probe.ts.parsePmt(packet);\n }\n break;\n default:\n break;\n }\n\n // Found the pat and pmt, we can stop walking the segment\n if (pmt.pid && pmt.table) {\n return;\n }\n\n startIndex += MP2T_PACKET_LENGTH;\n endIndex += MP2T_PACKET_LENGTH;\n continue;\n }\n\n // If we get here, we have somehow become de-synchronized and we need to step\n // forward one byte at a time until we find a pair of sync bytes that denote\n // a packet\n startIndex++;\n endIndex++;\n }\n};\n\n/**\n * walks through the segment data from the start and end to get timing information\n * for the first and last audio pes packets\n */\nvar parseAudioPes_ = function(bytes, pmt, result) {\n var\n startIndex = 0,\n endIndex = MP2T_PACKET_LENGTH,\n packet, type, pesType, pusi, parsed;\n\n var endLoop = false;\n\n // Start walking from start of segment to get first audio packet\n while (endIndex <= bytes.byteLength) {\n // Look for a pair of start and end sync bytes in the data..\n if (bytes[startIndex] === SYNC_BYTE &&\n (bytes[endIndex] === SYNC_BYTE || endIndex === bytes.byteLength)) {\n // We found a packet\n packet = bytes.subarray(startIndex, endIndex);\n type = probe.ts.parseType(packet, pmt.pid);\n\n switch (type) {\n case 'pes':\n pesType = probe.ts.parsePesType(packet, pmt.table);\n pusi = probe.ts.parsePayloadUnitStartIndicator(packet);\n if (pesType === 'audio' && pusi) {\n parsed = probe.ts.parsePesTime(packet);\n if (parsed) {\n parsed.type = 'audio';\n result.audio.push(parsed);\n endLoop = true;\n }\n }\n break;\n default:\n break;\n }\n\n if (endLoop) {\n break;\n }\n\n startIndex += MP2T_PACKET_LENGTH;\n endIndex += MP2T_PACKET_LENGTH;\n continue;\n }\n\n // If we get here, we have somehow become de-synchronized and we need to step\n // forward one byte at a time until we find a pair of sync bytes that denote\n // a packet\n startIndex++;\n endIndex++;\n }\n\n // Start walking from end of segment to get last audio packet\n endIndex = bytes.byteLength;\n startIndex = endIndex - MP2T_PACKET_LENGTH;\n endLoop = false;\n while (startIndex >= 0) {\n // Look for a pair of start and end sync bytes in the data..\n if (bytes[startIndex] === SYNC_BYTE &&\n (bytes[endIndex] === SYNC_BYTE || endIndex === bytes.byteLength)) {\n // We found a packet\n packet = bytes.subarray(startIndex, endIndex);\n type = probe.ts.parseType(packet, pmt.pid);\n\n switch (type) {\n case 'pes':\n pesType = probe.ts.parsePesType(packet, pmt.table);\n pusi = probe.ts.parsePayloadUnitStartIndicator(packet);\n if (pesType === 'audio' && pusi) {\n parsed = probe.ts.parsePesTime(packet);\n if (parsed) {\n parsed.type = 'audio';\n result.audio.push(parsed);\n endLoop = true;\n }\n }\n break;\n default:\n break;\n }\n\n if (endLoop) {\n break;\n }\n\n startIndex -= MP2T_PACKET_LENGTH;\n endIndex -= MP2T_PACKET_LENGTH;\n continue;\n }\n\n // If we get here, we have somehow become de-synchronized and we need to step\n // forward one byte at a time until we find a pair of sync bytes that denote\n // a packet\n startIndex--;\n endIndex--;\n }\n};\n\n/**\n * walks through the segment data from the start and end to get timing information\n * for the first and last video pes packets as well as timing information for the first\n * key frame.\n */\nvar parseVideoPes_ = function(bytes, pmt, result) {\n var\n startIndex = 0,\n endIndex = MP2T_PACKET_LENGTH,\n packet, type, pesType, pusi, parsed, frame, i, pes;\n\n var endLoop = false;\n\n var currentFrame = {\n data: [],\n size: 0\n };\n\n // Start walking from start of segment to get first video packet\n while (endIndex < bytes.byteLength) {\n // Look for a pair of start and end sync bytes in the data..\n if (bytes[startIndex] === SYNC_BYTE && bytes[endIndex] === SYNC_BYTE) {\n // We found a packet\n packet = bytes.subarray(startIndex, endIndex);\n type = probe.ts.parseType(packet, pmt.pid);\n\n switch (type) {\n case 'pes':\n pesType = probe.ts.parsePesType(packet, pmt.table);\n pusi = probe.ts.parsePayloadUnitStartIndicator(packet);\n if (pesType === 'video') {\n if (pusi && !endLoop) {\n parsed = probe.ts.parsePesTime(packet);\n if (parsed) {\n parsed.type = 'video';\n result.video.push(parsed);\n endLoop = true;\n }\n }\n if (!result.firstKeyFrame) {\n if (pusi) {\n if (currentFrame.size !== 0) {\n frame = new Uint8Array(currentFrame.size);\n i = 0;\n while (currentFrame.data.length) {\n pes = currentFrame.data.shift();\n frame.set(pes, i);\n i += pes.byteLength;\n }\n if (probe.ts.videoPacketContainsKeyFrame(frame)) {\n result.firstKeyFrame = probe.ts.parsePesTime(frame);\n result.firstKeyFrame.type = 'video';\n }\n currentFrame.size = 0;\n }\n }\n currentFrame.data.push(packet);\n currentFrame.size += packet.byteLength;\n }\n }\n break;\n default:\n break;\n }\n\n if (endLoop && result.firstKeyFrame) {\n break;\n }\n\n startIndex += MP2T_PACKET_LENGTH;\n endIndex += MP2T_PACKET_LENGTH;\n continue;\n }\n\n // If we get here, we have somehow become de-synchronized and we need to step\n // forward one byte at a time until we find a pair of sync bytes that denote\n // a packet\n startIndex++;\n endIndex++;\n }\n\n // Start walking from end of segment to get last video packet\n endIndex = bytes.byteLength;\n startIndex = endIndex - MP2T_PACKET_LENGTH;\n endLoop = false;\n while (startIndex >= 0) {\n // Look for a pair of start and end sync bytes in the data..\n if (bytes[startIndex] === SYNC_BYTE && bytes[endIndex] === SYNC_BYTE) {\n // We found a packet\n packet = bytes.subarray(startIndex, endIndex);\n type = probe.ts.parseType(packet, pmt.pid);\n\n switch (type) {\n case 'pes':\n pesType = probe.ts.parsePesType(packet, pmt.table);\n pusi = probe.ts.parsePayloadUnitStartIndicator(packet);\n if (pesType === 'video' && pusi) {\n parsed = probe.ts.parsePesTime(packet);\n if (parsed) {\n parsed.type = 'video';\n result.video.push(parsed);\n endLoop = true;\n }\n }\n break;\n default:\n break;\n }\n\n if (endLoop) {\n break;\n }\n\n startIndex -= MP2T_PACKET_LENGTH;\n endIndex -= MP2T_PACKET_LENGTH;\n continue;\n }\n\n // If we get here, we have somehow become de-synchronized and we need to step\n // forward one byte at a time until we find a pair of sync bytes that denote\n // a packet\n startIndex--;\n endIndex--;\n }\n};\n\n/**\n * Adjusts the timestamp information for the segment to account for\n * rollover and convert to seconds based on pes packet timescale (90khz clock)\n */\nvar adjustTimestamp_ = function(segmentInfo, baseTimestamp) {\n if (segmentInfo.audio && segmentInfo.audio.length) {\n var audioBaseTimestamp = baseTimestamp;\n if (typeof audioBaseTimestamp === 'undefined') {\n audioBaseTimestamp = segmentInfo.audio[0].dts;\n }\n segmentInfo.audio.forEach(function(info) {\n info.dts = handleRollover(info.dts, audioBaseTimestamp);\n info.pts = handleRollover(info.pts, audioBaseTimestamp);\n // time in seconds\n info.dtsTime = info.dts / PES_TIMESCALE;\n info.ptsTime = info.pts / PES_TIMESCALE;\n });\n }\n\n if (segmentInfo.video && segmentInfo.video.length) {\n var videoBaseTimestamp = baseTimestamp;\n if (typeof videoBaseTimestamp === 'undefined') {\n videoBaseTimestamp = segmentInfo.video[0].dts;\n }\n segmentInfo.video.forEach(function(info) {\n info.dts = handleRollover(info.dts, videoBaseTimestamp);\n info.pts = handleRollover(info.pts, videoBaseTimestamp);\n // time in seconds\n info.dtsTime = info.dts / PES_TIMESCALE;\n info.ptsTime = info.pts / PES_TIMESCALE;\n });\n if (segmentInfo.firstKeyFrame) {\n var frame = segmentInfo.firstKeyFrame;\n frame.dts = handleRollover(frame.dts, videoBaseTimestamp);\n frame.pts = handleRollover(frame.pts, videoBaseTimestamp);\n // time in seconds\n frame.dtsTime = frame.dts / PES_TIMESCALE;\n frame.ptsTime = frame.dts / PES_TIMESCALE;\n }\n }\n};\n\n/**\n * inspects the aac data stream for start and end time information\n */\nvar inspectAac_ = function(bytes) {\n var\n endLoop = false,\n audioCount = 0,\n sampleRate = null,\n timestamp = null,\n frameSize = 0,\n byteIndex = 0,\n packet;\n\n while (bytes.length - byteIndex >= 3) {\n var type = probe.aac.parseType(bytes, byteIndex);\n switch (type) {\n case 'timed-metadata':\n // Exit early because we don't have enough to parse\n // the ID3 tag header\n if (bytes.length - byteIndex < 10) {\n endLoop = true;\n break;\n }\n\n frameSize = probe.aac.parseId3TagSize(bytes, byteIndex);\n\n // Exit early if we don't have enough in the buffer\n // to emit a full packet\n if (frameSize > bytes.length) {\n endLoop = true;\n break;\n }\n if (timestamp === null) {\n packet = bytes.subarray(byteIndex, byteIndex + frameSize);\n timestamp = probe.aac.parseAacTimestamp(packet);\n }\n byteIndex += frameSize;\n break;\n case 'audio':\n // Exit early because we don't have enough to parse\n // the ADTS frame header\n if (bytes.length - byteIndex < 7) {\n endLoop = true;\n break;\n }\n\n frameSize = probe.aac.parseAdtsSize(bytes, byteIndex);\n\n // Exit early if we don't have enough in the buffer\n // to emit a full packet\n if (frameSize > bytes.length) {\n endLoop = true;\n break;\n }\n if (sampleRate === null) {\n packet = bytes.subarray(byteIndex, byteIndex + frameSize);\n sampleRate = probe.aac.parseSampleRate(packet);\n }\n audioCount++;\n byteIndex += frameSize;\n break;\n default:\n byteIndex++;\n break;\n }\n if (endLoop) {\n return null;\n }\n }\n if (sampleRate === null || timestamp === null) {\n return null;\n }\n\n var audioTimescale = PES_TIMESCALE / sampleRate;\n\n var result = {\n audio: [\n {\n type: 'audio',\n dts: timestamp,\n pts: timestamp\n },\n {\n type: 'audio',\n dts: timestamp + (audioCount * 1024 * audioTimescale),\n pts: timestamp + (audioCount * 1024 * audioTimescale)\n }\n ]\n };\n\n return result;\n};\n\n/**\n * inspects the transport stream segment data for start and end time information\n * of the audio and video tracks (when present) as well as the first key frame's\n * start time.\n */\nvar inspectTs_ = function(bytes) {\n var pmt = {\n pid: null,\n table: null\n };\n\n var result = {};\n\n parsePsi_(bytes, pmt);\n\n for (var pid in pmt.table) {\n if (pmt.table.hasOwnProperty(pid)) {\n var type = pmt.table[pid];\n switch (type) {\n case StreamTypes.H264_STREAM_TYPE:\n result.video = [];\n parseVideoPes_(bytes, pmt, result);\n if (result.video.length === 0) {\n delete result.video;\n }\n break;\n case StreamTypes.ADTS_STREAM_TYPE:\n result.audio = [];\n parseAudioPes_(bytes, pmt, result);\n if (result.audio.length === 0) {\n delete result.audio;\n }\n break;\n default:\n break;\n }\n }\n }\n return result;\n};\n\n/**\n * Inspects segment byte data and returns an object with start and end timing information\n *\n * @param {Uint8Array} bytes The segment byte data\n * @param {Number} baseTimestamp Relative reference timestamp used when adjusting frame\n * timestamps for rollover. This value must be in 90khz clock.\n * @return {Object} Object containing start and end frame timing info of segment.\n */\nvar inspect = function(bytes, baseTimestamp) {\n var isAacData = probe.aac.isLikelyAacData(bytes);\n\n var result;\n\n if (isAacData) {\n result = inspectAac_(bytes);\n } else {\n result = inspectTs_(bytes);\n }\n\n if (!result || (!result.audio && !result.video)) {\n return null;\n }\n\n adjustTimestamp_(result, baseTimestamp);\n\n return result;\n};\n\nmodule.exports = {\n inspect: inspect,\n parseAudioPes_: parseAudioPes_\n};\n","var toUnsigned = function(value) {\n return value >>> 0;\n};\n\nmodule.exports = {\n toUnsigned: toUnsigned\n};\n","var\n ONE_SECOND_IN_TS = 90000, // 90kHz clock\n secondsToVideoTs,\n secondsToAudioTs,\n videoTsToSeconds,\n audioTsToSeconds,\n audioTsToVideoTs,\n videoTsToAudioTs;\n\nsecondsToVideoTs = function(seconds) {\n return seconds * ONE_SECOND_IN_TS;\n};\n\nsecondsToAudioTs = function(seconds, sampleRate) {\n return seconds * sampleRate;\n};\n\nvideoTsToSeconds = function(timestamp) {\n return timestamp / ONE_SECOND_IN_TS;\n};\n\naudioTsToSeconds = function(timestamp, sampleRate) {\n return timestamp / sampleRate;\n};\n\naudioTsToVideoTs = function(timestamp, sampleRate) {\n return secondsToVideoTs(audioTsToSeconds(timestamp, sampleRate));\n};\n\nvideoTsToAudioTs = function(timestamp, sampleRate) {\n return secondsToAudioTs(videoTsToSeconds(timestamp), sampleRate);\n};\n\nmodule.exports = {\n secondsToVideoTs: secondsToVideoTs,\n secondsToAudioTs: secondsToAudioTs,\n videoTsToSeconds: videoTsToSeconds,\n audioTsToSeconds: audioTsToSeconds,\n audioTsToVideoTs: audioTsToVideoTs,\n videoTsToAudioTs: videoTsToAudioTs\n};\n","'use strict';\n\nvar ExpGolomb;\n\n/**\n * Parser for exponential Golomb codes, a variable-bitwidth number encoding\n * scheme used by h264.\n */\nExpGolomb = function(workingData) {\n var\n // the number of bytes left to examine in workingData\n workingBytesAvailable = workingData.byteLength,\n\n // the current word being examined\n workingWord = 0, // :uint\n\n // the number of bits left to examine in the current word\n workingBitsAvailable = 0; // :uint;\n\n // ():uint\n this.length = function() {\n return (8 * workingBytesAvailable);\n };\n\n // ():uint\n this.bitsAvailable = function() {\n return (8 * workingBytesAvailable) + workingBitsAvailable;\n };\n\n // ():void\n this.loadWord = function() {\n var\n position = workingData.byteLength - workingBytesAvailable,\n workingBytes = new Uint8Array(4),\n availableBytes = Math.min(4, workingBytesAvailable);\n\n if (availableBytes === 0) {\n throw new Error('no bytes available');\n }\n\n workingBytes.set(workingData.subarray(position,\n position + availableBytes));\n workingWord = new DataView(workingBytes.buffer).getUint32(0);\n\n // track the amount of workingData that has been processed\n workingBitsAvailable = availableBytes * 8;\n workingBytesAvailable -= availableBytes;\n };\n\n // (count:int):void\n this.skipBits = function(count) {\n var skipBytes; // :int\n if (workingBitsAvailable > count) {\n workingWord <<= count;\n workingBitsAvailable -= count;\n } else {\n count -= workingBitsAvailable;\n skipBytes = Math.floor(count / 8);\n\n count -= (skipBytes * 8);\n workingBytesAvailable -= skipBytes;\n\n this.loadWord();\n\n workingWord <<= count;\n workingBitsAvailable -= count;\n }\n };\n\n // (size:int):uint\n this.readBits = function(size) {\n var\n bits = Math.min(workingBitsAvailable, size), // :uint\n valu = workingWord >>> (32 - bits); // :uint\n // if size > 31, handle error\n workingBitsAvailable -= bits;\n if (workingBitsAvailable > 0) {\n workingWord <<= bits;\n } else if (workingBytesAvailable > 0) {\n this.loadWord();\n }\n\n bits = size - bits;\n if (bits > 0) {\n return valu << bits | this.readBits(bits);\n }\n return valu;\n };\n\n // ():uint\n this.skipLeadingZeros = function() {\n var leadingZeroCount; // :uint\n for (leadingZeroCount = 0; leadingZeroCount < workingBitsAvailable; ++leadingZeroCount) {\n if ((workingWord & (0x80000000 >>> leadingZeroCount)) !== 0) {\n // the first bit of working word is 1\n workingWord <<= leadingZeroCount;\n workingBitsAvailable -= leadingZeroCount;\n return leadingZeroCount;\n }\n }\n\n // we exhausted workingWord and still have not found a 1\n this.loadWord();\n return leadingZeroCount + this.skipLeadingZeros();\n };\n\n // ():void\n this.skipUnsignedExpGolomb = function() {\n this.skipBits(1 + this.skipLeadingZeros());\n };\n\n // ():void\n this.skipExpGolomb = function() {\n this.skipBits(1 + this.skipLeadingZeros());\n };\n\n // ():uint\n this.readUnsignedExpGolomb = function() {\n var clz = this.skipLeadingZeros(); // :uint\n return this.readBits(clz + 1) - 1;\n };\n\n // ():int\n this.readExpGolomb = function() {\n var valu = this.readUnsignedExpGolomb(); // :int\n if (0x01 & valu) {\n // the number is odd if the low order bit is set\n return (1 + valu) >>> 1; // add 1 to make it even, and divide by 2\n }\n return -1 * (valu >>> 1); // divide by two then make it negative\n };\n\n // Some convenience functions\n // :Boolean\n this.readBoolean = function() {\n return this.readBits(1) === 1;\n };\n\n // ():int\n this.readUnsignedByte = function() {\n return this.readBits(8);\n };\n\n this.loadWord();\n};\n\nmodule.exports = ExpGolomb;\n","/**\n * mux.js\n *\n * Copyright (c) 2014 Brightcove\n * All rights reserved.\n *\n * A lightweight readable stream implemention that handles event dispatching.\n * Objects that inherit from streams should call init in their constructors.\n */\n'use strict';\n\nvar Stream = function() {\n this.init = function() {\n var listeners = {};\n /**\n * Add a listener for a specified event type.\n * @param type {string} the event name\n * @param listener {function} the callback to be invoked when an event of\n * the specified type occurs\n */\n this.on = function(type, listener) {\n if (!listeners[type]) {\n listeners[type] = [];\n }\n listeners[type] = listeners[type].concat(listener);\n };\n /**\n * Remove a listener for a specified event type.\n * @param type {string} the event name\n * @param listener {function} a function previously registered for this\n * type of event through `on`\n */\n this.off = function(type, listener) {\n var index;\n if (!listeners[type]) {\n return false;\n }\n index = listeners[type].indexOf(listener);\n listeners[type] = listeners[type].slice();\n listeners[type].splice(index, 1);\n return index > -1;\n };\n /**\n * Trigger an event of the specified type on this stream. Any additional\n * arguments to this function are passed as parameters to event listeners.\n * @param type {string} the event name\n */\n this.trigger = function(type) {\n var callbacks, i, length, args;\n callbacks = listeners[type];\n if (!callbacks) {\n return;\n }\n // Slicing the arguments on every invocation of this method\n // can add a significant amount of overhead. Avoid the\n // intermediate object creation for the common case of a\n // single callback argument\n if (arguments.length === 2) {\n length = callbacks.length;\n for (i = 0; i < length; ++i) {\n callbacks[i].call(this, arguments[1]);\n }\n } else {\n args = [];\n i = arguments.length;\n for (i = 1; i < arguments.length; ++i) {\n args.push(arguments[i]);\n }\n length = callbacks.length;\n for (i = 0; i < length; ++i) {\n callbacks[i].apply(this, args);\n }\n }\n };\n /**\n * Destroys the stream and cleans up.\n */\n this.dispose = function() {\n listeners = {};\n };\n };\n};\n\n/**\n * Forwards all `data` events on this stream to the destination stream. The\n * destination stream should provide a method `push` to receive the data\n * events as they arrive.\n * @param destination {stream} the stream that will receive all `data` events\n * @param autoFlush {boolean} if false, we will not call `flush` on the destination\n * when the current stream emits a 'done' event\n * @see http://nodejs.org/api/stream.html#stream_readable_pipe_destination_options\n */\nStream.prototype.pipe = function(destination) {\n this.on('data', function(data) {\n destination.push(data);\n });\n\n this.on('done', function(flushSource) {\n destination.flush(flushSource);\n });\n\n return destination;\n};\n\n// Default stream functions that are expected to be overridden to perform\n// actual work. These are provided by the prototype as a sort of no-op\n// implementation so that we don't have to check for their existence in the\n// `pipe` function above.\nStream.prototype.push = function(data) {\n this.trigger('data', data);\n};\n\nStream.prototype.flush = function(flushSource) {\n this.trigger('done', flushSource);\n};\n\nmodule.exports = Stream;\n","var trim = require('trim')\n , forEach = require('for-each')\n , isArray = function(arg) {\n return Object.prototype.toString.call(arg) === '[object Array]';\n }\n\nmodule.exports = function (headers) {\n if (!headers)\n return {}\n\n var result = {}\n\n forEach(\n trim(headers).split('\\n')\n , function (row) {\n var index = row.indexOf(':')\n , key = trim(row.slice(0, index)).toLowerCase()\n , value = trim(row.slice(index + 1))\n\n if (typeof(result[key]) === 'undefined') {\n result[key] = value\n } else if (isArray(result[key])) {\n result[key].push(value)\n } else {\n result[key] = [ result[key], value ]\n }\n }\n )\n\n return result\n}","module.exports = SafeParseTuple\n\nfunction SafeParseTuple(obj, reviver) {\n var json\n var error = null\n\n try {\n json = JSON.parse(obj, reviver)\n } catch (err) {\n error = err\n }\n\n return [error, json]\n}\n","\nexports = module.exports = trim;\n\nfunction trim(str){\n return str.replace(/^\\s*|\\s*$/g, '');\n}\n\nexports.left = function(str){\n return str.replace(/^\\s*/, '');\n};\n\nexports.right = function(str){\n return str.replace(/\\s*$/, '');\n};\n","function clean (s) {\n return s.replace(/\\n\\r?\\s*/g, '')\n}\n\n\nmodule.exports = function tsml (sa) {\n var s = ''\n , i = 0\n\n for (; i < arguments.length; i++)\n s += clean(sa[i]) + (arguments[i + 1] || '')\n\n return s\n}","// see https://tools.ietf.org/html/rfc1808\n\n/* jshint ignore:start */\n(function(root) { \n/* jshint ignore:end */\n\n var URL_REGEX = /^((?:[a-zA-Z0-9+\\-.]+:)?)(\\/\\/[^\\/?#]*)?((?:[^\\/\\?#]*\\/)*.*?)??(;.*?)?(\\?.*?)?(#.*?)?$/;\n var FIRST_SEGMENT_REGEX = /^([^\\/?#]*)(.*)$/;\n var SLASH_DOT_REGEX = /(?:\\/|^)\\.(?=\\/)/g;\n var SLASH_DOT_DOT_REGEX = /(?:\\/|^)\\.\\.\\/(?!\\.\\.\\/).*?(?=\\/)/g;\n\n var URLToolkit = { // jshint ignore:line\n // If opts.alwaysNormalize is true then the path will always be normalized even when it starts with / or //\n // E.g\n // With opts.alwaysNormalize = false (default, spec compliant)\n // http://a.com/b/cd + /e/f/../g => http://a.com/e/f/../g\n // With opts.alwaysNormalize = true (not spec compliant)\n // http://a.com/b/cd + /e/f/../g => http://a.com/e/g\n buildAbsoluteURL: function(baseURL, relativeURL, opts) {\n opts = opts || {};\n // remove any remaining space and CRLF\n baseURL = baseURL.trim();\n relativeURL = relativeURL.trim();\n if (!relativeURL) {\n // 2a) If the embedded URL is entirely empty, it inherits the\n // entire base URL (i.e., is set equal to the base URL)\n // and we are done.\n if (!opts.alwaysNormalize) {\n return baseURL;\n }\n var basePartsForNormalise = URLToolkit.parseURL(baseURL);\n if (!basePartsForNormalise) {\n throw new Error('Error trying to parse base URL.');\n }\n basePartsForNormalise.path = URLToolkit.normalizePath(basePartsForNormalise.path);\n return URLToolkit.buildURLFromParts(basePartsForNormalise);\n }\n var relativeParts = URLToolkit.parseURL(relativeURL);\n if (!relativeParts) {\n throw new Error('Error trying to parse relative URL.');\n }\n if (relativeParts.scheme) {\n // 2b) If the embedded URL starts with a scheme name, it is\n // interpreted as an absolute URL and we are done.\n if (!opts.alwaysNormalize) {\n return relativeURL;\n }\n relativeParts.path = URLToolkit.normalizePath(relativeParts.path);\n return URLToolkit.buildURLFromParts(relativeParts);\n }\n var baseParts = URLToolkit.parseURL(baseURL);\n if (!baseParts) {\n throw new Error('Error trying to parse base URL.');\n }\n if (!baseParts.netLoc && baseParts.path && baseParts.path[0] !== '/') {\n // If netLoc missing and path doesn't start with '/', assume everthing before the first '/' is the netLoc\n // This causes 'example.com/a' to be handled as '//example.com/a' instead of '/example.com/a'\n var pathParts = FIRST_SEGMENT_REGEX.exec(baseParts.path);\n baseParts.netLoc = pathParts[1];\n baseParts.path = pathParts[2];\n }\n if (baseParts.netLoc && !baseParts.path) {\n baseParts.path = '/';\n }\n var builtParts = {\n // 2c) Otherwise, the embedded URL inherits the scheme of\n // the base URL.\n scheme: baseParts.scheme,\n netLoc: relativeParts.netLoc,\n path: null,\n params: relativeParts.params,\n query: relativeParts.query,\n fragment: relativeParts.fragment\n };\n if (!relativeParts.netLoc) {\n // 3) If the embedded URL's <net_loc> is non-empty, we skip to\n // Step 7. Otherwise, the embedded URL inherits the <net_loc>\n // (if any) of the base URL.\n builtParts.netLoc = baseParts.netLoc;\n // 4) If the embedded URL path is preceded by a slash \"/\", the\n // path is not relative and we skip to Step 7.\n if (relativeParts.path[0] !== '/') {\n if (!relativeParts.path) {\n // 5) If the embedded URL path is empty (and not preceded by a\n // slash), then the embedded URL inherits the base URL path\n builtParts.path = baseParts.path;\n // 5a) if the embedded URL's <params> is non-empty, we skip to\n // step 7; otherwise, it inherits the <params> of the base\n // URL (if any) and\n if (!relativeParts.params) {\n builtParts.params = baseParts.params;\n // 5b) if the embedded URL's <query> is non-empty, we skip to\n // step 7; otherwise, it inherits the <query> of the base\n // URL (if any) and we skip to step 7.\n if (!relativeParts.query) {\n builtParts.query = baseParts.query;\n }\n }\n } else {\n // 6) The last segment of the base URL's path (anything\n // following the rightmost slash \"/\", or the entire path if no\n // slash is present) is removed and the embedded URL's path is\n // appended in its place.\n var baseURLPath = baseParts.path;\n var newPath = baseURLPath.substring(0, baseURLPath.lastIndexOf('/') + 1) + relativeParts.path;\n builtParts.path = URLToolkit.normalizePath(newPath);\n }\n }\n }\n if (builtParts.path === null) {\n builtParts.path = opts.alwaysNormalize ? URLToolkit.normalizePath(relativeParts.path) : relativeParts.path;\n }\n return URLToolkit.buildURLFromParts(builtParts);\n },\n parseURL: function(url) {\n var parts = URL_REGEX.exec(url);\n if (!parts) {\n return null;\n }\n return {\n scheme: parts[1] || '',\n netLoc: parts[2] || '',\n path: parts[3] || '',\n params: parts[4] || '',\n query: parts[5] || '',\n fragment: parts[6] || ''\n };\n },\n normalizePath: function(path) {\n // The following operations are\n // then applied, in order, to the new path:\n // 6a) All occurrences of \"./\", where \".\" is a complete path\n // segment, are removed.\n // 6b) If the path ends with \".\" as a complete path segment,\n // that \".\" is removed.\n path = path.split('').reverse().join('').replace(SLASH_DOT_REGEX, '');\n // 6c) All occurrences of \"<segment>/../\", where <segment> is a\n // complete path segment not equal to \"..\", are removed.\n // Removal of these path segments is performed iteratively,\n // removing the leftmost matching pattern on each iteration,\n // until no matching pattern remains.\n // 6d) If the path ends with \"<segment>/..\", where <segment> is a\n // complete path segment not equal to \"..\", that\n // \"<segment>/..\" is removed.\n while (path.length !== (path = path.replace(SLASH_DOT_DOT_REGEX, '')).length) {} // jshint ignore:line\n return path.split('').reverse().join('');\n },\n buildURLFromParts: function(parts) {\n return parts.scheme + parts.netLoc + parts.path + parts.params + parts.query + parts.fragment;\n }\n };\n\n/* jshint ignore:start */\n if(typeof exports === 'object' && typeof module === 'object')\n module.exports = URLToolkit;\n else if(typeof define === 'function' && define.amd)\n define([], function() { return URLToolkit; });\n else if(typeof exports === 'object')\n exports[\"URLToolkit\"] = URLToolkit;\n else\n root[\"URLToolkit\"] = URLToolkit;\n})(this);\n/* jshint ignore:end */\n","var classCallCheck = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};\n\n\n\n\n\n\n\n\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\n\n\nvar inherits = function (subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n};\n\n\n\n\n\n\n\n\n\n\n\nvar possibleConstructorReturn = function (self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n};\n\n/**\n * @file stream.js\n */\n/**\n * A lightweight readable stream implemention that handles event dispatching.\n *\n * @class Stream\n */\nvar Stream = function () {\n function Stream() {\n classCallCheck(this, Stream);\n\n this.listeners = {};\n }\n\n /**\n * Add a listener for a specified event type.\n *\n * @param {String} type the event name\n * @param {Function} listener the callback to be invoked when an event of\n * the specified type occurs\n */\n\n\n Stream.prototype.on = function on(type, listener) {\n if (!this.listeners[type]) {\n this.listeners[type] = [];\n }\n this.listeners[type].push(listener);\n };\n\n /**\n * Remove a listener for a specified event type.\n *\n * @param {String} type the event name\n * @param {Function} listener a function previously registered for this\n * type of event through `on`\n * @return {Boolean} if we could turn it off or not\n */\n\n\n Stream.prototype.off = function off(type, listener) {\n if (!this.listeners[type]) {\n return false;\n }\n\n var index = this.listeners[type].indexOf(listener);\n\n this.listeners[type].splice(index, 1);\n return index > -1;\n };\n\n /**\n * Trigger an event of the specified type on this stream. Any additional\n * arguments to this function are passed as parameters to event listeners.\n *\n * @param {String} type the event name\n */\n\n\n Stream.prototype.trigger = function trigger(type) {\n var callbacks = this.listeners[type];\n var i = void 0;\n var length = void 0;\n var args = void 0;\n\n if (!callbacks) {\n return;\n }\n // Slicing the arguments on every invocation of this method\n // can add a significant amount of overhead. Avoid the\n // intermediate object creation for the common case of a\n // single callback argument\n if (arguments.length === 2) {\n length = callbacks.length;\n for (i = 0; i < length; ++i) {\n callbacks[i].call(this, arguments[1]);\n }\n } else {\n args = Array.prototype.slice.call(arguments, 1);\n length = callbacks.length;\n for (i = 0; i < length; ++i) {\n callbacks[i].apply(this, args);\n }\n }\n };\n\n /**\n * Destroys the stream and cleans up.\n */\n\n\n Stream.prototype.dispose = function dispose() {\n this.listeners = {};\n };\n /**\n * Forwards all `data` events on this stream to the destination stream. The\n * destination stream should provide a method `push` to receive the data\n * events as they arrive.\n *\n * @param {Stream} destination the stream that will receive all `data` events\n * @see http://nodejs.org/api/stream.html#stream_readable_pipe_destination_options\n */\n\n\n Stream.prototype.pipe = function pipe(destination) {\n this.on('data', function (data) {\n destination.push(data);\n });\n };\n\n return Stream;\n}();\n\n/**\n * @file m3u8/line-stream.js\n */\n/**\n * A stream that buffers string input and generates a `data` event for each\n * line.\n *\n * @class LineStream\n * @extends Stream\n */\n\nvar LineStream = function (_Stream) {\n inherits(LineStream, _Stream);\n\n function LineStream() {\n classCallCheck(this, LineStream);\n\n var _this = possibleConstructorReturn(this, _Stream.call(this));\n\n _this.buffer = '';\n return _this;\n }\n\n /**\n * Add new data to be parsed.\n *\n * @param {String} data the text to process\n */\n\n\n LineStream.prototype.push = function push(data) {\n var nextNewline = void 0;\n\n this.buffer += data;\n nextNewline = this.buffer.indexOf('\\n');\n\n for (; nextNewline > -1; nextNewline = this.buffer.indexOf('\\n')) {\n this.trigger('data', this.buffer.substring(0, nextNewline));\n this.buffer = this.buffer.substring(nextNewline + 1);\n }\n };\n\n return LineStream;\n}(Stream);\n\n/**\n * @file m3u8/parse-stream.js\n */\n/**\n * \"forgiving\" attribute list psuedo-grammar:\n * attributes -> keyvalue (',' keyvalue)*\n * keyvalue -> key '=' value\n * key -> [^=]*\n * value -> '\"' [^\"]* '\"' | [^,]*\n */\nvar attributeSeparator = function attributeSeparator() {\n var key = '[^=]*';\n var value = '\"[^\"]*\"|[^,]*';\n var keyvalue = '(?:' + key + ')=(?:' + value + ')';\n\n return new RegExp('(?:^|,)(' + keyvalue + ')');\n};\n\n/**\n * Parse attributes from a line given the seperator\n *\n * @param {String} attributes the attibute line to parse\n */\nvar parseAttributes = function parseAttributes(attributes) {\n // split the string using attributes as the separator\n var attrs = attributes.split(attributeSeparator());\n var result = {};\n var i = attrs.length;\n var attr = void 0;\n\n while (i--) {\n // filter out unmatched portions of the string\n if (attrs[i] === '') {\n continue;\n }\n\n // split the key and value\n attr = /([^=]*)=(.*)/.exec(attrs[i]).slice(1);\n // trim whitespace and remove optional quotes around the value\n attr[0] = attr[0].replace(/^\\s+|\\s+$/g, '');\n attr[1] = attr[1].replace(/^\\s+|\\s+$/g, '');\n attr[1] = attr[1].replace(/^['\"](.*)['\"]$/g, '$1');\n result[attr[0]] = attr[1];\n }\n return result;\n};\n\n/**\n * A line-level M3U8 parser event stream. It expects to receive input one\n * line at a time and performs a context-free parse of its contents. A stream\n * interpretation of a manifest can be useful if the manifest is expected to\n * be too large to fit comfortably into memory or the entirety of the input\n * is not immediately available. Otherwise, it's probably much easier to work\n * with a regular `Parser` object.\n *\n * Produces `data` events with an object that captures the parser's\n * interpretation of the input. That object has a property `tag` that is one\n * of `uri`, `comment`, or `tag`. URIs only have a single additional\n * property, `line`, which captures the entirety of the input without\n * interpretation. Comments similarly have a single additional property\n * `text` which is the input without the leading `#`.\n *\n * Tags always have a property `tagType` which is the lower-cased version of\n * the M3U8 directive without the `#EXT` or `#EXT-X-` prefix. For instance,\n * `#EXT-X-MEDIA-SEQUENCE` becomes `media-sequence` when parsed. Unrecognized\n * tags are given the tag type `unknown` and a single additional property\n * `data` with the remainder of the input.\n *\n * @class ParseStream\n * @extends Stream\n */\n\nvar ParseStream = function (_Stream) {\n inherits(ParseStream, _Stream);\n\n function ParseStream() {\n classCallCheck(this, ParseStream);\n\n var _this = possibleConstructorReturn(this, _Stream.call(this));\n\n _this.customParsers = [];\n return _this;\n }\n\n /**\n * Parses an additional line of input.\n *\n * @param {String} line a single line of an M3U8 file to parse\n */\n\n\n ParseStream.prototype.push = function push(line) {\n var match = void 0;\n var event = void 0;\n\n // strip whitespace\n line = line.replace(/^[\\u0000\\s]+|[\\u0000\\s]+$/g, '');\n if (line.length === 0) {\n // ignore empty lines\n return;\n }\n\n // URIs\n if (line[0] !== '#') {\n this.trigger('data', {\n type: 'uri',\n uri: line\n });\n return;\n }\n\n for (var i = 0; i < this.customParsers.length; i++) {\n if (this.customParsers[i].call(this, line)) {\n return;\n }\n }\n\n // Comments\n if (line.indexOf('#EXT') !== 0) {\n this.trigger('data', {\n type: 'comment',\n text: line.slice(1)\n });\n return;\n }\n\n // strip off any carriage returns here so the regex matching\n // doesn't have to account for them.\n line = line.replace('\\r', '');\n\n // Tags\n match = /^#EXTM3U/.exec(line);\n if (match) {\n this.trigger('data', {\n type: 'tag',\n tagType: 'm3u'\n });\n return;\n }\n match = /^#EXTINF:?([0-9\\.]*)?,?(.*)?$/.exec(line);\n if (match) {\n event = {\n type: 'tag',\n tagType: 'inf'\n };\n if (match[1]) {\n event.duration = parseFloat(match[1]);\n }\n if (match[2]) {\n event.title = match[2];\n }\n this.trigger('data', event);\n return;\n }\n match = /^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(line);\n if (match) {\n event = {\n type: 'tag',\n tagType: 'targetduration'\n };\n if (match[1]) {\n event.duration = parseInt(match[1], 10);\n }\n this.trigger('data', event);\n return;\n }\n match = /^#ZEN-TOTAL-DURATION:?([0-9.]*)?/.exec(line);\n if (match) {\n event = {\n type: 'tag',\n tagType: 'totalduration'\n };\n if (match[1]) {\n event.duration = parseInt(match[1], 10);\n }\n this.trigger('data', event);\n return;\n }\n match = /^#EXT-X-VERSION:?([0-9.]*)?/.exec(line);\n if (match) {\n event = {\n type: 'tag',\n tagType: 'version'\n };\n if (match[1]) {\n event.version = parseInt(match[1], 10);\n }\n this.trigger('data', event);\n return;\n }\n match = /^#EXT-X-MEDIA-SEQUENCE:?(\\-?[0-9.]*)?/.exec(line);\n if (match) {\n event = {\n type: 'tag',\n tagType: 'media-sequence'\n };\n if (match[1]) {\n event.number = parseInt(match[1], 10);\n }\n this.trigger('data', event);\n return;\n }\n match = /^#EXT-X-DISCONTINUITY-SEQUENCE:?(\\-?[0-9.]*)?/.exec(line);\n if (match) {\n event = {\n type: 'tag',\n tagType: 'discontinuity-sequence'\n };\n if (match[1]) {\n event.number = parseInt(match[1], 10);\n }\n this.trigger('data', event);\n return;\n }\n match = /^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(line);\n if (match) {\n event = {\n type: 'tag',\n tagType: 'playlist-type'\n };\n if (match[1]) {\n event.playlistType = match[1];\n }\n this.trigger('data', event);\n return;\n }\n match = /^#EXT-X-BYTERANGE:?([0-9.]*)?@?([0-9.]*)?/.exec(line);\n if (match) {\n event = {\n type: 'tag',\n tagType: 'byterange'\n };\n if (match[1]) {\n event.length = parseInt(match[1], 10);\n }\n if (match[2]) {\n event.offset = parseInt(match[2], 10);\n }\n this.trigger('data', event);\n return;\n }\n match = /^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(line);\n if (match) {\n event = {\n type: 'tag',\n tagType: 'allow-cache'\n };\n if (match[1]) {\n event.allowed = !/NO/.test(match[1]);\n }\n this.trigger('data', event);\n return;\n }\n match = /^#EXT-X-MAP:?(.*)$/.exec(line);\n if (match) {\n event = {\n type: 'tag',\n tagType: 'map'\n };\n\n if (match[1]) {\n var attributes = parseAttributes(match[1]);\n\n if (attributes.URI) {\n event.uri = attributes.URI;\n }\n if (attributes.BYTERANGE) {\n var _attributes$BYTERANGE = attributes.BYTERANGE.split('@'),\n length = _attributes$BYTERANGE[0],\n offset = _attributes$BYTERANGE[1];\n\n event.byterange = {};\n if (length) {\n event.byterange.length = parseInt(length, 10);\n }\n if (offset) {\n event.byterange.offset = parseInt(offset, 10);\n }\n }\n }\n\n this.trigger('data', event);\n return;\n }\n match = /^#EXT-X-STREAM-INF:?(.*)$/.exec(line);\n if (match) {\n event = {\n type: 'tag',\n tagType: 'stream-inf'\n };\n if (match[1]) {\n event.attributes = parseAttributes(match[1]);\n\n if (event.attributes.RESOLUTION) {\n var split = event.attributes.RESOLUTION.split('x');\n var resolution = {};\n\n if (split[0]) {\n resolution.width = parseInt(split[0], 10);\n }\n if (split[1]) {\n resolution.height = parseInt(split[1], 10);\n }\n event.attributes.RESOLUTION = resolution;\n }\n if (event.attributes.BANDWIDTH) {\n event.attributes.BANDWIDTH = parseInt(event.attributes.BANDWIDTH, 10);\n }\n if (event.attributes['PROGRAM-ID']) {\n event.attributes['PROGRAM-ID'] = parseInt(event.attributes['PROGRAM-ID'], 10);\n }\n }\n this.trigger('data', event);\n return;\n }\n match = /^#EXT-X-MEDIA:?(.*)$/.exec(line);\n if (match) {\n event = {\n type: 'tag',\n tagType: 'media'\n };\n if (match[1]) {\n event.attributes = parseAttributes(match[1]);\n }\n this.trigger('data', event);\n return;\n }\n match = /^#EXT-X-ENDLIST/.exec(line);\n if (match) {\n this.trigger('data', {\n type: 'tag',\n tagType: 'endlist'\n });\n return;\n }\n match = /^#EXT-X-DISCONTINUITY/.exec(line);\n if (match) {\n this.trigger('data', {\n type: 'tag',\n tagType: 'discontinuity'\n });\n return;\n }\n match = /^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(line);\n if (match) {\n event = {\n type: 'tag',\n tagType: 'program-date-time'\n };\n if (match[1]) {\n event.dateTimeString = match[1];\n event.dateTimeObject = new Date(match[1]);\n }\n this.trigger('data', event);\n return;\n }\n match = /^#EXT-X-KEY:?(.*)$/.exec(line);\n if (match) {\n event = {\n type: 'tag',\n tagType: 'key'\n };\n if (match[1]) {\n event.attributes = parseAttributes(match[1]);\n // parse the IV string into a Uint32Array\n if (event.attributes.IV) {\n if (event.attributes.IV.substring(0, 2).toLowerCase() === '0x') {\n event.attributes.IV = event.attributes.IV.substring(2);\n }\n\n event.attributes.IV = event.attributes.IV.match(/.{8}/g);\n event.attributes.IV[0] = parseInt(event.attributes.IV[0], 16);\n event.attributes.IV[1] = parseInt(event.attributes.IV[1], 16);\n event.attributes.IV[2] = parseInt(event.attributes.IV[2], 16);\n event.attributes.IV[3] = parseInt(event.attributes.IV[3], 16);\n event.attributes.IV = new Uint32Array(event.attributes.IV);\n }\n }\n this.trigger('data', event);\n return;\n }\n match = /^#EXT-X-START:?(.*)$/.exec(line);\n if (match) {\n event = {\n type: 'tag',\n tagType: 'start'\n };\n if (match[1]) {\n event.attributes = parseAttributes(match[1]);\n\n event.attributes['TIME-OFFSET'] = parseFloat(event.attributes['TIME-OFFSET']);\n event.attributes.PRECISE = /YES/.test(event.attributes.PRECISE);\n }\n this.trigger('data', event);\n return;\n }\n match = /^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(line);\n if (match) {\n event = {\n type: 'tag',\n tagType: 'cue-out-cont'\n };\n if (match[1]) {\n event.data = match[1];\n } else {\n event.data = '';\n }\n this.trigger('data', event);\n return;\n }\n match = /^#EXT-X-CUE-OUT:?(.*)?$/.exec(line);\n if (match) {\n event = {\n type: 'tag',\n tagType: 'cue-out'\n };\n if (match[1]) {\n event.data = match[1];\n } else {\n event.data = '';\n }\n this.trigger('data', event);\n return;\n }\n match = /^#EXT-X-CUE-IN:?(.*)?$/.exec(line);\n if (match) {\n event = {\n type: 'tag',\n tagType: 'cue-in'\n };\n if (match[1]) {\n event.data = match[1];\n } else {\n event.data = '';\n }\n this.trigger('data', event);\n return;\n }\n\n // unknown tag type\n this.trigger('data', {\n type: 'tag',\n data: line.slice(4)\n });\n };\n\n /**\n * Add a parser for custom headers\n *\n * @param {Object} options a map of options for the added parser\n * @param {RegExp} options.expression a regular expression to match the custom header\n * @param {string} options.customType the custom type to register to the output\n * @param {Function} [options.dataParser] function to parse the line into an object\n * @param {boolean} [options.segment] should tag data be attached to the segment object\n */\n\n\n ParseStream.prototype.addParser = function addParser(_ref) {\n var _this2 = this;\n\n var expression = _ref.expression,\n customType = _ref.customType,\n dataParser = _ref.dataParser,\n segment = _ref.segment;\n\n if (typeof dataParser !== 'function') {\n dataParser = function dataParser(line) {\n return line;\n };\n }\n this.customParsers.push(function (line) {\n var match = expression.exec(line);\n\n if (match) {\n _this2.trigger('data', {\n type: 'custom',\n data: dataParser(line),\n customType: customType,\n segment: segment\n });\n return true;\n }\n });\n };\n\n return ParseStream;\n}(Stream);\n\n/**\n * @file m3u8/parser.js\n */\n/**\n * A parser for M3U8 files. The current interpretation of the input is\n * exposed as a property `manifest` on parser objects. It's just two lines to\n * create and parse a manifest once you have the contents available as a string:\n *\n * ```js\n * var parser = new m3u8.Parser();\n * parser.push(xhr.responseText);\n * ```\n *\n * New input can later be applied to update the manifest object by calling\n * `push` again.\n *\n * The parser attempts to create a usable manifest object even if the\n * underlying input is somewhat nonsensical. It emits `info` and `warning`\n * events during the parse if it encounters input that seems invalid or\n * requires some property of the manifest object to be defaulted.\n *\n * @class Parser\n * @extends Stream\n */\n\nvar Parser = function (_Stream) {\n inherits(Parser, _Stream);\n\n function Parser() {\n classCallCheck(this, Parser);\n\n var _this = possibleConstructorReturn(this, _Stream.call(this));\n\n _this.lineStream = new LineStream();\n _this.parseStream = new ParseStream();\n _this.lineStream.pipe(_this.parseStream);\n\n /* eslint-disable consistent-this */\n var self = _this;\n /* eslint-enable consistent-this */\n var uris = [];\n var currentUri = {};\n // if specified, the active EXT-X-MAP definition\n var currentMap = void 0;\n // if specified, the active decryption key\n var _key = void 0;\n var noop = function noop() {};\n var defaultMediaGroups = {\n 'AUDIO': {},\n 'VIDEO': {},\n 'CLOSED-CAPTIONS': {},\n 'SUBTITLES': {}\n };\n // group segments into numbered timelines delineated by discontinuities\n var currentTimeline = 0;\n\n // the manifest is empty until the parse stream begins delivering data\n _this.manifest = {\n allowCache: true,\n discontinuityStarts: [],\n segments: []\n };\n\n // update the manifest with the m3u8 entry from the parse stream\n _this.parseStream.on('data', function (entry) {\n var mediaGroup = void 0;\n var rendition = void 0;\n\n ({\n tag: function tag() {\n // switch based on the tag type\n (({\n 'allow-cache': function allowCache() {\n this.manifest.allowCache = entry.allowed;\n if (!('allowed' in entry)) {\n this.trigger('info', {\n message: 'defaulting allowCache to YES'\n });\n this.manifest.allowCache = true;\n }\n },\n byterange: function byterange() {\n var byterange = {};\n\n if ('length' in entry) {\n currentUri.byterange = byterange;\n byterange.length = entry.length;\n\n if (!('offset' in entry)) {\n this.trigger('info', {\n message: 'defaulting offset to zero'\n });\n entry.offset = 0;\n }\n }\n if ('offset' in entry) {\n currentUri.byterange = byterange;\n byterange.offset = entry.offset;\n }\n },\n endlist: function endlist() {\n this.manifest.endList = true;\n },\n inf: function inf() {\n if (!('mediaSequence' in this.manifest)) {\n this.manifest.mediaSequence = 0;\n this.trigger('info', {\n message: 'defaulting media sequence to zero'\n });\n }\n if (!('discontinuitySequence' in this.manifest)) {\n this.manifest.discontinuitySequence = 0;\n this.trigger('info', {\n message: 'defaulting discontinuity sequence to zero'\n });\n }\n if (entry.duration > 0) {\n currentUri.duration = entry.duration;\n }\n\n if (entry.duration === 0) {\n currentUri.duration = 0.01;\n this.trigger('info', {\n message: 'updating zero segment duration to a small value'\n });\n }\n\n this.manifest.segments = uris;\n },\n key: function key() {\n if (!entry.attributes) {\n this.trigger('warn', {\n message: 'ignoring key declaration without attribute list'\n });\n return;\n }\n // clear the active encryption key\n if (entry.attributes.METHOD === 'NONE') {\n _key = null;\n return;\n }\n if (!entry.attributes.URI) {\n this.trigger('warn', {\n message: 'ignoring key declaration without URI'\n });\n return;\n }\n if (!entry.attributes.METHOD) {\n this.trigger('warn', {\n message: 'defaulting key method to AES-128'\n });\n }\n\n // setup an encryption key for upcoming segments\n _key = {\n method: entry.attributes.METHOD || 'AES-128',\n uri: entry.attributes.URI\n };\n\n if (typeof entry.attributes.IV !== 'undefined') {\n _key.iv = entry.attributes.IV;\n }\n },\n 'media-sequence': function mediaSequence() {\n if (!isFinite(entry.number)) {\n this.trigger('warn', {\n message: 'ignoring invalid media sequence: ' + entry.number\n });\n return;\n }\n this.manifest.mediaSequence = entry.number;\n },\n 'discontinuity-sequence': function discontinuitySequence() {\n if (!isFinite(entry.number)) {\n this.trigger('warn', {\n message: 'ignoring invalid discontinuity sequence: ' + entry.number\n });\n return;\n }\n this.manifest.discontinuitySequence = entry.number;\n currentTimeline = entry.number;\n },\n 'playlist-type': function playlistType() {\n if (!/VOD|EVENT/.test(entry.playlistType)) {\n this.trigger('warn', {\n message: 'ignoring unknown playlist type: ' + entry.playlist\n });\n return;\n }\n this.manifest.playlistType = entry.playlistType;\n },\n map: function map() {\n currentMap = {};\n if (entry.uri) {\n currentMap.uri = entry.uri;\n }\n if (entry.byterange) {\n currentMap.byterange = entry.byterange;\n }\n },\n 'stream-inf': function streamInf() {\n this.manifest.playlists = uris;\n this.manifest.mediaGroups = this.manifest.mediaGroups || defaultMediaGroups;\n\n if (!entry.attributes) {\n this.trigger('warn', {\n message: 'ignoring empty stream-inf attributes'\n });\n return;\n }\n\n if (!currentUri.attributes) {\n currentUri.attributes = {};\n }\n _extends(currentUri.attributes, entry.attributes);\n },\n media: function media() {\n this.manifest.mediaGroups = this.manifest.mediaGroups || defaultMediaGroups;\n\n if (!(entry.attributes && entry.attributes.TYPE && entry.attributes['GROUP-ID'] && entry.attributes.NAME)) {\n this.trigger('warn', {\n message: 'ignoring incomplete or missing media group'\n });\n return;\n }\n\n // find the media group, creating defaults as necessary\n var mediaGroupType = this.manifest.mediaGroups[entry.attributes.TYPE];\n\n mediaGroupType[entry.attributes['GROUP-ID']] = mediaGroupType[entry.attributes['GROUP-ID']] || {};\n mediaGroup = mediaGroupType[entry.attributes['GROUP-ID']];\n\n // collect the rendition metadata\n rendition = {\n 'default': /yes/i.test(entry.attributes.DEFAULT)\n };\n if (rendition['default']) {\n rendition.autoselect = true;\n } else {\n rendition.autoselect = /yes/i.test(entry.attributes.AUTOSELECT);\n }\n if (entry.attributes.LANGUAGE) {\n rendition.language = entry.attributes.LANGUAGE;\n }\n if (entry.attributes.URI) {\n rendition.uri = entry.attributes.URI;\n }\n if (entry.attributes['INSTREAM-ID']) {\n rendition.instreamId = entry.attributes['INSTREAM-ID'];\n }\n if (entry.attributes.CHARACTERISTICS) {\n rendition.characteristics = entry.attributes.CHARACTERISTICS;\n }\n if (entry.attributes.FORCED) {\n rendition.forced = /yes/i.test(entry.attributes.FORCED);\n }\n\n // insert the new rendition\n mediaGroup[entry.attributes.NAME] = rendition;\n },\n discontinuity: function discontinuity() {\n currentTimeline += 1;\n currentUri.discontinuity = true;\n this.manifest.discontinuityStarts.push(uris.length);\n },\n 'program-date-time': function programDateTime() {\n if (typeof this.manifest.dateTimeString === 'undefined') {\n // PROGRAM-DATE-TIME is a media-segment tag, but for backwards\n // compatibility, we add the first occurence of the PROGRAM-DATE-TIME tag\n // to the manifest object\n // TODO: Consider removing this in future major version\n this.manifest.dateTimeString = entry.dateTimeString;\n this.manifest.dateTimeObject = entry.dateTimeObject;\n }\n\n currentUri.dateTimeString = entry.dateTimeString;\n currentUri.dateTimeObject = entry.dateTimeObject;\n },\n targetduration: function targetduration() {\n if (!isFinite(entry.duration) || entry.duration < 0) {\n this.trigger('warn', {\n message: 'ignoring invalid target duration: ' + entry.duration\n });\n return;\n }\n this.manifest.targetDuration = entry.duration;\n },\n totalduration: function totalduration() {\n if (!isFinite(entry.duration) || entry.duration < 0) {\n this.trigger('warn', {\n message: 'ignoring invalid total duration: ' + entry.duration\n });\n return;\n }\n this.manifest.totalDuration = entry.duration;\n },\n start: function start() {\n if (!entry.attributes || isNaN(entry.attributes['TIME-OFFSET'])) {\n this.trigger('warn', {\n message: 'ignoring start declaration without appropriate attribute list'\n });\n return;\n }\n this.manifest.start = {\n timeOffset: entry.attributes['TIME-OFFSET'],\n precise: entry.attributes.PRECISE\n };\n },\n 'cue-out': function cueOut() {\n currentUri.cueOut = entry.data;\n },\n 'cue-out-cont': function cueOutCont() {\n currentUri.cueOutCont = entry.data;\n },\n 'cue-in': function cueIn() {\n currentUri.cueIn = entry.data;\n }\n })[entry.tagType] || noop).call(self);\n },\n uri: function uri() {\n currentUri.uri = entry.uri;\n uris.push(currentUri);\n\n // if no explicit duration was declared, use the target duration\n if (this.manifest.targetDuration && !('duration' in currentUri)) {\n this.trigger('warn', {\n message: 'defaulting segment duration to the target duration'\n });\n currentUri.duration = this.manifest.targetDuration;\n }\n // annotate with encryption information, if necessary\n if (_key) {\n currentUri.key = _key;\n }\n currentUri.timeline = currentTimeline;\n // annotate with initialization segment information, if necessary\n if (currentMap) {\n currentUri.map = currentMap;\n }\n\n // prepare for the next URI\n currentUri = {};\n },\n comment: function comment() {\n // comments are not important for playback\n },\n custom: function custom() {\n // if this is segment-level data attach the output to the segment\n if (entry.segment) {\n currentUri.custom = currentUri.custom || {};\n currentUri.custom[entry.customType] = entry.data;\n // if this is manifest-level data attach to the top level manifest object\n } else {\n this.manifest.custom = this.manifest.custom || {};\n this.manifest.custom[entry.customType] = entry.data;\n }\n }\n })[entry.type].call(self);\n });\n return _this;\n }\n\n /**\n * Parse the input string and update the manifest object.\n *\n * @param {String} chunk a potentially incomplete portion of the manifest\n */\n\n\n Parser.prototype.push = function push(chunk) {\n this.lineStream.push(chunk);\n };\n\n /**\n * Flush any remaining input. This can be handy if the last line of an M3U8\n * manifest did not contain a trailing newline but the file has been\n * completely received.\n */\n\n\n Parser.prototype.end = function end() {\n // flush any buffered input\n this.lineStream.push('\\n');\n };\n /**\n * Add an additional parser for non-standard tags\n *\n * @param {Object} options a map of options for the added parser\n * @param {RegExp} options.expression a regular expression to match the custom header\n * @param {string} options.type the type to register to the output\n * @param {Function} [options.dataParser] function to parse the line into an object\n * @param {boolean} [options.segment] should tag data be attached to the segment object\n */\n\n\n Parser.prototype.addParser = function addParser(options) {\n this.parseStream.addParser(options);\n };\n\n return Parser;\n}(Stream);\n\n/**\n * @file m3u8/index.js\n *\n * Utilities for parsing M3U8 files. If the entire manifest is available,\n * `Parser` will create an object representation with enough detail for managing\n * playback. `ParseStream` and `LineStream` are lower-level parsing primitives\n * that do not assume the entirety of the manifest is ready and expose a\n * ReadableStream-like interface.\n */\n\nexport { LineStream, ParseStream, Parser };\n","/*! @name mpd-parser @version 0.7.0 @license Apache-2.0 */\nimport window$1 from 'global/window';\n\nvar version = \"0.7.0\";\n\nvar isObject = function isObject(obj) {\n return !!obj && typeof obj === 'object';\n};\n\nvar merge = function merge() {\n for (var _len = arguments.length, objects = new Array(_len), _key = 0; _key < _len; _key++) {\n objects[_key] = arguments[_key];\n }\n\n return objects.reduce(function (result, source) {\n Object.keys(source).forEach(function (key) {\n if (Array.isArray(result[key]) && Array.isArray(source[key])) {\n result[key] = result[key].concat(source[key]);\n } else if (isObject(result[key]) && isObject(source[key])) {\n result[key] = merge(result[key], source[key]);\n } else {\n result[key] = source[key];\n }\n });\n return result;\n }, {});\n};\nvar values = function values(o) {\n return Object.keys(o).map(function (k) {\n return o[k];\n });\n};\n\nvar range = function range(start, end) {\n var result = [];\n\n for (var i = start; i < end; i++) {\n result.push(i);\n }\n\n return result;\n};\nvar flatten = function flatten(lists) {\n return lists.reduce(function (x, y) {\n return x.concat(y);\n }, []);\n};\nvar from = function from(list) {\n if (!list.length) {\n return [];\n }\n\n var result = [];\n\n for (var i = 0; i < list.length; i++) {\n result.push(list[i]);\n }\n\n return result;\n};\nvar findIndexes = function findIndexes(l, key) {\n return l.reduce(function (a, e, i) {\n if (e[key]) {\n a.push(i);\n }\n\n return a;\n }, []);\n};\n\nvar mergeDiscontiguousPlaylists = function mergeDiscontiguousPlaylists(playlists) {\n var mergedPlaylists = values(playlists.reduce(function (acc, playlist) {\n // assuming playlist IDs are the same across periods\n // TODO: handle multiperiod where representation sets are not the same\n // across periods\n var name = playlist.attributes.id + (playlist.attributes.lang || ''); // Periods after first\n\n if (acc[name]) {\n var _acc$name$segments;\n\n // first segment of subsequent periods signal a discontinuity\n playlist.segments[0].discontinuity = true;\n\n (_acc$name$segments = acc[name].segments).push.apply(_acc$name$segments, playlist.segments); // bubble up contentProtection, this assumes all DRM content\n // has the same contentProtection\n\n\n if (playlist.attributes.contentProtection) {\n acc[name].attributes.contentProtection = playlist.attributes.contentProtection;\n }\n } else {\n // first Period\n acc[name] = playlist;\n }\n\n return acc;\n }, {}));\n return mergedPlaylists.map(function (playlist) {\n playlist.discontinuityStarts = findIndexes(playlist.segments, 'discontinuity');\n return playlist;\n });\n};\n\nvar formatAudioPlaylist = function formatAudioPlaylist(_ref) {\n var _attributes;\n\n var attributes = _ref.attributes,\n segments = _ref.segments;\n var playlist = {\n attributes: (_attributes = {\n NAME: attributes.id,\n BANDWIDTH: attributes.bandwidth,\n CODECS: attributes.codecs\n }, _attributes['PROGRAM-ID'] = 1, _attributes),\n uri: '',\n endList: (attributes.type || 'static') === 'static',\n timeline: attributes.periodIndex,\n resolvedUri: '',\n targetDuration: attributes.duration,\n segments: segments,\n mediaSequence: segments.length ? segments[0].number : 1\n };\n\n if (attributes.contentProtection) {\n playlist.contentProtection = attributes.contentProtection;\n }\n\n return playlist;\n};\nvar formatVttPlaylist = function formatVttPlaylist(_ref2) {\n var _attributes2;\n\n var attributes = _ref2.attributes,\n segments = _ref2.segments;\n\n if (typeof segments === 'undefined') {\n // vtt tracks may use single file in BaseURL\n segments = [{\n uri: attributes.baseUrl,\n timeline: attributes.periodIndex,\n resolvedUri: attributes.baseUrl || '',\n duration: attributes.sourceDuration,\n number: 0\n }]; // targetDuration should be the same duration as the only segment\n\n attributes.duration = attributes.sourceDuration;\n }\n\n return {\n attributes: (_attributes2 = {\n NAME: attributes.id,\n BANDWIDTH: attributes.bandwidth\n }, _attributes2['PROGRAM-ID'] = 1, _attributes2),\n uri: '',\n endList: (attributes.type || 'static') === 'static',\n timeline: attributes.periodIndex,\n resolvedUri: attributes.baseUrl || '',\n targetDuration: attributes.duration,\n segments: segments,\n mediaSequence: segments.length ? segments[0].number : 1\n };\n};\nvar organizeAudioPlaylists = function organizeAudioPlaylists(playlists) {\n return playlists.reduce(function (a, playlist) {\n var role = playlist.attributes.role && playlist.attributes.role.value || 'main';\n var language = playlist.attributes.lang || '';\n var label = 'main';\n\n if (language) {\n label = playlist.attributes.lang + \" (\" + role + \")\";\n } // skip if we already have the highest quality audio for a language\n\n\n if (a[label] && a[label].playlists[0].attributes.BANDWIDTH > playlist.attributes.bandwidth) {\n return a;\n }\n\n a[label] = {\n language: language,\n autoselect: true,\n default: role === 'main',\n playlists: [formatAudioPlaylist(playlist)],\n uri: ''\n };\n return a;\n }, {});\n};\nvar organizeVttPlaylists = function organizeVttPlaylists(playlists) {\n return playlists.reduce(function (a, playlist) {\n var label = playlist.attributes.lang || 'text'; // skip if we already have subtitles\n\n if (a[label]) {\n return a;\n }\n\n a[label] = {\n language: label,\n default: false,\n autoselect: false,\n playlists: [formatVttPlaylist(playlist)],\n uri: ''\n };\n return a;\n }, {});\n};\nvar formatVideoPlaylist = function formatVideoPlaylist(_ref3) {\n var _attributes3;\n\n var attributes = _ref3.attributes,\n segments = _ref3.segments;\n var playlist = {\n attributes: (_attributes3 = {\n NAME: attributes.id,\n AUDIO: 'audio',\n SUBTITLES: 'subs',\n RESOLUTION: {\n width: attributes.width,\n height: attributes.height\n },\n CODECS: attributes.codecs,\n BANDWIDTH: attributes.bandwidth\n }, _attributes3['PROGRAM-ID'] = 1, _attributes3),\n uri: '',\n endList: (attributes.type || 'static') === 'static',\n timeline: attributes.periodIndex,\n resolvedUri: '',\n targetDuration: attributes.duration,\n segments: segments,\n mediaSequence: segments.length ? segments[0].number : 1\n };\n\n if (attributes.contentProtection) {\n playlist.contentProtection = attributes.contentProtection;\n }\n\n return playlist;\n};\nvar toM3u8 = function toM3u8(dashPlaylists) {\n var _mediaGroups;\n\n if (!dashPlaylists.length) {\n return {};\n } // grab all master attributes\n\n\n var _dashPlaylists$0$attr = dashPlaylists[0].attributes,\n duration = _dashPlaylists$0$attr.sourceDuration,\n _dashPlaylists$0$attr2 = _dashPlaylists$0$attr.minimumUpdatePeriod,\n minimumUpdatePeriod = _dashPlaylists$0$attr2 === void 0 ? 0 : _dashPlaylists$0$attr2;\n\n var videoOnly = function videoOnly(_ref4) {\n var attributes = _ref4.attributes;\n return attributes.mimeType === 'video/mp4' || attributes.contentType === 'video';\n };\n\n var audioOnly = function audioOnly(_ref5) {\n var attributes = _ref5.attributes;\n return attributes.mimeType === 'audio/mp4' || attributes.contentType === 'audio';\n };\n\n var vttOnly = function vttOnly(_ref6) {\n var attributes = _ref6.attributes;\n return attributes.mimeType === 'text/vtt' || attributes.contentType === 'text';\n };\n\n var videoPlaylists = mergeDiscontiguousPlaylists(dashPlaylists.filter(videoOnly)).map(formatVideoPlaylist);\n var audioPlaylists = mergeDiscontiguousPlaylists(dashPlaylists.filter(audioOnly));\n var vttPlaylists = dashPlaylists.filter(vttOnly);\n var master = {\n allowCache: true,\n discontinuityStarts: [],\n segments: [],\n endList: true,\n mediaGroups: (_mediaGroups = {\n AUDIO: {},\n VIDEO: {}\n }, _mediaGroups['CLOSED-CAPTIONS'] = {}, _mediaGroups.SUBTITLES = {}, _mediaGroups),\n uri: '',\n duration: duration,\n playlists: videoPlaylists,\n minimumUpdatePeriod: minimumUpdatePeriod * 1000\n };\n\n if (audioPlaylists.length) {\n master.mediaGroups.AUDIO.audio = organizeAudioPlaylists(audioPlaylists);\n }\n\n if (vttPlaylists.length) {\n master.mediaGroups.SUBTITLES.subs = organizeVttPlaylists(vttPlaylists);\n }\n\n return master;\n};\n\nvar commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nfunction createCommonjsModule(fn, module) {\n\treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n}\n\nvar urlToolkit = createCommonjsModule(function (module, exports) {\n// see https://tools.ietf.org/html/rfc1808\n\n/* jshint ignore:start */\n(function(root) { \n/* jshint ignore:end */\n\n var URL_REGEX = /^((?:[a-zA-Z0-9+\\-.]+:)?)(\\/\\/[^\\/?#]*)?((?:[^\\/\\?#]*\\/)*.*?)??(;.*?)?(\\?.*?)?(#.*?)?$/;\n var FIRST_SEGMENT_REGEX = /^([^\\/?#]*)(.*)$/;\n var SLASH_DOT_REGEX = /(?:\\/|^)\\.(?=\\/)/g;\n var SLASH_DOT_DOT_REGEX = /(?:\\/|^)\\.\\.\\/(?!\\.\\.\\/).*?(?=\\/)/g;\n\n var URLToolkit = { // jshint ignore:line\n // If opts.alwaysNormalize is true then the path will always be normalized even when it starts with / or //\n // E.g\n // With opts.alwaysNormalize = false (default, spec compliant)\n // http://a.com/b/cd + /e/f/../g => http://a.com/e/f/../g\n // With opts.alwaysNormalize = true (not spec compliant)\n // http://a.com/b/cd + /e/f/../g => http://a.com/e/g\n buildAbsoluteURL: function(baseURL, relativeURL, opts) {\n opts = opts || {};\n // remove any remaining space and CRLF\n baseURL = baseURL.trim();\n relativeURL = relativeURL.trim();\n if (!relativeURL) {\n // 2a) If the embedded URL is entirely empty, it inherits the\n // entire base URL (i.e., is set equal to the base URL)\n // and we are done.\n if (!opts.alwaysNormalize) {\n return baseURL;\n }\n var basePartsForNormalise = URLToolkit.parseURL(baseURL);\n if (!basePartsForNormalise) {\n throw new Error('Error trying to parse base URL.');\n }\n basePartsForNormalise.path = URLToolkit.normalizePath(basePartsForNormalise.path);\n return URLToolkit.buildURLFromParts(basePartsForNormalise);\n }\n var relativeParts = URLToolkit.parseURL(relativeURL);\n if (!relativeParts) {\n throw new Error('Error trying to parse relative URL.');\n }\n if (relativeParts.scheme) {\n // 2b) If the embedded URL starts with a scheme name, it is\n // interpreted as an absolute URL and we are done.\n if (!opts.alwaysNormalize) {\n return relativeURL;\n }\n relativeParts.path = URLToolkit.normalizePath(relativeParts.path);\n return URLToolkit.buildURLFromParts(relativeParts);\n }\n var baseParts = URLToolkit.parseURL(baseURL);\n if (!baseParts) {\n throw new Error('Error trying to parse base URL.');\n }\n if (!baseParts.netLoc && baseParts.path && baseParts.path[0] !== '/') {\n // If netLoc missing and path doesn't start with '/', assume everthing before the first '/' is the netLoc\n // This causes 'example.com/a' to be handled as '//example.com/a' instead of '/example.com/a'\n var pathParts = FIRST_SEGMENT_REGEX.exec(baseParts.path);\n baseParts.netLoc = pathParts[1];\n baseParts.path = pathParts[2];\n }\n if (baseParts.netLoc && !baseParts.path) {\n baseParts.path = '/';\n }\n var builtParts = {\n // 2c) Otherwise, the embedded URL inherits the scheme of\n // the base URL.\n scheme: baseParts.scheme,\n netLoc: relativeParts.netLoc,\n path: null,\n params: relativeParts.params,\n query: relativeParts.query,\n fragment: relativeParts.fragment\n };\n if (!relativeParts.netLoc) {\n // 3) If the embedded URL's <net_loc> is non-empty, we skip to\n // Step 7. Otherwise, the embedded URL inherits the <net_loc>\n // (if any) of the base URL.\n builtParts.netLoc = baseParts.netLoc;\n // 4) If the embedded URL path is preceded by a slash \"/\", the\n // path is not relative and we skip to Step 7.\n if (relativeParts.path[0] !== '/') {\n if (!relativeParts.path) {\n // 5) If the embedded URL path is empty (and not preceded by a\n // slash), then the embedded URL inherits the base URL path\n builtParts.path = baseParts.path;\n // 5a) if the embedded URL's <params> is non-empty, we skip to\n // step 7; otherwise, it inherits the <params> of the base\n // URL (if any) and\n if (!relativeParts.params) {\n builtParts.params = baseParts.params;\n // 5b) if the embedded URL's <query> is non-empty, we skip to\n // step 7; otherwise, it inherits the <query> of the base\n // URL (if any) and we skip to step 7.\n if (!relativeParts.query) {\n builtParts.query = baseParts.query;\n }\n }\n } else {\n // 6) The last segment of the base URL's path (anything\n // following the rightmost slash \"/\", or the entire path if no\n // slash is present) is removed and the embedded URL's path is\n // appended in its place.\n var baseURLPath = baseParts.path;\n var newPath = baseURLPath.substring(0, baseURLPath.lastIndexOf('/') + 1) + relativeParts.path;\n builtParts.path = URLToolkit.normalizePath(newPath);\n }\n }\n }\n if (builtParts.path === null) {\n builtParts.path = opts.alwaysNormalize ? URLToolkit.normalizePath(relativeParts.path) : relativeParts.path;\n }\n return URLToolkit.buildURLFromParts(builtParts);\n },\n parseURL: function(url) {\n var parts = URL_REGEX.exec(url);\n if (!parts) {\n return null;\n }\n return {\n scheme: parts[1] || '',\n netLoc: parts[2] || '',\n path: parts[3] || '',\n params: parts[4] || '',\n query: parts[5] || '',\n fragment: parts[6] || ''\n };\n },\n normalizePath: function(path) {\n // The following operations are\n // then applied, in order, to the new path:\n // 6a) All occurrences of \"./\", where \".\" is a complete path\n // segment, are removed.\n // 6b) If the path ends with \".\" as a complete path segment,\n // that \".\" is removed.\n path = path.split('').reverse().join('').replace(SLASH_DOT_REGEX, '');\n // 6c) All occurrences of \"<segment>/../\", where <segment> is a\n // complete path segment not equal to \"..\", are removed.\n // Removal of these path segments is performed iteratively,\n // removing the leftmost matching pattern on each iteration,\n // until no matching pattern remains.\n // 6d) If the path ends with \"<segment>/..\", where <segment> is a\n // complete path segment not equal to \"..\", that\n // \"<segment>/..\" is removed.\n while (path.length !== (path = path.replace(SLASH_DOT_DOT_REGEX, '')).length) {} // jshint ignore:line\n return path.split('').reverse().join('');\n },\n buildURLFromParts: function(parts) {\n return parts.scheme + parts.netLoc + parts.path + parts.params + parts.query + parts.fragment;\n }\n };\n\n/* jshint ignore:start */\n module.exports = URLToolkit;\n})(commonjsGlobal);\n/* jshint ignore:end */\n});\n\nvar resolveUrl = function resolveUrl(baseUrl, relativeUrl) {\n // return early if we don't need to resolve\n if (/^[a-z]+:/i.test(relativeUrl)) {\n return relativeUrl;\n } // if the base URL is relative then combine with the current location\n\n\n if (!/\\/\\//i.test(baseUrl)) {\n baseUrl = urlToolkit.buildAbsoluteURL(window$1.location.href, baseUrl);\n }\n\n return urlToolkit.buildAbsoluteURL(baseUrl, relativeUrl);\n};\n\n/**\n * @typedef {Object} SingleUri\n * @property {string} uri - relative location of segment\n * @property {string} resolvedUri - resolved location of segment\n * @property {Object} byterange - Object containing information on how to make byte range\n * requests following byte-range-spec per RFC2616.\n * @property {String} byterange.length - length of range request\n * @property {String} byterange.offset - byte offset of range request\n *\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.1\n */\n\n/**\n * Converts a URLType node (5.3.9.2.3 Table 13) to a segment object\n * that conforms to how m3u8-parser is structured\n *\n * @see https://github.com/videojs/m3u8-parser\n *\n * @param {string} baseUrl - baseUrl provided by <BaseUrl> nodes\n * @param {string} source - source url for segment\n * @param {string} range - optional range used for range calls, follows\n * @return {SingleUri} full segment information transformed into a format similar\n * to m3u8-parser\n */\n\nvar urlTypeToSegment = function urlTypeToSegment(_ref) {\n var _ref$baseUrl = _ref.baseUrl,\n baseUrl = _ref$baseUrl === void 0 ? '' : _ref$baseUrl,\n _ref$source = _ref.source,\n source = _ref$source === void 0 ? '' : _ref$source,\n _ref$range = _ref.range,\n range = _ref$range === void 0 ? '' : _ref$range;\n var init = {\n uri: source,\n resolvedUri: resolveUrl(baseUrl || '', source)\n };\n\n if (range) {\n var ranges = range.split('-');\n var startRange = parseInt(ranges[0], 10);\n var endRange = parseInt(ranges[1], 10);\n init.byterange = {\n length: endRange - startRange,\n offset: startRange\n };\n }\n\n return init;\n};\n\n/**\n * Calculates the R (repetition) value for a live stream (for the final segment\n * in a manifest where the r value is negative 1)\n *\n * @param {Object} attributes\n * Object containing all inherited attributes from parent elements with attribute\n * names as keys\n * @param {number} time\n * current time (typically the total time up until the final segment)\n * @param {number} duration\n * duration property for the given <S />\n *\n * @return {number}\n * R value to reach the end of the given period\n */\nvar getLiveRValue = function getLiveRValue(attributes, time, duration) {\n var NOW = attributes.NOW,\n clientOffset = attributes.clientOffset,\n availabilityStartTime = attributes.availabilityStartTime,\n _attributes$timescale = attributes.timescale,\n timescale = _attributes$timescale === void 0 ? 1 : _attributes$timescale,\n _attributes$start = attributes.start,\n start = _attributes$start === void 0 ? 0 : _attributes$start,\n _attributes$minimumUp = attributes.minimumUpdatePeriod,\n minimumUpdatePeriod = _attributes$minimumUp === void 0 ? 0 : _attributes$minimumUp;\n var now = (NOW + clientOffset) / 1000;\n var periodStartWC = availabilityStartTime + start;\n var periodEndWC = now + minimumUpdatePeriod;\n var periodDuration = periodEndWC - periodStartWC;\n return Math.ceil((periodDuration * timescale - time) / duration);\n};\n/**\n * Uses information provided by SegmentTemplate.SegmentTimeline to determine segment\n * timing and duration\n *\n * @param {Object} attributes\n * Object containing all inherited attributes from parent elements with attribute\n * names as keys\n * @param {Object[]} segmentTimeline\n * List of objects representing the attributes of each S element contained within\n *\n * @return {{number: number, duration: number, time: number, timeline: number}[]}\n * List of Objects with segment timing and duration info\n */\n\n\nvar parseByTimeline = function parseByTimeline(attributes, segmentTimeline) {\n var _attributes$type = attributes.type,\n type = _attributes$type === void 0 ? 'static' : _attributes$type,\n _attributes$minimumUp2 = attributes.minimumUpdatePeriod,\n minimumUpdatePeriod = _attributes$minimumUp2 === void 0 ? 0 : _attributes$minimumUp2,\n _attributes$media = attributes.media,\n media = _attributes$media === void 0 ? '' : _attributes$media,\n sourceDuration = attributes.sourceDuration,\n _attributes$timescale2 = attributes.timescale,\n timescale = _attributes$timescale2 === void 0 ? 1 : _attributes$timescale2,\n _attributes$startNumb = attributes.startNumber,\n startNumber = _attributes$startNumb === void 0 ? 1 : _attributes$startNumb,\n timeline = attributes.periodIndex;\n var segments = [];\n var time = -1;\n\n for (var sIndex = 0; sIndex < segmentTimeline.length; sIndex++) {\n var S = segmentTimeline[sIndex];\n var duration = S.d;\n var repeat = S.r || 0;\n var segmentTime = S.t || 0;\n\n if (time < 0) {\n // first segment\n time = segmentTime;\n }\n\n if (segmentTime && segmentTime > time) {\n // discontinuity\n // TODO: How to handle this type of discontinuity\n // timeline++ here would treat it like HLS discontuity and content would\n // get appended without gap\n // E.G.\n // <S t=\"0\" d=\"1\" />\n // <S d=\"1\" />\n // <S d=\"1\" />\n // <S t=\"5\" d=\"1\" />\n // would have $Time$ values of [0, 1, 2, 5]\n // should this be appened at time positions [0, 1, 2, 3],(#EXT-X-DISCONTINUITY)\n // or [0, 1, 2, gap, gap, 5]? (#EXT-X-GAP)\n // does the value of sourceDuration consider this when calculating arbitrary\n // negative @r repeat value?\n // E.G. Same elements as above with this added at the end\n // <S d=\"1\" r=\"-1\" />\n // with a sourceDuration of 10\n // Would the 2 gaps be included in the time duration calculations resulting in\n // 8 segments with $Time$ values of [0, 1, 2, 5, 6, 7, 8, 9] or 10 segments\n // with $Time$ values of [0, 1, 2, 5, 6, 7, 8, 9, 10, 11] ?\n time = segmentTime;\n }\n\n var count = void 0;\n\n if (repeat < 0) {\n var nextS = sIndex + 1;\n\n if (nextS === segmentTimeline.length) {\n // last segment\n if (type === 'dynamic' && minimumUpdatePeriod > 0 && media.indexOf('$Number$') > 0) {\n count = getLiveRValue(attributes, time, duration);\n } else {\n // TODO: This may be incorrect depending on conclusion of TODO above\n count = (sourceDuration * timescale - time) / duration;\n }\n } else {\n count = (segmentTimeline[nextS].t - time) / duration;\n }\n } else {\n count = repeat + 1;\n }\n\n var end = startNumber + segments.length + count;\n var number = startNumber + segments.length;\n\n while (number < end) {\n segments.push({\n number: number,\n duration: duration / timescale,\n time: time,\n timeline: timeline\n });\n time += duration;\n number++;\n }\n }\n\n return segments;\n};\n\n/**\n * Functions for calculating the range of available segments in static and dynamic\n * manifests.\n */\n\nvar segmentRange = {\n /**\n * Returns the entire range of available segments for a static MPD\n *\n * @param {Object} attributes\n * Inheritied MPD attributes\n * @return {{ start: number, end: number }}\n * The start and end numbers for available segments\n */\n static: function _static(attributes) {\n var duration = attributes.duration,\n _attributes$timescale = attributes.timescale,\n timescale = _attributes$timescale === void 0 ? 1 : _attributes$timescale,\n sourceDuration = attributes.sourceDuration;\n return {\n start: 0,\n end: Math.ceil(sourceDuration / (duration / timescale))\n };\n },\n\n /**\n * Returns the current live window range of available segments for a dynamic MPD\n *\n * @param {Object} attributes\n * Inheritied MPD attributes\n * @return {{ start: number, end: number }}\n * The start and end numbers for available segments\n */\n dynamic: function dynamic(attributes) {\n var NOW = attributes.NOW,\n clientOffset = attributes.clientOffset,\n availabilityStartTime = attributes.availabilityStartTime,\n _attributes$timescale2 = attributes.timescale,\n timescale = _attributes$timescale2 === void 0 ? 1 : _attributes$timescale2,\n duration = attributes.duration,\n _attributes$start = attributes.start,\n start = _attributes$start === void 0 ? 0 : _attributes$start,\n _attributes$minimumUp = attributes.minimumUpdatePeriod,\n minimumUpdatePeriod = _attributes$minimumUp === void 0 ? 0 : _attributes$minimumUp,\n _attributes$timeShift = attributes.timeShiftBufferDepth,\n timeShiftBufferDepth = _attributes$timeShift === void 0 ? Infinity : _attributes$timeShift;\n var now = (NOW + clientOffset) / 1000;\n var periodStartWC = availabilityStartTime + start;\n var periodEndWC = now + minimumUpdatePeriod;\n var periodDuration = periodEndWC - periodStartWC;\n var segmentCount = Math.ceil(periodDuration * timescale / duration);\n var availableStart = Math.floor((now - periodStartWC - timeShiftBufferDepth) * timescale / duration);\n var availableEnd = Math.floor((now - periodStartWC) * timescale / duration);\n return {\n start: Math.max(0, availableStart),\n end: Math.min(segmentCount, availableEnd)\n };\n }\n};\n/**\n * Maps a range of numbers to objects with information needed to build the corresponding\n * segment list\n *\n * @name toSegmentsCallback\n * @function\n * @param {number} number\n * Number of the segment\n * @param {number} index\n * Index of the number in the range list\n * @return {{ number: Number, duration: Number, timeline: Number, time: Number }}\n * Object with segment timing and duration info\n */\n\n/**\n * Returns a callback for Array.prototype.map for mapping a range of numbers to\n * information needed to build the segment list.\n *\n * @param {Object} attributes\n * Inherited MPD attributes\n * @return {toSegmentsCallback}\n * Callback map function\n */\n\nvar toSegments = function toSegments(attributes) {\n return function (number, index) {\n var duration = attributes.duration,\n _attributes$timescale3 = attributes.timescale,\n timescale = _attributes$timescale3 === void 0 ? 1 : _attributes$timescale3,\n periodIndex = attributes.periodIndex,\n _attributes$startNumb = attributes.startNumber,\n startNumber = _attributes$startNumb === void 0 ? 1 : _attributes$startNumb;\n return {\n number: startNumber + number,\n duration: duration / timescale,\n timeline: periodIndex,\n time: index * duration\n };\n };\n};\n/**\n * Returns a list of objects containing segment timing and duration info used for\n * building the list of segments. This uses the @duration attribute specified\n * in the MPD manifest to derive the range of segments.\n *\n * @param {Object} attributes\n * Inherited MPD attributes\n * @return {{number: number, duration: number, time: number, timeline: number}[]}\n * List of Objects with segment timing and duration info\n */\n\nvar parseByDuration = function parseByDuration(attributes) {\n var _attributes$type = attributes.type,\n type = _attributes$type === void 0 ? 'static' : _attributes$type,\n duration = attributes.duration,\n _attributes$timescale4 = attributes.timescale,\n timescale = _attributes$timescale4 === void 0 ? 1 : _attributes$timescale4,\n sourceDuration = attributes.sourceDuration;\n\n var _segmentRange$type = segmentRange[type](attributes),\n start = _segmentRange$type.start,\n end = _segmentRange$type.end;\n\n var segments = range(start, end).map(toSegments(attributes));\n\n if (type === 'static') {\n var index = segments.length - 1; // final segment may be less than full segment duration\n\n segments[index].duration = sourceDuration - duration / timescale * index;\n }\n\n return segments;\n};\n\nvar identifierPattern = /\\$([A-z]*)(?:(%0)([0-9]+)d)?\\$/g;\n/**\n * Replaces template identifiers with corresponding values. To be used as the callback\n * for String.prototype.replace\n *\n * @name replaceCallback\n * @function\n * @param {string} match\n * Entire match of identifier\n * @param {string} identifier\n * Name of matched identifier\n * @param {string} format\n * Format tag string. Its presence indicates that padding is expected\n * @param {string} width\n * Desired length of the replaced value. Values less than this width shall be left\n * zero padded\n * @return {string}\n * Replacement for the matched identifier\n */\n\n/**\n * Returns a function to be used as a callback for String.prototype.replace to replace\n * template identifiers\n *\n * @param {Obect} values\n * Object containing values that shall be used to replace known identifiers\n * @param {number} values.RepresentationID\n * Value of the Representation@id attribute\n * @param {number} values.Number\n * Number of the corresponding segment\n * @param {number} values.Bandwidth\n * Value of the Representation@bandwidth attribute.\n * @param {number} values.Time\n * Timestamp value of the corresponding segment\n * @return {replaceCallback}\n * Callback to be used with String.prototype.replace to replace identifiers\n */\n\nvar identifierReplacement = function identifierReplacement(values) {\n return function (match, identifier, format, width) {\n if (match === '$$') {\n // escape sequence\n return '$';\n }\n\n if (typeof values[identifier] === 'undefined') {\n return match;\n }\n\n var value = '' + values[identifier];\n\n if (identifier === 'RepresentationID') {\n // Format tag shall not be present with RepresentationID\n return value;\n }\n\n if (!format) {\n width = 1;\n } else {\n width = parseInt(width, 10);\n }\n\n if (value.length >= width) {\n return value;\n }\n\n return \"\" + new Array(width - value.length + 1).join('0') + value;\n };\n};\n/**\n * Constructs a segment url from a template string\n *\n * @param {string} url\n * Template string to construct url from\n * @param {Obect} values\n * Object containing values that shall be used to replace known identifiers\n * @param {number} values.RepresentationID\n * Value of the Representation@id attribute\n * @param {number} values.Number\n * Number of the corresponding segment\n * @param {number} values.Bandwidth\n * Value of the Representation@bandwidth attribute.\n * @param {number} values.Time\n * Timestamp value of the corresponding segment\n * @return {string}\n * Segment url with identifiers replaced\n */\n\nvar constructTemplateUrl = function constructTemplateUrl(url, values) {\n return url.replace(identifierPattern, identifierReplacement(values));\n};\n/**\n * Generates a list of objects containing timing and duration information about each\n * segment needed to generate segment uris and the complete segment object\n *\n * @param {Object} attributes\n * Object containing all inherited attributes from parent elements with attribute\n * names as keys\n * @param {Object[]|undefined} segmentTimeline\n * List of objects representing the attributes of each S element contained within\n * the SegmentTimeline element\n * @return {{number: number, duration: number, time: number, timeline: number}[]}\n * List of Objects with segment timing and duration info\n */\n\nvar parseTemplateInfo = function parseTemplateInfo(attributes, segmentTimeline) {\n if (!attributes.duration && !segmentTimeline) {\n // if neither @duration or SegmentTimeline are present, then there shall be exactly\n // one media segment\n return [{\n number: attributes.startNumber || 1,\n duration: attributes.sourceDuration,\n time: 0,\n timeline: attributes.periodIndex\n }];\n }\n\n if (attributes.duration) {\n return parseByDuration(attributes);\n }\n\n return parseByTimeline(attributes, segmentTimeline);\n};\n/**\n * Generates a list of segments using information provided by the SegmentTemplate element\n *\n * @param {Object} attributes\n * Object containing all inherited attributes from parent elements with attribute\n * names as keys\n * @param {Object[]|undefined} segmentTimeline\n * List of objects representing the attributes of each S element contained within\n * the SegmentTimeline element\n * @return {Object[]}\n * List of segment objects\n */\n\nvar segmentsFromTemplate = function segmentsFromTemplate(attributes, segmentTimeline) {\n var templateValues = {\n RepresentationID: attributes.id,\n Bandwidth: attributes.bandwidth || 0\n };\n var _attributes$initializ = attributes.initialization,\n initialization = _attributes$initializ === void 0 ? {\n sourceURL: '',\n range: ''\n } : _attributes$initializ;\n var mapSegment = urlTypeToSegment({\n baseUrl: attributes.baseUrl,\n source: constructTemplateUrl(initialization.sourceURL, templateValues),\n range: initialization.range\n });\n var segments = parseTemplateInfo(attributes, segmentTimeline);\n return segments.map(function (segment) {\n templateValues.Number = segment.number;\n templateValues.Time = segment.time;\n var uri = constructTemplateUrl(attributes.media || '', templateValues);\n return {\n uri: uri,\n timeline: segment.timeline,\n duration: segment.duration,\n resolvedUri: resolveUrl(attributes.baseUrl || '', uri),\n map: mapSegment,\n number: segment.number\n };\n });\n};\n\nvar errors = {\n INVALID_NUMBER_OF_PERIOD: 'INVALID_NUMBER_OF_PERIOD',\n DASH_EMPTY_MANIFEST: 'DASH_EMPTY_MANIFEST',\n DASH_INVALID_XML: 'DASH_INVALID_XML',\n NO_BASE_URL: 'NO_BASE_URL',\n MISSING_SEGMENT_INFORMATION: 'MISSING_SEGMENT_INFORMATION',\n SEGMENT_TIME_UNSPECIFIED: 'SEGMENT_TIME_UNSPECIFIED',\n UNSUPPORTED_UTC_TIMING_SCHEME: 'UNSUPPORTED_UTC_TIMING_SCHEME'\n};\n\n/**\n * Converts a <SegmentUrl> (of type URLType from the DASH spec 5.3.9.2 Table 14)\n * to an object that matches the output of a segment in videojs/mpd-parser\n *\n * @param {Object} attributes\n * Object containing all inherited attributes from parent elements with attribute\n * names as keys\n * @param {Object} segmentUrl\n * <SegmentURL> node to translate into a segment object\n * @return {Object} translated segment object\n */\n\nvar SegmentURLToSegmentObject = function SegmentURLToSegmentObject(attributes, segmentUrl) {\n var baseUrl = attributes.baseUrl,\n _attributes$initializ = attributes.initialization,\n initialization = _attributes$initializ === void 0 ? {} : _attributes$initializ;\n var initSegment = urlTypeToSegment({\n baseUrl: baseUrl,\n source: initialization.sourceURL,\n range: initialization.range\n });\n var segment = urlTypeToSegment({\n baseUrl: baseUrl,\n source: segmentUrl.media,\n range: segmentUrl.mediaRange\n });\n segment.map = initSegment;\n return segment;\n};\n/**\n * Generates a list of segments using information provided by the SegmentList element\n * SegmentList (DASH SPEC Section 5.3.9.3.2) contains a set of <SegmentURL> nodes. Each\n * node should be translated into segment.\n *\n * @param {Object} attributes\n * Object containing all inherited attributes from parent elements with attribute\n * names as keys\n * @param {Object[]|undefined} segmentTimeline\n * List of objects representing the attributes of each S element contained within\n * the SegmentTimeline element\n * @return {Object.<Array>} list of segments\n */\n\n\nvar segmentsFromList = function segmentsFromList(attributes, segmentTimeline) {\n var duration = attributes.duration,\n _attributes$segmentUr = attributes.segmentUrls,\n segmentUrls = _attributes$segmentUr === void 0 ? [] : _attributes$segmentUr; // Per spec (5.3.9.2.1) no way to determine segment duration OR\n // if both SegmentTimeline and @duration are defined, it is outside of spec.\n\n if (!duration && !segmentTimeline || duration && segmentTimeline) {\n throw new Error(errors.SEGMENT_TIME_UNSPECIFIED);\n }\n\n var segmentUrlMap = segmentUrls.map(function (segmentUrlObject) {\n return SegmentURLToSegmentObject(attributes, segmentUrlObject);\n });\n var segmentTimeInfo;\n\n if (duration) {\n segmentTimeInfo = parseByDuration(attributes);\n }\n\n if (segmentTimeline) {\n segmentTimeInfo = parseByTimeline(attributes, segmentTimeline);\n }\n\n var segments = segmentTimeInfo.map(function (segmentTime, index) {\n if (segmentUrlMap[index]) {\n var segment = segmentUrlMap[index];\n segment.timeline = segmentTime.timeline;\n segment.duration = segmentTime.duration;\n segment.number = segmentTime.number;\n return segment;\n } // Since we're mapping we should get rid of any blank segments (in case\n // the given SegmentTimeline is handling for more elements than we have\n // SegmentURLs for).\n\n }).filter(function (segment) {\n return segment;\n });\n return segments;\n};\n\n/**\n * Translates SegmentBase into a set of segments.\n * (DASH SPEC Section 5.3.9.3.2) contains a set of <SegmentURL> nodes. Each\n * node should be translated into segment.\n *\n * @param {Object} attributes\n * Object containing all inherited attributes from parent elements with attribute\n * names as keys\n * @return {Object.<Array>} list of segments\n */\n\nvar segmentsFromBase = function segmentsFromBase(attributes) {\n var baseUrl = attributes.baseUrl,\n _attributes$initializ = attributes.initialization,\n initialization = _attributes$initializ === void 0 ? {} : _attributes$initializ,\n sourceDuration = attributes.sourceDuration,\n _attributes$timescale = attributes.timescale,\n timescale = _attributes$timescale === void 0 ? 1 : _attributes$timescale,\n _attributes$indexRang = attributes.indexRange,\n indexRange = _attributes$indexRang === void 0 ? '' : _attributes$indexRang,\n duration = attributes.duration; // base url is required for SegmentBase to work, per spec (Section 5.3.9.2.1)\n\n if (!baseUrl) {\n throw new Error(errors.NO_BASE_URL);\n }\n\n var initSegment = urlTypeToSegment({\n baseUrl: baseUrl,\n source: initialization.sourceURL,\n range: initialization.range\n });\n var segment = urlTypeToSegment({\n baseUrl: baseUrl,\n source: baseUrl,\n range: indexRange\n });\n segment.map = initSegment; // If there is a duration, use it, otherwise use the given duration of the source\n // (since SegmentBase is only for one total segment)\n\n if (duration) {\n var segmentTimeInfo = parseByDuration(attributes);\n\n if (segmentTimeInfo.length) {\n segment.duration = segmentTimeInfo[0].duration;\n segment.timeline = segmentTimeInfo[0].timeline;\n }\n } else if (sourceDuration) {\n segment.duration = sourceDuration / timescale;\n segment.timeline = 0;\n } // This is used for mediaSequence\n\n\n segment.number = 0;\n return [segment];\n};\n\nvar generateSegments = function generateSegments(_ref) {\n var attributes = _ref.attributes,\n segmentInfo = _ref.segmentInfo;\n var segmentAttributes;\n var segmentsFn;\n\n if (segmentInfo.template) {\n segmentsFn = segmentsFromTemplate;\n segmentAttributes = merge(attributes, segmentInfo.template);\n } else if (segmentInfo.base) {\n segmentsFn = segmentsFromBase;\n segmentAttributes = merge(attributes, segmentInfo.base);\n } else if (segmentInfo.list) {\n segmentsFn = segmentsFromList;\n segmentAttributes = merge(attributes, segmentInfo.list);\n }\n\n if (!segmentsFn) {\n return {\n attributes: attributes\n };\n }\n\n var segments = segmentsFn(segmentAttributes, segmentInfo.timeline); // The @duration attribute will be used to determin the playlist's targetDuration which\n // must be in seconds. Since we've generated the segment list, we no longer need\n // @duration to be in @timescale units, so we can convert it here.\n\n if (segmentAttributes.duration) {\n var _segmentAttributes = segmentAttributes,\n duration = _segmentAttributes.duration,\n _segmentAttributes$ti = _segmentAttributes.timescale,\n timescale = _segmentAttributes$ti === void 0 ? 1 : _segmentAttributes$ti;\n segmentAttributes.duration = duration / timescale;\n } else if (segments.length) {\n // if there is no @duration attribute, use the largest segment duration as\n // as target duration\n segmentAttributes.duration = segments.reduce(function (max, segment) {\n return Math.max(max, Math.ceil(segment.duration));\n }, 0);\n } else {\n segmentAttributes.duration = 0;\n }\n\n return {\n attributes: segmentAttributes,\n segments: segments\n };\n};\nvar toPlaylists = function toPlaylists(representations) {\n return representations.map(generateSegments);\n};\n\nvar findChildren = function findChildren(element, name) {\n return from(element.childNodes).filter(function (_ref) {\n var tagName = _ref.tagName;\n return tagName === name;\n });\n};\nvar getContent = function getContent(element) {\n return element.textContent.trim();\n};\n\nvar parseDuration = function parseDuration(str) {\n var SECONDS_IN_YEAR = 365 * 24 * 60 * 60;\n var SECONDS_IN_MONTH = 30 * 24 * 60 * 60;\n var SECONDS_IN_DAY = 24 * 60 * 60;\n var SECONDS_IN_HOUR = 60 * 60;\n var SECONDS_IN_MIN = 60; // P10Y10M10DT10H10M10.1S\n\n var durationRegex = /P(?:(\\d*)Y)?(?:(\\d*)M)?(?:(\\d*)D)?(?:T(?:(\\d*)H)?(?:(\\d*)M)?(?:([\\d.]*)S)?)?/;\n var match = durationRegex.exec(str);\n\n if (!match) {\n return 0;\n }\n\n var _match$slice = match.slice(1),\n year = _match$slice[0],\n month = _match$slice[1],\n day = _match$slice[2],\n hour = _match$slice[3],\n minute = _match$slice[4],\n second = _match$slice[5];\n\n return parseFloat(year || 0) * SECONDS_IN_YEAR + parseFloat(month || 0) * SECONDS_IN_MONTH + parseFloat(day || 0) * SECONDS_IN_DAY + parseFloat(hour || 0) * SECONDS_IN_HOUR + parseFloat(minute || 0) * SECONDS_IN_MIN + parseFloat(second || 0);\n};\nvar parseDate = function parseDate(str) {\n // Date format without timezone according to ISO 8601\n // YYY-MM-DDThh:mm:ss.ssssss\n var dateRegex = /^\\d+-\\d+-\\d+T\\d+:\\d+:\\d+(\\.\\d+)?$/; // If the date string does not specifiy a timezone, we must specifiy UTC. This is\n // expressed by ending with 'Z'\n\n if (dateRegex.test(str)) {\n str += 'Z';\n }\n\n return Date.parse(str);\n};\n\nvar parsers = {\n /**\n * Specifies the duration of the entire Media Presentation. Format is a duration string\n * as specified in ISO 8601\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The duration in seconds\n */\n mediaPresentationDuration: function mediaPresentationDuration(value) {\n return parseDuration(value);\n },\n\n /**\n * Specifies the Segment availability start time for all Segments referred to in this\n * MPD. For a dynamic manifest, it specifies the anchor for the earliest availability\n * time. Format is a date string as specified in ISO 8601\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The date as seconds from unix epoch\n */\n availabilityStartTime: function availabilityStartTime(value) {\n return parseDate(value) / 1000;\n },\n\n /**\n * Specifies the smallest period between potential changes to the MPD. Format is a\n * duration string as specified in ISO 8601\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The duration in seconds\n */\n minimumUpdatePeriod: function minimumUpdatePeriod(value) {\n return parseDuration(value);\n },\n\n /**\n * Specifies the duration of the smallest time shifting buffer for any Representation\n * in the MPD. Format is a duration string as specified in ISO 8601\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The duration in seconds\n */\n timeShiftBufferDepth: function timeShiftBufferDepth(value) {\n return parseDuration(value);\n },\n\n /**\n * Specifies the PeriodStart time of the Period relative to the availabilityStarttime.\n * Format is a duration string as specified in ISO 8601\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The duration in seconds\n */\n start: function start(value) {\n return parseDuration(value);\n },\n\n /**\n * Specifies the width of the visual presentation\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The parsed width\n */\n width: function width(value) {\n return parseInt(value, 10);\n },\n\n /**\n * Specifies the height of the visual presentation\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The parsed height\n */\n height: function height(value) {\n return parseInt(value, 10);\n },\n\n /**\n * Specifies the bitrate of the representation\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The parsed bandwidth\n */\n bandwidth: function bandwidth(value) {\n return parseInt(value, 10);\n },\n\n /**\n * Specifies the number of the first Media Segment in this Representation in the Period\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The parsed number\n */\n startNumber: function startNumber(value) {\n return parseInt(value, 10);\n },\n\n /**\n * Specifies the timescale in units per seconds\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The aprsed timescale\n */\n timescale: function timescale(value) {\n return parseInt(value, 10);\n },\n\n /**\n * Specifies the constant approximate Segment duration\n * NOTE: The <Period> element also contains an @duration attribute. This duration\n * specifies the duration of the Period. This attribute is currently not\n * supported by the rest of the parser, however we still check for it to prevent\n * errors.\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The parsed duration\n */\n duration: function duration(value) {\n var parsedValue = parseInt(value, 10);\n\n if (isNaN(parsedValue)) {\n return parseDuration(value);\n }\n\n return parsedValue;\n },\n\n /**\n * Specifies the Segment duration, in units of the value of the @timescale.\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The parsed duration\n */\n d: function d(value) {\n return parseInt(value, 10);\n },\n\n /**\n * Specifies the MPD start time, in @timescale units, the first Segment in the series\n * starts relative to the beginning of the Period\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The parsed time\n */\n t: function t(value) {\n return parseInt(value, 10);\n },\n\n /**\n * Specifies the repeat count of the number of following contiguous Segments with the\n * same duration expressed by the value of @d\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The parsed number\n */\n r: function r(value) {\n return parseInt(value, 10);\n },\n\n /**\n * Default parser for all other attributes. Acts as a no-op and just returns the value\n * as a string\n *\n * @param {string} value\n * value of attribute as a string\n * @return {string}\n * Unparsed value\n */\n DEFAULT: function DEFAULT(value) {\n return value;\n }\n};\n/**\n * Gets all the attributes and values of the provided node, parses attributes with known\n * types, and returns an object with attribute names mapped to values.\n *\n * @param {Node} el\n * The node to parse attributes from\n * @return {Object}\n * Object with all attributes of el parsed\n */\n\nvar parseAttributes = function parseAttributes(el) {\n if (!(el && el.attributes)) {\n return {};\n }\n\n return from(el.attributes).reduce(function (a, e) {\n var parseFn = parsers[e.name] || parsers.DEFAULT;\n a[e.name] = parseFn(e.value);\n return a;\n }, {});\n};\n\nfunction decodeB64ToUint8Array(b64Text) {\n var decodedString = window$1.atob(b64Text);\n var array = new Uint8Array(decodedString.length);\n\n for (var i = 0; i < decodedString.length; i++) {\n array[i] = decodedString.charCodeAt(i);\n }\n\n return array;\n}\n\nvar keySystemsMap = {\n 'urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b': 'org.w3.clearkey',\n 'urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed': 'com.widevine.alpha',\n 'urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95': 'com.microsoft.playready',\n 'urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb': 'com.adobe.primetime'\n};\n/**\n * Builds a list of urls that is the product of the reference urls and BaseURL values\n *\n * @param {string[]} referenceUrls\n * List of reference urls to resolve to\n * @param {Node[]} baseUrlElements\n * List of BaseURL nodes from the mpd\n * @return {string[]}\n * List of resolved urls\n */\n\nvar buildBaseUrls = function buildBaseUrls(referenceUrls, baseUrlElements) {\n if (!baseUrlElements.length) {\n return referenceUrls;\n }\n\n return flatten(referenceUrls.map(function (reference) {\n return baseUrlElements.map(function (baseUrlElement) {\n return resolveUrl(reference, getContent(baseUrlElement));\n });\n }));\n};\n/**\n * Contains all Segment information for its containing AdaptationSet\n *\n * @typedef {Object} SegmentInformation\n * @property {Object|undefined} template\n * Contains the attributes for the SegmentTemplate node\n * @property {Object[]|undefined} timeline\n * Contains a list of atrributes for each S node within the SegmentTimeline node\n * @property {Object|undefined} list\n * Contains the attributes for the SegmentList node\n * @property {Object|undefined} base\n * Contains the attributes for the SegmentBase node\n */\n\n/**\n * Returns all available Segment information contained within the AdaptationSet node\n *\n * @param {Node} adaptationSet\n * The AdaptationSet node to get Segment information from\n * @return {SegmentInformation}\n * The Segment information contained within the provided AdaptationSet\n */\n\nvar getSegmentInformation = function getSegmentInformation(adaptationSet) {\n var segmentTemplate = findChildren(adaptationSet, 'SegmentTemplate')[0];\n var segmentList = findChildren(adaptationSet, 'SegmentList')[0];\n var segmentUrls = segmentList && findChildren(segmentList, 'SegmentURL').map(function (s) {\n return merge({\n tag: 'SegmentURL'\n }, parseAttributes(s));\n });\n var segmentBase = findChildren(adaptationSet, 'SegmentBase')[0];\n var segmentTimelineParentNode = segmentList || segmentTemplate;\n var segmentTimeline = segmentTimelineParentNode && findChildren(segmentTimelineParentNode, 'SegmentTimeline')[0];\n var segmentInitializationParentNode = segmentList || segmentBase || segmentTemplate;\n var segmentInitialization = segmentInitializationParentNode && findChildren(segmentInitializationParentNode, 'Initialization')[0]; // SegmentTemplate is handled slightly differently, since it can have both\n // @initialization and an <Initialization> node. @initialization can be templated,\n // while the node can have a url and range specified. If the <SegmentTemplate> has\n // both @initialization and an <Initialization> subelement we opt to override with\n // the node, as this interaction is not defined in the spec.\n\n var template = segmentTemplate && parseAttributes(segmentTemplate);\n\n if (template && segmentInitialization) {\n template.initialization = segmentInitialization && parseAttributes(segmentInitialization);\n } else if (template && template.initialization) {\n // If it is @initialization we convert it to an object since this is the format that\n // later functions will rely on for the initialization segment. This is only valid\n // for <SegmentTemplate>\n template.initialization = {\n sourceURL: template.initialization\n };\n }\n\n var segmentInfo = {\n template: template,\n timeline: segmentTimeline && findChildren(segmentTimeline, 'S').map(function (s) {\n return parseAttributes(s);\n }),\n list: segmentList && merge(parseAttributes(segmentList), {\n segmentUrls: segmentUrls,\n initialization: parseAttributes(segmentInitialization)\n }),\n base: segmentBase && merge(parseAttributes(segmentBase), {\n initialization: parseAttributes(segmentInitialization)\n })\n };\n Object.keys(segmentInfo).forEach(function (key) {\n if (!segmentInfo[key]) {\n delete segmentInfo[key];\n }\n });\n return segmentInfo;\n};\n/**\n * Contains Segment information and attributes needed to construct a Playlist object\n * from a Representation\n *\n * @typedef {Object} RepresentationInformation\n * @property {SegmentInformation} segmentInfo\n * Segment information for this Representation\n * @property {Object} attributes\n * Inherited attributes for this Representation\n */\n\n/**\n * Maps a Representation node to an object containing Segment information and attributes\n *\n * @name inheritBaseUrlsCallback\n * @function\n * @param {Node} representation\n * Representation node from the mpd\n * @return {RepresentationInformation}\n * Representation information needed to construct a Playlist object\n */\n\n/**\n * Returns a callback for Array.prototype.map for mapping Representation nodes to\n * Segment information and attributes using inherited BaseURL nodes.\n *\n * @param {Object} adaptationSetAttributes\n * Contains attributes inherited by the AdaptationSet\n * @param {string[]} adaptationSetBaseUrls\n * Contains list of resolved base urls inherited by the AdaptationSet\n * @param {SegmentInformation} adaptationSetSegmentInfo\n * Contains Segment information for the AdaptationSet\n * @return {inheritBaseUrlsCallback}\n * Callback map function\n */\n\nvar inheritBaseUrls = function inheritBaseUrls(adaptationSetAttributes, adaptationSetBaseUrls, adaptationSetSegmentInfo) {\n return function (representation) {\n var repBaseUrlElements = findChildren(representation, 'BaseURL');\n var repBaseUrls = buildBaseUrls(adaptationSetBaseUrls, repBaseUrlElements);\n var attributes = merge(adaptationSetAttributes, parseAttributes(representation));\n var representationSegmentInfo = getSegmentInformation(representation);\n return repBaseUrls.map(function (baseUrl) {\n return {\n segmentInfo: merge(adaptationSetSegmentInfo, representationSegmentInfo),\n attributes: merge(attributes, {\n baseUrl: baseUrl\n })\n };\n });\n };\n};\n/**\n * Tranforms a series of content protection nodes to\n * an object containing pssh data by key system\n *\n * @param {Node[]} contentProtectionNodes\n * Content protection nodes\n * @return {Object}\n * Object containing pssh data by key system\n */\n\nvar generateKeySystemInformation = function generateKeySystemInformation(contentProtectionNodes) {\n return contentProtectionNodes.reduce(function (acc, node) {\n var attributes = parseAttributes(node);\n var keySystem = keySystemsMap[attributes.schemeIdUri];\n\n if (keySystem) {\n acc[keySystem] = {\n attributes: attributes\n };\n var psshNode = findChildren(node, 'cenc:pssh')[0];\n\n if (psshNode) {\n var pssh = getContent(psshNode);\n var psshBuffer = pssh && decodeB64ToUint8Array(pssh);\n acc[keySystem].pssh = psshBuffer;\n }\n }\n\n return acc;\n }, {});\n};\n/**\n * Maps an AdaptationSet node to a list of Representation information objects\n *\n * @name toRepresentationsCallback\n * @function\n * @param {Node} adaptationSet\n * AdaptationSet node from the mpd\n * @return {RepresentationInformation[]}\n * List of objects containing Representaion information\n */\n\n/**\n * Returns a callback for Array.prototype.map for mapping AdaptationSet nodes to a list of\n * Representation information objects\n *\n * @param {Object} periodAttributes\n * Contains attributes inherited by the Period\n * @param {string[]} periodBaseUrls\n * Contains list of resolved base urls inherited by the Period\n * @param {string[]} periodSegmentInfo\n * Contains Segment Information at the period level\n * @return {toRepresentationsCallback}\n * Callback map function\n */\n\n\nvar toRepresentations = function toRepresentations(periodAttributes, periodBaseUrls, periodSegmentInfo) {\n return function (adaptationSet) {\n var adaptationSetAttributes = parseAttributes(adaptationSet);\n var adaptationSetBaseUrls = buildBaseUrls(periodBaseUrls, findChildren(adaptationSet, 'BaseURL'));\n var role = findChildren(adaptationSet, 'Role')[0];\n var roleAttributes = {\n role: parseAttributes(role)\n };\n var attrs = merge(periodAttributes, adaptationSetAttributes, roleAttributes);\n var contentProtection = generateKeySystemInformation(findChildren(adaptationSet, 'ContentProtection'));\n\n if (Object.keys(contentProtection).length) {\n attrs = merge(attrs, {\n contentProtection: contentProtection\n });\n }\n\n var segmentInfo = getSegmentInformation(adaptationSet);\n var representations = findChildren(adaptationSet, 'Representation');\n var adaptationSetSegmentInfo = merge(periodSegmentInfo, segmentInfo);\n return flatten(representations.map(inheritBaseUrls(attrs, adaptationSetBaseUrls, adaptationSetSegmentInfo)));\n };\n};\n/**\n * Maps an Period node to a list of Representation inforamtion objects for all\n * AdaptationSet nodes contained within the Period\n *\n * @name toAdaptationSetsCallback\n * @function\n * @param {Node} period\n * Period node from the mpd\n * @param {number} periodIndex\n * Index of the Period within the mpd\n * @return {RepresentationInformation[]}\n * List of objects containing Representaion information\n */\n\n/**\n * Returns a callback for Array.prototype.map for mapping Period nodes to a list of\n * Representation information objects\n *\n * @param {Object} mpdAttributes\n * Contains attributes inherited by the mpd\n * @param {string[]} mpdBaseUrls\n * Contains list of resolved base urls inherited by the mpd\n * @return {toAdaptationSetsCallback}\n * Callback map function\n */\n\nvar toAdaptationSets = function toAdaptationSets(mpdAttributes, mpdBaseUrls) {\n return function (period, index) {\n var periodBaseUrls = buildBaseUrls(mpdBaseUrls, findChildren(period, 'BaseURL'));\n var periodAtt = parseAttributes(period);\n var parsedPeriodId = parseInt(periodAtt.id, 10); // fallback to mapping index if Period@id is not a number\n\n var periodIndex = window$1.isNaN(parsedPeriodId) ? index : parsedPeriodId;\n var periodAttributes = merge(mpdAttributes, {\n periodIndex: periodIndex\n });\n var adaptationSets = findChildren(period, 'AdaptationSet');\n var periodSegmentInfo = getSegmentInformation(period);\n return flatten(adaptationSets.map(toRepresentations(periodAttributes, periodBaseUrls, periodSegmentInfo)));\n };\n};\n/**\n * Traverses the mpd xml tree to generate a list of Representation information objects\n * that have inherited attributes from parent nodes\n *\n * @param {Node} mpd\n * The root node of the mpd\n * @param {Object} options\n * Available options for inheritAttributes\n * @param {string} options.manifestUri\n * The uri source of the mpd\n * @param {number} options.NOW\n * Current time per DASH IOP. Default is current time in ms since epoch\n * @param {number} options.clientOffset\n * Client time difference from NOW (in milliseconds)\n * @return {RepresentationInformation[]}\n * List of objects containing Representation information\n */\n\nvar inheritAttributes = function inheritAttributes(mpd, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$manifestUri = _options.manifestUri,\n manifestUri = _options$manifestUri === void 0 ? '' : _options$manifestUri,\n _options$NOW = _options.NOW,\n NOW = _options$NOW === void 0 ? Date.now() : _options$NOW,\n _options$clientOffset = _options.clientOffset,\n clientOffset = _options$clientOffset === void 0 ? 0 : _options$clientOffset;\n var periods = findChildren(mpd, 'Period');\n\n if (!periods.length) {\n throw new Error(errors.INVALID_NUMBER_OF_PERIOD);\n }\n\n var mpdAttributes = parseAttributes(mpd);\n var mpdBaseUrls = buildBaseUrls([manifestUri], findChildren(mpd, 'BaseURL'));\n mpdAttributes.sourceDuration = mpdAttributes.mediaPresentationDuration || 0;\n mpdAttributes.NOW = NOW;\n mpdAttributes.clientOffset = clientOffset;\n return flatten(periods.map(toAdaptationSets(mpdAttributes, mpdBaseUrls)));\n};\n\nvar stringToMpdXml = function stringToMpdXml(manifestString) {\n if (manifestString === '') {\n throw new Error(errors.DASH_EMPTY_MANIFEST);\n }\n\n var parser = new window$1.DOMParser();\n var xml = parser.parseFromString(manifestString, 'application/xml');\n var mpd = xml && xml.documentElement.tagName === 'MPD' ? xml.documentElement : null;\n\n if (!mpd || mpd && mpd.getElementsByTagName('parsererror').length > 0) {\n throw new Error(errors.DASH_INVALID_XML);\n }\n\n return mpd;\n};\n\n/**\n * Parses the manifest for a UTCTiming node, returning the nodes attributes if found\n *\n * @param {string} mpd\n * XML string of the MPD manifest\n * @return {Object|null}\n * Attributes of UTCTiming node specified in the manifest. Null if none found\n */\n\nvar parseUTCTimingScheme = function parseUTCTimingScheme(mpd) {\n var UTCTimingNode = findChildren(mpd, 'UTCTiming')[0];\n\n if (!UTCTimingNode) {\n return null;\n }\n\n var attributes = parseAttributes(UTCTimingNode);\n\n switch (attributes.schemeIdUri) {\n case 'urn:mpeg:dash:utc:http-head:2014':\n case 'urn:mpeg:dash:utc:http-head:2012':\n attributes.method = 'HEAD';\n break;\n\n case 'urn:mpeg:dash:utc:http-xsdate:2014':\n case 'urn:mpeg:dash:utc:http-iso:2014':\n case 'urn:mpeg:dash:utc:http-xsdate:2012':\n case 'urn:mpeg:dash:utc:http-iso:2012':\n attributes.method = 'GET';\n break;\n\n case 'urn:mpeg:dash:utc:direct:2014':\n case 'urn:mpeg:dash:utc:direct:2012':\n attributes.method = 'DIRECT';\n attributes.value = Date.parse(attributes.value);\n break;\n\n case 'urn:mpeg:dash:utc:http-ntp:2014':\n case 'urn:mpeg:dash:utc:ntp:2014':\n case 'urn:mpeg:dash:utc:sntp:2014':\n default:\n throw new Error(errors.UNSUPPORTED_UTC_TIMING_SCHEME);\n }\n\n return attributes;\n};\n\nvar VERSION = version;\nvar parse = function parse(manifestString, options) {\n return toM3u8(toPlaylists(inheritAttributes(stringToMpdXml(manifestString), options)));\n};\n/**\n * Parses the manifest for a UTCTiming node, returning the nodes attributes if found\n *\n * @param {string} manifestString\n * XML string of the MPD manifest\n * @return {Object|null}\n * Attributes of UTCTiming node specified in the manifest. Null if none found\n */\n\nvar parseUTCTiming = function parseUTCTiming(manifestString) {\n return parseUTCTimingScheme(stringToMpdXml(manifestString));\n};\n\nexport { VERSION, parse, parseUTCTiming };\n","/*\n * pkcs7.pad\n * https://github.com/brightcove/pkcs7\n *\n * Copyright (c) 2014 Brightcove\n * Licensed under the apache2 license.\n */\n\nvar PADDING = void 0;\n\n/**\n * Returns a new Uint8Array that is padded with PKCS#7 padding.\n * @param plaintext {Uint8Array} the input bytes before encryption\n * @return {Uint8Array} the padded bytes\n * @see http://tools.ietf.org/html/rfc5652\n */\nfunction pad(plaintext) {\n var padding = PADDING[plaintext.byteLength % 16 || 0];\n var result = new Uint8Array(plaintext.byteLength + padding.length);\n\n result.set(plaintext);\n result.set(padding, plaintext.byteLength);\n\n return result;\n}\n\n// pre-define the padding values\nPADDING = [[16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16], [15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15], [14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14], [13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13], [12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12], [11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11], [10, 10, 10, 10, 10, 10, 10, 10, 10, 10], [9, 9, 9, 9, 9, 9, 9, 9, 9], [8, 8, 8, 8, 8, 8, 8, 8], [7, 7, 7, 7, 7, 7, 7], [6, 6, 6, 6, 6, 6], [5, 5, 5, 5, 5], [4, 4, 4, 4], [3, 3, 3], [2, 2], [1]];\n\n/**\n * Returns the subarray of a Uint8Array without PKCS#7 padding.\n * @param padded {Uint8Array} unencrypted bytes that have been padded\n * @return {Uint8Array} the unpadded bytes\n * @see http://tools.ietf.org/html/rfc5652\n */\nfunction unpad(padded) {\n return padded.subarray(0, padded.byteLength - padded[padded.byteLength - 1]);\n}\n\nvar version = \"1.0.2\";\n\nexport { pad, unpad, version as VERSION };\n","import { unpad } from 'pkcs7';\n\nvar classCallCheck = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};\n\nvar createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\n\n\n\n\n\n\n\n\nvar inherits = function (subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n};\n\n\n\n\n\n\n\n\n\n\n\nvar possibleConstructorReturn = function (self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n};\n\n/**\n * @file aes.js\n *\n * This file contains an adaptation of the AES decryption algorithm\n * from the Standford Javascript Cryptography Library. That work is\n * covered by the following copyright and permissions notice:\n *\n * Copyright 2009-2010 Emily Stark, Mike Hamburg, Dan Boneh.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following\n * disclaimer in the documentation and/or other materials provided\n * with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * The views and conclusions contained in the software and documentation\n * are those of the authors and should not be interpreted as representing\n * official policies, either expressed or implied, of the authors.\n */\n\n/**\n * Expand the S-box tables.\n *\n * @private\n */\nvar precompute = function precompute() {\n var tables = [[[], [], [], [], []], [[], [], [], [], []]];\n var encTable = tables[0];\n var decTable = tables[1];\n var sbox = encTable[4];\n var sboxInv = decTable[4];\n var i = void 0;\n var x = void 0;\n var xInv = void 0;\n var d = [];\n var th = [];\n var x2 = void 0;\n var x4 = void 0;\n var x8 = void 0;\n var s = void 0;\n var tEnc = void 0;\n var tDec = void 0;\n\n // Compute double and third tables\n for (i = 0; i < 256; i++) {\n th[(d[i] = i << 1 ^ (i >> 7) * 283) ^ i] = i;\n }\n\n for (x = xInv = 0; !sbox[x]; x ^= x2 || 1, xInv = th[xInv] || 1) {\n // Compute sbox\n s = xInv ^ xInv << 1 ^ xInv << 2 ^ xInv << 3 ^ xInv << 4;\n s = s >> 8 ^ s & 255 ^ 99;\n sbox[x] = s;\n sboxInv[s] = x;\n\n // Compute MixColumns\n x8 = d[x4 = d[x2 = d[x]]];\n tDec = x8 * 0x1010101 ^ x4 * 0x10001 ^ x2 * 0x101 ^ x * 0x1010100;\n tEnc = d[s] * 0x101 ^ s * 0x1010100;\n\n for (i = 0; i < 4; i++) {\n encTable[i][x] = tEnc = tEnc << 24 ^ tEnc >>> 8;\n decTable[i][s] = tDec = tDec << 24 ^ tDec >>> 8;\n }\n }\n\n // Compactify. Considerable speedup on Firefox.\n for (i = 0; i < 5; i++) {\n encTable[i] = encTable[i].slice(0);\n decTable[i] = decTable[i].slice(0);\n }\n return tables;\n};\nvar aesTables = null;\n\n/**\n * Schedule out an AES key for both encryption and decryption. This\n * is a low-level class. Use a cipher mode to do bulk encryption.\n *\n * @class AES\n * @param key {Array} The key as an array of 4, 6 or 8 words.\n */\n\nvar AES = function () {\n function AES(key) {\n classCallCheck(this, AES);\n\n /**\n * The expanded S-box and inverse S-box tables. These will be computed\n * on the client so that we don't have to send them down the wire.\n *\n * There are two tables, _tables[0] is for encryption and\n * _tables[1] is for decryption.\n *\n * The first 4 sub-tables are the expanded S-box with MixColumns. The\n * last (_tables[01][4]) is the S-box itself.\n *\n * @private\n */\n // if we have yet to precompute the S-box tables\n // do so now\n if (!aesTables) {\n aesTables = precompute();\n }\n // then make a copy of that object for use\n this._tables = [[aesTables[0][0].slice(), aesTables[0][1].slice(), aesTables[0][2].slice(), aesTables[0][3].slice(), aesTables[0][4].slice()], [aesTables[1][0].slice(), aesTables[1][1].slice(), aesTables[1][2].slice(), aesTables[1][3].slice(), aesTables[1][4].slice()]];\n var i = void 0;\n var j = void 0;\n var tmp = void 0;\n var encKey = void 0;\n var decKey = void 0;\n var sbox = this._tables[0][4];\n var decTable = this._tables[1];\n var keyLen = key.length;\n var rcon = 1;\n\n if (keyLen !== 4 && keyLen !== 6 && keyLen !== 8) {\n throw new Error('Invalid aes key size');\n }\n\n encKey = key.slice(0);\n decKey = [];\n this._key = [encKey, decKey];\n\n // schedule encryption keys\n for (i = keyLen; i < 4 * keyLen + 28; i++) {\n tmp = encKey[i - 1];\n\n // apply sbox\n if (i % keyLen === 0 || keyLen === 8 && i % keyLen === 4) {\n tmp = sbox[tmp >>> 24] << 24 ^ sbox[tmp >> 16 & 255] << 16 ^ sbox[tmp >> 8 & 255] << 8 ^ sbox[tmp & 255];\n\n // shift rows and add rcon\n if (i % keyLen === 0) {\n tmp = tmp << 8 ^ tmp >>> 24 ^ rcon << 24;\n rcon = rcon << 1 ^ (rcon >> 7) * 283;\n }\n }\n\n encKey[i] = encKey[i - keyLen] ^ tmp;\n }\n\n // schedule decryption keys\n for (j = 0; i; j++, i--) {\n tmp = encKey[j & 3 ? i : i - 4];\n if (i <= 4 || j < 4) {\n decKey[j] = tmp;\n } else {\n decKey[j] = decTable[0][sbox[tmp >>> 24]] ^ decTable[1][sbox[tmp >> 16 & 255]] ^ decTable[2][sbox[tmp >> 8 & 255]] ^ decTable[3][sbox[tmp & 255]];\n }\n }\n }\n\n /**\n * Decrypt 16 bytes, specified as four 32-bit words.\n *\n * @param {Number} encrypted0 the first word to decrypt\n * @param {Number} encrypted1 the second word to decrypt\n * @param {Number} encrypted2 the third word to decrypt\n * @param {Number} encrypted3 the fourth word to decrypt\n * @param {Int32Array} out the array to write the decrypted words\n * into\n * @param {Number} offset the offset into the output array to start\n * writing results\n * @return {Array} The plaintext.\n */\n\n\n AES.prototype.decrypt = function decrypt(encrypted0, encrypted1, encrypted2, encrypted3, out, offset) {\n var key = this._key[1];\n // state variables a,b,c,d are loaded with pre-whitened data\n var a = encrypted0 ^ key[0];\n var b = encrypted3 ^ key[1];\n var c = encrypted2 ^ key[2];\n var d = encrypted1 ^ key[3];\n var a2 = void 0;\n var b2 = void 0;\n var c2 = void 0;\n\n // key.length === 2 ?\n var nInnerRounds = key.length / 4 - 2;\n var i = void 0;\n var kIndex = 4;\n var table = this._tables[1];\n\n // load up the tables\n var table0 = table[0];\n var table1 = table[1];\n var table2 = table[2];\n var table3 = table[3];\n var sbox = table[4];\n\n // Inner rounds. Cribbed from OpenSSL.\n for (i = 0; i < nInnerRounds; i++) {\n a2 = table0[a >>> 24] ^ table1[b >> 16 & 255] ^ table2[c >> 8 & 255] ^ table3[d & 255] ^ key[kIndex];\n b2 = table0[b >>> 24] ^ table1[c >> 16 & 255] ^ table2[d >> 8 & 255] ^ table3[a & 255] ^ key[kIndex + 1];\n c2 = table0[c >>> 24] ^ table1[d >> 16 & 255] ^ table2[a >> 8 & 255] ^ table3[b & 255] ^ key[kIndex + 2];\n d = table0[d >>> 24] ^ table1[a >> 16 & 255] ^ table2[b >> 8 & 255] ^ table3[c & 255] ^ key[kIndex + 3];\n kIndex += 4;\n a = a2;b = b2;c = c2;\n }\n\n // Last round.\n for (i = 0; i < 4; i++) {\n out[(3 & -i) + offset] = sbox[a >>> 24] << 24 ^ sbox[b >> 16 & 255] << 16 ^ sbox[c >> 8 & 255] << 8 ^ sbox[d & 255] ^ key[kIndex++];\n a2 = a;a = b;b = c;c = d;d = a2;\n }\n };\n\n return AES;\n}();\n\n/**\n * @file stream.js\n */\n/**\n * A lightweight readable stream implemention that handles event dispatching.\n *\n * @class Stream\n */\nvar Stream = function () {\n function Stream() {\n classCallCheck(this, Stream);\n\n this.listeners = {};\n }\n\n /**\n * Add a listener for a specified event type.\n *\n * @param {String} type the event name\n * @param {Function} listener the callback to be invoked when an event of\n * the specified type occurs\n */\n\n\n Stream.prototype.on = function on(type, listener) {\n if (!this.listeners[type]) {\n this.listeners[type] = [];\n }\n this.listeners[type].push(listener);\n };\n\n /**\n * Remove a listener for a specified event type.\n *\n * @param {String} type the event name\n * @param {Function} listener a function previously registered for this\n * type of event through `on`\n * @return {Boolean} if we could turn it off or not\n */\n\n\n Stream.prototype.off = function off(type, listener) {\n if (!this.listeners[type]) {\n return false;\n }\n\n var index = this.listeners[type].indexOf(listener);\n\n this.listeners[type].splice(index, 1);\n return index > -1;\n };\n\n /**\n * Trigger an event of the specified type on this stream. Any additional\n * arguments to this function are passed as parameters to event listeners.\n *\n * @param {String} type the event name\n */\n\n\n Stream.prototype.trigger = function trigger(type) {\n var callbacks = this.listeners[type];\n\n if (!callbacks) {\n return;\n }\n\n // Slicing the arguments on every invocation of this method\n // can add a significant amount of overhead. Avoid the\n // intermediate object creation for the common case of a\n // single callback argument\n if (arguments.length === 2) {\n var length = callbacks.length;\n\n for (var i = 0; i < length; ++i) {\n callbacks[i].call(this, arguments[1]);\n }\n } else {\n var args = Array.prototype.slice.call(arguments, 1);\n var _length = callbacks.length;\n\n for (var _i = 0; _i < _length; ++_i) {\n callbacks[_i].apply(this, args);\n }\n }\n };\n\n /**\n * Destroys the stream and cleans up.\n */\n\n\n Stream.prototype.dispose = function dispose() {\n this.listeners = {};\n };\n /**\n * Forwards all `data` events on this stream to the destination stream. The\n * destination stream should provide a method `push` to receive the data\n * events as they arrive.\n *\n * @param {Stream} destination the stream that will receive all `data` events\n * @see http://nodejs.org/api/stream.html#stream_readable_pipe_destination_options\n */\n\n\n Stream.prototype.pipe = function pipe(destination) {\n this.on('data', function (data) {\n destination.push(data);\n });\n };\n\n return Stream;\n}();\n\n/**\n * @file async-stream.js\n */\n/**\n * A wrapper around the Stream class to use setTiemout\n * and run stream \"jobs\" Asynchronously\n *\n * @class AsyncStream\n * @extends Stream\n */\n\nvar AsyncStream = function (_Stream) {\n inherits(AsyncStream, _Stream);\n\n function AsyncStream() {\n classCallCheck(this, AsyncStream);\n\n var _this = possibleConstructorReturn(this, _Stream.call(this, Stream));\n\n _this.jobs = [];\n _this.delay = 1;\n _this.timeout_ = null;\n return _this;\n }\n\n /**\n * process an async job\n *\n * @private\n */\n\n\n AsyncStream.prototype.processJob_ = function processJob_() {\n this.jobs.shift()();\n if (this.jobs.length) {\n this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay);\n } else {\n this.timeout_ = null;\n }\n };\n\n /**\n * push a job into the stream\n *\n * @param {Function} job the job to push into the stream\n */\n\n\n AsyncStream.prototype.push = function push(job) {\n this.jobs.push(job);\n if (!this.timeout_) {\n this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay);\n }\n };\n\n return AsyncStream;\n}(Stream);\n\n/**\n * @file decrypter.js\n *\n * An asynchronous implementation of AES-128 CBC decryption with\n * PKCS#7 padding.\n */\n\n/**\n * Convert network-order (big-endian) bytes into their little-endian\n * representation.\n */\nvar ntoh = function ntoh(word) {\n return word << 24 | (word & 0xff00) << 8 | (word & 0xff0000) >> 8 | word >>> 24;\n};\n\n/**\n * Decrypt bytes using AES-128 with CBC and PKCS#7 padding.\n *\n * @param {Uint8Array} encrypted the encrypted bytes\n * @param {Uint32Array} key the bytes of the decryption key\n * @param {Uint32Array} initVector the initialization vector (IV) to\n * use for the first round of CBC.\n * @return {Uint8Array} the decrypted bytes\n *\n * @see http://en.wikipedia.org/wiki/Advanced_Encryption_Standard\n * @see http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Cipher_Block_Chaining_.28CBC.29\n * @see https://tools.ietf.org/html/rfc2315\n */\nvar decrypt = function decrypt(encrypted, key, initVector) {\n // word-level access to the encrypted bytes\n var encrypted32 = new Int32Array(encrypted.buffer, encrypted.byteOffset, encrypted.byteLength >> 2);\n\n var decipher = new AES(Array.prototype.slice.call(key));\n\n // byte and word-level access for the decrypted output\n var decrypted = new Uint8Array(encrypted.byteLength);\n var decrypted32 = new Int32Array(decrypted.buffer);\n\n // temporary variables for working with the IV, encrypted, and\n // decrypted data\n var init0 = void 0;\n var init1 = void 0;\n var init2 = void 0;\n var init3 = void 0;\n var encrypted0 = void 0;\n var encrypted1 = void 0;\n var encrypted2 = void 0;\n var encrypted3 = void 0;\n\n // iteration variable\n var wordIx = void 0;\n\n // pull out the words of the IV to ensure we don't modify the\n // passed-in reference and easier access\n init0 = initVector[0];\n init1 = initVector[1];\n init2 = initVector[2];\n init3 = initVector[3];\n\n // decrypt four word sequences, applying cipher-block chaining (CBC)\n // to each decrypted block\n for (wordIx = 0; wordIx < encrypted32.length; wordIx += 4) {\n // convert big-endian (network order) words into little-endian\n // (javascript order)\n encrypted0 = ntoh(encrypted32[wordIx]);\n encrypted1 = ntoh(encrypted32[wordIx + 1]);\n encrypted2 = ntoh(encrypted32[wordIx + 2]);\n encrypted3 = ntoh(encrypted32[wordIx + 3]);\n\n // decrypt the block\n decipher.decrypt(encrypted0, encrypted1, encrypted2, encrypted3, decrypted32, wordIx);\n\n // XOR with the IV, and restore network byte-order to obtain the\n // plaintext\n decrypted32[wordIx] = ntoh(decrypted32[wordIx] ^ init0);\n decrypted32[wordIx + 1] = ntoh(decrypted32[wordIx + 1] ^ init1);\n decrypted32[wordIx + 2] = ntoh(decrypted32[wordIx + 2] ^ init2);\n decrypted32[wordIx + 3] = ntoh(decrypted32[wordIx + 3] ^ init3);\n\n // setup the IV for the next round\n init0 = encrypted0;\n init1 = encrypted1;\n init2 = encrypted2;\n init3 = encrypted3;\n }\n\n return decrypted;\n};\n\n/**\n * The `Decrypter` class that manages decryption of AES\n * data through `AsyncStream` objects and the `decrypt`\n * function\n *\n * @param {Uint8Array} encrypted the encrypted bytes\n * @param {Uint32Array} key the bytes of the decryption key\n * @param {Uint32Array} initVector the initialization vector (IV) to\n * @param {Function} done the function to run when done\n * @class Decrypter\n */\n\nvar Decrypter = function () {\n function Decrypter(encrypted, key, initVector, done) {\n classCallCheck(this, Decrypter);\n\n var step = Decrypter.STEP;\n var encrypted32 = new Int32Array(encrypted.buffer);\n var decrypted = new Uint8Array(encrypted.byteLength);\n var i = 0;\n\n this.asyncStream_ = new AsyncStream();\n\n // split up the encryption job and do the individual chunks asynchronously\n this.asyncStream_.push(this.decryptChunk_(encrypted32.subarray(i, i + step), key, initVector, decrypted));\n for (i = step; i < encrypted32.length; i += step) {\n initVector = new Uint32Array([ntoh(encrypted32[i - 4]), ntoh(encrypted32[i - 3]), ntoh(encrypted32[i - 2]), ntoh(encrypted32[i - 1])]);\n this.asyncStream_.push(this.decryptChunk_(encrypted32.subarray(i, i + step), key, initVector, decrypted));\n }\n // invoke the done() callback when everything is finished\n this.asyncStream_.push(function () {\n // remove pkcs#7 padding from the decrypted bytes\n done(null, unpad(decrypted));\n });\n }\n\n /**\n * a getter for step the maximum number of bytes to process at one time\n *\n * @return {Number} the value of step 32000\n */\n\n\n /**\n * @private\n */\n Decrypter.prototype.decryptChunk_ = function decryptChunk_(encrypted, key, initVector, decrypted) {\n return function () {\n var bytes = decrypt(encrypted, key, initVector);\n\n decrypted.set(bytes, encrypted.byteOffset);\n };\n };\n\n createClass(Decrypter, null, [{\n key: 'STEP',\n get: function get$$1() {\n // 4 * 8000;\n return 32000;\n }\n }]);\n return Decrypter;\n}();\n\n/**\n * @file index.js\n *\n * Index module to easily import the primary components of AES-128\n * decryption. Like this:\n *\n * ```js\n * import {Decrypter, decrypt, AsyncStream} from 'aes-decrypter';\n * ```\n */\n\nexport { decrypt, Decrypter, AsyncStream };\n","/**\n * @license\n * Video.js 7.4.1 <http://videojs.com/>\n * Copyright Brightcove, Inc. <https://www.brightcove.com/>\n * Available under Apache License Version 2.0\n * <https://github.com/videojs/video.js/blob/master/LICENSE>\n *\n * Includes vtt.js <https://github.com/mozilla/vtt.js>\n * Available under Apache License Version 2.0\n * <https://github.com/mozilla/vtt.js/blob/master/LICENSE>\n */\n\nimport safeParseTuple from 'safe-json-parse/tuple';\nimport vtt from 'videojs-vtt.js';\nimport tsml from 'tsml';\nimport xhr from 'xhr';\nimport URLToolkit from 'url-toolkit';\nimport window$1 from 'global/window';\nimport { Parser } from 'm3u8-parser';\nimport document from 'global/document';\nimport { parse, parseUTCTiming } from 'mpd-parser';\nimport mp4probe from 'mux.js/lib/mp4/probe';\nimport { CaptionParser } from 'mux.js/lib/mp4';\nimport tsInspector from 'mux.js/lib/tools/ts-inspector.js';\nimport { Decrypter, AsyncStream, decrypt } from 'aes-decrypter';\n\nvar version = \"7.4.1\";\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _construct(Parent, args, Class) {\n if (isNativeReflectConstruct()) {\n _construct = Reflect.construct;\n } else {\n _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) _setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n }\n\n return _construct.apply(null, arguments);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _taggedTemplateLiteralLoose(strings, raw) {\n if (!raw) {\n raw = strings.slice(0);\n }\n\n strings.raw = raw;\n return strings;\n}\n\n/**\n * @file create-logger.js\n * @module create-logger\n */\n\nvar history = [];\n/**\n * Log messages to the console and history based on the type of message\n *\n * @private\n * @param {string} type\n * The name of the console method to use.\n *\n * @param {Array} args\n * The arguments to be passed to the matching console method.\n */\n\nvar LogByTypeFactory = function LogByTypeFactory(name, log) {\n return function (type, level, args) {\n var lvl = log.levels[level];\n var lvlRegExp = new RegExp(\"^(\" + lvl + \")$\");\n\n if (type !== 'log') {\n // Add the type to the front of the message when it's not \"log\".\n args.unshift(type.toUpperCase() + ':');\n } // Add console prefix after adding to history.\n\n\n args.unshift(name + ':'); // Add a clone of the args at this point to history.\n\n if (history) {\n history.push([].concat(args));\n } // If there's no console then don't try to output messages, but they will\n // still be stored in history.\n\n\n if (!window$1.console) {\n return;\n } // Was setting these once outside of this function, but containing them\n // in the function makes it easier to test cases where console doesn't exist\n // when the module is executed.\n\n\n var fn = window$1.console[type];\n\n if (!fn && type === 'debug') {\n // Certain browsers don't have support for console.debug. For those, we\n // should default to the closest comparable log.\n fn = window$1.console.info || window$1.console.log;\n } // Bail out if there's no console or if this type is not allowed by the\n // current logging level.\n\n\n if (!fn || !lvl || !lvlRegExp.test(type)) {\n return;\n }\n\n fn[Array.isArray(args) ? 'apply' : 'call'](window$1.console, args);\n };\n};\n\nfunction createLogger(name) {\n // This is the private tracking variable for logging level.\n var level = 'info'; // the curried logByType bound to the specific log and history\n\n var logByType;\n /**\n * Logs plain debug messages. Similar to `console.log`.\n *\n * Due to [limitations](https://github.com/jsdoc3/jsdoc/issues/955#issuecomment-313829149)\n * of our JSDoc template, we cannot properly document this as both a function\n * and a namespace, so its function signature is documented here.\n *\n * #### Arguments\n * ##### *args\n * Mixed[]\n *\n * Any combination of values that could be passed to `console.log()`.\n *\n * #### Return Value\n *\n * `undefined`\n *\n * @namespace\n * @param {Mixed[]} args\n * One or more messages or objects that should be logged.\n */\n\n var log = function log() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n logByType('log', level, args);\n }; // This is the logByType helper that the logging methods below use\n\n\n logByType = LogByTypeFactory(name, log);\n /**\n * Create a new sublogger which chains the old name to the new name.\n *\n * For example, doing `videojs.log.createLogger('player')` and then using that logger will log the following:\n * ```js\n * mylogger('foo');\n * // > VIDEOJS: player: foo\n * ```\n *\n * @param {string} name\n * The name to add call the new logger\n * @return {Object}\n */\n\n log.createLogger = function (subname) {\n return createLogger(name + ': ' + subname);\n };\n /**\n * Enumeration of available logging levels, where the keys are the level names\n * and the values are `|`-separated strings containing logging methods allowed\n * in that logging level. These strings are used to create a regular expression\n * matching the function name being called.\n *\n * Levels provided by Video.js are:\n *\n * - `off`: Matches no calls. Any value that can be cast to `false` will have\n * this effect. The most restrictive.\n * - `all`: Matches only Video.js-provided functions (`debug`, `log`,\n * `log.warn`, and `log.error`).\n * - `debug`: Matches `log.debug`, `log`, `log.warn`, and `log.error` calls.\n * - `info` (default): Matches `log`, `log.warn`, and `log.error` calls.\n * - `warn`: Matches `log.warn` and `log.error` calls.\n * - `error`: Matches only `log.error` calls.\n *\n * @type {Object}\n */\n\n\n log.levels = {\n all: 'debug|log|warn|error',\n off: '',\n debug: 'debug|log|warn|error',\n info: 'log|warn|error',\n warn: 'warn|error',\n error: 'error',\n DEFAULT: level\n };\n /**\n * Get or set the current logging level.\n *\n * If a string matching a key from {@link module:log.levels} is provided, acts\n * as a setter.\n *\n * @param {string} [lvl]\n * Pass a valid level to set a new logging level.\n *\n * @return {string}\n * The current logging level.\n */\n\n log.level = function (lvl) {\n if (typeof lvl === 'string') {\n if (!log.levels.hasOwnProperty(lvl)) {\n throw new Error(\"\\\"\" + lvl + \"\\\" in not a valid log level\");\n }\n\n level = lvl;\n }\n\n return level;\n };\n /**\n * Returns an array containing everything that has been logged to the history.\n *\n * This array is a shallow clone of the internal history record. However, its\n * contents are _not_ cloned; so, mutating objects inside this array will\n * mutate them in history.\n *\n * @return {Array}\n */\n\n\n log.history = function () {\n return history ? [].concat(history) : [];\n };\n /**\n * Allows you to filter the history by the given logger name\n *\n * @param {string} fname\n * The name to filter by\n *\n * @return {Array}\n * The filtered list to return\n */\n\n\n log.history.filter = function (fname) {\n return (history || []).filter(function (historyItem) {\n // if the first item in each historyItem includes `fname`, then it's a match\n return new RegExp(\".*\" + fname + \".*\").test(historyItem[0]);\n });\n };\n /**\n * Clears the internal history tracking, but does not prevent further history\n * tracking.\n */\n\n\n log.history.clear = function () {\n if (history) {\n history.length = 0;\n }\n };\n /**\n * Disable history tracking if it is currently enabled.\n */\n\n\n log.history.disable = function () {\n if (history !== null) {\n history.length = 0;\n history = null;\n }\n };\n /**\n * Enable history tracking if it is currently disabled.\n */\n\n\n log.history.enable = function () {\n if (history === null) {\n history = [];\n }\n };\n /**\n * Logs error messages. Similar to `console.error`.\n *\n * @param {Mixed[]} args\n * One or more messages or objects that should be logged as an error\n */\n\n\n log.error = function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return logByType('error', level, args);\n };\n /**\n * Logs warning messages. Similar to `console.warn`.\n *\n * @param {Mixed[]} args\n * One or more messages or objects that should be logged as a warning.\n */\n\n\n log.warn = function () {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n return logByType('warn', level, args);\n };\n /**\n * Logs debug messages. Similar to `console.debug`, but may also act as a comparable\n * log if `console.debug` is not available\n *\n * @param {Mixed[]} args\n * One or more messages or objects that should be logged as debug.\n */\n\n\n log.debug = function () {\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n\n return logByType('debug', level, args);\n };\n\n return log;\n}\n\n/**\n * @file log.js\n * @module log\n */\nvar log = createLogger('VIDEOJS');\nvar createLogger$1 = log.createLogger;\n\n/**\n * @file obj.js\n * @module obj\n */\n\n/**\n * @callback obj:EachCallback\n *\n * @param {Mixed} value\n * The current key for the object that is being iterated over.\n *\n * @param {string} key\n * The current key-value for object that is being iterated over\n */\n\n/**\n * @callback obj:ReduceCallback\n *\n * @param {Mixed} accum\n * The value that is accumulating over the reduce loop.\n *\n * @param {Mixed} value\n * The current key for the object that is being iterated over.\n *\n * @param {string} key\n * The current key-value for object that is being iterated over\n *\n * @return {Mixed}\n * The new accumulated value.\n */\nvar toString = Object.prototype.toString;\n/**\n * Get the keys of an Object\n *\n * @param {Object}\n * The Object to get the keys from\n *\n * @return {string[]}\n * An array of the keys from the object. Returns an empty array if the\n * object passed in was invalid or had no keys.\n *\n * @private\n */\n\nvar keys = function keys(object) {\n return isObject(object) ? Object.keys(object) : [];\n};\n/**\n * Array-like iteration for objects.\n *\n * @param {Object} object\n * The object to iterate over\n *\n * @param {obj:EachCallback} fn\n * The callback function which is called for each key in the object.\n */\n\n\nfunction each(object, fn) {\n keys(object).forEach(function (key) {\n return fn(object[key], key);\n });\n}\n/**\n * Array-like reduce for objects.\n *\n * @param {Object} object\n * The Object that you want to reduce.\n *\n * @param {Function} fn\n * A callback function which is called for each key in the object. It\n * receives the accumulated value and the per-iteration value and key\n * as arguments.\n *\n * @param {Mixed} [initial = 0]\n * Starting value\n *\n * @return {Mixed}\n * The final accumulated value.\n */\n\nfunction reduce(object, fn, initial) {\n if (initial === void 0) {\n initial = 0;\n }\n\n return keys(object).reduce(function (accum, key) {\n return fn(accum, object[key], key);\n }, initial);\n}\n/**\n * Object.assign-style object shallow merge/extend.\n *\n * @param {Object} target\n * @param {Object} ...sources\n * @return {Object}\n */\n\nfunction assign(target) {\n for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n sources[_key - 1] = arguments[_key];\n }\n\n if (Object.assign) {\n return Object.assign.apply(Object, [target].concat(sources));\n }\n\n sources.forEach(function (source) {\n if (!source) {\n return;\n }\n\n each(source, function (value, key) {\n target[key] = value;\n });\n });\n return target;\n}\n/**\n * Returns whether a value is an object of any kind - including DOM nodes,\n * arrays, regular expressions, etc. Not functions, though.\n *\n * This avoids the gotcha where using `typeof` on a `null` value\n * results in `'object'`.\n *\n * @param {Object} value\n * @return {boolean}\n */\n\nfunction isObject(value) {\n return !!value && typeof value === 'object';\n}\n/**\n * Returns whether an object appears to be a \"plain\" object - that is, a\n * direct instance of `Object`.\n *\n * @param {Object} value\n * @return {boolean}\n */\n\nfunction isPlain(value) {\n return isObject(value) && toString.call(value) === '[object Object]' && value.constructor === Object;\n}\n\n/**\n * @file computed-style.js\n * @module computed-style\n */\n/**\n * A safe getComputedStyle.\n *\n * This is needed because in Firefox, if the player is loaded in an iframe with\n * `display:none`, then `getComputedStyle` returns `null`, so, we do a\n * null-check to make sure that the player doesn't break in these cases.\n *\n * @function\n * @param {Element} el\n * The element you want the computed style of\n *\n * @param {string} prop\n * The property name you want\n *\n * @see https://bugzilla.mozilla.org/show_bug.cgi?id=548397\n */\n\nfunction computedStyle(el, prop) {\n if (!el || !prop) {\n return '';\n }\n\n if (typeof window$1.getComputedStyle === 'function') {\n var cs = window$1.getComputedStyle(el);\n return cs ? cs[prop] : '';\n }\n\n return '';\n}\n\nfunction _templateObject() {\n var data = _taggedTemplateLiteralLoose([\"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 \", \".\"]);\n\n _templateObject = function _templateObject() {\n return data;\n };\n\n return data;\n}\n/**\n * Detect if a value is a string with any non-whitespace characters.\n *\n * @private\n * @param {string} str\n * The string to check\n *\n * @return {boolean}\n * Will be `true` if the string is non-blank, `false` otherwise.\n *\n */\n\nfunction isNonBlankString(str) {\n return typeof str === 'string' && /\\S/.test(str);\n}\n/**\n * Throws an error if the passed string has whitespace. This is used by\n * class methods to be relatively consistent with the classList API.\n *\n * @private\n * @param {string} str\n * The string to check for whitespace.\n *\n * @throws {Error}\n * Throws an error if there is whitespace in the string.\n */\n\n\nfunction throwIfWhitespace(str) {\n if (/\\s/.test(str)) {\n throw new Error('class has illegal whitespace characters');\n }\n}\n/**\n * Produce a regular expression for matching a className within an elements className.\n *\n * @private\n * @param {string} className\n * The className to generate the RegExp for.\n *\n * @return {RegExp}\n * The RegExp that will check for a specific `className` in an elements\n * className.\n */\n\n\nfunction classRegExp(className) {\n return new RegExp('(^|\\\\s)' + className + '($|\\\\s)');\n}\n/**\n * Whether the current DOM interface appears to be real (i.e. not simulated).\n *\n * @return {boolean}\n * Will be `true` if the DOM appears to be real, `false` otherwise.\n */\n\n\nfunction isReal() {\n // Both document and window will never be undefined thanks to `global`.\n return document === window$1.document;\n}\n/**\n * Determines, via duck typing, whether or not a value is a DOM element.\n *\n * @param {Mixed} value\n * The value to check.\n *\n * @return {boolean}\n * Will be `true` if the value is a DOM element, `false` otherwise.\n */\n\nfunction isEl(value) {\n return isObject(value) && value.nodeType === 1;\n}\n/**\n * Determines if the current DOM is embedded in an iframe.\n *\n * @return {boolean}\n * Will be `true` if the DOM is embedded in an iframe, `false`\n * otherwise.\n */\n\nfunction isInFrame() {\n // We need a try/catch here because Safari will throw errors when attempting\n // to get either `parent` or `self`\n try {\n return window$1.parent !== window$1.self;\n } catch (x) {\n return true;\n }\n}\n/**\n * Creates functions to query the DOM using a given method.\n *\n * @private\n * @param {string} method\n * The method to create the query with.\n *\n * @return {Function}\n * The query method\n */\n\nfunction createQuerier(method) {\n return function (selector, context) {\n if (!isNonBlankString(selector)) {\n return document[method](null);\n }\n\n if (isNonBlankString(context)) {\n context = document.querySelector(context);\n }\n\n var ctx = isEl(context) ? context : document;\n return ctx[method] && ctx[method](selector);\n };\n}\n/**\n * Creates an element and applies properties, attributes, and inserts content.\n *\n * @param {string} [tagName='div']\n * Name of tag to be created.\n *\n * @param {Object} [properties={}]\n * Element properties to be applied.\n *\n * @param {Object} [attributes={}]\n * Element attributes to be applied.\n *\n * @param {module:dom~ContentDescriptor} content\n * A content descriptor object.\n *\n * @return {Element}\n * The element that was created.\n */\n\n\nfunction createEl(tagName, properties, attributes, content) {\n if (tagName === void 0) {\n tagName = 'div';\n }\n\n if (properties === void 0) {\n properties = {};\n }\n\n if (attributes === void 0) {\n attributes = {};\n }\n\n var el = document.createElement(tagName);\n Object.getOwnPropertyNames(properties).forEach(function (propName) {\n var val = properties[propName]; // See #2176\n // We originally were accepting both properties and attributes in the\n // same object, but that doesn't work so well.\n\n if (propName.indexOf('aria-') !== -1 || propName === 'role' || propName === 'type') {\n log.warn(tsml(_templateObject(), propName, val));\n el.setAttribute(propName, val); // Handle textContent since it's not supported everywhere and we have a\n // method for it.\n } else if (propName === 'textContent') {\n textContent(el, val);\n } else {\n el[propName] = val;\n }\n });\n Object.getOwnPropertyNames(attributes).forEach(function (attrName) {\n el.setAttribute(attrName, attributes[attrName]);\n });\n\n if (content) {\n appendContent(el, content);\n }\n\n return el;\n}\n/**\n * Injects text into an element, replacing any existing contents entirely.\n *\n * @param {Element} el\n * The element to add text content into\n *\n * @param {string} text\n * The text content to add.\n *\n * @return {Element}\n * The element with added text content.\n */\n\nfunction textContent(el, text) {\n if (typeof el.textContent === 'undefined') {\n el.innerText = text;\n } else {\n el.textContent = text;\n }\n\n return el;\n}\n/**\n * Insert an element as the first child node of another\n *\n * @param {Element} child\n * Element to insert\n *\n * @param {Element} parent\n * Element to insert child into\n */\n\nfunction prependTo(child, parent) {\n if (parent.firstChild) {\n parent.insertBefore(child, parent.firstChild);\n } else {\n parent.appendChild(child);\n }\n}\n/**\n * Check if an element has a class name.\n *\n * @param {Element} element\n * Element to check\n *\n * @param {string} classToCheck\n * Class name to check for\n *\n * @return {boolean}\n * Will be `true` if the element has a class, `false` otherwise.\n *\n * @throws {Error}\n * Throws an error if `classToCheck` has white space.\n */\n\nfunction hasClass(element, classToCheck) {\n throwIfWhitespace(classToCheck);\n\n if (element.classList) {\n return element.classList.contains(classToCheck);\n }\n\n return classRegExp(classToCheck).test(element.className);\n}\n/**\n * Add a class name to an element.\n *\n * @param {Element} element\n * Element to add class name to.\n *\n * @param {string} classToAdd\n * Class name to add.\n *\n * @return {Element}\n * The DOM element with the added class name.\n */\n\nfunction addClass(element, classToAdd) {\n if (element.classList) {\n element.classList.add(classToAdd); // Don't need to `throwIfWhitespace` here because `hasElClass` will do it\n // in the case of classList not being supported.\n } else if (!hasClass(element, classToAdd)) {\n element.className = (element.className + ' ' + classToAdd).trim();\n }\n\n return element;\n}\n/**\n * Remove a class name from an element.\n *\n * @param {Element} element\n * Element to remove a class name from.\n *\n * @param {string} classToRemove\n * Class name to remove\n *\n * @return {Element}\n * The DOM element with class name removed.\n */\n\nfunction removeClass(element, classToRemove) {\n if (element.classList) {\n element.classList.remove(classToRemove);\n } else {\n throwIfWhitespace(classToRemove);\n element.className = element.className.split(/\\s+/).filter(function (c) {\n return c !== classToRemove;\n }).join(' ');\n }\n\n return element;\n}\n/**\n * The callback definition for toggleClass.\n *\n * @callback module:dom~PredicateCallback\n * @param {Element} element\n * The DOM element of the Component.\n *\n * @param {string} classToToggle\n * The `className` that wants to be toggled\n *\n * @return {boolean|undefined}\n * If `true` is returned, the `classToToggle` will be added to the\n * `element`. If `false`, the `classToToggle` will be removed from\n * the `element`. If `undefined`, the callback will be ignored.\n */\n\n/**\n * Adds or removes a class name to/from an element depending on an optional\n * condition or the presence/absence of the class name.\n *\n * @param {Element} element\n * The element to toggle a class name on.\n *\n * @param {string} classToToggle\n * The class that should be toggled.\n *\n * @param {boolean|module:dom~PredicateCallback} [predicate]\n * See the return value for {@link module:dom~PredicateCallback}\n *\n * @return {Element}\n * The element with a class that has been toggled.\n */\n\nfunction toggleClass(element, classToToggle, predicate) {\n // This CANNOT use `classList` internally because IE11 does not support the\n // second parameter to the `classList.toggle()` method! Which is fine because\n // `classList` will be used by the add/remove functions.\n var has = hasClass(element, classToToggle);\n\n if (typeof predicate === 'function') {\n predicate = predicate(element, classToToggle);\n }\n\n if (typeof predicate !== 'boolean') {\n predicate = !has;\n } // If the necessary class operation matches the current state of the\n // element, no action is required.\n\n\n if (predicate === has) {\n return;\n }\n\n if (predicate) {\n addClass(element, classToToggle);\n } else {\n removeClass(element, classToToggle);\n }\n\n return element;\n}\n/**\n * Apply attributes to an HTML element.\n *\n * @param {Element} el\n * Element to add attributes to.\n *\n * @param {Object} [attributes]\n * Attributes to be applied.\n */\n\nfunction setAttributes(el, attributes) {\n Object.getOwnPropertyNames(attributes).forEach(function (attrName) {\n var attrValue = attributes[attrName];\n\n if (attrValue === null || typeof attrValue === 'undefined' || attrValue === false) {\n el.removeAttribute(attrName);\n } else {\n el.setAttribute(attrName, attrValue === true ? '' : attrValue);\n }\n });\n}\n/**\n * Get an element's attribute values, as defined on the HTML tag.\n *\n * Attributes are not the same as properties. They're defined on the tag\n * or with setAttribute.\n *\n * @param {Element} tag\n * Element from which to get tag attributes.\n *\n * @return {Object}\n * All attributes of the element. Boolean attributes will be `true` or\n * `false`, others will be strings.\n */\n\nfunction getAttributes(tag) {\n var obj = {}; // known boolean attributes\n // we can check for matching boolean properties, but not all browsers\n // and not all tags know about these attributes, so, we still want to check them manually\n\n var knownBooleans = ',' + 'autoplay,controls,playsinline,loop,muted,default,defaultMuted' + ',';\n\n if (tag && tag.attributes && tag.attributes.length > 0) {\n var attrs = tag.attributes;\n\n for (var i = attrs.length - 1; i >= 0; i--) {\n var attrName = attrs[i].name;\n var attrVal = attrs[i].value; // check for known booleans\n // the matching element property will return a value for typeof\n\n if (typeof tag[attrName] === 'boolean' || knownBooleans.indexOf(',' + attrName + ',') !== -1) {\n // the value of an included boolean attribute is typically an empty\n // string ('') which would equal false if we just check for a false value.\n // we also don't want support bad code like autoplay='false'\n attrVal = attrVal !== null ? true : false;\n }\n\n obj[attrName] = attrVal;\n }\n }\n\n return obj;\n}\n/**\n * Get the value of an element's attribute.\n *\n * @param {Element} el\n * A DOM element.\n *\n * @param {string} attribute\n * Attribute to get the value of.\n *\n * @return {string}\n * The value of the attribute.\n */\n\nfunction getAttribute(el, attribute) {\n return el.getAttribute(attribute);\n}\n/**\n * Set the value of an element's attribute.\n *\n * @param {Element} el\n * A DOM element.\n *\n * @param {string} attribute\n * Attribute to set.\n *\n * @param {string} value\n * Value to set the attribute to.\n */\n\nfunction setAttribute(el, attribute, value) {\n el.setAttribute(attribute, value);\n}\n/**\n * Remove an element's attribute.\n *\n * @param {Element} el\n * A DOM element.\n *\n * @param {string} attribute\n * Attribute to remove.\n */\n\nfunction removeAttribute(el, attribute) {\n el.removeAttribute(attribute);\n}\n/**\n * Attempt to block the ability to select text.\n */\n\nfunction blockTextSelection() {\n document.body.focus();\n\n document.onselectstart = function () {\n return false;\n };\n}\n/**\n * Turn off text selection blocking.\n */\n\nfunction unblockTextSelection() {\n document.onselectstart = function () {\n return true;\n };\n}\n/**\n * Identical to the native `getBoundingClientRect` function, but ensures that\n * the method is supported at all (it is in all browsers we claim to support)\n * and that the element is in the DOM before continuing.\n *\n * This wrapper function also shims properties which are not provided by some\n * older browsers (namely, IE8).\n *\n * Additionally, some browsers do not support adding properties to a\n * `ClientRect`/`DOMRect` object; so, we shallow-copy it with the standard\n * properties (except `x` and `y` which are not widely supported). This helps\n * avoid implementations where keys are non-enumerable.\n *\n * @param {Element} el\n * Element whose `ClientRect` we want to calculate.\n *\n * @return {Object|undefined}\n * Always returns a plain object - or `undefined` if it cannot.\n */\n\nfunction getBoundingClientRect(el) {\n if (el && el.getBoundingClientRect && el.parentNode) {\n var rect = el.getBoundingClientRect();\n var result = {};\n ['bottom', 'height', 'left', 'right', 'top', 'width'].forEach(function (k) {\n if (rect[k] !== undefined) {\n result[k] = rect[k];\n }\n });\n\n if (!result.height) {\n result.height = parseFloat(computedStyle(el, 'height'));\n }\n\n if (!result.width) {\n result.width = parseFloat(computedStyle(el, 'width'));\n }\n\n return result;\n }\n}\n/**\n * Represents the position of a DOM element on the page.\n *\n * @typedef {Object} module:dom~Position\n *\n * @property {number} left\n * Pixels to the left.\n *\n * @property {number} top\n * Pixels from the top.\n */\n\n/**\n * Get the position of an element in the DOM.\n *\n * Uses `getBoundingClientRect` technique from John Resig.\n *\n * @see http://ejohn.org/blog/getboundingclientrect-is-awesome/\n *\n * @param {Element} el\n * Element from which to get offset.\n *\n * @return {module:dom~Position}\n * The position of the element that was passed in.\n */\n\nfunction findPosition(el) {\n var box;\n\n if (el.getBoundingClientRect && el.parentNode) {\n box = el.getBoundingClientRect();\n }\n\n if (!box) {\n return {\n left: 0,\n top: 0\n };\n }\n\n var docEl = document.documentElement;\n var body = document.body;\n var clientLeft = docEl.clientLeft || body.clientLeft || 0;\n var scrollLeft = window$1.pageXOffset || body.scrollLeft;\n var left = box.left + scrollLeft - clientLeft;\n var clientTop = docEl.clientTop || body.clientTop || 0;\n var scrollTop = window$1.pageYOffset || body.scrollTop;\n var top = box.top + scrollTop - clientTop; // Android sometimes returns slightly off decimal values, so need to round\n\n return {\n left: Math.round(left),\n top: Math.round(top)\n };\n}\n/**\n * Represents x and y coordinates for a DOM element or mouse pointer.\n *\n * @typedef {Object} module:dom~Coordinates\n *\n * @property {number} x\n * x coordinate in pixels\n *\n * @property {number} y\n * y coordinate in pixels\n */\n\n/**\n * Get the pointer position within an element.\n *\n * The base on the coordinates are the bottom left of the element.\n *\n * @param {Element} el\n * Element on which to get the pointer position on.\n *\n * @param {EventTarget~Event} event\n * Event object.\n *\n * @return {module:dom~Coordinates}\n * A coordinates object corresponding to the mouse position.\n *\n */\n\nfunction getPointerPosition(el, event) {\n var position = {};\n var box = findPosition(el);\n var boxW = el.offsetWidth;\n var boxH = el.offsetHeight;\n var boxY = box.top;\n var boxX = box.left;\n var pageY = event.pageY;\n var pageX = event.pageX;\n\n if (event.changedTouches) {\n pageX = event.changedTouches[0].pageX;\n pageY = event.changedTouches[0].pageY;\n }\n\n position.y = Math.max(0, Math.min(1, (boxY - pageY + boxH) / boxH));\n position.x = Math.max(0, Math.min(1, (pageX - boxX) / boxW));\n return position;\n}\n/**\n * Determines, via duck typing, whether or not a value is a text node.\n *\n * @param {Mixed} value\n * Check if this value is a text node.\n *\n * @return {boolean}\n * Will be `true` if the value is a text node, `false` otherwise.\n */\n\nfunction isTextNode(value) {\n return isObject(value) && value.nodeType === 3;\n}\n/**\n * Empties the contents of an element.\n *\n * @param {Element} el\n * The element to empty children from\n *\n * @return {Element}\n * The element with no children\n */\n\nfunction emptyEl(el) {\n while (el.firstChild) {\n el.removeChild(el.firstChild);\n }\n\n return el;\n}\n/**\n * This is a mixed value that describes content to be injected into the DOM\n * via some method. It can be of the following types:\n *\n * Type | Description\n * -----------|-------------\n * `string` | The value will be normalized into a text node.\n * `Element` | The value will be accepted as-is.\n * `TextNode` | The value will be accepted as-is.\n * `Array` | A one-dimensional array of strings, elements, text nodes, or functions. These functions should return a string, element, or text node (any other return value, like an array, will be ignored).\n * `Function` | A function, which is expected to return a string, element, text node, or array - any of the other possible values described above. This means that a content descriptor could be a function that returns an array of functions, but those second-level functions must return strings, elements, or text nodes.\n *\n * @typedef {string|Element|TextNode|Array|Function} module:dom~ContentDescriptor\n */\n\n/**\n * Normalizes content for eventual insertion into the DOM.\n *\n * This allows a wide range of content definition methods, but helps protect\n * from falling into the trap of simply writing to `innerHTML`, which could\n * be an XSS concern.\n *\n * The content for an element can be passed in multiple types and\n * combinations, whose behavior is as follows:\n *\n * @param {module:dom~ContentDescriptor} content\n * A content descriptor value.\n *\n * @return {Array}\n * All of the content that was passed in, normalized to an array of\n * elements or text nodes.\n */\n\nfunction normalizeContent(content) {\n // First, invoke content if it is a function. If it produces an array,\n // that needs to happen before normalization.\n if (typeof content === 'function') {\n content = content();\n } // Next up, normalize to an array, so one or many items can be normalized,\n // filtered, and returned.\n\n\n return (Array.isArray(content) ? content : [content]).map(function (value) {\n // First, invoke value if it is a function to produce a new value,\n // which will be subsequently normalized to a Node of some kind.\n if (typeof value === 'function') {\n value = value();\n }\n\n if (isEl(value) || isTextNode(value)) {\n return value;\n }\n\n if (typeof value === 'string' && /\\S/.test(value)) {\n return document.createTextNode(value);\n }\n }).filter(function (value) {\n return value;\n });\n}\n/**\n * Normalizes and appends content to an element.\n *\n * @param {Element} el\n * Element to append normalized content to.\n *\n * @param {module:dom~ContentDescriptor} content\n * A content descriptor value.\n *\n * @return {Element}\n * The element with appended normalized content.\n */\n\nfunction appendContent(el, content) {\n normalizeContent(content).forEach(function (node) {\n return el.appendChild(node);\n });\n return el;\n}\n/**\n * Normalizes and inserts content into an element; this is identical to\n * `appendContent()`, except it empties the element first.\n *\n * @param {Element} el\n * Element to insert normalized content into.\n *\n * @param {module:dom~ContentDescriptor} content\n * A content descriptor value.\n *\n * @return {Element}\n * The element with inserted normalized content.\n */\n\nfunction insertContent(el, content) {\n return appendContent(emptyEl(el), content);\n}\n/**\n * Check if an event was a single left click.\n *\n * @param {EventTarget~Event} event\n * Event object.\n *\n * @return {boolean}\n * Will be `true` if a single left click, `false` otherwise.\n */\n\nfunction isSingleLeftClick(event) {\n // Note: if you create something draggable, be sure to\n // call it on both `mousedown` and `mousemove` event,\n // otherwise `mousedown` should be enough for a button\n if (event.button === undefined && event.buttons === undefined) {\n // Why do we need `buttons` ?\n // Because, middle mouse sometimes have this:\n // e.button === 0 and e.buttons === 4\n // Furthermore, we want to prevent combination click, something like\n // HOLD middlemouse then left click, that would be\n // e.button === 0, e.buttons === 5\n // just `button` is not gonna work\n // Alright, then what this block does ?\n // this is for chrome `simulate mobile devices`\n // I want to support this as well\n return true;\n }\n\n if (event.button === 0 && event.buttons === undefined) {\n // Touch screen, sometimes on some specific device, `buttons`\n // doesn't have anything (safari on ios, blackberry...)\n return true;\n }\n\n if (event.button !== 0 || event.buttons !== 1) {\n // This is the reason we have those if else block above\n // if any special case we can catch and let it slide\n // we do it above, when get to here, this definitely\n // is-not-left-click\n return false;\n }\n\n return true;\n}\n/**\n * Finds a single DOM element matching `selector` within the optional\n * `context` of another DOM element (defaulting to `document`).\n *\n * @param {string} selector\n * A valid CSS selector, which will be passed to `querySelector`.\n *\n * @param {Element|String} [context=document]\n * A DOM element within which to query. Can also be a selector\n * string in which case the first matching element will be used\n * as context. If missing (or no element matches selector), falls\n * back to `document`.\n *\n * @return {Element|null}\n * The element that was found or null.\n */\n\nvar $ = createQuerier('querySelector');\n/**\n * Finds a all DOM elements matching `selector` within the optional\n * `context` of another DOM element (defaulting to `document`).\n *\n * @param {string} selector\n * A valid CSS selector, which will be passed to `querySelectorAll`.\n *\n * @param {Element|String} [context=document]\n * A DOM element within which to query. Can also be a selector\n * string in which case the first matching element will be used\n * as context. If missing (or no element matches selector), falls\n * back to `document`.\n *\n * @return {NodeList}\n * A element list of elements that were found. Will be empty if none\n * were found.\n *\n */\n\nvar $$ = createQuerier('querySelectorAll');\n\nvar Dom = /*#__PURE__*/Object.freeze({\n isReal: isReal,\n isEl: isEl,\n isInFrame: isInFrame,\n createEl: createEl,\n textContent: textContent,\n prependTo: prependTo,\n hasClass: hasClass,\n addClass: addClass,\n removeClass: removeClass,\n toggleClass: toggleClass,\n setAttributes: setAttributes,\n getAttributes: getAttributes,\n getAttribute: getAttribute,\n setAttribute: setAttribute,\n removeAttribute: removeAttribute,\n blockTextSelection: blockTextSelection,\n unblockTextSelection: unblockTextSelection,\n getBoundingClientRect: getBoundingClientRect,\n findPosition: findPosition,\n getPointerPosition: getPointerPosition,\n isTextNode: isTextNode,\n emptyEl: emptyEl,\n normalizeContent: normalizeContent,\n appendContent: appendContent,\n insertContent: insertContent,\n isSingleLeftClick: isSingleLeftClick,\n $: $,\n $$: $$\n});\n\n/**\n * @file guid.js\n * @module guid\n */\n\n/**\n * Unique ID for an element or function\n * @type {Number}\n */\nvar _guid = 1;\n/**\n * Get a unique auto-incrementing ID by number that has not been returned before.\n *\n * @return {number}\n * A new unique ID.\n */\n\nfunction newGUID() {\n return _guid++;\n}\n\n/**\n * @file dom-data.js\n * @module dom-data\n */\n/**\n * Element Data Store.\n *\n * Allows for binding data to an element without putting it directly on the\n * element. Ex. Event listeners are stored here.\n * (also from jsninja.com, slightly modified and updated for closure compiler)\n *\n * @type {Object}\n * @private\n */\n\nvar elData = {};\n/*\n * Unique attribute name to store an element's guid in\n *\n * @type {String}\n * @constant\n * @private\n */\n\nvar elIdAttr = 'vdata' + new Date().getTime();\n/**\n * Returns the cache object where data for an element is stored\n *\n * @param {Element} el\n * Element to store data for.\n *\n * @return {Object}\n * The cache object for that el that was passed in.\n */\n\nfunction getData(el) {\n var id = el[elIdAttr];\n\n if (!id) {\n id = el[elIdAttr] = newGUID();\n }\n\n if (!elData[id]) {\n elData[id] = {};\n }\n\n return elData[id];\n}\n/**\n * Returns whether or not an element has cached data\n *\n * @param {Element} el\n * Check if this element has cached data.\n *\n * @return {boolean}\n * - True if the DOM element has cached data.\n * - False otherwise.\n */\n\nfunction hasData(el) {\n var id = el[elIdAttr];\n\n if (!id) {\n return false;\n }\n\n return !!Object.getOwnPropertyNames(elData[id]).length;\n}\n/**\n * Delete data for the element from the cache and the guid attr from getElementById\n *\n * @param {Element} el\n * Remove cached data for this element.\n */\n\nfunction removeData(el) {\n var id = el[elIdAttr];\n\n if (!id) {\n return;\n } // Remove all stored data\n\n\n delete elData[id]; // Remove the elIdAttr property from the DOM node\n\n try {\n delete el[elIdAttr];\n } catch (e) {\n if (el.removeAttribute) {\n el.removeAttribute(elIdAttr);\n } else {\n // IE doesn't appear to support removeAttribute on the document element\n el[elIdAttr] = null;\n }\n }\n}\n\n/**\n * @file events.js. An Event System (John Resig - Secrets of a JS Ninja http://jsninja.com/)\n * (Original book version wasn't completely usable, so fixed some things and made Closure Compiler compatible)\n * This should work very similarly to jQuery's events, however it's based off the book version which isn't as\n * robust as jquery's, so there's probably some differences.\n *\n * @file events.js\n * @module events\n */\n/**\n * Clean up the listener cache and dispatchers\n *\n * @param {Element|Object} elem\n * Element to clean up\n *\n * @param {string} type\n * Type of event to clean up\n */\n\nfunction _cleanUpEvents(elem, type) {\n var data = getData(elem); // Remove the events of a particular type if there are none left\n\n if (data.handlers[type].length === 0) {\n delete data.handlers[type]; // data.handlers[type] = null;\n // Setting to null was causing an error with data.handlers\n // Remove the meta-handler from the element\n\n if (elem.removeEventListener) {\n elem.removeEventListener(type, data.dispatcher, false);\n } else if (elem.detachEvent) {\n elem.detachEvent('on' + type, data.dispatcher);\n }\n } // Remove the events object if there are no types left\n\n\n if (Object.getOwnPropertyNames(data.handlers).length <= 0) {\n delete data.handlers;\n delete data.dispatcher;\n delete data.disabled;\n } // Finally remove the element data if there is no data left\n\n\n if (Object.getOwnPropertyNames(data).length === 0) {\n removeData(elem);\n }\n}\n/**\n * Loops through an array of event types and calls the requested method for each type.\n *\n * @param {Function} fn\n * The event method we want to use.\n *\n * @param {Element|Object} elem\n * Element or object to bind listeners to\n *\n * @param {string} type\n * Type of event to bind to.\n *\n * @param {EventTarget~EventListener} callback\n * Event listener.\n */\n\n\nfunction _handleMultipleEvents(fn, elem, types, callback) {\n types.forEach(function (type) {\n // Call the event method for each one of the types\n fn(elem, type, callback);\n });\n}\n/**\n * Fix a native event to have standard property values\n *\n * @param {Object} event\n * Event object to fix.\n *\n * @return {Object}\n * Fixed event object.\n */\n\n\nfunction fixEvent(event) {\n function returnTrue() {\n return true;\n }\n\n function returnFalse() {\n return false;\n } // Test if fixing up is needed\n // Used to check if !event.stopPropagation instead of isPropagationStopped\n // But native events return true for stopPropagation, but don't have\n // other expected methods like isPropagationStopped. Seems to be a problem\n // with the Javascript Ninja code. So we're just overriding all events now.\n\n\n if (!event || !event.isPropagationStopped) {\n var old = event || window$1.event;\n event = {}; // Clone the old object so that we can modify the values event = {};\n // IE8 Doesn't like when you mess with native event properties\n // Firefox returns false for event.hasOwnProperty('type') and other props\n // which makes copying more difficult.\n // TODO: Probably best to create a whitelist of event props\n\n for (var key in old) {\n // Safari 6.0.3 warns you if you try to copy deprecated layerX/Y\n // Chrome warns you if you try to copy deprecated keyboardEvent.keyLocation\n // and webkitMovementX/Y\n if (key !== 'layerX' && key !== 'layerY' && key !== 'keyLocation' && key !== 'webkitMovementX' && key !== 'webkitMovementY') {\n // Chrome 32+ warns if you try to copy deprecated returnValue, but\n // we still want to if preventDefault isn't supported (IE8).\n if (!(key === 'returnValue' && old.preventDefault)) {\n event[key] = old[key];\n }\n }\n } // The event occurred on this element\n\n\n if (!event.target) {\n event.target = event.srcElement || document;\n } // Handle which other element the event is related to\n\n\n if (!event.relatedTarget) {\n event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;\n } // Stop the default browser action\n\n\n event.preventDefault = function () {\n if (old.preventDefault) {\n old.preventDefault();\n }\n\n event.returnValue = false;\n old.returnValue = false;\n event.defaultPrevented = true;\n };\n\n event.defaultPrevented = false; // Stop the event from bubbling\n\n event.stopPropagation = function () {\n if (old.stopPropagation) {\n old.stopPropagation();\n }\n\n event.cancelBubble = true;\n old.cancelBubble = true;\n event.isPropagationStopped = returnTrue;\n };\n\n event.isPropagationStopped = returnFalse; // Stop the event from bubbling and executing other handlers\n\n event.stopImmediatePropagation = function () {\n if (old.stopImmediatePropagation) {\n old.stopImmediatePropagation();\n }\n\n event.isImmediatePropagationStopped = returnTrue;\n event.stopPropagation();\n };\n\n event.isImmediatePropagationStopped = returnFalse; // Handle mouse position\n\n if (event.clientX !== null && event.clientX !== undefined) {\n var doc = document.documentElement;\n var body = document.body;\n event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);\n event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);\n } // Handle key presses\n\n\n event.which = event.charCode || event.keyCode; // Fix button for mouse clicks:\n // 0 == left; 1 == middle; 2 == right\n\n if (event.button !== null && event.button !== undefined) {\n // The following is disabled because it does not pass videojs-standard\n // and... yikes.\n\n /* eslint-disable */\n event.button = event.button & 1 ? 0 : event.button & 4 ? 1 : event.button & 2 ? 2 : 0;\n /* eslint-enable */\n }\n } // Returns fixed-up instance\n\n\n return event;\n}\n/**\n * Whether passive event listeners are supported\n */\n\nvar _supportsPassive = false;\n\n(function () {\n try {\n var opts = Object.defineProperty({}, 'passive', {\n get: function get() {\n _supportsPassive = true;\n }\n });\n window$1.addEventListener('test', null, opts);\n window$1.removeEventListener('test', null, opts);\n } catch (e) {// disregard\n }\n})();\n/**\n * Touch events Chrome expects to be passive\n */\n\n\nvar passiveEvents = ['touchstart', 'touchmove'];\n/**\n * Add an event listener to element\n * It stores the handler function in a separate cache object\n * and adds a generic handler to the element's event,\n * along with a unique id (guid) to the element.\n *\n * @param {Element|Object} elem\n * Element or object to bind listeners to\n *\n * @param {string|string[]} type\n * Type of event to bind to.\n *\n * @param {EventTarget~EventListener} fn\n * Event listener.\n */\n\nfunction on(elem, type, fn) {\n if (Array.isArray(type)) {\n return _handleMultipleEvents(on, elem, type, fn);\n }\n\n var data = getData(elem); // We need a place to store all our handler data\n\n if (!data.handlers) {\n data.handlers = {};\n }\n\n if (!data.handlers[type]) {\n data.handlers[type] = [];\n }\n\n if (!fn.guid) {\n fn.guid = newGUID();\n }\n\n data.handlers[type].push(fn);\n\n if (!data.dispatcher) {\n data.disabled = false;\n\n data.dispatcher = function (event, hash) {\n if (data.disabled) {\n return;\n }\n\n event = fixEvent(event);\n var handlers = data.handlers[event.type];\n\n if (handlers) {\n // Copy handlers so if handlers are added/removed during the process it doesn't throw everything off.\n var handlersCopy = handlers.slice(0);\n\n for (var m = 0, n = handlersCopy.length; m < n; m++) {\n if (event.isImmediatePropagationStopped()) {\n break;\n } else {\n try {\n handlersCopy[m].call(elem, event, hash);\n } catch (e) {\n log.error(e);\n }\n }\n }\n }\n };\n }\n\n if (data.handlers[type].length === 1) {\n if (elem.addEventListener) {\n var options = false;\n\n if (_supportsPassive && passiveEvents.indexOf(type) > -1) {\n options = {\n passive: true\n };\n }\n\n elem.addEventListener(type, data.dispatcher, options);\n } else if (elem.attachEvent) {\n elem.attachEvent('on' + type, data.dispatcher);\n }\n }\n}\n/**\n * Removes event listeners from an element\n *\n * @param {Element|Object} elem\n * Object to remove listeners from.\n *\n * @param {string|string[]} [type]\n * Type of listener to remove. Don't include to remove all events from element.\n *\n * @param {EventTarget~EventListener} [fn]\n * Specific listener to remove. Don't include to remove listeners for an event\n * type.\n */\n\nfunction off(elem, type, fn) {\n // Don't want to add a cache object through getElData if not needed\n if (!hasData(elem)) {\n return;\n }\n\n var data = getData(elem); // If no events exist, nothing to unbind\n\n if (!data.handlers) {\n return;\n }\n\n if (Array.isArray(type)) {\n return _handleMultipleEvents(off, elem, type, fn);\n } // Utility function\n\n\n var removeType = function removeType(el, t) {\n data.handlers[t] = [];\n\n _cleanUpEvents(el, t);\n }; // Are we removing all bound events?\n\n\n if (type === undefined) {\n for (var t in data.handlers) {\n if (Object.prototype.hasOwnProperty.call(data.handlers || {}, t)) {\n removeType(elem, t);\n }\n }\n\n return;\n }\n\n var handlers = data.handlers[type]; // If no handlers exist, nothing to unbind\n\n if (!handlers) {\n return;\n } // If no listener was provided, remove all listeners for type\n\n\n if (!fn) {\n removeType(elem, type);\n return;\n } // We're only removing a single handler\n\n\n if (fn.guid) {\n for (var n = 0; n < handlers.length; n++) {\n if (handlers[n].guid === fn.guid) {\n handlers.splice(n--, 1);\n }\n }\n }\n\n _cleanUpEvents(elem, type);\n}\n/**\n * Trigger an event for an element\n *\n * @param {Element|Object} elem\n * Element to trigger an event on\n *\n * @param {EventTarget~Event|string} event\n * A string (the type) or an event object with a type attribute\n *\n * @param {Object} [hash]\n * data hash to pass along with the event\n *\n * @return {boolean|undefined}\n * Returns the opposite of `defaultPrevented` if default was\n * prevented. Otherwise, returns `undefined`\n */\n\nfunction trigger(elem, event, hash) {\n // Fetches element data and a reference to the parent (for bubbling).\n // Don't want to add a data object to cache for every parent,\n // so checking hasElData first.\n var elemData = hasData(elem) ? getData(elem) : {};\n var parent = elem.parentNode || elem.ownerDocument; // type = event.type || event,\n // handler;\n // If an event name was passed as a string, creates an event out of it\n\n if (typeof event === 'string') {\n event = {\n type: event,\n target: elem\n };\n } else if (!event.target) {\n event.target = elem;\n } // Normalizes the event properties.\n\n\n event = fixEvent(event); // If the passed element has a dispatcher, executes the established handlers.\n\n if (elemData.dispatcher) {\n elemData.dispatcher.call(elem, event, hash);\n } // Unless explicitly stopped or the event does not bubble (e.g. media events)\n // recursively calls this function to bubble the event up the DOM.\n\n\n if (parent && !event.isPropagationStopped() && event.bubbles === true) {\n trigger.call(null, parent, event, hash); // If at the top of the DOM, triggers the default action unless disabled.\n } else if (!parent && !event.defaultPrevented) {\n var targetData = getData(event.target); // Checks if the target has a default action for this event.\n\n if (event.target[event.type]) {\n // Temporarily disables event dispatching on the target as we have already executed the handler.\n targetData.disabled = true; // Executes the default action.\n\n if (typeof event.target[event.type] === 'function') {\n event.target[event.type]();\n } // Re-enables event dispatching.\n\n\n targetData.disabled = false;\n }\n } // Inform the triggerer if the default was prevented by returning false\n\n\n return !event.defaultPrevented;\n}\n/**\n * Trigger a listener only once for an event.\n *\n * @param {Element|Object} elem\n * Element or object to bind to.\n *\n * @param {string|string[]} type\n * Name/type of event\n *\n * @param {Event~EventListener} fn\n * Event listener function\n */\n\nfunction one(elem, type, fn) {\n if (Array.isArray(type)) {\n return _handleMultipleEvents(one, elem, type, fn);\n }\n\n var func = function func() {\n off(elem, type, func);\n fn.apply(this, arguments);\n }; // copy the guid to the new function so it can removed using the original function's ID\n\n\n func.guid = fn.guid = fn.guid || newGUID();\n on(elem, type, func);\n}\n\nvar Events = /*#__PURE__*/Object.freeze({\n fixEvent: fixEvent,\n on: on,\n off: off,\n trigger: trigger,\n one: one\n});\n\n/**\n * @file setup.js - Functions for setting up a player without\n * user interaction based on the data-setup `attribute` of the video tag.\n *\n * @module setup\n */\nvar _windowLoaded = false;\nvar videojs;\n/**\n * Set up any tags that have a data-setup `attribute` when the player is started.\n */\n\nvar autoSetup = function autoSetup() {\n // Protect against breakage in non-browser environments and check global autoSetup option.\n if (!isReal() || videojs.options.autoSetup === false) {\n return;\n }\n\n var vids = Array.prototype.slice.call(document.getElementsByTagName('video'));\n var audios = Array.prototype.slice.call(document.getElementsByTagName('audio'));\n var divs = Array.prototype.slice.call(document.getElementsByTagName('video-js'));\n var mediaEls = vids.concat(audios, divs); // Check if any media elements exist\n\n if (mediaEls && mediaEls.length > 0) {\n for (var i = 0, e = mediaEls.length; i < e; i++) {\n var mediaEl = mediaEls[i]; // Check if element exists, has getAttribute func.\n\n if (mediaEl && mediaEl.getAttribute) {\n // Make sure this player hasn't already been set up.\n if (mediaEl.player === undefined) {\n var options = mediaEl.getAttribute('data-setup'); // Check if data-setup attr exists.\n // We only auto-setup if they've added the data-setup attr.\n\n if (options !== null) {\n // Create new video.js instance.\n videojs(mediaEl);\n }\n } // If getAttribute isn't defined, we need to wait for the DOM.\n\n } else {\n autoSetupTimeout(1);\n break;\n }\n } // No videos were found, so keep looping unless page is finished loading.\n\n } else if (!_windowLoaded) {\n autoSetupTimeout(1);\n }\n};\n/**\n * Wait until the page is loaded before running autoSetup. This will be called in\n * autoSetup if `hasLoaded` returns false.\n *\n * @param {number} wait\n * How long to wait in ms\n *\n * @param {module:videojs} [vjs]\n * The videojs library function\n */\n\n\nfunction autoSetupTimeout(wait, vjs) {\n if (vjs) {\n videojs = vjs;\n }\n\n window$1.setTimeout(autoSetup, wait);\n}\n\nif (isReal() && document.readyState === 'complete') {\n _windowLoaded = true;\n} else {\n /**\n * Listen for the load event on window, and set _windowLoaded to true.\n *\n * @listens load\n */\n one(window$1, 'load', function () {\n _windowLoaded = true;\n });\n}\n\n/**\n * @file stylesheet.js\n * @module stylesheet\n */\n/**\n * Create a DOM syle element given a className for it.\n *\n * @param {string} className\n * The className to add to the created style element.\n *\n * @return {Element}\n * The element that was created.\n */\n\nvar createStyleElement = function createStyleElement(className) {\n var style = document.createElement('style');\n style.className = className;\n return style;\n};\n/**\n * Add text to a DOM element.\n *\n * @param {Element} el\n * The Element to add text content to.\n *\n * @param {string} content\n * The text to add to the element.\n */\n\nvar setTextContent = function setTextContent(el, content) {\n if (el.styleSheet) {\n el.styleSheet.cssText = content;\n } else {\n el.textContent = content;\n }\n};\n\n/**\n * @file fn.js\n * @module fn\n */\n/**\n * Bind (a.k.a proxy or context). A simple method for changing the context of\n * a function.\n *\n * It also stores a unique id on the function so it can be easily removed from\n * events.\n *\n * @function\n * @param {Mixed} context\n * The object to bind as scope.\n *\n * @param {Function} fn\n * The function to be bound to a scope.\n *\n * @param {number} [uid]\n * An optional unique ID for the function to be set\n *\n * @return {Function}\n * The new function that will be bound into the context given\n */\n\nvar bind = function bind(context, fn, uid) {\n // Make sure the function has a unique ID\n if (!fn.guid) {\n fn.guid = newGUID();\n } // Create the new function that changes the context\n\n\n var bound = function bound() {\n return fn.apply(context, arguments);\n }; // Allow for the ability to individualize this function\n // Needed in the case where multiple objects might share the same prototype\n // IF both items add an event listener with the same function, then you try to remove just one\n // it will remove both because they both have the same guid.\n // when using this, you need to use the bind method when you remove the listener as well.\n // currently used in text tracks\n\n\n bound.guid = uid ? uid + '_' + fn.guid : fn.guid;\n return bound;\n};\n/**\n * Wraps the given function, `fn`, with a new function that only invokes `fn`\n * at most once per every `wait` milliseconds.\n *\n * @function\n * @param {Function} fn\n * The function to be throttled.\n *\n * @param {Number} wait\n * The number of milliseconds by which to throttle.\n *\n * @return {Function}\n */\n\nvar throttle = function throttle(fn, wait) {\n var last = Date.now();\n\n var throttled = function throttled() {\n var now = Date.now();\n\n if (now - last >= wait) {\n fn.apply(void 0, arguments);\n last = now;\n }\n };\n\n return throttled;\n};\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked.\n *\n * Inspired by lodash and underscore implementations.\n *\n * @function\n * @param {Function} func\n * The function to wrap with debounce behavior.\n *\n * @param {number} wait\n * The number of milliseconds to wait after the last invocation.\n *\n * @param {boolean} [immediate]\n * Whether or not to invoke the function immediately upon creation.\n *\n * @param {Object} [context=window]\n * The \"context\" in which the debounced function should debounce. For\n * example, if this function should be tied to a Video.js player,\n * the player can be passed here. Alternatively, defaults to the\n * global `window` object.\n *\n * @return {Function}\n * A debounced function.\n */\n\nvar debounce = function debounce(func, wait, immediate, context) {\n if (context === void 0) {\n context = window$1;\n }\n\n var timeout;\n\n var cancel = function cancel() {\n context.clearTimeout(timeout);\n timeout = null;\n };\n /* eslint-disable consistent-this */\n\n\n var debounced = function debounced() {\n var self = this;\n var args = arguments;\n\n var _later = function later() {\n timeout = null;\n _later = null;\n\n if (!immediate) {\n func.apply(self, args);\n }\n };\n\n if (!timeout && immediate) {\n func.apply(self, args);\n }\n\n context.clearTimeout(timeout);\n timeout = context.setTimeout(_later, wait);\n };\n /* eslint-enable consistent-this */\n\n\n debounced.cancel = cancel;\n return debounced;\n};\n\n/**\n * @file src/js/event-target.js\n */\n/**\n * `EventTarget` is a class that can have the same API as the DOM `EventTarget`. It\n * adds shorthand functions that wrap around lengthy functions. For example:\n * the `on` function is a wrapper around `addEventListener`.\n *\n * @see [EventTarget Spec]{@link https://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-EventTarget}\n * @class EventTarget\n */\n\nvar EventTarget = function EventTarget() {};\n/**\n * A Custom DOM event.\n *\n * @typedef {Object} EventTarget~Event\n * @see [Properties]{@link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent}\n */\n\n/**\n * All event listeners should follow the following format.\n *\n * @callback EventTarget~EventListener\n * @this {EventTarget}\n *\n * @param {EventTarget~Event} event\n * the event that triggered this function\n *\n * @param {Object} [hash]\n * hash of data sent during the event\n */\n\n/**\n * An object containing event names as keys and booleans as values.\n *\n * > NOTE: If an event name is set to a true value here {@link EventTarget#trigger}\n * will have extra functionality. See that function for more information.\n *\n * @property EventTarget.prototype.allowedEvents_\n * @private\n */\n\n\nEventTarget.prototype.allowedEvents_ = {};\n/**\n * Adds an `event listener` to an instance of an `EventTarget`. An `event listener` is a\n * function that will get called when an event with a certain name gets triggered.\n *\n * @param {string|string[]} type\n * An event name or an array of event names.\n *\n * @param {EventTarget~EventListener} fn\n * The function to call with `EventTarget`s\n */\n\nEventTarget.prototype.on = function (type, fn) {\n // Remove the addEventListener alias before calling Events.on\n // so we don't get into an infinite type loop\n var ael = this.addEventListener;\n\n this.addEventListener = function () {};\n\n on(this, type, fn);\n this.addEventListener = ael;\n};\n/**\n * An alias of {@link EventTarget#on}. Allows `EventTarget` to mimic\n * the standard DOM API.\n *\n * @function\n * @see {@link EventTarget#on}\n */\n\n\nEventTarget.prototype.addEventListener = EventTarget.prototype.on;\n/**\n * Removes an `event listener` for a specific event from an instance of `EventTarget`.\n * This makes it so that the `event listener` will no longer get called when the\n * named event happens.\n *\n * @param {string|string[]} type\n * An event name or an array of event names.\n *\n * @param {EventTarget~EventListener} fn\n * The function to remove.\n */\n\nEventTarget.prototype.off = function (type, fn) {\n off(this, type, fn);\n};\n/**\n * An alias of {@link EventTarget#off}. Allows `EventTarget` to mimic\n * the standard DOM API.\n *\n * @function\n * @see {@link EventTarget#off}\n */\n\n\nEventTarget.prototype.removeEventListener = EventTarget.prototype.off;\n/**\n * This function will add an `event listener` that gets triggered only once. After the\n * first trigger it will get removed. This is like adding an `event listener`\n * with {@link EventTarget#on} that calls {@link EventTarget#off} on itself.\n *\n * @param {string|string[]} type\n * An event name or an array of event names.\n *\n * @param {EventTarget~EventListener} fn\n * The function to be called once for each event name.\n */\n\nEventTarget.prototype.one = function (type, fn) {\n // Remove the addEventListener alialing Events.on\n // so we don't get into an infinite type loop\n var ael = this.addEventListener;\n\n this.addEventListener = function () {};\n\n one(this, type, fn);\n this.addEventListener = ael;\n};\n/**\n * This function causes an event to happen. This will then cause any `event listeners`\n * that are waiting for that event, to get called. If there are no `event listeners`\n * for an event then nothing will happen.\n *\n * If the name of the `Event` that is being triggered is in `EventTarget.allowedEvents_`.\n * Trigger will also call the `on` + `uppercaseEventName` function.\n *\n * Example:\n * 'click' is in `EventTarget.allowedEvents_`, so, trigger will attempt to call\n * `onClick` if it exists.\n *\n * @param {string|EventTarget~Event|Object} event\n * The name of the event, an `Event`, or an object with a key of type set to\n * an event name.\n */\n\n\nEventTarget.prototype.trigger = function (event) {\n var type = event.type || event;\n\n if (typeof event === 'string') {\n event = {\n type: type\n };\n }\n\n event = fixEvent(event);\n\n if (this.allowedEvents_[type] && this['on' + type]) {\n this['on' + type](event);\n }\n\n trigger(this, event);\n};\n/**\n * An alias of {@link EventTarget#trigger}. Allows `EventTarget` to mimic\n * the standard DOM API.\n *\n * @function\n * @see {@link EventTarget#trigger}\n */\n\n\nEventTarget.prototype.dispatchEvent = EventTarget.prototype.trigger;\nvar EVENT_MAP;\n\nEventTarget.prototype.queueTrigger = function (event) {\n var _this = this;\n\n // only set up EVENT_MAP if it'll be used\n if (!EVENT_MAP) {\n EVENT_MAP = new Map();\n }\n\n var type = event.type || event;\n var map = EVENT_MAP.get(this);\n\n if (!map) {\n map = new Map();\n EVENT_MAP.set(this, map);\n }\n\n var oldTimeout = map.get(type);\n map.delete(type);\n window$1.clearTimeout(oldTimeout);\n var timeout = window$1.setTimeout(function () {\n // if we cleared out all timeouts for the current target, delete its map\n if (map.size === 0) {\n map = null;\n EVENT_MAP.delete(_this);\n }\n\n _this.trigger(event);\n }, 0);\n map.set(type, timeout);\n};\n\n/**\n * @file mixins/evented.js\n * @module evented\n */\n/**\n * Returns whether or not an object has had the evented mixin applied.\n *\n * @param {Object} object\n * An object to test.\n *\n * @return {boolean}\n * Whether or not the object appears to be evented.\n */\n\nvar isEvented = function isEvented(object) {\n return object instanceof EventTarget || !!object.eventBusEl_ && ['on', 'one', 'off', 'trigger'].every(function (k) {\n return typeof object[k] === 'function';\n });\n};\n/**\n * Adds a callback to run after the evented mixin applied.\n *\n * @param {Object} object\n * An object to Add\n * @param {Function} callback\n * The callback to run.\n */\n\n\nvar addEventedCallback = function addEventedCallback(target, callback) {\n if (isEvented(target)) {\n callback();\n } else {\n if (!target.eventedCallbacks) {\n target.eventedCallbacks = [];\n }\n\n target.eventedCallbacks.push(callback);\n }\n};\n/**\n * Whether a value is a valid event type - non-empty string or array.\n *\n * @private\n * @param {string|Array} type\n * The type value to test.\n *\n * @return {boolean}\n * Whether or not the type is a valid event type.\n */\n\n\nvar isValidEventType = function isValidEventType(type) {\n return (// The regex here verifies that the `type` contains at least one non-\n // whitespace character.\n typeof type === 'string' && /\\S/.test(type) || Array.isArray(type) && !!type.length\n );\n};\n/**\n * Validates a value to determine if it is a valid event target. Throws if not.\n *\n * @private\n * @throws {Error}\n * If the target does not appear to be a valid event target.\n *\n * @param {Object} target\n * The object to test.\n */\n\n\nvar validateTarget = function validateTarget(target) {\n if (!target.nodeName && !isEvented(target)) {\n throw new Error('Invalid target; must be a DOM node or evented object.');\n }\n};\n/**\n * Validates a value to determine if it is a valid event target. Throws if not.\n *\n * @private\n * @throws {Error}\n * If the type does not appear to be a valid event type.\n *\n * @param {string|Array} type\n * The type to test.\n */\n\n\nvar validateEventType = function validateEventType(type) {\n if (!isValidEventType(type)) {\n throw new Error('Invalid event type; must be a non-empty string or array.');\n }\n};\n/**\n * Validates a value to determine if it is a valid listener. Throws if not.\n *\n * @private\n * @throws {Error}\n * If the listener is not a function.\n *\n * @param {Function} listener\n * The listener to test.\n */\n\n\nvar validateListener = function validateListener(listener) {\n if (typeof listener !== 'function') {\n throw new Error('Invalid listener; must be a function.');\n }\n};\n/**\n * Takes an array of arguments given to `on()` or `one()`, validates them, and\n * normalizes them into an object.\n *\n * @private\n * @param {Object} self\n * The evented object on which `on()` or `one()` was called. This\n * object will be bound as the `this` value for the listener.\n *\n * @param {Array} args\n * An array of arguments passed to `on()` or `one()`.\n *\n * @return {Object}\n * An object containing useful values for `on()` or `one()` calls.\n */\n\n\nvar normalizeListenArgs = function normalizeListenArgs(self, args) {\n // If the number of arguments is less than 3, the target is always the\n // evented object itself.\n var isTargetingSelf = args.length < 3 || args[0] === self || args[0] === self.eventBusEl_;\n var target;\n var type;\n var listener;\n\n if (isTargetingSelf) {\n target = self.eventBusEl_; // Deal with cases where we got 3 arguments, but we are still listening to\n // the evented object itself.\n\n if (args.length >= 3) {\n args.shift();\n }\n\n type = args[0];\n listener = args[1];\n } else {\n target = args[0];\n type = args[1];\n listener = args[2];\n }\n\n validateTarget(target);\n validateEventType(type);\n validateListener(listener);\n listener = bind(self, listener);\n return {\n isTargetingSelf: isTargetingSelf,\n target: target,\n type: type,\n listener: listener\n };\n};\n/**\n * Adds the listener to the event type(s) on the target, normalizing for\n * the type of target.\n *\n * @private\n * @param {Element|Object} target\n * A DOM node or evented object.\n *\n * @param {string} method\n * The event binding method to use (\"on\" or \"one\").\n *\n * @param {string|Array} type\n * One or more event type(s).\n *\n * @param {Function} listener\n * A listener function.\n */\n\n\nvar listen = function listen(target, method, type, listener) {\n validateTarget(target);\n\n if (target.nodeName) {\n Events[method](target, type, listener);\n } else {\n target[method](type, listener);\n }\n};\n/**\n * Contains methods that provide event capabilities to an object which is passed\n * to {@link module:evented|evented}.\n *\n * @mixin EventedMixin\n */\n\n\nvar EventedMixin = {\n /**\n * Add a listener to an event (or events) on this object or another evented\n * object.\n *\n * @param {string|Array|Element|Object} targetOrType\n * If this is a string or array, it represents the event type(s)\n * that will trigger the listener.\n *\n * Another evented object can be passed here instead, which will\n * cause the listener to listen for events on _that_ object.\n *\n * In either case, the listener's `this` value will be bound to\n * this object.\n *\n * @param {string|Array|Function} typeOrListener\n * If the first argument was a string or array, this should be the\n * listener function. Otherwise, this is a string or array of event\n * type(s).\n *\n * @param {Function} [listener]\n * If the first argument was another evented object, this will be\n * the listener function.\n */\n on: function on$$1() {\n var _this = this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var _normalizeListenArgs = normalizeListenArgs(this, args),\n isTargetingSelf = _normalizeListenArgs.isTargetingSelf,\n target = _normalizeListenArgs.target,\n type = _normalizeListenArgs.type,\n listener = _normalizeListenArgs.listener;\n\n listen(target, 'on', type, listener); // If this object is listening to another evented object.\n\n if (!isTargetingSelf) {\n // If this object is disposed, remove the listener.\n var removeListenerOnDispose = function removeListenerOnDispose() {\n return _this.off(target, type, listener);\n }; // Use the same function ID as the listener so we can remove it later it\n // using the ID of the original listener.\n\n\n removeListenerOnDispose.guid = listener.guid; // Add a listener to the target's dispose event as well. This ensures\n // that if the target is disposed BEFORE this object, we remove the\n // removal listener that was just added. Otherwise, we create a memory leak.\n\n var removeRemoverOnTargetDispose = function removeRemoverOnTargetDispose() {\n return _this.off('dispose', removeListenerOnDispose);\n }; // Use the same function ID as the listener so we can remove it later\n // it using the ID of the original listener.\n\n\n removeRemoverOnTargetDispose.guid = listener.guid;\n listen(this, 'on', 'dispose', removeListenerOnDispose);\n listen(target, 'on', 'dispose', removeRemoverOnTargetDispose);\n }\n },\n\n /**\n * Add a listener to an event (or events) on this object or another evented\n * object. The listener will only be called once and then removed.\n *\n * @param {string|Array|Element|Object} targetOrType\n * If this is a string or array, it represents the event type(s)\n * that will trigger the listener.\n *\n * Another evented object can be passed here instead, which will\n * cause the listener to listen for events on _that_ object.\n *\n * In either case, the listener's `this` value will be bound to\n * this object.\n *\n * @param {string|Array|Function} typeOrListener\n * If the first argument was a string or array, this should be the\n * listener function. Otherwise, this is a string or array of event\n * type(s).\n *\n * @param {Function} [listener]\n * If the first argument was another evented object, this will be\n * the listener function.\n */\n one: function one$$1() {\n var _this2 = this;\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n var _normalizeListenArgs2 = normalizeListenArgs(this, args),\n isTargetingSelf = _normalizeListenArgs2.isTargetingSelf,\n target = _normalizeListenArgs2.target,\n type = _normalizeListenArgs2.type,\n listener = _normalizeListenArgs2.listener; // Targeting this evented object.\n\n\n if (isTargetingSelf) {\n listen(target, 'one', type, listener); // Targeting another evented object.\n } else {\n var wrapper = function wrapper() {\n _this2.off(target, type, wrapper);\n\n for (var _len3 = arguments.length, largs = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n largs[_key3] = arguments[_key3];\n }\n\n listener.apply(null, largs);\n }; // Use the same function ID as the listener so we can remove it later\n // it using the ID of the original listener.\n\n\n wrapper.guid = listener.guid;\n listen(target, 'one', type, wrapper);\n }\n },\n\n /**\n * Removes listener(s) from event(s) on an evented object.\n *\n * @param {string|Array|Element|Object} [targetOrType]\n * If this is a string or array, it represents the event type(s).\n *\n * Another evented object can be passed here instead, in which case\n * ALL 3 arguments are _required_.\n *\n * @param {string|Array|Function} [typeOrListener]\n * If the first argument was a string or array, this may be the\n * listener function. Otherwise, this is a string or array of event\n * type(s).\n *\n * @param {Function} [listener]\n * If the first argument was another evented object, this will be\n * the listener function; otherwise, _all_ listeners bound to the\n * event type(s) will be removed.\n */\n off: function off$$1(targetOrType, typeOrListener, listener) {\n // Targeting this evented object.\n if (!targetOrType || isValidEventType(targetOrType)) {\n off(this.eventBusEl_, targetOrType, typeOrListener); // Targeting another evented object.\n } else {\n var target = targetOrType;\n var type = typeOrListener; // Fail fast and in a meaningful way!\n\n validateTarget(target);\n validateEventType(type);\n validateListener(listener); // Ensure there's at least a guid, even if the function hasn't been used\n\n listener = bind(this, listener); // Remove the dispose listener on this evented object, which was given\n // the same guid as the event listener in on().\n\n this.off('dispose', listener);\n\n if (target.nodeName) {\n off(target, type, listener);\n off(target, 'dispose', listener);\n } else if (isEvented(target)) {\n target.off(type, listener);\n target.off('dispose', listener);\n }\n }\n },\n\n /**\n * Fire an event on this evented object, causing its listeners to be called.\n *\n * @param {string|Object} event\n * An event type or an object with a type property.\n *\n * @param {Object} [hash]\n * An additional object to pass along to listeners.\n *\n * @return {boolean}\n * Whether or not the default behavior was prevented.\n */\n trigger: function trigger$$1(event, hash) {\n return trigger(this.eventBusEl_, event, hash);\n }\n};\n/**\n * Applies {@link module:evented~EventedMixin|EventedMixin} to a target object.\n *\n * @param {Object} target\n * The object to which to add event methods.\n *\n * @param {Object} [options={}]\n * Options for customizing the mixin behavior.\n *\n * @param {string} [options.eventBusKey]\n * By default, adds a `eventBusEl_` DOM element to the target object,\n * which is used as an event bus. If the target object already has a\n * DOM element that should be used, pass its key here.\n *\n * @return {Object}\n * The target object.\n */\n\nfunction evented(target, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n eventBusKey = _options.eventBusKey; // Set or create the eventBusEl_.\n\n if (eventBusKey) {\n if (!target[eventBusKey].nodeName) {\n throw new Error(\"The eventBusKey \\\"\" + eventBusKey + \"\\\" does not refer to an element.\");\n }\n\n target.eventBusEl_ = target[eventBusKey];\n } else {\n target.eventBusEl_ = createEl('span', {\n className: 'vjs-event-bus'\n });\n }\n\n assign(target, EventedMixin);\n\n if (target.eventedCallbacks) {\n target.eventedCallbacks.forEach(function (callback) {\n callback();\n });\n } // When any evented object is disposed, it removes all its listeners.\n\n\n target.on('dispose', function () {\n target.off();\n window$1.setTimeout(function () {\n target.eventBusEl_ = null;\n }, 0);\n });\n return target;\n}\n\n/**\n * @file mixins/stateful.js\n * @module stateful\n */\n/**\n * Contains methods that provide statefulness to an object which is passed\n * to {@link module:stateful}.\n *\n * @mixin StatefulMixin\n */\n\nvar StatefulMixin = {\n /**\n * A hash containing arbitrary keys and values representing the state of\n * the object.\n *\n * @type {Object}\n */\n state: {},\n\n /**\n * Set the state of an object by mutating its\n * {@link module:stateful~StatefulMixin.state|state} object in place.\n *\n * @fires module:stateful~StatefulMixin#statechanged\n * @param {Object|Function} stateUpdates\n * A new set of properties to shallow-merge into the plugin state.\n * Can be a plain object or a function returning a plain object.\n *\n * @return {Object|undefined}\n * An object containing changes that occurred. If no changes\n * occurred, returns `undefined`.\n */\n setState: function setState(stateUpdates) {\n var _this = this;\n\n // Support providing the `stateUpdates` state as a function.\n if (typeof stateUpdates === 'function') {\n stateUpdates = stateUpdates();\n }\n\n var changes;\n each(stateUpdates, function (value, key) {\n // Record the change if the value is different from what's in the\n // current state.\n if (_this.state[key] !== value) {\n changes = changes || {};\n changes[key] = {\n from: _this.state[key],\n to: value\n };\n }\n\n _this.state[key] = value;\n }); // Only trigger \"statechange\" if there were changes AND we have a trigger\n // function. This allows us to not require that the target object be an\n // evented object.\n\n if (changes && isEvented(this)) {\n /**\n * An event triggered on an object that is both\n * {@link module:stateful|stateful} and {@link module:evented|evented}\n * indicating that its state has changed.\n *\n * @event module:stateful~StatefulMixin#statechanged\n * @type {Object}\n * @property {Object} changes\n * A hash containing the properties that were changed and\n * the values they were changed `from` and `to`.\n */\n this.trigger({\n changes: changes,\n type: 'statechanged'\n });\n }\n\n return changes;\n }\n};\n/**\n * Applies {@link module:stateful~StatefulMixin|StatefulMixin} to a target\n * object.\n *\n * If the target object is {@link module:evented|evented} and has a\n * `handleStateChanged` method, that method will be automatically bound to the\n * `statechanged` event on itself.\n *\n * @param {Object} target\n * The object to be made stateful.\n *\n * @param {Object} [defaultState]\n * A default set of properties to populate the newly-stateful object's\n * `state` property.\n *\n * @return {Object}\n * Returns the `target`.\n */\n\nfunction stateful(target, defaultState) {\n assign(target, StatefulMixin); // This happens after the mixing-in because we need to replace the `state`\n // added in that step.\n\n target.state = assign({}, target.state, defaultState); // Auto-bind the `handleStateChanged` method of the target object if it exists.\n\n if (typeof target.handleStateChanged === 'function' && isEvented(target)) {\n target.on('statechanged', target.handleStateChanged);\n }\n\n return target;\n}\n\n/**\n * @file to-title-case.js\n * @module to-title-case\n */\n\n/**\n * Uppercase the first letter of a string.\n *\n * @param {string} string\n * String to be uppercased\n *\n * @return {string}\n * The string with an uppercased first letter\n */\nfunction toTitleCase(string) {\n if (typeof string !== 'string') {\n return string;\n }\n\n return string.charAt(0).toUpperCase() + string.slice(1);\n}\n/**\n * Compares the TitleCase versions of the two strings for equality.\n *\n * @param {string} str1\n * The first string to compare\n *\n * @param {string} str2\n * The second string to compare\n *\n * @return {boolean}\n * Whether the TitleCase versions of the strings are equal\n */\n\nfunction titleCaseEquals(str1, str2) {\n return toTitleCase(str1) === toTitleCase(str2);\n}\n\n/**\n * @file merge-options.js\n * @module merge-options\n */\n/**\n * Merge two objects recursively.\n *\n * Performs a deep merge like\n * {@link https://lodash.com/docs/4.17.10#merge|lodash.merge}, but only merges\n * plain objects (not arrays, elements, or anything else).\n *\n * Non-plain object values will be copied directly from the right-most\n * argument.\n *\n * @static\n * @param {Object[]} sources\n * One or more objects to merge into a new object.\n *\n * @return {Object}\n * A new object that is the merged result of all sources.\n */\n\nfunction mergeOptions() {\n var result = {};\n\n for (var _len = arguments.length, sources = new Array(_len), _key = 0; _key < _len; _key++) {\n sources[_key] = arguments[_key];\n }\n\n sources.forEach(function (source) {\n if (!source) {\n return;\n }\n\n each(source, function (value, key) {\n if (!isPlain(value)) {\n result[key] = value;\n return;\n }\n\n if (!isPlain(result[key])) {\n result[key] = {};\n }\n\n result[key] = mergeOptions(result[key], value);\n });\n });\n return result;\n}\n\n/**\n * Player Component - Base class for all UI objects\n *\n * @file component.js\n */\n/**\n * Base class for all UI Components.\n * Components are UI objects which represent both a javascript object and an element\n * in the DOM. They can be children of other components, and can have\n * children themselves.\n *\n * Components can also use methods from {@link EventTarget}\n */\n\nvar Component =\n/*#__PURE__*/\nfunction () {\n /**\n * A callback that is called when a component is ready. Does not have any\n * paramters and any callback value will be ignored.\n *\n * @callback Component~ReadyCallback\n * @this Component\n */\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Object[]} [options.children]\n * An array of children objects to intialize this component with. Children objects have\n * a name property that will be used if more than one component of the same type needs to be\n * added.\n *\n * @param {Component~ReadyCallback} [ready]\n * Function that gets called when the `Component` is ready.\n */\n function Component(player, options, ready) {\n // The component might be the player itself and we can't pass `this` to super\n if (!player && this.play) {\n this.player_ = player = this; // eslint-disable-line\n } else {\n this.player_ = player;\n } // Make a copy of prototype.options_ to protect against overriding defaults\n\n\n this.options_ = mergeOptions({}, this.options_); // Updated options with supplied options\n\n options = this.options_ = mergeOptions(this.options_, options); // Get ID from options or options element if one is supplied\n\n this.id_ = options.id || options.el && options.el.id; // If there was no ID from the options, generate one\n\n if (!this.id_) {\n // Don't require the player ID function in the case of mock players\n var id = player && player.id && player.id() || 'no_player';\n this.id_ = id + \"_component_\" + newGUID();\n }\n\n this.name_ = options.name || null; // Create element if one wasn't provided in options\n\n if (options.el) {\n this.el_ = options.el;\n } else if (options.createEl !== false) {\n this.el_ = this.createEl();\n } // if evented is anything except false, we want to mixin in evented\n\n\n if (options.evented !== false) {\n // Make this an evented object and use `el_`, if available, as its event bus\n evented(this, {\n eventBusKey: this.el_ ? 'el_' : null\n });\n }\n\n stateful(this, this.constructor.defaultState);\n this.children_ = [];\n this.childIndex_ = {};\n this.childNameIndex_ = {}; // Add any child components in options\n\n if (options.initChildren !== false) {\n this.initChildren();\n }\n\n this.ready(ready); // Don't want to trigger ready here or it will before init is actually\n // finished for all children that run this constructor\n\n if (options.reportTouchActivity !== false) {\n this.enableTouchActivity();\n }\n }\n /**\n * Dispose of the `Component` and all child components.\n *\n * @fires Component#dispose\n */\n\n\n var _proto = Component.prototype;\n\n _proto.dispose = function dispose() {\n /**\n * Triggered when a `Component` is disposed.\n *\n * @event Component#dispose\n * @type {EventTarget~Event}\n *\n * @property {boolean} [bubbles=false]\n * set to false so that the close event does not\n * bubble up\n */\n this.trigger({\n type: 'dispose',\n bubbles: false\n }); // Dispose all children.\n\n if (this.children_) {\n for (var i = this.children_.length - 1; i >= 0; i--) {\n if (this.children_[i].dispose) {\n this.children_[i].dispose();\n }\n }\n } // Delete child references\n\n\n this.children_ = null;\n this.childIndex_ = null;\n this.childNameIndex_ = null;\n\n if (this.el_) {\n // Remove element from DOM\n if (this.el_.parentNode) {\n this.el_.parentNode.removeChild(this.el_);\n }\n\n removeData(this.el_);\n this.el_ = null;\n } // remove reference to the player after disposing of the element\n\n\n this.player_ = null;\n };\n /**\n * Return the {@link Player} that the `Component` has attached to.\n *\n * @return {Player}\n * The player that this `Component` has attached to.\n */\n\n\n _proto.player = function player() {\n return this.player_;\n };\n /**\n * Deep merge of options objects with new options.\n * > Note: When both `obj` and `options` contain properties whose values are objects.\n * The two properties get merged using {@link module:mergeOptions}\n *\n * @param {Object} obj\n * The object that contains new options.\n *\n * @return {Object}\n * A new object of `this.options_` and `obj` merged together.\n *\n * @deprecated since version 5\n */\n\n\n _proto.options = function options(obj) {\n log.warn('this.options() has been deprecated and will be moved to the constructor in 6.0');\n\n if (!obj) {\n return this.options_;\n }\n\n this.options_ = mergeOptions(this.options_, obj);\n return this.options_;\n };\n /**\n * Get the `Component`s DOM element\n *\n * @return {Element}\n * The DOM element for this `Component`.\n */\n\n\n _proto.el = function el() {\n return this.el_;\n };\n /**\n * Create the `Component`s DOM element.\n *\n * @param {string} [tagName]\n * Element's DOM node type. e.g. 'div'\n *\n * @param {Object} [properties]\n * An object of properties that should be set.\n *\n * @param {Object} [attributes]\n * An object of attributes that should be set.\n *\n * @return {Element}\n * The element that gets created.\n */\n\n\n _proto.createEl = function createEl$$1(tagName, properties, attributes) {\n return createEl(tagName, properties, attributes);\n };\n /**\n * Localize a string given the string in english.\n *\n * If tokens are provided, it'll try and run a simple token replacement on the provided string.\n * The tokens it looks for look like `{1}` with the index being 1-indexed into the tokens array.\n *\n * If a `defaultValue` is provided, it'll use that over `string`,\n * if a value isn't found in provided language files.\n * This is useful if you want to have a descriptive key for token replacement\n * but have a succinct localized string and not require `en.json` to be included.\n *\n * Currently, it is used for the progress bar timing.\n * ```js\n * {\n * \"progress bar timing: currentTime={1} duration={2}\": \"{1} of {2}\"\n * }\n * ```\n * It is then used like so:\n * ```js\n * this.localize('progress bar timing: currentTime={1} duration{2}',\n * [this.player_.currentTime(), this.player_.duration()],\n * '{1} of {2}');\n * ```\n *\n * Which outputs something like: `01:23 of 24:56`.\n *\n *\n * @param {string} string\n * The string to localize and the key to lookup in the language files.\n * @param {string[]} [tokens]\n * If the current item has token replacements, provide the tokens here.\n * @param {string} [defaultValue]\n * Defaults to `string`. Can be a default value to use for token replacement\n * if the lookup key is needed to be separate.\n *\n * @return {string}\n * The localized string or if no localization exists the english string.\n */\n\n\n _proto.localize = function localize(string, tokens, defaultValue) {\n if (defaultValue === void 0) {\n defaultValue = string;\n }\n\n var code = this.player_.language && this.player_.language();\n var languages = this.player_.languages && this.player_.languages();\n var language = languages && languages[code];\n var primaryCode = code && code.split('-')[0];\n var primaryLang = languages && languages[primaryCode];\n var localizedString = defaultValue;\n\n if (language && language[string]) {\n localizedString = language[string];\n } else if (primaryLang && primaryLang[string]) {\n localizedString = primaryLang[string];\n }\n\n if (tokens) {\n localizedString = localizedString.replace(/\\{(\\d+)\\}/g, function (match, index) {\n var value = tokens[index - 1];\n var ret = value;\n\n if (typeof value === 'undefined') {\n ret = match;\n }\n\n return ret;\n });\n }\n\n return localizedString;\n };\n /**\n * Return the `Component`s DOM element. This is where children get inserted.\n * This will usually be the the same as the element returned in {@link Component#el}.\n *\n * @return {Element}\n * The content element for this `Component`.\n */\n\n\n _proto.contentEl = function contentEl() {\n return this.contentEl_ || this.el_;\n };\n /**\n * Get this `Component`s ID\n *\n * @return {string}\n * The id of this `Component`\n */\n\n\n _proto.id = function id() {\n return this.id_;\n };\n /**\n * Get the `Component`s name. The name gets used to reference the `Component`\n * and is set during registration.\n *\n * @return {string}\n * The name of this `Component`.\n */\n\n\n _proto.name = function name() {\n return this.name_;\n };\n /**\n * Get an array of all child components\n *\n * @return {Array}\n * The children\n */\n\n\n _proto.children = function children() {\n return this.children_;\n };\n /**\n * Returns the child `Component` with the given `id`.\n *\n * @param {string} id\n * The id of the child `Component` to get.\n *\n * @return {Component|undefined}\n * The child `Component` with the given `id` or undefined.\n */\n\n\n _proto.getChildById = function getChildById(id) {\n return this.childIndex_[id];\n };\n /**\n * Returns the child `Component` with the given `name`.\n *\n * @param {string} name\n * The name of the child `Component` to get.\n *\n * @return {Component|undefined}\n * The child `Component` with the given `name` or undefined.\n */\n\n\n _proto.getChild = function getChild(name) {\n if (!name) {\n return;\n }\n\n name = toTitleCase(name);\n return this.childNameIndex_[name];\n };\n /**\n * Add a child `Component` inside the current `Component`.\n *\n *\n * @param {string|Component} child\n * The name or instance of a child to add.\n *\n * @param {Object} [options={}]\n * The key/value store of options that will get passed to children of\n * the child.\n *\n * @param {number} [index=this.children_.length]\n * The index to attempt to add a child into.\n *\n * @return {Component}\n * The `Component` that gets added as a child. When using a string the\n * `Component` will get created by this process.\n */\n\n\n _proto.addChild = function addChild(child, options, index) {\n if (options === void 0) {\n options = {};\n }\n\n if (index === void 0) {\n index = this.children_.length;\n }\n\n var component;\n var componentName; // If child is a string, create component with options\n\n if (typeof child === 'string') {\n componentName = toTitleCase(child);\n var componentClassName = options.componentClass || componentName; // Set name through options\n\n options.name = componentName; // Create a new object & element for this controls set\n // If there's no .player_, this is a player\n\n var ComponentClass = Component.getComponent(componentClassName);\n\n if (!ComponentClass) {\n throw new Error(\"Component \" + componentClassName + \" does not exist\");\n } // data stored directly on the videojs object may be\n // misidentified as a component to retain\n // backwards-compatibility with 4.x. check to make sure the\n // component class can be instantiated.\n\n\n if (typeof ComponentClass !== 'function') {\n return null;\n }\n\n component = new ComponentClass(this.player_ || this, options); // child is a component instance\n } else {\n component = child;\n }\n\n this.children_.splice(index, 0, component);\n\n if (typeof component.id === 'function') {\n this.childIndex_[component.id()] = component;\n } // If a name wasn't used to create the component, check if we can use the\n // name function of the component\n\n\n componentName = componentName || component.name && toTitleCase(component.name());\n\n if (componentName) {\n this.childNameIndex_[componentName] = component;\n } // Add the UI object's element to the container div (box)\n // Having an element is not required\n\n\n if (typeof component.el === 'function' && component.el()) {\n var childNodes = this.contentEl().children;\n var refNode = childNodes[index] || null;\n this.contentEl().insertBefore(component.el(), refNode);\n } // Return so it can stored on parent object if desired.\n\n\n return component;\n };\n /**\n * Remove a child `Component` from this `Component`s list of children. Also removes\n * the child `Component`s element from this `Component`s element.\n *\n * @param {Component} component\n * The child `Component` to remove.\n */\n\n\n _proto.removeChild = function removeChild(component) {\n if (typeof component === 'string') {\n component = this.getChild(component);\n }\n\n if (!component || !this.children_) {\n return;\n }\n\n var childFound = false;\n\n for (var i = this.children_.length - 1; i >= 0; i--) {\n if (this.children_[i] === component) {\n childFound = true;\n this.children_.splice(i, 1);\n break;\n }\n }\n\n if (!childFound) {\n return;\n }\n\n this.childIndex_[component.id()] = null;\n this.childNameIndex_[component.name()] = null;\n var compEl = component.el();\n\n if (compEl && compEl.parentNode === this.contentEl()) {\n this.contentEl().removeChild(component.el());\n }\n };\n /**\n * Add and initialize default child `Component`s based upon options.\n */\n\n\n _proto.initChildren = function initChildren() {\n var _this = this;\n\n var children = this.options_.children;\n\n if (children) {\n // `this` is `parent`\n var parentOptions = this.options_;\n\n var handleAdd = function handleAdd(child) {\n var name = child.name;\n var opts = child.opts; // Allow options for children to be set at the parent options\n // e.g. videojs(id, { controlBar: false });\n // instead of videojs(id, { children: { controlBar: false });\n\n if (parentOptions[name] !== undefined) {\n opts = parentOptions[name];\n } // Allow for disabling default components\n // e.g. options['children']['posterImage'] = false\n\n\n if (opts === false) {\n return;\n } // Allow options to be passed as a simple boolean if no configuration\n // is necessary.\n\n\n if (opts === true) {\n opts = {};\n } // We also want to pass the original player options\n // to each component as well so they don't need to\n // reach back into the player for options later.\n\n\n opts.playerOptions = _this.options_.playerOptions; // Create and add the child component.\n // Add a direct reference to the child by name on the parent instance.\n // If two of the same component are used, different names should be supplied\n // for each\n\n var newChild = _this.addChild(name, opts);\n\n if (newChild) {\n _this[name] = newChild;\n }\n }; // Allow for an array of children details to passed in the options\n\n\n var workingChildren;\n var Tech = Component.getComponent('Tech');\n\n if (Array.isArray(children)) {\n workingChildren = children;\n } else {\n workingChildren = Object.keys(children);\n }\n\n workingChildren // children that are in this.options_ but also in workingChildren would\n // give us extra children we do not want. So, we want to filter them out.\n .concat(Object.keys(this.options_).filter(function (child) {\n return !workingChildren.some(function (wchild) {\n if (typeof wchild === 'string') {\n return child === wchild;\n }\n\n return child === wchild.name;\n });\n })).map(function (child) {\n var name;\n var opts;\n\n if (typeof child === 'string') {\n name = child;\n opts = children[name] || _this.options_[name] || {};\n } else {\n name = child.name;\n opts = child;\n }\n\n return {\n name: name,\n opts: opts\n };\n }).filter(function (child) {\n // we have to make sure that child.name isn't in the techOrder since\n // techs are registerd as Components but can't aren't compatible\n // See https://github.com/videojs/video.js/issues/2772\n var c = Component.getComponent(child.opts.componentClass || toTitleCase(child.name));\n return c && !Tech.isTech(c);\n }).forEach(handleAdd);\n }\n };\n /**\n * Builds the default DOM class name. Should be overriden by sub-components.\n *\n * @return {string}\n * The DOM class name for this object.\n *\n * @abstract\n */\n\n\n _proto.buildCSSClass = function buildCSSClass() {\n // Child classes can include a function that does:\n // return 'CLASS NAME' + this._super();\n return '';\n };\n /**\n * Bind a listener to the component's ready state.\n * Different from event listeners in that if the ready event has already happened\n * it will trigger the function immediately.\n *\n * @return {Component}\n * Returns itself; method can be chained.\n */\n\n\n _proto.ready = function ready(fn, sync) {\n if (sync === void 0) {\n sync = false;\n }\n\n if (!fn) {\n return;\n }\n\n if (!this.isReady_) {\n this.readyQueue_ = this.readyQueue_ || [];\n this.readyQueue_.push(fn);\n return;\n }\n\n if (sync) {\n fn.call(this);\n } else {\n // Call the function asynchronously by default for consistency\n this.setTimeout(fn, 1);\n }\n };\n /**\n * Trigger all the ready listeners for this `Component`.\n *\n * @fires Component#ready\n */\n\n\n _proto.triggerReady = function triggerReady() {\n this.isReady_ = true; // Ensure ready is triggered asynchronously\n\n this.setTimeout(function () {\n var readyQueue = this.readyQueue_; // Reset Ready Queue\n\n this.readyQueue_ = [];\n\n if (readyQueue && readyQueue.length > 0) {\n readyQueue.forEach(function (fn) {\n fn.call(this);\n }, this);\n } // Allow for using event listeners also\n\n /**\n * Triggered when a `Component` is ready.\n *\n * @event Component#ready\n * @type {EventTarget~Event}\n */\n\n\n this.trigger('ready');\n }, 1);\n };\n /**\n * Find a single DOM element matching a `selector`. This can be within the `Component`s\n * `contentEl()` or another custom context.\n *\n * @param {string} selector\n * A valid CSS selector, which will be passed to `querySelector`.\n *\n * @param {Element|string} [context=this.contentEl()]\n * A DOM element within which to query. Can also be a selector string in\n * which case the first matching element will get used as context. If\n * missing `this.contentEl()` gets used. If `this.contentEl()` returns\n * nothing it falls back to `document`.\n *\n * @return {Element|null}\n * the dom element that was found, or null\n *\n * @see [Information on CSS Selectors](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_Started/Selectors)\n */\n\n\n _proto.$ = function $$$1(selector, context) {\n return $(selector, context || this.contentEl());\n };\n /**\n * Finds all DOM element matching a `selector`. This can be within the `Component`s\n * `contentEl()` or another custom context.\n *\n * @param {string} selector\n * A valid CSS selector, which will be passed to `querySelectorAll`.\n *\n * @param {Element|string} [context=this.contentEl()]\n * A DOM element within which to query. Can also be a selector string in\n * which case the first matching element will get used as context. If\n * missing `this.contentEl()` gets used. If `this.contentEl()` returns\n * nothing it falls back to `document`.\n *\n * @return {NodeList}\n * a list of dom elements that were found\n *\n * @see [Information on CSS Selectors](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_Started/Selectors)\n */\n\n\n _proto.$$ = function $$$$1(selector, context) {\n return $$(selector, context || this.contentEl());\n };\n /**\n * Check if a component's element has a CSS class name.\n *\n * @param {string} classToCheck\n * CSS class name to check.\n *\n * @return {boolean}\n * - True if the `Component` has the class.\n * - False if the `Component` does not have the class`\n */\n\n\n _proto.hasClass = function hasClass$$1(classToCheck) {\n return hasClass(this.el_, classToCheck);\n };\n /**\n * Add a CSS class name to the `Component`s element.\n *\n * @param {string} classToAdd\n * CSS class name to add\n */\n\n\n _proto.addClass = function addClass$$1(classToAdd) {\n addClass(this.el_, classToAdd);\n };\n /**\n * Remove a CSS class name from the `Component`s element.\n *\n * @param {string} classToRemove\n * CSS class name to remove\n */\n\n\n _proto.removeClass = function removeClass$$1(classToRemove) {\n removeClass(this.el_, classToRemove);\n };\n /**\n * Add or remove a CSS class name from the component's element.\n * - `classToToggle` gets added when {@link Component#hasClass} would return false.\n * - `classToToggle` gets removed when {@link Component#hasClass} would return true.\n *\n * @param {string} classToToggle\n * The class to add or remove based on (@link Component#hasClass}\n *\n * @param {boolean|Dom~predicate} [predicate]\n * An {@link Dom~predicate} function or a boolean\n */\n\n\n _proto.toggleClass = function toggleClass$$1(classToToggle, predicate) {\n toggleClass(this.el_, classToToggle, predicate);\n };\n /**\n * Show the `Component`s element if it is hidden by removing the\n * 'vjs-hidden' class name from it.\n */\n\n\n _proto.show = function show() {\n this.removeClass('vjs-hidden');\n };\n /**\n * Hide the `Component`s element if it is currently showing by adding the\n * 'vjs-hidden` class name to it.\n */\n\n\n _proto.hide = function hide() {\n this.addClass('vjs-hidden');\n };\n /**\n * Lock a `Component`s element in its visible state by adding the 'vjs-lock-showing'\n * class name to it. Used during fadeIn/fadeOut.\n *\n * @private\n */\n\n\n _proto.lockShowing = function lockShowing() {\n this.addClass('vjs-lock-showing');\n };\n /**\n * Unlock a `Component`s element from its visible state by removing the 'vjs-lock-showing'\n * class name from it. Used during fadeIn/fadeOut.\n *\n * @private\n */\n\n\n _proto.unlockShowing = function unlockShowing() {\n this.removeClass('vjs-lock-showing');\n };\n /**\n * Get the value of an attribute on the `Component`s element.\n *\n * @param {string} attribute\n * Name of the attribute to get the value from.\n *\n * @return {string|null}\n * - The value of the attribute that was asked for.\n * - Can be an empty string on some browsers if the attribute does not exist\n * or has no value\n * - Most browsers will return null if the attibute does not exist or has\n * no value.\n *\n * @see [DOM API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttribute}\n */\n\n\n _proto.getAttribute = function getAttribute$$1(attribute) {\n return getAttribute(this.el_, attribute);\n };\n /**\n * Set the value of an attribute on the `Component`'s element\n *\n * @param {string} attribute\n * Name of the attribute to set.\n *\n * @param {string} value\n * Value to set the attribute to.\n *\n * @see [DOM API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttribute}\n */\n\n\n _proto.setAttribute = function setAttribute$$1(attribute, value) {\n setAttribute(this.el_, attribute, value);\n };\n /**\n * Remove an attribute from the `Component`s element.\n *\n * @param {string} attribute\n * Name of the attribute to remove.\n *\n * @see [DOM API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Element/removeAttribute}\n */\n\n\n _proto.removeAttribute = function removeAttribute$$1(attribute) {\n removeAttribute(this.el_, attribute);\n };\n /**\n * Get or set the width of the component based upon the CSS styles.\n * See {@link Component#dimension} for more detailed information.\n *\n * @param {number|string} [num]\n * The width that you want to set postfixed with '%', 'px' or nothing.\n *\n * @param {boolean} [skipListeners]\n * Skip the componentresize event trigger\n *\n * @return {number|string}\n * The width when getting, zero if there is no width. Can be a string\n * postpixed with '%' or 'px'.\n */\n\n\n _proto.width = function width(num, skipListeners) {\n return this.dimension('width', num, skipListeners);\n };\n /**\n * Get or set the height of the component based upon the CSS styles.\n * See {@link Component#dimension} for more detailed information.\n *\n * @param {number|string} [num]\n * The height that you want to set postfixed with '%', 'px' or nothing.\n *\n * @param {boolean} [skipListeners]\n * Skip the componentresize event trigger\n *\n * @return {number|string}\n * The width when getting, zero if there is no width. Can be a string\n * postpixed with '%' or 'px'.\n */\n\n\n _proto.height = function height(num, skipListeners) {\n return this.dimension('height', num, skipListeners);\n };\n /**\n * Set both the width and height of the `Component` element at the same time.\n *\n * @param {number|string} width\n * Width to set the `Component`s element to.\n *\n * @param {number|string} height\n * Height to set the `Component`s element to.\n */\n\n\n _proto.dimensions = function dimensions(width, height) {\n // Skip componentresize listeners on width for optimization\n this.width(width, true);\n this.height(height);\n };\n /**\n * Get or set width or height of the `Component` element. This is the shared code\n * for the {@link Component#width} and {@link Component#height}.\n *\n * Things to know:\n * - If the width or height in an number this will return the number postfixed with 'px'.\n * - If the width/height is a percent this will return the percent postfixed with '%'\n * - Hidden elements have a width of 0 with `window.getComputedStyle`. This function\n * defaults to the `Component`s `style.width` and falls back to `window.getComputedStyle`.\n * See [this]{@link http://www.foliotek.com/devblog/getting-the-width-of-a-hidden-element-with-jquery-using-width/}\n * for more information\n * - If you want the computed style of the component, use {@link Component#currentWidth}\n * and {@link {Component#currentHeight}\n *\n * @fires Component#componentresize\n *\n * @param {string} widthOrHeight\n 8 'width' or 'height'\n *\n * @param {number|string} [num]\n 8 New dimension\n *\n * @param {boolean} [skipListeners]\n * Skip componentresize event trigger\n *\n * @return {number}\n * The dimension when getting or 0 if unset\n */\n\n\n _proto.dimension = function dimension(widthOrHeight, num, skipListeners) {\n if (num !== undefined) {\n // Set to zero if null or literally NaN (NaN !== NaN)\n if (num === null || num !== num) {\n num = 0;\n } // Check if using css width/height (% or px) and adjust\n\n\n if (('' + num).indexOf('%') !== -1 || ('' + num).indexOf('px') !== -1) {\n this.el_.style[widthOrHeight] = num;\n } else if (num === 'auto') {\n this.el_.style[widthOrHeight] = '';\n } else {\n this.el_.style[widthOrHeight] = num + 'px';\n } // skipListeners allows us to avoid triggering the resize event when setting both width and height\n\n\n if (!skipListeners) {\n /**\n * Triggered when a component is resized.\n *\n * @event Component#componentresize\n * @type {EventTarget~Event}\n */\n this.trigger('componentresize');\n }\n\n return;\n } // Not setting a value, so getting it\n // Make sure element exists\n\n\n if (!this.el_) {\n return 0;\n } // Get dimension value from style\n\n\n var val = this.el_.style[widthOrHeight];\n var pxIndex = val.indexOf('px');\n\n if (pxIndex !== -1) {\n // Return the pixel value with no 'px'\n return parseInt(val.slice(0, pxIndex), 10);\n } // No px so using % or no style was set, so falling back to offsetWidth/height\n // If component has display:none, offset will return 0\n // TODO: handle display:none and no dimension style using px\n\n\n return parseInt(this.el_['offset' + toTitleCase(widthOrHeight)], 10);\n };\n /**\n * Get the computed width or the height of the component's element.\n *\n * Uses `window.getComputedStyle`.\n *\n * @param {string} widthOrHeight\n * A string containing 'width' or 'height'. Whichever one you want to get.\n *\n * @return {number}\n * The dimension that gets asked for or 0 if nothing was set\n * for that dimension.\n */\n\n\n _proto.currentDimension = function currentDimension(widthOrHeight) {\n var computedWidthOrHeight = 0;\n\n if (widthOrHeight !== 'width' && widthOrHeight !== 'height') {\n throw new Error('currentDimension only accepts width or height value');\n }\n\n if (typeof window$1.getComputedStyle === 'function') {\n var computedStyle = window$1.getComputedStyle(this.el_);\n computedWidthOrHeight = computedStyle.getPropertyValue(widthOrHeight) || computedStyle[widthOrHeight];\n } // remove 'px' from variable and parse as integer\n\n\n computedWidthOrHeight = parseFloat(computedWidthOrHeight); // if the computed value is still 0, it's possible that the browser is lying\n // and we want to check the offset values.\n // This code also runs wherever getComputedStyle doesn't exist.\n\n if (computedWidthOrHeight === 0) {\n var rule = \"offset\" + toTitleCase(widthOrHeight);\n computedWidthOrHeight = this.el_[rule];\n }\n\n return computedWidthOrHeight;\n };\n /**\n * An object that contains width and height values of the `Component`s\n * computed style. Uses `window.getComputedStyle`.\n *\n * @typedef {Object} Component~DimensionObject\n *\n * @property {number} width\n * The width of the `Component`s computed style.\n *\n * @property {number} height\n * The height of the `Component`s computed style.\n */\n\n /**\n * Get an object that contains computed width and height values of the\n * component's element.\n *\n * Uses `window.getComputedStyle`.\n *\n * @return {Component~DimensionObject}\n * The computed dimensions of the component's element.\n */\n\n\n _proto.currentDimensions = function currentDimensions() {\n return {\n width: this.currentDimension('width'),\n height: this.currentDimension('height')\n };\n };\n /**\n * Get the computed width of the component's element.\n *\n * Uses `window.getComputedStyle`.\n *\n * @return {number}\n * The computed width of the component's element.\n */\n\n\n _proto.currentWidth = function currentWidth() {\n return this.currentDimension('width');\n };\n /**\n * Get the computed height of the component's element.\n *\n * Uses `window.getComputedStyle`.\n *\n * @return {number}\n * The computed height of the component's element.\n */\n\n\n _proto.currentHeight = function currentHeight() {\n return this.currentDimension('height');\n };\n /**\n * Set the focus to this component\n */\n\n\n _proto.focus = function focus() {\n this.el_.focus();\n };\n /**\n * Remove the focus from this component\n */\n\n\n _proto.blur = function blur() {\n this.el_.blur();\n };\n /**\n * Emit a 'tap' events when touch event support gets detected. This gets used to\n * support toggling the controls through a tap on the video. They get enabled\n * because every sub-component would have extra overhead otherwise.\n *\n * @private\n * @fires Component#tap\n * @listens Component#touchstart\n * @listens Component#touchmove\n * @listens Component#touchleave\n * @listens Component#touchcancel\n * @listens Component#touchend\n */\n\n\n _proto.emitTapEvents = function emitTapEvents() {\n // Track the start time so we can determine how long the touch lasted\n var touchStart = 0;\n var firstTouch = null; // Maximum movement allowed during a touch event to still be considered a tap\n // Other popular libs use anywhere from 2 (hammer.js) to 15,\n // so 10 seems like a nice, round number.\n\n var tapMovementThreshold = 10; // The maximum length a touch can be while still being considered a tap\n\n var touchTimeThreshold = 200;\n var couldBeTap;\n this.on('touchstart', function (event) {\n // If more than one finger, don't consider treating this as a click\n if (event.touches.length === 1) {\n // Copy pageX/pageY from the object\n firstTouch = {\n pageX: event.touches[0].pageX,\n pageY: event.touches[0].pageY\n }; // Record start time so we can detect a tap vs. \"touch and hold\"\n\n touchStart = new Date().getTime(); // Reset couldBeTap tracking\n\n couldBeTap = true;\n }\n });\n this.on('touchmove', function (event) {\n // If more than one finger, don't consider treating this as a click\n if (event.touches.length > 1) {\n couldBeTap = false;\n } else if (firstTouch) {\n // Some devices will throw touchmoves for all but the slightest of taps.\n // So, if we moved only a small distance, this could still be a tap\n var xdiff = event.touches[0].pageX - firstTouch.pageX;\n var ydiff = event.touches[0].pageY - firstTouch.pageY;\n var touchDistance = Math.sqrt(xdiff * xdiff + ydiff * ydiff);\n\n if (touchDistance > tapMovementThreshold) {\n couldBeTap = false;\n }\n }\n });\n\n var noTap = function noTap() {\n couldBeTap = false;\n }; // TODO: Listen to the original target. http://youtu.be/DujfpXOKUp8?t=13m8s\n\n\n this.on('touchleave', noTap);\n this.on('touchcancel', noTap); // When the touch ends, measure how long it took and trigger the appropriate\n // event\n\n this.on('touchend', function (event) {\n firstTouch = null; // Proceed only if the touchmove/leave/cancel event didn't happen\n\n if (couldBeTap === true) {\n // Measure how long the touch lasted\n var touchTime = new Date().getTime() - touchStart; // Make sure the touch was less than the threshold to be considered a tap\n\n if (touchTime < touchTimeThreshold) {\n // Don't let browser turn this into a click\n event.preventDefault();\n /**\n * Triggered when a `Component` is tapped.\n *\n * @event Component#tap\n * @type {EventTarget~Event}\n */\n\n this.trigger('tap'); // It may be good to copy the touchend event object and change the\n // type to tap, if the other event properties aren't exact after\n // Events.fixEvent runs (e.g. event.target)\n }\n }\n });\n };\n /**\n * This function reports user activity whenever touch events happen. This can get\n * turned off by any sub-components that wants touch events to act another way.\n *\n * Report user touch activity when touch events occur. User activity gets used to\n * determine when controls should show/hide. It is simple when it comes to mouse\n * events, because any mouse event should show the controls. So we capture mouse\n * events that bubble up to the player and report activity when that happens.\n * With touch events it isn't as easy as `touchstart` and `touchend` toggle player\n * controls. So touch events can't help us at the player level either.\n *\n * User activity gets checked asynchronously. So what could happen is a tap event\n * on the video turns the controls off. Then the `touchend` event bubbles up to\n * the player. Which, if it reported user activity, would turn the controls right\n * back on. We also don't want to completely block touch events from bubbling up.\n * Furthermore a `touchmove` event and anything other than a tap, should not turn\n * controls back on.\n *\n * @listens Component#touchstart\n * @listens Component#touchmove\n * @listens Component#touchend\n * @listens Component#touchcancel\n */\n\n\n _proto.enableTouchActivity = function enableTouchActivity() {\n // Don't continue if the root player doesn't support reporting user activity\n if (!this.player() || !this.player().reportUserActivity) {\n return;\n } // listener for reporting that the user is active\n\n\n var report = bind(this.player(), this.player().reportUserActivity);\n var touchHolding;\n this.on('touchstart', function () {\n report(); // For as long as the they are touching the device or have their mouse down,\n // we consider them active even if they're not moving their finger or mouse.\n // So we want to continue to update that they are active\n\n this.clearInterval(touchHolding); // report at the same interval as activityCheck\n\n touchHolding = this.setInterval(report, 250);\n });\n\n var touchEnd = function touchEnd(event) {\n report(); // stop the interval that maintains activity if the touch is holding\n\n this.clearInterval(touchHolding);\n };\n\n this.on('touchmove', report);\n this.on('touchend', touchEnd);\n this.on('touchcancel', touchEnd);\n };\n /**\n * A callback that has no parameters and is bound into `Component`s context.\n *\n * @callback Component~GenericCallback\n * @this Component\n */\n\n /**\n * Creates a function that runs after an `x` millisecond timeout. This function is a\n * wrapper around `window.setTimeout`. There are a few reasons to use this one\n * instead though:\n * 1. It gets cleared via {@link Component#clearTimeout} when\n * {@link Component#dispose} gets called.\n * 2. The function callback will gets turned into a {@link Component~GenericCallback}\n *\n * > Note: You can't use `window.clearTimeout` on the id returned by this function. This\n * will cause its dispose listener not to get cleaned up! Please use\n * {@link Component#clearTimeout} or {@link Component#dispose} instead.\n *\n * @param {Component~GenericCallback} fn\n * The function that will be run after `timeout`.\n *\n * @param {number} timeout\n * Timeout in milliseconds to delay before executing the specified function.\n *\n * @return {number}\n * Returns a timeout ID that gets used to identify the timeout. It can also\n * get used in {@link Component#clearTimeout} to clear the timeout that\n * was set.\n *\n * @listens Component#dispose\n * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setTimeout}\n */\n\n\n _proto.setTimeout = function setTimeout(fn, timeout) {\n var _this2 = this;\n\n // declare as variables so they are properly available in timeout function\n // eslint-disable-next-line\n var timeoutId, disposeFn;\n fn = bind(this, fn);\n timeoutId = window$1.setTimeout(function () {\n _this2.off('dispose', disposeFn);\n\n fn();\n }, timeout);\n\n disposeFn = function disposeFn() {\n return _this2.clearTimeout(timeoutId);\n };\n\n disposeFn.guid = \"vjs-timeout-\" + timeoutId;\n this.on('dispose', disposeFn);\n return timeoutId;\n };\n /**\n * Clears a timeout that gets created via `window.setTimeout` or\n * {@link Component#setTimeout}. If you set a timeout via {@link Component#setTimeout}\n * use this function instead of `window.clearTimout`. If you don't your dispose\n * listener will not get cleaned up until {@link Component#dispose}!\n *\n * @param {number} timeoutId\n * The id of the timeout to clear. The return value of\n * {@link Component#setTimeout} or `window.setTimeout`.\n *\n * @return {number}\n * Returns the timeout id that was cleared.\n *\n * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/clearTimeout}\n */\n\n\n _proto.clearTimeout = function clearTimeout(timeoutId) {\n window$1.clearTimeout(timeoutId);\n\n var disposeFn = function disposeFn() {};\n\n disposeFn.guid = \"vjs-timeout-\" + timeoutId;\n this.off('dispose', disposeFn);\n return timeoutId;\n };\n /**\n * Creates a function that gets run every `x` milliseconds. This function is a wrapper\n * around `window.setInterval`. There are a few reasons to use this one instead though.\n * 1. It gets cleared via {@link Component#clearInterval} when\n * {@link Component#dispose} gets called.\n * 2. The function callback will be a {@link Component~GenericCallback}\n *\n * @param {Component~GenericCallback} fn\n * The function to run every `x` seconds.\n *\n * @param {number} interval\n * Execute the specified function every `x` milliseconds.\n *\n * @return {number}\n * Returns an id that can be used to identify the interval. It can also be be used in\n * {@link Component#clearInterval} to clear the interval.\n *\n * @listens Component#dispose\n * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setInterval}\n */\n\n\n _proto.setInterval = function setInterval(fn, interval) {\n var _this3 = this;\n\n fn = bind(this, fn);\n var intervalId = window$1.setInterval(fn, interval);\n\n var disposeFn = function disposeFn() {\n return _this3.clearInterval(intervalId);\n };\n\n disposeFn.guid = \"vjs-interval-\" + intervalId;\n this.on('dispose', disposeFn);\n return intervalId;\n };\n /**\n * Clears an interval that gets created via `window.setInterval` or\n * {@link Component#setInterval}. If you set an inteval via {@link Component#setInterval}\n * use this function instead of `window.clearInterval`. If you don't your dispose\n * listener will not get cleaned up until {@link Component#dispose}!\n *\n * @param {number} intervalId\n * The id of the interval to clear. The return value of\n * {@link Component#setInterval} or `window.setInterval`.\n *\n * @return {number}\n * Returns the interval id that was cleared.\n *\n * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/clearInterval}\n */\n\n\n _proto.clearInterval = function clearInterval(intervalId) {\n window$1.clearInterval(intervalId);\n\n var disposeFn = function disposeFn() {};\n\n disposeFn.guid = \"vjs-interval-\" + intervalId;\n this.off('dispose', disposeFn);\n return intervalId;\n };\n /**\n * Queues up a callback to be passed to requestAnimationFrame (rAF), but\n * with a few extra bonuses:\n *\n * - Supports browsers that do not support rAF by falling back to\n * {@link Component#setTimeout}.\n *\n * - The callback is turned into a {@link Component~GenericCallback} (i.e.\n * bound to the component).\n *\n * - Automatic cancellation of the rAF callback is handled if the component\n * is disposed before it is called.\n *\n * @param {Component~GenericCallback} fn\n * A function that will be bound to this component and executed just\n * before the browser's next repaint.\n *\n * @return {number}\n * Returns an rAF ID that gets used to identify the timeout. It can\n * also be used in {@link Component#cancelAnimationFrame} to cancel\n * the animation frame callback.\n *\n * @listens Component#dispose\n * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame}\n */\n\n\n _proto.requestAnimationFrame = function requestAnimationFrame(fn) {\n var _this4 = this;\n\n // declare as variables so they are properly available in rAF function\n // eslint-disable-next-line\n var id, disposeFn;\n\n if (this.supportsRaf_) {\n fn = bind(this, fn);\n id = window$1.requestAnimationFrame(function () {\n _this4.off('dispose', disposeFn);\n\n fn();\n });\n\n disposeFn = function disposeFn() {\n return _this4.cancelAnimationFrame(id);\n };\n\n disposeFn.guid = \"vjs-raf-\" + id;\n this.on('dispose', disposeFn);\n return id;\n } // Fall back to using a timer.\n\n\n return this.setTimeout(fn, 1000 / 60);\n };\n /**\n * Cancels a queued callback passed to {@link Component#requestAnimationFrame}\n * (rAF).\n *\n * If you queue an rAF callback via {@link Component#requestAnimationFrame},\n * use this function instead of `window.cancelAnimationFrame`. If you don't,\n * your dispose listener will not get cleaned up until {@link Component#dispose}!\n *\n * @param {number} id\n * The rAF ID to clear. The return value of {@link Component#requestAnimationFrame}.\n *\n * @return {number}\n * Returns the rAF ID that was cleared.\n *\n * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/window/cancelAnimationFrame}\n */\n\n\n _proto.cancelAnimationFrame = function cancelAnimationFrame(id) {\n if (this.supportsRaf_) {\n window$1.cancelAnimationFrame(id);\n\n var disposeFn = function disposeFn() {};\n\n disposeFn.guid = \"vjs-raf-\" + id;\n this.off('dispose', disposeFn);\n return id;\n } // Fall back to using a timer.\n\n\n return this.clearTimeout(id);\n };\n /**\n * Register a `Component` with `videojs` given the name and the component.\n *\n * > NOTE: {@link Tech}s should not be registered as a `Component`. {@link Tech}s\n * should be registered using {@link Tech.registerTech} or\n * {@link videojs:videojs.registerTech}.\n *\n * > NOTE: This function can also be seen on videojs as\n * {@link videojs:videojs.registerComponent}.\n *\n * @param {string} name\n * The name of the `Component` to register.\n *\n * @param {Component} ComponentToRegister\n * The `Component` class to register.\n *\n * @return {Component}\n * The `Component` that was registered.\n */\n\n\n Component.registerComponent = function registerComponent(name, ComponentToRegister) {\n if (typeof name !== 'string' || !name) {\n throw new Error(\"Illegal component name, \\\"\" + name + \"\\\"; must be a non-empty string.\");\n }\n\n var Tech = Component.getComponent('Tech'); // We need to make sure this check is only done if Tech has been registered.\n\n var isTech = Tech && Tech.isTech(ComponentToRegister);\n var isComp = Component === ComponentToRegister || Component.prototype.isPrototypeOf(ComponentToRegister.prototype);\n\n if (isTech || !isComp) {\n var reason;\n\n if (isTech) {\n reason = 'techs must be registered using Tech.registerTech()';\n } else {\n reason = 'must be a Component subclass';\n }\n\n throw new Error(\"Illegal component, \\\"\" + name + \"\\\"; \" + reason + \".\");\n }\n\n name = toTitleCase(name);\n\n if (!Component.components_) {\n Component.components_ = {};\n }\n\n var Player = Component.getComponent('Player');\n\n if (name === 'Player' && Player && Player.players) {\n var players = Player.players;\n var playerNames = Object.keys(players); // If we have players that were disposed, then their name will still be\n // in Players.players. So, we must loop through and verify that the value\n // for each item is not null. This allows registration of the Player component\n // after all players have been disposed or before any were created.\n\n if (players && playerNames.length > 0 && playerNames.map(function (pname) {\n return players[pname];\n }).every(Boolean)) {\n throw new Error('Can not register Player component after player has been created.');\n }\n }\n\n Component.components_[name] = ComponentToRegister;\n return ComponentToRegister;\n };\n /**\n * Get a `Component` based on the name it was registered with.\n *\n * @param {string} name\n * The Name of the component to get.\n *\n * @return {Component}\n * The `Component` that got registered under the given name.\n *\n * @deprecated In `videojs` 6 this will not return `Component`s that were not\n * registered using {@link Component.registerComponent}. Currently we\n * check the global `videojs` object for a `Component` name and\n * return that if it exists.\n */\n\n\n Component.getComponent = function getComponent(name) {\n if (!name) {\n return;\n }\n\n name = toTitleCase(name);\n\n if (Component.components_ && Component.components_[name]) {\n return Component.components_[name];\n }\n };\n\n return Component;\n}();\n/**\n * Whether or not this component supports `requestAnimationFrame`.\n *\n * This is exposed primarily for testing purposes.\n *\n * @private\n * @type {Boolean}\n */\n\n\nComponent.prototype.supportsRaf_ = typeof window$1.requestAnimationFrame === 'function' && typeof window$1.cancelAnimationFrame === 'function';\nComponent.registerComponent('Component', Component);\n\n/**\n * @file browser.js\n * @module browser\n */\nvar USER_AGENT = window$1.navigator && window$1.navigator.userAgent || '';\nvar webkitVersionMap = /AppleWebKit\\/([\\d.]+)/i.exec(USER_AGENT);\nvar appleWebkitVersion = webkitVersionMap ? parseFloat(webkitVersionMap.pop()) : null;\n/**\n * Whether or not this device is an iPad.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_IPAD = /iPad/i.test(USER_AGENT);\n/**\n * Whether or not this device is an iPhone.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n// The Facebook app's UIWebView identifies as both an iPhone and iPad, so\n// to identify iPhones, we need to exclude iPads.\n// http://artsy.github.io/blog/2012/10/18/the-perils-of-ios-user-agent-sniffing/\n\nvar IS_IPHONE = /iPhone/i.test(USER_AGENT) && !IS_IPAD;\n/**\n * Whether or not this device is an iPod.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_IPOD = /iPod/i.test(USER_AGENT);\n/**\n * Whether or not this is an iOS device.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_IOS = IS_IPHONE || IS_IPAD || IS_IPOD;\n/**\n * The detected iOS version - or `null`.\n *\n * @static\n * @const\n * @type {string|null}\n */\n\nvar IOS_VERSION = function () {\n var match = USER_AGENT.match(/OS (\\d+)_/i);\n\n if (match && match[1]) {\n return match[1];\n }\n\n return null;\n}();\n/**\n * Whether or not this is an Android device.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_ANDROID = /Android/i.test(USER_AGENT);\n/**\n * The detected Android version - or `null`.\n *\n * @static\n * @const\n * @type {number|string|null}\n */\n\nvar ANDROID_VERSION = function () {\n // This matches Android Major.Minor.Patch versions\n // ANDROID_VERSION is Major.Minor as a Number, if Minor isn't available, then only Major is returned\n var match = USER_AGENT.match(/Android (\\d+)(?:\\.(\\d+))?(?:\\.(\\d+))*/i);\n\n if (!match) {\n return null;\n }\n\n var major = match[1] && parseFloat(match[1]);\n var minor = match[2] && parseFloat(match[2]);\n\n if (major && minor) {\n return parseFloat(match[1] + '.' + match[2]);\n } else if (major) {\n return major;\n }\n\n return null;\n}();\n/**\n * Whether or not this is a native Android browser.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_NATIVE_ANDROID = IS_ANDROID && ANDROID_VERSION < 5 && appleWebkitVersion < 537;\n/**\n * Whether or not this is Mozilla Firefox.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_FIREFOX = /Firefox/i.test(USER_AGENT);\n/**\n * Whether or not this is Microsoft Edge.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_EDGE = /Edge/i.test(USER_AGENT);\n/**\n * Whether or not this is Google Chrome.\n *\n * This will also be `true` for Chrome on iOS, which will have different support\n * as it is actually Safari under the hood.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_CHROME = !IS_EDGE && (/Chrome/i.test(USER_AGENT) || /CriOS/i.test(USER_AGENT));\n/**\n * The detected Google Chrome version - or `null`.\n *\n * @static\n * @const\n * @type {number|null}\n */\n\nvar CHROME_VERSION = function () {\n var match = USER_AGENT.match(/(Chrome|CriOS)\\/(\\d+)/);\n\n if (match && match[2]) {\n return parseFloat(match[2]);\n }\n\n return null;\n}();\n/**\n * The detected Internet Explorer version - or `null`.\n *\n * @static\n * @const\n * @type {number|null}\n */\n\nvar IE_VERSION = function () {\n var result = /MSIE\\s(\\d+)\\.\\d/.exec(USER_AGENT);\n var version = result && parseFloat(result[1]);\n\n if (!version && /Trident\\/7.0/i.test(USER_AGENT) && /rv:11.0/.test(USER_AGENT)) {\n // IE 11 has a different user agent string than other IE versions\n version = 11.0;\n }\n\n return version;\n}();\n/**\n * Whether or not this is desktop Safari.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_SAFARI = /Safari/i.test(USER_AGENT) && !IS_CHROME && !IS_ANDROID && !IS_EDGE;\n/**\n * Whether or not this is any flavor of Safari - including iOS.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_ANY_SAFARI = (IS_SAFARI || IS_IOS) && !IS_CHROME;\n/**\n * Whether or not this device is touch-enabled.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar TOUCH_ENABLED = isReal() && ('ontouchstart' in window$1 || window$1.navigator.maxTouchPoints || window$1.DocumentTouch && window$1.document instanceof window$1.DocumentTouch);\n\nvar browser = /*#__PURE__*/Object.freeze({\n IS_IPAD: IS_IPAD,\n IS_IPHONE: IS_IPHONE,\n IS_IPOD: IS_IPOD,\n IS_IOS: IS_IOS,\n IOS_VERSION: IOS_VERSION,\n IS_ANDROID: IS_ANDROID,\n ANDROID_VERSION: ANDROID_VERSION,\n IS_NATIVE_ANDROID: IS_NATIVE_ANDROID,\n IS_FIREFOX: IS_FIREFOX,\n IS_EDGE: IS_EDGE,\n IS_CHROME: IS_CHROME,\n CHROME_VERSION: CHROME_VERSION,\n IE_VERSION: IE_VERSION,\n IS_SAFARI: IS_SAFARI,\n IS_ANY_SAFARI: IS_ANY_SAFARI,\n TOUCH_ENABLED: TOUCH_ENABLED\n});\n\n/**\n * @file time-ranges.js\n * @module time-ranges\n */\n\n/**\n * Returns the time for the specified index at the start or end\n * of a TimeRange object.\n *\n * @typedef {Function} TimeRangeIndex\n *\n * @param {number} [index=0]\n * The range number to return the time for.\n *\n * @return {number}\n * The time offset at the specified index.\n *\n * @deprecated The index argument must be provided.\n * In the future, leaving it out will throw an error.\n */\n\n/**\n * An object that contains ranges of time.\n *\n * @typedef {Object} TimeRange\n *\n * @property {number} length\n * The number of time ranges represented by this object.\n *\n * @property {module:time-ranges~TimeRangeIndex} start\n * Returns the time offset at which a specified time range begins.\n *\n * @property {module:time-ranges~TimeRangeIndex} end\n * Returns the time offset at which a specified time range ends.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/TimeRanges\n */\n\n/**\n * Check if any of the time ranges are over the maximum index.\n *\n * @private\n * @param {string} fnName\n * The function name to use for logging\n *\n * @param {number} index\n * The index to check\n *\n * @param {number} maxIndex\n * The maximum possible index\n *\n * @throws {Error} if the timeRanges provided are over the maxIndex\n */\nfunction rangeCheck(fnName, index, maxIndex) {\n if (typeof index !== 'number' || index < 0 || index > maxIndex) {\n throw new Error(\"Failed to execute '\" + fnName + \"' on 'TimeRanges': The index provided (\" + index + \") is non-numeric or out of bounds (0-\" + maxIndex + \").\");\n }\n}\n/**\n * Get the time for the specified index at the start or end\n * of a TimeRange object.\n *\n * @private\n * @param {string} fnName\n * The function name to use for logging\n *\n * @param {string} valueIndex\n * The property that should be used to get the time. should be\n * 'start' or 'end'\n *\n * @param {Array} ranges\n * An array of time ranges\n *\n * @param {Array} [rangeIndex=0]\n * The index to start the search at\n *\n * @return {number}\n * The time that offset at the specified index.\n *\n * @deprecated rangeIndex must be set to a value, in the future this will throw an error.\n * @throws {Error} if rangeIndex is more than the length of ranges\n */\n\n\nfunction getRange(fnName, valueIndex, ranges, rangeIndex) {\n rangeCheck(fnName, rangeIndex, ranges.length - 1);\n return ranges[rangeIndex][valueIndex];\n}\n/**\n * Create a time range object given ranges of time.\n *\n * @private\n * @param {Array} [ranges]\n * An array of time ranges.\n */\n\n\nfunction createTimeRangesObj(ranges) {\n if (ranges === undefined || ranges.length === 0) {\n return {\n length: 0,\n start: function start() {\n throw new Error('This TimeRanges object is empty');\n },\n end: function end() {\n throw new Error('This TimeRanges object is empty');\n }\n };\n }\n\n return {\n length: ranges.length,\n start: getRange.bind(null, 'start', 0, ranges),\n end: getRange.bind(null, 'end', 1, ranges)\n };\n}\n/**\n * Create a `TimeRange` object which mimics an\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/TimeRanges|HTML5 TimeRanges instance}.\n *\n * @param {number|Array[]} start\n * The start of a single range (a number) or an array of ranges (an\n * array of arrays of two numbers each).\n *\n * @param {number} end\n * The end of a single range. Cannot be used with the array form of\n * the `start` argument.\n */\n\n\nfunction createTimeRanges(start, end) {\n if (Array.isArray(start)) {\n return createTimeRangesObj(start);\n } else if (start === undefined || end === undefined) {\n return createTimeRangesObj();\n }\n\n return createTimeRangesObj([[start, end]]);\n}\n\n/**\n * @file buffer.js\n * @module buffer\n */\n/**\n * Compute the percentage of the media that has been buffered.\n *\n * @param {TimeRange} buffered\n * The current `TimeRange` object representing buffered time ranges\n *\n * @param {number} duration\n * Total duration of the media\n *\n * @return {number}\n * Percent buffered of the total duration in decimal form.\n */\n\nfunction bufferedPercent(buffered, duration) {\n var bufferedDuration = 0;\n var start;\n var end;\n\n if (!duration) {\n return 0;\n }\n\n if (!buffered || !buffered.length) {\n buffered = createTimeRanges(0, 0);\n }\n\n for (var i = 0; i < buffered.length; i++) {\n start = buffered.start(i);\n end = buffered.end(i); // buffered end can be bigger than duration by a very small fraction\n\n if (end > duration) {\n end = duration;\n }\n\n bufferedDuration += end - start;\n }\n\n return bufferedDuration / duration;\n}\n\n/**\n * @file fullscreen-api.js\n * @module fullscreen-api\n * @private\n */\n/**\n * Store the browser-specific methods for the fullscreen API.\n *\n * @type {Object}\n * @see [Specification]{@link https://fullscreen.spec.whatwg.org}\n * @see [Map Approach From Screenfull.js]{@link https://github.com/sindresorhus/screenfull.js}\n */\n\nvar FullscreenApi = {}; // browser API methods\n\nvar apiMap = [['requestFullscreen', 'exitFullscreen', 'fullscreenElement', 'fullscreenEnabled', 'fullscreenchange', 'fullscreenerror'], // WebKit\n['webkitRequestFullscreen', 'webkitExitFullscreen', 'webkitFullscreenElement', 'webkitFullscreenEnabled', 'webkitfullscreenchange', 'webkitfullscreenerror'], // Old WebKit (Safari 5.1)\n['webkitRequestFullScreen', 'webkitCancelFullScreen', 'webkitCurrentFullScreenElement', 'webkitCancelFullScreen', 'webkitfullscreenchange', 'webkitfullscreenerror'], // Mozilla\n['mozRequestFullScreen', 'mozCancelFullScreen', 'mozFullScreenElement', 'mozFullScreenEnabled', 'mozfullscreenchange', 'mozfullscreenerror'], // Microsoft\n['msRequestFullscreen', 'msExitFullscreen', 'msFullscreenElement', 'msFullscreenEnabled', 'MSFullscreenChange', 'MSFullscreenError']];\nvar specApi = apiMap[0];\nvar browserApi; // determine the supported set of functions\n\nfor (var i = 0; i < apiMap.length; i++) {\n // check for exitFullscreen function\n if (apiMap[i][1] in document) {\n browserApi = apiMap[i];\n break;\n }\n} // map the browser API names to the spec API names\n\n\nif (browserApi) {\n for (var _i = 0; _i < browserApi.length; _i++) {\n FullscreenApi[specApi[_i]] = browserApi[_i];\n }\n}\n\n/**\n * @file media-error.js\n */\n/**\n * A Custom `MediaError` class which mimics the standard HTML5 `MediaError` class.\n *\n * @param {number|string|Object|MediaError} value\n * This can be of multiple types:\n * - number: should be a standard error code\n * - string: an error message (the code will be 0)\n * - Object: arbitrary properties\n * - `MediaError` (native): used to populate a video.js `MediaError` object\n * - `MediaError` (video.js): will return itself if it's already a\n * video.js `MediaError` object.\n *\n * @see [MediaError Spec]{@link https://dev.w3.org/html5/spec-author-view/video.html#mediaerror}\n * @see [Encrypted MediaError Spec]{@link https://www.w3.org/TR/2013/WD-encrypted-media-20130510/#error-codes}\n *\n * @class MediaError\n */\n\nfunction MediaError(value) {\n // Allow redundant calls to this constructor to avoid having `instanceof`\n // checks peppered around the code.\n if (value instanceof MediaError) {\n return value;\n }\n\n if (typeof value === 'number') {\n this.code = value;\n } else if (typeof value === 'string') {\n // default code is zero, so this is a custom error\n this.message = value;\n } else if (isObject(value)) {\n // We assign the `code` property manually because native `MediaError` objects\n // do not expose it as an own/enumerable property of the object.\n if (typeof value.code === 'number') {\n this.code = value.code;\n }\n\n assign(this, value);\n }\n\n if (!this.message) {\n this.message = MediaError.defaultMessages[this.code] || '';\n }\n}\n/**\n * The error code that refers two one of the defined `MediaError` types\n *\n * @type {Number}\n */\n\n\nMediaError.prototype.code = 0;\n/**\n * An optional message that to show with the error. Message is not part of the HTML5\n * video spec but allows for more informative custom errors.\n *\n * @type {String}\n */\n\nMediaError.prototype.message = '';\n/**\n * An optional status code that can be set by plugins to allow even more detail about\n * the error. For example a plugin might provide a specific HTTP status code and an\n * error message for that code. Then when the plugin gets that error this class will\n * know how to display an error message for it. This allows a custom message to show\n * up on the `Player` error overlay.\n *\n * @type {Array}\n */\n\nMediaError.prototype.status = null;\n/**\n * Errors indexed by the W3C standard. The order **CANNOT CHANGE**! See the\n * specification listed under {@link MediaError} for more information.\n *\n * @enum {array}\n * @readonly\n * @property {string} 0 - MEDIA_ERR_CUSTOM\n * @property {string} 1 - MEDIA_ERR_ABORTED\n * @property {string} 2 - MEDIA_ERR_NETWORK\n * @property {string} 3 - MEDIA_ERR_DECODE\n * @property {string} 4 - MEDIA_ERR_SRC_NOT_SUPPORTED\n * @property {string} 5 - MEDIA_ERR_ENCRYPTED\n */\n\nMediaError.errorTypes = ['MEDIA_ERR_CUSTOM', 'MEDIA_ERR_ABORTED', 'MEDIA_ERR_NETWORK', 'MEDIA_ERR_DECODE', 'MEDIA_ERR_SRC_NOT_SUPPORTED', 'MEDIA_ERR_ENCRYPTED'];\n/**\n * The default `MediaError` messages based on the {@link MediaError.errorTypes}.\n *\n * @type {Array}\n * @constant\n */\n\nMediaError.defaultMessages = {\n 1: 'You aborted the media playback',\n 2: 'A network error caused the media download to fail part-way.',\n 3: 'The media playback was aborted due to a corruption problem or because the media used features your browser did not support.',\n 4: 'The media could not be loaded, either because the server or network failed or because the format is not supported.',\n 5: 'The media is encrypted and we do not have the keys to decrypt it.'\n}; // Add types as properties on MediaError\n// e.g. MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED = 4;\n\nfor (var errNum = 0; errNum < MediaError.errorTypes.length; errNum++) {\n MediaError[MediaError.errorTypes[errNum]] = errNum; // values should be accessible on both the class and instance\n\n MediaError.prototype[MediaError.errorTypes[errNum]] = errNum;\n} // jsdocs for instance/static members added above\n\n/**\n * Returns whether an object is `Promise`-like (i.e. has a `then` method).\n *\n * @param {Object} value\n * An object that may or may not be `Promise`-like.\n *\n * @return {boolean}\n * Whether or not the object is `Promise`-like.\n */\nfunction isPromise(value) {\n return value !== undefined && value !== null && typeof value.then === 'function';\n}\n/**\n * Silence a Promise-like object.\n *\n * This is useful for avoiding non-harmful, but potentially confusing \"uncaught\n * play promise\" rejection error messages.\n *\n * @param {Object} value\n * An object that may or may not be `Promise`-like.\n */\n\nfunction silencePromise(value) {\n if (isPromise(value)) {\n value.then(null, function (e) {});\n }\n}\n\n/**\n * @file text-track-list-converter.js Utilities for capturing text track state and\n * re-creating tracks based on a capture.\n *\n * @module text-track-list-converter\n */\n\n/**\n * Examine a single {@link TextTrack} and return a JSON-compatible javascript object that\n * represents the {@link TextTrack}'s state.\n *\n * @param {TextTrack} track\n * The text track to query.\n *\n * @return {Object}\n * A serializable javascript representation of the TextTrack.\n * @private\n */\nvar trackToJson_ = function trackToJson_(track) {\n var ret = ['kind', 'label', 'language', 'id', 'inBandMetadataTrackDispatchType', 'mode', 'src'].reduce(function (acc, prop, i) {\n if (track[prop]) {\n acc[prop] = track[prop];\n }\n\n return acc;\n }, {\n cues: track.cues && Array.prototype.map.call(track.cues, function (cue) {\n return {\n startTime: cue.startTime,\n endTime: cue.endTime,\n text: cue.text,\n id: cue.id\n };\n })\n });\n return ret;\n};\n/**\n * Examine a {@link Tech} and return a JSON-compatible javascript array that represents the\n * state of all {@link TextTrack}s currently configured. The return array is compatible with\n * {@link text-track-list-converter:jsonToTextTracks}.\n *\n * @param {Tech} tech\n * The tech object to query\n *\n * @return {Array}\n * A serializable javascript representation of the {@link Tech}s\n * {@link TextTrackList}.\n */\n\n\nvar textTracksToJson = function textTracksToJson(tech) {\n var trackEls = tech.$$('track');\n var trackObjs = Array.prototype.map.call(trackEls, function (t) {\n return t.track;\n });\n var tracks = Array.prototype.map.call(trackEls, function (trackEl) {\n var json = trackToJson_(trackEl.track);\n\n if (trackEl.src) {\n json.src = trackEl.src;\n }\n\n return json;\n });\n return tracks.concat(Array.prototype.filter.call(tech.textTracks(), function (track) {\n return trackObjs.indexOf(track) === -1;\n }).map(trackToJson_));\n};\n/**\n * Create a set of remote {@link TextTrack}s on a {@link Tech} based on an array of javascript\n * object {@link TextTrack} representations.\n *\n * @param {Array} json\n * An array of `TextTrack` representation objects, like those that would be\n * produced by `textTracksToJson`.\n *\n * @param {Tech} tech\n * The `Tech` to create the `TextTrack`s on.\n */\n\n\nvar jsonToTextTracks = function jsonToTextTracks(json, tech) {\n json.forEach(function (track) {\n var addedTrack = tech.addRemoteTextTrack(track).track;\n\n if (!track.src && track.cues) {\n track.cues.forEach(function (cue) {\n return addedTrack.addCue(cue);\n });\n }\n });\n return tech.textTracks();\n};\n\nvar textTrackConverter = {\n textTracksToJson: textTracksToJson,\n jsonToTextTracks: jsonToTextTracks,\n trackToJson_: trackToJson_\n};\n\nvar MODAL_CLASS_NAME = 'vjs-modal-dialog';\nvar ESC = 27;\n/**\n * The `ModalDialog` displays over the video and its controls, which blocks\n * interaction with the player until it is closed.\n *\n * Modal dialogs include a \"Close\" button and will close when that button\n * is activated - or when ESC is pressed anywhere.\n *\n * @extends Component\n */\n\nvar ModalDialog =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(ModalDialog, _Component);\n\n /**\n * Create an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Mixed} [options.content=undefined]\n * Provide customized content for this modal.\n *\n * @param {string} [options.description]\n * A text description for the modal, primarily for accessibility.\n *\n * @param {boolean} [options.fillAlways=false]\n * Normally, modals are automatically filled only the first time\n * they open. This tells the modal to refresh its content\n * every time it opens.\n *\n * @param {string} [options.label]\n * A text label for the modal, primarily for accessibility.\n *\n * @param {boolean} [options.temporary=true]\n * If `true`, the modal can only be opened once; it will be\n * disposed as soon as it's closed.\n *\n * @param {boolean} [options.uncloseable=false]\n * If `true`, the user will not be able to close the modal\n * through the UI in the normal ways. Programmatic closing is\n * still possible.\n */\n function ModalDialog(player, options) {\n var _this;\n\n _this = _Component.call(this, player, options) || this;\n _this.opened_ = _this.hasBeenOpened_ = _this.hasBeenFilled_ = false;\n\n _this.closeable(!_this.options_.uncloseable);\n\n _this.content(_this.options_.content); // Make sure the contentEl is defined AFTER any children are initialized\n // because we only want the contents of the modal in the contentEl\n // (not the UI elements like the close button).\n\n\n _this.contentEl_ = createEl('div', {\n className: MODAL_CLASS_NAME + \"-content\"\n }, {\n role: 'document'\n });\n _this.descEl_ = createEl('p', {\n className: MODAL_CLASS_NAME + \"-description vjs-control-text\",\n id: _this.el().getAttribute('aria-describedby')\n });\n textContent(_this.descEl_, _this.description());\n\n _this.el_.appendChild(_this.descEl_);\n\n _this.el_.appendChild(_this.contentEl_);\n\n return _this;\n }\n /**\n * Create the `ModalDialog`'s DOM element\n *\n * @return {Element}\n * The DOM element that gets created.\n */\n\n\n var _proto = ModalDialog.prototype;\n\n _proto.createEl = function createEl$$1() {\n return _Component.prototype.createEl.call(this, 'div', {\n className: this.buildCSSClass(),\n tabIndex: -1\n }, {\n 'aria-describedby': this.id() + \"_description\",\n 'aria-hidden': 'true',\n 'aria-label': this.label(),\n 'role': 'dialog'\n });\n };\n\n _proto.dispose = function dispose() {\n this.contentEl_ = null;\n this.descEl_ = null;\n this.previouslyActiveEl_ = null;\n\n _Component.prototype.dispose.call(this);\n };\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n _proto.buildCSSClass = function buildCSSClass() {\n return MODAL_CLASS_NAME + \" vjs-hidden \" + _Component.prototype.buildCSSClass.call(this);\n };\n /**\n * Handles `keydown` events on the document, looking for ESC, which closes\n * the modal.\n *\n * @param {EventTarget~Event} e\n * The keypress that triggered this event.\n *\n * @listens keydown\n */\n\n\n _proto.handleKeyPress = function handleKeyPress(e) {\n if (e.which === ESC && this.closeable()) {\n this.close();\n }\n };\n /**\n * Returns the label string for this modal. Primarily used for accessibility.\n *\n * @return {string}\n * the localized or raw label of this modal.\n */\n\n\n _proto.label = function label() {\n return this.localize(this.options_.label || 'Modal Window');\n };\n /**\n * Returns the description string for this modal. Primarily used for\n * accessibility.\n *\n * @return {string}\n * The localized or raw description of this modal.\n */\n\n\n _proto.description = function description() {\n var desc = this.options_.description || this.localize('This is a modal window.'); // Append a universal closeability message if the modal is closeable.\n\n if (this.closeable()) {\n desc += ' ' + this.localize('This modal can be closed by pressing the Escape key or activating the close button.');\n }\n\n return desc;\n };\n /**\n * Opens the modal.\n *\n * @fires ModalDialog#beforemodalopen\n * @fires ModalDialog#modalopen\n */\n\n\n _proto.open = function open() {\n if (!this.opened_) {\n var player = this.player();\n /**\n * Fired just before a `ModalDialog` is opened.\n *\n * @event ModalDialog#beforemodalopen\n * @type {EventTarget~Event}\n */\n\n this.trigger('beforemodalopen');\n this.opened_ = true; // Fill content if the modal has never opened before and\n // never been filled.\n\n if (this.options_.fillAlways || !this.hasBeenOpened_ && !this.hasBeenFilled_) {\n this.fill();\n } // If the player was playing, pause it and take note of its previously\n // playing state.\n\n\n this.wasPlaying_ = !player.paused();\n\n if (this.options_.pauseOnOpen && this.wasPlaying_) {\n player.pause();\n }\n\n if (this.closeable()) {\n this.on(this.el_.ownerDocument, 'keydown', bind(this, this.handleKeyPress));\n } // Hide controls and note if they were enabled.\n\n\n this.hadControls_ = player.controls();\n player.controls(false);\n this.show();\n this.conditionalFocus_();\n this.el().setAttribute('aria-hidden', 'false');\n /**\n * Fired just after a `ModalDialog` is opened.\n *\n * @event ModalDialog#modalopen\n * @type {EventTarget~Event}\n */\n\n this.trigger('modalopen');\n this.hasBeenOpened_ = true;\n }\n };\n /**\n * If the `ModalDialog` is currently open or closed.\n *\n * @param {boolean} [value]\n * If given, it will open (`true`) or close (`false`) the modal.\n *\n * @return {boolean}\n * the current open state of the modaldialog\n */\n\n\n _proto.opened = function opened(value) {\n if (typeof value === 'boolean') {\n this[value ? 'open' : 'close']();\n }\n\n return this.opened_;\n };\n /**\n * Closes the modal, does nothing if the `ModalDialog` is\n * not open.\n *\n * @fires ModalDialog#beforemodalclose\n * @fires ModalDialog#modalclose\n */\n\n\n _proto.close = function close() {\n if (!this.opened_) {\n return;\n }\n\n var player = this.player();\n /**\n * Fired just before a `ModalDialog` is closed.\n *\n * @event ModalDialog#beforemodalclose\n * @type {EventTarget~Event}\n */\n\n this.trigger('beforemodalclose');\n this.opened_ = false;\n\n if (this.wasPlaying_ && this.options_.pauseOnOpen) {\n player.play();\n }\n\n if (this.closeable()) {\n this.off(this.el_.ownerDocument, 'keydown', bind(this, this.handleKeyPress));\n }\n\n if (this.hadControls_) {\n player.controls(true);\n }\n\n this.hide();\n this.el().setAttribute('aria-hidden', 'true');\n /**\n * Fired just after a `ModalDialog` is closed.\n *\n * @event ModalDialog#modalclose\n * @type {EventTarget~Event}\n */\n\n this.trigger('modalclose');\n this.conditionalBlur_();\n\n if (this.options_.temporary) {\n this.dispose();\n }\n };\n /**\n * Check to see if the `ModalDialog` is closeable via the UI.\n *\n * @param {boolean} [value]\n * If given as a boolean, it will set the `closeable` option.\n *\n * @return {boolean}\n * Returns the final value of the closable option.\n */\n\n\n _proto.closeable = function closeable(value) {\n if (typeof value === 'boolean') {\n var closeable = this.closeable_ = !!value;\n var close = this.getChild('closeButton'); // If this is being made closeable and has no close button, add one.\n\n if (closeable && !close) {\n // The close button should be a child of the modal - not its\n // content element, so temporarily change the content element.\n var temp = this.contentEl_;\n this.contentEl_ = this.el_;\n close = this.addChild('closeButton', {\n controlText: 'Close Modal Dialog'\n });\n this.contentEl_ = temp;\n this.on(close, 'close', this.close);\n } // If this is being made uncloseable and has a close button, remove it.\n\n\n if (!closeable && close) {\n this.off(close, 'close', this.close);\n this.removeChild(close);\n close.dispose();\n }\n }\n\n return this.closeable_;\n };\n /**\n * Fill the modal's content element with the modal's \"content\" option.\n * The content element will be emptied before this change takes place.\n */\n\n\n _proto.fill = function fill() {\n this.fillWith(this.content());\n };\n /**\n * Fill the modal's content element with arbitrary content.\n * The content element will be emptied before this change takes place.\n *\n * @fires ModalDialog#beforemodalfill\n * @fires ModalDialog#modalfill\n *\n * @param {Mixed} [content]\n * The same rules apply to this as apply to the `content` option.\n */\n\n\n _proto.fillWith = function fillWith(content) {\n var contentEl = this.contentEl();\n var parentEl = contentEl.parentNode;\n var nextSiblingEl = contentEl.nextSibling;\n /**\n * Fired just before a `ModalDialog` is filled with content.\n *\n * @event ModalDialog#beforemodalfill\n * @type {EventTarget~Event}\n */\n\n this.trigger('beforemodalfill');\n this.hasBeenFilled_ = true; // Detach the content element from the DOM before performing\n // manipulation to avoid modifying the live DOM multiple times.\n\n parentEl.removeChild(contentEl);\n this.empty();\n insertContent(contentEl, content);\n /**\n * Fired just after a `ModalDialog` is filled with content.\n *\n * @event ModalDialog#modalfill\n * @type {EventTarget~Event}\n */\n\n this.trigger('modalfill'); // Re-inject the re-filled content element.\n\n if (nextSiblingEl) {\n parentEl.insertBefore(contentEl, nextSiblingEl);\n } else {\n parentEl.appendChild(contentEl);\n } // make sure that the close button is last in the dialog DOM\n\n\n var closeButton = this.getChild('closeButton');\n\n if (closeButton) {\n parentEl.appendChild(closeButton.el_);\n }\n };\n /**\n * Empties the content element. This happens anytime the modal is filled.\n *\n * @fires ModalDialog#beforemodalempty\n * @fires ModalDialog#modalempty\n */\n\n\n _proto.empty = function empty() {\n /**\n * Fired just before a `ModalDialog` is emptied.\n *\n * @event ModalDialog#beforemodalempty\n * @type {EventTarget~Event}\n */\n this.trigger('beforemodalempty');\n emptyEl(this.contentEl());\n /**\n * Fired just after a `ModalDialog` is emptied.\n *\n * @event ModalDialog#modalempty\n * @type {EventTarget~Event}\n */\n\n this.trigger('modalempty');\n };\n /**\n * Gets or sets the modal content, which gets normalized before being\n * rendered into the DOM.\n *\n * This does not update the DOM or fill the modal, but it is called during\n * that process.\n *\n * @param {Mixed} [value]\n * If defined, sets the internal content value to be used on the\n * next call(s) to `fill`. This value is normalized before being\n * inserted. To \"clear\" the internal content value, pass `null`.\n *\n * @return {Mixed}\n * The current content of the modal dialog\n */\n\n\n _proto.content = function content(value) {\n if (typeof value !== 'undefined') {\n this.content_ = value;\n }\n\n return this.content_;\n };\n /**\n * conditionally focus the modal dialog if focus was previously on the player.\n *\n * @private\n */\n\n\n _proto.conditionalFocus_ = function conditionalFocus_() {\n var activeEl = document.activeElement;\n var playerEl = this.player_.el_;\n this.previouslyActiveEl_ = null;\n\n if (playerEl.contains(activeEl) || playerEl === activeEl) {\n this.previouslyActiveEl_ = activeEl;\n this.focus();\n this.on(document, 'keydown', this.handleKeyDown);\n }\n };\n /**\n * conditionally blur the element and refocus the last focused element\n *\n * @private\n */\n\n\n _proto.conditionalBlur_ = function conditionalBlur_() {\n if (this.previouslyActiveEl_) {\n this.previouslyActiveEl_.focus();\n this.previouslyActiveEl_ = null;\n }\n\n this.off(document, 'keydown', this.handleKeyDown);\n };\n /**\n * Keydown handler. Attached when modal is focused.\n *\n * @listens keydown\n */\n\n\n _proto.handleKeyDown = function handleKeyDown(event) {\n // exit early if it isn't a tab key\n if (event.which !== 9) {\n return;\n }\n\n var focusableEls = this.focusableEls_();\n var activeEl = this.el_.querySelector(':focus');\n var focusIndex;\n\n for (var i = 0; i < focusableEls.length; i++) {\n if (activeEl === focusableEls[i]) {\n focusIndex = i;\n break;\n }\n }\n\n if (document.activeElement === this.el_) {\n focusIndex = 0;\n }\n\n if (event.shiftKey && focusIndex === 0) {\n focusableEls[focusableEls.length - 1].focus();\n event.preventDefault();\n } else if (!event.shiftKey && focusIndex === focusableEls.length - 1) {\n focusableEls[0].focus();\n event.preventDefault();\n }\n };\n /**\n * get all focusable elements\n *\n * @private\n */\n\n\n _proto.focusableEls_ = function focusableEls_() {\n var allChildren = this.el_.querySelectorAll('*');\n return Array.prototype.filter.call(allChildren, function (child) {\n return (child instanceof window$1.HTMLAnchorElement || child instanceof window$1.HTMLAreaElement) && child.hasAttribute('href') || (child instanceof window$1.HTMLInputElement || child instanceof window$1.HTMLSelectElement || child instanceof window$1.HTMLTextAreaElement || child instanceof window$1.HTMLButtonElement) && !child.hasAttribute('disabled') || child instanceof window$1.HTMLIFrameElement || child instanceof window$1.HTMLObjectElement || child instanceof window$1.HTMLEmbedElement || child.hasAttribute('tabindex') && child.getAttribute('tabindex') !== -1 || child.hasAttribute('contenteditable');\n });\n };\n\n return ModalDialog;\n}(Component);\n/**\n * Default options for `ModalDialog` default options.\n *\n * @type {Object}\n * @private\n */\n\n\nModalDialog.prototype.options_ = {\n pauseOnOpen: true,\n temporary: true\n};\nComponent.registerComponent('ModalDialog', ModalDialog);\n\n/**\n * Common functionaliy between {@link TextTrackList}, {@link AudioTrackList}, and\n * {@link VideoTrackList}\n *\n * @extends EventTarget\n */\n\nvar TrackList =\n/*#__PURE__*/\nfunction (_EventTarget) {\n _inheritsLoose(TrackList, _EventTarget);\n\n /**\n * Create an instance of this class\n *\n * @param {Track[]} tracks\n * A list of tracks to initialize the list with.\n *\n * @abstract\n */\n function TrackList(tracks) {\n var _this;\n\n if (tracks === void 0) {\n tracks = [];\n }\n\n _this = _EventTarget.call(this) || this;\n _this.tracks_ = [];\n /**\n * @memberof TrackList\n * @member {number} length\n * The current number of `Track`s in the this Trackist.\n * @instance\n */\n\n Object.defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), 'length', {\n get: function get() {\n return this.tracks_.length;\n }\n });\n\n for (var i = 0; i < tracks.length; i++) {\n _this.addTrack(tracks[i]);\n }\n\n return _this;\n }\n /**\n * Add a {@link Track} to the `TrackList`\n *\n * @param {Track} track\n * The audio, video, or text track to add to the list.\n *\n * @fires TrackList#addtrack\n */\n\n\n var _proto = TrackList.prototype;\n\n _proto.addTrack = function addTrack(track) {\n var index = this.tracks_.length;\n\n if (!('' + index in this)) {\n Object.defineProperty(this, index, {\n get: function get() {\n return this.tracks_[index];\n }\n });\n } // Do not add duplicate tracks\n\n\n if (this.tracks_.indexOf(track) === -1) {\n this.tracks_.push(track);\n /**\n * Triggered when a track is added to a track list.\n *\n * @event TrackList#addtrack\n * @type {EventTarget~Event}\n * @property {Track} track\n * A reference to track that was added.\n */\n\n this.trigger({\n track: track,\n type: 'addtrack'\n });\n }\n };\n /**\n * Remove a {@link Track} from the `TrackList`\n *\n * @param {Track} rtrack\n * The audio, video, or text track to remove from the list.\n *\n * @fires TrackList#removetrack\n */\n\n\n _proto.removeTrack = function removeTrack(rtrack) {\n var track;\n\n for (var i = 0, l = this.length; i < l; i++) {\n if (this[i] === rtrack) {\n track = this[i];\n\n if (track.off) {\n track.off();\n }\n\n this.tracks_.splice(i, 1);\n break;\n }\n }\n\n if (!track) {\n return;\n }\n /**\n * Triggered when a track is removed from track list.\n *\n * @event TrackList#removetrack\n * @type {EventTarget~Event}\n * @property {Track} track\n * A reference to track that was removed.\n */\n\n\n this.trigger({\n track: track,\n type: 'removetrack'\n });\n };\n /**\n * Get a Track from the TrackList by a tracks id\n *\n * @param {string} id - the id of the track to get\n * @method getTrackById\n * @return {Track}\n * @private\n */\n\n\n _proto.getTrackById = function getTrackById(id) {\n var result = null;\n\n for (var i = 0, l = this.length; i < l; i++) {\n var track = this[i];\n\n if (track.id === id) {\n result = track;\n break;\n }\n }\n\n return result;\n };\n\n return TrackList;\n}(EventTarget);\n/**\n * Triggered when a different track is selected/enabled.\n *\n * @event TrackList#change\n * @type {EventTarget~Event}\n */\n\n/**\n * Events that can be called with on + eventName. See {@link EventHandler}.\n *\n * @property {Object} TrackList#allowedEvents_\n * @private\n */\n\n\nTrackList.prototype.allowedEvents_ = {\n change: 'change',\n addtrack: 'addtrack',\n removetrack: 'removetrack'\n}; // emulate attribute EventHandler support to allow for feature detection\n\nfor (var event in TrackList.prototype.allowedEvents_) {\n TrackList.prototype['on' + event] = null;\n}\n\n/**\n * Anywhere we call this function we diverge from the spec\n * as we only support one enabled audiotrack at a time\n *\n * @param {AudioTrackList} list\n * list to work on\n *\n * @param {AudioTrack} track\n * The track to skip\n *\n * @private\n */\n\nvar disableOthers = function disableOthers(list, track) {\n for (var i = 0; i < list.length; i++) {\n if (!Object.keys(list[i]).length || track.id === list[i].id) {\n continue;\n } // another audio track is enabled, disable it\n\n\n list[i].enabled = false;\n }\n};\n/**\n * The current list of {@link AudioTrack} for a media file.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#audiotracklist}\n * @extends TrackList\n */\n\n\nvar AudioTrackList =\n/*#__PURE__*/\nfunction (_TrackList) {\n _inheritsLoose(AudioTrackList, _TrackList);\n\n /**\n * Create an instance of this class.\n *\n * @param {AudioTrack[]} [tracks=[]]\n * A list of `AudioTrack` to instantiate the list with.\n */\n function AudioTrackList(tracks) {\n var _this;\n\n if (tracks === void 0) {\n tracks = [];\n }\n\n // make sure only 1 track is enabled\n // sorted from last index to first index\n for (var i = tracks.length - 1; i >= 0; i--) {\n if (tracks[i].enabled) {\n disableOthers(tracks, tracks[i]);\n break;\n }\n }\n\n _this = _TrackList.call(this, tracks) || this;\n _this.changing_ = false;\n return _this;\n }\n /**\n * Add an {@link AudioTrack} to the `AudioTrackList`.\n *\n * @param {AudioTrack} track\n * The AudioTrack to add to the list\n *\n * @fires TrackList#addtrack\n */\n\n\n var _proto = AudioTrackList.prototype;\n\n _proto.addTrack = function addTrack(track) {\n var _this2 = this;\n\n if (track.enabled) {\n disableOthers(this, track);\n }\n\n _TrackList.prototype.addTrack.call(this, track); // native tracks don't have this\n\n\n if (!track.addEventListener) {\n return;\n }\n /**\n * @listens AudioTrack#enabledchange\n * @fires TrackList#change\n */\n\n\n track.addEventListener('enabledchange', function () {\n // when we are disabling other tracks (since we don't support\n // more than one track at a time) we will set changing_\n // to true so that we don't trigger additional change events\n if (_this2.changing_) {\n return;\n }\n\n _this2.changing_ = true;\n disableOthers(_this2, track);\n _this2.changing_ = false;\n\n _this2.trigger('change');\n });\n };\n\n return AudioTrackList;\n}(TrackList);\n\n/**\n * Un-select all other {@link VideoTrack}s that are selected.\n *\n * @param {VideoTrackList} list\n * list to work on\n *\n * @param {VideoTrack} track\n * The track to skip\n *\n * @private\n */\n\nvar disableOthers$1 = function disableOthers(list, track) {\n for (var i = 0; i < list.length; i++) {\n if (!Object.keys(list[i]).length || track.id === list[i].id) {\n continue;\n } // another video track is enabled, disable it\n\n\n list[i].selected = false;\n }\n};\n/**\n * The current list of {@link VideoTrack} for a video.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#videotracklist}\n * @extends TrackList\n */\n\n\nvar VideoTrackList =\n/*#__PURE__*/\nfunction (_TrackList) {\n _inheritsLoose(VideoTrackList, _TrackList);\n\n /**\n * Create an instance of this class.\n *\n * @param {VideoTrack[]} [tracks=[]]\n * A list of `VideoTrack` to instantiate the list with.\n */\n function VideoTrackList(tracks) {\n var _this;\n\n if (tracks === void 0) {\n tracks = [];\n }\n\n // make sure only 1 track is enabled\n // sorted from last index to first index\n for (var i = tracks.length - 1; i >= 0; i--) {\n if (tracks[i].selected) {\n disableOthers$1(tracks, tracks[i]);\n break;\n }\n }\n\n _this = _TrackList.call(this, tracks) || this;\n _this.changing_ = false;\n /**\n * @member {number} VideoTrackList#selectedIndex\n * The current index of the selected {@link VideoTrack`}.\n */\n\n Object.defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), 'selectedIndex', {\n get: function get() {\n for (var _i = 0; _i < this.length; _i++) {\n if (this[_i].selected) {\n return _i;\n }\n }\n\n return -1;\n },\n set: function set() {}\n });\n return _this;\n }\n /**\n * Add a {@link VideoTrack} to the `VideoTrackList`.\n *\n * @param {VideoTrack} track\n * The VideoTrack to add to the list\n *\n * @fires TrackList#addtrack\n */\n\n\n var _proto = VideoTrackList.prototype;\n\n _proto.addTrack = function addTrack(track) {\n var _this2 = this;\n\n if (track.selected) {\n disableOthers$1(this, track);\n }\n\n _TrackList.prototype.addTrack.call(this, track); // native tracks don't have this\n\n\n if (!track.addEventListener) {\n return;\n }\n /**\n * @listens VideoTrack#selectedchange\n * @fires TrackList#change\n */\n\n\n track.addEventListener('selectedchange', function () {\n if (_this2.changing_) {\n return;\n }\n\n _this2.changing_ = true;\n disableOthers$1(_this2, track);\n _this2.changing_ = false;\n\n _this2.trigger('change');\n });\n };\n\n return VideoTrackList;\n}(TrackList);\n\n/**\n * The current list of {@link TextTrack} for a media file.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#texttracklist}\n * @extends TrackList\n */\n\nvar TextTrackList =\n/*#__PURE__*/\nfunction (_TrackList) {\n _inheritsLoose(TextTrackList, _TrackList);\n\n function TextTrackList() {\n return _TrackList.apply(this, arguments) || this;\n }\n\n var _proto = TextTrackList.prototype;\n\n /**\n * Add a {@link TextTrack} to the `TextTrackList`\n *\n * @param {TextTrack} track\n * The text track to add to the list.\n *\n * @fires TrackList#addtrack\n */\n _proto.addTrack = function addTrack(track) {\n _TrackList.prototype.addTrack.call(this, track);\n /**\n * @listens TextTrack#modechange\n * @fires TrackList#change\n */\n\n\n track.addEventListener('modechange', bind(this, function () {\n this.queueTrigger('change');\n }));\n var nonLanguageTextTrackKind = ['metadata', 'chapters'];\n\n if (nonLanguageTextTrackKind.indexOf(track.kind) === -1) {\n track.addEventListener('modechange', bind(this, function () {\n this.trigger('selectedlanguagechange');\n }));\n }\n };\n\n return TextTrackList;\n}(TrackList);\n\n/**\n * @file html-track-element-list.js\n */\n\n/**\n * The current list of {@link HtmlTrackElement}s.\n */\nvar HtmlTrackElementList =\n/*#__PURE__*/\nfunction () {\n /**\n * Create an instance of this class.\n *\n * @param {HtmlTrackElement[]} [tracks=[]]\n * A list of `HtmlTrackElement` to instantiate the list with.\n */\n function HtmlTrackElementList(trackElements) {\n if (trackElements === void 0) {\n trackElements = [];\n }\n\n this.trackElements_ = [];\n /**\n * @memberof HtmlTrackElementList\n * @member {number} length\n * The current number of `Track`s in the this Trackist.\n * @instance\n */\n\n Object.defineProperty(this, 'length', {\n get: function get() {\n return this.trackElements_.length;\n }\n });\n\n for (var i = 0, length = trackElements.length; i < length; i++) {\n this.addTrackElement_(trackElements[i]);\n }\n }\n /**\n * Add an {@link HtmlTrackElement} to the `HtmlTrackElementList`\n *\n * @param {HtmlTrackElement} trackElement\n * The track element to add to the list.\n *\n * @private\n */\n\n\n var _proto = HtmlTrackElementList.prototype;\n\n _proto.addTrackElement_ = function addTrackElement_(trackElement) {\n var index = this.trackElements_.length;\n\n if (!('' + index in this)) {\n Object.defineProperty(this, index, {\n get: function get() {\n return this.trackElements_[index];\n }\n });\n } // Do not add duplicate elements\n\n\n if (this.trackElements_.indexOf(trackElement) === -1) {\n this.trackElements_.push(trackElement);\n }\n };\n /**\n * Get an {@link HtmlTrackElement} from the `HtmlTrackElementList` given an\n * {@link TextTrack}.\n *\n * @param {TextTrack} track\n * The track associated with a track element.\n *\n * @return {HtmlTrackElement|undefined}\n * The track element that was found or undefined.\n *\n * @private\n */\n\n\n _proto.getTrackElementByTrack_ = function getTrackElementByTrack_(track) {\n var trackElement_;\n\n for (var i = 0, length = this.trackElements_.length; i < length; i++) {\n if (track === this.trackElements_[i].track) {\n trackElement_ = this.trackElements_[i];\n break;\n }\n }\n\n return trackElement_;\n };\n /**\n * Remove a {@link HtmlTrackElement} from the `HtmlTrackElementList`\n *\n * @param {HtmlTrackElement} trackElement\n * The track element to remove from the list.\n *\n * @private\n */\n\n\n _proto.removeTrackElement_ = function removeTrackElement_(trackElement) {\n for (var i = 0, length = this.trackElements_.length; i < length; i++) {\n if (trackElement === this.trackElements_[i]) {\n this.trackElements_.splice(i, 1);\n break;\n }\n }\n };\n\n return HtmlTrackElementList;\n}();\n\n/**\n * @file text-track-cue-list.js\n */\n\n/**\n * @typedef {Object} TextTrackCueList~TextTrackCue\n *\n * @property {string} id\n * The unique id for this text track cue\n *\n * @property {number} startTime\n * The start time for this text track cue\n *\n * @property {number} endTime\n * The end time for this text track cue\n *\n * @property {boolean} pauseOnExit\n * Pause when the end time is reached if true.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#texttrackcue}\n */\n\n/**\n * A List of TextTrackCues.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#texttrackcuelist}\n */\nvar TextTrackCueList =\n/*#__PURE__*/\nfunction () {\n /**\n * Create an instance of this class..\n *\n * @param {Array} cues\n * A list of cues to be initialized with\n */\n function TextTrackCueList(cues) {\n TextTrackCueList.prototype.setCues_.call(this, cues);\n /**\n * @memberof TextTrackCueList\n * @member {number} length\n * The current number of `TextTrackCue`s in the TextTrackCueList.\n * @instance\n */\n\n Object.defineProperty(this, 'length', {\n get: function get() {\n return this.length_;\n }\n });\n }\n /**\n * A setter for cues in this list. Creates getters\n * an an index for the cues.\n *\n * @param {Array} cues\n * An array of cues to set\n *\n * @private\n */\n\n\n var _proto = TextTrackCueList.prototype;\n\n _proto.setCues_ = function setCues_(cues) {\n var oldLength = this.length || 0;\n var i = 0;\n var l = cues.length;\n this.cues_ = cues;\n this.length_ = cues.length;\n\n var defineProp = function defineProp(index) {\n if (!('' + index in this)) {\n Object.defineProperty(this, '' + index, {\n get: function get() {\n return this.cues_[index];\n }\n });\n }\n };\n\n if (oldLength < l) {\n i = oldLength;\n\n for (; i < l; i++) {\n defineProp.call(this, i);\n }\n }\n };\n /**\n * Get a `TextTrackCue` that is currently in the `TextTrackCueList` by id.\n *\n * @param {string} id\n * The id of the cue that should be searched for.\n *\n * @return {TextTrackCueList~TextTrackCue|null}\n * A single cue or null if none was found.\n */\n\n\n _proto.getCueById = function getCueById(id) {\n var result = null;\n\n for (var i = 0, l = this.length; i < l; i++) {\n var cue = this[i];\n\n if (cue.id === id) {\n result = cue;\n break;\n }\n }\n\n return result;\n };\n\n return TextTrackCueList;\n}();\n\n/**\n * @file track-kinds.js\n */\n\n/**\n * All possible `VideoTrackKind`s\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-videotrack-kind\n * @typedef VideoTrack~Kind\n * @enum\n */\nvar VideoTrackKind = {\n alternative: 'alternative',\n captions: 'captions',\n main: 'main',\n sign: 'sign',\n subtitles: 'subtitles',\n commentary: 'commentary'\n};\n/**\n * All possible `AudioTrackKind`s\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-audiotrack-kind\n * @typedef AudioTrack~Kind\n * @enum\n */\n\nvar AudioTrackKind = {\n 'alternative': 'alternative',\n 'descriptions': 'descriptions',\n 'main': 'main',\n 'main-desc': 'main-desc',\n 'translation': 'translation',\n 'commentary': 'commentary'\n};\n/**\n * All possible `TextTrackKind`s\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-texttrack-kind\n * @typedef TextTrack~Kind\n * @enum\n */\n\nvar TextTrackKind = {\n subtitles: 'subtitles',\n captions: 'captions',\n descriptions: 'descriptions',\n chapters: 'chapters',\n metadata: 'metadata'\n};\n/**\n * All possible `TextTrackMode`s\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#texttrackmode\n * @typedef TextTrack~Mode\n * @enum\n */\n\nvar TextTrackMode = {\n disabled: 'disabled',\n hidden: 'hidden',\n showing: 'showing'\n};\n\n/**\n * A Track class that contains all of the common functionality for {@link AudioTrack},\n * {@link VideoTrack}, and {@link TextTrack}.\n *\n * > Note: This class should not be used directly\n *\n * @see {@link https://html.spec.whatwg.org/multipage/embedded-content.html}\n * @extends EventTarget\n * @abstract\n */\n\nvar Track =\n/*#__PURE__*/\nfunction (_EventTarget) {\n _inheritsLoose(Track, _EventTarget);\n\n /**\n * Create an instance of this class.\n *\n * @param {Object} [options={}]\n * Object of option names and values\n *\n * @param {string} [options.kind='']\n * A valid kind for the track type you are creating.\n *\n * @param {string} [options.id='vjs_track_' + Guid.newGUID()]\n * A unique id for this AudioTrack.\n *\n * @param {string} [options.label='']\n * The menu label for this track.\n *\n * @param {string} [options.language='']\n * A valid two character language code.\n *\n * @abstract\n */\n function Track(options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n _this = _EventTarget.call(this) || this;\n var trackProps = {\n id: options.id || 'vjs_track_' + newGUID(),\n kind: options.kind || '',\n label: options.label || '',\n language: options.language || ''\n };\n /**\n * @memberof Track\n * @member {string} id\n * The id of this track. Cannot be changed after creation.\n * @instance\n *\n * @readonly\n */\n\n /**\n * @memberof Track\n * @member {string} kind\n * The kind of track that this is. Cannot be changed after creation.\n * @instance\n *\n * @readonly\n */\n\n /**\n * @memberof Track\n * @member {string} label\n * The label of this track. Cannot be changed after creation.\n * @instance\n *\n * @readonly\n */\n\n /**\n * @memberof Track\n * @member {string} language\n * The two letter language code for this track. Cannot be changed after\n * creation.\n * @instance\n *\n * @readonly\n */\n\n var _loop = function _loop(key) {\n Object.defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), key, {\n get: function get() {\n return trackProps[key];\n },\n set: function set() {}\n });\n };\n\n for (var key in trackProps) {\n _loop(key);\n }\n\n return _this;\n }\n\n return Track;\n}(EventTarget);\n\n/**\n * @file url.js\n * @module url\n */\n/**\n * @typedef {Object} url:URLObject\n *\n * @property {string} protocol\n * The protocol of the url that was parsed.\n *\n * @property {string} hostname\n * The hostname of the url that was parsed.\n *\n * @property {string} port\n * The port of the url that was parsed.\n *\n * @property {string} pathname\n * The pathname of the url that was parsed.\n *\n * @property {string} search\n * The search query of the url that was parsed.\n *\n * @property {string} hash\n * The hash of the url that was parsed.\n *\n * @property {string} host\n * The host of the url that was parsed.\n */\n\n/**\n * Resolve and parse the elements of a URL.\n *\n * @function\n * @param {String} url\n * The url to parse\n *\n * @return {url:URLObject}\n * An object of url details\n */\n\nvar parseUrl = function parseUrl(url) {\n var props = ['protocol', 'hostname', 'port', 'pathname', 'search', 'hash', 'host']; // add the url to an anchor and let the browser parse the URL\n\n var a = document.createElement('a');\n a.href = url; // IE8 (and 9?) Fix\n // ie8 doesn't parse the URL correctly until the anchor is actually\n // added to the body, and an innerHTML is needed to trigger the parsing\n\n var addToBody = a.host === '' && a.protocol !== 'file:';\n var div;\n\n if (addToBody) {\n div = document.createElement('div');\n div.innerHTML = \"<a href=\\\"\" + url + \"\\\"></a>\";\n a = div.firstChild; // prevent the div from affecting layout\n\n div.setAttribute('style', 'display:none; position:absolute;');\n document.body.appendChild(div);\n } // Copy the specific URL properties to a new object\n // This is also needed for IE8 because the anchor loses its\n // properties when it's removed from the dom\n\n\n var details = {};\n\n for (var i = 0; i < props.length; i++) {\n details[props[i]] = a[props[i]];\n } // IE9 adds the port to the host property unlike everyone else. If\n // a port identifier is added for standard ports, strip it.\n\n\n if (details.protocol === 'http:') {\n details.host = details.host.replace(/:80$/, '');\n }\n\n if (details.protocol === 'https:') {\n details.host = details.host.replace(/:443$/, '');\n }\n\n if (!details.protocol) {\n details.protocol = window$1.location.protocol;\n }\n\n if (addToBody) {\n document.body.removeChild(div);\n }\n\n return details;\n};\n/**\n * Get absolute version of relative URL. Used to tell Flash the correct URL.\n *\n * @function\n * @param {string} url\n * URL to make absolute\n *\n * @return {string}\n * Absolute URL\n *\n * @see http://stackoverflow.com/questions/470832/getting-an-absolute-url-from-a-relative-one-ie6-issue\n */\n\nvar getAbsoluteURL = function getAbsoluteURL(url) {\n // Check if absolute URL\n if (!url.match(/^https?:\\/\\//)) {\n // Convert to absolute URL. Flash hosted off-site needs an absolute URL.\n var div = document.createElement('div');\n div.innerHTML = \"<a href=\\\"\" + url + \"\\\">x</a>\";\n url = div.firstChild.href;\n }\n\n return url;\n};\n/**\n * Returns the extension of the passed file name. It will return an empty string\n * if passed an invalid path.\n *\n * @function\n * @param {string} path\n * The fileName path like '/path/to/file.mp4'\n *\n * @returns {string}\n * The extension in lower case or an empty string if no\n * extension could be found.\n */\n\nvar getFileExtension = function getFileExtension(path) {\n if (typeof path === 'string') {\n var splitPathRe = /^(\\/?)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?)(\\.([^\\.\\/\\?]+)))(?:[\\/]*|[\\?].*)$/i;\n var pathParts = splitPathRe.exec(path);\n\n if (pathParts) {\n return pathParts.pop().toLowerCase();\n }\n }\n\n return '';\n};\n/**\n * Returns whether the url passed is a cross domain request or not.\n *\n * @function\n * @param {string} url\n * The url to check.\n *\n * @return {boolean}\n * Whether it is a cross domain request or not.\n */\n\nvar isCrossOrigin = function isCrossOrigin(url) {\n var winLoc = window$1.location;\n var urlInfo = parseUrl(url); // IE8 protocol relative urls will return ':' for protocol\n\n var srcProtocol = urlInfo.protocol === ':' ? winLoc.protocol : urlInfo.protocol; // Check if url is for another domain/origin\n // IE8 doesn't know location.origin, so we won't rely on it here\n\n var crossOrigin = srcProtocol + urlInfo.host !== winLoc.protocol + winLoc.host;\n return crossOrigin;\n};\n\nvar Url = /*#__PURE__*/Object.freeze({\n parseUrl: parseUrl,\n getAbsoluteURL: getAbsoluteURL,\n getFileExtension: getFileExtension,\n isCrossOrigin: isCrossOrigin\n});\n\n/**\n * Takes a webvtt file contents and parses it into cues\n *\n * @param {string} srcContent\n * webVTT file contents\n *\n * @param {TextTrack} track\n * TextTrack to add cues to. Cues come from the srcContent.\n *\n * @private\n */\n\nvar parseCues = function parseCues(srcContent, track) {\n var parser = new window$1.WebVTT.Parser(window$1, window$1.vttjs, window$1.WebVTT.StringDecoder());\n var errors = [];\n\n parser.oncue = function (cue) {\n track.addCue(cue);\n };\n\n parser.onparsingerror = function (error) {\n errors.push(error);\n };\n\n parser.onflush = function () {\n track.trigger({\n type: 'loadeddata',\n target: track\n });\n };\n\n parser.parse(srcContent);\n\n if (errors.length > 0) {\n if (window$1.console && window$1.console.groupCollapsed) {\n window$1.console.groupCollapsed(\"Text Track parsing errors for \" + track.src);\n }\n\n errors.forEach(function (error) {\n return log.error(error);\n });\n\n if (window$1.console && window$1.console.groupEnd) {\n window$1.console.groupEnd();\n }\n }\n\n parser.flush();\n};\n/**\n * Load a `TextTrack` from a specified url.\n *\n * @param {string} src\n * Url to load track from.\n *\n * @param {TextTrack} track\n * Track to add cues to. Comes from the content at the end of `url`.\n *\n * @private\n */\n\n\nvar loadTrack = function loadTrack(src, track) {\n var opts = {\n uri: src\n };\n var crossOrigin = isCrossOrigin(src);\n\n if (crossOrigin) {\n opts.cors = crossOrigin;\n }\n\n xhr(opts, bind(this, function (err, response, responseBody) {\n if (err) {\n return log.error(err, response);\n }\n\n track.loaded_ = true; // Make sure that vttjs has loaded, otherwise, wait till it finished loading\n // NOTE: this is only used for the alt/video.novtt.js build\n\n if (typeof window$1.WebVTT !== 'function') {\n if (track.tech_) {\n var loadHandler = function loadHandler() {\n return parseCues(responseBody, track);\n };\n\n track.tech_.on('vttjsloaded', loadHandler);\n track.tech_.on('vttjserror', function () {\n log.error(\"vttjs failed to load, stopping trying to process \" + track.src);\n track.tech_.off('vttjsloaded', loadHandler);\n });\n }\n } else {\n parseCues(responseBody, track);\n }\n }));\n};\n/**\n * A representation of a single `TextTrack`.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#texttrack}\n * @extends Track\n */\n\n\nvar TextTrack =\n/*#__PURE__*/\nfunction (_Track) {\n _inheritsLoose(TextTrack, _Track);\n\n /**\n * Create an instance of this class.\n *\n * @param {Object} options={}\n * Object of option names and values\n *\n * @param {Tech} options.tech\n * A reference to the tech that owns this TextTrack.\n *\n * @param {TextTrack~Kind} [options.kind='subtitles']\n * A valid text track kind.\n *\n * @param {TextTrack~Mode} [options.mode='disabled']\n * A valid text track mode.\n *\n * @param {string} [options.id='vjs_track_' + Guid.newGUID()]\n * A unique id for this TextTrack.\n *\n * @param {string} [options.label='']\n * The menu label for this track.\n *\n * @param {string} [options.language='']\n * A valid two character language code.\n *\n * @param {string} [options.srclang='']\n * A valid two character language code. An alternative, but deprioritized\n * version of `options.language`\n *\n * @param {string} [options.src]\n * A url to TextTrack cues.\n *\n * @param {boolean} [options.default]\n * If this track should default to on or off.\n */\n function TextTrack(options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n if (!options.tech) {\n throw new Error('A tech was not provided.');\n }\n\n var settings = mergeOptions(options, {\n kind: TextTrackKind[options.kind] || 'subtitles',\n language: options.language || options.srclang || ''\n });\n var mode = TextTrackMode[settings.mode] || 'disabled';\n var default_ = settings.default;\n\n if (settings.kind === 'metadata' || settings.kind === 'chapters') {\n mode = 'hidden';\n }\n\n _this = _Track.call(this, settings) || this;\n _this.tech_ = settings.tech;\n _this.cues_ = [];\n _this.activeCues_ = [];\n var cues = new TextTrackCueList(_this.cues_);\n var activeCues = new TextTrackCueList(_this.activeCues_);\n var changed = false;\n var timeupdateHandler = bind(_assertThisInitialized(_assertThisInitialized(_this)), function () {\n // Accessing this.activeCues for the side-effects of updating itself\n // due to it's nature as a getter function. Do not remove or cues will\n // stop updating!\n // Use the setter to prevent deletion from uglify (pure_getters rule)\n this.activeCues = this.activeCues;\n\n if (changed) {\n this.trigger('cuechange');\n changed = false;\n }\n });\n\n if (mode !== 'disabled') {\n _this.tech_.ready(function () {\n _this.tech_.on('timeupdate', timeupdateHandler);\n }, true);\n }\n\n Object.defineProperties(_assertThisInitialized(_assertThisInitialized(_this)), {\n /**\n * @memberof TextTrack\n * @member {boolean} default\n * If this track was set to be on or off by default. Cannot be changed after\n * creation.\n * @instance\n *\n * @readonly\n */\n default: {\n get: function get() {\n return default_;\n },\n set: function set() {}\n },\n\n /**\n * @memberof TextTrack\n * @member {string} mode\n * Set the mode of this TextTrack to a valid {@link TextTrack~Mode}. Will\n * not be set if setting to an invalid mode.\n * @instance\n *\n * @fires TextTrack#modechange\n */\n mode: {\n get: function get() {\n return mode;\n },\n set: function set(newMode) {\n var _this2 = this;\n\n if (!TextTrackMode[newMode]) {\n return;\n }\n\n mode = newMode;\n\n if (mode !== 'disabled') {\n this.tech_.ready(function () {\n _this2.tech_.on('timeupdate', timeupdateHandler);\n }, true);\n } else {\n this.tech_.off('timeupdate', timeupdateHandler);\n }\n /**\n * An event that fires when mode changes on this track. This allows\n * the TextTrackList that holds this track to act accordingly.\n *\n * > Note: This is not part of the spec!\n *\n * @event TextTrack#modechange\n * @type {EventTarget~Event}\n */\n\n\n this.trigger('modechange');\n }\n },\n\n /**\n * @memberof TextTrack\n * @member {TextTrackCueList} cues\n * The text track cue list for this TextTrack.\n * @instance\n */\n cues: {\n get: function get() {\n if (!this.loaded_) {\n return null;\n }\n\n return cues;\n },\n set: function set() {}\n },\n\n /**\n * @memberof TextTrack\n * @member {TextTrackCueList} activeCues\n * The list text track cues that are currently active for this TextTrack.\n * @instance\n */\n activeCues: {\n get: function get() {\n if (!this.loaded_) {\n return null;\n } // nothing to do\n\n\n if (this.cues.length === 0) {\n return activeCues;\n }\n\n var ct = this.tech_.currentTime();\n var active = [];\n\n for (var i = 0, l = this.cues.length; i < l; i++) {\n var cue = this.cues[i];\n\n if (cue.startTime <= ct && cue.endTime >= ct) {\n active.push(cue);\n } else if (cue.startTime === cue.endTime && cue.startTime <= ct && cue.startTime + 0.5 >= ct) {\n active.push(cue);\n }\n }\n\n changed = false;\n\n if (active.length !== this.activeCues_.length) {\n changed = true;\n } else {\n for (var _i = 0; _i < active.length; _i++) {\n if (this.activeCues_.indexOf(active[_i]) === -1) {\n changed = true;\n }\n }\n }\n\n this.activeCues_ = active;\n activeCues.setCues_(this.activeCues_);\n return activeCues;\n },\n // /!\\ Keep this setter empty (see the timeupdate handler above)\n set: function set() {}\n }\n });\n\n if (settings.src) {\n _this.src = settings.src;\n loadTrack(settings.src, _assertThisInitialized(_assertThisInitialized(_this)));\n } else {\n _this.loaded_ = true;\n }\n\n return _this;\n }\n /**\n * Add a cue to the internal list of cues.\n *\n * @param {TextTrack~Cue} cue\n * The cue to add to our internal list\n */\n\n\n var _proto = TextTrack.prototype;\n\n _proto.addCue = function addCue(originalCue) {\n var cue = originalCue;\n\n if (window$1.vttjs && !(originalCue instanceof window$1.vttjs.VTTCue)) {\n cue = new window$1.vttjs.VTTCue(originalCue.startTime, originalCue.endTime, originalCue.text);\n\n for (var prop in originalCue) {\n if (!(prop in cue)) {\n cue[prop] = originalCue[prop];\n }\n } // make sure that `id` is copied over\n\n\n cue.id = originalCue.id;\n cue.originalCue_ = originalCue;\n }\n\n var tracks = this.tech_.textTracks();\n\n for (var i = 0; i < tracks.length; i++) {\n if (tracks[i] !== this) {\n tracks[i].removeCue(cue);\n }\n }\n\n this.cues_.push(cue);\n this.cues.setCues_(this.cues_);\n };\n /**\n * Remove a cue from our internal list\n *\n * @param {TextTrack~Cue} removeCue\n * The cue to remove from our internal list\n */\n\n\n _proto.removeCue = function removeCue(_removeCue) {\n var i = this.cues_.length;\n\n while (i--) {\n var cue = this.cues_[i];\n\n if (cue === _removeCue || cue.originalCue_ && cue.originalCue_ === _removeCue) {\n this.cues_.splice(i, 1);\n this.cues.setCues_(this.cues_);\n break;\n }\n }\n };\n\n return TextTrack;\n}(Track);\n/**\n * cuechange - One or more cues in the track have become active or stopped being active.\n */\n\n\nTextTrack.prototype.allowedEvents_ = {\n cuechange: 'cuechange'\n};\n\n/**\n * A representation of a single `AudioTrack`. If it is part of an {@link AudioTrackList}\n * only one `AudioTrack` in the list will be enabled at a time.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#audiotrack}\n * @extends Track\n */\n\nvar AudioTrack =\n/*#__PURE__*/\nfunction (_Track) {\n _inheritsLoose(AudioTrack, _Track);\n\n /**\n * Create an instance of this class.\n *\n * @param {Object} [options={}]\n * Object of option names and values\n *\n * @param {AudioTrack~Kind} [options.kind='']\n * A valid audio track kind\n *\n * @param {string} [options.id='vjs_track_' + Guid.newGUID()]\n * A unique id for this AudioTrack.\n *\n * @param {string} [options.label='']\n * The menu label for this track.\n *\n * @param {string} [options.language='']\n * A valid two character language code.\n *\n * @param {boolean} [options.enabled]\n * If this track is the one that is currently playing. If this track is part of\n * an {@link AudioTrackList}, only one {@link AudioTrack} will be enabled.\n */\n function AudioTrack(options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n var settings = mergeOptions(options, {\n kind: AudioTrackKind[options.kind] || ''\n });\n _this = _Track.call(this, settings) || this;\n var enabled = false;\n /**\n * @memberof AudioTrack\n * @member {boolean} enabled\n * If this `AudioTrack` is enabled or not. When setting this will\n * fire {@link AudioTrack#enabledchange} if the state of enabled is changed.\n * @instance\n *\n * @fires VideoTrack#selectedchange\n */\n\n Object.defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), 'enabled', {\n get: function get() {\n return enabled;\n },\n set: function set(newEnabled) {\n // an invalid or unchanged value\n if (typeof newEnabled !== 'boolean' || newEnabled === enabled) {\n return;\n }\n\n enabled = newEnabled;\n /**\n * An event that fires when enabled changes on this track. This allows\n * the AudioTrackList that holds this track to act accordingly.\n *\n * > Note: This is not part of the spec! Native tracks will do\n * this internally without an event.\n *\n * @event AudioTrack#enabledchange\n * @type {EventTarget~Event}\n */\n\n this.trigger('enabledchange');\n }\n }); // if the user sets this track to selected then\n // set selected to that true value otherwise\n // we keep it false\n\n if (settings.enabled) {\n _this.enabled = settings.enabled;\n }\n\n _this.loaded_ = true;\n return _this;\n }\n\n return AudioTrack;\n}(Track);\n\n/**\n * A representation of a single `VideoTrack`.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#videotrack}\n * @extends Track\n */\n\nvar VideoTrack =\n/*#__PURE__*/\nfunction (_Track) {\n _inheritsLoose(VideoTrack, _Track);\n\n /**\n * Create an instance of this class.\n *\n * @param {Object} [options={}]\n * Object of option names and values\n *\n * @param {string} [options.kind='']\n * A valid {@link VideoTrack~Kind}\n *\n * @param {string} [options.id='vjs_track_' + Guid.newGUID()]\n * A unique id for this AudioTrack.\n *\n * @param {string} [options.label='']\n * The menu label for this track.\n *\n * @param {string} [options.language='']\n * A valid two character language code.\n *\n * @param {boolean} [options.selected]\n * If this track is the one that is currently playing.\n */\n function VideoTrack(options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n var settings = mergeOptions(options, {\n kind: VideoTrackKind[options.kind] || ''\n });\n _this = _Track.call(this, settings) || this;\n var selected = false;\n /**\n * @memberof VideoTrack\n * @member {boolean} selected\n * If this `VideoTrack` is selected or not. When setting this will\n * fire {@link VideoTrack#selectedchange} if the state of selected changed.\n * @instance\n *\n * @fires VideoTrack#selectedchange\n */\n\n Object.defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), 'selected', {\n get: function get() {\n return selected;\n },\n set: function set(newSelected) {\n // an invalid or unchanged value\n if (typeof newSelected !== 'boolean' || newSelected === selected) {\n return;\n }\n\n selected = newSelected;\n /**\n * An event that fires when selected changes on this track. This allows\n * the VideoTrackList that holds this track to act accordingly.\n *\n * > Note: This is not part of the spec! Native tracks will do\n * this internally without an event.\n *\n * @event VideoTrack#selectedchange\n * @type {EventTarget~Event}\n */\n\n this.trigger('selectedchange');\n }\n }); // if the user sets this track to selected then\n // set selected to that true value otherwise\n // we keep it false\n\n if (settings.selected) {\n _this.selected = settings.selected;\n }\n\n return _this;\n }\n\n return VideoTrack;\n}(Track);\n\n/**\n * @memberof HTMLTrackElement\n * @typedef {HTMLTrackElement~ReadyState}\n * @enum {number}\n */\n\nvar NONE = 0;\nvar LOADING = 1;\nvar LOADED = 2;\nvar ERROR = 3;\n/**\n * A single track represented in the DOM.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#htmltrackelement}\n * @extends EventTarget\n */\n\nvar HTMLTrackElement =\n/*#__PURE__*/\nfunction (_EventTarget) {\n _inheritsLoose(HTMLTrackElement, _EventTarget);\n\n /**\n * Create an instance of this class.\n *\n * @param {Object} options={}\n * Object of option names and values\n *\n * @param {Tech} options.tech\n * A reference to the tech that owns this HTMLTrackElement.\n *\n * @param {TextTrack~Kind} [options.kind='subtitles']\n * A valid text track kind.\n *\n * @param {TextTrack~Mode} [options.mode='disabled']\n * A valid text track mode.\n *\n * @param {string} [options.id='vjs_track_' + Guid.newGUID()]\n * A unique id for this TextTrack.\n *\n * @param {string} [options.label='']\n * The menu label for this track.\n *\n * @param {string} [options.language='']\n * A valid two character language code.\n *\n * @param {string} [options.srclang='']\n * A valid two character language code. An alternative, but deprioritized\n * vesion of `options.language`\n *\n * @param {string} [options.src]\n * A url to TextTrack cues.\n *\n * @param {boolean} [options.default]\n * If this track should default to on or off.\n */\n function HTMLTrackElement(options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n _this = _EventTarget.call(this) || this;\n var readyState;\n var track = new TextTrack(options);\n _this.kind = track.kind;\n _this.src = track.src;\n _this.srclang = track.language;\n _this.label = track.label;\n _this.default = track.default;\n Object.defineProperties(_assertThisInitialized(_assertThisInitialized(_this)), {\n /**\n * @memberof HTMLTrackElement\n * @member {HTMLTrackElement~ReadyState} readyState\n * The current ready state of the track element.\n * @instance\n */\n readyState: {\n get: function get() {\n return readyState;\n }\n },\n\n /**\n * @memberof HTMLTrackElement\n * @member {TextTrack} track\n * The underlying TextTrack object.\n * @instance\n *\n */\n track: {\n get: function get() {\n return track;\n }\n }\n });\n readyState = NONE;\n /**\n * @listens TextTrack#loadeddata\n * @fires HTMLTrackElement#load\n */\n\n track.addEventListener('loadeddata', function () {\n readyState = LOADED;\n\n _this.trigger({\n type: 'load',\n target: _assertThisInitialized(_assertThisInitialized(_this))\n });\n });\n return _this;\n }\n\n return HTMLTrackElement;\n}(EventTarget);\n\nHTMLTrackElement.prototype.allowedEvents_ = {\n load: 'load'\n};\nHTMLTrackElement.NONE = NONE;\nHTMLTrackElement.LOADING = LOADING;\nHTMLTrackElement.LOADED = LOADED;\nHTMLTrackElement.ERROR = ERROR;\n\n/*\n * This file contains all track properties that are used in\n * player.js, tech.js, html5.js and possibly other techs in the future.\n */\n\nvar NORMAL = {\n audio: {\n ListClass: AudioTrackList,\n TrackClass: AudioTrack,\n capitalName: 'Audio'\n },\n video: {\n ListClass: VideoTrackList,\n TrackClass: VideoTrack,\n capitalName: 'Video'\n },\n text: {\n ListClass: TextTrackList,\n TrackClass: TextTrack,\n capitalName: 'Text'\n }\n};\nObject.keys(NORMAL).forEach(function (type) {\n NORMAL[type].getterName = type + \"Tracks\";\n NORMAL[type].privateName = type + \"Tracks_\";\n});\nvar REMOTE = {\n remoteText: {\n ListClass: TextTrackList,\n TrackClass: TextTrack,\n capitalName: 'RemoteText',\n getterName: 'remoteTextTracks',\n privateName: 'remoteTextTracks_'\n },\n remoteTextEl: {\n ListClass: HtmlTrackElementList,\n TrackClass: HTMLTrackElement,\n capitalName: 'RemoteTextTrackEls',\n getterName: 'remoteTextTrackEls',\n privateName: 'remoteTextTrackEls_'\n }\n};\nvar ALL = mergeOptions(NORMAL, REMOTE);\nREMOTE.names = Object.keys(REMOTE);\nNORMAL.names = Object.keys(NORMAL);\nALL.names = [].concat(REMOTE.names).concat(NORMAL.names);\n\n/**\n * An Object containing a structure like: `{src: 'url', type: 'mimetype'}` or string\n * that just contains the src url alone.\n * * `var SourceObject = {src: 'http://ex.com/video.mp4', type: 'video/mp4'};`\n * `var SourceString = 'http://example.com/some-video.mp4';`\n *\n * @typedef {Object|string} Tech~SourceObject\n *\n * @property {string} src\n * The url to the source\n *\n * @property {string} type\n * The mime type of the source\n */\n\n/**\n * A function used by {@link Tech} to create a new {@link TextTrack}.\n *\n * @private\n *\n * @param {Tech} self\n * An instance of the Tech class.\n *\n * @param {string} kind\n * `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata)\n *\n * @param {string} [label]\n * Label to identify the text track\n *\n * @param {string} [language]\n * Two letter language abbreviation\n *\n * @param {Object} [options={}]\n * An object with additional text track options\n *\n * @return {TextTrack}\n * The text track that was created.\n */\n\nfunction createTrackHelper(self, kind, label, language, options) {\n if (options === void 0) {\n options = {};\n }\n\n var tracks = self.textTracks();\n options.kind = kind;\n\n if (label) {\n options.label = label;\n }\n\n if (language) {\n options.language = language;\n }\n\n options.tech = self;\n var track = new ALL.text.TrackClass(options);\n tracks.addTrack(track);\n return track;\n}\n/**\n * This is the base class for media playback technology controllers, such as\n * {@link Flash} and {@link HTML5}\n *\n * @extends Component\n */\n\n\nvar Tech =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(Tech, _Component);\n\n /**\n * Create an instance of this Tech.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Component~ReadyCallback} ready\n * Callback function to call when the `HTML5` Tech is ready.\n */\n function Tech(options, ready) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n if (ready === void 0) {\n ready = function ready() {};\n }\n\n // we don't want the tech to report user activity automatically.\n // This is done manually in addControlsListeners\n options.reportTouchActivity = false;\n _this = _Component.call(this, null, options, ready) || this; // keep track of whether the current source has played at all to\n // implement a very limited played()\n\n _this.hasStarted_ = false;\n\n _this.on('playing', function () {\n this.hasStarted_ = true;\n });\n\n _this.on('loadstart', function () {\n this.hasStarted_ = false;\n });\n\n ALL.names.forEach(function (name) {\n var props = ALL[name];\n\n if (options && options[props.getterName]) {\n _this[props.privateName] = options[props.getterName];\n }\n }); // Manually track progress in cases where the browser/flash player doesn't report it.\n\n if (!_this.featuresProgressEvents) {\n _this.manualProgressOn();\n } // Manually track timeupdates in cases where the browser/flash player doesn't report it.\n\n\n if (!_this.featuresTimeupdateEvents) {\n _this.manualTimeUpdatesOn();\n }\n\n ['Text', 'Audio', 'Video'].forEach(function (track) {\n if (options[\"native\" + track + \"Tracks\"] === false) {\n _this[\"featuresNative\" + track + \"Tracks\"] = false;\n }\n });\n\n if (options.nativeCaptions === false || options.nativeTextTracks === false) {\n _this.featuresNativeTextTracks = false;\n } else if (options.nativeCaptions === true || options.nativeTextTracks === true) {\n _this.featuresNativeTextTracks = true;\n }\n\n if (!_this.featuresNativeTextTracks) {\n _this.emulateTextTracks();\n }\n\n _this.autoRemoteTextTracks_ = new ALL.text.ListClass();\n\n _this.initTrackListeners(); // Turn on component tap events only if not using native controls\n\n\n if (!options.nativeControlsForTouch) {\n _this.emitTapEvents();\n }\n\n if (_this.constructor) {\n _this.name_ = _this.constructor.name || 'Unknown Tech';\n }\n\n return _this;\n }\n /**\n * A special function to trigger source set in a way that will allow player\n * to re-trigger if the player or tech are not ready yet.\n *\n * @fires Tech#sourceset\n * @param {string} src The source string at the time of the source changing.\n */\n\n\n var _proto = Tech.prototype;\n\n _proto.triggerSourceset = function triggerSourceset(src) {\n var _this2 = this;\n\n if (!this.isReady_) {\n // on initial ready we have to trigger source set\n // 1ms after ready so that player can watch for it.\n this.one('ready', function () {\n return _this2.setTimeout(function () {\n return _this2.triggerSourceset(src);\n }, 1);\n });\n }\n /**\n * Fired when the source is set on the tech causing the media element\n * to reload.\n *\n * @see {@link Player#event:sourceset}\n * @event Tech#sourceset\n * @type {EventTarget~Event}\n */\n\n\n this.trigger({\n src: src,\n type: 'sourceset'\n });\n };\n /* Fallbacks for unsupported event types\n ================================================================================ */\n\n /**\n * Polyfill the `progress` event for browsers that don't support it natively.\n *\n * @see {@link Tech#trackProgress}\n */\n\n\n _proto.manualProgressOn = function manualProgressOn() {\n this.on('durationchange', this.onDurationChange);\n this.manualProgress = true; // Trigger progress watching when a source begins loading\n\n this.one('ready', this.trackProgress);\n };\n /**\n * Turn off the polyfill for `progress` events that was created in\n * {@link Tech#manualProgressOn}\n */\n\n\n _proto.manualProgressOff = function manualProgressOff() {\n this.manualProgress = false;\n this.stopTrackingProgress();\n this.off('durationchange', this.onDurationChange);\n };\n /**\n * This is used to trigger a `progress` event when the buffered percent changes. It\n * sets an interval function that will be called every 500 milliseconds to check if the\n * buffer end percent has changed.\n *\n * > This function is called by {@link Tech#manualProgressOn}\n *\n * @param {EventTarget~Event} event\n * The `ready` event that caused this to run.\n *\n * @listens Tech#ready\n * @fires Tech#progress\n */\n\n\n _proto.trackProgress = function trackProgress(event) {\n this.stopTrackingProgress();\n this.progressInterval = this.setInterval(bind(this, function () {\n // Don't trigger unless buffered amount is greater than last time\n var numBufferedPercent = this.bufferedPercent();\n\n if (this.bufferedPercent_ !== numBufferedPercent) {\n /**\n * See {@link Player#progress}\n *\n * @event Tech#progress\n * @type {EventTarget~Event}\n */\n this.trigger('progress');\n }\n\n this.bufferedPercent_ = numBufferedPercent;\n\n if (numBufferedPercent === 1) {\n this.stopTrackingProgress();\n }\n }), 500);\n };\n /**\n * Update our internal duration on a `durationchange` event by calling\n * {@link Tech#duration}.\n *\n * @param {EventTarget~Event} event\n * The `durationchange` event that caused this to run.\n *\n * @listens Tech#durationchange\n */\n\n\n _proto.onDurationChange = function onDurationChange(event) {\n this.duration_ = this.duration();\n };\n /**\n * Get and create a `TimeRange` object for buffering.\n *\n * @return {TimeRange}\n * The time range object that was created.\n */\n\n\n _proto.buffered = function buffered() {\n return createTimeRanges(0, 0);\n };\n /**\n * Get the percentage of the current video that is currently buffered.\n *\n * @return {number}\n * A number from 0 to 1 that represents the decimal percentage of the\n * video that is buffered.\n *\n */\n\n\n _proto.bufferedPercent = function bufferedPercent$$1() {\n return bufferedPercent(this.buffered(), this.duration_);\n };\n /**\n * Turn off the polyfill for `progress` events that was created in\n * {@link Tech#manualProgressOn}\n * Stop manually tracking progress events by clearing the interval that was set in\n * {@link Tech#trackProgress}.\n */\n\n\n _proto.stopTrackingProgress = function stopTrackingProgress() {\n this.clearInterval(this.progressInterval);\n };\n /**\n * Polyfill the `timeupdate` event for browsers that don't support it.\n *\n * @see {@link Tech#trackCurrentTime}\n */\n\n\n _proto.manualTimeUpdatesOn = function manualTimeUpdatesOn() {\n this.manualTimeUpdates = true;\n this.on('play', this.trackCurrentTime);\n this.on('pause', this.stopTrackingCurrentTime);\n };\n /**\n * Turn off the polyfill for `timeupdate` events that was created in\n * {@link Tech#manualTimeUpdatesOn}\n */\n\n\n _proto.manualTimeUpdatesOff = function manualTimeUpdatesOff() {\n this.manualTimeUpdates = false;\n this.stopTrackingCurrentTime();\n this.off('play', this.trackCurrentTime);\n this.off('pause', this.stopTrackingCurrentTime);\n };\n /**\n * Sets up an interval function to track current time and trigger `timeupdate` every\n * 250 milliseconds.\n *\n * @listens Tech#play\n * @triggers Tech#timeupdate\n */\n\n\n _proto.trackCurrentTime = function trackCurrentTime() {\n if (this.currentTimeInterval) {\n this.stopTrackingCurrentTime();\n }\n\n this.currentTimeInterval = this.setInterval(function () {\n /**\n * Triggered at an interval of 250ms to indicated that time is passing in the video.\n *\n * @event Tech#timeupdate\n * @type {EventTarget~Event}\n */\n this.trigger({\n type: 'timeupdate',\n target: this,\n manuallyTriggered: true\n }); // 42 = 24 fps // 250 is what Webkit uses // FF uses 15\n }, 250);\n };\n /**\n * Stop the interval function created in {@link Tech#trackCurrentTime} so that the\n * `timeupdate` event is no longer triggered.\n *\n * @listens {Tech#pause}\n */\n\n\n _proto.stopTrackingCurrentTime = function stopTrackingCurrentTime() {\n this.clearInterval(this.currentTimeInterval); // #1002 - if the video ends right before the next timeupdate would happen,\n // the progress bar won't make it all the way to the end\n\n this.trigger({\n type: 'timeupdate',\n target: this,\n manuallyTriggered: true\n });\n };\n /**\n * Turn off all event polyfills, clear the `Tech`s {@link AudioTrackList},\n * {@link VideoTrackList}, and {@link TextTrackList}, and dispose of this Tech.\n *\n * @fires Component#dispose\n */\n\n\n _proto.dispose = function dispose() {\n // clear out all tracks because we can't reuse them between techs\n this.clearTracks(NORMAL.names); // Turn off any manual progress or timeupdate tracking\n\n if (this.manualProgress) {\n this.manualProgressOff();\n }\n\n if (this.manualTimeUpdates) {\n this.manualTimeUpdatesOff();\n }\n\n _Component.prototype.dispose.call(this);\n };\n /**\n * Clear out a single `TrackList` or an array of `TrackLists` given their names.\n *\n * > Note: Techs without source handlers should call this between sources for `video`\n * & `audio` tracks. You don't want to use them between tracks!\n *\n * @param {string[]|string} types\n * TrackList names to clear, valid names are `video`, `audio`, and\n * `text`.\n */\n\n\n _proto.clearTracks = function clearTracks(types) {\n var _this3 = this;\n\n types = [].concat(types); // clear out all tracks because we can't reuse them between techs\n\n types.forEach(function (type) {\n var list = _this3[type + \"Tracks\"]() || [];\n var i = list.length;\n\n while (i--) {\n var track = list[i];\n\n if (type === 'text') {\n _this3.removeRemoteTextTrack(track);\n }\n\n list.removeTrack(track);\n }\n });\n };\n /**\n * Remove any TextTracks added via addRemoteTextTrack that are\n * flagged for automatic garbage collection\n */\n\n\n _proto.cleanupAutoTextTracks = function cleanupAutoTextTracks() {\n var list = this.autoRemoteTextTracks_ || [];\n var i = list.length;\n\n while (i--) {\n var track = list[i];\n this.removeRemoteTextTrack(track);\n }\n };\n /**\n * Reset the tech, which will removes all sources and reset the internal readyState.\n *\n * @abstract\n */\n\n\n _proto.reset = function reset() {};\n /**\n * Get or set an error on the Tech.\n *\n * @param {MediaError} [err]\n * Error to set on the Tech\n *\n * @return {MediaError|null}\n * The current error object on the tech, or null if there isn't one.\n */\n\n\n _proto.error = function error(err) {\n if (err !== undefined) {\n this.error_ = new MediaError(err);\n this.trigger('error');\n }\n\n return this.error_;\n };\n /**\n * Returns the `TimeRange`s that have been played through for the current source.\n *\n * > NOTE: This implementation is incomplete. It does not track the played `TimeRange`.\n * It only checks whether the source has played at all or not.\n *\n * @return {TimeRange}\n * - A single time range if this video has played\n * - An empty set of ranges if not.\n */\n\n\n _proto.played = function played() {\n if (this.hasStarted_) {\n return createTimeRanges(0, 0);\n }\n\n return createTimeRanges();\n };\n /**\n * Causes a manual time update to occur if {@link Tech#manualTimeUpdatesOn} was\n * previously called.\n *\n * @fires Tech#timeupdate\n */\n\n\n _proto.setCurrentTime = function setCurrentTime() {\n // improve the accuracy of manual timeupdates\n if (this.manualTimeUpdates) {\n /**\n * A manual `timeupdate` event.\n *\n * @event Tech#timeupdate\n * @type {EventTarget~Event}\n */\n this.trigger({\n type: 'timeupdate',\n target: this,\n manuallyTriggered: true\n });\n }\n };\n /**\n * Turn on listeners for {@link VideoTrackList}, {@link {AudioTrackList}, and\n * {@link TextTrackList} events.\n *\n * This adds {@link EventTarget~EventListeners} for `addtrack`, and `removetrack`.\n *\n * @fires Tech#audiotrackchange\n * @fires Tech#videotrackchange\n * @fires Tech#texttrackchange\n */\n\n\n _proto.initTrackListeners = function initTrackListeners() {\n var _this4 = this;\n\n /**\n * Triggered when tracks are added or removed on the Tech {@link AudioTrackList}\n *\n * @event Tech#audiotrackchange\n * @type {EventTarget~Event}\n */\n\n /**\n * Triggered when tracks are added or removed on the Tech {@link VideoTrackList}\n *\n * @event Tech#videotrackchange\n * @type {EventTarget~Event}\n */\n\n /**\n * Triggered when tracks are added or removed on the Tech {@link TextTrackList}\n *\n * @event Tech#texttrackchange\n * @type {EventTarget~Event}\n */\n NORMAL.names.forEach(function (name) {\n var props = NORMAL[name];\n\n var trackListChanges = function trackListChanges() {\n _this4.trigger(name + \"trackchange\");\n };\n\n var tracks = _this4[props.getterName]();\n\n tracks.addEventListener('removetrack', trackListChanges);\n tracks.addEventListener('addtrack', trackListChanges);\n\n _this4.on('dispose', function () {\n tracks.removeEventListener('removetrack', trackListChanges);\n tracks.removeEventListener('addtrack', trackListChanges);\n });\n });\n };\n /**\n * Emulate TextTracks using vtt.js if necessary\n *\n * @fires Tech#vttjsloaded\n * @fires Tech#vttjserror\n */\n\n\n _proto.addWebVttScript_ = function addWebVttScript_() {\n var _this5 = this;\n\n if (window$1.WebVTT) {\n return;\n } // Initially, Tech.el_ is a child of a dummy-div wait until the Component system\n // signals that the Tech is ready at which point Tech.el_ is part of the DOM\n // before inserting the WebVTT script\n\n\n if (document.body.contains(this.el())) {\n // load via require if available and vtt.js script location was not passed in\n // as an option. novtt builds will turn the above require call into an empty object\n // which will cause this if check to always fail.\n if (!this.options_['vtt.js'] && isPlain(vtt) && Object.keys(vtt).length > 0) {\n this.trigger('vttjsloaded');\n return;\n } // load vtt.js via the script location option or the cdn of no location was\n // passed in\n\n\n var script = document.createElement('script');\n script.src = this.options_['vtt.js'] || 'https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js';\n\n script.onload = function () {\n /**\n * Fired when vtt.js is loaded.\n *\n * @event Tech#vttjsloaded\n * @type {EventTarget~Event}\n */\n _this5.trigger('vttjsloaded');\n };\n\n script.onerror = function () {\n /**\n * Fired when vtt.js was not loaded due to an error\n *\n * @event Tech#vttjsloaded\n * @type {EventTarget~Event}\n */\n _this5.trigger('vttjserror');\n };\n\n this.on('dispose', function () {\n script.onload = null;\n script.onerror = null;\n }); // but have not loaded yet and we set it to true before the inject so that\n // we don't overwrite the injected window.WebVTT if it loads right away\n\n window$1.WebVTT = true;\n this.el().parentNode.appendChild(script);\n } else {\n this.ready(this.addWebVttScript_);\n }\n };\n /**\n * Emulate texttracks\n *\n */\n\n\n _proto.emulateTextTracks = function emulateTextTracks() {\n var _this6 = this;\n\n var tracks = this.textTracks();\n var remoteTracks = this.remoteTextTracks();\n\n var handleAddTrack = function handleAddTrack(e) {\n return tracks.addTrack(e.track);\n };\n\n var handleRemoveTrack = function handleRemoveTrack(e) {\n return tracks.removeTrack(e.track);\n };\n\n remoteTracks.on('addtrack', handleAddTrack);\n remoteTracks.on('removetrack', handleRemoveTrack);\n this.addWebVttScript_();\n\n var updateDisplay = function updateDisplay() {\n return _this6.trigger('texttrackchange');\n };\n\n var textTracksChanges = function textTracksChanges() {\n updateDisplay();\n\n for (var i = 0; i < tracks.length; i++) {\n var track = tracks[i];\n track.removeEventListener('cuechange', updateDisplay);\n\n if (track.mode === 'showing') {\n track.addEventListener('cuechange', updateDisplay);\n }\n }\n };\n\n textTracksChanges();\n tracks.addEventListener('change', textTracksChanges);\n tracks.addEventListener('addtrack', textTracksChanges);\n tracks.addEventListener('removetrack', textTracksChanges);\n this.on('dispose', function () {\n remoteTracks.off('addtrack', handleAddTrack);\n remoteTracks.off('removetrack', handleRemoveTrack);\n tracks.removeEventListener('change', textTracksChanges);\n tracks.removeEventListener('addtrack', textTracksChanges);\n tracks.removeEventListener('removetrack', textTracksChanges);\n\n for (var i = 0; i < tracks.length; i++) {\n var track = tracks[i];\n track.removeEventListener('cuechange', updateDisplay);\n }\n });\n };\n /**\n * Create and returns a remote {@link TextTrack} object.\n *\n * @param {string} kind\n * `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata)\n *\n * @param {string} [label]\n * Label to identify the text track\n *\n * @param {string} [language]\n * Two letter language abbreviation\n *\n * @return {TextTrack}\n * The TextTrack that gets created.\n */\n\n\n _proto.addTextTrack = function addTextTrack(kind, label, language) {\n if (!kind) {\n throw new Error('TextTrack kind is required but was not provided');\n }\n\n return createTrackHelper(this, kind, label, language);\n };\n /**\n * Create an emulated TextTrack for use by addRemoteTextTrack\n *\n * This is intended to be overridden by classes that inherit from\n * Tech in order to create native or custom TextTracks.\n *\n * @param {Object} options\n * The object should contain the options to initialize the TextTrack with.\n *\n * @param {string} [options.kind]\n * `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata).\n *\n * @param {string} [options.label].\n * Label to identify the text track\n *\n * @param {string} [options.language]\n * Two letter language abbreviation.\n *\n * @return {HTMLTrackElement}\n * The track element that gets created.\n */\n\n\n _proto.createRemoteTextTrack = function createRemoteTextTrack(options) {\n var track = mergeOptions(options, {\n tech: this\n });\n return new REMOTE.remoteTextEl.TrackClass(track);\n };\n /**\n * Creates a remote text track object and returns an html track element.\n *\n * > Note: This can be an emulated {@link HTMLTrackElement} or a native one.\n *\n * @param {Object} options\n * See {@link Tech#createRemoteTextTrack} for more detailed properties.\n *\n * @param {boolean} [manualCleanup=true]\n * - When false: the TextTrack will be automatically removed from the video\n * element whenever the source changes\n * - When True: The TextTrack will have to be cleaned up manually\n *\n * @return {HTMLTrackElement}\n * An Html Track Element.\n *\n * @deprecated The default functionality for this function will be equivalent\n * to \"manualCleanup=false\" in the future. The manualCleanup parameter will\n * also be removed.\n */\n\n\n _proto.addRemoteTextTrack = function addRemoteTextTrack(options, manualCleanup) {\n var _this7 = this;\n\n if (options === void 0) {\n options = {};\n }\n\n var htmlTrackElement = this.createRemoteTextTrack(options);\n\n if (manualCleanup !== true && manualCleanup !== false) {\n // deprecation warning\n log.warn('Calling addRemoteTextTrack without explicitly setting the \"manualCleanup\" parameter to `true` is deprecated and default to `false` in future version of video.js');\n manualCleanup = true;\n } // store HTMLTrackElement and TextTrack to remote list\n\n\n this.remoteTextTrackEls().addTrackElement_(htmlTrackElement);\n this.remoteTextTracks().addTrack(htmlTrackElement.track);\n\n if (manualCleanup !== true) {\n // create the TextTrackList if it doesn't exist\n this.ready(function () {\n return _this7.autoRemoteTextTracks_.addTrack(htmlTrackElement.track);\n });\n }\n\n return htmlTrackElement;\n };\n /**\n * Remove a remote text track from the remote `TextTrackList`.\n *\n * @param {TextTrack} track\n * `TextTrack` to remove from the `TextTrackList`\n */\n\n\n _proto.removeRemoteTextTrack = function removeRemoteTextTrack(track) {\n var trackElement = this.remoteTextTrackEls().getTrackElementByTrack_(track); // remove HTMLTrackElement and TextTrack from remote list\n\n this.remoteTextTrackEls().removeTrackElement_(trackElement);\n this.remoteTextTracks().removeTrack(track);\n this.autoRemoteTextTracks_.removeTrack(track);\n };\n /**\n * Gets available media playback quality metrics as specified by the W3C's Media\n * Playback Quality API.\n *\n * @see [Spec]{@link https://wicg.github.io/media-playback-quality}\n *\n * @return {Object}\n * An object with supported media playback quality metrics\n *\n * @abstract\n */\n\n\n _proto.getVideoPlaybackQuality = function getVideoPlaybackQuality() {\n return {};\n };\n /**\n * A method to set a poster from a `Tech`.\n *\n * @abstract\n */\n\n\n _proto.setPoster = function setPoster() {};\n /**\n * A method to check for the presence of the 'playsinline' <video> attribute.\n *\n * @abstract\n */\n\n\n _proto.playsinline = function playsinline() {};\n /**\n * A method to set or unset the 'playsinline' <video> attribute.\n *\n * @abstract\n */\n\n\n _proto.setPlaysinline = function setPlaysinline() {};\n /**\n * Attempt to force override of native audio tracks.\n *\n * @param {boolean} override - If set to true native audio will be overridden,\n * otherwise native audio will potentially be used.\n *\n * @abstract\n */\n\n\n _proto.overrideNativeAudioTracks = function overrideNativeAudioTracks() {};\n /**\n * Attempt to force override of native video tracks.\n *\n * @param {boolean} override - If set to true native video will be overridden,\n * otherwise native video will potentially be used.\n *\n * @abstract\n */\n\n\n _proto.overrideNativeVideoTracks = function overrideNativeVideoTracks() {};\n /*\n * Check if the tech can support the given mime-type.\n *\n * The base tech does not support any type, but source handlers might\n * overwrite this.\n *\n * @param {string} type\n * The mimetype to check for support\n *\n * @return {string}\n * 'probably', 'maybe', or empty string\n *\n * @see [Spec]{@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/canPlayType}\n *\n * @abstract\n */\n\n\n _proto.canPlayType = function canPlayType() {\n return '';\n };\n /**\n * Check if the type is supported by this tech.\n *\n * The base tech does not support any type, but source handlers might\n * overwrite this.\n *\n * @param {string} type\n * The media type to check\n * @return {string} Returns the native video element's response\n */\n\n\n Tech.canPlayType = function canPlayType() {\n return '';\n };\n /**\n * Check if the tech can support the given source\n *\n * @param {Object} srcObj\n * The source object\n * @param {Object} options\n * The options passed to the tech\n * @return {string} 'probably', 'maybe', or '' (empty string)\n */\n\n\n Tech.canPlaySource = function canPlaySource(srcObj, options) {\n return Tech.canPlayType(srcObj.type);\n };\n /*\n * Return whether the argument is a Tech or not.\n * Can be passed either a Class like `Html5` or a instance like `player.tech_`\n *\n * @param {Object} component\n * The item to check\n *\n * @return {boolean}\n * Whether it is a tech or not\n * - True if it is a tech\n * - False if it is not\n */\n\n\n Tech.isTech = function isTech(component) {\n return component.prototype instanceof Tech || component instanceof Tech || component === Tech;\n };\n /**\n * Registers a `Tech` into a shared list for videojs.\n *\n * @param {string} name\n * Name of the `Tech` to register.\n *\n * @param {Object} tech\n * The `Tech` class to register.\n */\n\n\n Tech.registerTech = function registerTech(name, tech) {\n if (!Tech.techs_) {\n Tech.techs_ = {};\n }\n\n if (!Tech.isTech(tech)) {\n throw new Error(\"Tech \" + name + \" must be a Tech\");\n }\n\n if (!Tech.canPlayType) {\n throw new Error('Techs must have a static canPlayType method on them');\n }\n\n if (!Tech.canPlaySource) {\n throw new Error('Techs must have a static canPlaySource method on them');\n }\n\n name = toTitleCase(name);\n Tech.techs_[name] = tech;\n\n if (name !== 'Tech') {\n // camel case the techName for use in techOrder\n Tech.defaultTechOrder_.push(name);\n }\n\n return tech;\n };\n /**\n * Get a `Tech` from the shared list by name.\n *\n * @param {string} name\n * `camelCase` or `TitleCase` name of the Tech to get\n *\n * @return {Tech|undefined}\n * The `Tech` or undefined if there was no tech with the name requested.\n */\n\n\n Tech.getTech = function getTech(name) {\n if (!name) {\n return;\n }\n\n name = toTitleCase(name);\n\n if (Tech.techs_ && Tech.techs_[name]) {\n return Tech.techs_[name];\n }\n\n if (window$1 && window$1.videojs && window$1.videojs[name]) {\n log.warn(\"The \" + name + \" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)\");\n return window$1.videojs[name];\n }\n };\n\n return Tech;\n}(Component);\n/**\n * Get the {@link VideoTrackList}\n *\n * @returns {VideoTrackList}\n * @method Tech.prototype.videoTracks\n */\n\n/**\n * Get the {@link AudioTrackList}\n *\n * @returns {AudioTrackList}\n * @method Tech.prototype.audioTracks\n */\n\n/**\n * Get the {@link TextTrackList}\n *\n * @returns {TextTrackList}\n * @method Tech.prototype.textTracks\n */\n\n/**\n * Get the remote element {@link TextTrackList}\n *\n * @returns {TextTrackList}\n * @method Tech.prototype.remoteTextTracks\n */\n\n/**\n * Get the remote element {@link HtmlTrackElementList}\n *\n * @returns {HtmlTrackElementList}\n * @method Tech.prototype.remoteTextTrackEls\n */\n\n\nALL.names.forEach(function (name) {\n var props = ALL[name];\n\n Tech.prototype[props.getterName] = function () {\n this[props.privateName] = this[props.privateName] || new props.ListClass();\n return this[props.privateName];\n };\n});\n/**\n * List of associated text tracks\n *\n * @type {TextTrackList}\n * @private\n * @property Tech#textTracks_\n */\n\n/**\n * List of associated audio tracks.\n *\n * @type {AudioTrackList}\n * @private\n * @property Tech#audioTracks_\n */\n\n/**\n * List of associated video tracks.\n *\n * @type {VideoTrackList}\n * @private\n * @property Tech#videoTracks_\n */\n\n/**\n * Boolean indicating whether the `Tech` supports volume control.\n *\n * @type {boolean}\n * @default\n */\n\nTech.prototype.featuresVolumeControl = true;\n/**\n * Boolean indicating whether the `Tech` supports muting volume.\n *\n * @type {bolean}\n * @default\n */\n\nTech.prototype.featuresMuteControl = true;\n/**\n * Boolean indicating whether the `Tech` supports fullscreen resize control.\n * Resizing plugins using request fullscreen reloads the plugin\n *\n * @type {boolean}\n * @default\n */\n\nTech.prototype.featuresFullscreenResize = false;\n/**\n * Boolean indicating whether the `Tech` supports changing the speed at which the video\n * plays. Examples:\n * - Set player to play 2x (twice) as fast\n * - Set player to play 0.5x (half) as fast\n *\n * @type {boolean}\n * @default\n */\n\nTech.prototype.featuresPlaybackRate = false;\n/**\n * Boolean indicating whether the `Tech` supports the `progress` event. This is currently\n * not triggered by video-js-swf. This will be used to determine if\n * {@link Tech#manualProgressOn} should be called.\n *\n * @type {boolean}\n * @default\n */\n\nTech.prototype.featuresProgressEvents = false;\n/**\n * Boolean indicating whether the `Tech` supports the `sourceset` event.\n *\n * A tech should set this to `true` and then use {@link Tech#triggerSourceset}\n * to trigger a {@link Tech#event:sourceset} at the earliest time after getting\n * a new source.\n *\n * @type {boolean}\n * @default\n */\n\nTech.prototype.featuresSourceset = false;\n/**\n * Boolean indicating whether the `Tech` supports the `timeupdate` event. This is currently\n * not triggered by video-js-swf. This will be used to determine if\n * {@link Tech#manualTimeUpdates} should be called.\n *\n * @type {boolean}\n * @default\n */\n\nTech.prototype.featuresTimeupdateEvents = false;\n/**\n * Boolean indicating whether the `Tech` supports the native `TextTrack`s.\n * This will help us integrate with native `TextTrack`s if the browser supports them.\n *\n * @type {boolean}\n * @default\n */\n\nTech.prototype.featuresNativeTextTracks = false;\n/**\n * A functional mixin for techs that want to use the Source Handler pattern.\n * Source handlers are scripts for handling specific formats.\n * The source handler pattern is used for adaptive formats (HLS, DASH) that\n * manually load video data and feed it into a Source Buffer (Media Source Extensions)\n * Example: `Tech.withSourceHandlers.call(MyTech);`\n *\n * @param {Tech} _Tech\n * The tech to add source handler functions to.\n *\n * @mixes Tech~SourceHandlerAdditions\n */\n\nTech.withSourceHandlers = function (_Tech) {\n /**\n * Register a source handler\n *\n * @param {Function} handler\n * The source handler class\n *\n * @param {number} [index]\n * Register it at the following index\n */\n _Tech.registerSourceHandler = function (handler, index) {\n var handlers = _Tech.sourceHandlers;\n\n if (!handlers) {\n handlers = _Tech.sourceHandlers = [];\n }\n\n if (index === undefined) {\n // add to the end of the list\n index = handlers.length;\n }\n\n handlers.splice(index, 0, handler);\n };\n /**\n * Check if the tech can support the given type. Also checks the\n * Techs sourceHandlers.\n *\n * @param {string} type\n * The mimetype to check.\n *\n * @return {string}\n * 'probably', 'maybe', or '' (empty string)\n */\n\n\n _Tech.canPlayType = function (type) {\n var handlers = _Tech.sourceHandlers || [];\n var can;\n\n for (var i = 0; i < handlers.length; i++) {\n can = handlers[i].canPlayType(type);\n\n if (can) {\n return can;\n }\n }\n\n return '';\n };\n /**\n * Returns the first source handler that supports the source.\n *\n * TODO: Answer question: should 'probably' be prioritized over 'maybe'\n *\n * @param {Tech~SourceObject} source\n * The source object\n *\n * @param {Object} options\n * The options passed to the tech\n *\n * @return {SourceHandler|null}\n * The first source handler that supports the source or null if\n * no SourceHandler supports the source\n */\n\n\n _Tech.selectSourceHandler = function (source, options) {\n var handlers = _Tech.sourceHandlers || [];\n var can;\n\n for (var i = 0; i < handlers.length; i++) {\n can = handlers[i].canHandleSource(source, options);\n\n if (can) {\n return handlers[i];\n }\n }\n\n return null;\n };\n /**\n * Check if the tech can support the given source.\n *\n * @param {Tech~SourceObject} srcObj\n * The source object\n *\n * @param {Object} options\n * The options passed to the tech\n *\n * @return {string}\n * 'probably', 'maybe', or '' (empty string)\n */\n\n\n _Tech.canPlaySource = function (srcObj, options) {\n var sh = _Tech.selectSourceHandler(srcObj, options);\n\n if (sh) {\n return sh.canHandleSource(srcObj, options);\n }\n\n return '';\n };\n /**\n * When using a source handler, prefer its implementation of\n * any function normally provided by the tech.\n */\n\n\n var deferrable = ['seekable', 'seeking', 'duration'];\n /**\n * A wrapper around {@link Tech#seekable} that will call a `SourceHandler`s seekable\n * function if it exists, with a fallback to the Techs seekable function.\n *\n * @method _Tech.seekable\n */\n\n /**\n * A wrapper around {@link Tech#duration} that will call a `SourceHandler`s duration\n * function if it exists, otherwise it will fallback to the techs duration function.\n *\n * @method _Tech.duration\n */\n\n deferrable.forEach(function (fnName) {\n var originalFn = this[fnName];\n\n if (typeof originalFn !== 'function') {\n return;\n }\n\n this[fnName] = function () {\n if (this.sourceHandler_ && this.sourceHandler_[fnName]) {\n return this.sourceHandler_[fnName].apply(this.sourceHandler_, arguments);\n }\n\n return originalFn.apply(this, arguments);\n };\n }, _Tech.prototype);\n /**\n * Create a function for setting the source using a source object\n * and source handlers.\n * Should never be called unless a source handler was found.\n *\n * @param {Tech~SourceObject} source\n * A source object with src and type keys\n */\n\n _Tech.prototype.setSource = function (source) {\n var sh = _Tech.selectSourceHandler(source, this.options_);\n\n if (!sh) {\n // Fall back to a native source hander when unsupported sources are\n // deliberately set\n if (_Tech.nativeSourceHandler) {\n sh = _Tech.nativeSourceHandler;\n } else {\n log.error('No source handler found for the current source.');\n }\n } // Dispose any existing source handler\n\n\n this.disposeSourceHandler();\n this.off('dispose', this.disposeSourceHandler);\n\n if (sh !== _Tech.nativeSourceHandler) {\n this.currentSource_ = source;\n }\n\n this.sourceHandler_ = sh.handleSource(source, this, this.options_);\n this.on('dispose', this.disposeSourceHandler);\n };\n /**\n * Clean up any existing SourceHandlers and listeners when the Tech is disposed.\n *\n * @listens Tech#dispose\n */\n\n\n _Tech.prototype.disposeSourceHandler = function () {\n // if we have a source and get another one\n // then we are loading something new\n // than clear all of our current tracks\n if (this.currentSource_) {\n this.clearTracks(['audio', 'video']);\n this.currentSource_ = null;\n } // always clean up auto-text tracks\n\n\n this.cleanupAutoTextTracks();\n\n if (this.sourceHandler_) {\n if (this.sourceHandler_.dispose) {\n this.sourceHandler_.dispose();\n }\n\n this.sourceHandler_ = null;\n }\n };\n}; // The base Tech class needs to be registered as a Component. It is the only\n// Tech that can be registered as a Component.\n\n\nComponent.registerComponent('Tech', Tech);\nTech.registerTech('Tech', Tech);\n/**\n * A list of techs that should be added to techOrder on Players\n *\n * @private\n */\n\nTech.defaultTechOrder_ = [];\n\n/**\n * @file middleware.js\n * @module middleware\n */\nvar middlewares = {};\nvar middlewareInstances = {};\nvar TERMINATOR = {};\n/**\n * A middleware object is a plain JavaScript object that has methods that\n * match the {@link Tech} methods found in the lists of allowed\n * {@link module:middleware.allowedGetters|getters},\n * {@link module:middleware.allowedSetters|setters}, and\n * {@link module:middleware.allowedMediators|mediators}.\n *\n * @typedef {Object} MiddlewareObject\n */\n\n/**\n * A middleware factory function that should return a\n * {@link module:middleware~MiddlewareObject|MiddlewareObject}.\n *\n * This factory will be called for each player when needed, with the player\n * passed in as an argument.\n *\n * @callback MiddlewareFactory\n * @param {Player} player\n * A Video.js player.\n */\n\n/**\n * Define a middleware that the player should use by way of a factory function\n * that returns a middleware object.\n *\n * @param {string} type\n * The MIME type to match or `\"*\"` for all MIME types.\n *\n * @param {MiddlewareFactory} middleware\n * A middleware factory function that will be executed for\n * matching types.\n */\n\nfunction use(type, middleware) {\n middlewares[type] = middlewares[type] || [];\n middlewares[type].push(middleware);\n}\n/**\n * Asynchronously sets a source using middleware by recursing through any\n * matching middlewares and calling `setSource` on each, passing along the\n * previous returned value each time.\n *\n * @param {Player} player\n * A {@link Player} instance.\n *\n * @param {Tech~SourceObject} src\n * A source object.\n *\n * @param {Function}\n * The next middleware to run.\n */\n\nfunction setSource(player, src, next) {\n player.setTimeout(function () {\n return setSourceHelper(src, middlewares[src.type], next, player);\n }, 1);\n}\n/**\n * When the tech is set, passes the tech to each middleware's `setTech` method.\n *\n * @param {Object[]} middleware\n * An array of middleware instances.\n *\n * @param {Tech} tech\n * A Video.js tech.\n */\n\nfunction setTech(middleware, tech) {\n middleware.forEach(function (mw) {\n return mw.setTech && mw.setTech(tech);\n });\n}\n/**\n * Calls a getter on the tech first, through each middleware\n * from right to left to the player.\n *\n * @param {Object[]} middleware\n * An array of middleware instances.\n *\n * @param {Tech} tech\n * The current tech.\n *\n * @param {string} method\n * A method name.\n *\n * @return {Mixed}\n * The final value from the tech after middleware has intercepted it.\n */\n\nfunction get(middleware, tech, method) {\n return middleware.reduceRight(middlewareIterator(method), tech[method]());\n}\n/**\n * Takes the argument given to the player and calls the setter method on each\n * middleware from left to right to the tech.\n *\n * @param {Object[]} middleware\n * An array of middleware instances.\n *\n * @param {Tech} tech\n * The current tech.\n *\n * @param {string} method\n * A method name.\n *\n * @param {Mixed} arg\n * The value to set on the tech.\n *\n * @return {Mixed}\n * The return value of the `method` of the `tech`.\n */\n\nfunction set$1(middleware, tech, method, arg) {\n return tech[method](middleware.reduce(middlewareIterator(method), arg));\n}\n/**\n * Takes the argument given to the player and calls the `call` version of the\n * method on each middleware from left to right.\n *\n * Then, call the passed in method on the tech and return the result unchanged\n * back to the player, through middleware, this time from right to left.\n *\n * @param {Object[]} middleware\n * An array of middleware instances.\n *\n * @param {Tech} tech\n * The current tech.\n *\n * @param {string} method\n * A method name.\n *\n * @param {Mixed} arg\n * The value to set on the tech.\n *\n * @return {Mixed}\n * The return value of the `method` of the `tech`, regardless of the\n * return values of middlewares.\n */\n\nfunction mediate(middleware, tech, method, arg) {\n if (arg === void 0) {\n arg = null;\n }\n\n var callMethod = 'call' + toTitleCase(method);\n var middlewareValue = middleware.reduce(middlewareIterator(callMethod), arg);\n var terminated = middlewareValue === TERMINATOR;\n var returnValue = terminated ? null : tech[method](middlewareValue);\n executeRight(middleware, method, returnValue, terminated);\n return returnValue;\n}\n/**\n * Enumeration of allowed getters where the keys are method names.\n *\n * @type {Object}\n */\n\nvar allowedGetters = {\n buffered: 1,\n currentTime: 1,\n duration: 1,\n seekable: 1,\n played: 1,\n paused: 1\n};\n/**\n * Enumeration of allowed setters where the keys are method names.\n *\n * @type {Object}\n */\n\nvar allowedSetters = {\n setCurrentTime: 1\n};\n/**\n * Enumeration of allowed mediators where the keys are method names.\n *\n * @type {Object}\n */\n\nvar allowedMediators = {\n play: 1,\n pause: 1\n};\n\nfunction middlewareIterator(method) {\n return function (value, mw) {\n // if the previous middleware terminated, pass along the termination\n if (value === TERMINATOR) {\n return TERMINATOR;\n }\n\n if (mw[method]) {\n return mw[method](value);\n }\n\n return value;\n };\n}\n\nfunction executeRight(mws, method, value, terminated) {\n for (var i = mws.length - 1; i >= 0; i--) {\n var mw = mws[i];\n\n if (mw[method]) {\n mw[method](terminated, value);\n }\n }\n}\n/**\n * Clear the middleware cache for a player.\n *\n * @param {Player} player\n * A {@link Player} instance.\n */\n\n\nfunction clearCacheForPlayer(player) {\n middlewareInstances[player.id()] = null;\n}\n/**\n * {\n * [playerId]: [[mwFactory, mwInstance], ...]\n * }\n *\n * @private\n */\n\nfunction getOrCreateFactory(player, mwFactory) {\n var mws = middlewareInstances[player.id()];\n var mw = null;\n\n if (mws === undefined || mws === null) {\n mw = mwFactory(player);\n middlewareInstances[player.id()] = [[mwFactory, mw]];\n return mw;\n }\n\n for (var i = 0; i < mws.length; i++) {\n var _mws$i = mws[i],\n mwf = _mws$i[0],\n mwi = _mws$i[1];\n\n if (mwf !== mwFactory) {\n continue;\n }\n\n mw = mwi;\n }\n\n if (mw === null) {\n mw = mwFactory(player);\n mws.push([mwFactory, mw]);\n }\n\n return mw;\n}\n\nfunction setSourceHelper(src, middleware, next, player, acc, lastRun) {\n if (src === void 0) {\n src = {};\n }\n\n if (middleware === void 0) {\n middleware = [];\n }\n\n if (acc === void 0) {\n acc = [];\n }\n\n if (lastRun === void 0) {\n lastRun = false;\n }\n\n var _middleware = middleware,\n mwFactory = _middleware[0],\n mwrest = _middleware.slice(1); // if mwFactory is a string, then we're at a fork in the road\n\n\n if (typeof mwFactory === 'string') {\n setSourceHelper(src, middlewares[mwFactory], next, player, acc, lastRun); // if we have an mwFactory, call it with the player to get the mw,\n // then call the mw's setSource method\n } else if (mwFactory) {\n var mw = getOrCreateFactory(player, mwFactory); // if setSource isn't present, implicitly select this middleware\n\n if (!mw.setSource) {\n acc.push(mw);\n return setSourceHelper(src, mwrest, next, player, acc, lastRun);\n }\n\n mw.setSource(assign({}, src), function (err, _src) {\n // something happened, try the next middleware on the current level\n // make sure to use the old src\n if (err) {\n return setSourceHelper(src, mwrest, next, player, acc, lastRun);\n } // we've succeeded, now we need to go deeper\n\n\n acc.push(mw); // if it's the same type, continue down the current chain\n // otherwise, we want to go down the new chain\n\n setSourceHelper(_src, src.type === _src.type ? mwrest : middlewares[_src.type], next, player, acc, lastRun);\n });\n } else if (mwrest.length) {\n setSourceHelper(src, mwrest, next, player, acc, lastRun);\n } else if (lastRun) {\n next(src, acc);\n } else {\n setSourceHelper(src, middlewares['*'], next, player, acc, true);\n }\n}\n\n/**\n * Mimetypes\n *\n * @see http://hul.harvard.edu/ois/////systems/wax/wax-public-help/mimetypes.htm\n * @typedef Mimetypes~Kind\n * @enum\n */\n\nvar MimetypesKind = {\n opus: 'video/ogg',\n ogv: 'video/ogg',\n mp4: 'video/mp4',\n mov: 'video/mp4',\n m4v: 'video/mp4',\n mkv: 'video/x-matroska',\n mp3: 'audio/mpeg',\n aac: 'audio/aac',\n oga: 'audio/ogg',\n m3u8: 'application/x-mpegURL'\n};\n/**\n * Get the mimetype of a given src url if possible\n *\n * @param {string} src\n * The url to the src\n *\n * @return {string}\n * return the mimetype if it was known or empty string otherwise\n */\n\nvar getMimetype = function getMimetype(src) {\n if (src === void 0) {\n src = '';\n }\n\n var ext = getFileExtension(src);\n var mimetype = MimetypesKind[ext.toLowerCase()];\n return mimetype || '';\n};\n/**\n * Find the mime type of a given source string if possible. Uses the player\n * source cache.\n *\n * @param {Player} player\n * The player object\n *\n * @param {string} src\n * The source string\n *\n * @return {string}\n * The type that was found\n */\n\nvar findMimetype = function findMimetype(player, src) {\n if (!src) {\n return '';\n } // 1. check for the type in the `source` cache\n\n\n if (player.cache_.source.src === src && player.cache_.source.type) {\n return player.cache_.source.type;\n } // 2. see if we have this source in our `currentSources` cache\n\n\n var matchingSources = player.cache_.sources.filter(function (s) {\n return s.src === src;\n });\n\n if (matchingSources.length) {\n return matchingSources[0].type;\n } // 3. look for the src url in source elements and use the type there\n\n\n var sources = player.$$('source');\n\n for (var i = 0; i < sources.length; i++) {\n var s = sources[i];\n\n if (s.type && s.src && s.src === src) {\n return s.type;\n }\n } // 4. finally fallback to our list of mime types based on src url extension\n\n\n return getMimetype(src);\n};\n\n/**\n * @module filter-source\n */\n/**\n * Filter out single bad source objects or multiple source objects in an\n * array. Also flattens nested source object arrays into a 1 dimensional\n * array of source objects.\n *\n * @param {Tech~SourceObject|Tech~SourceObject[]} src\n * The src object to filter\n *\n * @return {Tech~SourceObject[]}\n * An array of sourceobjects containing only valid sources\n *\n * @private\n */\n\nvar filterSource = function filterSource(src) {\n // traverse array\n if (Array.isArray(src)) {\n var newsrc = [];\n src.forEach(function (srcobj) {\n srcobj = filterSource(srcobj);\n\n if (Array.isArray(srcobj)) {\n newsrc = newsrc.concat(srcobj);\n } else if (isObject(srcobj)) {\n newsrc.push(srcobj);\n }\n });\n src = newsrc;\n } else if (typeof src === 'string' && src.trim()) {\n // convert string into object\n src = [fixSource({\n src: src\n })];\n } else if (isObject(src) && typeof src.src === 'string' && src.src && src.src.trim()) {\n // src is already valid\n src = [fixSource(src)];\n } else {\n // invalid source, turn it into an empty array\n src = [];\n }\n\n return src;\n};\n/**\n * Checks src mimetype, adding it when possible\n *\n * @param {Tech~SourceObject} src\n * The src object to check\n * @return {Tech~SourceObject}\n * src Object with known type\n */\n\n\nfunction fixSource(src) {\n var mimetype = getMimetype(src.src);\n\n if (!src.type && mimetype) {\n src.type = mimetype;\n }\n\n return src;\n}\n\n/**\n * The `MediaLoader` is the `Component` that decides which playback technology to load\n * when a player is initialized.\n *\n * @extends Component\n */\n\nvar MediaLoader =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(MediaLoader, _Component);\n\n /**\n * Create an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should attach to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Component~ReadyCallback} [ready]\n * The function that is run when this component is ready.\n */\n function MediaLoader(player, options, ready) {\n var _this;\n\n // MediaLoader has no element\n var options_ = mergeOptions({\n createEl: false\n }, options);\n _this = _Component.call(this, player, options_, ready) || this; // If there are no sources when the player is initialized,\n // load the first supported playback technology.\n\n if (!options.playerOptions.sources || options.playerOptions.sources.length === 0) {\n for (var i = 0, j = options.playerOptions.techOrder; i < j.length; i++) {\n var techName = toTitleCase(j[i]);\n var tech = Tech.getTech(techName); // Support old behavior of techs being registered as components.\n // Remove once that deprecated behavior is removed.\n\n if (!techName) {\n tech = Component.getComponent(techName);\n } // Check if the browser supports this technology\n\n\n if (tech && tech.isSupported()) {\n player.loadTech_(techName);\n break;\n }\n }\n } else {\n // Loop through playback technologies (HTML5, Flash) and check for support.\n // Then load the best source.\n // A few assumptions here:\n // All playback technologies respect preload false.\n player.src(options.playerOptions.sources);\n }\n\n return _this;\n }\n\n return MediaLoader;\n}(Component);\n\nComponent.registerComponent('MediaLoader', MediaLoader);\n\n/**\n * Clickable Component which is clickable or keyboard actionable,\n * but is not a native HTML button.\n *\n * @extends Component\n */\n\nvar ClickableComponent =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(ClickableComponent, _Component);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function ClickableComponent(player, options) {\n var _this;\n\n _this = _Component.call(this, player, options) || this;\n\n _this.emitTapEvents();\n\n _this.enable();\n\n return _this;\n }\n /**\n * Create the `Component`s DOM element.\n *\n * @param {string} [tag=div]\n * The element's node type.\n *\n * @param {Object} [props={}]\n * An object of properties that should be set on the element.\n *\n * @param {Object} [attributes={}]\n * An object of attributes that should be set on the element.\n *\n * @return {Element}\n * The element that gets created.\n */\n\n\n var _proto = ClickableComponent.prototype;\n\n _proto.createEl = function createEl$$1(tag, props, attributes) {\n if (tag === void 0) {\n tag = 'div';\n }\n\n if (props === void 0) {\n props = {};\n }\n\n if (attributes === void 0) {\n attributes = {};\n }\n\n props = assign({\n innerHTML: '<span aria-hidden=\"true\" class=\"vjs-icon-placeholder\"></span>',\n className: this.buildCSSClass(),\n tabIndex: 0\n }, props);\n\n if (tag === 'button') {\n log.error(\"Creating a ClickableComponent with an HTML element of \" + tag + \" is not supported; use a Button instead.\");\n } // Add ARIA attributes for clickable element which is not a native HTML button\n\n\n attributes = assign({\n role: 'button'\n }, attributes);\n this.tabIndex_ = props.tabIndex;\n\n var el = _Component.prototype.createEl.call(this, tag, props, attributes);\n\n this.createControlTextEl(el);\n return el;\n };\n\n _proto.dispose = function dispose() {\n // remove controlTextEl_ on dispose\n this.controlTextEl_ = null;\n\n _Component.prototype.dispose.call(this);\n };\n /**\n * Create a control text element on this `Component`\n *\n * @param {Element} [el]\n * Parent element for the control text.\n *\n * @return {Element}\n * The control text element that gets created.\n */\n\n\n _proto.createControlTextEl = function createControlTextEl(el) {\n this.controlTextEl_ = createEl('span', {\n className: 'vjs-control-text'\n }, {\n // let the screen reader user know that the text of the element may change\n 'aria-live': 'polite'\n });\n\n if (el) {\n el.appendChild(this.controlTextEl_);\n }\n\n this.controlText(this.controlText_, el);\n return this.controlTextEl_;\n };\n /**\n * Get or set the localize text to use for the controls on the `Component`.\n *\n * @param {string} [text]\n * Control text for element.\n *\n * @param {Element} [el=this.el()]\n * Element to set the title on.\n *\n * @return {string}\n * - The control text when getting\n */\n\n\n _proto.controlText = function controlText(text, el) {\n if (el === void 0) {\n el = this.el();\n }\n\n if (text === undefined) {\n return this.controlText_ || 'Need Text';\n }\n\n var localizedText = this.localize(text);\n this.controlText_ = text;\n textContent(this.controlTextEl_, localizedText);\n\n if (!this.nonIconControl) {\n // Set title attribute if only an icon is shown\n el.setAttribute('title', localizedText);\n }\n };\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-control vjs-button \" + _Component.prototype.buildCSSClass.call(this);\n };\n /**\n * Enable this `Component`s element.\n */\n\n\n _proto.enable = function enable() {\n if (!this.enabled_) {\n this.enabled_ = true;\n this.removeClass('vjs-disabled');\n this.el_.setAttribute('aria-disabled', 'false');\n\n if (typeof this.tabIndex_ !== 'undefined') {\n this.el_.setAttribute('tabIndex', this.tabIndex_);\n }\n\n this.on(['tap', 'click'], this.handleClick);\n this.on('focus', this.handleFocus);\n this.on('blur', this.handleBlur);\n }\n };\n /**\n * Disable this `Component`s element.\n */\n\n\n _proto.disable = function disable() {\n this.enabled_ = false;\n this.addClass('vjs-disabled');\n this.el_.setAttribute('aria-disabled', 'true');\n\n if (typeof this.tabIndex_ !== 'undefined') {\n this.el_.removeAttribute('tabIndex');\n }\n\n this.off(['tap', 'click'], this.handleClick);\n this.off('focus', this.handleFocus);\n this.off('blur', this.handleBlur);\n };\n /**\n * This gets called when a `ClickableComponent` gets:\n * - Clicked (via the `click` event, listening starts in the constructor)\n * - Tapped (via the `tap` event, listening starts in the constructor)\n * - The following things happen in order:\n * 1. {@link ClickableComponent#handleFocus} is called via a `focus` event on the\n * `ClickableComponent`.\n * 2. {@link ClickableComponent#handleFocus} adds a listener for `keydown` on using\n * {@link ClickableComponent#handleKeyPress}.\n * 3. `ClickableComponent` has not had a `blur` event (`blur` means that focus was lost). The user presses\n * the space or enter key.\n * 4. {@link ClickableComponent#handleKeyPress} calls this function with the `keydown`\n * event as a parameter.\n *\n * @param {EventTarget~Event} event\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n * @abstract\n */\n\n\n _proto.handleClick = function handleClick(event) {};\n /**\n * This gets called when a `ClickableComponent` gains focus via a `focus` event.\n * Turns on listening for `keydown` events. When they happen it\n * calls `this.handleKeyPress`.\n *\n * @param {EventTarget~Event} event\n * The `focus` event that caused this function to be called.\n *\n * @listens focus\n */\n\n\n _proto.handleFocus = function handleFocus(event) {\n on(document, 'keydown', bind(this, this.handleKeyPress));\n };\n /**\n * Called when this ClickableComponent has focus and a key gets pressed down. By\n * default it will call `this.handleClick` when the key is space or enter.\n *\n * @param {EventTarget~Event} event\n * The `keydown` event that caused this function to be called.\n *\n * @listens keydown\n */\n\n\n _proto.handleKeyPress = function handleKeyPress(event) {\n // Support Space (32) or Enter (13) key operation to fire a click event\n if (event.which === 32 || event.which === 13) {\n event.preventDefault();\n this.trigger('click');\n } else if (_Component.prototype.handleKeyPress) {\n // Pass keypress handling up for unsupported keys\n _Component.prototype.handleKeyPress.call(this, event);\n }\n };\n /**\n * Called when a `ClickableComponent` loses focus. Turns off the listener for\n * `keydown` events. Which Stops `this.handleKeyPress` from getting called.\n *\n * @param {EventTarget~Event} event\n * The `blur` event that caused this function to be called.\n *\n * @listens blur\n */\n\n\n _proto.handleBlur = function handleBlur(event) {\n off(document, 'keydown', bind(this, this.handleKeyPress));\n };\n\n return ClickableComponent;\n}(Component);\n\nComponent.registerComponent('ClickableComponent', ClickableComponent);\n\n/**\n * A `ClickableComponent` that handles showing the poster image for the player.\n *\n * @extends ClickableComponent\n */\n\nvar PosterImage =\n/*#__PURE__*/\nfunction (_ClickableComponent) {\n _inheritsLoose(PosterImage, _ClickableComponent);\n\n /**\n * Create an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should attach to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function PosterImage(player, options) {\n var _this;\n\n _this = _ClickableComponent.call(this, player, options) || this;\n\n _this.update();\n\n player.on('posterchange', bind(_assertThisInitialized(_assertThisInitialized(_this)), _this.update));\n return _this;\n }\n /**\n * Clean up and dispose of the `PosterImage`.\n */\n\n\n var _proto = PosterImage.prototype;\n\n _proto.dispose = function dispose() {\n this.player().off('posterchange', this.update);\n\n _ClickableComponent.prototype.dispose.call(this);\n };\n /**\n * Create the `PosterImage`s DOM element.\n *\n * @return {Element}\n * The element that gets created.\n */\n\n\n _proto.createEl = function createEl$$1() {\n var el = createEl('div', {\n className: 'vjs-poster',\n // Don't want poster to be tabbable.\n tabIndex: -1\n });\n return el;\n };\n /**\n * An {@link EventTarget~EventListener} for {@link Player#posterchange} events.\n *\n * @listens Player#posterchange\n *\n * @param {EventTarget~Event} [event]\n * The `Player#posterchange` event that triggered this function.\n */\n\n\n _proto.update = function update(event) {\n var url = this.player().poster();\n this.setSrc(url); // If there's no poster source we should display:none on this component\n // so it's not still clickable or right-clickable\n\n if (url) {\n this.show();\n } else {\n this.hide();\n }\n };\n /**\n * Set the source of the `PosterImage` depending on the display method.\n *\n * @param {string} url\n * The URL to the source for the `PosterImage`.\n */\n\n\n _proto.setSrc = function setSrc(url) {\n var backgroundImage = ''; // Any falsy value should stay as an empty string, otherwise\n // this will throw an extra error\n\n if (url) {\n backgroundImage = \"url(\\\"\" + url + \"\\\")\";\n }\n\n this.el_.style.backgroundImage = backgroundImage;\n };\n /**\n * An {@link EventTarget~EventListener} for clicks on the `PosterImage`. See\n * {@link ClickableComponent#handleClick} for instances where this will be triggered.\n *\n * @listens tap\n * @listens click\n * @listens keydown\n *\n * @param {EventTarget~Event} event\n + The `click`, `tap` or `keydown` event that caused this function to be called.\n */\n\n\n _proto.handleClick = function handleClick(event) {\n // We don't want a click to trigger playback when controls are disabled\n if (!this.player_.controls()) {\n return;\n }\n\n if (this.player_.paused()) {\n silencePromise(this.player_.play());\n } else {\n this.player_.pause();\n }\n };\n\n return PosterImage;\n}(ClickableComponent);\n\nComponent.registerComponent('PosterImage', PosterImage);\n\nvar darkGray = '#222';\nvar lightGray = '#ccc';\nvar fontMap = {\n monospace: 'monospace',\n sansSerif: 'sans-serif',\n serif: 'serif',\n monospaceSansSerif: '\"Andale Mono\", \"Lucida Console\", monospace',\n monospaceSerif: '\"Courier New\", monospace',\n proportionalSansSerif: 'sans-serif',\n proportionalSerif: 'serif',\n casual: '\"Comic Sans MS\", Impact, fantasy',\n script: '\"Monotype Corsiva\", cursive',\n smallcaps: '\"Andale Mono\", \"Lucida Console\", monospace, sans-serif'\n};\n/**\n * Construct an rgba color from a given hex color code.\n *\n * @param {number} color\n * Hex number for color, like #f0e or #f604e2.\n *\n * @param {number} opacity\n * Value for opacity, 0.0 - 1.0.\n *\n * @return {string}\n * The rgba color that was created, like 'rgba(255, 0, 0, 0.3)'.\n */\n\nfunction constructColor(color, opacity) {\n var hex;\n\n if (color.length === 4) {\n // color looks like \"#f0e\"\n hex = color[1] + color[1] + color[2] + color[2] + color[3] + color[3];\n } else if (color.length === 7) {\n // color looks like \"#f604e2\"\n hex = color.slice(1);\n } else {\n throw new Error('Invalid color code provided, ' + color + '; must be formatted as e.g. #f0e or #f604e2.');\n }\n\n return 'rgba(' + parseInt(hex.slice(0, 2), 16) + ',' + parseInt(hex.slice(2, 4), 16) + ',' + parseInt(hex.slice(4, 6), 16) + ',' + opacity + ')';\n}\n/**\n * Try to update the style of a DOM element. Some style changes will throw an error,\n * particularly in IE8. Those should be noops.\n *\n * @param {Element} el\n * The DOM element to be styled.\n *\n * @param {string} style\n * The CSS property on the element that should be styled.\n *\n * @param {string} rule\n * The style rule that should be applied to the property.\n *\n * @private\n */\n\nfunction tryUpdateStyle(el, style, rule) {\n try {\n el.style[style] = rule;\n } catch (e) {\n // Satisfies linter.\n return;\n }\n}\n/**\n * The component for displaying text track cues.\n *\n * @extends Component\n */\n\n\nvar TextTrackDisplay =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(TextTrackDisplay, _Component);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Component~ReadyCallback} [ready]\n * The function to call when `TextTrackDisplay` is ready.\n */\n function TextTrackDisplay(player, options, ready) {\n var _this;\n\n _this = _Component.call(this, player, options, ready) || this;\n var updateDisplayHandler = bind(_assertThisInitialized(_assertThisInitialized(_this)), _this.updateDisplay);\n player.on('loadstart', bind(_assertThisInitialized(_assertThisInitialized(_this)), _this.toggleDisplay));\n player.on('texttrackchange', updateDisplayHandler);\n player.on('loadedmetadata', bind(_assertThisInitialized(_assertThisInitialized(_this)), _this.preselectTrack)); // This used to be called during player init, but was causing an error\n // if a track should show by default and the display hadn't loaded yet.\n // Should probably be moved to an external track loader when we support\n // tracks that don't need a display.\n\n player.ready(bind(_assertThisInitialized(_assertThisInitialized(_this)), function () {\n if (player.tech_ && player.tech_.featuresNativeTextTracks) {\n this.hide();\n return;\n }\n\n player.on('fullscreenchange', updateDisplayHandler);\n player.on('playerresize', updateDisplayHandler);\n window$1.addEventListener('orientationchange', updateDisplayHandler);\n player.on('dispose', function () {\n return window$1.removeEventListener('orientationchange', updateDisplayHandler);\n });\n var tracks = this.options_.playerOptions.tracks || [];\n\n for (var i = 0; i < tracks.length; i++) {\n this.player_.addRemoteTextTrack(tracks[i], true);\n }\n\n this.preselectTrack();\n }));\n return _this;\n }\n /**\n * Preselect a track following this precedence:\n * - matches the previously selected {@link TextTrack}'s language and kind\n * - matches the previously selected {@link TextTrack}'s language only\n * - is the first default captions track\n * - is the first default descriptions track\n *\n * @listens Player#loadstart\n */\n\n\n var _proto = TextTrackDisplay.prototype;\n\n _proto.preselectTrack = function preselectTrack() {\n var modes = {\n captions: 1,\n subtitles: 1\n };\n var trackList = this.player_.textTracks();\n var userPref = this.player_.cache_.selectedLanguage;\n var firstDesc;\n var firstCaptions;\n var preferredTrack;\n\n for (var i = 0; i < trackList.length; i++) {\n var track = trackList[i];\n\n if (userPref && userPref.enabled && userPref.language && userPref.language === track.language && track.kind in modes) {\n // Always choose the track that matches both language and kind\n if (track.kind === userPref.kind) {\n preferredTrack = track; // or choose the first track that matches language\n } else if (!preferredTrack) {\n preferredTrack = track;\n } // clear everything if offTextTrackMenuItem was clicked\n\n } else if (userPref && !userPref.enabled) {\n preferredTrack = null;\n firstDesc = null;\n firstCaptions = null;\n } else if (track.default) {\n if (track.kind === 'descriptions' && !firstDesc) {\n firstDesc = track;\n } else if (track.kind in modes && !firstCaptions) {\n firstCaptions = track;\n }\n }\n } // The preferredTrack matches the user preference and takes\n // precedence over all the other tracks.\n // So, display the preferredTrack before the first default track\n // and the subtitles/captions track before the descriptions track\n\n\n if (preferredTrack) {\n preferredTrack.mode = 'showing';\n } else if (firstCaptions) {\n firstCaptions.mode = 'showing';\n } else if (firstDesc) {\n firstDesc.mode = 'showing';\n }\n };\n /**\n * Turn display of {@link TextTrack}'s from the current state into the other state.\n * There are only two states:\n * - 'shown'\n * - 'hidden'\n *\n * @listens Player#loadstart\n */\n\n\n _proto.toggleDisplay = function toggleDisplay() {\n if (this.player_.tech_ && this.player_.tech_.featuresNativeTextTracks) {\n this.hide();\n } else {\n this.show();\n }\n };\n /**\n * Create the {@link Component}'s DOM element.\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n _proto.createEl = function createEl() {\n return _Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-text-track-display'\n }, {\n 'aria-live': 'off',\n 'aria-atomic': 'true'\n });\n };\n /**\n * Clear all displayed {@link TextTrack}s.\n */\n\n\n _proto.clearDisplay = function clearDisplay() {\n if (typeof window$1.WebVTT === 'function') {\n window$1.WebVTT.processCues(window$1, [], this.el_);\n }\n };\n /**\n * Update the displayed TextTrack when a either a {@link Player#texttrackchange} or\n * a {@link Player#fullscreenchange} is fired.\n *\n * @listens Player#texttrackchange\n * @listens Player#fullscreenchange\n */\n\n\n _proto.updateDisplay = function updateDisplay() {\n var tracks = this.player_.textTracks();\n this.clearDisplay(); // Track display prioritization model: if multiple tracks are 'showing',\n // display the first 'subtitles' or 'captions' track which is 'showing',\n // otherwise display the first 'descriptions' track which is 'showing'\n\n var descriptionsTrack = null;\n var captionsSubtitlesTrack = null;\n var i = tracks.length;\n\n while (i--) {\n var track = tracks[i];\n\n if (track.mode === 'showing') {\n if (track.kind === 'descriptions') {\n descriptionsTrack = track;\n } else {\n captionsSubtitlesTrack = track;\n }\n }\n }\n\n if (captionsSubtitlesTrack) {\n if (this.getAttribute('aria-live') !== 'off') {\n this.setAttribute('aria-live', 'off');\n }\n\n this.updateForTrack(captionsSubtitlesTrack);\n } else if (descriptionsTrack) {\n if (this.getAttribute('aria-live') !== 'assertive') {\n this.setAttribute('aria-live', 'assertive');\n }\n\n this.updateForTrack(descriptionsTrack);\n }\n };\n /**\n * Add an {@link TextTrack} to to the {@link Tech}s {@link TextTrackList}.\n *\n * @param {TextTrack} track\n * Text track object to be added to the list.\n */\n\n\n _proto.updateForTrack = function updateForTrack(track) {\n if (typeof window$1.WebVTT !== 'function' || !track.activeCues) {\n return;\n }\n\n var cues = [];\n\n for (var _i = 0; _i < track.activeCues.length; _i++) {\n cues.push(track.activeCues[_i]);\n }\n\n window$1.WebVTT.processCues(window$1, cues, this.el_);\n\n if (!this.player_.textTrackSettings) {\n return;\n }\n\n var overrides = this.player_.textTrackSettings.getValues();\n var i = cues.length;\n\n while (i--) {\n var cue = cues[i];\n\n if (!cue) {\n continue;\n }\n\n var cueDiv = cue.displayState;\n\n if (overrides.color) {\n cueDiv.firstChild.style.color = overrides.color;\n }\n\n if (overrides.textOpacity) {\n tryUpdateStyle(cueDiv.firstChild, 'color', constructColor(overrides.color || '#fff', overrides.textOpacity));\n }\n\n if (overrides.backgroundColor) {\n cueDiv.firstChild.style.backgroundColor = overrides.backgroundColor;\n }\n\n if (overrides.backgroundOpacity) {\n tryUpdateStyle(cueDiv.firstChild, 'backgroundColor', constructColor(overrides.backgroundColor || '#000', overrides.backgroundOpacity));\n }\n\n if (overrides.windowColor) {\n if (overrides.windowOpacity) {\n tryUpdateStyle(cueDiv, 'backgroundColor', constructColor(overrides.windowColor, overrides.windowOpacity));\n } else {\n cueDiv.style.backgroundColor = overrides.windowColor;\n }\n }\n\n if (overrides.edgeStyle) {\n if (overrides.edgeStyle === 'dropshadow') {\n cueDiv.firstChild.style.textShadow = \"2px 2px 3px \" + darkGray + \", 2px 2px 4px \" + darkGray + \", 2px 2px 5px \" + darkGray;\n } else if (overrides.edgeStyle === 'raised') {\n cueDiv.firstChild.style.textShadow = \"1px 1px \" + darkGray + \", 2px 2px \" + darkGray + \", 3px 3px \" + darkGray;\n } else if (overrides.edgeStyle === 'depressed') {\n cueDiv.firstChild.style.textShadow = \"1px 1px \" + lightGray + \", 0 1px \" + lightGray + \", -1px -1px \" + darkGray + \", 0 -1px \" + darkGray;\n } else if (overrides.edgeStyle === 'uniform') {\n cueDiv.firstChild.style.textShadow = \"0 0 4px \" + darkGray + \", 0 0 4px \" + darkGray + \", 0 0 4px \" + darkGray + \", 0 0 4px \" + darkGray;\n }\n }\n\n if (overrides.fontPercent && overrides.fontPercent !== 1) {\n var fontSize = window$1.parseFloat(cueDiv.style.fontSize);\n cueDiv.style.fontSize = fontSize * overrides.fontPercent + 'px';\n cueDiv.style.height = 'auto';\n cueDiv.style.top = 'auto';\n cueDiv.style.bottom = '2px';\n }\n\n if (overrides.fontFamily && overrides.fontFamily !== 'default') {\n if (overrides.fontFamily === 'small-caps') {\n cueDiv.firstChild.style.fontVariant = 'small-caps';\n } else {\n cueDiv.firstChild.style.fontFamily = fontMap[overrides.fontFamily];\n }\n }\n }\n };\n\n return TextTrackDisplay;\n}(Component);\n\nComponent.registerComponent('TextTrackDisplay', TextTrackDisplay);\n\n/**\n * A loading spinner for use during waiting/loading events.\n *\n * @extends Component\n */\n\nvar LoadingSpinner =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(LoadingSpinner, _Component);\n\n function LoadingSpinner() {\n return _Component.apply(this, arguments) || this;\n }\n\n var _proto = LoadingSpinner.prototype;\n\n /**\n * Create the `LoadingSpinner`s DOM element.\n *\n * @return {Element}\n * The dom element that gets created.\n */\n _proto.createEl = function createEl$$1() {\n var isAudio = this.player_.isAudio();\n var playerType = this.localize(isAudio ? 'Audio Player' : 'Video Player');\n var controlText = createEl('span', {\n className: 'vjs-control-text',\n innerHTML: this.localize('{1} is loading.', [playerType])\n });\n\n var el = _Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-loading-spinner',\n dir: 'ltr'\n });\n\n el.appendChild(controlText);\n return el;\n };\n\n return LoadingSpinner;\n}(Component);\n\nComponent.registerComponent('LoadingSpinner', LoadingSpinner);\n\n/**\n * Base class for all buttons.\n *\n * @extends ClickableComponent\n */\n\nvar Button =\n/*#__PURE__*/\nfunction (_ClickableComponent) {\n _inheritsLoose(Button, _ClickableComponent);\n\n function Button() {\n return _ClickableComponent.apply(this, arguments) || this;\n }\n\n var _proto = Button.prototype;\n\n /**\n * Create the `Button`s DOM element.\n *\n * @param {string} [tag=\"button\"]\n * The element's node type. This argument is IGNORED: no matter what\n * is passed, it will always create a `button` element.\n *\n * @param {Object} [props={}]\n * An object of properties that should be set on the element.\n *\n * @param {Object} [attributes={}]\n * An object of attributes that should be set on the element.\n *\n * @return {Element}\n * The element that gets created.\n */\n _proto.createEl = function createEl(tag, props, attributes) {\n if (props === void 0) {\n props = {};\n }\n\n if (attributes === void 0) {\n attributes = {};\n }\n\n tag = 'button';\n props = assign({\n innerHTML: '<span aria-hidden=\"true\" class=\"vjs-icon-placeholder\"></span>',\n className: this.buildCSSClass()\n }, props); // Add attributes for button element\n\n attributes = assign({\n // Necessary since the default button type is \"submit\"\n type: 'button'\n }, attributes);\n var el = Component.prototype.createEl.call(this, tag, props, attributes);\n this.createControlTextEl(el);\n return el;\n };\n /**\n * Add a child `Component` inside of this `Button`.\n *\n * @param {string|Component} child\n * The name or instance of a child to add.\n *\n * @param {Object} [options={}]\n * The key/value store of options that will get passed to children of\n * the child.\n *\n * @return {Component}\n * The `Component` that gets added as a child. When using a string the\n * `Component` will get created by this process.\n *\n * @deprecated since version 5\n */\n\n\n _proto.addChild = function addChild(child, options) {\n if (options === void 0) {\n options = {};\n }\n\n var className = this.constructor.name;\n log.warn(\"Adding an actionable (user controllable) child to a Button (\" + className + \") is not supported; use a ClickableComponent instead.\"); // Avoid the error message generated by ClickableComponent's addChild method\n\n return Component.prototype.addChild.call(this, child, options);\n };\n /**\n * Enable the `Button` element so that it can be activated or clicked. Use this with\n * {@link Button#disable}.\n */\n\n\n _proto.enable = function enable() {\n _ClickableComponent.prototype.enable.call(this);\n\n this.el_.removeAttribute('disabled');\n };\n /**\n * Disable the `Button` element so that it cannot be activated or clicked. Use this with\n * {@link Button#enable}.\n */\n\n\n _proto.disable = function disable() {\n _ClickableComponent.prototype.disable.call(this);\n\n this.el_.setAttribute('disabled', 'disabled');\n };\n /**\n * This gets called when a `Button` has focus and `keydown` is triggered via a key\n * press.\n *\n * @param {EventTarget~Event} event\n * The event that caused this function to get called.\n *\n * @listens keydown\n */\n\n\n _proto.handleKeyPress = function handleKeyPress(event) {\n // Ignore Space (32) or Enter (13) key operation, which is handled by the browser for a button.\n if (event.which === 32 || event.which === 13) {\n return;\n } // Pass keypress handling up for unsupported keys\n\n\n _ClickableComponent.prototype.handleKeyPress.call(this, event);\n };\n\n return Button;\n}(ClickableComponent);\n\nComponent.registerComponent('Button', Button);\n\n/**\n * The initial play button that shows before the video has played. The hiding of the\n * `BigPlayButton` get done via CSS and `Player` states.\n *\n * @extends Button\n */\n\nvar BigPlayButton =\n/*#__PURE__*/\nfunction (_Button) {\n _inheritsLoose(BigPlayButton, _Button);\n\n function BigPlayButton(player, options) {\n var _this;\n\n _this = _Button.call(this, player, options) || this;\n _this.mouseused_ = false;\n\n _this.on('mousedown', _this.handleMouseDown);\n\n return _this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object. Always returns 'vjs-big-play-button'.\n */\n\n\n var _proto = BigPlayButton.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return 'vjs-big-play-button';\n };\n /**\n * This gets called when a `BigPlayButton` \"clicked\". See {@link ClickableComponent}\n * for more detailed information on what a click can be.\n *\n * @param {EventTarget~Event} event\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n\n\n _proto.handleClick = function handleClick(event) {\n var playPromise = this.player_.play(); // exit early if clicked via the mouse\n\n if (this.mouseused_ && event.clientX && event.clientY) {\n silencePromise(playPromise);\n return;\n }\n\n var cb = this.player_.getChild('controlBar');\n var playToggle = cb && cb.getChild('playToggle');\n\n if (!playToggle) {\n this.player_.focus();\n return;\n }\n\n var playFocus = function playFocus() {\n return playToggle.focus();\n };\n\n if (isPromise(playPromise)) {\n playPromise.then(playFocus, function () {});\n } else {\n this.setTimeout(playFocus, 1);\n }\n };\n\n _proto.handleKeyPress = function handleKeyPress(event) {\n this.mouseused_ = false;\n\n _Button.prototype.handleKeyPress.call(this, event);\n };\n\n _proto.handleMouseDown = function handleMouseDown(event) {\n this.mouseused_ = true;\n };\n\n return BigPlayButton;\n}(Button);\n/**\n * The text that should display over the `BigPlayButton`s controls. Added to for localization.\n *\n * @type {string}\n * @private\n */\n\n\nBigPlayButton.prototype.controlText_ = 'Play Video';\nComponent.registerComponent('BigPlayButton', BigPlayButton);\n\n/**\n * The `CloseButton` is a `{@link Button}` that fires a `close` event when\n * it gets clicked.\n *\n * @extends Button\n */\n\nvar CloseButton =\n/*#__PURE__*/\nfunction (_Button) {\n _inheritsLoose(CloseButton, _Button);\n\n /**\n * Creates an instance of the this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function CloseButton(player, options) {\n var _this;\n\n _this = _Button.call(this, player, options) || this;\n\n _this.controlText(options && options.controlText || _this.localize('Close'));\n\n return _this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n var _proto = CloseButton.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-close-button \" + _Button.prototype.buildCSSClass.call(this);\n };\n /**\n * This gets called when a `CloseButton` gets clicked. See\n * {@link ClickableComponent#handleClick} for more information on when this will be\n * triggered\n *\n * @param {EventTarget~Event} event\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n * @fires CloseButton#close\n */\n\n\n _proto.handleClick = function handleClick(event) {\n /**\n * Triggered when the a `CloseButton` is clicked.\n *\n * @event CloseButton#close\n * @type {EventTarget~Event}\n *\n * @property {boolean} [bubbles=false]\n * set to false so that the close event does not\n * bubble up to parents if there is no listener\n */\n this.trigger({\n type: 'close',\n bubbles: false\n });\n };\n\n return CloseButton;\n}(Button);\n\nComponent.registerComponent('CloseButton', CloseButton);\n\n/**\n * Button to toggle between play and pause.\n *\n * @extends Button\n */\n\nvar PlayToggle =\n/*#__PURE__*/\nfunction (_Button) {\n _inheritsLoose(PlayToggle, _Button);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options={}]\n * The key/value store of player options.\n */\n function PlayToggle(player, options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n _this = _Button.call(this, player, options) || this; // show or hide replay icon\n\n options.replay = options.replay === undefined || options.replay;\n\n _this.on(player, 'play', _this.handlePlay);\n\n _this.on(player, 'pause', _this.handlePause);\n\n if (options.replay) {\n _this.on(player, 'ended', _this.handleEnded);\n }\n\n return _this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n var _proto = PlayToggle.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-play-control \" + _Button.prototype.buildCSSClass.call(this);\n };\n /**\n * This gets called when an `PlayToggle` is \"clicked\". See\n * {@link ClickableComponent} for more detailed information on what a click can be.\n *\n * @param {EventTarget~Event} [event]\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n\n\n _proto.handleClick = function handleClick(event) {\n if (this.player_.paused()) {\n this.player_.play();\n } else {\n this.player_.pause();\n }\n };\n /**\n * This gets called once after the video has ended and the user seeks so that\n * we can change the replay button back to a play button.\n *\n * @param {EventTarget~Event} [event]\n * The event that caused this function to run.\n *\n * @listens Player#seeked\n */\n\n\n _proto.handleSeeked = function handleSeeked(event) {\n this.removeClass('vjs-ended');\n\n if (this.player_.paused()) {\n this.handlePause(event);\n } else {\n this.handlePlay(event);\n }\n };\n /**\n * Add the vjs-playing class to the element so it can change appearance.\n *\n * @param {EventTarget~Event} [event]\n * The event that caused this function to run.\n *\n * @listens Player#play\n */\n\n\n _proto.handlePlay = function handlePlay(event) {\n this.removeClass('vjs-ended');\n this.removeClass('vjs-paused');\n this.addClass('vjs-playing'); // change the button text to \"Pause\"\n\n this.controlText('Pause');\n };\n /**\n * Add the vjs-paused class to the element so it can change appearance.\n *\n * @param {EventTarget~Event} [event]\n * The event that caused this function to run.\n *\n * @listens Player#pause\n */\n\n\n _proto.handlePause = function handlePause(event) {\n this.removeClass('vjs-playing');\n this.addClass('vjs-paused'); // change the button text to \"Play\"\n\n this.controlText('Play');\n };\n /**\n * Add the vjs-ended class to the element so it can change appearance\n *\n * @param {EventTarget~Event} [event]\n * The event that caused this function to run.\n *\n * @listens Player#ended\n */\n\n\n _proto.handleEnded = function handleEnded(event) {\n this.removeClass('vjs-playing');\n this.addClass('vjs-ended'); // change the button text to \"Replay\"\n\n this.controlText('Replay'); // on the next seek remove the replay button\n\n this.one(this.player_, 'seeked', this.handleSeeked);\n };\n\n return PlayToggle;\n}(Button);\n/**\n * The text that should display over the `PlayToggle`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\n\nPlayToggle.prototype.controlText_ = 'Play';\nComponent.registerComponent('PlayToggle', PlayToggle);\n\n/**\n * @file format-time.js\n * @module format-time\n */\n\n/**\n * Format seconds as a time string, H:MM:SS or M:SS. Supplying a guide (in\n * seconds) will force a number of leading zeros to cover the length of the\n * guide.\n *\n * @private\n * @param {number} seconds\n * Number of seconds to be turned into a string\n *\n * @param {number} guide\n * Number (in seconds) to model the string after\n *\n * @return {string}\n * Time formatted as H:MM:SS or M:SS\n */\nvar defaultImplementation = function defaultImplementation(seconds, guide) {\n seconds = seconds < 0 ? 0 : seconds;\n var s = Math.floor(seconds % 60);\n var m = Math.floor(seconds / 60 % 60);\n var h = Math.floor(seconds / 3600);\n var gm = Math.floor(guide / 60 % 60);\n var gh = Math.floor(guide / 3600); // handle invalid times\n\n if (isNaN(seconds) || seconds === Infinity) {\n // '-' is false for all relational operators (e.g. <, >=) so this setting\n // will add the minimum number of fields specified by the guide\n h = m = s = '-';\n } // Check if we need to show hours\n\n\n h = h > 0 || gh > 0 ? h + ':' : ''; // If hours are showing, we may need to add a leading zero.\n // Always show at least one digit of minutes.\n\n m = ((h || gm >= 10) && m < 10 ? '0' + m : m) + ':'; // Check if leading zero is need for seconds\n\n s = s < 10 ? '0' + s : s;\n return h + m + s;\n}; // Internal pointer to the current implementation.\n\n\nvar implementation = defaultImplementation;\n/**\n * Replaces the default formatTime implementation with a custom implementation.\n *\n * @param {Function} customImplementation\n * A function which will be used in place of the default formatTime\n * implementation. Will receive the current time in seconds and the\n * guide (in seconds) as arguments.\n */\n\nfunction setFormatTime(customImplementation) {\n implementation = customImplementation;\n}\n/**\n * Resets formatTime to the default implementation.\n */\n\nfunction resetFormatTime() {\n implementation = defaultImplementation;\n}\n/**\n * Delegates to either the default time formatting function or a custom\n * function supplied via `setFormatTime`.\n *\n * Formats seconds as a time string (H:MM:SS or M:SS). Supplying a\n * guide (in seconds) will force a number of leading zeros to cover the\n * length of the guide.\n *\n * @static\n * @example formatTime(125, 600) === \"02:05\"\n * @param {number} seconds\n * Number of seconds to be turned into a string\n *\n * @param {number} guide\n * Number (in seconds) to model the string after\n *\n * @return {string}\n * Time formatted as H:MM:SS or M:SS\n */\n\nfunction formatTime(seconds, guide) {\n if (guide === void 0) {\n guide = seconds;\n }\n\n return implementation(seconds, guide);\n}\n\n/**\n * Displays time information about the video\n *\n * @extends Component\n */\n\nvar TimeDisplay =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(TimeDisplay, _Component);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function TimeDisplay(player, options) {\n var _this;\n\n _this = _Component.call(this, player, options) || this;\n _this.throttledUpdateContent = throttle(bind(_assertThisInitialized(_assertThisInitialized(_this)), _this.updateContent), 25);\n\n _this.on(player, 'timeupdate', _this.throttledUpdateContent);\n\n return _this;\n }\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n var _proto = TimeDisplay.prototype;\n\n _proto.createEl = function createEl$$1(plainName) {\n var className = this.buildCSSClass();\n\n var el = _Component.prototype.createEl.call(this, 'div', {\n className: className + \" vjs-time-control vjs-control\",\n innerHTML: \"<span class=\\\"vjs-control-text\\\" role=\\\"presentation\\\">\" + this.localize(this.labelText_) + \"\\xA0</span>\"\n });\n\n this.contentEl_ = createEl('span', {\n className: className + \"-display\"\n }, {\n // tell screen readers not to automatically read the time as it changes\n 'aria-live': 'off',\n // span elements have no implicit role, but some screen readers (notably VoiceOver)\n // treat them as a break between items in the DOM when using arrow keys\n // (or left-to-right swipes on iOS) to read contents of a page. Using\n // role='presentation' causes VoiceOver to NOT treat this span as a break.\n 'role': 'presentation'\n });\n this.updateTextNode_();\n el.appendChild(this.contentEl_);\n return el;\n };\n\n _proto.dispose = function dispose() {\n this.contentEl_ = null;\n this.textNode_ = null;\n\n _Component.prototype.dispose.call(this);\n };\n /**\n * Updates the \"remaining time\" text node with new content using the\n * contents of the `formattedTime_` property.\n *\n * @private\n */\n\n\n _proto.updateTextNode_ = function updateTextNode_() {\n if (!this.contentEl_) {\n return;\n }\n\n while (this.contentEl_.firstChild) {\n this.contentEl_.removeChild(this.contentEl_.firstChild);\n }\n\n this.textNode_ = document.createTextNode(this.formattedTime_ || this.formatTime_(0));\n this.contentEl_.appendChild(this.textNode_);\n };\n /**\n * Generates a formatted time for this component to use in display.\n *\n * @param {number} time\n * A numeric time, in seconds.\n *\n * @return {string}\n * A formatted time\n *\n * @private\n */\n\n\n _proto.formatTime_ = function formatTime_(time) {\n return formatTime(time);\n };\n /**\n * Updates the time display text node if it has what was passed in changed\n * the formatted time.\n *\n * @param {number} time\n * The time to update to\n *\n * @private\n */\n\n\n _proto.updateFormattedTime_ = function updateFormattedTime_(time) {\n var formattedTime = this.formatTime_(time);\n\n if (formattedTime === this.formattedTime_) {\n return;\n }\n\n this.formattedTime_ = formattedTime;\n this.requestAnimationFrame(this.updateTextNode_);\n };\n /**\n * To be filled out in the child class, should update the displayed time\n * in accordance with the fact that the current time has changed.\n *\n * @param {EventTarget~Event} [event]\n * The `timeupdate` event that caused this to run.\n *\n * @listens Player#timeupdate\n */\n\n\n _proto.updateContent = function updateContent(event) {};\n\n return TimeDisplay;\n}(Component);\n/**\n * The text that is added to the `TimeDisplay` for screen reader users.\n *\n * @type {string}\n * @private\n */\n\n\nTimeDisplay.prototype.labelText_ = 'Time';\n/**\n * The text that should display over the `TimeDisplay`s controls. Added to for localization.\n *\n * @type {string}\n * @private\n *\n * @deprecated in v7; controlText_ is not used in non-active display Components\n */\n\nTimeDisplay.prototype.controlText_ = 'Time';\nComponent.registerComponent('TimeDisplay', TimeDisplay);\n\n/**\n * Displays the current time\n *\n * @extends Component\n */\n\nvar CurrentTimeDisplay =\n/*#__PURE__*/\nfunction (_TimeDisplay) {\n _inheritsLoose(CurrentTimeDisplay, _TimeDisplay);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function CurrentTimeDisplay(player, options) {\n var _this;\n\n _this = _TimeDisplay.call(this, player, options) || this;\n\n _this.on(player, 'ended', _this.handleEnded);\n\n return _this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n var _proto = CurrentTimeDisplay.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return 'vjs-current-time';\n };\n /**\n * Update current time display\n *\n * @param {EventTarget~Event} [event]\n * The `timeupdate` event that caused this function to run.\n *\n * @listens Player#timeupdate\n */\n\n\n _proto.updateContent = function updateContent(event) {\n // Allows for smooth scrubbing, when player can't keep up.\n var time = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime();\n this.updateFormattedTime_(time);\n };\n /**\n * When the player fires ended there should be no time left. Sadly\n * this is not always the case, lets make it seem like that is the case\n * for users.\n *\n * @param {EventTarget~Event} [event]\n * The `ended` event that caused this to run.\n *\n * @listens Player#ended\n */\n\n\n _proto.handleEnded = function handleEnded(event) {\n if (!this.player_.duration()) {\n return;\n }\n\n this.updateFormattedTime_(this.player_.duration());\n };\n\n return CurrentTimeDisplay;\n}(TimeDisplay);\n/**\n * The text that is added to the `CurrentTimeDisplay` for screen reader users.\n *\n * @type {string}\n * @private\n */\n\n\nCurrentTimeDisplay.prototype.labelText_ = 'Current Time';\n/**\n * The text that should display over the `CurrentTimeDisplay`s controls. Added to for localization.\n *\n * @type {string}\n * @private\n *\n * @deprecated in v7; controlText_ is not used in non-active display Components\n */\n\nCurrentTimeDisplay.prototype.controlText_ = 'Current Time';\nComponent.registerComponent('CurrentTimeDisplay', CurrentTimeDisplay);\n\n/**\n * Displays the duration\n *\n * @extends Component\n */\n\nvar DurationDisplay =\n/*#__PURE__*/\nfunction (_TimeDisplay) {\n _inheritsLoose(DurationDisplay, _TimeDisplay);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function DurationDisplay(player, options) {\n var _this;\n\n _this = _TimeDisplay.call(this, player, options) || this; // we do not want to/need to throttle duration changes,\n // as they should always display the changed duration as\n // it has changed\n\n _this.on(player, 'durationchange', _this.updateContent); // Listen to loadstart because the player duration is reset when a new media element is loaded,\n // but the durationchange on the user agent will not fire.\n // @see [Spec]{@link https://www.w3.org/TR/2011/WD-html5-20110113/video.html#media-element-load-algorithm}\n\n\n _this.on(player, 'loadstart', _this.updateContent); // Also listen for timeupdate (in the parent) and loadedmetadata because removing those\n // listeners could have broken dependent applications/libraries. These\n // can likely be removed for 7.0.\n\n\n _this.on(player, 'loadedmetadata', _this.throttledUpdateContent);\n\n return _this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n var _proto = DurationDisplay.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return 'vjs-duration';\n };\n /**\n * Update duration time display.\n *\n * @param {EventTarget~Event} [event]\n * The `durationchange`, `timeupdate`, or `loadedmetadata` event that caused\n * this function to be called.\n *\n * @listens Player#durationchange\n * @listens Player#timeupdate\n * @listens Player#loadedmetadata\n */\n\n\n _proto.updateContent = function updateContent(event) {\n var duration = this.player_.duration();\n\n if (this.duration_ !== duration) {\n this.duration_ = duration;\n this.updateFormattedTime_(duration);\n }\n };\n\n return DurationDisplay;\n}(TimeDisplay);\n/**\n * The text that is added to the `DurationDisplay` for screen reader users.\n *\n * @type {string}\n * @private\n */\n\n\nDurationDisplay.prototype.labelText_ = 'Duration';\n/**\n * The text that should display over the `DurationDisplay`s controls. Added to for localization.\n *\n * @type {string}\n * @private\n *\n * @deprecated in v7; controlText_ is not used in non-active display Components\n */\n\nDurationDisplay.prototype.controlText_ = 'Duration';\nComponent.registerComponent('DurationDisplay', DurationDisplay);\n\n/**\n * The separator between the current time and duration.\n * Can be hidden if it's not needed in the design.\n *\n * @extends Component\n */\n\nvar TimeDivider =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(TimeDivider, _Component);\n\n function TimeDivider() {\n return _Component.apply(this, arguments) || this;\n }\n\n var _proto = TimeDivider.prototype;\n\n /**\n * Create the component's DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n _proto.createEl = function createEl() {\n return _Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-time-control vjs-time-divider',\n innerHTML: '<div><span>/</span></div>'\n }, {\n // this element and its contents can be hidden from assistive techs since\n // it is made extraneous by the announcement of the control text\n // for the current time and duration displays\n 'aria-hidden': true\n });\n };\n\n return TimeDivider;\n}(Component);\n\nComponent.registerComponent('TimeDivider', TimeDivider);\n\n/**\n * Displays the time left in the video\n *\n * @extends Component\n */\n\nvar RemainingTimeDisplay =\n/*#__PURE__*/\nfunction (_TimeDisplay) {\n _inheritsLoose(RemainingTimeDisplay, _TimeDisplay);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function RemainingTimeDisplay(player, options) {\n var _this;\n\n _this = _TimeDisplay.call(this, player, options) || this;\n\n _this.on(player, 'durationchange', _this.throttledUpdateContent);\n\n _this.on(player, 'ended', _this.handleEnded);\n\n return _this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n var _proto = RemainingTimeDisplay.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return 'vjs-remaining-time';\n };\n /**\n * The remaining time display prefixes numbers with a \"minus\" character.\n *\n * @param {number} time\n * A numeric time, in seconds.\n *\n * @return {string}\n * A formatted time\n *\n * @private\n */\n\n\n _proto.formatTime_ = function formatTime_(time) {\n // TODO: The \"-\" should be decorative, and not announced by a screen reader\n return '-' + _TimeDisplay.prototype.formatTime_.call(this, time);\n };\n /**\n * Update remaining time display.\n *\n * @param {EventTarget~Event} [event]\n * The `timeupdate` or `durationchange` event that caused this to run.\n *\n * @listens Player#timeupdate\n * @listens Player#durationchange\n */\n\n\n _proto.updateContent = function updateContent(event) {\n if (!this.player_.duration()) {\n return;\n } // @deprecated We should only use remainingTimeDisplay\n // as of video.js 7\n\n\n if (this.player_.remainingTimeDisplay) {\n this.updateFormattedTime_(this.player_.remainingTimeDisplay());\n } else {\n this.updateFormattedTime_(this.player_.remainingTime());\n }\n };\n /**\n * When the player fires ended there should be no time left. Sadly\n * this is not always the case, lets make it seem like that is the case\n * for users.\n *\n * @param {EventTarget~Event} [event]\n * The `ended` event that caused this to run.\n *\n * @listens Player#ended\n */\n\n\n _proto.handleEnded = function handleEnded(event) {\n if (!this.player_.duration()) {\n return;\n }\n\n this.updateFormattedTime_(0);\n };\n\n return RemainingTimeDisplay;\n}(TimeDisplay);\n/**\n * The text that is added to the `RemainingTimeDisplay` for screen reader users.\n *\n * @type {string}\n * @private\n */\n\n\nRemainingTimeDisplay.prototype.labelText_ = 'Remaining Time';\n/**\n * The text that should display over the `RemainingTimeDisplay`s controls. Added to for localization.\n *\n * @type {string}\n * @private\n *\n * @deprecated in v7; controlText_ is not used in non-active display Components\n */\n\nRemainingTimeDisplay.prototype.controlText_ = 'Remaining Time';\nComponent.registerComponent('RemainingTimeDisplay', RemainingTimeDisplay);\n\n/**\n * Displays the live indicator when duration is Infinity.\n *\n * @extends Component\n */\n\nvar LiveDisplay =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(LiveDisplay, _Component);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function LiveDisplay(player, options) {\n var _this;\n\n _this = _Component.call(this, player, options) || this;\n\n _this.updateShowing();\n\n _this.on(_this.player(), 'durationchange', _this.updateShowing);\n\n return _this;\n }\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n var _proto = LiveDisplay.prototype;\n\n _proto.createEl = function createEl$$1() {\n var el = _Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-live-control vjs-control'\n });\n\n this.contentEl_ = createEl('div', {\n className: 'vjs-live-display',\n innerHTML: \"<span class=\\\"vjs-control-text\\\">\" + this.localize('Stream Type') + \"\\xA0</span>\" + this.localize('LIVE')\n }, {\n 'aria-live': 'off'\n });\n el.appendChild(this.contentEl_);\n return el;\n };\n\n _proto.dispose = function dispose() {\n this.contentEl_ = null;\n\n _Component.prototype.dispose.call(this);\n };\n /**\n * Check the duration to see if the LiveDisplay should be showing or not. Then show/hide\n * it accordingly\n *\n * @param {EventTarget~Event} [event]\n * The {@link Player#durationchange} event that caused this function to run.\n *\n * @listens Player#durationchange\n */\n\n\n _proto.updateShowing = function updateShowing(event) {\n if (this.player().duration() === Infinity) {\n this.show();\n } else {\n this.hide();\n }\n };\n\n return LiveDisplay;\n}(Component);\n\nComponent.registerComponent('LiveDisplay', LiveDisplay);\n\n/**\n * Displays the live indicator when duration is Infinity.\n *\n * @extends Component\n */\n\nvar SeekToLive =\n/*#__PURE__*/\nfunction (_Button) {\n _inheritsLoose(SeekToLive, _Button);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function SeekToLive(player, options) {\n var _this;\n\n _this = _Button.call(this, player, options) || this;\n\n _this.updateLiveEdgeStatus();\n\n if (_this.player_.liveTracker) {\n _this.on(_this.player_.liveTracker, 'liveedgechange', _this.updateLiveEdgeStatus);\n }\n\n return _this;\n }\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n var _proto = SeekToLive.prototype;\n\n _proto.createEl = function createEl$$1() {\n var el = _Button.prototype.createEl.call(this, 'button', {\n className: 'vjs-seek-to-live-control vjs-control'\n });\n\n this.textEl_ = createEl('span', {\n className: 'vjs-seek-to-live-text',\n innerHTML: this.localize('LIVE')\n }, {\n 'aria-hidden': 'true'\n });\n el.appendChild(this.textEl_);\n return el;\n };\n /**\n * Update the state of this button if we are at the live edge\n * or not\n */\n\n\n _proto.updateLiveEdgeStatus = function updateLiveEdgeStatus(e) {\n // default to live edge\n if (!this.player_.liveTracker || this.player_.liveTracker.atLiveEdge()) {\n this.setAttribute('aria-disabled', true);\n this.addClass('vjs-at-live-edge');\n this.controlText('Seek to live, currently playing live');\n } else {\n this.setAttribute('aria-disabled', false);\n this.removeClass('vjs-at-live-edge');\n this.controlText('Seek to live, currently behind live');\n }\n };\n /**\n * On click bring us as near to the live point as possible.\n * This requires that we wait for the next `live-seekable-change`\n * event which will happen every segment length seconds.\n */\n\n\n _proto.handleClick = function handleClick() {\n this.player_.liveTracker.seekToLiveEdge();\n };\n /**\n * Dispose of the element and stop tracking\n */\n\n\n _proto.dispose = function dispose() {\n if (this.player_.liveTracker) {\n this.off(this.player_.liveTracker, 'liveedgechange', this.updateLiveEdgeStatus);\n }\n\n this.textEl_ = null;\n\n _Button.prototype.dispose.call(this);\n };\n\n return SeekToLive;\n}(Button);\n\nSeekToLive.prototype.controlText_ = 'Seek to live, currently playing live';\nComponent.registerComponent('SeekToLive', SeekToLive);\n\n/**\n * The base functionality for a slider. Can be vertical or horizontal.\n * For instance the volume bar or the seek bar on a video is a slider.\n *\n * @extends Component\n */\n\nvar Slider =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(Slider, _Component);\n\n /**\n * Create an instance of this class\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function Slider(player, options) {\n var _this;\n\n _this = _Component.call(this, player, options) || this; // Set property names to bar to match with the child Slider class is looking for\n\n _this.bar = _this.getChild(_this.options_.barName); // Set a horizontal or vertical class on the slider depending on the slider type\n\n _this.vertical(!!_this.options_.vertical);\n\n _this.enable();\n\n return _this;\n }\n /**\n * Are controls are currently enabled for this slider or not.\n *\n * @return {boolean}\n * true if controls are enabled, false otherwise\n */\n\n\n var _proto = Slider.prototype;\n\n _proto.enabled = function enabled() {\n return this.enabled_;\n };\n /**\n * Enable controls for this slider if they are disabled\n */\n\n\n _proto.enable = function enable() {\n if (this.enabled()) {\n return;\n }\n\n this.on('mousedown', this.handleMouseDown);\n this.on('touchstart', this.handleMouseDown);\n this.on('focus', this.handleFocus);\n this.on('blur', this.handleBlur);\n this.on('click', this.handleClick);\n this.on(this.player_, 'controlsvisible', this.update);\n\n if (this.playerEvent) {\n this.on(this.player_, this.playerEvent, this.update);\n }\n\n this.removeClass('disabled');\n this.setAttribute('tabindex', 0);\n this.enabled_ = true;\n };\n /**\n * Disable controls for this slider if they are enabled\n */\n\n\n _proto.disable = function disable() {\n if (!this.enabled()) {\n return;\n }\n\n var doc = this.bar.el_.ownerDocument;\n this.off('mousedown', this.handleMouseDown);\n this.off('touchstart', this.handleMouseDown);\n this.off('focus', this.handleFocus);\n this.off('blur', this.handleBlur);\n this.off('click', this.handleClick);\n this.off(this.player_, 'controlsvisible', this.update);\n this.off(doc, 'mousemove', this.handleMouseMove);\n this.off(doc, 'mouseup', this.handleMouseUp);\n this.off(doc, 'touchmove', this.handleMouseMove);\n this.off(doc, 'touchend', this.handleMouseUp);\n this.removeAttribute('tabindex');\n this.addClass('disabled');\n\n if (this.playerEvent) {\n this.off(this.player_, this.playerEvent, this.update);\n }\n\n this.enabled_ = false;\n };\n /**\n * Create the `Slider`s DOM element.\n *\n * @param {string} type\n * Type of element to create.\n *\n * @param {Object} [props={}]\n * List of properties in Object form.\n *\n * @param {Object} [attributes={}]\n * list of attributes in Object form.\n *\n * @return {Element}\n * The element that gets created.\n */\n\n\n _proto.createEl = function createEl$$1(type, props, attributes) {\n if (props === void 0) {\n props = {};\n }\n\n if (attributes === void 0) {\n attributes = {};\n }\n\n // Add the slider element class to all sub classes\n props.className = props.className + ' vjs-slider';\n props = assign({\n tabIndex: 0\n }, props);\n attributes = assign({\n 'role': 'slider',\n 'aria-valuenow': 0,\n 'aria-valuemin': 0,\n 'aria-valuemax': 100,\n 'tabIndex': 0\n }, attributes);\n return _Component.prototype.createEl.call(this, type, props, attributes);\n };\n /**\n * Handle `mousedown` or `touchstart` events on the `Slider`.\n *\n * @param {EventTarget~Event} event\n * `mousedown` or `touchstart` event that triggered this function\n *\n * @listens mousedown\n * @listens touchstart\n * @fires Slider#slideractive\n */\n\n\n _proto.handleMouseDown = function handleMouseDown(event) {\n var doc = this.bar.el_.ownerDocument;\n\n if (event.type === 'mousedown') {\n event.preventDefault();\n } // Do not call preventDefault() on touchstart in Chrome\n // to avoid console warnings. Use a 'touch-action: none' style\n // instead to prevent unintented scrolling.\n // https://developers.google.com/web/updates/2017/01/scrolling-intervention\n\n\n if (event.type === 'touchstart' && !IS_CHROME) {\n event.preventDefault();\n }\n\n blockTextSelection();\n this.addClass('vjs-sliding');\n /**\n * Triggered when the slider is in an active state\n *\n * @event Slider#slideractive\n * @type {EventTarget~Event}\n */\n\n this.trigger('slideractive');\n this.on(doc, 'mousemove', this.handleMouseMove);\n this.on(doc, 'mouseup', this.handleMouseUp);\n this.on(doc, 'touchmove', this.handleMouseMove);\n this.on(doc, 'touchend', this.handleMouseUp);\n this.handleMouseMove(event);\n };\n /**\n * Handle the `mousemove`, `touchmove`, and `mousedown` events on this `Slider`.\n * The `mousemove` and `touchmove` events will only only trigger this function during\n * `mousedown` and `touchstart`. This is due to {@link Slider#handleMouseDown} and\n * {@link Slider#handleMouseUp}.\n *\n * @param {EventTarget~Event} event\n * `mousedown`, `mousemove`, `touchstart`, or `touchmove` event that triggered\n * this function\n *\n * @listens mousemove\n * @listens touchmove\n */\n\n\n _proto.handleMouseMove = function handleMouseMove(event) {};\n /**\n * Handle `mouseup` or `touchend` events on the `Slider`.\n *\n * @param {EventTarget~Event} event\n * `mouseup` or `touchend` event that triggered this function.\n *\n * @listens touchend\n * @listens mouseup\n * @fires Slider#sliderinactive\n */\n\n\n _proto.handleMouseUp = function handleMouseUp() {\n var doc = this.bar.el_.ownerDocument;\n unblockTextSelection();\n this.removeClass('vjs-sliding');\n /**\n * Triggered when the slider is no longer in an active state.\n *\n * @event Slider#sliderinactive\n * @type {EventTarget~Event}\n */\n\n this.trigger('sliderinactive');\n this.off(doc, 'mousemove', this.handleMouseMove);\n this.off(doc, 'mouseup', this.handleMouseUp);\n this.off(doc, 'touchmove', this.handleMouseMove);\n this.off(doc, 'touchend', this.handleMouseUp);\n this.update();\n };\n /**\n * Update the progress bar of the `Slider`.\n *\n * @return {number}\n * The percentage of progress the progress bar represents as a\n * number from 0 to 1.\n */\n\n\n _proto.update = function update() {\n // In VolumeBar init we have a setTimeout for update that pops and update\n // to the end of the execution stack. The player is destroyed before then\n // update will cause an error\n if (!this.el_) {\n return;\n } // If scrubbing, we could use a cached value to make the handle keep up\n // with the user's mouse. On HTML5 browsers scrubbing is really smooth, but\n // some flash players are slow, so we might want to utilize this later.\n // var progress = (this.player_.scrubbing()) ? this.player_.getCache().currentTime / this.player_.duration() : this.player_.currentTime() / this.player_.duration();\n\n\n var progress = this.getPercent();\n var bar = this.bar; // If there's no bar...\n\n if (!bar) {\n return;\n } // Protect against no duration and other division issues\n\n\n if (typeof progress !== 'number' || progress !== progress || progress < 0 || progress === Infinity) {\n progress = 0;\n } // Convert to a percentage for setting\n\n\n var percentage = (progress * 100).toFixed(2) + '%';\n var style = bar.el().style; // Set the new bar width or height\n\n if (this.vertical()) {\n style.height = percentage;\n } else {\n style.width = percentage;\n }\n\n return progress;\n };\n /**\n * Calculate distance for slider\n *\n * @param {EventTarget~Event} event\n * The event that caused this function to run.\n *\n * @return {number}\n * The current position of the Slider.\n * - position.x for vertical `Slider`s\n * - position.y for horizontal `Slider`s\n */\n\n\n _proto.calculateDistance = function calculateDistance(event) {\n var position = getPointerPosition(this.el_, event);\n\n if (this.vertical()) {\n return position.y;\n }\n\n return position.x;\n };\n /**\n * Handle a `focus` event on this `Slider`.\n *\n * @param {EventTarget~Event} event\n * The `focus` event that caused this function to run.\n *\n * @listens focus\n */\n\n\n _proto.handleFocus = function handleFocus() {\n this.on(this.bar.el_.ownerDocument, 'keydown', this.handleKeyPress);\n };\n /**\n * Handle a `keydown` event on the `Slider`. Watches for left, rigth, up, and down\n * arrow keys. This function will only be called when the slider has focus. See\n * {@link Slider#handleFocus} and {@link Slider#handleBlur}.\n *\n * @param {EventTarget~Event} event\n * the `keydown` event that caused this function to run.\n *\n * @listens keydown\n */\n\n\n _proto.handleKeyPress = function handleKeyPress(event) {\n // Left and Down Arrows\n if (event.which === 37 || event.which === 40) {\n event.preventDefault();\n this.stepBack(); // Up and Right Arrows\n } else if (event.which === 38 || event.which === 39) {\n event.preventDefault();\n this.stepForward();\n }\n };\n /**\n * Handle a `blur` event on this `Slider`.\n *\n * @param {EventTarget~Event} event\n * The `blur` event that caused this function to run.\n *\n * @listens blur\n */\n\n\n _proto.handleBlur = function handleBlur() {\n this.off(this.bar.el_.ownerDocument, 'keydown', this.handleKeyPress);\n };\n /**\n * Listener for click events on slider, used to prevent clicks\n * from bubbling up to parent elements like button menus.\n *\n * @param {Object} event\n * Event that caused this object to run\n */\n\n\n _proto.handleClick = function handleClick(event) {\n event.stopImmediatePropagation();\n event.preventDefault();\n };\n /**\n * Get/set if slider is horizontal for vertical\n *\n * @param {boolean} [bool]\n * - true if slider is vertical,\n * - false is horizontal\n *\n * @return {boolean}\n * - true if slider is vertical, and getting\n * - false if the slider is horizontal, and getting\n */\n\n\n _proto.vertical = function vertical(bool) {\n if (bool === undefined) {\n return this.vertical_ || false;\n }\n\n this.vertical_ = !!bool;\n\n if (this.vertical_) {\n this.addClass('vjs-slider-vertical');\n } else {\n this.addClass('vjs-slider-horizontal');\n }\n };\n\n return Slider;\n}(Component);\n\nComponent.registerComponent('Slider', Slider);\n\n/**\n * Shows loading progress\n *\n * @extends Component\n */\n\nvar LoadProgressBar =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(LoadProgressBar, _Component);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function LoadProgressBar(player, options) {\n var _this;\n\n _this = _Component.call(this, player, options) || this;\n _this.partEls_ = [];\n\n _this.on(player, 'progress', _this.update);\n\n return _this;\n }\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n var _proto = LoadProgressBar.prototype;\n\n _proto.createEl = function createEl$$1() {\n return _Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-load-progress',\n innerHTML: \"<span class=\\\"vjs-control-text\\\"><span>\" + this.localize('Loaded') + \"</span>: <span class=\\\"vjs-control-text-loaded-percentage\\\">0%</span></span>\"\n });\n };\n\n _proto.dispose = function dispose() {\n this.partEls_ = null;\n\n _Component.prototype.dispose.call(this);\n };\n /**\n * Update progress bar\n *\n * @param {EventTarget~Event} [event]\n * The `progress` event that caused this function to run.\n *\n * @listens Player#progress\n */\n\n\n _proto.update = function update(event) {\n var liveTracker = this.player_.liveTracker;\n var buffered = this.player_.buffered();\n var duration = liveTracker && liveTracker.isLive() ? liveTracker.seekableEnd() : this.player_.duration();\n var bufferedEnd = this.player_.bufferedEnd();\n var children = this.partEls_;\n var controlTextPercentage = this.$('.vjs-control-text-loaded-percentage'); // get the percent width of a time compared to the total end\n\n var percentify = function percentify(time, end, rounded) {\n // no NaN\n var percent = time / end || 0;\n percent = (percent >= 1 ? 1 : percent) * 100;\n\n if (rounded) {\n percent = percent.toFixed(2);\n }\n\n return percent + '%';\n }; // update the width of the progress bar\n\n\n this.el_.style.width = percentify(bufferedEnd, duration); // update the control-text\n\n textContent(controlTextPercentage, percentify(bufferedEnd, duration, true)); // add child elements to represent the individual buffered time ranges\n\n for (var i = 0; i < buffered.length; i++) {\n var start = buffered.start(i);\n var end = buffered.end(i);\n var part = children[i];\n\n if (!part) {\n part = this.el_.appendChild(createEl());\n children[i] = part;\n } // set the percent based on the width of the progress bar (bufferedEnd)\n\n\n part.style.left = percentify(start, bufferedEnd);\n part.style.width = percentify(end - start, bufferedEnd);\n } // remove unused buffered range elements\n\n\n for (var _i = children.length; _i > buffered.length; _i--) {\n this.el_.removeChild(children[_i - 1]);\n }\n\n children.length = buffered.length;\n };\n\n return LoadProgressBar;\n}(Component);\n\nComponent.registerComponent('LoadProgressBar', LoadProgressBar);\n\n/**\n * Time tooltips display a time above the progress bar.\n *\n * @extends Component\n */\n\nvar TimeTooltip =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(TimeTooltip, _Component);\n\n function TimeTooltip() {\n return _Component.apply(this, arguments) || this;\n }\n\n var _proto = TimeTooltip.prototype;\n\n /**\n * Create the time tooltip DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n _proto.createEl = function createEl$$1() {\n return _Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-time-tooltip'\n }, {\n 'aria-hidden': 'true'\n });\n };\n /**\n * Updates the position of the time tooltip relative to the `SeekBar`.\n *\n * @param {Object} seekBarRect\n * The `ClientRect` for the {@link SeekBar} element.\n *\n * @param {number} seekBarPoint\n * A number from 0 to 1, representing a horizontal reference point\n * from the left edge of the {@link SeekBar}\n */\n\n\n _proto.update = function update(seekBarRect, seekBarPoint, content) {\n var tooltipRect = getBoundingClientRect(this.el_);\n var playerRect = getBoundingClientRect(this.player_.el());\n var seekBarPointPx = seekBarRect.width * seekBarPoint; // do nothing if either rect isn't available\n // for example, if the player isn't in the DOM for testing\n\n if (!playerRect || !tooltipRect) {\n return;\n } // This is the space left of the `seekBarPoint` available within the bounds\n // of the player. We calculate any gap between the left edge of the player\n // and the left edge of the `SeekBar` and add the number of pixels in the\n // `SeekBar` before hitting the `seekBarPoint`\n\n\n var spaceLeftOfPoint = seekBarRect.left - playerRect.left + seekBarPointPx; // This is the space right of the `seekBarPoint` available within the bounds\n // of the player. We calculate the number of pixels from the `seekBarPoint`\n // to the right edge of the `SeekBar` and add to that any gap between the\n // right edge of the `SeekBar` and the player.\n\n var spaceRightOfPoint = seekBarRect.width - seekBarPointPx + (playerRect.right - seekBarRect.right); // This is the number of pixels by which the tooltip will need to be pulled\n // further to the right to center it over the `seekBarPoint`.\n\n var pullTooltipBy = tooltipRect.width / 2; // Adjust the `pullTooltipBy` distance to the left or right depending on\n // the results of the space calculations above.\n\n if (spaceLeftOfPoint < pullTooltipBy) {\n pullTooltipBy += pullTooltipBy - spaceLeftOfPoint;\n } else if (spaceRightOfPoint < pullTooltipBy) {\n pullTooltipBy = spaceRightOfPoint;\n } // Due to the imprecision of decimal/ratio based calculations and varying\n // rounding behaviors, there are cases where the spacing adjustment is off\n // by a pixel or two. This adds insurance to these calculations.\n\n\n if (pullTooltipBy < 0) {\n pullTooltipBy = 0;\n } else if (pullTooltipBy > tooltipRect.width) {\n pullTooltipBy = tooltipRect.width;\n }\n\n this.el_.style.right = \"-\" + pullTooltipBy + \"px\";\n textContent(this.el_, content);\n };\n /**\n * Updates the position of the time tooltip relative to the `SeekBar`.\n *\n * @param {Object} seekBarRect\n * The `ClientRect` for the {@link SeekBar} element.\n *\n * @param {number} seekBarPoint\n * A number from 0 to 1, representing a horizontal reference point\n * from the left edge of the {@link SeekBar}\n *\n * @param {number} time\n * The time to update the tooltip to, not used during live playback\n *\n * @param {Function} cb\n * A function that will be called during the request animation frame\n * for tooltips that need to do additional animations from the default\n */\n\n\n _proto.updateTime = function updateTime(seekBarRect, seekBarPoint, time, cb) {\n var _this = this;\n\n // If there is an existing rAF ID, cancel it so we don't over-queue.\n if (this.rafId_) {\n this.cancelAnimationFrame(this.rafId_);\n }\n\n this.rafId_ = this.requestAnimationFrame(function () {\n var content;\n\n var duration = _this.player_.duration();\n\n if (_this.player_.liveTracker && _this.player_.liveTracker.isLive()) {\n var liveWindow = _this.player_.liveTracker.liveWindow();\n\n var secondsBehind = liveWindow - seekBarPoint * liveWindow;\n content = (secondsBehind < 1 ? '' : '-') + formatTime(secondsBehind, liveWindow);\n } else {\n content = formatTime(time, duration);\n }\n\n _this.update(seekBarRect, seekBarPoint, content);\n\n if (cb) {\n cb();\n }\n });\n };\n\n return TimeTooltip;\n}(Component);\n\nComponent.registerComponent('TimeTooltip', TimeTooltip);\n\n/**\n * Used by {@link SeekBar} to display media playback progress as part of the\n * {@link ProgressControl}.\n *\n * @extends Component\n */\n\nvar PlayProgressBar =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(PlayProgressBar, _Component);\n\n function PlayProgressBar() {\n return _Component.apply(this, arguments) || this;\n }\n\n var _proto = PlayProgressBar.prototype;\n\n /**\n * Create the the DOM element for this class.\n *\n * @return {Element}\n * The element that was created.\n */\n _proto.createEl = function createEl() {\n return _Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-play-progress vjs-slider-bar'\n }, {\n 'aria-hidden': 'true'\n });\n };\n /**\n * Enqueues updates to its own DOM as well as the DOM of its\n * {@link TimeTooltip} child.\n *\n * @param {Object} seekBarRect\n * The `ClientRect` for the {@link SeekBar} element.\n *\n * @param {number} seekBarPoint\n * A number from 0 to 1, representing a horizontal reference point\n * from the left edge of the {@link SeekBar}\n */\n\n\n _proto.update = function update(seekBarRect, seekBarPoint) {\n var timeTooltip = this.getChild('timeTooltip');\n\n if (!timeTooltip) {\n return;\n }\n\n var time = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime();\n timeTooltip.updateTime(seekBarRect, seekBarPoint, time);\n };\n\n return PlayProgressBar;\n}(Component);\n/**\n * Default options for {@link PlayProgressBar}.\n *\n * @type {Object}\n * @private\n */\n\n\nPlayProgressBar.prototype.options_ = {\n children: []\n}; // Time tooltips should not be added to a player on mobile devices\n\nif (!IS_IOS && !IS_ANDROID) {\n PlayProgressBar.prototype.options_.children.push('timeTooltip');\n}\n\nComponent.registerComponent('PlayProgressBar', PlayProgressBar);\n\n/**\n * The {@link MouseTimeDisplay} component tracks mouse movement over the\n * {@link ProgressControl}. It displays an indicator and a {@link TimeTooltip}\n * indicating the time which is represented by a given point in the\n * {@link ProgressControl}.\n *\n * @extends Component\n */\n\nvar MouseTimeDisplay =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(MouseTimeDisplay, _Component);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The {@link Player} that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function MouseTimeDisplay(player, options) {\n var _this;\n\n _this = _Component.call(this, player, options) || this;\n _this.update = throttle(bind(_assertThisInitialized(_assertThisInitialized(_this)), _this.update), 25);\n return _this;\n }\n /**\n * Create the DOM element for this class.\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n var _proto = MouseTimeDisplay.prototype;\n\n _proto.createEl = function createEl() {\n return _Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-mouse-display'\n });\n };\n /**\n * Enqueues updates to its own DOM as well as the DOM of its\n * {@link TimeTooltip} child.\n *\n * @param {Object} seekBarRect\n * The `ClientRect` for the {@link SeekBar} element.\n *\n * @param {number} seekBarPoint\n * A number from 0 to 1, representing a horizontal reference point\n * from the left edge of the {@link SeekBar}\n */\n\n\n _proto.update = function update(seekBarRect, seekBarPoint) {\n var _this2 = this;\n\n var time = seekBarPoint * this.player_.duration();\n this.getChild('timeTooltip').updateTime(seekBarRect, seekBarPoint, time, function () {\n _this2.el_.style.left = seekBarRect.width * seekBarPoint + \"px\";\n });\n };\n\n return MouseTimeDisplay;\n}(Component);\n/**\n * Default options for `MouseTimeDisplay`\n *\n * @type {Object}\n * @private\n */\n\n\nMouseTimeDisplay.prototype.options_ = {\n children: ['timeTooltip']\n};\nComponent.registerComponent('MouseTimeDisplay', MouseTimeDisplay);\n\nvar STEP_SECONDS = 5; // The interval at which the bar should update as it progresses.\n\nvar UPDATE_REFRESH_INTERVAL = 30;\n/**\n * Seek bar and container for the progress bars. Uses {@link PlayProgressBar}\n * as its `bar`.\n *\n * @extends Slider\n */\n\nvar SeekBar =\n/*#__PURE__*/\nfunction (_Slider) {\n _inheritsLoose(SeekBar, _Slider);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function SeekBar(player, options) {\n var _this;\n\n _this = _Slider.call(this, player, options) || this;\n\n _this.setEventHandlers_();\n\n return _this;\n }\n /**\n * Sets the event handlers\n *\n * @private\n */\n\n\n var _proto = SeekBar.prototype;\n\n _proto.setEventHandlers_ = function setEventHandlers_() {\n var _this2 = this;\n\n this.update = throttle(bind(this, this.update), UPDATE_REFRESH_INTERVAL);\n this.on(this.player_, 'timeupdate', this.update);\n this.on(this.player_, 'ended', this.handleEnded);\n this.on(this.player_, 'durationchange', this.update);\n\n if (this.player_.liveTracker) {\n this.on(this.player_.liveTracker, 'liveedgechange', this.update);\n } // when playing, let's ensure we smoothly update the play progress bar\n // via an interval\n\n\n this.updateInterval = null;\n this.on(this.player_, ['playing'], function () {\n _this2.clearInterval(_this2.updateInterval);\n\n _this2.updateInterval = _this2.setInterval(function () {\n _this2.requestAnimationFrame(function () {\n _this2.update();\n });\n }, UPDATE_REFRESH_INTERVAL);\n });\n this.on(this.player_, ['ended', 'pause', 'waiting'], function (e) {\n if (_this2.player_.liveTracker && _this2.player_.liveTracker.isLive() && e.type !== 'ended') {\n return;\n }\n\n _this2.clearInterval(_this2.updateInterval);\n });\n this.on(this.player_, ['timeupdate', 'ended'], this.update);\n };\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n _proto.createEl = function createEl$$1() {\n return _Slider.prototype.createEl.call(this, 'div', {\n className: 'vjs-progress-holder'\n }, {\n 'aria-label': this.localize('Progress Bar')\n });\n };\n /**\n * This function updates the play progress bar and accessibility\n * attributes to whatever is passed in.\n *\n * @param {number} currentTime\n * The currentTime value that should be used for accessibility\n *\n * @param {number} percent\n * The percentage as a decimal that the bar should be filled from 0-1.\n *\n * @private\n */\n\n\n _proto.update_ = function update_(currentTime, percent) {\n var liveTracker = this.player_.liveTracker;\n var duration = this.player_.duration();\n\n if (liveTracker && liveTracker.isLive()) {\n duration = this.player_.liveTracker.liveCurrentTime();\n }\n\n if (liveTracker && liveTracker.seekableEnd() === Infinity) {\n this.disable();\n } else {\n this.enable();\n } // machine readable value of progress bar (percentage complete)\n\n\n this.el_.setAttribute('aria-valuenow', (percent * 100).toFixed(2)); // human readable value of progress bar (time complete)\n\n this.el_.setAttribute('aria-valuetext', this.localize('progress bar timing: currentTime={1} duration={2}', [formatTime(currentTime, duration), formatTime(duration, duration)], '{1} of {2}')); // Update the `PlayProgressBar`.\n\n this.bar.update(getBoundingClientRect(this.el_), percent);\n };\n /**\n * Update the seek bar's UI.\n *\n * @param {EventTarget~Event} [event]\n * The `timeupdate` or `ended` event that caused this to run.\n *\n * @listens Player#timeupdate\n *\n * @return {number}\n * The current percent at a number from 0-1\n */\n\n\n _proto.update = function update(event) {\n var percent = _Slider.prototype.update.call(this);\n\n this.update_(this.getCurrentTime_(), percent);\n return percent;\n };\n /**\n * Get the value of current time but allows for smooth scrubbing,\n * when player can't keep up.\n *\n * @return {number}\n * The current time value to display\n *\n * @private\n */\n\n\n _proto.getCurrentTime_ = function getCurrentTime_() {\n return this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime();\n };\n /**\n * We want the seek bar to be full on ended\n * no matter what the actual internal values are. so we force it.\n *\n * @param {EventTarget~Event} [event]\n * The `timeupdate` or `ended` event that caused this to run.\n *\n * @listens Player#ended\n */\n\n\n _proto.handleEnded = function handleEnded(event) {\n this.update_(this.player_.duration(), 1);\n };\n /**\n * Get the percentage of media played so far.\n *\n * @return {number}\n * The percentage of media played so far (0 to 1).\n */\n\n\n _proto.getPercent = function getPercent() {\n var currentTime = this.getCurrentTime_();\n var percent;\n var liveTracker = this.player_.liveTracker;\n\n if (liveTracker && liveTracker.isLive()) {\n percent = (currentTime - liveTracker.seekableStart()) / liveTracker.liveWindow(); // prevent the percent from changing at the live edge\n\n if (liveTracker.atLiveEdge()) {\n percent = 1;\n }\n } else {\n percent = currentTime / this.player_.duration();\n }\n\n return percent >= 1 ? 1 : percent || 0;\n };\n /**\n * Handle mouse down on seek bar\n *\n * @param {EventTarget~Event} event\n * The `mousedown` event that caused this to run.\n *\n * @listens mousedown\n */\n\n\n _proto.handleMouseDown = function handleMouseDown(event) {\n if (!isSingleLeftClick(event)) {\n return;\n } // Stop event propagation to prevent double fire in progress-control.js\n\n\n event.stopPropagation();\n this.player_.scrubbing(true);\n this.videoWasPlaying = !this.player_.paused();\n this.player_.pause();\n\n _Slider.prototype.handleMouseDown.call(this, event);\n };\n /**\n * Handle mouse move on seek bar\n *\n * @param {EventTarget~Event} event\n * The `mousemove` event that caused this to run.\n *\n * @listens mousemove\n */\n\n\n _proto.handleMouseMove = function handleMouseMove(event) {\n if (!isSingleLeftClick(event)) {\n return;\n }\n\n var newTime;\n var distance = this.calculateDistance(event);\n var liveTracker = this.player_.liveTracker;\n\n if (!liveTracker || !liveTracker.isLive()) {\n newTime = distance * this.player_.duration(); // Don't let video end while scrubbing.\n\n if (newTime === this.player_.duration()) {\n newTime = newTime - 0.1;\n }\n } else {\n var seekableStart = liveTracker.seekableStart();\n var seekableEnd = liveTracker.liveCurrentTime();\n newTime = seekableStart + distance * liveTracker.liveWindow(); // Don't let video end while scrubbing.\n\n if (newTime >= seekableEnd) {\n newTime = seekableEnd;\n } // Compensate for precision differences so that currentTime is not less\n // than seekable start\n\n\n if (newTime <= seekableStart) {\n newTime = seekableStart + 0.1;\n } // On android seekableEnd can be Infinity sometimes,\n // this will cause newTime to be Infinity, which is\n // not a valid currentTime.\n\n\n if (newTime === Infinity) {\n return;\n }\n } // Set new time (tell player to seek to new time)\n\n\n this.player_.currentTime(newTime);\n };\n\n _proto.enable = function enable() {\n _Slider.prototype.enable.call(this);\n\n var mouseTimeDisplay = this.getChild('mouseTimeDisplay');\n\n if (!mouseTimeDisplay) {\n return;\n }\n\n mouseTimeDisplay.show();\n };\n\n _proto.disable = function disable() {\n _Slider.prototype.disable.call(this);\n\n var mouseTimeDisplay = this.getChild('mouseTimeDisplay');\n\n if (!mouseTimeDisplay) {\n return;\n }\n\n mouseTimeDisplay.hide();\n };\n /**\n * Handle mouse up on seek bar\n *\n * @param {EventTarget~Event} event\n * The `mouseup` event that caused this to run.\n *\n * @listens mouseup\n */\n\n\n _proto.handleMouseUp = function handleMouseUp(event) {\n _Slider.prototype.handleMouseUp.call(this, event); // Stop event propagation to prevent double fire in progress-control.js\n\n\n if (event) {\n event.stopPropagation();\n }\n\n this.player_.scrubbing(false);\n /**\n * Trigger timeupdate because we're done seeking and the time has changed.\n * This is particularly useful for if the player is paused to time the time displays.\n *\n * @event Tech#timeupdate\n * @type {EventTarget~Event}\n */\n\n this.player_.trigger({\n type: 'timeupdate',\n target: this,\n manuallyTriggered: true\n });\n\n if (this.videoWasPlaying) {\n silencePromise(this.player_.play());\n }\n };\n /**\n * Move more quickly fast forward for keyboard-only users\n */\n\n\n _proto.stepForward = function stepForward() {\n this.player_.currentTime(this.player_.currentTime() + STEP_SECONDS);\n };\n /**\n * Move more quickly rewind for keyboard-only users\n */\n\n\n _proto.stepBack = function stepBack() {\n this.player_.currentTime(this.player_.currentTime() - STEP_SECONDS);\n };\n /**\n * Toggles the playback state of the player\n * This gets called when enter or space is used on the seekbar\n *\n * @param {EventTarget~Event} event\n * The `keydown` event that caused this function to be called\n *\n */\n\n\n _proto.handleAction = function handleAction(event) {\n if (this.player_.paused()) {\n this.player_.play();\n } else {\n this.player_.pause();\n }\n };\n /**\n * Called when this SeekBar has focus and a key gets pressed down. By\n * default it will call `this.handleAction` when the key is space or enter.\n *\n * @param {EventTarget~Event} event\n * The `keydown` event that caused this function to be called.\n *\n * @listens keydown\n */\n\n\n _proto.handleKeyPress = function handleKeyPress(event) {\n // Support Space (32) or Enter (13) key operation to fire a click event\n if (event.which === 32 || event.which === 13) {\n event.preventDefault();\n this.handleAction(event);\n } else if (_Slider.prototype.handleKeyPress) {\n // Pass keypress handling up for unsupported keys\n _Slider.prototype.handleKeyPress.call(this, event);\n }\n };\n\n return SeekBar;\n}(Slider);\n/**\n * Default options for the `SeekBar`\n *\n * @type {Object}\n * @private\n */\n\n\nSeekBar.prototype.options_ = {\n children: ['loadProgressBar', 'playProgressBar'],\n barName: 'playProgressBar'\n}; // MouseTimeDisplay tooltips should not be added to a player on mobile devices\n\nif (!IS_IOS && !IS_ANDROID) {\n SeekBar.prototype.options_.children.splice(1, 0, 'mouseTimeDisplay');\n}\n/**\n * Call the update event for this Slider when this event happens on the player.\n *\n * @type {string}\n */\n\n\nSeekBar.prototype.playerEvent = 'timeupdate';\nComponent.registerComponent('SeekBar', SeekBar);\n\n/**\n * The Progress Control component contains the seek bar, load progress,\n * and play progress.\n *\n * @extends Component\n */\n\nvar ProgressControl =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(ProgressControl, _Component);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function ProgressControl(player, options) {\n var _this;\n\n _this = _Component.call(this, player, options) || this;\n _this.handleMouseMove = throttle(bind(_assertThisInitialized(_assertThisInitialized(_this)), _this.handleMouseMove), 25);\n _this.throttledHandleMouseSeek = throttle(bind(_assertThisInitialized(_assertThisInitialized(_this)), _this.handleMouseSeek), 25);\n\n _this.enable();\n\n return _this;\n }\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n var _proto = ProgressControl.prototype;\n\n _proto.createEl = function createEl$$1() {\n return _Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-progress-control vjs-control'\n });\n };\n /**\n * When the mouse moves over the `ProgressControl`, the pointer position\n * gets passed down to the `MouseTimeDisplay` component.\n *\n * @param {EventTarget~Event} event\n * The `mousemove` event that caused this function to run.\n *\n * @listen mousemove\n */\n\n\n _proto.handleMouseMove = function handleMouseMove(event) {\n var seekBar = this.getChild('seekBar');\n\n if (seekBar) {\n var mouseTimeDisplay = seekBar.getChild('mouseTimeDisplay');\n var seekBarEl = seekBar.el();\n var seekBarRect = getBoundingClientRect(seekBarEl);\n var seekBarPoint = getPointerPosition(seekBarEl, event).x; // The default skin has a gap on either side of the `SeekBar`. This means\n // that it's possible to trigger this behavior outside the boundaries of\n // the `SeekBar`. This ensures we stay within it at all times.\n\n if (seekBarPoint > 1) {\n seekBarPoint = 1;\n } else if (seekBarPoint < 0) {\n seekBarPoint = 0;\n }\n\n if (mouseTimeDisplay) {\n mouseTimeDisplay.update(seekBarRect, seekBarPoint);\n }\n }\n };\n /**\n * A throttled version of the {@link ProgressControl#handleMouseSeek} listener.\n *\n * @method ProgressControl#throttledHandleMouseSeek\n * @param {EventTarget~Event} event\n * The `mousemove` event that caused this function to run.\n *\n * @listen mousemove\n * @listen touchmove\n */\n\n /**\n * Handle `mousemove` or `touchmove` events on the `ProgressControl`.\n *\n * @param {EventTarget~Event} event\n * `mousedown` or `touchstart` event that triggered this function\n *\n * @listens mousemove\n * @listens touchmove\n */\n\n\n _proto.handleMouseSeek = function handleMouseSeek(event) {\n var seekBar = this.getChild('seekBar');\n\n if (seekBar) {\n seekBar.handleMouseMove(event);\n }\n };\n /**\n * Are controls are currently enabled for this progress control.\n *\n * @return {boolean}\n * true if controls are enabled, false otherwise\n */\n\n\n _proto.enabled = function enabled() {\n return this.enabled_;\n };\n /**\n * Disable all controls on the progress control and its children\n */\n\n\n _proto.disable = function disable() {\n this.children().forEach(function (child) {\n return child.disable && child.disable();\n });\n\n if (!this.enabled()) {\n return;\n }\n\n this.off(['mousedown', 'touchstart'], this.handleMouseDown);\n this.off(this.el_, 'mousemove', this.handleMouseMove);\n this.handleMouseUp();\n this.addClass('disabled');\n this.enabled_ = false;\n };\n /**\n * Enable all controls on the progress control and its children\n */\n\n\n _proto.enable = function enable() {\n this.children().forEach(function (child) {\n return child.enable && child.enable();\n });\n\n if (this.enabled()) {\n return;\n }\n\n this.on(['mousedown', 'touchstart'], this.handleMouseDown);\n this.on(this.el_, 'mousemove', this.handleMouseMove);\n this.removeClass('disabled');\n this.enabled_ = true;\n };\n /**\n * Handle `mousedown` or `touchstart` events on the `ProgressControl`.\n *\n * @param {EventTarget~Event} event\n * `mousedown` or `touchstart` event that triggered this function\n *\n * @listens mousedown\n * @listens touchstart\n */\n\n\n _proto.handleMouseDown = function handleMouseDown(event) {\n var doc = this.el_.ownerDocument;\n var seekBar = this.getChild('seekBar');\n\n if (seekBar) {\n seekBar.handleMouseDown(event);\n }\n\n this.on(doc, 'mousemove', this.throttledHandleMouseSeek);\n this.on(doc, 'touchmove', this.throttledHandleMouseSeek);\n this.on(doc, 'mouseup', this.handleMouseUp);\n this.on(doc, 'touchend', this.handleMouseUp);\n };\n /**\n * Handle `mouseup` or `touchend` events on the `ProgressControl`.\n *\n * @param {EventTarget~Event} event\n * `mouseup` or `touchend` event that triggered this function.\n *\n * @listens touchend\n * @listens mouseup\n */\n\n\n _proto.handleMouseUp = function handleMouseUp(event) {\n var doc = this.el_.ownerDocument;\n var seekBar = this.getChild('seekBar');\n\n if (seekBar) {\n seekBar.handleMouseUp(event);\n }\n\n this.off(doc, 'mousemove', this.throttledHandleMouseSeek);\n this.off(doc, 'touchmove', this.throttledHandleMouseSeek);\n this.off(doc, 'mouseup', this.handleMouseUp);\n this.off(doc, 'touchend', this.handleMouseUp);\n };\n\n return ProgressControl;\n}(Component);\n/**\n * Default options for `ProgressControl`\n *\n * @type {Object}\n * @private\n */\n\n\nProgressControl.prototype.options_ = {\n children: ['seekBar']\n};\nComponent.registerComponent('ProgressControl', ProgressControl);\n\n/**\n * Toggle fullscreen video\n *\n * @extends Button\n */\n\nvar FullscreenToggle =\n/*#__PURE__*/\nfunction (_Button) {\n _inheritsLoose(FullscreenToggle, _Button);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function FullscreenToggle(player, options) {\n var _this;\n\n _this = _Button.call(this, player, options) || this;\n\n _this.on(player, 'fullscreenchange', _this.handleFullscreenChange);\n\n if (document[FullscreenApi.fullscreenEnabled] === false) {\n _this.disable();\n }\n\n return _this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n var _proto = FullscreenToggle.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-fullscreen-control \" + _Button.prototype.buildCSSClass.call(this);\n };\n /**\n * Handles fullscreenchange on the player and change control text accordingly.\n *\n * @param {EventTarget~Event} [event]\n * The {@link Player#fullscreenchange} event that caused this function to be\n * called.\n *\n * @listens Player#fullscreenchange\n */\n\n\n _proto.handleFullscreenChange = function handleFullscreenChange(event) {\n if (this.player_.isFullscreen()) {\n this.controlText('Non-Fullscreen');\n } else {\n this.controlText('Fullscreen');\n }\n };\n /**\n * This gets called when an `FullscreenToggle` is \"clicked\". See\n * {@link ClickableComponent} for more detailed information on what a click can be.\n *\n * @param {EventTarget~Event} [event]\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n\n\n _proto.handleClick = function handleClick(event) {\n if (!this.player_.isFullscreen()) {\n this.player_.requestFullscreen();\n } else {\n this.player_.exitFullscreen();\n }\n };\n\n return FullscreenToggle;\n}(Button);\n/**\n * The text that should display over the `FullscreenToggle`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\n\nFullscreenToggle.prototype.controlText_ = 'Fullscreen';\nComponent.registerComponent('FullscreenToggle', FullscreenToggle);\n\n/**\n * Check if volume control is supported and if it isn't hide the\n * `Component` that was passed using the `vjs-hidden` class.\n *\n * @param {Component} self\n * The component that should be hidden if volume is unsupported\n *\n * @param {Player} player\n * A reference to the player\n *\n * @private\n */\nvar checkVolumeSupport = function checkVolumeSupport(self, player) {\n // hide volume controls when they're not supported by the current tech\n if (player.tech_ && !player.tech_.featuresVolumeControl) {\n self.addClass('vjs-hidden');\n }\n\n self.on(player, 'loadstart', function () {\n if (!player.tech_.featuresVolumeControl) {\n self.addClass('vjs-hidden');\n } else {\n self.removeClass('vjs-hidden');\n }\n });\n};\n\n/**\n * Shows volume level\n *\n * @extends Component\n */\n\nvar VolumeLevel =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(VolumeLevel, _Component);\n\n function VolumeLevel() {\n return _Component.apply(this, arguments) || this;\n }\n\n var _proto = VolumeLevel.prototype;\n\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n _proto.createEl = function createEl() {\n return _Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-volume-level',\n innerHTML: '<span class=\"vjs-control-text\"></span>'\n });\n };\n\n return VolumeLevel;\n}(Component);\n\nComponent.registerComponent('VolumeLevel', VolumeLevel);\n\n/**\n * The bar that contains the volume level and can be clicked on to adjust the level\n *\n * @extends Slider\n */\n\nvar VolumeBar =\n/*#__PURE__*/\nfunction (_Slider) {\n _inheritsLoose(VolumeBar, _Slider);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function VolumeBar(player, options) {\n var _this;\n\n _this = _Slider.call(this, player, options) || this;\n\n _this.on('slideractive', _this.updateLastVolume_);\n\n _this.on(player, 'volumechange', _this.updateARIAAttributes);\n\n player.ready(function () {\n return _this.updateARIAAttributes();\n });\n return _this;\n }\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n var _proto = VolumeBar.prototype;\n\n _proto.createEl = function createEl$$1() {\n return _Slider.prototype.createEl.call(this, 'div', {\n className: 'vjs-volume-bar vjs-slider-bar'\n }, {\n 'aria-label': this.localize('Volume Level'),\n 'aria-live': 'polite'\n });\n };\n /**\n * Handle mouse down on volume bar\n *\n * @param {EventTarget~Event} event\n * The `mousedown` event that caused this to run.\n *\n * @listens mousedown\n */\n\n\n _proto.handleMouseDown = function handleMouseDown(event) {\n if (!isSingleLeftClick(event)) {\n return;\n }\n\n _Slider.prototype.handleMouseDown.call(this, event);\n };\n /**\n * Handle movement events on the {@link VolumeMenuButton}.\n *\n * @param {EventTarget~Event} event\n * The event that caused this function to run.\n *\n * @listens mousemove\n */\n\n\n _proto.handleMouseMove = function handleMouseMove(event) {\n if (!isSingleLeftClick(event)) {\n return;\n }\n\n this.checkMuted();\n this.player_.volume(this.calculateDistance(event));\n };\n /**\n * If the player is muted unmute it.\n */\n\n\n _proto.checkMuted = function checkMuted() {\n if (this.player_.muted()) {\n this.player_.muted(false);\n }\n };\n /**\n * Get percent of volume level\n *\n * @return {number}\n * Volume level percent as a decimal number.\n */\n\n\n _proto.getPercent = function getPercent() {\n if (this.player_.muted()) {\n return 0;\n }\n\n return this.player_.volume();\n };\n /**\n * Increase volume level for keyboard users\n */\n\n\n _proto.stepForward = function stepForward() {\n this.checkMuted();\n this.player_.volume(this.player_.volume() + 0.1);\n };\n /**\n * Decrease volume level for keyboard users\n */\n\n\n _proto.stepBack = function stepBack() {\n this.checkMuted();\n this.player_.volume(this.player_.volume() - 0.1);\n };\n /**\n * Update ARIA accessibility attributes\n *\n * @param {EventTarget~Event} [event]\n * The `volumechange` event that caused this function to run.\n *\n * @listens Player#volumechange\n */\n\n\n _proto.updateARIAAttributes = function updateARIAAttributes(event) {\n var ariaValue = this.player_.muted() ? 0 : this.volumeAsPercentage_();\n this.el_.setAttribute('aria-valuenow', ariaValue);\n this.el_.setAttribute('aria-valuetext', ariaValue + '%');\n };\n /**\n * Returns the current value of the player volume as a percentage\n *\n * @private\n */\n\n\n _proto.volumeAsPercentage_ = function volumeAsPercentage_() {\n return Math.round(this.player_.volume() * 100);\n };\n /**\n * When user starts dragging the VolumeBar, store the volume and listen for\n * the end of the drag. When the drag ends, if the volume was set to zero,\n * set lastVolume to the stored volume.\n *\n * @listens slideractive\n * @private\n */\n\n\n _proto.updateLastVolume_ = function updateLastVolume_() {\n var _this2 = this;\n\n var volumeBeforeDrag = this.player_.volume();\n this.one('sliderinactive', function () {\n if (_this2.player_.volume() === 0) {\n _this2.player_.lastVolume_(volumeBeforeDrag);\n }\n });\n };\n\n return VolumeBar;\n}(Slider);\n/**\n * Default options for the `VolumeBar`\n *\n * @type {Object}\n * @private\n */\n\n\nVolumeBar.prototype.options_ = {\n children: ['volumeLevel'],\n barName: 'volumeLevel'\n};\n/**\n * Call the update event for this Slider when this event happens on the player.\n *\n * @type {string}\n */\n\nVolumeBar.prototype.playerEvent = 'volumechange';\nComponent.registerComponent('VolumeBar', VolumeBar);\n\n/**\n * The component for controlling the volume level\n *\n * @extends Component\n */\n\nvar VolumeControl =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(VolumeControl, _Component);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options={}]\n * The key/value store of player options.\n */\n function VolumeControl(player, options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n options.vertical = options.vertical || false; // Pass the vertical option down to the VolumeBar if\n // the VolumeBar is turned on.\n\n if (typeof options.volumeBar === 'undefined' || isPlain(options.volumeBar)) {\n options.volumeBar = options.volumeBar || {};\n options.volumeBar.vertical = options.vertical;\n }\n\n _this = _Component.call(this, player, options) || this; // hide this control if volume support is missing\n\n checkVolumeSupport(_assertThisInitialized(_assertThisInitialized(_this)), player);\n _this.throttledHandleMouseMove = throttle(bind(_assertThisInitialized(_assertThisInitialized(_this)), _this.handleMouseMove), 25);\n\n _this.on('mousedown', _this.handleMouseDown);\n\n _this.on('touchstart', _this.handleMouseDown); // while the slider is active (the mouse has been pressed down and\n // is dragging) or in focus we do not want to hide the VolumeBar\n\n\n _this.on(_this.volumeBar, ['focus', 'slideractive'], function () {\n _this.volumeBar.addClass('vjs-slider-active');\n\n _this.addClass('vjs-slider-active');\n\n _this.trigger('slideractive');\n });\n\n _this.on(_this.volumeBar, ['blur', 'sliderinactive'], function () {\n _this.volumeBar.removeClass('vjs-slider-active');\n\n _this.removeClass('vjs-slider-active');\n\n _this.trigger('sliderinactive');\n });\n\n return _this;\n }\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n var _proto = VolumeControl.prototype;\n\n _proto.createEl = function createEl() {\n var orientationClass = 'vjs-volume-horizontal';\n\n if (this.options_.vertical) {\n orientationClass = 'vjs-volume-vertical';\n }\n\n return _Component.prototype.createEl.call(this, 'div', {\n className: \"vjs-volume-control vjs-control \" + orientationClass\n });\n };\n /**\n * Handle `mousedown` or `touchstart` events on the `VolumeControl`.\n *\n * @param {EventTarget~Event} event\n * `mousedown` or `touchstart` event that triggered this function\n *\n * @listens mousedown\n * @listens touchstart\n */\n\n\n _proto.handleMouseDown = function handleMouseDown(event) {\n var doc = this.el_.ownerDocument;\n this.on(doc, 'mousemove', this.throttledHandleMouseMove);\n this.on(doc, 'touchmove', this.throttledHandleMouseMove);\n this.on(doc, 'mouseup', this.handleMouseUp);\n this.on(doc, 'touchend', this.handleMouseUp);\n };\n /**\n * Handle `mouseup` or `touchend` events on the `VolumeControl`.\n *\n * @param {EventTarget~Event} event\n * `mouseup` or `touchend` event that triggered this function.\n *\n * @listens touchend\n * @listens mouseup\n */\n\n\n _proto.handleMouseUp = function handleMouseUp(event) {\n var doc = this.el_.ownerDocument;\n this.off(doc, 'mousemove', this.throttledHandleMouseMove);\n this.off(doc, 'touchmove', this.throttledHandleMouseMove);\n this.off(doc, 'mouseup', this.handleMouseUp);\n this.off(doc, 'touchend', this.handleMouseUp);\n };\n /**\n * Handle `mousedown` or `touchstart` events on the `VolumeControl`.\n *\n * @param {EventTarget~Event} event\n * `mousedown` or `touchstart` event that triggered this function\n *\n * @listens mousedown\n * @listens touchstart\n */\n\n\n _proto.handleMouseMove = function handleMouseMove(event) {\n this.volumeBar.handleMouseMove(event);\n };\n\n return VolumeControl;\n}(Component);\n/**\n * Default options for the `VolumeControl`\n *\n * @type {Object}\n * @private\n */\n\n\nVolumeControl.prototype.options_ = {\n children: ['volumeBar']\n};\nComponent.registerComponent('VolumeControl', VolumeControl);\n\n/**\n * Check if muting volume is supported and if it isn't hide the mute toggle\n * button.\n *\n * @param {Component} self\n * A reference to the mute toggle button\n *\n * @param {Player} player\n * A reference to the player\n *\n * @private\n */\nvar checkMuteSupport = function checkMuteSupport(self, player) {\n // hide mute toggle button if it's not supported by the current tech\n if (player.tech_ && !player.tech_.featuresMuteControl) {\n self.addClass('vjs-hidden');\n }\n\n self.on(player, 'loadstart', function () {\n if (!player.tech_.featuresMuteControl) {\n self.addClass('vjs-hidden');\n } else {\n self.removeClass('vjs-hidden');\n }\n });\n};\n\n/**\n * A button component for muting the audio.\n *\n * @extends Button\n */\n\nvar MuteToggle =\n/*#__PURE__*/\nfunction (_Button) {\n _inheritsLoose(MuteToggle, _Button);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function MuteToggle(player, options) {\n var _this;\n\n _this = _Button.call(this, player, options) || this; // hide this control if volume support is missing\n\n checkMuteSupport(_assertThisInitialized(_assertThisInitialized(_this)), player);\n\n _this.on(player, ['loadstart', 'volumechange'], _this.update);\n\n return _this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n var _proto = MuteToggle.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-mute-control \" + _Button.prototype.buildCSSClass.call(this);\n };\n /**\n * This gets called when an `MuteToggle` is \"clicked\". See\n * {@link ClickableComponent} for more detailed information on what a click can be.\n *\n * @param {EventTarget~Event} [event]\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n\n\n _proto.handleClick = function handleClick(event) {\n var vol = this.player_.volume();\n var lastVolume = this.player_.lastVolume_();\n\n if (vol === 0) {\n var volumeToSet = lastVolume < 0.1 ? 0.1 : lastVolume;\n this.player_.volume(volumeToSet);\n this.player_.muted(false);\n } else {\n this.player_.muted(this.player_.muted() ? false : true);\n }\n };\n /**\n * Update the `MuteToggle` button based on the state of `volume` and `muted`\n * on the player.\n *\n * @param {EventTarget~Event} [event]\n * The {@link Player#loadstart} event if this function was called\n * through an event.\n *\n * @listens Player#loadstart\n * @listens Player#volumechange\n */\n\n\n _proto.update = function update(event) {\n this.updateIcon_();\n this.updateControlText_();\n };\n /**\n * Update the appearance of the `MuteToggle` icon.\n *\n * Possible states (given `level` variable below):\n * - 0: crossed out\n * - 1: zero bars of volume\n * - 2: one bar of volume\n * - 3: two bars of volume\n *\n * @private\n */\n\n\n _proto.updateIcon_ = function updateIcon_() {\n var vol = this.player_.volume();\n var level = 3; // in iOS when a player is loaded with muted attribute\n // and volume is changed with a native mute button\n // we want to make sure muted state is updated\n\n if (IS_IOS) {\n this.player_.muted(this.player_.tech_.el_.muted);\n }\n\n if (vol === 0 || this.player_.muted()) {\n level = 0;\n } else if (vol < 0.33) {\n level = 1;\n } else if (vol < 0.67) {\n level = 2;\n } // TODO improve muted icon classes\n\n\n for (var i = 0; i < 4; i++) {\n removeClass(this.el_, \"vjs-vol-\" + i);\n }\n\n addClass(this.el_, \"vjs-vol-\" + level);\n };\n /**\n * If `muted` has changed on the player, update the control text\n * (`title` attribute on `vjs-mute-control` element and content of\n * `vjs-control-text` element).\n *\n * @private\n */\n\n\n _proto.updateControlText_ = function updateControlText_() {\n var soundOff = this.player_.muted() || this.player_.volume() === 0;\n var text = soundOff ? 'Unmute' : 'Mute';\n\n if (this.controlText() !== text) {\n this.controlText(text);\n }\n };\n\n return MuteToggle;\n}(Button);\n/**\n * The text that should display over the `MuteToggle`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\n\nMuteToggle.prototype.controlText_ = 'Mute';\nComponent.registerComponent('MuteToggle', MuteToggle);\n\n/**\n * A Component to contain the MuteToggle and VolumeControl so that\n * they can work together.\n *\n * @extends Component\n */\n\nvar VolumePanel =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(VolumePanel, _Component);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options={}]\n * The key/value store of player options.\n */\n function VolumePanel(player, options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n if (typeof options.inline !== 'undefined') {\n options.inline = options.inline;\n } else {\n options.inline = true;\n } // pass the inline option down to the VolumeControl as vertical if\n // the VolumeControl is on.\n\n\n if (typeof options.volumeControl === 'undefined' || isPlain(options.volumeControl)) {\n options.volumeControl = options.volumeControl || {};\n options.volumeControl.vertical = !options.inline;\n }\n\n _this = _Component.call(this, player, options) || this;\n\n _this.on(player, ['loadstart'], _this.volumePanelState_); // while the slider is active (the mouse has been pressed down and\n // is dragging) we do not want to hide the VolumeBar\n\n\n _this.on(_this.volumeControl, ['slideractive'], _this.sliderActive_);\n\n _this.on(_this.volumeControl, ['sliderinactive'], _this.sliderInactive_);\n\n return _this;\n }\n /**\n * Add vjs-slider-active class to the VolumePanel\n *\n * @listens VolumeControl#slideractive\n * @private\n */\n\n\n var _proto = VolumePanel.prototype;\n\n _proto.sliderActive_ = function sliderActive_() {\n this.addClass('vjs-slider-active');\n };\n /**\n * Removes vjs-slider-active class to the VolumePanel\n *\n * @listens VolumeControl#sliderinactive\n * @private\n */\n\n\n _proto.sliderInactive_ = function sliderInactive_() {\n this.removeClass('vjs-slider-active');\n };\n /**\n * Adds vjs-hidden or vjs-mute-toggle-only to the VolumePanel\n * depending on MuteToggle and VolumeControl state\n *\n * @listens Player#loadstart\n * @private\n */\n\n\n _proto.volumePanelState_ = function volumePanelState_() {\n // hide volume panel if neither volume control or mute toggle\n // are displayed\n if (this.volumeControl.hasClass('vjs-hidden') && this.muteToggle.hasClass('vjs-hidden')) {\n this.addClass('vjs-hidden');\n } // if only mute toggle is visible we don't want\n // volume panel expanding when hovered or active\n\n\n if (this.volumeControl.hasClass('vjs-hidden') && !this.muteToggle.hasClass('vjs-hidden')) {\n this.addClass('vjs-mute-toggle-only');\n }\n };\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n _proto.createEl = function createEl() {\n var orientationClass = 'vjs-volume-panel-horizontal';\n\n if (!this.options_.inline) {\n orientationClass = 'vjs-volume-panel-vertical';\n }\n\n return _Component.prototype.createEl.call(this, 'div', {\n className: \"vjs-volume-panel vjs-control \" + orientationClass\n });\n };\n\n return VolumePanel;\n}(Component);\n/**\n * Default options for the `VolumeControl`\n *\n * @type {Object}\n * @private\n */\n\n\nVolumePanel.prototype.options_ = {\n children: ['muteToggle', 'volumeControl']\n};\nComponent.registerComponent('VolumePanel', VolumePanel);\n\n/**\n * The Menu component is used to build popup menus, including subtitle and\n * captions selection menus.\n *\n * @extends Component\n */\n\nvar Menu =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(Menu, _Component);\n\n /**\n * Create an instance of this class.\n *\n * @param {Player} player\n * the player that this component should attach to\n *\n * @param {Object} [options]\n * Object of option names and values\n *\n */\n function Menu(player, options) {\n var _this;\n\n _this = _Component.call(this, player, options) || this;\n\n if (options) {\n _this.menuButton_ = options.menuButton;\n }\n\n _this.focusedChild_ = -1;\n\n _this.on('keydown', _this.handleKeyPress);\n\n return _this;\n }\n /**\n * Add a {@link MenuItem} to the menu.\n *\n * @param {Object|string} component\n * The name or instance of the `MenuItem` to add.\n *\n */\n\n\n var _proto = Menu.prototype;\n\n _proto.addItem = function addItem(component) {\n this.addChild(component);\n component.on('blur', bind(this, this.handleBlur));\n component.on(['tap', 'click'], bind(this, function (event) {\n // Unpress the associated MenuButton, and move focus back to it\n if (this.menuButton_) {\n this.menuButton_.unpressButton(); // don't focus menu button if item is a caption settings item\n // because focus will move elsewhere\n\n if (component.name() !== 'CaptionSettingsMenuItem') {\n this.menuButton_.focus();\n }\n }\n }));\n };\n /**\n * Create the `Menu`s DOM element.\n *\n * @return {Element}\n * the element that was created\n */\n\n\n _proto.createEl = function createEl$$1() {\n var contentElType = this.options_.contentElType || 'ul';\n this.contentEl_ = createEl(contentElType, {\n className: 'vjs-menu-content'\n });\n this.contentEl_.setAttribute('role', 'menu');\n\n var el = _Component.prototype.createEl.call(this, 'div', {\n append: this.contentEl_,\n className: 'vjs-menu'\n });\n\n el.appendChild(this.contentEl_); // Prevent clicks from bubbling up. Needed for Menu Buttons,\n // where a click on the parent is significant\n\n on(el, 'click', function (event) {\n event.preventDefault();\n event.stopImmediatePropagation();\n });\n return el;\n };\n\n _proto.dispose = function dispose() {\n this.contentEl_ = null;\n\n _Component.prototype.dispose.call(this);\n };\n /**\n * Called when a `MenuItem` loses focus.\n *\n * @param {EventTarget~Event} event\n * The `blur` event that caused this function to be called.\n *\n * @listens blur\n */\n\n\n _proto.handleBlur = function handleBlur(event) {\n var relatedTarget = event.relatedTarget || document.activeElement; // Close menu popup when a user clicks outside the menu\n\n if (!this.children().some(function (element) {\n return element.el() === relatedTarget;\n })) {\n var btn = this.menuButton_;\n\n if (btn && btn.buttonPressed_ && relatedTarget !== btn.el().firstChild) {\n btn.unpressButton();\n }\n }\n };\n /**\n * Handle a `keydown` event on this menu. This listener is added in the constructor.\n *\n * @param {EventTarget~Event} event\n * A `keydown` event that happened on the menu.\n *\n * @listens keydown\n */\n\n\n _proto.handleKeyPress = function handleKeyPress(event) {\n // Left and Down Arrows\n if (event.which === 37 || event.which === 40) {\n event.preventDefault();\n this.stepForward(); // Up and Right Arrows\n } else if (event.which === 38 || event.which === 39) {\n event.preventDefault();\n this.stepBack();\n }\n };\n /**\n * Move to next (lower) menu item for keyboard users.\n */\n\n\n _proto.stepForward = function stepForward() {\n var stepChild = 0;\n\n if (this.focusedChild_ !== undefined) {\n stepChild = this.focusedChild_ + 1;\n }\n\n this.focus(stepChild);\n };\n /**\n * Move to previous (higher) menu item for keyboard users.\n */\n\n\n _proto.stepBack = function stepBack() {\n var stepChild = 0;\n\n if (this.focusedChild_ !== undefined) {\n stepChild = this.focusedChild_ - 1;\n }\n\n this.focus(stepChild);\n };\n /**\n * Set focus on a {@link MenuItem} in the `Menu`.\n *\n * @param {Object|string} [item=0]\n * Index of child item set focus on.\n */\n\n\n _proto.focus = function focus(item) {\n if (item === void 0) {\n item = 0;\n }\n\n var children = this.children().slice();\n var haveTitle = children.length && children[0].className && /vjs-menu-title/.test(children[0].className);\n\n if (haveTitle) {\n children.shift();\n }\n\n if (children.length > 0) {\n if (item < 0) {\n item = 0;\n } else if (item >= children.length) {\n item = children.length - 1;\n }\n\n this.focusedChild_ = item;\n children[item].el_.focus();\n }\n };\n\n return Menu;\n}(Component);\n\nComponent.registerComponent('Menu', Menu);\n\n/**\n * A `MenuButton` class for any popup {@link Menu}.\n *\n * @extends Component\n */\n\nvar MenuButton =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(MenuButton, _Component);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options={}]\n * The key/value store of player options.\n */\n function MenuButton(player, options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n _this = _Component.call(this, player, options) || this;\n _this.menuButton_ = new Button(player, options);\n\n _this.menuButton_.controlText(_this.controlText_);\n\n _this.menuButton_.el_.setAttribute('aria-haspopup', 'true'); // Add buildCSSClass values to the button, not the wrapper\n\n\n var buttonClass = Button.prototype.buildCSSClass();\n _this.menuButton_.el_.className = _this.buildCSSClass() + ' ' + buttonClass;\n\n _this.menuButton_.removeClass('vjs-control');\n\n _this.addChild(_this.menuButton_);\n\n _this.update();\n\n _this.enabled_ = true;\n\n _this.on(_this.menuButton_, 'tap', _this.handleClick);\n\n _this.on(_this.menuButton_, 'click', _this.handleClick);\n\n _this.on(_this.menuButton_, 'focus', _this.handleFocus);\n\n _this.on(_this.menuButton_, 'blur', _this.handleBlur);\n\n _this.on(_this.menuButton_, 'mouseenter', function () {\n _this.menu.show();\n });\n\n _this.on('keydown', _this.handleSubmenuKeyPress);\n\n return _this;\n }\n /**\n * Update the menu based on the current state of its items.\n */\n\n\n var _proto = MenuButton.prototype;\n\n _proto.update = function update() {\n var menu = this.createMenu();\n\n if (this.menu) {\n this.menu.dispose();\n this.removeChild(this.menu);\n }\n\n this.menu = menu;\n this.addChild(menu);\n /**\n * Track the state of the menu button\n *\n * @type {Boolean}\n * @private\n */\n\n this.buttonPressed_ = false;\n this.menuButton_.el_.setAttribute('aria-expanded', 'false');\n\n if (this.items && this.items.length <= this.hideThreshold_) {\n this.hide();\n } else {\n this.show();\n }\n };\n /**\n * Create the menu and add all items to it.\n *\n * @return {Menu}\n * The constructed menu\n */\n\n\n _proto.createMenu = function createMenu() {\n var menu = new Menu(this.player_, {\n menuButton: this\n });\n /**\n * Hide the menu if the number of items is less than or equal to this threshold. This defaults\n * to 0 and whenever we add items which can be hidden to the menu we'll increment it. We list\n * it here because every time we run `createMenu` we need to reset the value.\n *\n * @protected\n * @type {Number}\n */\n\n this.hideThreshold_ = 0; // Add a title list item to the top\n\n if (this.options_.title) {\n var title = createEl('li', {\n className: 'vjs-menu-title',\n innerHTML: toTitleCase(this.options_.title),\n tabIndex: -1\n });\n this.hideThreshold_ += 1;\n menu.children_.unshift(title);\n prependTo(title, menu.contentEl());\n }\n\n this.items = this.createItems();\n\n if (this.items) {\n // Add menu items to the menu\n for (var i = 0; i < this.items.length; i++) {\n menu.addItem(this.items[i]);\n }\n }\n\n return menu;\n };\n /**\n * Create the list of menu items. Specific to each subclass.\n *\n * @abstract\n */\n\n\n _proto.createItems = function createItems() {};\n /**\n * Create the `MenuButtons`s DOM element.\n *\n * @return {Element}\n * The element that gets created.\n */\n\n\n _proto.createEl = function createEl$$1() {\n return _Component.prototype.createEl.call(this, 'div', {\n className: this.buildWrapperCSSClass()\n }, {});\n };\n /**\n * Allow sub components to stack CSS class names for the wrapper element\n *\n * @return {string}\n * The constructed wrapper DOM `className`\n */\n\n\n _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {\n var menuButtonClass = 'vjs-menu-button'; // If the inline option is passed, we want to use different styles altogether.\n\n if (this.options_.inline === true) {\n menuButtonClass += '-inline';\n } else {\n menuButtonClass += '-popup';\n } // TODO: Fix the CSS so that this isn't necessary\n\n\n var buttonClass = Button.prototype.buildCSSClass();\n return \"vjs-menu-button \" + menuButtonClass + \" \" + buttonClass + \" \" + _Component.prototype.buildCSSClass.call(this);\n };\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n _proto.buildCSSClass = function buildCSSClass() {\n var menuButtonClass = 'vjs-menu-button'; // If the inline option is passed, we want to use different styles altogether.\n\n if (this.options_.inline === true) {\n menuButtonClass += '-inline';\n } else {\n menuButtonClass += '-popup';\n }\n\n return \"vjs-menu-button \" + menuButtonClass + \" \" + _Component.prototype.buildCSSClass.call(this);\n };\n /**\n * Get or set the localized control text that will be used for accessibility.\n *\n * > NOTE: This will come from the internal `menuButton_` element.\n *\n * @param {string} [text]\n * Control text for element.\n *\n * @param {Element} [el=this.menuButton_.el()]\n * Element to set the title on.\n *\n * @return {string}\n * - The control text when getting\n */\n\n\n _proto.controlText = function controlText(text, el) {\n if (el === void 0) {\n el = this.menuButton_.el();\n }\n\n return this.menuButton_.controlText(text, el);\n };\n /**\n * Handle a click on a `MenuButton`.\n * See {@link ClickableComponent#handleClick} for instances where this is called.\n *\n * @param {EventTarget~Event} event\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n\n\n _proto.handleClick = function handleClick(event) {\n if (this.buttonPressed_) {\n this.unpressButton();\n } else {\n this.pressButton();\n }\n };\n /**\n * Set the focus to the actual button, not to this element\n */\n\n\n _proto.focus = function focus() {\n this.menuButton_.focus();\n };\n /**\n * Remove the focus from the actual button, not this element\n */\n\n\n _proto.blur = function blur() {\n this.menuButton_.blur();\n };\n /**\n * This gets called when a `MenuButton` gains focus via a `focus` event.\n * Turns on listening for `keydown` events. When they happen it\n * calls `this.handleKeyPress`.\n *\n * @param {EventTarget~Event} event\n * The `focus` event that caused this function to be called.\n *\n * @listens focus\n */\n\n\n _proto.handleFocus = function handleFocus() {\n on(document, 'keydown', bind(this, this.handleKeyPress));\n };\n /**\n * Called when a `MenuButton` loses focus. Turns off the listener for\n * `keydown` events. Which Stops `this.handleKeyPress` from getting called.\n *\n * @param {EventTarget~Event} event\n * The `blur` event that caused this function to be called.\n *\n * @listens blur\n */\n\n\n _proto.handleBlur = function handleBlur() {\n off(document, 'keydown', bind(this, this.handleKeyPress));\n };\n /**\n * Handle tab, escape, down arrow, and up arrow keys for `MenuButton`. See\n * {@link ClickableComponent#handleKeyPress} for instances where this is called.\n *\n * @param {EventTarget~Event} event\n * The `keydown` event that caused this function to be called.\n *\n * @listens keydown\n */\n\n\n _proto.handleKeyPress = function handleKeyPress(event) {\n // Escape (27) key or Tab (9) key unpress the 'button'\n if (event.which === 27 || event.which === 9) {\n if (this.buttonPressed_) {\n this.unpressButton();\n } // Don't preventDefault for Tab key - we still want to lose focus\n\n\n if (event.which !== 9) {\n event.preventDefault(); // Set focus back to the menu button's button\n\n this.menuButton_.el_.focus();\n } // Enter (13) or Up (38) key or Down (40) key press the 'button'\n\n } else if (event.which === 13 || event.which === 38 || event.which === 40) {\n if (!this.buttonPressed_) {\n this.pressButton();\n event.preventDefault();\n }\n }\n };\n /**\n * Handle a `keydown` event on a sub-menu. The listener for this is added in\n * the constructor.\n *\n * @param {EventTarget~Event} event\n * Key press event\n *\n * @listens keydown\n */\n\n\n _proto.handleSubmenuKeyPress = function handleSubmenuKeyPress(event) {\n // Escape (27) key or Tab (9) key unpress the 'button'\n if (event.which === 27 || event.which === 9) {\n if (this.buttonPressed_) {\n this.unpressButton();\n } // Don't preventDefault for Tab key - we still want to lose focus\n\n\n if (event.which !== 9) {\n event.preventDefault(); // Set focus back to the menu button's button\n\n this.menuButton_.el_.focus();\n }\n }\n };\n /**\n * Put the current `MenuButton` into a pressed state.\n */\n\n\n _proto.pressButton = function pressButton() {\n if (this.enabled_) {\n this.buttonPressed_ = true;\n this.menu.show();\n this.menu.lockShowing();\n this.menuButton_.el_.setAttribute('aria-expanded', 'true'); // set the focus into the submenu, except on iOS where it is resulting in\n // undesired scrolling behavior when the player is in an iframe\n\n if (IS_IOS && isInFrame()) {\n // Return early so that the menu isn't focused\n return;\n }\n\n this.menu.focus();\n }\n };\n /**\n * Take the current `MenuButton` out of a pressed state.\n */\n\n\n _proto.unpressButton = function unpressButton() {\n if (this.enabled_) {\n this.buttonPressed_ = false;\n this.menu.unlockShowing();\n this.menu.hide();\n this.menuButton_.el_.setAttribute('aria-expanded', 'false');\n }\n };\n /**\n * Disable the `MenuButton`. Don't allow it to be clicked.\n */\n\n\n _proto.disable = function disable() {\n this.unpressButton();\n this.enabled_ = false;\n this.addClass('vjs-disabled');\n this.menuButton_.disable();\n };\n /**\n * Enable the `MenuButton`. Allow it to be clicked.\n */\n\n\n _proto.enable = function enable() {\n this.enabled_ = true;\n this.removeClass('vjs-disabled');\n this.menuButton_.enable();\n };\n\n return MenuButton;\n}(Component);\n\nComponent.registerComponent('MenuButton', MenuButton);\n\n/**\n * The base class for buttons that toggle specific track types (e.g. subtitles).\n *\n * @extends MenuButton\n */\n\nvar TrackButton =\n/*#__PURE__*/\nfunction (_MenuButton) {\n _inheritsLoose(TrackButton, _MenuButton);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function TrackButton(player, options) {\n var _this;\n\n var tracks = options.tracks;\n _this = _MenuButton.call(this, player, options) || this;\n\n if (_this.items.length <= 1) {\n _this.hide();\n }\n\n if (!tracks) {\n return _assertThisInitialized(_this);\n }\n\n var updateHandler = bind(_assertThisInitialized(_assertThisInitialized(_this)), _this.update);\n tracks.addEventListener('removetrack', updateHandler);\n tracks.addEventListener('addtrack', updateHandler);\n\n _this.player_.on('ready', updateHandler);\n\n _this.player_.on('dispose', function () {\n tracks.removeEventListener('removetrack', updateHandler);\n tracks.removeEventListener('addtrack', updateHandler);\n });\n\n return _this;\n }\n\n return TrackButton;\n}(MenuButton);\n\nComponent.registerComponent('TrackButton', TrackButton);\n\n/**\n * The component for a menu item. `<li>`\n *\n * @extends ClickableComponent\n */\n\nvar MenuItem =\n/*#__PURE__*/\nfunction (_ClickableComponent) {\n _inheritsLoose(MenuItem, _ClickableComponent);\n\n /**\n * Creates an instance of the this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options={}]\n * The key/value store of player options.\n *\n */\n function MenuItem(player, options) {\n var _this;\n\n _this = _ClickableComponent.call(this, player, options) || this;\n _this.selectable = options.selectable;\n _this.isSelected_ = options.selected || false;\n _this.multiSelectable = options.multiSelectable;\n\n _this.selected(_this.isSelected_);\n\n if (_this.selectable) {\n if (_this.multiSelectable) {\n _this.el_.setAttribute('role', 'menuitemcheckbox');\n } else {\n _this.el_.setAttribute('role', 'menuitemradio');\n }\n } else {\n _this.el_.setAttribute('role', 'menuitem');\n }\n\n return _this;\n }\n /**\n * Create the `MenuItem's DOM element\n *\n * @param {string} [type=li]\n * Element's node type, not actually used, always set to `li`.\n *\n * @param {Object} [props={}]\n * An object of properties that should be set on the element\n *\n * @param {Object} [attrs={}]\n * An object of attributes that should be set on the element\n *\n * @return {Element}\n * The element that gets created.\n */\n\n\n var _proto = MenuItem.prototype;\n\n _proto.createEl = function createEl(type, props, attrs) {\n // The control is textual, not just an icon\n this.nonIconControl = true;\n return _ClickableComponent.prototype.createEl.call(this, 'li', assign({\n className: 'vjs-menu-item',\n innerHTML: \"<span class=\\\"vjs-menu-item-text\\\">\" + this.localize(this.options_.label) + \"</span>\",\n tabIndex: -1\n }, props), attrs);\n };\n /**\n * Any click on a `MenuItem` puts it into the selected state.\n * See {@link ClickableComponent#handleClick} for instances where this is called.\n *\n * @param {EventTarget~Event} event\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n\n\n _proto.handleClick = function handleClick(event) {\n this.selected(true);\n };\n /**\n * Set the state for this menu item as selected or not.\n *\n * @param {boolean} selected\n * if the menu item is selected or not\n */\n\n\n _proto.selected = function selected(_selected) {\n if (this.selectable) {\n if (_selected) {\n this.addClass('vjs-selected');\n this.el_.setAttribute('aria-checked', 'true'); // aria-checked isn't fully supported by browsers/screen readers,\n // so indicate selected state to screen reader in the control text.\n\n this.controlText(', selected');\n this.isSelected_ = true;\n } else {\n this.removeClass('vjs-selected');\n this.el_.setAttribute('aria-checked', 'false'); // Indicate un-selected state to screen reader\n\n this.controlText('');\n this.isSelected_ = false;\n }\n }\n };\n\n return MenuItem;\n}(ClickableComponent);\n\nComponent.registerComponent('MenuItem', MenuItem);\n\n/**\n * The specific menu item type for selecting a language within a text track kind\n *\n * @extends MenuItem\n */\n\nvar TextTrackMenuItem =\n/*#__PURE__*/\nfunction (_MenuItem) {\n _inheritsLoose(TextTrackMenuItem, _MenuItem);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function TextTrackMenuItem(player, options) {\n var _this;\n\n var track = options.track;\n var tracks = player.textTracks(); // Modify options for parent MenuItem class's init.\n\n options.label = track.label || track.language || 'Unknown';\n options.selected = track.mode === 'showing';\n _this = _MenuItem.call(this, player, options) || this;\n _this.track = track;\n\n var changeHandler = function changeHandler() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this.handleTracksChange.apply(_assertThisInitialized(_assertThisInitialized(_this)), args);\n };\n\n var selectedLanguageChangeHandler = function selectedLanguageChangeHandler() {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n _this.handleSelectedLanguageChange.apply(_assertThisInitialized(_assertThisInitialized(_this)), args);\n };\n\n player.on(['loadstart', 'texttrackchange'], changeHandler);\n tracks.addEventListener('change', changeHandler);\n tracks.addEventListener('selectedlanguagechange', selectedLanguageChangeHandler);\n\n _this.on('dispose', function () {\n player.off(['loadstart', 'texttrackchange'], changeHandler);\n tracks.removeEventListener('change', changeHandler);\n tracks.removeEventListener('selectedlanguagechange', selectedLanguageChangeHandler);\n }); // iOS7 doesn't dispatch change events to TextTrackLists when an\n // associated track's mode changes. Without something like\n // Object.observe() (also not present on iOS7), it's not\n // possible to detect changes to the mode attribute and polyfill\n // the change event. As a poor substitute, we manually dispatch\n // change events whenever the controls modify the mode.\n\n\n if (tracks.onchange === undefined) {\n var event;\n\n _this.on(['tap', 'click'], function () {\n if (typeof window$1.Event !== 'object') {\n // Android 2.3 throws an Illegal Constructor error for window.Event\n try {\n event = new window$1.Event('change');\n } catch (err) {// continue regardless of error\n }\n }\n\n if (!event) {\n event = document.createEvent('Event');\n event.initEvent('change', true, true);\n }\n\n tracks.dispatchEvent(event);\n });\n } // set the default state based on current tracks\n\n\n _this.handleTracksChange();\n\n return _this;\n }\n /**\n * This gets called when an `TextTrackMenuItem` is \"clicked\". See\n * {@link ClickableComponent} for more detailed information on what a click can be.\n *\n * @param {EventTarget~Event} event\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n\n\n var _proto = TextTrackMenuItem.prototype;\n\n _proto.handleClick = function handleClick(event) {\n var kind = this.track.kind;\n var kinds = this.track.kinds;\n var tracks = this.player_.textTracks();\n\n if (!kinds) {\n kinds = [kind];\n }\n\n _MenuItem.prototype.handleClick.call(this, event);\n\n if (!tracks) {\n return;\n }\n\n for (var i = 0; i < tracks.length; i++) {\n var track = tracks[i];\n\n if (track === this.track && kinds.indexOf(track.kind) > -1) {\n if (track.mode !== 'showing') {\n track.mode = 'showing';\n }\n } else if (track.mode !== 'disabled') {\n track.mode = 'disabled';\n }\n }\n };\n /**\n * Handle text track list change\n *\n * @param {EventTarget~Event} event\n * The `change` event that caused this function to be called.\n *\n * @listens TextTrackList#change\n */\n\n\n _proto.handleTracksChange = function handleTracksChange(event) {\n var shouldBeSelected = this.track.mode === 'showing'; // Prevent redundant selected() calls because they may cause\n // screen readers to read the appended control text unnecessarily\n\n if (shouldBeSelected !== this.isSelected_) {\n this.selected(shouldBeSelected);\n }\n };\n\n _proto.handleSelectedLanguageChange = function handleSelectedLanguageChange(event) {\n if (this.track.mode === 'showing') {\n var selectedLanguage = this.player_.cache_.selectedLanguage; // Don't replace the kind of track across the same language\n\n if (selectedLanguage && selectedLanguage.enabled && selectedLanguage.language === this.track.language && selectedLanguage.kind !== this.track.kind) {\n return;\n }\n\n this.player_.cache_.selectedLanguage = {\n enabled: true,\n language: this.track.language,\n kind: this.track.kind\n };\n }\n };\n\n _proto.dispose = function dispose() {\n // remove reference to track object on dispose\n this.track = null;\n\n _MenuItem.prototype.dispose.call(this);\n };\n\n return TextTrackMenuItem;\n}(MenuItem);\n\nComponent.registerComponent('TextTrackMenuItem', TextTrackMenuItem);\n\n/**\n * A special menu item for turning of a specific type of text track\n *\n * @extends TextTrackMenuItem\n */\n\nvar OffTextTrackMenuItem =\n/*#__PURE__*/\nfunction (_TextTrackMenuItem) {\n _inheritsLoose(OffTextTrackMenuItem, _TextTrackMenuItem);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function OffTextTrackMenuItem(player, options) {\n // Create pseudo track info\n // Requires options['kind']\n options.track = {\n player: player,\n kind: options.kind,\n kinds: options.kinds,\n default: false,\n mode: 'disabled'\n };\n\n if (!options.kinds) {\n options.kinds = [options.kind];\n }\n\n if (options.label) {\n options.track.label = options.label;\n } else {\n options.track.label = options.kinds.join(' and ') + ' off';\n } // MenuItem is selectable\n\n\n options.selectable = true; // MenuItem is NOT multiSelectable (i.e. only one can be marked \"selected\" at a time)\n\n options.multiSelectable = false;\n return _TextTrackMenuItem.call(this, player, options) || this;\n }\n /**\n * Handle text track change\n *\n * @param {EventTarget~Event} event\n * The event that caused this function to run\n */\n\n\n var _proto = OffTextTrackMenuItem.prototype;\n\n _proto.handleTracksChange = function handleTracksChange(event) {\n var tracks = this.player().textTracks();\n var shouldBeSelected = true;\n\n for (var i = 0, l = tracks.length; i < l; i++) {\n var track = tracks[i];\n\n if (this.options_.kinds.indexOf(track.kind) > -1 && track.mode === 'showing') {\n shouldBeSelected = false;\n break;\n }\n } // Prevent redundant selected() calls because they may cause\n // screen readers to read the appended control text unnecessarily\n\n\n if (shouldBeSelected !== this.isSelected_) {\n this.selected(shouldBeSelected);\n }\n };\n\n _proto.handleSelectedLanguageChange = function handleSelectedLanguageChange(event) {\n var tracks = this.player().textTracks();\n var allHidden = true;\n\n for (var i = 0, l = tracks.length; i < l; i++) {\n var track = tracks[i];\n\n if (['captions', 'descriptions', 'subtitles'].indexOf(track.kind) > -1 && track.mode === 'showing') {\n allHidden = false;\n break;\n }\n }\n\n if (allHidden) {\n this.player_.cache_.selectedLanguage = {\n enabled: false\n };\n }\n };\n\n return OffTextTrackMenuItem;\n}(TextTrackMenuItem);\n\nComponent.registerComponent('OffTextTrackMenuItem', OffTextTrackMenuItem);\n\n/**\n * The base class for buttons that toggle specific text track types (e.g. subtitles)\n *\n * @extends MenuButton\n */\n\nvar TextTrackButton =\n/*#__PURE__*/\nfunction (_TrackButton) {\n _inheritsLoose(TextTrackButton, _TrackButton);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options={}]\n * The key/value store of player options.\n */\n function TextTrackButton(player, options) {\n if (options === void 0) {\n options = {};\n }\n\n options.tracks = player.textTracks();\n return _TrackButton.call(this, player, options) || this;\n }\n /**\n * Create a menu item for each text track\n *\n * @param {TextTrackMenuItem[]} [items=[]]\n * Existing array of items to use during creation\n *\n * @return {TextTrackMenuItem[]}\n * Array of menu items that were created\n */\n\n\n var _proto = TextTrackButton.prototype;\n\n _proto.createItems = function createItems(items, TrackMenuItem) {\n if (items === void 0) {\n items = [];\n }\n\n if (TrackMenuItem === void 0) {\n TrackMenuItem = TextTrackMenuItem;\n }\n\n // Label is an override for the [track] off label\n // USed to localise captions/subtitles\n var label;\n\n if (this.label_) {\n label = this.label_ + \" off\";\n } // Add an OFF menu item to turn all tracks off\n\n\n items.push(new OffTextTrackMenuItem(this.player_, {\n kinds: this.kinds_,\n kind: this.kind_,\n label: label\n }));\n this.hideThreshold_ += 1;\n var tracks = this.player_.textTracks();\n\n if (!Array.isArray(this.kinds_)) {\n this.kinds_ = [this.kind_];\n }\n\n for (var i = 0; i < tracks.length; i++) {\n var track = tracks[i]; // only add tracks that are of an appropriate kind and have a label\n\n if (this.kinds_.indexOf(track.kind) > -1) {\n var item = new TrackMenuItem(this.player_, {\n track: track,\n // MenuItem is selectable\n selectable: true,\n // MenuItem is NOT multiSelectable (i.e. only one can be marked \"selected\" at a time)\n multiSelectable: false\n });\n item.addClass(\"vjs-\" + track.kind + \"-menu-item\");\n items.push(item);\n }\n }\n\n return items;\n };\n\n return TextTrackButton;\n}(TrackButton);\n\nComponent.registerComponent('TextTrackButton', TextTrackButton);\n\n/**\n * The chapter track menu item\n *\n * @extends MenuItem\n */\n\nvar ChaptersTrackMenuItem =\n/*#__PURE__*/\nfunction (_MenuItem) {\n _inheritsLoose(ChaptersTrackMenuItem, _MenuItem);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function ChaptersTrackMenuItem(player, options) {\n var _this;\n\n var track = options.track;\n var cue = options.cue;\n var currentTime = player.currentTime(); // Modify options for parent MenuItem class's init.\n\n options.selectable = true;\n options.multiSelectable = false;\n options.label = cue.text;\n options.selected = cue.startTime <= currentTime && currentTime < cue.endTime;\n _this = _MenuItem.call(this, player, options) || this;\n _this.track = track;\n _this.cue = cue;\n track.addEventListener('cuechange', bind(_assertThisInitialized(_assertThisInitialized(_this)), _this.update));\n return _this;\n }\n /**\n * This gets called when an `ChaptersTrackMenuItem` is \"clicked\". See\n * {@link ClickableComponent} for more detailed information on what a click can be.\n *\n * @param {EventTarget~Event} [event]\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n\n\n var _proto = ChaptersTrackMenuItem.prototype;\n\n _proto.handleClick = function handleClick(event) {\n _MenuItem.prototype.handleClick.call(this);\n\n this.player_.currentTime(this.cue.startTime);\n this.update(this.cue.startTime);\n };\n /**\n * Update chapter menu item\n *\n * @param {EventTarget~Event} [event]\n * The `cuechange` event that caused this function to run.\n *\n * @listens TextTrack#cuechange\n */\n\n\n _proto.update = function update(event) {\n var cue = this.cue;\n var currentTime = this.player_.currentTime(); // vjs.log(currentTime, cue.startTime);\n\n this.selected(cue.startTime <= currentTime && currentTime < cue.endTime);\n };\n\n return ChaptersTrackMenuItem;\n}(MenuItem);\n\nComponent.registerComponent('ChaptersTrackMenuItem', ChaptersTrackMenuItem);\n\n/**\n * The button component for toggling and selecting chapters\n * Chapters act much differently than other text tracks\n * Cues are navigation vs. other tracks of alternative languages\n *\n * @extends TextTrackButton\n */\n\nvar ChaptersButton =\n/*#__PURE__*/\nfunction (_TextTrackButton) {\n _inheritsLoose(ChaptersButton, _TextTrackButton);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Component~ReadyCallback} [ready]\n * The function to call when this function is ready.\n */\n function ChaptersButton(player, options, ready) {\n return _TextTrackButton.call(this, player, options, ready) || this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n var _proto = ChaptersButton.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-chapters-button \" + _TextTrackButton.prototype.buildCSSClass.call(this);\n };\n\n _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {\n return \"vjs-chapters-button \" + _TextTrackButton.prototype.buildWrapperCSSClass.call(this);\n };\n /**\n * Update the menu based on the current state of its items.\n *\n * @param {EventTarget~Event} [event]\n * An event that triggered this function to run.\n *\n * @listens TextTrackList#addtrack\n * @listens TextTrackList#removetrack\n * @listens TextTrackList#change\n */\n\n\n _proto.update = function update(event) {\n if (!this.track_ || event && (event.type === 'addtrack' || event.type === 'removetrack')) {\n this.setTrack(this.findChaptersTrack());\n }\n\n _TextTrackButton.prototype.update.call(this);\n };\n /**\n * Set the currently selected track for the chapters button.\n *\n * @param {TextTrack} track\n * The new track to select. Nothing will change if this is the currently selected\n * track.\n */\n\n\n _proto.setTrack = function setTrack(track) {\n if (this.track_ === track) {\n return;\n }\n\n if (!this.updateHandler_) {\n this.updateHandler_ = this.update.bind(this);\n } // here this.track_ refers to the old track instance\n\n\n if (this.track_) {\n var remoteTextTrackEl = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);\n\n if (remoteTextTrackEl) {\n remoteTextTrackEl.removeEventListener('load', this.updateHandler_);\n }\n\n this.track_ = null;\n }\n\n this.track_ = track; // here this.track_ refers to the new track instance\n\n if (this.track_) {\n this.track_.mode = 'hidden';\n\n var _remoteTextTrackEl = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);\n\n if (_remoteTextTrackEl) {\n _remoteTextTrackEl.addEventListener('load', this.updateHandler_);\n }\n }\n };\n /**\n * Find the track object that is currently in use by this ChaptersButton\n *\n * @return {TextTrack|undefined}\n * The current track or undefined if none was found.\n */\n\n\n _proto.findChaptersTrack = function findChaptersTrack() {\n var tracks = this.player_.textTracks() || [];\n\n for (var i = tracks.length - 1; i >= 0; i--) {\n // We will always choose the last track as our chaptersTrack\n var track = tracks[i];\n\n if (track.kind === this.kind_) {\n return track;\n }\n }\n };\n /**\n * Get the caption for the ChaptersButton based on the track label. This will also\n * use the current tracks localized kind as a fallback if a label does not exist.\n *\n * @return {string}\n * The tracks current label or the localized track kind.\n */\n\n\n _proto.getMenuCaption = function getMenuCaption() {\n if (this.track_ && this.track_.label) {\n return this.track_.label;\n }\n\n return this.localize(toTitleCase(this.kind_));\n };\n /**\n * Create menu from chapter track\n *\n * @return {Menu}\n * New menu for the chapter buttons\n */\n\n\n _proto.createMenu = function createMenu() {\n this.options_.title = this.getMenuCaption();\n return _TextTrackButton.prototype.createMenu.call(this);\n };\n /**\n * Create a menu item for each text track\n *\n * @return {TextTrackMenuItem[]}\n * Array of menu items\n */\n\n\n _proto.createItems = function createItems() {\n var items = [];\n\n if (!this.track_) {\n return items;\n }\n\n var cues = this.track_.cues;\n\n if (!cues) {\n return items;\n }\n\n for (var i = 0, l = cues.length; i < l; i++) {\n var cue = cues[i];\n var mi = new ChaptersTrackMenuItem(this.player_, {\n track: this.track_,\n cue: cue\n });\n items.push(mi);\n }\n\n return items;\n };\n\n return ChaptersButton;\n}(TextTrackButton);\n/**\n * `kind` of TextTrack to look for to associate it with this menu.\n *\n * @type {string}\n * @private\n */\n\n\nChaptersButton.prototype.kind_ = 'chapters';\n/**\n * The text that should display over the `ChaptersButton`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\nChaptersButton.prototype.controlText_ = 'Chapters';\nComponent.registerComponent('ChaptersButton', ChaptersButton);\n\n/**\n * The button component for toggling and selecting descriptions\n *\n * @extends TextTrackButton\n */\n\nvar DescriptionsButton =\n/*#__PURE__*/\nfunction (_TextTrackButton) {\n _inheritsLoose(DescriptionsButton, _TextTrackButton);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Component~ReadyCallback} [ready]\n * The function to call when this component is ready.\n */\n function DescriptionsButton(player, options, ready) {\n var _this;\n\n _this = _TextTrackButton.call(this, player, options, ready) || this;\n var tracks = player.textTracks();\n var changeHandler = bind(_assertThisInitialized(_assertThisInitialized(_this)), _this.handleTracksChange);\n tracks.addEventListener('change', changeHandler);\n\n _this.on('dispose', function () {\n tracks.removeEventListener('change', changeHandler);\n });\n\n return _this;\n }\n /**\n * Handle text track change\n *\n * @param {EventTarget~Event} event\n * The event that caused this function to run\n *\n * @listens TextTrackList#change\n */\n\n\n var _proto = DescriptionsButton.prototype;\n\n _proto.handleTracksChange = function handleTracksChange(event) {\n var tracks = this.player().textTracks();\n var disabled = false; // Check whether a track of a different kind is showing\n\n for (var i = 0, l = tracks.length; i < l; i++) {\n var track = tracks[i];\n\n if (track.kind !== this.kind_ && track.mode === 'showing') {\n disabled = true;\n break;\n }\n } // If another track is showing, disable this menu button\n\n\n if (disabled) {\n this.disable();\n } else {\n this.enable();\n }\n };\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-descriptions-button \" + _TextTrackButton.prototype.buildCSSClass.call(this);\n };\n\n _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {\n return \"vjs-descriptions-button \" + _TextTrackButton.prototype.buildWrapperCSSClass.call(this);\n };\n\n return DescriptionsButton;\n}(TextTrackButton);\n/**\n * `kind` of TextTrack to look for to associate it with this menu.\n *\n * @type {string}\n * @private\n */\n\n\nDescriptionsButton.prototype.kind_ = 'descriptions';\n/**\n * The text that should display over the `DescriptionsButton`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\nDescriptionsButton.prototype.controlText_ = 'Descriptions';\nComponent.registerComponent('DescriptionsButton', DescriptionsButton);\n\n/**\n * The button component for toggling and selecting subtitles\n *\n * @extends TextTrackButton\n */\n\nvar SubtitlesButton =\n/*#__PURE__*/\nfunction (_TextTrackButton) {\n _inheritsLoose(SubtitlesButton, _TextTrackButton);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Component~ReadyCallback} [ready]\n * The function to call when this component is ready.\n */\n function SubtitlesButton(player, options, ready) {\n return _TextTrackButton.call(this, player, options, ready) || this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n var _proto = SubtitlesButton.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-subtitles-button \" + _TextTrackButton.prototype.buildCSSClass.call(this);\n };\n\n _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {\n return \"vjs-subtitles-button \" + _TextTrackButton.prototype.buildWrapperCSSClass.call(this);\n };\n\n return SubtitlesButton;\n}(TextTrackButton);\n/**\n * `kind` of TextTrack to look for to associate it with this menu.\n *\n * @type {string}\n * @private\n */\n\n\nSubtitlesButton.prototype.kind_ = 'subtitles';\n/**\n * The text that should display over the `SubtitlesButton`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\nSubtitlesButton.prototype.controlText_ = 'Subtitles';\nComponent.registerComponent('SubtitlesButton', SubtitlesButton);\n\n/**\n * The menu item for caption track settings menu\n *\n * @extends TextTrackMenuItem\n */\n\nvar CaptionSettingsMenuItem =\n/*#__PURE__*/\nfunction (_TextTrackMenuItem) {\n _inheritsLoose(CaptionSettingsMenuItem, _TextTrackMenuItem);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function CaptionSettingsMenuItem(player, options) {\n var _this;\n\n options.track = {\n player: player,\n kind: options.kind,\n label: options.kind + ' settings',\n selectable: false,\n default: false,\n mode: 'disabled'\n }; // CaptionSettingsMenuItem has no concept of 'selected'\n\n options.selectable = false;\n options.name = 'CaptionSettingsMenuItem';\n _this = _TextTrackMenuItem.call(this, player, options) || this;\n\n _this.addClass('vjs-texttrack-settings');\n\n _this.controlText(', opens ' + options.kind + ' settings dialog');\n\n return _this;\n }\n /**\n * This gets called when an `CaptionSettingsMenuItem` is \"clicked\". See\n * {@link ClickableComponent} for more detailed information on what a click can be.\n *\n * @param {EventTarget~Event} [event]\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n\n\n var _proto = CaptionSettingsMenuItem.prototype;\n\n _proto.handleClick = function handleClick(event) {\n this.player().getChild('textTrackSettings').open();\n };\n\n return CaptionSettingsMenuItem;\n}(TextTrackMenuItem);\n\nComponent.registerComponent('CaptionSettingsMenuItem', CaptionSettingsMenuItem);\n\n/**\n * The button component for toggling and selecting captions\n *\n * @extends TextTrackButton\n */\n\nvar CaptionsButton =\n/*#__PURE__*/\nfunction (_TextTrackButton) {\n _inheritsLoose(CaptionsButton, _TextTrackButton);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Component~ReadyCallback} [ready]\n * The function to call when this component is ready.\n */\n function CaptionsButton(player, options, ready) {\n return _TextTrackButton.call(this, player, options, ready) || this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n var _proto = CaptionsButton.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-captions-button \" + _TextTrackButton.prototype.buildCSSClass.call(this);\n };\n\n _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {\n return \"vjs-captions-button \" + _TextTrackButton.prototype.buildWrapperCSSClass.call(this);\n };\n /**\n * Create caption menu items\n *\n * @return {CaptionSettingsMenuItem[]}\n * The array of current menu items.\n */\n\n\n _proto.createItems = function createItems() {\n var items = [];\n\n if (!(this.player().tech_ && this.player().tech_.featuresNativeTextTracks) && this.player().getChild('textTrackSettings')) {\n items.push(new CaptionSettingsMenuItem(this.player_, {\n kind: this.kind_\n }));\n this.hideThreshold_ += 1;\n }\n\n return _TextTrackButton.prototype.createItems.call(this, items);\n };\n\n return CaptionsButton;\n}(TextTrackButton);\n/**\n * `kind` of TextTrack to look for to associate it with this menu.\n *\n * @type {string}\n * @private\n */\n\n\nCaptionsButton.prototype.kind_ = 'captions';\n/**\n * The text that should display over the `CaptionsButton`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\nCaptionsButton.prototype.controlText_ = 'Captions';\nComponent.registerComponent('CaptionsButton', CaptionsButton);\n\n/**\n * SubsCapsMenuItem has an [cc] icon to distinguish captions from subtitles\n * in the SubsCapsMenu.\n *\n * @extends TextTrackMenuItem\n */\n\nvar SubsCapsMenuItem =\n/*#__PURE__*/\nfunction (_TextTrackMenuItem) {\n _inheritsLoose(SubsCapsMenuItem, _TextTrackMenuItem);\n\n function SubsCapsMenuItem() {\n return _TextTrackMenuItem.apply(this, arguments) || this;\n }\n\n var _proto = SubsCapsMenuItem.prototype;\n\n _proto.createEl = function createEl(type, props, attrs) {\n var innerHTML = \"<span class=\\\"vjs-menu-item-text\\\">\" + this.localize(this.options_.label);\n\n if (this.options_.track.kind === 'captions') {\n innerHTML += \"\\n <span aria-hidden=\\\"true\\\" class=\\\"vjs-icon-placeholder\\\"></span>\\n <span class=\\\"vjs-control-text\\\"> \" + this.localize('Captions') + \"</span>\\n \";\n }\n\n innerHTML += '</span>';\n\n var el = _TextTrackMenuItem.prototype.createEl.call(this, type, assign({\n innerHTML: innerHTML\n }, props), attrs);\n\n return el;\n };\n\n return SubsCapsMenuItem;\n}(TextTrackMenuItem);\n\nComponent.registerComponent('SubsCapsMenuItem', SubsCapsMenuItem);\n\n/**\n * The button component for toggling and selecting captions and/or subtitles\n *\n * @extends TextTrackButton\n */\n\nvar SubsCapsButton =\n/*#__PURE__*/\nfunction (_TextTrackButton) {\n _inheritsLoose(SubsCapsButton, _TextTrackButton);\n\n function SubsCapsButton(player, options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n _this = _TextTrackButton.call(this, player, options) || this; // Although North America uses \"captions\" in most cases for\n // \"captions and subtitles\" other locales use \"subtitles\"\n\n _this.label_ = 'subtitles';\n\n if (['en', 'en-us', 'en-ca', 'fr-ca'].indexOf(_this.player_.language_) > -1) {\n _this.label_ = 'captions';\n }\n\n _this.menuButton_.controlText(toTitleCase(_this.label_));\n\n return _this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n var _proto = SubsCapsButton.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-subs-caps-button \" + _TextTrackButton.prototype.buildCSSClass.call(this);\n };\n\n _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {\n return \"vjs-subs-caps-button \" + _TextTrackButton.prototype.buildWrapperCSSClass.call(this);\n };\n /**\n * Create caption/subtitles menu items\n *\n * @return {CaptionSettingsMenuItem[]}\n * The array of current menu items.\n */\n\n\n _proto.createItems = function createItems() {\n var items = [];\n\n if (!(this.player().tech_ && this.player().tech_.featuresNativeTextTracks) && this.player().getChild('textTrackSettings')) {\n items.push(new CaptionSettingsMenuItem(this.player_, {\n kind: this.label_\n }));\n this.hideThreshold_ += 1;\n }\n\n items = _TextTrackButton.prototype.createItems.call(this, items, SubsCapsMenuItem);\n return items;\n };\n\n return SubsCapsButton;\n}(TextTrackButton);\n/**\n * `kind`s of TextTrack to look for to associate it with this menu.\n *\n * @type {array}\n * @private\n */\n\n\nSubsCapsButton.prototype.kinds_ = ['captions', 'subtitles'];\n/**\n * The text that should display over the `SubsCapsButton`s controls.\n *\n *\n * @type {string}\n * @private\n */\n\nSubsCapsButton.prototype.controlText_ = 'Subtitles';\nComponent.registerComponent('SubsCapsButton', SubsCapsButton);\n\n/**\n * An {@link AudioTrack} {@link MenuItem}\n *\n * @extends MenuItem\n */\n\nvar AudioTrackMenuItem =\n/*#__PURE__*/\nfunction (_MenuItem) {\n _inheritsLoose(AudioTrackMenuItem, _MenuItem);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function AudioTrackMenuItem(player, options) {\n var _this;\n\n var track = options.track;\n var tracks = player.audioTracks(); // Modify options for parent MenuItem class's init.\n\n options.label = track.label || track.language || 'Unknown';\n options.selected = track.enabled;\n _this = _MenuItem.call(this, player, options) || this;\n _this.track = track;\n\n _this.addClass(\"vjs-\" + track.kind + \"-menu-item\");\n\n var changeHandler = function changeHandler() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this.handleTracksChange.apply(_assertThisInitialized(_assertThisInitialized(_this)), args);\n };\n\n tracks.addEventListener('change', changeHandler);\n\n _this.on('dispose', function () {\n tracks.removeEventListener('change', changeHandler);\n });\n\n return _this;\n }\n\n var _proto = AudioTrackMenuItem.prototype;\n\n _proto.createEl = function createEl(type, props, attrs) {\n var innerHTML = \"<span class=\\\"vjs-menu-item-text\\\">\" + this.localize(this.options_.label);\n\n if (this.options_.track.kind === 'main-desc') {\n innerHTML += \"\\n <span aria-hidden=\\\"true\\\" class=\\\"vjs-icon-placeholder\\\"></span>\\n <span class=\\\"vjs-control-text\\\"> \" + this.localize('Descriptions') + \"</span>\\n \";\n }\n\n innerHTML += '</span>';\n\n var el = _MenuItem.prototype.createEl.call(this, type, assign({\n innerHTML: innerHTML\n }, props), attrs);\n\n return el;\n };\n /**\n * This gets called when an `AudioTrackMenuItem is \"clicked\". See {@link ClickableComponent}\n * for more detailed information on what a click can be.\n *\n * @param {EventTarget~Event} [event]\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n\n\n _proto.handleClick = function handleClick(event) {\n var tracks = this.player_.audioTracks();\n\n _MenuItem.prototype.handleClick.call(this, event);\n\n for (var i = 0; i < tracks.length; i++) {\n var track = tracks[i];\n track.enabled = track === this.track;\n }\n };\n /**\n * Handle any {@link AudioTrack} change.\n *\n * @param {EventTarget~Event} [event]\n * The {@link AudioTrackList#change} event that caused this to run.\n *\n * @listens AudioTrackList#change\n */\n\n\n _proto.handleTracksChange = function handleTracksChange(event) {\n this.selected(this.track.enabled);\n };\n\n return AudioTrackMenuItem;\n}(MenuItem);\n\nComponent.registerComponent('AudioTrackMenuItem', AudioTrackMenuItem);\n\n/**\n * The base class for buttons that toggle specific {@link AudioTrack} types.\n *\n * @extends TrackButton\n */\n\nvar AudioTrackButton =\n/*#__PURE__*/\nfunction (_TrackButton) {\n _inheritsLoose(AudioTrackButton, _TrackButton);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options={}]\n * The key/value store of player options.\n */\n function AudioTrackButton(player, options) {\n if (options === void 0) {\n options = {};\n }\n\n options.tracks = player.audioTracks();\n return _TrackButton.call(this, player, options) || this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n var _proto = AudioTrackButton.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-audio-button \" + _TrackButton.prototype.buildCSSClass.call(this);\n };\n\n _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {\n return \"vjs-audio-button \" + _TrackButton.prototype.buildWrapperCSSClass.call(this);\n };\n /**\n * Create a menu item for each audio track\n *\n * @param {AudioTrackMenuItem[]} [items=[]]\n * An array of existing menu items to use.\n *\n * @return {AudioTrackMenuItem[]}\n * An array of menu items\n */\n\n\n _proto.createItems = function createItems(items) {\n if (items === void 0) {\n items = [];\n }\n\n // if there's only one audio track, there no point in showing it\n this.hideThreshold_ = 1;\n var tracks = this.player_.audioTracks();\n\n for (var i = 0; i < tracks.length; i++) {\n var track = tracks[i];\n items.push(new AudioTrackMenuItem(this.player_, {\n track: track,\n // MenuItem is selectable\n selectable: true,\n // MenuItem is NOT multiSelectable (i.e. only one can be marked \"selected\" at a time)\n multiSelectable: false\n }));\n }\n\n return items;\n };\n\n return AudioTrackButton;\n}(TrackButton);\n/**\n * The text that should display over the `AudioTrackButton`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\n\nAudioTrackButton.prototype.controlText_ = 'Audio Track';\nComponent.registerComponent('AudioTrackButton', AudioTrackButton);\n\n/**\n * The specific menu item type for selecting a playback rate.\n *\n * @extends MenuItem\n */\n\nvar PlaybackRateMenuItem =\n/*#__PURE__*/\nfunction (_MenuItem) {\n _inheritsLoose(PlaybackRateMenuItem, _MenuItem);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function PlaybackRateMenuItem(player, options) {\n var _this;\n\n var label = options.rate;\n var rate = parseFloat(label, 10); // Modify options for parent MenuItem class's init.\n\n options.label = label;\n options.selected = rate === 1;\n options.selectable = true;\n options.multiSelectable = false;\n _this = _MenuItem.call(this, player, options) || this;\n _this.label = label;\n _this.rate = rate;\n\n _this.on(player, 'ratechange', _this.update);\n\n return _this;\n }\n /**\n * This gets called when an `PlaybackRateMenuItem` is \"clicked\". See\n * {@link ClickableComponent} for more detailed information on what a click can be.\n *\n * @param {EventTarget~Event} [event]\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n\n\n var _proto = PlaybackRateMenuItem.prototype;\n\n _proto.handleClick = function handleClick(event) {\n _MenuItem.prototype.handleClick.call(this);\n\n this.player().playbackRate(this.rate);\n };\n /**\n * Update the PlaybackRateMenuItem when the playbackrate changes.\n *\n * @param {EventTarget~Event} [event]\n * The `ratechange` event that caused this function to run.\n *\n * @listens Player#ratechange\n */\n\n\n _proto.update = function update(event) {\n this.selected(this.player().playbackRate() === this.rate);\n };\n\n return PlaybackRateMenuItem;\n}(MenuItem);\n/**\n * The text that should display over the `PlaybackRateMenuItem`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\n\nPlaybackRateMenuItem.prototype.contentElType = 'button';\nComponent.registerComponent('PlaybackRateMenuItem', PlaybackRateMenuItem);\n\n/**\n * The component for controlling the playback rate.\n *\n * @extends MenuButton\n */\n\nvar PlaybackRateMenuButton =\n/*#__PURE__*/\nfunction (_MenuButton) {\n _inheritsLoose(PlaybackRateMenuButton, _MenuButton);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function PlaybackRateMenuButton(player, options) {\n var _this;\n\n _this = _MenuButton.call(this, player, options) || this;\n\n _this.updateVisibility();\n\n _this.updateLabel();\n\n _this.on(player, 'loadstart', _this.updateVisibility);\n\n _this.on(player, 'ratechange', _this.updateLabel);\n\n return _this;\n }\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n var _proto = PlaybackRateMenuButton.prototype;\n\n _proto.createEl = function createEl$$1() {\n var el = _MenuButton.prototype.createEl.call(this);\n\n this.labelEl_ = createEl('div', {\n className: 'vjs-playback-rate-value',\n innerHTML: '1x'\n });\n el.appendChild(this.labelEl_);\n return el;\n };\n\n _proto.dispose = function dispose() {\n this.labelEl_ = null;\n\n _MenuButton.prototype.dispose.call(this);\n };\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-playback-rate \" + _MenuButton.prototype.buildCSSClass.call(this);\n };\n\n _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {\n return \"vjs-playback-rate \" + _MenuButton.prototype.buildWrapperCSSClass.call(this);\n };\n /**\n * Create the playback rate menu\n *\n * @return {Menu}\n * Menu object populated with {@link PlaybackRateMenuItem}s\n */\n\n\n _proto.createMenu = function createMenu() {\n var menu = new Menu(this.player());\n var rates = this.playbackRates();\n\n if (rates) {\n for (var i = rates.length - 1; i >= 0; i--) {\n menu.addChild(new PlaybackRateMenuItem(this.player(), {\n rate: rates[i] + 'x'\n }));\n }\n }\n\n return menu;\n };\n /**\n * Updates ARIA accessibility attributes\n */\n\n\n _proto.updateARIAAttributes = function updateARIAAttributes() {\n // Current playback rate\n this.el().setAttribute('aria-valuenow', this.player().playbackRate());\n };\n /**\n * This gets called when an `PlaybackRateMenuButton` is \"clicked\". See\n * {@link ClickableComponent} for more detailed information on what a click can be.\n *\n * @param {EventTarget~Event} [event]\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n\n\n _proto.handleClick = function handleClick(event) {\n // select next rate option\n var currentRate = this.player().playbackRate();\n var rates = this.playbackRates(); // this will select first one if the last one currently selected\n\n var newRate = rates[0];\n\n for (var i = 0; i < rates.length; i++) {\n if (rates[i] > currentRate) {\n newRate = rates[i];\n break;\n }\n }\n\n this.player().playbackRate(newRate);\n };\n /**\n * Get possible playback rates\n *\n * @return {Array}\n * All possible playback rates\n */\n\n\n _proto.playbackRates = function playbackRates() {\n return this.options_.playbackRates || this.options_.playerOptions && this.options_.playerOptions.playbackRates;\n };\n /**\n * Get whether playback rates is supported by the tech\n * and an array of playback rates exists\n *\n * @return {boolean}\n * Whether changing playback rate is supported\n */\n\n\n _proto.playbackRateSupported = function playbackRateSupported() {\n return this.player().tech_ && this.player().tech_.featuresPlaybackRate && this.playbackRates() && this.playbackRates().length > 0;\n };\n /**\n * Hide playback rate controls when they're no playback rate options to select\n *\n * @param {EventTarget~Event} [event]\n * The event that caused this function to run.\n *\n * @listens Player#loadstart\n */\n\n\n _proto.updateVisibility = function updateVisibility(event) {\n if (this.playbackRateSupported()) {\n this.removeClass('vjs-hidden');\n } else {\n this.addClass('vjs-hidden');\n }\n };\n /**\n * Update button label when rate changed\n *\n * @param {EventTarget~Event} [event]\n * The event that caused this function to run.\n *\n * @listens Player#ratechange\n */\n\n\n _proto.updateLabel = function updateLabel(event) {\n if (this.playbackRateSupported()) {\n this.labelEl_.innerHTML = this.player().playbackRate() + 'x';\n }\n };\n\n return PlaybackRateMenuButton;\n}(MenuButton);\n/**\n * The text that should display over the `FullscreenToggle`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\n\nPlaybackRateMenuButton.prototype.controlText_ = 'Playback Rate';\nComponent.registerComponent('PlaybackRateMenuButton', PlaybackRateMenuButton);\n\n/**\n * Just an empty spacer element that can be used as an append point for plugins, etc.\n * Also can be used to create space between elements when necessary.\n *\n * @extends Component\n */\n\nvar Spacer =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(Spacer, _Component);\n\n function Spacer() {\n return _Component.apply(this, arguments) || this;\n }\n\n var _proto = Spacer.prototype;\n\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-spacer \" + _Component.prototype.buildCSSClass.call(this);\n };\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n _proto.createEl = function createEl() {\n return _Component.prototype.createEl.call(this, 'div', {\n className: this.buildCSSClass()\n });\n };\n\n return Spacer;\n}(Component);\n\nComponent.registerComponent('Spacer', Spacer);\n\n/**\n * Spacer specifically meant to be used as an insertion point for new plugins, etc.\n *\n * @extends Spacer\n */\n\nvar CustomControlSpacer =\n/*#__PURE__*/\nfunction (_Spacer) {\n _inheritsLoose(CustomControlSpacer, _Spacer);\n\n function CustomControlSpacer() {\n return _Spacer.apply(this, arguments) || this;\n }\n\n var _proto = CustomControlSpacer.prototype;\n\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-custom-control-spacer \" + _Spacer.prototype.buildCSSClass.call(this);\n };\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n _proto.createEl = function createEl() {\n var el = _Spacer.prototype.createEl.call(this, {\n className: this.buildCSSClass()\n }); // No-flex/table-cell mode requires there be some content\n // in the cell to fill the remaining space of the table.\n\n\n el.innerHTML = \"\\xA0\";\n return el;\n };\n\n return CustomControlSpacer;\n}(Spacer);\n\nComponent.registerComponent('CustomControlSpacer', CustomControlSpacer);\n\n/**\n * Container of main controls.\n *\n * @extends Component\n */\n\nvar ControlBar =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(ControlBar, _Component);\n\n function ControlBar() {\n return _Component.apply(this, arguments) || this;\n }\n\n var _proto = ControlBar.prototype;\n\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n _proto.createEl = function createEl() {\n return _Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-control-bar',\n dir: 'ltr'\n });\n };\n\n return ControlBar;\n}(Component);\n/**\n * Default options for `ControlBar`\n *\n * @type {Object}\n * @private\n */\n\n\nControlBar.prototype.options_ = {\n children: ['playToggle', 'volumePanel', 'currentTimeDisplay', 'timeDivider', 'durationDisplay', 'progressControl', 'liveDisplay', 'seekToLive', 'remainingTimeDisplay', 'customControlSpacer', 'playbackRateMenuButton', 'chaptersButton', 'descriptionsButton', 'subsCapsButton', 'audioTrackButton', 'fullscreenToggle']\n};\nComponent.registerComponent('ControlBar', ControlBar);\n\n/**\n * A display that indicates an error has occurred. This means that the video\n * is unplayable.\n *\n * @extends ModalDialog\n */\n\nvar ErrorDisplay =\n/*#__PURE__*/\nfunction (_ModalDialog) {\n _inheritsLoose(ErrorDisplay, _ModalDialog);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function ErrorDisplay(player, options) {\n var _this;\n\n _this = _ModalDialog.call(this, player, options) || this;\n\n _this.on(player, 'error', _this.open);\n\n return _this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n *\n * @deprecated Since version 5.\n */\n\n\n var _proto = ErrorDisplay.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-error-display \" + _ModalDialog.prototype.buildCSSClass.call(this);\n };\n /**\n * Gets the localized error message based on the `Player`s error.\n *\n * @return {string}\n * The `Player`s error message localized or an empty string.\n */\n\n\n _proto.content = function content() {\n var error = this.player().error();\n return error ? this.localize(error.message) : '';\n };\n\n return ErrorDisplay;\n}(ModalDialog);\n/**\n * The default options for an `ErrorDisplay`.\n *\n * @private\n */\n\n\nErrorDisplay.prototype.options_ = mergeOptions(ModalDialog.prototype.options_, {\n pauseOnOpen: false,\n fillAlways: true,\n temporary: false,\n uncloseable: true\n});\nComponent.registerComponent('ErrorDisplay', ErrorDisplay);\n\nvar LOCAL_STORAGE_KEY = 'vjs-text-track-settings';\nvar COLOR_BLACK = ['#000', 'Black'];\nvar COLOR_BLUE = ['#00F', 'Blue'];\nvar COLOR_CYAN = ['#0FF', 'Cyan'];\nvar COLOR_GREEN = ['#0F0', 'Green'];\nvar COLOR_MAGENTA = ['#F0F', 'Magenta'];\nvar COLOR_RED = ['#F00', 'Red'];\nvar COLOR_WHITE = ['#FFF', 'White'];\nvar COLOR_YELLOW = ['#FF0', 'Yellow'];\nvar OPACITY_OPAQUE = ['1', 'Opaque'];\nvar OPACITY_SEMI = ['0.5', 'Semi-Transparent'];\nvar OPACITY_TRANS = ['0', 'Transparent']; // Configuration for the various <select> elements in the DOM of this component.\n//\n// Possible keys include:\n//\n// `default`:\n// The default option index. Only needs to be provided if not zero.\n// `parser`:\n// A function which is used to parse the value from the selected option in\n// a customized way.\n// `selector`:\n// The selector used to find the associated <select> element.\n\nvar selectConfigs = {\n backgroundColor: {\n selector: '.vjs-bg-color > select',\n id: 'captions-background-color-%s',\n label: 'Color',\n options: [COLOR_BLACK, COLOR_WHITE, COLOR_RED, COLOR_GREEN, COLOR_BLUE, COLOR_YELLOW, COLOR_MAGENTA, COLOR_CYAN]\n },\n backgroundOpacity: {\n selector: '.vjs-bg-opacity > select',\n id: 'captions-background-opacity-%s',\n label: 'Transparency',\n options: [OPACITY_OPAQUE, OPACITY_SEMI, OPACITY_TRANS]\n },\n color: {\n selector: '.vjs-fg-color > select',\n id: 'captions-foreground-color-%s',\n label: 'Color',\n options: [COLOR_WHITE, COLOR_BLACK, COLOR_RED, COLOR_GREEN, COLOR_BLUE, COLOR_YELLOW, COLOR_MAGENTA, COLOR_CYAN]\n },\n edgeStyle: {\n selector: '.vjs-edge-style > select',\n id: '%s',\n label: 'Text Edge Style',\n options: [['none', 'None'], ['raised', 'Raised'], ['depressed', 'Depressed'], ['uniform', 'Uniform'], ['dropshadow', 'Dropshadow']]\n },\n fontFamily: {\n selector: '.vjs-font-family > select',\n id: 'captions-font-family-%s',\n label: 'Font Family',\n options: [['proportionalSansSerif', 'Proportional Sans-Serif'], ['monospaceSansSerif', 'Monospace Sans-Serif'], ['proportionalSerif', 'Proportional Serif'], ['monospaceSerif', 'Monospace Serif'], ['casual', 'Casual'], ['script', 'Script'], ['small-caps', 'Small Caps']]\n },\n fontPercent: {\n selector: '.vjs-font-percent > select',\n id: 'captions-font-size-%s',\n label: 'Font Size',\n options: [['0.50', '50%'], ['0.75', '75%'], ['1.00', '100%'], ['1.25', '125%'], ['1.50', '150%'], ['1.75', '175%'], ['2.00', '200%'], ['3.00', '300%'], ['4.00', '400%']],\n default: 2,\n parser: function parser(v) {\n return v === '1.00' ? null : Number(v);\n }\n },\n textOpacity: {\n selector: '.vjs-text-opacity > select',\n id: 'captions-foreground-opacity-%s',\n label: 'Transparency',\n options: [OPACITY_OPAQUE, OPACITY_SEMI]\n },\n // Options for this object are defined below.\n windowColor: {\n selector: '.vjs-window-color > select',\n id: 'captions-window-color-%s',\n label: 'Color'\n },\n // Options for this object are defined below.\n windowOpacity: {\n selector: '.vjs-window-opacity > select',\n id: 'captions-window-opacity-%s',\n label: 'Transparency',\n options: [OPACITY_TRANS, OPACITY_SEMI, OPACITY_OPAQUE]\n }\n};\nselectConfigs.windowColor.options = selectConfigs.backgroundColor.options;\n/**\n * Get the actual value of an option.\n *\n * @param {string} value\n * The value to get\n *\n * @param {Function} [parser]\n * Optional function to adjust the value.\n *\n * @return {Mixed}\n * - Will be `undefined` if no value exists\n * - Will be `undefined` if the given value is \"none\".\n * - Will be the actual value otherwise.\n *\n * @private\n */\n\nfunction parseOptionValue(value, parser) {\n if (parser) {\n value = parser(value);\n }\n\n if (value && value !== 'none') {\n return value;\n }\n}\n/**\n * Gets the value of the selected <option> element within a <select> element.\n *\n * @param {Element} el\n * the element to look in\n *\n * @param {Function} [parser]\n * Optional function to adjust the value.\n *\n * @return {Mixed}\n * - Will be `undefined` if no value exists\n * - Will be `undefined` if the given value is \"none\".\n * - Will be the actual value otherwise.\n *\n * @private\n */\n\n\nfunction getSelectedOptionValue(el, parser) {\n var value = el.options[el.options.selectedIndex].value;\n return parseOptionValue(value, parser);\n}\n/**\n * Sets the selected <option> element within a <select> element based on a\n * given value.\n *\n * @param {Element} el\n * The element to look in.\n *\n * @param {string} value\n * the property to look on.\n *\n * @param {Function} [parser]\n * Optional function to adjust the value before comparing.\n *\n * @private\n */\n\n\nfunction setSelectedOption(el, value, parser) {\n if (!value) {\n return;\n }\n\n for (var i = 0; i < el.options.length; i++) {\n if (parseOptionValue(el.options[i].value, parser) === value) {\n el.selectedIndex = i;\n break;\n }\n }\n}\n/**\n * Manipulate Text Tracks settings.\n *\n * @extends ModalDialog\n */\n\n\nvar TextTrackSettings =\n/*#__PURE__*/\nfunction (_ModalDialog) {\n _inheritsLoose(TextTrackSettings, _ModalDialog);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function TextTrackSettings(player, options) {\n var _this;\n\n options.temporary = false;\n _this = _ModalDialog.call(this, player, options) || this;\n _this.updateDisplay = bind(_assertThisInitialized(_assertThisInitialized(_this)), _this.updateDisplay); // fill the modal and pretend we have opened it\n\n _this.fill();\n\n _this.hasBeenOpened_ = _this.hasBeenFilled_ = true;\n _this.endDialog = createEl('p', {\n className: 'vjs-control-text',\n textContent: _this.localize('End of dialog window.')\n });\n\n _this.el().appendChild(_this.endDialog);\n\n _this.setDefaults(); // Grab `persistTextTrackSettings` from the player options if not passed in child options\n\n\n if (options.persistTextTrackSettings === undefined) {\n _this.options_.persistTextTrackSettings = _this.options_.playerOptions.persistTextTrackSettings;\n }\n\n _this.on(_this.$('.vjs-done-button'), 'click', function () {\n _this.saveSettings();\n\n _this.close();\n });\n\n _this.on(_this.$('.vjs-default-button'), 'click', function () {\n _this.setDefaults();\n\n _this.updateDisplay();\n });\n\n each(selectConfigs, function (config) {\n _this.on(_this.$(config.selector), 'change', _this.updateDisplay);\n });\n\n if (_this.options_.persistTextTrackSettings) {\n _this.restoreSettings();\n }\n\n return _this;\n }\n\n var _proto = TextTrackSettings.prototype;\n\n _proto.dispose = function dispose() {\n this.endDialog = null;\n\n _ModalDialog.prototype.dispose.call(this);\n };\n /**\n * Create a <select> element with configured options.\n *\n * @param {string} key\n * Configuration key to use during creation.\n *\n * @return {string}\n * An HTML string.\n *\n * @private\n */\n\n\n _proto.createElSelect_ = function createElSelect_(key, legendId, type) {\n var _this2 = this;\n\n if (legendId === void 0) {\n legendId = '';\n }\n\n if (type === void 0) {\n type = 'label';\n }\n\n var config = selectConfigs[key];\n var id = config.id.replace('%s', this.id_);\n var selectLabelledbyIds = [legendId, id].join(' ').trim();\n return [\"<\" + type + \" id=\\\"\" + id + \"\\\" class=\\\"\" + (type === 'label' ? 'vjs-label' : '') + \"\\\">\", this.localize(config.label), \"</\" + type + \">\", \"<select aria-labelledby=\\\"\" + selectLabelledbyIds + \"\\\">\"].concat(config.options.map(function (o) {\n var optionId = id + '-' + o[1].replace(/\\W+/g, '');\n return [\"<option id=\\\"\" + optionId + \"\\\" value=\\\"\" + o[0] + \"\\\" \", \"aria-labelledby=\\\"\" + selectLabelledbyIds + \" \" + optionId + \"\\\">\", _this2.localize(o[1]), '</option>'].join('');\n })).concat('</select>').join('');\n };\n /**\n * Create foreground color element for the component\n *\n * @return {string}\n * An HTML string.\n *\n * @private\n */\n\n\n _proto.createElFgColor_ = function createElFgColor_() {\n var legendId = \"captions-text-legend-\" + this.id_;\n return ['<fieldset class=\"vjs-fg-color vjs-track-setting\">', \"<legend id=\\\"\" + legendId + \"\\\">\", this.localize('Text'), '</legend>', this.createElSelect_('color', legendId), '<span class=\"vjs-text-opacity vjs-opacity\">', this.createElSelect_('textOpacity', legendId), '</span>', '</fieldset>'].join('');\n };\n /**\n * Create background color element for the component\n *\n * @return {string}\n * An HTML string.\n *\n * @private\n */\n\n\n _proto.createElBgColor_ = function createElBgColor_() {\n var legendId = \"captions-background-\" + this.id_;\n return ['<fieldset class=\"vjs-bg-color vjs-track-setting\">', \"<legend id=\\\"\" + legendId + \"\\\">\", this.localize('Background'), '</legend>', this.createElSelect_('backgroundColor', legendId), '<span class=\"vjs-bg-opacity vjs-opacity\">', this.createElSelect_('backgroundOpacity', legendId), '</span>', '</fieldset>'].join('');\n };\n /**\n * Create window color element for the component\n *\n * @return {string}\n * An HTML string.\n *\n * @private\n */\n\n\n _proto.createElWinColor_ = function createElWinColor_() {\n var legendId = \"captions-window-\" + this.id_;\n return ['<fieldset class=\"vjs-window-color vjs-track-setting\">', \"<legend id=\\\"\" + legendId + \"\\\">\", this.localize('Window'), '</legend>', this.createElSelect_('windowColor', legendId), '<span class=\"vjs-window-opacity vjs-opacity\">', this.createElSelect_('windowOpacity', legendId), '</span>', '</fieldset>'].join('');\n };\n /**\n * Create color elements for the component\n *\n * @return {Element}\n * The element that was created\n *\n * @private\n */\n\n\n _proto.createElColors_ = function createElColors_() {\n return createEl('div', {\n className: 'vjs-track-settings-colors',\n innerHTML: [this.createElFgColor_(), this.createElBgColor_(), this.createElWinColor_()].join('')\n });\n };\n /**\n * Create font elements for the component\n *\n * @return {Element}\n * The element that was created.\n *\n * @private\n */\n\n\n _proto.createElFont_ = function createElFont_() {\n return createEl('div', {\n className: 'vjs-track-settings-font',\n innerHTML: ['<fieldset class=\"vjs-font-percent vjs-track-setting\">', this.createElSelect_('fontPercent', '', 'legend'), '</fieldset>', '<fieldset class=\"vjs-edge-style vjs-track-setting\">', this.createElSelect_('edgeStyle', '', 'legend'), '</fieldset>', '<fieldset class=\"vjs-font-family vjs-track-setting\">', this.createElSelect_('fontFamily', '', 'legend'), '</fieldset>'].join('')\n });\n };\n /**\n * Create controls for the component\n *\n * @return {Element}\n * The element that was created.\n *\n * @private\n */\n\n\n _proto.createElControls_ = function createElControls_() {\n var defaultsDescription = this.localize('restore all settings to the default values');\n return createEl('div', {\n className: 'vjs-track-settings-controls',\n innerHTML: [\"<button type=\\\"button\\\" class=\\\"vjs-default-button\\\" title=\\\"\" + defaultsDescription + \"\\\">\", this.localize('Reset'), \"<span class=\\\"vjs-control-text\\\"> \" + defaultsDescription + \"</span>\", '</button>', \"<button type=\\\"button\\\" class=\\\"vjs-done-button\\\">\" + this.localize('Done') + \"</button>\"].join('')\n });\n };\n\n _proto.content = function content() {\n return [this.createElColors_(), this.createElFont_(), this.createElControls_()];\n };\n\n _proto.label = function label() {\n return this.localize('Caption Settings Dialog');\n };\n\n _proto.description = function description() {\n return this.localize('Beginning of dialog window. Escape will cancel and close the window.');\n };\n\n _proto.buildCSSClass = function buildCSSClass() {\n return _ModalDialog.prototype.buildCSSClass.call(this) + ' vjs-text-track-settings';\n };\n /**\n * Gets an object of text track settings (or null).\n *\n * @return {Object}\n * An object with config values parsed from the DOM or localStorage.\n */\n\n\n _proto.getValues = function getValues() {\n var _this3 = this;\n\n return reduce(selectConfigs, function (accum, config, key) {\n var value = getSelectedOptionValue(_this3.$(config.selector), config.parser);\n\n if (value !== undefined) {\n accum[key] = value;\n }\n\n return accum;\n }, {});\n };\n /**\n * Sets text track settings from an object of values.\n *\n * @param {Object} values\n * An object with config values parsed from the DOM or localStorage.\n */\n\n\n _proto.setValues = function setValues(values) {\n var _this4 = this;\n\n each(selectConfigs, function (config, key) {\n setSelectedOption(_this4.$(config.selector), values[key], config.parser);\n });\n };\n /**\n * Sets all `<select>` elements to their default values.\n */\n\n\n _proto.setDefaults = function setDefaults() {\n var _this5 = this;\n\n each(selectConfigs, function (config) {\n var index = config.hasOwnProperty('default') ? config.default : 0;\n _this5.$(config.selector).selectedIndex = index;\n });\n };\n /**\n * Restore texttrack settings from localStorage\n */\n\n\n _proto.restoreSettings = function restoreSettings() {\n var values;\n\n try {\n values = JSON.parse(window$1.localStorage.getItem(LOCAL_STORAGE_KEY));\n } catch (err) {\n log.warn(err);\n }\n\n if (values) {\n this.setValues(values);\n }\n };\n /**\n * Save text track settings to localStorage\n */\n\n\n _proto.saveSettings = function saveSettings() {\n if (!this.options_.persistTextTrackSettings) {\n return;\n }\n\n var values = this.getValues();\n\n try {\n if (Object.keys(values).length) {\n window$1.localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(values));\n } else {\n window$1.localStorage.removeItem(LOCAL_STORAGE_KEY);\n }\n } catch (err) {\n log.warn(err);\n }\n };\n /**\n * Update display of text track settings\n */\n\n\n _proto.updateDisplay = function updateDisplay() {\n var ttDisplay = this.player_.getChild('textTrackDisplay');\n\n if (ttDisplay) {\n ttDisplay.updateDisplay();\n }\n };\n /**\n * conditionally blur the element and refocus the captions button\n *\n * @private\n */\n\n\n _proto.conditionalBlur_ = function conditionalBlur_() {\n this.previouslyActiveEl_ = null;\n this.off(document, 'keydown', this.handleKeyDown);\n var cb = this.player_.controlBar;\n var subsCapsBtn = cb && cb.subsCapsButton;\n var ccBtn = cb && cb.captionsButton;\n\n if (subsCapsBtn) {\n subsCapsBtn.focus();\n } else if (ccBtn) {\n ccBtn.focus();\n }\n };\n\n return TextTrackSettings;\n}(ModalDialog);\n\nComponent.registerComponent('TextTrackSettings', TextTrackSettings);\n\n/**\n * A Resize Manager. It is in charge of triggering `playerresize` on the player in the right conditions.\n *\n * It'll either create an iframe and use a debounced resize handler on it or use the new {@link https://wicg.github.io/ResizeObserver/|ResizeObserver}.\n *\n * If the ResizeObserver is available natively, it will be used. A polyfill can be passed in as an option.\n * If a `playerresize` event is not needed, the ResizeManager component can be removed from the player, see the example below.\n * @example <caption>How to disable the resize manager</caption>\n * const player = videojs('#vid', {\n * resizeManager: false\n * });\n *\n * @see {@link https://wicg.github.io/ResizeObserver/|ResizeObserver specification}\n *\n * @extends Component\n */\n\nvar ResizeManager =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(ResizeManager, _Component);\n\n /**\n * Create the ResizeManager.\n *\n * @param {Object} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of ResizeManager options.\n *\n * @param {Object} [options.ResizeObserver]\n * A polyfill for ResizeObserver can be passed in here.\n * If this is set to null it will ignore the native ResizeObserver and fall back to the iframe fallback.\n */\n function ResizeManager(player, options) {\n var _this;\n\n var RESIZE_OBSERVER_AVAILABLE = options.ResizeObserver || window$1.ResizeObserver; // if `null` was passed, we want to disable the ResizeObserver\n\n if (options.ResizeObserver === null) {\n RESIZE_OBSERVER_AVAILABLE = false;\n } // Only create an element when ResizeObserver isn't available\n\n\n var options_ = mergeOptions({\n createEl: !RESIZE_OBSERVER_AVAILABLE,\n reportTouchActivity: false\n }, options);\n _this = _Component.call(this, player, options_) || this;\n _this.ResizeObserver = options.ResizeObserver || window$1.ResizeObserver;\n _this.loadListener_ = null;\n _this.resizeObserver_ = null;\n _this.debouncedHandler_ = debounce(function () {\n _this.resizeHandler();\n }, 100, false, _assertThisInitialized(_assertThisInitialized(_this)));\n\n if (RESIZE_OBSERVER_AVAILABLE) {\n _this.resizeObserver_ = new _this.ResizeObserver(_this.debouncedHandler_);\n\n _this.resizeObserver_.observe(player.el());\n } else {\n _this.loadListener_ = function () {\n if (!_this.el_ || !_this.el_.contentWindow) {\n return;\n }\n\n on(_this.el_.contentWindow, 'resize', _this.debouncedHandler_);\n };\n\n _this.one('load', _this.loadListener_);\n }\n\n return _this;\n }\n\n var _proto = ResizeManager.prototype;\n\n _proto.createEl = function createEl() {\n return _Component.prototype.createEl.call(this, 'iframe', {\n className: 'vjs-resize-manager'\n });\n };\n /**\n * Called when a resize is triggered on the iframe or a resize is observed via the ResizeObserver\n *\n * @fires Player#playerresize\n */\n\n\n _proto.resizeHandler = function resizeHandler() {\n /**\n * Called when the player size has changed\n *\n * @event Player#playerresize\n * @type {EventTarget~Event}\n */\n // make sure player is still around to trigger\n // prevents this from causing an error after dispose\n if (!this.player_ || !this.player_.trigger) {\n return;\n }\n\n this.player_.trigger('playerresize');\n };\n\n _proto.dispose = function dispose() {\n if (this.debouncedHandler_) {\n this.debouncedHandler_.cancel();\n }\n\n if (this.resizeObserver_) {\n if (this.player_.el()) {\n this.resizeObserver_.unobserve(this.player_.el());\n }\n\n this.resizeObserver_.disconnect();\n }\n\n if (this.el_ && this.el_.contentWindow) {\n off(this.el_.contentWindow, 'resize', this.debouncedHandler_);\n }\n\n if (this.loadListener_) {\n this.off('load', this.loadListener_);\n }\n\n this.ResizeObserver = null;\n this.resizeObserver = null;\n this.debouncedHandler_ = null;\n this.loadListener_ = null;\n };\n\n return ResizeManager;\n}(Component);\n\nComponent.registerComponent('ResizeManager', ResizeManager);\n\n/* track when we are at the live edge, and other helpers for live playback */\n\nvar LiveTracker =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(LiveTracker, _Component);\n\n function LiveTracker(player, options) {\n var _this;\n\n // LiveTracker does not need an element\n var options_ = mergeOptions({\n createEl: false\n }, options);\n _this = _Component.call(this, player, options_) || this;\n\n _this.reset_();\n\n _this.on(_this.player_, 'durationchange', _this.handleDurationchange);\n\n return _this;\n }\n\n var _proto = LiveTracker.prototype;\n\n _proto.isBehind_ = function isBehind_() {\n // don't report that we are behind until a timeupdate has been seen\n if (!this.timeupdateSeen_) {\n return false;\n }\n\n var liveCurrentTime = this.liveCurrentTime();\n var currentTime = this.player_.currentTime();\n var seekableIncrement = this.seekableIncrement_; // the live edge window is the amount of seconds away from live\n // that a player can be, but still be considered live.\n // we add 0.07 because the live tracking happens every 30ms\n // and we want some wiggle room for short segment live playback\n\n var liveEdgeWindow = seekableIncrement * 2 + 0.07; // on Android liveCurrentTime can bee Infinity, because seekableEnd\n // can be Infinity, so we handle that case.\n\n return liveCurrentTime !== Infinity && liveCurrentTime - liveEdgeWindow >= currentTime;\n }; // all the functionality for tracking when seek end changes\n // and for tracking how far past seek end we should be\n\n\n _proto.trackLive_ = function trackLive_() {\n this.pastSeekEnd_ = this.pastSeekEnd_;\n var seekable = this.player_.seekable(); // skip undefined seekable\n\n if (!seekable || !seekable.length) {\n return;\n }\n\n var newSeekEnd = this.seekableEnd(); // we can only tell if we are behind live, when seekable changes\n // once we detect that seekable has changed we check the new seek\n // end against current time, with a fudge value of half a second.\n\n if (newSeekEnd !== this.lastSeekEnd_) {\n if (this.lastSeekEnd_) {\n this.seekableIncrement_ = Math.abs(newSeekEnd - this.lastSeekEnd_);\n }\n\n this.pastSeekEnd_ = 0;\n this.lastSeekEnd_ = newSeekEnd;\n this.trigger('seekableendchange');\n }\n\n this.pastSeekEnd_ = this.pastSeekEnd() + 0.03;\n\n if (this.isBehind_() !== this.behindLiveEdge()) {\n this.behindLiveEdge_ = this.isBehind_();\n this.trigger('liveedgechange');\n }\n };\n /**\n * handle a durationchange event on the player\n * and start/stop tracking accordingly.\n */\n\n\n _proto.handleDurationchange = function handleDurationchange() {\n if (this.player_.duration() === Infinity) {\n this.startTracking();\n } else {\n this.stopTracking();\n }\n };\n /**\n * start tracking live playback\n */\n\n\n _proto.startTracking = function startTracking() {\n var _this2 = this;\n\n if (this.isTracking()) {\n return;\n }\n\n this.trackingInterval_ = this.setInterval(this.trackLive_, 30);\n this.trackLive_();\n this.on(this.player_, 'play', this.trackLive_);\n this.on(this.player_, 'pause', this.trackLive_);\n this.one(this.player_, 'play', this.handlePlay); // this is to prevent showing that we are not live\n // before a video starts to play\n\n if (!this.timeupdateSeen_) {\n this.handleTimeupdate = function () {\n _this2.timeupdateSeen_ = true;\n _this2.handleTimeupdate = null;\n };\n\n this.one(this.player_, 'timeupdate', this.handleTimeupdate);\n }\n };\n\n _proto.handlePlay = function handlePlay() {\n this.one(this.player_, 'timeupdate', this.seekToLiveEdge);\n };\n /**\n * Stop tracking, and set all internal variables to\n * their initial value.\n */\n\n\n _proto.reset_ = function reset_() {\n this.pastSeekEnd_ = 0;\n this.lastSeekEnd_ = null;\n this.behindLiveEdge_ = null;\n this.timeupdateSeen_ = false;\n this.clearInterval(this.trackingInterval_);\n this.trackingInterval_ = null;\n this.seekableIncrement_ = 12;\n this.off(this.player_, 'play', this.trackLive_);\n this.off(this.player_, 'pause', this.trackLive_);\n this.off(this.player_, 'play', this.handlePlay);\n this.off(this.player_, 'timeupdate', this.seekToLiveEdge);\n\n if (this.handleTimeupdate) {\n this.off(this.player_, 'timeupdate', this.handleTimeupdate);\n this.handleTimeupdate = null;\n }\n };\n /**\n * stop tracking live playback\n */\n\n\n _proto.stopTracking = function stopTracking() {\n if (!this.isTracking()) {\n return;\n }\n\n this.reset_();\n };\n /**\n * A helper to get the player seekable end\n * so that we don't have to null check everywhere\n */\n\n\n _proto.seekableEnd = function seekableEnd() {\n var seekable = this.player_.seekable();\n var seekableEnds = [];\n var i = seekable ? seekable.length : 0;\n\n while (i--) {\n seekableEnds.push(seekable.end(i));\n } // grab the furthest seekable end after sorting, or if there are none\n // default to Infinity\n\n\n return seekableEnds.length ? seekableEnds.sort()[seekableEnds.length - 1] : Infinity;\n };\n /**\n * A helper to get the player seekable start\n * so that we don't have to null check everywhere\n */\n\n\n _proto.seekableStart = function seekableStart() {\n var seekable = this.player_.seekable();\n var seekableStarts = [];\n var i = seekable ? seekable.length : 0;\n\n while (i--) {\n seekableStarts.push(seekable.start(i));\n } // grab the first seekable start after sorting, or if there are none\n // default to 0\n\n\n return seekableStarts.length ? seekableStarts.sort()[0] : 0;\n };\n /**\n * Get the live time window\n */\n\n\n _proto.liveWindow = function liveWindow() {\n var liveCurrentTime = this.liveCurrentTime();\n\n if (liveCurrentTime === Infinity) {\n return Infinity;\n }\n\n return liveCurrentTime - this.seekableStart();\n };\n /**\n * Determines if the player is live, only checks if this component\n * is tracking live playback or not\n */\n\n\n _proto.isLive = function isLive() {\n return this.isTracking();\n };\n /**\n * Determines if currentTime is at the live edge and won't fall behind\n * on each seekableendchange\n */\n\n\n _proto.atLiveEdge = function atLiveEdge() {\n return !this.behindLiveEdge();\n };\n /**\n * get what we expect the live current time to be\n */\n\n\n _proto.liveCurrentTime = function liveCurrentTime() {\n return this.pastSeekEnd() + this.seekableEnd();\n };\n /**\n * Returns how far past seek end we expect current time to be\n */\n\n\n _proto.pastSeekEnd = function pastSeekEnd() {\n return this.pastSeekEnd_;\n };\n /**\n * If we are currently behind the live edge, aka currentTime will be\n * behind on a seekableendchange\n */\n\n\n _proto.behindLiveEdge = function behindLiveEdge() {\n return this.behindLiveEdge_;\n };\n\n _proto.isTracking = function isTracking() {\n return typeof this.trackingInterval_ === 'number';\n };\n /**\n * Seek to the live edge if we are behind the live edge\n */\n\n\n _proto.seekToLiveEdge = function seekToLiveEdge() {\n if (this.atLiveEdge()) {\n return;\n }\n\n this.player_.currentTime(this.liveCurrentTime());\n\n if (this.player_.paused()) {\n this.player_.play();\n }\n };\n\n _proto.dispose = function dispose() {\n this.stopTracking();\n\n _Component.prototype.dispose.call(this);\n };\n\n return LiveTracker;\n}(Component);\n\nComponent.registerComponent('LiveTracker', LiveTracker);\n\n/**\n * This function is used to fire a sourceset when there is something\n * similar to `mediaEl.load()` being called. It will try to find the source via\n * the `src` attribute and then the `<source>` elements. It will then fire `sourceset`\n * with the source that was found or empty string if we cannot know. If it cannot\n * find a source then `sourceset` will not be fired.\n *\n * @param {Html5} tech\n * The tech object that sourceset was setup on\n *\n * @return {boolean}\n * returns false if the sourceset was not fired and true otherwise.\n */\n\nvar sourcesetLoad = function sourcesetLoad(tech) {\n var el = tech.el(); // if `el.src` is set, that source will be loaded.\n\n if (el.hasAttribute('src')) {\n tech.triggerSourceset(el.src);\n return true;\n }\n /**\n * Since there isn't a src property on the media element, source elements will be used for\n * implementing the source selection algorithm. This happens asynchronously and\n * for most cases were there is more than one source we cannot tell what source will\n * be loaded, without re-implementing the source selection algorithm. At this time we are not\n * going to do that. There are three special cases that we do handle here though:\n *\n * 1. If there are no sources, do not fire `sourceset`.\n * 2. If there is only one `<source>` with a `src` property/attribute that is our `src`\n * 3. If there is more than one `<source>` but all of them have the same `src` url.\n * That will be our src.\n */\n\n\n var sources = tech.$$('source');\n var srcUrls = [];\n var src = ''; // if there are no sources, do not fire sourceset\n\n if (!sources.length) {\n return false;\n } // only count valid/non-duplicate source elements\n\n\n for (var i = 0; i < sources.length; i++) {\n var url = sources[i].src;\n\n if (url && srcUrls.indexOf(url) === -1) {\n srcUrls.push(url);\n }\n } // there were no valid sources\n\n\n if (!srcUrls.length) {\n return false;\n } // there is only one valid source element url\n // use that\n\n\n if (srcUrls.length === 1) {\n src = srcUrls[0];\n }\n\n tech.triggerSourceset(src);\n return true;\n};\n/**\n * our implementation of an `innerHTML` descriptor for browsers\n * that do not have one.\n */\n\n\nvar innerHTMLDescriptorPolyfill = Object.defineProperty({}, 'innerHTML', {\n get: function get() {\n return this.cloneNode(true).innerHTML;\n },\n set: function set(v) {\n // make a dummy node to use innerHTML on\n var dummy = document.createElement(this.nodeName.toLowerCase()); // set innerHTML to the value provided\n\n dummy.innerHTML = v; // make a document fragment to hold the nodes from dummy\n\n var docFrag = document.createDocumentFragment(); // copy all of the nodes created by the innerHTML on dummy\n // to the document fragment\n\n while (dummy.childNodes.length) {\n docFrag.appendChild(dummy.childNodes[0]);\n } // remove content\n\n\n this.innerText = ''; // now we add all of that html in one by appending the\n // document fragment. This is how innerHTML does it.\n\n window$1.Element.prototype.appendChild.call(this, docFrag); // then return the result that innerHTML's setter would\n\n return this.innerHTML;\n }\n});\n/**\n * Get a property descriptor given a list of priorities and the\n * property to get.\n */\n\nvar getDescriptor = function getDescriptor(priority, prop) {\n var descriptor = {};\n\n for (var i = 0; i < priority.length; i++) {\n descriptor = Object.getOwnPropertyDescriptor(priority[i], prop);\n\n if (descriptor && descriptor.set && descriptor.get) {\n break;\n }\n }\n\n descriptor.enumerable = true;\n descriptor.configurable = true;\n return descriptor;\n};\n\nvar getInnerHTMLDescriptor = function getInnerHTMLDescriptor(tech) {\n return getDescriptor([tech.el(), window$1.HTMLMediaElement.prototype, window$1.Element.prototype, innerHTMLDescriptorPolyfill], 'innerHTML');\n};\n/**\n * Patches browser internal functions so that we can tell synchronously\n * if a `<source>` was appended to the media element. For some reason this\n * causes a `sourceset` if the the media element is ready and has no source.\n * This happens when:\n * - The page has just loaded and the media element does not have a source.\n * - The media element was emptied of all sources, then `load()` was called.\n *\n * It does this by patching the following functions/properties when they are supported:\n *\n * - `append()` - can be used to add a `<source>` element to the media element\n * - `appendChild()` - can be used to add a `<source>` element to the media element\n * - `insertAdjacentHTML()` - can be used to add a `<source>` element to the media element\n * - `innerHTML` - can be used to add a `<source>` element to the media element\n *\n * @param {Html5} tech\n * The tech object that sourceset is being setup on.\n */\n\n\nvar firstSourceWatch = function firstSourceWatch(tech) {\n var el = tech.el(); // make sure firstSourceWatch isn't setup twice.\n\n if (el.resetSourceWatch_) {\n return;\n }\n\n var old = {};\n var innerDescriptor = getInnerHTMLDescriptor(tech);\n\n var appendWrapper = function appendWrapper(appendFn) {\n return function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var retval = appendFn.apply(el, args);\n sourcesetLoad(tech);\n return retval;\n };\n };\n\n ['append', 'appendChild', 'insertAdjacentHTML'].forEach(function (k) {\n if (!el[k]) {\n return;\n } // store the old function\n\n\n old[k] = el[k]; // call the old function with a sourceset if a source\n // was loaded\n\n el[k] = appendWrapper(old[k]);\n });\n Object.defineProperty(el, 'innerHTML', mergeOptions(innerDescriptor, {\n set: appendWrapper(innerDescriptor.set)\n }));\n\n el.resetSourceWatch_ = function () {\n el.resetSourceWatch_ = null;\n Object.keys(old).forEach(function (k) {\n el[k] = old[k];\n });\n Object.defineProperty(el, 'innerHTML', innerDescriptor);\n }; // on the first sourceset, we need to revert our changes\n\n\n tech.one('sourceset', el.resetSourceWatch_);\n};\n/**\n * our implementation of a `src` descriptor for browsers\n * that do not have one.\n */\n\n\nvar srcDescriptorPolyfill = Object.defineProperty({}, 'src', {\n get: function get() {\n if (this.hasAttribute('src')) {\n return getAbsoluteURL(window$1.Element.prototype.getAttribute.call(this, 'src'));\n }\n\n return '';\n },\n set: function set(v) {\n window$1.Element.prototype.setAttribute.call(this, 'src', v);\n return v;\n }\n});\n\nvar getSrcDescriptor = function getSrcDescriptor(tech) {\n return getDescriptor([tech.el(), window$1.HTMLMediaElement.prototype, srcDescriptorPolyfill], 'src');\n};\n/**\n * setup `sourceset` handling on the `Html5` tech. This function\n * patches the following element properties/functions:\n *\n * - `src` - to determine when `src` is set\n * - `setAttribute()` - to determine when `src` is set\n * - `load()` - this re-triggers the source selection algorithm, and can\n * cause a sourceset.\n *\n * If there is no source when we are adding `sourceset` support or during a `load()`\n * we also patch the functions listed in `firstSourceWatch`.\n *\n * @param {Html5} tech\n * The tech to patch\n */\n\n\nvar setupSourceset = function setupSourceset(tech) {\n if (!tech.featuresSourceset) {\n return;\n }\n\n var el = tech.el(); // make sure sourceset isn't setup twice.\n\n if (el.resetSourceset_) {\n return;\n }\n\n var srcDescriptor = getSrcDescriptor(tech);\n var oldSetAttribute = el.setAttribute;\n var oldLoad = el.load;\n Object.defineProperty(el, 'src', mergeOptions(srcDescriptor, {\n set: function set(v) {\n var retval = srcDescriptor.set.call(el, v); // we use the getter here to get the actual value set on src\n\n tech.triggerSourceset(el.src);\n return retval;\n }\n }));\n\n el.setAttribute = function (n, v) {\n var retval = oldSetAttribute.call(el, n, v);\n\n if (/src/i.test(n)) {\n tech.triggerSourceset(el.src);\n }\n\n return retval;\n };\n\n el.load = function () {\n var retval = oldLoad.call(el); // if load was called, but there was no source to fire\n // sourceset on. We have to watch for a source append\n // as that can trigger a `sourceset` when the media element\n // has no source\n\n if (!sourcesetLoad(tech)) {\n tech.triggerSourceset('');\n firstSourceWatch(tech);\n }\n\n return retval;\n };\n\n if (el.currentSrc) {\n tech.triggerSourceset(el.currentSrc);\n } else if (!sourcesetLoad(tech)) {\n firstSourceWatch(tech);\n }\n\n el.resetSourceset_ = function () {\n el.resetSourceset_ = null;\n el.load = oldLoad;\n el.setAttribute = oldSetAttribute;\n Object.defineProperty(el, 'src', srcDescriptor);\n\n if (el.resetSourceWatch_) {\n el.resetSourceWatch_();\n }\n };\n};\n\nfunction _templateObject$1() {\n var data = _taggedTemplateLiteralLoose([\"Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\\n This may prevent text tracks from loading.\"]);\n\n _templateObject$1 = function _templateObject() {\n return data;\n };\n\n return data;\n}\n/**\n * HTML5 Media Controller - Wrapper for HTML5 Media API\n *\n * @mixes Tech~SourceHandlerAdditions\n * @extends Tech\n */\n\nvar Html5 =\n/*#__PURE__*/\nfunction (_Tech) {\n _inheritsLoose(Html5, _Tech);\n\n /**\n * Create an instance of this Tech.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Component~ReadyCallback} ready\n * Callback function to call when the `HTML5` Tech is ready.\n */\n function Html5(options, ready) {\n var _this;\n\n _this = _Tech.call(this, options, ready) || this;\n var source = options.source;\n var crossoriginTracks = false; // Set the source if one is provided\n // 1) Check if the source is new (if not, we want to keep the original so playback isn't interrupted)\n // 2) Check to see if the network state of the tag was failed at init, and if so, reset the source\n // anyway so the error gets fired.\n\n if (source && (_this.el_.currentSrc !== source.src || options.tag && options.tag.initNetworkState_ === 3)) {\n _this.setSource(source);\n } else {\n _this.handleLateInit_(_this.el_);\n } // setup sourceset after late sourceset/init\n\n\n if (options.enableSourceset) {\n _this.setupSourcesetHandling_();\n }\n\n if (_this.el_.hasChildNodes()) {\n var nodes = _this.el_.childNodes;\n var nodesLength = nodes.length;\n var removeNodes = [];\n\n while (nodesLength--) {\n var node = nodes[nodesLength];\n var nodeName = node.nodeName.toLowerCase();\n\n if (nodeName === 'track') {\n if (!_this.featuresNativeTextTracks) {\n // Empty video tag tracks so the built-in player doesn't use them also.\n // This may not be fast enough to stop HTML5 browsers from reading the tags\n // so we'll need to turn off any default tracks if we're manually doing\n // captions and subtitles. videoElement.textTracks\n removeNodes.push(node);\n } else {\n // store HTMLTrackElement and TextTrack to remote list\n _this.remoteTextTrackEls().addTrackElement_(node);\n\n _this.remoteTextTracks().addTrack(node.track);\n\n _this.textTracks().addTrack(node.track);\n\n if (!crossoriginTracks && !_this.el_.hasAttribute('crossorigin') && isCrossOrigin(node.src)) {\n crossoriginTracks = true;\n }\n }\n }\n }\n\n for (var i = 0; i < removeNodes.length; i++) {\n _this.el_.removeChild(removeNodes[i]);\n }\n }\n\n _this.proxyNativeTracks_();\n\n if (_this.featuresNativeTextTracks && crossoriginTracks) {\n log.warn(tsml(_templateObject$1()));\n } // prevent iOS Safari from disabling metadata text tracks during native playback\n\n\n _this.restoreMetadataTracksInIOSNativePlayer_(); // Determine if native controls should be used\n // Our goal should be to get the custom controls on mobile solid everywhere\n // so we can remove this all together. Right now this will block custom\n // controls on touch enabled laptops like the Chrome Pixel\n\n\n if ((TOUCH_ENABLED || IS_IPHONE || IS_NATIVE_ANDROID) && options.nativeControlsForTouch === true) {\n _this.setControls(true);\n } // on iOS, we want to proxy `webkitbeginfullscreen` and `webkitendfullscreen`\n // into a `fullscreenchange` event\n\n\n _this.proxyWebkitFullscreen_();\n\n _this.triggerReady();\n\n return _this;\n }\n /**\n * Dispose of `HTML5` media element and remove all tracks.\n */\n\n\n var _proto = Html5.prototype;\n\n _proto.dispose = function dispose() {\n if (this.el_ && this.el_.resetSourceset_) {\n this.el_.resetSourceset_();\n }\n\n Html5.disposeMediaElement(this.el_);\n this.options_ = null; // tech will handle clearing of the emulated track list\n\n _Tech.prototype.dispose.call(this);\n };\n /**\n * Modify the media element so that we can detect when\n * the source is changed. Fires `sourceset` just after the source has changed\n */\n\n\n _proto.setupSourcesetHandling_ = function setupSourcesetHandling_() {\n setupSourceset(this);\n };\n /**\n * When a captions track is enabled in the iOS Safari native player, all other\n * tracks are disabled (including metadata tracks), which nulls all of their\n * associated cue points. This will restore metadata tracks to their pre-fullscreen\n * state in those cases so that cue points are not needlessly lost.\n *\n * @private\n */\n\n\n _proto.restoreMetadataTracksInIOSNativePlayer_ = function restoreMetadataTracksInIOSNativePlayer_() {\n var textTracks = this.textTracks();\n var metadataTracksPreFullscreenState; // captures a snapshot of every metadata track's current state\n\n var takeMetadataTrackSnapshot = function takeMetadataTrackSnapshot() {\n metadataTracksPreFullscreenState = [];\n\n for (var i = 0; i < textTracks.length; i++) {\n var track = textTracks[i];\n\n if (track.kind === 'metadata') {\n metadataTracksPreFullscreenState.push({\n track: track,\n storedMode: track.mode\n });\n }\n }\n }; // snapshot each metadata track's initial state, and update the snapshot\n // each time there is a track 'change' event\n\n\n takeMetadataTrackSnapshot();\n textTracks.addEventListener('change', takeMetadataTrackSnapshot);\n this.on('dispose', function () {\n return textTracks.removeEventListener('change', takeMetadataTrackSnapshot);\n });\n\n var restoreTrackMode = function restoreTrackMode() {\n for (var i = 0; i < metadataTracksPreFullscreenState.length; i++) {\n var storedTrack = metadataTracksPreFullscreenState[i];\n\n if (storedTrack.track.mode === 'disabled' && storedTrack.track.mode !== storedTrack.storedMode) {\n storedTrack.track.mode = storedTrack.storedMode;\n }\n } // we only want this handler to be executed on the first 'change' event\n\n\n textTracks.removeEventListener('change', restoreTrackMode);\n }; // when we enter fullscreen playback, stop updating the snapshot and\n // restore all track modes to their pre-fullscreen state\n\n\n this.on('webkitbeginfullscreen', function () {\n textTracks.removeEventListener('change', takeMetadataTrackSnapshot); // remove the listener before adding it just in case it wasn't previously removed\n\n textTracks.removeEventListener('change', restoreTrackMode);\n textTracks.addEventListener('change', restoreTrackMode);\n }); // start updating the snapshot again after leaving fullscreen\n\n this.on('webkitendfullscreen', function () {\n // remove the listener before adding it just in case it wasn't previously removed\n textTracks.removeEventListener('change', takeMetadataTrackSnapshot);\n textTracks.addEventListener('change', takeMetadataTrackSnapshot); // remove the restoreTrackMode handler in case it wasn't triggered during fullscreen playback\n\n textTracks.removeEventListener('change', restoreTrackMode);\n });\n };\n /**\n * Attempt to force override of tracks for the given type\n *\n * @param {string} type - Track type to override, possible values include 'Audio',\n * 'Video', and 'Text'.\n * @param {boolean} override - If set to true native audio/video will be overridden,\n * otherwise native audio/video will potentially be used.\n * @private\n */\n\n\n _proto.overrideNative_ = function overrideNative_(type, override) {\n var _this2 = this;\n\n // If there is no behavioral change don't add/remove listeners\n if (override !== this[\"featuresNative\" + type + \"Tracks\"]) {\n return;\n }\n\n var lowerCaseType = type.toLowerCase();\n\n if (this[lowerCaseType + \"TracksListeners_\"]) {\n Object.keys(this[lowerCaseType + \"TracksListeners_\"]).forEach(function (eventName) {\n var elTracks = _this2.el()[lowerCaseType + \"Tracks\"];\n\n elTracks.removeEventListener(eventName, _this2[lowerCaseType + \"TracksListeners_\"][eventName]);\n });\n }\n\n this[\"featuresNative\" + type + \"Tracks\"] = !override;\n this[lowerCaseType + \"TracksListeners_\"] = null;\n this.proxyNativeTracksForType_(lowerCaseType);\n };\n /**\n * Attempt to force override of native audio tracks.\n *\n * @param {boolean} override - If set to true native audio will be overridden,\n * otherwise native audio will potentially be used.\n */\n\n\n _proto.overrideNativeAudioTracks = function overrideNativeAudioTracks(override) {\n this.overrideNative_('Audio', override);\n };\n /**\n * Attempt to force override of native video tracks.\n *\n * @param {boolean} override - If set to true native video will be overridden,\n * otherwise native video will potentially be used.\n */\n\n\n _proto.overrideNativeVideoTracks = function overrideNativeVideoTracks(override) {\n this.overrideNative_('Video', override);\n };\n /**\n * Proxy native track list events for the given type to our track\n * lists if the browser we are playing in supports that type of track list.\n *\n * @param {string} name - Track type; values include 'audio', 'video', and 'text'\n * @private\n */\n\n\n _proto.proxyNativeTracksForType_ = function proxyNativeTracksForType_(name) {\n var _this3 = this;\n\n var props = NORMAL[name];\n var elTracks = this.el()[props.getterName];\n var techTracks = this[props.getterName]();\n\n if (!this[\"featuresNative\" + props.capitalName + \"Tracks\"] || !elTracks || !elTracks.addEventListener) {\n return;\n }\n\n var listeners = {\n change: function change(e) {\n techTracks.trigger({\n type: 'change',\n target: techTracks,\n currentTarget: techTracks,\n srcElement: techTracks\n });\n },\n addtrack: function addtrack(e) {\n techTracks.addTrack(e.track);\n },\n removetrack: function removetrack(e) {\n techTracks.removeTrack(e.track);\n }\n };\n\n var removeOldTracks = function removeOldTracks() {\n var removeTracks = [];\n\n for (var i = 0; i < techTracks.length; i++) {\n var found = false;\n\n for (var j = 0; j < elTracks.length; j++) {\n if (elTracks[j] === techTracks[i]) {\n found = true;\n break;\n }\n }\n\n if (!found) {\n removeTracks.push(techTracks[i]);\n }\n }\n\n while (removeTracks.length) {\n techTracks.removeTrack(removeTracks.shift());\n }\n };\n\n this[props.getterName + 'Listeners_'] = listeners;\n Object.keys(listeners).forEach(function (eventName) {\n var listener = listeners[eventName];\n elTracks.addEventListener(eventName, listener);\n\n _this3.on('dispose', function (e) {\n return elTracks.removeEventListener(eventName, listener);\n });\n }); // Remove (native) tracks that are not used anymore\n\n this.on('loadstart', removeOldTracks);\n this.on('dispose', function (e) {\n return _this3.off('loadstart', removeOldTracks);\n });\n };\n /**\n * Proxy all native track list events to our track lists if the browser we are playing\n * in supports that type of track list.\n *\n * @private\n */\n\n\n _proto.proxyNativeTracks_ = function proxyNativeTracks_() {\n var _this4 = this;\n\n NORMAL.names.forEach(function (name) {\n _this4.proxyNativeTracksForType_(name);\n });\n };\n /**\n * Create the `Html5` Tech's DOM element.\n *\n * @return {Element}\n * The element that gets created.\n */\n\n\n _proto.createEl = function createEl$$1() {\n var el = this.options_.tag; // Check if this browser supports moving the element into the box.\n // On the iPhone video will break if you move the element,\n // So we have to create a brand new element.\n // If we ingested the player div, we do not need to move the media element.\n\n if (!el || !(this.options_.playerElIngest || this.movingMediaElementInDOM)) {\n // If the original tag is still there, clone and remove it.\n if (el) {\n var clone = el.cloneNode(true);\n\n if (el.parentNode) {\n el.parentNode.insertBefore(clone, el);\n }\n\n Html5.disposeMediaElement(el);\n el = clone;\n } else {\n el = document.createElement('video'); // determine if native controls should be used\n\n var tagAttributes = this.options_.tag && getAttributes(this.options_.tag);\n var attributes = mergeOptions({}, tagAttributes);\n\n if (!TOUCH_ENABLED || this.options_.nativeControlsForTouch !== true) {\n delete attributes.controls;\n }\n\n setAttributes(el, assign(attributes, {\n id: this.options_.techId,\n class: 'vjs-tech'\n }));\n }\n\n el.playerId = this.options_.playerId;\n }\n\n if (typeof this.options_.preload !== 'undefined') {\n setAttribute(el, 'preload', this.options_.preload);\n } // Update specific tag settings, in case they were overridden\n // `autoplay` has to be *last* so that `muted` and `playsinline` are present\n // when iOS/Safari or other browsers attempt to autoplay.\n\n\n var settingsAttrs = ['loop', 'muted', 'playsinline', 'autoplay'];\n\n for (var i = 0; i < settingsAttrs.length; i++) {\n var attr = settingsAttrs[i];\n var value = this.options_[attr];\n\n if (typeof value !== 'undefined') {\n if (value) {\n setAttribute(el, attr, attr);\n } else {\n removeAttribute(el, attr);\n }\n\n el[attr] = value;\n }\n }\n\n return el;\n };\n /**\n * This will be triggered if the loadstart event has already fired, before videojs was\n * ready. Two known examples of when this can happen are:\n * 1. If we're loading the playback object after it has started loading\n * 2. The media is already playing the (often with autoplay on) then\n *\n * This function will fire another loadstart so that videojs can catchup.\n *\n * @fires Tech#loadstart\n *\n * @return {undefined}\n * returns nothing.\n */\n\n\n _proto.handleLateInit_ = function handleLateInit_(el) {\n if (el.networkState === 0 || el.networkState === 3) {\n // The video element hasn't started loading the source yet\n // or didn't find a source\n return;\n }\n\n if (el.readyState === 0) {\n // NetworkState is set synchronously BUT loadstart is fired at the\n // end of the current stack, usually before setInterval(fn, 0).\n // So at this point we know loadstart may have already fired or is\n // about to fire, and either way the player hasn't seen it yet.\n // We don't want to fire loadstart prematurely here and cause a\n // double loadstart so we'll wait and see if it happens between now\n // and the next loop, and fire it if not.\n // HOWEVER, we also want to make sure it fires before loadedmetadata\n // which could also happen between now and the next loop, so we'll\n // watch for that also.\n var loadstartFired = false;\n\n var setLoadstartFired = function setLoadstartFired() {\n loadstartFired = true;\n };\n\n this.on('loadstart', setLoadstartFired);\n\n var triggerLoadstart = function triggerLoadstart() {\n // We did miss the original loadstart. Make sure the player\n // sees loadstart before loadedmetadata\n if (!loadstartFired) {\n this.trigger('loadstart');\n }\n };\n\n this.on('loadedmetadata', triggerLoadstart);\n this.ready(function () {\n this.off('loadstart', setLoadstartFired);\n this.off('loadedmetadata', triggerLoadstart);\n\n if (!loadstartFired) {\n // We did miss the original native loadstart. Fire it now.\n this.trigger('loadstart');\n }\n });\n return;\n } // From here on we know that loadstart already fired and we missed it.\n // The other readyState events aren't as much of a problem if we double\n // them, so not going to go to as much trouble as loadstart to prevent\n // that unless we find reason to.\n\n\n var eventsToTrigger = ['loadstart']; // loadedmetadata: newly equal to HAVE_METADATA (1) or greater\n\n eventsToTrigger.push('loadedmetadata'); // loadeddata: newly increased to HAVE_CURRENT_DATA (2) or greater\n\n if (el.readyState >= 2) {\n eventsToTrigger.push('loadeddata');\n } // canplay: newly increased to HAVE_FUTURE_DATA (3) or greater\n\n\n if (el.readyState >= 3) {\n eventsToTrigger.push('canplay');\n } // canplaythrough: newly equal to HAVE_ENOUGH_DATA (4)\n\n\n if (el.readyState >= 4) {\n eventsToTrigger.push('canplaythrough');\n } // We still need to give the player time to add event listeners\n\n\n this.ready(function () {\n eventsToTrigger.forEach(function (type) {\n this.trigger(type);\n }, this);\n });\n };\n /**\n * Set current time for the `HTML5` tech.\n *\n * @param {number} seconds\n * Set the current time of the media to this.\n */\n\n\n _proto.setCurrentTime = function setCurrentTime(seconds) {\n try {\n this.el_.currentTime = seconds;\n } catch (e) {\n log(e, 'Video is not ready. (Video.js)'); // this.warning(VideoJS.warnings.videoNotReady);\n }\n };\n /**\n * Get the current duration of the HTML5 media element.\n *\n * @return {number}\n * The duration of the media or 0 if there is no duration.\n */\n\n\n _proto.duration = function duration() {\n var _this5 = this;\n\n // Android Chrome will report duration as Infinity for VOD HLS until after\n // playback has started, which triggers the live display erroneously.\n // Return NaN if playback has not started and trigger a durationupdate once\n // the duration can be reliably known.\n if (this.el_.duration === Infinity && IS_ANDROID && IS_CHROME && this.el_.currentTime === 0) {\n // Wait for the first `timeupdate` with currentTime > 0 - there may be\n // several with 0\n var checkProgress = function checkProgress() {\n if (_this5.el_.currentTime > 0) {\n // Trigger durationchange for genuinely live video\n if (_this5.el_.duration === Infinity) {\n _this5.trigger('durationchange');\n }\n\n _this5.off('timeupdate', checkProgress);\n }\n };\n\n this.on('timeupdate', checkProgress);\n return NaN;\n }\n\n return this.el_.duration || NaN;\n };\n /**\n * Get the current width of the HTML5 media element.\n *\n * @return {number}\n * The width of the HTML5 media element.\n */\n\n\n _proto.width = function width() {\n return this.el_.offsetWidth;\n };\n /**\n * Get the current height of the HTML5 media element.\n *\n * @return {number}\n * The height of the HTML5 media element.\n */\n\n\n _proto.height = function height() {\n return this.el_.offsetHeight;\n };\n /**\n * Proxy iOS `webkitbeginfullscreen` and `webkitendfullscreen` into\n * `fullscreenchange` event.\n *\n * @private\n * @fires fullscreenchange\n * @listens webkitendfullscreen\n * @listens webkitbeginfullscreen\n * @listens webkitbeginfullscreen\n */\n\n\n _proto.proxyWebkitFullscreen_ = function proxyWebkitFullscreen_() {\n var _this6 = this;\n\n if (!('webkitDisplayingFullscreen' in this.el_)) {\n return;\n }\n\n var endFn = function endFn() {\n this.trigger('fullscreenchange', {\n isFullscreen: false\n });\n };\n\n var beginFn = function beginFn() {\n if ('webkitPresentationMode' in this.el_ && this.el_.webkitPresentationMode !== 'picture-in-picture') {\n this.one('webkitendfullscreen', endFn);\n this.trigger('fullscreenchange', {\n isFullscreen: true\n });\n }\n };\n\n this.on('webkitbeginfullscreen', beginFn);\n this.on('dispose', function () {\n _this6.off('webkitbeginfullscreen', beginFn);\n\n _this6.off('webkitendfullscreen', endFn);\n });\n };\n /**\n * Check if fullscreen is supported on the current playback device.\n *\n * @return {boolean}\n * - True if fullscreen is supported.\n * - False if fullscreen is not supported.\n */\n\n\n _proto.supportsFullScreen = function supportsFullScreen() {\n if (typeof this.el_.webkitEnterFullScreen === 'function') {\n var userAgent = window$1.navigator && window$1.navigator.userAgent || ''; // Seems to be broken in Chromium/Chrome && Safari in Leopard\n\n if (/Android/.test(userAgent) || !/Chrome|Mac OS X 10.5/.test(userAgent)) {\n return true;\n }\n }\n\n return false;\n };\n /**\n * Request that the `HTML5` Tech enter fullscreen.\n */\n\n\n _proto.enterFullScreen = function enterFullScreen() {\n var video = this.el_;\n\n if (video.paused && video.networkState <= video.HAVE_METADATA) {\n // attempt to prime the video element for programmatic access\n // this isn't necessary on the desktop but shouldn't hurt\n this.el_.play(); // playing and pausing synchronously during the transition to fullscreen\n // can get iOS ~6.1 devices into a play/pause loop\n\n this.setTimeout(function () {\n video.pause();\n video.webkitEnterFullScreen();\n }, 0);\n } else {\n video.webkitEnterFullScreen();\n }\n };\n /**\n * Request that the `HTML5` Tech exit fullscreen.\n */\n\n\n _proto.exitFullScreen = function exitFullScreen() {\n this.el_.webkitExitFullScreen();\n };\n /**\n * A getter/setter for the `Html5` Tech's source object.\n * > Note: Please use {@link Html5#setSource}\n *\n * @param {Tech~SourceObject} [src]\n * The source object you want to set on the `HTML5` techs element.\n *\n * @return {Tech~SourceObject|undefined}\n * - The current source object when a source is not passed in.\n * - undefined when setting\n *\n * @deprecated Since version 5.\n */\n\n\n _proto.src = function src(_src) {\n if (_src === undefined) {\n return this.el_.src;\n } // Setting src through `src` instead of `setSrc` will be deprecated\n\n\n this.setSrc(_src);\n };\n /**\n * Reset the tech by removing all sources and then calling\n * {@link Html5.resetMediaElement}.\n */\n\n\n _proto.reset = function reset() {\n Html5.resetMediaElement(this.el_);\n };\n /**\n * Get the current source on the `HTML5` Tech. Falls back to returning the source from\n * the HTML5 media element.\n *\n * @return {Tech~SourceObject}\n * The current source object from the HTML5 tech. With a fallback to the\n * elements source.\n */\n\n\n _proto.currentSrc = function currentSrc() {\n if (this.currentSource_) {\n return this.currentSource_.src;\n }\n\n return this.el_.currentSrc;\n };\n /**\n * Set controls attribute for the HTML5 media Element.\n *\n * @param {string} val\n * Value to set the controls attribute to\n */\n\n\n _proto.setControls = function setControls(val) {\n this.el_.controls = !!val;\n };\n /**\n * Create and returns a remote {@link TextTrack} object.\n *\n * @param {string} kind\n * `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata)\n *\n * @param {string} [label]\n * Label to identify the text track\n *\n * @param {string} [language]\n * Two letter language abbreviation\n *\n * @return {TextTrack}\n * The TextTrack that gets created.\n */\n\n\n _proto.addTextTrack = function addTextTrack(kind, label, language) {\n if (!this.featuresNativeTextTracks) {\n return _Tech.prototype.addTextTrack.call(this, kind, label, language);\n }\n\n return this.el_.addTextTrack(kind, label, language);\n };\n /**\n * Creates either native TextTrack or an emulated TextTrack depending\n * on the value of `featuresNativeTextTracks`\n *\n * @param {Object} options\n * The object should contain the options to initialize the TextTrack with.\n *\n * @param {string} [options.kind]\n * `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata).\n *\n * @param {string} [options.label]\n * Label to identify the text track\n *\n * @param {string} [options.language]\n * Two letter language abbreviation.\n *\n * @param {boolean} [options.default]\n * Default this track to on.\n *\n * @param {string} [options.id]\n * The internal id to assign this track.\n *\n * @param {string} [options.src]\n * A source url for the track.\n *\n * @return {HTMLTrackElement}\n * The track element that gets created.\n */\n\n\n _proto.createRemoteTextTrack = function createRemoteTextTrack(options) {\n if (!this.featuresNativeTextTracks) {\n return _Tech.prototype.createRemoteTextTrack.call(this, options);\n }\n\n var htmlTrackElement = document.createElement('track');\n\n if (options.kind) {\n htmlTrackElement.kind = options.kind;\n }\n\n if (options.label) {\n htmlTrackElement.label = options.label;\n }\n\n if (options.language || options.srclang) {\n htmlTrackElement.srclang = options.language || options.srclang;\n }\n\n if (options.default) {\n htmlTrackElement.default = options.default;\n }\n\n if (options.id) {\n htmlTrackElement.id = options.id;\n }\n\n if (options.src) {\n htmlTrackElement.src = options.src;\n }\n\n return htmlTrackElement;\n };\n /**\n * Creates a remote text track object and returns an html track element.\n *\n * @param {Object} options The object should contain values for\n * kind, language, label, and src (location of the WebVTT file)\n * @param {boolean} [manualCleanup=true] if set to false, the TextTrack will be\n * automatically removed from the video element whenever the source changes\n * @return {HTMLTrackElement} An Html Track Element.\n * This can be an emulated {@link HTMLTrackElement} or a native one.\n * @deprecated The default value of the \"manualCleanup\" parameter will default\n * to \"false\" in upcoming versions of Video.js\n */\n\n\n _proto.addRemoteTextTrack = function addRemoteTextTrack(options, manualCleanup) {\n var htmlTrackElement = _Tech.prototype.addRemoteTextTrack.call(this, options, manualCleanup);\n\n if (this.featuresNativeTextTracks) {\n this.el().appendChild(htmlTrackElement);\n }\n\n return htmlTrackElement;\n };\n /**\n * Remove remote `TextTrack` from `TextTrackList` object\n *\n * @param {TextTrack} track\n * `TextTrack` object to remove\n */\n\n\n _proto.removeRemoteTextTrack = function removeRemoteTextTrack(track) {\n _Tech.prototype.removeRemoteTextTrack.call(this, track);\n\n if (this.featuresNativeTextTracks) {\n var tracks = this.$$('track');\n var i = tracks.length;\n\n while (i--) {\n if (track === tracks[i] || track === tracks[i].track) {\n this.el().removeChild(tracks[i]);\n }\n }\n }\n };\n /**\n * Gets available media playback quality metrics as specified by the W3C's Media\n * Playback Quality API.\n *\n * @see [Spec]{@link https://wicg.github.io/media-playback-quality}\n *\n * @return {Object}\n * An object with supported media playback quality metrics\n */\n\n\n _proto.getVideoPlaybackQuality = function getVideoPlaybackQuality() {\n if (typeof this.el().getVideoPlaybackQuality === 'function') {\n return this.el().getVideoPlaybackQuality();\n }\n\n var videoPlaybackQuality = {};\n\n if (typeof this.el().webkitDroppedFrameCount !== 'undefined' && typeof this.el().webkitDecodedFrameCount !== 'undefined') {\n videoPlaybackQuality.droppedVideoFrames = this.el().webkitDroppedFrameCount;\n videoPlaybackQuality.totalVideoFrames = this.el().webkitDecodedFrameCount;\n }\n\n if (window$1.performance && typeof window$1.performance.now === 'function') {\n videoPlaybackQuality.creationTime = window$1.performance.now();\n } else if (window$1.performance && window$1.performance.timing && typeof window$1.performance.timing.navigationStart === 'number') {\n videoPlaybackQuality.creationTime = window$1.Date.now() - window$1.performance.timing.navigationStart;\n }\n\n return videoPlaybackQuality;\n };\n\n return Html5;\n}(Tech);\n/* HTML5 Support Testing ---------------------------------------------------- */\n\n\nif (isReal()) {\n /**\n * Element for testing browser HTML5 media capabilities\n *\n * @type {Element}\n * @constant\n * @private\n */\n Html5.TEST_VID = document.createElement('video');\n var track = document.createElement('track');\n track.kind = 'captions';\n track.srclang = 'en';\n track.label = 'English';\n Html5.TEST_VID.appendChild(track);\n}\n/**\n * Check if HTML5 media is supported by this browser/device.\n *\n * @return {boolean}\n * - True if HTML5 media is supported.\n * - False if HTML5 media is not supported.\n */\n\n\nHtml5.isSupported = function () {\n // IE with no Media Player is a LIAR! (#984)\n try {\n Html5.TEST_VID.volume = 0.5;\n } catch (e) {\n return false;\n }\n\n return !!(Html5.TEST_VID && Html5.TEST_VID.canPlayType);\n};\n/**\n * Check if the tech can support the given type\n *\n * @param {string} type\n * The mimetype to check\n * @return {string} 'probably', 'maybe', or '' (empty string)\n */\n\n\nHtml5.canPlayType = function (type) {\n return Html5.TEST_VID.canPlayType(type);\n};\n/**\n * Check if the tech can support the given source\n *\n * @param {Object} srcObj\n * The source object\n * @param {Object} options\n * The options passed to the tech\n * @return {string} 'probably', 'maybe', or '' (empty string)\n */\n\n\nHtml5.canPlaySource = function (srcObj, options) {\n return Html5.canPlayType(srcObj.type);\n};\n/**\n * Check if the volume can be changed in this browser/device.\n * Volume cannot be changed in a lot of mobile devices.\n * Specifically, it can't be changed from 1 on iOS.\n *\n * @return {boolean}\n * - True if volume can be controlled\n * - False otherwise\n */\n\n\nHtml5.canControlVolume = function () {\n // IE will error if Windows Media Player not installed #3315\n try {\n var volume = Html5.TEST_VID.volume;\n Html5.TEST_VID.volume = volume / 2 + 0.1;\n return volume !== Html5.TEST_VID.volume;\n } catch (e) {\n return false;\n }\n};\n/**\n * Check if the volume can be muted in this browser/device.\n * Some devices, e.g. iOS, don't allow changing volume\n * but permits muting/unmuting.\n *\n * @return {bolean}\n * - True if volume can be muted\n * - False otherwise\n */\n\n\nHtml5.canMuteVolume = function () {\n try {\n var muted = Html5.TEST_VID.muted; // in some versions of iOS muted property doesn't always\n // work, so we want to set both property and attribute\n\n Html5.TEST_VID.muted = !muted;\n\n if (Html5.TEST_VID.muted) {\n setAttribute(Html5.TEST_VID, 'muted', 'muted');\n } else {\n removeAttribute(Html5.TEST_VID, 'muted', 'muted');\n }\n\n return muted !== Html5.TEST_VID.muted;\n } catch (e) {\n return false;\n }\n};\n/**\n * Check if the playback rate can be changed in this browser/device.\n *\n * @return {boolean}\n * - True if playback rate can be controlled\n * - False otherwise\n */\n\n\nHtml5.canControlPlaybackRate = function () {\n // Playback rate API is implemented in Android Chrome, but doesn't do anything\n // https://github.com/videojs/video.js/issues/3180\n if (IS_ANDROID && IS_CHROME && CHROME_VERSION < 58) {\n return false;\n } // IE will error if Windows Media Player not installed #3315\n\n\n try {\n var playbackRate = Html5.TEST_VID.playbackRate;\n Html5.TEST_VID.playbackRate = playbackRate / 2 + 0.1;\n return playbackRate !== Html5.TEST_VID.playbackRate;\n } catch (e) {\n return false;\n }\n};\n/**\n * Check if we can override a video/audio elements attributes, with\n * Object.defineProperty.\n *\n * @return {boolean}\n * - True if builtin attributes can be overridden\n * - False otherwise\n */\n\n\nHtml5.canOverrideAttributes = function () {\n // if we cannot overwrite the src/innerHTML property, there is no support\n // iOS 7 safari for instance cannot do this.\n try {\n var noop = function noop() {};\n\n Object.defineProperty(document.createElement('video'), 'src', {\n get: noop,\n set: noop\n });\n Object.defineProperty(document.createElement('audio'), 'src', {\n get: noop,\n set: noop\n });\n Object.defineProperty(document.createElement('video'), 'innerHTML', {\n get: noop,\n set: noop\n });\n Object.defineProperty(document.createElement('audio'), 'innerHTML', {\n get: noop,\n set: noop\n });\n } catch (e) {\n return false;\n }\n\n return true;\n};\n/**\n * Check to see if native `TextTrack`s are supported by this browser/device.\n *\n * @return {boolean}\n * - True if native `TextTrack`s are supported.\n * - False otherwise\n */\n\n\nHtml5.supportsNativeTextTracks = function () {\n return IS_ANY_SAFARI || IS_IOS && IS_CHROME;\n};\n/**\n * Check to see if native `VideoTrack`s are supported by this browser/device\n *\n * @return {boolean}\n * - True if native `VideoTrack`s are supported.\n * - False otherwise\n */\n\n\nHtml5.supportsNativeVideoTracks = function () {\n return !!(Html5.TEST_VID && Html5.TEST_VID.videoTracks);\n};\n/**\n * Check to see if native `AudioTrack`s are supported by this browser/device\n *\n * @return {boolean}\n * - True if native `AudioTrack`s are supported.\n * - False otherwise\n */\n\n\nHtml5.supportsNativeAudioTracks = function () {\n return !!(Html5.TEST_VID && Html5.TEST_VID.audioTracks);\n};\n/**\n * An array of events available on the Html5 tech.\n *\n * @private\n * @type {Array}\n */\n\n\nHtml5.Events = ['loadstart', 'suspend', 'abort', 'error', 'emptied', 'stalled', 'loadedmetadata', 'loadeddata', 'canplay', 'canplaythrough', 'playing', 'waiting', 'seeking', 'seeked', 'ended', 'durationchange', 'timeupdate', 'progress', 'play', 'pause', 'ratechange', 'resize', 'volumechange'];\n/**\n * Boolean indicating whether the `Tech` supports volume control.\n *\n * @type {boolean}\n * @default {@link Html5.canControlVolume}\n */\n\nHtml5.prototype.featuresVolumeControl = Html5.canControlVolume();\n/**\n * Boolean indicating whether the `Tech` supports muting volume.\n *\n * @type {bolean}\n * @default {@link Html5.canMuteVolume}\n */\n\nHtml5.prototype.featuresMuteControl = Html5.canMuteVolume();\n/**\n * Boolean indicating whether the `Tech` supports changing the speed at which the media\n * plays. Examples:\n * - Set player to play 2x (twice) as fast\n * - Set player to play 0.5x (half) as fast\n *\n * @type {boolean}\n * @default {@link Html5.canControlPlaybackRate}\n */\n\nHtml5.prototype.featuresPlaybackRate = Html5.canControlPlaybackRate();\n/**\n * Boolean indicating whether the `Tech` supports the `sourceset` event.\n *\n * @type {boolean}\n * @default\n */\n\nHtml5.prototype.featuresSourceset = Html5.canOverrideAttributes();\n/**\n * Boolean indicating whether the `HTML5` tech currently supports the media element\n * moving in the DOM. iOS breaks if you move the media element, so this is set this to\n * false there. Everywhere else this should be true.\n *\n * @type {boolean}\n * @default\n */\n\nHtml5.prototype.movingMediaElementInDOM = !IS_IOS; // TODO: Previous comment: No longer appears to be used. Can probably be removed.\n// Is this true?\n\n/**\n * Boolean indicating whether the `HTML5` tech currently supports automatic media resize\n * when going into fullscreen.\n *\n * @type {boolean}\n * @default\n */\n\nHtml5.prototype.featuresFullscreenResize = true;\n/**\n * Boolean indicating whether the `HTML5` tech currently supports the progress event.\n * If this is false, manual `progress` events will be triggered instead.\n *\n * @type {boolean}\n * @default\n */\n\nHtml5.prototype.featuresProgressEvents = true;\n/**\n * Boolean indicating whether the `HTML5` tech currently supports the timeupdate event.\n * If this is false, manual `timeupdate` events will be triggered instead.\n *\n * @default\n */\n\nHtml5.prototype.featuresTimeupdateEvents = true;\n/**\n * Boolean indicating whether the `HTML5` tech currently supports native `TextTrack`s.\n *\n * @type {boolean}\n * @default {@link Html5.supportsNativeTextTracks}\n */\n\nHtml5.prototype.featuresNativeTextTracks = Html5.supportsNativeTextTracks();\n/**\n * Boolean indicating whether the `HTML5` tech currently supports native `VideoTrack`s.\n *\n * @type {boolean}\n * @default {@link Html5.supportsNativeVideoTracks}\n */\n\nHtml5.prototype.featuresNativeVideoTracks = Html5.supportsNativeVideoTracks();\n/**\n * Boolean indicating whether the `HTML5` tech currently supports native `AudioTrack`s.\n *\n * @type {boolean}\n * @default {@link Html5.supportsNativeAudioTracks}\n */\n\nHtml5.prototype.featuresNativeAudioTracks = Html5.supportsNativeAudioTracks(); // HTML5 Feature detection and Device Fixes --------------------------------- //\n\nvar canPlayType = Html5.TEST_VID && Html5.TEST_VID.constructor.prototype.canPlayType;\nvar mpegurlRE = /^application\\/(?:x-|vnd\\.apple\\.)mpegurl/i;\n\nHtml5.patchCanPlayType = function () {\n // Android 4.0 and above can play HLS to some extent but it reports being unable to do so\n // Firefox and Chrome report correctly\n if (ANDROID_VERSION >= 4.0 && !IS_FIREFOX && !IS_CHROME) {\n Html5.TEST_VID.constructor.prototype.canPlayType = function (type) {\n if (type && mpegurlRE.test(type)) {\n return 'maybe';\n }\n\n return canPlayType.call(this, type);\n };\n }\n};\n\nHtml5.unpatchCanPlayType = function () {\n var r = Html5.TEST_VID.constructor.prototype.canPlayType;\n Html5.TEST_VID.constructor.prototype.canPlayType = canPlayType;\n return r;\n}; // by default, patch the media element\n\n\nHtml5.patchCanPlayType();\n\nHtml5.disposeMediaElement = function (el) {\n if (!el) {\n return;\n }\n\n if (el.parentNode) {\n el.parentNode.removeChild(el);\n } // remove any child track or source nodes to prevent their loading\n\n\n while (el.hasChildNodes()) {\n el.removeChild(el.firstChild);\n } // remove any src reference. not setting `src=''` because that causes a warning\n // in firefox\n\n\n el.removeAttribute('src'); // force the media element to update its loading state by calling load()\n // however IE on Windows 7N has a bug that throws an error so need a try/catch (#793)\n\n if (typeof el.load === 'function') {\n // wrapping in an iife so it's not deoptimized (#1060#discussion_r10324473)\n (function () {\n try {\n el.load();\n } catch (e) {// not supported\n }\n })();\n }\n};\n\nHtml5.resetMediaElement = function (el) {\n if (!el) {\n return;\n }\n\n var sources = el.querySelectorAll('source');\n var i = sources.length;\n\n while (i--) {\n el.removeChild(sources[i]);\n } // remove any src reference.\n // not setting `src=''` because that throws an error\n\n\n el.removeAttribute('src');\n\n if (typeof el.load === 'function') {\n // wrapping in an iife so it's not deoptimized (#1060#discussion_r10324473)\n (function () {\n try {\n el.load();\n } catch (e) {// satisfy linter\n }\n })();\n }\n};\n/* Native HTML5 element property wrapping ----------------------------------- */\n// Wrap native boolean attributes with getters that check both property and attribute\n// The list is as followed:\n// muted, defaultMuted, autoplay, controls, loop, playsinline\n\n\n[\n/**\n * Get the value of `muted` from the media element. `muted` indicates\n * that the volume for the media should be set to silent. This does not actually change\n * the `volume` attribute.\n *\n * @method Html5#muted\n * @return {boolean}\n * - True if the value of `volume` should be ignored and the audio set to silent.\n * - False if the value of `volume` should be used.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-muted}\n */\n'muted',\n/**\n * Get the value of `defaultMuted` from the media element. `defaultMuted` indicates\n * whether the media should start muted or not. Only changes the default state of the\n * media. `muted` and `defaultMuted` can have different values. {@link Html5#muted} indicates the\n * current state.\n *\n * @method Html5#defaultMuted\n * @return {boolean}\n * - The value of `defaultMuted` from the media element.\n * - True indicates that the media should start muted.\n * - False indicates that the media should not start muted\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-defaultmuted}\n */\n'defaultMuted',\n/**\n * Get the value of `autoplay` from the media element. `autoplay` indicates\n * that the media should start to play as soon as the page is ready.\n *\n * @method Html5#autoplay\n * @return {boolean}\n * - The value of `autoplay` from the media element.\n * - True indicates that the media should start as soon as the page loads.\n * - False indicates that the media should not start as soon as the page loads.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-autoplay}\n */\n'autoplay',\n/**\n * Get the value of `controls` from the media element. `controls` indicates\n * whether the native media controls should be shown or hidden.\n *\n * @method Html5#controls\n * @return {boolean}\n * - The value of `controls` from the media element.\n * - True indicates that native controls should be showing.\n * - False indicates that native controls should be hidden.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-controls}\n */\n'controls',\n/**\n * Get the value of `loop` from the media element. `loop` indicates\n * that the media should return to the start of the media and continue playing once\n * it reaches the end.\n *\n * @method Html5#loop\n * @return {boolean}\n * - The value of `loop` from the media element.\n * - True indicates that playback should seek back to start once\n * the end of a media is reached.\n * - False indicates that playback should not loop back to the start when the\n * end of the media is reached.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-loop}\n */\n'loop',\n/**\n * Get the value of `playsinline` from the media element. `playsinline` indicates\n * to the browser that non-fullscreen playback is preferred when fullscreen\n * playback is the native default, such as in iOS Safari.\n *\n * @method Html5#playsinline\n * @return {boolean}\n * - The value of `playsinline` from the media element.\n * - True indicates that the media should play inline.\n * - False indicates that the media should not play inline.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/#attr-video-playsinline}\n */\n'playsinline'].forEach(function (prop) {\n Html5.prototype[prop] = function () {\n return this.el_[prop] || this.el_.hasAttribute(prop);\n };\n}); // Wrap native boolean attributes with setters that set both property and attribute\n// The list is as followed:\n// setMuted, setDefaultMuted, setAutoplay, setLoop, setPlaysinline\n// setControls is special-cased above\n\n[\n/**\n * Set the value of `muted` on the media element. `muted` indicates that the current\n * audio level should be silent.\n *\n * @method Html5#setMuted\n * @param {boolean} muted\n * - True if the audio should be set to silent\n * - False otherwise\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-muted}\n */\n'muted',\n/**\n * Set the value of `defaultMuted` on the media element. `defaultMuted` indicates that the current\n * audio level should be silent, but will only effect the muted level on intial playback..\n *\n * @method Html5.prototype.setDefaultMuted\n * @param {boolean} defaultMuted\n * - True if the audio should be set to silent\n * - False otherwise\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-defaultmuted}\n */\n'defaultMuted',\n/**\n * Set the value of `autoplay` on the media element. `autoplay` indicates\n * that the media should start to play as soon as the page is ready.\n *\n * @method Html5#setAutoplay\n * @param {boolean} autoplay\n * - True indicates that the media should start as soon as the page loads.\n * - False indicates that the media should not start as soon as the page loads.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-autoplay}\n */\n'autoplay',\n/**\n * Set the value of `loop` on the media element. `loop` indicates\n * that the media should return to the start of the media and continue playing once\n * it reaches the end.\n *\n * @method Html5#setLoop\n * @param {boolean} loop\n * - True indicates that playback should seek back to start once\n * the end of a media is reached.\n * - False indicates that playback should not loop back to the start when the\n * end of the media is reached.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-loop}\n */\n'loop',\n/**\n * Set the value of `playsinline` from the media element. `playsinline` indicates\n * to the browser that non-fullscreen playback is preferred when fullscreen\n * playback is the native default, such as in iOS Safari.\n *\n * @method Html5#setPlaysinline\n * @param {boolean} playsinline\n * - True indicates that the media should play inline.\n * - False indicates that the media should not play inline.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/#attr-video-playsinline}\n */\n'playsinline'].forEach(function (prop) {\n Html5.prototype['set' + toTitleCase(prop)] = function (v) {\n this.el_[prop] = v;\n\n if (v) {\n this.el_.setAttribute(prop, prop);\n } else {\n this.el_.removeAttribute(prop);\n }\n };\n}); // Wrap native properties with a getter\n// The list is as followed\n// paused, currentTime, buffered, volume, poster, preload, error, seeking\n// seekable, ended, playbackRate, defaultPlaybackRate, played, networkState\n// readyState, videoWidth, videoHeight\n\n[\n/**\n * Get the value of `paused` from the media element. `paused` indicates whether the media element\n * is currently paused or not.\n *\n * @method Html5#paused\n * @return {boolean}\n * The value of `paused` from the media element.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-paused}\n */\n'paused',\n/**\n * Get the value of `currentTime` from the media element. `currentTime` indicates\n * the current second that the media is at in playback.\n *\n * @method Html5#currentTime\n * @return {number}\n * The value of `currentTime` from the media element.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-currenttime}\n */\n'currentTime',\n/**\n * Get the value of `buffered` from the media element. `buffered` is a `TimeRange`\n * object that represents the parts of the media that are already downloaded and\n * available for playback.\n *\n * @method Html5#buffered\n * @return {TimeRange}\n * The value of `buffered` from the media element.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-buffered}\n */\n'buffered',\n/**\n * Get the value of `volume` from the media element. `volume` indicates\n * the current playback volume of audio for a media. `volume` will be a value from 0\n * (silent) to 1 (loudest and default).\n *\n * @method Html5#volume\n * @return {number}\n * The value of `volume` from the media element. Value will be between 0-1.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-a-volume}\n */\n'volume',\n/**\n * Get the value of `poster` from the media element. `poster` indicates\n * that the url of an image file that can/will be shown when no media data is available.\n *\n * @method Html5#poster\n * @return {string}\n * The value of `poster` from the media element. Value will be a url to an\n * image.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-video-poster}\n */\n'poster',\n/**\n * Get the value of `preload` from the media element. `preload` indicates\n * what should download before the media is interacted with. It can have the following\n * values:\n * - none: nothing should be downloaded\n * - metadata: poster and the first few frames of the media may be downloaded to get\n * media dimensions and other metadata\n * - auto: allow the media and metadata for the media to be downloaded before\n * interaction\n *\n * @method Html5#preload\n * @return {string}\n * The value of `preload` from the media element. Will be 'none', 'metadata',\n * or 'auto'.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-preload}\n */\n'preload',\n/**\n * Get the value of the `error` from the media element. `error` indicates any\n * MediaError that may have occurred during playback. If error returns null there is no\n * current error.\n *\n * @method Html5#error\n * @return {MediaError|null}\n * The value of `error` from the media element. Will be `MediaError` if there\n * is a current error and null otherwise.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-error}\n */\n'error',\n/**\n * Get the value of `seeking` from the media element. `seeking` indicates whether the\n * media is currently seeking to a new position or not.\n *\n * @method Html5#seeking\n * @return {boolean}\n * - The value of `seeking` from the media element.\n * - True indicates that the media is currently seeking to a new position.\n * - False indicates that the media is not seeking to a new position at this time.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-seeking}\n */\n'seeking',\n/**\n * Get the value of `seekable` from the media element. `seekable` returns a\n * `TimeRange` object indicating ranges of time that can currently be `seeked` to.\n *\n * @method Html5#seekable\n * @return {TimeRange}\n * The value of `seekable` from the media element. A `TimeRange` object\n * indicating the current ranges of time that can be seeked to.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-seekable}\n */\n'seekable',\n/**\n * Get the value of `ended` from the media element. `ended` indicates whether\n * the media has reached the end or not.\n *\n * @method Html5#ended\n * @return {boolean}\n * - The value of `ended` from the media element.\n * - True indicates that the media has ended.\n * - False indicates that the media has not ended.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-ended}\n */\n'ended',\n/**\n * Get the value of `playbackRate` from the media element. `playbackRate` indicates\n * the rate at which the media is currently playing back. Examples:\n * - if playbackRate is set to 2, media will play twice as fast.\n * - if playbackRate is set to 0.5, media will play half as fast.\n *\n * @method Html5#playbackRate\n * @return {number}\n * The value of `playbackRate` from the media element. A number indicating\n * the current playback speed of the media, where 1 is normal speed.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-playbackrate}\n */\n'playbackRate',\n/**\n * Get the value of `defaultPlaybackRate` from the media element. `defaultPlaybackRate` indicates\n * the rate at which the media is currently playing back. This value will not indicate the current\n * `playbackRate` after playback has started, use {@link Html5#playbackRate} for that.\n *\n * Examples:\n * - if defaultPlaybackRate is set to 2, media will play twice as fast.\n * - if defaultPlaybackRate is set to 0.5, media will play half as fast.\n *\n * @method Html5.prototype.defaultPlaybackRate\n * @return {number}\n * The value of `defaultPlaybackRate` from the media element. A number indicating\n * the current playback speed of the media, where 1 is normal speed.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-playbackrate}\n */\n'defaultPlaybackRate',\n/**\n * Get the value of `played` from the media element. `played` returns a `TimeRange`\n * object representing points in the media timeline that have been played.\n *\n * @method Html5#played\n * @return {TimeRange}\n * The value of `played` from the media element. A `TimeRange` object indicating\n * the ranges of time that have been played.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-played}\n */\n'played',\n/**\n * Get the value of `networkState` from the media element. `networkState` indicates\n * the current network state. It returns an enumeration from the following list:\n * - 0: NETWORK_EMPTY\n * - 1: NETWORK_IDLE\n * - 2: NETWORK_LOADING\n * - 3: NETWORK_NO_SOURCE\n *\n * @method Html5#networkState\n * @return {number}\n * The value of `networkState` from the media element. This will be a number\n * from the list in the description.\n *\n * @see [Spec] {@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-networkstate}\n */\n'networkState',\n/**\n * Get the value of `readyState` from the media element. `readyState` indicates\n * the current state of the media element. It returns an enumeration from the\n * following list:\n * - 0: HAVE_NOTHING\n * - 1: HAVE_METADATA\n * - 2: HAVE_CURRENT_DATA\n * - 3: HAVE_FUTURE_DATA\n * - 4: HAVE_ENOUGH_DATA\n *\n * @method Html5#readyState\n * @return {number}\n * The value of `readyState` from the media element. This will be a number\n * from the list in the description.\n *\n * @see [Spec] {@link https://www.w3.org/TR/html5/embedded-content-0.html#ready-states}\n */\n'readyState',\n/**\n * Get the value of `videoWidth` from the video element. `videoWidth` indicates\n * the current width of the video in css pixels.\n *\n * @method Html5#videoWidth\n * @return {number}\n * The value of `videoWidth` from the video element. This will be a number\n * in css pixels.\n *\n * @see [Spec] {@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-video-videowidth}\n */\n'videoWidth',\n/**\n * Get the value of `videoHeight` from the video element. `videoHeight` indicates\n * the current height of the video in css pixels.\n *\n * @method Html5#videoHeight\n * @return {number}\n * The value of `videoHeight` from the video element. This will be a number\n * in css pixels.\n *\n * @see [Spec] {@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-video-videowidth}\n */\n'videoHeight'].forEach(function (prop) {\n Html5.prototype[prop] = function () {\n return this.el_[prop];\n };\n}); // Wrap native properties with a setter in this format:\n// set + toTitleCase(name)\n// The list is as follows:\n// setVolume, setSrc, setPoster, setPreload, setPlaybackRate, setDefaultPlaybackRate\n\n[\n/**\n * Set the value of `volume` on the media element. `volume` indicates the current\n * audio level as a percentage in decimal form. This means that 1 is 100%, 0.5 is 50%, and\n * so on.\n *\n * @method Html5#setVolume\n * @param {number} percentAsDecimal\n * The volume percent as a decimal. Valid range is from 0-1.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-a-volume}\n */\n'volume',\n/**\n * Set the value of `src` on the media element. `src` indicates the current\n * {@link Tech~SourceObject} for the media.\n *\n * @method Html5#setSrc\n * @param {Tech~SourceObject} src\n * The source object to set as the current source.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-src}\n */\n'src',\n/**\n * Set the value of `poster` on the media element. `poster` is the url to\n * an image file that can/will be shown when no media data is available.\n *\n * @method Html5#setPoster\n * @param {string} poster\n * The url to an image that should be used as the `poster` for the media\n * element.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-poster}\n */\n'poster',\n/**\n * Set the value of `preload` on the media element. `preload` indicates\n * what should download before the media is interacted with. It can have the following\n * values:\n * - none: nothing should be downloaded\n * - metadata: poster and the first few frames of the media may be downloaded to get\n * media dimensions and other metadata\n * - auto: allow the media and metadata for the media to be downloaded before\n * interaction\n *\n * @method Html5#setPreload\n * @param {string} preload\n * The value of `preload` to set on the media element. Must be 'none', 'metadata',\n * or 'auto'.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-preload}\n */\n'preload',\n/**\n * Set the value of `playbackRate` on the media element. `playbackRate` indicates\n * the rate at which the media should play back. Examples:\n * - if playbackRate is set to 2, media will play twice as fast.\n * - if playbackRate is set to 0.5, media will play half as fast.\n *\n * @method Html5#setPlaybackRate\n * @return {number}\n * The value of `playbackRate` from the media element. A number indicating\n * the current playback speed of the media, where 1 is normal speed.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-playbackrate}\n */\n'playbackRate',\n/**\n * Set the value of `defaultPlaybackRate` on the media element. `defaultPlaybackRate` indicates\n * the rate at which the media should play back upon initial startup. Changing this value\n * after a video has started will do nothing. Instead you should used {@link Html5#setPlaybackRate}.\n *\n * Example Values:\n * - if playbackRate is set to 2, media will play twice as fast.\n * - if playbackRate is set to 0.5, media will play half as fast.\n *\n * @method Html5.prototype.setDefaultPlaybackRate\n * @return {number}\n * The value of `defaultPlaybackRate` from the media element. A number indicating\n * the current playback speed of the media, where 1 is normal speed.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-defaultplaybackrate}\n */\n'defaultPlaybackRate'].forEach(function (prop) {\n Html5.prototype['set' + toTitleCase(prop)] = function (v) {\n this.el_[prop] = v;\n };\n}); // wrap native functions with a function\n// The list is as follows:\n// pause, load, play\n\n[\n/**\n * A wrapper around the media elements `pause` function. This will call the `HTML5`\n * media elements `pause` function.\n *\n * @method Html5#pause\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-pause}\n */\n'pause',\n/**\n * A wrapper around the media elements `load` function. This will call the `HTML5`s\n * media element `load` function.\n *\n * @method Html5#load\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-load}\n */\n'load',\n/**\n * A wrapper around the media elements `play` function. This will call the `HTML5`s\n * media element `play` function.\n *\n * @method Html5#play\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-play}\n */\n'play'].forEach(function (prop) {\n Html5.prototype[prop] = function () {\n return this.el_[prop]();\n };\n});\nTech.withSourceHandlers(Html5);\n/**\n * Native source handler for Html5, simply passes the source to the media element.\n *\n * @property {Tech~SourceObject} source\n * The source object\n *\n * @property {Html5} tech\n * The instance of the HTML5 tech.\n */\n\nHtml5.nativeSourceHandler = {};\n/**\n * Check if the media element can play the given mime type.\n *\n * @param {string} type\n * The mimetype to check\n *\n * @return {string}\n * 'probably', 'maybe', or '' (empty string)\n */\n\nHtml5.nativeSourceHandler.canPlayType = function (type) {\n // IE without MediaPlayer throws an error (#519)\n try {\n return Html5.TEST_VID.canPlayType(type);\n } catch (e) {\n return '';\n }\n};\n/**\n * Check if the media element can handle a source natively.\n *\n * @param {Tech~SourceObject} source\n * The source object\n *\n * @param {Object} [options]\n * Options to be passed to the tech.\n *\n * @return {string}\n * 'probably', 'maybe', or '' (empty string).\n */\n\n\nHtml5.nativeSourceHandler.canHandleSource = function (source, options) {\n // If a type was provided we should rely on that\n if (source.type) {\n return Html5.nativeSourceHandler.canPlayType(source.type); // If no type, fall back to checking 'video/[EXTENSION]'\n } else if (source.src) {\n var ext = getFileExtension(source.src);\n return Html5.nativeSourceHandler.canPlayType(\"video/\" + ext);\n }\n\n return '';\n};\n/**\n * Pass the source to the native media element.\n *\n * @param {Tech~SourceObject} source\n * The source object\n *\n * @param {Html5} tech\n * The instance of the Html5 tech\n *\n * @param {Object} [options]\n * The options to pass to the source\n */\n\n\nHtml5.nativeSourceHandler.handleSource = function (source, tech, options) {\n tech.setSrc(source.src);\n};\n/**\n * A noop for the native dispose function, as cleanup is not needed.\n */\n\n\nHtml5.nativeSourceHandler.dispose = function () {}; // Register the native source handler\n\n\nHtml5.registerSourceHandler(Html5.nativeSourceHandler);\nTech.registerTech('Html5', Html5);\n\nfunction _templateObject$2() {\n var data = _taggedTemplateLiteralLoose([\"\\n Using the tech directly can be dangerous. I hope you know what you're doing.\\n See https://github.com/videojs/video.js/issues/2617 for more info.\\n \"]);\n\n _templateObject$2 = function _templateObject() {\n return data;\n };\n\n return data;\n}\n// on the player when they happen\n\nvar TECH_EVENTS_RETRIGGER = [\n/**\n * Fired while the user agent is downloading media data.\n *\n * @event Player#progress\n * @type {EventTarget~Event}\n */\n\n/**\n * Retrigger the `progress` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechProgress_\n * @fires Player#progress\n * @listens Tech#progress\n */\n'progress',\n/**\n * Fires when the loading of an audio/video is aborted.\n *\n * @event Player#abort\n * @type {EventTarget~Event}\n */\n\n/**\n * Retrigger the `abort` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechAbort_\n * @fires Player#abort\n * @listens Tech#abort\n */\n'abort',\n/**\n * Fires when the browser is intentionally not getting media data.\n *\n * @event Player#suspend\n * @type {EventTarget~Event}\n */\n\n/**\n * Retrigger the `suspend` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechSuspend_\n * @fires Player#suspend\n * @listens Tech#suspend\n */\n'suspend',\n/**\n * Fires when the current playlist is empty.\n *\n * @event Player#emptied\n * @type {EventTarget~Event}\n */\n\n/**\n * Retrigger the `emptied` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechEmptied_\n * @fires Player#emptied\n * @listens Tech#emptied\n */\n'emptied',\n/**\n * Fires when the browser is trying to get media data, but data is not available.\n *\n * @event Player#stalled\n * @type {EventTarget~Event}\n */\n\n/**\n * Retrigger the `stalled` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechStalled_\n * @fires Player#stalled\n * @listens Tech#stalled\n */\n'stalled',\n/**\n * Fires when the browser has loaded meta data for the audio/video.\n *\n * @event Player#loadedmetadata\n * @type {EventTarget~Event}\n */\n\n/**\n * Retrigger the `stalled` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechLoadedmetadata_\n * @fires Player#loadedmetadata\n * @listens Tech#loadedmetadata\n */\n'loadedmetadata',\n/**\n * Fires when the browser has loaded the current frame of the audio/video.\n *\n * @event Player#loadeddata\n * @type {event}\n */\n\n/**\n * Retrigger the `loadeddata` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechLoaddeddata_\n * @fires Player#loadeddata\n * @listens Tech#loadeddata\n */\n'loadeddata',\n/**\n * Fires when the current playback position has changed.\n *\n * @event Player#timeupdate\n * @type {event}\n */\n\n/**\n * Retrigger the `timeupdate` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechTimeUpdate_\n * @fires Player#timeupdate\n * @listens Tech#timeupdate\n */\n'timeupdate',\n/**\n * Fires when the video's intrinsic dimensions change\n *\n * @event Player#resize\n * @type {event}\n */\n\n/**\n * Retrigger the `resize` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechResize_\n * @fires Player#resize\n * @listens Tech#resize\n */\n'resize',\n/**\n * Fires when the volume has been changed\n *\n * @event Player#volumechange\n * @type {event}\n */\n\n/**\n * Retrigger the `volumechange` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechVolumechange_\n * @fires Player#volumechange\n * @listens Tech#volumechange\n */\n'volumechange',\n/**\n * Fires when the text track has been changed\n *\n * @event Player#texttrackchange\n * @type {event}\n */\n\n/**\n * Retrigger the `texttrackchange` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechTexttrackchange_\n * @fires Player#texttrackchange\n * @listens Tech#texttrackchange\n */\n'texttrackchange']; // events to queue when playback rate is zero\n// this is a hash for the sole purpose of mapping non-camel-cased event names\n// to camel-cased function names\n\nvar TECH_EVENTS_QUEUE = {\n canplay: 'CanPlay',\n canplaythrough: 'CanPlayThrough',\n playing: 'Playing',\n seeked: 'Seeked'\n};\nvar BREAKPOINT_ORDER = ['tiny', 'xsmall', 'small', 'medium', 'large', 'xlarge', 'huge'];\nvar BREAKPOINT_CLASSES = {}; // grep: vjs-layout-tiny\n// grep: vjs-layout-x-small\n// grep: vjs-layout-small\n// grep: vjs-layout-medium\n// grep: vjs-layout-large\n// grep: vjs-layout-x-large\n// grep: vjs-layout-huge\n\nBREAKPOINT_ORDER.forEach(function (k) {\n var v = k.charAt(0) === 'x' ? \"x-\" + k.substring(1) : k;\n BREAKPOINT_CLASSES[k] = \"vjs-layout-\" + v;\n});\nvar DEFAULT_BREAKPOINTS = {\n tiny: 210,\n xsmall: 320,\n small: 425,\n medium: 768,\n large: 1440,\n xlarge: 2560,\n huge: Infinity\n};\n/**\n * An instance of the `Player` class is created when any of the Video.js setup methods\n * are used to initialize a video.\n *\n * After an instance has been created it can be accessed globally in two ways:\n * 1. By calling `videojs('example_video_1');`\n * 2. By using it directly via `videojs.players.example_video_1;`\n *\n * @extends Component\n */\n\nvar Player =\n/*#__PURE__*/\nfunction (_Component) {\n _inheritsLoose(Player, _Component);\n\n /**\n * Create an instance of this class.\n *\n * @param {Element} tag\n * The original video DOM element used for configuring options.\n *\n * @param {Object} [options]\n * Object of option names and values.\n *\n * @param {Component~ReadyCallback} [ready]\n * Ready callback function.\n */\n function Player(tag, options, ready) {\n var _this;\n\n // Make sure tag ID exists\n tag.id = tag.id || options.id || \"vjs_video_\" + newGUID(); // Set Options\n // The options argument overrides options set in the video tag\n // which overrides globally set options.\n // This latter part coincides with the load order\n // (tag must exist before Player)\n\n options = assign(Player.getTagSettings(tag), options); // Delay the initialization of children because we need to set up\n // player properties first, and can't use `this` before `super()`\n\n options.initChildren = false; // Same with creating the element\n\n options.createEl = false; // don't auto mixin the evented mixin\n\n options.evented = false; // we don't want the player to report touch activity on itself\n // see enableTouchActivity in Component\n\n options.reportTouchActivity = false; // If language is not set, get the closest lang attribute\n\n if (!options.language) {\n if (typeof tag.closest === 'function') {\n var closest = tag.closest('[lang]');\n\n if (closest && closest.getAttribute) {\n options.language = closest.getAttribute('lang');\n }\n } else {\n var element = tag;\n\n while (element && element.nodeType === 1) {\n if (getAttributes(element).hasOwnProperty('lang')) {\n options.language = element.getAttribute('lang');\n break;\n }\n\n element = element.parentNode;\n }\n }\n } // Run base component initializing with new options\n\n\n _this = _Component.call(this, null, options, ready) || this; // create logger\n\n _this.log = createLogger$1(_this.id_); // Tracks when a tech changes the poster\n\n _this.isPosterFromTech_ = false; // Holds callback info that gets queued when playback rate is zero\n // and a seek is happening\n\n _this.queuedCallbacks_ = []; // Turn off API access because we're loading a new tech that might load asynchronously\n\n _this.isReady_ = false; // Init state hasStarted_\n\n _this.hasStarted_ = false; // Init state userActive_\n\n _this.userActive_ = false; // if the global option object was accidentally blown away by\n // someone, bail early with an informative error\n\n if (!_this.options_ || !_this.options_.techOrder || !_this.options_.techOrder.length) {\n throw new Error('No techOrder specified. Did you overwrite ' + 'videojs.options instead of just changing the ' + 'properties you want to override?');\n } // Store the original tag used to set options\n\n\n _this.tag = tag; // Store the tag attributes used to restore html5 element\n\n _this.tagAttributes = tag && getAttributes(tag); // Update current language\n\n _this.language(_this.options_.language); // Update Supported Languages\n\n\n if (options.languages) {\n // Normalise player option languages to lowercase\n var languagesToLower = {};\n Object.getOwnPropertyNames(options.languages).forEach(function (name$$1) {\n languagesToLower[name$$1.toLowerCase()] = options.languages[name$$1];\n });\n _this.languages_ = languagesToLower;\n } else {\n _this.languages_ = Player.prototype.options_.languages;\n } // Cache for video property values.\n\n\n _this.cache_ = {}; // Set poster\n\n _this.poster_ = options.poster || ''; // Set controls\n\n _this.controls_ = !!options.controls; // Set default values for lastVolume\n\n _this.cache_.lastVolume = 1; // Original tag settings stored in options\n // now remove immediately so native controls don't flash.\n // May be turned back on by HTML5 tech if nativeControlsForTouch is true\n\n tag.controls = false;\n tag.removeAttribute('controls'); // the attribute overrides the option\n\n if (tag.hasAttribute('autoplay')) {\n _this.options_.autoplay = true;\n } else {\n // otherwise use the setter to validate and\n // set the correct value.\n _this.autoplay(_this.options_.autoplay);\n }\n /*\n * Store the internal state of scrubbing\n *\n * @private\n * @return {Boolean} True if the user is scrubbing\n */\n\n\n _this.scrubbing_ = false;\n _this.el_ = _this.createEl(); // Set default value for lastPlaybackRate\n\n _this.cache_.lastPlaybackRate = _this.defaultPlaybackRate(); // Make this an evented object and use `el_` as its event bus.\n\n evented(_assertThisInitialized(_assertThisInitialized(_this)), {\n eventBusKey: 'el_'\n });\n\n if (_this.fluid_) {\n _this.on('playerreset', _this.updateStyleEl_);\n } // We also want to pass the original player options to each component and plugin\n // as well so they don't need to reach back into the player for options later.\n // We also need to do another copy of this.options_ so we don't end up with\n // an infinite loop.\n\n\n var playerOptionsCopy = mergeOptions(_this.options_); // Load plugins\n\n if (options.plugins) {\n var plugins = options.plugins;\n Object.keys(plugins).forEach(function (name$$1) {\n if (typeof this[name$$1] === 'function') {\n this[name$$1](plugins[name$$1]);\n } else {\n throw new Error(\"plugin \\\"\" + name$$1 + \"\\\" does not exist\");\n }\n }, _assertThisInitialized(_assertThisInitialized(_this)));\n }\n\n _this.options_.playerOptions = playerOptionsCopy;\n _this.middleware_ = [];\n\n _this.initChildren(); // Set isAudio based on whether or not an audio tag was used\n\n\n _this.isAudio(tag.nodeName.toLowerCase() === 'audio'); // Update controls className. Can't do this when the controls are initially\n // set because the element doesn't exist yet.\n\n\n if (_this.controls()) {\n _this.addClass('vjs-controls-enabled');\n } else {\n _this.addClass('vjs-controls-disabled');\n } // Set ARIA label and region role depending on player type\n\n\n _this.el_.setAttribute('role', 'region');\n\n if (_this.isAudio()) {\n _this.el_.setAttribute('aria-label', _this.localize('Audio Player'));\n } else {\n _this.el_.setAttribute('aria-label', _this.localize('Video Player'));\n }\n\n if (_this.isAudio()) {\n _this.addClass('vjs-audio');\n }\n\n if (_this.flexNotSupported_()) {\n _this.addClass('vjs-no-flex');\n } // TODO: Make this smarter. Toggle user state between touching/mousing\n // using events, since devices can have both touch and mouse events.\n // if (browser.TOUCH_ENABLED) {\n // this.addClass('vjs-touch-enabled');\n // }\n // iOS Safari has broken hover handling\n\n\n if (!IS_IOS) {\n _this.addClass('vjs-workinghover');\n } // Make player easily findable by ID\n\n\n Player.players[_this.id_] = _assertThisInitialized(_assertThisInitialized(_this)); // Add a major version class to aid css in plugins\n\n var majorVersion = version.split('.')[0];\n\n _this.addClass(\"vjs-v\" + majorVersion); // When the player is first initialized, trigger activity so components\n // like the control bar show themselves if needed\n\n\n _this.userActive(true);\n\n _this.reportUserActivity();\n\n _this.one('play', _this.listenForUserActivity_);\n\n _this.on('fullscreenchange', _this.handleFullscreenChange_);\n\n _this.on('stageclick', _this.handleStageClick_);\n\n _this.breakpoints(_this.options_.breakpoints);\n\n _this.responsive(_this.options_.responsive);\n\n _this.changingSrc_ = false;\n _this.playWaitingForReady_ = false;\n _this.playOnLoadstart_ = null;\n return _this;\n }\n /**\n * Destroys the video player and does any necessary cleanup.\n *\n * This is especially helpful if you are dynamically adding and removing videos\n * to/from the DOM.\n *\n * @fires Player#dispose\n */\n\n\n var _proto = Player.prototype;\n\n _proto.dispose = function dispose() {\n /**\n * Called when the player is being disposed of.\n *\n * @event Player#dispose\n * @type {EventTarget~Event}\n */\n this.trigger('dispose'); // prevent dispose from being called twice\n\n this.off('dispose');\n\n if (this.styleEl_ && this.styleEl_.parentNode) {\n this.styleEl_.parentNode.removeChild(this.styleEl_);\n this.styleEl_ = null;\n } // Kill reference to this player\n\n\n Player.players[this.id_] = null;\n\n if (this.tag && this.tag.player) {\n this.tag.player = null;\n }\n\n if (this.el_ && this.el_.player) {\n this.el_.player = null;\n }\n\n if (this.tech_) {\n this.tech_.dispose();\n this.isPosterFromTech_ = false;\n this.poster_ = '';\n }\n\n if (this.playerElIngest_) {\n this.playerElIngest_ = null;\n }\n\n if (this.tag) {\n this.tag = null;\n }\n\n clearCacheForPlayer(this); // the actual .el_ is removed here\n\n _Component.prototype.dispose.call(this);\n };\n /**\n * Create the `Player`'s DOM element.\n *\n * @return {Element}\n * The DOM element that gets created.\n */\n\n\n _proto.createEl = function createEl$$1() {\n var tag = this.tag;\n var el;\n var playerElIngest = this.playerElIngest_ = tag.parentNode && tag.parentNode.hasAttribute && tag.parentNode.hasAttribute('data-vjs-player');\n var divEmbed = this.tag.tagName.toLowerCase() === 'video-js';\n\n if (playerElIngest) {\n el = this.el_ = tag.parentNode;\n } else if (!divEmbed) {\n el = this.el_ = _Component.prototype.createEl.call(this, 'div');\n } // Copy over all the attributes from the tag, including ID and class\n // ID will now reference player box, not the video tag\n\n\n var attrs = getAttributes(tag);\n\n if (divEmbed) {\n el = this.el_ = tag;\n tag = this.tag = document.createElement('video');\n\n while (el.children.length) {\n tag.appendChild(el.firstChild);\n }\n\n if (!hasClass(el, 'video-js')) {\n addClass(el, 'video-js');\n }\n\n el.appendChild(tag);\n playerElIngest = this.playerElIngest_ = el; // move properties over from our custom `video-js` element\n // to our new `video` element. This will move things like\n // `src` or `controls` that were set via js before the player\n // was initialized.\n\n Object.keys(el).forEach(function (k) {\n tag[k] = el[k];\n });\n } // set tabindex to -1 to remove the video element from the focus order\n\n\n tag.setAttribute('tabindex', '-1');\n attrs.tabindex = '-1'; // Workaround for #4583 (JAWS+IE doesn't announce BPB or play button)\n // See https://github.com/FreedomScientific/VFO-standards-support/issues/78\n // Note that we can't detect if JAWS is being used, but this ARIA attribute\n // doesn't change behavior of IE11 if JAWS is not being used\n\n if (IE_VERSION) {\n tag.setAttribute('role', 'application');\n attrs.role = 'application';\n } // Remove width/height attrs from tag so CSS can make it 100% width/height\n\n\n tag.removeAttribute('width');\n tag.removeAttribute('height');\n\n if ('width' in attrs) {\n delete attrs.width;\n }\n\n if ('height' in attrs) {\n delete attrs.height;\n }\n\n Object.getOwnPropertyNames(attrs).forEach(function (attr) {\n // don't copy over the class attribute to the player element when we're in a div embed\n // the class is already set up properly in the divEmbed case\n // and we want to make sure that the `video-js` class doesn't get lost\n if (!(divEmbed && attr === 'class')) {\n el.setAttribute(attr, attrs[attr]);\n }\n\n if (divEmbed) {\n tag.setAttribute(attr, attrs[attr]);\n }\n }); // Update tag id/class for use as HTML5 playback tech\n // Might think we should do this after embedding in container so .vjs-tech class\n // doesn't flash 100% width/height, but class only applies with .video-js parent\n\n tag.playerId = tag.id;\n tag.id += '_html5_api';\n tag.className = 'vjs-tech'; // Make player findable on elements\n\n tag.player = el.player = this; // Default state of video is paused\n\n this.addClass('vjs-paused'); // Add a style element in the player that we'll use to set the width/height\n // of the player in a way that's still overrideable by CSS, just like the\n // video element\n\n if (window$1.VIDEOJS_NO_DYNAMIC_STYLE !== true) {\n this.styleEl_ = createStyleElement('vjs-styles-dimensions');\n var defaultsStyleEl = $('.vjs-styles-defaults');\n var head = $('head');\n head.insertBefore(this.styleEl_, defaultsStyleEl ? defaultsStyleEl.nextSibling : head.firstChild);\n }\n\n this.fill_ = false;\n this.fluid_ = false; // Pass in the width/height/aspectRatio options which will update the style el\n\n this.width(this.options_.width);\n this.height(this.options_.height);\n this.fill(this.options_.fill);\n this.fluid(this.options_.fluid);\n this.aspectRatio(this.options_.aspectRatio); // Hide any links within the video/audio tag,\n // because IE doesn't hide them completely from screen readers.\n\n var links = tag.getElementsByTagName('a');\n\n for (var i = 0; i < links.length; i++) {\n var linkEl = links.item(i);\n addClass(linkEl, 'vjs-hidden');\n linkEl.setAttribute('hidden', 'hidden');\n } // insertElFirst seems to cause the networkState to flicker from 3 to 2, so\n // keep track of the original for later so we can know if the source originally failed\n\n\n tag.initNetworkState_ = tag.networkState; // Wrap video tag in div (el/box) container\n\n if (tag.parentNode && !playerElIngest) {\n tag.parentNode.insertBefore(el, tag);\n } // insert the tag as the first child of the player element\n // then manually add it to the children array so that this.addChild\n // will work properly for other components\n //\n // Breaks iPhone, fixed in HTML5 setup.\n\n\n prependTo(tag, el);\n this.children_.unshift(tag); // Set lang attr on player to ensure CSS :lang() in consistent with player\n // if it's been set to something different to the doc\n\n this.el_.setAttribute('lang', this.language_);\n this.el_ = el;\n return el;\n };\n /**\n * A getter/setter for the `Player`'s width. Returns the player's configured value.\n * To get the current width use `currentWidth()`.\n *\n * @param {number} [value]\n * The value to set the `Player`'s width to.\n *\n * @return {number}\n * The current width of the `Player` when getting.\n */\n\n\n _proto.width = function width(value) {\n return this.dimension('width', value);\n };\n /**\n * A getter/setter for the `Player`'s height. Returns the player's configured value.\n * To get the current height use `currentheight()`.\n *\n * @param {number} [value]\n * The value to set the `Player`'s heigth to.\n *\n * @return {number}\n * The current height of the `Player` when getting.\n */\n\n\n _proto.height = function height(value) {\n return this.dimension('height', value);\n };\n /**\n * A getter/setter for the `Player`'s width & height.\n *\n * @param {string} dimension\n * This string can be:\n * - 'width'\n * - 'height'\n *\n * @param {number} [value]\n * Value for dimension specified in the first argument.\n *\n * @return {number}\n * The dimension arguments value when getting (width/height).\n */\n\n\n _proto.dimension = function dimension(_dimension, value) {\n var privDimension = _dimension + '_';\n\n if (value === undefined) {\n return this[privDimension] || 0;\n }\n\n if (value === '') {\n // If an empty string is given, reset the dimension to be automatic\n this[privDimension] = undefined;\n this.updateStyleEl_();\n return;\n }\n\n var parsedVal = parseFloat(value);\n\n if (isNaN(parsedVal)) {\n log.error(\"Improper value \\\"\" + value + \"\\\" supplied for for \" + _dimension);\n return;\n }\n\n this[privDimension] = parsedVal;\n this.updateStyleEl_();\n };\n /**\n * A getter/setter/toggler for the vjs-fluid `className` on the `Player`.\n *\n * Turning this on will turn off fill mode.\n *\n * @param {boolean} [bool]\n * - A value of true adds the class.\n * - A value of false removes the class.\n * - No value will be a getter.\n *\n * @return {boolean|undefined}\n * - The value of fluid when getting.\n * - `undefined` when setting.\n */\n\n\n _proto.fluid = function fluid(bool) {\n if (bool === undefined) {\n return !!this.fluid_;\n }\n\n this.fluid_ = !!bool;\n\n if (isEvented(this)) {\n this.off('playerreset', this.updateStyleEl_);\n }\n\n if (bool) {\n this.addClass('vjs-fluid');\n this.fill(false);\n addEventedCallback(function () {\n this.on('playerreset', this.updateStyleEl_);\n });\n } else {\n this.removeClass('vjs-fluid');\n }\n\n this.updateStyleEl_();\n };\n /**\n * A getter/setter/toggler for the vjs-fill `className` on the `Player`.\n *\n * Turning this on will turn off fluid mode.\n *\n * @param {boolean} [bool]\n * - A value of true adds the class.\n * - A value of false removes the class.\n * - No value will be a getter.\n *\n * @return {boolean|undefined}\n * - The value of fluid when getting.\n * - `undefined` when setting.\n */\n\n\n _proto.fill = function fill(bool) {\n if (bool === undefined) {\n return !!this.fill_;\n }\n\n this.fill_ = !!bool;\n\n if (bool) {\n this.addClass('vjs-fill');\n this.fluid(false);\n } else {\n this.removeClass('vjs-fill');\n }\n };\n /**\n * Get/Set the aspect ratio\n *\n * @param {string} [ratio]\n * Aspect ratio for player\n *\n * @return {string|undefined}\n * returns the current aspect ratio when getting\n */\n\n /**\n * A getter/setter for the `Player`'s aspect ratio.\n *\n * @param {string} [ratio]\n * The value to set the `Player's aspect ratio to.\n *\n * @return {string|undefined}\n * - The current aspect ratio of the `Player` when getting.\n * - undefined when setting\n */\n\n\n _proto.aspectRatio = function aspectRatio(ratio) {\n if (ratio === undefined) {\n return this.aspectRatio_;\n } // Check for width:height format\n\n\n if (!/^\\d+\\:\\d+$/.test(ratio)) {\n throw new Error('Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.');\n }\n\n this.aspectRatio_ = ratio; // We're assuming if you set an aspect ratio you want fluid mode,\n // because in fixed mode you could calculate width and height yourself.\n\n this.fluid(true);\n this.updateStyleEl_();\n };\n /**\n * Update styles of the `Player` element (height, width and aspect ratio).\n *\n * @private\n * @listens Tech#loadedmetadata\n */\n\n\n _proto.updateStyleEl_ = function updateStyleEl_() {\n if (window$1.VIDEOJS_NO_DYNAMIC_STYLE === true) {\n var _width = typeof this.width_ === 'number' ? this.width_ : this.options_.width;\n\n var _height = typeof this.height_ === 'number' ? this.height_ : this.options_.height;\n\n var techEl = this.tech_ && this.tech_.el();\n\n if (techEl) {\n if (_width >= 0) {\n techEl.width = _width;\n }\n\n if (_height >= 0) {\n techEl.height = _height;\n }\n }\n\n return;\n }\n\n var width;\n var height;\n var aspectRatio;\n var idClass; // The aspect ratio is either used directly or to calculate width and height.\n\n if (this.aspectRatio_ !== undefined && this.aspectRatio_ !== 'auto') {\n // Use any aspectRatio that's been specifically set\n aspectRatio = this.aspectRatio_;\n } else if (this.videoWidth() > 0) {\n // Otherwise try to get the aspect ratio from the video metadata\n aspectRatio = this.videoWidth() + ':' + this.videoHeight();\n } else {\n // Or use a default. The video element's is 2:1, but 16:9 is more common.\n aspectRatio = '16:9';\n } // Get the ratio as a decimal we can use to calculate dimensions\n\n\n var ratioParts = aspectRatio.split(':');\n var ratioMultiplier = ratioParts[1] / ratioParts[0];\n\n if (this.width_ !== undefined) {\n // Use any width that's been specifically set\n width = this.width_;\n } else if (this.height_ !== undefined) {\n // Or calulate the width from the aspect ratio if a height has been set\n width = this.height_ / ratioMultiplier;\n } else {\n // Or use the video's metadata, or use the video el's default of 300\n width = this.videoWidth() || 300;\n }\n\n if (this.height_ !== undefined) {\n // Use any height that's been specifically set\n height = this.height_;\n } else {\n // Otherwise calculate the height from the ratio and the width\n height = width * ratioMultiplier;\n } // Ensure the CSS class is valid by starting with an alpha character\n\n\n if (/^[^a-zA-Z]/.test(this.id())) {\n idClass = 'dimensions-' + this.id();\n } else {\n idClass = this.id() + '-dimensions';\n } // Ensure the right class is still on the player for the style element\n\n\n this.addClass(idClass);\n setTextContent(this.styleEl_, \"\\n .\" + idClass + \" {\\n width: \" + width + \"px;\\n height: \" + height + \"px;\\n }\\n\\n .\" + idClass + \".vjs-fluid {\\n padding-top: \" + ratioMultiplier * 100 + \"%;\\n }\\n \");\n };\n /**\n * Load/Create an instance of playback {@link Tech} including element\n * and API methods. Then append the `Tech` element in `Player` as a child.\n *\n * @param {string} techName\n * name of the playback technology\n *\n * @param {string} source\n * video source\n *\n * @private\n */\n\n\n _proto.loadTech_ = function loadTech_(techName, source) {\n var _this2 = this;\n\n // Pause and remove current playback technology\n if (this.tech_) {\n this.unloadTech_();\n }\n\n var titleTechName = toTitleCase(techName);\n var camelTechName = techName.charAt(0).toLowerCase() + techName.slice(1); // get rid of the HTML5 video tag as soon as we are using another tech\n\n if (titleTechName !== 'Html5' && this.tag) {\n Tech.getTech('Html5').disposeMediaElement(this.tag);\n this.tag.player = null;\n this.tag = null;\n }\n\n this.techName_ = titleTechName; // Turn off API access because we're loading a new tech that might load asynchronously\n\n this.isReady_ = false; // if autoplay is a string we pass false to the tech\n // because the player is going to handle autoplay on `loadstart`\n\n var autoplay = typeof this.autoplay() === 'string' ? false : this.autoplay(); // Grab tech-specific options from player options and add source and parent element to use.\n\n var techOptions = {\n source: source,\n autoplay: autoplay,\n 'nativeControlsForTouch': this.options_.nativeControlsForTouch,\n 'playerId': this.id(),\n 'techId': this.id() + \"_\" + camelTechName + \"_api\",\n 'playsinline': this.options_.playsinline,\n 'preload': this.options_.preload,\n 'loop': this.options_.loop,\n 'muted': this.options_.muted,\n 'poster': this.poster(),\n 'language': this.language(),\n 'playerElIngest': this.playerElIngest_ || false,\n 'vtt.js': this.options_['vtt.js'],\n 'canOverridePoster': !!this.options_.techCanOverridePoster,\n 'enableSourceset': this.options_.enableSourceset\n };\n ALL.names.forEach(function (name$$1) {\n var props = ALL[name$$1];\n techOptions[props.getterName] = _this2[props.privateName];\n });\n assign(techOptions, this.options_[titleTechName]);\n assign(techOptions, this.options_[camelTechName]);\n assign(techOptions, this.options_[techName.toLowerCase()]);\n\n if (this.tag) {\n techOptions.tag = this.tag;\n }\n\n if (source && source.src === this.cache_.src && this.cache_.currentTime > 0) {\n techOptions.startTime = this.cache_.currentTime;\n } // Initialize tech instance\n\n\n var TechClass = Tech.getTech(techName);\n\n if (!TechClass) {\n throw new Error(\"No Tech named '\" + titleTechName + \"' exists! '\" + titleTechName + \"' should be registered using videojs.registerTech()'\");\n }\n\n this.tech_ = new TechClass(techOptions); // player.triggerReady is always async, so don't need this to be async\n\n this.tech_.ready(bind(this, this.handleTechReady_), true);\n textTrackConverter.jsonToTextTracks(this.textTracksJson_ || [], this.tech_); // Listen to all HTML5-defined events and trigger them on the player\n\n TECH_EVENTS_RETRIGGER.forEach(function (event) {\n _this2.on(_this2.tech_, event, _this2[\"handleTech\" + toTitleCase(event) + \"_\"]);\n });\n Object.keys(TECH_EVENTS_QUEUE).forEach(function (event) {\n _this2.on(_this2.tech_, event, function (eventObj) {\n if (_this2.tech_.playbackRate() === 0 && _this2.tech_.seeking()) {\n _this2.queuedCallbacks_.push({\n callback: _this2[\"handleTech\" + TECH_EVENTS_QUEUE[event] + \"_\"].bind(_this2),\n event: eventObj\n });\n\n return;\n }\n\n _this2[\"handleTech\" + TECH_EVENTS_QUEUE[event] + \"_\"](eventObj);\n });\n });\n this.on(this.tech_, 'loadstart', this.handleTechLoadStart_);\n this.on(this.tech_, 'sourceset', this.handleTechSourceset_);\n this.on(this.tech_, 'waiting', this.handleTechWaiting_);\n this.on(this.tech_, 'ended', this.handleTechEnded_);\n this.on(this.tech_, 'seeking', this.handleTechSeeking_);\n this.on(this.tech_, 'play', this.handleTechPlay_);\n this.on(this.tech_, 'firstplay', this.handleTechFirstPlay_);\n this.on(this.tech_, 'pause', this.handleTechPause_);\n this.on(this.tech_, 'durationchange', this.handleTechDurationChange_);\n this.on(this.tech_, 'fullscreenchange', this.handleTechFullscreenChange_);\n this.on(this.tech_, 'error', this.handleTechError_);\n this.on(this.tech_, 'loadedmetadata', this.updateStyleEl_);\n this.on(this.tech_, 'posterchange', this.handleTechPosterChange_);\n this.on(this.tech_, 'textdata', this.handleTechTextData_);\n this.on(this.tech_, 'ratechange', this.handleTechRateChange_);\n this.usingNativeControls(this.techGet_('controls'));\n\n if (this.controls() && !this.usingNativeControls()) {\n this.addTechControlsListeners_();\n } // Add the tech element in the DOM if it was not already there\n // Make sure to not insert the original video element if using Html5\n\n\n if (this.tech_.el().parentNode !== this.el() && (titleTechName !== 'Html5' || !this.tag)) {\n prependTo(this.tech_.el(), this.el());\n } // Get rid of the original video tag reference after the first tech is loaded\n\n\n if (this.tag) {\n this.tag.player = null;\n this.tag = null;\n }\n };\n /**\n * Unload and dispose of the current playback {@link Tech}.\n *\n * @private\n */\n\n\n _proto.unloadTech_ = function unloadTech_() {\n var _this3 = this;\n\n // Save the current text tracks so that we can reuse the same text tracks with the next tech\n ALL.names.forEach(function (name$$1) {\n var props = ALL[name$$1];\n _this3[props.privateName] = _this3[props.getterName]();\n });\n this.textTracksJson_ = textTrackConverter.textTracksToJson(this.tech_);\n this.isReady_ = false;\n this.tech_.dispose();\n this.tech_ = false;\n\n if (this.isPosterFromTech_) {\n this.poster_ = '';\n this.trigger('posterchange');\n }\n\n this.isPosterFromTech_ = false;\n };\n /**\n * Return a reference to the current {@link Tech}.\n * It will print a warning by default about the danger of using the tech directly\n * but any argument that is passed in will silence the warning.\n *\n * @param {*} [safety]\n * Anything passed in to silence the warning\n *\n * @return {Tech}\n * The Tech\n */\n\n\n _proto.tech = function tech(safety) {\n if (safety === undefined) {\n log.warn(tsml(_templateObject$2()));\n }\n\n return this.tech_;\n };\n /**\n * Set up click and touch listeners for the playback element\n *\n * - On desktops: a click on the video itself will toggle playback\n * - On mobile devices: a click on the video toggles controls\n * which is done by toggling the user state between active and\n * inactive\n * - A tap can signal that a user has become active or has become inactive\n * e.g. a quick tap on an iPhone movie should reveal the controls. Another\n * quick tap should hide them again (signaling the user is in an inactive\n * viewing state)\n * - In addition to this, we still want the user to be considered inactive after\n * a few seconds of inactivity.\n *\n * > Note: the only part of iOS interaction we can't mimic with this setup\n * is a touch and hold on the video element counting as activity in order to\n * keep the controls showing, but that shouldn't be an issue. A touch and hold\n * on any controls will still keep the user active\n *\n * @private\n */\n\n\n _proto.addTechControlsListeners_ = function addTechControlsListeners_() {\n // Make sure to remove all the previous listeners in case we are called multiple times.\n this.removeTechControlsListeners_(); // Some browsers (Chrome & IE) don't trigger a click on a flash swf, but do\n // trigger mousedown/up.\n // http://stackoverflow.com/questions/1444562/javascript-onclick-event-over-flash-object\n // Any touch events are set to block the mousedown event from happening\n\n this.on(this.tech_, 'mousedown', this.handleTechClick_);\n this.on(this.tech_, 'dblclick', this.handleTechDoubleClick_); // If the controls were hidden we don't want that to change without a tap event\n // so we'll check if the controls were already showing before reporting user\n // activity\n\n this.on(this.tech_, 'touchstart', this.handleTechTouchStart_);\n this.on(this.tech_, 'touchmove', this.handleTechTouchMove_);\n this.on(this.tech_, 'touchend', this.handleTechTouchEnd_); // The tap listener needs to come after the touchend listener because the tap\n // listener cancels out any reportedUserActivity when setting userActive(false)\n\n this.on(this.tech_, 'tap', this.handleTechTap_);\n };\n /**\n * Remove the listeners used for click and tap controls. This is needed for\n * toggling to controls disabled, where a tap/touch should do nothing.\n *\n * @private\n */\n\n\n _proto.removeTechControlsListeners_ = function removeTechControlsListeners_() {\n // We don't want to just use `this.off()` because there might be other needed\n // listeners added by techs that extend this.\n this.off(this.tech_, 'tap', this.handleTechTap_);\n this.off(this.tech_, 'touchstart', this.handleTechTouchStart_);\n this.off(this.tech_, 'touchmove', this.handleTechTouchMove_);\n this.off(this.tech_, 'touchend', this.handleTechTouchEnd_);\n this.off(this.tech_, 'mousedown', this.handleTechClick_);\n this.off(this.tech_, 'dblclick', this.handleTechDoubleClick_);\n };\n /**\n * Player waits for the tech to be ready\n *\n * @private\n */\n\n\n _proto.handleTechReady_ = function handleTechReady_() {\n this.triggerReady(); // Keep the same volume as before\n\n if (this.cache_.volume) {\n this.techCall_('setVolume', this.cache_.volume);\n } // Look if the tech found a higher resolution poster while loading\n\n\n this.handleTechPosterChange_(); // Update the duration if available\n\n this.handleTechDurationChange_();\n };\n /**\n * Retrigger the `loadstart` event that was triggered by the {@link Tech}. This\n * function will also trigger {@link Player#firstplay} if it is the first loadstart\n * for a video.\n *\n * @fires Player#loadstart\n * @fires Player#firstplay\n * @listens Tech#loadstart\n * @private\n */\n\n\n _proto.handleTechLoadStart_ = function handleTechLoadStart_() {\n // TODO: Update to use `emptied` event instead. See #1277.\n this.removeClass('vjs-ended');\n this.removeClass('vjs-seeking'); // reset the error state\n\n this.error(null); // Update the duration\n\n this.handleTechDurationChange_(); // If it's already playing we want to trigger a firstplay event now.\n // The firstplay event relies on both the play and loadstart events\n // which can happen in any order for a new source\n\n if (!this.paused()) {\n /**\n * Fired when the user agent begins looking for media data\n *\n * @event Player#loadstart\n * @type {EventTarget~Event}\n */\n this.trigger('loadstart');\n this.trigger('firstplay');\n } else {\n // reset the hasStarted state\n this.hasStarted(false);\n this.trigger('loadstart');\n } // autoplay happens after loadstart for the browser,\n // so we mimic that behavior\n\n\n this.manualAutoplay_(this.autoplay());\n };\n /**\n * Handle autoplay string values, rather than the typical boolean\n * values that should be handled by the tech. Note that this is not\n * part of any specification. Valid values and what they do can be\n * found on the autoplay getter at Player#autoplay()\n */\n\n\n _proto.manualAutoplay_ = function manualAutoplay_(type) {\n var _this4 = this;\n\n if (!this.tech_ || typeof type !== 'string') {\n return;\n }\n\n var muted = function muted() {\n var previouslyMuted = _this4.muted();\n\n _this4.muted(true);\n\n var playPromise = _this4.play();\n\n if (!playPromise || !playPromise.then || !playPromise.catch) {\n return;\n }\n\n return playPromise.catch(function (e) {\n // restore old value of muted on failure\n _this4.muted(previouslyMuted);\n });\n };\n\n var promise;\n\n if (type === 'any') {\n promise = this.play();\n\n if (promise && promise.then && promise.catch) {\n promise.catch(function () {\n return muted();\n });\n }\n } else if (type === 'muted') {\n promise = muted();\n } else {\n promise = this.play();\n }\n\n if (!promise || !promise.then || !promise.catch) {\n return;\n }\n\n return promise.then(function () {\n _this4.trigger({\n type: 'autoplay-success',\n autoplay: type\n });\n }).catch(function (e) {\n _this4.trigger({\n type: 'autoplay-failure',\n autoplay: type\n });\n });\n };\n /**\n * Update the internal source caches so that we return the correct source from\n * `src()`, `currentSource()`, and `currentSources()`.\n *\n * > Note: `currentSources` will not be updated if the source that is passed in exists\n * in the current `currentSources` cache.\n *\n *\n * @param {Tech~SourceObject} srcObj\n * A string or object source to update our caches to.\n */\n\n\n _proto.updateSourceCaches_ = function updateSourceCaches_(srcObj) {\n if (srcObj === void 0) {\n srcObj = '';\n }\n\n var src = srcObj;\n var type = '';\n\n if (typeof src !== 'string') {\n src = srcObj.src;\n type = srcObj.type;\n } // make sure all the caches are set to default values\n // to prevent null checking\n\n\n this.cache_.source = this.cache_.source || {};\n this.cache_.sources = this.cache_.sources || []; // try to get the type of the src that was passed in\n\n if (src && !type) {\n type = findMimetype(this, src);\n } // update `currentSource` cache always\n\n\n this.cache_.source = mergeOptions({}, srcObj, {\n src: src,\n type: type\n });\n var matchingSources = this.cache_.sources.filter(function (s) {\n return s.src && s.src === src;\n });\n var sourceElSources = [];\n var sourceEls = this.$$('source');\n var matchingSourceEls = [];\n\n for (var i = 0; i < sourceEls.length; i++) {\n var sourceObj = getAttributes(sourceEls[i]);\n sourceElSources.push(sourceObj);\n\n if (sourceObj.src && sourceObj.src === src) {\n matchingSourceEls.push(sourceObj.src);\n }\n } // if we have matching source els but not matching sources\n // the current source cache is not up to date\n\n\n if (matchingSourceEls.length && !matchingSources.length) {\n this.cache_.sources = sourceElSources; // if we don't have matching source or source els set the\n // sources cache to the `currentSource` cache\n } else if (!matchingSources.length) {\n this.cache_.sources = [this.cache_.source];\n } // update the tech `src` cache\n\n\n this.cache_.src = src;\n };\n /**\n * *EXPERIMENTAL* Fired when the source is set or changed on the {@link Tech}\n * causing the media element to reload.\n *\n * It will fire for the initial source and each subsequent source.\n * This event is a custom event from Video.js and is triggered by the {@link Tech}.\n *\n * The event object for this event contains a `src` property that will contain the source\n * that was available when the event was triggered. This is generally only necessary if Video.js\n * is switching techs while the source was being changed.\n *\n * It is also fired when `load` is called on the player (or media element)\n * because the {@link https://html.spec.whatwg.org/multipage/media.html#dom-media-load|specification for `load`}\n * says that the resource selection algorithm needs to be aborted and restarted.\n * In this case, it is very likely that the `src` property will be set to the\n * empty string `\"\"` to indicate we do not know what the source will be but\n * that it is changing.\n *\n * *This event is currently still experimental and may change in minor releases.*\n * __To use this, pass `enableSourceset` option to the player.__\n *\n * @event Player#sourceset\n * @type {EventTarget~Event}\n * @prop {string} src\n * The source url available when the `sourceset` was triggered.\n * It will be an empty string if we cannot know what the source is\n * but know that the source will change.\n */\n\n /**\n * Retrigger the `sourceset` event that was triggered by the {@link Tech}.\n *\n * @fires Player#sourceset\n * @listens Tech#sourceset\n * @private\n */\n\n\n _proto.handleTechSourceset_ = function handleTechSourceset_(event) {\n var _this5 = this;\n\n // only update the source cache when the source\n // was not updated using the player api\n if (!this.changingSrc_) {\n var updateSourceCaches = function updateSourceCaches(src) {\n return _this5.updateSourceCaches_(src);\n };\n\n var playerSrc = this.currentSource().src;\n var eventSrc = event.src; // if we have a playerSrc that is not a blob, and a tech src that is a blob\n\n if (playerSrc && !/^blob:/.test(playerSrc) && /^blob:/.test(eventSrc)) {\n // if both the tech source and the player source were updated we assume\n // something like @videojs/http-streaming did the sourceset and skip updating the source cache.\n if (!this.lastSource_ || this.lastSource_.tech !== eventSrc && this.lastSource_.player !== playerSrc) {\n updateSourceCaches = function updateSourceCaches() {};\n }\n } // update the source to the intial source right away\n // in some cases this will be empty string\n\n\n updateSourceCaches(eventSrc); // if the `sourceset` `src` was an empty string\n // wait for a `loadstart` to update the cache to `currentSrc`.\n // If a sourceset happens before a `loadstart`, we reset the state\n // as this function will be called again.\n\n if (!event.src) {\n var updateCache = function updateCache(e) {\n if (e.type !== 'sourceset') {\n var techSrc = _this5.techGet('currentSrc');\n\n _this5.lastSource_.tech = techSrc;\n\n _this5.updateSourceCaches_(techSrc);\n }\n\n _this5.tech_.off(['sourceset', 'loadstart'], updateCache);\n };\n\n this.tech_.one(['sourceset', 'loadstart'], updateCache);\n }\n }\n\n this.lastSource_ = {\n player: this.currentSource().src,\n tech: event.src\n };\n this.trigger({\n src: event.src,\n type: 'sourceset'\n });\n };\n /**\n * Add/remove the vjs-has-started class\n *\n * @fires Player#firstplay\n *\n * @param {boolean} request\n * - true: adds the class\n * - false: remove the class\n *\n * @return {boolean}\n * the boolean value of hasStarted_\n */\n\n\n _proto.hasStarted = function hasStarted(request) {\n if (request === undefined) {\n // act as getter, if we have no request to change\n return this.hasStarted_;\n }\n\n if (request === this.hasStarted_) {\n return;\n }\n\n this.hasStarted_ = request;\n\n if (this.hasStarted_) {\n this.addClass('vjs-has-started');\n this.trigger('firstplay');\n } else {\n this.removeClass('vjs-has-started');\n }\n };\n /**\n * Fired whenever the media begins or resumes playback\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-play}\n * @fires Player#play\n * @listens Tech#play\n * @private\n */\n\n\n _proto.handleTechPlay_ = function handleTechPlay_() {\n this.removeClass('vjs-ended');\n this.removeClass('vjs-paused');\n this.addClass('vjs-playing'); // hide the poster when the user hits play\n\n this.hasStarted(true);\n /**\n * Triggered whenever an {@link Tech#play} event happens. Indicates that\n * playback has started or resumed.\n *\n * @event Player#play\n * @type {EventTarget~Event}\n */\n\n this.trigger('play');\n };\n /**\n * Retrigger the `ratechange` event that was triggered by the {@link Tech}.\n *\n * If there were any events queued while the playback rate was zero, fire\n * those events now.\n *\n * @private\n * @method Player#handleTechRateChange_\n * @fires Player#ratechange\n * @listens Tech#ratechange\n */\n\n\n _proto.handleTechRateChange_ = function handleTechRateChange_() {\n if (this.tech_.playbackRate() > 0 && this.cache_.lastPlaybackRate === 0) {\n this.queuedCallbacks_.forEach(function (queued) {\n return queued.callback(queued.event);\n });\n this.queuedCallbacks_ = [];\n }\n\n this.cache_.lastPlaybackRate = this.tech_.playbackRate();\n /**\n * Fires when the playing speed of the audio/video is changed\n *\n * @event Player#ratechange\n * @type {event}\n */\n\n this.trigger('ratechange');\n };\n /**\n * Retrigger the `waiting` event that was triggered by the {@link Tech}.\n *\n * @fires Player#waiting\n * @listens Tech#waiting\n * @private\n */\n\n\n _proto.handleTechWaiting_ = function handleTechWaiting_() {\n var _this6 = this;\n\n this.addClass('vjs-waiting');\n /**\n * A readyState change on the DOM element has caused playback to stop.\n *\n * @event Player#waiting\n * @type {EventTarget~Event}\n */\n\n this.trigger('waiting'); // Browsers may emit a timeupdate event after a waiting event. In order to prevent\n // premature removal of the waiting class, wait for the time to change.\n\n var timeWhenWaiting = this.currentTime();\n\n var timeUpdateListener = function timeUpdateListener() {\n if (timeWhenWaiting !== _this6.currentTime()) {\n _this6.removeClass('vjs-waiting');\n\n _this6.off('timeupdate', timeUpdateListener);\n }\n };\n\n this.on('timeupdate', timeUpdateListener);\n };\n /**\n * Retrigger the `canplay` event that was triggered by the {@link Tech}.\n * > Note: This is not consistent between browsers. See #1351\n *\n * @fires Player#canplay\n * @listens Tech#canplay\n * @private\n */\n\n\n _proto.handleTechCanPlay_ = function handleTechCanPlay_() {\n this.removeClass('vjs-waiting');\n /**\n * The media has a readyState of HAVE_FUTURE_DATA or greater.\n *\n * @event Player#canplay\n * @type {EventTarget~Event}\n */\n\n this.trigger('canplay');\n };\n /**\n * Retrigger the `canplaythrough` event that was triggered by the {@link Tech}.\n *\n * @fires Player#canplaythrough\n * @listens Tech#canplaythrough\n * @private\n */\n\n\n _proto.handleTechCanPlayThrough_ = function handleTechCanPlayThrough_() {\n this.removeClass('vjs-waiting');\n /**\n * The media has a readyState of HAVE_ENOUGH_DATA or greater. This means that the\n * entire media file can be played without buffering.\n *\n * @event Player#canplaythrough\n * @type {EventTarget~Event}\n */\n\n this.trigger('canplaythrough');\n };\n /**\n * Retrigger the `playing` event that was triggered by the {@link Tech}.\n *\n * @fires Player#playing\n * @listens Tech#playing\n * @private\n */\n\n\n _proto.handleTechPlaying_ = function handleTechPlaying_() {\n this.removeClass('vjs-waiting');\n /**\n * The media is no longer blocked from playback, and has started playing.\n *\n * @event Player#playing\n * @type {EventTarget~Event}\n */\n\n this.trigger('playing');\n };\n /**\n * Retrigger the `seeking` event that was triggered by the {@link Tech}.\n *\n * @fires Player#seeking\n * @listens Tech#seeking\n * @private\n */\n\n\n _proto.handleTechSeeking_ = function handleTechSeeking_() {\n this.addClass('vjs-seeking');\n /**\n * Fired whenever the player is jumping to a new time\n *\n * @event Player#seeking\n * @type {EventTarget~Event}\n */\n\n this.trigger('seeking');\n };\n /**\n * Retrigger the `seeked` event that was triggered by the {@link Tech}.\n *\n * @fires Player#seeked\n * @listens Tech#seeked\n * @private\n */\n\n\n _proto.handleTechSeeked_ = function handleTechSeeked_() {\n this.removeClass('vjs-seeking');\n /**\n * Fired when the player has finished jumping to a new time\n *\n * @event Player#seeked\n * @type {EventTarget~Event}\n */\n\n this.trigger('seeked');\n };\n /**\n * Retrigger the `firstplay` event that was triggered by the {@link Tech}.\n *\n * @fires Player#firstplay\n * @listens Tech#firstplay\n * @deprecated As of 6.0 firstplay event is deprecated.\n * As of 6.0 passing the `starttime` option to the player and the firstplay event are deprecated.\n * @private\n */\n\n\n _proto.handleTechFirstPlay_ = function handleTechFirstPlay_() {\n // If the first starttime attribute is specified\n // then we will start at the given offset in seconds\n if (this.options_.starttime) {\n log.warn('Passing the `starttime` option to the player will be deprecated in 6.0');\n this.currentTime(this.options_.starttime);\n }\n\n this.addClass('vjs-has-started');\n /**\n * Fired the first time a video is played. Not part of the HLS spec, and this is\n * probably not the best implementation yet, so use sparingly. If you don't have a\n * reason to prevent playback, use `myPlayer.one('play');` instead.\n *\n * @event Player#firstplay\n * @deprecated As of 6.0 firstplay event is deprecated.\n * @type {EventTarget~Event}\n */\n\n this.trigger('firstplay');\n };\n /**\n * Retrigger the `pause` event that was triggered by the {@link Tech}.\n *\n * @fires Player#pause\n * @listens Tech#pause\n * @private\n */\n\n\n _proto.handleTechPause_ = function handleTechPause_() {\n this.removeClass('vjs-playing');\n this.addClass('vjs-paused');\n /**\n * Fired whenever the media has been paused\n *\n * @event Player#pause\n * @type {EventTarget~Event}\n */\n\n this.trigger('pause');\n };\n /**\n * Retrigger the `ended` event that was triggered by the {@link Tech}.\n *\n * @fires Player#ended\n * @listens Tech#ended\n * @private\n */\n\n\n _proto.handleTechEnded_ = function handleTechEnded_() {\n this.addClass('vjs-ended');\n\n if (this.options_.loop) {\n this.currentTime(0);\n this.play();\n } else if (!this.paused()) {\n this.pause();\n }\n /**\n * Fired when the end of the media resource is reached (currentTime == duration)\n *\n * @event Player#ended\n * @type {EventTarget~Event}\n */\n\n\n this.trigger('ended');\n };\n /**\n * Fired when the duration of the media resource is first known or changed\n *\n * @listens Tech#durationchange\n * @private\n */\n\n\n _proto.handleTechDurationChange_ = function handleTechDurationChange_() {\n this.duration(this.techGet_('duration'));\n };\n /**\n * Handle a click on the media element to play/pause\n *\n * @param {EventTarget~Event} event\n * the event that caused this function to trigger\n *\n * @listens Tech#mousedown\n * @private\n */\n\n\n _proto.handleTechClick_ = function handleTechClick_(event) {\n if (!isSingleLeftClick(event)) {\n return;\n } // When controls are disabled a click should not toggle playback because\n // the click is considered a control\n\n\n if (!this.controls_) {\n return;\n }\n\n if (this.paused()) {\n silencePromise(this.play());\n } else {\n this.pause();\n }\n };\n /**\n * Handle a double-click on the media element to enter/exit fullscreen\n *\n * @param {EventTarget~Event} event\n * the event that caused this function to trigger\n *\n * @listens Tech#dblclick\n * @private\n */\n\n\n _proto.handleTechDoubleClick_ = function handleTechDoubleClick_(event) {\n if (!this.controls_) {\n return;\n } // we do not want to toggle fullscreen state\n // when double-clicking inside a control bar or a modal\n\n\n var inAllowedEls = Array.prototype.some.call(this.$$('.vjs-control-bar, .vjs-modal-dialog'), function (el) {\n return el.contains(event.target);\n });\n\n if (!inAllowedEls) {\n if (this.isFullscreen()) {\n this.exitFullscreen();\n } else {\n this.requestFullscreen();\n }\n }\n };\n /**\n * Handle a tap on the media element. It will toggle the user\n * activity state, which hides and shows the controls.\n *\n * @listens Tech#tap\n * @private\n */\n\n\n _proto.handleTechTap_ = function handleTechTap_() {\n this.userActive(!this.userActive());\n };\n /**\n * Handle touch to start\n *\n * @listens Tech#touchstart\n * @private\n */\n\n\n _proto.handleTechTouchStart_ = function handleTechTouchStart_() {\n this.userWasActive = this.userActive();\n };\n /**\n * Handle touch to move\n *\n * @listens Tech#touchmove\n * @private\n */\n\n\n _proto.handleTechTouchMove_ = function handleTechTouchMove_() {\n if (this.userWasActive) {\n this.reportUserActivity();\n }\n };\n /**\n * Handle touch to end\n *\n * @param {EventTarget~Event} event\n * the touchend event that triggered\n * this function\n *\n * @listens Tech#touchend\n * @private\n */\n\n\n _proto.handleTechTouchEnd_ = function handleTechTouchEnd_(event) {\n // Stop the mouse events from also happening\n event.preventDefault();\n };\n /**\n * Fired when the player switches in or out of fullscreen mode\n *\n * @private\n * @listens Player#fullscreenchange\n */\n\n\n _proto.handleFullscreenChange_ = function handleFullscreenChange_() {\n if (this.isFullscreen()) {\n this.addClass('vjs-fullscreen');\n } else {\n this.removeClass('vjs-fullscreen');\n }\n };\n /**\n * native click events on the SWF aren't triggered on IE11, Win8.1RT\n * use stageclick events triggered from inside the SWF instead\n *\n * @private\n * @listens stageclick\n */\n\n\n _proto.handleStageClick_ = function handleStageClick_() {\n this.reportUserActivity();\n };\n /**\n * Handle Tech Fullscreen Change\n *\n * @param {EventTarget~Event} event\n * the fullscreenchange event that triggered this function\n *\n * @param {Object} data\n * the data that was sent with the event\n *\n * @private\n * @listens Tech#fullscreenchange\n * @fires Player#fullscreenchange\n */\n\n\n _proto.handleTechFullscreenChange_ = function handleTechFullscreenChange_(event, data) {\n if (data) {\n this.isFullscreen(data.isFullscreen);\n }\n /**\n * Fired when going in and out of fullscreen.\n *\n * @event Player#fullscreenchange\n * @type {EventTarget~Event}\n */\n\n\n this.trigger('fullscreenchange');\n };\n /**\n * Fires when an error occurred during the loading of an audio/video.\n *\n * @private\n * @listens Tech#error\n */\n\n\n _proto.handleTechError_ = function handleTechError_() {\n var error = this.tech_.error();\n this.error(error);\n };\n /**\n * Retrigger the `textdata` event that was triggered by the {@link Tech}.\n *\n * @fires Player#textdata\n * @listens Tech#textdata\n * @private\n */\n\n\n _proto.handleTechTextData_ = function handleTechTextData_() {\n var data = null;\n\n if (arguments.length > 1) {\n data = arguments[1];\n }\n /**\n * Fires when we get a textdata event from tech\n *\n * @event Player#textdata\n * @type {EventTarget~Event}\n */\n\n\n this.trigger('textdata', data);\n };\n /**\n * Get object for cached values.\n *\n * @return {Object}\n * get the current object cache\n */\n\n\n _proto.getCache = function getCache() {\n return this.cache_;\n };\n /**\n * Pass values to the playback tech\n *\n * @param {string} [method]\n * the method to call\n *\n * @param {Object} arg\n * the argument to pass\n *\n * @private\n */\n\n\n _proto.techCall_ = function techCall_(method, arg) {\n // If it's not ready yet, call method when it is\n this.ready(function () {\n if (method in allowedSetters) {\n return set$1(this.middleware_, this.tech_, method, arg);\n } else if (method in allowedMediators) {\n return mediate(this.middleware_, this.tech_, method, arg);\n }\n\n try {\n if (this.tech_) {\n this.tech_[method](arg);\n }\n } catch (e) {\n log(e);\n throw e;\n }\n }, true);\n };\n /**\n * Get calls can't wait for the tech, and sometimes don't need to.\n *\n * @param {string} method\n * Tech method\n *\n * @return {Function|undefined}\n * the method or undefined\n *\n * @private\n */\n\n\n _proto.techGet_ = function techGet_(method) {\n if (!this.tech_ || !this.tech_.isReady_) {\n return;\n }\n\n if (method in allowedGetters) {\n return get(this.middleware_, this.tech_, method);\n } else if (method in allowedMediators) {\n return mediate(this.middleware_, this.tech_, method);\n } // Flash likes to die and reload when you hide or reposition it.\n // In these cases the object methods go away and we get errors.\n // When that happens we'll catch the errors and inform tech that it's not ready any more.\n\n\n try {\n return this.tech_[method]();\n } catch (e) {\n // When building additional tech libs, an expected method may not be defined yet\n if (this.tech_[method] === undefined) {\n log(\"Video.js: \" + method + \" method not defined for \" + this.techName_ + \" playback technology.\", e);\n throw e;\n } // When a method isn't available on the object it throws a TypeError\n\n\n if (e.name === 'TypeError') {\n log(\"Video.js: \" + method + \" unavailable on \" + this.techName_ + \" playback technology element.\", e);\n this.tech_.isReady_ = false;\n throw e;\n } // If error unknown, just log and throw\n\n\n log(e);\n throw e;\n }\n };\n /**\n * Attempt to begin playback at the first opportunity.\n *\n * @return {Promise|undefined}\n * Returns a promise if the browser supports Promises (or one\n * was passed in as an option). This promise will be resolved on\n * the return value of play. If this is undefined it will fulfill the\n * promise chain otherwise the promise chain will be fulfilled when\n * the promise from play is fulfilled.\n */\n\n\n _proto.play = function play() {\n var _this7 = this;\n\n var PromiseClass = this.options_.Promise || window$1.Promise;\n\n if (PromiseClass) {\n return new PromiseClass(function (resolve) {\n _this7.play_(resolve);\n });\n }\n\n return this.play_();\n };\n /**\n * The actual logic for play, takes a callback that will be resolved on the\n * return value of play. This allows us to resolve to the play promise if there\n * is one on modern browsers.\n *\n * @private\n * @param {Function} [callback]\n * The callback that should be called when the techs play is actually called\n */\n\n\n _proto.play_ = function play_(callback) {\n var _this8 = this;\n\n if (callback === void 0) {\n callback = silencePromise;\n }\n\n // If this is called while we have a play queued up on a loadstart, remove\n // that listener to avoid getting in a potentially bad state.\n if (this.playOnLoadstart_) {\n this.off('loadstart', this.playOnLoadstart_);\n } // If the player/tech is not ready, queue up another call to `play()` for\n // when it is. This will loop back into this method for another attempt at\n // playback when the tech is ready.\n\n\n if (!this.isReady_) {\n // Bail out if we're already waiting for `ready`!\n if (this.playWaitingForReady_) {\n return;\n }\n\n this.playWaitingForReady_ = true;\n this.ready(function () {\n _this8.playWaitingForReady_ = false;\n callback(_this8.play());\n }); // If the player/tech is ready and we have a source, we can attempt playback.\n } else if (!this.changingSrc_ && (this.src() || this.currentSrc())) {\n callback(this.techGet_('play'));\n return; // If the tech is ready, but we do not have a source, we'll need to wait\n // for both the `ready` and a `loadstart` when the source is finally\n // resolved by middleware and set on the player.\n //\n // This can happen if `play()` is called while changing sources or before\n // one has been set on the player.\n } else {\n this.playOnLoadstart_ = function () {\n _this8.playOnLoadstart_ = null;\n callback(_this8.play());\n };\n\n this.one('loadstart', this.playOnLoadstart_);\n }\n };\n /**\n * Pause the video playback\n *\n * @return {Player}\n * A reference to the player object this function was called on\n */\n\n\n _proto.pause = function pause() {\n this.techCall_('pause');\n };\n /**\n * Check if the player is paused or has yet to play\n *\n * @return {boolean}\n * - false: if the media is currently playing\n * - true: if media is not currently playing\n */\n\n\n _proto.paused = function paused() {\n // The initial state of paused should be true (in Safari it's actually false)\n return this.techGet_('paused') === false ? false : true;\n };\n /**\n * Get a TimeRange object representing the current ranges of time that the user\n * has played.\n *\n * @return {TimeRange}\n * A time range object that represents all the increments of time that have\n * been played.\n */\n\n\n _proto.played = function played() {\n return this.techGet_('played') || createTimeRanges(0, 0);\n };\n /**\n * Returns whether or not the user is \"scrubbing\". Scrubbing is\n * when the user has clicked the progress bar handle and is\n * dragging it along the progress bar.\n *\n * @param {boolean} [isScrubbing]\n * whether the user is or is not scrubbing\n *\n * @return {boolean}\n * The value of scrubbing when getting\n */\n\n\n _proto.scrubbing = function scrubbing(isScrubbing) {\n if (typeof isScrubbing === 'undefined') {\n return this.scrubbing_;\n }\n\n this.scrubbing_ = !!isScrubbing;\n\n if (isScrubbing) {\n this.addClass('vjs-scrubbing');\n } else {\n this.removeClass('vjs-scrubbing');\n }\n };\n /**\n * Get or set the current time (in seconds)\n *\n * @param {number|string} [seconds]\n * The time to seek to in seconds\n *\n * @return {number}\n * - the current time in seconds when getting\n */\n\n\n _proto.currentTime = function currentTime(seconds) {\n if (typeof seconds !== 'undefined') {\n if (seconds < 0) {\n seconds = 0;\n }\n\n this.techCall_('setCurrentTime', seconds);\n return;\n } // cache last currentTime and return. default to 0 seconds\n //\n // Caching the currentTime is meant to prevent a massive amount of reads on the tech's\n // currentTime when scrubbing, but may not provide much performance benefit afterall.\n // Should be tested. Also something has to read the actual current time or the cache will\n // never get updated.\n\n\n this.cache_.currentTime = this.techGet_('currentTime') || 0;\n return this.cache_.currentTime;\n };\n /**\n * Normally gets the length in time of the video in seconds;\n * in all but the rarest use cases an argument will NOT be passed to the method\n *\n * > **NOTE**: The video must have started loading before the duration can be\n * known, and in the case of Flash, may not be known until the video starts\n * playing.\n *\n * @fires Player#durationchange\n *\n * @param {number} [seconds]\n * The duration of the video to set in seconds\n *\n * @return {number}\n * - The duration of the video in seconds when getting\n */\n\n\n _proto.duration = function duration(seconds) {\n if (seconds === undefined) {\n // return NaN if the duration is not known\n return this.cache_.duration !== undefined ? this.cache_.duration : NaN;\n }\n\n seconds = parseFloat(seconds); // Standardize on Infinity for signaling video is live\n\n if (seconds < 0) {\n seconds = Infinity;\n }\n\n if (seconds !== this.cache_.duration) {\n // Cache the last set value for optimized scrubbing (esp. Flash)\n this.cache_.duration = seconds;\n\n if (seconds === Infinity) {\n this.addClass('vjs-live');\n\n if (this.options_.liveui && this.player_.liveTracker) {\n this.addClass('vjs-liveui');\n }\n } else {\n this.removeClass('vjs-live');\n this.removeClass('vjs-liveui');\n }\n\n if (!isNaN(seconds)) {\n // Do not fire durationchange unless the duration value is known.\n // @see [Spec]{@link https://www.w3.org/TR/2011/WD-html5-20110113/video.html#media-element-load-algorithm}\n\n /**\n * @event Player#durationchange\n * @type {EventTarget~Event}\n */\n this.trigger('durationchange');\n }\n }\n };\n /**\n * Calculates how much time is left in the video. Not part\n * of the native video API.\n *\n * @return {number}\n * The time remaining in seconds\n */\n\n\n _proto.remainingTime = function remainingTime() {\n return this.duration() - this.currentTime();\n };\n /**\n * A remaining time function that is intented to be used when\n * the time is to be displayed directly to the user.\n *\n * @return {number}\n * The rounded time remaining in seconds\n */\n\n\n _proto.remainingTimeDisplay = function remainingTimeDisplay() {\n return Math.floor(this.duration()) - Math.floor(this.currentTime());\n }; //\n // Kind of like an array of portions of the video that have been downloaded.\n\n /**\n * Get a TimeRange object with an array of the times of the video\n * that have been downloaded. If you just want the percent of the\n * video that's been downloaded, use bufferedPercent.\n *\n * @see [Buffered Spec]{@link http://dev.w3.org/html5/spec/video.html#dom-media-buffered}\n *\n * @return {TimeRange}\n * A mock TimeRange object (following HTML spec)\n */\n\n\n _proto.buffered = function buffered() {\n var buffered = this.techGet_('buffered');\n\n if (!buffered || !buffered.length) {\n buffered = createTimeRanges(0, 0);\n }\n\n return buffered;\n };\n /**\n * Get the percent (as a decimal) of the video that's been downloaded.\n * This method is not a part of the native HTML video API.\n *\n * @return {number}\n * A decimal between 0 and 1 representing the percent\n * that is buffered 0 being 0% and 1 being 100%\n */\n\n\n _proto.bufferedPercent = function bufferedPercent$$1() {\n return bufferedPercent(this.buffered(), this.duration());\n };\n /**\n * Get the ending time of the last buffered time range\n * This is used in the progress bar to encapsulate all time ranges.\n *\n * @return {number}\n * The end of the last buffered time range\n */\n\n\n _proto.bufferedEnd = function bufferedEnd() {\n var buffered = this.buffered();\n var duration = this.duration();\n var end = buffered.end(buffered.length - 1);\n\n if (end > duration) {\n end = duration;\n }\n\n return end;\n };\n /**\n * Get or set the current volume of the media\n *\n * @param {number} [percentAsDecimal]\n * The new volume as a decimal percent:\n * - 0 is muted/0%/off\n * - 1.0 is 100%/full\n * - 0.5 is half volume or 50%\n *\n * @return {number}\n * The current volume as a percent when getting\n */\n\n\n _proto.volume = function volume(percentAsDecimal) {\n var vol;\n\n if (percentAsDecimal !== undefined) {\n // Force value to between 0 and 1\n vol = Math.max(0, Math.min(1, parseFloat(percentAsDecimal)));\n this.cache_.volume = vol;\n this.techCall_('setVolume', vol);\n\n if (vol > 0) {\n this.lastVolume_(vol);\n }\n\n return;\n } // Default to 1 when returning current volume.\n\n\n vol = parseFloat(this.techGet_('volume'));\n return isNaN(vol) ? 1 : vol;\n };\n /**\n * Get the current muted state, or turn mute on or off\n *\n * @param {boolean} [muted]\n * - true to mute\n * - false to unmute\n *\n * @return {boolean}\n * - true if mute is on and getting\n * - false if mute is off and getting\n */\n\n\n _proto.muted = function muted(_muted) {\n if (_muted !== undefined) {\n this.techCall_('setMuted', _muted);\n return;\n }\n\n return this.techGet_('muted') || false;\n };\n /**\n * Get the current defaultMuted state, or turn defaultMuted on or off. defaultMuted\n * indicates the state of muted on initial playback.\n *\n * ```js\n * var myPlayer = videojs('some-player-id');\n *\n * myPlayer.src(\"http://www.example.com/path/to/video.mp4\");\n *\n * // get, should be false\n * console.log(myPlayer.defaultMuted());\n * // set to true\n * myPlayer.defaultMuted(true);\n * // get should be true\n * console.log(myPlayer.defaultMuted());\n * ```\n *\n * @param {boolean} [defaultMuted]\n * - true to mute\n * - false to unmute\n *\n * @return {boolean|Player}\n * - true if defaultMuted is on and getting\n * - false if defaultMuted is off and getting\n * - A reference to the current player when setting\n */\n\n\n _proto.defaultMuted = function defaultMuted(_defaultMuted) {\n if (_defaultMuted !== undefined) {\n return this.techCall_('setDefaultMuted', _defaultMuted);\n }\n\n return this.techGet_('defaultMuted') || false;\n };\n /**\n * Get the last volume, or set it\n *\n * @param {number} [percentAsDecimal]\n * The new last volume as a decimal percent:\n * - 0 is muted/0%/off\n * - 1.0 is 100%/full\n * - 0.5 is half volume or 50%\n *\n * @return {number}\n * the current value of lastVolume as a percent when getting\n *\n * @private\n */\n\n\n _proto.lastVolume_ = function lastVolume_(percentAsDecimal) {\n if (percentAsDecimal !== undefined && percentAsDecimal !== 0) {\n this.cache_.lastVolume = percentAsDecimal;\n return;\n }\n\n return this.cache_.lastVolume;\n };\n /**\n * Check if current tech can support native fullscreen\n * (e.g. with built in controls like iOS, so not our flash swf)\n *\n * @return {boolean}\n * if native fullscreen is supported\n */\n\n\n _proto.supportsFullScreen = function supportsFullScreen() {\n return this.techGet_('supportsFullScreen') || false;\n };\n /**\n * Check if the player is in fullscreen mode or tell the player that it\n * is or is not in fullscreen mode.\n *\n * > NOTE: As of the latest HTML5 spec, isFullscreen is no longer an official\n * property and instead document.fullscreenElement is used. But isFullscreen is\n * still a valuable property for internal player workings.\n *\n * @param {boolean} [isFS]\n * Set the players current fullscreen state\n *\n * @return {boolean}\n * - true if fullscreen is on and getting\n * - false if fullscreen is off and getting\n */\n\n\n _proto.isFullscreen = function isFullscreen(isFS) {\n if (isFS !== undefined) {\n this.isFullscreen_ = !!isFS;\n return;\n }\n\n return !!this.isFullscreen_;\n };\n /**\n * Increase the size of the video to full screen\n * In some browsers, full screen is not supported natively, so it enters\n * \"full window mode\", where the video fills the browser window.\n * In browsers and devices that support native full screen, sometimes the\n * browser's default controls will be shown, and not the Video.js custom skin.\n * This includes most mobile devices (iOS, Android) and older versions of\n * Safari.\n *\n * @fires Player#fullscreenchange\n */\n\n\n _proto.requestFullscreen = function requestFullscreen() {\n var fsApi = FullscreenApi;\n this.isFullscreen(true);\n\n if (fsApi.requestFullscreen) {\n // the browser supports going fullscreen at the element level so we can\n // take the controls fullscreen as well as the video\n // Trigger fullscreenchange event after change\n // We have to specifically add this each time, and remove\n // when canceling fullscreen. Otherwise if there's multiple\n // players on a page, they would all be reacting to the same fullscreen\n // events\n on(document, fsApi.fullscreenchange, bind(this, function documentFullscreenChange(e) {\n this.isFullscreen(document[fsApi.fullscreenElement]); // If cancelling fullscreen, remove event listener.\n\n if (this.isFullscreen() === false) {\n off(document, fsApi.fullscreenchange, documentFullscreenChange);\n }\n /**\n * @event Player#fullscreenchange\n * @type {EventTarget~Event}\n */\n\n\n this.trigger('fullscreenchange');\n }));\n this.el_[fsApi.requestFullscreen]();\n } else if (this.tech_.supportsFullScreen()) {\n // we can't take the video.js controls fullscreen but we can go fullscreen\n // with native controls\n this.techCall_('enterFullScreen');\n } else {\n // fullscreen isn't supported so we'll just stretch the video element to\n // fill the viewport\n this.enterFullWindow();\n /**\n * @event Player#fullscreenchange\n * @type {EventTarget~Event}\n */\n\n this.trigger('fullscreenchange');\n }\n };\n /**\n * Return the video to its normal size after having been in full screen mode\n *\n * @fires Player#fullscreenchange\n */\n\n\n _proto.exitFullscreen = function exitFullscreen() {\n var fsApi = FullscreenApi;\n this.isFullscreen(false); // Check for browser element fullscreen support\n\n if (fsApi.requestFullscreen) {\n document[fsApi.exitFullscreen]();\n } else if (this.tech_.supportsFullScreen()) {\n this.techCall_('exitFullScreen');\n } else {\n this.exitFullWindow();\n /**\n * @event Player#fullscreenchange\n * @type {EventTarget~Event}\n */\n\n this.trigger('fullscreenchange');\n }\n };\n /**\n * When fullscreen isn't supported we can stretch the\n * video container to as wide as the browser will let us.\n *\n * @fires Player#enterFullWindow\n */\n\n\n _proto.enterFullWindow = function enterFullWindow() {\n this.isFullWindow = true; // Storing original doc overflow value to return to when fullscreen is off\n\n this.docOrigOverflow = document.documentElement.style.overflow; // Add listener for esc key to exit fullscreen\n\n on(document, 'keydown', bind(this, this.fullWindowOnEscKey)); // Hide any scroll bars\n\n document.documentElement.style.overflow = 'hidden'; // Apply fullscreen styles\n\n addClass(document.body, 'vjs-full-window');\n /**\n * @event Player#enterFullWindow\n * @type {EventTarget~Event}\n */\n\n this.trigger('enterFullWindow');\n };\n /**\n * Check for call to either exit full window or\n * full screen on ESC key\n *\n * @param {string} event\n * Event to check for key press\n */\n\n\n _proto.fullWindowOnEscKey = function fullWindowOnEscKey(event) {\n if (event.keyCode === 27) {\n if (this.isFullscreen() === true) {\n this.exitFullscreen();\n } else {\n this.exitFullWindow();\n }\n }\n };\n /**\n * Exit full window\n *\n * @fires Player#exitFullWindow\n */\n\n\n _proto.exitFullWindow = function exitFullWindow() {\n this.isFullWindow = false;\n off(document, 'keydown', this.fullWindowOnEscKey); // Unhide scroll bars.\n\n document.documentElement.style.overflow = this.docOrigOverflow; // Remove fullscreen styles\n\n removeClass(document.body, 'vjs-full-window'); // Resize the box, controller, and poster to original sizes\n // this.positionAll();\n\n /**\n * @event Player#exitFullWindow\n * @type {EventTarget~Event}\n */\n\n this.trigger('exitFullWindow');\n };\n /**\n * Check whether the player can play a given mimetype\n *\n * @see https://www.w3.org/TR/2011/WD-html5-20110113/video.html#dom-navigator-canplaytype\n *\n * @param {string} type\n * The mimetype to check\n *\n * @return {string}\n * 'probably', 'maybe', or '' (empty string)\n */\n\n\n _proto.canPlayType = function canPlayType(type) {\n var can; // Loop through each playback technology in the options order\n\n for (var i = 0, j = this.options_.techOrder; i < j.length; i++) {\n var techName = j[i];\n var tech = Tech.getTech(techName); // Support old behavior of techs being registered as components.\n // Remove once that deprecated behavior is removed.\n\n if (!tech) {\n tech = Component.getComponent(techName);\n } // Check if the current tech is defined before continuing\n\n\n if (!tech) {\n log.error(\"The \\\"\" + techName + \"\\\" tech is undefined. Skipped browser support check for that tech.\");\n continue;\n } // Check if the browser supports this technology\n\n\n if (tech.isSupported()) {\n can = tech.canPlayType(type);\n\n if (can) {\n return can;\n }\n }\n }\n\n return '';\n };\n /**\n * Select source based on tech-order or source-order\n * Uses source-order selection if `options.sourceOrder` is truthy. Otherwise,\n * defaults to tech-order selection\n *\n * @param {Array} sources\n * The sources for a media asset\n *\n * @return {Object|boolean}\n * Object of source and tech order or false\n */\n\n\n _proto.selectSource = function selectSource(sources) {\n var _this9 = this;\n\n // Get only the techs specified in `techOrder` that exist and are supported by the\n // current platform\n var techs = this.options_.techOrder.map(function (techName) {\n return [techName, Tech.getTech(techName)];\n }).filter(function (_ref) {\n var techName = _ref[0],\n tech = _ref[1];\n\n // Check if the current tech is defined before continuing\n if (tech) {\n // Check if the browser supports this technology\n return tech.isSupported();\n }\n\n log.error(\"The \\\"\" + techName + \"\\\" tech is undefined. Skipped browser support check for that tech.\");\n return false;\n }); // Iterate over each `innerArray` element once per `outerArray` element and execute\n // `tester` with both. If `tester` returns a non-falsy value, exit early and return\n // that value.\n\n var findFirstPassingTechSourcePair = function findFirstPassingTechSourcePair(outerArray, innerArray, tester) {\n var found;\n outerArray.some(function (outerChoice) {\n return innerArray.some(function (innerChoice) {\n found = tester(outerChoice, innerChoice);\n\n if (found) {\n return true;\n }\n });\n });\n return found;\n };\n\n var foundSourceAndTech;\n\n var flip = function flip(fn) {\n return function (a, b) {\n return fn(b, a);\n };\n };\n\n var finder = function finder(_ref2, source) {\n var techName = _ref2[0],\n tech = _ref2[1];\n\n if (tech.canPlaySource(source, _this9.options_[techName.toLowerCase()])) {\n return {\n source: source,\n tech: techName\n };\n }\n }; // Depending on the truthiness of `options.sourceOrder`, we swap the order of techs and sources\n // to select from them based on their priority.\n\n\n if (this.options_.sourceOrder) {\n // Source-first ordering\n foundSourceAndTech = findFirstPassingTechSourcePair(sources, techs, flip(finder));\n } else {\n // Tech-first ordering\n foundSourceAndTech = findFirstPassingTechSourcePair(techs, sources, finder);\n }\n\n return foundSourceAndTech || false;\n };\n /**\n * Get or set the video source.\n *\n * @param {Tech~SourceObject|Tech~SourceObject[]|string} [source]\n * A SourceObject, an array of SourceObjects, or a string referencing\n * a URL to a media source. It is _highly recommended_ that an object\n * or array of objects is used here, so that source selection\n * algorithms can take the `type` into account.\n *\n * If not provided, this method acts as a getter.\n *\n * @return {string|undefined}\n * If the `source` argument is missing, returns the current source\n * URL. Otherwise, returns nothing/undefined.\n */\n\n\n _proto.src = function src(source) {\n var _this10 = this;\n\n // getter usage\n if (typeof source === 'undefined') {\n return this.cache_.src || '';\n } // filter out invalid sources and turn our source into\n // an array of source objects\n\n\n var sources = filterSource(source); // if a source was passed in then it is invalid because\n // it was filtered to a zero length Array. So we have to\n // show an error\n\n if (!sources.length) {\n this.setTimeout(function () {\n this.error({\n code: 4,\n message: this.localize(this.options_.notSupportedMessage)\n });\n }, 0);\n return;\n } // intial sources\n\n\n this.changingSrc_ = true;\n this.cache_.sources = sources;\n this.updateSourceCaches_(sources[0]); // middlewareSource is the source after it has been changed by middleware\n\n setSource(this, sources[0], function (middlewareSource, mws) {\n _this10.middleware_ = mws; // since sourceSet is async we have to update the cache again after we select a source since\n // the source that is selected could be out of order from the cache update above this callback.\n\n _this10.cache_.sources = sources;\n\n _this10.updateSourceCaches_(middlewareSource);\n\n var err = _this10.src_(middlewareSource);\n\n if (err) {\n if (sources.length > 1) {\n return _this10.src(sources.slice(1));\n }\n\n _this10.changingSrc_ = false; // We need to wrap this in a timeout to give folks a chance to add error event handlers\n\n _this10.setTimeout(function () {\n this.error({\n code: 4,\n message: this.localize(this.options_.notSupportedMessage)\n });\n }, 0); // we could not find an appropriate tech, but let's still notify the delegate that this is it\n // this needs a better comment about why this is needed\n\n\n _this10.triggerReady();\n\n return;\n }\n\n setTech(mws, _this10.tech_);\n });\n };\n /**\n * Set the source object on the tech, returns a boolean that indicates whether\n * there is a tech that can play the source or not\n *\n * @param {Tech~SourceObject} source\n * The source object to set on the Tech\n *\n * @return {boolean}\n * - True if there is no Tech to playback this source\n * - False otherwise\n *\n * @private\n */\n\n\n _proto.src_ = function src_(source) {\n var _this11 = this;\n\n var sourceTech = this.selectSource([source]);\n\n if (!sourceTech) {\n return true;\n }\n\n if (!titleCaseEquals(sourceTech.tech, this.techName_)) {\n this.changingSrc_ = true; // load this technology with the chosen source\n\n this.loadTech_(sourceTech.tech, sourceTech.source);\n this.tech_.ready(function () {\n _this11.changingSrc_ = false;\n });\n return false;\n } // wait until the tech is ready to set the source\n // and set it synchronously if possible (#2326)\n\n\n this.ready(function () {\n // The setSource tech method was added with source handlers\n // so older techs won't support it\n // We need to check the direct prototype for the case where subclasses\n // of the tech do not support source handlers\n if (this.tech_.constructor.prototype.hasOwnProperty('setSource')) {\n this.techCall_('setSource', source);\n } else {\n this.techCall_('src', source.src);\n }\n\n this.changingSrc_ = false;\n }, true);\n return false;\n };\n /**\n * Begin loading the src data.\n */\n\n\n _proto.load = function load() {\n this.techCall_('load');\n };\n /**\n * Reset the player. Loads the first tech in the techOrder,\n * removes all the text tracks in the existing `tech`,\n * and calls `reset` on the `tech`.\n */\n\n\n _proto.reset = function reset() {\n if (this.tech_) {\n this.tech_.clearTracks('text');\n }\n\n this.loadTech_(this.options_.techOrder[0], null);\n this.techCall_('reset');\n\n if (isEvented(this)) {\n this.trigger('playerreset');\n }\n };\n /**\n * Returns all of the current source objects.\n *\n * @return {Tech~SourceObject[]}\n * The current source objects\n */\n\n\n _proto.currentSources = function currentSources() {\n var source = this.currentSource();\n var sources = []; // assume `{}` or `{ src }`\n\n if (Object.keys(source).length !== 0) {\n sources.push(source);\n }\n\n return this.cache_.sources || sources;\n };\n /**\n * Returns the current source object.\n *\n * @return {Tech~SourceObject}\n * The current source object\n */\n\n\n _proto.currentSource = function currentSource() {\n return this.cache_.source || {};\n };\n /**\n * Returns the fully qualified URL of the current source value e.g. http://mysite.com/video.mp4\n * Can be used in conjunction with `currentType` to assist in rebuilding the current source object.\n *\n * @return {string}\n * The current source\n */\n\n\n _proto.currentSrc = function currentSrc() {\n return this.currentSource() && this.currentSource().src || '';\n };\n /**\n * Get the current source type e.g. video/mp4\n * This can allow you rebuild the current source object so that you could load the same\n * source and tech later\n *\n * @return {string}\n * The source MIME type\n */\n\n\n _proto.currentType = function currentType() {\n return this.currentSource() && this.currentSource().type || '';\n };\n /**\n * Get or set the preload attribute\n *\n * @param {boolean} [value]\n * - true means that we should preload\n * - false means that we should not preload\n *\n * @return {string}\n * The preload attribute value when getting\n */\n\n\n _proto.preload = function preload(value) {\n if (value !== undefined) {\n this.techCall_('setPreload', value);\n this.options_.preload = value;\n return;\n }\n\n return this.techGet_('preload');\n };\n /**\n * Get or set the autoplay option. When this is a boolean it will\n * modify the attribute on the tech. When this is a string the attribute on\n * the tech will be removed and `Player` will handle autoplay on loadstarts.\n *\n * @param {boolean|string} [value]\n * - true: autoplay using the browser behavior\n * - false: do not autoplay\n * - 'play': call play() on every loadstart\n * - 'muted': call muted() then play() on every loadstart\n * - 'any': call play() on every loadstart. if that fails call muted() then play().\n * - *: values other than those listed here will be set `autoplay` to true\n *\n * @return {boolean|string}\n * The current value of autoplay when getting\n */\n\n\n _proto.autoplay = function autoplay(value) {\n // getter usage\n if (value === undefined) {\n return this.options_.autoplay || false;\n }\n\n var techAutoplay; // if the value is a valid string set it to that\n\n if (typeof value === 'string' && /(any|play|muted)/.test(value)) {\n this.options_.autoplay = value;\n this.manualAutoplay_(value);\n techAutoplay = false; // any falsy value sets autoplay to false in the browser,\n // lets do the same\n } else if (!value) {\n this.options_.autoplay = false; // any other value (ie truthy) sets autoplay to true\n } else {\n this.options_.autoplay = true;\n }\n\n techAutoplay = techAutoplay || this.options_.autoplay; // if we don't have a tech then we do not queue up\n // a setAutoplay call on tech ready. We do this because the\n // autoplay option will be passed in the constructor and we\n // do not need to set it twice\n\n if (this.tech_) {\n this.techCall_('setAutoplay', techAutoplay);\n }\n };\n /**\n * Set or unset the playsinline attribute.\n * Playsinline tells the browser that non-fullscreen playback is preferred.\n *\n * @param {boolean} [value]\n * - true means that we should try to play inline by default\n * - false means that we should use the browser's default playback mode,\n * which in most cases is inline. iOS Safari is a notable exception\n * and plays fullscreen by default.\n *\n * @return {string|Player}\n * - the current value of playsinline\n * - the player when setting\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/#attr-video-playsinline}\n */\n\n\n _proto.playsinline = function playsinline(value) {\n if (value !== undefined) {\n this.techCall_('setPlaysinline', value);\n this.options_.playsinline = value;\n return this;\n }\n\n return this.techGet_('playsinline');\n };\n /**\n * Get or set the loop attribute on the video element.\n *\n * @param {boolean} [value]\n * - true means that we should loop the video\n * - false means that we should not loop the video\n *\n * @return {string}\n * The current value of loop when getting\n */\n\n\n _proto.loop = function loop(value) {\n if (value !== undefined) {\n this.techCall_('setLoop', value);\n this.options_.loop = value;\n return;\n }\n\n return this.techGet_('loop');\n };\n /**\n * Get or set the poster image source url\n *\n * @fires Player#posterchange\n *\n * @param {string} [src]\n * Poster image source URL\n *\n * @return {string}\n * The current value of poster when getting\n */\n\n\n _proto.poster = function poster(src) {\n if (src === undefined) {\n return this.poster_;\n } // The correct way to remove a poster is to set as an empty string\n // other falsey values will throw errors\n\n\n if (!src) {\n src = '';\n }\n\n if (src === this.poster_) {\n return;\n } // update the internal poster variable\n\n\n this.poster_ = src; // update the tech's poster\n\n this.techCall_('setPoster', src);\n this.isPosterFromTech_ = false; // alert components that the poster has been set\n\n /**\n * This event fires when the poster image is changed on the player.\n *\n * @event Player#posterchange\n * @type {EventTarget~Event}\n */\n\n this.trigger('posterchange');\n };\n /**\n * Some techs (e.g. YouTube) can provide a poster source in an\n * asynchronous way. We want the poster component to use this\n * poster source so that it covers up the tech's controls.\n * (YouTube's play button). However we only want to use this\n * source if the player user hasn't set a poster through\n * the normal APIs.\n *\n * @fires Player#posterchange\n * @listens Tech#posterchange\n * @private\n */\n\n\n _proto.handleTechPosterChange_ = function handleTechPosterChange_() {\n if ((!this.poster_ || this.options_.techCanOverridePoster) && this.tech_ && this.tech_.poster) {\n var newPoster = this.tech_.poster() || '';\n\n if (newPoster !== this.poster_) {\n this.poster_ = newPoster;\n this.isPosterFromTech_ = true; // Let components know the poster has changed\n\n this.trigger('posterchange');\n }\n }\n };\n /**\n * Get or set whether or not the controls are showing.\n *\n * @fires Player#controlsenabled\n *\n * @param {boolean} [bool]\n * - true to turn controls on\n * - false to turn controls off\n *\n * @return {boolean}\n * The current value of controls when getting\n */\n\n\n _proto.controls = function controls(bool) {\n if (bool === undefined) {\n return !!this.controls_;\n }\n\n bool = !!bool; // Don't trigger a change event unless it actually changed\n\n if (this.controls_ === bool) {\n return;\n }\n\n this.controls_ = bool;\n\n if (this.usingNativeControls()) {\n this.techCall_('setControls', bool);\n }\n\n if (this.controls_) {\n this.removeClass('vjs-controls-disabled');\n this.addClass('vjs-controls-enabled');\n /**\n * @event Player#controlsenabled\n * @type {EventTarget~Event}\n */\n\n this.trigger('controlsenabled');\n\n if (!this.usingNativeControls()) {\n this.addTechControlsListeners_();\n }\n } else {\n this.removeClass('vjs-controls-enabled');\n this.addClass('vjs-controls-disabled');\n /**\n * @event Player#controlsdisabled\n * @type {EventTarget~Event}\n */\n\n this.trigger('controlsdisabled');\n\n if (!this.usingNativeControls()) {\n this.removeTechControlsListeners_();\n }\n }\n };\n /**\n * Toggle native controls on/off. Native controls are the controls built into\n * devices (e.g. default iPhone controls), Flash, or other techs\n * (e.g. Vimeo Controls)\n * **This should only be set by the current tech, because only the tech knows\n * if it can support native controls**\n *\n * @fires Player#usingnativecontrols\n * @fires Player#usingcustomcontrols\n *\n * @param {boolean} [bool]\n * - true to turn native controls on\n * - false to turn native controls off\n *\n * @return {boolean}\n * The current value of native controls when getting\n */\n\n\n _proto.usingNativeControls = function usingNativeControls(bool) {\n if (bool === undefined) {\n return !!this.usingNativeControls_;\n }\n\n bool = !!bool; // Don't trigger a change event unless it actually changed\n\n if (this.usingNativeControls_ === bool) {\n return;\n }\n\n this.usingNativeControls_ = bool;\n\n if (this.usingNativeControls_) {\n this.addClass('vjs-using-native-controls');\n /**\n * player is using the native device controls\n *\n * @event Player#usingnativecontrols\n * @type {EventTarget~Event}\n */\n\n this.trigger('usingnativecontrols');\n } else {\n this.removeClass('vjs-using-native-controls');\n /**\n * player is using the custom HTML controls\n *\n * @event Player#usingcustomcontrols\n * @type {EventTarget~Event}\n */\n\n this.trigger('usingcustomcontrols');\n }\n };\n /**\n * Set or get the current MediaError\n *\n * @fires Player#error\n *\n * @param {MediaError|string|number} [err]\n * A MediaError or a string/number to be turned\n * into a MediaError\n *\n * @return {MediaError|null}\n * The current MediaError when getting (or null)\n */\n\n\n _proto.error = function error(err) {\n if (err === undefined) {\n return this.error_ || null;\n } // restoring to default\n\n\n if (err === null) {\n this.error_ = err;\n this.removeClass('vjs-error');\n\n if (this.errorDisplay) {\n this.errorDisplay.close();\n }\n\n return;\n }\n\n this.error_ = new MediaError(err); // add the vjs-error classname to the player\n\n this.addClass('vjs-error'); // log the name of the error type and any message\n // IE11 logs \"[object object]\" and required you to expand message to see error object\n\n log.error(\"(CODE:\" + this.error_.code + \" \" + MediaError.errorTypes[this.error_.code] + \")\", this.error_.message, this.error_);\n /**\n * @event Player#error\n * @type {EventTarget~Event}\n */\n\n this.trigger('error');\n return;\n };\n /**\n * Report user activity\n *\n * @param {Object} event\n * Event object\n */\n\n\n _proto.reportUserActivity = function reportUserActivity(event) {\n this.userActivity_ = true;\n };\n /**\n * Get/set if user is active\n *\n * @fires Player#useractive\n * @fires Player#userinactive\n *\n * @param {boolean} [bool]\n * - true if the user is active\n * - false if the user is inactive\n *\n * @return {boolean}\n * The current value of userActive when getting\n */\n\n\n _proto.userActive = function userActive(bool) {\n if (bool === undefined) {\n return this.userActive_;\n }\n\n bool = !!bool;\n\n if (bool === this.userActive_) {\n return;\n }\n\n this.userActive_ = bool;\n\n if (this.userActive_) {\n this.userActivity_ = true;\n this.removeClass('vjs-user-inactive');\n this.addClass('vjs-user-active');\n /**\n * @event Player#useractive\n * @type {EventTarget~Event}\n */\n\n this.trigger('useractive');\n return;\n } // Chrome/Safari/IE have bugs where when you change the cursor it can\n // trigger a mousemove event. This causes an issue when you're hiding\n // the cursor when the user is inactive, and a mousemove signals user\n // activity. Making it impossible to go into inactive mode. Specifically\n // this happens in fullscreen when we really need to hide the cursor.\n //\n // When this gets resolved in ALL browsers it can be removed\n // https://code.google.com/p/chromium/issues/detail?id=103041\n\n\n if (this.tech_) {\n this.tech_.one('mousemove', function (e) {\n e.stopPropagation();\n e.preventDefault();\n });\n }\n\n this.userActivity_ = false;\n this.removeClass('vjs-user-active');\n this.addClass('vjs-user-inactive');\n /**\n * @event Player#userinactive\n * @type {EventTarget~Event}\n */\n\n this.trigger('userinactive');\n };\n /**\n * Listen for user activity based on timeout value\n *\n * @private\n */\n\n\n _proto.listenForUserActivity_ = function listenForUserActivity_() {\n var mouseInProgress;\n var lastMoveX;\n var lastMoveY;\n var handleActivity = bind(this, this.reportUserActivity);\n\n var handleMouseMove = function handleMouseMove(e) {\n // #1068 - Prevent mousemove spamming\n // Chrome Bug: https://code.google.com/p/chromium/issues/detail?id=366970\n if (e.screenX !== lastMoveX || e.screenY !== lastMoveY) {\n lastMoveX = e.screenX;\n lastMoveY = e.screenY;\n handleActivity();\n }\n };\n\n var handleMouseDown = function handleMouseDown() {\n handleActivity(); // For as long as the they are touching the device or have their mouse down,\n // we consider them active even if they're not moving their finger or mouse.\n // So we want to continue to update that they are active\n\n this.clearInterval(mouseInProgress); // Setting userActivity=true now and setting the interval to the same time\n // as the activityCheck interval (250) should ensure we never miss the\n // next activityCheck\n\n mouseInProgress = this.setInterval(handleActivity, 250);\n };\n\n var handleMouseUp = function handleMouseUp(event) {\n handleActivity(); // Stop the interval that maintains activity if the mouse/touch is down\n\n this.clearInterval(mouseInProgress);\n }; // Any mouse movement will be considered user activity\n\n\n this.on('mousedown', handleMouseDown);\n this.on('mousemove', handleMouseMove);\n this.on('mouseup', handleMouseUp); // Listen for keyboard navigation\n // Shouldn't need to use inProgress interval because of key repeat\n\n this.on('keydown', handleActivity);\n this.on('keyup', handleActivity); // Run an interval every 250 milliseconds instead of stuffing everything into\n // the mousemove/touchmove function itself, to prevent performance degradation.\n // `this.reportUserActivity` simply sets this.userActivity_ to true, which\n // then gets picked up by this loop\n // http://ejohn.org/blog/learning-from-twitter/\n\n var inactivityTimeout;\n this.setInterval(function () {\n // Check to see if mouse/touch activity has happened\n if (!this.userActivity_) {\n return;\n } // Reset the activity tracker\n\n\n this.userActivity_ = false; // If the user state was inactive, set the state to active\n\n this.userActive(true); // Clear any existing inactivity timeout to start the timer over\n\n this.clearTimeout(inactivityTimeout);\n var timeout = this.options_.inactivityTimeout;\n\n if (timeout <= 0) {\n return;\n } // In <timeout> milliseconds, if no more activity has occurred the\n // user will be considered inactive\n\n\n inactivityTimeout = this.setTimeout(function () {\n // Protect against the case where the inactivityTimeout can trigger just\n // before the next user activity is picked up by the activity check loop\n // causing a flicker\n if (!this.userActivity_) {\n this.userActive(false);\n }\n }, timeout);\n }, 250);\n };\n /**\n * Gets or sets the current playback rate. A playback rate of\n * 1.0 represents normal speed and 0.5 would indicate half-speed\n * playback, for instance.\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-playbackrate\n *\n * @param {number} [rate]\n * New playback rate to set.\n *\n * @return {number}\n * The current playback rate when getting or 1.0\n */\n\n\n _proto.playbackRate = function playbackRate(rate) {\n if (rate !== undefined) {\n // NOTE: this.cache_.lastPlaybackRate is set from the tech handler\n // that is registered above\n this.techCall_('setPlaybackRate', rate);\n return;\n }\n\n if (this.tech_ && this.tech_.featuresPlaybackRate) {\n return this.cache_.lastPlaybackRate || this.techGet_('playbackRate');\n }\n\n return 1.0;\n };\n /**\n * Gets or sets the current default playback rate. A default playback rate of\n * 1.0 represents normal speed and 0.5 would indicate half-speed playback, for instance.\n * defaultPlaybackRate will only represent what the initial playbackRate of a video was, not\n * not the current playbackRate.\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-defaultplaybackrate\n *\n * @param {number} [rate]\n * New default playback rate to set.\n *\n * @return {number|Player}\n * - The default playback rate when getting or 1.0\n * - the player when setting\n */\n\n\n _proto.defaultPlaybackRate = function defaultPlaybackRate(rate) {\n if (rate !== undefined) {\n return this.techCall_('setDefaultPlaybackRate', rate);\n }\n\n if (this.tech_ && this.tech_.featuresPlaybackRate) {\n return this.techGet_('defaultPlaybackRate');\n }\n\n return 1.0;\n };\n /**\n * Gets or sets the audio flag\n *\n * @param {boolean} bool\n * - true signals that this is an audio player\n * - false signals that this is not an audio player\n *\n * @return {boolean}\n * The current value of isAudio when getting\n */\n\n\n _proto.isAudio = function isAudio(bool) {\n if (bool !== undefined) {\n this.isAudio_ = !!bool;\n return;\n }\n\n return !!this.isAudio_;\n };\n /**\n * A helper method for adding a {@link TextTrack} to our\n * {@link TextTrackList}.\n *\n * In addition to the W3C settings we allow adding additional info through options.\n *\n * @see http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-addtexttrack\n *\n * @param {string} [kind]\n * the kind of TextTrack you are adding\n *\n * @param {string} [label]\n * the label to give the TextTrack label\n *\n * @param {string} [language]\n * the language to set on the TextTrack\n *\n * @return {TextTrack|undefined}\n * the TextTrack that was added or undefined\n * if there is no tech\n */\n\n\n _proto.addTextTrack = function addTextTrack(kind, label, language) {\n if (this.tech_) {\n return this.tech_.addTextTrack(kind, label, language);\n }\n };\n /**\n * Create a remote {@link TextTrack} and an {@link HTMLTrackElement}. It will\n * automatically removed from the video element whenever the source changes, unless\n * manualCleanup is set to false.\n *\n * @param {Object} options\n * Options to pass to {@link HTMLTrackElement} during creation. See\n * {@link HTMLTrackElement} for object properties that you should use.\n *\n * @param {boolean} [manualCleanup=true] if set to false, the TextTrack will be\n *\n * @return {HtmlTrackElement}\n * the HTMLTrackElement that was created and added\n * to the HtmlTrackElementList and the remote\n * TextTrackList\n *\n * @deprecated The default value of the \"manualCleanup\" parameter will default\n * to \"false\" in upcoming versions of Video.js\n */\n\n\n _proto.addRemoteTextTrack = function addRemoteTextTrack(options, manualCleanup) {\n if (this.tech_) {\n return this.tech_.addRemoteTextTrack(options, manualCleanup);\n }\n };\n /**\n * Remove a remote {@link TextTrack} from the respective\n * {@link TextTrackList} and {@link HtmlTrackElementList}.\n *\n * @param {Object} track\n * Remote {@link TextTrack} to remove\n *\n * @return {undefined}\n * does not return anything\n */\n\n\n _proto.removeRemoteTextTrack = function removeRemoteTextTrack(obj) {\n if (obj === void 0) {\n obj = {};\n }\n\n var _obj = obj,\n track = _obj.track;\n\n if (!track) {\n track = obj;\n } // destructure the input into an object with a track argument, defaulting to arguments[0]\n // default the whole argument to an empty object if nothing was passed in\n\n\n if (this.tech_) {\n return this.tech_.removeRemoteTextTrack(track);\n }\n };\n /**\n * Gets available media playback quality metrics as specified by the W3C's Media\n * Playback Quality API.\n *\n * @see [Spec]{@link https://wicg.github.io/media-playback-quality}\n *\n * @return {Object|undefined}\n * An object with supported media playback quality metrics or undefined if there\n * is no tech or the tech does not support it.\n */\n\n\n _proto.getVideoPlaybackQuality = function getVideoPlaybackQuality() {\n return this.techGet_('getVideoPlaybackQuality');\n };\n /**\n * Get video width\n *\n * @return {number}\n * current video width\n */\n\n\n _proto.videoWidth = function videoWidth() {\n return this.tech_ && this.tech_.videoWidth && this.tech_.videoWidth() || 0;\n };\n /**\n * Get video height\n *\n * @return {number}\n * current video height\n */\n\n\n _proto.videoHeight = function videoHeight() {\n return this.tech_ && this.tech_.videoHeight && this.tech_.videoHeight() || 0;\n };\n /**\n * The player's language code\n * NOTE: The language should be set in the player options if you want the\n * the controls to be built with a specific language. Changing the language\n * later will not update controls text.\n *\n * @param {string} [code]\n * the language code to set the player to\n *\n * @return {string}\n * The current language code when getting\n */\n\n\n _proto.language = function language(code) {\n if (code === undefined) {\n return this.language_;\n }\n\n this.language_ = String(code).toLowerCase();\n };\n /**\n * Get the player's language dictionary\n * Merge every time, because a newly added plugin might call videojs.addLanguage() at any time\n * Languages specified directly in the player options have precedence\n *\n * @return {Array}\n * An array of of supported languages\n */\n\n\n _proto.languages = function languages() {\n return mergeOptions(Player.prototype.options_.languages, this.languages_);\n };\n /**\n * returns a JavaScript object reperesenting the current track\n * information. **DOES not return it as JSON**\n *\n * @return {Object}\n * Object representing the current of track info\n */\n\n\n _proto.toJSON = function toJSON() {\n var options = mergeOptions(this.options_);\n var tracks = options.tracks;\n options.tracks = [];\n\n for (var i = 0; i < tracks.length; i++) {\n var track = tracks[i]; // deep merge tracks and null out player so no circular references\n\n track = mergeOptions(track);\n track.player = undefined;\n options.tracks[i] = track;\n }\n\n return options;\n };\n /**\n * Creates a simple modal dialog (an instance of the {@link ModalDialog}\n * component) that immediately overlays the player with arbitrary\n * content and removes itself when closed.\n *\n * @param {string|Function|Element|Array|null} content\n * Same as {@link ModalDialog#content}'s param of the same name.\n * The most straight-forward usage is to provide a string or DOM\n * element.\n *\n * @param {Object} [options]\n * Extra options which will be passed on to the {@link ModalDialog}.\n *\n * @return {ModalDialog}\n * the {@link ModalDialog} that was created\n */\n\n\n _proto.createModal = function createModal(content, options) {\n var _this12 = this;\n\n options = options || {};\n options.content = content || '';\n var modal = new ModalDialog(this, options);\n this.addChild(modal);\n modal.on('dispose', function () {\n _this12.removeChild(modal);\n });\n modal.open();\n return modal;\n };\n /**\n * Change breakpoint classes when the player resizes.\n *\n * @private\n */\n\n\n _proto.updateCurrentBreakpoint_ = function updateCurrentBreakpoint_() {\n if (!this.responsive()) {\n return;\n }\n\n var currentBreakpoint = this.currentBreakpoint();\n var currentWidth = this.currentWidth();\n\n for (var i = 0; i < BREAKPOINT_ORDER.length; i++) {\n var candidateBreakpoint = BREAKPOINT_ORDER[i];\n var maxWidth = this.breakpoints_[candidateBreakpoint];\n\n if (currentWidth <= maxWidth) {\n // The current breakpoint did not change, nothing to do.\n if (currentBreakpoint === candidateBreakpoint) {\n return;\n } // Only remove a class if there is a current breakpoint.\n\n\n if (currentBreakpoint) {\n this.removeClass(BREAKPOINT_CLASSES[currentBreakpoint]);\n }\n\n this.addClass(BREAKPOINT_CLASSES[candidateBreakpoint]);\n this.breakpoint_ = candidateBreakpoint;\n break;\n }\n }\n };\n /**\n * Removes the current breakpoint.\n *\n * @private\n */\n\n\n _proto.removeCurrentBreakpoint_ = function removeCurrentBreakpoint_() {\n var className = this.currentBreakpointClass();\n this.breakpoint_ = '';\n\n if (className) {\n this.removeClass(className);\n }\n };\n /**\n * Get or set breakpoints on the player.\n *\n * Calling this method with an object or `true` will remove any previous\n * custom breakpoints and start from the defaults again.\n *\n * @param {Object|boolean} [breakpoints]\n * If an object is given, it can be used to provide custom\n * breakpoints. If `true` is given, will set default breakpoints.\n * If this argument is not given, will simply return the current\n * breakpoints.\n *\n * @param {number} [breakpoints.tiny]\n * The maximum width for the \"vjs-layout-tiny\" class.\n *\n * @param {number} [breakpoints.xsmall]\n * The maximum width for the \"vjs-layout-x-small\" class.\n *\n * @param {number} [breakpoints.small]\n * The maximum width for the \"vjs-layout-small\" class.\n *\n * @param {number} [breakpoints.medium]\n * The maximum width for the \"vjs-layout-medium\" class.\n *\n * @param {number} [breakpoints.large]\n * The maximum width for the \"vjs-layout-large\" class.\n *\n * @param {number} [breakpoints.xlarge]\n * The maximum width for the \"vjs-layout-x-large\" class.\n *\n * @param {number} [breakpoints.huge]\n * The maximum width for the \"vjs-layout-huge\" class.\n *\n * @return {Object}\n * An object mapping breakpoint names to maximum width values.\n */\n\n\n _proto.breakpoints = function breakpoints(_breakpoints) {\n // Used as a getter.\n if (_breakpoints === undefined) {\n return assign(this.breakpoints_);\n }\n\n this.breakpoint_ = '';\n this.breakpoints_ = assign({}, DEFAULT_BREAKPOINTS, _breakpoints); // When breakpoint definitions change, we need to update the currently\n // selected breakpoint.\n\n this.updateCurrentBreakpoint_(); // Clone the breakpoints before returning.\n\n return assign(this.breakpoints_);\n };\n /**\n * Get or set a flag indicating whether or not this player should adjust\n * its UI based on its dimensions.\n *\n * @param {boolean} value\n * Should be `true` if the player should adjust its UI based on its\n * dimensions; otherwise, should be `false`.\n *\n * @return {boolean}\n * Will be `true` if this player should adjust its UI based on its\n * dimensions; otherwise, will be `false`.\n */\n\n\n _proto.responsive = function responsive(value) {\n // Used as a getter.\n if (value === undefined) {\n return this.responsive_;\n }\n\n value = Boolean(value);\n var current = this.responsive_; // Nothing changed.\n\n if (value === current) {\n return;\n } // The value actually changed, set it.\n\n\n this.responsive_ = value; // Start listening for breakpoints and set the initial breakpoint if the\n // player is now responsive.\n\n if (value) {\n this.on('playerresize', this.updateCurrentBreakpoint_);\n this.updateCurrentBreakpoint_(); // Stop listening for breakpoints if the player is no longer responsive.\n } else {\n this.off('playerresize', this.updateCurrentBreakpoint_);\n this.removeCurrentBreakpoint_();\n }\n\n return value;\n };\n /**\n * Get current breakpoint name, if any.\n *\n * @return {string}\n * If there is currently a breakpoint set, returns a the key from the\n * breakpoints object matching it. Otherwise, returns an empty string.\n */\n\n\n _proto.currentBreakpoint = function currentBreakpoint() {\n return this.breakpoint_;\n };\n /**\n * Get the current breakpoint class name.\n *\n * @return {string}\n * The matching class name (e.g. `\"vjs-layout-tiny\"` or\n * `\"vjs-layout-large\"`) for the current breakpoint. Empty string if\n * there is no current breakpoint.\n */\n\n\n _proto.currentBreakpointClass = function currentBreakpointClass() {\n return BREAKPOINT_CLASSES[this.breakpoint_] || '';\n };\n /**\n * Gets tag settings\n *\n * @param {Element} tag\n * The player tag\n *\n * @return {Object}\n * An object containing all of the settings\n * for a player tag\n */\n\n\n Player.getTagSettings = function getTagSettings(tag) {\n var baseOptions = {\n sources: [],\n tracks: []\n };\n var tagOptions = getAttributes(tag);\n var dataSetup = tagOptions['data-setup'];\n\n if (hasClass(tag, 'vjs-fill')) {\n tagOptions.fill = true;\n }\n\n if (hasClass(tag, 'vjs-fluid')) {\n tagOptions.fluid = true;\n } // Check if data-setup attr exists.\n\n\n if (dataSetup !== null) {\n // Parse options JSON\n // If empty string, make it a parsable json object.\n var _safeParseTuple = safeParseTuple(dataSetup || '{}'),\n err = _safeParseTuple[0],\n data = _safeParseTuple[1];\n\n if (err) {\n log.error(err);\n }\n\n assign(tagOptions, data);\n }\n\n assign(baseOptions, tagOptions); // Get tag children settings\n\n if (tag.hasChildNodes()) {\n var children = tag.childNodes;\n\n for (var i = 0, j = children.length; i < j; i++) {\n var child = children[i]; // Change case needed: http://ejohn.org/blog/nodename-case-sensitivity/\n\n var childName = child.nodeName.toLowerCase();\n\n if (childName === 'source') {\n baseOptions.sources.push(getAttributes(child));\n } else if (childName === 'track') {\n baseOptions.tracks.push(getAttributes(child));\n }\n }\n }\n\n return baseOptions;\n };\n /**\n * Determine whether or not flexbox is supported\n *\n * @return {boolean}\n * - true if flexbox is supported\n * - false if flexbox is not supported\n */\n\n\n _proto.flexNotSupported_ = function flexNotSupported_() {\n var elem = document.createElement('i'); // Note: We don't actually use flexBasis (or flexOrder), but it's one of the more\n // common flex features that we can rely on when checking for flex support.\n\n return !('flexBasis' in elem.style || 'webkitFlexBasis' in elem.style || 'mozFlexBasis' in elem.style || 'msFlexBasis' in elem.style || // IE10-specific (2012 flex spec), available for completeness\n 'msFlexOrder' in elem.style);\n };\n\n return Player;\n}(Component);\n/**\n * Get the {@link VideoTrackList}\n * @link https://html.spec.whatwg.org/multipage/embedded-content.html#videotracklist\n *\n * @return {VideoTrackList}\n * the current video track list\n *\n * @method Player.prototype.videoTracks\n */\n\n/**\n * Get the {@link AudioTrackList}\n * @link https://html.spec.whatwg.org/multipage/embedded-content.html#audiotracklist\n *\n * @return {AudioTrackList}\n * the current audio track list\n *\n * @method Player.prototype.audioTracks\n */\n\n/**\n * Get the {@link TextTrackList}\n *\n * @link http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-texttracks\n *\n * @return {TextTrackList}\n * the current text track list\n *\n * @method Player.prototype.textTracks\n */\n\n/**\n * Get the remote {@link TextTrackList}\n *\n * @return {TextTrackList}\n * The current remote text track list\n *\n * @method Player.prototype.remoteTextTracks\n */\n\n/**\n * Get the remote {@link HtmlTrackElementList} tracks.\n *\n * @return {HtmlTrackElementList}\n * The current remote text track element list\n *\n * @method Player.prototype.remoteTextTrackEls\n */\n\n\nALL.names.forEach(function (name$$1) {\n var props = ALL[name$$1];\n\n Player.prototype[props.getterName] = function () {\n if (this.tech_) {\n return this.tech_[props.getterName]();\n } // if we have not yet loadTech_, we create {video,audio,text}Tracks_\n // these will be passed to the tech during loading\n\n\n this[props.privateName] = this[props.privateName] || new props.ListClass();\n return this[props.privateName];\n };\n});\n/**\n * Global enumeration of players.\n *\n * The keys are the player IDs and the values are either the {@link Player}\n * instance or `null` for disposed players.\n *\n * @type {Object}\n */\n\nPlayer.players = {};\nvar navigator = window$1.navigator;\n/*\n * Player instance options, surfaced using options\n * options = Player.prototype.options_\n * Make changes in options, not here.\n *\n * @type {Object}\n * @private\n */\n\nPlayer.prototype.options_ = {\n // Default order of fallback technology\n techOrder: Tech.defaultTechOrder_,\n html5: {},\n flash: {},\n // default inactivity timeout\n inactivityTimeout: 2000,\n // default playback rates\n playbackRates: [],\n // Add playback rate selection by adding rates\n // 'playbackRates': [0.5, 1, 1.5, 2],\n liveui: false,\n // Included control sets\n children: ['mediaLoader', 'posterImage', 'textTrackDisplay', 'loadingSpinner', 'bigPlayButton', 'liveTracker', 'controlBar', 'errorDisplay', 'textTrackSettings', 'resizeManager'],\n language: navigator && (navigator.languages && navigator.languages[0] || navigator.userLanguage || navigator.language) || 'en',\n // locales and their language translations\n languages: {},\n // Default message to show when a video cannot be played.\n notSupportedMessage: 'No compatible source was found for this media.',\n breakpoints: {},\n responsive: false\n};\n[\n/**\n * Returns whether or not the player is in the \"ended\" state.\n *\n * @return {Boolean} True if the player is in the ended state, false if not.\n * @method Player#ended\n */\n'ended',\n/**\n * Returns whether or not the player is in the \"seeking\" state.\n *\n * @return {Boolean} True if the player is in the seeking state, false if not.\n * @method Player#seeking\n */\n'seeking',\n/**\n * Returns the TimeRanges of the media that are currently available\n * for seeking to.\n *\n * @return {TimeRanges} the seekable intervals of the media timeline\n * @method Player#seekable\n */\n'seekable',\n/**\n * Returns the current state of network activity for the element, from\n * the codes in the list below.\n * - NETWORK_EMPTY (numeric value 0)\n * The element has not yet been initialised. All attributes are in\n * their initial states.\n * - NETWORK_IDLE (numeric value 1)\n * The element's resource selection algorithm is active and has\n * selected a resource, but it is not actually using the network at\n * this time.\n * - NETWORK_LOADING (numeric value 2)\n * The user agent is actively trying to download data.\n * - NETWORK_NO_SOURCE (numeric value 3)\n * The element's resource selection algorithm is active, but it has\n * not yet found a resource to use.\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#network-states\n * @return {number} the current network activity state\n * @method Player#networkState\n */\n'networkState',\n/**\n * Returns a value that expresses the current state of the element\n * with respect to rendering the current playback position, from the\n * codes in the list below.\n * - HAVE_NOTHING (numeric value 0)\n * No information regarding the media resource is available.\n * - HAVE_METADATA (numeric value 1)\n * Enough of the resource has been obtained that the duration of the\n * resource is available.\n * - HAVE_CURRENT_DATA (numeric value 2)\n * Data for the immediate current playback position is available.\n * - HAVE_FUTURE_DATA (numeric value 3)\n * Data for the immediate current playback position is available, as\n * well as enough data for the user agent to advance the current\n * playback position in the direction of playback.\n * - HAVE_ENOUGH_DATA (numeric value 4)\n * The user agent estimates that enough data is available for\n * playback to proceed uninterrupted.\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-readystate\n * @return {number} the current playback rendering state\n * @method Player#readyState\n */\n'readyState'].forEach(function (fn) {\n Player.prototype[fn] = function () {\n return this.techGet_(fn);\n };\n});\nTECH_EVENTS_RETRIGGER.forEach(function (event) {\n Player.prototype[\"handleTech\" + toTitleCase(event) + \"_\"] = function () {\n return this.trigger(event);\n };\n});\n/**\n * Fired when the player has initial duration and dimension information\n *\n * @event Player#loadedmetadata\n * @type {EventTarget~Event}\n */\n\n/**\n * Fired when the player has downloaded data at the current playback position\n *\n * @event Player#loadeddata\n * @type {EventTarget~Event}\n */\n\n/**\n * Fired when the current playback position has changed *\n * During playback this is fired every 15-250 milliseconds, depending on the\n * playback technology in use.\n *\n * @event Player#timeupdate\n * @type {EventTarget~Event}\n */\n\n/**\n * Fired when the volume changes\n *\n * @event Player#volumechange\n * @type {EventTarget~Event}\n */\n\n/**\n * Reports whether or not a player has a plugin available.\n *\n * This does not report whether or not the plugin has ever been initialized\n * on this player. For that, [usingPlugin]{@link Player#usingPlugin}.\n *\n * @method Player#hasPlugin\n * @param {string} name\n * The name of a plugin.\n *\n * @return {boolean}\n * Whether or not this player has the requested plugin available.\n */\n\n/**\n * Reports whether or not a player is using a plugin by name.\n *\n * For basic plugins, this only reports whether the plugin has _ever_ been\n * initialized on this player.\n *\n * @method Player#usingPlugin\n * @param {string} name\n * The name of a plugin.\n *\n * @return {boolean}\n * Whether or not this player is using the requested plugin.\n */\n\nComponent.registerComponent('Player', Player);\n\n/**\n * The base plugin name.\n *\n * @private\n * @constant\n * @type {string}\n */\n\nvar BASE_PLUGIN_NAME = 'plugin';\n/**\n * The key on which a player's active plugins cache is stored.\n *\n * @private\n * @constant\n * @type {string}\n */\n\nvar PLUGIN_CACHE_KEY = 'activePlugins_';\n/**\n * Stores registered plugins in a private space.\n *\n * @private\n * @type {Object}\n */\n\nvar pluginStorage = {};\n/**\n * Reports whether or not a plugin has been registered.\n *\n * @private\n * @param {string} name\n * The name of a plugin.\n *\n * @return {boolean}\n * Whether or not the plugin has been registered.\n */\n\nvar pluginExists = function pluginExists(name) {\n return pluginStorage.hasOwnProperty(name);\n};\n/**\n * Get a single registered plugin by name.\n *\n * @private\n * @param {string} name\n * The name of a plugin.\n *\n * @return {Function|undefined}\n * The plugin (or undefined).\n */\n\n\nvar getPlugin = function getPlugin(name) {\n return pluginExists(name) ? pluginStorage[name] : undefined;\n};\n/**\n * Marks a plugin as \"active\" on a player.\n *\n * Also, ensures that the player has an object for tracking active plugins.\n *\n * @private\n * @param {Player} player\n * A Video.js player instance.\n *\n * @param {string} name\n * The name of a plugin.\n */\n\n\nvar markPluginAsActive = function markPluginAsActive(player, name) {\n player[PLUGIN_CACHE_KEY] = player[PLUGIN_CACHE_KEY] || {};\n player[PLUGIN_CACHE_KEY][name] = true;\n};\n/**\n * Triggers a pair of plugin setup events.\n *\n * @private\n * @param {Player} player\n * A Video.js player instance.\n *\n * @param {Plugin~PluginEventHash} hash\n * A plugin event hash.\n *\n * @param {boolean} [before]\n * If true, prefixes the event name with \"before\". In other words,\n * use this to trigger \"beforepluginsetup\" instead of \"pluginsetup\".\n */\n\n\nvar triggerSetupEvent = function triggerSetupEvent(player, hash, before) {\n var eventName = (before ? 'before' : '') + 'pluginsetup';\n player.trigger(eventName, hash);\n player.trigger(eventName + ':' + hash.name, hash);\n};\n/**\n * Takes a basic plugin function and returns a wrapper function which marks\n * on the player that the plugin has been activated.\n *\n * @private\n * @param {string} name\n * The name of the plugin.\n *\n * @param {Function} plugin\n * The basic plugin.\n *\n * @return {Function}\n * A wrapper function for the given plugin.\n */\n\n\nvar createBasicPlugin = function createBasicPlugin(name, plugin) {\n var basicPluginWrapper = function basicPluginWrapper() {\n // We trigger the \"beforepluginsetup\" and \"pluginsetup\" events on the player\n // regardless, but we want the hash to be consistent with the hash provided\n // for advanced plugins.\n //\n // The only potentially counter-intuitive thing here is the `instance` in\n // the \"pluginsetup\" event is the value returned by the `plugin` function.\n triggerSetupEvent(this, {\n name: name,\n plugin: plugin,\n instance: null\n }, true);\n var instance = plugin.apply(this, arguments);\n markPluginAsActive(this, name);\n triggerSetupEvent(this, {\n name: name,\n plugin: plugin,\n instance: instance\n });\n return instance;\n };\n\n Object.keys(plugin).forEach(function (prop) {\n basicPluginWrapper[prop] = plugin[prop];\n });\n return basicPluginWrapper;\n};\n/**\n * Takes a plugin sub-class and returns a factory function for generating\n * instances of it.\n *\n * This factory function will replace itself with an instance of the requested\n * sub-class of Plugin.\n *\n * @private\n * @param {string} name\n * The name of the plugin.\n *\n * @param {Plugin} PluginSubClass\n * The advanced plugin.\n *\n * @return {Function}\n */\n\n\nvar createPluginFactory = function createPluginFactory(name, PluginSubClass) {\n // Add a `name` property to the plugin prototype so that each plugin can\n // refer to itself by name.\n PluginSubClass.prototype.name = name;\n return function () {\n triggerSetupEvent(this, {\n name: name,\n plugin: PluginSubClass,\n instance: null\n }, true);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var instance = _construct(PluginSubClass, [this].concat(args)); // The plugin is replaced by a function that returns the current instance.\n\n\n this[name] = function () {\n return instance;\n };\n\n triggerSetupEvent(this, instance.getEventHash());\n return instance;\n };\n};\n/**\n * Parent class for all advanced plugins.\n *\n * @mixes module:evented~EventedMixin\n * @mixes module:stateful~StatefulMixin\n * @fires Player#beforepluginsetup\n * @fires Player#beforepluginsetup:$name\n * @fires Player#pluginsetup\n * @fires Player#pluginsetup:$name\n * @listens Player#dispose\n * @throws {Error}\n * If attempting to instantiate the base {@link Plugin} class\n * directly instead of via a sub-class.\n */\n\n\nvar Plugin =\n/*#__PURE__*/\nfunction () {\n /**\n * Creates an instance of this class.\n *\n * Sub-classes should call `super` to ensure plugins are properly initialized.\n *\n * @param {Player} player\n * A Video.js player instance.\n */\n function Plugin(player) {\n if (this.constructor === Plugin) {\n throw new Error('Plugin must be sub-classed; not directly instantiated.');\n }\n\n this.player = player; // Make this object evented, but remove the added `trigger` method so we\n // use the prototype version instead.\n\n evented(this);\n delete this.trigger;\n stateful(this, this.constructor.defaultState);\n markPluginAsActive(player, this.name); // Auto-bind the dispose method so we can use it as a listener and unbind\n // it later easily.\n\n this.dispose = bind(this, this.dispose); // If the player is disposed, dispose the plugin.\n\n player.on('dispose', this.dispose);\n }\n /**\n * Get the version of the plugin that was set on <pluginName>.VERSION\n */\n\n\n var _proto = Plugin.prototype;\n\n _proto.version = function version() {\n return this.constructor.VERSION;\n };\n /**\n * Each event triggered by plugins includes a hash of additional data with\n * conventional properties.\n *\n * This returns that object or mutates an existing hash.\n *\n * @param {Object} [hash={}]\n * An object to be used as event an event hash.\n *\n * @return {Plugin~PluginEventHash}\n * An event hash object with provided properties mixed-in.\n */\n\n\n _proto.getEventHash = function getEventHash(hash) {\n if (hash === void 0) {\n hash = {};\n }\n\n hash.name = this.name;\n hash.plugin = this.constructor;\n hash.instance = this;\n return hash;\n };\n /**\n * Triggers an event on the plugin object and overrides\n * {@link module:evented~EventedMixin.trigger|EventedMixin.trigger}.\n *\n * @param {string|Object} event\n * An event type or an object with a type property.\n *\n * @param {Object} [hash={}]\n * Additional data hash to merge with a\n * {@link Plugin~PluginEventHash|PluginEventHash}.\n *\n * @return {boolean}\n * Whether or not default was prevented.\n */\n\n\n _proto.trigger = function trigger$$1(event, hash) {\n if (hash === void 0) {\n hash = {};\n }\n\n return trigger(this.eventBusEl_, event, this.getEventHash(hash));\n };\n /**\n * Handles \"statechanged\" events on the plugin. No-op by default, override by\n * subclassing.\n *\n * @abstract\n * @param {Event} e\n * An event object provided by a \"statechanged\" event.\n *\n * @param {Object} e.changes\n * An object describing changes that occurred with the \"statechanged\"\n * event.\n */\n\n\n _proto.handleStateChanged = function handleStateChanged(e) {};\n /**\n * Disposes a plugin.\n *\n * Subclasses can override this if they want, but for the sake of safety,\n * it's probably best to subscribe the \"dispose\" event.\n *\n * @fires Plugin#dispose\n */\n\n\n _proto.dispose = function dispose() {\n var name = this.name,\n player = this.player;\n /**\n * Signals that a advanced plugin is about to be disposed.\n *\n * @event Plugin#dispose\n * @type {EventTarget~Event}\n */\n\n this.trigger('dispose');\n this.off();\n player.off('dispose', this.dispose); // Eliminate any possible sources of leaking memory by clearing up\n // references between the player and the plugin instance and nulling out\n // the plugin's state and replacing methods with a function that throws.\n\n player[PLUGIN_CACHE_KEY][name] = false;\n this.player = this.state = null; // Finally, replace the plugin name on the player with a new factory\n // function, so that the plugin is ready to be set up again.\n\n player[name] = createPluginFactory(name, pluginStorage[name]);\n };\n /**\n * Determines if a plugin is a basic plugin (i.e. not a sub-class of `Plugin`).\n *\n * @param {string|Function} plugin\n * If a string, matches the name of a plugin. If a function, will be\n * tested directly.\n *\n * @return {boolean}\n * Whether or not a plugin is a basic plugin.\n */\n\n\n Plugin.isBasic = function isBasic(plugin) {\n var p = typeof plugin === 'string' ? getPlugin(plugin) : plugin;\n return typeof p === 'function' && !Plugin.prototype.isPrototypeOf(p.prototype);\n };\n /**\n * Register a Video.js plugin.\n *\n * @param {string} name\n * The name of the plugin to be registered. Must be a string and\n * must not match an existing plugin or a method on the `Player`\n * prototype.\n *\n * @param {Function} plugin\n * A sub-class of `Plugin` or a function for basic plugins.\n *\n * @return {Function}\n * For advanced plugins, a factory function for that plugin. For\n * basic plugins, a wrapper function that initializes the plugin.\n */\n\n\n Plugin.registerPlugin = function registerPlugin(name, plugin) {\n if (typeof name !== 'string') {\n throw new Error(\"Illegal plugin name, \\\"\" + name + \"\\\", must be a string, was \" + typeof name + \".\");\n }\n\n if (pluginExists(name)) {\n log.warn(\"A plugin named \\\"\" + name + \"\\\" already exists. You may want to avoid re-registering plugins!\");\n } else if (Player.prototype.hasOwnProperty(name)) {\n throw new Error(\"Illegal plugin name, \\\"\" + name + \"\\\", cannot share a name with an existing player method!\");\n }\n\n if (typeof plugin !== 'function') {\n throw new Error(\"Illegal plugin for \\\"\" + name + \"\\\", must be a function, was \" + typeof plugin + \".\");\n }\n\n pluginStorage[name] = plugin; // Add a player prototype method for all sub-classed plugins (but not for\n // the base Plugin class).\n\n if (name !== BASE_PLUGIN_NAME) {\n if (Plugin.isBasic(plugin)) {\n Player.prototype[name] = createBasicPlugin(name, plugin);\n } else {\n Player.prototype[name] = createPluginFactory(name, plugin);\n }\n }\n\n return plugin;\n };\n /**\n * De-register a Video.js plugin.\n *\n * @param {string} name\n * The name of the plugin to be de-registered. Must be a string that\n * matches an existing plugin.\n *\n * @throws {Error}\n * If an attempt is made to de-register the base plugin.\n */\n\n\n Plugin.deregisterPlugin = function deregisterPlugin(name) {\n if (name === BASE_PLUGIN_NAME) {\n throw new Error('Cannot de-register base plugin.');\n }\n\n if (pluginExists(name)) {\n delete pluginStorage[name];\n delete Player.prototype[name];\n }\n };\n /**\n * Gets an object containing multiple Video.js plugins.\n *\n * @param {Array} [names]\n * If provided, should be an array of plugin names. Defaults to _all_\n * plugin names.\n *\n * @return {Object|undefined}\n * An object containing plugin(s) associated with their name(s) or\n * `undefined` if no matching plugins exist).\n */\n\n\n Plugin.getPlugins = function getPlugins(names) {\n if (names === void 0) {\n names = Object.keys(pluginStorage);\n }\n\n var result;\n names.forEach(function (name) {\n var plugin = getPlugin(name);\n\n if (plugin) {\n result = result || {};\n result[name] = plugin;\n }\n });\n return result;\n };\n /**\n * Gets a plugin's version, if available\n *\n * @param {string} name\n * The name of a plugin.\n *\n * @return {string}\n * The plugin's version or an empty string.\n */\n\n\n Plugin.getPluginVersion = function getPluginVersion(name) {\n var plugin = getPlugin(name);\n return plugin && plugin.VERSION || '';\n };\n\n return Plugin;\n}();\n/**\n * Gets a plugin by name if it exists.\n *\n * @static\n * @method getPlugin\n * @memberOf Plugin\n * @param {string} name\n * The name of a plugin.\n *\n * @returns {Function|undefined}\n * The plugin (or `undefined`).\n */\n\n\nPlugin.getPlugin = getPlugin;\n/**\n * The name of the base plugin class as it is registered.\n *\n * @type {string}\n */\n\nPlugin.BASE_PLUGIN_NAME = BASE_PLUGIN_NAME;\nPlugin.registerPlugin(BASE_PLUGIN_NAME, Plugin);\n/**\n * Documented in player.js\n *\n * @ignore\n */\n\nPlayer.prototype.usingPlugin = function (name) {\n return !!this[PLUGIN_CACHE_KEY] && this[PLUGIN_CACHE_KEY][name] === true;\n};\n/**\n * Documented in player.js\n *\n * @ignore\n */\n\n\nPlayer.prototype.hasPlugin = function (name) {\n return !!pluginExists(name);\n};\n/**\n * Signals that a plugin is about to be set up on a player.\n *\n * @event Player#beforepluginsetup\n * @type {Plugin~PluginEventHash}\n */\n\n/**\n * Signals that a plugin is about to be set up on a player - by name. The name\n * is the name of the plugin.\n *\n * @event Player#beforepluginsetup:$name\n * @type {Plugin~PluginEventHash}\n */\n\n/**\n * Signals that a plugin has just been set up on a player.\n *\n * @event Player#pluginsetup\n * @type {Plugin~PluginEventHash}\n */\n\n/**\n * Signals that a plugin has just been set up on a player - by name. The name\n * is the name of the plugin.\n *\n * @event Player#pluginsetup:$name\n * @type {Plugin~PluginEventHash}\n */\n\n/**\n * @typedef {Object} Plugin~PluginEventHash\n *\n * @property {string} instance\n * For basic plugins, the return value of the plugin function. For\n * advanced plugins, the plugin instance on which the event is fired.\n *\n * @property {string} name\n * The name of the plugin.\n *\n * @property {string} plugin\n * For basic plugins, the plugin function. For advanced plugins, the\n * plugin class/constructor.\n */\n\n/**\n * @file extend.js\n * @module extend\n */\n\n/**\n * A combination of node inherits and babel's inherits (after transpile).\n * Both work the same but node adds `super_` to the subClass\n * and Bable adds the superClass as __proto__. Both seem useful.\n *\n * @param {Object} subClass\n * The class to inherit to\n *\n * @param {Object} superClass\n * The class to inherit from\n *\n * @private\n */\nvar _inherits$1 = function _inherits(subClass, superClass) {\n if (typeof superClass !== 'function' && superClass !== null) {\n throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n\n if (superClass) {\n // node\n subClass.super_ = superClass;\n }\n};\n/**\n * Used to subclass an existing class by emulating ES subclassing using the\n * `extends` keyword.\n *\n * @function\n * @example\n * var MyComponent = videojs.extend(videojs.getComponent('Component'), {\n * myCustomMethod: function() {\n * // Do things in my method.\n * }\n * });\n *\n * @param {Function} superClass\n * The class to inherit from\n *\n * @param {Object} [subClassMethods={}]\n * Methods of the new class\n *\n * @return {Function}\n * The new class with subClassMethods that inherited superClass.\n */\n\n\nvar extend = function extend(superClass, subClassMethods) {\n if (subClassMethods === void 0) {\n subClassMethods = {};\n }\n\n var subClass = function subClass() {\n superClass.apply(this, arguments);\n };\n\n var methods = {};\n\n if (typeof subClassMethods === 'object') {\n if (subClassMethods.constructor !== Object.prototype.constructor) {\n subClass = subClassMethods.constructor;\n }\n\n methods = subClassMethods;\n } else if (typeof subClassMethods === 'function') {\n subClass = subClassMethods;\n }\n\n _inherits$1(subClass, superClass); // Extend subObj's prototype with functions and other properties from props\n\n\n for (var name in methods) {\n if (methods.hasOwnProperty(name)) {\n subClass.prototype[name] = methods[name];\n }\n }\n\n return subClass;\n};\n\n/**\n * @file video.js\n * @module videojs\n */\n/**\n * Normalize an `id` value by trimming off a leading `#`\n *\n * @private\n * @param {string} id\n * A string, maybe with a leading `#`.\n *\n * @return {string}\n * The string, without any leading `#`.\n */\n\nvar normalizeId = function normalizeId(id) {\n return id.indexOf('#') === 0 ? id.slice(1) : id;\n};\n/**\n * The `videojs()` function doubles as the main function for users to create a\n * {@link Player} instance as well as the main library namespace.\n *\n * It can also be used as a getter for a pre-existing {@link Player} instance.\n * However, we _strongly_ recommend using `videojs.getPlayer()` for this\n * purpose because it avoids any potential for unintended initialization.\n *\n * Due to [limitations](https://github.com/jsdoc3/jsdoc/issues/955#issuecomment-313829149)\n * of our JSDoc template, we cannot properly document this as both a function\n * and a namespace, so its function signature is documented here.\n *\n * #### Arguments\n * ##### id\n * string|Element, **required**\n *\n * Video element or video element ID.\n *\n * ##### options\n * Object, optional\n *\n * Options object for providing settings.\n * See: [Options Guide](https://docs.videojs.com/tutorial-options.html).\n *\n * ##### ready\n * {@link Component~ReadyCallback}, optional\n *\n * A function to be called when the {@link Player} and {@link Tech} are ready.\n *\n * #### Return Value\n *\n * The `videojs()` function returns a {@link Player} instance.\n *\n * @namespace\n *\n * @borrows AudioTrack as AudioTrack\n * @borrows Component.getComponent as getComponent\n * @borrows module:computed-style~computedStyle as computedStyle\n * @borrows module:events.on as on\n * @borrows module:events.one as one\n * @borrows module:events.off as off\n * @borrows module:events.trigger as trigger\n * @borrows EventTarget as EventTarget\n * @borrows module:extend~extend as extend\n * @borrows module:fn.bind as bind\n * @borrows module:format-time.formatTime as formatTime\n * @borrows module:format-time.resetFormatTime as resetFormatTime\n * @borrows module:format-time.setFormatTime as setFormatTime\n * @borrows module:merge-options.mergeOptions as mergeOptions\n * @borrows module:middleware.use as use\n * @borrows Player.players as players\n * @borrows Plugin.registerPlugin as registerPlugin\n * @borrows Plugin.deregisterPlugin as deregisterPlugin\n * @borrows Plugin.getPlugins as getPlugins\n * @borrows Plugin.getPlugin as getPlugin\n * @borrows Plugin.getPluginVersion as getPluginVersion\n * @borrows Tech.getTech as getTech\n * @borrows Tech.registerTech as registerTech\n * @borrows TextTrack as TextTrack\n * @borrows module:time-ranges.createTimeRanges as createTimeRange\n * @borrows module:time-ranges.createTimeRanges as createTimeRanges\n * @borrows module:url.isCrossOrigin as isCrossOrigin\n * @borrows module:url.parseUrl as parseUrl\n * @borrows VideoTrack as VideoTrack\n *\n * @param {string|Element} id\n * Video element or video element ID.\n *\n * @param {Object} [options]\n * Options object for providing settings.\n * See: [Options Guide](https://docs.videojs.com/tutorial-options.html).\n *\n * @param {Component~ReadyCallback} [ready]\n * A function to be called when the {@link Player} and {@link Tech} are\n * ready.\n *\n * @return {Player}\n * The `videojs()` function returns a {@link Player|Player} instance.\n */\n\n\nfunction videojs$1(id, options, ready) {\n var player = videojs$1.getPlayer(id);\n\n if (player) {\n if (options) {\n log.warn(\"Player \\\"\" + id + \"\\\" is already initialised. Options will not be applied.\");\n }\n\n if (ready) {\n player.ready(ready);\n }\n\n return player;\n }\n\n var el = typeof id === 'string' ? $('#' + normalizeId(id)) : id;\n\n if (!isEl(el)) {\n throw new TypeError('The element or ID supplied is not valid. (videojs)');\n }\n\n if (!document.body.contains(el)) {\n log.warn('The element supplied is not included in the DOM');\n }\n\n options = options || {};\n videojs$1.hooks('beforesetup').forEach(function (hookFunction) {\n var opts = hookFunction(el, mergeOptions(options));\n\n if (!isObject(opts) || Array.isArray(opts)) {\n log.error('please return an object in beforesetup hooks');\n return;\n }\n\n options = mergeOptions(options, opts);\n }); // We get the current \"Player\" component here in case an integration has\n // replaced it with a custom player.\n\n var PlayerComponent = Component.getComponent('Player');\n player = new PlayerComponent(el, options, ready);\n videojs$1.hooks('setup').forEach(function (hookFunction) {\n return hookFunction(player);\n });\n return player;\n}\n/**\n * An Object that contains lifecycle hooks as keys which point to an array\n * of functions that are run when a lifecycle is triggered\n *\n * @private\n */\n\n\nvideojs$1.hooks_ = {};\n/**\n * Get a list of hooks for a specific lifecycle\n *\n * @param {string} type\n * the lifecyle to get hooks from\n *\n * @param {Function|Function[]} [fn]\n * Optionally add a hook (or hooks) to the lifecycle that your are getting.\n *\n * @return {Array}\n * an array of hooks, or an empty array if there are none.\n */\n\nvideojs$1.hooks = function (type, fn) {\n videojs$1.hooks_[type] = videojs$1.hooks_[type] || [];\n\n if (fn) {\n videojs$1.hooks_[type] = videojs$1.hooks_[type].concat(fn);\n }\n\n return videojs$1.hooks_[type];\n};\n/**\n * Add a function hook to a specific videojs lifecycle.\n *\n * @param {string} type\n * the lifecycle to hook the function to.\n *\n * @param {Function|Function[]}\n * The function or array of functions to attach.\n */\n\n\nvideojs$1.hook = function (type, fn) {\n videojs$1.hooks(type, fn);\n};\n/**\n * Add a function hook that will only run once to a specific videojs lifecycle.\n *\n * @param {string} type\n * the lifecycle to hook the function to.\n *\n * @param {Function|Function[]}\n * The function or array of functions to attach.\n */\n\n\nvideojs$1.hookOnce = function (type, fn) {\n videojs$1.hooks(type, [].concat(fn).map(function (original) {\n var wrapper = function wrapper() {\n videojs$1.removeHook(type, wrapper);\n return original.apply(void 0, arguments);\n };\n\n return wrapper;\n }));\n};\n/**\n * Remove a hook from a specific videojs lifecycle.\n *\n * @param {string} type\n * the lifecycle that the function hooked to\n *\n * @param {Function} fn\n * The hooked function to remove\n *\n * @return {boolean}\n * The function that was removed or undef\n */\n\n\nvideojs$1.removeHook = function (type, fn) {\n var index = videojs$1.hooks(type).indexOf(fn);\n\n if (index <= -1) {\n return false;\n }\n\n videojs$1.hooks_[type] = videojs$1.hooks_[type].slice();\n videojs$1.hooks_[type].splice(index, 1);\n return true;\n}; // Add default styles\n\n\nif (window$1.VIDEOJS_NO_DYNAMIC_STYLE !== true && isReal()) {\n var style$1 = $('.vjs-styles-defaults');\n\n if (!style$1) {\n style$1 = createStyleElement('vjs-styles-defaults');\n var head = $('head');\n\n if (head) {\n head.insertBefore(style$1, head.firstChild);\n }\n\n setTextContent(style$1, \"\\n .video-js {\\n width: 300px;\\n height: 150px;\\n }\\n\\n .vjs-fluid {\\n padding-top: 56.25%\\n }\\n \");\n }\n} // Run Auto-load players\n// You have to wait at least once in case this script is loaded after your\n// video in the DOM (weird behavior only with minified version)\n\n\nautoSetupTimeout(1, videojs$1);\n/**\n * Current Video.js version. Follows [semantic versioning](https://semver.org/).\n *\n * @type {string}\n */\n\nvideojs$1.VERSION = version;\n/**\n * The global options object. These are the settings that take effect\n * if no overrides are specified when the player is created.\n *\n * @type {Object}\n */\n\nvideojs$1.options = Player.prototype.options_;\n/**\n * Get an object with the currently created players, keyed by player ID\n *\n * @return {Object}\n * The created players\n */\n\nvideojs$1.getPlayers = function () {\n return Player.players;\n};\n/**\n * Get a single player based on an ID or DOM element.\n *\n * This is useful if you want to check if an element or ID has an associated\n * Video.js player, but not create one if it doesn't.\n *\n * @param {string|Element} id\n * An HTML element - `<video>`, `<audio>`, or `<video-js>` -\n * or a string matching the `id` of such an element.\n *\n * @return {Player|undefined}\n * A player instance or `undefined` if there is no player instance\n * matching the argument.\n */\n\n\nvideojs$1.getPlayer = function (id) {\n var players = Player.players;\n var tag;\n\n if (typeof id === 'string') {\n var nId = normalizeId(id);\n var player = players[nId];\n\n if (player) {\n return player;\n }\n\n tag = $('#' + nId);\n } else {\n tag = id;\n }\n\n if (isEl(tag)) {\n var _tag = tag,\n _player = _tag.player,\n playerId = _tag.playerId; // Element may have a `player` property referring to an already created\n // player instance. If so, return that.\n\n if (_player || players[playerId]) {\n return _player || players[playerId];\n }\n }\n};\n/**\n * Returns an array of all current players.\n *\n * @return {Array}\n * An array of all players. The array will be in the order that\n * `Object.keys` provides, which could potentially vary between\n * JavaScript engines.\n *\n */\n\n\nvideojs$1.getAllPlayers = function () {\n return (// Disposed players leave a key with a `null` value, so we need to make sure\n // we filter those out.\n Object.keys(Player.players).map(function (k) {\n return Player.players[k];\n }).filter(Boolean)\n );\n};\n\nvideojs$1.players = Player.players;\nvideojs$1.getComponent = Component.getComponent;\n/**\n * Register a component so it can referred to by name. Used when adding to other\n * components, either through addChild `component.addChild('myComponent')` or through\n * default children options `{ children: ['myComponent'] }`.\n *\n * > NOTE: You could also just initialize the component before adding.\n * `component.addChild(new MyComponent());`\n *\n * @param {string} name\n * The class name of the component\n *\n * @param {Component} comp\n * The component class\n *\n * @return {Component}\n * The newly registered component\n */\n\nvideojs$1.registerComponent = function (name$$1, comp) {\n if (Tech.isTech(comp)) {\n log.warn(\"The \" + name$$1 + \" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)\");\n }\n\n Component.registerComponent.call(Component, name$$1, comp);\n};\n\nvideojs$1.getTech = Tech.getTech;\nvideojs$1.registerTech = Tech.registerTech;\nvideojs$1.use = use;\n/**\n * An object that can be returned by a middleware to signify\n * that the middleware is being terminated.\n *\n * @type {object}\n * @property {object} middleware.TERMINATOR\n */\n\nObject.defineProperty(videojs$1, 'middleware', {\n value: {},\n writeable: false,\n enumerable: true\n});\nObject.defineProperty(videojs$1.middleware, 'TERMINATOR', {\n value: TERMINATOR,\n writeable: false,\n enumerable: true\n});\n/**\n * A reference to the {@link module:browser|browser utility module} as an object.\n *\n * @type {Object}\n * @see {@link module:browser|browser}\n */\n\nvideojs$1.browser = browser;\n/**\n * Use {@link module:browser.TOUCH_ENABLED|browser.TOUCH_ENABLED} instead; only\n * included for backward-compatibility with 4.x.\n *\n * @deprecated Since version 5.0, use {@link module:browser.TOUCH_ENABLED|browser.TOUCH_ENABLED instead.\n * @type {boolean}\n */\n\nvideojs$1.TOUCH_ENABLED = TOUCH_ENABLED;\nvideojs$1.extend = extend;\nvideojs$1.mergeOptions = mergeOptions;\nvideojs$1.bind = bind;\nvideojs$1.registerPlugin = Plugin.registerPlugin;\nvideojs$1.deregisterPlugin = Plugin.deregisterPlugin;\n/**\n * Deprecated method to register a plugin with Video.js\n *\n * @deprecated videojs.plugin() is deprecated; use videojs.registerPlugin() instead\n *\n * @param {string} name\n * The plugin name\n *\n * @param {Plugin|Function} plugin\n * The plugin sub-class or function\n */\n\nvideojs$1.plugin = function (name$$1, plugin) {\n log.warn('videojs.plugin() is deprecated; use videojs.registerPlugin() instead');\n return Plugin.registerPlugin(name$$1, plugin);\n};\n\nvideojs$1.getPlugins = Plugin.getPlugins;\nvideojs$1.getPlugin = Plugin.getPlugin;\nvideojs$1.getPluginVersion = Plugin.getPluginVersion;\n/**\n * Adding languages so that they're available to all players.\n * Example: `videojs.addLanguage('es', { 'Hello': 'Hola' });`\n *\n * @param {string} code\n * The language code or dictionary property\n *\n * @param {Object} data\n * The data values to be translated\n *\n * @return {Object}\n * The resulting language dictionary object\n */\n\nvideojs$1.addLanguage = function (code, data) {\n var _mergeOptions;\n\n code = ('' + code).toLowerCase();\n videojs$1.options.languages = mergeOptions(videojs$1.options.languages, (_mergeOptions = {}, _mergeOptions[code] = data, _mergeOptions));\n return videojs$1.options.languages[code];\n};\n/**\n * A reference to the {@link module:log|log utility module} as an object.\n *\n * @type {Function}\n * @see {@link module:log|log}\n */\n\n\nvideojs$1.log = log;\nvideojs$1.createLogger = createLogger$1;\nvideojs$1.createTimeRange = videojs$1.createTimeRanges = createTimeRanges;\nvideojs$1.formatTime = formatTime;\nvideojs$1.setFormatTime = setFormatTime;\nvideojs$1.resetFormatTime = resetFormatTime;\nvideojs$1.parseUrl = parseUrl;\nvideojs$1.isCrossOrigin = isCrossOrigin;\nvideojs$1.EventTarget = EventTarget;\nvideojs$1.on = on;\nvideojs$1.one = one;\nvideojs$1.off = off;\nvideojs$1.trigger = trigger;\n/**\n * A cross-browser XMLHttpRequest wrapper.\n *\n * @function\n * @param {Object} options\n * Settings for the request.\n *\n * @return {XMLHttpRequest|XDomainRequest}\n * The request object.\n *\n * @see https://github.com/Raynos/xhr\n */\n\nvideojs$1.xhr = xhr;\nvideojs$1.TextTrack = TextTrack;\nvideojs$1.AudioTrack = AudioTrack;\nvideojs$1.VideoTrack = VideoTrack;\n['isEl', 'isTextNode', 'createEl', 'hasClass', 'addClass', 'removeClass', 'toggleClass', 'setAttributes', 'getAttributes', 'emptyEl', 'appendContent', 'insertContent'].forEach(function (k) {\n videojs$1[k] = function () {\n log.warn(\"videojs.\" + k + \"() is deprecated; use videojs.dom.\" + k + \"() instead\");\n return Dom[k].apply(null, arguments);\n };\n});\nvideojs$1.computedStyle = computedStyle;\n/**\n * A reference to the {@link module:dom|DOM utility module} as an object.\n *\n * @type {Object}\n * @see {@link module:dom|dom}\n */\n\nvideojs$1.dom = Dom;\n/**\n * A reference to the {@link module:url|URL utility module} as an object.\n *\n * @type {Object}\n * @see {@link module:url|url}\n */\n\nvideojs$1.url = Url;\n\n/**\n * @videojs/http-streaming\n * @version 1.5.1\n * @copyright 2018 Brightcove, Inc\n * @license Apache-2.0\n */\n/**\n * @file resolve-url.js\n */\n\nvar resolveUrl = function resolveUrl(baseURL, relativeURL) {\n // return early if we don't need to resolve\n if (/^[a-z]+:/i.test(relativeURL)) {\n return relativeURL;\n } // if the base URL is relative then combine with the current location\n\n\n if (!/\\/\\//i.test(baseURL)) {\n baseURL = URLToolkit.buildAbsoluteURL(window$1.location.href, baseURL);\n }\n\n return URLToolkit.buildAbsoluteURL(baseURL, relativeURL);\n};\n\nvar classCallCheck = function classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};\n\nvar createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\nvar get$1 = function get(object, property, receiver) {\n if (object === null) object = Function.prototype;\n var desc = Object.getOwnPropertyDescriptor(object, property);\n\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n\n if (parent === null) {\n return undefined;\n } else {\n return get(parent, property, receiver);\n }\n } else if (\"value\" in desc) {\n return desc.value;\n } else {\n var getter = desc.get;\n\n if (getter === undefined) {\n return undefined;\n }\n\n return getter.call(receiver);\n }\n};\n\nvar inherits = function inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n};\n\nvar possibleConstructorReturn = function possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n};\n\nvar slicedToArray = function () {\n function sliceIterator(arr, i) {\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"]) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n }\n\n return function (arr, i) {\n if (Array.isArray(arr)) {\n return arr;\n } else if (Symbol.iterator in Object(arr)) {\n return sliceIterator(arr, i);\n } else {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n }\n };\n}();\n/**\n * @file playlist-loader.js\n *\n * A state machine that manages the loading, caching, and updating of\n * M3U8 playlists.\n *\n */\n\n\nvar mergeOptions$1 = videojs$1.mergeOptions,\n EventTarget$1 = videojs$1.EventTarget,\n log$1 = videojs$1.log;\n/**\n * Loops through all supported media groups in master and calls the provided\n * callback for each group\n *\n * @param {Object} master\n * The parsed master manifest object\n * @param {Function} callback\n * Callback to call for each media group\n */\n\nvar forEachMediaGroup = function forEachMediaGroup(master, callback) {\n ['AUDIO', 'SUBTITLES'].forEach(function (mediaType) {\n for (var groupKey in master.mediaGroups[mediaType]) {\n for (var labelKey in master.mediaGroups[mediaType][groupKey]) {\n var mediaProperties = master.mediaGroups[mediaType][groupKey][labelKey];\n callback(mediaProperties, mediaType, groupKey, labelKey);\n }\n }\n });\n};\n/**\n * Returns a new array of segments that is the result of merging\n * properties from an older list of segments onto an updated\n * list. No properties on the updated playlist will be overridden.\n *\n * @param {Array} original the outdated list of segments\n * @param {Array} update the updated list of segments\n * @param {Number=} offset the index of the first update\n * segment in the original segment list. For non-live playlists,\n * this should always be zero and does not need to be\n * specified. For live playlists, it should be the difference\n * between the media sequence numbers in the original and updated\n * playlists.\n * @return a list of merged segment objects\n */\n\n\nvar updateSegments = function updateSegments(original, update, offset) {\n var result = update.slice();\n offset = offset || 0;\n var length = Math.min(original.length, update.length + offset);\n\n for (var i = offset; i < length; i++) {\n result[i - offset] = mergeOptions$1(original[i], result[i - offset]);\n }\n\n return result;\n};\n\nvar resolveSegmentUris = function resolveSegmentUris(segment, baseUri) {\n if (!segment.resolvedUri) {\n segment.resolvedUri = resolveUrl(baseUri, segment.uri);\n }\n\n if (segment.key && !segment.key.resolvedUri) {\n segment.key.resolvedUri = resolveUrl(baseUri, segment.key.uri);\n }\n\n if (segment.map && !segment.map.resolvedUri) {\n segment.map.resolvedUri = resolveUrl(baseUri, segment.map.uri);\n }\n};\n/**\n * Returns a new master playlist that is the result of merging an\n * updated media playlist into the original version. If the\n * updated media playlist does not match any of the playlist\n * entries in the original master playlist, null is returned.\n *\n * @param {Object} master a parsed master M3U8 object\n * @param {Object} media a parsed media M3U8 object\n * @return {Object} a new object that represents the original\n * master playlist with the updated media playlist merged in, or\n * null if the merge produced no change.\n */\n\n\nvar updateMaster = function updateMaster(master, media) {\n var result = mergeOptions$1(master, {});\n var playlist = result.playlists[media.uri];\n\n if (!playlist) {\n return null;\n } // consider the playlist unchanged if the number of segments is equal and the media\n // sequence number is unchanged\n\n\n if (playlist.segments && media.segments && playlist.segments.length === media.segments.length && playlist.mediaSequence === media.mediaSequence) {\n return null;\n }\n\n var mergedPlaylist = mergeOptions$1(playlist, media); // if the update could overlap existing segment information, merge the two segment lists\n\n if (playlist.segments) {\n mergedPlaylist.segments = updateSegments(playlist.segments, media.segments, media.mediaSequence - playlist.mediaSequence);\n } // resolve any segment URIs to prevent us from having to do it later\n\n\n mergedPlaylist.segments.forEach(function (segment) {\n resolveSegmentUris(segment, mergedPlaylist.resolvedUri);\n }); // TODO Right now in the playlists array there are two references to each playlist, one\n // that is referenced by index, and one by URI. The index reference may no longer be\n // necessary.\n\n for (var i = 0; i < result.playlists.length; i++) {\n if (result.playlists[i].uri === media.uri) {\n result.playlists[i] = mergedPlaylist;\n }\n }\n\n result.playlists[media.uri] = mergedPlaylist;\n return result;\n};\n\nvar setupMediaPlaylists = function setupMediaPlaylists(master) {\n // setup by-URI lookups and resolve media playlist URIs\n var i = master.playlists.length;\n\n while (i--) {\n var playlist = master.playlists[i];\n master.playlists[playlist.uri] = playlist;\n playlist.resolvedUri = resolveUrl(master.uri, playlist.uri);\n playlist.id = i;\n\n if (!playlist.attributes) {\n // Although the spec states an #EXT-X-STREAM-INF tag MUST have a\n // BANDWIDTH attribute, we can play the stream without it. This means a poorly\n // formatted master playlist may not have an attribute list. An attributes\n // property is added here to prevent undefined references when we encounter\n // this scenario.\n playlist.attributes = {};\n log$1.warn('Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.');\n }\n }\n};\n\nvar resolveMediaGroupUris = function resolveMediaGroupUris(master) {\n forEachMediaGroup(master, function (properties) {\n if (properties.uri) {\n properties.resolvedUri = resolveUrl(master.uri, properties.uri);\n }\n });\n};\n/**\n * Calculates the time to wait before refreshing a live playlist\n *\n * @param {Object} media\n * The current media\n * @param {Boolean} update\n * True if there were any updates from the last refresh, false otherwise\n * @return {Number}\n * The time in ms to wait before refreshing the live playlist\n */\n\n\nvar refreshDelay = function refreshDelay(media, update) {\n var lastSegment = media.segments[media.segments.length - 1];\n var delay = void 0;\n\n if (update && lastSegment && lastSegment.duration) {\n delay = lastSegment.duration * 1000;\n } else {\n // if the playlist is unchanged since the last reload or last segment duration\n // cannot be determined, try again after half the target duration\n delay = (media.targetDuration || 10) * 500;\n }\n\n return delay;\n};\n/**\n * Load a playlist from a remote location\n *\n * @class PlaylistLoader\n * @extends Stream\n * @param {String} srcUrl the url to start with\n * @param {Boolean} withCredentials the withCredentials xhr option\n * @constructor\n */\n\n\nvar PlaylistLoader = function (_EventTarget) {\n inherits(PlaylistLoader, _EventTarget);\n\n function PlaylistLoader(srcUrl, hls, withCredentials) {\n classCallCheck(this, PlaylistLoader);\n\n var _this = possibleConstructorReturn(this, (PlaylistLoader.__proto__ || Object.getPrototypeOf(PlaylistLoader)).call(this));\n\n _this.srcUrl = srcUrl;\n _this.hls_ = hls;\n _this.withCredentials = withCredentials;\n\n if (!_this.srcUrl) {\n throw new Error('A non-empty playlist URL is required');\n } // initialize the loader state\n\n\n _this.state = 'HAVE_NOTHING'; // live playlist staleness timeout\n\n _this.on('mediaupdatetimeout', function () {\n if (_this.state !== 'HAVE_METADATA') {\n // only refresh the media playlist if no other activity is going on\n return;\n }\n\n _this.state = 'HAVE_CURRENT_METADATA';\n _this.request = _this.hls_.xhr({\n uri: resolveUrl(_this.master.uri, _this.media().uri),\n withCredentials: _this.withCredentials\n }, function (error, req) {\n // disposed\n if (!_this.request) {\n return;\n }\n\n if (error) {\n return _this.playlistRequestError(_this.request, _this.media().uri, 'HAVE_METADATA');\n }\n\n _this.haveMetadata(_this.request, _this.media().uri);\n });\n });\n\n return _this;\n }\n\n createClass(PlaylistLoader, [{\n key: 'playlistRequestError',\n value: function playlistRequestError(xhr$$1, url, startingState) {\n // any in-flight request is now finished\n this.request = null;\n\n if (startingState) {\n this.state = startingState;\n }\n\n this.error = {\n playlist: this.master.playlists[url],\n status: xhr$$1.status,\n message: 'HLS playlist request error at URL: ' + url,\n responseText: xhr$$1.responseText,\n code: xhr$$1.status >= 500 ? 4 : 2\n };\n this.trigger('error');\n } // update the playlist loader's state in response to a new or\n // updated playlist.\n\n }, {\n key: 'haveMetadata',\n value: function haveMetadata(xhr$$1, url) {\n var _this2 = this; // any in-flight request is now finished\n\n\n this.request = null;\n this.state = 'HAVE_METADATA';\n var parser = new Parser();\n parser.push(xhr$$1.responseText);\n parser.end();\n parser.manifest.uri = url; // m3u8-parser does not attach an attributes property to media playlists so make\n // sure that the property is attached to avoid undefined reference errors\n\n parser.manifest.attributes = parser.manifest.attributes || {}; // merge this playlist into the master\n\n var update = updateMaster(this.master, parser.manifest);\n this.targetDuration = parser.manifest.targetDuration;\n\n if (update) {\n this.master = update;\n this.media_ = this.master.playlists[parser.manifest.uri];\n } else {\n this.trigger('playlistunchanged');\n } // refresh live playlists after a target duration passes\n\n\n if (!this.media().endList) {\n window$1.clearTimeout(this.mediaUpdateTimeout);\n this.mediaUpdateTimeout = window$1.setTimeout(function () {\n _this2.trigger('mediaupdatetimeout');\n }, refreshDelay(this.media(), !!update));\n }\n\n this.trigger('loadedplaylist');\n }\n /**\n * Abort any outstanding work and clean up.\n */\n\n }, {\n key: 'dispose',\n value: function dispose() {\n this.stopRequest();\n window$1.clearTimeout(this.mediaUpdateTimeout);\n }\n }, {\n key: 'stopRequest',\n value: function stopRequest() {\n if (this.request) {\n var oldRequest = this.request;\n this.request = null;\n oldRequest.onreadystatechange = null;\n oldRequest.abort();\n }\n }\n /**\n * When called without any arguments, returns the currently\n * active media playlist. When called with a single argument,\n * triggers the playlist loader to asynchronously switch to the\n * specified media playlist. Calling this method while the\n * loader is in the HAVE_NOTHING causes an error to be emitted\n * but otherwise has no effect.\n *\n * @param {Object=} playlist the parsed media playlist\n * object to switch to\n * @return {Playlist} the current loaded media\n */\n\n }, {\n key: 'media',\n value: function media(playlist) {\n var _this3 = this; // getter\n\n\n if (!playlist) {\n return this.media_;\n } // setter\n\n\n if (this.state === 'HAVE_NOTHING') {\n throw new Error('Cannot switch media playlist from ' + this.state);\n }\n\n var startingState = this.state; // find the playlist object if the target playlist has been\n // specified by URI\n\n if (typeof playlist === 'string') {\n if (!this.master.playlists[playlist]) {\n throw new Error('Unknown playlist URI: ' + playlist);\n }\n\n playlist = this.master.playlists[playlist];\n }\n\n var mediaChange = !this.media_ || playlist.uri !== this.media_.uri; // switch to fully loaded playlists immediately\n\n if (this.master.playlists[playlist.uri].endList) {\n // abort outstanding playlist requests\n if (this.request) {\n this.request.onreadystatechange = null;\n this.request.abort();\n this.request = null;\n }\n\n this.state = 'HAVE_METADATA';\n this.media_ = playlist; // trigger media change if the active media has been updated\n\n if (mediaChange) {\n this.trigger('mediachanging');\n this.trigger('mediachange');\n }\n\n return;\n } // switching to the active playlist is a no-op\n\n\n if (!mediaChange) {\n return;\n }\n\n this.state = 'SWITCHING_MEDIA'; // there is already an outstanding playlist request\n\n if (this.request) {\n if (resolveUrl(this.master.uri, playlist.uri) === this.request.url) {\n // requesting to switch to the same playlist multiple times\n // has no effect after the first\n return;\n }\n\n this.request.onreadystatechange = null;\n this.request.abort();\n this.request = null;\n } // request the new playlist\n\n\n if (this.media_) {\n this.trigger('mediachanging');\n }\n\n this.request = this.hls_.xhr({\n uri: resolveUrl(this.master.uri, playlist.uri),\n withCredentials: this.withCredentials\n }, function (error, req) {\n // disposed\n if (!_this3.request) {\n return;\n }\n\n if (error) {\n return _this3.playlistRequestError(_this3.request, playlist.uri, startingState);\n }\n\n _this3.haveMetadata(req, playlist.uri); // fire loadedmetadata the first time a media playlist is loaded\n\n\n if (startingState === 'HAVE_MASTER') {\n _this3.trigger('loadedmetadata');\n } else {\n _this3.trigger('mediachange');\n }\n });\n }\n /**\n * pause loading of the playlist\n */\n\n }, {\n key: 'pause',\n value: function pause() {\n this.stopRequest();\n window$1.clearTimeout(this.mediaUpdateTimeout);\n\n if (this.state === 'HAVE_NOTHING') {\n // If we pause the loader before any data has been retrieved, its as if we never\n // started, so reset to an unstarted state.\n this.started = false;\n } // Need to restore state now that no activity is happening\n\n\n if (this.state === 'SWITCHING_MEDIA') {\n // if the loader was in the process of switching media, it should either return to\n // HAVE_MASTER or HAVE_METADATA depending on if the loader has loaded a media\n // playlist yet. This is determined by the existence of loader.media_\n if (this.media_) {\n this.state = 'HAVE_METADATA';\n } else {\n this.state = 'HAVE_MASTER';\n }\n } else if (this.state === 'HAVE_CURRENT_METADATA') {\n this.state = 'HAVE_METADATA';\n }\n }\n /**\n * start loading of the playlist\n */\n\n }, {\n key: 'load',\n value: function load(isFinalRendition) {\n var _this4 = this;\n\n window$1.clearTimeout(this.mediaUpdateTimeout);\n var media = this.media();\n\n if (isFinalRendition) {\n var delay = media ? media.targetDuration / 2 * 1000 : 5 * 1000;\n this.mediaUpdateTimeout = window$1.setTimeout(function () {\n return _this4.load();\n }, delay);\n return;\n }\n\n if (!this.started) {\n this.start();\n return;\n }\n\n if (media && !media.endList) {\n this.trigger('mediaupdatetimeout');\n } else {\n this.trigger('loadedplaylist');\n }\n }\n /**\n * start loading of the playlist\n */\n\n }, {\n key: 'start',\n value: function start() {\n var _this5 = this;\n\n this.started = true; // request the specified URL\n\n this.request = this.hls_.xhr({\n uri: this.srcUrl,\n withCredentials: this.withCredentials\n }, function (error, req) {\n // disposed\n if (!_this5.request) {\n return;\n } // clear the loader's request reference\n\n\n _this5.request = null;\n\n if (error) {\n _this5.error = {\n status: req.status,\n message: 'HLS playlist request error at URL: ' + _this5.srcUrl,\n responseText: req.responseText,\n // MEDIA_ERR_NETWORK\n code: 2\n };\n\n if (_this5.state === 'HAVE_NOTHING') {\n _this5.started = false;\n }\n\n return _this5.trigger('error');\n }\n\n var parser = new Parser();\n parser.push(req.responseText);\n parser.end();\n _this5.state = 'HAVE_MASTER';\n parser.manifest.uri = _this5.srcUrl; // loaded a master playlist\n\n if (parser.manifest.playlists) {\n _this5.master = parser.manifest;\n setupMediaPlaylists(_this5.master);\n resolveMediaGroupUris(_this5.master);\n\n _this5.trigger('loadedplaylist');\n\n if (!_this5.request) {\n // no media playlist was specifically selected so start\n // from the first listed one\n _this5.media(parser.manifest.playlists[0]);\n }\n\n return;\n } // loaded a media playlist\n // infer a master playlist if none was previously requested\n\n\n _this5.master = {\n mediaGroups: {\n 'AUDIO': {},\n 'VIDEO': {},\n 'CLOSED-CAPTIONS': {},\n 'SUBTITLES': {}\n },\n uri: window$1.location.href,\n playlists: [{\n uri: _this5.srcUrl,\n id: 0\n }]\n };\n _this5.master.playlists[_this5.srcUrl] = _this5.master.playlists[0];\n _this5.master.playlists[0].resolvedUri = _this5.srcUrl; // m3u8-parser does not attach an attributes property to media playlists so make\n // sure that the property is attached to avoid undefined reference errors\n\n _this5.master.playlists[0].attributes = _this5.master.playlists[0].attributes || {};\n\n _this5.haveMetadata(req, _this5.srcUrl);\n\n return _this5.trigger('loadedmetadata');\n });\n }\n }]);\n return PlaylistLoader;\n}(EventTarget$1);\n/**\n * @file playlist.js\n *\n * Playlist related utilities.\n */\n\n\nvar createTimeRange = videojs$1.createTimeRange;\n/**\n * walk backward until we find a duration we can use\n * or return a failure\n *\n * @param {Playlist} playlist the playlist to walk through\n * @param {Number} endSequence the mediaSequence to stop walking on\n */\n\nvar backwardDuration = function backwardDuration(playlist, endSequence) {\n var result = 0;\n var i = endSequence - playlist.mediaSequence; // if a start time is available for segment immediately following\n // the interval, use it\n\n var segment = playlist.segments[i]; // Walk backward until we find the latest segment with timeline\n // information that is earlier than endSequence\n\n if (segment) {\n if (typeof segment.start !== 'undefined') {\n return {\n result: segment.start,\n precise: true\n };\n }\n\n if (typeof segment.end !== 'undefined') {\n return {\n result: segment.end - segment.duration,\n precise: true\n };\n }\n }\n\n while (i--) {\n segment = playlist.segments[i];\n\n if (typeof segment.end !== 'undefined') {\n return {\n result: result + segment.end,\n precise: true\n };\n }\n\n result += segment.duration;\n\n if (typeof segment.start !== 'undefined') {\n return {\n result: result + segment.start,\n precise: true\n };\n }\n }\n\n return {\n result: result,\n precise: false\n };\n};\n/**\n * walk forward until we find a duration we can use\n * or return a failure\n *\n * @param {Playlist} playlist the playlist to walk through\n * @param {Number} endSequence the mediaSequence to stop walking on\n */\n\n\nvar forwardDuration = function forwardDuration(playlist, endSequence) {\n var result = 0;\n var segment = void 0;\n var i = endSequence - playlist.mediaSequence; // Walk forward until we find the earliest segment with timeline\n // information\n\n for (; i < playlist.segments.length; i++) {\n segment = playlist.segments[i];\n\n if (typeof segment.start !== 'undefined') {\n return {\n result: segment.start - result,\n precise: true\n };\n }\n\n result += segment.duration;\n\n if (typeof segment.end !== 'undefined') {\n return {\n result: segment.end - result,\n precise: true\n };\n }\n } // indicate we didn't find a useful duration estimate\n\n\n return {\n result: -1,\n precise: false\n };\n};\n/**\n * Calculate the media duration from the segments associated with a\n * playlist. The duration of a subinterval of the available segments\n * may be calculated by specifying an end index.\n *\n * @param {Object} playlist a media playlist object\n * @param {Number=} endSequence an exclusive upper boundary\n * for the playlist. Defaults to playlist length.\n * @param {Number} expired the amount of time that has dropped\n * off the front of the playlist in a live scenario\n * @return {Number} the duration between the first available segment\n * and end index.\n */\n\n\nvar intervalDuration = function intervalDuration(playlist, endSequence, expired) {\n var backward = void 0;\n var forward = void 0;\n\n if (typeof endSequence === 'undefined') {\n endSequence = playlist.mediaSequence + playlist.segments.length;\n }\n\n if (endSequence < playlist.mediaSequence) {\n return 0;\n } // do a backward walk to estimate the duration\n\n\n backward = backwardDuration(playlist, endSequence);\n\n if (backward.precise) {\n // if we were able to base our duration estimate on timing\n // information provided directly from the Media Source, return\n // it\n return backward.result;\n } // walk forward to see if a precise duration estimate can be made\n // that way\n\n\n forward = forwardDuration(playlist, endSequence);\n\n if (forward.precise) {\n // we found a segment that has been buffered and so it's\n // position is known precisely\n return forward.result;\n } // return the less-precise, playlist-based duration estimate\n\n\n return backward.result + expired;\n};\n/**\n * Calculates the duration of a playlist. If a start and end index\n * are specified, the duration will be for the subset of the media\n * timeline between those two indices. The total duration for live\n * playlists is always Infinity.\n *\n * @param {Object} playlist a media playlist object\n * @param {Number=} endSequence an exclusive upper\n * boundary for the playlist. Defaults to the playlist media\n * sequence number plus its length.\n * @param {Number=} expired the amount of time that has\n * dropped off the front of the playlist in a live scenario\n * @return {Number} the duration between the start index and end\n * index.\n */\n\n\nvar duration = function duration(playlist, endSequence, expired) {\n if (!playlist) {\n return 0;\n }\n\n if (typeof expired !== 'number') {\n expired = 0;\n } // if a slice of the total duration is not requested, use\n // playlist-level duration indicators when they're present\n\n\n if (typeof endSequence === 'undefined') {\n // if present, use the duration specified in the playlist\n if (playlist.totalDuration) {\n return playlist.totalDuration;\n } // duration should be Infinity for live playlists\n\n\n if (!playlist.endList) {\n return window$1.Infinity;\n }\n } // calculate the total duration based on the segment durations\n\n\n return intervalDuration(playlist, endSequence, expired);\n};\n/**\n * Calculate the time between two indexes in the current playlist\n * neight the start- nor the end-index need to be within the current\n * playlist in which case, the targetDuration of the playlist is used\n * to approximate the durations of the segments\n *\n * @param {Object} playlist a media playlist object\n * @param {Number} startIndex\n * @param {Number} endIndex\n * @return {Number} the number of seconds between startIndex and endIndex\n */\n\n\nvar sumDurations = function sumDurations(playlist, startIndex, endIndex) {\n var durations = 0;\n\n if (startIndex > endIndex) {\n var _ref = [endIndex, startIndex];\n startIndex = _ref[0];\n endIndex = _ref[1];\n }\n\n if (startIndex < 0) {\n for (var i = startIndex; i < Math.min(0, endIndex); i++) {\n durations += playlist.targetDuration;\n }\n\n startIndex = 0;\n }\n\n for (var _i = startIndex; _i < endIndex; _i++) {\n durations += playlist.segments[_i].duration;\n }\n\n return durations;\n};\n/**\n * Determines the media index of the segment corresponding to the safe edge of the live\n * window which is the duration of the last segment plus 2 target durations from the end\n * of the playlist.\n *\n * @param {Object} playlist\n * a media playlist object\n * @return {Number}\n * The media index of the segment at the safe live point. 0 if there is no \"safe\"\n * point.\n * @function safeLiveIndex\n */\n\n\nvar safeLiveIndex = function safeLiveIndex(playlist) {\n if (!playlist.segments.length) {\n return 0;\n }\n\n var i = playlist.segments.length - 1;\n var distanceFromEnd = playlist.segments[i].duration || playlist.targetDuration;\n var safeDistance = distanceFromEnd + playlist.targetDuration * 2;\n\n while (i--) {\n distanceFromEnd += playlist.segments[i].duration;\n\n if (distanceFromEnd >= safeDistance) {\n break;\n }\n }\n\n return Math.max(0, i);\n};\n/**\n * Calculates the playlist end time\n *\n * @param {Object} playlist a media playlist object\n * @param {Number=} expired the amount of time that has\n * dropped off the front of the playlist in a live scenario\n * @param {Boolean|false} useSafeLiveEnd a boolean value indicating whether or not the\n * playlist end calculation should consider the safe live end\n * (truncate the playlist end by three segments). This is normally\n * used for calculating the end of the playlist's seekable range.\n * @returns {Number} the end time of playlist\n * @function playlistEnd\n */\n\n\nvar playlistEnd = function playlistEnd(playlist, expired, useSafeLiveEnd) {\n if (!playlist || !playlist.segments) {\n return null;\n }\n\n if (playlist.endList) {\n return duration(playlist);\n }\n\n if (expired === null) {\n return null;\n }\n\n expired = expired || 0;\n var endSequence = useSafeLiveEnd ? safeLiveIndex(playlist) : playlist.segments.length;\n return intervalDuration(playlist, playlist.mediaSequence + endSequence, expired);\n};\n/**\n * Calculates the interval of time that is currently seekable in a\n * playlist. The returned time ranges are relative to the earliest\n * moment in the specified playlist that is still available. A full\n * seekable implementation for live streams would need to offset\n * these values by the duration of content that has expired from the\n * stream.\n *\n * @param {Object} playlist a media playlist object\n * dropped off the front of the playlist in a live scenario\n * @param {Number=} expired the amount of time that has\n * dropped off the front of the playlist in a live scenario\n * @return {TimeRanges} the periods of time that are valid targets\n * for seeking\n */\n\n\nvar seekable = function seekable(playlist, expired) {\n var useSafeLiveEnd = true;\n var seekableStart = expired || 0;\n var seekableEnd = playlistEnd(playlist, expired, useSafeLiveEnd);\n\n if (seekableEnd === null) {\n return createTimeRange();\n }\n\n return createTimeRange(seekableStart, seekableEnd);\n};\n\nvar isWholeNumber = function isWholeNumber(num) {\n return num - Math.floor(num) === 0;\n};\n\nvar roundSignificantDigit = function roundSignificantDigit(increment, num) {\n // If we have a whole number, just add 1 to it\n if (isWholeNumber(num)) {\n return num + increment * 0.1;\n }\n\n var numDecimalDigits = num.toString().split('.')[1].length;\n\n for (var i = 1; i <= numDecimalDigits; i++) {\n var scale = Math.pow(10, i);\n var temp = num * scale;\n\n if (isWholeNumber(temp) || i === numDecimalDigits) {\n return (temp + increment) / scale;\n }\n }\n};\n\nvar ceilLeastSignificantDigit = roundSignificantDigit.bind(null, 1);\nvar floorLeastSignificantDigit = roundSignificantDigit.bind(null, -1);\n/**\n * Determine the index and estimated starting time of the segment that\n * contains a specified playback position in a media playlist.\n *\n * @param {Object} playlist the media playlist to query\n * @param {Number} currentTime The number of seconds since the earliest\n * possible position to determine the containing segment for\n * @param {Number} startIndex\n * @param {Number} startTime\n * @return {Object}\n */\n\nvar getMediaInfoForTime = function getMediaInfoForTime(playlist, currentTime, startIndex, startTime) {\n var i = void 0;\n var segment = void 0;\n var numSegments = playlist.segments.length;\n var time = currentTime - startTime;\n\n if (time < 0) {\n // Walk backward from startIndex in the playlist, adding durations\n // until we find a segment that contains `time` and return it\n if (startIndex > 0) {\n for (i = startIndex - 1; i >= 0; i--) {\n segment = playlist.segments[i];\n time += floorLeastSignificantDigit(segment.duration);\n\n if (time > 0) {\n return {\n mediaIndex: i,\n startTime: startTime - sumDurations(playlist, startIndex, i)\n };\n }\n }\n } // We were unable to find a good segment within the playlist\n // so select the first segment\n\n\n return {\n mediaIndex: 0,\n startTime: currentTime\n };\n } // When startIndex is negative, we first walk forward to first segment\n // adding target durations. If we \"run out of time\" before getting to\n // the first segment, return the first segment\n\n\n if (startIndex < 0) {\n for (i = startIndex; i < 0; i++) {\n time -= playlist.targetDuration;\n\n if (time < 0) {\n return {\n mediaIndex: 0,\n startTime: currentTime\n };\n }\n }\n\n startIndex = 0;\n } // Walk forward from startIndex in the playlist, subtracting durations\n // until we find a segment that contains `time` and return it\n\n\n for (i = startIndex; i < numSegments; i++) {\n segment = playlist.segments[i];\n time -= ceilLeastSignificantDigit(segment.duration);\n\n if (time < 0) {\n return {\n mediaIndex: i,\n startTime: startTime + sumDurations(playlist, startIndex, i)\n };\n }\n } // We are out of possible candidates so load the last one...\n\n\n return {\n mediaIndex: numSegments - 1,\n startTime: currentTime\n };\n};\n/**\n * Check whether the playlist is blacklisted or not.\n *\n * @param {Object} playlist the media playlist object\n * @return {boolean} whether the playlist is blacklisted or not\n * @function isBlacklisted\n */\n\n\nvar isBlacklisted = function isBlacklisted(playlist) {\n return playlist.excludeUntil && playlist.excludeUntil > Date.now();\n};\n/**\n * Check whether the playlist is compatible with current playback configuration or has\n * been blacklisted permanently for being incompatible.\n *\n * @param {Object} playlist the media playlist object\n * @return {boolean} whether the playlist is incompatible or not\n * @function isIncompatible\n */\n\n\nvar isIncompatible = function isIncompatible(playlist) {\n return playlist.excludeUntil && playlist.excludeUntil === Infinity;\n};\n/**\n * Check whether the playlist is enabled or not.\n *\n * @param {Object} playlist the media playlist object\n * @return {boolean} whether the playlist is enabled or not\n * @function isEnabled\n */\n\n\nvar isEnabled = function isEnabled(playlist) {\n var blacklisted = isBlacklisted(playlist);\n return !playlist.disabled && !blacklisted;\n};\n/**\n * Check whether the playlist has been manually disabled through the representations api.\n *\n * @param {Object} playlist the media playlist object\n * @return {boolean} whether the playlist is disabled manually or not\n * @function isDisabled\n */\n\n\nvar isDisabled = function isDisabled(playlist) {\n return playlist.disabled;\n};\n/**\n * Returns whether the current playlist is an AES encrypted HLS stream\n *\n * @return {Boolean} true if it's an AES encrypted HLS stream\n */\n\n\nvar isAes = function isAes(media) {\n for (var i = 0; i < media.segments.length; i++) {\n if (media.segments[i].key) {\n return true;\n }\n }\n\n return false;\n};\n/**\n * Returns whether the current playlist contains fMP4\n *\n * @return {Boolean} true if the playlist contains fMP4\n */\n\n\nvar isFmp4 = function isFmp4(media) {\n for (var i = 0; i < media.segments.length; i++) {\n if (media.segments[i].map) {\n return true;\n }\n }\n\n return false;\n};\n/**\n * Checks if the playlist has a value for the specified attribute\n *\n * @param {String} attr\n * Attribute to check for\n * @param {Object} playlist\n * The media playlist object\n * @return {Boolean}\n * Whether the playlist contains a value for the attribute or not\n * @function hasAttribute\n */\n\n\nvar hasAttribute = function hasAttribute(attr, playlist) {\n return playlist.attributes && playlist.attributes[attr];\n};\n/**\n * Estimates the time required to complete a segment download from the specified playlist\n *\n * @param {Number} segmentDuration\n * Duration of requested segment\n * @param {Number} bandwidth\n * Current measured bandwidth of the player\n * @param {Object} playlist\n * The media playlist object\n * @param {Number=} bytesReceived\n * Number of bytes already received for the request. Defaults to 0\n * @return {Number|NaN}\n * The estimated time to request the segment. NaN if bandwidth information for\n * the given playlist is unavailable\n * @function estimateSegmentRequestTime\n */\n\n\nvar estimateSegmentRequestTime = function estimateSegmentRequestTime(segmentDuration, bandwidth, playlist) {\n var bytesReceived = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n\n if (!hasAttribute('BANDWIDTH', playlist)) {\n return NaN;\n }\n\n var size = segmentDuration * playlist.attributes.BANDWIDTH;\n return (size - bytesReceived * 8) / bandwidth;\n};\n/*\n * Returns whether the current playlist is the lowest rendition\n *\n * @return {Boolean} true if on lowest rendition\n */\n\n\nvar isLowestEnabledRendition = function isLowestEnabledRendition(master, media) {\n if (master.playlists.length === 1) {\n return true;\n }\n\n var currentBandwidth = media.attributes.BANDWIDTH || Number.MAX_VALUE;\n return master.playlists.filter(function (playlist) {\n if (!isEnabled(playlist)) {\n return false;\n }\n\n return (playlist.attributes.BANDWIDTH || 0) < currentBandwidth;\n }).length === 0;\n}; // exports\n\n\nvar Playlist = {\n duration: duration,\n seekable: seekable,\n safeLiveIndex: safeLiveIndex,\n getMediaInfoForTime: getMediaInfoForTime,\n isEnabled: isEnabled,\n isDisabled: isDisabled,\n isBlacklisted: isBlacklisted,\n isIncompatible: isIncompatible,\n playlistEnd: playlistEnd,\n isAes: isAes,\n isFmp4: isFmp4,\n hasAttribute: hasAttribute,\n estimateSegmentRequestTime: estimateSegmentRequestTime,\n isLowestEnabledRendition: isLowestEnabledRendition\n};\n/**\n * @file xhr.js\n */\n\nvar videojsXHR = videojs$1.xhr,\n mergeOptions$1$1 = videojs$1.mergeOptions;\n\nvar xhrFactory = function xhrFactory() {\n var xhr$$1 = function XhrFunction(options, callback) {\n // Add a default timeout for all hls requests\n options = mergeOptions$1$1({\n timeout: 45e3\n }, options); // Allow an optional user-specified function to modify the option\n // object before we construct the xhr request\n\n var beforeRequest = XhrFunction.beforeRequest || videojs$1.Hls.xhr.beforeRequest;\n\n if (beforeRequest && typeof beforeRequest === 'function') {\n var newOptions = beforeRequest(options);\n\n if (newOptions) {\n options = newOptions;\n }\n }\n\n var request = videojsXHR(options, function (error, response) {\n var reqResponse = request.response;\n\n if (!error && reqResponse) {\n request.responseTime = Date.now();\n request.roundTripTime = request.responseTime - request.requestTime;\n request.bytesReceived = reqResponse.byteLength || reqResponse.length;\n\n if (!request.bandwidth) {\n request.bandwidth = Math.floor(request.bytesReceived / request.roundTripTime * 8 * 1000);\n }\n }\n\n if (response.headers) {\n request.responseHeaders = response.headers;\n } // videojs.xhr now uses a specific code on the error\n // object to signal that a request has timed out instead\n // of setting a boolean on the request object\n\n\n if (error && error.code === 'ETIMEDOUT') {\n request.timedout = true;\n } // videojs.xhr no longer considers status codes outside of 200 and 0\n // (for file uris) to be errors, but the old XHR did, so emulate that\n // behavior. Status 206 may be used in response to byterange requests.\n\n\n if (!error && !request.aborted && response.statusCode !== 200 && response.statusCode !== 206 && response.statusCode !== 0) {\n error = new Error('XHR Failed with a response of: ' + (request && (reqResponse || request.responseText)));\n }\n\n callback(error, request);\n });\n var originalAbort = request.abort;\n\n request.abort = function () {\n request.aborted = true;\n return originalAbort.apply(request, arguments);\n };\n\n request.uri = options.uri;\n request.requestTime = Date.now();\n return request;\n };\n\n return xhr$$1;\n};\n/**\n * @file bin-utils.js\n */\n\n/**\n * convert a TimeRange to text\n *\n * @param {TimeRange} range the timerange to use for conversion\n * @param {Number} i the iterator on the range to convert\n */\n\n\nvar textRange = function textRange(range, i) {\n return range.start(i) + '-' + range.end(i);\n};\n/**\n * format a number as hex string\n *\n * @param {Number} e The number\n * @param {Number} i the iterator\n */\n\n\nvar formatHexString = function formatHexString(e, i) {\n var value = e.toString(16);\n return '00'.substring(0, 2 - value.length) + value + (i % 2 ? ' ' : '');\n};\n\nvar formatAsciiString = function formatAsciiString(e) {\n if (e >= 0x20 && e < 0x7e) {\n return String.fromCharCode(e);\n }\n\n return '.';\n};\n/**\n * Creates an object for sending to a web worker modifying properties that are TypedArrays\n * into a new object with seperated properties for the buffer, byteOffset, and byteLength.\n *\n * @param {Object} message\n * Object of properties and values to send to the web worker\n * @return {Object}\n * Modified message with TypedArray values expanded\n * @function createTransferableMessage\n */\n\n\nvar createTransferableMessage = function createTransferableMessage(message) {\n var transferable = {};\n Object.keys(message).forEach(function (key) {\n var value = message[key];\n\n if (ArrayBuffer.isView(value)) {\n transferable[key] = {\n bytes: value.buffer,\n byteOffset: value.byteOffset,\n byteLength: value.byteLength\n };\n } else {\n transferable[key] = value;\n }\n });\n return transferable;\n};\n/**\n * Returns a unique string identifier for a media initialization\n * segment.\n */\n\n\nvar initSegmentId = function initSegmentId(initSegment) {\n var byterange = initSegment.byterange || {\n length: Infinity,\n offset: 0\n };\n return [byterange.length, byterange.offset, initSegment.resolvedUri].join(',');\n};\n/**\n * utils to help dump binary data to the console\n */\n\n\nvar hexDump = function hexDump(data) {\n var bytes = Array.prototype.slice.call(data);\n var step = 16;\n var result = '';\n var hex = void 0;\n var ascii = void 0;\n\n for (var j = 0; j < bytes.length / step; j++) {\n hex = bytes.slice(j * step, j * step + step).map(formatHexString).join('');\n ascii = bytes.slice(j * step, j * step + step).map(formatAsciiString).join('');\n result += hex + ' ' + ascii + '\\n';\n }\n\n return result;\n};\n\nvar tagDump = function tagDump(_ref) {\n var bytes = _ref.bytes;\n return hexDump(bytes);\n};\n\nvar textRanges = function textRanges(ranges) {\n var result = '';\n var i = void 0;\n\n for (i = 0; i < ranges.length; i++) {\n result += textRange(ranges, i) + ' ';\n }\n\n return result;\n};\n\nvar utils =\n/*#__PURE__*/\nObject.freeze({\n createTransferableMessage: createTransferableMessage,\n initSegmentId: initSegmentId,\n hexDump: hexDump,\n tagDump: tagDump,\n textRanges: textRanges\n});\n/**\n * @file time.js\n */\n\n/**\n * Checks whether a given time is within a segment based on its start time\n * and duration. For playerTime, the requested time is in seconds, for\n * streamTime, the time is a Date object.\n *\n * @param {Date|Number} requestedTime Time to check is within a segment\n * @param {\"stream\" | \"player\"} type Whether passing in a playerTime or streamTime\n * @param {Date|Number} segmentStart The start time of the segment\n * @param {Number} duration Segment duration in seconds\n */\n\nvar timeWithinSegment = function timeWithinSegment(requestedTime, type, segmentStart, duration) {\n var endTime = void 0;\n\n if (type === 'stream') {\n endTime = new Date(duration * 1000 + segmentStart.getTime());\n var requestedTimeString = requestedTime.toISOString();\n var segmentTimeString = segmentStart.toISOString();\n var endTimeString = endTime.toISOString();\n return segmentTimeString <= requestedTimeString && requestedTimeString <= endTimeString;\n } else if (type === 'player') {\n endTime = duration + segmentStart;\n return segmentStart <= requestedTime && requestedTime <= endTime;\n }\n};\n/**\n * Finds a segment that contains the time requested. This might be an estimate or\n * an accurate match.\n *\n * @param {Date|Number} time The streamTime or playerTime to find a matching segment for\n * @param {\"stream\" | \"player\"} type Either the playerTime or streamTime\n * @param {Object} playlist A playlist object\n * @return {Object} match\n * @return {Object} match.segment The matched segment from the playlist\n * @return {Date|Number} match.estimatedStart The estimated start time of the segment\n * @return {\"accurate\" | \"estimate\"} match.type Whether the match is estimated or accurate\n */\n\n\nvar findSegmentForTime = function findSegmentForTime(time, type, playlist) {\n if (!playlist.segments || playlist.segments.length === 0) {\n return null;\n }\n\n if (type !== 'player' && type !== 'stream') {\n return null;\n }\n\n var manifestTime = 0;\n\n for (var i = 0; i < playlist.segments.length; i++) {\n var segment = playlist.segments[i];\n var estimatedEnd = manifestTime + segment.duration;\n var segmentStart = void 0;\n var estimatedStart = void 0;\n\n if (type === 'player') {\n segmentStart = segment.start;\n estimatedStart = manifestTime;\n } else {\n // we can rely on the program date time being accurate\n segmentStart = segment.dateTimeObject;\n estimatedStart = segment.dateTimeObject;\n }\n\n var timeWithinSegmentEnd = typeof segment.start !== 'undefined' && typeof segment.end !== 'undefined' && timeWithinSegment(time, type, segmentStart, segment.end - segment.start);\n var timeWithinSegmentDuration = timeWithinSegment(time, type, estimatedStart, segment.duration);\n\n if (timeWithinSegmentEnd) {\n return {\n segment: segment,\n estimatedStart: estimatedStart,\n type: 'accurate'\n };\n } else if (timeWithinSegmentDuration) {\n return {\n segment: segment,\n estimatedStart: estimatedStart,\n type: 'estimate'\n };\n }\n\n manifestTime = estimatedEnd;\n }\n\n return null;\n};\n/**\n * Finds a segment that contains the given player time(in seconds).\n *\n * @param {Number} time The player time to find a match for\n * @param {Object} playlist A playlist object to search within\n */\n\n\nvar findSegmentForPlayerTime = function findSegmentForPlayerTime(time, playlist) {\n // Assumptions:\n // - there will always be a segment.duration\n // - we can start from zero\n // - segments are in time order\n // - segment.start and segment.end only come\n // from syncController\n return findSegmentForTime(time, 'player', playlist);\n};\n/**\n * Finds a segment that contains the stream time give as an ISO-8601 string.\n *\n * @param {String} streamTime The ISO-8601 streamTime to find a match for\n * @param {Object} playlist A playlist object to search within\n */\n\n\nvar findSegmentForStreamTime = function findSegmentForStreamTime(streamTime, playlist) {\n var dateTimeObject = void 0;\n\n try {\n dateTimeObject = new Date(streamTime);\n } catch (e) {\n // TODO something here?\n return null;\n } // Assumptions:\n // - verifyProgramDateTimeTags has already been run\n // - live streams have been started\n\n\n return findSegmentForTime(dateTimeObject, 'stream', playlist);\n};\n/**\n * Gives the offset of the comparisonTimestamp from the streamTime timestamp in seconds.\n * If the offset returned is positive, the streamTime occurs before the comparisonTimestamp.\n * If the offset is negative, the streamTime occurs before the comparisonTimestamp.\n *\n * @param {String} comparisonTimeStamp An ISO-8601 timestamp to compare against\n * @param {String} streamTime The streamTime as an ISO-8601 string\n * @return {Number} offset\n */\n\n\nvar getOffsetFromTimestamp = function getOffsetFromTimestamp(comparisonTimeStamp, streamTime) {\n var segmentDateTime = void 0;\n var streamDateTime = void 0;\n\n try {\n segmentDateTime = new Date(comparisonTimeStamp);\n streamDateTime = new Date(streamTime);\n } catch (e) {// TODO handle error\n }\n\n var segmentTimeEpoch = segmentDateTime.getTime();\n var streamTimeEpoch = streamDateTime.getTime();\n return (streamTimeEpoch - segmentTimeEpoch) / 1000;\n};\n/**\n * Checks that all segments in this playlist have programDateTime tags.\n *\n * @param {Object} playlist A playlist object\n */\n\n\nvar verifyProgramDateTimeTags = function verifyProgramDateTimeTags(playlist) {\n if (!playlist.segments || playlist.segments.length === 0) {\n return false;\n }\n\n for (var i = 0; i < playlist.segments.length; i++) {\n var segment = playlist.segments[i];\n\n if (!segment.dateTimeObject) {\n return false;\n }\n }\n\n return true;\n};\n/**\n * Returns the streamTime of the media given a playlist and a playerTime.\n * The playlist must have programDateTime tags for a programDateTime tag to be returned.\n * If the segments containing the time requested have not been buffered yet, an estimate\n * may be returned to the callback.\n *\n * @param {Object} args\n * @param {Object} args.playlist A playlist object to search within\n * @param {Number} time A playerTime in seconds\n * @param {Function} callback(err, streamTime)\n * @returns {String} err.message A detailed error message\n * @returns {Object} streamTime\n * @returns {Number} streamTime.mediaSeconds The streamTime in seconds\n * @returns {String} streamTime.programDateTime The streamTime as an ISO-8601 String\n */\n\n\nvar getStreamTime = function getStreamTime(_ref) {\n var playlist = _ref.playlist,\n _ref$time = _ref.time,\n time = _ref$time === undefined ? undefined : _ref$time,\n callback = _ref.callback;\n\n if (!callback) {\n throw new Error('getStreamTime: callback must be provided');\n }\n\n if (!playlist || time === undefined) {\n return callback({\n message: 'getStreamTime: playlist and time must be provided'\n });\n }\n\n var matchedSegment = findSegmentForPlayerTime(time, playlist);\n\n if (!matchedSegment) {\n return callback({\n message: 'valid streamTime was not found'\n });\n }\n\n if (matchedSegment.type === 'estimate') {\n return callback({\n message: 'Accurate streamTime could not be determined. Please seek to e.seekTime and try again',\n seekTime: matchedSegment.estimatedStart\n });\n }\n\n var streamTime = {\n mediaSeconds: time\n };\n\n if (matchedSegment.segment.dateTimeObject) {\n // TODO this is currently the time of the beginning of the\n // segment. This still needs to be modified to be offset\n // by the time requested.\n streamTime.programDateTime = matchedSegment.segment.dateTimeObject.toISOString();\n }\n\n return callback(null, streamTime);\n};\n/**\n * Seeks in the player to a time that matches the given streamTime ISO-8601 string.\n *\n * @param {Object} args\n * @param {String} args.streamTime A streamTime to seek to as an ISO-8601 String\n * @param {Object} args.playlist A playlist to look within\n * @param {Number} args.retryCount The number of times to try for an accurate seek. Default is 2.\n * @param {Function} args.seekTo A method to perform a seek\n * @param {Boolean} args.pauseAfterSeek Whether to end in a paused state after seeking. Default is true.\n * @param {Object} args.tech The tech to seek on\n * @param {Function} args.callback(err, newTime) A callback to return the new time to\n * @returns {String} err.message A detailed error message\n * @returns {Number} newTime The exact time that was seeked to in seconds\n */\n\n\nvar seekToStreamTime = function seekToStreamTime(_ref2) {\n var streamTime = _ref2.streamTime,\n playlist = _ref2.playlist,\n _ref2$retryCount = _ref2.retryCount,\n retryCount = _ref2$retryCount === undefined ? 2 : _ref2$retryCount,\n seekTo = _ref2.seekTo,\n _ref2$pauseAfterSeek = _ref2.pauseAfterSeek,\n pauseAfterSeek = _ref2$pauseAfterSeek === undefined ? true : _ref2$pauseAfterSeek,\n tech = _ref2.tech,\n callback = _ref2.callback;\n\n if (!callback) {\n throw new Error('seekToStreamTime: callback must be provided');\n }\n\n if (typeof streamTime === 'undefined' || !playlist || !seekTo) {\n return callback({\n message: 'seekToStreamTime: streamTime, seekTo and playlist must be provided'\n });\n }\n\n if (!playlist.endList && !tech.hasStarted_) {\n return callback({\n message: 'player must be playing a live stream to start buffering'\n });\n }\n\n if (!verifyProgramDateTimeTags(playlist)) {\n return callback({\n message: 'programDateTime tags must be provided in the manifest ' + playlist.resolvedUri\n });\n }\n\n var matchedSegment = findSegmentForStreamTime(streamTime, playlist); // no match\n\n if (!matchedSegment) {\n return callback({\n message: streamTime + ' was not found in the stream'\n });\n }\n\n if (matchedSegment.type === 'estimate') {\n // we've run out of retries\n if (retryCount === 0) {\n return callback({\n message: streamTime + ' is not buffered yet. Try again'\n });\n }\n\n return seekToStreamTime({\n streamTime: streamTime,\n playlist: playlist,\n retryCount: retryCount - 1,\n seekTo: seekTo,\n pauseAfterSeek: pauseAfterSeek,\n tech: tech,\n callback: callback\n });\n }\n\n var segment = matchedSegment.segment;\n var mediaOffset = getOffsetFromTimestamp(segment.dateTimeObject, streamTime);\n var seekToTime = segment.start + mediaOffset;\n\n var seekedCallback = function seekedCallback() {\n return callback(null, tech.currentTime());\n }; // listen for seeked event\n\n\n tech.one('seeked', seekedCallback); // pause before seeking as video.js will restore this state\n\n if (pauseAfterSeek) {\n tech.pause();\n }\n\n seekTo(seekToTime);\n};\n/**\n * ranges\n *\n * Utilities for working with TimeRanges.\n *\n */\n// Fudge factor to account for TimeRanges rounding\n\n\nvar TIME_FUDGE_FACTOR = 1 / 30; // Comparisons between time values such as current time and the end of the buffered range\n// can be misleading because of precision differences or when the current media has poorly\n// aligned audio and video, which can cause values to be slightly off from what you would\n// expect. This value is what we consider to be safe to use in such comparisons to account\n// for these scenarios.\n\nvar SAFE_TIME_DELTA = TIME_FUDGE_FACTOR * 3;\n\nvar filterRanges = function filterRanges(timeRanges, predicate) {\n var results = [];\n var i = void 0;\n\n if (timeRanges && timeRanges.length) {\n // Search for ranges that match the predicate\n for (i = 0; i < timeRanges.length; i++) {\n if (predicate(timeRanges.start(i), timeRanges.end(i))) {\n results.push([timeRanges.start(i), timeRanges.end(i)]);\n }\n }\n }\n\n return videojs$1.createTimeRanges(results);\n};\n/**\n * Attempts to find the buffered TimeRange that contains the specified\n * time.\n * @param {TimeRanges} buffered - the TimeRanges object to query\n * @param {number} time - the time to filter on.\n * @returns {TimeRanges} a new TimeRanges object\n */\n\n\nvar findRange = function findRange(buffered, time) {\n return filterRanges(buffered, function (start, end) {\n return start - TIME_FUDGE_FACTOR <= time && end + TIME_FUDGE_FACTOR >= time;\n });\n};\n/**\n * Returns the TimeRanges that begin later than the specified time.\n * @param {TimeRanges} timeRanges - the TimeRanges object to query\n * @param {number} time - the time to filter on.\n * @returns {TimeRanges} a new TimeRanges object.\n */\n\n\nvar findNextRange = function findNextRange(timeRanges, time) {\n return filterRanges(timeRanges, function (start) {\n return start - TIME_FUDGE_FACTOR >= time;\n });\n};\n/**\n * Returns gaps within a list of TimeRanges\n * @param {TimeRanges} buffered - the TimeRanges object\n * @return {TimeRanges} a TimeRanges object of gaps\n */\n\n\nvar findGaps = function findGaps(buffered) {\n if (buffered.length < 2) {\n return videojs$1.createTimeRanges();\n }\n\n var ranges = [];\n\n for (var i = 1; i < buffered.length; i++) {\n var start = buffered.end(i - 1);\n var end = buffered.start(i);\n ranges.push([start, end]);\n }\n\n return videojs$1.createTimeRanges(ranges);\n};\n/**\n * Gets a human readable string for a TimeRange\n *\n * @param {TimeRange} range\n * @returns {String} a human readable string\n */\n\n\nvar printableRange = function printableRange(range) {\n var strArr = [];\n\n if (!range || !range.length) {\n return '';\n }\n\n for (var i = 0; i < range.length; i++) {\n strArr.push(range.start(i) + ' => ' + range.end(i));\n }\n\n return strArr.join(', ');\n};\n/**\n * Calculates the amount of time left in seconds until the player hits the end of the\n * buffer and causes a rebuffer\n *\n * @param {TimeRange} buffered\n * The state of the buffer\n * @param {Numnber} currentTime\n * The current time of the player\n * @param {Number} playbackRate\n * The current playback rate of the player. Defaults to 1.\n * @return {Number}\n * Time until the player has to start rebuffering in seconds.\n * @function timeUntilRebuffer\n */\n\n\nvar timeUntilRebuffer = function timeUntilRebuffer(buffered, currentTime) {\n var playbackRate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n var bufferedEnd = buffered.length ? buffered.end(buffered.length - 1) : 0;\n return (bufferedEnd - currentTime) / playbackRate;\n};\n/**\n * Converts a TimeRanges object into an array representation\n * @param {TimeRanges} timeRanges\n * @returns {Array}\n */\n\n\nvar timeRangesToArray = function timeRangesToArray(timeRanges) {\n var timeRangesList = [];\n\n for (var i = 0; i < timeRanges.length; i++) {\n timeRangesList.push({\n start: timeRanges.start(i),\n end: timeRanges.end(i)\n });\n }\n\n return timeRangesList;\n};\n/**\n * @file create-text-tracks-if-necessary.js\n */\n\n/**\n * Create text tracks on video.js if they exist on a segment.\n *\n * @param {Object} sourceBuffer the VSB or FSB\n * @param {Object} mediaSource the HTML media source\n * @param {Object} segment the segment that may contain the text track\n * @private\n */\n\n\nvar createTextTracksIfNecessary = function createTextTracksIfNecessary(sourceBuffer, mediaSource, segment) {\n var player = mediaSource.player_; // create an in-band caption track if one is present in the segment\n\n if (segment.captions && segment.captions.length) {\n if (!sourceBuffer.inbandTextTracks_) {\n sourceBuffer.inbandTextTracks_ = {};\n }\n\n for (var trackId in segment.captionStreams) {\n if (!sourceBuffer.inbandTextTracks_[trackId]) {\n player.tech_.trigger({\n type: 'usage',\n name: 'hls-608'\n });\n var track = player.textTracks().getTrackById(trackId);\n\n if (track) {\n // Resuse an existing track with a CC# id because this was\n // very likely created by videojs-contrib-hls from information\n // in the m3u8 for us to use\n sourceBuffer.inbandTextTracks_[trackId] = track;\n } else {\n // Otherwise, create a track with the default `CC#` label and\n // without a language\n sourceBuffer.inbandTextTracks_[trackId] = player.addRemoteTextTrack({\n kind: 'captions',\n id: trackId,\n label: trackId\n }, false).track;\n }\n }\n }\n }\n\n if (segment.metadata && segment.metadata.length && !sourceBuffer.metadataTrack_) {\n sourceBuffer.metadataTrack_ = player.addRemoteTextTrack({\n kind: 'metadata',\n label: 'Timed Metadata'\n }, false).track;\n sourceBuffer.metadataTrack_.inBandMetadataTrackDispatchType = segment.metadata.dispatchType;\n }\n};\n/**\n * @file remove-cues-from-track.js\n */\n\n/**\n * Remove cues from a track on video.js.\n *\n * @param {Double} start start of where we should remove the cue\n * @param {Double} end end of where the we should remove the cue\n * @param {Object} track the text track to remove the cues from\n * @private\n */\n\n\nvar removeCuesFromTrack = function removeCuesFromTrack(start, end, track) {\n var i = void 0;\n var cue = void 0;\n\n if (!track) {\n return;\n }\n\n if (!track.cues) {\n return;\n }\n\n i = track.cues.length;\n\n while (i--) {\n cue = track.cues[i]; // Remove any overlapping cue\n\n if (cue.startTime <= end && cue.endTime >= start) {\n track.removeCue(cue);\n }\n }\n};\n/**\n * @file add-text-track-data.js\n */\n\n/**\n * Define properties on a cue for backwards compatability,\n * but warn the user that the way that they are using it\n * is depricated and will be removed at a later date.\n *\n * @param {Cue} cue the cue to add the properties on\n * @private\n */\n\n\nvar deprecateOldCue = function deprecateOldCue(cue) {\n Object.defineProperties(cue.frame, {\n id: {\n get: function get() {\n videojs$1.log.warn('cue.frame.id is deprecated. Use cue.value.key instead.');\n return cue.value.key;\n }\n },\n value: {\n get: function get() {\n videojs$1.log.warn('cue.frame.value is deprecated. Use cue.value.data instead.');\n return cue.value.data;\n }\n },\n privateData: {\n get: function get() {\n videojs$1.log.warn('cue.frame.privateData is deprecated. Use cue.value.data instead.');\n return cue.value.data;\n }\n }\n });\n};\n\nvar durationOfVideo = function durationOfVideo(duration) {\n var dur = void 0;\n\n if (isNaN(duration) || Math.abs(duration) === Infinity) {\n dur = Number.MAX_VALUE;\n } else {\n dur = duration;\n }\n\n return dur;\n};\n/**\n * Add text track data to a source handler given the captions and\n * metadata from the buffer.\n *\n * @param {Object} sourceHandler the virtual source buffer\n * @param {Array} captionArray an array of caption data\n * @param {Array} metadataArray an array of meta data\n * @private\n */\n\n\nvar addTextTrackData = function addTextTrackData(sourceHandler, captionArray, metadataArray) {\n var Cue = window$1.WebKitDataCue || window$1.VTTCue;\n\n if (captionArray) {\n captionArray.forEach(function (caption) {\n var track = caption.stream;\n this.inbandTextTracks_[track].addCue(new Cue(caption.startTime + this.timestampOffset, caption.endTime + this.timestampOffset, caption.text));\n }, sourceHandler);\n }\n\n if (metadataArray) {\n var videoDuration = durationOfVideo(sourceHandler.mediaSource_.duration);\n metadataArray.forEach(function (metadata) {\n var time = metadata.cueTime + this.timestampOffset;\n metadata.frames.forEach(function (frame) {\n var cue = new Cue(time, time, frame.value || frame.url || frame.data || '');\n cue.frame = frame;\n cue.value = frame;\n deprecateOldCue(cue);\n this.metadataTrack_.addCue(cue);\n }, this);\n }, sourceHandler); // Updating the metadeta cues so that\n // the endTime of each cue is the startTime of the next cue\n // the endTime of last cue is the duration of the video\n\n if (sourceHandler.metadataTrack_ && sourceHandler.metadataTrack_.cues && sourceHandler.metadataTrack_.cues.length) {\n var cues = sourceHandler.metadataTrack_.cues;\n var cuesArray = []; // Create a copy of the TextTrackCueList...\n // ...disregarding cues with a falsey value\n\n for (var i = 0; i < cues.length; i++) {\n if (cues[i]) {\n cuesArray.push(cues[i]);\n }\n } // Group cues by their startTime value\n\n\n var cuesGroupedByStartTime = cuesArray.reduce(function (obj, cue) {\n var timeSlot = obj[cue.startTime] || [];\n timeSlot.push(cue);\n obj[cue.startTime] = timeSlot;\n return obj;\n }, {}); // Sort startTimes by ascending order\n\n var sortedStartTimes = Object.keys(cuesGroupedByStartTime).sort(function (a, b) {\n return Number(a) - Number(b);\n }); // Map each cue group's endTime to the next group's startTime\n\n sortedStartTimes.forEach(function (startTime, idx) {\n var cueGroup = cuesGroupedByStartTime[startTime];\n var nextTime = Number(sortedStartTimes[idx + 1]) || videoDuration; // Map each cue's endTime the next group's startTime\n\n cueGroup.forEach(function (cue) {\n cue.endTime = nextTime;\n });\n });\n }\n }\n};\n\nvar win = typeof window !== 'undefined' ? window : {},\n TARGET = typeof Symbol === 'undefined' ? '__target' : Symbol(),\n SCRIPT_TYPE = 'application/javascript',\n BlobBuilder = win.BlobBuilder || win.WebKitBlobBuilder || win.MozBlobBuilder || win.MSBlobBuilder,\n URL = win.URL || win.webkitURL || URL && URL.msURL,\n Worker = win.Worker;\n/**\n * Returns a wrapper around Web Worker code that is constructible.\n *\n * @function shimWorker\n *\n * @param { String } filename The name of the file\n * @param { Function } fn Function wrapping the code of the worker\n */\n\nfunction shimWorker(filename, fn) {\n return function ShimWorker(forceFallback) {\n var o = this;\n\n if (!fn) {\n return new Worker(filename);\n } else if (Worker && !forceFallback) {\n // Convert the function's inner code to a string to construct the worker\n var source = fn.toString().replace(/^function.+?{/, '').slice(0, -1),\n objURL = createSourceObject(source);\n this[TARGET] = new Worker(objURL);\n wrapTerminate(this[TARGET], objURL);\n return this[TARGET];\n } else {\n var selfShim = {\n postMessage: function postMessage(m) {\n if (o.onmessage) {\n setTimeout(function () {\n o.onmessage({\n data: m,\n target: selfShim\n });\n });\n }\n }\n };\n fn.call(selfShim);\n\n this.postMessage = function (m) {\n setTimeout(function () {\n selfShim.onmessage({\n data: m,\n target: o\n });\n });\n };\n\n this.isThisThread = true;\n }\n };\n} // Test Worker capabilities\n\n\nif (Worker) {\n var testWorker,\n objURL = createSourceObject('self.onmessage = function () {}'),\n testArray = new Uint8Array(1);\n\n try {\n testWorker = new Worker(objURL); // Native browser on some Samsung devices throws for transferables, let's detect it\n\n testWorker.postMessage(testArray, [testArray.buffer]);\n } catch (e) {\n Worker = null;\n } finally {\n URL.revokeObjectURL(objURL);\n\n if (testWorker) {\n testWorker.terminate();\n }\n }\n}\n\nfunction createSourceObject(str) {\n try {\n return URL.createObjectURL(new Blob([str], {\n type: SCRIPT_TYPE\n }));\n } catch (e) {\n var blob = new BlobBuilder();\n blob.append(str);\n return URL.createObjectURL(blob.getBlob(type));\n }\n}\n\nfunction wrapTerminate(worker, objURL) {\n if (!worker || !objURL) return;\n var term = worker.terminate;\n worker.objURL = objURL;\n\n worker.terminate = function () {\n if (worker.objURL) URL.revokeObjectURL(worker.objURL);\n term.call(worker);\n };\n}\n\nvar TransmuxWorker = new shimWorker(\"./transmuxer-worker.worker.js\", function (window, document$$1) {\n var self = this;\n\n var transmuxerWorker = function () {\n /**\n * mux.js\n *\n * Copyright (c) 2015 Brightcove\n * All rights reserved.\n *\n * Functions that generate fragmented MP4s suitable for use with Media\n * Source Extensions.\n */\n var UINT32_MAX = Math.pow(2, 32) - 1;\n var box, dinf, esds, ftyp, mdat, mfhd, minf, moof, moov, mvex, mvhd, trak, tkhd, mdia, mdhd, hdlr, sdtp, stbl, stsd, traf, trex, trun, types, MAJOR_BRAND, MINOR_VERSION, AVC1_BRAND, VIDEO_HDLR, AUDIO_HDLR, HDLR_TYPES, VMHD, SMHD, DREF, STCO, STSC, STSZ, STTS; // pre-calculate constants\n\n (function () {\n var i;\n types = {\n avc1: [],\n // codingname\n avcC: [],\n btrt: [],\n dinf: [],\n dref: [],\n esds: [],\n ftyp: [],\n hdlr: [],\n mdat: [],\n mdhd: [],\n mdia: [],\n mfhd: [],\n minf: [],\n moof: [],\n moov: [],\n mp4a: [],\n // codingname\n mvex: [],\n mvhd: [],\n sdtp: [],\n smhd: [],\n stbl: [],\n stco: [],\n stsc: [],\n stsd: [],\n stsz: [],\n stts: [],\n styp: [],\n tfdt: [],\n tfhd: [],\n traf: [],\n trak: [],\n trun: [],\n trex: [],\n tkhd: [],\n vmhd: []\n }; // In environments where Uint8Array is undefined (e.g., IE8), skip set up so that we\n // don't throw an error\n\n if (typeof Uint8Array === 'undefined') {\n return;\n }\n\n for (i in types) {\n if (types.hasOwnProperty(i)) {\n types[i] = [i.charCodeAt(0), i.charCodeAt(1), i.charCodeAt(2), i.charCodeAt(3)];\n }\n }\n\n MAJOR_BRAND = new Uint8Array(['i'.charCodeAt(0), 's'.charCodeAt(0), 'o'.charCodeAt(0), 'm'.charCodeAt(0)]);\n AVC1_BRAND = new Uint8Array(['a'.charCodeAt(0), 'v'.charCodeAt(0), 'c'.charCodeAt(0), '1'.charCodeAt(0)]);\n MINOR_VERSION = new Uint8Array([0, 0, 0, 1]);\n VIDEO_HDLR = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, // pre_defined\n 0x76, 0x69, 0x64, 0x65, // handler_type: 'vide'\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x56, 0x69, 0x64, 0x65, 0x6f, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'VideoHandler'\n ]);\n AUDIO_HDLR = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, // pre_defined\n 0x73, 0x6f, 0x75, 0x6e, // handler_type: 'soun'\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'SoundHandler'\n ]);\n HDLR_TYPES = {\n video: VIDEO_HDLR,\n audio: AUDIO_HDLR\n };\n DREF = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x01, // entry_count\n 0x00, 0x00, 0x00, 0x0c, // entry_size\n 0x75, 0x72, 0x6c, 0x20, // 'url' type\n 0x00, // version 0\n 0x00, 0x00, 0x01 // entry_flags\n ]);\n SMHD = new Uint8Array([0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, // balance, 0 means centered\n 0x00, 0x00 // reserved\n ]);\n STCO = new Uint8Array([0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00 // entry_count\n ]);\n STSC = STCO;\n STSZ = new Uint8Array([0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, // sample_size\n 0x00, 0x00, 0x00, 0x00 // sample_count\n ]);\n STTS = STCO;\n VMHD = new Uint8Array([0x00, // version\n 0x00, 0x00, 0x01, // flags\n 0x00, 0x00, // graphicsmode\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // opcolor\n ]);\n })();\n\n box = function box(type) {\n var payload = [],\n size = 0,\n i,\n result,\n view;\n\n for (i = 1; i < arguments.length; i++) {\n payload.push(arguments[i]);\n }\n\n i = payload.length; // calculate the total size we need to allocate\n\n while (i--) {\n size += payload[i].byteLength;\n }\n\n result = new Uint8Array(size + 8);\n view = new DataView(result.buffer, result.byteOffset, result.byteLength);\n view.setUint32(0, result.byteLength);\n result.set(type, 4); // copy the payload into the result\n\n for (i = 0, size = 8; i < payload.length; i++) {\n result.set(payload[i], size);\n size += payload[i].byteLength;\n }\n\n return result;\n };\n\n dinf = function dinf() {\n return box(types.dinf, box(types.dref, DREF));\n };\n\n esds = function esds(track) {\n return box(types.esds, new Uint8Array([0x00, // version\n 0x00, 0x00, 0x00, // flags\n // ES_Descriptor\n 0x03, // tag, ES_DescrTag\n 0x19, // length\n 0x00, 0x00, // ES_ID\n 0x00, // streamDependenceFlag, URL_flag, reserved, streamPriority\n // DecoderConfigDescriptor\n 0x04, // tag, DecoderConfigDescrTag\n 0x11, // length\n 0x40, // object type\n 0x15, // streamType\n 0x00, 0x06, 0x00, // bufferSizeDB\n 0x00, 0x00, 0xda, 0xc0, // maxBitrate\n 0x00, 0x00, 0xda, 0xc0, // avgBitrate\n // DecoderSpecificInfo\n 0x05, // tag, DecoderSpecificInfoTag\n 0x02, // length\n // ISO/IEC 14496-3, AudioSpecificConfig\n // for samplingFrequencyIndex see ISO/IEC 13818-7:2006, 8.1.3.2.2, Table 35\n track.audioobjecttype << 3 | track.samplingfrequencyindex >>> 1, track.samplingfrequencyindex << 7 | track.channelcount << 3, 0x06, 0x01, 0x02 // GASpecificConfig\n ]));\n };\n\n ftyp = function ftyp() {\n return box(types.ftyp, MAJOR_BRAND, MINOR_VERSION, MAJOR_BRAND, AVC1_BRAND);\n };\n\n hdlr = function hdlr(type) {\n return box(types.hdlr, HDLR_TYPES[type]);\n };\n\n mdat = function mdat(data) {\n return box(types.mdat, data);\n };\n\n mdhd = function mdhd(track) {\n var result = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x02, // creation_time\n 0x00, 0x00, 0x00, 0x03, // modification_time\n 0x00, 0x01, 0x5f, 0x90, // timescale, 90,000 \"ticks\" per second\n track.duration >>> 24 & 0xFF, track.duration >>> 16 & 0xFF, track.duration >>> 8 & 0xFF, track.duration & 0xFF, // duration\n 0x55, 0xc4, // 'und' language (undetermined)\n 0x00, 0x00]); // Use the sample rate from the track metadata, when it is\n // defined. The sample rate can be parsed out of an ADTS header, for\n // instance.\n\n if (track.samplerate) {\n result[12] = track.samplerate >>> 24 & 0xFF;\n result[13] = track.samplerate >>> 16 & 0xFF;\n result[14] = track.samplerate >>> 8 & 0xFF;\n result[15] = track.samplerate & 0xFF;\n }\n\n return box(types.mdhd, result);\n };\n\n mdia = function mdia(track) {\n return box(types.mdia, mdhd(track), hdlr(track.type), minf(track));\n };\n\n mfhd = function mfhd(sequenceNumber) {\n return box(types.mfhd, new Uint8Array([0x00, 0x00, 0x00, 0x00, // flags\n (sequenceNumber & 0xFF000000) >> 24, (sequenceNumber & 0xFF0000) >> 16, (sequenceNumber & 0xFF00) >> 8, sequenceNumber & 0xFF // sequence_number\n ]));\n };\n\n minf = function minf(track) {\n return box(types.minf, track.type === 'video' ? box(types.vmhd, VMHD) : box(types.smhd, SMHD), dinf(), stbl(track));\n };\n\n moof = function moof(sequenceNumber, tracks) {\n var trackFragments = [],\n i = tracks.length; // build traf boxes for each track fragment\n\n while (i--) {\n trackFragments[i] = traf(tracks[i]);\n }\n\n return box.apply(null, [types.moof, mfhd(sequenceNumber)].concat(trackFragments));\n };\n /**\n * Returns a movie box.\n * @param tracks {array} the tracks associated with this movie\n * @see ISO/IEC 14496-12:2012(E), section 8.2.1\n */\n\n\n moov = function moov(tracks) {\n var i = tracks.length,\n boxes = [];\n\n while (i--) {\n boxes[i] = trak(tracks[i]);\n }\n\n return box.apply(null, [types.moov, mvhd(0xffffffff)].concat(boxes).concat(mvex(tracks)));\n };\n\n mvex = function mvex(tracks) {\n var i = tracks.length,\n boxes = [];\n\n while (i--) {\n boxes[i] = trex(tracks[i]);\n }\n\n return box.apply(null, [types.mvex].concat(boxes));\n };\n\n mvhd = function mvhd(duration) {\n var bytes = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x01, // creation_time\n 0x00, 0x00, 0x00, 0x02, // modification_time\n 0x00, 0x01, 0x5f, 0x90, // timescale, 90,000 \"ticks\" per second\n (duration & 0xFF000000) >> 24, (duration & 0xFF0000) >> 16, (duration & 0xFF00) >> 8, duration & 0xFF, // duration\n 0x00, 0x01, 0x00, 0x00, // 1.0 rate\n 0x01, 0x00, // 1.0 volume\n 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // pre_defined\n 0xff, 0xff, 0xff, 0xff // next_track_ID\n ]);\n return box(types.mvhd, bytes);\n };\n\n sdtp = function sdtp(track) {\n var samples = track.samples || [],\n bytes = new Uint8Array(4 + samples.length),\n flags,\n i; // leave the full box header (4 bytes) all zero\n // write the sample table\n\n for (i = 0; i < samples.length; i++) {\n flags = samples[i].flags;\n bytes[i + 4] = flags.dependsOn << 4 | flags.isDependedOn << 2 | flags.hasRedundancy;\n }\n\n return box(types.sdtp, bytes);\n };\n\n stbl = function stbl(track) {\n return box(types.stbl, stsd(track), box(types.stts, STTS), box(types.stsc, STSC), box(types.stsz, STSZ), box(types.stco, STCO));\n };\n\n (function () {\n var videoSample, audioSample;\n\n stsd = function stsd(track) {\n return box(types.stsd, new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x01]), track.type === 'video' ? videoSample(track) : audioSample(track));\n };\n\n videoSample = function videoSample(track) {\n var sps = track.sps || [],\n pps = track.pps || [],\n sequenceParameterSets = [],\n pictureParameterSets = [],\n i; // assemble the SPSs\n\n for (i = 0; i < sps.length; i++) {\n sequenceParameterSets.push((sps[i].byteLength & 0xFF00) >>> 8);\n sequenceParameterSets.push(sps[i].byteLength & 0xFF); // sequenceParameterSetLength\n\n sequenceParameterSets = sequenceParameterSets.concat(Array.prototype.slice.call(sps[i])); // SPS\n } // assemble the PPSs\n\n\n for (i = 0; i < pps.length; i++) {\n pictureParameterSets.push((pps[i].byteLength & 0xFF00) >>> 8);\n pictureParameterSets.push(pps[i].byteLength & 0xFF);\n pictureParameterSets = pictureParameterSets.concat(Array.prototype.slice.call(pps[i]));\n }\n\n return box(types.avc1, new Uint8Array([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // data_reference_index\n 0x00, 0x00, // pre_defined\n 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // pre_defined\n (track.width & 0xff00) >> 8, track.width & 0xff, // width\n (track.height & 0xff00) >> 8, track.height & 0xff, // height\n 0x00, 0x48, 0x00, 0x00, // horizresolution\n 0x00, 0x48, 0x00, 0x00, // vertresolution\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // frame_count\n 0x13, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x6a, 0x73, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x2d, 0x68, 0x6c, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // compressorname\n 0x00, 0x18, // depth = 24\n 0x11, 0x11 // pre_defined = -1\n ]), box(types.avcC, new Uint8Array([0x01, // configurationVersion\n track.profileIdc, // AVCProfileIndication\n track.profileCompatibility, // profile_compatibility\n track.levelIdc, // AVCLevelIndication\n 0xff // lengthSizeMinusOne, hard-coded to 4 bytes\n ].concat([sps.length // numOfSequenceParameterSets\n ]).concat(sequenceParameterSets).concat([pps.length // numOfPictureParameterSets\n ]).concat(pictureParameterSets))), // \"PPS\"\n box(types.btrt, new Uint8Array([0x00, 0x1c, 0x9c, 0x80, // bufferSizeDB\n 0x00, 0x2d, 0xc6, 0xc0, // maxBitrate\n 0x00, 0x2d, 0xc6, 0xc0])) // avgBitrate\n );\n };\n\n audioSample = function audioSample(track) {\n return box(types.mp4a, new Uint8Array([// SampleEntry, ISO/IEC 14496-12\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // data_reference_index\n // AudioSampleEntry, ISO/IEC 14496-12\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n (track.channelcount & 0xff00) >> 8, track.channelcount & 0xff, // channelcount\n (track.samplesize & 0xff00) >> 8, track.samplesize & 0xff, // samplesize\n 0x00, 0x00, // pre_defined\n 0x00, 0x00, // reserved\n (track.samplerate & 0xff00) >> 8, track.samplerate & 0xff, 0x00, 0x00 // samplerate, 16.16\n // MP4AudioSampleEntry, ISO/IEC 14496-14\n ]), esds(track));\n };\n })();\n\n tkhd = function tkhd(track) {\n var result = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x07, // flags\n 0x00, 0x00, 0x00, 0x00, // creation_time\n 0x00, 0x00, 0x00, 0x00, // modification_time\n (track.id & 0xFF000000) >> 24, (track.id & 0xFF0000) >> 16, (track.id & 0xFF00) >> 8, track.id & 0xFF, // track_ID\n 0x00, 0x00, 0x00, 0x00, // reserved\n (track.duration & 0xFF000000) >> 24, (track.duration & 0xFF0000) >> 16, (track.duration & 0xFF00) >> 8, track.duration & 0xFF, // duration\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, // layer\n 0x00, 0x00, // alternate_group\n 0x01, 0x00, // non-audio track volume\n 0x00, 0x00, // reserved\n 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix\n (track.width & 0xFF00) >> 8, track.width & 0xFF, 0x00, 0x00, // width\n (track.height & 0xFF00) >> 8, track.height & 0xFF, 0x00, 0x00 // height\n ]);\n return box(types.tkhd, result);\n };\n /**\n * Generate a track fragment (traf) box. A traf box collects metadata\n * about tracks in a movie fragment (moof) box.\n */\n\n\n traf = function traf(track) {\n var trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun, sampleDependencyTable, dataOffset, upperWordBaseMediaDecodeTime, lowerWordBaseMediaDecodeTime;\n trackFragmentHeader = box(types.tfhd, new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x3a, // flags\n (track.id & 0xFF000000) >> 24, (track.id & 0xFF0000) >> 16, (track.id & 0xFF00) >> 8, track.id & 0xFF, // track_ID\n 0x00, 0x00, 0x00, 0x01, // sample_description_index\n 0x00, 0x00, 0x00, 0x00, // default_sample_duration\n 0x00, 0x00, 0x00, 0x00, // default_sample_size\n 0x00, 0x00, 0x00, 0x00 // default_sample_flags\n ]));\n upperWordBaseMediaDecodeTime = Math.floor(track.baseMediaDecodeTime / (UINT32_MAX + 1));\n lowerWordBaseMediaDecodeTime = Math.floor(track.baseMediaDecodeTime % (UINT32_MAX + 1));\n trackFragmentDecodeTime = box(types.tfdt, new Uint8Array([0x01, // version 1\n 0x00, 0x00, 0x00, // flags\n // baseMediaDecodeTime\n upperWordBaseMediaDecodeTime >>> 24 & 0xFF, upperWordBaseMediaDecodeTime >>> 16 & 0xFF, upperWordBaseMediaDecodeTime >>> 8 & 0xFF, upperWordBaseMediaDecodeTime & 0xFF, lowerWordBaseMediaDecodeTime >>> 24 & 0xFF, lowerWordBaseMediaDecodeTime >>> 16 & 0xFF, lowerWordBaseMediaDecodeTime >>> 8 & 0xFF, lowerWordBaseMediaDecodeTime & 0xFF])); // the data offset specifies the number of bytes from the start of\n // the containing moof to the first payload byte of the associated\n // mdat\n\n dataOffset = 32 + // tfhd\n 20 + // tfdt\n 8 + // traf header\n 16 + // mfhd\n 8 + // moof header\n 8; // mdat header\n // audio tracks require less metadata\n\n if (track.type === 'audio') {\n trackFragmentRun = trun(track, dataOffset);\n return box(types.traf, trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun);\n } // video tracks should contain an independent and disposable samples\n // box (sdtp)\n // generate one and adjust offsets to match\n\n\n sampleDependencyTable = sdtp(track);\n trackFragmentRun = trun(track, sampleDependencyTable.length + dataOffset);\n return box(types.traf, trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun, sampleDependencyTable);\n };\n /**\n * Generate a track box.\n * @param track {object} a track definition\n * @return {Uint8Array} the track box\n */\n\n\n trak = function trak(track) {\n track.duration = track.duration || 0xffffffff;\n return box(types.trak, tkhd(track), mdia(track));\n };\n\n trex = function trex(track) {\n var result = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n (track.id & 0xFF000000) >> 24, (track.id & 0xFF0000) >> 16, (track.id & 0xFF00) >> 8, track.id & 0xFF, // track_ID\n 0x00, 0x00, 0x00, 0x01, // default_sample_description_index\n 0x00, 0x00, 0x00, 0x00, // default_sample_duration\n 0x00, 0x00, 0x00, 0x00, // default_sample_size\n 0x00, 0x01, 0x00, 0x01 // default_sample_flags\n ]); // the last two bytes of default_sample_flags is the sample\n // degradation priority, a hint about the importance of this sample\n // relative to others. Lower the degradation priority for all sample\n // types other than video.\n\n if (track.type !== 'video') {\n result[result.length - 1] = 0x00;\n }\n\n return box(types.trex, result);\n };\n\n (function () {\n var audioTrun, videoTrun, trunHeader; // This method assumes all samples are uniform. That is, if a\n // duration is present for the first sample, it will be present for\n // all subsequent samples.\n // see ISO/IEC 14496-12:2012, Section 8.8.8.1\n\n trunHeader = function trunHeader(samples, offset) {\n var durationPresent = 0,\n sizePresent = 0,\n flagsPresent = 0,\n compositionTimeOffset = 0; // trun flag constants\n\n if (samples.length) {\n if (samples[0].duration !== undefined) {\n durationPresent = 0x1;\n }\n\n if (samples[0].size !== undefined) {\n sizePresent = 0x2;\n }\n\n if (samples[0].flags !== undefined) {\n flagsPresent = 0x4;\n }\n\n if (samples[0].compositionTimeOffset !== undefined) {\n compositionTimeOffset = 0x8;\n }\n }\n\n return [0x00, // version 0\n 0x00, durationPresent | sizePresent | flagsPresent | compositionTimeOffset, 0x01, // flags\n (samples.length & 0xFF000000) >>> 24, (samples.length & 0xFF0000) >>> 16, (samples.length & 0xFF00) >>> 8, samples.length & 0xFF, // sample_count\n (offset & 0xFF000000) >>> 24, (offset & 0xFF0000) >>> 16, (offset & 0xFF00) >>> 8, offset & 0xFF // data_offset\n ];\n };\n\n videoTrun = function videoTrun(track, offset) {\n var bytes, samples, sample, i;\n samples = track.samples || [];\n offset += 8 + 12 + 16 * samples.length;\n bytes = trunHeader(samples, offset);\n\n for (i = 0; i < samples.length; i++) {\n sample = samples[i];\n bytes = bytes.concat([(sample.duration & 0xFF000000) >>> 24, (sample.duration & 0xFF0000) >>> 16, (sample.duration & 0xFF00) >>> 8, sample.duration & 0xFF, // sample_duration\n (sample.size & 0xFF000000) >>> 24, (sample.size & 0xFF0000) >>> 16, (sample.size & 0xFF00) >>> 8, sample.size & 0xFF, // sample_size\n sample.flags.isLeading << 2 | sample.flags.dependsOn, sample.flags.isDependedOn << 6 | sample.flags.hasRedundancy << 4 | sample.flags.paddingValue << 1 | sample.flags.isNonSyncSample, sample.flags.degradationPriority & 0xF0 << 8, sample.flags.degradationPriority & 0x0F, // sample_flags\n (sample.compositionTimeOffset & 0xFF000000) >>> 24, (sample.compositionTimeOffset & 0xFF0000) >>> 16, (sample.compositionTimeOffset & 0xFF00) >>> 8, sample.compositionTimeOffset & 0xFF // sample_composition_time_offset\n ]);\n }\n\n return box(types.trun, new Uint8Array(bytes));\n };\n\n audioTrun = function audioTrun(track, offset) {\n var bytes, samples, sample, i;\n samples = track.samples || [];\n offset += 8 + 12 + 8 * samples.length;\n bytes = trunHeader(samples, offset);\n\n for (i = 0; i < samples.length; i++) {\n sample = samples[i];\n bytes = bytes.concat([(sample.duration & 0xFF000000) >>> 24, (sample.duration & 0xFF0000) >>> 16, (sample.duration & 0xFF00) >>> 8, sample.duration & 0xFF, // sample_duration\n (sample.size & 0xFF000000) >>> 24, (sample.size & 0xFF0000) >>> 16, (sample.size & 0xFF00) >>> 8, sample.size & 0xFF]); // sample_size\n }\n\n return box(types.trun, new Uint8Array(bytes));\n };\n\n trun = function trun(track, offset) {\n if (track.type === 'audio') {\n return audioTrun(track, offset);\n }\n\n return videoTrun(track, offset);\n };\n })();\n\n var mp4Generator = {\n ftyp: ftyp,\n mdat: mdat,\n moof: moof,\n moov: moov,\n initSegment: function initSegment(tracks) {\n var fileType = ftyp(),\n movie = moov(tracks),\n result;\n result = new Uint8Array(fileType.byteLength + movie.byteLength);\n result.set(fileType);\n result.set(movie, fileType.byteLength);\n return result;\n }\n };\n\n var toUnsigned = function toUnsigned(value) {\n return value >>> 0;\n };\n\n var bin = {\n toUnsigned: toUnsigned\n };\n var toUnsigned$1 = bin.toUnsigned;\n\n var _findBox, parseType, timescale, startTime, getVideoTrackIds; // Find the data for a box specified by its path\n\n\n _findBox = function findBox(data, path) {\n var results = [],\n i,\n size,\n type,\n end,\n subresults;\n\n if (!path.length) {\n // short-circuit the search for empty paths\n return null;\n }\n\n for (i = 0; i < data.byteLength;) {\n size = toUnsigned$1(data[i] << 24 | data[i + 1] << 16 | data[i + 2] << 8 | data[i + 3]);\n type = parseType(data.subarray(i + 4, i + 8));\n end = size > 1 ? i + size : data.byteLength;\n\n if (type === path[0]) {\n if (path.length === 1) {\n // this is the end of the path and we've found the box we were\n // looking for\n results.push(data.subarray(i + 8, end));\n } else {\n // recursively search for the next box along the path\n subresults = _findBox(data.subarray(i + 8, end), path.slice(1));\n\n if (subresults.length) {\n results = results.concat(subresults);\n }\n }\n }\n\n i = end;\n } // we've finished searching all of data\n\n\n return results;\n };\n /**\n * Returns the string representation of an ASCII encoded four byte buffer.\n * @param buffer {Uint8Array} a four-byte buffer to translate\n * @return {string} the corresponding string\n */\n\n\n parseType = function parseType(buffer) {\n var result = '';\n result += String.fromCharCode(buffer[0]);\n result += String.fromCharCode(buffer[1]);\n result += String.fromCharCode(buffer[2]);\n result += String.fromCharCode(buffer[3]);\n return result;\n };\n /**\n * Parses an MP4 initialization segment and extracts the timescale\n * values for any declared tracks. Timescale values indicate the\n * number of clock ticks per second to assume for time-based values\n * elsewhere in the MP4.\n *\n * To determine the start time of an MP4, you need two pieces of\n * information: the timescale unit and the earliest base media decode\n * time. Multiple timescales can be specified within an MP4 but the\n * base media decode time is always expressed in the timescale from\n * the media header box for the track:\n * ```\n * moov > trak > mdia > mdhd.timescale\n * ```\n * @param init {Uint8Array} the bytes of the init segment\n * @return {object} a hash of track ids to timescale values or null if\n * the init segment is malformed.\n */\n\n\n timescale = function timescale(init) {\n var result = {},\n traks = _findBox(init, ['moov', 'trak']); // mdhd timescale\n\n\n return traks.reduce(function (result, trak) {\n var tkhd, version, index, id, mdhd;\n tkhd = _findBox(trak, ['tkhd'])[0];\n\n if (!tkhd) {\n return null;\n }\n\n version = tkhd[0];\n index = version === 0 ? 12 : 20;\n id = toUnsigned$1(tkhd[index] << 24 | tkhd[index + 1] << 16 | tkhd[index + 2] << 8 | tkhd[index + 3]);\n mdhd = _findBox(trak, ['mdia', 'mdhd'])[0];\n\n if (!mdhd) {\n return null;\n }\n\n version = mdhd[0];\n index = version === 0 ? 12 : 20;\n result[id] = toUnsigned$1(mdhd[index] << 24 | mdhd[index + 1] << 16 | mdhd[index + 2] << 8 | mdhd[index + 3]);\n return result;\n }, result);\n };\n /**\n * Determine the base media decode start time, in seconds, for an MP4\n * fragment. If multiple fragments are specified, the earliest time is\n * returned.\n *\n * The base media decode time can be parsed from track fragment\n * metadata:\n * ```\n * moof > traf > tfdt.baseMediaDecodeTime\n * ```\n * It requires the timescale value from the mdhd to interpret.\n *\n * @param timescale {object} a hash of track ids to timescale values.\n * @return {number} the earliest base media decode start time for the\n * fragment, in seconds\n */\n\n\n startTime = function startTime(timescale, fragment) {\n var trafs, baseTimes, result; // we need info from two childrend of each track fragment box\n\n trafs = _findBox(fragment, ['moof', 'traf']); // determine the start times for each track\n\n baseTimes = [].concat.apply([], trafs.map(function (traf) {\n return _findBox(traf, ['tfhd']).map(function (tfhd) {\n var id, scale, baseTime; // get the track id from the tfhd\n\n id = toUnsigned$1(tfhd[4] << 24 | tfhd[5] << 16 | tfhd[6] << 8 | tfhd[7]); // assume a 90kHz clock if no timescale was specified\n\n scale = timescale[id] || 90e3; // get the base media decode time from the tfdt\n\n baseTime = _findBox(traf, ['tfdt']).map(function (tfdt) {\n var version, result;\n version = tfdt[0];\n result = toUnsigned$1(tfdt[4] << 24 | tfdt[5] << 16 | tfdt[6] << 8 | tfdt[7]);\n\n if (version === 1) {\n result *= Math.pow(2, 32);\n result += toUnsigned$1(tfdt[8] << 24 | tfdt[9] << 16 | tfdt[10] << 8 | tfdt[11]);\n }\n\n return result;\n })[0];\n baseTime = baseTime || Infinity; // convert base time to seconds\n\n return baseTime / scale;\n });\n })); // return the minimum\n\n result = Math.min.apply(null, baseTimes);\n return isFinite(result) ? result : 0;\n };\n /**\n * Find the trackIds of the video tracks in this source.\n * Found by parsing the Handler Reference and Track Header Boxes:\n * moov > trak > mdia > hdlr\n * moov > trak > tkhd\n *\n * @param {Uint8Array} init - The bytes of the init segment for this source\n * @return {Number[]} A list of trackIds\n *\n * @see ISO-BMFF-12/2015, Section 8.4.3\n **/\n\n\n getVideoTrackIds = function getVideoTrackIds(init) {\n var traks = _findBox(init, ['moov', 'trak']);\n\n var videoTrackIds = [];\n traks.forEach(function (trak) {\n var hdlrs = _findBox(trak, ['mdia', 'hdlr']);\n\n var tkhds = _findBox(trak, ['tkhd']);\n\n hdlrs.forEach(function (hdlr, index) {\n var handlerType = parseType(hdlr.subarray(8, 12));\n var tkhd = tkhds[index];\n var view;\n var version;\n var trackId;\n\n if (handlerType === 'vide') {\n view = new DataView(tkhd.buffer, tkhd.byteOffset, tkhd.byteLength);\n version = view.getUint8(0);\n trackId = version === 0 ? view.getUint32(12) : view.getUint32(20);\n videoTrackIds.push(trackId);\n }\n });\n });\n return videoTrackIds;\n };\n\n var probe = {\n findBox: _findBox,\n parseType: parseType,\n timescale: timescale,\n startTime: startTime,\n videoTrackIds: getVideoTrackIds\n };\n /**\n * mux.js\n *\n * Copyright (c) 2014 Brightcove\n * All rights reserved.\n *\n * A lightweight readable stream implemention that handles event dispatching.\n * Objects that inherit from streams should call init in their constructors.\n */\n\n var Stream = function Stream() {\n this.init = function () {\n var listeners = {};\n /**\n * Add a listener for a specified event type.\n * @param type {string} the event name\n * @param listener {function} the callback to be invoked when an event of\n * the specified type occurs\n */\n\n this.on = function (type, listener) {\n if (!listeners[type]) {\n listeners[type] = [];\n }\n\n listeners[type] = listeners[type].concat(listener);\n };\n /**\n * Remove a listener for a specified event type.\n * @param type {string} the event name\n * @param listener {function} a function previously registered for this\n * type of event through `on`\n */\n\n\n this.off = function (type, listener) {\n var index;\n\n if (!listeners[type]) {\n return false;\n }\n\n index = listeners[type].indexOf(listener);\n listeners[type] = listeners[type].slice();\n listeners[type].splice(index, 1);\n return index > -1;\n };\n /**\n * Trigger an event of the specified type on this stream. Any additional\n * arguments to this function are passed as parameters to event listeners.\n * @param type {string} the event name\n */\n\n\n this.trigger = function (type) {\n var callbacks, i, length, args;\n callbacks = listeners[type];\n\n if (!callbacks) {\n return;\n } // Slicing the arguments on every invocation of this method\n // can add a significant amount of overhead. Avoid the\n // intermediate object creation for the common case of a\n // single callback argument\n\n\n if (arguments.length === 2) {\n length = callbacks.length;\n\n for (i = 0; i < length; ++i) {\n callbacks[i].call(this, arguments[1]);\n }\n } else {\n args = [];\n i = arguments.length;\n\n for (i = 1; i < arguments.length; ++i) {\n args.push(arguments[i]);\n }\n\n length = callbacks.length;\n\n for (i = 0; i < length; ++i) {\n callbacks[i].apply(this, args);\n }\n }\n };\n /**\n * Destroys the stream and cleans up.\n */\n\n\n this.dispose = function () {\n listeners = {};\n };\n };\n };\n /**\n * Forwards all `data` events on this stream to the destination stream. The\n * destination stream should provide a method `push` to receive the data\n * events as they arrive.\n * @param destination {stream} the stream that will receive all `data` events\n * @param autoFlush {boolean} if false, we will not call `flush` on the destination\n * when the current stream emits a 'done' event\n * @see http://nodejs.org/api/stream.html#stream_readable_pipe_destination_options\n */\n\n\n Stream.prototype.pipe = function (destination) {\n this.on('data', function (data) {\n destination.push(data);\n });\n this.on('done', function (flushSource) {\n destination.flush(flushSource);\n });\n return destination;\n }; // Default stream functions that are expected to be overridden to perform\n // actual work. These are provided by the prototype as a sort of no-op\n // implementation so that we don't have to check for their existence in the\n // `pipe` function above.\n\n\n Stream.prototype.push = function (data) {\n this.trigger('data', data);\n };\n\n Stream.prototype.flush = function (flushSource) {\n this.trigger('done', flushSource);\n };\n\n var stream = Stream; // Convert an array of nal units into an array of frames with each frame being\n // composed of the nal units that make up that frame\n // Also keep track of cummulative data about the frame from the nal units such\n // as the frame duration, starting pts, etc.\n\n var groupNalsIntoFrames = function groupNalsIntoFrames(nalUnits) {\n var i,\n currentNal,\n currentFrame = [],\n frames = [];\n currentFrame.byteLength = 0;\n\n for (i = 0; i < nalUnits.length; i++) {\n currentNal = nalUnits[i]; // Split on 'aud'-type nal units\n\n if (currentNal.nalUnitType === 'access_unit_delimiter_rbsp') {\n // Since the very first nal unit is expected to be an AUD\n // only push to the frames array when currentFrame is not empty\n if (currentFrame.length) {\n currentFrame.duration = currentNal.dts - currentFrame.dts;\n frames.push(currentFrame);\n }\n\n currentFrame = [currentNal];\n currentFrame.byteLength = currentNal.data.byteLength;\n currentFrame.pts = currentNal.pts;\n currentFrame.dts = currentNal.dts;\n } else {\n // Specifically flag key frames for ease of use later\n if (currentNal.nalUnitType === 'slice_layer_without_partitioning_rbsp_idr') {\n currentFrame.keyFrame = true;\n }\n\n currentFrame.duration = currentNal.dts - currentFrame.dts;\n currentFrame.byteLength += currentNal.data.byteLength;\n currentFrame.push(currentNal);\n }\n } // For the last frame, use the duration of the previous frame if we\n // have nothing better to go on\n\n\n if (frames.length && (!currentFrame.duration || currentFrame.duration <= 0)) {\n currentFrame.duration = frames[frames.length - 1].duration;\n } // Push the final frame\n\n\n frames.push(currentFrame);\n return frames;\n }; // Convert an array of frames into an array of Gop with each Gop being composed\n // of the frames that make up that Gop\n // Also keep track of cummulative data about the Gop from the frames such as the\n // Gop duration, starting pts, etc.\n\n\n var groupFramesIntoGops = function groupFramesIntoGops(frames) {\n var i,\n currentFrame,\n currentGop = [],\n gops = []; // We must pre-set some of the values on the Gop since we\n // keep running totals of these values\n\n currentGop.byteLength = 0;\n currentGop.nalCount = 0;\n currentGop.duration = 0;\n currentGop.pts = frames[0].pts;\n currentGop.dts = frames[0].dts; // store some metadata about all the Gops\n\n gops.byteLength = 0;\n gops.nalCount = 0;\n gops.duration = 0;\n gops.pts = frames[0].pts;\n gops.dts = frames[0].dts;\n\n for (i = 0; i < frames.length; i++) {\n currentFrame = frames[i];\n\n if (currentFrame.keyFrame) {\n // Since the very first frame is expected to be an keyframe\n // only push to the gops array when currentGop is not empty\n if (currentGop.length) {\n gops.push(currentGop);\n gops.byteLength += currentGop.byteLength;\n gops.nalCount += currentGop.nalCount;\n gops.duration += currentGop.duration;\n }\n\n currentGop = [currentFrame];\n currentGop.nalCount = currentFrame.length;\n currentGop.byteLength = currentFrame.byteLength;\n currentGop.pts = currentFrame.pts;\n currentGop.dts = currentFrame.dts;\n currentGop.duration = currentFrame.duration;\n } else {\n currentGop.duration += currentFrame.duration;\n currentGop.nalCount += currentFrame.length;\n currentGop.byteLength += currentFrame.byteLength;\n currentGop.push(currentFrame);\n }\n }\n\n if (gops.length && currentGop.duration <= 0) {\n currentGop.duration = gops[gops.length - 1].duration;\n }\n\n gops.byteLength += currentGop.byteLength;\n gops.nalCount += currentGop.nalCount;\n gops.duration += currentGop.duration; // push the final Gop\n\n gops.push(currentGop);\n return gops;\n };\n /*\n * Search for the first keyframe in the GOPs and throw away all frames\n * until that keyframe. Then extend the duration of the pulled keyframe\n * and pull the PTS and DTS of the keyframe so that it covers the time\n * range of the frames that were disposed.\n *\n * @param {Array} gops video GOPs\n * @returns {Array} modified video GOPs\n */\n\n\n var extendFirstKeyFrame = function extendFirstKeyFrame(gops) {\n var currentGop;\n\n if (!gops[0][0].keyFrame && gops.length > 1) {\n // Remove the first GOP\n currentGop = gops.shift();\n gops.byteLength -= currentGop.byteLength;\n gops.nalCount -= currentGop.nalCount; // Extend the first frame of what is now the\n // first gop to cover the time period of the\n // frames we just removed\n\n gops[0][0].dts = currentGop.dts;\n gops[0][0].pts = currentGop.pts;\n gops[0][0].duration += currentGop.duration;\n }\n\n return gops;\n };\n /**\n * Default sample object\n * see ISO/IEC 14496-12:2012, section 8.6.4.3\n */\n\n\n var createDefaultSample = function createDefaultSample() {\n return {\n size: 0,\n flags: {\n isLeading: 0,\n dependsOn: 1,\n isDependedOn: 0,\n hasRedundancy: 0,\n degradationPriority: 0,\n isNonSyncSample: 1\n }\n };\n };\n /*\n * Collates information from a video frame into an object for eventual\n * entry into an MP4 sample table.\n *\n * @param {Object} frame the video frame\n * @param {Number} dataOffset the byte offset to position the sample\n * @return {Object} object containing sample table info for a frame\n */\n\n\n var sampleForFrame = function sampleForFrame(frame, dataOffset) {\n var sample = createDefaultSample();\n sample.dataOffset = dataOffset;\n sample.compositionTimeOffset = frame.pts - frame.dts;\n sample.duration = frame.duration;\n sample.size = 4 * frame.length; // Space for nal unit size\n\n sample.size += frame.byteLength;\n\n if (frame.keyFrame) {\n sample.flags.dependsOn = 2;\n sample.flags.isNonSyncSample = 0;\n }\n\n return sample;\n }; // generate the track's sample table from an array of gops\n\n\n var generateSampleTable = function generateSampleTable(gops, baseDataOffset) {\n var h,\n i,\n sample,\n currentGop,\n currentFrame,\n dataOffset = baseDataOffset || 0,\n samples = [];\n\n for (h = 0; h < gops.length; h++) {\n currentGop = gops[h];\n\n for (i = 0; i < currentGop.length; i++) {\n currentFrame = currentGop[i];\n sample = sampleForFrame(currentFrame, dataOffset);\n dataOffset += sample.size;\n samples.push(sample);\n }\n }\n\n return samples;\n }; // generate the track's raw mdat data from an array of gops\n\n\n var concatenateNalData = function concatenateNalData(gops) {\n var h,\n i,\n j,\n currentGop,\n currentFrame,\n currentNal,\n dataOffset = 0,\n nalsByteLength = gops.byteLength,\n numberOfNals = gops.nalCount,\n totalByteLength = nalsByteLength + 4 * numberOfNals,\n data = new Uint8Array(totalByteLength),\n view = new DataView(data.buffer); // For each Gop..\n\n for (h = 0; h < gops.length; h++) {\n currentGop = gops[h]; // For each Frame..\n\n for (i = 0; i < currentGop.length; i++) {\n currentFrame = currentGop[i]; // For each NAL..\n\n for (j = 0; j < currentFrame.length; j++) {\n currentNal = currentFrame[j];\n view.setUint32(dataOffset, currentNal.data.byteLength);\n dataOffset += 4;\n data.set(currentNal.data, dataOffset);\n dataOffset += currentNal.data.byteLength;\n }\n }\n }\n\n return data;\n };\n\n var frameUtils = {\n groupNalsIntoFrames: groupNalsIntoFrames,\n groupFramesIntoGops: groupFramesIntoGops,\n extendFirstKeyFrame: extendFirstKeyFrame,\n generateSampleTable: generateSampleTable,\n concatenateNalData: concatenateNalData\n };\n var highPrefix = [33, 16, 5, 32, 164, 27];\n var lowPrefix = [33, 65, 108, 84, 1, 2, 4, 8, 168, 2, 4, 8, 17, 191, 252];\n\n var zeroFill = function zeroFill(count) {\n var a = [];\n\n while (count--) {\n a.push(0);\n }\n\n return a;\n };\n\n var makeTable = function makeTable(metaTable) {\n return Object.keys(metaTable).reduce(function (obj, key) {\n obj[key] = new Uint8Array(metaTable[key].reduce(function (arr, part) {\n return arr.concat(part);\n }, []));\n return obj;\n }, {});\n }; // Frames-of-silence to use for filling in missing AAC frames\n\n\n var coneOfSilence = {\n 96000: [highPrefix, [227, 64], zeroFill(154), [56]],\n 88200: [highPrefix, [231], zeroFill(170), [56]],\n 64000: [highPrefix, [248, 192], zeroFill(240), [56]],\n 48000: [highPrefix, [255, 192], zeroFill(268), [55, 148, 128], zeroFill(54), [112]],\n 44100: [highPrefix, [255, 192], zeroFill(268), [55, 163, 128], zeroFill(84), [112]],\n 32000: [highPrefix, [255, 192], zeroFill(268), [55, 234], zeroFill(226), [112]],\n 24000: [highPrefix, [255, 192], zeroFill(268), [55, 255, 128], zeroFill(268), [111, 112], zeroFill(126), [224]],\n 16000: [highPrefix, [255, 192], zeroFill(268), [55, 255, 128], zeroFill(268), [111, 255], zeroFill(269), [223, 108], zeroFill(195), [1, 192]],\n 12000: [lowPrefix, zeroFill(268), [3, 127, 248], zeroFill(268), [6, 255, 240], zeroFill(268), [13, 255, 224], zeroFill(268), [27, 253, 128], zeroFill(259), [56]],\n 11025: [lowPrefix, zeroFill(268), [3, 127, 248], zeroFill(268), [6, 255, 240], zeroFill(268), [13, 255, 224], zeroFill(268), [27, 255, 192], zeroFill(268), [55, 175, 128], zeroFill(108), [112]],\n 8000: [lowPrefix, zeroFill(268), [3, 121, 16], zeroFill(47), [7]]\n };\n var silence = makeTable(coneOfSilence);\n var ONE_SECOND_IN_TS = 90000,\n // 90kHz clock\n secondsToVideoTs,\n secondsToAudioTs,\n videoTsToSeconds,\n audioTsToSeconds,\n audioTsToVideoTs,\n videoTsToAudioTs;\n\n secondsToVideoTs = function secondsToVideoTs(seconds) {\n return seconds * ONE_SECOND_IN_TS;\n };\n\n secondsToAudioTs = function secondsToAudioTs(seconds, sampleRate) {\n return seconds * sampleRate;\n };\n\n videoTsToSeconds = function videoTsToSeconds(timestamp) {\n return timestamp / ONE_SECOND_IN_TS;\n };\n\n audioTsToSeconds = function audioTsToSeconds(timestamp, sampleRate) {\n return timestamp / sampleRate;\n };\n\n audioTsToVideoTs = function audioTsToVideoTs(timestamp, sampleRate) {\n return secondsToVideoTs(audioTsToSeconds(timestamp, sampleRate));\n };\n\n videoTsToAudioTs = function videoTsToAudioTs(timestamp, sampleRate) {\n return secondsToAudioTs(videoTsToSeconds(timestamp), sampleRate);\n };\n\n var clock = {\n secondsToVideoTs: secondsToVideoTs,\n secondsToAudioTs: secondsToAudioTs,\n videoTsToSeconds: videoTsToSeconds,\n audioTsToSeconds: audioTsToSeconds,\n audioTsToVideoTs: audioTsToVideoTs,\n videoTsToAudioTs: videoTsToAudioTs\n };\n var ONE_SECOND_IN_TS$1 = 90000; // 90kHz clock\n\n /**\n * Sum the `byteLength` properties of the data in each AAC frame\n */\n\n var sumFrameByteLengths = function sumFrameByteLengths(array) {\n var i,\n currentObj,\n sum = 0; // sum the byteLength's all each nal unit in the frame\n\n for (i = 0; i < array.length; i++) {\n currentObj = array[i];\n sum += currentObj.data.byteLength;\n }\n\n return sum;\n }; // Possibly pad (prefix) the audio track with silence if appending this track\n // would lead to the introduction of a gap in the audio buffer\n\n\n var prefixWithSilence = function prefixWithSilence(track, frames, audioAppendStartTs, videoBaseMediaDecodeTime) {\n var baseMediaDecodeTimeTs,\n frameDuration = 0,\n audioGapDuration = 0,\n audioFillFrameCount = 0,\n audioFillDuration = 0,\n silentFrame,\n i;\n\n if (!frames.length) {\n return;\n }\n\n baseMediaDecodeTimeTs = clock.audioTsToVideoTs(track.baseMediaDecodeTime, track.samplerate); // determine frame clock duration based on sample rate, round up to avoid overfills\n\n frameDuration = Math.ceil(ONE_SECOND_IN_TS$1 / (track.samplerate / 1024));\n\n if (audioAppendStartTs && videoBaseMediaDecodeTime) {\n // insert the shortest possible amount (audio gap or audio to video gap)\n audioGapDuration = baseMediaDecodeTimeTs - Math.max(audioAppendStartTs, videoBaseMediaDecodeTime); // number of full frames in the audio gap\n\n audioFillFrameCount = Math.floor(audioGapDuration / frameDuration);\n audioFillDuration = audioFillFrameCount * frameDuration;\n } // don't attempt to fill gaps smaller than a single frame or larger\n // than a half second\n\n\n if (audioFillFrameCount < 1 || audioFillDuration > ONE_SECOND_IN_TS$1 / 2) {\n return;\n }\n\n silentFrame = silence[track.samplerate];\n\n if (!silentFrame) {\n // we don't have a silent frame pregenerated for the sample rate, so use a frame\n // from the content instead\n silentFrame = frames[0].data;\n }\n\n for (i = 0; i < audioFillFrameCount; i++) {\n frames.splice(i, 0, {\n data: silentFrame\n });\n }\n\n track.baseMediaDecodeTime -= Math.floor(clock.videoTsToAudioTs(audioFillDuration, track.samplerate));\n }; // If the audio segment extends before the earliest allowed dts\n // value, remove AAC frames until starts at or after the earliest\n // allowed DTS so that we don't end up with a negative baseMedia-\n // DecodeTime for the audio track\n\n\n var trimAdtsFramesByEarliestDts = function trimAdtsFramesByEarliestDts(adtsFrames, track, earliestAllowedDts) {\n if (track.minSegmentDts >= earliestAllowedDts) {\n return adtsFrames;\n } // We will need to recalculate the earliest segment Dts\n\n\n track.minSegmentDts = Infinity;\n return adtsFrames.filter(function (currentFrame) {\n // If this is an allowed frame, keep it and record it's Dts\n if (currentFrame.dts >= earliestAllowedDts) {\n track.minSegmentDts = Math.min(track.minSegmentDts, currentFrame.dts);\n track.minSegmentPts = track.minSegmentDts;\n return true;\n } // Otherwise, discard it\n\n\n return false;\n });\n }; // generate the track's raw mdat data from an array of frames\n\n\n var generateSampleTable$1 = function generateSampleTable(frames) {\n var i,\n currentFrame,\n samples = [];\n\n for (i = 0; i < frames.length; i++) {\n currentFrame = frames[i];\n samples.push({\n size: currentFrame.data.byteLength,\n duration: 1024 // For AAC audio, all samples contain 1024 samples\n\n });\n }\n\n return samples;\n }; // generate the track's sample table from an array of frames\n\n\n var concatenateFrameData = function concatenateFrameData(frames) {\n var i,\n currentFrame,\n dataOffset = 0,\n data = new Uint8Array(sumFrameByteLengths(frames));\n\n for (i = 0; i < frames.length; i++) {\n currentFrame = frames[i];\n data.set(currentFrame.data, dataOffset);\n dataOffset += currentFrame.data.byteLength;\n }\n\n return data;\n };\n\n var audioFrameUtils = {\n prefixWithSilence: prefixWithSilence,\n trimAdtsFramesByEarliestDts: trimAdtsFramesByEarliestDts,\n generateSampleTable: generateSampleTable$1,\n concatenateFrameData: concatenateFrameData\n };\n var ONE_SECOND_IN_TS$2 = 90000; // 90kHz clock\n\n /**\n * Store information about the start and end of the track and the\n * duration for each frame/sample we process in order to calculate\n * the baseMediaDecodeTime\n */\n\n var collectDtsInfo = function collectDtsInfo(track, data) {\n if (typeof data.pts === 'number') {\n if (track.timelineStartInfo.pts === undefined) {\n track.timelineStartInfo.pts = data.pts;\n }\n\n if (track.minSegmentPts === undefined) {\n track.minSegmentPts = data.pts;\n } else {\n track.minSegmentPts = Math.min(track.minSegmentPts, data.pts);\n }\n\n if (track.maxSegmentPts === undefined) {\n track.maxSegmentPts = data.pts;\n } else {\n track.maxSegmentPts = Math.max(track.maxSegmentPts, data.pts);\n }\n }\n\n if (typeof data.dts === 'number') {\n if (track.timelineStartInfo.dts === undefined) {\n track.timelineStartInfo.dts = data.dts;\n }\n\n if (track.minSegmentDts === undefined) {\n track.minSegmentDts = data.dts;\n } else {\n track.minSegmentDts = Math.min(track.minSegmentDts, data.dts);\n }\n\n if (track.maxSegmentDts === undefined) {\n track.maxSegmentDts = data.dts;\n } else {\n track.maxSegmentDts = Math.max(track.maxSegmentDts, data.dts);\n }\n }\n };\n /**\n * Clear values used to calculate the baseMediaDecodeTime between\n * tracks\n */\n\n\n var clearDtsInfo = function clearDtsInfo(track) {\n delete track.minSegmentDts;\n delete track.maxSegmentDts;\n delete track.minSegmentPts;\n delete track.maxSegmentPts;\n };\n /**\n * Calculate the track's baseMediaDecodeTime based on the earliest\n * DTS the transmuxer has ever seen and the minimum DTS for the\n * current track\n * @param track {object} track metadata configuration\n * @param keepOriginalTimestamps {boolean} If true, keep the timestamps\n * in the source; false to adjust the first segment to start at 0.\n */\n\n\n var calculateTrackBaseMediaDecodeTime = function calculateTrackBaseMediaDecodeTime(track, keepOriginalTimestamps) {\n var baseMediaDecodeTime,\n scale,\n minSegmentDts = track.minSegmentDts; // Optionally adjust the time so the first segment starts at zero.\n\n if (!keepOriginalTimestamps) {\n minSegmentDts -= track.timelineStartInfo.dts;\n } // track.timelineStartInfo.baseMediaDecodeTime is the location, in time, where\n // we want the start of the first segment to be placed\n\n\n baseMediaDecodeTime = track.timelineStartInfo.baseMediaDecodeTime; // Add to that the distance this segment is from the very first\n\n baseMediaDecodeTime += minSegmentDts; // baseMediaDecodeTime must not become negative\n\n baseMediaDecodeTime = Math.max(0, baseMediaDecodeTime);\n\n if (track.type === 'audio') {\n // Audio has a different clock equal to the sampling_rate so we need to\n // scale the PTS values into the clock rate of the track\n scale = track.samplerate / ONE_SECOND_IN_TS$2;\n baseMediaDecodeTime *= scale;\n baseMediaDecodeTime = Math.floor(baseMediaDecodeTime);\n }\n\n return baseMediaDecodeTime;\n };\n\n var trackDecodeInfo = {\n clearDtsInfo: clearDtsInfo,\n calculateTrackBaseMediaDecodeTime: calculateTrackBaseMediaDecodeTime,\n collectDtsInfo: collectDtsInfo\n };\n /**\n * mux.js\n *\n * Copyright (c) 2015 Brightcove\n * All rights reserved.\n *\n * Reads in-band caption information from a video elementary\n * stream. Captions must follow the CEA-708 standard for injection\n * into an MPEG-2 transport streams.\n * @see https://en.wikipedia.org/wiki/CEA-708\n * @see https://www.gpo.gov/fdsys/pkg/CFR-2007-title47-vol1/pdf/CFR-2007-title47-vol1-sec15-119.pdf\n */\n // Supplemental enhancement information (SEI) NAL units have a\n // payload type field to indicate how they are to be\n // interpreted. CEAS-708 caption content is always transmitted with\n // payload type 0x04.\n\n var USER_DATA_REGISTERED_ITU_T_T35 = 4,\n RBSP_TRAILING_BITS = 128;\n /**\n * Parse a supplemental enhancement information (SEI) NAL unit.\n * Stops parsing once a message of type ITU T T35 has been found.\n *\n * @param bytes {Uint8Array} the bytes of a SEI NAL unit\n * @return {object} the parsed SEI payload\n * @see Rec. ITU-T H.264, 7.3.2.3.1\n */\n\n var parseSei = function parseSei(bytes) {\n var i = 0,\n result = {\n payloadType: -1,\n payloadSize: 0\n },\n payloadType = 0,\n payloadSize = 0; // go through the sei_rbsp parsing each each individual sei_message\n\n while (i < bytes.byteLength) {\n // stop once we have hit the end of the sei_rbsp\n if (bytes[i] === RBSP_TRAILING_BITS) {\n break;\n } // Parse payload type\n\n\n while (bytes[i] === 0xFF) {\n payloadType += 255;\n i++;\n }\n\n payloadType += bytes[i++]; // Parse payload size\n\n while (bytes[i] === 0xFF) {\n payloadSize += 255;\n i++;\n }\n\n payloadSize += bytes[i++]; // this sei_message is a 608/708 caption so save it and break\n // there can only ever be one caption message in a frame's sei\n\n if (!result.payload && payloadType === USER_DATA_REGISTERED_ITU_T_T35) {\n result.payloadType = payloadType;\n result.payloadSize = payloadSize;\n result.payload = bytes.subarray(i, i + payloadSize);\n break;\n } // skip the payload and parse the next message\n\n\n i += payloadSize;\n payloadType = 0;\n payloadSize = 0;\n }\n\n return result;\n }; // see ANSI/SCTE 128-1 (2013), section 8.1\n\n\n var parseUserData = function parseUserData(sei) {\n // itu_t_t35_contry_code must be 181 (United States) for\n // captions\n if (sei.payload[0] !== 181) {\n return null;\n } // itu_t_t35_provider_code should be 49 (ATSC) for captions\n\n\n if ((sei.payload[1] << 8 | sei.payload[2]) !== 49) {\n return null;\n } // the user_identifier should be \"GA94\" to indicate ATSC1 data\n\n\n if (String.fromCharCode(sei.payload[3], sei.payload[4], sei.payload[5], sei.payload[6]) !== 'GA94') {\n return null;\n } // finally, user_data_type_code should be 0x03 for caption data\n\n\n if (sei.payload[7] !== 0x03) {\n return null;\n } // return the user_data_type_structure and strip the trailing\n // marker bits\n\n\n return sei.payload.subarray(8, sei.payload.length - 1);\n }; // see CEA-708-D, section 4.4\n\n\n var parseCaptionPackets = function parseCaptionPackets(pts, userData) {\n var results = [],\n i,\n count,\n offset,\n data; // if this is just filler, return immediately\n\n if (!(userData[0] & 0x40)) {\n return results;\n } // parse out the cc_data_1 and cc_data_2 fields\n\n\n count = userData[0] & 0x1f;\n\n for (i = 0; i < count; i++) {\n offset = i * 3;\n data = {\n type: userData[offset + 2] & 0x03,\n pts: pts\n }; // capture cc data when cc_valid is 1\n\n if (userData[offset + 2] & 0x04) {\n data.ccData = userData[offset + 3] << 8 | userData[offset + 4];\n results.push(data);\n }\n }\n\n return results;\n };\n\n var discardEmulationPreventionBytes = function discardEmulationPreventionBytes(data) {\n var length = data.byteLength,\n emulationPreventionBytesPositions = [],\n i = 1,\n newLength,\n newData; // Find all `Emulation Prevention Bytes`\n\n while (i < length - 2) {\n if (data[i] === 0 && data[i + 1] === 0 && data[i + 2] === 0x03) {\n emulationPreventionBytesPositions.push(i + 2);\n i += 2;\n } else {\n i++;\n }\n } // If no Emulation Prevention Bytes were found just return the original\n // array\n\n\n if (emulationPreventionBytesPositions.length === 0) {\n return data;\n } // Create a new array to hold the NAL unit data\n\n\n newLength = length - emulationPreventionBytesPositions.length;\n newData = new Uint8Array(newLength);\n var sourceIndex = 0;\n\n for (i = 0; i < newLength; sourceIndex++, i++) {\n if (sourceIndex === emulationPreventionBytesPositions[0]) {\n // Skip this byte\n sourceIndex++; // Remove this position index\n\n emulationPreventionBytesPositions.shift();\n }\n\n newData[i] = data[sourceIndex];\n }\n\n return newData;\n }; // exports\n\n\n var captionPacketParser = {\n parseSei: parseSei,\n parseUserData: parseUserData,\n parseCaptionPackets: parseCaptionPackets,\n discardEmulationPreventionBytes: discardEmulationPreventionBytes,\n USER_DATA_REGISTERED_ITU_T_T35: USER_DATA_REGISTERED_ITU_T_T35\n }; // -----------------\n // Link To Transport\n // -----------------\n\n var CaptionStream = function CaptionStream() {\n CaptionStream.prototype.init.call(this);\n this.captionPackets_ = [];\n this.ccStreams_ = [new Cea608Stream(0, 0), // eslint-disable-line no-use-before-define\n new Cea608Stream(0, 1), // eslint-disable-line no-use-before-define\n new Cea608Stream(1, 0), // eslint-disable-line no-use-before-define\n new Cea608Stream(1, 1) // eslint-disable-line no-use-before-define\n ];\n this.reset(); // forward data and done events from CCs to this CaptionStream\n\n this.ccStreams_.forEach(function (cc) {\n cc.on('data', this.trigger.bind(this, 'data'));\n cc.on('done', this.trigger.bind(this, 'done'));\n }, this);\n };\n\n CaptionStream.prototype = new stream();\n\n CaptionStream.prototype.push = function (event) {\n var sei, userData, newCaptionPackets; // only examine SEI NALs\n\n if (event.nalUnitType !== 'sei_rbsp') {\n return;\n } // parse the sei\n\n\n sei = captionPacketParser.parseSei(event.escapedRBSP); // ignore everything but user_data_registered_itu_t_t35\n\n if (sei.payloadType !== captionPacketParser.USER_DATA_REGISTERED_ITU_T_T35) {\n return;\n } // parse out the user data payload\n\n\n userData = captionPacketParser.parseUserData(sei); // ignore unrecognized userData\n\n if (!userData) {\n return;\n } // Sometimes, the same segment # will be downloaded twice. To stop the\n // caption data from being processed twice, we track the latest dts we've\n // received and ignore everything with a dts before that. However, since\n // data for a specific dts can be split across packets on either side of\n // a segment boundary, we need to make sure we *don't* ignore the packets\n // from the *next* segment that have dts === this.latestDts_. By constantly\n // tracking the number of packets received with dts === this.latestDts_, we\n // know how many should be ignored once we start receiving duplicates.\n\n\n if (event.dts < this.latestDts_) {\n // We've started getting older data, so set the flag.\n this.ignoreNextEqualDts_ = true;\n return;\n } else if (event.dts === this.latestDts_ && this.ignoreNextEqualDts_) {\n this.numSameDts_--;\n\n if (!this.numSameDts_) {\n // We've received the last duplicate packet, time to start processing again\n this.ignoreNextEqualDts_ = false;\n }\n\n return;\n } // parse out CC data packets and save them for later\n\n\n newCaptionPackets = captionPacketParser.parseCaptionPackets(event.pts, userData);\n this.captionPackets_ = this.captionPackets_.concat(newCaptionPackets);\n\n if (this.latestDts_ !== event.dts) {\n this.numSameDts_ = 0;\n }\n\n this.numSameDts_++;\n this.latestDts_ = event.dts;\n };\n\n CaptionStream.prototype.flush = function () {\n // make sure we actually parsed captions before proceeding\n if (!this.captionPackets_.length) {\n this.ccStreams_.forEach(function (cc) {\n cc.flush();\n }, this);\n return;\n } // In Chrome, the Array#sort function is not stable so add a\n // presortIndex that we can use to ensure we get a stable-sort\n\n\n this.captionPackets_.forEach(function (elem, idx) {\n elem.presortIndex = idx;\n }); // sort caption byte-pairs based on their PTS values\n\n this.captionPackets_.sort(function (a, b) {\n if (a.pts === b.pts) {\n return a.presortIndex - b.presortIndex;\n }\n\n return a.pts - b.pts;\n });\n this.captionPackets_.forEach(function (packet) {\n if (packet.type < 2) {\n // Dispatch packet to the right Cea608Stream\n this.dispatchCea608Packet(packet);\n } // this is where an 'else' would go for a dispatching packets\n // to a theoretical Cea708Stream that handles SERVICEn data\n\n }, this);\n this.captionPackets_.length = 0;\n this.ccStreams_.forEach(function (cc) {\n cc.flush();\n }, this);\n return;\n };\n\n CaptionStream.prototype.reset = function () {\n this.latestDts_ = null;\n this.ignoreNextEqualDts_ = false;\n this.numSameDts_ = 0;\n this.activeCea608Channel_ = [null, null];\n this.ccStreams_.forEach(function (ccStream) {\n ccStream.reset();\n });\n };\n\n CaptionStream.prototype.dispatchCea608Packet = function (packet) {\n // NOTE: packet.type is the CEA608 field\n if (this.setsChannel1Active(packet)) {\n this.activeCea608Channel_[packet.type] = 0;\n } else if (this.setsChannel2Active(packet)) {\n this.activeCea608Channel_[packet.type] = 1;\n }\n\n if (this.activeCea608Channel_[packet.type] === null) {\n // If we haven't received anything to set the active channel, discard the\n // data; we don't want jumbled captions\n return;\n }\n\n this.ccStreams_[(packet.type << 1) + this.activeCea608Channel_[packet.type]].push(packet);\n };\n\n CaptionStream.prototype.setsChannel1Active = function (packet) {\n return (packet.ccData & 0x7800) === 0x1000;\n };\n\n CaptionStream.prototype.setsChannel2Active = function (packet) {\n return (packet.ccData & 0x7800) === 0x1800;\n }; // ----------------------\n // Session to Application\n // ----------------------\n // This hash maps non-ASCII, special, and extended character codes to their\n // proper Unicode equivalent. The first keys that are only a single byte\n // are the non-standard ASCII characters, which simply map the CEA608 byte\n // to the standard ASCII/Unicode. The two-byte keys that follow are the CEA608\n // character codes, but have their MSB bitmasked with 0x03 so that a lookup\n // can be performed regardless of the field and data channel on which the\n // character code was received.\n\n\n var CHARACTER_TRANSLATION = {\n 0x2a: 0xe1,\n // á\n 0x5c: 0xe9,\n // é\n 0x5e: 0xed,\n // í\n 0x5f: 0xf3,\n // ó\n 0x60: 0xfa,\n // ú\n 0x7b: 0xe7,\n // ç\n 0x7c: 0xf7,\n // ÷\n 0x7d: 0xd1,\n // Ñ\n 0x7e: 0xf1,\n // ñ\n 0x7f: 0x2588,\n // █\n 0x0130: 0xae,\n // ®\n 0x0131: 0xb0,\n // °\n 0x0132: 0xbd,\n // ½\n 0x0133: 0xbf,\n // ¿\n 0x0134: 0x2122,\n // ™\n 0x0135: 0xa2,\n // ¢\n 0x0136: 0xa3,\n // £\n 0x0137: 0x266a,\n // ♪\n 0x0138: 0xe0,\n // à\n 0x0139: 0xa0,\n //\n 0x013a: 0xe8,\n // è\n 0x013b: 0xe2,\n // â\n 0x013c: 0xea,\n // ê\n 0x013d: 0xee,\n // î\n 0x013e: 0xf4,\n // ô\n 0x013f: 0xfb,\n // û\n 0x0220: 0xc1,\n // Á\n 0x0221: 0xc9,\n // É\n 0x0222: 0xd3,\n // Ó\n 0x0223: 0xda,\n // Ú\n 0x0224: 0xdc,\n // Ü\n 0x0225: 0xfc,\n // ü\n 0x0226: 0x2018,\n // ‘\n 0x0227: 0xa1,\n // ¡\n 0x0228: 0x2a,\n // *\n 0x0229: 0x27,\n // '\n 0x022a: 0x2014,\n // —\n 0x022b: 0xa9,\n // ©\n 0x022c: 0x2120,\n // ℠\n 0x022d: 0x2022,\n // •\n 0x022e: 0x201c,\n // “\n 0x022f: 0x201d,\n // ”\n 0x0230: 0xc0,\n // À\n 0x0231: 0xc2,\n // Â\n 0x0232: 0xc7,\n // Ç\n 0x0233: 0xc8,\n // È\n 0x0234: 0xca,\n // Ê\n 0x0235: 0xcb,\n // Ë\n 0x0236: 0xeb,\n // ë\n 0x0237: 0xce,\n // Î\n 0x0238: 0xcf,\n // Ï\n 0x0239: 0xef,\n // ï\n 0x023a: 0xd4,\n // Ô\n 0x023b: 0xd9,\n // Ù\n 0x023c: 0xf9,\n // ù\n 0x023d: 0xdb,\n // Û\n 0x023e: 0xab,\n // «\n 0x023f: 0xbb,\n // »\n 0x0320: 0xc3,\n // Ã\n 0x0321: 0xe3,\n // ã\n 0x0322: 0xcd,\n // Í\n 0x0323: 0xcc,\n // Ì\n 0x0324: 0xec,\n // ì\n 0x0325: 0xd2,\n // Ò\n 0x0326: 0xf2,\n // ò\n 0x0327: 0xd5,\n // Õ\n 0x0328: 0xf5,\n // õ\n 0x0329: 0x7b,\n // {\n 0x032a: 0x7d,\n // }\n 0x032b: 0x5c,\n // \\\n 0x032c: 0x5e,\n // ^\n 0x032d: 0x5f,\n // _\n 0x032e: 0x7c,\n // |\n 0x032f: 0x7e,\n // ~\n 0x0330: 0xc4,\n // Ä\n 0x0331: 0xe4,\n // ä\n 0x0332: 0xd6,\n // Ö\n 0x0333: 0xf6,\n // ö\n 0x0334: 0xdf,\n // ß\n 0x0335: 0xa5,\n // ¥\n 0x0336: 0xa4,\n // ¤\n 0x0337: 0x2502,\n // │\n 0x0338: 0xc5,\n // Å\n 0x0339: 0xe5,\n // å\n 0x033a: 0xd8,\n // Ø\n 0x033b: 0xf8,\n // ø\n 0x033c: 0x250c,\n // ┌\n 0x033d: 0x2510,\n // ┐\n 0x033e: 0x2514,\n // └\n 0x033f: 0x2518 // ┘\n\n };\n\n var getCharFromCode = function getCharFromCode(code) {\n if (code === null) {\n return '';\n }\n\n code = CHARACTER_TRANSLATION[code] || code;\n return String.fromCharCode(code);\n }; // the index of the last row in a CEA-608 display buffer\n\n\n var BOTTOM_ROW = 14; // This array is used for mapping PACs -> row #, since there's no way of\n // getting it through bit logic.\n\n var ROWS = [0x1100, 0x1120, 0x1200, 0x1220, 0x1500, 0x1520, 0x1600, 0x1620, 0x1700, 0x1720, 0x1000, 0x1300, 0x1320, 0x1400, 0x1420]; // CEA-608 captions are rendered onto a 34x15 matrix of character\n // cells. The \"bottom\" row is the last element in the outer array.\n\n var createDisplayBuffer = function createDisplayBuffer() {\n var result = [],\n i = BOTTOM_ROW + 1;\n\n while (i--) {\n result.push('');\n }\n\n return result;\n };\n\n var Cea608Stream = function Cea608Stream(field, dataChannel) {\n Cea608Stream.prototype.init.call(this);\n this.field_ = field || 0;\n this.dataChannel_ = dataChannel || 0;\n this.name_ = 'CC' + ((this.field_ << 1 | this.dataChannel_) + 1);\n this.setConstants();\n this.reset();\n\n this.push = function (packet) {\n var data, swap, char0, char1, text; // remove the parity bits\n\n data = packet.ccData & 0x7f7f; // ignore duplicate control codes; the spec demands they're sent twice\n\n if (data === this.lastControlCode_) {\n this.lastControlCode_ = null;\n return;\n } // Store control codes\n\n\n if ((data & 0xf000) === 0x1000) {\n this.lastControlCode_ = data;\n } else if (data !== this.PADDING_) {\n this.lastControlCode_ = null;\n }\n\n char0 = data >>> 8;\n char1 = data & 0xff;\n\n if (data === this.PADDING_) {\n return;\n } else if (data === this.RESUME_CAPTION_LOADING_) {\n this.mode_ = 'popOn';\n } else if (data === this.END_OF_CAPTION_) {\n // If an EOC is received while in paint-on mode, the displayed caption\n // text should be swapped to non-displayed memory as if it was a pop-on\n // caption. Because of that, we should explicitly switch back to pop-on\n // mode\n this.mode_ = 'popOn';\n this.clearFormatting(packet.pts); // if a caption was being displayed, it's gone now\n\n this.flushDisplayed(packet.pts); // flip memory\n\n swap = this.displayed_;\n this.displayed_ = this.nonDisplayed_;\n this.nonDisplayed_ = swap; // start measuring the time to display the caption\n\n this.startPts_ = packet.pts;\n } else if (data === this.ROLL_UP_2_ROWS_) {\n this.rollUpRows_ = 2;\n this.setRollUp(packet.pts);\n } else if (data === this.ROLL_UP_3_ROWS_) {\n this.rollUpRows_ = 3;\n this.setRollUp(packet.pts);\n } else if (data === this.ROLL_UP_4_ROWS_) {\n this.rollUpRows_ = 4;\n this.setRollUp(packet.pts);\n } else if (data === this.CARRIAGE_RETURN_) {\n this.clearFormatting(packet.pts);\n this.flushDisplayed(packet.pts);\n this.shiftRowsUp_();\n this.startPts_ = packet.pts;\n } else if (data === this.BACKSPACE_) {\n if (this.mode_ === 'popOn') {\n this.nonDisplayed_[this.row_] = this.nonDisplayed_[this.row_].slice(0, -1);\n } else {\n this.displayed_[this.row_] = this.displayed_[this.row_].slice(0, -1);\n }\n } else if (data === this.ERASE_DISPLAYED_MEMORY_) {\n this.flushDisplayed(packet.pts);\n this.displayed_ = createDisplayBuffer();\n } else if (data === this.ERASE_NON_DISPLAYED_MEMORY_) {\n this.nonDisplayed_ = createDisplayBuffer();\n } else if (data === this.RESUME_DIRECT_CAPTIONING_) {\n if (this.mode_ !== 'paintOn') {\n // NOTE: This should be removed when proper caption positioning is\n // implemented\n this.flushDisplayed(packet.pts);\n this.displayed_ = createDisplayBuffer();\n }\n\n this.mode_ = 'paintOn';\n this.startPts_ = packet.pts; // Append special characters to caption text\n } else if (this.isSpecialCharacter(char0, char1)) {\n // Bitmask char0 so that we can apply character transformations\n // regardless of field and data channel.\n // Then byte-shift to the left and OR with char1 so we can pass the\n // entire character code to `getCharFromCode`.\n char0 = (char0 & 0x03) << 8;\n text = getCharFromCode(char0 | char1);\n this[this.mode_](packet.pts, text);\n this.column_++; // Append extended characters to caption text\n } else if (this.isExtCharacter(char0, char1)) {\n // Extended characters always follow their \"non-extended\" equivalents.\n // IE if a \"è\" is desired, you'll always receive \"eè\"; non-compliant\n // decoders are supposed to drop the \"è\", while compliant decoders\n // backspace the \"e\" and insert \"è\".\n // Delete the previous character\n if (this.mode_ === 'popOn') {\n this.nonDisplayed_[this.row_] = this.nonDisplayed_[this.row_].slice(0, -1);\n } else {\n this.displayed_[this.row_] = this.displayed_[this.row_].slice(0, -1);\n } // Bitmask char0 so that we can apply character transformations\n // regardless of field and data channel.\n // Then byte-shift to the left and OR with char1 so we can pass the\n // entire character code to `getCharFromCode`.\n\n\n char0 = (char0 & 0x03) << 8;\n text = getCharFromCode(char0 | char1);\n this[this.mode_](packet.pts, text);\n this.column_++; // Process mid-row codes\n } else if (this.isMidRowCode(char0, char1)) {\n // Attributes are not additive, so clear all formatting\n this.clearFormatting(packet.pts); // According to the standard, mid-row codes\n // should be replaced with spaces, so add one now\n\n this[this.mode_](packet.pts, ' ');\n this.column_++;\n\n if ((char1 & 0xe) === 0xe) {\n this.addFormatting(packet.pts, ['i']);\n }\n\n if ((char1 & 0x1) === 0x1) {\n this.addFormatting(packet.pts, ['u']);\n } // Detect offset control codes and adjust cursor\n\n } else if (this.isOffsetControlCode(char0, char1)) {\n // Cursor position is set by indent PAC (see below) in 4-column\n // increments, with an additional offset code of 1-3 to reach any\n // of the 32 columns specified by CEA-608. So all we need to do\n // here is increment the column cursor by the given offset.\n this.column_ += char1 & 0x03; // Detect PACs (Preamble Address Codes)\n } else if (this.isPAC(char0, char1)) {\n // There's no logic for PAC -> row mapping, so we have to just\n // find the row code in an array and use its index :(\n var row = ROWS.indexOf(data & 0x1f20); // Configure the caption window if we're in roll-up mode\n\n if (this.mode_ === 'rollUp') {\n // This implies that the base row is incorrectly set.\n // As per the recommendation in CEA-608(Base Row Implementation), defer to the number\n // of roll-up rows set.\n if (row - this.rollUpRows_ + 1 < 0) {\n row = this.rollUpRows_ - 1;\n }\n\n this.setRollUp(packet.pts, row);\n }\n\n if (row !== this.row_) {\n // formatting is only persistent for current row\n this.clearFormatting(packet.pts);\n this.row_ = row;\n } // All PACs can apply underline, so detect and apply\n // (All odd-numbered second bytes set underline)\n\n\n if (char1 & 0x1 && this.formatting_.indexOf('u') === -1) {\n this.addFormatting(packet.pts, ['u']);\n }\n\n if ((data & 0x10) === 0x10) {\n // We've got an indent level code. Each successive even number\n // increments the column cursor by 4, so we can get the desired\n // column position by bit-shifting to the right (to get n/2)\n // and multiplying by 4.\n this.column_ = ((data & 0xe) >> 1) * 4;\n }\n\n if (this.isColorPAC(char1)) {\n // it's a color code, though we only support white, which\n // can be either normal or italicized. white italics can be\n // either 0x4e or 0x6e depending on the row, so we just\n // bitwise-and with 0xe to see if italics should be turned on\n if ((char1 & 0xe) === 0xe) {\n this.addFormatting(packet.pts, ['i']);\n }\n } // We have a normal character in char0, and possibly one in char1\n\n } else if (this.isNormalChar(char0)) {\n if (char1 === 0x00) {\n char1 = null;\n }\n\n text = getCharFromCode(char0);\n text += getCharFromCode(char1);\n this[this.mode_](packet.pts, text);\n this.column_ += text.length;\n } // finish data processing\n\n };\n };\n\n Cea608Stream.prototype = new stream(); // Trigger a cue point that captures the current state of the\n // display buffer\n\n Cea608Stream.prototype.flushDisplayed = function (pts) {\n var content = this.displayed_ // remove spaces from the start and end of the string\n .map(function (row) {\n try {\n return row.trim();\n } catch (e) {\n // Ordinarily, this shouldn't happen. However, caption\n // parsing errors should not throw exceptions and\n // break playback.\n // eslint-disable-next-line no-console\n console.error('Skipping malformed caption.');\n return '';\n }\n }) // combine all text rows to display in one cue\n .join('\\n') // and remove blank rows from the start and end, but not the middle\n .replace(/^\\n+|\\n+$/g, '');\n\n if (content.length) {\n this.trigger('data', {\n startPts: this.startPts_,\n endPts: pts,\n text: content,\n stream: this.name_\n });\n }\n };\n /**\n * Zero out the data, used for startup and on seek\n */\n\n\n Cea608Stream.prototype.reset = function () {\n this.mode_ = 'popOn'; // When in roll-up mode, the index of the last row that will\n // actually display captions. If a caption is shifted to a row\n // with a lower index than this, it is cleared from the display\n // buffer\n\n this.topRow_ = 0;\n this.startPts_ = 0;\n this.displayed_ = createDisplayBuffer();\n this.nonDisplayed_ = createDisplayBuffer();\n this.lastControlCode_ = null; // Track row and column for proper line-breaking and spacing\n\n this.column_ = 0;\n this.row_ = BOTTOM_ROW;\n this.rollUpRows_ = 2; // This variable holds currently-applied formatting\n\n this.formatting_ = [];\n };\n /**\n * Sets up control code and related constants for this instance\n */\n\n\n Cea608Stream.prototype.setConstants = function () {\n // The following attributes have these uses:\n // ext_ : char0 for mid-row codes, and the base for extended\n // chars (ext_+0, ext_+1, and ext_+2 are char0s for\n // extended codes)\n // control_: char0 for control codes, except byte-shifted to the\n // left so that we can do this.control_ | CONTROL_CODE\n // offset_: char0 for tab offset codes\n //\n // It's also worth noting that control codes, and _only_ control codes,\n // differ between field 1 and field2. Field 2 control codes are always\n // their field 1 value plus 1. That's why there's the \"| field\" on the\n // control value.\n if (this.dataChannel_ === 0) {\n this.BASE_ = 0x10;\n this.EXT_ = 0x11;\n this.CONTROL_ = (0x14 | this.field_) << 8;\n this.OFFSET_ = 0x17;\n } else if (this.dataChannel_ === 1) {\n this.BASE_ = 0x18;\n this.EXT_ = 0x19;\n this.CONTROL_ = (0x1c | this.field_) << 8;\n this.OFFSET_ = 0x1f;\n } // Constants for the LSByte command codes recognized by Cea608Stream. This\n // list is not exhaustive. For a more comprehensive listing and semantics see\n // http://www.gpo.gov/fdsys/pkg/CFR-2010-title47-vol1/pdf/CFR-2010-title47-vol1-sec15-119.pdf\n // Padding\n\n\n this.PADDING_ = 0x0000; // Pop-on Mode\n\n this.RESUME_CAPTION_LOADING_ = this.CONTROL_ | 0x20;\n this.END_OF_CAPTION_ = this.CONTROL_ | 0x2f; // Roll-up Mode\n\n this.ROLL_UP_2_ROWS_ = this.CONTROL_ | 0x25;\n this.ROLL_UP_3_ROWS_ = this.CONTROL_ | 0x26;\n this.ROLL_UP_4_ROWS_ = this.CONTROL_ | 0x27;\n this.CARRIAGE_RETURN_ = this.CONTROL_ | 0x2d; // paint-on mode\n\n this.RESUME_DIRECT_CAPTIONING_ = this.CONTROL_ | 0x29; // Erasure\n\n this.BACKSPACE_ = this.CONTROL_ | 0x21;\n this.ERASE_DISPLAYED_MEMORY_ = this.CONTROL_ | 0x2c;\n this.ERASE_NON_DISPLAYED_MEMORY_ = this.CONTROL_ | 0x2e;\n };\n /**\n * Detects if the 2-byte packet data is a special character\n *\n * Special characters have a second byte in the range 0x30 to 0x3f,\n * with the first byte being 0x11 (for data channel 1) or 0x19 (for\n * data channel 2).\n *\n * @param {Integer} char0 The first byte\n * @param {Integer} char1 The second byte\n * @return {Boolean} Whether the 2 bytes are an special character\n */\n\n\n Cea608Stream.prototype.isSpecialCharacter = function (char0, char1) {\n return char0 === this.EXT_ && char1 >= 0x30 && char1 <= 0x3f;\n };\n /**\n * Detects if the 2-byte packet data is an extended character\n *\n * Extended characters have a second byte in the range 0x20 to 0x3f,\n * with the first byte being 0x12 or 0x13 (for data channel 1) or\n * 0x1a or 0x1b (for data channel 2).\n *\n * @param {Integer} char0 The first byte\n * @param {Integer} char1 The second byte\n * @return {Boolean} Whether the 2 bytes are an extended character\n */\n\n\n Cea608Stream.prototype.isExtCharacter = function (char0, char1) {\n return (char0 === this.EXT_ + 1 || char0 === this.EXT_ + 2) && char1 >= 0x20 && char1 <= 0x3f;\n };\n /**\n * Detects if the 2-byte packet is a mid-row code\n *\n * Mid-row codes have a second byte in the range 0x20 to 0x2f, with\n * the first byte being 0x11 (for data channel 1) or 0x19 (for data\n * channel 2).\n *\n * @param {Integer} char0 The first byte\n * @param {Integer} char1 The second byte\n * @return {Boolean} Whether the 2 bytes are a mid-row code\n */\n\n\n Cea608Stream.prototype.isMidRowCode = function (char0, char1) {\n return char0 === this.EXT_ && char1 >= 0x20 && char1 <= 0x2f;\n };\n /**\n * Detects if the 2-byte packet is an offset control code\n *\n * Offset control codes have a second byte in the range 0x21 to 0x23,\n * with the first byte being 0x17 (for data channel 1) or 0x1f (for\n * data channel 2).\n *\n * @param {Integer} char0 The first byte\n * @param {Integer} char1 The second byte\n * @return {Boolean} Whether the 2 bytes are an offset control code\n */\n\n\n Cea608Stream.prototype.isOffsetControlCode = function (char0, char1) {\n return char0 === this.OFFSET_ && char1 >= 0x21 && char1 <= 0x23;\n };\n /**\n * Detects if the 2-byte packet is a Preamble Address Code\n *\n * PACs have a first byte in the range 0x10 to 0x17 (for data channel 1)\n * or 0x18 to 0x1f (for data channel 2), with the second byte in the\n * range 0x40 to 0x7f.\n *\n * @param {Integer} char0 The first byte\n * @param {Integer} char1 The second byte\n * @return {Boolean} Whether the 2 bytes are a PAC\n */\n\n\n Cea608Stream.prototype.isPAC = function (char0, char1) {\n return char0 >= this.BASE_ && char0 < this.BASE_ + 8 && char1 >= 0x40 && char1 <= 0x7f;\n };\n /**\n * Detects if a packet's second byte is in the range of a PAC color code\n *\n * PAC color codes have the second byte be in the range 0x40 to 0x4f, or\n * 0x60 to 0x6f.\n *\n * @param {Integer} char1 The second byte\n * @return {Boolean} Whether the byte is a color PAC\n */\n\n\n Cea608Stream.prototype.isColorPAC = function (char1) {\n return char1 >= 0x40 && char1 <= 0x4f || char1 >= 0x60 && char1 <= 0x7f;\n };\n /**\n * Detects if a single byte is in the range of a normal character\n *\n * Normal text bytes are in the range 0x20 to 0x7f.\n *\n * @param {Integer} char The byte\n * @return {Boolean} Whether the byte is a normal character\n */\n\n\n Cea608Stream.prototype.isNormalChar = function (char) {\n return char >= 0x20 && char <= 0x7f;\n };\n /**\n * Configures roll-up\n *\n * @param {Integer} pts Current PTS\n * @param {Integer} newBaseRow Used by PACs to slide the current window to\n * a new position\n */\n\n\n Cea608Stream.prototype.setRollUp = function (pts, newBaseRow) {\n // Reset the base row to the bottom row when switching modes\n if (this.mode_ !== 'rollUp') {\n this.row_ = BOTTOM_ROW;\n this.mode_ = 'rollUp'; // Spec says to wipe memories when switching to roll-up\n\n this.flushDisplayed(pts);\n this.nonDisplayed_ = createDisplayBuffer();\n this.displayed_ = createDisplayBuffer();\n }\n\n if (newBaseRow !== undefined && newBaseRow !== this.row_) {\n // move currently displayed captions (up or down) to the new base row\n for (var i = 0; i < this.rollUpRows_; i++) {\n this.displayed_[newBaseRow - i] = this.displayed_[this.row_ - i];\n this.displayed_[this.row_ - i] = '';\n }\n }\n\n if (newBaseRow === undefined) {\n newBaseRow = this.row_;\n }\n\n this.topRow_ = newBaseRow - this.rollUpRows_ + 1;\n }; // Adds the opening HTML tag for the passed character to the caption text,\n // and keeps track of it for later closing\n\n\n Cea608Stream.prototype.addFormatting = function (pts, format) {\n this.formatting_ = this.formatting_.concat(format);\n var text = format.reduce(function (text, format) {\n return text + '<' + format + '>';\n }, '');\n this[this.mode_](pts, text);\n }; // Adds HTML closing tags for current formatting to caption text and\n // clears remembered formatting\n\n\n Cea608Stream.prototype.clearFormatting = function (pts) {\n if (!this.formatting_.length) {\n return;\n }\n\n var text = this.formatting_.reverse().reduce(function (text, format) {\n return text + '</' + format + '>';\n }, '');\n this.formatting_ = [];\n this[this.mode_](pts, text);\n }; // Mode Implementations\n\n\n Cea608Stream.prototype.popOn = function (pts, text) {\n var baseRow = this.nonDisplayed_[this.row_]; // buffer characters\n\n baseRow += text;\n this.nonDisplayed_[this.row_] = baseRow;\n };\n\n Cea608Stream.prototype.rollUp = function (pts, text) {\n var baseRow = this.displayed_[this.row_];\n baseRow += text;\n this.displayed_[this.row_] = baseRow;\n };\n\n Cea608Stream.prototype.shiftRowsUp_ = function () {\n var i; // clear out inactive rows\n\n for (i = 0; i < this.topRow_; i++) {\n this.displayed_[i] = '';\n }\n\n for (i = this.row_ + 1; i < BOTTOM_ROW + 1; i++) {\n this.displayed_[i] = '';\n } // shift displayed rows up\n\n\n for (i = this.topRow_; i < this.row_; i++) {\n this.displayed_[i] = this.displayed_[i + 1];\n } // clear out the bottom row\n\n\n this.displayed_[this.row_] = '';\n };\n\n Cea608Stream.prototype.paintOn = function (pts, text) {\n var baseRow = this.displayed_[this.row_];\n baseRow += text;\n this.displayed_[this.row_] = baseRow;\n }; // exports\n\n\n var captionStream = {\n CaptionStream: CaptionStream,\n Cea608Stream: Cea608Stream\n };\n var streamTypes = {\n H264_STREAM_TYPE: 0x1B,\n ADTS_STREAM_TYPE: 0x0F,\n METADATA_STREAM_TYPE: 0x15\n };\n var MAX_TS = 8589934592;\n var RO_THRESH = 4294967296;\n\n var handleRollover = function handleRollover(value, reference) {\n var direction = 1;\n\n if (value > reference) {\n // If the current timestamp value is greater than our reference timestamp and we detect a\n // timestamp rollover, this means the roll over is happening in the opposite direction.\n // Example scenario: Enter a long stream/video just after a rollover occurred. The reference\n // point will be set to a small number, e.g. 1. The user then seeks backwards over the\n // rollover point. In loading this segment, the timestamp values will be very large,\n // e.g. 2^33 - 1. Since this comes before the data we loaded previously, we want to adjust\n // the time stamp to be `value - 2^33`.\n direction = -1;\n } // Note: A seek forwards or back that is greater than the RO_THRESH (2^32, ~13 hours) will\n // cause an incorrect adjustment.\n\n\n while (Math.abs(reference - value) > RO_THRESH) {\n value += direction * MAX_TS;\n }\n\n return value;\n };\n\n var TimestampRolloverStream = function TimestampRolloverStream(type) {\n var lastDTS, referenceDTS;\n TimestampRolloverStream.prototype.init.call(this);\n this.type_ = type;\n\n this.push = function (data) {\n if (data.type !== this.type_) {\n return;\n }\n\n if (referenceDTS === undefined) {\n referenceDTS = data.dts;\n }\n\n data.dts = handleRollover(data.dts, referenceDTS);\n data.pts = handleRollover(data.pts, referenceDTS);\n lastDTS = data.dts;\n this.trigger('data', data);\n };\n\n this.flush = function () {\n referenceDTS = lastDTS;\n this.trigger('done');\n };\n\n this.discontinuity = function () {\n referenceDTS = void 0;\n lastDTS = void 0;\n };\n };\n\n TimestampRolloverStream.prototype = new stream();\n var timestampRolloverStream = {\n TimestampRolloverStream: TimestampRolloverStream,\n handleRollover: handleRollover\n };\n\n var percentEncode = function percentEncode(bytes, start, end) {\n var i,\n result = '';\n\n for (i = start; i < end; i++) {\n result += '%' + ('00' + bytes[i].toString(16)).slice(-2);\n }\n\n return result;\n },\n // return the string representation of the specified byte range,\n // interpreted as UTf-8.\n parseUtf8 = function parseUtf8(bytes, start, end) {\n return decodeURIComponent(percentEncode(bytes, start, end));\n },\n // return the string representation of the specified byte range,\n // interpreted as ISO-8859-1.\n parseIso88591 = function parseIso88591(bytes, start, end) {\n return unescape(percentEncode(bytes, start, end)); // jshint ignore:line\n },\n parseSyncSafeInteger = function parseSyncSafeInteger(data) {\n return data[0] << 21 | data[1] << 14 | data[2] << 7 | data[3];\n },\n tagParsers = {\n TXXX: function TXXX(tag) {\n var i;\n\n if (tag.data[0] !== 3) {\n // ignore frames with unrecognized character encodings\n return;\n }\n\n for (i = 1; i < tag.data.length; i++) {\n if (tag.data[i] === 0) {\n // parse the text fields\n tag.description = parseUtf8(tag.data, 1, i); // do not include the null terminator in the tag value\n\n tag.value = parseUtf8(tag.data, i + 1, tag.data.length).replace(/\\0*$/, '');\n break;\n }\n }\n\n tag.data = tag.value;\n },\n WXXX: function WXXX(tag) {\n var i;\n\n if (tag.data[0] !== 3) {\n // ignore frames with unrecognized character encodings\n return;\n }\n\n for (i = 1; i < tag.data.length; i++) {\n if (tag.data[i] === 0) {\n // parse the description and URL fields\n tag.description = parseUtf8(tag.data, 1, i);\n tag.url = parseUtf8(tag.data, i + 1, tag.data.length);\n break;\n }\n }\n },\n PRIV: function PRIV(tag) {\n var i;\n\n for (i = 0; i < tag.data.length; i++) {\n if (tag.data[i] === 0) {\n // parse the description and URL fields\n tag.owner = parseIso88591(tag.data, 0, i);\n break;\n }\n }\n\n tag.privateData = tag.data.subarray(i + 1);\n tag.data = tag.privateData;\n }\n },\n _MetadataStream;\n\n _MetadataStream = function MetadataStream(options) {\n var settings = {\n debug: !!(options && options.debug),\n // the bytes of the program-level descriptor field in MP2T\n // see ISO/IEC 13818-1:2013 (E), section 2.6 \"Program and\n // program element descriptors\"\n descriptor: options && options.descriptor\n },\n // the total size in bytes of the ID3 tag being parsed\n tagSize = 0,\n // tag data that is not complete enough to be parsed\n buffer = [],\n // the total number of bytes currently in the buffer\n bufferSize = 0,\n i;\n\n _MetadataStream.prototype.init.call(this); // calculate the text track in-band metadata track dispatch type\n // https://html.spec.whatwg.org/multipage/embedded-content.html#steps-to-expose-a-media-resource-specific-text-track\n\n\n this.dispatchType = streamTypes.METADATA_STREAM_TYPE.toString(16);\n\n if (settings.descriptor) {\n for (i = 0; i < settings.descriptor.length; i++) {\n this.dispatchType += ('00' + settings.descriptor[i].toString(16)).slice(-2);\n }\n }\n\n this.push = function (chunk) {\n var tag, frameStart, frameSize, frame, i, frameHeader;\n\n if (chunk.type !== 'timed-metadata') {\n return;\n } // if data_alignment_indicator is set in the PES header,\n // we must have the start of a new ID3 tag. Assume anything\n // remaining in the buffer was malformed and throw it out\n\n\n if (chunk.dataAlignmentIndicator) {\n bufferSize = 0;\n buffer.length = 0;\n } // ignore events that don't look like ID3 data\n\n\n if (buffer.length === 0 && (chunk.data.length < 10 || chunk.data[0] !== 'I'.charCodeAt(0) || chunk.data[1] !== 'D'.charCodeAt(0) || chunk.data[2] !== '3'.charCodeAt(0))) {\n if (settings.debug) {\n // eslint-disable-next-line no-console\n console.log('Skipping unrecognized metadata packet');\n }\n\n return;\n } // add this chunk to the data we've collected so far\n\n\n buffer.push(chunk);\n bufferSize += chunk.data.byteLength; // grab the size of the entire frame from the ID3 header\n\n if (buffer.length === 1) {\n // the frame size is transmitted as a 28-bit integer in the\n // last four bytes of the ID3 header.\n // The most significant bit of each byte is dropped and the\n // results concatenated to recover the actual value.\n tagSize = parseSyncSafeInteger(chunk.data.subarray(6, 10)); // ID3 reports the tag size excluding the header but it's more\n // convenient for our comparisons to include it\n\n tagSize += 10;\n } // if the entire frame has not arrived, wait for more data\n\n\n if (bufferSize < tagSize) {\n return;\n } // collect the entire frame so it can be parsed\n\n\n tag = {\n data: new Uint8Array(tagSize),\n frames: [],\n pts: buffer[0].pts,\n dts: buffer[0].dts\n };\n\n for (i = 0; i < tagSize;) {\n tag.data.set(buffer[0].data.subarray(0, tagSize - i), i);\n i += buffer[0].data.byteLength;\n bufferSize -= buffer[0].data.byteLength;\n buffer.shift();\n } // find the start of the first frame and the end of the tag\n\n\n frameStart = 10;\n\n if (tag.data[5] & 0x40) {\n // advance the frame start past the extended header\n frameStart += 4; // header size field\n\n frameStart += parseSyncSafeInteger(tag.data.subarray(10, 14)); // clip any padding off the end\n\n tagSize -= parseSyncSafeInteger(tag.data.subarray(16, 20));\n } // parse one or more ID3 frames\n // http://id3.org/id3v2.3.0#ID3v2_frame_overview\n\n\n do {\n // determine the number of bytes in this frame\n frameSize = parseSyncSafeInteger(tag.data.subarray(frameStart + 4, frameStart + 8));\n\n if (frameSize < 1) {\n // eslint-disable-next-line no-console\n return console.log('Malformed ID3 frame encountered. Skipping metadata parsing.');\n }\n\n frameHeader = String.fromCharCode(tag.data[frameStart], tag.data[frameStart + 1], tag.data[frameStart + 2], tag.data[frameStart + 3]);\n frame = {\n id: frameHeader,\n data: tag.data.subarray(frameStart + 10, frameStart + frameSize + 10)\n };\n frame.key = frame.id;\n\n if (tagParsers[frame.id]) {\n tagParsers[frame.id](frame); // handle the special PRIV frame used to indicate the start\n // time for raw AAC data\n\n if (frame.owner === 'com.apple.streaming.transportStreamTimestamp') {\n var d = frame.data,\n size = (d[3] & 0x01) << 30 | d[4] << 22 | d[5] << 14 | d[6] << 6 | d[7] >>> 2;\n size *= 4;\n size += d[7] & 0x03;\n frame.timeStamp = size; // in raw AAC, all subsequent data will be timestamped based\n // on the value of this frame\n // we couldn't have known the appropriate pts and dts before\n // parsing this ID3 tag so set those values now\n\n if (tag.pts === undefined && tag.dts === undefined) {\n tag.pts = frame.timeStamp;\n tag.dts = frame.timeStamp;\n }\n\n this.trigger('timestamp', frame);\n }\n }\n\n tag.frames.push(frame);\n frameStart += 10; // advance past the frame header\n\n frameStart += frameSize; // advance past the frame body\n } while (frameStart < tagSize);\n\n this.trigger('data', tag);\n };\n };\n\n _MetadataStream.prototype = new stream();\n var metadataStream = _MetadataStream;\n var TimestampRolloverStream$1 = timestampRolloverStream.TimestampRolloverStream; // object types\n\n var _TransportPacketStream, _TransportParseStream, _ElementaryStream; // constants\n\n\n var MP2T_PACKET_LENGTH = 188,\n // bytes\n SYNC_BYTE = 0x47;\n /**\n * Splits an incoming stream of binary data into MPEG-2 Transport\n * Stream packets.\n */\n\n _TransportPacketStream = function TransportPacketStream() {\n var buffer = new Uint8Array(MP2T_PACKET_LENGTH),\n bytesInBuffer = 0;\n\n _TransportPacketStream.prototype.init.call(this); // Deliver new bytes to the stream.\n\n /**\n * Split a stream of data into M2TS packets\n **/\n\n\n this.push = function (bytes) {\n var startIndex = 0,\n endIndex = MP2T_PACKET_LENGTH,\n everything; // If there are bytes remaining from the last segment, prepend them to the\n // bytes that were pushed in\n\n if (bytesInBuffer) {\n everything = new Uint8Array(bytes.byteLength + bytesInBuffer);\n everything.set(buffer.subarray(0, bytesInBuffer));\n everything.set(bytes, bytesInBuffer);\n bytesInBuffer = 0;\n } else {\n everything = bytes;\n } // While we have enough data for a packet\n\n\n while (endIndex < everything.byteLength) {\n // Look for a pair of start and end sync bytes in the data..\n if (everything[startIndex] === SYNC_BYTE && everything[endIndex] === SYNC_BYTE) {\n // We found a packet so emit it and jump one whole packet forward in\n // the stream\n this.trigger('data', everything.subarray(startIndex, endIndex));\n startIndex += MP2T_PACKET_LENGTH;\n endIndex += MP2T_PACKET_LENGTH;\n continue;\n } // If we get here, we have somehow become de-synchronized and we need to step\n // forward one byte at a time until we find a pair of sync bytes that denote\n // a packet\n\n\n startIndex++;\n endIndex++;\n } // If there was some data left over at the end of the segment that couldn't\n // possibly be a whole packet, keep it because it might be the start of a packet\n // that continues in the next segment\n\n\n if (startIndex < everything.byteLength) {\n buffer.set(everything.subarray(startIndex), 0);\n bytesInBuffer = everything.byteLength - startIndex;\n }\n };\n /**\n * Passes identified M2TS packets to the TransportParseStream to be parsed\n **/\n\n\n this.flush = function () {\n // If the buffer contains a whole packet when we are being flushed, emit it\n // and empty the buffer. Otherwise hold onto the data because it may be\n // important for decoding the next segment\n if (bytesInBuffer === MP2T_PACKET_LENGTH && buffer[0] === SYNC_BYTE) {\n this.trigger('data', buffer);\n bytesInBuffer = 0;\n }\n\n this.trigger('done');\n };\n };\n\n _TransportPacketStream.prototype = new stream();\n /**\n * Accepts an MP2T TransportPacketStream and emits data events with parsed\n * forms of the individual transport stream packets.\n */\n\n _TransportParseStream = function TransportParseStream() {\n var parsePsi, parsePat, parsePmt, self;\n\n _TransportParseStream.prototype.init.call(this);\n\n self = this;\n this.packetsWaitingForPmt = [];\n this.programMapTable = undefined;\n\n parsePsi = function parsePsi(payload, psi) {\n var offset = 0; // PSI packets may be split into multiple sections and those\n // sections may be split into multiple packets. If a PSI\n // section starts in this packet, the payload_unit_start_indicator\n // will be true and the first byte of the payload will indicate\n // the offset from the current position to the start of the\n // section.\n\n if (psi.payloadUnitStartIndicator) {\n offset += payload[offset] + 1;\n }\n\n if (psi.type === 'pat') {\n parsePat(payload.subarray(offset), psi);\n } else {\n parsePmt(payload.subarray(offset), psi);\n }\n };\n\n parsePat = function parsePat(payload, pat) {\n pat.section_number = payload[7]; // eslint-disable-line camelcase\n\n pat.last_section_number = payload[8]; // eslint-disable-line camelcase\n // skip the PSI header and parse the first PMT entry\n\n self.pmtPid = (payload[10] & 0x1F) << 8 | payload[11];\n pat.pmtPid = self.pmtPid;\n };\n /**\n * Parse out the relevant fields of a Program Map Table (PMT).\n * @param payload {Uint8Array} the PMT-specific portion of an MP2T\n * packet. The first byte in this array should be the table_id\n * field.\n * @param pmt {object} the object that should be decorated with\n * fields parsed from the PMT.\n */\n\n\n parsePmt = function parsePmt(payload, pmt) {\n var sectionLength, tableEnd, programInfoLength, offset; // PMTs can be sent ahead of the time when they should actually\n // take effect. We don't believe this should ever be the case\n // for HLS but we'll ignore \"forward\" PMT declarations if we see\n // them. Future PMT declarations have the current_next_indicator\n // set to zero.\n\n if (!(payload[5] & 0x01)) {\n return;\n } // overwrite any existing program map table\n\n\n self.programMapTable = {\n video: null,\n audio: null,\n 'timed-metadata': {}\n }; // the mapping table ends at the end of the current section\n\n sectionLength = (payload[1] & 0x0f) << 8 | payload[2];\n tableEnd = 3 + sectionLength - 4; // to determine where the table is, we have to figure out how\n // long the program info descriptors are\n\n programInfoLength = (payload[10] & 0x0f) << 8 | payload[11]; // advance the offset to the first entry in the mapping table\n\n offset = 12 + programInfoLength;\n\n while (offset < tableEnd) {\n var streamType = payload[offset];\n var pid = (payload[offset + 1] & 0x1F) << 8 | payload[offset + 2]; // only map a single elementary_pid for audio and video stream types\n // TODO: should this be done for metadata too? for now maintain behavior of\n // multiple metadata streams\n\n if (streamType === streamTypes.H264_STREAM_TYPE && self.programMapTable.video === null) {\n self.programMapTable.video = pid;\n } else if (streamType === streamTypes.ADTS_STREAM_TYPE && self.programMapTable.audio === null) {\n self.programMapTable.audio = pid;\n } else if (streamType === streamTypes.METADATA_STREAM_TYPE) {\n // map pid to stream type for metadata streams\n self.programMapTable['timed-metadata'][pid] = streamType;\n } // move to the next table entry\n // skip past the elementary stream descriptors, if present\n\n\n offset += ((payload[offset + 3] & 0x0F) << 8 | payload[offset + 4]) + 5;\n } // record the map on the packet as well\n\n\n pmt.programMapTable = self.programMapTable;\n };\n /**\n * Deliver a new MP2T packet to the next stream in the pipeline.\n */\n\n\n this.push = function (packet) {\n var result = {},\n offset = 4;\n result.payloadUnitStartIndicator = !!(packet[1] & 0x40); // pid is a 13-bit field starting at the last bit of packet[1]\n\n result.pid = packet[1] & 0x1f;\n result.pid <<= 8;\n result.pid |= packet[2]; // if an adaption field is present, its length is specified by the\n // fifth byte of the TS packet header. The adaptation field is\n // used to add stuffing to PES packets that don't fill a complete\n // TS packet, and to specify some forms of timing and control data\n // that we do not currently use.\n\n if ((packet[3] & 0x30) >>> 4 > 0x01) {\n offset += packet[offset] + 1;\n } // parse the rest of the packet based on the type\n\n\n if (result.pid === 0) {\n result.type = 'pat';\n parsePsi(packet.subarray(offset), result);\n this.trigger('data', result);\n } else if (result.pid === this.pmtPid) {\n result.type = 'pmt';\n parsePsi(packet.subarray(offset), result);\n this.trigger('data', result); // if there are any packets waiting for a PMT to be found, process them now\n\n while (this.packetsWaitingForPmt.length) {\n this.processPes_.apply(this, this.packetsWaitingForPmt.shift());\n }\n } else if (this.programMapTable === undefined) {\n // When we have not seen a PMT yet, defer further processing of\n // PES packets until one has been parsed\n this.packetsWaitingForPmt.push([packet, offset, result]);\n } else {\n this.processPes_(packet, offset, result);\n }\n };\n\n this.processPes_ = function (packet, offset, result) {\n // set the appropriate stream type\n if (result.pid === this.programMapTable.video) {\n result.streamType = streamTypes.H264_STREAM_TYPE;\n } else if (result.pid === this.programMapTable.audio) {\n result.streamType = streamTypes.ADTS_STREAM_TYPE;\n } else {\n // if not video or audio, it is timed-metadata or unknown\n // if unknown, streamType will be undefined\n result.streamType = this.programMapTable['timed-metadata'][result.pid];\n }\n\n result.type = 'pes';\n result.data = packet.subarray(offset);\n this.trigger('data', result);\n };\n };\n\n _TransportParseStream.prototype = new stream();\n _TransportParseStream.STREAM_TYPES = {\n h264: 0x1b,\n adts: 0x0f\n };\n /**\n * Reconsistutes program elementary stream (PES) packets from parsed\n * transport stream packets. That is, if you pipe an\n * mp2t.TransportParseStream into a mp2t.ElementaryStream, the output\n * events will be events which capture the bytes for individual PES\n * packets plus relevant metadata that has been extracted from the\n * container.\n */\n\n _ElementaryStream = function ElementaryStream() {\n var self = this,\n // PES packet fragments\n video = {\n data: [],\n size: 0\n },\n audio = {\n data: [],\n size: 0\n },\n timedMetadata = {\n data: [],\n size: 0\n },\n parsePes = function parsePes(payload, pes) {\n var ptsDtsFlags; // get the packet length, this will be 0 for video\n\n pes.packetLength = 6 + (payload[4] << 8 | payload[5]); // find out if this packets starts a new keyframe\n\n pes.dataAlignmentIndicator = (payload[6] & 0x04) !== 0; // PES packets may be annotated with a PTS value, or a PTS value\n // and a DTS value. Determine what combination of values is\n // available to work with.\n\n ptsDtsFlags = payload[7]; // PTS and DTS are normally stored as a 33-bit number. Javascript\n // performs all bitwise operations on 32-bit integers but javascript\n // supports a much greater range (52-bits) of integer using standard\n // mathematical operations.\n // We construct a 31-bit value using bitwise operators over the 31\n // most significant bits and then multiply by 4 (equal to a left-shift\n // of 2) before we add the final 2 least significant bits of the\n // timestamp (equal to an OR.)\n\n if (ptsDtsFlags & 0xC0) {\n // the PTS and DTS are not written out directly. For information\n // on how they are encoded, see\n // http://dvd.sourceforge.net/dvdinfo/pes-hdr.html\n pes.pts = (payload[9] & 0x0E) << 27 | (payload[10] & 0xFF) << 20 | (payload[11] & 0xFE) << 12 | (payload[12] & 0xFF) << 5 | (payload[13] & 0xFE) >>> 3;\n pes.pts *= 4; // Left shift by 2\n\n pes.pts += (payload[13] & 0x06) >>> 1; // OR by the two LSBs\n\n pes.dts = pes.pts;\n\n if (ptsDtsFlags & 0x40) {\n pes.dts = (payload[14] & 0x0E) << 27 | (payload[15] & 0xFF) << 20 | (payload[16] & 0xFE) << 12 | (payload[17] & 0xFF) << 5 | (payload[18] & 0xFE) >>> 3;\n pes.dts *= 4; // Left shift by 2\n\n pes.dts += (payload[18] & 0x06) >>> 1; // OR by the two LSBs\n }\n } // the data section starts immediately after the PES header.\n // pes_header_data_length specifies the number of header bytes\n // that follow the last byte of the field.\n\n\n pes.data = payload.subarray(9 + payload[8]);\n },\n\n /**\n * Pass completely parsed PES packets to the next stream in the pipeline\n **/\n flushStream = function flushStream(stream$$1, type, forceFlush) {\n var packetData = new Uint8Array(stream$$1.size),\n event = {\n type: type\n },\n i = 0,\n offset = 0,\n packetFlushable = false,\n fragment; // do nothing if there is not enough buffered data for a complete\n // PES header\n\n if (!stream$$1.data.length || stream$$1.size < 9) {\n return;\n }\n\n event.trackId = stream$$1.data[0].pid; // reassemble the packet\n\n for (i = 0; i < stream$$1.data.length; i++) {\n fragment = stream$$1.data[i];\n packetData.set(fragment.data, offset);\n offset += fragment.data.byteLength;\n } // parse assembled packet's PES header\n\n\n parsePes(packetData, event); // non-video PES packets MUST have a non-zero PES_packet_length\n // check that there is enough stream data to fill the packet\n\n packetFlushable = type === 'video' || event.packetLength <= stream$$1.size; // flush pending packets if the conditions are right\n\n if (forceFlush || packetFlushable) {\n stream$$1.size = 0;\n stream$$1.data.length = 0;\n } // only emit packets that are complete. this is to avoid assembling\n // incomplete PES packets due to poor segmentation\n\n\n if (packetFlushable) {\n self.trigger('data', event);\n }\n };\n\n _ElementaryStream.prototype.init.call(this);\n /**\n * Identifies M2TS packet types and parses PES packets using metadata\n * parsed from the PMT\n **/\n\n\n this.push = function (data) {\n ({\n pat: function pat() {// we have to wait for the PMT to arrive as well before we\n // have any meaningful metadata\n },\n pes: function pes() {\n var stream$$1, streamType;\n\n switch (data.streamType) {\n case streamTypes.H264_STREAM_TYPE:\n case streamTypes.H264_STREAM_TYPE:\n stream$$1 = video;\n streamType = 'video';\n break;\n\n case streamTypes.ADTS_STREAM_TYPE:\n stream$$1 = audio;\n streamType = 'audio';\n break;\n\n case streamTypes.METADATA_STREAM_TYPE:\n stream$$1 = timedMetadata;\n streamType = 'timed-metadata';\n break;\n\n default:\n // ignore unknown stream types\n return;\n } // if a new packet is starting, we can flush the completed\n // packet\n\n\n if (data.payloadUnitStartIndicator) {\n flushStream(stream$$1, streamType, true);\n } // buffer this fragment until we are sure we've received the\n // complete payload\n\n\n stream$$1.data.push(data);\n stream$$1.size += data.data.byteLength;\n },\n pmt: function pmt() {\n var event = {\n type: 'metadata',\n tracks: []\n },\n programMapTable = data.programMapTable; // translate audio and video streams to tracks\n\n if (programMapTable.video !== null) {\n event.tracks.push({\n timelineStartInfo: {\n baseMediaDecodeTime: 0\n },\n id: +programMapTable.video,\n codec: 'avc',\n type: 'video'\n });\n }\n\n if (programMapTable.audio !== null) {\n event.tracks.push({\n timelineStartInfo: {\n baseMediaDecodeTime: 0\n },\n id: +programMapTable.audio,\n codec: 'adts',\n type: 'audio'\n });\n }\n\n self.trigger('data', event);\n }\n })[data.type]();\n };\n /**\n * Flush any remaining input. Video PES packets may be of variable\n * length. Normally, the start of a new video packet can trigger the\n * finalization of the previous packet. That is not possible if no\n * more video is forthcoming, however. In that case, some other\n * mechanism (like the end of the file) has to be employed. When it is\n * clear that no additional data is forthcoming, calling this method\n * will flush the buffered packets.\n */\n\n\n this.flush = function () {\n // !!THIS ORDER IS IMPORTANT!!\n // video first then audio\n flushStream(video, 'video');\n flushStream(audio, 'audio');\n flushStream(timedMetadata, 'timed-metadata');\n this.trigger('done');\n };\n };\n\n _ElementaryStream.prototype = new stream();\n var m2ts = {\n PAT_PID: 0x0000,\n MP2T_PACKET_LENGTH: MP2T_PACKET_LENGTH,\n TransportPacketStream: _TransportPacketStream,\n TransportParseStream: _TransportParseStream,\n ElementaryStream: _ElementaryStream,\n TimestampRolloverStream: TimestampRolloverStream$1,\n CaptionStream: captionStream.CaptionStream,\n Cea608Stream: captionStream.Cea608Stream,\n MetadataStream: metadataStream\n };\n\n for (var type in streamTypes) {\n if (streamTypes.hasOwnProperty(type)) {\n m2ts[type] = streamTypes[type];\n }\n }\n\n var m2ts_1 = m2ts;\n\n var _AdtsStream;\n\n var ADTS_SAMPLING_FREQUENCIES = [96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350];\n /*\n * Accepts a ElementaryStream and emits data events with parsed\n * AAC Audio Frames of the individual packets. Input audio in ADTS\n * format is unpacked and re-emitted as AAC frames.\n *\n * @see http://wiki.multimedia.cx/index.php?title=ADTS\n * @see http://wiki.multimedia.cx/?title=Understanding_AAC\n */\n\n _AdtsStream = function AdtsStream() {\n var buffer;\n\n _AdtsStream.prototype.init.call(this);\n\n this.push = function (packet) {\n var i = 0,\n frameNum = 0,\n frameLength,\n protectionSkipBytes,\n frameEnd,\n oldBuffer,\n sampleCount,\n adtsFrameDuration;\n\n if (packet.type !== 'audio') {\n // ignore non-audio data\n return;\n } // Prepend any data in the buffer to the input data so that we can parse\n // aac frames the cross a PES packet boundary\n\n\n if (buffer) {\n oldBuffer = buffer;\n buffer = new Uint8Array(oldBuffer.byteLength + packet.data.byteLength);\n buffer.set(oldBuffer);\n buffer.set(packet.data, oldBuffer.byteLength);\n } else {\n buffer = packet.data;\n } // unpack any ADTS frames which have been fully received\n // for details on the ADTS header, see http://wiki.multimedia.cx/index.php?title=ADTS\n\n\n while (i + 5 < buffer.length) {\n // Loook for the start of an ADTS header..\n if (buffer[i] !== 0xFF || (buffer[i + 1] & 0xF6) !== 0xF0) {\n // If a valid header was not found, jump one forward and attempt to\n // find a valid ADTS header starting at the next byte\n i++;\n continue;\n } // The protection skip bit tells us if we have 2 bytes of CRC data at the\n // end of the ADTS header\n\n\n protectionSkipBytes = (~buffer[i + 1] & 0x01) * 2; // Frame length is a 13 bit integer starting 16 bits from the\n // end of the sync sequence\n\n frameLength = (buffer[i + 3] & 0x03) << 11 | buffer[i + 4] << 3 | (buffer[i + 5] & 0xe0) >> 5;\n sampleCount = ((buffer[i + 6] & 0x03) + 1) * 1024;\n adtsFrameDuration = sampleCount * 90000 / ADTS_SAMPLING_FREQUENCIES[(buffer[i + 2] & 0x3c) >>> 2];\n frameEnd = i + frameLength; // If we don't have enough data to actually finish this ADTS frame, return\n // and wait for more data\n\n if (buffer.byteLength < frameEnd) {\n return;\n } // Otherwise, deliver the complete AAC frame\n\n\n this.trigger('data', {\n pts: packet.pts + frameNum * adtsFrameDuration,\n dts: packet.dts + frameNum * adtsFrameDuration,\n sampleCount: sampleCount,\n audioobjecttype: (buffer[i + 2] >>> 6 & 0x03) + 1,\n channelcount: (buffer[i + 2] & 1) << 2 | (buffer[i + 3] & 0xc0) >>> 6,\n samplerate: ADTS_SAMPLING_FREQUENCIES[(buffer[i + 2] & 0x3c) >>> 2],\n samplingfrequencyindex: (buffer[i + 2] & 0x3c) >>> 2,\n // assume ISO/IEC 14496-12 AudioSampleEntry default of 16\n samplesize: 16,\n data: buffer.subarray(i + 7 + protectionSkipBytes, frameEnd)\n }); // If the buffer is empty, clear it and return\n\n if (buffer.byteLength === frameEnd) {\n buffer = undefined;\n return;\n }\n\n frameNum++; // Remove the finished frame from the buffer and start the process again\n\n buffer = buffer.subarray(frameEnd);\n }\n };\n\n this.flush = function () {\n this.trigger('done');\n };\n };\n\n _AdtsStream.prototype = new stream();\n var adts = _AdtsStream;\n var ExpGolomb;\n /**\n * Parser for exponential Golomb codes, a variable-bitwidth number encoding\n * scheme used by h264.\n */\n\n ExpGolomb = function ExpGolomb(workingData) {\n var // the number of bytes left to examine in workingData\n workingBytesAvailable = workingData.byteLength,\n // the current word being examined\n workingWord = 0,\n // :uint\n // the number of bits left to examine in the current word\n workingBitsAvailable = 0; // :uint;\n // ():uint\n\n this.length = function () {\n return 8 * workingBytesAvailable;\n }; // ():uint\n\n\n this.bitsAvailable = function () {\n return 8 * workingBytesAvailable + workingBitsAvailable;\n }; // ():void\n\n\n this.loadWord = function () {\n var position = workingData.byteLength - workingBytesAvailable,\n workingBytes = new Uint8Array(4),\n availableBytes = Math.min(4, workingBytesAvailable);\n\n if (availableBytes === 0) {\n throw new Error('no bytes available');\n }\n\n workingBytes.set(workingData.subarray(position, position + availableBytes));\n workingWord = new DataView(workingBytes.buffer).getUint32(0); // track the amount of workingData that has been processed\n\n workingBitsAvailable = availableBytes * 8;\n workingBytesAvailable -= availableBytes;\n }; // (count:int):void\n\n\n this.skipBits = function (count) {\n var skipBytes; // :int\n\n if (workingBitsAvailable > count) {\n workingWord <<= count;\n workingBitsAvailable -= count;\n } else {\n count -= workingBitsAvailable;\n skipBytes = Math.floor(count / 8);\n count -= skipBytes * 8;\n workingBytesAvailable -= skipBytes;\n this.loadWord();\n workingWord <<= count;\n workingBitsAvailable -= count;\n }\n }; // (size:int):uint\n\n\n this.readBits = function (size) {\n var bits = Math.min(workingBitsAvailable, size),\n // :uint\n valu = workingWord >>> 32 - bits; // :uint\n // if size > 31, handle error\n\n workingBitsAvailable -= bits;\n\n if (workingBitsAvailable > 0) {\n workingWord <<= bits;\n } else if (workingBytesAvailable > 0) {\n this.loadWord();\n }\n\n bits = size - bits;\n\n if (bits > 0) {\n return valu << bits | this.readBits(bits);\n }\n\n return valu;\n }; // ():uint\n\n\n this.skipLeadingZeros = function () {\n var leadingZeroCount; // :uint\n\n for (leadingZeroCount = 0; leadingZeroCount < workingBitsAvailable; ++leadingZeroCount) {\n if ((workingWord & 0x80000000 >>> leadingZeroCount) !== 0) {\n // the first bit of working word is 1\n workingWord <<= leadingZeroCount;\n workingBitsAvailable -= leadingZeroCount;\n return leadingZeroCount;\n }\n } // we exhausted workingWord and still have not found a 1\n\n\n this.loadWord();\n return leadingZeroCount + this.skipLeadingZeros();\n }; // ():void\n\n\n this.skipUnsignedExpGolomb = function () {\n this.skipBits(1 + this.skipLeadingZeros());\n }; // ():void\n\n\n this.skipExpGolomb = function () {\n this.skipBits(1 + this.skipLeadingZeros());\n }; // ():uint\n\n\n this.readUnsignedExpGolomb = function () {\n var clz = this.skipLeadingZeros(); // :uint\n\n return this.readBits(clz + 1) - 1;\n }; // ():int\n\n\n this.readExpGolomb = function () {\n var valu = this.readUnsignedExpGolomb(); // :int\n\n if (0x01 & valu) {\n // the number is odd if the low order bit is set\n return 1 + valu >>> 1; // add 1 to make it even, and divide by 2\n }\n\n return -1 * (valu >>> 1); // divide by two then make it negative\n }; // Some convenience functions\n // :Boolean\n\n\n this.readBoolean = function () {\n return this.readBits(1) === 1;\n }; // ():int\n\n\n this.readUnsignedByte = function () {\n return this.readBits(8);\n };\n\n this.loadWord();\n };\n\n var expGolomb = ExpGolomb;\n\n var _H264Stream, _NalByteStream;\n\n var PROFILES_WITH_OPTIONAL_SPS_DATA;\n /**\n * Accepts a NAL unit byte stream and unpacks the embedded NAL units.\n */\n\n _NalByteStream = function NalByteStream() {\n var syncPoint = 0,\n i,\n buffer;\n\n _NalByteStream.prototype.init.call(this);\n /*\n * Scans a byte stream and triggers a data event with the NAL units found.\n * @param {Object} data Event received from H264Stream\n * @param {Uint8Array} data.data The h264 byte stream to be scanned\n *\n * @see H264Stream.push\n */\n\n\n this.push = function (data) {\n var swapBuffer;\n\n if (!buffer) {\n buffer = data.data;\n } else {\n swapBuffer = new Uint8Array(buffer.byteLength + data.data.byteLength);\n swapBuffer.set(buffer);\n swapBuffer.set(data.data, buffer.byteLength);\n buffer = swapBuffer;\n } // Rec. ITU-T H.264, Annex B\n // scan for NAL unit boundaries\n // a match looks like this:\n // 0 0 1 .. NAL .. 0 0 1\n // ^ sync point ^ i\n // or this:\n // 0 0 1 .. NAL .. 0 0 0\n // ^ sync point ^ i\n // advance the sync point to a NAL start, if necessary\n\n\n for (; syncPoint < buffer.byteLength - 3; syncPoint++) {\n if (buffer[syncPoint + 2] === 1) {\n // the sync point is properly aligned\n i = syncPoint + 5;\n break;\n }\n }\n\n while (i < buffer.byteLength) {\n // look at the current byte to determine if we've hit the end of\n // a NAL unit boundary\n switch (buffer[i]) {\n case 0:\n // skip past non-sync sequences\n if (buffer[i - 1] !== 0) {\n i += 2;\n break;\n } else if (buffer[i - 2] !== 0) {\n i++;\n break;\n } // deliver the NAL unit if it isn't empty\n\n\n if (syncPoint + 3 !== i - 2) {\n this.trigger('data', buffer.subarray(syncPoint + 3, i - 2));\n } // drop trailing zeroes\n\n\n do {\n i++;\n } while (buffer[i] !== 1 && i < buffer.length);\n\n syncPoint = i - 2;\n i += 3;\n break;\n\n case 1:\n // skip past non-sync sequences\n if (buffer[i - 1] !== 0 || buffer[i - 2] !== 0) {\n i += 3;\n break;\n } // deliver the NAL unit\n\n\n this.trigger('data', buffer.subarray(syncPoint + 3, i - 2));\n syncPoint = i - 2;\n i += 3;\n break;\n\n default:\n // the current byte isn't a one or zero, so it cannot be part\n // of a sync sequence\n i += 3;\n break;\n }\n } // filter out the NAL units that were delivered\n\n\n buffer = buffer.subarray(syncPoint);\n i -= syncPoint;\n syncPoint = 0;\n };\n\n this.flush = function () {\n // deliver the last buffered NAL unit\n if (buffer && buffer.byteLength > 3) {\n this.trigger('data', buffer.subarray(syncPoint + 3));\n } // reset the stream state\n\n\n buffer = null;\n syncPoint = 0;\n this.trigger('done');\n };\n };\n\n _NalByteStream.prototype = new stream(); // values of profile_idc that indicate additional fields are included in the SPS\n // see Recommendation ITU-T H.264 (4/2013),\n // 7.3.2.1.1 Sequence parameter set data syntax\n\n PROFILES_WITH_OPTIONAL_SPS_DATA = {\n 100: true,\n 110: true,\n 122: true,\n 244: true,\n 44: true,\n 83: true,\n 86: true,\n 118: true,\n 128: true,\n 138: true,\n 139: true,\n 134: true\n };\n /**\n * Accepts input from a ElementaryStream and produces H.264 NAL unit data\n * events.\n */\n\n _H264Stream = function H264Stream() {\n var nalByteStream = new _NalByteStream(),\n self,\n trackId,\n currentPts,\n currentDts,\n discardEmulationPreventionBytes,\n readSequenceParameterSet,\n skipScalingList;\n\n _H264Stream.prototype.init.call(this);\n\n self = this;\n /*\n * Pushes a packet from a stream onto the NalByteStream\n *\n * @param {Object} packet - A packet received from a stream\n * @param {Uint8Array} packet.data - The raw bytes of the packet\n * @param {Number} packet.dts - Decode timestamp of the packet\n * @param {Number} packet.pts - Presentation timestamp of the packet\n * @param {Number} packet.trackId - The id of the h264 track this packet came from\n * @param {('video'|'audio')} packet.type - The type of packet\n *\n */\n\n this.push = function (packet) {\n if (packet.type !== 'video') {\n return;\n }\n\n trackId = packet.trackId;\n currentPts = packet.pts;\n currentDts = packet.dts;\n nalByteStream.push(packet);\n };\n /*\n * Identify NAL unit types and pass on the NALU, trackId, presentation and decode timestamps\n * for the NALUs to the next stream component.\n * Also, preprocess caption and sequence parameter NALUs.\n *\n * @param {Uint8Array} data - A NAL unit identified by `NalByteStream.push`\n * @see NalByteStream.push\n */\n\n\n nalByteStream.on('data', function (data) {\n var event = {\n trackId: trackId,\n pts: currentPts,\n dts: currentDts,\n data: data\n };\n\n switch (data[0] & 0x1f) {\n case 0x05:\n event.nalUnitType = 'slice_layer_without_partitioning_rbsp_idr';\n break;\n\n case 0x06:\n event.nalUnitType = 'sei_rbsp';\n event.escapedRBSP = discardEmulationPreventionBytes(data.subarray(1));\n break;\n\n case 0x07:\n event.nalUnitType = 'seq_parameter_set_rbsp';\n event.escapedRBSP = discardEmulationPreventionBytes(data.subarray(1));\n event.config = readSequenceParameterSet(event.escapedRBSP);\n break;\n\n case 0x08:\n event.nalUnitType = 'pic_parameter_set_rbsp';\n break;\n\n case 0x09:\n event.nalUnitType = 'access_unit_delimiter_rbsp';\n break;\n\n default:\n break;\n } // This triggers data on the H264Stream\n\n\n self.trigger('data', event);\n });\n nalByteStream.on('done', function () {\n self.trigger('done');\n });\n\n this.flush = function () {\n nalByteStream.flush();\n };\n /**\n * Advance the ExpGolomb decoder past a scaling list. The scaling\n * list is optionally transmitted as part of a sequence parameter\n * set and is not relevant to transmuxing.\n * @param count {number} the number of entries in this scaling list\n * @param expGolombDecoder {object} an ExpGolomb pointed to the\n * start of a scaling list\n * @see Recommendation ITU-T H.264, Section 7.3.2.1.1.1\n */\n\n\n skipScalingList = function skipScalingList(count, expGolombDecoder) {\n var lastScale = 8,\n nextScale = 8,\n j,\n deltaScale;\n\n for (j = 0; j < count; j++) {\n if (nextScale !== 0) {\n deltaScale = expGolombDecoder.readExpGolomb();\n nextScale = (lastScale + deltaScale + 256) % 256;\n }\n\n lastScale = nextScale === 0 ? lastScale : nextScale;\n }\n };\n /**\n * Expunge any \"Emulation Prevention\" bytes from a \"Raw Byte\n * Sequence Payload\"\n * @param data {Uint8Array} the bytes of a RBSP from a NAL\n * unit\n * @return {Uint8Array} the RBSP without any Emulation\n * Prevention Bytes\n */\n\n\n discardEmulationPreventionBytes = function discardEmulationPreventionBytes(data) {\n var length = data.byteLength,\n emulationPreventionBytesPositions = [],\n i = 1,\n newLength,\n newData; // Find all `Emulation Prevention Bytes`\n\n while (i < length - 2) {\n if (data[i] === 0 && data[i + 1] === 0 && data[i + 2] === 0x03) {\n emulationPreventionBytesPositions.push(i + 2);\n i += 2;\n } else {\n i++;\n }\n } // If no Emulation Prevention Bytes were found just return the original\n // array\n\n\n if (emulationPreventionBytesPositions.length === 0) {\n return data;\n } // Create a new array to hold the NAL unit data\n\n\n newLength = length - emulationPreventionBytesPositions.length;\n newData = new Uint8Array(newLength);\n var sourceIndex = 0;\n\n for (i = 0; i < newLength; sourceIndex++, i++) {\n if (sourceIndex === emulationPreventionBytesPositions[0]) {\n // Skip this byte\n sourceIndex++; // Remove this position index\n\n emulationPreventionBytesPositions.shift();\n }\n\n newData[i] = data[sourceIndex];\n }\n\n return newData;\n };\n /**\n * Read a sequence parameter set and return some interesting video\n * properties. A sequence parameter set is the H264 metadata that\n * describes the properties of upcoming video frames.\n * @param data {Uint8Array} the bytes of a sequence parameter set\n * @return {object} an object with configuration parsed from the\n * sequence parameter set, including the dimensions of the\n * associated video frames.\n */\n\n\n readSequenceParameterSet = function readSequenceParameterSet(data) {\n var frameCropLeftOffset = 0,\n frameCropRightOffset = 0,\n frameCropTopOffset = 0,\n frameCropBottomOffset = 0,\n sarScale = 1,\n expGolombDecoder,\n profileIdc,\n levelIdc,\n profileCompatibility,\n chromaFormatIdc,\n picOrderCntType,\n numRefFramesInPicOrderCntCycle,\n picWidthInMbsMinus1,\n picHeightInMapUnitsMinus1,\n frameMbsOnlyFlag,\n scalingListCount,\n sarRatio,\n aspectRatioIdc,\n i;\n expGolombDecoder = new expGolomb(data);\n profileIdc = expGolombDecoder.readUnsignedByte(); // profile_idc\n\n profileCompatibility = expGolombDecoder.readUnsignedByte(); // constraint_set[0-5]_flag\n\n levelIdc = expGolombDecoder.readUnsignedByte(); // level_idc u(8)\n\n expGolombDecoder.skipUnsignedExpGolomb(); // seq_parameter_set_id\n // some profiles have more optional data we don't need\n\n if (PROFILES_WITH_OPTIONAL_SPS_DATA[profileIdc]) {\n chromaFormatIdc = expGolombDecoder.readUnsignedExpGolomb();\n\n if (chromaFormatIdc === 3) {\n expGolombDecoder.skipBits(1); // separate_colour_plane_flag\n }\n\n expGolombDecoder.skipUnsignedExpGolomb(); // bit_depth_luma_minus8\n\n expGolombDecoder.skipUnsignedExpGolomb(); // bit_depth_chroma_minus8\n\n expGolombDecoder.skipBits(1); // qpprime_y_zero_transform_bypass_flag\n\n if (expGolombDecoder.readBoolean()) {\n // seq_scaling_matrix_present_flag\n scalingListCount = chromaFormatIdc !== 3 ? 8 : 12;\n\n for (i = 0; i < scalingListCount; i++) {\n if (expGolombDecoder.readBoolean()) {\n // seq_scaling_list_present_flag[ i ]\n if (i < 6) {\n skipScalingList(16, expGolombDecoder);\n } else {\n skipScalingList(64, expGolombDecoder);\n }\n }\n }\n }\n }\n\n expGolombDecoder.skipUnsignedExpGolomb(); // log2_max_frame_num_minus4\n\n picOrderCntType = expGolombDecoder.readUnsignedExpGolomb();\n\n if (picOrderCntType === 0) {\n expGolombDecoder.readUnsignedExpGolomb(); // log2_max_pic_order_cnt_lsb_minus4\n } else if (picOrderCntType === 1) {\n expGolombDecoder.skipBits(1); // delta_pic_order_always_zero_flag\n\n expGolombDecoder.skipExpGolomb(); // offset_for_non_ref_pic\n\n expGolombDecoder.skipExpGolomb(); // offset_for_top_to_bottom_field\n\n numRefFramesInPicOrderCntCycle = expGolombDecoder.readUnsignedExpGolomb();\n\n for (i = 0; i < numRefFramesInPicOrderCntCycle; i++) {\n expGolombDecoder.skipExpGolomb(); // offset_for_ref_frame[ i ]\n }\n }\n\n expGolombDecoder.skipUnsignedExpGolomb(); // max_num_ref_frames\n\n expGolombDecoder.skipBits(1); // gaps_in_frame_num_value_allowed_flag\n\n picWidthInMbsMinus1 = expGolombDecoder.readUnsignedExpGolomb();\n picHeightInMapUnitsMinus1 = expGolombDecoder.readUnsignedExpGolomb();\n frameMbsOnlyFlag = expGolombDecoder.readBits(1);\n\n if (frameMbsOnlyFlag === 0) {\n expGolombDecoder.skipBits(1); // mb_adaptive_frame_field_flag\n }\n\n expGolombDecoder.skipBits(1); // direct_8x8_inference_flag\n\n if (expGolombDecoder.readBoolean()) {\n // frame_cropping_flag\n frameCropLeftOffset = expGolombDecoder.readUnsignedExpGolomb();\n frameCropRightOffset = expGolombDecoder.readUnsignedExpGolomb();\n frameCropTopOffset = expGolombDecoder.readUnsignedExpGolomb();\n frameCropBottomOffset = expGolombDecoder.readUnsignedExpGolomb();\n }\n\n if (expGolombDecoder.readBoolean()) {\n // vui_parameters_present_flag\n if (expGolombDecoder.readBoolean()) {\n // aspect_ratio_info_present_flag\n aspectRatioIdc = expGolombDecoder.readUnsignedByte();\n\n switch (aspectRatioIdc) {\n case 1:\n sarRatio = [1, 1];\n break;\n\n case 2:\n sarRatio = [12, 11];\n break;\n\n case 3:\n sarRatio = [10, 11];\n break;\n\n case 4:\n sarRatio = [16, 11];\n break;\n\n case 5:\n sarRatio = [40, 33];\n break;\n\n case 6:\n sarRatio = [24, 11];\n break;\n\n case 7:\n sarRatio = [20, 11];\n break;\n\n case 8:\n sarRatio = [32, 11];\n break;\n\n case 9:\n sarRatio = [80, 33];\n break;\n\n case 10:\n sarRatio = [18, 11];\n break;\n\n case 11:\n sarRatio = [15, 11];\n break;\n\n case 12:\n sarRatio = [64, 33];\n break;\n\n case 13:\n sarRatio = [160, 99];\n break;\n\n case 14:\n sarRatio = [4, 3];\n break;\n\n case 15:\n sarRatio = [3, 2];\n break;\n\n case 16:\n sarRatio = [2, 1];\n break;\n\n case 255:\n {\n sarRatio = [expGolombDecoder.readUnsignedByte() << 8 | expGolombDecoder.readUnsignedByte(), expGolombDecoder.readUnsignedByte() << 8 | expGolombDecoder.readUnsignedByte()];\n break;\n }\n }\n\n if (sarRatio) {\n sarScale = sarRatio[0] / sarRatio[1];\n }\n }\n }\n\n return {\n profileIdc: profileIdc,\n levelIdc: levelIdc,\n profileCompatibility: profileCompatibility,\n width: Math.ceil(((picWidthInMbsMinus1 + 1) * 16 - frameCropLeftOffset * 2 - frameCropRightOffset * 2) * sarScale),\n height: (2 - frameMbsOnlyFlag) * (picHeightInMapUnitsMinus1 + 1) * 16 - frameCropTopOffset * 2 - frameCropBottomOffset * 2\n };\n };\n };\n\n _H264Stream.prototype = new stream();\n var h264 = {\n H264Stream: _H264Stream,\n NalByteStream: _NalByteStream\n };\n /**\n * mux.js\n *\n * Copyright (c) 2016 Brightcove\n * All rights reserved.\n *\n * Utilities to detect basic properties and metadata about Aac data.\n */\n\n var ADTS_SAMPLING_FREQUENCIES$1 = [96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350];\n\n var isLikelyAacData = function isLikelyAacData(data) {\n if (data[0] === 'I'.charCodeAt(0) && data[1] === 'D'.charCodeAt(0) && data[2] === '3'.charCodeAt(0)) {\n return true;\n }\n\n return false;\n };\n\n var parseSyncSafeInteger$1 = function parseSyncSafeInteger(data) {\n return data[0] << 21 | data[1] << 14 | data[2] << 7 | data[3];\n }; // return a percent-encoded representation of the specified byte range\n // @see http://en.wikipedia.org/wiki/Percent-encoding\n\n\n var percentEncode$1 = function percentEncode(bytes, start, end) {\n var i,\n result = '';\n\n for (i = start; i < end; i++) {\n result += '%' + ('00' + bytes[i].toString(16)).slice(-2);\n }\n\n return result;\n }; // return the string representation of the specified byte range,\n // interpreted as ISO-8859-1.\n\n\n var parseIso88591$1 = function parseIso88591(bytes, start, end) {\n return unescape(percentEncode$1(bytes, start, end)); // jshint ignore:line\n };\n\n var parseId3TagSize = function parseId3TagSize(header, byteIndex) {\n var returnSize = header[byteIndex + 6] << 21 | header[byteIndex + 7] << 14 | header[byteIndex + 8] << 7 | header[byteIndex + 9],\n flags = header[byteIndex + 5],\n footerPresent = (flags & 16) >> 4;\n\n if (footerPresent) {\n return returnSize + 20;\n }\n\n return returnSize + 10;\n };\n\n var parseAdtsSize = function parseAdtsSize(header, byteIndex) {\n var lowThree = (header[byteIndex + 5] & 0xE0) >> 5,\n middle = header[byteIndex + 4] << 3,\n highTwo = header[byteIndex + 3] & 0x3 << 11;\n return highTwo | middle | lowThree;\n };\n\n var parseType$1 = function parseType(header, byteIndex) {\n if (header[byteIndex] === 'I'.charCodeAt(0) && header[byteIndex + 1] === 'D'.charCodeAt(0) && header[byteIndex + 2] === '3'.charCodeAt(0)) {\n return 'timed-metadata';\n } else if (header[byteIndex] & 0xff === 0xff && (header[byteIndex + 1] & 0xf0) === 0xf0) {\n return 'audio';\n }\n\n return null;\n };\n\n var parseSampleRate = function parseSampleRate(packet) {\n var i = 0;\n\n while (i + 5 < packet.length) {\n if (packet[i] !== 0xFF || (packet[i + 1] & 0xF6) !== 0xF0) {\n // If a valid header was not found, jump one forward and attempt to\n // find a valid ADTS header starting at the next byte\n i++;\n continue;\n }\n\n return ADTS_SAMPLING_FREQUENCIES$1[(packet[i + 2] & 0x3c) >>> 2];\n }\n\n return null;\n };\n\n var parseAacTimestamp = function parseAacTimestamp(packet) {\n var frameStart, frameSize, frame, frameHeader; // find the start of the first frame and the end of the tag\n\n frameStart = 10;\n\n if (packet[5] & 0x40) {\n // advance the frame start past the extended header\n frameStart += 4; // header size field\n\n frameStart += parseSyncSafeInteger$1(packet.subarray(10, 14));\n } // parse one or more ID3 frames\n // http://id3.org/id3v2.3.0#ID3v2_frame_overview\n\n\n do {\n // determine the number of bytes in this frame\n frameSize = parseSyncSafeInteger$1(packet.subarray(frameStart + 4, frameStart + 8));\n\n if (frameSize < 1) {\n return null;\n }\n\n frameHeader = String.fromCharCode(packet[frameStart], packet[frameStart + 1], packet[frameStart + 2], packet[frameStart + 3]);\n\n if (frameHeader === 'PRIV') {\n frame = packet.subarray(frameStart + 10, frameStart + frameSize + 10);\n\n for (var i = 0; i < frame.byteLength; i++) {\n if (frame[i] === 0) {\n var owner = parseIso88591$1(frame, 0, i);\n\n if (owner === 'com.apple.streaming.transportStreamTimestamp') {\n var d = frame.subarray(i + 1);\n var size = (d[3] & 0x01) << 30 | d[4] << 22 | d[5] << 14 | d[6] << 6 | d[7] >>> 2;\n size *= 4;\n size += d[7] & 0x03;\n return size;\n }\n\n break;\n }\n }\n }\n\n frameStart += 10; // advance past the frame header\n\n frameStart += frameSize; // advance past the frame body\n } while (frameStart < packet.byteLength);\n\n return null;\n };\n\n var utils = {\n isLikelyAacData: isLikelyAacData,\n parseId3TagSize: parseId3TagSize,\n parseAdtsSize: parseAdtsSize,\n parseType: parseType$1,\n parseSampleRate: parseSampleRate,\n parseAacTimestamp: parseAacTimestamp\n }; // Constants\n\n var _AacStream;\n /**\n * Splits an incoming stream of binary data into ADTS and ID3 Frames.\n */\n\n\n _AacStream = function AacStream() {\n var everything = new Uint8Array(),\n timeStamp = 0;\n\n _AacStream.prototype.init.call(this);\n\n this.setTimestamp = function (timestamp) {\n timeStamp = timestamp;\n };\n\n this.push = function (bytes) {\n var frameSize = 0,\n byteIndex = 0,\n bytesLeft,\n chunk,\n packet,\n tempLength; // If there are bytes remaining from the last segment, prepend them to the\n // bytes that were pushed in\n\n if (everything.length) {\n tempLength = everything.length;\n everything = new Uint8Array(bytes.byteLength + tempLength);\n everything.set(everything.subarray(0, tempLength));\n everything.set(bytes, tempLength);\n } else {\n everything = bytes;\n }\n\n while (everything.length - byteIndex >= 3) {\n if (everything[byteIndex] === 'I'.charCodeAt(0) && everything[byteIndex + 1] === 'D'.charCodeAt(0) && everything[byteIndex + 2] === '3'.charCodeAt(0)) {\n // Exit early because we don't have enough to parse\n // the ID3 tag header\n if (everything.length - byteIndex < 10) {\n break;\n } // check framesize\n\n\n frameSize = utils.parseId3TagSize(everything, byteIndex); // Exit early if we don't have enough in the buffer\n // to emit a full packet\n // Add to byteIndex to support multiple ID3 tags in sequence\n\n if (byteIndex + frameSize > everything.length) {\n break;\n }\n\n chunk = {\n type: 'timed-metadata',\n data: everything.subarray(byteIndex, byteIndex + frameSize)\n };\n this.trigger('data', chunk);\n byteIndex += frameSize;\n continue;\n } else if ((everything[byteIndex] & 0xff) === 0xff && (everything[byteIndex + 1] & 0xf0) === 0xf0) {\n // Exit early because we don't have enough to parse\n // the ADTS frame header\n if (everything.length - byteIndex < 7) {\n break;\n }\n\n frameSize = utils.parseAdtsSize(everything, byteIndex); // Exit early if we don't have enough in the buffer\n // to emit a full packet\n\n if (byteIndex + frameSize > everything.length) {\n break;\n }\n\n packet = {\n type: 'audio',\n data: everything.subarray(byteIndex, byteIndex + frameSize),\n pts: timeStamp,\n dts: timeStamp\n };\n this.trigger('data', packet);\n byteIndex += frameSize;\n continue;\n }\n\n byteIndex++;\n }\n\n bytesLeft = everything.length - byteIndex;\n\n if (bytesLeft > 0) {\n everything = everything.subarray(byteIndex);\n } else {\n everything = new Uint8Array();\n }\n };\n };\n\n _AacStream.prototype = new stream();\n var aac = _AacStream;\n var H264Stream = h264.H264Stream;\n var isLikelyAacData$1 = utils.isLikelyAacData; // constants\n\n var AUDIO_PROPERTIES = ['audioobjecttype', 'channelcount', 'samplerate', 'samplingfrequencyindex', 'samplesize'];\n var VIDEO_PROPERTIES = ['width', 'height', 'profileIdc', 'levelIdc', 'profileCompatibility']; // object types\n\n var _VideoSegmentStream, _AudioSegmentStream, _Transmuxer, _CoalesceStream;\n /**\n * Compare two arrays (even typed) for same-ness\n */\n\n\n var arrayEquals = function arrayEquals(a, b) {\n var i;\n\n if (a.length !== b.length) {\n return false;\n } // compare the value of each element in the array\n\n\n for (i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n\n return true;\n };\n /**\n * Constructs a single-track, ISO BMFF media segment from AAC data\n * events. The output of this stream can be fed to a SourceBuffer\n * configured with a suitable initialization segment.\n * @param track {object} track metadata configuration\n * @param options {object} transmuxer options object\n * @param options.keepOriginalTimestamps {boolean} If true, keep the timestamps\n * in the source; false to adjust the first segment to start at 0.\n */\n\n\n _AudioSegmentStream = function AudioSegmentStream(track, options) {\n var adtsFrames = [],\n sequenceNumber = 0,\n earliestAllowedDts = 0,\n audioAppendStartTs = 0,\n videoBaseMediaDecodeTime = Infinity;\n options = options || {};\n\n _AudioSegmentStream.prototype.init.call(this);\n\n this.push = function (data) {\n trackDecodeInfo.collectDtsInfo(track, data);\n\n if (track) {\n AUDIO_PROPERTIES.forEach(function (prop) {\n track[prop] = data[prop];\n });\n } // buffer audio data until end() is called\n\n\n adtsFrames.push(data);\n };\n\n this.setEarliestDts = function (earliestDts) {\n earliestAllowedDts = earliestDts - track.timelineStartInfo.baseMediaDecodeTime;\n };\n\n this.setVideoBaseMediaDecodeTime = function (baseMediaDecodeTime) {\n videoBaseMediaDecodeTime = baseMediaDecodeTime;\n };\n\n this.setAudioAppendStart = function (timestamp) {\n audioAppendStartTs = timestamp;\n };\n\n this.flush = function () {\n var frames, moof, mdat, boxes; // return early if no audio data has been observed\n\n if (adtsFrames.length === 0) {\n this.trigger('done', 'AudioSegmentStream');\n return;\n }\n\n frames = audioFrameUtils.trimAdtsFramesByEarliestDts(adtsFrames, track, earliestAllowedDts);\n track.baseMediaDecodeTime = trackDecodeInfo.calculateTrackBaseMediaDecodeTime(track, options.keepOriginalTimestamps);\n audioFrameUtils.prefixWithSilence(track, frames, audioAppendStartTs, videoBaseMediaDecodeTime); // we have to build the index from byte locations to\n // samples (that is, adts frames) in the audio data\n\n track.samples = audioFrameUtils.generateSampleTable(frames); // concatenate the audio data to constuct the mdat\n\n mdat = mp4Generator.mdat(audioFrameUtils.concatenateFrameData(frames));\n adtsFrames = [];\n moof = mp4Generator.moof(sequenceNumber, [track]);\n boxes = new Uint8Array(moof.byteLength + mdat.byteLength); // bump the sequence number for next time\n\n sequenceNumber++;\n boxes.set(moof);\n boxes.set(mdat, moof.byteLength);\n trackDecodeInfo.clearDtsInfo(track);\n this.trigger('data', {\n track: track,\n boxes: boxes\n });\n this.trigger('done', 'AudioSegmentStream');\n };\n };\n\n _AudioSegmentStream.prototype = new stream();\n /**\n * Constructs a single-track, ISO BMFF media segment from H264 data\n * events. The output of this stream can be fed to a SourceBuffer\n * configured with a suitable initialization segment.\n * @param track {object} track metadata configuration\n * @param options {object} transmuxer options object\n * @param options.alignGopsAtEnd {boolean} If true, start from the end of the\n * gopsToAlignWith list when attempting to align gop pts\n * @param options.keepOriginalTimestamps {boolean} If true, keep the timestamps\n * in the source; false to adjust the first segment to start at 0.\n */\n\n _VideoSegmentStream = function VideoSegmentStream(track, options) {\n var sequenceNumber = 0,\n nalUnits = [],\n gopsToAlignWith = [],\n config,\n pps;\n options = options || {};\n\n _VideoSegmentStream.prototype.init.call(this);\n\n delete track.minPTS;\n this.gopCache_ = [];\n /**\n * Constructs a ISO BMFF segment given H264 nalUnits\n * @param {Object} nalUnit A data event representing a nalUnit\n * @param {String} nalUnit.nalUnitType\n * @param {Object} nalUnit.config Properties for a mp4 track\n * @param {Uint8Array} nalUnit.data The nalUnit bytes\n * @see lib/codecs/h264.js\n **/\n\n this.push = function (nalUnit) {\n trackDecodeInfo.collectDtsInfo(track, nalUnit); // record the track config\n\n if (nalUnit.nalUnitType === 'seq_parameter_set_rbsp' && !config) {\n config = nalUnit.config;\n track.sps = [nalUnit.data];\n VIDEO_PROPERTIES.forEach(function (prop) {\n track[prop] = config[prop];\n }, this);\n }\n\n if (nalUnit.nalUnitType === 'pic_parameter_set_rbsp' && !pps) {\n pps = nalUnit.data;\n track.pps = [nalUnit.data];\n } // buffer video until flush() is called\n\n\n nalUnits.push(nalUnit);\n };\n /**\n * Pass constructed ISO BMFF track and boxes on to the\n * next stream in the pipeline\n **/\n\n\n this.flush = function () {\n var frames, gopForFusion, gops, moof, mdat, boxes; // Throw away nalUnits at the start of the byte stream until\n // we find the first AUD\n\n while (nalUnits.length) {\n if (nalUnits[0].nalUnitType === 'access_unit_delimiter_rbsp') {\n break;\n }\n\n nalUnits.shift();\n } // Return early if no video data has been observed\n\n\n if (nalUnits.length === 0) {\n this.resetStream_();\n this.trigger('done', 'VideoSegmentStream');\n return;\n } // Organize the raw nal-units into arrays that represent\n // higher-level constructs such as frames and gops\n // (group-of-pictures)\n\n\n frames = frameUtils.groupNalsIntoFrames(nalUnits);\n gops = frameUtils.groupFramesIntoGops(frames); // If the first frame of this fragment is not a keyframe we have\n // a problem since MSE (on Chrome) requires a leading keyframe.\n //\n // We have two approaches to repairing this situation:\n // 1) GOP-FUSION:\n // This is where we keep track of the GOPS (group-of-pictures)\n // from previous fragments and attempt to find one that we can\n // prepend to the current fragment in order to create a valid\n // fragment.\n // 2) KEYFRAME-PULLING:\n // Here we search for the first keyframe in the fragment and\n // throw away all the frames between the start of the fragment\n // and that keyframe. We then extend the duration and pull the\n // PTS of the keyframe forward so that it covers the time range\n // of the frames that were disposed of.\n //\n // #1 is far prefereable over #2 which can cause \"stuttering\" but\n // requires more things to be just right.\n\n if (!gops[0][0].keyFrame) {\n // Search for a gop for fusion from our gopCache\n gopForFusion = this.getGopForFusion_(nalUnits[0], track);\n\n if (gopForFusion) {\n gops.unshift(gopForFusion); // Adjust Gops' metadata to account for the inclusion of the\n // new gop at the beginning\n\n gops.byteLength += gopForFusion.byteLength;\n gops.nalCount += gopForFusion.nalCount;\n gops.pts = gopForFusion.pts;\n gops.dts = gopForFusion.dts;\n gops.duration += gopForFusion.duration;\n } else {\n // If we didn't find a candidate gop fall back to keyframe-pulling\n gops = frameUtils.extendFirstKeyFrame(gops);\n }\n } // Trim gops to align with gopsToAlignWith\n\n\n if (gopsToAlignWith.length) {\n var alignedGops;\n\n if (options.alignGopsAtEnd) {\n alignedGops = this.alignGopsAtEnd_(gops);\n } else {\n alignedGops = this.alignGopsAtStart_(gops);\n }\n\n if (!alignedGops) {\n // save all the nals in the last GOP into the gop cache\n this.gopCache_.unshift({\n gop: gops.pop(),\n pps: track.pps,\n sps: track.sps\n }); // Keep a maximum of 6 GOPs in the cache\n\n this.gopCache_.length = Math.min(6, this.gopCache_.length); // Clear nalUnits\n\n nalUnits = []; // return early no gops can be aligned with desired gopsToAlignWith\n\n this.resetStream_();\n this.trigger('done', 'VideoSegmentStream');\n return;\n } // Some gops were trimmed. clear dts info so minSegmentDts and pts are correct\n // when recalculated before sending off to CoalesceStream\n\n\n trackDecodeInfo.clearDtsInfo(track);\n gops = alignedGops;\n }\n\n trackDecodeInfo.collectDtsInfo(track, gops); // First, we have to build the index from byte locations to\n // samples (that is, frames) in the video data\n\n track.samples = frameUtils.generateSampleTable(gops); // Concatenate the video data and construct the mdat\n\n mdat = mp4Generator.mdat(frameUtils.concatenateNalData(gops));\n track.baseMediaDecodeTime = trackDecodeInfo.calculateTrackBaseMediaDecodeTime(track, options.keepOriginalTimestamps);\n this.trigger('processedGopsInfo', gops.map(function (gop) {\n return {\n pts: gop.pts,\n dts: gop.dts,\n byteLength: gop.byteLength\n };\n })); // save all the nals in the last GOP into the gop cache\n\n this.gopCache_.unshift({\n gop: gops.pop(),\n pps: track.pps,\n sps: track.sps\n }); // Keep a maximum of 6 GOPs in the cache\n\n this.gopCache_.length = Math.min(6, this.gopCache_.length); // Clear nalUnits\n\n nalUnits = [];\n this.trigger('baseMediaDecodeTime', track.baseMediaDecodeTime);\n this.trigger('timelineStartInfo', track.timelineStartInfo);\n moof = mp4Generator.moof(sequenceNumber, [track]); // it would be great to allocate this array up front instead of\n // throwing away hundreds of media segment fragments\n\n boxes = new Uint8Array(moof.byteLength + mdat.byteLength); // Bump the sequence number for next time\n\n sequenceNumber++;\n boxes.set(moof);\n boxes.set(mdat, moof.byteLength);\n this.trigger('data', {\n track: track,\n boxes: boxes\n });\n this.resetStream_(); // Continue with the flush process now\n\n this.trigger('done', 'VideoSegmentStream');\n };\n\n this.resetStream_ = function () {\n trackDecodeInfo.clearDtsInfo(track); // reset config and pps because they may differ across segments\n // for instance, when we are rendition switching\n\n config = undefined;\n pps = undefined;\n }; // Search for a candidate Gop for gop-fusion from the gop cache and\n // return it or return null if no good candidate was found\n\n\n this.getGopForFusion_ = function (nalUnit) {\n var halfSecond = 45000,\n // Half-a-second in a 90khz clock\n allowableOverlap = 10000,\n // About 3 frames @ 30fps\n nearestDistance = Infinity,\n dtsDistance,\n nearestGopObj,\n currentGop,\n currentGopObj,\n i; // Search for the GOP nearest to the beginning of this nal unit\n\n for (i = 0; i < this.gopCache_.length; i++) {\n currentGopObj = this.gopCache_[i];\n currentGop = currentGopObj.gop; // Reject Gops with different SPS or PPS\n\n if (!(track.pps && arrayEquals(track.pps[0], currentGopObj.pps[0])) || !(track.sps && arrayEquals(track.sps[0], currentGopObj.sps[0]))) {\n continue;\n } // Reject Gops that would require a negative baseMediaDecodeTime\n\n\n if (currentGop.dts < track.timelineStartInfo.dts) {\n continue;\n } // The distance between the end of the gop and the start of the nalUnit\n\n\n dtsDistance = nalUnit.dts - currentGop.dts - currentGop.duration; // Only consider GOPS that start before the nal unit and end within\n // a half-second of the nal unit\n\n if (dtsDistance >= -allowableOverlap && dtsDistance <= halfSecond) {\n // Always use the closest GOP we found if there is more than\n // one candidate\n if (!nearestGopObj || nearestDistance > dtsDistance) {\n nearestGopObj = currentGopObj;\n nearestDistance = dtsDistance;\n }\n }\n }\n\n if (nearestGopObj) {\n return nearestGopObj.gop;\n }\n\n return null;\n }; // trim gop list to the first gop found that has a matching pts with a gop in the list\n // of gopsToAlignWith starting from the START of the list\n\n\n this.alignGopsAtStart_ = function (gops) {\n var alignIndex, gopIndex, align, gop, byteLength, nalCount, duration, alignedGops;\n byteLength = gops.byteLength;\n nalCount = gops.nalCount;\n duration = gops.duration;\n alignIndex = gopIndex = 0;\n\n while (alignIndex < gopsToAlignWith.length && gopIndex < gops.length) {\n align = gopsToAlignWith[alignIndex];\n gop = gops[gopIndex];\n\n if (align.pts === gop.pts) {\n break;\n }\n\n if (gop.pts > align.pts) {\n // this current gop starts after the current gop we want to align on, so increment\n // align index\n alignIndex++;\n continue;\n } // current gop starts before the current gop we want to align on. so increment gop\n // index\n\n\n gopIndex++;\n byteLength -= gop.byteLength;\n nalCount -= gop.nalCount;\n duration -= gop.duration;\n }\n\n if (gopIndex === 0) {\n // no gops to trim\n return gops;\n }\n\n if (gopIndex === gops.length) {\n // all gops trimmed, skip appending all gops\n return null;\n }\n\n alignedGops = gops.slice(gopIndex);\n alignedGops.byteLength = byteLength;\n alignedGops.duration = duration;\n alignedGops.nalCount = nalCount;\n alignedGops.pts = alignedGops[0].pts;\n alignedGops.dts = alignedGops[0].dts;\n return alignedGops;\n }; // trim gop list to the first gop found that has a matching pts with a gop in the list\n // of gopsToAlignWith starting from the END of the list\n\n\n this.alignGopsAtEnd_ = function (gops) {\n var alignIndex, gopIndex, align, gop, alignEndIndex, matchFound;\n alignIndex = gopsToAlignWith.length - 1;\n gopIndex = gops.length - 1;\n alignEndIndex = null;\n matchFound = false;\n\n while (alignIndex >= 0 && gopIndex >= 0) {\n align = gopsToAlignWith[alignIndex];\n gop = gops[gopIndex];\n\n if (align.pts === gop.pts) {\n matchFound = true;\n break;\n }\n\n if (align.pts > gop.pts) {\n alignIndex--;\n continue;\n }\n\n if (alignIndex === gopsToAlignWith.length - 1) {\n // gop.pts is greater than the last alignment candidate. If no match is found\n // by the end of this loop, we still want to append gops that come after this\n // point\n alignEndIndex = gopIndex;\n }\n\n gopIndex--;\n }\n\n if (!matchFound && alignEndIndex === null) {\n return null;\n }\n\n var trimIndex;\n\n if (matchFound) {\n trimIndex = gopIndex;\n } else {\n trimIndex = alignEndIndex;\n }\n\n if (trimIndex === 0) {\n return gops;\n }\n\n var alignedGops = gops.slice(trimIndex);\n var metadata = alignedGops.reduce(function (total, gop) {\n total.byteLength += gop.byteLength;\n total.duration += gop.duration;\n total.nalCount += gop.nalCount;\n return total;\n }, {\n byteLength: 0,\n duration: 0,\n nalCount: 0\n });\n alignedGops.byteLength = metadata.byteLength;\n alignedGops.duration = metadata.duration;\n alignedGops.nalCount = metadata.nalCount;\n alignedGops.pts = alignedGops[0].pts;\n alignedGops.dts = alignedGops[0].dts;\n return alignedGops;\n };\n\n this.alignGopsWith = function (newGopsToAlignWith) {\n gopsToAlignWith = newGopsToAlignWith;\n };\n };\n\n _VideoSegmentStream.prototype = new stream();\n /**\n * A Stream that can combine multiple streams (ie. audio & video)\n * into a single output segment for MSE. Also supports audio-only\n * and video-only streams.\n * @param options {object} transmuxer options object\n * @param options.keepOriginalTimestamps {boolean} If true, keep the timestamps\n * in the source; false to adjust the first segment to start at media timeline start.\n */\n\n _CoalesceStream = function CoalesceStream(options, metadataStream) {\n // Number of Tracks per output segment\n // If greater than 1, we combine multiple\n // tracks into a single segment\n this.numberOfTracks = 0;\n this.metadataStream = metadataStream;\n options = options || {};\n\n if (typeof options.remux !== 'undefined') {\n this.remuxTracks = !!options.remux;\n } else {\n this.remuxTracks = true;\n }\n\n if (typeof options.keepOriginalTimestamps === 'boolean') {\n this.keepOriginalTimestamps = options.keepOriginalTimestamps;\n }\n\n this.pendingTracks = [];\n this.videoTrack = null;\n this.pendingBoxes = [];\n this.pendingCaptions = [];\n this.pendingMetadata = [];\n this.pendingBytes = 0;\n this.emittedTracks = 0;\n\n _CoalesceStream.prototype.init.call(this); // Take output from multiple\n\n\n this.push = function (output) {\n // buffer incoming captions until the associated video segment\n // finishes\n if (output.text) {\n return this.pendingCaptions.push(output);\n } // buffer incoming id3 tags until the final flush\n\n\n if (output.frames) {\n return this.pendingMetadata.push(output);\n } // Add this track to the list of pending tracks and store\n // important information required for the construction of\n // the final segment\n\n\n this.pendingTracks.push(output.track);\n this.pendingBoxes.push(output.boxes);\n this.pendingBytes += output.boxes.byteLength;\n\n if (output.track.type === 'video') {\n this.videoTrack = output.track;\n }\n\n if (output.track.type === 'audio') {\n this.audioTrack = output.track;\n }\n };\n };\n\n _CoalesceStream.prototype = new stream();\n\n _CoalesceStream.prototype.flush = function (flushSource) {\n var offset = 0,\n event = {\n captions: [],\n captionStreams: {},\n metadata: [],\n info: {}\n },\n caption,\n id3,\n initSegment,\n timelineStartPts = 0,\n i;\n\n if (this.pendingTracks.length < this.numberOfTracks) {\n if (flushSource !== 'VideoSegmentStream' && flushSource !== 'AudioSegmentStream') {\n // Return because we haven't received a flush from a data-generating\n // portion of the segment (meaning that we have only recieved meta-data\n // or captions.)\n return;\n } else if (this.remuxTracks) {\n // Return until we have enough tracks from the pipeline to remux (if we\n // are remuxing audio and video into a single MP4)\n return;\n } else if (this.pendingTracks.length === 0) {\n // In the case where we receive a flush without any data having been\n // received we consider it an emitted track for the purposes of coalescing\n // `done` events.\n // We do this for the case where there is an audio and video track in the\n // segment but no audio data. (seen in several playlists with alternate\n // audio tracks and no audio present in the main TS segments.)\n this.emittedTracks++;\n\n if (this.emittedTracks >= this.numberOfTracks) {\n this.trigger('done');\n this.emittedTracks = 0;\n }\n\n return;\n }\n }\n\n if (this.videoTrack) {\n timelineStartPts = this.videoTrack.timelineStartInfo.pts;\n VIDEO_PROPERTIES.forEach(function (prop) {\n event.info[prop] = this.videoTrack[prop];\n }, this);\n } else if (this.audioTrack) {\n timelineStartPts = this.audioTrack.timelineStartInfo.pts;\n AUDIO_PROPERTIES.forEach(function (prop) {\n event.info[prop] = this.audioTrack[prop];\n }, this);\n }\n\n if (this.pendingTracks.length === 1) {\n event.type = this.pendingTracks[0].type;\n } else {\n event.type = 'combined';\n }\n\n this.emittedTracks += this.pendingTracks.length;\n initSegment = mp4Generator.initSegment(this.pendingTracks); // Create a new typed array to hold the init segment\n\n event.initSegment = new Uint8Array(initSegment.byteLength); // Create an init segment containing a moov\n // and track definitions\n\n event.initSegment.set(initSegment); // Create a new typed array to hold the moof+mdats\n\n event.data = new Uint8Array(this.pendingBytes); // Append each moof+mdat (one per track) together\n\n for (i = 0; i < this.pendingBoxes.length; i++) {\n event.data.set(this.pendingBoxes[i], offset);\n offset += this.pendingBoxes[i].byteLength;\n } // Translate caption PTS times into second offsets to match the\n // video timeline for the segment, and add track info\n\n\n for (i = 0; i < this.pendingCaptions.length; i++) {\n caption = this.pendingCaptions[i];\n caption.startTime = caption.startPts;\n\n if (!this.keepOriginalTimestamps) {\n caption.startTime -= timelineStartPts;\n }\n\n caption.startTime /= 90e3;\n caption.endTime = caption.endPts;\n\n if (!this.keepOriginalTimestamps) {\n caption.endTime -= timelineStartPts;\n }\n\n caption.endTime /= 90e3;\n event.captionStreams[caption.stream] = true;\n event.captions.push(caption);\n } // Translate ID3 frame PTS times into second offsets to match the\n // video timeline for the segment\n\n\n for (i = 0; i < this.pendingMetadata.length; i++) {\n id3 = this.pendingMetadata[i];\n id3.cueTime = id3.pts;\n\n if (!this.keepOriginalTimestamps) {\n id3.cueTime -= timelineStartPts;\n }\n\n id3.cueTime /= 90e3;\n event.metadata.push(id3);\n } // We add this to every single emitted segment even though we only need\n // it for the first\n\n\n event.metadata.dispatchType = this.metadataStream.dispatchType; // Reset stream state\n\n this.pendingTracks.length = 0;\n this.videoTrack = null;\n this.pendingBoxes.length = 0;\n this.pendingCaptions.length = 0;\n this.pendingBytes = 0;\n this.pendingMetadata.length = 0; // Emit the built segment\n\n this.trigger('data', event); // Only emit `done` if all tracks have been flushed and emitted\n\n if (this.emittedTracks >= this.numberOfTracks) {\n this.trigger('done');\n this.emittedTracks = 0;\n }\n };\n /**\n * A Stream that expects MP2T binary data as input and produces\n * corresponding media segments, suitable for use with Media Source\n * Extension (MSE) implementations that support the ISO BMFF byte\n * stream format, like Chrome.\n */\n\n\n _Transmuxer = function Transmuxer(options) {\n var self = this,\n hasFlushed = true,\n videoTrack,\n audioTrack;\n\n _Transmuxer.prototype.init.call(this);\n\n options = options || {};\n this.baseMediaDecodeTime = options.baseMediaDecodeTime || 0;\n this.transmuxPipeline_ = {};\n\n this.setupAacPipeline = function () {\n var pipeline = {};\n this.transmuxPipeline_ = pipeline;\n pipeline.type = 'aac';\n pipeline.metadataStream = new m2ts_1.MetadataStream(); // set up the parsing pipeline\n\n pipeline.aacStream = new aac();\n pipeline.audioTimestampRolloverStream = new m2ts_1.TimestampRolloverStream('audio');\n pipeline.timedMetadataTimestampRolloverStream = new m2ts_1.TimestampRolloverStream('timed-metadata');\n pipeline.adtsStream = new adts();\n pipeline.coalesceStream = new _CoalesceStream(options, pipeline.metadataStream);\n pipeline.headOfPipeline = pipeline.aacStream;\n pipeline.aacStream.pipe(pipeline.audioTimestampRolloverStream).pipe(pipeline.adtsStream);\n pipeline.aacStream.pipe(pipeline.timedMetadataTimestampRolloverStream).pipe(pipeline.metadataStream).pipe(pipeline.coalesceStream);\n pipeline.metadataStream.on('timestamp', function (frame) {\n pipeline.aacStream.setTimestamp(frame.timeStamp);\n });\n pipeline.aacStream.on('data', function (data) {\n if (data.type === 'timed-metadata' && !pipeline.audioSegmentStream) {\n audioTrack = audioTrack || {\n timelineStartInfo: {\n baseMediaDecodeTime: self.baseMediaDecodeTime\n },\n codec: 'adts',\n type: 'audio'\n }; // hook up the audio segment stream to the first track with aac data\n\n pipeline.coalesceStream.numberOfTracks++;\n pipeline.audioSegmentStream = new _AudioSegmentStream(audioTrack, options); // Set up the final part of the audio pipeline\n\n pipeline.adtsStream.pipe(pipeline.audioSegmentStream).pipe(pipeline.coalesceStream);\n }\n }); // Re-emit any data coming from the coalesce stream to the outside world\n\n pipeline.coalesceStream.on('data', this.trigger.bind(this, 'data')); // Let the consumer know we have finished flushing the entire pipeline\n\n pipeline.coalesceStream.on('done', this.trigger.bind(this, 'done'));\n };\n\n this.setupTsPipeline = function () {\n var pipeline = {};\n this.transmuxPipeline_ = pipeline;\n pipeline.type = 'ts';\n pipeline.metadataStream = new m2ts_1.MetadataStream(); // set up the parsing pipeline\n\n pipeline.packetStream = new m2ts_1.TransportPacketStream();\n pipeline.parseStream = new m2ts_1.TransportParseStream();\n pipeline.elementaryStream = new m2ts_1.ElementaryStream();\n pipeline.videoTimestampRolloverStream = new m2ts_1.TimestampRolloverStream('video');\n pipeline.audioTimestampRolloverStream = new m2ts_1.TimestampRolloverStream('audio');\n pipeline.timedMetadataTimestampRolloverStream = new m2ts_1.TimestampRolloverStream('timed-metadata');\n pipeline.adtsStream = new adts();\n pipeline.h264Stream = new H264Stream();\n pipeline.captionStream = new m2ts_1.CaptionStream();\n pipeline.coalesceStream = new _CoalesceStream(options, pipeline.metadataStream);\n pipeline.headOfPipeline = pipeline.packetStream; // disassemble MPEG2-TS packets into elementary streams\n\n pipeline.packetStream.pipe(pipeline.parseStream).pipe(pipeline.elementaryStream); // !!THIS ORDER IS IMPORTANT!!\n // demux the streams\n\n pipeline.elementaryStream.pipe(pipeline.videoTimestampRolloverStream).pipe(pipeline.h264Stream);\n pipeline.elementaryStream.pipe(pipeline.audioTimestampRolloverStream).pipe(pipeline.adtsStream);\n pipeline.elementaryStream.pipe(pipeline.timedMetadataTimestampRolloverStream).pipe(pipeline.metadataStream).pipe(pipeline.coalesceStream); // Hook up CEA-608/708 caption stream\n\n pipeline.h264Stream.pipe(pipeline.captionStream).pipe(pipeline.coalesceStream);\n pipeline.elementaryStream.on('data', function (data) {\n var i;\n\n if (data.type === 'metadata') {\n i = data.tracks.length; // scan the tracks listed in the metadata\n\n while (i--) {\n if (!videoTrack && data.tracks[i].type === 'video') {\n videoTrack = data.tracks[i];\n videoTrack.timelineStartInfo.baseMediaDecodeTime = self.baseMediaDecodeTime;\n } else if (!audioTrack && data.tracks[i].type === 'audio') {\n audioTrack = data.tracks[i];\n audioTrack.timelineStartInfo.baseMediaDecodeTime = self.baseMediaDecodeTime;\n }\n } // hook up the video segment stream to the first track with h264 data\n\n\n if (videoTrack && !pipeline.videoSegmentStream) {\n pipeline.coalesceStream.numberOfTracks++;\n pipeline.videoSegmentStream = new _VideoSegmentStream(videoTrack, options);\n pipeline.videoSegmentStream.on('timelineStartInfo', function (timelineStartInfo) {\n // When video emits timelineStartInfo data after a flush, we forward that\n // info to the AudioSegmentStream, if it exists, because video timeline\n // data takes precedence.\n if (audioTrack) {\n audioTrack.timelineStartInfo = timelineStartInfo; // On the first segment we trim AAC frames that exist before the\n // very earliest DTS we have seen in video because Chrome will\n // interpret any video track with a baseMediaDecodeTime that is\n // non-zero as a gap.\n\n pipeline.audioSegmentStream.setEarliestDts(timelineStartInfo.dts);\n }\n });\n pipeline.videoSegmentStream.on('processedGopsInfo', self.trigger.bind(self, 'gopInfo'));\n pipeline.videoSegmentStream.on('baseMediaDecodeTime', function (baseMediaDecodeTime) {\n if (audioTrack) {\n pipeline.audioSegmentStream.setVideoBaseMediaDecodeTime(baseMediaDecodeTime);\n }\n }); // Set up the final part of the video pipeline\n\n pipeline.h264Stream.pipe(pipeline.videoSegmentStream).pipe(pipeline.coalesceStream);\n }\n\n if (audioTrack && !pipeline.audioSegmentStream) {\n // hook up the audio segment stream to the first track with aac data\n pipeline.coalesceStream.numberOfTracks++;\n pipeline.audioSegmentStream = new _AudioSegmentStream(audioTrack, options); // Set up the final part of the audio pipeline\n\n pipeline.adtsStream.pipe(pipeline.audioSegmentStream).pipe(pipeline.coalesceStream);\n }\n }\n }); // Re-emit any data coming from the coalesce stream to the outside world\n\n pipeline.coalesceStream.on('data', this.trigger.bind(this, 'data')); // Let the consumer know we have finished flushing the entire pipeline\n\n pipeline.coalesceStream.on('done', this.trigger.bind(this, 'done'));\n }; // hook up the segment streams once track metadata is delivered\n\n\n this.setBaseMediaDecodeTime = function (baseMediaDecodeTime) {\n var pipeline = this.transmuxPipeline_;\n\n if (!options.keepOriginalTimestamps) {\n this.baseMediaDecodeTime = baseMediaDecodeTime;\n }\n\n if (audioTrack) {\n audioTrack.timelineStartInfo.dts = undefined;\n audioTrack.timelineStartInfo.pts = undefined;\n trackDecodeInfo.clearDtsInfo(audioTrack);\n\n if (!options.keepOriginalTimestamps) {\n audioTrack.timelineStartInfo.baseMediaDecodeTime = baseMediaDecodeTime;\n }\n\n if (pipeline.audioTimestampRolloverStream) {\n pipeline.audioTimestampRolloverStream.discontinuity();\n }\n }\n\n if (videoTrack) {\n if (pipeline.videoSegmentStream) {\n pipeline.videoSegmentStream.gopCache_ = [];\n pipeline.videoTimestampRolloverStream.discontinuity();\n }\n\n videoTrack.timelineStartInfo.dts = undefined;\n videoTrack.timelineStartInfo.pts = undefined;\n trackDecodeInfo.clearDtsInfo(videoTrack);\n pipeline.captionStream.reset();\n\n if (!options.keepOriginalTimestamps) {\n videoTrack.timelineStartInfo.baseMediaDecodeTime = baseMediaDecodeTime;\n }\n }\n\n if (pipeline.timedMetadataTimestampRolloverStream) {\n pipeline.timedMetadataTimestampRolloverStream.discontinuity();\n }\n };\n\n this.setAudioAppendStart = function (timestamp) {\n if (audioTrack) {\n this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(timestamp);\n }\n };\n\n this.alignGopsWith = function (gopsToAlignWith) {\n if (videoTrack && this.transmuxPipeline_.videoSegmentStream) {\n this.transmuxPipeline_.videoSegmentStream.alignGopsWith(gopsToAlignWith);\n }\n }; // feed incoming data to the front of the parsing pipeline\n\n\n this.push = function (data) {\n if (hasFlushed) {\n var isAac = isLikelyAacData$1(data);\n\n if (isAac && this.transmuxPipeline_.type !== 'aac') {\n this.setupAacPipeline();\n } else if (!isAac && this.transmuxPipeline_.type !== 'ts') {\n this.setupTsPipeline();\n }\n\n hasFlushed = false;\n }\n\n this.transmuxPipeline_.headOfPipeline.push(data);\n }; // flush any buffered data\n\n\n this.flush = function () {\n hasFlushed = true; // Start at the top of the pipeline and flush all pending work\n\n this.transmuxPipeline_.headOfPipeline.flush();\n }; // Caption data has to be reset when seeking outside buffered range\n\n\n this.resetCaptions = function () {\n if (this.transmuxPipeline_.captionStream) {\n this.transmuxPipeline_.captionStream.reset();\n }\n };\n };\n\n _Transmuxer.prototype = new stream();\n var transmuxer = {\n Transmuxer: _Transmuxer,\n VideoSegmentStream: _VideoSegmentStream,\n AudioSegmentStream: _AudioSegmentStream,\n AUDIO_PROPERTIES: AUDIO_PROPERTIES,\n VIDEO_PROPERTIES: VIDEO_PROPERTIES\n };\n\n var inspectMp4,\n _textifyMp,\n parseType$2 = probe.parseType,\n parseMp4Date = function parseMp4Date(seconds) {\n return new Date(seconds * 1000 - 2082844800000);\n },\n parseSampleFlags = function parseSampleFlags(flags) {\n return {\n isLeading: (flags[0] & 0x0c) >>> 2,\n dependsOn: flags[0] & 0x03,\n isDependedOn: (flags[1] & 0xc0) >>> 6,\n hasRedundancy: (flags[1] & 0x30) >>> 4,\n paddingValue: (flags[1] & 0x0e) >>> 1,\n isNonSyncSample: flags[1] & 0x01,\n degradationPriority: flags[2] << 8 | flags[3]\n };\n },\n nalParse = function nalParse(avcStream) {\n var avcView = new DataView(avcStream.buffer, avcStream.byteOffset, avcStream.byteLength),\n result = [],\n i,\n length;\n\n for (i = 0; i + 4 < avcStream.length; i += length) {\n length = avcView.getUint32(i);\n i += 4; // bail if this doesn't appear to be an H264 stream\n\n if (length <= 0) {\n result.push('<span style=\\'color:red;\\'>MALFORMED DATA</span>');\n continue;\n }\n\n switch (avcStream[i] & 0x1F) {\n case 0x01:\n result.push('slice_layer_without_partitioning_rbsp');\n break;\n\n case 0x05:\n result.push('slice_layer_without_partitioning_rbsp_idr');\n break;\n\n case 0x06:\n result.push('sei_rbsp');\n break;\n\n case 0x07:\n result.push('seq_parameter_set_rbsp');\n break;\n\n case 0x08:\n result.push('pic_parameter_set_rbsp');\n break;\n\n case 0x09:\n result.push('access_unit_delimiter_rbsp');\n break;\n\n default:\n result.push('UNKNOWN NAL - ' + avcStream[i] & 0x1F);\n break;\n }\n }\n\n return result;\n },\n // registry of handlers for individual mp4 box types\n parse$$1 = {\n // codingname, not a first-class box type. stsd entries share the\n // same format as real boxes so the parsing infrastructure can be\n // shared\n avc1: function avc1(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength);\n return {\n dataReferenceIndex: view.getUint16(6),\n width: view.getUint16(24),\n height: view.getUint16(26),\n horizresolution: view.getUint16(28) + view.getUint16(30) / 16,\n vertresolution: view.getUint16(32) + view.getUint16(34) / 16,\n frameCount: view.getUint16(40),\n depth: view.getUint16(74),\n config: inspectMp4(data.subarray(78, data.byteLength))\n };\n },\n avcC: function avcC(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n configurationVersion: data[0],\n avcProfileIndication: data[1],\n profileCompatibility: data[2],\n avcLevelIndication: data[3],\n lengthSizeMinusOne: data[4] & 0x03,\n sps: [],\n pps: []\n },\n numOfSequenceParameterSets = data[5] & 0x1f,\n numOfPictureParameterSets,\n nalSize,\n offset,\n i; // iterate past any SPSs\n\n offset = 6;\n\n for (i = 0; i < numOfSequenceParameterSets; i++) {\n nalSize = view.getUint16(offset);\n offset += 2;\n result.sps.push(new Uint8Array(data.subarray(offset, offset + nalSize)));\n offset += nalSize;\n } // iterate past any PPSs\n\n\n numOfPictureParameterSets = data[offset];\n offset++;\n\n for (i = 0; i < numOfPictureParameterSets; i++) {\n nalSize = view.getUint16(offset);\n offset += 2;\n result.pps.push(new Uint8Array(data.subarray(offset, offset + nalSize)));\n offset += nalSize;\n }\n\n return result;\n },\n btrt: function btrt(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength);\n return {\n bufferSizeDB: view.getUint32(0),\n maxBitrate: view.getUint32(4),\n avgBitrate: view.getUint32(8)\n };\n },\n esds: function esds(data) {\n return {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n esId: data[6] << 8 | data[7],\n streamPriority: data[8] & 0x1f,\n decoderConfig: {\n objectProfileIndication: data[11],\n streamType: data[12] >>> 2 & 0x3f,\n bufferSize: data[13] << 16 | data[14] << 8 | data[15],\n maxBitrate: data[16] << 24 | data[17] << 16 | data[18] << 8 | data[19],\n avgBitrate: data[20] << 24 | data[21] << 16 | data[22] << 8 | data[23],\n decoderConfigDescriptor: {\n tag: data[24],\n length: data[25],\n audioObjectType: data[26] >>> 3 & 0x1f,\n samplingFrequencyIndex: (data[26] & 0x07) << 1 | data[27] >>> 7 & 0x01,\n channelConfiguration: data[27] >>> 3 & 0x0f\n }\n }\n };\n },\n ftyp: function ftyp(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n majorBrand: parseType$2(data.subarray(0, 4)),\n minorVersion: view.getUint32(4),\n compatibleBrands: []\n },\n i = 8;\n\n while (i < data.byteLength) {\n result.compatibleBrands.push(parseType$2(data.subarray(i, i + 4)));\n i += 4;\n }\n\n return result;\n },\n dinf: function dinf(data) {\n return {\n boxes: inspectMp4(data)\n };\n },\n dref: function dref(data) {\n return {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n dataReferences: inspectMp4(data.subarray(8))\n };\n },\n hdlr: function hdlr(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n version: view.getUint8(0),\n flags: new Uint8Array(data.subarray(1, 4)),\n handlerType: parseType$2(data.subarray(8, 12)),\n name: ''\n },\n i = 8; // parse out the name field\n\n for (i = 24; i < data.byteLength; i++) {\n if (data[i] === 0x00) {\n // the name field is null-terminated\n i++;\n break;\n }\n\n result.name += String.fromCharCode(data[i]);\n } // decode UTF-8 to javascript's internal representation\n // see http://ecmanaut.blogspot.com/2006/07/encoding-decoding-utf8-in-javascript.html\n\n\n result.name = decodeURIComponent(escape(result.name));\n return result;\n },\n mdat: function mdat(data) {\n return {\n byteLength: data.byteLength,\n nals: nalParse(data)\n };\n },\n mdhd: function mdhd(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n i = 4,\n language,\n result = {\n version: view.getUint8(0),\n flags: new Uint8Array(data.subarray(1, 4)),\n language: ''\n };\n\n if (result.version === 1) {\n i += 4;\n result.creationTime = parseMp4Date(view.getUint32(i)); // truncating top 4 bytes\n\n i += 8;\n result.modificationTime = parseMp4Date(view.getUint32(i)); // truncating top 4 bytes\n\n i += 4;\n result.timescale = view.getUint32(i);\n i += 8;\n result.duration = view.getUint32(i); // truncating top 4 bytes\n } else {\n result.creationTime = parseMp4Date(view.getUint32(i));\n i += 4;\n result.modificationTime = parseMp4Date(view.getUint32(i));\n i += 4;\n result.timescale = view.getUint32(i);\n i += 4;\n result.duration = view.getUint32(i);\n }\n\n i += 4; // language is stored as an ISO-639-2/T code in an array of three 5-bit fields\n // each field is the packed difference between its ASCII value and 0x60\n\n language = view.getUint16(i);\n result.language += String.fromCharCode((language >> 10) + 0x60);\n result.language += String.fromCharCode(((language & 0x03e0) >> 5) + 0x60);\n result.language += String.fromCharCode((language & 0x1f) + 0x60);\n return result;\n },\n mdia: function mdia(data) {\n return {\n boxes: inspectMp4(data)\n };\n },\n mfhd: function mfhd(data) {\n return {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n sequenceNumber: data[4] << 24 | data[5] << 16 | data[6] << 8 | data[7]\n };\n },\n minf: function minf(data) {\n return {\n boxes: inspectMp4(data)\n };\n },\n // codingname, not a first-class box type. stsd entries share the\n // same format as real boxes so the parsing infrastructure can be\n // shared\n mp4a: function mp4a(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n // 6 bytes reserved\n dataReferenceIndex: view.getUint16(6),\n // 4 + 4 bytes reserved\n channelcount: view.getUint16(16),\n samplesize: view.getUint16(18),\n // 2 bytes pre_defined\n // 2 bytes reserved\n samplerate: view.getUint16(24) + view.getUint16(26) / 65536\n }; // if there are more bytes to process, assume this is an ISO/IEC\n // 14496-14 MP4AudioSampleEntry and parse the ESDBox\n\n if (data.byteLength > 28) {\n result.streamDescriptor = inspectMp4(data.subarray(28))[0];\n }\n\n return result;\n },\n moof: function moof(data) {\n return {\n boxes: inspectMp4(data)\n };\n },\n moov: function moov(data) {\n return {\n boxes: inspectMp4(data)\n };\n },\n mvex: function mvex(data) {\n return {\n boxes: inspectMp4(data)\n };\n },\n mvhd: function mvhd(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n i = 4,\n result = {\n version: view.getUint8(0),\n flags: new Uint8Array(data.subarray(1, 4))\n };\n\n if (result.version === 1) {\n i += 4;\n result.creationTime = parseMp4Date(view.getUint32(i)); // truncating top 4 bytes\n\n i += 8;\n result.modificationTime = parseMp4Date(view.getUint32(i)); // truncating top 4 bytes\n\n i += 4;\n result.timescale = view.getUint32(i);\n i += 8;\n result.duration = view.getUint32(i); // truncating top 4 bytes\n } else {\n result.creationTime = parseMp4Date(view.getUint32(i));\n i += 4;\n result.modificationTime = parseMp4Date(view.getUint32(i));\n i += 4;\n result.timescale = view.getUint32(i);\n i += 4;\n result.duration = view.getUint32(i);\n }\n\n i += 4; // convert fixed-point, base 16 back to a number\n\n result.rate = view.getUint16(i) + view.getUint16(i + 2) / 16;\n i += 4;\n result.volume = view.getUint8(i) + view.getUint8(i + 1) / 8;\n i += 2;\n i += 2;\n i += 2 * 4;\n result.matrix = new Uint32Array(data.subarray(i, i + 9 * 4));\n i += 9 * 4;\n i += 6 * 4;\n result.nextTrackId = view.getUint32(i);\n return result;\n },\n pdin: function pdin(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength);\n return {\n version: view.getUint8(0),\n flags: new Uint8Array(data.subarray(1, 4)),\n rate: view.getUint32(4),\n initialDelay: view.getUint32(8)\n };\n },\n sdtp: function sdtp(data) {\n var result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n samples: []\n },\n i;\n\n for (i = 4; i < data.byteLength; i++) {\n result.samples.push({\n dependsOn: (data[i] & 0x30) >> 4,\n isDependedOn: (data[i] & 0x0c) >> 2,\n hasRedundancy: data[i] & 0x03\n });\n }\n\n return result;\n },\n sidx: function sidx(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n references: [],\n referenceId: view.getUint32(4),\n timescale: view.getUint32(8),\n earliestPresentationTime: view.getUint32(12),\n firstOffset: view.getUint32(16)\n },\n referenceCount = view.getUint16(22),\n i;\n\n for (i = 24; referenceCount; i += 12, referenceCount--) {\n result.references.push({\n referenceType: (data[i] & 0x80) >>> 7,\n referencedSize: view.getUint32(i) & 0x7FFFFFFF,\n subsegmentDuration: view.getUint32(i + 4),\n startsWithSap: !!(data[i + 8] & 0x80),\n sapType: (data[i + 8] & 0x70) >>> 4,\n sapDeltaTime: view.getUint32(i + 8) & 0x0FFFFFFF\n });\n }\n\n return result;\n },\n smhd: function smhd(data) {\n return {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n balance: data[4] + data[5] / 256\n };\n },\n stbl: function stbl(data) {\n return {\n boxes: inspectMp4(data)\n };\n },\n stco: function stco(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n chunkOffsets: []\n },\n entryCount = view.getUint32(4),\n i;\n\n for (i = 8; entryCount; i += 4, entryCount--) {\n result.chunkOffsets.push(view.getUint32(i));\n }\n\n return result;\n },\n stsc: function stsc(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n entryCount = view.getUint32(4),\n result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n sampleToChunks: []\n },\n i;\n\n for (i = 8; entryCount; i += 12, entryCount--) {\n result.sampleToChunks.push({\n firstChunk: view.getUint32(i),\n samplesPerChunk: view.getUint32(i + 4),\n sampleDescriptionIndex: view.getUint32(i + 8)\n });\n }\n\n return result;\n },\n stsd: function stsd(data) {\n return {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n sampleDescriptions: inspectMp4(data.subarray(8))\n };\n },\n stsz: function stsz(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n sampleSize: view.getUint32(4),\n entries: []\n },\n i;\n\n for (i = 12; i < data.byteLength; i += 4) {\n result.entries.push(view.getUint32(i));\n }\n\n return result;\n },\n stts: function stts(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n timeToSamples: []\n },\n entryCount = view.getUint32(4),\n i;\n\n for (i = 8; entryCount; i += 8, entryCount--) {\n result.timeToSamples.push({\n sampleCount: view.getUint32(i),\n sampleDelta: view.getUint32(i + 4)\n });\n }\n\n return result;\n },\n styp: function styp(data) {\n return parse$$1.ftyp(data);\n },\n tfdt: function tfdt(data) {\n var result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n baseMediaDecodeTime: data[4] << 24 | data[5] << 16 | data[6] << 8 | data[7]\n };\n\n if (result.version === 1) {\n result.baseMediaDecodeTime *= Math.pow(2, 32);\n result.baseMediaDecodeTime += data[8] << 24 | data[9] << 16 | data[10] << 8 | data[11];\n }\n\n return result;\n },\n tfhd: function tfhd(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n trackId: view.getUint32(4)\n },\n baseDataOffsetPresent = result.flags[2] & 0x01,\n sampleDescriptionIndexPresent = result.flags[2] & 0x02,\n defaultSampleDurationPresent = result.flags[2] & 0x08,\n defaultSampleSizePresent = result.flags[2] & 0x10,\n defaultSampleFlagsPresent = result.flags[2] & 0x20,\n durationIsEmpty = result.flags[0] & 0x010000,\n defaultBaseIsMoof = result.flags[0] & 0x020000,\n i;\n i = 8;\n\n if (baseDataOffsetPresent) {\n i += 4; // truncate top 4 bytes\n // FIXME: should we read the full 64 bits?\n\n result.baseDataOffset = view.getUint32(12);\n i += 4;\n }\n\n if (sampleDescriptionIndexPresent) {\n result.sampleDescriptionIndex = view.getUint32(i);\n i += 4;\n }\n\n if (defaultSampleDurationPresent) {\n result.defaultSampleDuration = view.getUint32(i);\n i += 4;\n }\n\n if (defaultSampleSizePresent) {\n result.defaultSampleSize = view.getUint32(i);\n i += 4;\n }\n\n if (defaultSampleFlagsPresent) {\n result.defaultSampleFlags = view.getUint32(i);\n }\n\n if (durationIsEmpty) {\n result.durationIsEmpty = true;\n }\n\n if (!baseDataOffsetPresent && defaultBaseIsMoof) {\n result.baseDataOffsetIsMoof = true;\n }\n\n return result;\n },\n tkhd: function tkhd(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n i = 4,\n result = {\n version: view.getUint8(0),\n flags: new Uint8Array(data.subarray(1, 4))\n };\n\n if (result.version === 1) {\n i += 4;\n result.creationTime = parseMp4Date(view.getUint32(i)); // truncating top 4 bytes\n\n i += 8;\n result.modificationTime = parseMp4Date(view.getUint32(i)); // truncating top 4 bytes\n\n i += 4;\n result.trackId = view.getUint32(i);\n i += 4;\n i += 8;\n result.duration = view.getUint32(i); // truncating top 4 bytes\n } else {\n result.creationTime = parseMp4Date(view.getUint32(i));\n i += 4;\n result.modificationTime = parseMp4Date(view.getUint32(i));\n i += 4;\n result.trackId = view.getUint32(i);\n i += 4;\n i += 4;\n result.duration = view.getUint32(i);\n }\n\n i += 4;\n i += 2 * 4;\n result.layer = view.getUint16(i);\n i += 2;\n result.alternateGroup = view.getUint16(i);\n i += 2; // convert fixed-point, base 16 back to a number\n\n result.volume = view.getUint8(i) + view.getUint8(i + 1) / 8;\n i += 2;\n i += 2;\n result.matrix = new Uint32Array(data.subarray(i, i + 9 * 4));\n i += 9 * 4;\n result.width = view.getUint16(i) + view.getUint16(i + 2) / 16;\n i += 4;\n result.height = view.getUint16(i) + view.getUint16(i + 2) / 16;\n return result;\n },\n traf: function traf(data) {\n return {\n boxes: inspectMp4(data)\n };\n },\n trak: function trak(data) {\n return {\n boxes: inspectMp4(data)\n };\n },\n trex: function trex(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength);\n return {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n trackId: view.getUint32(4),\n defaultSampleDescriptionIndex: view.getUint32(8),\n defaultSampleDuration: view.getUint32(12),\n defaultSampleSize: view.getUint32(16),\n sampleDependsOn: data[20] & 0x03,\n sampleIsDependedOn: (data[21] & 0xc0) >> 6,\n sampleHasRedundancy: (data[21] & 0x30) >> 4,\n samplePaddingValue: (data[21] & 0x0e) >> 1,\n sampleIsDifferenceSample: !!(data[21] & 0x01),\n sampleDegradationPriority: view.getUint16(22)\n };\n },\n trun: function trun(data) {\n var result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n samples: []\n },\n view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n // Flag interpretation\n dataOffsetPresent = result.flags[2] & 0x01,\n // compare with 2nd byte of 0x1\n firstSampleFlagsPresent = result.flags[2] & 0x04,\n // compare with 2nd byte of 0x4\n sampleDurationPresent = result.flags[1] & 0x01,\n // compare with 2nd byte of 0x100\n sampleSizePresent = result.flags[1] & 0x02,\n // compare with 2nd byte of 0x200\n sampleFlagsPresent = result.flags[1] & 0x04,\n // compare with 2nd byte of 0x400\n sampleCompositionTimeOffsetPresent = result.flags[1] & 0x08,\n // compare with 2nd byte of 0x800\n sampleCount = view.getUint32(4),\n offset = 8,\n sample;\n\n if (dataOffsetPresent) {\n // 32 bit signed integer\n result.dataOffset = view.getInt32(offset);\n offset += 4;\n } // Overrides the flags for the first sample only. The order of\n // optional values will be: duration, size, compositionTimeOffset\n\n\n if (firstSampleFlagsPresent && sampleCount) {\n sample = {\n flags: parseSampleFlags(data.subarray(offset, offset + 4))\n };\n offset += 4;\n\n if (sampleDurationPresent) {\n sample.duration = view.getUint32(offset);\n offset += 4;\n }\n\n if (sampleSizePresent) {\n sample.size = view.getUint32(offset);\n offset += 4;\n }\n\n if (sampleCompositionTimeOffsetPresent) {\n // Note: this should be a signed int if version is 1\n sample.compositionTimeOffset = view.getUint32(offset);\n offset += 4;\n }\n\n result.samples.push(sample);\n sampleCount--;\n }\n\n while (sampleCount--) {\n sample = {};\n\n if (sampleDurationPresent) {\n sample.duration = view.getUint32(offset);\n offset += 4;\n }\n\n if (sampleSizePresent) {\n sample.size = view.getUint32(offset);\n offset += 4;\n }\n\n if (sampleFlagsPresent) {\n sample.flags = parseSampleFlags(data.subarray(offset, offset + 4));\n offset += 4;\n }\n\n if (sampleCompositionTimeOffsetPresent) {\n // Note: this should be a signed int if version is 1\n sample.compositionTimeOffset = view.getUint32(offset);\n offset += 4;\n }\n\n result.samples.push(sample);\n }\n\n return result;\n },\n 'url ': function url(data) {\n return {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4))\n };\n },\n vmhd: function vmhd(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength);\n return {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n graphicsmode: view.getUint16(4),\n opcolor: new Uint16Array([view.getUint16(6), view.getUint16(8), view.getUint16(10)])\n };\n }\n };\n /**\n * Return a javascript array of box objects parsed from an ISO base\n * media file.\n * @param data {Uint8Array} the binary data of the media to be inspected\n * @return {array} a javascript array of potentially nested box objects\n */\n\n\n inspectMp4 = function inspectMp4(data) {\n var i = 0,\n result = [],\n view,\n size,\n type,\n end,\n box; // Convert data from Uint8Array to ArrayBuffer, to follow Dataview API\n\n var ab = new ArrayBuffer(data.length);\n var v = new Uint8Array(ab);\n\n for (var z = 0; z < data.length; ++z) {\n v[z] = data[z];\n }\n\n view = new DataView(ab);\n\n while (i < data.byteLength) {\n // parse box data\n size = view.getUint32(i);\n type = parseType$2(data.subarray(i + 4, i + 8));\n end = size > 1 ? i + size : data.byteLength; // parse type-specific data\n\n box = (parse$$1[type] || function (data) {\n return {\n data: data\n };\n })(data.subarray(i + 8, end));\n\n box.size = size;\n box.type = type; // store this box and move to the next\n\n result.push(box);\n i = end;\n }\n\n return result;\n };\n /**\n * Returns a textual representation of the javascript represtentation\n * of an MP4 file. You can use it as an alternative to\n * JSON.stringify() to compare inspected MP4s.\n * @param inspectedMp4 {array} the parsed array of boxes in an MP4\n * file\n * @param depth {number} (optional) the number of ancestor boxes of\n * the elements of inspectedMp4. Assumed to be zero if unspecified.\n * @return {string} a text representation of the parsed MP4\n */\n\n\n _textifyMp = function textifyMp4(inspectedMp4, depth) {\n var indent;\n depth = depth || 0;\n indent = new Array(depth * 2 + 1).join(' '); // iterate over all the boxes\n\n return inspectedMp4.map(function (box, index) {\n // list the box type first at the current indentation level\n return indent + box.type + '\\n' + // the type is already included and handle child boxes separately\n Object.keys(box).filter(function (key) {\n return key !== 'type' && key !== 'boxes'; // output all the box properties\n }).map(function (key) {\n var prefix = indent + ' ' + key + ': ',\n value = box[key]; // print out raw bytes as hexademical\n\n if (value instanceof Uint8Array || value instanceof Uint32Array) {\n var bytes = Array.prototype.slice.call(new Uint8Array(value.buffer, value.byteOffset, value.byteLength)).map(function (byte) {\n return ' ' + ('00' + byte.toString(16)).slice(-2);\n }).join('').match(/.{1,24}/g);\n\n if (!bytes) {\n return prefix + '<>';\n }\n\n if (bytes.length === 1) {\n return prefix + '<' + bytes.join('').slice(1) + '>';\n }\n\n return prefix + '<\\n' + bytes.map(function (line) {\n return indent + ' ' + line;\n }).join('\\n') + '\\n' + indent + ' >';\n } // stringify generic objects\n\n\n return prefix + JSON.stringify(value, null, 2).split('\\n').map(function (line, index) {\n if (index === 0) {\n return line;\n }\n\n return indent + ' ' + line;\n }).join('\\n');\n }).join('\\n') + ( // recursively textify the child boxes\n box.boxes ? '\\n' + _textifyMp(box.boxes, depth + 1) : '');\n }).join('\\n');\n };\n\n var mp4Inspector = {\n inspect: inspectMp4,\n textify: _textifyMp,\n parseTfdt: parse$$1.tfdt,\n parseHdlr: parse$$1.hdlr,\n parseTfhd: parse$$1.tfhd,\n parseTrun: parse$$1.trun\n };\n var discardEmulationPreventionBytes$1 = captionPacketParser.discardEmulationPreventionBytes;\n var CaptionStream$1 = captionStream.CaptionStream;\n /**\n * Maps an offset in the mdat to a sample based on the the size of the samples.\n * Assumes that `parseSamples` has been called first.\n *\n * @param {Number} offset - The offset into the mdat\n * @param {Object[]} samples - An array of samples, parsed using `parseSamples`\n * @return {?Object} The matching sample, or null if no match was found.\n *\n * @see ISO-BMFF-12/2015, Section 8.8.8\n **/\n\n var mapToSample = function mapToSample(offset, samples) {\n var approximateOffset = offset;\n\n for (var i = 0; i < samples.length; i++) {\n var sample = samples[i];\n\n if (approximateOffset < sample.size) {\n return sample;\n }\n\n approximateOffset -= sample.size;\n }\n\n return null;\n };\n /**\n * Finds SEI nal units contained in a Media Data Box.\n * Assumes that `parseSamples` has been called first.\n *\n * @param {Uint8Array} avcStream - The bytes of the mdat\n * @param {Object[]} samples - The samples parsed out by `parseSamples`\n * @param {Number} trackId - The trackId of this video track\n * @return {Object[]} seiNals - the parsed SEI NALUs found.\n * The contents of the seiNal should match what is expected by\n * CaptionStream.push (nalUnitType, size, data, escapedRBSP, pts, dts)\n *\n * @see ISO-BMFF-12/2015, Section 8.1.1\n * @see Rec. ITU-T H.264, 7.3.2.3.1\n **/\n\n\n var findSeiNals = function findSeiNals(avcStream, samples, trackId) {\n var avcView = new DataView(avcStream.buffer, avcStream.byteOffset, avcStream.byteLength),\n result = [],\n seiNal,\n i,\n length,\n lastMatchedSample;\n\n for (i = 0; i + 4 < avcStream.length; i += length) {\n length = avcView.getUint32(i);\n i += 4; // Bail if this doesn't appear to be an H264 stream\n\n if (length <= 0) {\n continue;\n }\n\n switch (avcStream[i] & 0x1F) {\n case 0x06:\n var data = avcStream.subarray(i + 1, i + 1 + length);\n var matchingSample = mapToSample(i, samples);\n seiNal = {\n nalUnitType: 'sei_rbsp',\n size: length,\n data: data,\n escapedRBSP: discardEmulationPreventionBytes$1(data),\n trackId: trackId\n };\n\n if (matchingSample) {\n seiNal.pts = matchingSample.pts;\n seiNal.dts = matchingSample.dts;\n lastMatchedSample = matchingSample;\n } else {\n // If a matching sample cannot be found, use the last\n // sample's values as they should be as close as possible\n seiNal.pts = lastMatchedSample.pts;\n seiNal.dts = lastMatchedSample.dts;\n }\n\n result.push(seiNal);\n break;\n\n default:\n break;\n }\n }\n\n return result;\n };\n /**\n * Parses sample information out of Track Run Boxes and calculates\n * the absolute presentation and decode timestamps of each sample.\n *\n * @param {Array<Uint8Array>} truns - The Trun Run boxes to be parsed\n * @param {Number} baseMediaDecodeTime - base media decode time from tfdt\n @see ISO-BMFF-12/2015, Section 8.8.12\n * @param {Object} tfhd - The parsed Track Fragment Header\n * @see inspect.parseTfhd\n * @return {Object[]} the parsed samples\n *\n * @see ISO-BMFF-12/2015, Section 8.8.8\n **/\n\n\n var parseSamples = function parseSamples(truns, baseMediaDecodeTime, tfhd) {\n var currentDts = baseMediaDecodeTime;\n var defaultSampleDuration = tfhd.defaultSampleDuration || 0;\n var defaultSampleSize = tfhd.defaultSampleSize || 0;\n var trackId = tfhd.trackId;\n var allSamples = [];\n truns.forEach(function (trun) {\n // Note: We currently do not parse the sample table as well\n // as the trun. It's possible some sources will require this.\n // moov > trak > mdia > minf > stbl\n var trackRun = mp4Inspector.parseTrun(trun);\n var samples = trackRun.samples;\n samples.forEach(function (sample) {\n if (sample.duration === undefined) {\n sample.duration = defaultSampleDuration;\n }\n\n if (sample.size === undefined) {\n sample.size = defaultSampleSize;\n }\n\n sample.trackId = trackId;\n sample.dts = currentDts;\n\n if (sample.compositionTimeOffset === undefined) {\n sample.compositionTimeOffset = 0;\n }\n\n sample.pts = currentDts + sample.compositionTimeOffset;\n currentDts += sample.duration;\n });\n allSamples = allSamples.concat(samples);\n });\n return allSamples;\n };\n /**\n * Parses out caption nals from an FMP4 segment's video tracks.\n *\n * @param {Uint8Array} segment - The bytes of a single segment\n * @param {Number} videoTrackId - The trackId of a video track in the segment\n * @return {Object.<Number, Object[]>} A mapping of video trackId to\n * a list of seiNals found in that track\n **/\n\n\n var parseCaptionNals = function parseCaptionNals(segment, videoTrackId) {\n // To get the samples\n var trafs = probe.findBox(segment, ['moof', 'traf']); // To get SEI NAL units\n\n var mdats = probe.findBox(segment, ['mdat']);\n var captionNals = {};\n var mdatTrafPairs = []; // Pair up each traf with a mdat as moofs and mdats are in pairs\n\n mdats.forEach(function (mdat, index) {\n var matchingTraf = trafs[index];\n mdatTrafPairs.push({\n mdat: mdat,\n traf: matchingTraf\n });\n });\n mdatTrafPairs.forEach(function (pair) {\n var mdat = pair.mdat;\n var traf = pair.traf;\n var tfhd = probe.findBox(traf, ['tfhd']); // Exactly 1 tfhd per traf\n\n var headerInfo = mp4Inspector.parseTfhd(tfhd[0]);\n var trackId = headerInfo.trackId;\n var tfdt = probe.findBox(traf, ['tfdt']); // Either 0 or 1 tfdt per traf\n\n var baseMediaDecodeTime = tfdt.length > 0 ? mp4Inspector.parseTfdt(tfdt[0]).baseMediaDecodeTime : 0;\n var truns = probe.findBox(traf, ['trun']);\n var samples;\n var seiNals; // Only parse video data for the chosen video track\n\n if (videoTrackId === trackId && truns.length > 0) {\n samples = parseSamples(truns, baseMediaDecodeTime, headerInfo);\n seiNals = findSeiNals(mdat, samples, trackId);\n\n if (!captionNals[trackId]) {\n captionNals[trackId] = [];\n }\n\n captionNals[trackId] = captionNals[trackId].concat(seiNals);\n }\n });\n return captionNals;\n };\n /**\n * Parses out inband captions from an MP4 container and returns\n * caption objects that can be used by WebVTT and the TextTrack API.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/VTTCue\n * @see https://developer.mozilla.org/en-US/docs/Web/API/TextTrack\n * Assumes that `probe.getVideoTrackIds` and `probe.timescale` have been called first\n *\n * @param {Uint8Array} segment - The fmp4 segment containing embedded captions\n * @param {Number} trackId - The id of the video track to parse\n * @param {Number} timescale - The timescale for the video track from the init segment\n *\n * @return {?Object[]} parsedCaptions - A list of captions or null if no video tracks\n * @return {Number} parsedCaptions[].startTime - The time to show the caption in seconds\n * @return {Number} parsedCaptions[].endTime - The time to stop showing the caption in seconds\n * @return {String} parsedCaptions[].text - The visible content of the caption\n **/\n\n\n var parseEmbeddedCaptions = function parseEmbeddedCaptions(segment, trackId, timescale) {\n var seiNals;\n\n if (!trackId) {\n return null;\n }\n\n seiNals = parseCaptionNals(segment, trackId);\n return {\n seiNals: seiNals[trackId],\n timescale: timescale\n };\n };\n /**\n * Converts SEI NALUs into captions that can be used by video.js\n **/\n\n\n var CaptionParser$$1 = function CaptionParser$$1() {\n var isInitialized = false;\n var captionStream$$1; // Stores segments seen before trackId and timescale are set\n\n var segmentCache; // Stores video track ID of the track being parsed\n\n var trackId; // Stores the timescale of the track being parsed\n\n var timescale; // Stores captions parsed so far\n\n var parsedCaptions;\n /**\n * A method to indicate whether a CaptionParser has been initalized\n * @returns {Boolean}\n **/\n\n this.isInitialized = function () {\n return isInitialized;\n };\n /**\n * Initializes the underlying CaptionStream, SEI NAL parsing\n * and management, and caption collection\n **/\n\n\n this.init = function () {\n captionStream$$1 = new CaptionStream$1();\n isInitialized = true; // Collect dispatched captions\n\n captionStream$$1.on('data', function (event) {\n // Convert to seconds in the source's timescale\n event.startTime = event.startPts / timescale;\n event.endTime = event.endPts / timescale;\n parsedCaptions.captions.push(event);\n parsedCaptions.captionStreams[event.stream] = true;\n });\n };\n /**\n * Determines if a new video track will be selected\n * or if the timescale changed\n * @return {Boolean}\n **/\n\n\n this.isNewInit = function (videoTrackIds, timescales) {\n if (videoTrackIds && videoTrackIds.length === 0 || timescales && typeof timescales === 'object' && Object.keys(timescales).length === 0) {\n return false;\n }\n\n return trackId !== videoTrackIds[0] || timescale !== timescales[trackId];\n };\n /**\n * Parses out SEI captions and interacts with underlying\n * CaptionStream to return dispatched captions\n *\n * @param {Uint8Array} segment - The fmp4 segment containing embedded captions\n * @param {Number[]} videoTrackIds - A list of video tracks found in the init segment\n * @param {Object.<Number, Number>} timescales - The timescales found in the init segment\n * @see parseEmbeddedCaptions\n * @see m2ts/caption-stream.js\n **/\n\n\n this.parse = function (segment, videoTrackIds, timescales) {\n var parsedData;\n\n if (!this.isInitialized()) {\n return null; // This is not likely to be a video segment\n } else if (!videoTrackIds || !timescales) {\n return null;\n } else if (this.isNewInit(videoTrackIds, timescales)) {\n // Use the first video track only as there is no\n // mechanism to switch to other video tracks\n trackId = videoTrackIds[0];\n timescale = timescales[trackId]; // If an init segment has not been seen yet, hold onto segment\n // data until we have one\n } else if (!trackId || !timescale) {\n segmentCache.push(segment);\n return null;\n } // Now that a timescale and trackId is set, parse cached segments\n\n\n while (segmentCache.length > 0) {\n var cachedSegment = segmentCache.shift();\n this.parse(cachedSegment, videoTrackIds, timescales);\n }\n\n parsedData = parseEmbeddedCaptions(segment, trackId, timescale);\n\n if (parsedData === null || !parsedData.seiNals) {\n return null;\n }\n\n this.pushNals(parsedData.seiNals); // Force the parsed captions to be dispatched\n\n this.flushStream();\n return parsedCaptions;\n };\n /**\n * Pushes SEI NALUs onto CaptionStream\n * @param {Object[]} nals - A list of SEI nals parsed using `parseCaptionNals`\n * Assumes that `parseCaptionNals` has been called first\n * @see m2ts/caption-stream.js\n **/\n\n\n this.pushNals = function (nals) {\n if (!this.isInitialized() || !nals || nals.length === 0) {\n return null;\n }\n\n nals.forEach(function (nal) {\n captionStream$$1.push(nal);\n });\n };\n /**\n * Flushes underlying CaptionStream to dispatch processed, displayable captions\n * @see m2ts/caption-stream.js\n **/\n\n\n this.flushStream = function () {\n if (!this.isInitialized()) {\n return null;\n }\n\n captionStream$$1.flush();\n };\n /**\n * Reset caption buckets for new data\n **/\n\n\n this.clearParsedCaptions = function () {\n parsedCaptions.captions = [];\n parsedCaptions.captionStreams = {};\n };\n /**\n * Resets underlying CaptionStream\n * @see m2ts/caption-stream.js\n **/\n\n\n this.resetCaptionStream = function () {\n if (!this.isInitialized()) {\n return null;\n }\n\n captionStream$$1.reset();\n };\n /**\n * Convenience method to clear all captions flushed from the\n * CaptionStream and still being parsed\n * @see m2ts/caption-stream.js\n **/\n\n\n this.clearAllCaptions = function () {\n this.clearParsedCaptions();\n this.resetCaptionStream();\n };\n /**\n * Reset caption parser\n **/\n\n\n this.reset = function () {\n segmentCache = [];\n trackId = null;\n timescale = null;\n\n if (!parsedCaptions) {\n parsedCaptions = {\n captions: [],\n // CC1, CC2, CC3, CC4\n captionStreams: {}\n };\n } else {\n this.clearParsedCaptions();\n }\n\n this.resetCaptionStream();\n };\n\n this.reset();\n };\n\n var captionParser = CaptionParser$$1;\n var mp4 = {\n generator: mp4Generator,\n probe: probe,\n Transmuxer: transmuxer.Transmuxer,\n AudioSegmentStream: transmuxer.AudioSegmentStream,\n VideoSegmentStream: transmuxer.VideoSegmentStream,\n CaptionParser: captionParser\n };\n\n var classCallCheck = function classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n };\n\n var createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n }();\n /**\n * @file transmuxer-worker.js\n */\n\n /**\n * Re-emits transmuxer events by converting them into messages to the\n * world outside the worker.\n *\n * @param {Object} transmuxer the transmuxer to wire events on\n * @private\n */\n\n\n var wireTransmuxerEvents = function wireTransmuxerEvents(self, transmuxer) {\n transmuxer.on('data', function (segment) {\n // transfer ownership of the underlying ArrayBuffer\n // instead of doing a copy to save memory\n // ArrayBuffers are transferable but generic TypedArrays are not\n // @link https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers#Passing_data_by_transferring_ownership_(transferable_objects)\n var initArray = segment.initSegment;\n segment.initSegment = {\n data: initArray.buffer,\n byteOffset: initArray.byteOffset,\n byteLength: initArray.byteLength\n };\n var typedArray = segment.data;\n segment.data = typedArray.buffer;\n self.postMessage({\n action: 'data',\n segment: segment,\n byteOffset: typedArray.byteOffset,\n byteLength: typedArray.byteLength\n }, [segment.data]);\n });\n\n if (transmuxer.captionStream) {\n transmuxer.captionStream.on('data', function (caption) {\n self.postMessage({\n action: 'caption',\n data: caption\n });\n });\n }\n\n transmuxer.on('done', function (data) {\n self.postMessage({\n action: 'done'\n });\n });\n transmuxer.on('gopInfo', function (gopInfo) {\n self.postMessage({\n action: 'gopInfo',\n gopInfo: gopInfo\n });\n });\n };\n /**\n * All incoming messages route through this hash. If no function exists\n * to handle an incoming message, then we ignore the message.\n *\n * @class MessageHandlers\n * @param {Object} options the options to initialize with\n */\n\n\n var MessageHandlers = function () {\n function MessageHandlers(self, options) {\n classCallCheck(this, MessageHandlers);\n this.options = options || {};\n this.self = self;\n this.init();\n }\n /**\n * initialize our web worker and wire all the events.\n */\n\n\n createClass(MessageHandlers, [{\n key: 'init',\n value: function init() {\n if (this.transmuxer) {\n this.transmuxer.dispose();\n }\n\n this.transmuxer = new mp4.Transmuxer(this.options);\n wireTransmuxerEvents(this.self, this.transmuxer);\n }\n /**\n * Adds data (a ts segment) to the start of the transmuxer pipeline for\n * processing.\n *\n * @param {ArrayBuffer} data data to push into the muxer\n */\n\n }, {\n key: 'push',\n value: function push(data) {\n // Cast array buffer to correct type for transmuxer\n var segment = new Uint8Array(data.data, data.byteOffset, data.byteLength);\n this.transmuxer.push(segment);\n }\n /**\n * Recreate the transmuxer so that the next segment added via `push`\n * start with a fresh transmuxer.\n */\n\n }, {\n key: 'reset',\n value: function reset() {\n this.init();\n }\n /**\n * Set the value that will be used as the `baseMediaDecodeTime` time for the\n * next segment pushed in. Subsequent segments will have their `baseMediaDecodeTime`\n * set relative to the first based on the PTS values.\n *\n * @param {Object} data used to set the timestamp offset in the muxer\n */\n\n }, {\n key: 'setTimestampOffset',\n value: function setTimestampOffset(data) {\n var timestampOffset = data.timestampOffset || 0;\n this.transmuxer.setBaseMediaDecodeTime(Math.round(timestampOffset * 90000));\n }\n }, {\n key: 'setAudioAppendStart',\n value: function setAudioAppendStart(data) {\n this.transmuxer.setAudioAppendStart(Math.ceil(data.appendStart * 90000));\n }\n /**\n * Forces the pipeline to finish processing the last segment and emit it's\n * results.\n *\n * @param {Object} data event data, not really used\n */\n\n }, {\n key: 'flush',\n value: function flush(data) {\n this.transmuxer.flush();\n }\n }, {\n key: 'resetCaptions',\n value: function resetCaptions() {\n this.transmuxer.resetCaptions();\n }\n }, {\n key: 'alignGopsWith',\n value: function alignGopsWith(data) {\n this.transmuxer.alignGopsWith(data.gopsToAlignWith.slice());\n }\n }]);\n return MessageHandlers;\n }();\n /**\n * Our web wroker interface so that things can talk to mux.js\n * that will be running in a web worker. the scope is passed to this by\n * webworkify.\n *\n * @param {Object} self the scope for the web worker\n */\n\n\n var TransmuxerWorker = function TransmuxerWorker(self) {\n self.onmessage = function (event) {\n if (event.data.action === 'init' && event.data.options) {\n this.messageHandlers = new MessageHandlers(self, event.data.options);\n return;\n }\n\n if (!this.messageHandlers) {\n this.messageHandlers = new MessageHandlers(self);\n }\n\n if (event.data && event.data.action && event.data.action !== 'init') {\n if (this.messageHandlers[event.data.action]) {\n this.messageHandlers[event.data.action](event.data);\n }\n }\n };\n };\n\n var transmuxerWorker = new TransmuxerWorker(self);\n return transmuxerWorker;\n }();\n});\n/**\n * @file - codecs.js - Handles tasks regarding codec strings such as translating them to\n * codec strings, or translating codec strings into objects that can be examined.\n */\n// Default codec parameters if none were provided for video and/or audio\n\nvar defaultCodecs = {\n videoCodec: 'avc1',\n videoObjectTypeIndicator: '.4d400d',\n // AAC-LC\n audioProfile: '2'\n};\n/**\n * Replace the old apple-style `avc1.<dd>.<dd>` codec string with the standard\n * `avc1.<hhhhhh>`\n *\n * @param {Array} codecs an array of codec strings to fix\n * @return {Array} the translated codec array\n * @private\n */\n\nvar translateLegacyCodecs = function translateLegacyCodecs(codecs) {\n return codecs.map(function (codec) {\n return codec.replace(/avc1\\.(\\d+)\\.(\\d+)/i, function (orig, profile, avcLevel) {\n var profileHex = ('00' + Number(profile).toString(16)).slice(-2);\n var avcLevelHex = ('00' + Number(avcLevel).toString(16)).slice(-2);\n return 'avc1.' + profileHex + '00' + avcLevelHex;\n });\n });\n};\n/**\n * Parses a codec string to retrieve the number of codecs specified,\n * the video codec and object type indicator, and the audio profile.\n */\n\n\nvar parseCodecs = function parseCodecs() {\n var codecs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var result = {\n codecCount: 0\n };\n var parsed = void 0;\n result.codecCount = codecs.split(',').length;\n result.codecCount = result.codecCount || 2; // parse the video codec\n\n parsed = /(^|\\s|,)+(avc[13])([^ ,]*)/i.exec(codecs);\n\n if (parsed) {\n result.videoCodec = parsed[2];\n result.videoObjectTypeIndicator = parsed[3];\n } // parse the last field of the audio codec\n\n\n result.audioProfile = /(^|\\s|,)+mp4a.[0-9A-Fa-f]+\\.([0-9A-Fa-f]+)/i.exec(codecs);\n result.audioProfile = result.audioProfile && result.audioProfile[2];\n return result;\n};\n/**\n * Replace codecs in the codec string with the old apple-style `avc1.<dd>.<dd>` to the\n * standard `avc1.<hhhhhh>`.\n *\n * @param codecString {String} the codec string\n * @return {String} the codec string with old apple-style codecs replaced\n *\n * @private\n */\n\n\nvar mapLegacyAvcCodecs = function mapLegacyAvcCodecs(codecString) {\n return codecString.replace(/avc1\\.(\\d+)\\.(\\d+)/i, function (match) {\n return translateLegacyCodecs([match])[0];\n });\n};\n/**\n * Build a media mime-type string from a set of parameters\n * @param {String} type either 'audio' or 'video'\n * @param {String} container either 'mp2t' or 'mp4'\n * @param {Array} codecs an array of codec strings to add\n * @return {String} a valid media mime-type\n */\n\n\nvar makeMimeTypeString = function makeMimeTypeString(type, container, codecs) {\n // The codecs array is filtered so that falsey values are\n // dropped and don't cause Array#join to create spurious\n // commas\n return type + '/' + container + '; codecs=\"' + codecs.filter(function (c) {\n return !!c;\n }).join(', ') + '\"';\n};\n/**\n * Returns the type container based on information in the playlist\n * @param {Playlist} media the current media playlist\n * @return {String} a valid media container type\n */\n\n\nvar getContainerType = function getContainerType(media) {\n // An initialization segment means the media playlist is an iframe\n // playlist or is using the mp4 container. We don't currently\n // support iframe playlists, so assume this is signalling mp4\n // fragments.\n if (media.segments && media.segments.length && media.segments[0].map) {\n return 'mp4';\n }\n\n return 'mp2t';\n};\n/**\n * Returns a set of codec strings parsed from the playlist or the default\n * codec strings if no codecs were specified in the playlist\n * @param {Playlist} media the current media playlist\n * @return {Object} an object with the video and audio codecs\n */\n\n\nvar getCodecs = function getCodecs(media) {\n // if the codecs were explicitly specified, use them instead of the\n // defaults\n var mediaAttributes = media.attributes || {};\n\n if (mediaAttributes.CODECS) {\n return parseCodecs(mediaAttributes.CODECS);\n }\n\n return defaultCodecs;\n};\n\nvar audioProfileFromDefault = function audioProfileFromDefault(master, audioGroupId) {\n if (!master.mediaGroups.AUDIO || !audioGroupId) {\n return null;\n }\n\n var audioGroup = master.mediaGroups.AUDIO[audioGroupId];\n\n if (!audioGroup) {\n return null;\n }\n\n for (var name in audioGroup) {\n var audioType = audioGroup[name];\n\n if (audioType.default && audioType.playlists) {\n // codec should be the same for all playlists within the audio type\n return parseCodecs(audioType.playlists[0].attributes.CODECS).audioProfile;\n }\n }\n\n return null;\n};\n/**\n * Calculates the MIME type strings for a working configuration of\n * SourceBuffers to play variant streams in a master playlist. If\n * there is no possible working configuration, an empty array will be\n * returned.\n *\n * @param master {Object} the m3u8 object for the master playlist\n * @param media {Object} the m3u8 object for the variant playlist\n * @return {Array} the MIME type strings. If the array has more than\n * one entry, the first element should be applied to the video\n * SourceBuffer and the second to the audio SourceBuffer.\n *\n * @private\n */\n\n\nvar mimeTypesForPlaylist = function mimeTypesForPlaylist(master, media) {\n var containerType = getContainerType(media);\n var codecInfo = getCodecs(media);\n var mediaAttributes = media.attributes || {}; // Default condition for a traditional HLS (no demuxed audio/video)\n\n var isMuxed = true;\n var isMaat = false;\n\n if (!media) {\n // Not enough information\n return [];\n }\n\n if (master.mediaGroups.AUDIO && mediaAttributes.AUDIO) {\n var audioGroup = master.mediaGroups.AUDIO[mediaAttributes.AUDIO]; // Handle the case where we are in a multiple-audio track scenario\n\n if (audioGroup) {\n isMaat = true; // Start with the everything demuxed then...\n\n isMuxed = false; // ...check to see if any audio group tracks are muxed (ie. lacking a uri)\n\n for (var groupId in audioGroup) {\n // either a uri is present (if the case of HLS and an external playlist), or\n // playlists is present (in the case of DASH where we don't have external audio\n // playlists)\n if (!audioGroup[groupId].uri && !audioGroup[groupId].playlists) {\n isMuxed = true;\n break;\n }\n }\n }\n } // HLS with multiple-audio tracks must always get an audio codec.\n // Put another way, there is no way to have a video-only multiple-audio HLS!\n\n\n if (isMaat && !codecInfo.audioProfile) {\n if (!isMuxed) {\n // It is possible for codecs to be specified on the audio media group playlist but\n // not on the rendition playlist. This is mostly the case for DASH, where audio and\n // video are always separate (and separately specified).\n codecInfo.audioProfile = audioProfileFromDefault(master, mediaAttributes.AUDIO);\n }\n\n if (!codecInfo.audioProfile) {\n videojs$1.log.warn('Multiple audio tracks present but no audio codec string is specified. ' + 'Attempting to use the default audio codec (mp4a.40.2)');\n codecInfo.audioProfile = defaultCodecs.audioProfile;\n }\n } // Generate the final codec strings from the codec object generated above\n\n\n var codecStrings = {};\n\n if (codecInfo.videoCodec) {\n codecStrings.video = '' + codecInfo.videoCodec + codecInfo.videoObjectTypeIndicator;\n }\n\n if (codecInfo.audioProfile) {\n codecStrings.audio = 'mp4a.40.' + codecInfo.audioProfile;\n } // Finally, make and return an array with proper mime-types depending on\n // the configuration\n\n\n var justAudio = makeMimeTypeString('audio', containerType, [codecStrings.audio]);\n var justVideo = makeMimeTypeString('video', containerType, [codecStrings.video]);\n var bothVideoAudio = makeMimeTypeString('video', containerType, [codecStrings.video, codecStrings.audio]);\n\n if (isMaat) {\n if (!isMuxed && codecStrings.video) {\n return [justVideo, justAudio];\n }\n\n if (!isMuxed && !codecStrings.video) {\n // There is no muxed content and no video codec string, so this is an audio only\n // stream with alternate audio.\n return [justAudio, justAudio];\n } // There exists the possiblity that this will return a `video/container`\n // mime-type for the first entry in the array even when there is only audio.\n // This doesn't appear to be a problem and simplifies the code.\n\n\n return [bothVideoAudio, justAudio];\n } // If there is no video codec at all, always just return a single\n // audio/<container> mime-type\n\n\n if (!codecStrings.video) {\n return [justAudio];\n } // When not using separate audio media groups, audio and video is\n // *always* muxed\n\n\n return [bothVideoAudio];\n};\n/**\n * Parse a content type header into a type and parameters\n * object\n *\n * @param {String} type the content type header\n * @return {Object} the parsed content-type\n * @private\n */\n\n\nvar parseContentType = function parseContentType(type) {\n var object = {\n type: '',\n parameters: {}\n };\n var parameters = type.trim().split(';'); // first parameter should always be content-type\n\n object.type = parameters.shift().trim();\n parameters.forEach(function (parameter) {\n var pair = parameter.trim().split('=');\n\n if (pair.length > 1) {\n var name = pair[0].replace(/\"/g, '').trim();\n var value = pair[1].replace(/\"/g, '').trim();\n object.parameters[name] = value;\n }\n });\n return object;\n};\n/**\n * Check if a codec string refers to an audio codec.\n *\n * @param {String} codec codec string to check\n * @return {Boolean} if this is an audio codec\n * @private\n */\n\n\nvar isAudioCodec = function isAudioCodec(codec) {\n return /mp4a\\.\\d+.\\d+/i.test(codec);\n};\n/**\n * Check if a codec string refers to a video codec.\n *\n * @param {String} codec codec string to check\n * @return {Boolean} if this is a video codec\n * @private\n */\n\n\nvar isVideoCodec = function isVideoCodec(codec) {\n return /avc1\\.[\\da-f]+/i.test(codec);\n};\n/**\n * Returns a list of gops in the buffer that have a pts value of 3 seconds or more in\n * front of current time.\n *\n * @param {Array} buffer\n * The current buffer of gop information\n * @param {Number} currentTime\n * The current time\n * @param {Double} mapping\n * Offset to map display time to stream presentation time\n * @return {Array}\n * List of gops considered safe to append over\n */\n\n\nvar gopsSafeToAlignWith = function gopsSafeToAlignWith(buffer, currentTime, mapping) {\n if (typeof currentTime === 'undefined' || currentTime === null || !buffer.length) {\n return [];\n } // pts value for current time + 3 seconds to give a bit more wiggle room\n\n\n var currentTimePts = Math.ceil((currentTime - mapping + 3) * 90000);\n var i = void 0;\n\n for (i = 0; i < buffer.length; i++) {\n if (buffer[i].pts > currentTimePts) {\n break;\n }\n }\n\n return buffer.slice(i);\n};\n/**\n * Appends gop information (timing and byteLength) received by the transmuxer for the\n * gops appended in the last call to appendBuffer\n *\n * @param {Array} buffer\n * The current buffer of gop information\n * @param {Array} gops\n * List of new gop information\n * @param {boolean} replace\n * If true, replace the buffer with the new gop information. If false, append the\n * new gop information to the buffer in the right location of time.\n * @return {Array}\n * Updated list of gop information\n */\n\n\nvar updateGopBuffer = function updateGopBuffer(buffer, gops, replace) {\n if (!gops.length) {\n return buffer;\n }\n\n if (replace) {\n // If we are in safe append mode, then completely overwrite the gop buffer\n // with the most recent appeneded data. This will make sure that when appending\n // future segments, we only try to align with gops that are both ahead of current\n // time and in the last segment appended.\n return gops.slice();\n }\n\n var start = gops[0].pts;\n var i = 0;\n\n for (i; i < buffer.length; i++) {\n if (buffer[i].pts >= start) {\n break;\n }\n }\n\n return buffer.slice(0, i).concat(gops);\n};\n/**\n * Removes gop information in buffer that overlaps with provided start and end\n *\n * @param {Array} buffer\n * The current buffer of gop information\n * @param {Double} start\n * position to start the remove at\n * @param {Double} end\n * position to end the remove at\n * @param {Double} mapping\n * Offset to map display time to stream presentation time\n */\n\n\nvar removeGopBuffer = function removeGopBuffer(buffer, start, end, mapping) {\n var startPts = Math.ceil((start - mapping) * 90000);\n var endPts = Math.ceil((end - mapping) * 90000);\n var updatedBuffer = buffer.slice();\n var i = buffer.length;\n\n while (i--) {\n if (buffer[i].pts <= endPts) {\n break;\n }\n }\n\n if (i === -1) {\n // no removal because end of remove range is before start of buffer\n return updatedBuffer;\n }\n\n var j = i + 1;\n\n while (j--) {\n if (buffer[j].pts <= startPts) {\n break;\n }\n } // clamp remove range start to 0 index\n\n\n j = Math.max(j, 0);\n updatedBuffer.splice(j, i - j + 1);\n return updatedBuffer;\n};\n\nvar buffered = function buffered(videoBuffer, audioBuffer, audioDisabled) {\n var start = null;\n var end = null;\n var arity = 0;\n var extents = [];\n var ranges = []; // neither buffer has been created yet\n\n if (!videoBuffer && !audioBuffer) {\n return videojs$1.createTimeRange();\n } // only one buffer is configured\n\n\n if (!videoBuffer) {\n return audioBuffer.buffered;\n }\n\n if (!audioBuffer) {\n return videoBuffer.buffered;\n } // both buffers are configured\n\n\n if (audioDisabled) {\n return videoBuffer.buffered;\n } // both buffers are empty\n\n\n if (videoBuffer.buffered.length === 0 && audioBuffer.buffered.length === 0) {\n return videojs$1.createTimeRange();\n } // Handle the case where we have both buffers and create an\n // intersection of the two\n\n\n var videoBuffered = videoBuffer.buffered;\n var audioBuffered = audioBuffer.buffered;\n var count = videoBuffered.length; // A) Gather up all start and end times\n\n while (count--) {\n extents.push({\n time: videoBuffered.start(count),\n type: 'start'\n });\n extents.push({\n time: videoBuffered.end(count),\n type: 'end'\n });\n }\n\n count = audioBuffered.length;\n\n while (count--) {\n extents.push({\n time: audioBuffered.start(count),\n type: 'start'\n });\n extents.push({\n time: audioBuffered.end(count),\n type: 'end'\n });\n } // B) Sort them by time\n\n\n extents.sort(function (a, b) {\n return a.time - b.time;\n }); // C) Go along one by one incrementing arity for start and decrementing\n // arity for ends\n\n for (count = 0; count < extents.length; count++) {\n if (extents[count].type === 'start') {\n arity++; // D) If arity is ever incremented to 2 we are entering an\n // overlapping range\n\n if (arity === 2) {\n start = extents[count].time;\n }\n } else if (extents[count].type === 'end') {\n arity--; // E) If arity is ever decremented to 1 we leaving an\n // overlapping range\n\n if (arity === 1) {\n end = extents[count].time;\n }\n } // F) Record overlapping ranges\n\n\n if (start !== null && end !== null) {\n ranges.push([start, end]);\n start = null;\n end = null;\n }\n }\n\n return videojs$1.createTimeRanges(ranges);\n};\n/**\n * @file virtual-source-buffer.js\n */\n// We create a wrapper around the SourceBuffer so that we can manage the\n// state of the `updating` property manually. We have to do this because\n// Firefox changes `updating` to false long before triggering `updateend`\n// events and that was causing strange problems in videojs-contrib-hls\n\n\nvar makeWrappedSourceBuffer = function makeWrappedSourceBuffer(mediaSource, mimeType) {\n var sourceBuffer = mediaSource.addSourceBuffer(mimeType);\n var wrapper = Object.create(null);\n wrapper.updating = false;\n wrapper.realBuffer_ = sourceBuffer;\n\n var _loop = function _loop(key) {\n if (typeof sourceBuffer[key] === 'function') {\n wrapper[key] = function () {\n return sourceBuffer[key].apply(sourceBuffer, arguments);\n };\n } else if (typeof wrapper[key] === 'undefined') {\n Object.defineProperty(wrapper, key, {\n get: function get$$1() {\n return sourceBuffer[key];\n },\n set: function set$$1(v) {\n return sourceBuffer[key] = v;\n }\n });\n }\n };\n\n for (var key in sourceBuffer) {\n _loop(key);\n }\n\n return wrapper;\n};\n/**\n * VirtualSourceBuffers exist so that we can transmux non native formats\n * into a native format, but keep the same api as a native source buffer.\n * It creates a transmuxer, that works in its own thread (a web worker) and\n * that transmuxer muxes the data into a native format. VirtualSourceBuffer will\n * then send all of that data to the naive sourcebuffer so that it is\n * indestinguishable from a natively supported format.\n *\n * @param {HtmlMediaSource} mediaSource the parent mediaSource\n * @param {Array} codecs array of codecs that we will be dealing with\n * @class VirtualSourceBuffer\n * @extends video.js.EventTarget\n */\n\n\nvar VirtualSourceBuffer = function (_videojs$EventTarget) {\n inherits(VirtualSourceBuffer, _videojs$EventTarget);\n\n function VirtualSourceBuffer(mediaSource, codecs) {\n classCallCheck(this, VirtualSourceBuffer);\n\n var _this = possibleConstructorReturn(this, (VirtualSourceBuffer.__proto__ || Object.getPrototypeOf(VirtualSourceBuffer)).call(this, videojs$1.EventTarget));\n\n _this.timestampOffset_ = 0;\n _this.pendingBuffers_ = [];\n _this.bufferUpdating_ = false;\n _this.mediaSource_ = mediaSource;\n _this.codecs_ = codecs;\n _this.audioCodec_ = null;\n _this.videoCodec_ = null;\n _this.audioDisabled_ = false;\n _this.appendAudioInitSegment_ = true;\n _this.gopBuffer_ = [];\n _this.timeMapping_ = 0;\n _this.safeAppend_ = videojs$1.browser.IE_VERSION >= 11;\n var options = {\n remux: false,\n alignGopsAtEnd: _this.safeAppend_\n };\n\n _this.codecs_.forEach(function (codec) {\n if (isAudioCodec(codec)) {\n _this.audioCodec_ = codec;\n } else if (isVideoCodec(codec)) {\n _this.videoCodec_ = codec;\n }\n }); // append muxed segments to their respective native buffers as\n // soon as they are available\n\n\n _this.transmuxer_ = new TransmuxWorker();\n\n _this.transmuxer_.postMessage({\n action: 'init',\n options: options\n });\n\n _this.transmuxer_.onmessage = function (event) {\n if (event.data.action === 'data') {\n return _this.data_(event);\n }\n\n if (event.data.action === 'done') {\n return _this.done_(event);\n }\n\n if (event.data.action === 'gopInfo') {\n return _this.appendGopInfo_(event);\n }\n }; // this timestampOffset is a property with the side-effect of resetting\n // baseMediaDecodeTime in the transmuxer on the setter\n\n\n Object.defineProperty(_this, 'timestampOffset', {\n get: function get$$1() {\n return this.timestampOffset_;\n },\n set: function set$$1(val) {\n if (typeof val === 'number' && val >= 0) {\n this.timestampOffset_ = val;\n this.appendAudioInitSegment_ = true; // reset gop buffer on timestampoffset as this signals a change in timeline\n\n this.gopBuffer_.length = 0;\n this.timeMapping_ = 0; // We have to tell the transmuxer to set the baseMediaDecodeTime to\n // the desired timestampOffset for the next segment\n\n this.transmuxer_.postMessage({\n action: 'setTimestampOffset',\n timestampOffset: val\n });\n }\n }\n }); // setting the append window affects both source buffers\n\n Object.defineProperty(_this, 'appendWindowStart', {\n get: function get$$1() {\n return (this.videoBuffer_ || this.audioBuffer_).appendWindowStart;\n },\n set: function set$$1(start) {\n if (this.videoBuffer_) {\n this.videoBuffer_.appendWindowStart = start;\n }\n\n if (this.audioBuffer_) {\n this.audioBuffer_.appendWindowStart = start;\n }\n }\n }); // this buffer is \"updating\" if either of its native buffers are\n\n Object.defineProperty(_this, 'updating', {\n get: function get$$1() {\n return !!(this.bufferUpdating_ || !this.audioDisabled_ && this.audioBuffer_ && this.audioBuffer_.updating || this.videoBuffer_ && this.videoBuffer_.updating);\n }\n }); // the buffered property is the intersection of the buffered\n // ranges of the native source buffers\n\n Object.defineProperty(_this, 'buffered', {\n get: function get$$1() {\n return buffered(this.videoBuffer_, this.audioBuffer_, this.audioDisabled_);\n }\n });\n return _this;\n }\n /**\n * When we get a data event from the transmuxer\n * we call this function and handle the data that\n * was sent to us\n *\n * @private\n * @param {Event} event the data event from the transmuxer\n */\n\n\n createClass(VirtualSourceBuffer, [{\n key: 'data_',\n value: function data_(event) {\n var segment = event.data.segment; // Cast ArrayBuffer to TypedArray\n\n segment.data = new Uint8Array(segment.data, event.data.byteOffset, event.data.byteLength);\n segment.initSegment = new Uint8Array(segment.initSegment.data, segment.initSegment.byteOffset, segment.initSegment.byteLength);\n createTextTracksIfNecessary(this, this.mediaSource_, segment); // Add the segments to the pendingBuffers array\n\n this.pendingBuffers_.push(segment);\n return;\n }\n /**\n * When we get a done event from the transmuxer\n * we call this function and we process all\n * of the pending data that we have been saving in the\n * data_ function\n *\n * @private\n * @param {Event} event the done event from the transmuxer\n */\n\n }, {\n key: 'done_',\n value: function done_(event) {\n // Don't process and append data if the mediaSource is closed\n if (this.mediaSource_.readyState === 'closed') {\n this.pendingBuffers_.length = 0;\n return;\n } // All buffers should have been flushed from the muxer\n // start processing anything we have received\n\n\n this.processPendingSegments_();\n return;\n }\n /**\n * Create our internal native audio/video source buffers and add\n * event handlers to them with the following conditions:\n * 1. they do not already exist on the mediaSource\n * 2. this VSB has a codec for them\n *\n * @private\n */\n\n }, {\n key: 'createRealSourceBuffers_',\n value: function createRealSourceBuffers_() {\n var _this2 = this;\n\n var types = ['audio', 'video'];\n types.forEach(function (type) {\n // Don't create a SourceBuffer of this type if we don't have a\n // codec for it\n if (!_this2[type + 'Codec_']) {\n return;\n } // Do nothing if a SourceBuffer of this type already exists\n\n\n if (_this2[type + 'Buffer_']) {\n return;\n }\n\n var buffer = null; // If the mediasource already has a SourceBuffer for the codec\n // use that\n\n if (_this2.mediaSource_[type + 'Buffer_']) {\n buffer = _this2.mediaSource_[type + 'Buffer_']; // In multiple audio track cases, the audio source buffer is disabled\n // on the main VirtualSourceBuffer by the HTMLMediaSource much earlier\n // than createRealSourceBuffers_ is called to create the second\n // VirtualSourceBuffer because that happens as a side-effect of\n // videojs-contrib-hls starting the audioSegmentLoader. As a result,\n // the audioBuffer is essentially \"ownerless\" and no one will toggle\n // the `updating` state back to false once the `updateend` event is received\n //\n // Setting `updating` to false manually will work around this\n // situation and allow work to continue\n\n buffer.updating = false;\n } else {\n var codecProperty = type + 'Codec_';\n var mimeType = type + '/mp4;codecs=\"' + _this2[codecProperty] + '\"';\n buffer = makeWrappedSourceBuffer(_this2.mediaSource_.nativeMediaSource_, mimeType);\n _this2.mediaSource_[type + 'Buffer_'] = buffer;\n }\n\n _this2[type + 'Buffer_'] = buffer; // Wire up the events to the SourceBuffer\n\n ['update', 'updatestart', 'updateend'].forEach(function (event) {\n buffer.addEventListener(event, function () {\n // if audio is disabled\n if (type === 'audio' && _this2.audioDisabled_) {\n return;\n }\n\n if (event === 'updateend') {\n _this2[type + 'Buffer_'].updating = false;\n }\n\n var shouldTrigger = types.every(function (t) {\n // skip checking audio's updating status if audio\n // is not enabled\n if (t === 'audio' && _this2.audioDisabled_) {\n return true;\n } // if the other type if updating we don't trigger\n\n\n if (type !== t && _this2[t + 'Buffer_'] && _this2[t + 'Buffer_'].updating) {\n return false;\n }\n\n return true;\n });\n\n if (shouldTrigger) {\n return _this2.trigger(event);\n }\n });\n });\n });\n }\n /**\n * Emulate the native mediasource function, but our function will\n * send all of the proposed segments to the transmuxer so that we\n * can transmux them before we append them to our internal\n * native source buffers in the correct format.\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/appendBuffer\n * @param {Uint8Array} segment the segment to append to the buffer\n */\n\n }, {\n key: 'appendBuffer',\n value: function appendBuffer(segment) {\n // Start the internal \"updating\" state\n this.bufferUpdating_ = true;\n\n if (this.audioBuffer_ && this.audioBuffer_.buffered.length) {\n var audioBuffered = this.audioBuffer_.buffered;\n this.transmuxer_.postMessage({\n action: 'setAudioAppendStart',\n appendStart: audioBuffered.end(audioBuffered.length - 1)\n });\n }\n\n if (this.videoBuffer_) {\n this.transmuxer_.postMessage({\n action: 'alignGopsWith',\n gopsToAlignWith: gopsSafeToAlignWith(this.gopBuffer_, this.mediaSource_.player_ ? this.mediaSource_.player_.currentTime() : null, this.timeMapping_)\n });\n }\n\n this.transmuxer_.postMessage({\n action: 'push',\n // Send the typed-array of data as an ArrayBuffer so that\n // it can be sent as a \"Transferable\" and avoid the costly\n // memory copy\n data: segment.buffer,\n // To recreate the original typed-array, we need information\n // about what portion of the ArrayBuffer it was a view into\n byteOffset: segment.byteOffset,\n byteLength: segment.byteLength\n }, [segment.buffer]);\n this.transmuxer_.postMessage({\n action: 'flush'\n });\n }\n /**\n * Appends gop information (timing and byteLength) received by the transmuxer for the\n * gops appended in the last call to appendBuffer\n *\n * @param {Event} event\n * The gopInfo event from the transmuxer\n * @param {Array} event.data.gopInfo\n * List of gop info to append\n */\n\n }, {\n key: 'appendGopInfo_',\n value: function appendGopInfo_(event) {\n this.gopBuffer_ = updateGopBuffer(this.gopBuffer_, event.data.gopInfo, this.safeAppend_);\n }\n /**\n * Emulate the native mediasource function and remove parts\n * of the buffer from any of our internal buffers that exist\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/remove\n * @param {Double} start position to start the remove at\n * @param {Double} end position to end the remove at\n */\n\n }, {\n key: 'remove',\n value: function remove(start, end) {\n if (this.videoBuffer_) {\n this.videoBuffer_.updating = true;\n this.videoBuffer_.remove(start, end);\n this.gopBuffer_ = removeGopBuffer(this.gopBuffer_, start, end, this.timeMapping_);\n }\n\n if (!this.audioDisabled_ && this.audioBuffer_) {\n this.audioBuffer_.updating = true;\n this.audioBuffer_.remove(start, end);\n } // Remove Metadata Cues (id3)\n\n\n removeCuesFromTrack(start, end, this.metadataTrack_); // Remove Any Captions\n\n if (this.inbandTextTracks_) {\n for (var track in this.inbandTextTracks_) {\n removeCuesFromTrack(start, end, this.inbandTextTracks_[track]);\n }\n }\n }\n /**\n * Process any segments that the muxer has output\n * Concatenate segments together based on type and append them into\n * their respective sourceBuffers\n *\n * @private\n */\n\n }, {\n key: 'processPendingSegments_',\n value: function processPendingSegments_() {\n var sortedSegments = {\n video: {\n segments: [],\n bytes: 0\n },\n audio: {\n segments: [],\n bytes: 0\n },\n captions: [],\n metadata: []\n }; // Sort segments into separate video/audio arrays and\n // keep track of their total byte lengths\n\n sortedSegments = this.pendingBuffers_.reduce(function (segmentObj, segment) {\n var type = segment.type;\n var data = segment.data;\n var initSegment = segment.initSegment;\n segmentObj[type].segments.push(data);\n segmentObj[type].bytes += data.byteLength;\n segmentObj[type].initSegment = initSegment; // Gather any captions into a single array\n\n if (segment.captions) {\n segmentObj.captions = segmentObj.captions.concat(segment.captions);\n }\n\n if (segment.info) {\n segmentObj[type].info = segment.info;\n } // Gather any metadata into a single array\n\n\n if (segment.metadata) {\n segmentObj.metadata = segmentObj.metadata.concat(segment.metadata);\n }\n\n return segmentObj;\n }, sortedSegments); // Create the real source buffers if they don't exist by now since we\n // finally are sure what tracks are contained in the source\n\n if (!this.videoBuffer_ && !this.audioBuffer_) {\n // Remove any codecs that may have been specified by default but\n // are no longer applicable now\n if (sortedSegments.video.bytes === 0) {\n this.videoCodec_ = null;\n }\n\n if (sortedSegments.audio.bytes === 0) {\n this.audioCodec_ = null;\n }\n\n this.createRealSourceBuffers_();\n }\n\n if (sortedSegments.audio.info) {\n this.mediaSource_.trigger({\n type: 'audioinfo',\n info: sortedSegments.audio.info\n });\n }\n\n if (sortedSegments.video.info) {\n this.mediaSource_.trigger({\n type: 'videoinfo',\n info: sortedSegments.video.info\n });\n }\n\n if (this.appendAudioInitSegment_) {\n if (!this.audioDisabled_ && this.audioBuffer_) {\n sortedSegments.audio.segments.unshift(sortedSegments.audio.initSegment);\n sortedSegments.audio.bytes += sortedSegments.audio.initSegment.byteLength;\n }\n\n this.appendAudioInitSegment_ = false;\n }\n\n var triggerUpdateend = false; // Merge multiple video and audio segments into one and append\n\n if (this.videoBuffer_ && sortedSegments.video.bytes) {\n sortedSegments.video.segments.unshift(sortedSegments.video.initSegment);\n sortedSegments.video.bytes += sortedSegments.video.initSegment.byteLength;\n this.concatAndAppendSegments_(sortedSegments.video, this.videoBuffer_); // TODO: are video tracks the only ones with text tracks?\n\n addTextTrackData(this, sortedSegments.captions, sortedSegments.metadata);\n } else if (this.videoBuffer_ && (this.audioDisabled_ || !this.audioBuffer_)) {\n // The transmuxer did not return any bytes of video, meaning it was all trimmed\n // for gop alignment. Since we have a video buffer and audio is disabled, updateend\n // will never be triggered by this source buffer, which will cause contrib-hls\n // to be stuck forever waiting for updateend. If audio is not disabled, updateend\n // will be triggered by the audio buffer, which will be sent upwards since the video\n // buffer will not be in an updating state.\n triggerUpdateend = true;\n }\n\n if (!this.audioDisabled_ && this.audioBuffer_) {\n this.concatAndAppendSegments_(sortedSegments.audio, this.audioBuffer_);\n }\n\n this.pendingBuffers_.length = 0;\n\n if (triggerUpdateend) {\n this.trigger('updateend');\n } // We are no longer in the internal \"updating\" state\n\n\n this.bufferUpdating_ = false;\n }\n /**\n * Combine all segments into a single Uint8Array and then append them\n * to the destination buffer\n *\n * @param {Object} segmentObj\n * @param {SourceBuffer} destinationBuffer native source buffer to append data to\n * @private\n */\n\n }, {\n key: 'concatAndAppendSegments_',\n value: function concatAndAppendSegments_(segmentObj, destinationBuffer) {\n var offset = 0;\n var tempBuffer = void 0;\n\n if (segmentObj.bytes) {\n tempBuffer = new Uint8Array(segmentObj.bytes); // Combine the individual segments into one large typed-array\n\n segmentObj.segments.forEach(function (segment) {\n tempBuffer.set(segment, offset);\n offset += segment.byteLength;\n });\n\n try {\n destinationBuffer.updating = true;\n destinationBuffer.appendBuffer(tempBuffer);\n } catch (error) {\n if (this.mediaSource_.player_) {\n this.mediaSource_.player_.error({\n code: -3,\n type: 'APPEND_BUFFER_ERR',\n message: error.message,\n originalError: error\n });\n }\n }\n }\n }\n /**\n * Emulate the native mediasource function. abort any soureBuffer\n * actions and throw out any un-appended data.\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/abort\n */\n\n }, {\n key: 'abort',\n value: function abort() {\n if (this.videoBuffer_) {\n this.videoBuffer_.abort();\n }\n\n if (!this.audioDisabled_ && this.audioBuffer_) {\n this.audioBuffer_.abort();\n }\n\n if (this.transmuxer_) {\n this.transmuxer_.postMessage({\n action: 'reset'\n });\n }\n\n this.pendingBuffers_.length = 0;\n this.bufferUpdating_ = false;\n }\n }]);\n return VirtualSourceBuffer;\n}(videojs$1.EventTarget);\n/**\n * @file html-media-source.js\n */\n\n/**\n * Our MediaSource implementation in HTML, mimics native\n * MediaSource where/if possible.\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/API/MediaSource\n * @class HtmlMediaSource\n * @extends videojs.EventTarget\n */\n\n\nvar HtmlMediaSource = function (_videojs$EventTarget) {\n inherits(HtmlMediaSource, _videojs$EventTarget);\n\n function HtmlMediaSource() {\n classCallCheck(this, HtmlMediaSource);\n\n var _this = possibleConstructorReturn(this, (HtmlMediaSource.__proto__ || Object.getPrototypeOf(HtmlMediaSource)).call(this));\n\n var property = void 0;\n _this.nativeMediaSource_ = new window$1.MediaSource(); // delegate to the native MediaSource's methods by default\n\n for (property in _this.nativeMediaSource_) {\n if (!(property in HtmlMediaSource.prototype) && typeof _this.nativeMediaSource_[property] === 'function') {\n _this[property] = _this.nativeMediaSource_[property].bind(_this.nativeMediaSource_);\n }\n } // emulate `duration` and `seekable` until seeking can be\n // handled uniformly for live streams\n // see https://github.com/w3c/media-source/issues/5\n\n\n _this.duration_ = NaN;\n Object.defineProperty(_this, 'duration', {\n get: function get$$1() {\n if (this.duration_ === Infinity) {\n return this.duration_;\n }\n\n return this.nativeMediaSource_.duration;\n },\n set: function set$$1(duration) {\n this.duration_ = duration;\n\n if (duration !== Infinity) {\n this.nativeMediaSource_.duration = duration;\n return;\n }\n }\n });\n Object.defineProperty(_this, 'seekable', {\n get: function get$$1() {\n if (this.duration_ === Infinity) {\n return videojs$1.createTimeRanges([[0, this.nativeMediaSource_.duration]]);\n }\n\n return this.nativeMediaSource_.seekable;\n }\n });\n Object.defineProperty(_this, 'readyState', {\n get: function get$$1() {\n return this.nativeMediaSource_.readyState;\n }\n });\n Object.defineProperty(_this, 'activeSourceBuffers', {\n get: function get$$1() {\n return this.activeSourceBuffers_;\n }\n }); // the list of virtual and native SourceBuffers created by this\n // MediaSource\n\n _this.sourceBuffers = [];\n _this.activeSourceBuffers_ = [];\n /**\n * update the list of active source buffers based upon various\n * imformation from HLS and video.js\n *\n * @private\n */\n\n _this.updateActiveSourceBuffers_ = function () {\n // Retain the reference but empty the array\n _this.activeSourceBuffers_.length = 0; // If there is only one source buffer, then it will always be active and audio will\n // be disabled based on the codec of the source buffer\n\n if (_this.sourceBuffers.length === 1) {\n var sourceBuffer = _this.sourceBuffers[0];\n sourceBuffer.appendAudioInitSegment_ = true;\n sourceBuffer.audioDisabled_ = !sourceBuffer.audioCodec_;\n\n _this.activeSourceBuffers_.push(sourceBuffer);\n\n return;\n } // There are 2 source buffers, a combined (possibly video only) source buffer and\n // and an audio only source buffer.\n // By default, the audio in the combined virtual source buffer is enabled\n // and the audio-only source buffer (if it exists) is disabled.\n\n\n var disableCombined = false;\n var disableAudioOnly = true; // TODO: maybe we can store the sourcebuffers on the track objects?\n // safari may do something like this\n\n for (var i = 0; i < _this.player_.audioTracks().length; i++) {\n var track = _this.player_.audioTracks()[i];\n\n if (track.enabled && track.kind !== 'main') {\n // The enabled track is an alternate audio track so disable the audio in\n // the combined source buffer and enable the audio-only source buffer.\n disableCombined = true;\n disableAudioOnly = false;\n break;\n }\n }\n\n _this.sourceBuffers.forEach(function (sourceBuffer, index) {\n /* eslinst-disable */\n // TODO once codecs are required, we can switch to using the codecs to determine\n // what stream is the video stream, rather than relying on videoTracks\n\n /* eslinst-enable */\n sourceBuffer.appendAudioInitSegment_ = true;\n\n if (sourceBuffer.videoCodec_ && sourceBuffer.audioCodec_) {\n // combined\n sourceBuffer.audioDisabled_ = disableCombined;\n } else if (sourceBuffer.videoCodec_ && !sourceBuffer.audioCodec_) {\n // If the \"combined\" source buffer is video only, then we do not want\n // disable the audio-only source buffer (this is mostly for demuxed\n // audio and video hls)\n sourceBuffer.audioDisabled_ = true;\n disableAudioOnly = false;\n } else if (!sourceBuffer.videoCodec_ && sourceBuffer.audioCodec_) {\n // audio only\n // In the case of audio only with alternate audio and disableAudioOnly is true\n // this means we want to disable the audio on the alternate audio sourcebuffer\n // but not the main \"combined\" source buffer. The \"combined\" source buffer is\n // always at index 0, so this ensures audio won't be disabled in both source\n // buffers.\n sourceBuffer.audioDisabled_ = index ? disableAudioOnly : !disableAudioOnly;\n\n if (sourceBuffer.audioDisabled_) {\n return;\n }\n }\n\n _this.activeSourceBuffers_.push(sourceBuffer);\n });\n };\n\n _this.onPlayerMediachange_ = function () {\n _this.sourceBuffers.forEach(function (sourceBuffer) {\n sourceBuffer.appendAudioInitSegment_ = true;\n });\n };\n\n _this.onHlsReset_ = function () {\n _this.sourceBuffers.forEach(function (sourceBuffer) {\n if (sourceBuffer.transmuxer_) {\n sourceBuffer.transmuxer_.postMessage({\n action: 'resetCaptions'\n });\n }\n });\n };\n\n _this.onHlsSegmentTimeMapping_ = function (event) {\n _this.sourceBuffers.forEach(function (buffer) {\n return buffer.timeMapping_ = event.mapping;\n });\n }; // Re-emit MediaSource events on the polyfill\n\n\n ['sourceopen', 'sourceclose', 'sourceended'].forEach(function (eventName) {\n this.nativeMediaSource_.addEventListener(eventName, this.trigger.bind(this));\n }, _this); // capture the associated player when the MediaSource is\n // successfully attached\n\n _this.on('sourceopen', function (event) {\n // Get the player this MediaSource is attached to\n var video = document.querySelector('[src=\"' + _this.url_ + '\"]');\n\n if (!video) {\n return;\n }\n\n _this.player_ = videojs$1(video.parentNode);\n\n if (!_this.player_) {\n return;\n } // hls-reset is fired by videojs.Hls on to the tech after the main SegmentLoader\n // resets its state and flushes the buffer\n\n\n _this.player_.tech_.on('hls-reset', _this.onHlsReset_); // hls-segment-time-mapping is fired by videojs.Hls on to the tech after the main\n // SegmentLoader inspects an MTS segment and has an accurate stream to display\n // time mapping\n\n\n _this.player_.tech_.on('hls-segment-time-mapping', _this.onHlsSegmentTimeMapping_);\n\n if (_this.player_.audioTracks && _this.player_.audioTracks()) {\n _this.player_.audioTracks().on('change', _this.updateActiveSourceBuffers_);\n\n _this.player_.audioTracks().on('addtrack', _this.updateActiveSourceBuffers_);\n\n _this.player_.audioTracks().on('removetrack', _this.updateActiveSourceBuffers_);\n }\n\n _this.player_.on('mediachange', _this.onPlayerMediachange_);\n });\n\n _this.on('sourceended', function (event) {\n var duration = durationOfVideo(_this.duration);\n\n for (var i = 0; i < _this.sourceBuffers.length; i++) {\n var sourcebuffer = _this.sourceBuffers[i];\n var cues = sourcebuffer.metadataTrack_ && sourcebuffer.metadataTrack_.cues;\n\n if (cues && cues.length) {\n cues[cues.length - 1].endTime = duration;\n }\n }\n }); // explicitly terminate any WebWorkers that were created\n // by SourceHandlers\n\n\n _this.on('sourceclose', function (event) {\n this.sourceBuffers.forEach(function (sourceBuffer) {\n if (sourceBuffer.transmuxer_) {\n sourceBuffer.transmuxer_.terminate();\n }\n });\n this.sourceBuffers.length = 0;\n\n if (!this.player_) {\n return;\n }\n\n if (this.player_.audioTracks && this.player_.audioTracks()) {\n this.player_.audioTracks().off('change', this.updateActiveSourceBuffers_);\n this.player_.audioTracks().off('addtrack', this.updateActiveSourceBuffers_);\n this.player_.audioTracks().off('removetrack', this.updateActiveSourceBuffers_);\n } // We can only change this if the player hasn't been disposed of yet\n // because `off` eventually tries to use the el_ property. If it has\n // been disposed of, then don't worry about it because there are no\n // event handlers left to unbind anyway\n\n\n if (this.player_.el_) {\n this.player_.off('mediachange', this.onPlayerMediachange_);\n }\n\n if (this.player_.tech_ && this.player_.tech_.el_) {\n this.player_.tech_.off('hls-reset', this.onHlsReset_);\n this.player_.tech_.off('hls-segment-time-mapping', this.onHlsSegmentTimeMapping_);\n }\n });\n\n return _this;\n }\n /**\n * Add a range that that can now be seeked to.\n *\n * @param {Double} start where to start the addition\n * @param {Double} end where to end the addition\n * @private\n */\n\n\n createClass(HtmlMediaSource, [{\n key: 'addSeekableRange_',\n value: function addSeekableRange_(start, end) {\n var error = void 0;\n\n if (this.duration !== Infinity) {\n error = new Error('MediaSource.addSeekableRange() can only be invoked ' + 'when the duration is Infinity');\n error.name = 'InvalidStateError';\n error.code = 11;\n throw error;\n }\n\n if (end > this.nativeMediaSource_.duration || isNaN(this.nativeMediaSource_.duration)) {\n this.nativeMediaSource_.duration = end;\n }\n }\n /**\n * Add a source buffer to the media source.\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/addSourceBuffer\n * @param {String} type the content-type of the content\n * @return {Object} the created source buffer\n */\n\n }, {\n key: 'addSourceBuffer',\n value: function addSourceBuffer(type) {\n var buffer = void 0;\n var parsedType = parseContentType(type); // Create a VirtualSourceBuffer to transmux MPEG-2 transport\n // stream segments into fragmented MP4s\n\n if (/^(video|audio)\\/mp2t$/i.test(parsedType.type)) {\n var codecs = [];\n\n if (parsedType.parameters && parsedType.parameters.codecs) {\n codecs = parsedType.parameters.codecs.split(',');\n codecs = translateLegacyCodecs(codecs);\n codecs = codecs.filter(function (codec) {\n return isAudioCodec(codec) || isVideoCodec(codec);\n });\n }\n\n if (codecs.length === 0) {\n codecs = ['avc1.4d400d', 'mp4a.40.2'];\n }\n\n buffer = new VirtualSourceBuffer(this, codecs);\n\n if (this.sourceBuffers.length !== 0) {\n // If another VirtualSourceBuffer already exists, then we are creating a\n // SourceBuffer for an alternate audio track and therefore we know that\n // the source has both an audio and video track.\n // That means we should trigger the manual creation of the real\n // SourceBuffers instead of waiting for the transmuxer to return data\n this.sourceBuffers[0].createRealSourceBuffers_();\n buffer.createRealSourceBuffers_(); // Automatically disable the audio on the first source buffer if\n // a second source buffer is ever created\n\n this.sourceBuffers[0].audioDisabled_ = true;\n }\n } else {\n // delegate to the native implementation\n buffer = this.nativeMediaSource_.addSourceBuffer(type);\n }\n\n this.sourceBuffers.push(buffer);\n return buffer;\n }\n }]);\n return HtmlMediaSource;\n}(videojs$1.EventTarget);\n/**\n * @file videojs-contrib-media-sources.js\n */\n\n\nvar urlCount = 0; // ------------\n// Media Source\n// ------------\n// store references to the media sources so they can be connected\n// to a video element (a swf object)\n// TODO: can we store this somewhere local to this module?\n\nvideojs$1.mediaSources = {};\n/**\n * Provide a method for a swf object to notify JS that a\n * media source is now open.\n *\n * @param {String} msObjectURL string referencing the MSE Object URL\n * @param {String} swfId the swf id\n */\n\nvar open = function open(msObjectURL, swfId) {\n var mediaSource = videojs$1.mediaSources[msObjectURL];\n\n if (mediaSource) {\n mediaSource.trigger({\n type: 'sourceopen',\n swfId: swfId\n });\n } else {\n throw new Error('Media Source not found (Video.js)');\n }\n};\n/**\n * Check to see if the native MediaSource object exists and supports\n * an MP4 container with both H.264 video and AAC-LC audio.\n *\n * @return {Boolean} if native media sources are supported\n */\n\n\nvar supportsNativeMediaSources = function supportsNativeMediaSources() {\n return !!window$1.MediaSource && !!window$1.MediaSource.isTypeSupported && window$1.MediaSource.isTypeSupported('video/mp4;codecs=\"avc1.4d400d,mp4a.40.2\"');\n};\n/**\n * An emulation of the MediaSource API so that we can support\n * native and non-native functionality. returns an instance of\n * HtmlMediaSource.\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/MediaSource\n */\n\n\nvar MediaSource = function MediaSource() {\n this.MediaSource = {\n open: open,\n supportsNativeMediaSources: supportsNativeMediaSources\n };\n\n if (supportsNativeMediaSources()) {\n return new HtmlMediaSource();\n }\n\n throw new Error('Cannot use create a virtual MediaSource for this video');\n};\n\nMediaSource.open = open;\nMediaSource.supportsNativeMediaSources = supportsNativeMediaSources;\n/**\n * A wrapper around the native URL for our MSE object\n * implementation, this object is exposed under videojs.URL\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/API/URL/URL\n */\n\nvar URL$1 = {\n /**\n * A wrapper around the native createObjectURL for our objects.\n * This function maps a native or emulated mediaSource to a blob\n * url so that it can be loaded into video.js\n *\n * @link https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL\n * @param {MediaSource} object the object to create a blob url to\n */\n createObjectURL: function createObjectURL(object) {\n var objectUrlPrefix = 'blob:vjs-media-source/';\n var url = void 0; // use the native MediaSource to generate an object URL\n\n if (object instanceof HtmlMediaSource) {\n url = window$1.URL.createObjectURL(object.nativeMediaSource_);\n object.url_ = url;\n return url;\n } // if the object isn't an emulated MediaSource, delegate to the\n // native implementation\n\n\n if (!(object instanceof HtmlMediaSource)) {\n url = window$1.URL.createObjectURL(object);\n object.url_ = url;\n return url;\n } // build a URL that can be used to map back to the emulated\n // MediaSource\n\n\n url = objectUrlPrefix + urlCount;\n urlCount++; // setup the mapping back to object\n\n videojs$1.mediaSources[url] = object;\n return url;\n }\n};\nvideojs$1.MediaSource = MediaSource;\nvideojs$1.URL = URL$1;\nvar EventTarget$1$1 = videojs$1.EventTarget,\n mergeOptions$2 = videojs$1.mergeOptions;\n/**\n * Returns a new master manifest that is the result of merging an updated master manifest\n * into the original version.\n *\n * @param {Object} oldMaster\n * The old parsed mpd object\n * @param {Object} newMaster\n * The updated parsed mpd object\n * @return {Object}\n * A new object representing the original master manifest with the updated media\n * playlists merged in\n */\n\nvar updateMaster$1 = function updateMaster$$1(oldMaster, newMaster) {\n var update = mergeOptions$2(oldMaster, {\n // These are top level properties that can be updated\n duration: newMaster.duration,\n minimumUpdatePeriod: newMaster.minimumUpdatePeriod\n }); // First update the playlists in playlist list\n\n for (var i = 0; i < newMaster.playlists.length; i++) {\n var playlistUpdate = updateMaster(update, newMaster.playlists[i]);\n\n if (playlistUpdate) {\n update = playlistUpdate;\n }\n } // Then update media group playlists\n\n\n forEachMediaGroup(newMaster, function (properties, type, group, label) {\n if (properties.playlists && properties.playlists.length) {\n var uri = properties.playlists[0].uri;\n\n var _playlistUpdate = updateMaster(update, properties.playlists[0]);\n\n if (_playlistUpdate) {\n update = _playlistUpdate; // update the playlist reference within media groups\n\n update.mediaGroups[type][group][label].playlists[0] = update.playlists[uri];\n }\n }\n });\n return update;\n};\n\nvar DashPlaylistLoader = function (_EventTarget) {\n inherits(DashPlaylistLoader, _EventTarget); // DashPlaylistLoader must accept either a src url or a playlist because subsequent\n // playlist loader setups from media groups will expect to be able to pass a playlist\n // (since there aren't external URLs to media playlists with DASH)\n\n function DashPlaylistLoader(srcUrlOrPlaylist, hls, withCredentials, masterPlaylistLoader) {\n classCallCheck(this, DashPlaylistLoader);\n\n var _this = possibleConstructorReturn(this, (DashPlaylistLoader.__proto__ || Object.getPrototypeOf(DashPlaylistLoader)).call(this));\n\n _this.hls_ = hls;\n _this.withCredentials = withCredentials;\n\n if (!srcUrlOrPlaylist) {\n throw new Error('A non-empty playlist URL or playlist is required');\n } // event naming?\n\n\n _this.on('minimumUpdatePeriod', function () {\n _this.refreshXml_();\n }); // live playlist staleness timeout\n\n\n _this.on('mediaupdatetimeout', function () {\n _this.refreshMedia_();\n }); // initialize the loader state\n\n\n if (typeof srcUrlOrPlaylist === 'string') {\n _this.srcUrl = srcUrlOrPlaylist;\n _this.state = 'HAVE_NOTHING';\n return possibleConstructorReturn(_this);\n }\n\n _this.masterPlaylistLoader_ = masterPlaylistLoader;\n _this.state = 'HAVE_METADATA';\n _this.started = true; // we only should have one playlist so select it\n\n _this.media(srcUrlOrPlaylist); // trigger async to mimic behavior of HLS, where it must request a playlist\n\n\n window$1.setTimeout(function () {\n _this.trigger('loadedmetadata');\n }, 0);\n return _this;\n }\n\n createClass(DashPlaylistLoader, [{\n key: 'dispose',\n value: function dispose() {\n this.stopRequest();\n window$1.clearTimeout(this.mediaUpdateTimeout);\n }\n }, {\n key: 'stopRequest',\n value: function stopRequest() {\n if (this.request) {\n var oldRequest = this.request;\n this.request = null;\n oldRequest.onreadystatechange = null;\n oldRequest.abort();\n }\n }\n }, {\n key: 'media',\n value: function media(playlist) {\n // getter\n if (!playlist) {\n return this.media_;\n } // setter\n\n\n if (this.state === 'HAVE_NOTHING') {\n throw new Error('Cannot switch media playlist from ' + this.state);\n }\n\n var startingState = this.state; // find the playlist object if the target playlist has been specified by URI\n\n if (typeof playlist === 'string') {\n if (!this.master.playlists[playlist]) {\n throw new Error('Unknown playlist URI: ' + playlist);\n }\n\n playlist = this.master.playlists[playlist];\n }\n\n var mediaChange = !this.media_ || playlist.uri !== this.media_.uri;\n this.state = 'HAVE_METADATA'; // switching to the active playlist is a no-op\n\n if (!mediaChange) {\n return;\n } // switching from an already loaded playlist\n\n\n if (this.media_) {\n this.trigger('mediachanging');\n }\n\n this.media_ = playlist;\n this.refreshMedia_(); // trigger media change if the active media has been updated\n\n if (startingState !== 'HAVE_MASTER') {\n this.trigger('mediachange');\n }\n }\n }, {\n key: 'pause',\n value: function pause() {\n this.stopRequest();\n window$1.clearTimeout(this.mediaUpdateTimeout);\n\n if (this.state === 'HAVE_NOTHING') {\n // If we pause the loader before any data has been retrieved, its as if we never\n // started, so reset to an unstarted state.\n this.started = false;\n }\n }\n }, {\n key: 'load',\n value: function load(isFinalRendition) {\n var _this2 = this;\n\n window$1.clearTimeout(this.mediaUpdateTimeout);\n var media = this.media();\n\n if (isFinalRendition) {\n var delay = media ? media.targetDuration / 2 * 1000 : 5 * 1000;\n this.mediaUpdateTimeout = window$1.setTimeout(function () {\n return _this2.load();\n }, delay);\n return;\n } // because the playlists are internal to the manifest, load should either load the\n // main manifest, or do nothing but trigger an event\n\n\n if (!this.started) {\n this.start();\n return;\n }\n\n this.trigger('loadedplaylist');\n }\n /**\n * Parses the master xml string and updates playlist uri references\n *\n * @return {Object}\n * The parsed mpd manifest object\n */\n\n }, {\n key: 'parseMasterXml',\n value: function parseMasterXml() {\n var master = parse(this.masterXml_, {\n manifestUri: this.srcUrl,\n clientOffset: this.clientOffset_\n });\n master.uri = this.srcUrl; // Set up phony URIs for the playlists since we won't have external URIs for DASH\n // but reference playlists by their URI throughout the project\n // TODO: Should we create the dummy uris in mpd-parser as well (leaning towards yes).\n\n for (var i = 0; i < master.playlists.length; i++) {\n var phonyUri = 'placeholder-uri-' + i;\n master.playlists[i].uri = phonyUri; // set up by URI references\n\n master.playlists[phonyUri] = master.playlists[i];\n } // set up phony URIs for the media group playlists since we won't have external\n // URIs for DASH but reference playlists by their URI throughout the project\n\n\n forEachMediaGroup(master, function (properties, mediaType, groupKey, labelKey) {\n if (properties.playlists && properties.playlists.length) {\n var _phonyUri = 'placeholder-uri-' + mediaType + '-' + groupKey + '-' + labelKey;\n\n properties.playlists[0].uri = _phonyUri; // setup URI references\n\n master.playlists[_phonyUri] = properties.playlists[0];\n }\n });\n setupMediaPlaylists(master);\n resolveMediaGroupUris(master);\n return master;\n }\n }, {\n key: 'start',\n value: function start() {\n var _this3 = this;\n\n this.started = true; // request the specified URL\n\n this.request = this.hls_.xhr({\n uri: this.srcUrl,\n withCredentials: this.withCredentials\n }, function (error, req) {\n // disposed\n if (!_this3.request) {\n return;\n } // clear the loader's request reference\n\n\n _this3.request = null;\n\n if (error) {\n _this3.error = {\n status: req.status,\n message: 'DASH playlist request error at URL: ' + _this3.srcUrl,\n responseText: req.responseText,\n // MEDIA_ERR_NETWORK\n code: 2\n };\n\n if (_this3.state === 'HAVE_NOTHING') {\n _this3.started = false;\n }\n\n return _this3.trigger('error');\n }\n\n _this3.masterXml_ = req.responseText;\n\n if (req.responseHeaders && req.responseHeaders.date) {\n _this3.masterLoaded_ = Date.parse(req.responseHeaders.date);\n } else {\n _this3.masterLoaded_ = Date.now();\n }\n\n _this3.syncClientServerClock_(_this3.onClientServerClockSync_.bind(_this3));\n });\n }\n /**\n * Parses the master xml for UTCTiming node to sync the client clock to the server\n * clock. If the UTCTiming node requires a HEAD or GET request, that request is made.\n *\n * @param {Function} done\n * Function to call when clock sync has completed\n */\n\n }, {\n key: 'syncClientServerClock_',\n value: function syncClientServerClock_(done) {\n var _this4 = this;\n\n var utcTiming = parseUTCTiming(this.masterXml_); // No UTCTiming element found in the mpd. Use Date header from mpd request as the\n // server clock\n\n if (utcTiming === null) {\n this.clientOffset_ = this.masterLoaded_ - Date.now();\n return done();\n }\n\n if (utcTiming.method === 'DIRECT') {\n this.clientOffset_ = utcTiming.value - Date.now();\n return done();\n }\n\n this.request = this.hls_.xhr({\n uri: resolveUrl(this.srcUrl, utcTiming.value),\n method: utcTiming.method,\n withCredentials: this.withCredentials\n }, function (error, req) {\n // disposed\n if (!_this4.request) {\n return;\n }\n\n if (error) {\n // sync request failed, fall back to using date header from mpd\n // TODO: log warning\n _this4.clientOffset_ = _this4.masterLoaded_ - Date.now();\n return done();\n }\n\n var serverTime = void 0;\n\n if (utcTiming.method === 'HEAD') {\n if (!req.responseHeaders || !req.responseHeaders.date) {\n // expected date header not preset, fall back to using date header from mpd\n // TODO: log warning\n serverTime = _this4.masterLoaded_;\n } else {\n serverTime = Date.parse(req.responseHeaders.date);\n }\n } else {\n serverTime = Date.parse(req.responseText);\n }\n\n _this4.clientOffset_ = serverTime - Date.now();\n done();\n });\n }\n /**\n * Handler for after client/server clock synchronization has happened. Sets up\n * xml refresh timer if specificed by the manifest.\n */\n\n }, {\n key: 'onClientServerClockSync_',\n value: function onClientServerClockSync_() {\n var _this5 = this;\n\n this.master = this.parseMasterXml();\n this.state = 'HAVE_MASTER';\n this.trigger('loadedplaylist');\n\n if (!this.media_) {\n // no media playlist was specifically selected so start\n // from the first listed one\n this.media(this.master.playlists[0]);\n } // trigger loadedmetadata to resolve setup of media groups\n // trigger async to mimic behavior of HLS, where it must request a playlist\n\n\n window$1.setTimeout(function () {\n _this5.trigger('loadedmetadata');\n }, 0); // TODO: minimumUpdatePeriod can have a value of 0. Currently the manifest will not\n // be refreshed when this is the case. The inter-op guide says that when the\n // minimumUpdatePeriod is 0, the manifest should outline all currently available\n // segments, but future segments may require an update. I think a good solution\n // would be to update the manifest at the same rate that the media playlists\n // are \"refreshed\", i.e. every targetDuration.\n\n if (this.master.minimumUpdatePeriod) {\n window$1.setTimeout(function () {\n _this5.trigger('minimumUpdatePeriod');\n }, this.master.minimumUpdatePeriod);\n }\n }\n /**\n * Sends request to refresh the master xml and updates the parsed master manifest\n * TODO: Does the client offset need to be recalculated when the xml is refreshed?\n */\n\n }, {\n key: 'refreshXml_',\n value: function refreshXml_() {\n var _this6 = this;\n\n this.request = this.hls_.xhr({\n uri: this.srcUrl,\n withCredentials: this.withCredentials\n }, function (error, req) {\n // disposed\n if (!_this6.request) {\n return;\n } // clear the loader's request reference\n\n\n _this6.request = null;\n\n if (error) {\n _this6.error = {\n status: req.status,\n message: 'DASH playlist request error at URL: ' + _this6.srcUrl,\n responseText: req.responseText,\n // MEDIA_ERR_NETWORK\n code: 2\n };\n\n if (_this6.state === 'HAVE_NOTHING') {\n _this6.started = false;\n }\n\n return _this6.trigger('error');\n }\n\n _this6.masterXml_ = req.responseText;\n\n var newMaster = _this6.parseMasterXml();\n\n _this6.master = updateMaster$1(_this6.master, newMaster);\n window$1.setTimeout(function () {\n _this6.trigger('minimumUpdatePeriod');\n }, _this6.master.minimumUpdatePeriod);\n });\n }\n /**\n * Refreshes the media playlist by re-parsing the master xml and updating playlist\n * references. If this is an alternate loader, the updated parsed manifest is retrieved\n * from the master loader.\n */\n\n }, {\n key: 'refreshMedia_',\n value: function refreshMedia_() {\n var _this7 = this;\n\n var oldMaster = void 0;\n var newMaster = void 0;\n\n if (this.masterPlaylistLoader_) {\n oldMaster = this.masterPlaylistLoader_.master;\n newMaster = this.masterPlaylistLoader_.parseMasterXml();\n } else {\n oldMaster = this.master;\n newMaster = this.parseMasterXml();\n }\n\n var updatedMaster = updateMaster$1(oldMaster, newMaster);\n\n if (updatedMaster) {\n if (this.masterPlaylistLoader_) {\n this.masterPlaylistLoader_.master = updatedMaster;\n } else {\n this.master = updatedMaster;\n }\n\n this.media_ = updatedMaster.playlists[this.media_.uri];\n } else {\n this.trigger('playlistunchanged');\n }\n\n if (!this.media().endList) {\n this.mediaUpdateTimeout = window$1.setTimeout(function () {\n _this7.trigger('mediaupdatetimeout');\n }, refreshDelay(this.media(), !!updatedMaster));\n }\n\n this.trigger('loadedplaylist');\n }\n }]);\n return DashPlaylistLoader;\n}(EventTarget$1$1);\n\nvar logger = function logger(source) {\n if (videojs$1.log.debug) {\n return videojs$1.log.debug.bind(videojs$1, 'VHS:', source + ' >');\n }\n\n return function () {};\n};\n\nfunction noop() {}\n/**\n * @file source-updater.js\n */\n\n/**\n * A queue of callbacks to be serialized and applied when a\n * MediaSource and its associated SourceBuffers are not in the\n * updating state. It is used by the segment loader to update the\n * underlying SourceBuffers when new data is loaded, for instance.\n *\n * @class SourceUpdater\n * @param {MediaSource} mediaSource the MediaSource to create the\n * SourceBuffer from\n * @param {String} mimeType the desired MIME type of the underlying\n * SourceBuffer\n * @param {Object} sourceBufferEmitter an event emitter that fires when a source buffer is\n * added to the media source\n */\n\n\nvar SourceUpdater = function () {\n function SourceUpdater(mediaSource, mimeType, type, sourceBufferEmitter) {\n classCallCheck(this, SourceUpdater);\n this.callbacks_ = [];\n this.pendingCallback_ = null;\n this.timestampOffset_ = 0;\n this.mediaSource = mediaSource;\n this.processedAppend_ = false;\n this.type_ = type;\n this.mimeType_ = mimeType;\n this.logger_ = logger('SourceUpdater[' + type + '][' + mimeType + ']');\n\n if (mediaSource.readyState === 'closed') {\n mediaSource.addEventListener('sourceopen', this.createSourceBuffer_.bind(this, mimeType, sourceBufferEmitter));\n } else {\n this.createSourceBuffer_(mimeType, sourceBufferEmitter);\n }\n }\n\n createClass(SourceUpdater, [{\n key: 'createSourceBuffer_',\n value: function createSourceBuffer_(mimeType, sourceBufferEmitter) {\n var _this = this;\n\n this.sourceBuffer_ = this.mediaSource.addSourceBuffer(mimeType);\n this.logger_('created SourceBuffer');\n\n if (sourceBufferEmitter) {\n sourceBufferEmitter.trigger('sourcebufferadded');\n\n if (this.mediaSource.sourceBuffers.length < 2) {\n // There's another source buffer we must wait for before we can start updating\n // our own (or else we can get into a bad state, i.e., appending video/audio data\n // before the other video/audio source buffer is available and leading to a video\n // or audio only buffer).\n sourceBufferEmitter.on('sourcebufferadded', function () {\n _this.start_();\n });\n return;\n }\n }\n\n this.start_();\n }\n }, {\n key: 'start_',\n value: function start_() {\n var _this2 = this;\n\n this.started_ = true; // run completion handlers and process callbacks as updateend\n // events fire\n\n this.onUpdateendCallback_ = function () {\n var pendingCallback = _this2.pendingCallback_;\n _this2.pendingCallback_ = null;\n\n _this2.logger_('buffered [' + printableRange(_this2.buffered()) + ']');\n\n if (pendingCallback) {\n pendingCallback();\n }\n\n _this2.runCallback_();\n };\n\n this.sourceBuffer_.addEventListener('updateend', this.onUpdateendCallback_);\n this.runCallback_();\n }\n /**\n * Aborts the current segment and resets the segment parser.\n *\n * @param {Function} done function to call when done\n * @see http://w3c.github.io/media-source/#widl-SourceBuffer-abort-void\n */\n\n }, {\n key: 'abort',\n value: function abort(done) {\n var _this3 = this;\n\n if (this.processedAppend_) {\n this.queueCallback_(function () {\n _this3.sourceBuffer_.abort();\n }, done);\n }\n }\n /**\n * Queue an update to append an ArrayBuffer.\n *\n * @param {ArrayBuffer} bytes\n * @param {Function} done the function to call when done\n * @see http://www.w3.org/TR/media-source/#widl-SourceBuffer-appendBuffer-void-ArrayBuffer-data\n */\n\n }, {\n key: 'appendBuffer',\n value: function appendBuffer(bytes, done) {\n var _this4 = this;\n\n this.processedAppend_ = true;\n this.queueCallback_(function () {\n _this4.sourceBuffer_.appendBuffer(bytes);\n }, done);\n }\n /**\n * Indicates what TimeRanges are buffered in the managed SourceBuffer.\n *\n * @see http://www.w3.org/TR/media-source/#widl-SourceBuffer-buffered\n */\n\n }, {\n key: 'buffered',\n value: function buffered() {\n if (!this.sourceBuffer_) {\n return videojs$1.createTimeRanges();\n }\n\n return this.sourceBuffer_.buffered;\n }\n /**\n * Queue an update to remove a time range from the buffer.\n *\n * @param {Number} start where to start the removal\n * @param {Number} end where to end the removal\n * @param {Function} [done=noop] optional callback to be executed when the remove\n * operation is complete\n * @see http://www.w3.org/TR/media-source/#widl-SourceBuffer-remove-void-double-start-unrestricted-double-end\n */\n\n }, {\n key: 'remove',\n value: function remove(start, end) {\n var _this5 = this;\n\n var done = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : noop;\n\n if (this.processedAppend_) {\n this.queueCallback_(function () {\n _this5.logger_('remove [' + start + ' => ' + end + ']');\n\n _this5.sourceBuffer_.remove(start, end);\n }, done);\n }\n }\n /**\n * Whether the underlying sourceBuffer is updating or not\n *\n * @return {Boolean} the updating status of the SourceBuffer\n */\n\n }, {\n key: 'updating',\n value: function updating() {\n return !this.sourceBuffer_ || this.sourceBuffer_.updating || this.pendingCallback_;\n }\n /**\n * Set/get the timestampoffset on the SourceBuffer\n *\n * @return {Number} the timestamp offset\n */\n\n }, {\n key: 'timestampOffset',\n value: function timestampOffset(offset) {\n var _this6 = this;\n\n if (typeof offset !== 'undefined') {\n this.queueCallback_(function () {\n _this6.sourceBuffer_.timestampOffset = offset;\n });\n this.timestampOffset_ = offset;\n }\n\n return this.timestampOffset_;\n }\n /**\n * Queue a callback to run\n */\n\n }, {\n key: 'queueCallback_',\n value: function queueCallback_(callback, done) {\n this.callbacks_.push([callback.bind(this), done]);\n this.runCallback_();\n }\n /**\n * Run a queued callback\n */\n\n }, {\n key: 'runCallback_',\n value: function runCallback_() {\n var callbacks = void 0;\n\n if (!this.updating() && this.callbacks_.length && this.started_) {\n callbacks = this.callbacks_.shift();\n this.pendingCallback_ = callbacks[1];\n callbacks[0]();\n }\n }\n /**\n * dispose of the source updater and the underlying sourceBuffer\n */\n\n }, {\n key: 'dispose',\n value: function dispose() {\n this.sourceBuffer_.removeEventListener('updateend', this.onUpdateendCallback_);\n\n if (this.sourceBuffer_ && this.mediaSource.readyState === 'open') {\n this.sourceBuffer_.abort();\n }\n }\n }]);\n return SourceUpdater;\n}();\n\nvar Config = {\n GOAL_BUFFER_LENGTH: 30,\n MAX_GOAL_BUFFER_LENGTH: 60,\n GOAL_BUFFER_LENGTH_RATE: 1,\n // 0.5 MB/s\n INITIAL_BANDWIDTH: 4194304,\n // A fudge factor to apply to advertised playlist bitrates to account for\n // temporary flucations in client bandwidth\n BANDWIDTH_VARIANCE: 1.2,\n // How much of the buffer must be filled before we consider upswitching\n BUFFER_LOW_WATER_LINE: 0,\n MAX_BUFFER_LOW_WATER_LINE: 30,\n BUFFER_LOW_WATER_LINE_RATE: 1\n};\nvar REQUEST_ERRORS = {\n FAILURE: 2,\n TIMEOUT: -101,\n ABORTED: -102\n};\n/**\n * Turns segment byterange into a string suitable for use in\n * HTTP Range requests\n *\n * @param {Object} byterange - an object with two values defining the start and end\n * of a byte-range\n */\n\nvar byterangeStr = function byterangeStr(byterange) {\n var byterangeStart = void 0;\n var byterangeEnd = void 0; // `byterangeEnd` is one less than `offset + length` because the HTTP range\n // header uses inclusive ranges\n\n byterangeEnd = byterange.offset + byterange.length - 1;\n byterangeStart = byterange.offset;\n return 'bytes=' + byterangeStart + '-' + byterangeEnd;\n};\n/**\n * Defines headers for use in the xhr request for a particular segment.\n *\n * @param {Object} segment - a simplified copy of the segmentInfo object\n * from SegmentLoader\n */\n\n\nvar segmentXhrHeaders = function segmentXhrHeaders(segment) {\n var headers = {};\n\n if (segment.byterange) {\n headers.Range = byterangeStr(segment.byterange);\n }\n\n return headers;\n};\n/**\n * Abort all requests\n *\n * @param {Object} activeXhrs - an object that tracks all XHR requests\n */\n\n\nvar abortAll = function abortAll(activeXhrs) {\n activeXhrs.forEach(function (xhr$$1) {\n xhr$$1.abort();\n });\n};\n/**\n * Gather important bandwidth stats once a request has completed\n *\n * @param {Object} request - the XHR request from which to gather stats\n */\n\n\nvar getRequestStats = function getRequestStats(request) {\n return {\n bandwidth: request.bandwidth,\n bytesReceived: request.bytesReceived || 0,\n roundTripTime: request.roundTripTime || 0\n };\n};\n/**\n * If possible gather bandwidth stats as a request is in\n * progress\n *\n * @param {Event} progressEvent - an event object from an XHR's progress event\n */\n\n\nvar getProgressStats = function getProgressStats(progressEvent) {\n var request = progressEvent.target;\n var roundTripTime = Date.now() - request.requestTime;\n var stats = {\n bandwidth: Infinity,\n bytesReceived: 0,\n roundTripTime: roundTripTime || 0\n };\n stats.bytesReceived = progressEvent.loaded; // This can result in Infinity if stats.roundTripTime is 0 but that is ok\n // because we should only use bandwidth stats on progress to determine when\n // abort a request early due to insufficient bandwidth\n\n stats.bandwidth = Math.floor(stats.bytesReceived / stats.roundTripTime * 8 * 1000);\n return stats;\n};\n/**\n * Handle all error conditions in one place and return an object\n * with all the information\n *\n * @param {Error|null} error - if non-null signals an error occured with the XHR\n * @param {Object} request - the XHR request that possibly generated the error\n */\n\n\nvar handleErrors = function handleErrors(error, request) {\n if (request.timedout) {\n return {\n status: request.status,\n message: 'HLS request timed-out at URL: ' + request.uri,\n code: REQUEST_ERRORS.TIMEOUT,\n xhr: request\n };\n }\n\n if (request.aborted) {\n return {\n status: request.status,\n message: 'HLS request aborted at URL: ' + request.uri,\n code: REQUEST_ERRORS.ABORTED,\n xhr: request\n };\n }\n\n if (error) {\n return {\n status: request.status,\n message: 'HLS request errored at URL: ' + request.uri,\n code: REQUEST_ERRORS.FAILURE,\n xhr: request\n };\n }\n\n return null;\n};\n/**\n * Handle responses for key data and convert the key data to the correct format\n * for the decryption step later\n *\n * @param {Object} segment - a simplified copy of the segmentInfo object\n * from SegmentLoader\n * @param {Function} finishProcessingFn - a callback to execute to continue processing\n * this request\n */\n\n\nvar handleKeyResponse = function handleKeyResponse(segment, finishProcessingFn) {\n return function (error, request) {\n var response = request.response;\n var errorObj = handleErrors(error, request);\n\n if (errorObj) {\n return finishProcessingFn(errorObj, segment);\n }\n\n if (response.byteLength !== 16) {\n return finishProcessingFn({\n status: request.status,\n message: 'Invalid HLS key at URL: ' + request.uri,\n code: REQUEST_ERRORS.FAILURE,\n xhr: request\n }, segment);\n }\n\n var view = new DataView(response);\n segment.key.bytes = new Uint32Array([view.getUint32(0), view.getUint32(4), view.getUint32(8), view.getUint32(12)]);\n return finishProcessingFn(null, segment);\n };\n};\n/**\n * Handle init-segment responses\n *\n * @param {Object} segment - a simplified copy of the segmentInfo object\n * from SegmentLoader\n * @param {Function} finishProcessingFn - a callback to execute to continue processing\n * this request\n */\n\n\nvar handleInitSegmentResponse = function handleInitSegmentResponse(segment, captionParser, finishProcessingFn) {\n return function (error, request) {\n var response = request.response;\n var errorObj = handleErrors(error, request);\n\n if (errorObj) {\n return finishProcessingFn(errorObj, segment);\n } // stop processing if received empty content\n\n\n if (response.byteLength === 0) {\n return finishProcessingFn({\n status: request.status,\n message: 'Empty HLS segment content at URL: ' + request.uri,\n code: REQUEST_ERRORS.FAILURE,\n xhr: request\n }, segment);\n }\n\n segment.map.bytes = new Uint8Array(request.response); // Initialize CaptionParser if it hasn't been yet\n\n if (!captionParser.isInitialized()) {\n captionParser.init();\n }\n\n segment.map.timescales = mp4probe.timescale(segment.map.bytes);\n segment.map.videoTrackIds = mp4probe.videoTrackIds(segment.map.bytes);\n return finishProcessingFn(null, segment);\n };\n};\n/**\n * Response handler for segment-requests being sure to set the correct\n * property depending on whether the segment is encryped or not\n * Also records and keeps track of stats that are used for ABR purposes\n *\n * @param {Object} segment - a simplified copy of the segmentInfo object\n * from SegmentLoader\n * @param {Function} finishProcessingFn - a callback to execute to continue processing\n * this request\n */\n\n\nvar handleSegmentResponse = function handleSegmentResponse(segment, captionParser, finishProcessingFn) {\n return function (error, request) {\n var response = request.response;\n var errorObj = handleErrors(error, request);\n var parsed = void 0;\n\n if (errorObj) {\n return finishProcessingFn(errorObj, segment);\n } // stop processing if received empty content\n\n\n if (response.byteLength === 0) {\n return finishProcessingFn({\n status: request.status,\n message: 'Empty HLS segment content at URL: ' + request.uri,\n code: REQUEST_ERRORS.FAILURE,\n xhr: request\n }, segment);\n }\n\n segment.stats = getRequestStats(request);\n\n if (segment.key) {\n segment.encryptedBytes = new Uint8Array(request.response);\n } else {\n segment.bytes = new Uint8Array(request.response);\n } // This is likely an FMP4 and has the init segment.\n // Run through the CaptionParser in case there are captions.\n\n\n if (segment.map && segment.map.bytes) {\n // Initialize CaptionParser if it hasn't been yet\n if (!captionParser.isInitialized()) {\n captionParser.init();\n }\n\n parsed = captionParser.parse(segment.bytes, segment.map.videoTrackIds, segment.map.timescales);\n\n if (parsed && parsed.captions) {\n segment.captionStreams = parsed.captionStreams;\n segment.fmp4Captions = parsed.captions;\n }\n }\n\n return finishProcessingFn(null, segment);\n };\n};\n/**\n * Decrypt the segment via the decryption web worker\n *\n * @param {WebWorker} decrypter - a WebWorker interface to AES-128 decryption routines\n * @param {Object} segment - a simplified copy of the segmentInfo object\n * from SegmentLoader\n * @param {Function} doneFn - a callback that is executed after decryption has completed\n */\n\n\nvar decryptSegment = function decryptSegment(decrypter, segment, doneFn) {\n var decryptionHandler = function decryptionHandler(event) {\n if (event.data.source === segment.requestId) {\n decrypter.removeEventListener('message', decryptionHandler);\n var decrypted = event.data.decrypted;\n segment.bytes = new Uint8Array(decrypted.bytes, decrypted.byteOffset, decrypted.byteLength);\n return doneFn(null, segment);\n }\n };\n\n decrypter.addEventListener('message', decryptionHandler); // this is an encrypted segment\n // incrementally decrypt the segment\n\n decrypter.postMessage(createTransferableMessage({\n source: segment.requestId,\n encrypted: segment.encryptedBytes,\n key: segment.key.bytes,\n iv: segment.key.iv\n }), [segment.encryptedBytes.buffer, segment.key.bytes.buffer]);\n};\n/**\n * This function waits for all XHRs to finish (with either success or failure)\n * before continueing processing via it's callback. The function gathers errors\n * from each request into a single errors array so that the error status for\n * each request can be examined later.\n *\n * @param {Object} activeXhrs - an object that tracks all XHR requests\n * @param {WebWorker} decrypter - a WebWorker interface to AES-128 decryption routines\n * @param {Function} doneFn - a callback that is executed after all resources have been\n * downloaded and any decryption completed\n */\n\n\nvar waitForCompletion = function waitForCompletion(activeXhrs, decrypter, doneFn) {\n var count = 0;\n var didError = false;\n return function (error, segment) {\n if (didError) {\n return;\n }\n\n if (error) {\n didError = true; // If there are errors, we have to abort any outstanding requests\n\n abortAll(activeXhrs); // Even though the requests above are aborted, and in theory we could wait until we\n // handle the aborted events from those requests, there are some cases where we may\n // never get an aborted event. For instance, if the network connection is lost and\n // there were two requests, the first may have triggered an error immediately, while\n // the second request remains unsent. In that case, the aborted algorithm will not\n // trigger an abort: see https://xhr.spec.whatwg.org/#the-abort()-method\n //\n // We also can't rely on the ready state of the XHR, since the request that\n // triggered the connection error may also show as a ready state of 0 (unsent).\n // Therefore, we have to finish this group of requests immediately after the first\n // seen error.\n\n return doneFn(error, segment);\n }\n\n count += 1;\n\n if (count === activeXhrs.length) {\n // Keep track of when *all* of the requests have completed\n segment.endOfAllRequests = Date.now();\n\n if (segment.encryptedBytes) {\n return decryptSegment(decrypter, segment, doneFn);\n } // Otherwise, everything is ready just continue\n\n\n return doneFn(null, segment);\n }\n };\n};\n/**\n * Simple progress event callback handler that gathers some stats before\n * executing a provided callback with the `segment` object\n *\n * @param {Object} segment - a simplified copy of the segmentInfo object\n * from SegmentLoader\n * @param {Function} progressFn - a callback that is executed each time a progress event\n * is received\n * @param {Event} event - the progress event object from XMLHttpRequest\n */\n\n\nvar handleProgress = function handleProgress(segment, progressFn) {\n return function (event) {\n segment.stats = videojs$1.mergeOptions(segment.stats, getProgressStats(event)); // record the time that we receive the first byte of data\n\n if (!segment.stats.firstBytesReceivedAt && segment.stats.bytesReceived) {\n segment.stats.firstBytesReceivedAt = Date.now();\n }\n\n return progressFn(event, segment);\n };\n};\n/**\n * Load all resources and does any processing necessary for a media-segment\n *\n * Features:\n * decrypts the media-segment if it has a key uri and an iv\n * aborts *all* requests if *any* one request fails\n *\n * The segment object, at minimum, has the following format:\n * {\n * resolvedUri: String,\n * [byterange]: {\n * offset: Number,\n * length: Number\n * },\n * [key]: {\n * resolvedUri: String\n * [byterange]: {\n * offset: Number,\n * length: Number\n * },\n * iv: {\n * bytes: Uint32Array\n * }\n * },\n * [map]: {\n * resolvedUri: String,\n * [byterange]: {\n * offset: Number,\n * length: Number\n * },\n * [bytes]: Uint8Array\n * }\n * }\n * ...where [name] denotes optional properties\n *\n * @param {Function} xhr - an instance of the xhr wrapper in xhr.js\n * @param {Object} xhrOptions - the base options to provide to all xhr requests\n * @param {WebWorker} decryptionWorker - a WebWorker interface to AES-128\n * decryption routines\n * @param {Object} segment - a simplified copy of the segmentInfo object\n * from SegmentLoader\n * @param {Function} progressFn - a callback that receives progress events from the main\n * segment's xhr request\n * @param {Function} doneFn - a callback that is executed only once all requests have\n * succeeded or failed\n * @returns {Function} a function that, when invoked, immediately aborts all\n * outstanding requests\n */\n\n\nvar mediaSegmentRequest = function mediaSegmentRequest(xhr$$1, xhrOptions, decryptionWorker, captionParser, segment, progressFn, doneFn) {\n var activeXhrs = [];\n var finishProcessingFn = waitForCompletion(activeXhrs, decryptionWorker, doneFn); // optionally, request the decryption key\n\n if (segment.key) {\n var keyRequestOptions = videojs$1.mergeOptions(xhrOptions, {\n uri: segment.key.resolvedUri,\n responseType: 'arraybuffer'\n });\n var keyRequestCallback = handleKeyResponse(segment, finishProcessingFn);\n var keyXhr = xhr$$1(keyRequestOptions, keyRequestCallback);\n activeXhrs.push(keyXhr);\n } // optionally, request the associated media init segment\n\n\n if (segment.map && !segment.map.bytes) {\n var initSegmentOptions = videojs$1.mergeOptions(xhrOptions, {\n uri: segment.map.resolvedUri,\n responseType: 'arraybuffer',\n headers: segmentXhrHeaders(segment.map)\n });\n var initSegmentRequestCallback = handleInitSegmentResponse(segment, captionParser, finishProcessingFn);\n var initSegmentXhr = xhr$$1(initSegmentOptions, initSegmentRequestCallback);\n activeXhrs.push(initSegmentXhr);\n }\n\n var segmentRequestOptions = videojs$1.mergeOptions(xhrOptions, {\n uri: segment.resolvedUri,\n responseType: 'arraybuffer',\n headers: segmentXhrHeaders(segment)\n });\n var segmentRequestCallback = handleSegmentResponse(segment, captionParser, finishProcessingFn);\n var segmentXhr = xhr$$1(segmentRequestOptions, segmentRequestCallback);\n segmentXhr.addEventListener('progress', handleProgress(segment, progressFn));\n activeXhrs.push(segmentXhr);\n return function () {\n return abortAll(activeXhrs);\n };\n}; // Utilities\n\n/**\n * Returns the CSS value for the specified property on an element\n * using `getComputedStyle`. Firefox has a long-standing issue where\n * getComputedStyle() may return null when running in an iframe with\n * `display: none`.\n *\n * @see https://bugzilla.mozilla.org/show_bug.cgi?id=548397\n * @param {HTMLElement} el the htmlelement to work on\n * @param {string} the proprety to get the style for\n */\n\n\nvar safeGetComputedStyle = function safeGetComputedStyle(el, property) {\n var result = void 0;\n\n if (!el) {\n return '';\n }\n\n result = window$1.getComputedStyle(el);\n\n if (!result) {\n return '';\n }\n\n return result[property];\n};\n/**\n * Resuable stable sort function\n *\n * @param {Playlists} array\n * @param {Function} sortFn Different comparators\n * @function stableSort\n */\n\n\nvar stableSort = function stableSort(array, sortFn) {\n var newArray = array.slice();\n array.sort(function (left, right) {\n var cmp = sortFn(left, right);\n\n if (cmp === 0) {\n return newArray.indexOf(left) - newArray.indexOf(right);\n }\n\n return cmp;\n });\n};\n/**\n * A comparator function to sort two playlist object by bandwidth.\n *\n * @param {Object} left a media playlist object\n * @param {Object} right a media playlist object\n * @return {Number} Greater than zero if the bandwidth attribute of\n * left is greater than the corresponding attribute of right. Less\n * than zero if the bandwidth of right is greater than left and\n * exactly zero if the two are equal.\n */\n\n\nvar comparePlaylistBandwidth = function comparePlaylistBandwidth(left, right) {\n var leftBandwidth = void 0;\n var rightBandwidth = void 0;\n\n if (left.attributes.BANDWIDTH) {\n leftBandwidth = left.attributes.BANDWIDTH;\n }\n\n leftBandwidth = leftBandwidth || window$1.Number.MAX_VALUE;\n\n if (right.attributes.BANDWIDTH) {\n rightBandwidth = right.attributes.BANDWIDTH;\n }\n\n rightBandwidth = rightBandwidth || window$1.Number.MAX_VALUE;\n return leftBandwidth - rightBandwidth;\n};\n/**\n * A comparator function to sort two playlist object by resolution (width).\n * @param {Object} left a media playlist object\n * @param {Object} right a media playlist object\n * @return {Number} Greater than zero if the resolution.width attribute of\n * left is greater than the corresponding attribute of right. Less\n * than zero if the resolution.width of right is greater than left and\n * exactly zero if the two are equal.\n */\n\n\nvar comparePlaylistResolution = function comparePlaylistResolution(left, right) {\n var leftWidth = void 0;\n var rightWidth = void 0;\n\n if (left.attributes.RESOLUTION && left.attributes.RESOLUTION.width) {\n leftWidth = left.attributes.RESOLUTION.width;\n }\n\n leftWidth = leftWidth || window$1.Number.MAX_VALUE;\n\n if (right.attributes.RESOLUTION && right.attributes.RESOLUTION.width) {\n rightWidth = right.attributes.RESOLUTION.width;\n }\n\n rightWidth = rightWidth || window$1.Number.MAX_VALUE; // NOTE - Fallback to bandwidth sort as appropriate in cases where multiple renditions\n // have the same media dimensions/ resolution\n\n if (leftWidth === rightWidth && left.attributes.BANDWIDTH && right.attributes.BANDWIDTH) {\n return left.attributes.BANDWIDTH - right.attributes.BANDWIDTH;\n }\n\n return leftWidth - rightWidth;\n};\n/**\n * Chooses the appropriate media playlist based on bandwidth and player size\n *\n * @param {Object} master\n * Object representation of the master manifest\n * @param {Number} playerBandwidth\n * Current calculated bandwidth of the player\n * @param {Number} playerWidth\n * Current width of the player element\n * @param {Number} playerHeight\n * Current height of the player element\n * @param {Boolean} limitRenditionByPlayerDimensions\n * True if the player width and height should be used during the selection, false otherwise\n * @return {Playlist} the highest bitrate playlist less than the\n * currently detected bandwidth, accounting for some amount of\n * bandwidth variance\n */\n\n\nvar simpleSelector = function simpleSelector(master, playerBandwidth, playerWidth, playerHeight, limitRenditionByPlayerDimensions) {\n // convert the playlists to an intermediary representation to make comparisons easier\n var sortedPlaylistReps = master.playlists.map(function (playlist) {\n var width = void 0;\n var height = void 0;\n var bandwidth = void 0;\n width = playlist.attributes.RESOLUTION && playlist.attributes.RESOLUTION.width;\n height = playlist.attributes.RESOLUTION && playlist.attributes.RESOLUTION.height;\n bandwidth = playlist.attributes.BANDWIDTH;\n bandwidth = bandwidth || window$1.Number.MAX_VALUE;\n return {\n bandwidth: bandwidth,\n width: width,\n height: height,\n playlist: playlist\n };\n });\n stableSort(sortedPlaylistReps, function (left, right) {\n return left.bandwidth - right.bandwidth;\n }); // filter out any playlists that have been excluded due to\n // incompatible configurations\n\n sortedPlaylistReps = sortedPlaylistReps.filter(function (rep) {\n return !Playlist.isIncompatible(rep.playlist);\n }); // filter out any playlists that have been disabled manually through the representations\n // api or blacklisted temporarily due to playback errors.\n\n var enabledPlaylistReps = sortedPlaylistReps.filter(function (rep) {\n return Playlist.isEnabled(rep.playlist);\n });\n\n if (!enabledPlaylistReps.length) {\n // if there are no enabled playlists, then they have all been blacklisted or disabled\n // by the user through the representations api. In this case, ignore blacklisting and\n // fallback to what the user wants by using playlists the user has not disabled.\n enabledPlaylistReps = sortedPlaylistReps.filter(function (rep) {\n return !Playlist.isDisabled(rep.playlist);\n });\n } // filter out any variant that has greater effective bitrate\n // than the current estimated bandwidth\n\n\n var bandwidthPlaylistReps = enabledPlaylistReps.filter(function (rep) {\n return rep.bandwidth * Config.BANDWIDTH_VARIANCE < playerBandwidth;\n });\n var highestRemainingBandwidthRep = bandwidthPlaylistReps[bandwidthPlaylistReps.length - 1]; // get all of the renditions with the same (highest) bandwidth\n // and then taking the very first element\n\n var bandwidthBestRep = bandwidthPlaylistReps.filter(function (rep) {\n return rep.bandwidth === highestRemainingBandwidthRep.bandwidth;\n })[0]; // if we're not going to limit renditions by player size, make an early decision.\n\n if (limitRenditionByPlayerDimensions === false) {\n var _chosenRep = bandwidthBestRep || enabledPlaylistReps[0] || sortedPlaylistReps[0];\n\n return _chosenRep ? _chosenRep.playlist : null;\n } // filter out playlists without resolution information\n\n\n var haveResolution = bandwidthPlaylistReps.filter(function (rep) {\n return rep.width && rep.height;\n }); // sort variants by resolution\n\n stableSort(haveResolution, function (left, right) {\n return left.width - right.width;\n }); // if we have the exact resolution as the player use it\n\n var resolutionBestRepList = haveResolution.filter(function (rep) {\n return rep.width === playerWidth && rep.height === playerHeight;\n });\n highestRemainingBandwidthRep = resolutionBestRepList[resolutionBestRepList.length - 1]; // ensure that we pick the highest bandwidth variant that have exact resolution\n\n var resolutionBestRep = resolutionBestRepList.filter(function (rep) {\n return rep.bandwidth === highestRemainingBandwidthRep.bandwidth;\n })[0];\n var resolutionPlusOneList = void 0;\n var resolutionPlusOneSmallest = void 0;\n var resolutionPlusOneRep = void 0; // find the smallest variant that is larger than the player\n // if there is no match of exact resolution\n\n if (!resolutionBestRep) {\n resolutionPlusOneList = haveResolution.filter(function (rep) {\n return rep.width > playerWidth || rep.height > playerHeight;\n }); // find all the variants have the same smallest resolution\n\n resolutionPlusOneSmallest = resolutionPlusOneList.filter(function (rep) {\n return rep.width === resolutionPlusOneList[0].width && rep.height === resolutionPlusOneList[0].height;\n }); // ensure that we also pick the highest bandwidth variant that\n // is just-larger-than the video player\n\n highestRemainingBandwidthRep = resolutionPlusOneSmallest[resolutionPlusOneSmallest.length - 1];\n resolutionPlusOneRep = resolutionPlusOneSmallest.filter(function (rep) {\n return rep.bandwidth === highestRemainingBandwidthRep.bandwidth;\n })[0];\n } // fallback chain of variants\n\n\n var chosenRep = resolutionPlusOneRep || resolutionBestRep || bandwidthBestRep || enabledPlaylistReps[0] || sortedPlaylistReps[0];\n return chosenRep ? chosenRep.playlist : null;\n}; // Playlist Selectors\n\n/**\n * Chooses the appropriate media playlist based on the most recent\n * bandwidth estimate and the player size.\n *\n * Expects to be called within the context of an instance of HlsHandler\n *\n * @return {Playlist} the highest bitrate playlist less than the\n * currently detected bandwidth, accounting for some amount of\n * bandwidth variance\n */\n\n\nvar lastBandwidthSelector = function lastBandwidthSelector() {\n return simpleSelector(this.playlists.master, this.systemBandwidth, parseInt(safeGetComputedStyle(this.tech_.el(), 'width'), 10), parseInt(safeGetComputedStyle(this.tech_.el(), 'height'), 10), this.limitRenditionByPlayerDimensions);\n};\n/**\n * Chooses the appropriate media playlist based on the potential to rebuffer\n *\n * @param {Object} settings\n * Object of information required to use this selector\n * @param {Object} settings.master\n * Object representation of the master manifest\n * @param {Number} settings.currentTime\n * The current time of the player\n * @param {Number} settings.bandwidth\n * Current measured bandwidth\n * @param {Number} settings.duration\n * Duration of the media\n * @param {Number} settings.segmentDuration\n * Segment duration to be used in round trip time calculations\n * @param {Number} settings.timeUntilRebuffer\n * Time left in seconds until the player has to rebuffer\n * @param {Number} settings.currentTimeline\n * The current timeline segments are being loaded from\n * @param {SyncController} settings.syncController\n * SyncController for determining if we have a sync point for a given playlist\n * @return {Object|null}\n * {Object} return.playlist\n * The highest bandwidth playlist with the least amount of rebuffering\n * {Number} return.rebufferingImpact\n * The amount of time in seconds switching to this playlist will rebuffer. A\n * negative value means that switching will cause zero rebuffering.\n */\n\n\nvar minRebufferMaxBandwidthSelector = function minRebufferMaxBandwidthSelector(settings) {\n var master = settings.master,\n currentTime = settings.currentTime,\n bandwidth = settings.bandwidth,\n duration$$1 = settings.duration,\n segmentDuration = settings.segmentDuration,\n timeUntilRebuffer = settings.timeUntilRebuffer,\n currentTimeline = settings.currentTimeline,\n syncController = settings.syncController; // filter out any playlists that have been excluded due to\n // incompatible configurations\n\n var compatiblePlaylists = master.playlists.filter(function (playlist) {\n return !Playlist.isIncompatible(playlist);\n }); // filter out any playlists that have been disabled manually through the representations\n // api or blacklisted temporarily due to playback errors.\n\n var enabledPlaylists = compatiblePlaylists.filter(Playlist.isEnabled);\n\n if (!enabledPlaylists.length) {\n // if there are no enabled playlists, then they have all been blacklisted or disabled\n // by the user through the representations api. In this case, ignore blacklisting and\n // fallback to what the user wants by using playlists the user has not disabled.\n enabledPlaylists = compatiblePlaylists.filter(function (playlist) {\n return !Playlist.isDisabled(playlist);\n });\n }\n\n var bandwidthPlaylists = enabledPlaylists.filter(Playlist.hasAttribute.bind(null, 'BANDWIDTH'));\n var rebufferingEstimates = bandwidthPlaylists.map(function (playlist) {\n var syncPoint = syncController.getSyncPoint(playlist, duration$$1, currentTimeline, currentTime); // If there is no sync point for this playlist, switching to it will require a\n // sync request first. This will double the request time\n\n var numRequests = syncPoint ? 1 : 2;\n var requestTimeEstimate = Playlist.estimateSegmentRequestTime(segmentDuration, bandwidth, playlist);\n var rebufferingImpact = requestTimeEstimate * numRequests - timeUntilRebuffer;\n return {\n playlist: playlist,\n rebufferingImpact: rebufferingImpact\n };\n });\n var noRebufferingPlaylists = rebufferingEstimates.filter(function (estimate) {\n return estimate.rebufferingImpact <= 0;\n }); // Sort by bandwidth DESC\n\n stableSort(noRebufferingPlaylists, function (a, b) {\n return comparePlaylistBandwidth(b.playlist, a.playlist);\n });\n\n if (noRebufferingPlaylists.length) {\n return noRebufferingPlaylists[0];\n }\n\n stableSort(rebufferingEstimates, function (a, b) {\n return a.rebufferingImpact - b.rebufferingImpact;\n });\n return rebufferingEstimates[0] || null;\n};\n/**\n * Chooses the appropriate media playlist, which in this case is the lowest bitrate\n * one with video. If no renditions with video exist, return the lowest audio rendition.\n *\n * Expects to be called within the context of an instance of HlsHandler\n *\n * @return {Object|null}\n * {Object} return.playlist\n * The lowest bitrate playlist that contains a video codec. If no such rendition\n * exists pick the lowest audio rendition.\n */\n\n\nvar lowestBitrateCompatibleVariantSelector = function lowestBitrateCompatibleVariantSelector() {\n // filter out any playlists that have been excluded due to\n // incompatible configurations or playback errors\n var playlists = this.playlists.master.playlists.filter(Playlist.isEnabled); // Sort ascending by bitrate\n\n stableSort(playlists, function (a, b) {\n return comparePlaylistBandwidth(a, b);\n }); // Parse and assume that playlists with no video codec have no video\n // (this is not necessarily true, although it is generally true).\n //\n // If an entire manifest has no valid videos everything will get filtered\n // out.\n\n var playlistsWithVideo = playlists.filter(function (playlist) {\n return parseCodecs(playlist.attributes.CODECS).videoCodec;\n });\n return playlistsWithVideo[0] || null;\n};\n/**\n * Create captions text tracks on video.js if they do not exist\n *\n * @param {Object} inbandTextTracks a reference to current inbandTextTracks\n * @param {Object} tech the video.js tech\n * @param {Object} captionStreams the caption streams to create\n * @private\n */\n\n\nvar createCaptionsTrackIfNotExists = function createCaptionsTrackIfNotExists(inbandTextTracks, tech, captionStreams) {\n for (var trackId in captionStreams) {\n if (!inbandTextTracks[trackId]) {\n tech.trigger({\n type: 'usage',\n name: 'hls-608'\n });\n var track = tech.textTracks().getTrackById(trackId);\n\n if (track) {\n // Resuse an existing track with a CC# id because this was\n // very likely created by videojs-contrib-hls from information\n // in the m3u8 for us to use\n inbandTextTracks[trackId] = track;\n } else {\n // Otherwise, create a track with the default `CC#` label and\n // without a language\n inbandTextTracks[trackId] = tech.addRemoteTextTrack({\n kind: 'captions',\n id: trackId,\n label: trackId\n }, false).track;\n }\n }\n }\n};\n\nvar addCaptionData = function addCaptionData(_ref) {\n var inbandTextTracks = _ref.inbandTextTracks,\n captionArray = _ref.captionArray,\n timestampOffset = _ref.timestampOffset;\n\n if (!captionArray) {\n return;\n }\n\n var Cue = window.WebKitDataCue || window.VTTCue;\n captionArray.forEach(function (caption) {\n var track = caption.stream;\n var startTime = caption.startTime;\n var endTime = caption.endTime;\n\n if (!inbandTextTracks[track]) {\n return;\n }\n\n startTime += timestampOffset;\n endTime += timestampOffset;\n inbandTextTracks[track].addCue(new Cue(startTime, endTime, caption.text));\n });\n};\n/**\n * @file segment-loader.js\n */\n// in ms\n\n\nvar CHECK_BUFFER_DELAY = 500;\n/**\n * Determines if we should call endOfStream on the media source based\n * on the state of the buffer or if appened segment was the final\n * segment in the playlist.\n *\n * @param {Object} playlist a media playlist object\n * @param {Object} mediaSource the MediaSource object\n * @param {Number} segmentIndex the index of segment we last appended\n * @returns {Boolean} do we need to call endOfStream on the MediaSource\n */\n\nvar detectEndOfStream = function detectEndOfStream(playlist, mediaSource, segmentIndex) {\n if (!playlist || !mediaSource) {\n return false;\n }\n\n var segments = playlist.segments; // determine a few boolean values to help make the branch below easier\n // to read\n\n var appendedLastSegment = segmentIndex === segments.length; // if we've buffered to the end of the video, we need to call endOfStream\n // so that MediaSources can trigger the `ended` event when it runs out of\n // buffered data instead of waiting for me\n\n return playlist.endList && mediaSource.readyState === 'open' && appendedLastSegment;\n};\n\nvar finite = function finite(num) {\n return typeof num === 'number' && isFinite(num);\n};\n\nvar illegalMediaSwitch = function illegalMediaSwitch(loaderType, startingMedia, newSegmentMedia) {\n // Although these checks should most likely cover non 'main' types, for now it narrows\n // the scope of our checks.\n if (loaderType !== 'main' || !startingMedia || !newSegmentMedia) {\n return null;\n }\n\n if (!newSegmentMedia.containsAudio && !newSegmentMedia.containsVideo) {\n return 'Neither audio nor video found in segment.';\n }\n\n if (startingMedia.containsVideo && !newSegmentMedia.containsVideo) {\n return 'Only audio found in segment when we expected video.' + ' We can\\'t switch to audio only from a stream that had video.' + ' To get rid of this message, please add codec information to the manifest.';\n }\n\n if (!startingMedia.containsVideo && newSegmentMedia.containsVideo) {\n return 'Video found in segment when we expected only audio.' + ' We can\\'t switch to a stream with video from an audio only stream.' + ' To get rid of this message, please add codec information to the manifest.';\n }\n\n return null;\n};\n/**\n * Calculates a time value that is safe to remove from the back buffer without interupting\n * playback.\n *\n * @param {TimeRange} seekable\n * The current seekable range\n * @param {Number} currentTime\n * The current time of the player\n * @param {Number} targetDuration\n * The target duration of the current playlist\n * @return {Number}\n * Time that is safe to remove from the back buffer without interupting playback\n */\n\n\nvar safeBackBufferTrimTime = function safeBackBufferTrimTime(seekable$$1, currentTime, targetDuration) {\n var removeToTime = void 0;\n\n if (seekable$$1.length && seekable$$1.start(0) > 0 && seekable$$1.start(0) < currentTime) {\n // If we have a seekable range use that as the limit for what can be removed safely\n removeToTime = seekable$$1.start(0);\n } else {\n // otherwise remove anything older than 30 seconds before the current play head\n removeToTime = currentTime - 30;\n } // Don't allow removing from the buffer within target duration of current time\n // to avoid the possibility of removing the GOP currently being played which could\n // cause playback stalls.\n\n\n return Math.min(removeToTime, currentTime - targetDuration);\n};\n\nvar segmentInfoString = function segmentInfoString(segmentInfo) {\n var _segmentInfo$segment = segmentInfo.segment,\n start = _segmentInfo$segment.start,\n end = _segmentInfo$segment.end,\n _segmentInfo$playlist = segmentInfo.playlist,\n seq = _segmentInfo$playlist.mediaSequence,\n id = _segmentInfo$playlist.id,\n _segmentInfo$playlist2 = _segmentInfo$playlist.segments,\n segments = _segmentInfo$playlist2 === undefined ? [] : _segmentInfo$playlist2,\n index = segmentInfo.mediaIndex,\n timeline = segmentInfo.timeline;\n return ['appending [' + index + '] of [' + seq + ', ' + (seq + segments.length) + '] from playlist [' + id + ']', '[' + start + ' => ' + end + '] in timeline [' + timeline + ']'].join(' ');\n};\n/**\n * An object that manages segment loading and appending.\n *\n * @class SegmentLoader\n * @param {Object} options required and optional options\n * @extends videojs.EventTarget\n */\n\n\nvar SegmentLoader = function (_videojs$EventTarget) {\n inherits(SegmentLoader, _videojs$EventTarget);\n\n function SegmentLoader(settings) {\n classCallCheck(this, SegmentLoader); // check pre-conditions\n\n var _this = possibleConstructorReturn(this, (SegmentLoader.__proto__ || Object.getPrototypeOf(SegmentLoader)).call(this));\n\n if (!settings) {\n throw new TypeError('Initialization settings are required');\n }\n\n if (typeof settings.currentTime !== 'function') {\n throw new TypeError('No currentTime getter specified');\n }\n\n if (!settings.mediaSource) {\n throw new TypeError('No MediaSource specified');\n } // public properties\n\n\n _this.bandwidth = settings.bandwidth;\n _this.throughput = {\n rate: 0,\n count: 0\n };\n _this.roundTrip = NaN;\n\n _this.resetStats_();\n\n _this.mediaIndex = null; // private settings\n\n _this.hasPlayed_ = settings.hasPlayed;\n _this.currentTime_ = settings.currentTime;\n _this.seekable_ = settings.seekable;\n _this.seeking_ = settings.seeking;\n _this.duration_ = settings.duration;\n _this.mediaSource_ = settings.mediaSource;\n _this.hls_ = settings.hls;\n _this.loaderType_ = settings.loaderType;\n _this.startingMedia_ = void 0;\n _this.segmentMetadataTrack_ = settings.segmentMetadataTrack;\n _this.goalBufferLength_ = settings.goalBufferLength;\n _this.sourceType_ = settings.sourceType;\n _this.inbandTextTracks_ = settings.inbandTextTracks;\n _this.state_ = 'INIT'; // private instance variables\n\n _this.checkBufferTimeout_ = null;\n _this.error_ = void 0;\n _this.currentTimeline_ = -1;\n _this.pendingSegment_ = null;\n _this.mimeType_ = null;\n _this.sourceUpdater_ = null;\n _this.xhrOptions_ = null; // Fragmented mp4 playback\n\n _this.activeInitSegmentId_ = null;\n _this.initSegments_ = {}; // Fmp4 CaptionParser\n\n _this.captionParser_ = new CaptionParser();\n _this.decrypter_ = settings.decrypter; // Manages the tracking and generation of sync-points, mappings\n // between a time in the display time and a segment index within\n // a playlist\n\n _this.syncController_ = settings.syncController;\n _this.syncPoint_ = {\n segmentIndex: 0,\n time: 0\n };\n\n _this.syncController_.on('syncinfoupdate', function () {\n return _this.trigger('syncinfoupdate');\n });\n\n _this.mediaSource_.addEventListener('sourceopen', function () {\n return _this.ended_ = false;\n }); // ...for determining the fetch location\n\n\n _this.fetchAtBuffer_ = false;\n _this.logger_ = logger('SegmentLoader[' + _this.loaderType_ + ']');\n Object.defineProperty(_this, 'state', {\n get: function get$$1() {\n return this.state_;\n },\n set: function set$$1(newState) {\n if (newState !== this.state_) {\n this.logger_(this.state_ + ' -> ' + newState);\n this.state_ = newState;\n }\n }\n });\n return _this;\n }\n /**\n * reset all of our media stats\n *\n * @private\n */\n\n\n createClass(SegmentLoader, [{\n key: 'resetStats_',\n value: function resetStats_() {\n this.mediaBytesTransferred = 0;\n this.mediaRequests = 0;\n this.mediaRequestsAborted = 0;\n this.mediaRequestsTimedout = 0;\n this.mediaRequestsErrored = 0;\n this.mediaTransferDuration = 0;\n this.mediaSecondsLoaded = 0;\n }\n /**\n * dispose of the SegmentLoader and reset to the default state\n */\n\n }, {\n key: 'dispose',\n value: function dispose() {\n this.state = 'DISPOSED';\n this.pause();\n this.abort_();\n\n if (this.sourceUpdater_) {\n this.sourceUpdater_.dispose();\n }\n\n this.resetStats_();\n this.captionParser_.reset();\n }\n /**\n * abort anything that is currently doing on with the SegmentLoader\n * and reset to a default state\n */\n\n }, {\n key: 'abort',\n value: function abort() {\n if (this.state !== 'WAITING') {\n if (this.pendingSegment_) {\n this.pendingSegment_ = null;\n }\n\n return;\n }\n\n this.abort_(); // We aborted the requests we were waiting on, so reset the loader's state to READY\n // since we are no longer \"waiting\" on any requests. XHR callback is not always run\n // when the request is aborted. This will prevent the loader from being stuck in the\n // WAITING state indefinitely.\n\n this.state = 'READY'; // don't wait for buffer check timeouts to begin fetching the\n // next segment\n\n if (!this.paused()) {\n this.monitorBuffer_();\n }\n }\n /**\n * abort all pending xhr requests and null any pending segements\n *\n * @private\n */\n\n }, {\n key: 'abort_',\n value: function abort_() {\n if (this.pendingSegment_) {\n this.pendingSegment_.abortRequests();\n } // clear out the segment being processed\n\n\n this.pendingSegment_ = null;\n }\n /**\n * set an error on the segment loader and null out any pending segements\n *\n * @param {Error} error the error to set on the SegmentLoader\n * @return {Error} the error that was set or that is currently set\n */\n\n }, {\n key: 'error',\n value: function error(_error) {\n if (typeof _error !== 'undefined') {\n this.error_ = _error;\n }\n\n this.pendingSegment_ = null;\n return this.error_;\n }\n }, {\n key: 'endOfStream',\n value: function endOfStream() {\n this.ended_ = true;\n this.pause();\n this.trigger('ended');\n }\n /**\n * Indicates which time ranges are buffered\n *\n * @return {TimeRange}\n * TimeRange object representing the current buffered ranges\n */\n\n }, {\n key: 'buffered_',\n value: function buffered_() {\n if (!this.sourceUpdater_) {\n return videojs$1.createTimeRanges();\n }\n\n return this.sourceUpdater_.buffered();\n }\n /**\n * Gets and sets init segment for the provided map\n *\n * @param {Object} map\n * The map object representing the init segment to get or set\n * @param {Boolean=} set\n * If true, the init segment for the provided map should be saved\n * @return {Object}\n * map object for desired init segment\n */\n\n }, {\n key: 'initSegment',\n value: function initSegment(map) {\n var set$$1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (!map) {\n return null;\n }\n\n var id = initSegmentId(map);\n var storedMap = this.initSegments_[id];\n\n if (set$$1 && !storedMap && map.bytes) {\n this.initSegments_[id] = storedMap = {\n resolvedUri: map.resolvedUri,\n byterange: map.byterange,\n bytes: map.bytes,\n timescales: map.timescales,\n videoTrackIds: map.videoTrackIds\n };\n }\n\n return storedMap || map;\n }\n /**\n * Returns true if all configuration required for loading is present, otherwise false.\n *\n * @return {Boolean} True if the all configuration is ready for loading\n * @private\n */\n\n }, {\n key: 'couldBeginLoading_',\n value: function couldBeginLoading_() {\n return this.playlist_ && ( // the source updater is created when init_ is called, so either having a\n // source updater or being in the INIT state with a mimeType is enough\n // to say we have all the needed configuration to start loading.\n this.sourceUpdater_ || this.mimeType_ && this.state === 'INIT') && !this.paused();\n }\n /**\n * load a playlist and start to fill the buffer\n */\n\n }, {\n key: 'load',\n value: function load() {\n // un-pause\n this.monitorBuffer_(); // if we don't have a playlist yet, keep waiting for one to be\n // specified\n\n if (!this.playlist_) {\n return;\n } // not sure if this is the best place for this\n\n\n this.syncController_.setDateTimeMapping(this.playlist_); // if all the configuration is ready, initialize and begin loading\n\n if (this.state === 'INIT' && this.couldBeginLoading_()) {\n return this.init_();\n } // if we're in the middle of processing a segment already, don't\n // kick off an additional segment request\n\n\n if (!this.couldBeginLoading_() || this.state !== 'READY' && this.state !== 'INIT') {\n return;\n }\n\n this.state = 'READY';\n }\n /**\n * Once all the starting parameters have been specified, begin\n * operation. This method should only be invoked from the INIT\n * state.\n *\n * @private\n */\n\n }, {\n key: 'init_',\n value: function init_() {\n this.state = 'READY';\n this.sourceUpdater_ = new SourceUpdater(this.mediaSource_, this.mimeType_, this.loaderType_, this.sourceBufferEmitter_);\n this.resetEverything();\n return this.monitorBuffer_();\n }\n /**\n * set a playlist on the segment loader\n *\n * @param {PlaylistLoader} media the playlist to set on the segment loader\n */\n\n }, {\n key: 'playlist',\n value: function playlist(newPlaylist) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (!newPlaylist) {\n return;\n }\n\n var oldPlaylist = this.playlist_;\n var segmentInfo = this.pendingSegment_;\n this.playlist_ = newPlaylist;\n this.xhrOptions_ = options; // when we haven't started playing yet, the start of a live playlist\n // is always our zero-time so force a sync update each time the playlist\n // is refreshed from the server\n\n if (!this.hasPlayed_()) {\n newPlaylist.syncInfo = {\n mediaSequence: newPlaylist.mediaSequence,\n time: 0\n };\n }\n\n var oldId = oldPlaylist ? oldPlaylist.id : null;\n this.logger_('playlist update [' + oldId + ' => ' + newPlaylist.id + ']'); // in VOD, this is always a rendition switch (or we updated our syncInfo above)\n // in LIVE, we always want to update with new playlists (including refreshes)\n\n this.trigger('syncinfoupdate'); // if we were unpaused but waiting for a playlist, start\n // buffering now\n\n if (this.state === 'INIT' && this.couldBeginLoading_()) {\n return this.init_();\n }\n\n if (!oldPlaylist || oldPlaylist.uri !== newPlaylist.uri) {\n if (this.mediaIndex !== null) {\n // we must \"resync\" the segment loader when we switch renditions and\n // the segment loader is already synced to the previous rendition\n this.resyncLoader();\n } // the rest of this function depends on `oldPlaylist` being defined\n\n\n return;\n } // we reloaded the same playlist so we are in a live scenario\n // and we will likely need to adjust the mediaIndex\n\n\n var mediaSequenceDiff = newPlaylist.mediaSequence - oldPlaylist.mediaSequence;\n this.logger_('live window shift [' + mediaSequenceDiff + ']'); // update the mediaIndex on the SegmentLoader\n // this is important because we can abort a request and this value must be\n // equal to the last appended mediaIndex\n\n if (this.mediaIndex !== null) {\n this.mediaIndex -= mediaSequenceDiff;\n } // update the mediaIndex on the SegmentInfo object\n // this is important because we will update this.mediaIndex with this value\n // in `handleUpdateEnd_` after the segment has been successfully appended\n\n\n if (segmentInfo) {\n segmentInfo.mediaIndex -= mediaSequenceDiff; // we need to update the referenced segment so that timing information is\n // saved for the new playlist's segment, however, if the segment fell off the\n // playlist, we can leave the old reference and just lose the timing info\n\n if (segmentInfo.mediaIndex >= 0) {\n segmentInfo.segment = newPlaylist.segments[segmentInfo.mediaIndex];\n }\n }\n\n this.syncController_.saveExpiredSegmentInfo(oldPlaylist, newPlaylist);\n }\n /**\n * Prevent the loader from fetching additional segments. If there\n * is a segment request outstanding, it will finish processing\n * before the loader halts. A segment loader can be unpaused by\n * calling load().\n */\n\n }, {\n key: 'pause',\n value: function pause() {\n if (this.checkBufferTimeout_) {\n window$1.clearTimeout(this.checkBufferTimeout_);\n this.checkBufferTimeout_ = null;\n }\n }\n /**\n * Returns whether the segment loader is fetching additional\n * segments when given the opportunity. This property can be\n * modified through calls to pause() and load().\n */\n\n }, {\n key: 'paused',\n value: function paused() {\n return this.checkBufferTimeout_ === null;\n }\n /**\n * create/set the following mimetype on the SourceBuffer through a\n * SourceUpdater\n *\n * @param {String} mimeType the mime type string to use\n * @param {Object} sourceBufferEmitter an event emitter that fires when a source buffer\n * is added to the media source\n */\n\n }, {\n key: 'mimeType',\n value: function mimeType(_mimeType, sourceBufferEmitter) {\n if (this.mimeType_) {\n return;\n }\n\n this.mimeType_ = _mimeType;\n this.sourceBufferEmitter_ = sourceBufferEmitter; // if we were unpaused but waiting for a sourceUpdater, start\n // buffering now\n\n if (this.state === 'INIT' && this.couldBeginLoading_()) {\n this.init_();\n }\n }\n /**\n * Delete all the buffered data and reset the SegmentLoader\n * @param {Function} [done] an optional callback to be executed when the remove\n * operation is complete\n */\n\n }, {\n key: 'resetEverything',\n value: function resetEverything(done) {\n this.ended_ = false;\n this.resetLoader();\n this.remove(0, this.duration_(), done); // clears fmp4 captions\n\n this.captionParser_.clearAllCaptions();\n this.trigger('reseteverything');\n }\n /**\n * Force the SegmentLoader to resync and start loading around the currentTime instead\n * of starting at the end of the buffer\n *\n * Useful for fast quality changes\n */\n\n }, {\n key: 'resetLoader',\n value: function resetLoader() {\n this.fetchAtBuffer_ = false;\n this.resyncLoader();\n }\n /**\n * Force the SegmentLoader to restart synchronization and make a conservative guess\n * before returning to the simple walk-forward method\n */\n\n }, {\n key: 'resyncLoader',\n value: function resyncLoader() {\n this.mediaIndex = null;\n this.syncPoint_ = null;\n this.abort();\n }\n /**\n * Remove any data in the source buffer between start and end times\n * @param {Number} start - the start time of the region to remove from the buffer\n * @param {Number} end - the end time of the region to remove from the buffer\n * @param {Function} [done] - an optional callback to be executed when the remove\n * operation is complete\n */\n\n }, {\n key: 'remove',\n value: function remove(start, end, done) {\n if (this.sourceUpdater_) {\n this.sourceUpdater_.remove(start, end, done);\n }\n\n removeCuesFromTrack(start, end, this.segmentMetadataTrack_);\n\n if (this.inbandTextTracks_) {\n for (var id in this.inbandTextTracks_) {\n removeCuesFromTrack(start, end, this.inbandTextTracks_[id]);\n }\n }\n }\n /**\n * (re-)schedule monitorBufferTick_ to run as soon as possible\n *\n * @private\n */\n\n }, {\n key: 'monitorBuffer_',\n value: function monitorBuffer_() {\n if (this.checkBufferTimeout_) {\n window$1.clearTimeout(this.checkBufferTimeout_);\n }\n\n this.checkBufferTimeout_ = window$1.setTimeout(this.monitorBufferTick_.bind(this), 1);\n }\n /**\n * As long as the SegmentLoader is in the READY state, periodically\n * invoke fillBuffer_().\n *\n * @private\n */\n\n }, {\n key: 'monitorBufferTick_',\n value: function monitorBufferTick_() {\n if (this.state === 'READY') {\n this.fillBuffer_();\n }\n\n if (this.checkBufferTimeout_) {\n window$1.clearTimeout(this.checkBufferTimeout_);\n }\n\n this.checkBufferTimeout_ = window$1.setTimeout(this.monitorBufferTick_.bind(this), CHECK_BUFFER_DELAY);\n }\n /**\n * fill the buffer with segements unless the sourceBuffers are\n * currently updating\n *\n * Note: this function should only ever be called by monitorBuffer_\n * and never directly\n *\n * @private\n */\n\n }, {\n key: 'fillBuffer_',\n value: function fillBuffer_() {\n if (this.sourceUpdater_.updating()) {\n return;\n }\n\n if (!this.syncPoint_) {\n this.syncPoint_ = this.syncController_.getSyncPoint(this.playlist_, this.duration_(), this.currentTimeline_, this.currentTime_());\n } // see if we need to begin loading immediately\n\n\n var segmentInfo = this.checkBuffer_(this.buffered_(), this.playlist_, this.mediaIndex, this.hasPlayed_(), this.currentTime_(), this.syncPoint_);\n\n if (!segmentInfo) {\n return;\n }\n\n var isEndOfStream = detectEndOfStream(this.playlist_, this.mediaSource_, segmentInfo.mediaIndex);\n\n if (isEndOfStream) {\n this.endOfStream();\n return;\n }\n\n if (segmentInfo.mediaIndex === this.playlist_.segments.length - 1 && this.mediaSource_.readyState === 'ended' && !this.seeking_()) {\n return;\n } // We will need to change timestampOffset of the sourceBuffer if either of\n // the following conditions are true:\n // - The segment.timeline !== this.currentTimeline\n // (we are crossing a discontinuity somehow)\n // - The \"timestampOffset\" for the start of this segment is less than\n // the currently set timestampOffset\n // Also, clear captions if we are crossing a discontinuity boundary\n\n\n if (segmentInfo.timeline !== this.currentTimeline_ || segmentInfo.startOfSegment !== null && segmentInfo.startOfSegment < this.sourceUpdater_.timestampOffset()) {\n this.syncController_.reset();\n segmentInfo.timestampOffset = segmentInfo.startOfSegment;\n this.captionParser_.clearAllCaptions();\n }\n\n this.loadSegment_(segmentInfo);\n }\n /**\n * Determines what segment request should be made, given current playback\n * state.\n *\n * @param {TimeRanges} buffered - the state of the buffer\n * @param {Object} playlist - the playlist object to fetch segments from\n * @param {Number} mediaIndex - the previous mediaIndex fetched or null\n * @param {Boolean} hasPlayed - a flag indicating whether we have played or not\n * @param {Number} currentTime - the playback position in seconds\n * @param {Object} syncPoint - a segment info object that describes the\n * @returns {Object} a segment request object that describes the segment to load\n */\n\n }, {\n key: 'checkBuffer_',\n value: function checkBuffer_(buffered, playlist, mediaIndex, hasPlayed, currentTime, syncPoint) {\n var lastBufferedEnd = 0;\n var startOfSegment = void 0;\n\n if (buffered.length) {\n lastBufferedEnd = buffered.end(buffered.length - 1);\n }\n\n var bufferedTime = Math.max(0, lastBufferedEnd - currentTime);\n\n if (!playlist.segments.length) {\n return null;\n } // if there is plenty of content buffered, and the video has\n // been played before relax for awhile\n\n\n if (bufferedTime >= this.goalBufferLength_()) {\n return null;\n } // if the video has not yet played once, and we already have\n // one segment downloaded do nothing\n\n\n if (!hasPlayed && bufferedTime >= 1) {\n return null;\n } // When the syncPoint is null, there is no way of determining a good\n // conservative segment index to fetch from\n // The best thing to do here is to get the kind of sync-point data by\n // making a request\n\n\n if (syncPoint === null) {\n mediaIndex = this.getSyncSegmentCandidate_(playlist);\n return this.generateSegmentInfo_(playlist, mediaIndex, null, true);\n } // Under normal playback conditions fetching is a simple walk forward\n\n\n if (mediaIndex !== null) {\n var segment = playlist.segments[mediaIndex];\n\n if (segment && segment.end) {\n startOfSegment = segment.end;\n } else {\n startOfSegment = lastBufferedEnd;\n }\n\n return this.generateSegmentInfo_(playlist, mediaIndex + 1, startOfSegment, false);\n } // There is a sync-point but the lack of a mediaIndex indicates that\n // we need to make a good conservative guess about which segment to\n // fetch\n\n\n if (this.fetchAtBuffer_) {\n // Find the segment containing the end of the buffer\n var mediaSourceInfo = Playlist.getMediaInfoForTime(playlist, lastBufferedEnd, syncPoint.segmentIndex, syncPoint.time);\n mediaIndex = mediaSourceInfo.mediaIndex;\n startOfSegment = mediaSourceInfo.startTime;\n } else {\n // Find the segment containing currentTime\n var _mediaSourceInfo = Playlist.getMediaInfoForTime(playlist, currentTime, syncPoint.segmentIndex, syncPoint.time);\n\n mediaIndex = _mediaSourceInfo.mediaIndex;\n startOfSegment = _mediaSourceInfo.startTime;\n }\n\n return this.generateSegmentInfo_(playlist, mediaIndex, startOfSegment, false);\n }\n /**\n * The segment loader has no recourse except to fetch a segment in the\n * current playlist and use the internal timestamps in that segment to\n * generate a syncPoint. This function returns a good candidate index\n * for that process.\n *\n * @param {Object} playlist - the playlist object to look for a\n * @returns {Number} An index of a segment from the playlist to load\n */\n\n }, {\n key: 'getSyncSegmentCandidate_',\n value: function getSyncSegmentCandidate_(playlist) {\n var _this2 = this;\n\n if (this.currentTimeline_ === -1) {\n return 0;\n }\n\n var segmentIndexArray = playlist.segments.map(function (s, i) {\n return {\n timeline: s.timeline,\n segmentIndex: i\n };\n }).filter(function (s) {\n return s.timeline === _this2.currentTimeline_;\n });\n\n if (segmentIndexArray.length) {\n return segmentIndexArray[Math.min(segmentIndexArray.length - 1, 1)].segmentIndex;\n }\n\n return Math.max(playlist.segments.length - 1, 0);\n }\n }, {\n key: 'generateSegmentInfo_',\n value: function generateSegmentInfo_(playlist, mediaIndex, startOfSegment, isSyncRequest) {\n if (mediaIndex < 0 || mediaIndex >= playlist.segments.length) {\n return null;\n }\n\n var segment = playlist.segments[mediaIndex];\n return {\n requestId: 'segment-loader-' + Math.random(),\n // resolve the segment URL relative to the playlist\n uri: segment.resolvedUri,\n // the segment's mediaIndex at the time it was requested\n mediaIndex: mediaIndex,\n // whether or not to update the SegmentLoader's state with this\n // segment's mediaIndex\n isSyncRequest: isSyncRequest,\n startOfSegment: startOfSegment,\n // the segment's playlist\n playlist: playlist,\n // unencrypted bytes of the segment\n bytes: null,\n // when a key is defined for this segment, the encrypted bytes\n encryptedBytes: null,\n // The target timestampOffset for this segment when we append it\n // to the source buffer\n timestampOffset: null,\n // The timeline that the segment is in\n timeline: segment.timeline,\n // The expected duration of the segment in seconds\n duration: segment.duration,\n // retain the segment in case the playlist updates while doing an async process\n segment: segment\n };\n }\n /**\n * Determines if the network has enough bandwidth to complete the current segment\n * request in a timely manner. If not, the request will be aborted early and bandwidth\n * updated to trigger a playlist switch.\n *\n * @param {Object} stats\n * Object containing stats about the request timing and size\n * @return {Boolean} True if the request was aborted, false otherwise\n * @private\n */\n\n }, {\n key: 'abortRequestEarly_',\n value: function abortRequestEarly_(stats) {\n if (this.hls_.tech_.paused() || // Don't abort if the current playlist is on the lowestEnabledRendition\n // TODO: Replace using timeout with a boolean indicating whether this playlist is\n // the lowestEnabledRendition.\n !this.xhrOptions_.timeout || // Don't abort if we have no bandwidth information to estimate segment sizes\n !this.playlist_.attributes.BANDWIDTH) {\n return false;\n } // Wait at least 1 second since the first byte of data has been received before\n // using the calculated bandwidth from the progress event to allow the bitrate\n // to stabilize\n\n\n if (Date.now() - (stats.firstBytesReceivedAt || Date.now()) < 1000) {\n return false;\n }\n\n var currentTime = this.currentTime_();\n var measuredBandwidth = stats.bandwidth;\n var segmentDuration = this.pendingSegment_.duration;\n var requestTimeRemaining = Playlist.estimateSegmentRequestTime(segmentDuration, measuredBandwidth, this.playlist_, stats.bytesReceived); // Subtract 1 from the timeUntilRebuffer so we still consider an early abort\n // if we are only left with less than 1 second when the request completes.\n // A negative timeUntilRebuffering indicates we are already rebuffering\n\n var timeUntilRebuffer$$1 = timeUntilRebuffer(this.buffered_(), currentTime, this.hls_.tech_.playbackRate()) - 1; // Only consider aborting early if the estimated time to finish the download\n // is larger than the estimated time until the player runs out of forward buffer\n\n if (requestTimeRemaining <= timeUntilRebuffer$$1) {\n return false;\n }\n\n var switchCandidate = minRebufferMaxBandwidthSelector({\n master: this.hls_.playlists.master,\n currentTime: currentTime,\n bandwidth: measuredBandwidth,\n duration: this.duration_(),\n segmentDuration: segmentDuration,\n timeUntilRebuffer: timeUntilRebuffer$$1,\n currentTimeline: this.currentTimeline_,\n syncController: this.syncController_\n });\n\n if (!switchCandidate) {\n return;\n }\n\n var rebufferingImpact = requestTimeRemaining - timeUntilRebuffer$$1;\n var timeSavedBySwitching = rebufferingImpact - switchCandidate.rebufferingImpact;\n var minimumTimeSaving = 0.5; // If we are already rebuffering, increase the amount of variance we add to the\n // potential round trip time of the new request so that we are not too aggressive\n // with switching to a playlist that might save us a fraction of a second.\n\n if (timeUntilRebuffer$$1 <= TIME_FUDGE_FACTOR) {\n minimumTimeSaving = 1;\n }\n\n if (!switchCandidate.playlist || switchCandidate.playlist.uri === this.playlist_.uri || timeSavedBySwitching < minimumTimeSaving) {\n return false;\n } // set the bandwidth to that of the desired playlist being sure to scale by\n // BANDWIDTH_VARIANCE and add one so the playlist selector does not exclude it\n // don't trigger a bandwidthupdate as the bandwidth is artifial\n\n\n this.bandwidth = switchCandidate.playlist.attributes.BANDWIDTH * Config.BANDWIDTH_VARIANCE + 1;\n this.abort();\n this.trigger('earlyabort');\n return true;\n }\n /**\n * XHR `progress` event handler\n *\n * @param {Event}\n * The XHR `progress` event\n * @param {Object} simpleSegment\n * A simplified segment object copy\n * @private\n */\n\n }, {\n key: 'handleProgress_',\n value: function handleProgress_(event, simpleSegment) {\n if (!this.pendingSegment_ || simpleSegment.requestId !== this.pendingSegment_.requestId || this.abortRequestEarly_(simpleSegment.stats)) {\n return;\n }\n\n this.trigger('progress');\n }\n /**\n * load a specific segment from a request into the buffer\n *\n * @private\n */\n\n }, {\n key: 'loadSegment_',\n value: function loadSegment_(segmentInfo) {\n this.state = 'WAITING';\n this.pendingSegment_ = segmentInfo;\n this.trimBackBuffer_(segmentInfo);\n segmentInfo.abortRequests = mediaSegmentRequest(this.hls_.xhr, this.xhrOptions_, this.decrypter_, this.captionParser_, this.createSimplifiedSegmentObj_(segmentInfo), // progress callback\n this.handleProgress_.bind(this), this.segmentRequestFinished_.bind(this));\n }\n /**\n * trim the back buffer so that we don't have too much data\n * in the source buffer\n *\n * @private\n *\n * @param {Object} segmentInfo - the current segment\n */\n\n }, {\n key: 'trimBackBuffer_',\n value: function trimBackBuffer_(segmentInfo) {\n var removeToTime = safeBackBufferTrimTime(this.seekable_(), this.currentTime_(), this.playlist_.targetDuration || 10); // Chrome has a hard limit of 150MB of\n // buffer and a very conservative \"garbage collector\"\n // We manually clear out the old buffer to ensure\n // we don't trigger the QuotaExceeded error\n // on the source buffer during subsequent appends\n\n if (removeToTime > 0) {\n this.remove(0, removeToTime);\n }\n }\n /**\n * created a simplified copy of the segment object with just the\n * information necessary to perform the XHR and decryption\n *\n * @private\n *\n * @param {Object} segmentInfo - the current segment\n * @returns {Object} a simplified segment object copy\n */\n\n }, {\n key: 'createSimplifiedSegmentObj_',\n value: function createSimplifiedSegmentObj_(segmentInfo) {\n var segment = segmentInfo.segment;\n var simpleSegment = {\n resolvedUri: segment.resolvedUri,\n byterange: segment.byterange,\n requestId: segmentInfo.requestId\n };\n\n if (segment.key) {\n // if the media sequence is greater than 2^32, the IV will be incorrect\n // assuming 10s segments, that would be about 1300 years\n var iv = segment.key.iv || new Uint32Array([0, 0, 0, segmentInfo.mediaIndex + segmentInfo.playlist.mediaSequence]);\n simpleSegment.key = {\n resolvedUri: segment.key.resolvedUri,\n iv: iv\n };\n }\n\n if (segment.map) {\n simpleSegment.map = this.initSegment(segment.map);\n }\n\n return simpleSegment;\n }\n /**\n * Handle the callback from the segmentRequest function and set the\n * associated SegmentLoader state and errors if necessary\n *\n * @private\n */\n\n }, {\n key: 'segmentRequestFinished_',\n value: function segmentRequestFinished_(error, simpleSegment) {\n // every request counts as a media request even if it has been aborted\n // or canceled due to a timeout\n this.mediaRequests += 1;\n\n if (simpleSegment.stats) {\n this.mediaBytesTransferred += simpleSegment.stats.bytesReceived;\n this.mediaTransferDuration += simpleSegment.stats.roundTripTime;\n } // The request was aborted and the SegmentLoader has already been reset\n\n\n if (!this.pendingSegment_) {\n this.mediaRequestsAborted += 1;\n return;\n } // the request was aborted and the SegmentLoader has already started\n // another request. this can happen when the timeout for an aborted\n // request triggers due to a limitation in the XHR library\n // do not count this as any sort of request or we risk double-counting\n\n\n if (simpleSegment.requestId !== this.pendingSegment_.requestId) {\n return;\n } // an error occurred from the active pendingSegment_ so reset everything\n\n\n if (error) {\n this.pendingSegment_ = null;\n this.state = 'READY'; // the requests were aborted just record the aborted stat and exit\n // this is not a true error condition and nothing corrective needs\n // to be done\n\n if (error.code === REQUEST_ERRORS.ABORTED) {\n this.mediaRequestsAborted += 1;\n return;\n }\n\n this.pause(); // the error is really just that at least one of the requests timed-out\n // set the bandwidth to a very low value and trigger an ABR switch to\n // take emergency action\n\n if (error.code === REQUEST_ERRORS.TIMEOUT) {\n this.mediaRequestsTimedout += 1;\n this.bandwidth = 1;\n this.roundTrip = NaN;\n this.trigger('bandwidthupdate');\n return;\n } // if control-flow has arrived here, then the error is real\n // emit an error event to blacklist the current playlist\n\n\n this.mediaRequestsErrored += 1;\n this.error(error);\n this.trigger('error');\n return;\n } // the response was a success so set any bandwidth stats the request\n // generated for ABR purposes\n\n\n this.bandwidth = simpleSegment.stats.bandwidth;\n this.roundTrip = simpleSegment.stats.roundTripTime; // if this request included an initialization segment, save that data\n // to the initSegment cache\n\n if (simpleSegment.map) {\n simpleSegment.map = this.initSegment(simpleSegment.map, true);\n }\n\n this.processSegmentResponse_(simpleSegment);\n }\n /**\n * Move any important data from the simplified segment object\n * back to the real segment object for future phases\n *\n * @private\n */\n\n }, {\n key: 'processSegmentResponse_',\n value: function processSegmentResponse_(simpleSegment) {\n var segmentInfo = this.pendingSegment_;\n segmentInfo.bytes = simpleSegment.bytes;\n\n if (simpleSegment.map) {\n segmentInfo.segment.map.bytes = simpleSegment.map.bytes;\n }\n\n segmentInfo.endOfAllRequests = simpleSegment.endOfAllRequests; // This has fmp4 captions, add them to text tracks\n\n if (simpleSegment.fmp4Captions) {\n createCaptionsTrackIfNotExists(this.inbandTextTracks_, this.hls_.tech_, simpleSegment.captionStreams);\n addCaptionData({\n inbandTextTracks: this.inbandTextTracks_,\n captionArray: simpleSegment.fmp4Captions,\n // fmp4s will not have a timestamp offset\n timestampOffset: 0\n }); // Reset stored captions since we added parsed\n // captions to a text track at this point\n\n this.captionParser_.clearParsedCaptions();\n }\n\n this.handleSegment_();\n }\n /**\n * append a decrypted segement to the SourceBuffer through a SourceUpdater\n *\n * @private\n */\n\n }, {\n key: 'handleSegment_',\n value: function handleSegment_() {\n var _this3 = this;\n\n if (!this.pendingSegment_) {\n this.state = 'READY';\n return;\n }\n\n var segmentInfo = this.pendingSegment_;\n var segment = segmentInfo.segment;\n var timingInfo = this.syncController_.probeSegmentInfo(segmentInfo); // When we have our first timing info, determine what media types this loader is\n // dealing with. Although we're maintaining extra state, it helps to preserve the\n // separation of segment loader from the actual source buffers.\n\n if (typeof this.startingMedia_ === 'undefined' && timingInfo && ( // Guard against cases where we're not getting timing info at all until we are\n // certain that all streams will provide it.\n timingInfo.containsAudio || timingInfo.containsVideo)) {\n this.startingMedia_ = {\n containsAudio: timingInfo.containsAudio,\n containsVideo: timingInfo.containsVideo\n };\n }\n\n var illegalMediaSwitchError = illegalMediaSwitch(this.loaderType_, this.startingMedia_, timingInfo);\n\n if (illegalMediaSwitchError) {\n this.error({\n message: illegalMediaSwitchError,\n blacklistDuration: Infinity\n });\n this.trigger('error');\n return;\n }\n\n if (segmentInfo.isSyncRequest) {\n this.trigger('syncinfoupdate');\n this.pendingSegment_ = null;\n this.state = 'READY';\n return;\n }\n\n if (segmentInfo.timestampOffset !== null && segmentInfo.timestampOffset !== this.sourceUpdater_.timestampOffset()) {\n this.sourceUpdater_.timestampOffset(segmentInfo.timestampOffset); // fired when a timestamp offset is set in HLS (can also identify discontinuities)\n\n this.trigger('timestampoffset');\n }\n\n var timelineMapping = this.syncController_.mappingForTimeline(segmentInfo.timeline);\n\n if (timelineMapping !== null) {\n this.trigger({\n type: 'segmenttimemapping',\n mapping: timelineMapping\n });\n }\n\n this.state = 'APPENDING'; // if the media initialization segment is changing, append it\n // before the content segment\n\n if (segment.map) {\n var initId = initSegmentId(segment.map);\n\n if (!this.activeInitSegmentId_ || this.activeInitSegmentId_ !== initId) {\n var initSegment = this.initSegment(segment.map);\n this.sourceUpdater_.appendBuffer(initSegment.bytes, function () {\n _this3.activeInitSegmentId_ = initId;\n });\n }\n }\n\n segmentInfo.byteLength = segmentInfo.bytes.byteLength;\n\n if (typeof segment.start === 'number' && typeof segment.end === 'number') {\n this.mediaSecondsLoaded += segment.end - segment.start;\n } else {\n this.mediaSecondsLoaded += segment.duration;\n }\n\n this.logger_(segmentInfoString(segmentInfo));\n this.sourceUpdater_.appendBuffer(segmentInfo.bytes, this.handleUpdateEnd_.bind(this));\n }\n /**\n * callback to run when appendBuffer is finished. detects if we are\n * in a good state to do things with the data we got, or if we need\n * to wait for more\n *\n * @private\n */\n\n }, {\n key: 'handleUpdateEnd_',\n value: function handleUpdateEnd_() {\n if (!this.pendingSegment_) {\n this.state = 'READY';\n\n if (!this.paused()) {\n this.monitorBuffer_();\n }\n\n return;\n }\n\n var segmentInfo = this.pendingSegment_;\n var segment = segmentInfo.segment;\n var isWalkingForward = this.mediaIndex !== null;\n this.pendingSegment_ = null;\n this.recordThroughput_(segmentInfo);\n this.addSegmentMetadataCue_(segmentInfo);\n this.state = 'READY';\n this.mediaIndex = segmentInfo.mediaIndex;\n this.fetchAtBuffer_ = true;\n this.currentTimeline_ = segmentInfo.timeline; // We must update the syncinfo to recalculate the seekable range before\n // the following conditional otherwise it may consider this a bad \"guess\"\n // and attempt to resync when the post-update seekable window and live\n // point would mean that this was the perfect segment to fetch\n\n this.trigger('syncinfoupdate'); // If we previously appended a segment that ends more than 3 targetDurations before\n // the currentTime_ that means that our conservative guess was too conservative.\n // In that case, reset the loader state so that we try to use any information gained\n // from the previous request to create a new, more accurate, sync-point.\n\n if (segment.end && this.currentTime_() - segment.end > segmentInfo.playlist.targetDuration * 3) {\n this.resetEverything();\n return;\n } // Don't do a rendition switch unless we have enough time to get a sync segment\n // and conservatively guess\n\n\n if (isWalkingForward) {\n this.trigger('bandwidthupdate');\n }\n\n this.trigger('progress'); // any time an update finishes and the last segment is in the\n // buffer, end the stream. this ensures the \"ended\" event will\n // fire if playback reaches that point.\n\n var isEndOfStream = detectEndOfStream(segmentInfo.playlist, this.mediaSource_, segmentInfo.mediaIndex + 1);\n\n if (isEndOfStream) {\n this.endOfStream();\n }\n\n if (!this.paused()) {\n this.monitorBuffer_();\n }\n }\n /**\n * Records the current throughput of the decrypt, transmux, and append\n * portion of the semgment pipeline. `throughput.rate` is a the cumulative\n * moving average of the throughput. `throughput.count` is the number of\n * data points in the average.\n *\n * @private\n * @param {Object} segmentInfo the object returned by loadSegment\n */\n\n }, {\n key: 'recordThroughput_',\n value: function recordThroughput_(segmentInfo) {\n var rate = this.throughput.rate; // Add one to the time to ensure that we don't accidentally attempt to divide\n // by zero in the case where the throughput is ridiculously high\n\n var segmentProcessingTime = Date.now() - segmentInfo.endOfAllRequests + 1; // Multiply by 8000 to convert from bytes/millisecond to bits/second\n\n var segmentProcessingThroughput = Math.floor(segmentInfo.byteLength / segmentProcessingTime * 8 * 1000); // This is just a cumulative moving average calculation:\n // newAvg = oldAvg + (sample - oldAvg) / (sampleCount + 1)\n\n this.throughput.rate += (segmentProcessingThroughput - rate) / ++this.throughput.count;\n }\n /**\n * Adds a cue to the segment-metadata track with some metadata information about the\n * segment\n *\n * @private\n * @param {Object} segmentInfo\n * the object returned by loadSegment\n * @method addSegmentMetadataCue_\n */\n\n }, {\n key: 'addSegmentMetadataCue_',\n value: function addSegmentMetadataCue_(segmentInfo) {\n if (!this.segmentMetadataTrack_) {\n return;\n }\n\n var segment = segmentInfo.segment;\n var start = segment.start;\n var end = segment.end; // Do not try adding the cue if the start and end times are invalid.\n\n if (!finite(start) || !finite(end)) {\n return;\n }\n\n removeCuesFromTrack(start, end, this.segmentMetadataTrack_);\n var Cue = window$1.WebKitDataCue || window$1.VTTCue;\n var value = {\n dateTimeObject: segment.dateTimeObject,\n dateTimeString: segment.dateTimeString,\n bandwidth: segmentInfo.playlist.attributes.BANDWIDTH,\n resolution: segmentInfo.playlist.attributes.RESOLUTION,\n codecs: segmentInfo.playlist.attributes.CODECS,\n byteLength: segmentInfo.byteLength,\n uri: segmentInfo.uri,\n timeline: segmentInfo.timeline,\n playlist: segmentInfo.playlist.uri,\n start: start,\n end: end\n };\n var data = JSON.stringify(value);\n var cue = new Cue(start, end, data); // Attach the metadata to the value property of the cue to keep consistency between\n // the differences of WebKitDataCue in safari and VTTCue in other browsers\n\n cue.value = value;\n this.segmentMetadataTrack_.addCue(cue);\n }\n }]);\n return SegmentLoader;\n}(videojs$1.EventTarget);\n\nvar uint8ToUtf8 = function uint8ToUtf8(uintArray) {\n return decodeURIComponent(escape(String.fromCharCode.apply(null, uintArray)));\n};\n/**\n * @file vtt-segment-loader.js\n */\n\n\nvar VTT_LINE_TERMINATORS = new Uint8Array('\\n\\n'.split('').map(function (char) {\n return char.charCodeAt(0);\n}));\n/**\n * An object that manages segment loading and appending.\n *\n * @class VTTSegmentLoader\n * @param {Object} options required and optional options\n * @extends videojs.EventTarget\n */\n\nvar VTTSegmentLoader = function (_SegmentLoader) {\n inherits(VTTSegmentLoader, _SegmentLoader);\n\n function VTTSegmentLoader(settings) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n classCallCheck(this, VTTSegmentLoader); // SegmentLoader requires a MediaSource be specified or it will throw an error;\n // however, VTTSegmentLoader has no need of a media source, so delete the reference\n\n var _this = possibleConstructorReturn(this, (VTTSegmentLoader.__proto__ || Object.getPrototypeOf(VTTSegmentLoader)).call(this, settings, options));\n\n _this.mediaSource_ = null;\n _this.subtitlesTrack_ = null;\n return _this;\n }\n /**\n * Indicates which time ranges are buffered\n *\n * @return {TimeRange}\n * TimeRange object representing the current buffered ranges\n */\n\n\n createClass(VTTSegmentLoader, [{\n key: 'buffered_',\n value: function buffered_() {\n if (!this.subtitlesTrack_ || !this.subtitlesTrack_.cues.length) {\n return videojs$1.createTimeRanges();\n }\n\n var cues = this.subtitlesTrack_.cues;\n var start = cues[0].startTime;\n var end = cues[cues.length - 1].startTime;\n return videojs$1.createTimeRanges([[start, end]]);\n }\n /**\n * Gets and sets init segment for the provided map\n *\n * @param {Object} map\n * The map object representing the init segment to get or set\n * @param {Boolean=} set\n * If true, the init segment for the provided map should be saved\n * @return {Object}\n * map object for desired init segment\n */\n\n }, {\n key: 'initSegment',\n value: function initSegment(map) {\n var set$$1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (!map) {\n return null;\n }\n\n var id = initSegmentId(map);\n var storedMap = this.initSegments_[id];\n\n if (set$$1 && !storedMap && map.bytes) {\n // append WebVTT line terminators to the media initialization segment if it exists\n // to follow the WebVTT spec (https://w3c.github.io/webvtt/#file-structure) that\n // requires two or more WebVTT line terminators between the WebVTT header and the\n // rest of the file\n var combinedByteLength = VTT_LINE_TERMINATORS.byteLength + map.bytes.byteLength;\n var combinedSegment = new Uint8Array(combinedByteLength);\n combinedSegment.set(map.bytes);\n combinedSegment.set(VTT_LINE_TERMINATORS, map.bytes.byteLength);\n this.initSegments_[id] = storedMap = {\n resolvedUri: map.resolvedUri,\n byterange: map.byterange,\n bytes: combinedSegment\n };\n }\n\n return storedMap || map;\n }\n /**\n * Returns true if all configuration required for loading is present, otherwise false.\n *\n * @return {Boolean} True if the all configuration is ready for loading\n * @private\n */\n\n }, {\n key: 'couldBeginLoading_',\n value: function couldBeginLoading_() {\n return this.playlist_ && this.subtitlesTrack_ && !this.paused();\n }\n /**\n * Once all the starting parameters have been specified, begin\n * operation. This method should only be invoked from the INIT\n * state.\n *\n * @private\n */\n\n }, {\n key: 'init_',\n value: function init_() {\n this.state = 'READY';\n this.resetEverything();\n return this.monitorBuffer_();\n }\n /**\n * Set a subtitle track on the segment loader to add subtitles to\n *\n * @param {TextTrack=} track\n * The text track to add loaded subtitles to\n * @return {TextTrack}\n * Returns the subtitles track\n */\n\n }, {\n key: 'track',\n value: function track(_track) {\n if (typeof _track === 'undefined') {\n return this.subtitlesTrack_;\n }\n\n this.subtitlesTrack_ = _track; // if we were unpaused but waiting for a sourceUpdater, start\n // buffering now\n\n if (this.state === 'INIT' && this.couldBeginLoading_()) {\n this.init_();\n }\n\n return this.subtitlesTrack_;\n }\n /**\n * Remove any data in the source buffer between start and end times\n * @param {Number} start - the start time of the region to remove from the buffer\n * @param {Number} end - the end time of the region to remove from the buffer\n */\n\n }, {\n key: 'remove',\n value: function remove(start, end) {\n removeCuesFromTrack(start, end, this.subtitlesTrack_);\n }\n /**\n * fill the buffer with segements unless the sourceBuffers are\n * currently updating\n *\n * Note: this function should only ever be called by monitorBuffer_\n * and never directly\n *\n * @private\n */\n\n }, {\n key: 'fillBuffer_',\n value: function fillBuffer_() {\n var _this2 = this;\n\n if (!this.syncPoint_) {\n this.syncPoint_ = this.syncController_.getSyncPoint(this.playlist_, this.duration_(), this.currentTimeline_, this.currentTime_());\n } // see if we need to begin loading immediately\n\n\n var segmentInfo = this.checkBuffer_(this.buffered_(), this.playlist_, this.mediaIndex, this.hasPlayed_(), this.currentTime_(), this.syncPoint_);\n segmentInfo = this.skipEmptySegments_(segmentInfo);\n\n if (!segmentInfo) {\n return;\n }\n\n if (this.syncController_.timestampOffsetForTimeline(segmentInfo.timeline) === null) {\n // We don't have the timestamp offset that we need to sync subtitles.\n // Rerun on a timestamp offset or user interaction.\n var checkTimestampOffset = function checkTimestampOffset() {\n _this2.state = 'READY';\n\n if (!_this2.paused()) {\n // if not paused, queue a buffer check as soon as possible\n _this2.monitorBuffer_();\n }\n };\n\n this.syncController_.one('timestampoffset', checkTimestampOffset);\n this.state = 'WAITING_ON_TIMELINE';\n return;\n }\n\n this.loadSegment_(segmentInfo);\n }\n /**\n * Prevents the segment loader from requesting segments we know contain no subtitles\n * by walking forward until we find the next segment that we don't know whether it is\n * empty or not.\n *\n * @param {Object} segmentInfo\n * a segment info object that describes the current segment\n * @return {Object}\n * a segment info object that describes the current segment\n */\n\n }, {\n key: 'skipEmptySegments_',\n value: function skipEmptySegments_(segmentInfo) {\n while (segmentInfo && segmentInfo.segment.empty) {\n segmentInfo = this.generateSegmentInfo_(segmentInfo.playlist, segmentInfo.mediaIndex + 1, segmentInfo.startOfSegment + segmentInfo.duration, segmentInfo.isSyncRequest);\n }\n\n return segmentInfo;\n }\n /**\n * append a decrypted segement to the SourceBuffer through a SourceUpdater\n *\n * @private\n */\n\n }, {\n key: 'handleSegment_',\n value: function handleSegment_() {\n var _this3 = this;\n\n if (!this.pendingSegment_ || !this.subtitlesTrack_) {\n this.state = 'READY';\n return;\n }\n\n this.state = 'APPENDING';\n var segmentInfo = this.pendingSegment_;\n var segment = segmentInfo.segment; // Make sure that vttjs has loaded, otherwise, wait till it finished loading\n\n if (typeof window$1.WebVTT !== 'function' && this.subtitlesTrack_ && this.subtitlesTrack_.tech_) {\n var loadHandler = function loadHandler() {\n _this3.handleSegment_();\n };\n\n this.state = 'WAITING_ON_VTTJS';\n this.subtitlesTrack_.tech_.one('vttjsloaded', loadHandler);\n this.subtitlesTrack_.tech_.one('vttjserror', function () {\n _this3.subtitlesTrack_.tech_.off('vttjsloaded', loadHandler);\n\n _this3.error({\n message: 'Error loading vtt.js'\n });\n\n _this3.state = 'READY';\n\n _this3.pause();\n\n _this3.trigger('error');\n });\n return;\n }\n\n segment.requested = true;\n\n try {\n this.parseVTTCues_(segmentInfo);\n } catch (e) {\n this.error({\n message: e.message\n });\n this.state = 'READY';\n this.pause();\n return this.trigger('error');\n }\n\n this.updateTimeMapping_(segmentInfo, this.syncController_.timelines[segmentInfo.timeline], this.playlist_);\n\n if (segmentInfo.isSyncRequest) {\n this.trigger('syncinfoupdate');\n this.pendingSegment_ = null;\n this.state = 'READY';\n return;\n }\n\n segmentInfo.byteLength = segmentInfo.bytes.byteLength;\n this.mediaSecondsLoaded += segment.duration;\n\n if (segmentInfo.cues.length) {\n // remove any overlapping cues to prevent doubling\n this.remove(segmentInfo.cues[0].endTime, segmentInfo.cues[segmentInfo.cues.length - 1].endTime);\n }\n\n segmentInfo.cues.forEach(function (cue) {\n _this3.subtitlesTrack_.addCue(cue);\n });\n this.handleUpdateEnd_();\n }\n /**\n * Uses the WebVTT parser to parse the segment response\n *\n * @param {Object} segmentInfo\n * a segment info object that describes the current segment\n * @private\n */\n\n }, {\n key: 'parseVTTCues_',\n value: function parseVTTCues_(segmentInfo) {\n var decoder = void 0;\n var decodeBytesToString = false;\n\n if (typeof window$1.TextDecoder === 'function') {\n decoder = new window$1.TextDecoder('utf8');\n } else {\n decoder = window$1.WebVTT.StringDecoder();\n decodeBytesToString = true;\n }\n\n var parser = new window$1.WebVTT.Parser(window$1, window$1.vttjs, decoder);\n segmentInfo.cues = [];\n segmentInfo.timestampmap = {\n MPEGTS: 0,\n LOCAL: 0\n };\n parser.oncue = segmentInfo.cues.push.bind(segmentInfo.cues);\n\n parser.ontimestampmap = function (map) {\n return segmentInfo.timestampmap = map;\n };\n\n parser.onparsingerror = function (error) {\n videojs$1.log.warn('Error encountered when parsing cues: ' + error.message);\n };\n\n if (segmentInfo.segment.map) {\n var mapData = segmentInfo.segment.map.bytes;\n\n if (decodeBytesToString) {\n mapData = uint8ToUtf8(mapData);\n }\n\n parser.parse(mapData);\n }\n\n var segmentData = segmentInfo.bytes;\n\n if (decodeBytesToString) {\n segmentData = uint8ToUtf8(segmentData);\n }\n\n parser.parse(segmentData);\n parser.flush();\n }\n /**\n * Updates the start and end times of any cues parsed by the WebVTT parser using\n * the information parsed from the X-TIMESTAMP-MAP header and a TS to media time mapping\n * from the SyncController\n *\n * @param {Object} segmentInfo\n * a segment info object that describes the current segment\n * @param {Object} mappingObj\n * object containing a mapping from TS to media time\n * @param {Object} playlist\n * the playlist object containing the segment\n * @private\n */\n\n }, {\n key: 'updateTimeMapping_',\n value: function updateTimeMapping_(segmentInfo, mappingObj, playlist) {\n var segment = segmentInfo.segment;\n\n if (!mappingObj) {\n // If the sync controller does not have a mapping of TS to Media Time for the\n // timeline, then we don't have enough information to update the cue\n // start/end times\n return;\n }\n\n if (!segmentInfo.cues.length) {\n // If there are no cues, we also do not have enough information to figure out\n // segment timing. Mark that the segment contains no cues so we don't re-request\n // an empty segment.\n segment.empty = true;\n return;\n }\n\n var timestampmap = segmentInfo.timestampmap;\n var diff = timestampmap.MPEGTS / 90000 - timestampmap.LOCAL + mappingObj.mapping;\n segmentInfo.cues.forEach(function (cue) {\n // First convert cue time to TS time using the timestamp-map provided within the vtt\n cue.startTime += diff;\n cue.endTime += diff;\n });\n\n if (!playlist.syncInfo) {\n var firstStart = segmentInfo.cues[0].startTime;\n var lastStart = segmentInfo.cues[segmentInfo.cues.length - 1].startTime;\n playlist.syncInfo = {\n mediaSequence: playlist.mediaSequence + segmentInfo.mediaIndex,\n time: Math.min(firstStart, lastStart - segment.duration)\n };\n }\n }\n }]);\n return VTTSegmentLoader;\n}(SegmentLoader);\n/**\n * @file ad-cue-tags.js\n */\n\n/**\n * Searches for an ad cue that overlaps with the given mediaTime\n */\n\n\nvar findAdCue = function findAdCue(track, mediaTime) {\n var cues = track.cues;\n\n for (var i = 0; i < cues.length; i++) {\n var cue = cues[i];\n\n if (mediaTime >= cue.adStartTime && mediaTime <= cue.adEndTime) {\n return cue;\n }\n }\n\n return null;\n};\n\nvar updateAdCues = function updateAdCues(media, track) {\n var offset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n\n if (!media.segments) {\n return;\n }\n\n var mediaTime = offset;\n var cue = void 0;\n\n for (var i = 0; i < media.segments.length; i++) {\n var segment = media.segments[i];\n\n if (!cue) {\n // Since the cues will span for at least the segment duration, adding a fudge\n // factor of half segment duration will prevent duplicate cues from being\n // created when timing info is not exact (e.g. cue start time initialized\n // at 10.006677, but next call mediaTime is 10.003332 )\n cue = findAdCue(track, mediaTime + segment.duration / 2);\n }\n\n if (cue) {\n if ('cueIn' in segment) {\n // Found a CUE-IN so end the cue\n cue.endTime = mediaTime;\n cue.adEndTime = mediaTime;\n mediaTime += segment.duration;\n cue = null;\n continue;\n }\n\n if (mediaTime < cue.endTime) {\n // Already processed this mediaTime for this cue\n mediaTime += segment.duration;\n continue;\n } // otherwise extend cue until a CUE-IN is found\n\n\n cue.endTime += segment.duration;\n } else {\n if ('cueOut' in segment) {\n cue = new window$1.VTTCue(mediaTime, mediaTime + segment.duration, segment.cueOut);\n cue.adStartTime = mediaTime; // Assumes tag format to be\n // #EXT-X-CUE-OUT:30\n\n cue.adEndTime = mediaTime + parseFloat(segment.cueOut);\n track.addCue(cue);\n }\n\n if ('cueOutCont' in segment) {\n // Entered into the middle of an ad cue\n var adOffset = void 0;\n var adTotal = void 0; // Assumes tag formate to be\n // #EXT-X-CUE-OUT-CONT:10/30\n\n var _segment$cueOutCont$s = segment.cueOutCont.split('/').map(parseFloat);\n\n var _segment$cueOutCont$s2 = slicedToArray(_segment$cueOutCont$s, 2);\n\n adOffset = _segment$cueOutCont$s2[0];\n adTotal = _segment$cueOutCont$s2[1];\n cue = new window$1.VTTCue(mediaTime, mediaTime + segment.duration, '');\n cue.adStartTime = mediaTime - adOffset;\n cue.adEndTime = cue.adStartTime + adTotal;\n track.addCue(cue);\n }\n }\n\n mediaTime += segment.duration;\n }\n};\n/**\n * @file sync-controller.js\n */\n\n\nvar tsprobe = tsInspector.inspect;\nvar syncPointStrategies = [// Stategy \"VOD\": Handle the VOD-case where the sync-point is *always*\n// the equivalence display-time 0 === segment-index 0\n{\n name: 'VOD',\n run: function run(syncController, playlist, duration$$1, currentTimeline, currentTime) {\n if (duration$$1 !== Infinity) {\n var syncPoint = {\n time: 0,\n segmentIndex: 0\n };\n return syncPoint;\n }\n\n return null;\n }\n}, // Stategy \"ProgramDateTime\": We have a program-date-time tag in this playlist\n{\n name: 'ProgramDateTime',\n run: function run(syncController, playlist, duration$$1, currentTimeline, currentTime) {\n if (!syncController.datetimeToDisplayTime) {\n return null;\n }\n\n var segments = playlist.segments || [];\n var syncPoint = null;\n var lastDistance = null;\n currentTime = currentTime || 0;\n\n for (var i = 0; i < segments.length; i++) {\n var segment = segments[i];\n\n if (segment.dateTimeObject) {\n var segmentTime = segment.dateTimeObject.getTime() / 1000;\n var segmentStart = segmentTime + syncController.datetimeToDisplayTime;\n var distance = Math.abs(currentTime - segmentStart); // Once the distance begins to increase, we have passed\n // currentTime and can stop looking for better candidates\n\n if (lastDistance !== null && lastDistance < distance) {\n break;\n }\n\n lastDistance = distance;\n syncPoint = {\n time: segmentStart,\n segmentIndex: i\n };\n }\n }\n\n return syncPoint;\n }\n}, // Stategy \"Segment\": We have a known time mapping for a timeline and a\n// segment in the current timeline with timing data\n{\n name: 'Segment',\n run: function run(syncController, playlist, duration$$1, currentTimeline, currentTime) {\n var segments = playlist.segments || [];\n var syncPoint = null;\n var lastDistance = null;\n currentTime = currentTime || 0;\n\n for (var i = 0; i < segments.length; i++) {\n var segment = segments[i];\n\n if (segment.timeline === currentTimeline && typeof segment.start !== 'undefined') {\n var distance = Math.abs(currentTime - segment.start); // Once the distance begins to increase, we have passed\n // currentTime and can stop looking for better candidates\n\n if (lastDistance !== null && lastDistance < distance) {\n break;\n }\n\n if (!syncPoint || lastDistance === null || lastDistance >= distance) {\n lastDistance = distance;\n syncPoint = {\n time: segment.start,\n segmentIndex: i\n };\n }\n }\n }\n\n return syncPoint;\n }\n}, // Stategy \"Discontinuity\": We have a discontinuity with a known\n// display-time\n{\n name: 'Discontinuity',\n run: function run(syncController, playlist, duration$$1, currentTimeline, currentTime) {\n var syncPoint = null;\n currentTime = currentTime || 0;\n\n if (playlist.discontinuityStarts && playlist.discontinuityStarts.length) {\n var lastDistance = null;\n\n for (var i = 0; i < playlist.discontinuityStarts.length; i++) {\n var segmentIndex = playlist.discontinuityStarts[i];\n var discontinuity = playlist.discontinuitySequence + i + 1;\n var discontinuitySync = syncController.discontinuities[discontinuity];\n\n if (discontinuitySync) {\n var distance = Math.abs(currentTime - discontinuitySync.time); // Once the distance begins to increase, we have passed\n // currentTime and can stop looking for better candidates\n\n if (lastDistance !== null && lastDistance < distance) {\n break;\n }\n\n if (!syncPoint || lastDistance === null || lastDistance >= distance) {\n lastDistance = distance;\n syncPoint = {\n time: discontinuitySync.time,\n segmentIndex: segmentIndex\n };\n }\n }\n }\n }\n\n return syncPoint;\n }\n}, // Stategy \"Playlist\": We have a playlist with a known mapping of\n// segment index to display time\n{\n name: 'Playlist',\n run: function run(syncController, playlist, duration$$1, currentTimeline, currentTime) {\n if (playlist.syncInfo) {\n var syncPoint = {\n time: playlist.syncInfo.time,\n segmentIndex: playlist.syncInfo.mediaSequence - playlist.mediaSequence\n };\n return syncPoint;\n }\n\n return null;\n }\n}];\n\nvar SyncController = function (_videojs$EventTarget) {\n inherits(SyncController, _videojs$EventTarget);\n\n function SyncController() {\n classCallCheck(this, SyncController); // Segment Loader state variables...\n // ...for synching across variants\n\n var _this = possibleConstructorReturn(this, (SyncController.__proto__ || Object.getPrototypeOf(SyncController)).call(this));\n\n _this.inspectCache_ = undefined; // ...for synching across variants\n\n _this.timelines = [];\n _this.discontinuities = [];\n _this.datetimeToDisplayTime = null;\n _this.logger_ = logger('SyncController');\n return _this;\n }\n /**\n * Find a sync-point for the playlist specified\n *\n * A sync-point is defined as a known mapping from display-time to\n * a segment-index in the current playlist.\n *\n * @param {Playlist} playlist\n * The playlist that needs a sync-point\n * @param {Number} duration\n * Duration of the MediaSource (Infinite if playing a live source)\n * @param {Number} currentTimeline\n * The last timeline from which a segment was loaded\n * @returns {Object}\n * A sync-point object\n */\n\n\n createClass(SyncController, [{\n key: 'getSyncPoint',\n value: function getSyncPoint(playlist, duration$$1, currentTimeline, currentTime) {\n var syncPoints = this.runStrategies_(playlist, duration$$1, currentTimeline, currentTime);\n\n if (!syncPoints.length) {\n // Signal that we need to attempt to get a sync-point manually\n // by fetching a segment in the playlist and constructing\n // a sync-point from that information\n return null;\n } // Now find the sync-point that is closest to the currentTime because\n // that should result in the most accurate guess about which segment\n // to fetch\n\n\n return this.selectSyncPoint_(syncPoints, {\n key: 'time',\n value: currentTime\n });\n }\n /**\n * Calculate the amount of time that has expired off the playlist during playback\n *\n * @param {Playlist} playlist\n * Playlist object to calculate expired from\n * @param {Number} duration\n * Duration of the MediaSource (Infinity if playling a live source)\n * @returns {Number|null}\n * The amount of time that has expired off the playlist during playback. Null\n * if no sync-points for the playlist can be found.\n */\n\n }, {\n key: 'getExpiredTime',\n value: function getExpiredTime(playlist, duration$$1) {\n if (!playlist || !playlist.segments) {\n return null;\n }\n\n var syncPoints = this.runStrategies_(playlist, duration$$1, playlist.discontinuitySequence, 0); // Without sync-points, there is not enough information to determine the expired time\n\n if (!syncPoints.length) {\n return null;\n }\n\n var syncPoint = this.selectSyncPoint_(syncPoints, {\n key: 'segmentIndex',\n value: 0\n }); // If the sync-point is beyond the start of the playlist, we want to subtract the\n // duration from index 0 to syncPoint.segmentIndex instead of adding.\n\n if (syncPoint.segmentIndex > 0) {\n syncPoint.time *= -1;\n }\n\n return Math.abs(syncPoint.time + sumDurations(playlist, syncPoint.segmentIndex, 0));\n }\n /**\n * Runs each sync-point strategy and returns a list of sync-points returned by the\n * strategies\n *\n * @private\n * @param {Playlist} playlist\n * The playlist that needs a sync-point\n * @param {Number} duration\n * Duration of the MediaSource (Infinity if playing a live source)\n * @param {Number} currentTimeline\n * The last timeline from which a segment was loaded\n * @returns {Array}\n * A list of sync-point objects\n */\n\n }, {\n key: 'runStrategies_',\n value: function runStrategies_(playlist, duration$$1, currentTimeline, currentTime) {\n var syncPoints = []; // Try to find a sync-point in by utilizing various strategies...\n\n for (var i = 0; i < syncPointStrategies.length; i++) {\n var strategy = syncPointStrategies[i];\n var syncPoint = strategy.run(this, playlist, duration$$1, currentTimeline, currentTime);\n\n if (syncPoint) {\n syncPoint.strategy = strategy.name;\n syncPoints.push({\n strategy: strategy.name,\n syncPoint: syncPoint\n });\n }\n }\n\n return syncPoints;\n }\n /**\n * Selects the sync-point nearest the specified target\n *\n * @private\n * @param {Array} syncPoints\n * List of sync-points to select from\n * @param {Object} target\n * Object specifying the property and value we are targeting\n * @param {String} target.key\n * Specifies the property to target. Must be either 'time' or 'segmentIndex'\n * @param {Number} target.value\n * The value to target for the specified key.\n * @returns {Object}\n * The sync-point nearest the target\n */\n\n }, {\n key: 'selectSyncPoint_',\n value: function selectSyncPoint_(syncPoints, target) {\n var bestSyncPoint = syncPoints[0].syncPoint;\n var bestDistance = Math.abs(syncPoints[0].syncPoint[target.key] - target.value);\n var bestStrategy = syncPoints[0].strategy;\n\n for (var i = 1; i < syncPoints.length; i++) {\n var newDistance = Math.abs(syncPoints[i].syncPoint[target.key] - target.value);\n\n if (newDistance < bestDistance) {\n bestDistance = newDistance;\n bestSyncPoint = syncPoints[i].syncPoint;\n bestStrategy = syncPoints[i].strategy;\n }\n }\n\n this.logger_('syncPoint for [' + target.key + ': ' + target.value + '] chosen with strategy' + (' [' + bestStrategy + ']: [time:' + bestSyncPoint.time + ',') + (' segmentIndex:' + bestSyncPoint.segmentIndex + ']'));\n return bestSyncPoint;\n }\n /**\n * Save any meta-data present on the segments when segments leave\n * the live window to the playlist to allow for synchronization at the\n * playlist level later.\n *\n * @param {Playlist} oldPlaylist - The previous active playlist\n * @param {Playlist} newPlaylist - The updated and most current playlist\n */\n\n }, {\n key: 'saveExpiredSegmentInfo',\n value: function saveExpiredSegmentInfo(oldPlaylist, newPlaylist) {\n var mediaSequenceDiff = newPlaylist.mediaSequence - oldPlaylist.mediaSequence; // When a segment expires from the playlist and it has a start time\n // save that information as a possible sync-point reference in future\n\n for (var i = mediaSequenceDiff - 1; i >= 0; i--) {\n var lastRemovedSegment = oldPlaylist.segments[i];\n\n if (lastRemovedSegment && typeof lastRemovedSegment.start !== 'undefined') {\n newPlaylist.syncInfo = {\n mediaSequence: oldPlaylist.mediaSequence + i,\n time: lastRemovedSegment.start\n };\n this.logger_('playlist refresh sync: [time:' + newPlaylist.syncInfo.time + ',' + (' mediaSequence: ' + newPlaylist.syncInfo.mediaSequence + ']'));\n this.trigger('syncinfoupdate');\n break;\n }\n }\n }\n /**\n * Save the mapping from playlist's ProgramDateTime to display. This should\n * only ever happen once at the start of playback.\n *\n * @param {Playlist} playlist - The currently active playlist\n */\n\n }, {\n key: 'setDateTimeMapping',\n value: function setDateTimeMapping(playlist) {\n if (!this.datetimeToDisplayTime && playlist.segments && playlist.segments.length && playlist.segments[0].dateTimeObject) {\n var playlistTimestamp = playlist.segments[0].dateTimeObject.getTime() / 1000;\n this.datetimeToDisplayTime = -playlistTimestamp;\n }\n }\n /**\n * Reset the state of the inspection cache when we do a rendition\n * switch\n */\n\n }, {\n key: 'reset',\n value: function reset() {\n this.inspectCache_ = undefined;\n }\n /**\n * Probe or inspect a fmp4 or an mpeg2-ts segment to determine the start\n * and end of the segment in it's internal \"media time\". Used to generate\n * mappings from that internal \"media time\" to the display time that is\n * shown on the player.\n *\n * @param {SegmentInfo} segmentInfo - The current active request information\n */\n\n }, {\n key: 'probeSegmentInfo',\n value: function probeSegmentInfo(segmentInfo) {\n var segment = segmentInfo.segment;\n var playlist = segmentInfo.playlist;\n var timingInfo = void 0;\n\n if (segment.map) {\n timingInfo = this.probeMp4Segment_(segmentInfo);\n } else {\n timingInfo = this.probeTsSegment_(segmentInfo);\n }\n\n if (timingInfo) {\n if (this.calculateSegmentTimeMapping_(segmentInfo, timingInfo)) {\n this.saveDiscontinuitySyncInfo_(segmentInfo); // If the playlist does not have sync information yet, record that information\n // now with segment timing information\n\n if (!playlist.syncInfo) {\n playlist.syncInfo = {\n mediaSequence: playlist.mediaSequence + segmentInfo.mediaIndex,\n time: segment.start\n };\n }\n }\n }\n\n return timingInfo;\n }\n /**\n * Probe an fmp4 or an mpeg2-ts segment to determine the start of the segment\n * in it's internal \"media time\".\n *\n * @private\n * @param {SegmentInfo} segmentInfo - The current active request information\n * @return {object} The start and end time of the current segment in \"media time\"\n */\n\n }, {\n key: 'probeMp4Segment_',\n value: function probeMp4Segment_(segmentInfo) {\n var segment = segmentInfo.segment;\n var timescales = mp4probe.timescale(segment.map.bytes);\n var startTime = mp4probe.startTime(timescales, segmentInfo.bytes);\n\n if (segmentInfo.timestampOffset !== null) {\n segmentInfo.timestampOffset -= startTime;\n }\n\n return {\n start: startTime,\n end: startTime + segment.duration\n };\n }\n /**\n * Probe an mpeg2-ts segment to determine the start and end of the segment\n * in it's internal \"media time\".\n *\n * @private\n * @param {SegmentInfo} segmentInfo - The current active request information\n * @return {object} The start and end time of the current segment in \"media time\"\n */\n\n }, {\n key: 'probeTsSegment_',\n value: function probeTsSegment_(segmentInfo) {\n var timeInfo = tsprobe(segmentInfo.bytes, this.inspectCache_);\n var segmentStartTime = void 0;\n var segmentEndTime = void 0;\n\n if (!timeInfo) {\n return null;\n }\n\n if (timeInfo.video && timeInfo.video.length === 2) {\n this.inspectCache_ = timeInfo.video[1].dts;\n segmentStartTime = timeInfo.video[0].dtsTime;\n segmentEndTime = timeInfo.video[1].dtsTime;\n } else if (timeInfo.audio && timeInfo.audio.length === 2) {\n this.inspectCache_ = timeInfo.audio[1].dts;\n segmentStartTime = timeInfo.audio[0].dtsTime;\n segmentEndTime = timeInfo.audio[1].dtsTime;\n }\n\n return {\n start: segmentStartTime,\n end: segmentEndTime,\n containsVideo: timeInfo.video && timeInfo.video.length === 2,\n containsAudio: timeInfo.audio && timeInfo.audio.length === 2\n };\n }\n }, {\n key: 'timestampOffsetForTimeline',\n value: function timestampOffsetForTimeline(timeline) {\n if (typeof this.timelines[timeline] === 'undefined') {\n return null;\n }\n\n return this.timelines[timeline].time;\n }\n }, {\n key: 'mappingForTimeline',\n value: function mappingForTimeline(timeline) {\n if (typeof this.timelines[timeline] === 'undefined') {\n return null;\n }\n\n return this.timelines[timeline].mapping;\n }\n /**\n * Use the \"media time\" for a segment to generate a mapping to \"display time\" and\n * save that display time to the segment.\n *\n * @private\n * @param {SegmentInfo} segmentInfo\n * The current active request information\n * @param {object} timingInfo\n * The start and end time of the current segment in \"media time\"\n * @returns {Boolean}\n * Returns false if segment time mapping could not be calculated\n */\n\n }, {\n key: 'calculateSegmentTimeMapping_',\n value: function calculateSegmentTimeMapping_(segmentInfo, timingInfo) {\n var segment = segmentInfo.segment;\n var mappingObj = this.timelines[segmentInfo.timeline];\n\n if (segmentInfo.timestampOffset !== null) {\n mappingObj = {\n time: segmentInfo.startOfSegment,\n mapping: segmentInfo.startOfSegment - timingInfo.start\n };\n this.timelines[segmentInfo.timeline] = mappingObj;\n this.trigger('timestampoffset');\n this.logger_('time mapping for timeline ' + segmentInfo.timeline + ': ' + ('[time: ' + mappingObj.time + '] [mapping: ' + mappingObj.mapping + ']'));\n segment.start = segmentInfo.startOfSegment;\n segment.end = timingInfo.end + mappingObj.mapping;\n } else if (mappingObj) {\n segment.start = timingInfo.start + mappingObj.mapping;\n segment.end = timingInfo.end + mappingObj.mapping;\n } else {\n return false;\n }\n\n return true;\n }\n /**\n * Each time we have discontinuity in the playlist, attempt to calculate the location\n * in display of the start of the discontinuity and save that. We also save an accuracy\n * value so that we save values with the most accuracy (closest to 0.)\n *\n * @private\n * @param {SegmentInfo} segmentInfo - The current active request information\n */\n\n }, {\n key: 'saveDiscontinuitySyncInfo_',\n value: function saveDiscontinuitySyncInfo_(segmentInfo) {\n var playlist = segmentInfo.playlist;\n var segment = segmentInfo.segment; // If the current segment is a discontinuity then we know exactly where\n // the start of the range and it's accuracy is 0 (greater accuracy values\n // mean more approximation)\n\n if (segment.discontinuity) {\n this.discontinuities[segment.timeline] = {\n time: segment.start,\n accuracy: 0\n };\n } else if (playlist.discontinuityStarts && playlist.discontinuityStarts.length) {\n // Search for future discontinuities that we can provide better timing\n // information for and save that information for sync purposes\n for (var i = 0; i < playlist.discontinuityStarts.length; i++) {\n var segmentIndex = playlist.discontinuityStarts[i];\n var discontinuity = playlist.discontinuitySequence + i + 1;\n var mediaIndexDiff = segmentIndex - segmentInfo.mediaIndex;\n var accuracy = Math.abs(mediaIndexDiff);\n\n if (!this.discontinuities[discontinuity] || this.discontinuities[discontinuity].accuracy > accuracy) {\n var time = void 0;\n\n if (mediaIndexDiff < 0) {\n time = segment.start - sumDurations(playlist, segmentInfo.mediaIndex, segmentIndex);\n } else {\n time = segment.end + sumDurations(playlist, segmentInfo.mediaIndex + 1, segmentIndex);\n }\n\n this.discontinuities[discontinuity] = {\n time: time,\n accuracy: accuracy\n };\n }\n }\n }\n }\n }]);\n return SyncController;\n}(videojs$1.EventTarget);\n\nvar Decrypter$1 = new shimWorker(\"./decrypter-worker.worker.js\", function (window, document$$1) {\n var self = this;\n\n var decrypterWorker = function () {\n /*\n * pkcs7.pad\n * https://github.com/brightcove/pkcs7\n *\n * Copyright (c) 2014 Brightcove\n * Licensed under the apache2 license.\n */\n\n /**\n * Returns the subarray of a Uint8Array without PKCS#7 padding.\n * @param padded {Uint8Array} unencrypted bytes that have been padded\n * @return {Uint8Array} the unpadded bytes\n * @see http://tools.ietf.org/html/rfc5652\n */\n function unpad(padded) {\n return padded.subarray(0, padded.byteLength - padded[padded.byteLength - 1]);\n }\n\n var classCallCheck = function classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n };\n\n var createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n }();\n\n var inherits = function inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n };\n\n var possibleConstructorReturn = function possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n };\n /**\n * @file aes.js\n *\n * This file contains an adaptation of the AES decryption algorithm\n * from the Standford Javascript Cryptography Library. That work is\n * covered by the following copyright and permissions notice:\n *\n * Copyright 2009-2010 Emily Stark, Mike Hamburg, Dan Boneh.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following\n * disclaimer in the documentation and/or other materials provided\n * with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * The views and conclusions contained in the software and documentation\n * are those of the authors and should not be interpreted as representing\n * official policies, either expressed or implied, of the authors.\n */\n\n /**\n * Expand the S-box tables.\n *\n * @private\n */\n\n\n var precompute = function precompute() {\n var tables = [[[], [], [], [], []], [[], [], [], [], []]];\n var encTable = tables[0];\n var decTable = tables[1];\n var sbox = encTable[4];\n var sboxInv = decTable[4];\n var i = void 0;\n var x = void 0;\n var xInv = void 0;\n var d = [];\n var th = [];\n var x2 = void 0;\n var x4 = void 0;\n var x8 = void 0;\n var s = void 0;\n var tEnc = void 0;\n var tDec = void 0; // Compute double and third tables\n\n for (i = 0; i < 256; i++) {\n th[(d[i] = i << 1 ^ (i >> 7) * 283) ^ i] = i;\n }\n\n for (x = xInv = 0; !sbox[x]; x ^= x2 || 1, xInv = th[xInv] || 1) {\n // Compute sbox\n s = xInv ^ xInv << 1 ^ xInv << 2 ^ xInv << 3 ^ xInv << 4;\n s = s >> 8 ^ s & 255 ^ 99;\n sbox[x] = s;\n sboxInv[s] = x; // Compute MixColumns\n\n x8 = d[x4 = d[x2 = d[x]]];\n tDec = x8 * 0x1010101 ^ x4 * 0x10001 ^ x2 * 0x101 ^ x * 0x1010100;\n tEnc = d[s] * 0x101 ^ s * 0x1010100;\n\n for (i = 0; i < 4; i++) {\n encTable[i][x] = tEnc = tEnc << 24 ^ tEnc >>> 8;\n decTable[i][s] = tDec = tDec << 24 ^ tDec >>> 8;\n }\n } // Compactify. Considerable speedup on Firefox.\n\n\n for (i = 0; i < 5; i++) {\n encTable[i] = encTable[i].slice(0);\n decTable[i] = decTable[i].slice(0);\n }\n\n return tables;\n };\n\n var aesTables = null;\n /**\n * Schedule out an AES key for both encryption and decryption. This\n * is a low-level class. Use a cipher mode to do bulk encryption.\n *\n * @class AES\n * @param key {Array} The key as an array of 4, 6 or 8 words.\n */\n\n var AES = function () {\n function AES(key) {\n classCallCheck(this, AES);\n /**\n * The expanded S-box and inverse S-box tables. These will be computed\n * on the client so that we don't have to send them down the wire.\n *\n * There are two tables, _tables[0] is for encryption and\n * _tables[1] is for decryption.\n *\n * The first 4 sub-tables are the expanded S-box with MixColumns. The\n * last (_tables[01][4]) is the S-box itself.\n *\n * @private\n */\n // if we have yet to precompute the S-box tables\n // do so now\n\n if (!aesTables) {\n aesTables = precompute();\n } // then make a copy of that object for use\n\n\n this._tables = [[aesTables[0][0].slice(), aesTables[0][1].slice(), aesTables[0][2].slice(), aesTables[0][3].slice(), aesTables[0][4].slice()], [aesTables[1][0].slice(), aesTables[1][1].slice(), aesTables[1][2].slice(), aesTables[1][3].slice(), aesTables[1][4].slice()]];\n var i = void 0;\n var j = void 0;\n var tmp = void 0;\n var encKey = void 0;\n var decKey = void 0;\n var sbox = this._tables[0][4];\n var decTable = this._tables[1];\n var keyLen = key.length;\n var rcon = 1;\n\n if (keyLen !== 4 && keyLen !== 6 && keyLen !== 8) {\n throw new Error('Invalid aes key size');\n }\n\n encKey = key.slice(0);\n decKey = [];\n this._key = [encKey, decKey]; // schedule encryption keys\n\n for (i = keyLen; i < 4 * keyLen + 28; i++) {\n tmp = encKey[i - 1]; // apply sbox\n\n if (i % keyLen === 0 || keyLen === 8 && i % keyLen === 4) {\n tmp = sbox[tmp >>> 24] << 24 ^ sbox[tmp >> 16 & 255] << 16 ^ sbox[tmp >> 8 & 255] << 8 ^ sbox[tmp & 255]; // shift rows and add rcon\n\n if (i % keyLen === 0) {\n tmp = tmp << 8 ^ tmp >>> 24 ^ rcon << 24;\n rcon = rcon << 1 ^ (rcon >> 7) * 283;\n }\n }\n\n encKey[i] = encKey[i - keyLen] ^ tmp;\n } // schedule decryption keys\n\n\n for (j = 0; i; j++, i--) {\n tmp = encKey[j & 3 ? i : i - 4];\n\n if (i <= 4 || j < 4) {\n decKey[j] = tmp;\n } else {\n decKey[j] = decTable[0][sbox[tmp >>> 24]] ^ decTable[1][sbox[tmp >> 16 & 255]] ^ decTable[2][sbox[tmp >> 8 & 255]] ^ decTable[3][sbox[tmp & 255]];\n }\n }\n }\n /**\n * Decrypt 16 bytes, specified as four 32-bit words.\n *\n * @param {Number} encrypted0 the first word to decrypt\n * @param {Number} encrypted1 the second word to decrypt\n * @param {Number} encrypted2 the third word to decrypt\n * @param {Number} encrypted3 the fourth word to decrypt\n * @param {Int32Array} out the array to write the decrypted words\n * into\n * @param {Number} offset the offset into the output array to start\n * writing results\n * @return {Array} The plaintext.\n */\n\n\n AES.prototype.decrypt = function decrypt$$1(encrypted0, encrypted1, encrypted2, encrypted3, out, offset) {\n var key = this._key[1]; // state variables a,b,c,d are loaded with pre-whitened data\n\n var a = encrypted0 ^ key[0];\n var b = encrypted3 ^ key[1];\n var c = encrypted2 ^ key[2];\n var d = encrypted1 ^ key[3];\n var a2 = void 0;\n var b2 = void 0;\n var c2 = void 0; // key.length === 2 ?\n\n var nInnerRounds = key.length / 4 - 2;\n var i = void 0;\n var kIndex = 4;\n var table = this._tables[1]; // load up the tables\n\n var table0 = table[0];\n var table1 = table[1];\n var table2 = table[2];\n var table3 = table[3];\n var sbox = table[4]; // Inner rounds. Cribbed from OpenSSL.\n\n for (i = 0; i < nInnerRounds; i++) {\n a2 = table0[a >>> 24] ^ table1[b >> 16 & 255] ^ table2[c >> 8 & 255] ^ table3[d & 255] ^ key[kIndex];\n b2 = table0[b >>> 24] ^ table1[c >> 16 & 255] ^ table2[d >> 8 & 255] ^ table3[a & 255] ^ key[kIndex + 1];\n c2 = table0[c >>> 24] ^ table1[d >> 16 & 255] ^ table2[a >> 8 & 255] ^ table3[b & 255] ^ key[kIndex + 2];\n d = table0[d >>> 24] ^ table1[a >> 16 & 255] ^ table2[b >> 8 & 255] ^ table3[c & 255] ^ key[kIndex + 3];\n kIndex += 4;\n a = a2;\n b = b2;\n c = c2;\n } // Last round.\n\n\n for (i = 0; i < 4; i++) {\n out[(3 & -i) + offset] = sbox[a >>> 24] << 24 ^ sbox[b >> 16 & 255] << 16 ^ sbox[c >> 8 & 255] << 8 ^ sbox[d & 255] ^ key[kIndex++];\n a2 = a;\n a = b;\n b = c;\n c = d;\n d = a2;\n }\n };\n\n return AES;\n }();\n /**\n * @file stream.js\n */\n\n /**\n * A lightweight readable stream implemention that handles event dispatching.\n *\n * @class Stream\n */\n\n\n var Stream = function () {\n function Stream() {\n classCallCheck(this, Stream);\n this.listeners = {};\n }\n /**\n * Add a listener for a specified event type.\n *\n * @param {String} type the event name\n * @param {Function} listener the callback to be invoked when an event of\n * the specified type occurs\n */\n\n\n Stream.prototype.on = function on(type, listener) {\n if (!this.listeners[type]) {\n this.listeners[type] = [];\n }\n\n this.listeners[type].push(listener);\n };\n /**\n * Remove a listener for a specified event type.\n *\n * @param {String} type the event name\n * @param {Function} listener a function previously registered for this\n * type of event through `on`\n * @return {Boolean} if we could turn it off or not\n */\n\n\n Stream.prototype.off = function off(type, listener) {\n if (!this.listeners[type]) {\n return false;\n }\n\n var index = this.listeners[type].indexOf(listener);\n this.listeners[type].splice(index, 1);\n return index > -1;\n };\n /**\n * Trigger an event of the specified type on this stream. Any additional\n * arguments to this function are passed as parameters to event listeners.\n *\n * @param {String} type the event name\n */\n\n\n Stream.prototype.trigger = function trigger(type) {\n var callbacks = this.listeners[type];\n\n if (!callbacks) {\n return;\n } // Slicing the arguments on every invocation of this method\n // can add a significant amount of overhead. Avoid the\n // intermediate object creation for the common case of a\n // single callback argument\n\n\n if (arguments.length === 2) {\n var length = callbacks.length;\n\n for (var i = 0; i < length; ++i) {\n callbacks[i].call(this, arguments[1]);\n }\n } else {\n var args = Array.prototype.slice.call(arguments, 1);\n var _length = callbacks.length;\n\n for (var _i = 0; _i < _length; ++_i) {\n callbacks[_i].apply(this, args);\n }\n }\n };\n /**\n * Destroys the stream and cleans up.\n */\n\n\n Stream.prototype.dispose = function dispose() {\n this.listeners = {};\n };\n /**\n * Forwards all `data` events on this stream to the destination stream. The\n * destination stream should provide a method `push` to receive the data\n * events as they arrive.\n *\n * @param {Stream} destination the stream that will receive all `data` events\n * @see http://nodejs.org/api/stream.html#stream_readable_pipe_destination_options\n */\n\n\n Stream.prototype.pipe = function pipe(destination) {\n this.on('data', function (data) {\n destination.push(data);\n });\n };\n\n return Stream;\n }();\n /**\n * @file async-stream.js\n */\n\n /**\n * A wrapper around the Stream class to use setTiemout\n * and run stream \"jobs\" Asynchronously\n *\n * @class AsyncStream\n * @extends Stream\n */\n\n\n var AsyncStream$$1 = function (_Stream) {\n inherits(AsyncStream$$1, _Stream);\n\n function AsyncStream$$1() {\n classCallCheck(this, AsyncStream$$1);\n\n var _this = possibleConstructorReturn(this, _Stream.call(this, Stream));\n\n _this.jobs = [];\n _this.delay = 1;\n _this.timeout_ = null;\n return _this;\n }\n /**\n * process an async job\n *\n * @private\n */\n\n\n AsyncStream$$1.prototype.processJob_ = function processJob_() {\n this.jobs.shift()();\n\n if (this.jobs.length) {\n this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay);\n } else {\n this.timeout_ = null;\n }\n };\n /**\n * push a job into the stream\n *\n * @param {Function} job the job to push into the stream\n */\n\n\n AsyncStream$$1.prototype.push = function push(job) {\n this.jobs.push(job);\n\n if (!this.timeout_) {\n this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay);\n }\n };\n\n return AsyncStream$$1;\n }(Stream);\n /**\n * @file decrypter.js\n *\n * An asynchronous implementation of AES-128 CBC decryption with\n * PKCS#7 padding.\n */\n\n /**\n * Convert network-order (big-endian) bytes into their little-endian\n * representation.\n */\n\n\n var ntoh = function ntoh(word) {\n return word << 24 | (word & 0xff00) << 8 | (word & 0xff0000) >> 8 | word >>> 24;\n };\n /**\n * Decrypt bytes using AES-128 with CBC and PKCS#7 padding.\n *\n * @param {Uint8Array} encrypted the encrypted bytes\n * @param {Uint32Array} key the bytes of the decryption key\n * @param {Uint32Array} initVector the initialization vector (IV) to\n * use for the first round of CBC.\n * @return {Uint8Array} the decrypted bytes\n *\n * @see http://en.wikipedia.org/wiki/Advanced_Encryption_Standard\n * @see http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Cipher_Block_Chaining_.28CBC.29\n * @see https://tools.ietf.org/html/rfc2315\n */\n\n\n var decrypt$$1 = function decrypt$$1(encrypted, key, initVector) {\n // word-level access to the encrypted bytes\n var encrypted32 = new Int32Array(encrypted.buffer, encrypted.byteOffset, encrypted.byteLength >> 2);\n var decipher = new AES(Array.prototype.slice.call(key)); // byte and word-level access for the decrypted output\n\n var decrypted = new Uint8Array(encrypted.byteLength);\n var decrypted32 = new Int32Array(decrypted.buffer); // temporary variables for working with the IV, encrypted, and\n // decrypted data\n\n var init0 = void 0;\n var init1 = void 0;\n var init2 = void 0;\n var init3 = void 0;\n var encrypted0 = void 0;\n var encrypted1 = void 0;\n var encrypted2 = void 0;\n var encrypted3 = void 0; // iteration variable\n\n var wordIx = void 0; // pull out the words of the IV to ensure we don't modify the\n // passed-in reference and easier access\n\n init0 = initVector[0];\n init1 = initVector[1];\n init2 = initVector[2];\n init3 = initVector[3]; // decrypt four word sequences, applying cipher-block chaining (CBC)\n // to each decrypted block\n\n for (wordIx = 0; wordIx < encrypted32.length; wordIx += 4) {\n // convert big-endian (network order) words into little-endian\n // (javascript order)\n encrypted0 = ntoh(encrypted32[wordIx]);\n encrypted1 = ntoh(encrypted32[wordIx + 1]);\n encrypted2 = ntoh(encrypted32[wordIx + 2]);\n encrypted3 = ntoh(encrypted32[wordIx + 3]); // decrypt the block\n\n decipher.decrypt(encrypted0, encrypted1, encrypted2, encrypted3, decrypted32, wordIx); // XOR with the IV, and restore network byte-order to obtain the\n // plaintext\n\n decrypted32[wordIx] = ntoh(decrypted32[wordIx] ^ init0);\n decrypted32[wordIx + 1] = ntoh(decrypted32[wordIx + 1] ^ init1);\n decrypted32[wordIx + 2] = ntoh(decrypted32[wordIx + 2] ^ init2);\n decrypted32[wordIx + 3] = ntoh(decrypted32[wordIx + 3] ^ init3); // setup the IV for the next round\n\n init0 = encrypted0;\n init1 = encrypted1;\n init2 = encrypted2;\n init3 = encrypted3;\n }\n\n return decrypted;\n };\n /**\n * The `Decrypter` class that manages decryption of AES\n * data through `AsyncStream` objects and the `decrypt`\n * function\n *\n * @param {Uint8Array} encrypted the encrypted bytes\n * @param {Uint32Array} key the bytes of the decryption key\n * @param {Uint32Array} initVector the initialization vector (IV) to\n * @param {Function} done the function to run when done\n * @class Decrypter\n */\n\n\n var Decrypter$$1 = function () {\n function Decrypter$$1(encrypted, key, initVector, done) {\n classCallCheck(this, Decrypter$$1);\n var step = Decrypter$$1.STEP;\n var encrypted32 = new Int32Array(encrypted.buffer);\n var decrypted = new Uint8Array(encrypted.byteLength);\n var i = 0;\n this.asyncStream_ = new AsyncStream$$1(); // split up the encryption job and do the individual chunks asynchronously\n\n this.asyncStream_.push(this.decryptChunk_(encrypted32.subarray(i, i + step), key, initVector, decrypted));\n\n for (i = step; i < encrypted32.length; i += step) {\n initVector = new Uint32Array([ntoh(encrypted32[i - 4]), ntoh(encrypted32[i - 3]), ntoh(encrypted32[i - 2]), ntoh(encrypted32[i - 1])]);\n this.asyncStream_.push(this.decryptChunk_(encrypted32.subarray(i, i + step), key, initVector, decrypted));\n } // invoke the done() callback when everything is finished\n\n\n this.asyncStream_.push(function () {\n // remove pkcs#7 padding from the decrypted bytes\n done(null, unpad(decrypted));\n });\n }\n /**\n * a getter for step the maximum number of bytes to process at one time\n *\n * @return {Number} the value of step 32000\n */\n\n /**\n * @private\n */\n\n\n Decrypter$$1.prototype.decryptChunk_ = function decryptChunk_(encrypted, key, initVector, decrypted) {\n return function () {\n var bytes = decrypt$$1(encrypted, key, initVector);\n decrypted.set(bytes, encrypted.byteOffset);\n };\n };\n\n createClass(Decrypter$$1, null, [{\n key: 'STEP',\n get: function get$$1() {\n // 4 * 8000;\n return 32000;\n }\n }]);\n return Decrypter$$1;\n }();\n /**\n * @file bin-utils.js\n */\n\n /**\n * Creates an object for sending to a web worker modifying properties that are TypedArrays\n * into a new object with seperated properties for the buffer, byteOffset, and byteLength.\n *\n * @param {Object} message\n * Object of properties and values to send to the web worker\n * @return {Object}\n * Modified message with TypedArray values expanded\n * @function createTransferableMessage\n */\n\n\n var createTransferableMessage = function createTransferableMessage(message) {\n var transferable = {};\n Object.keys(message).forEach(function (key) {\n var value = message[key];\n\n if (ArrayBuffer.isView(value)) {\n transferable[key] = {\n bytes: value.buffer,\n byteOffset: value.byteOffset,\n byteLength: value.byteLength\n };\n } else {\n transferable[key] = value;\n }\n });\n return transferable;\n };\n /**\n * Our web worker interface so that things can talk to aes-decrypter\n * that will be running in a web worker. the scope is passed to this by\n * webworkify.\n *\n * @param {Object} self\n * the scope for the web worker\n */\n\n\n var DecrypterWorker = function DecrypterWorker(self) {\n self.onmessage = function (event) {\n var data = event.data;\n var encrypted = new Uint8Array(data.encrypted.bytes, data.encrypted.byteOffset, data.encrypted.byteLength);\n var key = new Uint32Array(data.key.bytes, data.key.byteOffset, data.key.byteLength / 4);\n var iv = new Uint32Array(data.iv.bytes, data.iv.byteOffset, data.iv.byteLength / 4);\n /* eslint-disable no-new, handle-callback-err */\n\n new Decrypter$$1(encrypted, key, iv, function (err, bytes) {\n self.postMessage(createTransferableMessage({\n source: data.source,\n decrypted: bytes\n }), [bytes.buffer]);\n });\n /* eslint-enable */\n };\n };\n\n var decrypterWorker = new DecrypterWorker(self);\n return decrypterWorker;\n }();\n});\n/**\n * Convert the properties of an HLS track into an audioTrackKind.\n *\n * @private\n */\n\nvar audioTrackKind_ = function audioTrackKind_(properties) {\n var kind = properties.default ? 'main' : 'alternative';\n\n if (properties.characteristics && properties.characteristics.indexOf('public.accessibility.describes-video') >= 0) {\n kind = 'main-desc';\n }\n\n return kind;\n};\n/**\n * Pause provided segment loader and playlist loader if active\n *\n * @param {SegmentLoader} segmentLoader\n * SegmentLoader to pause\n * @param {Object} mediaType\n * Active media type\n * @function stopLoaders\n */\n\n\nvar stopLoaders = function stopLoaders(segmentLoader, mediaType) {\n segmentLoader.abort();\n segmentLoader.pause();\n\n if (mediaType && mediaType.activePlaylistLoader) {\n mediaType.activePlaylistLoader.pause();\n mediaType.activePlaylistLoader = null;\n }\n};\n/**\n * Start loading provided segment loader and playlist loader\n *\n * @param {PlaylistLoader} playlistLoader\n * PlaylistLoader to start loading\n * @param {Object} mediaType\n * Active media type\n * @function startLoaders\n */\n\n\nvar startLoaders = function startLoaders(playlistLoader, mediaType) {\n // Segment loader will be started after `loadedmetadata` or `loadedplaylist` from the\n // playlist loader\n mediaType.activePlaylistLoader = playlistLoader;\n playlistLoader.load();\n};\n/**\n * Returns a function to be called when the media group changes. It performs a\n * non-destructive (preserve the buffer) resync of the SegmentLoader. This is because a\n * change of group is merely a rendition switch of the same content at another encoding,\n * rather than a change of content, such as switching audio from English to Spanish.\n *\n * @param {String} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @return {Function}\n * Handler for a non-destructive resync of SegmentLoader when the active media\n * group changes.\n * @function onGroupChanged\n */\n\n\nvar onGroupChanged = function onGroupChanged(type, settings) {\n return function () {\n var _settings$segmentLoad = settings.segmentLoaders,\n segmentLoader = _settings$segmentLoad[type],\n mainSegmentLoader = _settings$segmentLoad.main,\n mediaType = settings.mediaTypes[type];\n var activeTrack = mediaType.activeTrack();\n var activeGroup = mediaType.activeGroup(activeTrack);\n var previousActiveLoader = mediaType.activePlaylistLoader;\n stopLoaders(segmentLoader, mediaType);\n\n if (!activeGroup) {\n // there is no group active\n return;\n }\n\n if (!activeGroup.playlistLoader) {\n if (previousActiveLoader) {\n // The previous group had a playlist loader but the new active group does not\n // this means we are switching from demuxed to muxed audio. In this case we want to\n // do a destructive reset of the main segment loader and not restart the audio\n // loaders.\n mainSegmentLoader.resetEverything();\n }\n\n return;\n } // Non-destructive resync\n\n\n segmentLoader.resyncLoader();\n startLoaders(activeGroup.playlistLoader, mediaType);\n };\n};\n/**\n * Returns a function to be called when the media track changes. It performs a\n * destructive reset of the SegmentLoader to ensure we start loading as close to\n * currentTime as possible.\n *\n * @param {String} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @return {Function}\n * Handler for a destructive reset of SegmentLoader when the active media\n * track changes.\n * @function onTrackChanged\n */\n\n\nvar onTrackChanged = function onTrackChanged(type, settings) {\n return function () {\n var _settings$segmentLoad2 = settings.segmentLoaders,\n segmentLoader = _settings$segmentLoad2[type],\n mainSegmentLoader = _settings$segmentLoad2.main,\n mediaType = settings.mediaTypes[type];\n var activeTrack = mediaType.activeTrack();\n var activeGroup = mediaType.activeGroup(activeTrack);\n var previousActiveLoader = mediaType.activePlaylistLoader;\n stopLoaders(segmentLoader, mediaType);\n\n if (!activeGroup) {\n // there is no group active so we do not want to restart loaders\n return;\n }\n\n if (!activeGroup.playlistLoader) {\n // when switching from demuxed audio/video to muxed audio/video (noted by no playlist\n // loader for the audio group), we want to do a destructive reset of the main segment\n // loader and not restart the audio loaders\n mainSegmentLoader.resetEverything();\n return;\n }\n\n if (previousActiveLoader === activeGroup.playlistLoader) {\n // Nothing has actually changed. This can happen because track change events can fire\n // multiple times for a \"single\" change. One for enabling the new active track, and\n // one for disabling the track that was active\n startLoaders(activeGroup.playlistLoader, mediaType);\n return;\n }\n\n if (segmentLoader.track) {\n // For WebVTT, set the new text track in the segmentloader\n segmentLoader.track(activeTrack);\n } // destructive reset\n\n\n segmentLoader.resetEverything();\n startLoaders(activeGroup.playlistLoader, mediaType);\n };\n};\n\nvar onError = {\n /**\n * Returns a function to be called when a SegmentLoader or PlaylistLoader encounters\n * an error.\n *\n * @param {String} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @return {Function}\n * Error handler. Logs warning (or error if the playlist is blacklisted) to\n * console and switches back to default audio track.\n * @function onError.AUDIO\n */\n AUDIO: function AUDIO(type, settings) {\n return function () {\n var segmentLoader = settings.segmentLoaders[type],\n mediaType = settings.mediaTypes[type],\n blacklistCurrentPlaylist = settings.blacklistCurrentPlaylist;\n stopLoaders(segmentLoader, mediaType); // switch back to default audio track\n\n var activeTrack = mediaType.activeTrack();\n var activeGroup = mediaType.activeGroup();\n var id = (activeGroup.filter(function (group) {\n return group.default;\n })[0] || activeGroup[0]).id;\n var defaultTrack = mediaType.tracks[id];\n\n if (activeTrack === defaultTrack) {\n // Default track encountered an error. All we can do now is blacklist the current\n // rendition and hope another will switch audio groups\n blacklistCurrentPlaylist({\n message: 'Problem encountered loading the default audio track.'\n });\n return;\n }\n\n videojs$1.log.warn('Problem encountered loading the alternate audio track.' + 'Switching back to default.');\n\n for (var trackId in mediaType.tracks) {\n mediaType.tracks[trackId].enabled = mediaType.tracks[trackId] === defaultTrack;\n }\n\n mediaType.onTrackChanged();\n };\n },\n\n /**\n * Returns a function to be called when a SegmentLoader or PlaylistLoader encounters\n * an error.\n *\n * @param {String} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @return {Function}\n * Error handler. Logs warning to console and disables the active subtitle track\n * @function onError.SUBTITLES\n */\n SUBTITLES: function SUBTITLES(type, settings) {\n return function () {\n var segmentLoader = settings.segmentLoaders[type],\n mediaType = settings.mediaTypes[type];\n videojs$1.log.warn('Problem encountered loading the subtitle track.' + 'Disabling subtitle track.');\n stopLoaders(segmentLoader, mediaType);\n var track = mediaType.activeTrack();\n\n if (track) {\n track.mode = 'disabled';\n }\n\n mediaType.onTrackChanged();\n };\n }\n};\nvar setupListeners = {\n /**\n * Setup event listeners for audio playlist loader\n *\n * @param {String} type\n * MediaGroup type\n * @param {PlaylistLoader|null} playlistLoader\n * PlaylistLoader to register listeners on\n * @param {Object} settings\n * Object containing required information for media groups\n * @function setupListeners.AUDIO\n */\n AUDIO: function AUDIO(type, playlistLoader, settings) {\n if (!playlistLoader) {\n // no playlist loader means audio will be muxed with the video\n return;\n }\n\n var tech = settings.tech,\n requestOptions = settings.requestOptions,\n segmentLoader = settings.segmentLoaders[type];\n playlistLoader.on('loadedmetadata', function () {\n var media = playlistLoader.media();\n segmentLoader.playlist(media, requestOptions); // if the video is already playing, or if this isn't a live video and preload\n // permits, start downloading segments\n\n if (!tech.paused() || media.endList && tech.preload() !== 'none') {\n segmentLoader.load();\n }\n });\n playlistLoader.on('loadedplaylist', function () {\n segmentLoader.playlist(playlistLoader.media(), requestOptions); // If the player isn't paused, ensure that the segment loader is running\n\n if (!tech.paused()) {\n segmentLoader.load();\n }\n });\n playlistLoader.on('error', onError[type](type, settings));\n },\n\n /**\n * Setup event listeners for subtitle playlist loader\n *\n * @param {String} type\n * MediaGroup type\n * @param {PlaylistLoader|null} playlistLoader\n * PlaylistLoader to register listeners on\n * @param {Object} settings\n * Object containing required information for media groups\n * @function setupListeners.SUBTITLES\n */\n SUBTITLES: function SUBTITLES(type, playlistLoader, settings) {\n var tech = settings.tech,\n requestOptions = settings.requestOptions,\n segmentLoader = settings.segmentLoaders[type],\n mediaType = settings.mediaTypes[type];\n playlistLoader.on('loadedmetadata', function () {\n var media = playlistLoader.media();\n segmentLoader.playlist(media, requestOptions);\n segmentLoader.track(mediaType.activeTrack()); // if the video is already playing, or if this isn't a live video and preload\n // permits, start downloading segments\n\n if (!tech.paused() || media.endList && tech.preload() !== 'none') {\n segmentLoader.load();\n }\n });\n playlistLoader.on('loadedplaylist', function () {\n segmentLoader.playlist(playlistLoader.media(), requestOptions); // If the player isn't paused, ensure that the segment loader is running\n\n if (!tech.paused()) {\n segmentLoader.load();\n }\n });\n playlistLoader.on('error', onError[type](type, settings));\n }\n};\n\nvar byGroupId = function byGroupId(type, groupId) {\n return function (playlist) {\n return playlist.attributes[type] === groupId;\n };\n};\n\nvar byResolvedUri = function byResolvedUri(resolvedUri) {\n return function (playlist) {\n return playlist.resolvedUri === resolvedUri;\n };\n};\n\nvar initialize = {\n /**\n * Setup PlaylistLoaders and AudioTracks for the audio groups\n *\n * @param {String} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @function initialize.AUDIO\n */\n 'AUDIO': function AUDIO(type, settings) {\n var hls = settings.hls,\n sourceType = settings.sourceType,\n segmentLoader = settings.segmentLoaders[type],\n withCredentials = settings.requestOptions.withCredentials,\n _settings$master = settings.master,\n mediaGroups = _settings$master.mediaGroups,\n playlists = _settings$master.playlists,\n _settings$mediaTypes$ = settings.mediaTypes[type],\n groups = _settings$mediaTypes$.groups,\n tracks = _settings$mediaTypes$.tracks,\n masterPlaylistLoader = settings.masterPlaylistLoader; // force a default if we have none\n\n if (!mediaGroups[type] || Object.keys(mediaGroups[type]).length === 0) {\n mediaGroups[type] = {\n main: {\n default: {\n default: true\n }\n }\n };\n }\n\n for (var groupId in mediaGroups[type]) {\n if (!groups[groupId]) {\n groups[groupId] = [];\n } // List of playlists that have an AUDIO attribute value matching the current\n // group ID\n\n\n var groupPlaylists = playlists.filter(byGroupId(type, groupId));\n\n for (var variantLabel in mediaGroups[type][groupId]) {\n var properties = mediaGroups[type][groupId][variantLabel]; // List of playlists for the current group ID that have a matching uri with\n // this alternate audio variant\n\n var matchingPlaylists = groupPlaylists.filter(byResolvedUri(properties.resolvedUri));\n\n if (matchingPlaylists.length) {\n // If there is a playlist that has the same uri as this audio variant, assume\n // that the playlist is audio only. We delete the resolvedUri property here\n // to prevent a playlist loader from being created so that we don't have\n // both the main and audio segment loaders loading the same audio segments\n // from the same playlist.\n delete properties.resolvedUri;\n }\n\n var playlistLoader = void 0;\n\n if (properties.resolvedUri) {\n playlistLoader = new PlaylistLoader(properties.resolvedUri, hls, withCredentials);\n } else if (properties.playlists && sourceType === 'dash') {\n playlistLoader = new DashPlaylistLoader(properties.playlists[0], hls, withCredentials, masterPlaylistLoader);\n } else {\n // no resolvedUri means the audio is muxed with the video when using this\n // audio track\n playlistLoader = null;\n }\n\n properties = videojs$1.mergeOptions({\n id: variantLabel,\n playlistLoader: playlistLoader\n }, properties);\n setupListeners[type](type, properties.playlistLoader, settings);\n groups[groupId].push(properties);\n\n if (typeof tracks[variantLabel] === 'undefined') {\n var track = new videojs$1.AudioTrack({\n id: variantLabel,\n kind: audioTrackKind_(properties),\n enabled: false,\n language: properties.language,\n default: properties.default,\n label: variantLabel\n });\n tracks[variantLabel] = track;\n }\n }\n } // setup single error event handler for the segment loader\n\n\n segmentLoader.on('error', onError[type](type, settings));\n },\n\n /**\n * Setup PlaylistLoaders and TextTracks for the subtitle groups\n *\n * @param {String} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @function initialize.SUBTITLES\n */\n 'SUBTITLES': function SUBTITLES(type, settings) {\n var tech = settings.tech,\n hls = settings.hls,\n sourceType = settings.sourceType,\n segmentLoader = settings.segmentLoaders[type],\n withCredentials = settings.requestOptions.withCredentials,\n mediaGroups = settings.master.mediaGroups,\n _settings$mediaTypes$2 = settings.mediaTypes[type],\n groups = _settings$mediaTypes$2.groups,\n tracks = _settings$mediaTypes$2.tracks,\n masterPlaylistLoader = settings.masterPlaylistLoader;\n\n for (var groupId in mediaGroups[type]) {\n if (!groups[groupId]) {\n groups[groupId] = [];\n }\n\n for (var variantLabel in mediaGroups[type][groupId]) {\n if (mediaGroups[type][groupId][variantLabel].forced) {\n // Subtitle playlists with the forced attribute are not selectable in Safari.\n // According to Apple's HLS Authoring Specification:\n // If content has forced subtitles and regular subtitles in a given language,\n // the regular subtitles track in that language MUST contain both the forced\n // subtitles and the regular subtitles for that language.\n // Because of this requirement and that Safari does not add forced subtitles,\n // forced subtitles are skipped here to maintain consistent experience across\n // all platforms\n continue;\n }\n\n var properties = mediaGroups[type][groupId][variantLabel];\n var playlistLoader = void 0;\n\n if (sourceType === 'hls') {\n playlistLoader = new PlaylistLoader(properties.resolvedUri, hls, withCredentials);\n } else if (sourceType === 'dash') {\n playlistLoader = new DashPlaylistLoader(properties.playlists[0], hls, withCredentials, masterPlaylistLoader);\n }\n\n properties = videojs$1.mergeOptions({\n id: variantLabel,\n playlistLoader: playlistLoader\n }, properties);\n setupListeners[type](type, properties.playlistLoader, settings);\n groups[groupId].push(properties);\n\n if (typeof tracks[variantLabel] === 'undefined') {\n var track = tech.addRemoteTextTrack({\n id: variantLabel,\n kind: 'subtitles',\n default: properties.default && properties.autoselect,\n language: properties.language,\n label: variantLabel\n }, false).track;\n tracks[variantLabel] = track;\n }\n }\n } // setup single error event handler for the segment loader\n\n\n segmentLoader.on('error', onError[type](type, settings));\n },\n\n /**\n * Setup TextTracks for the closed-caption groups\n *\n * @param {String} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @function initialize['CLOSED-CAPTIONS']\n */\n 'CLOSED-CAPTIONS': function CLOSEDCAPTIONS(type, settings) {\n var tech = settings.tech,\n mediaGroups = settings.master.mediaGroups,\n _settings$mediaTypes$3 = settings.mediaTypes[type],\n groups = _settings$mediaTypes$3.groups,\n tracks = _settings$mediaTypes$3.tracks;\n\n for (var groupId in mediaGroups[type]) {\n if (!groups[groupId]) {\n groups[groupId] = [];\n }\n\n for (var variantLabel in mediaGroups[type][groupId]) {\n var properties = mediaGroups[type][groupId][variantLabel]; // We only support CEA608 captions for now, so ignore anything that\n // doesn't use a CCx INSTREAM-ID\n\n if (!properties.instreamId.match(/CC\\d/)) {\n continue;\n } // No PlaylistLoader is required for Closed-Captions because the captions are\n // embedded within the video stream\n\n\n groups[groupId].push(videojs$1.mergeOptions({\n id: variantLabel\n }, properties));\n\n if (typeof tracks[variantLabel] === 'undefined') {\n var track = tech.addRemoteTextTrack({\n id: properties.instreamId,\n kind: 'captions',\n default: properties.default && properties.autoselect,\n language: properties.language,\n label: variantLabel\n }, false).track;\n tracks[variantLabel] = track;\n }\n }\n }\n }\n};\n/**\n * Returns a function used to get the active group of the provided type\n *\n * @param {String} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @return {Function}\n * Function that returns the active media group for the provided type. Takes an\n * optional parameter {TextTrack} track. If no track is provided, a list of all\n * variants in the group, otherwise the variant corresponding to the provided\n * track is returned.\n * @function activeGroup\n */\n\nvar activeGroup = function activeGroup(type, settings) {\n return function (track) {\n var masterPlaylistLoader = settings.masterPlaylistLoader,\n groups = settings.mediaTypes[type].groups;\n var media = masterPlaylistLoader.media();\n\n if (!media) {\n return null;\n }\n\n var variants = null;\n\n if (media.attributes[type]) {\n variants = groups[media.attributes[type]];\n }\n\n variants = variants || groups.main;\n\n if (typeof track === 'undefined') {\n return variants;\n }\n\n if (track === null) {\n // An active track was specified so a corresponding group is expected. track === null\n // means no track is currently active so there is no corresponding group\n return null;\n }\n\n return variants.filter(function (props) {\n return props.id === track.id;\n })[0] || null;\n };\n};\n\nvar activeTrack = {\n /**\n * Returns a function used to get the active track of type provided\n *\n * @param {String} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @return {Function}\n * Function that returns the active media track for the provided type. Returns\n * null if no track is active\n * @function activeTrack.AUDIO\n */\n AUDIO: function AUDIO(type, settings) {\n return function () {\n var tracks = settings.mediaTypes[type].tracks;\n\n for (var id in tracks) {\n if (tracks[id].enabled) {\n return tracks[id];\n }\n }\n\n return null;\n };\n },\n\n /**\n * Returns a function used to get the active track of type provided\n *\n * @param {String} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @return {Function}\n * Function that returns the active media track for the provided type. Returns\n * null if no track is active\n * @function activeTrack.SUBTITLES\n */\n SUBTITLES: function SUBTITLES(type, settings) {\n return function () {\n var tracks = settings.mediaTypes[type].tracks;\n\n for (var id in tracks) {\n if (tracks[id].mode === 'showing') {\n return tracks[id];\n }\n }\n\n return null;\n };\n }\n};\n/**\n * Setup PlaylistLoaders and Tracks for media groups (Audio, Subtitles,\n * Closed-Captions) specified in the master manifest.\n *\n * @param {Object} settings\n * Object containing required information for setting up the media groups\n * @param {SegmentLoader} settings.segmentLoaders.AUDIO\n * Audio segment loader\n * @param {SegmentLoader} settings.segmentLoaders.SUBTITLES\n * Subtitle segment loader\n * @param {SegmentLoader} settings.segmentLoaders.main\n * Main segment loader\n * @param {Tech} settings.tech\n * The tech of the player\n * @param {Object} settings.requestOptions\n * XHR request options used by the segment loaders\n * @param {PlaylistLoader} settings.masterPlaylistLoader\n * PlaylistLoader for the master source\n * @param {HlsHandler} settings.hls\n * HLS SourceHandler\n * @param {Object} settings.master\n * The parsed master manifest\n * @param {Object} settings.mediaTypes\n * Object to store the loaders, tracks, and utility methods for each media type\n * @param {Function} settings.blacklistCurrentPlaylist\n * Blacklists the current rendition and forces a rendition switch.\n * @function setupMediaGroups\n */\n\nvar setupMediaGroups = function setupMediaGroups(settings) {\n ['AUDIO', 'SUBTITLES', 'CLOSED-CAPTIONS'].forEach(function (type) {\n initialize[type](type, settings);\n });\n var mediaTypes = settings.mediaTypes,\n masterPlaylistLoader = settings.masterPlaylistLoader,\n tech = settings.tech,\n hls = settings.hls; // setup active group and track getters and change event handlers\n\n ['AUDIO', 'SUBTITLES'].forEach(function (type) {\n mediaTypes[type].activeGroup = activeGroup(type, settings);\n mediaTypes[type].activeTrack = activeTrack[type](type, settings);\n mediaTypes[type].onGroupChanged = onGroupChanged(type, settings);\n mediaTypes[type].onTrackChanged = onTrackChanged(type, settings);\n }); // DO NOT enable the default subtitle or caption track.\n // DO enable the default audio track\n\n var audioGroup = mediaTypes.AUDIO.activeGroup();\n var groupId = (audioGroup.filter(function (group) {\n return group.default;\n })[0] || audioGroup[0]).id;\n mediaTypes.AUDIO.tracks[groupId].enabled = true;\n mediaTypes.AUDIO.onTrackChanged();\n masterPlaylistLoader.on('mediachange', function () {\n ['AUDIO', 'SUBTITLES'].forEach(function (type) {\n return mediaTypes[type].onGroupChanged();\n });\n }); // custom audio track change event handler for usage event\n\n var onAudioTrackChanged = function onAudioTrackChanged() {\n mediaTypes.AUDIO.onTrackChanged();\n tech.trigger({\n type: 'usage',\n name: 'hls-audio-change'\n });\n };\n\n tech.audioTracks().addEventListener('change', onAudioTrackChanged);\n tech.remoteTextTracks().addEventListener('change', mediaTypes.SUBTITLES.onTrackChanged);\n hls.on('dispose', function () {\n tech.audioTracks().removeEventListener('change', onAudioTrackChanged);\n tech.remoteTextTracks().removeEventListener('change', mediaTypes.SUBTITLES.onTrackChanged);\n }); // clear existing audio tracks and add the ones we just created\n\n tech.clearTracks('audio');\n\n for (var id in mediaTypes.AUDIO.tracks) {\n tech.audioTracks().addTrack(mediaTypes.AUDIO.tracks[id]);\n }\n};\n/**\n * Creates skeleton object used to store the loaders, tracks, and utility methods for each\n * media type\n *\n * @return {Object}\n * Object to store the loaders, tracks, and utility methods for each media type\n * @function createMediaTypes\n */\n\n\nvar createMediaTypes = function createMediaTypes() {\n var mediaTypes = {};\n ['AUDIO', 'SUBTITLES', 'CLOSED-CAPTIONS'].forEach(function (type) {\n mediaTypes[type] = {\n groups: {},\n tracks: {},\n activePlaylistLoader: null,\n activeGroup: noop,\n activeTrack: noop,\n onGroupChanged: noop,\n onTrackChanged: noop\n };\n });\n return mediaTypes;\n};\n/**\n * @file master-playlist-controller.js\n */\n\n\nvar ABORT_EARLY_BLACKLIST_SECONDS = 60 * 2;\nvar Hls = void 0; // SegmentLoader stats that need to have each loader's\n// values summed to calculate the final value\n\nvar loaderStats = ['mediaRequests', 'mediaRequestsAborted', 'mediaRequestsTimedout', 'mediaRequestsErrored', 'mediaTransferDuration', 'mediaBytesTransferred'];\n\nvar sumLoaderStat = function sumLoaderStat(stat) {\n return this.audioSegmentLoader_[stat] + this.mainSegmentLoader_[stat];\n};\n/**\n * the master playlist controller controller all interactons\n * between playlists and segmentloaders. At this time this mainly\n * involves a master playlist and a series of audio playlists\n * if they are available\n *\n * @class MasterPlaylistController\n * @extends videojs.EventTarget\n */\n\n\nvar MasterPlaylistController = function (_videojs$EventTarget) {\n inherits(MasterPlaylistController, _videojs$EventTarget);\n\n function MasterPlaylistController(options) {\n classCallCheck(this, MasterPlaylistController);\n\n var _this = possibleConstructorReturn(this, (MasterPlaylistController.__proto__ || Object.getPrototypeOf(MasterPlaylistController)).call(this));\n\n var url = options.url,\n withCredentials = options.withCredentials,\n tech = options.tech,\n bandwidth = options.bandwidth,\n externHls = options.externHls,\n useCueTags = options.useCueTags,\n blacklistDuration = options.blacklistDuration,\n enableLowInitialPlaylist = options.enableLowInitialPlaylist,\n sourceType = options.sourceType,\n seekTo = options.seekTo;\n\n if (!url) {\n throw new Error('A non-empty playlist URL is required');\n }\n\n Hls = externHls;\n _this.withCredentials = withCredentials;\n _this.tech_ = tech;\n _this.hls_ = tech.hls;\n _this.seekTo_ = seekTo;\n _this.sourceType_ = sourceType;\n _this.useCueTags_ = useCueTags;\n _this.blacklistDuration = blacklistDuration;\n _this.enableLowInitialPlaylist = enableLowInitialPlaylist;\n\n if (_this.useCueTags_) {\n _this.cueTagsTrack_ = _this.tech_.addTextTrack('metadata', 'ad-cues');\n _this.cueTagsTrack_.inBandMetadataTrackDispatchType = '';\n }\n\n _this.requestOptions_ = {\n withCredentials: _this.withCredentials,\n timeout: null\n };\n _this.mediaTypes_ = createMediaTypes();\n _this.mediaSource = new videojs$1.MediaSource(); // load the media source into the player\n\n _this.mediaSource.addEventListener('sourceopen', _this.handleSourceOpen_.bind(_this));\n\n _this.seekable_ = videojs$1.createTimeRanges();\n\n _this.hasPlayed_ = function () {\n return false;\n };\n\n _this.syncController_ = new SyncController(options);\n _this.segmentMetadataTrack_ = tech.addRemoteTextTrack({\n kind: 'metadata',\n label: 'segment-metadata'\n }, false).track;\n _this.decrypter_ = new Decrypter$1();\n _this.inbandTextTracks_ = {};\n var segmentLoaderSettings = {\n hls: _this.hls_,\n mediaSource: _this.mediaSource,\n currentTime: _this.tech_.currentTime.bind(_this.tech_),\n seekable: function seekable$$1() {\n return _this.seekable();\n },\n seeking: function seeking() {\n return _this.tech_.seeking();\n },\n duration: function duration$$1() {\n return _this.mediaSource.duration;\n },\n hasPlayed: function hasPlayed() {\n return _this.hasPlayed_();\n },\n goalBufferLength: function goalBufferLength() {\n return _this.goalBufferLength();\n },\n bandwidth: bandwidth,\n syncController: _this.syncController_,\n decrypter: _this.decrypter_,\n sourceType: _this.sourceType_,\n inbandTextTracks: _this.inbandTextTracks_\n };\n _this.masterPlaylistLoader_ = _this.sourceType_ === 'dash' ? new DashPlaylistLoader(url, _this.hls_, _this.withCredentials) : new PlaylistLoader(url, _this.hls_, _this.withCredentials);\n\n _this.setupMasterPlaylistLoaderListeners_(); // setup segment loaders\n // combined audio/video or just video when alternate audio track is selected\n\n\n _this.mainSegmentLoader_ = new SegmentLoader(videojs$1.mergeOptions(segmentLoaderSettings, {\n segmentMetadataTrack: _this.segmentMetadataTrack_,\n loaderType: 'main'\n }), options); // alternate audio track\n\n _this.audioSegmentLoader_ = new SegmentLoader(videojs$1.mergeOptions(segmentLoaderSettings, {\n loaderType: 'audio'\n }), options);\n _this.subtitleSegmentLoader_ = new VTTSegmentLoader(videojs$1.mergeOptions(segmentLoaderSettings, {\n loaderType: 'vtt'\n }), options);\n\n _this.setupSegmentLoaderListeners_(); // Create SegmentLoader stat-getters\n\n\n loaderStats.forEach(function (stat) {\n _this[stat + '_'] = sumLoaderStat.bind(_this, stat);\n });\n _this.logger_ = logger('MPC');\n\n _this.masterPlaylistLoader_.load();\n\n return _this;\n }\n /**\n * Register event handlers on the master playlist loader. A helper\n * function for construction time.\n *\n * @private\n */\n\n\n createClass(MasterPlaylistController, [{\n key: 'setupMasterPlaylistLoaderListeners_',\n value: function setupMasterPlaylistLoaderListeners_() {\n var _this2 = this;\n\n this.masterPlaylistLoader_.on('loadedmetadata', function () {\n var media = _this2.masterPlaylistLoader_.media();\n\n var requestTimeout = _this2.masterPlaylistLoader_.targetDuration * 1.5 * 1000; // If we don't have any more available playlists, we don't want to\n // timeout the request.\n\n if (isLowestEnabledRendition(_this2.masterPlaylistLoader_.master, _this2.masterPlaylistLoader_.media())) {\n _this2.requestOptions_.timeout = 0;\n } else {\n _this2.requestOptions_.timeout = requestTimeout;\n } // if this isn't a live video and preload permits, start\n // downloading segments\n\n\n if (media.endList && _this2.tech_.preload() !== 'none') {\n _this2.mainSegmentLoader_.playlist(media, _this2.requestOptions_);\n\n _this2.mainSegmentLoader_.load();\n }\n\n setupMediaGroups({\n sourceType: _this2.sourceType_,\n segmentLoaders: {\n AUDIO: _this2.audioSegmentLoader_,\n SUBTITLES: _this2.subtitleSegmentLoader_,\n main: _this2.mainSegmentLoader_\n },\n tech: _this2.tech_,\n requestOptions: _this2.requestOptions_,\n masterPlaylistLoader: _this2.masterPlaylistLoader_,\n hls: _this2.hls_,\n master: _this2.master(),\n mediaTypes: _this2.mediaTypes_,\n blacklistCurrentPlaylist: _this2.blacklistCurrentPlaylist.bind(_this2)\n });\n\n _this2.triggerPresenceUsage_(_this2.master(), media);\n\n try {\n _this2.setupSourceBuffers_();\n } catch (e) {\n videojs$1.log.warn('Failed to create SourceBuffers', e);\n return _this2.mediaSource.endOfStream('decode');\n }\n\n _this2.setupFirstPlay();\n\n _this2.trigger('selectedinitialmedia');\n });\n this.masterPlaylistLoader_.on('loadedplaylist', function () {\n var updatedPlaylist = _this2.masterPlaylistLoader_.media();\n\n if (!updatedPlaylist) {\n // blacklist any variants that are not supported by the browser before selecting\n // an initial media as the playlist selectors do not consider browser support\n _this2.excludeUnsupportedVariants_();\n\n var selectedMedia = void 0;\n\n if (_this2.enableLowInitialPlaylist) {\n selectedMedia = _this2.selectInitialPlaylist();\n }\n\n if (!selectedMedia) {\n selectedMedia = _this2.selectPlaylist();\n }\n\n _this2.initialMedia_ = selectedMedia;\n\n _this2.masterPlaylistLoader_.media(_this2.initialMedia_);\n\n return;\n }\n\n if (_this2.useCueTags_) {\n _this2.updateAdCues_(updatedPlaylist);\n } // TODO: Create a new event on the PlaylistLoader that signals\n // that the segments have changed in some way and use that to\n // update the SegmentLoader instead of doing it twice here and\n // on `mediachange`\n\n\n _this2.mainSegmentLoader_.playlist(updatedPlaylist, _this2.requestOptions_);\n\n _this2.updateDuration(); // If the player isn't paused, ensure that the segment loader is running,\n // as it is possible that it was temporarily stopped while waiting for\n // a playlist (e.g., in case the playlist errored and we re-requested it).\n\n\n if (!_this2.tech_.paused()) {\n _this2.mainSegmentLoader_.load();\n\n if (_this2.audioSegmentLoader_) {\n _this2.audioSegmentLoader_.load();\n }\n }\n\n if (!updatedPlaylist.endList) {\n var addSeekableRange = function addSeekableRange() {\n var seekable$$1 = _this2.seekable();\n\n if (seekable$$1.length !== 0) {\n _this2.mediaSource.addSeekableRange_(seekable$$1.start(0), seekable$$1.end(0));\n }\n };\n\n if (_this2.duration() !== Infinity) {\n var onDurationchange = function onDurationchange() {\n if (_this2.duration() === Infinity) {\n addSeekableRange();\n } else {\n _this2.tech_.one('durationchange', onDurationchange);\n }\n };\n\n _this2.tech_.one('durationchange', onDurationchange);\n } else {\n addSeekableRange();\n }\n }\n });\n this.masterPlaylistLoader_.on('error', function () {\n _this2.blacklistCurrentPlaylist(_this2.masterPlaylistLoader_.error);\n });\n this.masterPlaylistLoader_.on('mediachanging', function () {\n _this2.mainSegmentLoader_.abort();\n\n _this2.mainSegmentLoader_.pause();\n });\n this.masterPlaylistLoader_.on('mediachange', function () {\n var media = _this2.masterPlaylistLoader_.media();\n\n var requestTimeout = _this2.masterPlaylistLoader_.targetDuration * 1.5 * 1000; // If we don't have any more available playlists, we don't want to\n // timeout the request.\n\n if (isLowestEnabledRendition(_this2.masterPlaylistLoader_.master, _this2.masterPlaylistLoader_.media())) {\n _this2.requestOptions_.timeout = 0;\n } else {\n _this2.requestOptions_.timeout = requestTimeout;\n } // TODO: Create a new event on the PlaylistLoader that signals\n // that the segments have changed in some way and use that to\n // update the SegmentLoader instead of doing it twice here and\n // on `loadedplaylist`\n\n\n _this2.mainSegmentLoader_.playlist(media, _this2.requestOptions_);\n\n _this2.mainSegmentLoader_.load();\n\n _this2.tech_.trigger({\n type: 'mediachange',\n bubbles: true\n });\n });\n this.masterPlaylistLoader_.on('playlistunchanged', function () {\n var updatedPlaylist = _this2.masterPlaylistLoader_.media();\n\n var playlistOutdated = _this2.stuckAtPlaylistEnd_(updatedPlaylist);\n\n if (playlistOutdated) {\n // Playlist has stopped updating and we're stuck at its end. Try to\n // blacklist it and switch to another playlist in the hope that that\n // one is updating (and give the player a chance to re-adjust to the\n // safe live point).\n _this2.blacklistCurrentPlaylist({\n message: 'Playlist no longer updating.'\n }); // useful for monitoring QoS\n\n\n _this2.tech_.trigger('playliststuck');\n }\n });\n this.masterPlaylistLoader_.on('renditiondisabled', function () {\n _this2.tech_.trigger({\n type: 'usage',\n name: 'hls-rendition-disabled'\n });\n });\n this.masterPlaylistLoader_.on('renditionenabled', function () {\n _this2.tech_.trigger({\n type: 'usage',\n name: 'hls-rendition-enabled'\n });\n });\n }\n /**\n * A helper function for triggerring presence usage events once per source\n *\n * @private\n */\n\n }, {\n key: 'triggerPresenceUsage_',\n value: function triggerPresenceUsage_(master, media) {\n var mediaGroups = master.mediaGroups || {};\n var defaultDemuxed = true;\n var audioGroupKeys = Object.keys(mediaGroups.AUDIO);\n\n for (var mediaGroup in mediaGroups.AUDIO) {\n for (var label in mediaGroups.AUDIO[mediaGroup]) {\n var properties = mediaGroups.AUDIO[mediaGroup][label];\n\n if (!properties.uri) {\n defaultDemuxed = false;\n }\n }\n }\n\n if (defaultDemuxed) {\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-demuxed'\n });\n }\n\n if (Object.keys(mediaGroups.SUBTITLES).length) {\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-webvtt'\n });\n }\n\n if (Hls.Playlist.isAes(media)) {\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-aes'\n });\n }\n\n if (Hls.Playlist.isFmp4(media)) {\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-fmp4'\n });\n }\n\n if (audioGroupKeys.length && Object.keys(mediaGroups.AUDIO[audioGroupKeys[0]]).length > 1) {\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-alternate-audio'\n });\n }\n\n if (this.useCueTags_) {\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-playlist-cue-tags'\n });\n }\n }\n /**\n * Register event handlers on the segment loaders. A helper function\n * for construction time.\n *\n * @private\n */\n\n }, {\n key: 'setupSegmentLoaderListeners_',\n value: function setupSegmentLoaderListeners_() {\n var _this3 = this;\n\n this.mainSegmentLoader_.on('bandwidthupdate', function () {\n var nextPlaylist = _this3.selectPlaylist();\n\n var currentPlaylist = _this3.masterPlaylistLoader_.media();\n\n var buffered = _this3.tech_.buffered();\n\n var forwardBuffer = buffered.length ? buffered.end(buffered.length - 1) - _this3.tech_.currentTime() : 0;\n\n var bufferLowWaterLine = _this3.bufferLowWaterLine(); // If the playlist is live, then we want to not take low water line into account.\n // This is because in LIVE, the player plays 3 segments from the end of the\n // playlist, and if `BUFFER_LOW_WATER_LINE` is greater than the duration availble\n // in those segments, a viewer will never experience a rendition upswitch.\n\n\n if (!currentPlaylist.endList || // For the same reason as LIVE, we ignore the low water line when the VOD\n // duration is below the max potential low water line\n _this3.duration() < Config.MAX_BUFFER_LOW_WATER_LINE || // we want to switch down to lower resolutions quickly to continue playback, but\n nextPlaylist.attributes.BANDWIDTH < currentPlaylist.attributes.BANDWIDTH || // ensure we have some buffer before we switch up to prevent us running out of\n // buffer while loading a higher rendition.\n forwardBuffer >= bufferLowWaterLine) {\n _this3.masterPlaylistLoader_.media(nextPlaylist);\n }\n\n _this3.tech_.trigger('bandwidthupdate');\n });\n this.mainSegmentLoader_.on('progress', function () {\n _this3.trigger('progress');\n });\n this.mainSegmentLoader_.on('error', function () {\n _this3.blacklistCurrentPlaylist(_this3.mainSegmentLoader_.error());\n });\n this.mainSegmentLoader_.on('syncinfoupdate', function () {\n _this3.onSyncInfoUpdate_();\n });\n this.mainSegmentLoader_.on('timestampoffset', function () {\n _this3.tech_.trigger({\n type: 'usage',\n name: 'hls-timestamp-offset'\n });\n });\n this.audioSegmentLoader_.on('syncinfoupdate', function () {\n _this3.onSyncInfoUpdate_();\n });\n this.mainSegmentLoader_.on('ended', function () {\n _this3.onEndOfStream();\n });\n this.mainSegmentLoader_.on('earlyabort', function () {\n _this3.blacklistCurrentPlaylist({\n message: 'Aborted early because there isn\\'t enough bandwidth to complete the ' + 'request without rebuffering.'\n }, ABORT_EARLY_BLACKLIST_SECONDS);\n });\n this.mainSegmentLoader_.on('reseteverything', function () {\n // If playing an MTS stream, a videojs.MediaSource is listening for\n // hls-reset to reset caption parsing state in the transmuxer\n _this3.tech_.trigger('hls-reset');\n });\n this.mainSegmentLoader_.on('segmenttimemapping', function (event) {\n // If playing an MTS stream in html, a videojs.MediaSource is listening for\n // hls-segment-time-mapping update its internal mapping of stream to display time\n _this3.tech_.trigger({\n type: 'hls-segment-time-mapping',\n mapping: event.mapping\n });\n });\n this.audioSegmentLoader_.on('ended', function () {\n _this3.onEndOfStream();\n });\n }\n }, {\n key: 'mediaSecondsLoaded_',\n value: function mediaSecondsLoaded_() {\n return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded + this.mainSegmentLoader_.mediaSecondsLoaded);\n }\n /**\n * Call load on our SegmentLoaders\n */\n\n }, {\n key: 'load',\n value: function load() {\n this.mainSegmentLoader_.load();\n\n if (this.mediaTypes_.AUDIO.activePlaylistLoader) {\n this.audioSegmentLoader_.load();\n }\n\n if (this.mediaTypes_.SUBTITLES.activePlaylistLoader) {\n this.subtitleSegmentLoader_.load();\n }\n }\n /**\n * Re-tune playback quality level for the current player\n * conditions without performing destructive actions, like\n * removing already buffered content\n *\n * @private\n */\n\n }, {\n key: 'smoothQualityChange_',\n value: function smoothQualityChange_() {\n var media = this.selectPlaylist();\n\n if (media !== this.masterPlaylistLoader_.media()) {\n this.masterPlaylistLoader_.media(media);\n this.mainSegmentLoader_.resetLoader(); // don't need to reset audio as it is reset when media changes\n }\n }\n /**\n * Re-tune playback quality level for the current player\n * conditions. This method will perform destructive actions like removing\n * already buffered content in order to readjust the currently active\n * playlist quickly. This is good for manual quality changes\n *\n * @private\n */\n\n }, {\n key: 'fastQualityChange_',\n value: function fastQualityChange_() {\n var _this4 = this;\n\n var media = this.selectPlaylist();\n\n if (media === this.masterPlaylistLoader_.media()) {\n return;\n }\n\n this.masterPlaylistLoader_.media(media); // Delete all buffered data to allow an immediate quality switch, then seek to give\n // the browser a kick to remove any cached frames from the previous rendtion (.04 seconds\n // ahead is roughly the minimum that will accomplish this across a variety of content\n // in IE and Edge, but seeking in place is sufficient on all other browsers)\n // Edge/IE bug: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/14600375/\n // Chrome bug: https://bugs.chromium.org/p/chromium/issues/detail?id=651904\n\n this.mainSegmentLoader_.resetEverything(function () {\n // Since this is not a typical seek, we avoid the seekTo method which can cause segments\n // from the previously enabled rendition to load before the new playlist has finished loading\n if (videojs$1.browser.IE_VERSION || videojs$1.browser.IS_EDGE) {\n _this4.tech_.setCurrentTime(_this4.tech_.currentTime() + 0.04);\n } else {\n _this4.tech_.setCurrentTime(_this4.tech_.currentTime());\n }\n }); // don't need to reset audio as it is reset when media changes\n }\n /**\n * Begin playback.\n */\n\n }, {\n key: 'play',\n value: function play() {\n if (this.setupFirstPlay()) {\n return;\n }\n\n if (this.tech_.ended()) {\n this.seekTo_(0);\n }\n\n if (this.hasPlayed_()) {\n this.load();\n }\n\n var seekable$$1 = this.tech_.seekable(); // if the viewer has paused and we fell out of the live window,\n // seek forward to the live point\n\n if (this.tech_.duration() === Infinity) {\n if (this.tech_.currentTime() < seekable$$1.start(0)) {\n return this.seekTo_(seekable$$1.end(seekable$$1.length - 1));\n }\n }\n }\n /**\n * Seek to the latest media position if this is a live video and the\n * player and video are loaded and initialized.\n */\n\n }, {\n key: 'setupFirstPlay',\n value: function setupFirstPlay() {\n var _this5 = this;\n\n var media = this.masterPlaylistLoader_.media(); // Check that everything is ready to begin buffering for the first call to play\n // If 1) there is no active media\n // 2) the player is paused\n // 3) the first play has already been setup\n // then exit early\n\n if (!media || this.tech_.paused() || this.hasPlayed_()) {\n return false;\n } // when the video is a live stream\n\n\n if (!media.endList) {\n var seekable$$1 = this.seekable();\n\n if (!seekable$$1.length) {\n // without a seekable range, the player cannot seek to begin buffering at the live\n // point\n return false;\n }\n\n if (videojs$1.browser.IE_VERSION && this.tech_.readyState() === 0) {\n // IE11 throws an InvalidStateError if you try to set currentTime while the\n // readyState is 0, so it must be delayed until the tech fires loadedmetadata.\n this.tech_.one('loadedmetadata', function () {\n _this5.trigger('firstplay');\n\n _this5.seekTo_(seekable$$1.end(0));\n\n _this5.hasPlayed_ = function () {\n return true;\n };\n });\n return false;\n } // trigger firstplay to inform the source handler to ignore the next seek event\n\n\n this.trigger('firstplay'); // seek to the live point\n\n this.seekTo_(seekable$$1.end(0));\n }\n\n this.hasPlayed_ = function () {\n return true;\n }; // we can begin loading now that everything is ready\n\n\n this.load();\n return true;\n }\n /**\n * handle the sourceopen event on the MediaSource\n *\n * @private\n */\n\n }, {\n key: 'handleSourceOpen_',\n value: function handleSourceOpen_() {\n // Only attempt to create the source buffer if none already exist.\n // handleSourceOpen is also called when we are \"re-opening\" a source buffer\n // after `endOfStream` has been called (in response to a seek for instance)\n try {\n this.setupSourceBuffers_();\n } catch (e) {\n videojs$1.log.warn('Failed to create Source Buffers', e);\n return this.mediaSource.endOfStream('decode');\n } // if autoplay is enabled, begin playback. This is duplicative of\n // code in video.js but is required because play() must be invoked\n // *after* the media source has opened.\n\n\n if (this.tech_.autoplay()) {\n var playPromise = this.tech_.play(); // Catch/silence error when a pause interrupts a play request\n // on browsers which return a promise\n\n if (typeof playPromise !== 'undefined' && typeof playPromise.then === 'function') {\n playPromise.then(null, function (e) {});\n }\n }\n\n this.trigger('sourceopen');\n }\n /**\n * Calls endOfStream on the media source when all active stream types have called\n * endOfStream\n *\n * @param {string} streamType\n * Stream type of the segment loader that called endOfStream\n * @private\n */\n\n }, {\n key: 'onEndOfStream',\n value: function onEndOfStream() {\n var isEndOfStream = this.mainSegmentLoader_.ended_;\n\n if (this.mediaTypes_.AUDIO.activePlaylistLoader) {\n // if the audio playlist loader exists, then alternate audio is active\n if (!this.mainSegmentLoader_.startingMedia_ || this.mainSegmentLoader_.startingMedia_.containsVideo) {\n // if we do not know if the main segment loader contains video yet or if we\n // definitively know the main segment loader contains video, then we need to wait\n // for both main and audio segment loaders to call endOfStream\n isEndOfStream = isEndOfStream && this.audioSegmentLoader_.ended_;\n } else {\n // otherwise just rely on the audio loader\n isEndOfStream = this.audioSegmentLoader_.ended_;\n }\n }\n\n if (isEndOfStream) {\n this.mediaSource.endOfStream();\n }\n }\n /**\n * Check if a playlist has stopped being updated\n * @param {Object} playlist the media playlist object\n * @return {boolean} whether the playlist has stopped being updated or not\n */\n\n }, {\n key: 'stuckAtPlaylistEnd_',\n value: function stuckAtPlaylistEnd_(playlist) {\n var seekable$$1 = this.seekable();\n\n if (!seekable$$1.length) {\n // playlist doesn't have enough information to determine whether we are stuck\n return false;\n }\n\n var expired = this.syncController_.getExpiredTime(playlist, this.mediaSource.duration);\n\n if (expired === null) {\n return false;\n } // does not use the safe live end to calculate playlist end, since we\n // don't want to say we are stuck while there is still content\n\n\n var absolutePlaylistEnd = Hls.Playlist.playlistEnd(playlist, expired);\n var currentTime = this.tech_.currentTime();\n var buffered = this.tech_.buffered();\n\n if (!buffered.length) {\n // return true if the playhead reached the absolute end of the playlist\n return absolutePlaylistEnd - currentTime <= SAFE_TIME_DELTA;\n }\n\n var bufferedEnd = buffered.end(buffered.length - 1); // return true if there is too little buffer left and buffer has reached absolute\n // end of playlist\n\n return bufferedEnd - currentTime <= SAFE_TIME_DELTA && absolutePlaylistEnd - bufferedEnd <= SAFE_TIME_DELTA;\n }\n /**\n * Blacklists a playlist when an error occurs for a set amount of time\n * making it unavailable for selection by the rendition selection algorithm\n * and then forces a new playlist (rendition) selection.\n *\n * @param {Object=} error an optional error that may include the playlist\n * to blacklist\n * @param {Number=} blacklistDuration an optional number of seconds to blacklist the\n * playlist\n */\n\n }, {\n key: 'blacklistCurrentPlaylist',\n value: function blacklistCurrentPlaylist() {\n var error = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var blacklistDuration = arguments[1];\n var currentPlaylist = void 0;\n var nextPlaylist = void 0; // If the `error` was generated by the playlist loader, it will contain\n // the playlist we were trying to load (but failed) and that should be\n // blacklisted instead of the currently selected playlist which is likely\n // out-of-date in this scenario\n\n currentPlaylist = error.playlist || this.masterPlaylistLoader_.media();\n blacklistDuration = blacklistDuration || error.blacklistDuration || this.blacklistDuration; // If there is no current playlist, then an error occurred while we were\n // trying to load the master OR while we were disposing of the tech\n\n if (!currentPlaylist) {\n this.error = error;\n\n try {\n return this.mediaSource.endOfStream('network');\n } catch (e) {\n return this.trigger('error');\n }\n }\n\n var isFinalRendition = this.masterPlaylistLoader_.master.playlists.filter(isEnabled).length === 1;\n\n if (isFinalRendition) {\n // Never blacklisting this playlist because it's final rendition\n videojs$1.log.warn('Problem encountered with the current ' + 'HLS playlist. Trying again since it is the final playlist.');\n this.tech_.trigger('retryplaylist');\n return this.masterPlaylistLoader_.load(isFinalRendition);\n } // Blacklist this playlist\n\n\n currentPlaylist.excludeUntil = Date.now() + blacklistDuration * 1000;\n this.tech_.trigger('blacklistplaylist');\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-rendition-blacklisted'\n }); // Select a new playlist\n\n nextPlaylist = this.selectPlaylist();\n videojs$1.log.warn('Problem encountered with the current HLS playlist.' + (error.message ? ' ' + error.message : '') + ' Switching to another playlist.');\n return this.masterPlaylistLoader_.media(nextPlaylist);\n }\n /**\n * Pause all segment loaders\n */\n\n }, {\n key: 'pauseLoading',\n value: function pauseLoading() {\n this.mainSegmentLoader_.pause();\n\n if (this.mediaTypes_.AUDIO.activePlaylistLoader) {\n this.audioSegmentLoader_.pause();\n }\n\n if (this.mediaTypes_.SUBTITLES.activePlaylistLoader) {\n this.subtitleSegmentLoader_.pause();\n }\n }\n /**\n * set the current time on all segment loaders\n *\n * @param {TimeRange} currentTime the current time to set\n * @return {TimeRange} the current time\n */\n\n }, {\n key: 'setCurrentTime',\n value: function setCurrentTime(currentTime) {\n var buffered = findRange(this.tech_.buffered(), currentTime);\n\n if (!(this.masterPlaylistLoader_ && this.masterPlaylistLoader_.media())) {\n // return immediately if the metadata is not ready yet\n return 0;\n } // it's clearly an edge-case but don't thrown an error if asked to\n // seek within an empty playlist\n\n\n if (!this.masterPlaylistLoader_.media().segments) {\n return 0;\n } // In flash playback, the segment loaders should be reset on every seek, even\n // in buffer seeks. If the seek location is already buffered, continue buffering as\n // usual\n // TODO: redo this comment\n\n\n if (buffered && buffered.length) {\n return currentTime;\n } // cancel outstanding requests so we begin buffering at the new\n // location\n\n\n this.mainSegmentLoader_.resetEverything();\n this.mainSegmentLoader_.abort();\n\n if (this.mediaTypes_.AUDIO.activePlaylistLoader) {\n this.audioSegmentLoader_.resetEverything();\n this.audioSegmentLoader_.abort();\n }\n\n if (this.mediaTypes_.SUBTITLES.activePlaylistLoader) {\n this.subtitleSegmentLoader_.resetEverything();\n this.subtitleSegmentLoader_.abort();\n } // start segment loader loading in case they are paused\n\n\n this.load();\n }\n /**\n * get the current duration\n *\n * @return {TimeRange} the duration\n */\n\n }, {\n key: 'duration',\n value: function duration$$1() {\n if (!this.masterPlaylistLoader_) {\n return 0;\n }\n\n if (this.mediaSource) {\n return this.mediaSource.duration;\n }\n\n return Hls.Playlist.duration(this.masterPlaylistLoader_.media());\n }\n /**\n * check the seekable range\n *\n * @return {TimeRange} the seekable range\n */\n\n }, {\n key: 'seekable',\n value: function seekable$$1() {\n return this.seekable_;\n }\n }, {\n key: 'onSyncInfoUpdate_',\n value: function onSyncInfoUpdate_() {\n var mainSeekable = void 0;\n var audioSeekable = void 0;\n\n if (!this.masterPlaylistLoader_) {\n return;\n }\n\n var media = this.masterPlaylistLoader_.media();\n\n if (!media) {\n return;\n }\n\n var expired = this.syncController_.getExpiredTime(media, this.mediaSource.duration);\n\n if (expired === null) {\n // not enough information to update seekable\n return;\n }\n\n mainSeekable = Hls.Playlist.seekable(media, expired);\n\n if (mainSeekable.length === 0) {\n return;\n }\n\n if (this.mediaTypes_.AUDIO.activePlaylistLoader) {\n media = this.mediaTypes_.AUDIO.activePlaylistLoader.media();\n expired = this.syncController_.getExpiredTime(media, this.mediaSource.duration);\n\n if (expired === null) {\n return;\n }\n\n audioSeekable = Hls.Playlist.seekable(media, expired);\n\n if (audioSeekable.length === 0) {\n return;\n }\n }\n\n if (!audioSeekable) {\n // seekable has been calculated based on buffering video data so it\n // can be returned directly\n this.seekable_ = mainSeekable;\n } else if (audioSeekable.start(0) > mainSeekable.end(0) || mainSeekable.start(0) > audioSeekable.end(0)) {\n // seekables are pretty far off, rely on main\n this.seekable_ = mainSeekable;\n } else {\n this.seekable_ = videojs$1.createTimeRanges([[audioSeekable.start(0) > mainSeekable.start(0) ? audioSeekable.start(0) : mainSeekable.start(0), audioSeekable.end(0) < mainSeekable.end(0) ? audioSeekable.end(0) : mainSeekable.end(0)]]);\n }\n\n this.logger_('seekable updated [' + printableRange(this.seekable_) + ']');\n this.tech_.trigger('seekablechanged');\n }\n /**\n * Update the player duration\n */\n\n }, {\n key: 'updateDuration',\n value: function updateDuration() {\n var _this6 = this;\n\n var oldDuration = this.mediaSource.duration;\n var newDuration = Hls.Playlist.duration(this.masterPlaylistLoader_.media());\n var buffered = this.tech_.buffered();\n\n var setDuration = function setDuration() {\n _this6.mediaSource.duration = newDuration;\n\n _this6.tech_.trigger('durationchange');\n\n _this6.mediaSource.removeEventListener('sourceopen', setDuration);\n };\n\n if (buffered.length > 0) {\n newDuration = Math.max(newDuration, buffered.end(buffered.length - 1));\n } // if the duration has changed, invalidate the cached value\n\n\n if (oldDuration !== newDuration) {\n // update the duration\n if (this.mediaSource.readyState !== 'open') {\n this.mediaSource.addEventListener('sourceopen', setDuration);\n } else {\n setDuration();\n }\n }\n }\n /**\n * dispose of the MasterPlaylistController and everything\n * that it controls\n */\n\n }, {\n key: 'dispose',\n value: function dispose() {\n var _this7 = this;\n\n this.decrypter_.terminate();\n this.masterPlaylistLoader_.dispose();\n this.mainSegmentLoader_.dispose();\n ['AUDIO', 'SUBTITLES'].forEach(function (type) {\n var groups = _this7.mediaTypes_[type].groups;\n\n for (var id in groups) {\n groups[id].forEach(function (group) {\n if (group.playlistLoader) {\n group.playlistLoader.dispose();\n }\n });\n }\n });\n this.audioSegmentLoader_.dispose();\n this.subtitleSegmentLoader_.dispose();\n }\n /**\n * return the master playlist object if we have one\n *\n * @return {Object} the master playlist object that we parsed\n */\n\n }, {\n key: 'master',\n value: function master() {\n return this.masterPlaylistLoader_.master;\n }\n /**\n * return the currently selected playlist\n *\n * @return {Object} the currently selected playlist object that we parsed\n */\n\n }, {\n key: 'media',\n value: function media() {\n // playlist loader will not return media if it has not been fully loaded\n return this.masterPlaylistLoader_.media() || this.initialMedia_;\n }\n /**\n * setup our internal source buffers on our segment Loaders\n *\n * @private\n */\n\n }, {\n key: 'setupSourceBuffers_',\n value: function setupSourceBuffers_() {\n var media = this.masterPlaylistLoader_.media();\n var mimeTypes = void 0; // wait until a media playlist is available and the Media Source is\n // attached\n\n if (!media || this.mediaSource.readyState !== 'open') {\n return;\n }\n\n mimeTypes = mimeTypesForPlaylist(this.masterPlaylistLoader_.master, media);\n\n if (mimeTypes.length < 1) {\n this.error = 'No compatible SourceBuffer configuration for the variant stream:' + media.resolvedUri;\n return this.mediaSource.endOfStream('decode');\n }\n\n this.configureLoaderMimeTypes_(mimeTypes); // exclude any incompatible variant streams from future playlist\n // selection\n\n this.excludeIncompatibleVariants_(media);\n }\n }, {\n key: 'configureLoaderMimeTypes_',\n value: function configureLoaderMimeTypes_(mimeTypes) {\n // If the content is demuxed, we can't start appending segments to a source buffer\n // until both source buffers are set up, or else the browser may not let us add the\n // second source buffer (it will assume we are playing either audio only or video\n // only).\n var sourceBufferEmitter = // If there is more than one mime type\n mimeTypes.length > 1 && // and the first mime type does not have muxed video and audio\n mimeTypes[0].indexOf(',') === -1 && // and the two mime types are different (they can be the same in the case of audio\n // only with alternate audio)\n mimeTypes[0] !== mimeTypes[1] ? // then we want to wait on the second source buffer\n new videojs$1.EventTarget() : // otherwise there is no need to wait as the content is either audio only,\n // video only, or muxed content.\n null;\n this.mainSegmentLoader_.mimeType(mimeTypes[0], sourceBufferEmitter);\n\n if (mimeTypes[1]) {\n this.audioSegmentLoader_.mimeType(mimeTypes[1], sourceBufferEmitter);\n }\n }\n /**\n * Blacklists playlists with codecs that are unsupported by the browser.\n */\n\n }, {\n key: 'excludeUnsupportedVariants_',\n value: function excludeUnsupportedVariants_() {\n this.master().playlists.forEach(function (variant) {\n if (variant.attributes.CODECS && window$1.MediaSource && window$1.MediaSource.isTypeSupported && !window$1.MediaSource.isTypeSupported('video/mp4; codecs=\"' + mapLegacyAvcCodecs(variant.attributes.CODECS) + '\"')) {\n variant.excludeUntil = Infinity;\n }\n });\n }\n /**\n * Blacklist playlists that are known to be codec or\n * stream-incompatible with the SourceBuffer configuration. For\n * instance, Media Source Extensions would cause the video element to\n * stall waiting for video data if you switched from a variant with\n * video and audio to an audio-only one.\n *\n * @param {Object} media a media playlist compatible with the current\n * set of SourceBuffers. Variants in the current master playlist that\n * do not appear to have compatible codec or stream configurations\n * will be excluded from the default playlist selection algorithm\n * indefinitely.\n * @private\n */\n\n }, {\n key: 'excludeIncompatibleVariants_',\n value: function excludeIncompatibleVariants_(media) {\n var codecCount = 2;\n var videoCodec = null;\n var codecs = void 0;\n\n if (media.attributes.CODECS) {\n codecs = parseCodecs(media.attributes.CODECS);\n videoCodec = codecs.videoCodec;\n codecCount = codecs.codecCount;\n }\n\n this.master().playlists.forEach(function (variant) {\n var variantCodecs = {\n codecCount: 2,\n videoCodec: null\n };\n\n if (variant.attributes.CODECS) {\n variantCodecs = parseCodecs(variant.attributes.CODECS);\n } // if the streams differ in the presence or absence of audio or\n // video, they are incompatible\n\n\n if (variantCodecs.codecCount !== codecCount) {\n variant.excludeUntil = Infinity;\n } // if h.264 is specified on the current playlist, some flavor of\n // it must be specified on all compatible variants\n\n\n if (variantCodecs.videoCodec !== videoCodec) {\n variant.excludeUntil = Infinity;\n }\n });\n }\n }, {\n key: 'updateAdCues_',\n value: function updateAdCues_(media) {\n var offset = 0;\n var seekable$$1 = this.seekable();\n\n if (seekable$$1.length) {\n offset = seekable$$1.start(0);\n }\n\n updateAdCues(media, this.cueTagsTrack_, offset);\n }\n /**\n * Calculates the desired forward buffer length based on current time\n *\n * @return {Number} Desired forward buffer length in seconds\n */\n\n }, {\n key: 'goalBufferLength',\n value: function goalBufferLength() {\n var currentTime = this.tech_.currentTime();\n var initial = Config.GOAL_BUFFER_LENGTH;\n var rate = Config.GOAL_BUFFER_LENGTH_RATE;\n var max = Math.max(initial, Config.MAX_GOAL_BUFFER_LENGTH);\n return Math.min(initial + currentTime * rate, max);\n }\n /**\n * Calculates the desired buffer low water line based on current time\n *\n * @return {Number} Desired buffer low water line in seconds\n */\n\n }, {\n key: 'bufferLowWaterLine',\n value: function bufferLowWaterLine() {\n var currentTime = this.tech_.currentTime();\n var initial = Config.BUFFER_LOW_WATER_LINE;\n var rate = Config.BUFFER_LOW_WATER_LINE_RATE;\n var max = Math.max(initial, Config.MAX_BUFFER_LOW_WATER_LINE);\n return Math.min(initial + currentTime * rate, max);\n }\n }]);\n return MasterPlaylistController;\n}(videojs$1.EventTarget);\n/**\n * Returns a function that acts as the Enable/disable playlist function.\n *\n * @param {PlaylistLoader} loader - The master playlist loader\n * @param {String} playlistUri - uri of the playlist\n * @param {Function} changePlaylistFn - A function to be called after a\n * playlist's enabled-state has been changed. Will NOT be called if a\n * playlist's enabled-state is unchanged\n * @param {Boolean=} enable - Value to set the playlist enabled-state to\n * or if undefined returns the current enabled-state for the playlist\n * @return {Function} Function for setting/getting enabled\n */\n\n\nvar enableFunction = function enableFunction(loader, playlistUri, changePlaylistFn) {\n return function (enable) {\n var playlist = loader.master.playlists[playlistUri];\n var incompatible = isIncompatible(playlist);\n var currentlyEnabled = isEnabled(playlist);\n\n if (typeof enable === 'undefined') {\n return currentlyEnabled;\n }\n\n if (enable) {\n delete playlist.disabled;\n } else {\n playlist.disabled = true;\n }\n\n if (enable !== currentlyEnabled && !incompatible) {\n // Ensure the outside world knows about our changes\n changePlaylistFn();\n\n if (enable) {\n loader.trigger('renditionenabled');\n } else {\n loader.trigger('renditiondisabled');\n }\n }\n\n return enable;\n };\n};\n/**\n * The representation object encapsulates the publicly visible information\n * in a media playlist along with a setter/getter-type function (enabled)\n * for changing the enabled-state of a particular playlist entry\n *\n * @class Representation\n */\n\n\nvar Representation = function Representation(hlsHandler, playlist, id) {\n classCallCheck(this, Representation);\n var mpc = hlsHandler.masterPlaylistController_,\n smoothQualityChange = hlsHandler.options_.smoothQualityChange; // Get a reference to a bound version of the quality change function\n\n var changeType = smoothQualityChange ? 'smooth' : 'fast';\n var qualityChangeFunction = mpc[changeType + 'QualityChange_'].bind(mpc); // some playlist attributes are optional\n\n if (playlist.attributes.RESOLUTION) {\n var resolution = playlist.attributes.RESOLUTION;\n this.width = resolution.width;\n this.height = resolution.height;\n }\n\n this.bandwidth = playlist.attributes.BANDWIDTH; // The id is simply the ordinality of the media playlist\n // within the master playlist\n\n this.id = id; // Partially-apply the enableFunction to create a playlist-\n // specific variant\n\n this.enabled = enableFunction(hlsHandler.playlists, playlist.uri, qualityChangeFunction);\n};\n/**\n * A mixin function that adds the `representations` api to an instance\n * of the HlsHandler class\n * @param {HlsHandler} hlsHandler - An instance of HlsHandler to add the\n * representation API into\n */\n\n\nvar renditionSelectionMixin = function renditionSelectionMixin(hlsHandler) {\n var playlists = hlsHandler.playlists; // Add a single API-specific function to the HlsHandler instance\n\n hlsHandler.representations = function () {\n return playlists.master.playlists.filter(function (media) {\n return !isIncompatible(media);\n }).map(function (e, i) {\n return new Representation(hlsHandler, e, e.uri);\n });\n };\n};\n/**\n * @file playback-watcher.js\n *\n * Playback starts, and now my watch begins. It shall not end until my death. I shall\n * take no wait, hold no uncleared timeouts, father no bad seeks. I shall wear no crowns\n * and win no glory. I shall live and die at my post. I am the corrector of the underflow.\n * I am the watcher of gaps. I am the shield that guards the realms of seekable. I pledge\n * my life and honor to the Playback Watch, for this Player and all the Players to come.\n */\n// Set of events that reset the playback-watcher time check logic and clear the timeout\n\n\nvar timerCancelEvents = ['seeking', 'seeked', 'pause', 'playing', 'error'];\n/**\n * @class PlaybackWatcher\n */\n\nvar PlaybackWatcher = function () {\n /**\n * Represents an PlaybackWatcher object.\n * @constructor\n * @param {object} options an object that includes the tech and settings\n */\n function PlaybackWatcher(options) {\n var _this = this;\n\n classCallCheck(this, PlaybackWatcher);\n this.tech_ = options.tech;\n this.seekable = options.seekable;\n this.seekTo = options.seekTo;\n this.consecutiveUpdates = 0;\n this.lastRecordedTime = null;\n this.timer_ = null;\n this.checkCurrentTimeTimeout_ = null;\n this.logger_ = logger('PlaybackWatcher');\n this.logger_('initialize');\n\n var canPlayHandler = function canPlayHandler() {\n return _this.monitorCurrentTime_();\n };\n\n var waitingHandler = function waitingHandler() {\n return _this.techWaiting_();\n };\n\n var cancelTimerHandler = function cancelTimerHandler() {\n return _this.cancelTimer_();\n };\n\n var fixesBadSeeksHandler = function fixesBadSeeksHandler() {\n return _this.fixesBadSeeks_();\n };\n\n this.tech_.on('seekablechanged', fixesBadSeeksHandler);\n this.tech_.on('waiting', waitingHandler);\n this.tech_.on(timerCancelEvents, cancelTimerHandler);\n this.tech_.on('canplay', canPlayHandler); // Define the dispose function to clean up our events\n\n this.dispose = function () {\n _this.logger_('dispose');\n\n _this.tech_.off('seekablechanged', fixesBadSeeksHandler);\n\n _this.tech_.off('waiting', waitingHandler);\n\n _this.tech_.off(timerCancelEvents, cancelTimerHandler);\n\n _this.tech_.off('canplay', canPlayHandler);\n\n if (_this.checkCurrentTimeTimeout_) {\n window$1.clearTimeout(_this.checkCurrentTimeTimeout_);\n }\n\n _this.cancelTimer_();\n };\n }\n /**\n * Periodically check current time to see if playback stopped\n *\n * @private\n */\n\n\n createClass(PlaybackWatcher, [{\n key: 'monitorCurrentTime_',\n value: function monitorCurrentTime_() {\n this.checkCurrentTime_();\n\n if (this.checkCurrentTimeTimeout_) {\n window$1.clearTimeout(this.checkCurrentTimeTimeout_);\n } // 42 = 24 fps // 250 is what Webkit uses // FF uses 15\n\n\n this.checkCurrentTimeTimeout_ = window$1.setTimeout(this.monitorCurrentTime_.bind(this), 250);\n }\n /**\n * The purpose of this function is to emulate the \"waiting\" event on\n * browsers that do not emit it when they are waiting for more\n * data to continue playback\n *\n * @private\n */\n\n }, {\n key: 'checkCurrentTime_',\n value: function checkCurrentTime_() {\n if (this.tech_.seeking() && this.fixesBadSeeks_()) {\n this.consecutiveUpdates = 0;\n this.lastRecordedTime = this.tech_.currentTime();\n return;\n }\n\n if (this.tech_.paused() || this.tech_.seeking()) {\n return;\n }\n\n var currentTime = this.tech_.currentTime();\n var buffered = this.tech_.buffered();\n\n if (this.lastRecordedTime === currentTime && (!buffered.length || currentTime + SAFE_TIME_DELTA >= buffered.end(buffered.length - 1))) {\n // If current time is at the end of the final buffered region, then any playback\n // stall is most likely caused by buffering in a low bandwidth environment. The tech\n // should fire a `waiting` event in this scenario, but due to browser and tech\n // inconsistencies. Calling `techWaiting_` here allows us to simulate\n // responding to a native `waiting` event when the tech fails to emit one.\n return this.techWaiting_();\n }\n\n if (this.consecutiveUpdates >= 5 && currentTime === this.lastRecordedTime) {\n this.consecutiveUpdates++;\n this.waiting_();\n } else if (currentTime === this.lastRecordedTime) {\n this.consecutiveUpdates++;\n } else {\n this.consecutiveUpdates = 0;\n this.lastRecordedTime = currentTime;\n }\n }\n /**\n * Cancels any pending timers and resets the 'timeupdate' mechanism\n * designed to detect that we are stalled\n *\n * @private\n */\n\n }, {\n key: 'cancelTimer_',\n value: function cancelTimer_() {\n this.consecutiveUpdates = 0;\n\n if (this.timer_) {\n this.logger_('cancelTimer_');\n clearTimeout(this.timer_);\n }\n\n this.timer_ = null;\n }\n /**\n * Fixes situations where there's a bad seek\n *\n * @return {Boolean} whether an action was taken to fix the seek\n * @private\n */\n\n }, {\n key: 'fixesBadSeeks_',\n value: function fixesBadSeeks_() {\n var seeking = this.tech_.seeking();\n var seekable = this.seekable();\n var currentTime = this.tech_.currentTime();\n var seekTo = void 0;\n\n if (seeking && this.afterSeekableWindow_(seekable, currentTime)) {\n var seekableEnd = seekable.end(seekable.length - 1); // sync to live point (if VOD, our seekable was updated and we're simply adjusting)\n\n seekTo = seekableEnd;\n }\n\n if (seeking && this.beforeSeekableWindow_(seekable, currentTime)) {\n var seekableStart = seekable.start(0); // sync to the beginning of the live window\n // provide a buffer of .1 seconds to handle rounding/imprecise numbers\n\n seekTo = seekableStart + SAFE_TIME_DELTA;\n }\n\n if (typeof seekTo !== 'undefined') {\n this.logger_('Trying to seek outside of seekable at time ' + currentTime + ' with ' + ('seekable range ' + printableRange(seekable) + '. Seeking to ') + (seekTo + '.'));\n this.seekTo(seekTo);\n return true;\n }\n\n return false;\n }\n /**\n * Handler for situations when we determine the player is waiting.\n *\n * @private\n */\n\n }, {\n key: 'waiting_',\n value: function waiting_() {\n if (this.techWaiting_()) {\n return;\n } // All tech waiting checks failed. Use last resort correction\n\n\n var currentTime = this.tech_.currentTime();\n var buffered = this.tech_.buffered();\n var currentRange = findRange(buffered, currentTime); // Sometimes the player can stall for unknown reasons within a contiguous buffered\n // region with no indication that anything is amiss (seen in Firefox). Seeking to\n // currentTime is usually enough to kickstart the player. This checks that the player\n // is currently within a buffered region before attempting a corrective seek.\n // Chrome does not appear to continue `timeupdate` events after a `waiting` event\n // until there is ~ 3 seconds of forward buffer available. PlaybackWatcher should also\n // make sure there is ~3 seconds of forward buffer before taking any corrective action\n // to avoid triggering an `unknownwaiting` event when the network is slow.\n\n if (currentRange.length && currentTime + 3 <= currentRange.end(0)) {\n this.cancelTimer_();\n this.seekTo(currentTime);\n this.logger_('Stopped at ' + currentTime + ' while inside a buffered region ' + ('[' + currentRange.start(0) + ' -> ' + currentRange.end(0) + ']. Attempting to resume ') + 'playback by seeking to the current time.'); // unknown waiting corrections may be useful for monitoring QoS\n\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-unknown-waiting'\n });\n return;\n }\n }\n /**\n * Handler for situations when the tech fires a `waiting` event\n *\n * @return {Boolean}\n * True if an action (or none) was needed to correct the waiting. False if no\n * checks passed\n * @private\n */\n\n }, {\n key: 'techWaiting_',\n value: function techWaiting_() {\n var seekable = this.seekable();\n var currentTime = this.tech_.currentTime();\n\n if (this.tech_.seeking() && this.fixesBadSeeks_()) {\n // Tech is seeking or bad seek fixed, no action needed\n return true;\n }\n\n if (this.tech_.seeking() || this.timer_ !== null) {\n // Tech is seeking or already waiting on another action, no action needed\n return true;\n }\n\n if (this.beforeSeekableWindow_(seekable, currentTime)) {\n var livePoint = seekable.end(seekable.length - 1);\n this.logger_('Fell out of live window at time ' + currentTime + '. Seeking to ' + ('live point (seekable end) ' + livePoint));\n this.cancelTimer_();\n this.seekTo(livePoint); // live window resyncs may be useful for monitoring QoS\n\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-live-resync'\n });\n return true;\n }\n\n var buffered = this.tech_.buffered();\n var nextRange = findNextRange(buffered, currentTime);\n\n if (this.videoUnderflow_(nextRange, buffered, currentTime)) {\n // Even though the video underflowed and was stuck in a gap, the audio overplayed\n // the gap, leading currentTime into a buffered range. Seeking to currentTime\n // allows the video to catch up to the audio position without losing any audio\n // (only suffering ~3 seconds of frozen video and a pause in audio playback).\n this.cancelTimer_();\n this.seekTo(currentTime); // video underflow may be useful for monitoring QoS\n\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-video-underflow'\n });\n return true;\n } // check for gap\n\n\n if (nextRange.length > 0) {\n var difference = nextRange.start(0) - currentTime;\n this.logger_('Stopped at ' + currentTime + ', setting timer for ' + difference + ', seeking ' + ('to ' + nextRange.start(0)));\n this.timer_ = setTimeout(this.skipTheGap_.bind(this), difference * 1000, currentTime);\n return true;\n } // All checks failed. Returning false to indicate failure to correct waiting\n\n\n return false;\n }\n }, {\n key: 'afterSeekableWindow_',\n value: function afterSeekableWindow_(seekable, currentTime) {\n if (!seekable.length) {\n // we can't make a solid case if there's no seekable, default to false\n return false;\n }\n\n if (currentTime > seekable.end(seekable.length - 1) + SAFE_TIME_DELTA) {\n return true;\n }\n\n return false;\n }\n }, {\n key: 'beforeSeekableWindow_',\n value: function beforeSeekableWindow_(seekable, currentTime) {\n if (seekable.length && // can't fall before 0 and 0 seekable start identifies VOD stream\n seekable.start(0) > 0 && currentTime < seekable.start(0) - SAFE_TIME_DELTA) {\n return true;\n }\n\n return false;\n }\n }, {\n key: 'videoUnderflow_',\n value: function videoUnderflow_(nextRange, buffered, currentTime) {\n if (nextRange.length === 0) {\n // Even if there is no available next range, there is still a possibility we are\n // stuck in a gap due to video underflow.\n var gap = this.gapFromVideoUnderflow_(buffered, currentTime);\n\n if (gap) {\n this.logger_('Encountered a gap in video from ' + gap.start + ' to ' + gap.end + '. ' + ('Seeking to current time ' + currentTime));\n return true;\n }\n }\n\n return false;\n }\n /**\n * Timer callback. If playback still has not proceeded, then we seek\n * to the start of the next buffered region.\n *\n * @private\n */\n\n }, {\n key: 'skipTheGap_',\n value: function skipTheGap_(scheduledCurrentTime) {\n var buffered = this.tech_.buffered();\n var currentTime = this.tech_.currentTime();\n var nextRange = findNextRange(buffered, currentTime);\n this.cancelTimer_();\n\n if (nextRange.length === 0 || currentTime !== scheduledCurrentTime) {\n return;\n }\n\n this.logger_('skipTheGap_:', 'currentTime:', currentTime, 'scheduled currentTime:', scheduledCurrentTime, 'nextRange start:', nextRange.start(0)); // only seek if we still have not played\n\n this.seekTo(nextRange.start(0) + TIME_FUDGE_FACTOR);\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-gap-skip'\n });\n }\n }, {\n key: 'gapFromVideoUnderflow_',\n value: function gapFromVideoUnderflow_(buffered, currentTime) {\n // At least in Chrome, if there is a gap in the video buffer, the audio will continue\n // playing for ~3 seconds after the video gap starts. This is done to account for\n // video buffer underflow/underrun (note that this is not done when there is audio\n // buffer underflow/underrun -- in that case the video will stop as soon as it\n // encounters the gap, as audio stalls are more noticeable/jarring to a user than\n // video stalls). The player's time will reflect the playthrough of audio, so the\n // time will appear as if we are in a buffered region, even if we are stuck in a\n // \"gap.\"\n //\n // Example:\n // video buffer: 0 => 10.1, 10.2 => 20\n // audio buffer: 0 => 20\n // overall buffer: 0 => 10.1, 10.2 => 20\n // current time: 13\n //\n // Chrome's video froze at 10 seconds, where the video buffer encountered the gap,\n // however, the audio continued playing until it reached ~3 seconds past the gap\n // (13 seconds), at which point it stops as well. Since current time is past the\n // gap, findNextRange will return no ranges.\n //\n // To check for this issue, we see if there is a gap that starts somewhere within\n // a 3 second range (3 seconds +/- 1 second) back from our current time.\n var gaps = findGaps(buffered);\n\n for (var i = 0; i < gaps.length; i++) {\n var start = gaps.start(i);\n var end = gaps.end(i); // gap is starts no more than 4 seconds back\n\n if (currentTime - start < 4 && currentTime - start > 2) {\n return {\n start: start,\n end: end\n };\n }\n }\n\n return null;\n }\n }]);\n return PlaybackWatcher;\n}();\n\nvar defaultOptions = {\n errorInterval: 30,\n getSource: function getSource(next) {\n var tech = this.tech({\n IWillNotUseThisInPlugins: true\n });\n var sourceObj = tech.currentSource_;\n return next(sourceObj);\n }\n};\n/**\n * Main entry point for the plugin\n *\n * @param {Player} player a reference to a videojs Player instance\n * @param {Object} [options] an object with plugin options\n * @private\n */\n\nvar initPlugin = function initPlugin(player, options) {\n var lastCalled = 0;\n var seekTo = 0;\n var localOptions = videojs$1.mergeOptions(defaultOptions, options);\n player.ready(function () {\n player.trigger({\n type: 'usage',\n name: 'hls-error-reload-initialized'\n });\n });\n /**\n * Player modifications to perform that must wait until `loadedmetadata`\n * has been triggered\n *\n * @private\n */\n\n var loadedMetadataHandler = function loadedMetadataHandler() {\n if (seekTo) {\n player.currentTime(seekTo);\n }\n };\n /**\n * Set the source on the player element, play, and seek if necessary\n *\n * @param {Object} sourceObj An object specifying the source url and mime-type to play\n * @private\n */\n\n\n var setSource = function setSource(sourceObj) {\n if (sourceObj === null || sourceObj === undefined) {\n return;\n }\n\n seekTo = player.duration() !== Infinity && player.currentTime() || 0;\n player.one('loadedmetadata', loadedMetadataHandler);\n player.src(sourceObj);\n player.trigger({\n type: 'usage',\n name: 'hls-error-reload'\n });\n player.play();\n };\n /**\n * Attempt to get a source from either the built-in getSource function\n * or a custom function provided via the options\n *\n * @private\n */\n\n\n var errorHandler = function errorHandler() {\n // Do not attempt to reload the source if a source-reload occurred before\n // 'errorInterval' time has elapsed since the last source-reload\n if (Date.now() - lastCalled < localOptions.errorInterval * 1000) {\n player.trigger({\n type: 'usage',\n name: 'hls-error-reload-canceled'\n });\n return;\n }\n\n if (!localOptions.getSource || typeof localOptions.getSource !== 'function') {\n videojs$1.log.error('ERROR: reloadSourceOnError - The option getSource must be a function!');\n return;\n }\n\n lastCalled = Date.now();\n return localOptions.getSource.call(player, setSource);\n };\n /**\n * Unbind any event handlers that were bound by the plugin\n *\n * @private\n */\n\n\n var cleanupEvents = function cleanupEvents() {\n player.off('loadedmetadata', loadedMetadataHandler);\n player.off('error', errorHandler);\n player.off('dispose', cleanupEvents);\n };\n /**\n * Cleanup before re-initializing the plugin\n *\n * @param {Object} [newOptions] an object with plugin options\n * @private\n */\n\n\n var reinitPlugin = function reinitPlugin(newOptions) {\n cleanupEvents();\n initPlugin(player, newOptions);\n };\n\n player.on('error', errorHandler);\n player.on('dispose', cleanupEvents); // Overwrite the plugin function so that we can correctly cleanup before\n // initializing the plugin\n\n player.reloadSourceOnError = reinitPlugin;\n};\n/**\n * Reload the source when an error is detected as long as there\n * wasn't an error previously within the last 30 seconds\n *\n * @param {Object} [options] an object with plugin options\n */\n\n\nvar reloadSourceOnError = function reloadSourceOnError(options) {\n initPlugin(this, options);\n};\n\nvar version$1 = \"1.5.1\"; // since VHS handles HLS and DASH (and in the future, more types), use * to capture all\n\nvideojs$1.use('*', function (player) {\n return {\n setSource: function setSource(srcObj, next) {\n // pass null as the first argument to indicate that the source is not rejected\n next(null, srcObj);\n },\n // VHS needs to know when seeks happen. For external seeks (generated at the player\n // level), this middleware will capture the action. For internal seeks (generated at\n // the tech level), we use a wrapped function so that we can handle it on our own\n // (specified elsewhere).\n setCurrentTime: function setCurrentTime(time) {\n if (player.vhs && player.currentSource().src === player.vhs.source_.src) {\n player.vhs.setCurrentTime(time);\n }\n\n return time;\n },\n // Sync VHS after play requests.\n // This specifically handles replay where the order of actions is\n // play, video element will seek to 0 (skipping the setCurrentTime middleware)\n // then triggers a play event.\n play: function play() {\n if (player.vhs && player.currentSource().src === player.vhs.source_.src) {\n player.vhs.setCurrentTime(player.currentTime());\n }\n }\n };\n});\n/**\n * @file videojs-http-streaming.js\n *\n * The main file for the HLS project.\n * License: https://github.com/videojs/videojs-http-streaming/blob/master/LICENSE\n */\n\nvar Hls$1 = {\n PlaylistLoader: PlaylistLoader,\n Playlist: Playlist,\n Decrypter: Decrypter,\n AsyncStream: AsyncStream,\n decrypt: decrypt,\n utils: utils,\n STANDARD_PLAYLIST_SELECTOR: lastBandwidthSelector,\n INITIAL_PLAYLIST_SELECTOR: lowestBitrateCompatibleVariantSelector,\n comparePlaylistBandwidth: comparePlaylistBandwidth,\n comparePlaylistResolution: comparePlaylistResolution,\n xhr: xhrFactory()\n}; // Define getter/setters for config properites\n\n['GOAL_BUFFER_LENGTH', 'MAX_GOAL_BUFFER_LENGTH', 'GOAL_BUFFER_LENGTH_RATE', 'BUFFER_LOW_WATER_LINE', 'MAX_BUFFER_LOW_WATER_LINE', 'BUFFER_LOW_WATER_LINE_RATE', 'BANDWIDTH_VARIANCE'].forEach(function (prop) {\n Object.defineProperty(Hls$1, prop, {\n get: function get$$1() {\n videojs$1.log.warn('using Hls.' + prop + ' is UNSAFE be sure you know what you are doing');\n return Config[prop];\n },\n set: function set$$1(value) {\n videojs$1.log.warn('using Hls.' + prop + ' is UNSAFE be sure you know what you are doing');\n\n if (typeof value !== 'number' || value < 0) {\n videojs$1.log.warn('value of Hls.' + prop + ' must be greater than or equal to 0');\n return;\n }\n\n Config[prop] = value;\n }\n });\n});\nvar LOCAL_STORAGE_KEY$1 = 'videojs-vhs';\n\nvar simpleTypeFromSourceType = function simpleTypeFromSourceType(type) {\n var mpegurlRE = /^(audio|video|application)\\/(x-|vnd\\.apple\\.)?mpegurl/i;\n\n if (mpegurlRE.test(type)) {\n return 'hls';\n }\n\n var dashRE = /^application\\/dash\\+xml/i;\n\n if (dashRE.test(type)) {\n return 'dash';\n }\n\n return null;\n};\n/**\n * Updates the selectedIndex of the QualityLevelList when a mediachange happens in hls.\n *\n * @param {QualityLevelList} qualityLevels The QualityLevelList to update.\n * @param {PlaylistLoader} playlistLoader PlaylistLoader containing the new media info.\n * @function handleHlsMediaChange\n */\n\n\nvar handleHlsMediaChange = function handleHlsMediaChange(qualityLevels, playlistLoader) {\n var newPlaylist = playlistLoader.media();\n var selectedIndex = -1;\n\n for (var i = 0; i < qualityLevels.length; i++) {\n if (qualityLevels[i].id === newPlaylist.uri) {\n selectedIndex = i;\n break;\n }\n }\n\n qualityLevels.selectedIndex_ = selectedIndex;\n qualityLevels.trigger({\n selectedIndex: selectedIndex,\n type: 'change'\n });\n};\n/**\n * Adds quality levels to list once playlist metadata is available\n *\n * @param {QualityLevelList} qualityLevels The QualityLevelList to attach events to.\n * @param {Object} hls Hls object to listen to for media events.\n * @function handleHlsLoadedMetadata\n */\n\n\nvar handleHlsLoadedMetadata = function handleHlsLoadedMetadata(qualityLevels, hls) {\n hls.representations().forEach(function (rep) {\n qualityLevels.addQualityLevel(rep);\n });\n handleHlsMediaChange(qualityLevels, hls.playlists);\n}; // HLS is a source handler, not a tech. Make sure attempts to use it\n// as one do not cause exceptions.\n\n\nHls$1.canPlaySource = function () {\n return videojs$1.log.warn('HLS is no longer a tech. Please remove it from ' + 'your player\\'s techOrder.');\n};\n\nvar emeKeySystems = function emeKeySystems(keySystemOptions, videoPlaylist, audioPlaylist) {\n if (!keySystemOptions) {\n return keySystemOptions;\n } // upsert the content types based on the selected playlist\n\n\n var keySystemContentTypes = {};\n\n for (var keySystem in keySystemOptions) {\n keySystemContentTypes[keySystem] = {\n audioContentType: 'audio/mp4; codecs=\"' + audioPlaylist.attributes.CODECS + '\"',\n videoContentType: 'video/mp4; codecs=\"' + videoPlaylist.attributes.CODECS + '\"'\n };\n\n if (videoPlaylist.contentProtection && videoPlaylist.contentProtection[keySystem] && videoPlaylist.contentProtection[keySystem].pssh) {\n keySystemContentTypes[keySystem].pssh = videoPlaylist.contentProtection[keySystem].pssh;\n } // videojs-contrib-eme accepts the option of specifying: 'com.some.cdm': 'url'\n // so we need to prevent overwriting the URL entirely\n\n\n if (typeof keySystemOptions[keySystem] === 'string') {\n keySystemContentTypes[keySystem].url = keySystemOptions[keySystem];\n }\n }\n\n return videojs$1.mergeOptions(keySystemOptions, keySystemContentTypes);\n};\n\nvar setupEmeOptions = function setupEmeOptions(hlsHandler) {\n if (hlsHandler.options_.sourceType !== 'dash') {\n return;\n }\n\n var player = videojs$1.players[hlsHandler.tech_.options_.playerId];\n\n if (player.eme) {\n var sourceOptions = emeKeySystems(hlsHandler.source_.keySystems, hlsHandler.playlists.media(), hlsHandler.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader.media());\n\n if (sourceOptions) {\n player.currentSource().keySystems = sourceOptions; // works around https://bugs.chromium.org/p/chromium/issues/detail?id=895449\n\n if (player.eme.initializeMediaKeys) {\n player.eme.initializeMediaKeys();\n }\n }\n }\n};\n\nvar getVhsLocalStorage = function getVhsLocalStorage() {\n if (!window.localStorage) {\n return null;\n }\n\n var storedObject = window.localStorage.getItem(LOCAL_STORAGE_KEY$1);\n\n if (!storedObject) {\n return null;\n }\n\n try {\n return JSON.parse(storedObject);\n } catch (e) {\n // someone may have tampered with the value\n return null;\n }\n};\n\nvar updateVhsLocalStorage = function updateVhsLocalStorage(options) {\n if (!window.localStorage) {\n return false;\n }\n\n var objectToStore = getVhsLocalStorage();\n objectToStore = objectToStore ? videojs$1.mergeOptions(objectToStore, options) : options;\n\n try {\n window.localStorage.setItem(LOCAL_STORAGE_KEY$1, JSON.stringify(objectToStore));\n } catch (e) {\n // Throws if storage is full (e.g., always on iOS 5+ Safari private mode, where\n // storage is set to 0).\n // https://developer.mozilla.org/en-US/docs/Web/API/Storage/setItem#Exceptions\n // No need to perform any operation.\n return false;\n }\n\n return objectToStore;\n};\n/**\n * Whether the browser has built-in HLS support.\n */\n\n\nHls$1.supportsNativeHls = function () {\n var video = document.createElement('video'); // native HLS is definitely not supported if HTML5 video isn't\n\n if (!videojs$1.getTech('Html5').isSupported()) {\n return false;\n } // HLS manifests can go by many mime-types\n\n\n var canPlay = [// Apple santioned\n 'application/vnd.apple.mpegurl', // Apple sanctioned for backwards compatibility\n 'audio/mpegurl', // Very common\n 'audio/x-mpegurl', // Very common\n 'application/x-mpegurl', // Included for completeness\n 'video/x-mpegurl', 'video/mpegurl', 'application/mpegurl'];\n return canPlay.some(function (canItPlay) {\n return /maybe|probably/i.test(video.canPlayType(canItPlay));\n });\n}();\n\nHls$1.supportsNativeDash = function () {\n if (!videojs$1.getTech('Html5').isSupported()) {\n return false;\n }\n\n return /maybe|probably/i.test(document.createElement('video').canPlayType('application/dash+xml'));\n}();\n\nHls$1.supportsTypeNatively = function (type) {\n if (type === 'hls') {\n return Hls$1.supportsNativeHls;\n }\n\n if (type === 'dash') {\n return Hls$1.supportsNativeDash;\n }\n\n return false;\n};\n/**\n * HLS is a source handler, not a tech. Make sure attempts to use it\n * as one do not cause exceptions.\n */\n\n\nHls$1.isSupported = function () {\n return videojs$1.log.warn('HLS is no longer a tech. Please remove it from ' + 'your player\\'s techOrder.');\n};\n\nvar Component$1 = videojs$1.getComponent('Component');\n/**\n * The Hls Handler object, where we orchestrate all of the parts\n * of HLS to interact with video.js\n *\n * @class HlsHandler\n * @extends videojs.Component\n * @param {Object} source the soruce object\n * @param {Tech} tech the parent tech object\n * @param {Object} options optional and required options\n */\n\nvar HlsHandler = function (_Component) {\n inherits(HlsHandler, _Component);\n\n function HlsHandler(source, tech, options) {\n classCallCheck(this, HlsHandler); // tech.player() is deprecated but setup a reference to HLS for\n // backwards-compatibility\n\n var _this = possibleConstructorReturn(this, (HlsHandler.__proto__ || Object.getPrototypeOf(HlsHandler)).call(this, tech, options.hls));\n\n if (tech.options_ && tech.options_.playerId) {\n var _player = videojs$1(tech.options_.playerId);\n\n if (!_player.hasOwnProperty('hls')) {\n Object.defineProperty(_player, 'hls', {\n get: function get$$1() {\n videojs$1.log.warn('player.hls is deprecated. Use player.tech().hls instead.');\n tech.trigger({\n type: 'usage',\n name: 'hls-player-access'\n });\n return _this;\n },\n configurable: true\n });\n } // Set up a reference to the HlsHandler from player.vhs. This allows users to start\n // migrating from player.tech_.hls... to player.vhs... for API access. Although this\n // isn't the most appropriate form of reference for video.js (since all APIs should\n // be provided through core video.js), it is a common pattern for plugins, and vhs\n // will act accordingly.\n\n\n _player.vhs = _this; // deprecated, for backwards compatibility\n\n _player.dash = _this;\n _this.player_ = _player;\n }\n\n _this.tech_ = tech;\n _this.source_ = source;\n _this.stats = {};\n\n _this.setOptions_();\n\n if (_this.options_.overrideNative && tech.overrideNativeAudioTracks && tech.overrideNativeVideoTracks) {\n tech.overrideNativeAudioTracks(true);\n tech.overrideNativeVideoTracks(true);\n } else if (_this.options_.overrideNative && (tech.featuresNativeVideoTracks || tech.featuresNativeAudioTracks)) {\n // overriding native HLS only works if audio tracks have been emulated\n // error early if we're misconfigured\n throw new Error('Overriding native HLS requires emulated tracks. ' + 'See https://git.io/vMpjB');\n } // listen for fullscreenchange events for this player so that we\n // can adjust our quality selection quickly\n\n\n _this.on(document, ['fullscreenchange', 'webkitfullscreenchange', 'mozfullscreenchange', 'MSFullscreenChange'], function (event) {\n var fullscreenElement = document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement;\n\n if (fullscreenElement && fullscreenElement.contains(_this.tech_.el())) {\n _this.masterPlaylistController_.smoothQualityChange_();\n }\n }); // Handle seeking when looping - middleware doesn't handle this seek event from the tech\n\n\n _this.on(_this.tech_, 'seeking', function () {\n if (this.tech_.seeking() && this.tech_.currentTime() === 0 && this.tech_.player_.loop()) {\n this.setCurrentTime(0);\n }\n });\n\n _this.on(_this.tech_, 'error', function () {\n if (this.masterPlaylistController_) {\n this.masterPlaylistController_.pauseLoading();\n }\n });\n\n _this.on(_this.tech_, 'play', _this.play);\n\n return _this;\n }\n\n createClass(HlsHandler, [{\n key: 'setOptions_',\n value: function setOptions_() {\n var _this2 = this; // defaults\n\n\n this.options_.withCredentials = this.options_.withCredentials || false;\n this.options_.limitRenditionByPlayerDimensions = this.options_.limitRenditionByPlayerDimensions === false ? false : true;\n this.options_.smoothQualityChange = this.options_.smoothQualityChange || false;\n this.options_.useBandwidthFromLocalStorage = typeof this.source_.useBandwidthFromLocalStorage !== 'undefined' ? this.source_.useBandwidthFromLocalStorage : this.options_.useBandwidthFromLocalStorage || false;\n\n if (typeof this.options_.blacklistDuration !== 'number') {\n this.options_.blacklistDuration = 5 * 60;\n }\n\n if (typeof this.options_.bandwidth !== 'number') {\n if (this.options_.useBandwidthFromLocalStorage) {\n var storedObject = getVhsLocalStorage();\n\n if (storedObject && storedObject.bandwidth) {\n this.options_.bandwidth = storedObject.bandwidth;\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-bandwidth-from-local-storage'\n });\n }\n\n if (storedObject && storedObject.throughput) {\n this.options_.throughput = storedObject.throughput;\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-throughput-from-local-storage'\n });\n }\n }\n } // if bandwidth was not set by options or pulled from local storage, start playlist\n // selection at a reasonable bandwidth\n\n\n if (typeof this.options_.bandwidth !== 'number') {\n this.options_.bandwidth = Config.INITIAL_BANDWIDTH;\n } // If the bandwidth number is unchanged from the initial setting\n // then this takes precedence over the enableLowInitialPlaylist option\n\n\n this.options_.enableLowInitialPlaylist = this.options_.enableLowInitialPlaylist && this.options_.bandwidth === Config.INITIAL_BANDWIDTH; // grab options passed to player.src\n\n ['withCredentials', 'limitRenditionByPlayerDimensions', 'bandwidth', 'smoothQualityChange'].forEach(function (option) {\n if (typeof _this2.source_[option] !== 'undefined') {\n _this2.options_[option] = _this2.source_[option];\n }\n });\n this.limitRenditionByPlayerDimensions = this.options_.limitRenditionByPlayerDimensions;\n }\n /**\n * called when player.src gets called, handle a new source\n *\n * @param {Object} src the source object to handle\n */\n\n }, {\n key: 'src',\n value: function src(_src, type) {\n var _this3 = this; // do nothing if the src is falsey\n\n\n if (!_src) {\n return;\n }\n\n this.setOptions_(); // add master playlist controller options\n\n this.options_.url = this.source_.src;\n this.options_.tech = this.tech_;\n this.options_.externHls = Hls$1;\n this.options_.sourceType = simpleTypeFromSourceType(type); // Whenever we seek internally, we should update both the tech and call our own\n // setCurrentTime function. This is needed because \"seeking\" events aren't always\n // reliable. External seeks (via the player object) are handled via middleware.\n\n this.options_.seekTo = function (time) {\n _this3.tech_.setCurrentTime(time);\n\n _this3.setCurrentTime(time);\n };\n\n this.masterPlaylistController_ = new MasterPlaylistController(this.options_);\n this.playbackWatcher_ = new PlaybackWatcher(videojs$1.mergeOptions(this.options_, {\n seekable: function seekable$$1() {\n return _this3.seekable();\n }\n }));\n this.masterPlaylistController_.on('error', function () {\n var player = videojs$1.players[_this3.tech_.options_.playerId];\n player.error(_this3.masterPlaylistController_.error);\n }); // `this` in selectPlaylist should be the HlsHandler for backwards\n // compatibility with < v2\n\n this.masterPlaylistController_.selectPlaylist = this.selectPlaylist ? this.selectPlaylist.bind(this) : Hls$1.STANDARD_PLAYLIST_SELECTOR.bind(this);\n this.masterPlaylistController_.selectInitialPlaylist = Hls$1.INITIAL_PLAYLIST_SELECTOR.bind(this); // re-expose some internal objects for backwards compatibility with < v2\n\n this.playlists = this.masterPlaylistController_.masterPlaylistLoader_;\n this.mediaSource = this.masterPlaylistController_.mediaSource; // Proxy assignment of some properties to the master playlist\n // controller. Using a custom property for backwards compatibility\n // with < v2\n\n Object.defineProperties(this, {\n selectPlaylist: {\n get: function get$$1() {\n return this.masterPlaylistController_.selectPlaylist;\n },\n set: function set$$1(selectPlaylist) {\n this.masterPlaylistController_.selectPlaylist = selectPlaylist.bind(this);\n }\n },\n throughput: {\n get: function get$$1() {\n return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate;\n },\n set: function set$$1(throughput) {\n this.masterPlaylistController_.mainSegmentLoader_.throughput.rate = throughput; // By setting `count` to 1 the throughput value becomes the starting value\n // for the cumulative average\n\n this.masterPlaylistController_.mainSegmentLoader_.throughput.count = 1;\n }\n },\n bandwidth: {\n get: function get$$1() {\n return this.masterPlaylistController_.mainSegmentLoader_.bandwidth;\n },\n set: function set$$1(bandwidth) {\n this.masterPlaylistController_.mainSegmentLoader_.bandwidth = bandwidth; // setting the bandwidth manually resets the throughput counter\n // `count` is set to zero that current value of `rate` isn't included\n // in the cumulative average\n\n this.masterPlaylistController_.mainSegmentLoader_.throughput = {\n rate: 0,\n count: 0\n };\n }\n },\n\n /**\n * `systemBandwidth` is a combination of two serial processes bit-rates. The first\n * is the network bitrate provided by `bandwidth` and the second is the bitrate of\n * the entire process after that - decryption, transmuxing, and appending - provided\n * by `throughput`.\n *\n * Since the two process are serial, the overall system bandwidth is given by:\n * sysBandwidth = 1 / (1 / bandwidth + 1 / throughput)\n */\n systemBandwidth: {\n get: function get$$1() {\n var invBandwidth = 1 / (this.bandwidth || 1);\n var invThroughput = void 0;\n\n if (this.throughput > 0) {\n invThroughput = 1 / this.throughput;\n } else {\n invThroughput = 0;\n }\n\n var systemBitrate = Math.floor(1 / (invBandwidth + invThroughput));\n return systemBitrate;\n },\n set: function set$$1() {\n videojs$1.log.error('The \"systemBandwidth\" property is read-only');\n }\n }\n });\n\n if (this.options_.bandwidth) {\n this.bandwidth = this.options_.bandwidth;\n }\n\n if (this.options_.throughput) {\n this.throughput = this.options_.throughput;\n }\n\n Object.defineProperties(this.stats, {\n bandwidth: {\n get: function get$$1() {\n return _this3.bandwidth || 0;\n },\n enumerable: true\n },\n mediaRequests: {\n get: function get$$1() {\n return _this3.masterPlaylistController_.mediaRequests_() || 0;\n },\n enumerable: true\n },\n mediaRequestsAborted: {\n get: function get$$1() {\n return _this3.masterPlaylistController_.mediaRequestsAborted_() || 0;\n },\n enumerable: true\n },\n mediaRequestsTimedout: {\n get: function get$$1() {\n return _this3.masterPlaylistController_.mediaRequestsTimedout_() || 0;\n },\n enumerable: true\n },\n mediaRequestsErrored: {\n get: function get$$1() {\n return _this3.masterPlaylistController_.mediaRequestsErrored_() || 0;\n },\n enumerable: true\n },\n mediaTransferDuration: {\n get: function get$$1() {\n return _this3.masterPlaylistController_.mediaTransferDuration_() || 0;\n },\n enumerable: true\n },\n mediaBytesTransferred: {\n get: function get$$1() {\n return _this3.masterPlaylistController_.mediaBytesTransferred_() || 0;\n },\n enumerable: true\n },\n mediaSecondsLoaded: {\n get: function get$$1() {\n return _this3.masterPlaylistController_.mediaSecondsLoaded_() || 0;\n },\n enumerable: true\n },\n buffered: {\n get: function get$$1() {\n return timeRangesToArray(_this3.tech_.buffered());\n },\n enumerable: true\n },\n currentTime: {\n get: function get$$1() {\n return _this3.tech_.currentTime();\n },\n enumerable: true\n },\n currentSource: {\n get: function get$$1() {\n return _this3.tech_.currentSource_;\n },\n enumerable: true\n },\n currentTech: {\n get: function get$$1() {\n return _this3.tech_.name_;\n },\n enumerable: true\n },\n duration: {\n get: function get$$1() {\n return _this3.tech_.duration();\n },\n enumerable: true\n },\n master: {\n get: function get$$1() {\n return _this3.playlists.master;\n },\n enumerable: true\n },\n playerDimensions: {\n get: function get$$1() {\n return _this3.tech_.currentDimensions();\n },\n enumerable: true\n },\n seekable: {\n get: function get$$1() {\n return timeRangesToArray(_this3.tech_.seekable());\n },\n enumerable: true\n },\n timestamp: {\n get: function get$$1() {\n return Date.now();\n },\n enumerable: true\n },\n videoPlaybackQuality: {\n get: function get$$1() {\n return _this3.tech_.getVideoPlaybackQuality();\n },\n enumerable: true\n }\n });\n this.tech_.one('canplay', this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_));\n this.tech_.on('bandwidthupdate', function () {\n if (_this3.options_.useBandwidthFromLocalStorage) {\n updateVhsLocalStorage({\n bandwidth: _this3.bandwidth,\n throughput: Math.round(_this3.throughput)\n });\n }\n });\n this.masterPlaylistController_.on('selectedinitialmedia', function () {\n // Add the manual rendition mix-in to HlsHandler\n renditionSelectionMixin(_this3);\n setupEmeOptions(_this3);\n }); // the bandwidth of the primary segment loader is our best\n // estimate of overall bandwidth\n\n this.on(this.masterPlaylistController_, 'progress', function () {\n this.tech_.trigger('progress');\n });\n this.tech_.ready(function () {\n return _this3.setupQualityLevels_();\n }); // do nothing if the tech has been disposed already\n // this can occur if someone sets the src in player.ready(), for instance\n\n if (!this.tech_.el()) {\n return;\n }\n\n this.tech_.src(videojs$1.URL.createObjectURL(this.masterPlaylistController_.mediaSource));\n }\n /**\n * Initializes the quality levels and sets listeners to update them.\n *\n * @method setupQualityLevels_\n * @private\n */\n\n }, {\n key: 'setupQualityLevels_',\n value: function setupQualityLevels_() {\n var _this4 = this;\n\n var player = videojs$1.players[this.tech_.options_.playerId];\n\n if (player && player.qualityLevels) {\n this.qualityLevels_ = player.qualityLevels();\n this.masterPlaylistController_.on('selectedinitialmedia', function () {\n handleHlsLoadedMetadata(_this4.qualityLevels_, _this4);\n });\n this.playlists.on('mediachange', function () {\n handleHlsMediaChange(_this4.qualityLevels_, _this4.playlists);\n });\n }\n }\n /**\n * Begin playing the video.\n */\n\n }, {\n key: 'play',\n value: function play() {\n this.masterPlaylistController_.play();\n }\n /**\n * a wrapper around the function in MasterPlaylistController\n */\n\n }, {\n key: 'setCurrentTime',\n value: function setCurrentTime(currentTime) {\n this.masterPlaylistController_.setCurrentTime(currentTime);\n }\n /**\n * a wrapper around the function in MasterPlaylistController\n */\n\n }, {\n key: 'duration',\n value: function duration$$1() {\n return this.masterPlaylistController_.duration();\n }\n /**\n * a wrapper around the function in MasterPlaylistController\n */\n\n }, {\n key: 'seekable',\n value: function seekable$$1() {\n return this.masterPlaylistController_.seekable();\n }\n /**\n * Abort all outstanding work and cleanup.\n */\n\n }, {\n key: 'dispose',\n value: function dispose() {\n if (this.playbackWatcher_) {\n this.playbackWatcher_.dispose();\n }\n\n if (this.masterPlaylistController_) {\n this.masterPlaylistController_.dispose();\n }\n\n if (this.qualityLevels_) {\n this.qualityLevels_.dispose();\n }\n\n if (this.player_) {\n delete this.player_.vhs;\n delete this.player_.dash;\n delete this.player_.hls;\n }\n\n if (this.tech_ && this.tech_.hls) {\n delete this.tech_.hls;\n }\n\n get$1(HlsHandler.prototype.__proto__ || Object.getPrototypeOf(HlsHandler.prototype), 'dispose', this).call(this);\n }\n }, {\n key: 'convertToStreamTime',\n value: function convertToStreamTime(time, callback) {\n return getStreamTime({\n playlist: this.masterPlaylistController_.media(),\n time: time,\n callback: callback\n });\n } // the player must be playing before calling this\n\n }, {\n key: 'seekToStreamTime',\n value: function seekToStreamTime$$1(streamTime, callback) {\n var pauseAfterSeek = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n var retryCount = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 2;\n return seekToStreamTime({\n streamTime: streamTime,\n playlist: this.masterPlaylistController_.media(),\n retryCount: retryCount,\n pauseAfterSeek: pauseAfterSeek,\n seekTo: this.options_.seekTo,\n tech: this.options_.tech,\n callback: callback\n });\n }\n }]);\n return HlsHandler;\n}(Component$1);\n/**\n * The Source Handler object, which informs video.js what additional\n * MIME types are supported and sets up playback. It is registered\n * automatically to the appropriate tech based on the capabilities of\n * the browser it is running in. It is not necessary to use or modify\n * this object in normal usage.\n */\n\n\nvar HlsSourceHandler = {\n name: 'videojs-http-streaming',\n VERSION: version$1,\n canHandleSource: function canHandleSource(srcObj) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var localOptions = videojs$1.mergeOptions(videojs$1.options, options);\n return HlsSourceHandler.canPlayType(srcObj.type, localOptions);\n },\n handleSource: function handleSource(source, tech) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var localOptions = videojs$1.mergeOptions(videojs$1.options, options);\n tech.hls = new HlsHandler(source, tech, localOptions);\n tech.hls.xhr = xhrFactory();\n tech.hls.src(source.src, source.type);\n return tech.hls;\n },\n canPlayType: function canPlayType(type) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var _videojs$mergeOptions = videojs$1.mergeOptions(videojs$1.options, options),\n overrideNative = _videojs$mergeOptions.hls.overrideNative;\n\n var supportedType = simpleTypeFromSourceType(type);\n var canUseMsePlayback = supportedType && (!Hls$1.supportsTypeNatively(supportedType) || overrideNative);\n return canUseMsePlayback ? 'maybe' : '';\n }\n};\n\nif (typeof videojs$1.MediaSource === 'undefined' || typeof videojs$1.URL === 'undefined') {\n videojs$1.MediaSource = MediaSource;\n videojs$1.URL = URL$1;\n} // register source handlers with the appropriate techs\n\n\nif (MediaSource.supportsNativeMediaSources()) {\n videojs$1.getTech('Html5').registerSourceHandler(HlsSourceHandler, 0);\n}\n\nvideojs$1.HlsHandler = HlsHandler;\nvideojs$1.HlsSourceHandler = HlsSourceHandler;\nvideojs$1.Hls = Hls$1;\n\nif (!videojs$1.use) {\n videojs$1.registerComponent('Hls', Hls$1);\n}\n\nvideojs$1.options.hls = videojs$1.options.hls || {};\n\nif (videojs$1.registerPlugin) {\n videojs$1.registerPlugin('reloadSourceOnError', reloadSourceOnError);\n} else {\n videojs$1.plugin('reloadSourceOnError', reloadSourceOnError);\n}\n\nexport default videojs$1;\n","/**\n * Copyright 2013 vtt.js Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Default exports for Node. Export the extended versions of VTTCue and\n// VTTRegion in Node since we likely want the capability to convert back and\n// forth between JSON. If we don't then it's not that big of a deal since we're\n// off browser.\n\nvar window = require('global/window');\n\nvar vttjs = module.exports = {\n WebVTT: require(\"./vtt.js\"),\n VTTCue: require(\"./vttcue.js\"),\n VTTRegion: require(\"./vttregion.js\")\n};\n\nwindow.vttjs = vttjs;\nwindow.WebVTT = vttjs.WebVTT;\n\nvar cueShim = vttjs.VTTCue;\nvar regionShim = vttjs.VTTRegion;\nvar nativeVTTCue = window.VTTCue;\nvar nativeVTTRegion = window.VTTRegion;\n\nvttjs.shim = function() {\n window.VTTCue = cueShim;\n window.VTTRegion = regionShim;\n};\n\nvttjs.restore = function() {\n window.VTTCue = nativeVTTCue;\n window.VTTRegion = nativeVTTRegion;\n};\n\nif (!window.VTTCue) {\n vttjs.shim();\n}\n","/**\n * Copyright 2013 vtt.js Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */\nvar _objCreate = Object.create || (function() {\n function F() {}\n return function(o) {\n if (arguments.length !== 1) {\n throw new Error('Object.create shim only accepts one parameter.');\n }\n F.prototype = o;\n return new F();\n };\n})();\n\n// Creates a new ParserError object from an errorData object. The errorData\n// object should have default code and message properties. The default message\n// property can be overriden by passing in a message parameter.\n// See ParsingError.Errors below for acceptable errors.\nfunction ParsingError(errorData, message) {\n this.name = \"ParsingError\";\n this.code = errorData.code;\n this.message = message || errorData.message;\n}\nParsingError.prototype = _objCreate(Error.prototype);\nParsingError.prototype.constructor = ParsingError;\n\n// ParsingError metadata for acceptable ParsingErrors.\nParsingError.Errors = {\n BadSignature: {\n code: 0,\n message: \"Malformed WebVTT signature.\"\n },\n BadTimeStamp: {\n code: 1,\n message: \"Malformed time stamp.\"\n }\n};\n\n// Try to parse input as a time stamp.\nfunction parseTimeStamp(input) {\n\n function computeSeconds(h, m, s, f) {\n return (h | 0) * 3600 + (m | 0) * 60 + (s | 0) + (f | 0) / 1000;\n }\n\n var m = input.match(/^(\\d+):(\\d{2})(:\\d{2})?\\.(\\d{3})/);\n if (!m) {\n return null;\n }\n\n if (m[3]) {\n // Timestamp takes the form of [hours]:[minutes]:[seconds].[milliseconds]\n return computeSeconds(m[1], m[2], m[3].replace(\":\", \"\"), m[4]);\n } else if (m[1] > 59) {\n // Timestamp takes the form of [hours]:[minutes].[milliseconds]\n // First position is hours as it's over 59.\n return computeSeconds(m[1], m[2], 0, m[4]);\n } else {\n // Timestamp takes the form of [minutes]:[seconds].[milliseconds]\n return computeSeconds(0, m[1], m[2], m[4]);\n }\n}\n\n// A settings object holds key/value pairs and will ignore anything but the first\n// assignment to a specific key.\nfunction Settings() {\n this.values = _objCreate(null);\n}\n\nSettings.prototype = {\n // Only accept the first assignment to any key.\n set: function(k, v) {\n if (!this.get(k) && v !== \"\") {\n this.values[k] = v;\n }\n },\n // Return the value for a key, or a default value.\n // If 'defaultKey' is passed then 'dflt' is assumed to be an object with\n // a number of possible default values as properties where 'defaultKey' is\n // the key of the property that will be chosen; otherwise it's assumed to be\n // a single value.\n get: function(k, dflt, defaultKey) {\n if (defaultKey) {\n return this.has(k) ? this.values[k] : dflt[defaultKey];\n }\n return this.has(k) ? this.values[k] : dflt;\n },\n // Check whether we have a value for a key.\n has: function(k) {\n return k in this.values;\n },\n // Accept a setting if its one of the given alternatives.\n alt: function(k, v, a) {\n for (var n = 0; n < a.length; ++n) {\n if (v === a[n]) {\n this.set(k, v);\n break;\n }\n }\n },\n // Accept a setting if its a valid (signed) integer.\n integer: function(k, v) {\n if (/^-?\\d+$/.test(v)) { // integer\n this.set(k, parseInt(v, 10));\n }\n },\n // Accept a setting if its a valid percentage.\n percent: function(k, v) {\n var m;\n if ((m = v.match(/^([\\d]{1,3})(\\.[\\d]*)?%$/))) {\n v = parseFloat(v);\n if (v >= 0 && v <= 100) {\n this.set(k, v);\n return true;\n }\n }\n return false;\n }\n};\n\n// Helper function to parse input into groups separated by 'groupDelim', and\n// interprete each group as a key/value pair separated by 'keyValueDelim'.\nfunction parseOptions(input, callback, keyValueDelim, groupDelim) {\n var groups = groupDelim ? input.split(groupDelim) : [input];\n for (var i in groups) {\n if (typeof groups[i] !== \"string\") {\n continue;\n }\n var kv = groups[i].split(keyValueDelim);\n if (kv.length !== 2) {\n continue;\n }\n var k = kv[0];\n var v = kv[1];\n callback(k, v);\n }\n}\n\nfunction parseCue(input, cue, regionList) {\n // Remember the original input if we need to throw an error.\n var oInput = input;\n // 4.1 WebVTT timestamp\n function consumeTimeStamp() {\n var ts = parseTimeStamp(input);\n if (ts === null) {\n throw new ParsingError(ParsingError.Errors.BadTimeStamp,\n \"Malformed timestamp: \" + oInput);\n }\n // Remove time stamp from input.\n input = input.replace(/^[^\\sa-zA-Z-]+/, \"\");\n return ts;\n }\n\n // 4.4.2 WebVTT cue settings\n function consumeCueSettings(input, cue) {\n var settings = new Settings();\n\n parseOptions(input, function (k, v) {\n switch (k) {\n case \"region\":\n // Find the last region we parsed with the same region id.\n for (var i = regionList.length - 1; i >= 0; i--) {\n if (regionList[i].id === v) {\n settings.set(k, regionList[i].region);\n break;\n }\n }\n break;\n case \"vertical\":\n settings.alt(k, v, [\"rl\", \"lr\"]);\n break;\n case \"line\":\n var vals = v.split(\",\"),\n vals0 = vals[0];\n settings.integer(k, vals0);\n settings.percent(k, vals0) ? settings.set(\"snapToLines\", false) : null;\n settings.alt(k, vals0, [\"auto\"]);\n if (vals.length === 2) {\n settings.alt(\"lineAlign\", vals[1], [\"start\", \"middle\", \"end\"]);\n }\n break;\n case \"position\":\n vals = v.split(\",\");\n settings.percent(k, vals[0]);\n if (vals.length === 2) {\n settings.alt(\"positionAlign\", vals[1], [\"start\", \"middle\", \"end\"]);\n }\n break;\n case \"size\":\n settings.percent(k, v);\n break;\n case \"align\":\n settings.alt(k, v, [\"start\", \"middle\", \"end\", \"left\", \"right\"]);\n break;\n }\n }, /:/, /\\s/);\n\n // Apply default values for any missing fields.\n cue.region = settings.get(\"region\", null);\n cue.vertical = settings.get(\"vertical\", \"\");\n cue.line = settings.get(\"line\", \"auto\");\n cue.lineAlign = settings.get(\"lineAlign\", \"start\");\n cue.snapToLines = settings.get(\"snapToLines\", true);\n cue.size = settings.get(\"size\", 100);\n cue.align = settings.get(\"align\", \"middle\");\n cue.position = settings.get(\"position\", {\n start: 0,\n left: 0,\n middle: 50,\n end: 100,\n right: 100\n }, cue.align);\n cue.positionAlign = settings.get(\"positionAlign\", {\n start: \"start\",\n left: \"start\",\n middle: \"middle\",\n end: \"end\",\n right: \"end\"\n }, cue.align);\n }\n\n function skipWhitespace() {\n input = input.replace(/^\\s+/, \"\");\n }\n\n // 4.1 WebVTT cue timings.\n skipWhitespace();\n cue.startTime = consumeTimeStamp(); // (1) collect cue start time\n skipWhitespace();\n if (input.substr(0, 3) !== \"-->\") { // (3) next characters must match \"-->\"\n throw new ParsingError(ParsingError.Errors.BadTimeStamp,\n \"Malformed time stamp (time stamps must be separated by '-->'): \" +\n oInput);\n }\n input = input.substr(3);\n skipWhitespace();\n cue.endTime = consumeTimeStamp(); // (5) collect cue end time\n\n // 4.1 WebVTT cue settings list.\n skipWhitespace();\n consumeCueSettings(input, cue);\n}\n\nvar ESCAPE = {\n \"&amp;\": \"&\",\n \"&lt;\": \"<\",\n \"&gt;\": \">\",\n \"&lrm;\": \"\\u200e\",\n \"&rlm;\": \"\\u200f\",\n \"&nbsp;\": \"\\u00a0\"\n};\n\nvar TAG_NAME = {\n c: \"span\",\n i: \"i\",\n b: \"b\",\n u: \"u\",\n ruby: \"ruby\",\n rt: \"rt\",\n v: \"span\",\n lang: \"span\"\n};\n\nvar TAG_ANNOTATION = {\n v: \"title\",\n lang: \"lang\"\n};\n\nvar NEEDS_PARENT = {\n rt: \"ruby\"\n};\n\n// Parse content into a document fragment.\nfunction parseContent(window, input) {\n function nextToken() {\n // Check for end-of-string.\n if (!input) {\n return null;\n }\n\n // Consume 'n' characters from the input.\n function consume(result) {\n input = input.substr(result.length);\n return result;\n }\n\n var m = input.match(/^([^<]*)(<[^>]*>?)?/);\n // If there is some text before the next tag, return it, otherwise return\n // the tag.\n return consume(m[1] ? m[1] : m[2]);\n }\n\n // Unescape a string 's'.\n function unescape1(e) {\n return ESCAPE[e];\n }\n function unescape(s) {\n while ((m = s.match(/&(amp|lt|gt|lrm|rlm|nbsp);/))) {\n s = s.replace(m[0], unescape1);\n }\n return s;\n }\n\n function shouldAdd(current, element) {\n return !NEEDS_PARENT[element.localName] ||\n NEEDS_PARENT[element.localName] === current.localName;\n }\n\n // Create an element for this tag.\n function createElement(type, annotation) {\n var tagName = TAG_NAME[type];\n if (!tagName) {\n return null;\n }\n var element = window.document.createElement(tagName);\n element.localName = tagName;\n var name = TAG_ANNOTATION[type];\n if (name && annotation) {\n element[name] = annotation.trim();\n }\n return element;\n }\n\n var rootDiv = window.document.createElement(\"div\"),\n current = rootDiv,\n t,\n tagStack = [];\n\n while ((t = nextToken()) !== null) {\n if (t[0] === '<') {\n if (t[1] === \"/\") {\n // If the closing tag matches, move back up to the parent node.\n if (tagStack.length &&\n tagStack[tagStack.length - 1] === t.substr(2).replace(\">\", \"\")) {\n tagStack.pop();\n current = current.parentNode;\n }\n // Otherwise just ignore the end tag.\n continue;\n }\n var ts = parseTimeStamp(t.substr(1, t.length - 2));\n var node;\n if (ts) {\n // Timestamps are lead nodes as well.\n node = window.document.createProcessingInstruction(\"timestamp\", ts);\n current.appendChild(node);\n continue;\n }\n var m = t.match(/^<([^.\\s/0-9>]+)(\\.[^\\s\\\\>]+)?([^>\\\\]+)?(\\\\?)>?$/);\n // If we can't parse the tag, skip to the next tag.\n if (!m) {\n continue;\n }\n // Try to construct an element, and ignore the tag if we couldn't.\n node = createElement(m[1], m[3]);\n if (!node) {\n continue;\n }\n // Determine if the tag should be added based on the context of where it\n // is placed in the cuetext.\n if (!shouldAdd(current, node)) {\n continue;\n }\n // Set the class list (as a list of classes, separated by space).\n if (m[2]) {\n node.className = m[2].substr(1).replace('.', ' ');\n }\n // Append the node to the current node, and enter the scope of the new\n // node.\n tagStack.push(m[1]);\n current.appendChild(node);\n current = node;\n continue;\n }\n\n // Text nodes are leaf nodes.\n current.appendChild(window.document.createTextNode(unescape(t)));\n }\n\n return rootDiv;\n}\n\n// This is a list of all the Unicode characters that have a strong\n// right-to-left category. What this means is that these characters are\n// written right-to-left for sure. It was generated by pulling all the strong\n// right-to-left characters out of the Unicode data table. That table can\n// found at: http://www.unicode.org/Public/UNIDATA/UnicodeData.txt\nvar strongRTLRanges = [[0x5be, 0x5be], [0x5c0, 0x5c0], [0x5c3, 0x5c3], [0x5c6, 0x5c6],\n [0x5d0, 0x5ea], [0x5f0, 0x5f4], [0x608, 0x608], [0x60b, 0x60b], [0x60d, 0x60d],\n [0x61b, 0x61b], [0x61e, 0x64a], [0x66d, 0x66f], [0x671, 0x6d5], [0x6e5, 0x6e6],\n [0x6ee, 0x6ef], [0x6fa, 0x70d], [0x70f, 0x710], [0x712, 0x72f], [0x74d, 0x7a5],\n [0x7b1, 0x7b1], [0x7c0, 0x7ea], [0x7f4, 0x7f5], [0x7fa, 0x7fa], [0x800, 0x815],\n [0x81a, 0x81a], [0x824, 0x824], [0x828, 0x828], [0x830, 0x83e], [0x840, 0x858],\n [0x85e, 0x85e], [0x8a0, 0x8a0], [0x8a2, 0x8ac], [0x200f, 0x200f],\n [0xfb1d, 0xfb1d], [0xfb1f, 0xfb28], [0xfb2a, 0xfb36], [0xfb38, 0xfb3c],\n [0xfb3e, 0xfb3e], [0xfb40, 0xfb41], [0xfb43, 0xfb44], [0xfb46, 0xfbc1],\n [0xfbd3, 0xfd3d], [0xfd50, 0xfd8f], [0xfd92, 0xfdc7], [0xfdf0, 0xfdfc],\n [0xfe70, 0xfe74], [0xfe76, 0xfefc], [0x10800, 0x10805], [0x10808, 0x10808],\n [0x1080a, 0x10835], [0x10837, 0x10838], [0x1083c, 0x1083c], [0x1083f, 0x10855],\n [0x10857, 0x1085f], [0x10900, 0x1091b], [0x10920, 0x10939], [0x1093f, 0x1093f],\n [0x10980, 0x109b7], [0x109be, 0x109bf], [0x10a00, 0x10a00], [0x10a10, 0x10a13],\n [0x10a15, 0x10a17], [0x10a19, 0x10a33], [0x10a40, 0x10a47], [0x10a50, 0x10a58],\n [0x10a60, 0x10a7f], [0x10b00, 0x10b35], [0x10b40, 0x10b55], [0x10b58, 0x10b72],\n [0x10b78, 0x10b7f], [0x10c00, 0x10c48], [0x1ee00, 0x1ee03], [0x1ee05, 0x1ee1f],\n [0x1ee21, 0x1ee22], [0x1ee24, 0x1ee24], [0x1ee27, 0x1ee27], [0x1ee29, 0x1ee32],\n [0x1ee34, 0x1ee37], [0x1ee39, 0x1ee39], [0x1ee3b, 0x1ee3b], [0x1ee42, 0x1ee42],\n [0x1ee47, 0x1ee47], [0x1ee49, 0x1ee49], [0x1ee4b, 0x1ee4b], [0x1ee4d, 0x1ee4f],\n [0x1ee51, 0x1ee52], [0x1ee54, 0x1ee54], [0x1ee57, 0x1ee57], [0x1ee59, 0x1ee59],\n [0x1ee5b, 0x1ee5b], [0x1ee5d, 0x1ee5d], [0x1ee5f, 0x1ee5f], [0x1ee61, 0x1ee62],\n [0x1ee64, 0x1ee64], [0x1ee67, 0x1ee6a], [0x1ee6c, 0x1ee72], [0x1ee74, 0x1ee77],\n [0x1ee79, 0x1ee7c], [0x1ee7e, 0x1ee7e], [0x1ee80, 0x1ee89], [0x1ee8b, 0x1ee9b],\n [0x1eea1, 0x1eea3], [0x1eea5, 0x1eea9], [0x1eeab, 0x1eebb], [0x10fffd, 0x10fffd]];\n\nfunction isStrongRTLChar(charCode) {\n for (var i = 0; i < strongRTLRanges.length; i++) {\n var currentRange = strongRTLRanges[i];\n if (charCode >= currentRange[0] && charCode <= currentRange[1]) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction determineBidi(cueDiv) {\n var nodeStack = [],\n text = \"\",\n charCode;\n\n if (!cueDiv || !cueDiv.childNodes) {\n return \"ltr\";\n }\n\n function pushNodes(nodeStack, node) {\n for (var i = node.childNodes.length - 1; i >= 0; i--) {\n nodeStack.push(node.childNodes[i]);\n }\n }\n\n function nextTextNode(nodeStack) {\n if (!nodeStack || !nodeStack.length) {\n return null;\n }\n\n var node = nodeStack.pop(),\n text = node.textContent || node.innerText;\n if (text) {\n // TODO: This should match all unicode type B characters (paragraph\n // separator characters). See issue #115.\n var m = text.match(/^.*(\\n|\\r)/);\n if (m) {\n nodeStack.length = 0;\n return m[0];\n }\n return text;\n }\n if (node.tagName === \"ruby\") {\n return nextTextNode(nodeStack);\n }\n if (node.childNodes) {\n pushNodes(nodeStack, node);\n return nextTextNode(nodeStack);\n }\n }\n\n pushNodes(nodeStack, cueDiv);\n while ((text = nextTextNode(nodeStack))) {\n for (var i = 0; i < text.length; i++) {\n charCode = text.charCodeAt(i);\n if (isStrongRTLChar(charCode)) {\n return \"rtl\";\n }\n }\n }\n return \"ltr\";\n}\n\nfunction computeLinePos(cue) {\n if (typeof cue.line === \"number\" &&\n (cue.snapToLines || (cue.line >= 0 && cue.line <= 100))) {\n return cue.line;\n }\n if (!cue.track || !cue.track.textTrackList ||\n !cue.track.textTrackList.mediaElement) {\n return -1;\n }\n var track = cue.track,\n trackList = track.textTrackList,\n count = 0;\n for (var i = 0; i < trackList.length && trackList[i] !== track; i++) {\n if (trackList[i].mode === \"showing\") {\n count++;\n }\n }\n return ++count * -1;\n}\n\nfunction StyleBox() {\n}\n\n// Apply styles to a div. If there is no div passed then it defaults to the\n// div on 'this'.\nStyleBox.prototype.applyStyles = function(styles, div) {\n div = div || this.div;\n for (var prop in styles) {\n if (styles.hasOwnProperty(prop)) {\n div.style[prop] = styles[prop];\n }\n }\n};\n\nStyleBox.prototype.formatStyle = function(val, unit) {\n return val === 0 ? 0 : val + unit;\n};\n\n// Constructs the computed display state of the cue (a div). Places the div\n// into the overlay which should be a block level element (usually a div).\nfunction CueStyleBox(window, cue, styleOptions) {\n StyleBox.call(this);\n this.cue = cue;\n\n // Parse our cue's text into a DOM tree rooted at 'cueDiv'. This div will\n // have inline positioning and will function as the cue background box.\n this.cueDiv = parseContent(window, cue.text);\n var styles = {\n color: \"rgba(255, 255, 255, 1)\",\n backgroundColor: \"rgba(0, 0, 0, 0.8)\",\n position: \"relative\",\n left: 0,\n right: 0,\n top: 0,\n bottom: 0,\n display: \"inline\",\n writingMode: cue.vertical === \"\" ? \"horizontal-tb\"\n : cue.vertical === \"lr\" ? \"vertical-lr\"\n : \"vertical-rl\",\n unicodeBidi: \"plaintext\"\n };\n\n this.applyStyles(styles, this.cueDiv);\n\n // Create an absolutely positioned div that will be used to position the cue\n // div. Note, all WebVTT cue-setting alignments are equivalent to the CSS\n // mirrors of them except \"middle\" which is \"center\" in CSS.\n this.div = window.document.createElement(\"div\");\n styles = {\n direction: determineBidi(this.cueDiv),\n writingMode: cue.vertical === \"\" ? \"horizontal-tb\"\n : cue.vertical === \"lr\" ? \"vertical-lr\"\n : \"vertical-rl\",\n unicodeBidi: \"plaintext\",\n textAlign: cue.align === \"middle\" ? \"center\" : cue.align,\n font: styleOptions.font,\n whiteSpace: \"pre-line\",\n position: \"absolute\"\n };\n\n this.applyStyles(styles);\n this.div.appendChild(this.cueDiv);\n\n // Calculate the distance from the reference edge of the viewport to the text\n // position of the cue box. The reference edge will be resolved later when\n // the box orientation styles are applied.\n var textPos = 0;\n switch (cue.positionAlign) {\n case \"start\":\n textPos = cue.position;\n break;\n case \"middle\":\n textPos = cue.position - (cue.size / 2);\n break;\n case \"end\":\n textPos = cue.position - cue.size;\n break;\n }\n\n // Horizontal box orientation; textPos is the distance from the left edge of the\n // area to the left edge of the box and cue.size is the distance extending to\n // the right from there.\n if (cue.vertical === \"\") {\n this.applyStyles({\n left: this.formatStyle(textPos, \"%\"),\n width: this.formatStyle(cue.size, \"%\")\n });\n // Vertical box orientation; textPos is the distance from the top edge of the\n // area to the top edge of the box and cue.size is the height extending\n // downwards from there.\n } else {\n this.applyStyles({\n top: this.formatStyle(textPos, \"%\"),\n height: this.formatStyle(cue.size, \"%\")\n });\n }\n\n this.move = function(box) {\n this.applyStyles({\n top: this.formatStyle(box.top, \"px\"),\n bottom: this.formatStyle(box.bottom, \"px\"),\n left: this.formatStyle(box.left, \"px\"),\n right: this.formatStyle(box.right, \"px\"),\n height: this.formatStyle(box.height, \"px\"),\n width: this.formatStyle(box.width, \"px\")\n });\n };\n}\nCueStyleBox.prototype = _objCreate(StyleBox.prototype);\nCueStyleBox.prototype.constructor = CueStyleBox;\n\n// Represents the co-ordinates of an Element in a way that we can easily\n// compute things with such as if it overlaps or intersects with another Element.\n// Can initialize it with either a StyleBox or another BoxPosition.\nfunction BoxPosition(obj) {\n // Either a BoxPosition was passed in and we need to copy it, or a StyleBox\n // was passed in and we need to copy the results of 'getBoundingClientRect'\n // as the object returned is readonly. All co-ordinate values are in reference\n // to the viewport origin (top left).\n var lh, height, width, top;\n if (obj.div) {\n height = obj.div.offsetHeight;\n width = obj.div.offsetWidth;\n top = obj.div.offsetTop;\n\n var rects = (rects = obj.div.childNodes) && (rects = rects[0]) &&\n rects.getClientRects && rects.getClientRects();\n obj = obj.div.getBoundingClientRect();\n // In certain cases the outter div will be slightly larger then the sum of\n // the inner div's lines. This could be due to bold text, etc, on some platforms.\n // In this case we should get the average line height and use that. This will\n // result in the desired behaviour.\n lh = rects ? Math.max((rects[0] && rects[0].height) || 0, obj.height / rects.length)\n : 0;\n\n }\n this.left = obj.left;\n this.right = obj.right;\n this.top = obj.top || top;\n this.height = obj.height || height;\n this.bottom = obj.bottom || (top + (obj.height || height));\n this.width = obj.width || width;\n this.lineHeight = lh !== undefined ? lh : obj.lineHeight;\n}\n\n// Move the box along a particular axis. Optionally pass in an amount to move\n// the box. If no amount is passed then the default is the line height of the\n// box.\nBoxPosition.prototype.move = function(axis, toMove) {\n toMove = toMove !== undefined ? toMove : this.lineHeight;\n switch (axis) {\n case \"+x\":\n this.left += toMove;\n this.right += toMove;\n break;\n case \"-x\":\n this.left -= toMove;\n this.right -= toMove;\n break;\n case \"+y\":\n this.top += toMove;\n this.bottom += toMove;\n break;\n case \"-y\":\n this.top -= toMove;\n this.bottom -= toMove;\n break;\n }\n};\n\n// Check if this box overlaps another box, b2.\nBoxPosition.prototype.overlaps = function(b2) {\n return this.left < b2.right &&\n this.right > b2.left &&\n this.top < b2.bottom &&\n this.bottom > b2.top;\n};\n\n// Check if this box overlaps any other boxes in boxes.\nBoxPosition.prototype.overlapsAny = function(boxes) {\n for (var i = 0; i < boxes.length; i++) {\n if (this.overlaps(boxes[i])) {\n return true;\n }\n }\n return false;\n};\n\n// Check if this box is within another box.\nBoxPosition.prototype.within = function(container) {\n return this.top >= container.top &&\n this.bottom <= container.bottom &&\n this.left >= container.left &&\n this.right <= container.right;\n};\n\n// Check if this box is entirely within the container or it is overlapping\n// on the edge opposite of the axis direction passed. For example, if \"+x\" is\n// passed and the box is overlapping on the left edge of the container, then\n// return true.\nBoxPosition.prototype.overlapsOppositeAxis = function(container, axis) {\n switch (axis) {\n case \"+x\":\n return this.left < container.left;\n case \"-x\":\n return this.right > container.right;\n case \"+y\":\n return this.top < container.top;\n case \"-y\":\n return this.bottom > container.bottom;\n }\n};\n\n// Find the percentage of the area that this box is overlapping with another\n// box.\nBoxPosition.prototype.intersectPercentage = function(b2) {\n var x = Math.max(0, Math.min(this.right, b2.right) - Math.max(this.left, b2.left)),\n y = Math.max(0, Math.min(this.bottom, b2.bottom) - Math.max(this.top, b2.top)),\n intersectArea = x * y;\n return intersectArea / (this.height * this.width);\n};\n\n// Convert the positions from this box to CSS compatible positions using\n// the reference container's positions. This has to be done because this\n// box's positions are in reference to the viewport origin, whereas, CSS\n// values are in referecne to their respective edges.\nBoxPosition.prototype.toCSSCompatValues = function(reference) {\n return {\n top: this.top - reference.top,\n bottom: reference.bottom - this.bottom,\n left: this.left - reference.left,\n right: reference.right - this.right,\n height: this.height,\n width: this.width\n };\n};\n\n// Get an object that represents the box's position without anything extra.\n// Can pass a StyleBox, HTMLElement, or another BoxPositon.\nBoxPosition.getSimpleBoxPosition = function(obj) {\n var height = obj.div ? obj.div.offsetHeight : obj.tagName ? obj.offsetHeight : 0;\n var width = obj.div ? obj.div.offsetWidth : obj.tagName ? obj.offsetWidth : 0;\n var top = obj.div ? obj.div.offsetTop : obj.tagName ? obj.offsetTop : 0;\n\n obj = obj.div ? obj.div.getBoundingClientRect() :\n obj.tagName ? obj.getBoundingClientRect() : obj;\n var ret = {\n left: obj.left,\n right: obj.right,\n top: obj.top || top,\n height: obj.height || height,\n bottom: obj.bottom || (top + (obj.height || height)),\n width: obj.width || width\n };\n return ret;\n};\n\n// Move a StyleBox to its specified, or next best, position. The containerBox\n// is the box that contains the StyleBox, such as a div. boxPositions are\n// a list of other boxes that the styleBox can't overlap with.\nfunction moveBoxToLinePosition(window, styleBox, containerBox, boxPositions) {\n\n // Find the best position for a cue box, b, on the video. The axis parameter\n // is a list of axis, the order of which, it will move the box along. For example:\n // Passing [\"+x\", \"-x\"] will move the box first along the x axis in the positive\n // direction. If it doesn't find a good position for it there it will then move\n // it along the x axis in the negative direction.\n function findBestPosition(b, axis) {\n var bestPosition,\n specifiedPosition = new BoxPosition(b),\n percentage = 1; // Highest possible so the first thing we get is better.\n\n for (var i = 0; i < axis.length; i++) {\n while (b.overlapsOppositeAxis(containerBox, axis[i]) ||\n (b.within(containerBox) && b.overlapsAny(boxPositions))) {\n b.move(axis[i]);\n }\n // We found a spot where we aren't overlapping anything. This is our\n // best position.\n if (b.within(containerBox)) {\n return b;\n }\n var p = b.intersectPercentage(containerBox);\n // If we're outside the container box less then we were on our last try\n // then remember this position as the best position.\n if (percentage > p) {\n bestPosition = new BoxPosition(b);\n percentage = p;\n }\n // Reset the box position to the specified position.\n b = new BoxPosition(specifiedPosition);\n }\n return bestPosition || specifiedPosition;\n }\n\n var boxPosition = new BoxPosition(styleBox),\n cue = styleBox.cue,\n linePos = computeLinePos(cue),\n axis = [];\n\n // If we have a line number to align the cue to.\n if (cue.snapToLines) {\n var size;\n switch (cue.vertical) {\n case \"\":\n axis = [ \"+y\", \"-y\" ];\n size = \"height\";\n break;\n case \"rl\":\n axis = [ \"+x\", \"-x\" ];\n size = \"width\";\n break;\n case \"lr\":\n axis = [ \"-x\", \"+x\" ];\n size = \"width\";\n break;\n }\n\n var step = boxPosition.lineHeight,\n position = step * Math.round(linePos),\n maxPosition = containerBox[size] + step,\n initialAxis = axis[0];\n\n // If the specified intial position is greater then the max position then\n // clamp the box to the amount of steps it would take for the box to\n // reach the max position.\n if (Math.abs(position) > maxPosition) {\n position = position < 0 ? -1 : 1;\n position *= Math.ceil(maxPosition / step) * step;\n }\n\n // If computed line position returns negative then line numbers are\n // relative to the bottom of the video instead of the top. Therefore, we\n // need to increase our initial position by the length or width of the\n // video, depending on the writing direction, and reverse our axis directions.\n if (linePos < 0) {\n position += cue.vertical === \"\" ? containerBox.height : containerBox.width;\n axis = axis.reverse();\n }\n\n // Move the box to the specified position. This may not be its best\n // position.\n boxPosition.move(initialAxis, position);\n\n } else {\n // If we have a percentage line value for the cue.\n var calculatedPercentage = (boxPosition.lineHeight / containerBox.height) * 100;\n\n switch (cue.lineAlign) {\n case \"middle\":\n linePos -= (calculatedPercentage / 2);\n break;\n case \"end\":\n linePos -= calculatedPercentage;\n break;\n }\n\n // Apply initial line position to the cue box.\n switch (cue.vertical) {\n case \"\":\n styleBox.applyStyles({\n top: styleBox.formatStyle(linePos, \"%\")\n });\n break;\n case \"rl\":\n styleBox.applyStyles({\n left: styleBox.formatStyle(linePos, \"%\")\n });\n break;\n case \"lr\":\n styleBox.applyStyles({\n right: styleBox.formatStyle(linePos, \"%\")\n });\n break;\n }\n\n axis = [ \"+y\", \"-x\", \"+x\", \"-y\" ];\n\n // Get the box position again after we've applied the specified positioning\n // to it.\n boxPosition = new BoxPosition(styleBox);\n }\n\n var bestPosition = findBestPosition(boxPosition, axis);\n styleBox.move(bestPosition.toCSSCompatValues(containerBox));\n}\n\nfunction WebVTT() {\n // Nothing\n}\n\n// Helper to allow strings to be decoded instead of the default binary utf8 data.\nWebVTT.StringDecoder = function() {\n return {\n decode: function(data) {\n if (!data) {\n return \"\";\n }\n if (typeof data !== \"string\") {\n throw new Error(\"Error - expected string data.\");\n }\n return decodeURIComponent(encodeURIComponent(data));\n }\n };\n};\n\nWebVTT.convertCueToDOMTree = function(window, cuetext) {\n if (!window || !cuetext) {\n return null;\n }\n return parseContent(window, cuetext);\n};\n\nvar FONT_SIZE_PERCENT = 0.05;\nvar FONT_STYLE = \"sans-serif\";\nvar CUE_BACKGROUND_PADDING = \"1.5%\";\n\n// Runs the processing model over the cues and regions passed to it.\n// @param overlay A block level element (usually a div) that the computed cues\n// and regions will be placed into.\nWebVTT.processCues = function(window, cues, overlay) {\n if (!window || !cues || !overlay) {\n return null;\n }\n\n // Remove all previous children.\n while (overlay.firstChild) {\n overlay.removeChild(overlay.firstChild);\n }\n\n var paddedOverlay = window.document.createElement(\"div\");\n paddedOverlay.style.position = \"absolute\";\n paddedOverlay.style.left = \"0\";\n paddedOverlay.style.right = \"0\";\n paddedOverlay.style.top = \"0\";\n paddedOverlay.style.bottom = \"0\";\n paddedOverlay.style.margin = CUE_BACKGROUND_PADDING;\n overlay.appendChild(paddedOverlay);\n\n // Determine if we need to compute the display states of the cues. This could\n // be the case if a cue's state has been changed since the last computation or\n // if it has not been computed yet.\n function shouldCompute(cues) {\n for (var i = 0; i < cues.length; i++) {\n if (cues[i].hasBeenReset || !cues[i].displayState) {\n return true;\n }\n }\n return false;\n }\n\n // We don't need to recompute the cues' display states. Just reuse them.\n if (!shouldCompute(cues)) {\n for (var i = 0; i < cues.length; i++) {\n paddedOverlay.appendChild(cues[i].displayState);\n }\n return;\n }\n\n var boxPositions = [],\n containerBox = BoxPosition.getSimpleBoxPosition(paddedOverlay),\n fontSize = Math.round(containerBox.height * FONT_SIZE_PERCENT * 100) / 100;\n var styleOptions = {\n font: fontSize + \"px \" + FONT_STYLE\n };\n\n (function() {\n var styleBox, cue;\n\n for (var i = 0; i < cues.length; i++) {\n cue = cues[i];\n\n // Compute the intial position and styles of the cue div.\n styleBox = new CueStyleBox(window, cue, styleOptions);\n paddedOverlay.appendChild(styleBox.div);\n\n // Move the cue div to it's correct line position.\n moveBoxToLinePosition(window, styleBox, containerBox, boxPositions);\n\n // Remember the computed div so that we don't have to recompute it later\n // if we don't have too.\n cue.displayState = styleBox.div;\n\n boxPositions.push(BoxPosition.getSimpleBoxPosition(styleBox));\n }\n })();\n};\n\nWebVTT.Parser = function(window, vttjs, decoder) {\n if (!decoder) {\n decoder = vttjs;\n vttjs = {};\n }\n if (!vttjs) {\n vttjs = {};\n }\n\n this.window = window;\n this.vttjs = vttjs;\n this.state = \"INITIAL\";\n this.buffer = \"\";\n this.decoder = decoder || new TextDecoder(\"utf8\");\n this.regionList = [];\n};\n\nWebVTT.Parser.prototype = {\n // If the error is a ParsingError then report it to the consumer if\n // possible. If it's not a ParsingError then throw it like normal.\n reportOrThrowError: function(e) {\n if (e instanceof ParsingError) {\n this.onparsingerror && this.onparsingerror(e);\n } else {\n throw e;\n }\n },\n parse: function (data) {\n var self = this;\n\n // If there is no data then we won't decode it, but will just try to parse\n // whatever is in buffer already. This may occur in circumstances, for\n // example when flush() is called.\n if (data) {\n // Try to decode the data that we received.\n self.buffer += self.decoder.decode(data, {stream: true});\n }\n\n function collectNextLine() {\n var buffer = self.buffer;\n var pos = 0;\n while (pos < buffer.length && buffer[pos] !== '\\r' && buffer[pos] !== '\\n') {\n ++pos;\n }\n var line = buffer.substr(0, pos);\n // Advance the buffer early in case we fail below.\n if (buffer[pos] === '\\r') {\n ++pos;\n }\n if (buffer[pos] === '\\n') {\n ++pos;\n }\n self.buffer = buffer.substr(pos);\n return line;\n }\n\n // 3.4 WebVTT region and WebVTT region settings syntax\n function parseRegion(input) {\n var settings = new Settings();\n\n parseOptions(input, function (k, v) {\n switch (k) {\n case \"id\":\n settings.set(k, v);\n break;\n case \"width\":\n settings.percent(k, v);\n break;\n case \"lines\":\n settings.integer(k, v);\n break;\n case \"regionanchor\":\n case \"viewportanchor\":\n var xy = v.split(',');\n if (xy.length !== 2) {\n break;\n }\n // We have to make sure both x and y parse, so use a temporary\n // settings object here.\n var anchor = new Settings();\n anchor.percent(\"x\", xy[0]);\n anchor.percent(\"y\", xy[1]);\n if (!anchor.has(\"x\") || !anchor.has(\"y\")) {\n break;\n }\n settings.set(k + \"X\", anchor.get(\"x\"));\n settings.set(k + \"Y\", anchor.get(\"y\"));\n break;\n case \"scroll\":\n settings.alt(k, v, [\"up\"]);\n break;\n }\n }, /=/, /\\s/);\n\n // Create the region, using default values for any values that were not\n // specified.\n if (settings.has(\"id\")) {\n var region = new (self.vttjs.VTTRegion || self.window.VTTRegion)();\n region.width = settings.get(\"width\", 100);\n region.lines = settings.get(\"lines\", 3);\n region.regionAnchorX = settings.get(\"regionanchorX\", 0);\n region.regionAnchorY = settings.get(\"regionanchorY\", 100);\n region.viewportAnchorX = settings.get(\"viewportanchorX\", 0);\n region.viewportAnchorY = settings.get(\"viewportanchorY\", 100);\n region.scroll = settings.get(\"scroll\", \"\");\n // Register the region.\n self.onregion && self.onregion(region);\n // Remember the VTTRegion for later in case we parse any VTTCues that\n // reference it.\n self.regionList.push({\n id: settings.get(\"id\"),\n region: region\n });\n }\n }\n\n // draft-pantos-http-live-streaming-20\n // https://tools.ietf.org/html/draft-pantos-http-live-streaming-20#section-3.5\n // 3.5 WebVTT\n function parseTimestampMap(input) {\n var settings = new Settings();\n\n parseOptions(input, function(k, v) {\n switch(k) {\n case \"MPEGT\":\n settings.integer(k + 'S', v);\n break;\n case \"LOCA\":\n settings.set(k + 'L', parseTimeStamp(v));\n break;\n }\n }, /[^\\d]:/, /,/);\n\n self.ontimestampmap && self.ontimestampmap({\n \"MPEGTS\": settings.get(\"MPEGTS\"),\n \"LOCAL\": settings.get(\"LOCAL\")\n });\n }\n\n // 3.2 WebVTT metadata header syntax\n function parseHeader(input) {\n if (input.match(/X-TIMESTAMP-MAP/)) {\n // This line contains HLS X-TIMESTAMP-MAP metadata\n parseOptions(input, function(k, v) {\n switch(k) {\n case \"X-TIMESTAMP-MAP\":\n parseTimestampMap(v);\n break;\n }\n }, /=/);\n } else {\n parseOptions(input, function (k, v) {\n switch (k) {\n case \"Region\":\n // 3.3 WebVTT region metadata header syntax\n parseRegion(v);\n break;\n }\n }, /:/);\n }\n\n }\n\n // 5.1 WebVTT file parsing.\n try {\n var line;\n if (self.state === \"INITIAL\") {\n // We can't start parsing until we have the first line.\n if (!/\\r\\n|\\n/.test(self.buffer)) {\n return this;\n }\n\n line = collectNextLine();\n\n var m = line.match(/^WEBVTT([ \\t].*)?$/);\n if (!m || !m[0]) {\n throw new ParsingError(ParsingError.Errors.BadSignature);\n }\n\n self.state = \"HEADER\";\n }\n\n var alreadyCollectedLine = false;\n while (self.buffer) {\n // We can't parse a line until we have the full line.\n if (!/\\r\\n|\\n/.test(self.buffer)) {\n return this;\n }\n\n if (!alreadyCollectedLine) {\n line = collectNextLine();\n } else {\n alreadyCollectedLine = false;\n }\n\n switch (self.state) {\n case \"HEADER\":\n // 13-18 - Allow a header (metadata) under the WEBVTT line.\n if (/:/.test(line)) {\n parseHeader(line);\n } else if (!line) {\n // An empty line terminates the header and starts the body (cues).\n self.state = \"ID\";\n }\n continue;\n case \"NOTE\":\n // Ignore NOTE blocks.\n if (!line) {\n self.state = \"ID\";\n }\n continue;\n case \"ID\":\n // Check for the start of NOTE blocks.\n if (/^NOTE($|[ \\t])/.test(line)) {\n self.state = \"NOTE\";\n break;\n }\n // 19-29 - Allow any number of line terminators, then initialize new cue values.\n if (!line) {\n continue;\n }\n self.cue = new (self.vttjs.VTTCue || self.window.VTTCue)(0, 0, \"\");\n self.state = \"CUE\";\n // 30-39 - Check if self line contains an optional identifier or timing data.\n if (line.indexOf(\"-->\") === -1) {\n self.cue.id = line;\n continue;\n }\n // Process line as start of a cue.\n /*falls through*/\n case \"CUE\":\n // 40 - Collect cue timings and settings.\n try {\n parseCue(line, self.cue, self.regionList);\n } catch (e) {\n self.reportOrThrowError(e);\n // In case of an error ignore rest of the cue.\n self.cue = null;\n self.state = \"BADCUE\";\n continue;\n }\n self.state = \"CUETEXT\";\n continue;\n case \"CUETEXT\":\n var hasSubstring = line.indexOf(\"-->\") !== -1;\n // 34 - If we have an empty line then report the cue.\n // 35 - If we have the special substring '-->' then report the cue,\n // but do not collect the line as we need to process the current\n // one as a new cue.\n if (!line || hasSubstring && (alreadyCollectedLine = true)) {\n // We are done parsing self cue.\n self.oncue && self.oncue(self.cue);\n self.cue = null;\n self.state = \"ID\";\n continue;\n }\n if (self.cue.text) {\n self.cue.text += \"\\n\";\n }\n self.cue.text += line;\n continue;\n case \"BADCUE\": // BADCUE\n // 54-62 - Collect and discard the remaining cue.\n if (!line) {\n self.state = \"ID\";\n }\n continue;\n }\n }\n } catch (e) {\n self.reportOrThrowError(e);\n\n // If we are currently parsing a cue, report what we have.\n if (self.state === \"CUETEXT\" && self.cue && self.oncue) {\n self.oncue(self.cue);\n }\n self.cue = null;\n // Enter BADWEBVTT state if header was not parsed correctly otherwise\n // another exception occurred so enter BADCUE state.\n self.state = self.state === \"INITIAL\" ? \"BADWEBVTT\" : \"BADCUE\";\n }\n return this;\n },\n flush: function () {\n var self = this;\n try {\n // Finish decoding the stream.\n self.buffer += self.decoder.decode();\n // Synthesize the end of the current cue or region.\n if (self.cue || self.state === \"HEADER\") {\n self.buffer += \"\\n\\n\";\n self.parse();\n }\n // If we've flushed, parsed, and we're still on the INITIAL state then\n // that means we don't have enough of the stream to parse the first\n // line.\n if (self.state === \"INITIAL\") {\n throw new ParsingError(ParsingError.Errors.BadSignature);\n }\n } catch(e) {\n self.reportOrThrowError(e);\n }\n self.onflush && self.onflush();\n return this;\n }\n};\n\nmodule.exports = WebVTT;\n","/**\n * Copyright 2013 vtt.js Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nvar autoKeyword = \"auto\";\nvar directionSetting = {\n \"\": 1,\n \"lr\": 1,\n \"rl\": 1\n};\nvar alignSetting = {\n \"start\": 1,\n \"middle\": 1,\n \"end\": 1,\n \"left\": 1,\n \"right\": 1\n};\n\nfunction findDirectionSetting(value) {\n if (typeof value !== \"string\") {\n return false;\n }\n var dir = directionSetting[value.toLowerCase()];\n return dir ? value.toLowerCase() : false;\n}\n\nfunction findAlignSetting(value) {\n if (typeof value !== \"string\") {\n return false;\n }\n var align = alignSetting[value.toLowerCase()];\n return align ? value.toLowerCase() : false;\n}\n\nfunction VTTCue(startTime, endTime, text) {\n /**\n * Shim implementation specific properties. These properties are not in\n * the spec.\n */\n\n // Lets us know when the VTTCue's data has changed in such a way that we need\n // to recompute its display state. This lets us compute its display state\n // lazily.\n this.hasBeenReset = false;\n\n /**\n * VTTCue and TextTrackCue properties\n * http://dev.w3.org/html5/webvtt/#vttcue-interface\n */\n\n var _id = \"\";\n var _pauseOnExit = false;\n var _startTime = startTime;\n var _endTime = endTime;\n var _text = text;\n var _region = null;\n var _vertical = \"\";\n var _snapToLines = true;\n var _line = \"auto\";\n var _lineAlign = \"start\";\n var _position = 50;\n var _positionAlign = \"middle\";\n var _size = 50;\n var _align = \"middle\";\n\n Object.defineProperties(this, {\n \"id\": {\n enumerable: true,\n get: function() {\n return _id;\n },\n set: function(value) {\n _id = \"\" + value;\n }\n },\n\n \"pauseOnExit\": {\n enumerable: true,\n get: function() {\n return _pauseOnExit;\n },\n set: function(value) {\n _pauseOnExit = !!value;\n }\n },\n\n \"startTime\": {\n enumerable: true,\n get: function() {\n return _startTime;\n },\n set: function(value) {\n if (typeof value !== \"number\") {\n throw new TypeError(\"Start time must be set to a number.\");\n }\n _startTime = value;\n this.hasBeenReset = true;\n }\n },\n\n \"endTime\": {\n enumerable: true,\n get: function() {\n return _endTime;\n },\n set: function(value) {\n if (typeof value !== \"number\") {\n throw new TypeError(\"End time must be set to a number.\");\n }\n _endTime = value;\n this.hasBeenReset = true;\n }\n },\n\n \"text\": {\n enumerable: true,\n get: function() {\n return _text;\n },\n set: function(value) {\n _text = \"\" + value;\n this.hasBeenReset = true;\n }\n },\n\n \"region\": {\n enumerable: true,\n get: function() {\n return _region;\n },\n set: function(value) {\n _region = value;\n this.hasBeenReset = true;\n }\n },\n\n \"vertical\": {\n enumerable: true,\n get: function() {\n return _vertical;\n },\n set: function(value) {\n var setting = findDirectionSetting(value);\n // Have to check for false because the setting an be an empty string.\n if (setting === false) {\n throw new SyntaxError(\"An invalid or illegal string was specified.\");\n }\n _vertical = setting;\n this.hasBeenReset = true;\n }\n },\n\n \"snapToLines\": {\n enumerable: true,\n get: function() {\n return _snapToLines;\n },\n set: function(value) {\n _snapToLines = !!value;\n this.hasBeenReset = true;\n }\n },\n\n \"line\": {\n enumerable: true,\n get: function() {\n return _line;\n },\n set: function(value) {\n if (typeof value !== \"number\" && value !== autoKeyword) {\n throw new SyntaxError(\"An invalid number or illegal string was specified.\");\n }\n _line = value;\n this.hasBeenReset = true;\n }\n },\n\n \"lineAlign\": {\n enumerable: true,\n get: function() {\n return _lineAlign;\n },\n set: function(value) {\n var setting = findAlignSetting(value);\n if (!setting) {\n throw new SyntaxError(\"An invalid or illegal string was specified.\");\n }\n _lineAlign = setting;\n this.hasBeenReset = true;\n }\n },\n\n \"position\": {\n enumerable: true,\n get: function() {\n return _position;\n },\n set: function(value) {\n if (value < 0 || value > 100) {\n throw new Error(\"Position must be between 0 and 100.\");\n }\n _position = value;\n this.hasBeenReset = true;\n }\n },\n\n \"positionAlign\": {\n enumerable: true,\n get: function() {\n return _positionAlign;\n },\n set: function(value) {\n var setting = findAlignSetting(value);\n if (!setting) {\n throw new SyntaxError(\"An invalid or illegal string was specified.\");\n }\n _positionAlign = setting;\n this.hasBeenReset = true;\n }\n },\n\n \"size\": {\n enumerable: true,\n get: function() {\n return _size;\n },\n set: function(value) {\n if (value < 0 || value > 100) {\n throw new Error(\"Size must be between 0 and 100.\");\n }\n _size = value;\n this.hasBeenReset = true;\n }\n },\n\n \"align\": {\n enumerable: true,\n get: function() {\n return _align;\n },\n set: function(value) {\n var setting = findAlignSetting(value);\n if (!setting) {\n throw new SyntaxError(\"An invalid or illegal string was specified.\");\n }\n _align = setting;\n this.hasBeenReset = true;\n }\n }\n });\n\n /**\n * Other <track> spec defined properties\n */\n\n // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#text-track-cue-display-state\n this.displayState = undefined;\n}\n\n/**\n * VTTCue methods\n */\n\nVTTCue.prototype.getCueAsHTML = function() {\n // Assume WebVTT.convertCueToDOMTree is on the global.\n return WebVTT.convertCueToDOMTree(window, this.text);\n};\n\nmodule.exports = VTTCue;\n","/**\n * Copyright 2013 vtt.js Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nvar scrollSetting = {\n \"\": true,\n \"up\": true\n};\n\nfunction findScrollSetting(value) {\n if (typeof value !== \"string\") {\n return false;\n }\n var scroll = scrollSetting[value.toLowerCase()];\n return scroll ? value.toLowerCase() : false;\n}\n\nfunction isValidPercentValue(value) {\n return typeof value === \"number\" && (value >= 0 && value <= 100);\n}\n\n// VTTRegion shim http://dev.w3.org/html5/webvtt/#vttregion-interface\nfunction VTTRegion() {\n var _width = 100;\n var _lines = 3;\n var _regionAnchorX = 0;\n var _regionAnchorY = 100;\n var _viewportAnchorX = 0;\n var _viewportAnchorY = 100;\n var _scroll = \"\";\n\n Object.defineProperties(this, {\n \"width\": {\n enumerable: true,\n get: function() {\n return _width;\n },\n set: function(value) {\n if (!isValidPercentValue(value)) {\n throw new Error(\"Width must be between 0 and 100.\");\n }\n _width = value;\n }\n },\n \"lines\": {\n enumerable: true,\n get: function() {\n return _lines;\n },\n set: function(value) {\n if (typeof value !== \"number\") {\n throw new TypeError(\"Lines must be set to a number.\");\n }\n _lines = value;\n }\n },\n \"regionAnchorY\": {\n enumerable: true,\n get: function() {\n return _regionAnchorY;\n },\n set: function(value) {\n if (!isValidPercentValue(value)) {\n throw new Error(\"RegionAnchorX must be between 0 and 100.\");\n }\n _regionAnchorY = value;\n }\n },\n \"regionAnchorX\": {\n enumerable: true,\n get: function() {\n return _regionAnchorX;\n },\n set: function(value) {\n if(!isValidPercentValue(value)) {\n throw new Error(\"RegionAnchorY must be between 0 and 100.\");\n }\n _regionAnchorX = value;\n }\n },\n \"viewportAnchorY\": {\n enumerable: true,\n get: function() {\n return _viewportAnchorY;\n },\n set: function(value) {\n if (!isValidPercentValue(value)) {\n throw new Error(\"ViewportAnchorY must be between 0 and 100.\");\n }\n _viewportAnchorY = value;\n }\n },\n \"viewportAnchorX\": {\n enumerable: true,\n get: function() {\n return _viewportAnchorX;\n },\n set: function(value) {\n if (!isValidPercentValue(value)) {\n throw new Error(\"ViewportAnchorX must be between 0 and 100.\");\n }\n _viewportAnchorX = value;\n }\n },\n \"scroll\": {\n enumerable: true,\n get: function() {\n return _scroll;\n },\n set: function(value) {\n var setting = findScrollSetting(value);\n // Have to check for false as an empty string is a legal value.\n if (setting === false) {\n throw new SyntaxError(\"An invalid or illegal string was specified.\");\n }\n _scroll = setting;\n }\n }\n });\n}\n\nmodule.exports = VTTRegion;\n","\"use strict\";\nvar window = require(\"global/window\")\nvar isFunction = require(\"is-function\")\nvar parseHeaders = require(\"parse-headers\")\nvar xtend = require(\"xtend\")\n\nmodule.exports = createXHR\ncreateXHR.XMLHttpRequest = window.XMLHttpRequest || noop\ncreateXHR.XDomainRequest = \"withCredentials\" in (new createXHR.XMLHttpRequest()) ? createXHR.XMLHttpRequest : window.XDomainRequest\n\nforEachArray([\"get\", \"put\", \"post\", \"patch\", \"head\", \"delete\"], function(method) {\n createXHR[method === \"delete\" ? \"del\" : method] = function(uri, options, callback) {\n options = initParams(uri, options, callback)\n options.method = method.toUpperCase()\n return _createXHR(options)\n }\n})\n\nfunction forEachArray(array, iterator) {\n for (var i = 0; i < array.length; i++) {\n iterator(array[i])\n }\n}\n\nfunction isEmpty(obj){\n for(var i in obj){\n if(obj.hasOwnProperty(i)) return false\n }\n return true\n}\n\nfunction initParams(uri, options, callback) {\n var params = uri\n\n if (isFunction(options)) {\n callback = options\n if (typeof uri === \"string\") {\n params = {uri:uri}\n }\n } else {\n params = xtend(options, {uri: uri})\n }\n\n params.callback = callback\n return params\n}\n\nfunction createXHR(uri, options, callback) {\n options = initParams(uri, options, callback)\n return _createXHR(options)\n}\n\nfunction _createXHR(options) {\n if(typeof options.callback === \"undefined\"){\n throw new Error(\"callback argument missing\")\n }\n\n var called = false\n var callback = function cbOnce(err, response, body){\n if(!called){\n called = true\n options.callback(err, response, body)\n }\n }\n\n function readystatechange() {\n if (xhr.readyState === 4) {\n setTimeout(loadFunc, 0)\n }\n }\n\n function getBody() {\n // Chrome with requestType=blob throws errors arround when even testing access to responseText\n var body = undefined\n\n if (xhr.response) {\n body = xhr.response\n } else {\n body = xhr.responseText || getXml(xhr)\n }\n\n if (isJson) {\n try {\n body = JSON.parse(body)\n } catch (e) {}\n }\n\n return body\n }\n\n function errorFunc(evt) {\n clearTimeout(timeoutTimer)\n if(!(evt instanceof Error)){\n evt = new Error(\"\" + (evt || \"Unknown XMLHttpRequest Error\") )\n }\n evt.statusCode = 0\n return callback(evt, failureResponse)\n }\n\n // will load the data & process the response in a special response object\n function loadFunc() {\n if (aborted) return\n var status\n clearTimeout(timeoutTimer)\n if(options.useXDR && xhr.status===undefined) {\n //IE8 CORS GET successful response doesn't have a status field, but body is fine\n status = 200\n } else {\n status = (xhr.status === 1223 ? 204 : xhr.status)\n }\n var response = failureResponse\n var err = null\n\n if (status !== 0){\n response = {\n body: getBody(),\n statusCode: status,\n method: method,\n headers: {},\n url: uri,\n rawRequest: xhr\n }\n if(xhr.getAllResponseHeaders){ //remember xhr can in fact be XDR for CORS in IE\n response.headers = parseHeaders(xhr.getAllResponseHeaders())\n }\n } else {\n err = new Error(\"Internal XMLHttpRequest Error\")\n }\n return callback(err, response, response.body)\n }\n\n var xhr = options.xhr || null\n\n if (!xhr) {\n if (options.cors || options.useXDR) {\n xhr = new createXHR.XDomainRequest()\n }else{\n xhr = new createXHR.XMLHttpRequest()\n }\n }\n\n var key\n var aborted\n var uri = xhr.url = options.uri || options.url\n var method = xhr.method = options.method || \"GET\"\n var body = options.body || options.data\n var headers = xhr.headers = options.headers || {}\n var sync = !!options.sync\n var isJson = false\n var timeoutTimer\n var failureResponse = {\n body: undefined,\n headers: {},\n statusCode: 0,\n method: method,\n url: uri,\n rawRequest: xhr\n }\n\n if (\"json\" in options && options.json !== false) {\n isJson = true\n headers[\"accept\"] || headers[\"Accept\"] || (headers[\"Accept\"] = \"application/json\") //Don't override existing accept header declared by user\n if (method !== \"GET\" && method !== \"HEAD\") {\n headers[\"content-type\"] || headers[\"Content-Type\"] || (headers[\"Content-Type\"] = \"application/json\") //Don't override existing accept header declared by user\n body = JSON.stringify(options.json === true ? body : options.json)\n }\n }\n\n xhr.onreadystatechange = readystatechange\n xhr.onload = loadFunc\n xhr.onerror = errorFunc\n // IE9 must have onprogress be set to a unique function.\n xhr.onprogress = function () {\n // IE must die\n }\n xhr.onabort = function(){\n aborted = true;\n }\n xhr.ontimeout = errorFunc\n xhr.open(method, uri, !sync, options.username, options.password)\n //has to be after open\n if(!sync) {\n xhr.withCredentials = !!options.withCredentials\n }\n // Cannot set timeout with sync request\n // not setting timeout on the xhr object, because of old webkits etc. not handling that correctly\n // both npm's request and jquery 1.x use this kind of timeout, so this is being consistent\n if (!sync && options.timeout > 0 ) {\n timeoutTimer = setTimeout(function(){\n if (aborted) return\n aborted = true//IE9 may still call readystatechange\n xhr.abort(\"timeout\")\n var e = new Error(\"XMLHttpRequest timeout\")\n e.code = \"ETIMEDOUT\"\n errorFunc(e)\n }, options.timeout )\n }\n\n if (xhr.setRequestHeader) {\n for(key in headers){\n if(headers.hasOwnProperty(key)){\n xhr.setRequestHeader(key, headers[key])\n }\n }\n } else if (options.headers && !isEmpty(options.headers)) {\n throw new Error(\"Headers cannot be set on an XDomainRequest object\")\n }\n\n if (\"responseType\" in options) {\n xhr.responseType = options.responseType\n }\n\n if (\"beforeSend\" in options &&\n typeof options.beforeSend === \"function\"\n ) {\n options.beforeSend(xhr)\n }\n\n // Microsoft Edge browser sends \"undefined\" when send is called with undefined value.\n // XMLHttpRequest spec says to pass null as body to indicate no body\n // See https://github.com/naugtur/xhr/issues/100.\n xhr.send(body || null)\n\n return xhr\n\n\n}\n\nfunction getXml(xhr) {\n if (xhr.responseType === \"document\") {\n return xhr.responseXML\n }\n var firefoxBugTakenEffect = xhr.responseXML && xhr.responseXML.documentElement.nodeName === \"parsererror\"\n if (xhr.responseType === \"\" && !firefoxBugTakenEffect) {\n return xhr.responseXML\n }\n\n return null\n}\n\nfunction noop() {}\n","module.exports = extend\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nfunction extend() {\n var target = {}\n\n for (var i = 0; i < arguments.length; i++) {\n var source = arguments[i]\n\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n target[key] = source[key]\n }\n }\n }\n\n return target\n}\n"],"names":["isCallable","toStr","Object","prototype","toString","hasOwnProperty","forEachArray","array","iterator","receiver","i","len","length","call","forEachString","string","charAt","forEachObject","object","k","module","exports","list","thisArg","TypeError","arguments","doccy","topLevel","g","window","minDoc","document","win","self","badArrayLike","isCallableMarker","fnToStr","Function","reflectApply","Reflect","apply","defineProperty","get","_","constructorRegex","isES6ClassFn","value","fnStr","test","e","hasToStringTag","Symbol","toStringTag","documentDotAll","all","undefined","tryFunctionObject","strClass","fn","setTimeout","alert","confirm","prompt","AacStream","Stream","aacUtils","everything","Uint8Array","timeStamp","init","this","setTimestamp","timestamp","push","bytes","bytesLeft","chunk","packet","tempLength","frameSize","byteIndex","byteLength","set","subarray","charCodeAt","parseAdtsSize","type","data","pts","dts","trigger","parseId3TagSize","ADTS_SAMPLING_FREQUENCIES","parseSyncSafeInteger","isLikelyAacData","header","returnSize","lowThree","middle","parseType","parseSampleRate","parseAacTimestamp","frameStart","frame","String","fromCharCode","owner","unescape","start","end","result","slice","percentEncode","d","size","AdtsStream","buffer","frameLength","protectionSkipBytes","frameEnd","oldBuffer","sampleCount","adtsFrameDuration","frameNum","audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize","flush","H264Stream","NalByteStream","PROFILES_WITH_OPTIONAL_SPS_DATA","ExpGolomb","syncPoint","swapBuffer","trackId","currentPts","currentDts","discardEmulationPreventionBytes","readSequenceParameterSet","skipScalingList","nalByteStream","on","event","nalUnitType","escapedRBSP","config","count","expGolombDecoder","j","lastScale","nextScale","readExpGolomb","newLength","newData","emulationPreventionBytesPositions","sourceIndex","shift","profileIdc","levelIdc","profileCompatibility","chromaFormatIdc","picOrderCntType","numRefFramesInPicOrderCntCycle","picWidthInMbsMinus1","picHeightInMapUnitsMinus1","frameMbsOnlyFlag","scalingListCount","sarRatio","frameCropLeftOffset","frameCropRightOffset","frameCropTopOffset","frameCropBottomOffset","sarScale","readUnsignedByte","skipUnsignedExpGolomb","readUnsignedExpGolomb","skipBits","readBoolean","skipExpGolomb","readBits","width","Math","ceil","height","metaTable","highPrefix","lowPrefix","zeroFill","a","coneOfSilence","keys","reduce","obj","key","arr","part","concat","cea708Parser","CaptionStream","captionPackets_","ccStreams_","Cea608Stream","reset","forEach","cc","bind","sei","userData","newCaptionPackets","parseSei","payloadType","USER_DATA_REGISTERED_ITU_T_T35","parseUserData","latestDts_","ignoreNextEqualDts_","numSameDts_","parseCaptionPackets","elem","idx","presortIndex","sort","b","dispatchCea608Packet","activeCea608Channel_","ccStream","setsChannel1Active","setsChannel2Active","ccData","CHARACTER_TRANSLATION","getCharFromCode","code","ROWS","createDisplayBuffer","BOTTOM_ROW","field","dataChannel","field_","dataChannel_","name_","setConstants","swap","char0","char1","text","lastControlCode_","PADDING_","RESUME_CAPTION_LOADING_","mode_","END_OF_CAPTION_","clearFormatting","flushDisplayed","displayed_","nonDisplayed_","startPts_","ROLL_UP_2_ROWS_","rollUpRows_","setRollUp","ROLL_UP_3_ROWS_","ROLL_UP_4_ROWS_","CARRIAGE_RETURN_","shiftRowsUp_","BACKSPACE_","row_","ERASE_DISPLAYED_MEMORY_","ERASE_NON_DISPLAYED_MEMORY_","RESUME_DIRECT_CAPTIONING_","isSpecialCharacter","column_","isExtCharacter","isMidRowCode","addFormatting","isOffsetControlCode","isPAC","row","indexOf","formatting_","isColorPAC","isNormalChar","content","map","trim","console","error","join","replace","startPts","endPts","stream","topRow_","BASE_","EXT_","CONTROL_","OFFSET_","char","newBaseRow","format","reverse","popOn","baseRow","rollUp","paintOn","TransportPacketStream","TransportParseStream","ElementaryStream","StreamTypes","TimestampRolloverStream","m2tsStreamTypes","MP2T_PACKET_LENGTH","bytesInBuffer","startIndex","endIndex","parsePsi","parsePat","parsePmt","packetsWaitingForPmt","programMapTable","payload","psi","offset","payloadUnitStartIndicator","pat","section_number","last_section_number","pmtPid","pmt","tableEnd","video","audio","streamType","pid","H264_STREAM_TYPE","ADTS_STREAM_TYPE","METADATA_STREAM_TYPE","processPes_","STREAM_TYPES","h264","adts","timedMetadata","flushStream","forceFlush","packetFlushable","fragment","packetData","pes","ptsDtsFlags","packetLength","dataAlignmentIndicator","tracks","timelineStartInfo","baseMediaDecodeTime","id","codec","m2ts","PAT_PID","MetadataStream","parseUtf8","decodeURIComponent","tagParsers","TXXX","tag","description","WXXX","url","PRIV","privateData","options","settings","debug","descriptor","tagSize","bufferSize","dispatchType","log","frames","parsePid","parsePayloadUnitStartIndicator","parseAdaptionField","parseNalUnitType","pusi","payloadOffset","parsePesType","parsePesTime","videoPacketContainsKeyFrame","frameBuffer","frameI","frameSyncPoint","foundKeyFrame","handleRollover","reference","direction","abs","lastDTS","referenceDTS","type_","discontinuity","clock","prefixWithSilence","track","audioAppendStartTs","videoBaseMediaDecodeTime","baseMediaDecodeTimeTs","frameDuration","silentFrame","audioGapDuration","audioFillFrameCount","audioFillDuration","audioTsToVideoTs","max","floor","ONE_SECOND_IN_TS","splice","videoTsToAudioTs","trimAdtsFramesByEarliestDts","adtsFrames","earliestAllowedDts","minSegmentDts","Infinity","filter","currentFrame","min","minSegmentPts","generateSampleTable","samples","duration","concatenateFrameData","dataOffset","sum","sumFrameByteLengths","probe","inspect","mapToSample","approximateOffset","sample","parseCaptionNals","segment","videoTrackId","trafs","findBox","mdats","captionNals","mdatTrafPairs","mdat","index","matchingTraf","traf","pair","seiNals","tfhd","headerInfo","parseTfhd","tfdt","parseTfdt","truns","defaultSampleDuration","defaultSampleSize","allSamples","trun","parseTrun","compositionTimeOffset","parseSamples","avcStream","seiNal","lastMatchedSample","avcView","DataView","byteOffset","getUint32","matchingSample","findSeiNals","captionStream","segmentCache","timescale","parsedCaptions","isInitialized","startTime","endTime","captions","captionStreams","isNewInit","videoTrackIds","timescales","parse","parsedData","cachedSegment","parseEmbeddedCaptions","pushNals","nals","nal","clearParsedCaptions","resetCaptionStream","clearAllCaptions","sampleForFrame","flags","isLeading","dependsOn","isDependedOn","hasRedundancy","degradationPriority","isNonSyncSample","keyFrame","groupNalsIntoFrames","nalUnits","currentNal","groupFramesIntoGops","currentGop","gops","nalCount","extendFirstKeyFrame","baseDataOffset","h","concatenateNalData","nalsByteLength","numberOfNals","view","setUint32","generator","Transmuxer","AudioSegmentStream","VideoSegmentStream","CaptionParser","box","dinf","esds","ftyp","mfhd","minf","moof","moov","mvex","mvhd","trak","tkhd","mdia","mdhd","hdlr","sdtp","stbl","stsd","trex","types","MAJOR_BRAND","MINOR_VERSION","AVC1_BRAND","VIDEO_HDLR","AUDIO_HDLR","HDLR_TYPES","VMHD","SMHD","DREF","STCO","STSC","STSZ","STTS","videoSample","audioSample","audioTrun","videoTrun","trunHeader","UINT32_MAX","pow","avc1","avcC","btrt","dref","mp4a","smhd","stco","stsc","stsz","stts","styp","vmhd","sequenceNumber","trackFragments","boxes","sps","pps","sequenceParameterSets","pictureParameterSets","Array","trackFragmentHeader","trackFragmentDecodeTime","trackFragmentRun","sampleDependencyTable","upperWordBaseMediaDecodeTime","lowerWordBaseMediaDecodeTime","durationPresent","sizePresent","flagsPresent","paddingValue","initSegment","fileType","movie","getVideoTrackIds","toUnsigned","path","subresults","results","version","baseTimes","scale","baseTime","isFinite","traks","hdlrs","tkhds","handlerType","getUint8","clearDtsInfo","maxSegmentDts","maxSegmentPts","calculateTrackBaseMediaDecodeTime","keepOriginalTimestamps","collectDtsInfo","CoalesceStream","mp4","frameUtils","audioFrameUtils","trackDecodeInfo","AUDIO_PROPERTIES","VIDEO_PROPERTIES","arrayEquals","prop","setEarliestDts","earliestDts","setVideoBaseMediaDecodeTime","setAudioAppendStart","gopsToAlignWith","minPTS","gopCache_","nalUnit","gopForFusion","resetStream_","getGopForFusion_","unshift","alignedGops","alignGopsAtEnd","alignGopsAtEnd_","alignGopsAtStart_","gop","pop","dtsDistance","nearestGopObj","currentGopObj","nearestDistance","alignIndex","gopIndex","align","alignEndIndex","matchFound","trimIndex","metadata","total","alignGopsWith","newGopsToAlignWith","metadataStream","numberOfTracks","remux","remuxTracks","pendingTracks","videoTrack","pendingBoxes","pendingCaptions","pendingMetadata","pendingBytes","emittedTracks","output","audioTrack","flushSource","caption","id3","info","timelineStartPts","cueTime","hasFlushed","transmuxPipeline_","setupAacPipeline","pipeline","aacStream","audioTimestampRolloverStream","timedMetadataTimestampRolloverStream","adtsStream","coalesceStream","headOfPipeline","pipe","audioSegmentStream","setupTsPipeline","packetStream","parseStream","elementaryStream","videoTimestampRolloverStream","h264Stream","videoSegmentStream","setBaseMediaDecodeTime","isAac","resetCaptions","payloadSize","inspectMp4","textifyMp4","parseMp4Date","seconds","Date","parseSampleFlags","nalParse","dataReferenceIndex","getUint16","horizresolution","vertresolution","frameCount","depth","numOfPictureParameterSets","nalSize","configurationVersion","avcProfileIndication","avcLevelIndication","lengthSizeMinusOne","numOfSequenceParameterSets","bufferSizeDB","maxBitrate","avgBitrate","esId","streamPriority","decoderConfig","objectProfileIndication","decoderConfigDescriptor","audioObjectType","samplingFrequencyIndex","channelConfiguration","majorBrand","minorVersion","compatibleBrands","dataReferences","name","escape","language","creationTime","modificationTime","streamDescriptor","rate","volume","matrix","Uint32Array","nextTrackId","pdin","initialDelay","sidx","references","referenceId","earliestPresentationTime","firstOffset","referenceCount","referenceType","referencedSize","subsegmentDuration","startsWithSap","sapType","sapDeltaTime","balance","chunkOffsets","entryCount","sampleToChunks","firstChunk","samplesPerChunk","sampleDescriptionIndex","sampleDescriptions","sampleSize","entries","timeToSamples","sampleDelta","baseDataOffsetPresent","sampleDescriptionIndexPresent","defaultSampleDurationPresent","defaultSampleSizePresent","defaultSampleFlagsPresent","durationIsEmpty","defaultBaseIsMoof","defaultSampleFlags","baseDataOffsetIsMoof","layer","alternateGroup","defaultSampleDescriptionIndex","sampleDependsOn","sampleIsDependedOn","sampleHasRedundancy","samplePaddingValue","sampleIsDifferenceSample","sampleDegradationPriority","dataOffsetPresent","firstSampleFlagsPresent","sampleDurationPresent","sampleSizePresent","sampleFlagsPresent","sampleCompositionTimeOffsetPresent","getInt32","graphicsmode","opcolor","Uint16Array","ab","ArrayBuffer","v","z","inspectedMp4","indent","prefix","byte","match","line","JSON","stringify","split","textify","parseHdlr","ts","aac","PES_TIMESCALE","SYNC_BYTE","parseAudioPes_","pesType","parsed","endLoop","table","parseVideoPes_","firstKeyFrame","inspectTs_","parsePsi_","baseTimestamp","audioCount","sampleRate","audioTimescale","inspectAac_","segmentInfo","audioBaseTimestamp","dtsTime","ptsTime","videoBaseTimestamp","adjustTimestamp_","secondsToVideoTs","secondsToAudioTs","videoTsToSeconds","audioTsToSeconds","workingData","workingBytesAvailable","workingWord","workingBitsAvailable","bitsAvailable","loadWord","position","workingBytes","availableBytes","Error","skipBytes","bits","valu","skipLeadingZeros","leadingZeroCount","clz","listeners","listener","off","callbacks","args","dispose","destination","headers","arg","toLowerCase","reviver","json","err","str","left","right","clean","s","sa","URL_REGEX","FIRST_SEGMENT_REGEX","SLASH_DOT_REGEX","SLASH_DOT_DOT_REGEX","URLToolkit","buildAbsoluteURL","baseURL","relativeURL","opts","alwaysNormalize","basePartsForNormalise","parseURL","normalizePath","buildURLFromParts","relativeParts","scheme","baseParts","netLoc","pathParts","exec","builtParts","params","query","baseURLPath","newPath","substring","lastIndexOf","parts","classCallCheck","instance","Constructor","_extends","assign","target","source","inherits","subClass","superClass","create","constructor","enumerable","writable","configurable","setPrototypeOf","__proto__","possibleConstructorReturn","ReferenceError","LineStream","_Stream","_this","nextNewline","parseAttributes","attributes","attrs","RegExp","attr","ParseStream","customParsers","tagType","parseFloat","title","parseInt","number","playlistType","allowed","URI","uri","BYTERANGE","_attributes$BYTERANGE","byterange","RESOLUTION","resolution","BANDWIDTH","dateTimeString","dateTimeObject","IV","PRECISE","addParser","_ref","_this2","expression","customType","dataParser","Parser","lineStream","uris","currentUri","currentMap","_key","noop","defaultMediaGroups","currentTimeline","manifest","allowCache","discontinuityStarts","segments","entry","mediaGroup","rendition","message","endlist","endList","inf","mediaSequence","discontinuitySequence","METHOD","method","iv","playlist","playlists","mediaGroups","media","TYPE","NAME","mediaGroupType","DEFAULT","autoselect","AUTOSELECT","LANGUAGE","instreamId","CHARACTERISTICS","characteristics","FORCED","forced","targetduration","targetDuration","totalduration","totalDuration","isNaN","timeOffset","precise","cueOut","cueOutCont","cueIn","timeline","comment","custom","isObject","merge","_len","objects","isArray","flatten","lists","x","y","from","mergeDiscontiguousPlaylists","o","acc","_acc$name$segments","lang","contentProtection","l","formatAudioPlaylist","_attributes","bandwidth","CODECS","codecs","periodIndex","resolvedUri","formatVideoPlaylist","_ref3","_attributes3","AUDIO","SUBTITLES","toM3u8","dashPlaylists","_mediaGroups","_dashPlaylists$0$attr","sourceDuration","_dashPlaylists$0$attr2","minimumUpdatePeriod","videoPlaylists","_ref4","mimeType","contentType","audioPlaylists","_ref5","vttPlaylists","_ref6","master","VIDEO","role","label","default","subs","_ref2","_attributes2","baseUrl","organizeVttPlaylists","urlToolkit","resolveUrl","relativeUrl","urlTypeToSegment","_ref$baseUrl","_ref$source","_ref$range","range","ranges","startRange","endRange","getLiveRValue","time","NOW","clientOffset","availabilityStartTime","_attributes$timescale","_attributes$start","_attributes$minimumUp","periodDuration","parseByTimeline","segmentTimeline","_attributes$type","_attributes$minimumUp2","_attributes$media","_attributes$timescale2","_attributes$startNumb","startNumber","sIndex","S","repeat","r","segmentTime","t","nextS","segmentRange","static","dynamic","_attributes$timeShift","timeShiftBufferDepth","now","periodStartWC","segmentCount","availableStart","availableEnd","parseByDuration","_attributes$timescale4","_segmentRange$type","_attributes$timescale3","toSegments","identifierPattern","constructTemplateUrl","values","identifier","identifierReplacement","segmentsFromTemplate","templateValues","RepresentationID","Bandwidth","_attributes$initializ","initialization","sourceURL","mapSegment","parseTemplateInfo","Number","Time","errors","segmentsFromList","_attributes$segmentUr","segmentUrls","segmentTimeInfo","segmentUrlMap","segmentUrlObject","segmentUrl","mediaRange","SegmentURLToSegmentObject","segmentsFromBase","_attributes$indexRang","indexRange","generateSegments","segmentAttributes","segmentsFn","template","base","_segmentAttributes","_segmentAttributes$ti","findChildren","element","childNodes","tagName","getContent","textContent","parseDuration","_match$slice","year","month","day","hour","minute","second","parsers","mediaPresentationDuration","parsedValue","el","parseFn","keySystemsMap","buildBaseUrls","referenceUrls","baseUrlElements","baseUrlElement","getSegmentInformation","adaptationSet","segmentTemplate","segmentList","segmentBase","segmentTimelineParentNode","segmentInitializationParentNode","segmentInitialization","generateKeySystemInformation","contentProtectionNodes","node","keySystem","schemeIdUri","psshNode","pssh","psshBuffer","b64Text","decodedString","decodeB64ToUint8Array","toRepresentations","periodAttributes","periodBaseUrls","periodSegmentInfo","adaptationSetAttributes","adaptationSetBaseUrls","roleAttributes","representations","adaptationSetSegmentInfo","representation","repBaseUrlElements","repBaseUrls","representationSegmentInfo","inheritBaseUrls","inheritAttributes","mpd","_options","_options$manifestUri","manifestUri","_options$NOW","_options$clientOffset","periods","mpdAttributes","mpdBaseUrls","period","periodAtt","parsedPeriodId","adaptationSets","toAdaptationSets","stringToMpdXml","manifestString","xml","parseFromString","documentElement","getElementsByTagName","parseUTCTiming","UTCTimingNode","parseUTCTimingScheme","createClass","defineProperties","props","protoProps","staticProps","aesTables","AES","tables","encTable","decTable","sbox","sboxInv","xInv","th","x2","x4","tEnc","tDec","precompute","_tables","tmp","encKey","decKey","keyLen","rcon","decrypt","encrypted0","encrypted1","encrypted2","encrypted3","out","c","a2","b2","c2","nInnerRounds","kIndex","table0","table1","table2","table3","_length","_i","AsyncStream","jobs","delay","timeout_","processJob_","job","ntoh","word","encrypted","initVector","encrypted32","Int32Array","decipher","decrypted","decrypted32","init0","init1","init2","init3","wordIx","Decrypter","done","step","STEP","asyncStream_","decryptChunk_","padded","_inheritsLoose","_setPrototypeOf","p","isNativeReflectConstruct","construct","sham","Proxy","_construct","Parent","Class","_assertThisInitialized","_taggedTemplateLiteralLoose","strings","raw","createLogger","logByType","level","lvl","levels","lvlRegExp","toUpperCase","LogByTypeFactory","subname","warn","history","fname","historyItem","clear","disable","enable","_len2","_key2","_len3","_key3","_len4","_key4","createLogger$1","each","sources","isPlain","computedStyle","cs","_templateObject","isNonBlankString","throwIfWhitespace","isReal","isEl","nodeType","isInFrame","createQuerier","selector","context","ctx","createEl","properties","getOwnPropertyNames","propName","val","setAttribute","attrName","appendContent","innerText","prependTo","child","parent","firstChild","insertBefore","appendChild","hasClass","classToCheck","classList","contains","className","addClass","classToAdd","add","removeClass","classToRemove","remove","toggleClass","classToToggle","predicate","has","setAttributes","attrValue","removeAttribute","getAttributes","knownBooleans","attrVal","getAttribute","attribute","blockTextSelection","unblockTextSelection","getBoundingClientRect","parentNode","rect","findPosition","top","docEl","body","clientLeft","scrollLeft","clientTop","scrollTop","round","getPointerPosition","boxW","offsetWidth","boxH","offsetHeight","boxY","boxX","pageY","pageX","changedTouches","isTextNode","emptyEl","removeChild","normalizeContent","insertContent","isSingleLeftClick","button","buttons","$","$$","Dom","freeze","_guid","newGUID","elData","elIdAttr","getTime","getData","hasData","removeData","_cleanUpEvents","handlers","removeEventListener","dispatcher","detachEvent","disabled","_handleMultipleEvents","callback","fixEvent","returnTrue","returnFalse","isPropagationStopped","old","preventDefault","srcElement","relatedTarget","fromElement","toElement","returnValue","defaultPrevented","stopPropagation","cancelBubble","stopImmediatePropagation","isImmediatePropagationStopped","clientX","doc","clientY","which","charCode","keyCode","_supportsPassive","passiveEvents","guid","hash","handlersCopy","m","n","addEventListener","passive","attachEvent","removeType","elemData","ownerDocument","bubbles","targetData","one","func","videojs","Events","_windowLoaded","autoSetup","vids","audios","divs","mediaEls","mediaEl","autoSetupTimeout","player","wait","vjs","EVENT_MAP","createStyleElement","style","setTextContent","styleSheet","cssText","uid","bound","throttle","last","EventTarget","allowedEvents_","ael","dispatchEvent","queueTrigger","Map","oldTimeout","delete","timeout","isEvented","eventBusEl_","every","isValidEventType","validateTarget","nodeName","validateEventType","validateListener","normalizeListenArgs","isTargetingSelf","listen","EventedMixin","_normalizeListenArgs","removeListenerOnDispose","removeRemoverOnTargetDispose","_normalizeListenArgs2","wrapper","largs","targetOrType","typeOrListener","evented","eventBusKey","eventedCallbacks","StatefulMixin","state","setState","stateUpdates","changes","to","stateful","defaultState","handleStateChanged","toTitleCase","mergeOptions","Component","ready","play","player_","options_","id_","el_","children_","childIndex_","childNameIndex_","initChildren","reportTouchActivity","enableTouchActivity","_proto","localize","tokens","defaultValue","languages","primaryCode","primaryLang","localizedString","ret","contentEl","contentEl_","children","getChildById","getChild","addChild","component","componentName","componentClassName","componentClass","ComponentClass","getComponent","refNode","childFound","compEl","workingChildren","parentOptions","Tech","some","wchild","isTech","playerOptions","newChild","buildCSSClass","sync","isReady_","readyQueue_","triggerReady","readyQueue","show","hide","lockShowing","unlockShowing","num","skipListeners","dimension","dimensions","widthOrHeight","pxIndex","currentDimension","computedWidthOrHeight","getPropertyValue","rule","currentDimensions","currentWidth","currentHeight","focus","blur","emitTapEvents","couldBeTap","touchStart","firstTouch","touches","xdiff","ydiff","sqrt","noTap","reportUserActivity","touchHolding","report","clearInterval","setInterval","touchEnd","timeoutId","disposeFn","clearTimeout","interval","_this3","intervalId","requestAnimationFrame","_this4","supportsRaf_","cancelAnimationFrame","registerComponent","ComponentToRegister","reason","isComp","isPrototypeOf","components_","Player","players","playerNames","pname","Boolean","USER_AGENT","webkitVersionMap","appleWebkitVersion","IS_IPAD","IS_IPHONE","IS_IPOD","IS_IOS","IOS_VERSION","IS_ANDROID","ANDROID_VERSION","major","minor","IS_NATIVE_ANDROID","IS_FIREFOX","IS_EDGE","IS_CHROME","CHROME_VERSION","IE_VERSION","IS_SAFARI","IS_ANY_SAFARI","TOUCH_ENABLED","browser","getRange","fnName","valueIndex","rangeIndex","maxIndex","rangeCheck","createTimeRangesObj","createTimeRanges","bufferedPercent","buffered","bufferedDuration","browserApi","FullscreenApi","apiMap","specApi","MediaError","defaultMessages","status","errorTypes","errNum","isPromise","then","silencePromise","trackToJson_","cues","cue","textTrackConverter","tech","trackEls","trackObjs","trackEl","src","textTracks","addedTrack","addRemoteTextTrack","addCue","ModalDialog","_Component","opened_","hasBeenOpened_","hasBeenFilled_","closeable","uncloseable","MODAL_CLASS_NAME","descEl_","tabIndex","previouslyActiveEl_","handleKeyPress","close","desc","open","fillAlways","fill","wasPlaying_","paused","pauseOnOpen","pause","hadControls_","controls","conditionalFocus_","opened","conditionalBlur_","temporary","closeable_","temp","controlText","fillWith","parentEl","nextSiblingEl","nextSibling","empty","closeButton","content_","activeEl","playerEl","handleKeyDown","focusIndex","focusableEls","focusableEls_","querySelector","shiftKey","allChildren","querySelectorAll","hasAttribute","TrackList","_EventTarget","tracks_","addTrack","removeTrack","rtrack","getTrackById","change","addtrack","removetrack","disableOthers","enabled","AudioTrackList","_TrackList","changing_","disableOthers$1","selected","VideoTrackList","TextTrackList","kind","HtmlTrackElementList","trackElements","trackElements_","addTrackElement_","trackElement","getTrackElementByTrack_","trackElement_","removeTrackElement_","TextTrackCueList","setCues_","length_","oldLength","cues_","defineProp","getCueById","VideoTrackKind","alternative","main","sign","subtitles","commentary","AudioTrackKind","TextTrackKind","descriptions","chapters","TextTrackMode","hidden","showing","Track","trackProps","_loop","parseUrl","href","div","addToBody","host","protocol","innerHTML","details","getAbsoluteURL","getFileExtension","isCrossOrigin","winLoc","urlInfo","Url","parseCues","srcContent","parser","oncue","onparsingerror","onflush","TextTrack","_Track","srclang","mode","default_","tech_","activeCues_","activeCues","changed","timeupdateHandler","newMode","loaded_","ct","currentTime","active","crossOrigin","cors","response","responseBody","loadHandler","loadTrack","originalCue","originalCue_","removeCue","_removeCue","cuechange","AudioTrack","newEnabled","VideoTrack","newSelected","HTMLTrackElement","readyState","load","NONE","LOADING","LOADED","ERROR","NORMAL","ListClass","TrackClass","capitalName","getterName","privateName","REMOTE","remoteText","remoteTextEl","ALL","names","hasStarted_","featuresProgressEvents","manualProgressOn","featuresTimeupdateEvents","manualTimeUpdatesOn","nativeCaptions","nativeTextTracks","featuresNativeTextTracks","emulateTextTracks","autoRemoteTextTracks_","initTrackListeners","nativeControlsForTouch","triggerSourceset","onDurationChange","manualProgress","trackProgress","manualProgressOff","stopTrackingProgress","progressInterval","numBufferedPercent","bufferedPercent_","duration_","manualTimeUpdates","trackCurrentTime","stopTrackingCurrentTime","manualTimeUpdatesOff","currentTimeInterval","manuallyTriggered","clearTracks","removeRemoteTextTrack","cleanupAutoTextTracks","error_","played","setCurrentTime","trackListChanges","addWebVttScript_","_this5","script","onload","onerror","_this6","remoteTracks","remoteTextTracks","handleAddTrack","handleRemoveTrack","updateDisplay","textTracksChanges","addTextTrack","createTrackHelper","createRemoteTextTrack","manualCleanup","_this7","htmlTrackElement","remoteTextTrackEls","getVideoPlaybackQuality","setPoster","playsinline","setPlaysinline","overrideNativeAudioTracks","overrideNativeVideoTracks","canPlayType","canPlaySource","srcObj","registerTech","techs_","defaultTechOrder_","getTech","featuresVolumeControl","featuresMuteControl","featuresFullscreenResize","featuresPlaybackRate","featuresSourceset","withSourceHandlers","_Tech","registerSourceHandler","handler","sourceHandlers","can","selectSourceHandler","canHandleSource","sh","originalFn","sourceHandler_","setSource","nativeSourceHandler","disposeSourceHandler","currentSource_","handleSource","middlewares","middlewareInstances","TERMINATOR","next","setSourceHelper","mediate","middleware","callMethod","middlewareValue","middlewareIterator","terminated","mws","mw","executeRight","allowedGetters","seekable","allowedSetters","allowedMediators","lastRun","_middleware","mwFactory","mwrest","_mws$i","mwf","mwi","getOrCreateFactory","_src","MimetypesKind","opus","ogv","mov","m4v","mkv","mp3","oga","m3u8","getMimetype","ext","filterSource","newsrc","srcobj","fixSource","mimetype","MediaLoader","techOrder","techName","isSupported","loadTech_","ClickableComponent","tabIndex_","createControlTextEl","controlTextEl_","controlText_","localizedText","nonIconControl","enabled_","handleClick","handleFocus","handleBlur","PosterImage","_ClickableComponent","update","poster","setSrc","backgroundImage","fontMap","monospace","sansSerif","serif","monospaceSansSerif","monospaceSerif","proportionalSansSerif","proportionalSerif","casual","smallcaps","constructColor","color","opacity","hex","tryUpdateStyle","TextTrackDisplay","updateDisplayHandler","toggleDisplay","preselectTrack","firstDesc","firstCaptions","preferredTrack","modes","trackList","userPref","cache_","selectedLanguage","clearDisplay","descriptionsTrack","captionsSubtitlesTrack","updateForTrack","textTrackSettings","overrides","getValues","cueDiv","displayState","textOpacity","backgroundColor","backgroundOpacity","windowColor","windowOpacity","edgeStyle","textShadow","fontPercent","fontSize","bottom","fontFamily","fontVariant","LoadingSpinner","isAudio","playerType","dir","Button","BigPlayButton","_Button","mouseused_","handleMouseDown","playPromise","cb","playToggle","playFocus","CloseButton","PlayToggle","replay","handlePlay","handlePause","handleEnded","handleSeeked","defaultImplementation","guide","gm","gh","implementation","formatTime","TimeDisplay","throttledUpdateContent","updateContent","plainName","labelText_","updateTextNode_","textNode_","formattedTime_","formatTime_","updateFormattedTime_","formattedTime","CurrentTimeDisplay","_TimeDisplay","scrubbing","getCache","DurationDisplay","TimeDivider","RemainingTimeDisplay","remainingTimeDisplay","remainingTime","LiveDisplay","updateShowing","SeekToLive","updateLiveEdgeStatus","liveTracker","textEl_","atLiveEdge","seekToLiveEdge","Slider","bar","barName","vertical","playerEvent","handleMouseMove","handleMouseUp","progress","getPercent","percentage","toFixed","calculateDistance","stepBack","stepForward","bool","vertical_","LoadProgressBar","partEls_","isLive","seekableEnd","bufferedEnd","controlTextPercentage","percentify","rounded","percent","TimeTooltip","seekBarRect","seekBarPoint","tooltipRect","playerRect","seekBarPointPx","spaceLeftOfPoint","spaceRightOfPoint","pullTooltipBy","updateTime","rafId_","liveWindow","secondsBehind","PlayProgressBar","timeTooltip","MouseTimeDisplay","SeekBar","_Slider","setEventHandlers_","updateInterval","update_","liveCurrentTime","getCurrentTime_","seekableStart","videoWasPlaying","newTime","distance","mouseTimeDisplay","handleAction","ProgressControl","throttledHandleMouseSeek","handleMouseSeek","seekBar","seekBarEl","FullscreenToggle","handleFullscreenChange","fullscreenEnabled","isFullscreen","exitFullscreen","requestFullscreen","VolumeLevel","VolumeBar","updateLastVolume_","updateARIAAttributes","checkMuted","muted","ariaValue","volumeAsPercentage_","volumeBeforeDrag","lastVolume_","VolumeControl","volumeBar","checkVolumeSupport","throttledHandleMouseMove","orientationClass","MuteToggle","checkMuteSupport","vol","lastVolume","volumeToSet","updateIcon_","updateControlText_","VolumePanel","inline","volumeControl","volumePanelState_","sliderActive_","sliderInactive_","muteToggle","Menu","menuButton_","menuButton","focusedChild_","addItem","unpressButton","contentElType","append","btn","buttonPressed_","stepChild","item","MenuButton","buttonClass","menu","handleSubmenuKeyPress","createMenu","items","hideThreshold_","createItems","buildWrapperCSSClass","menuButtonClass","pressButton","TrackButton","_MenuButton","updateHandler","MenuItem","selectable","isSelected_","multiSelectable","_selected","TextTrackMenuItem","_MenuItem","changeHandler","handleTracksChange","selectedLanguageChangeHandler","handleSelectedLanguageChange","onchange","initEvent","kinds","shouldBeSelected","OffTextTrackMenuItem","_TextTrackMenuItem","allHidden","TextTrackButton","_TrackButton","TrackMenuItem","label_","kinds_","kind_","ChaptersTrackMenuItem","ChaptersButton","_TextTrackButton","track_","setTrack","findChaptersTrack","updateHandler_","remoteTextTrackEl","_remoteTextTrackEl","getMenuCaption","mi","DescriptionsButton","SubtitlesButton","CaptionSettingsMenuItem","CaptionsButton","SubsCapsMenuItem","SubsCapsButton","language_","AudioTrackMenuItem","audioTracks","AudioTrackButton","PlaybackRateMenuItem","playbackRate","PlaybackRateMenuButton","updateVisibility","updateLabel","labelEl_","rates","playbackRates","currentRate","newRate","playbackRateSupported","Spacer","CustomControlSpacer","_Spacer","ControlBar","ErrorDisplay","_ModalDialog","LOCAL_STORAGE_KEY","COLOR_BLACK","COLOR_BLUE","COLOR_CYAN","COLOR_GREEN","COLOR_MAGENTA","COLOR_RED","COLOR_WHITE","COLOR_YELLOW","OPACITY_OPAQUE","OPACITY_SEMI","OPACITY_TRANS","selectConfigs","parseOptionValue","TextTrackSettings","endDialog","setDefaults","persistTextTrackSettings","saveSettings","restoreSettings","createElSelect_","legendId","selectLabelledbyIds","optionId","createElFgColor_","createElBgColor_","createElWinColor_","createElColors_","createElFont_","createElControls_","defaultsDescription","initial","accum","selectedIndex","setValues","setSelectedOption","ttDisplay","controlBar","subsCapsBtn","subsCapsButton","ccBtn","captionsButton","ResizeManager","RESIZE_OBSERVER_AVAILABLE","ResizeObserver","loadListener_","resizeObserver_","debouncedHandler_","immediate","debounced","_later","cancel","debounce","resizeHandler","observe","contentWindow","unobserve","disconnect","resizeObserver","LiveTracker","reset_","handleDurationchange","isBehind_","timeupdateSeen_","seekableIncrement","seekableIncrement_","trackLive_","pastSeekEnd_","newSeekEnd","lastSeekEnd_","pastSeekEnd","behindLiveEdge","behindLiveEdge_","startTracking","stopTracking","isTracking","trackingInterval_","handleTimeupdate","seekableEnds","seekableStarts","sourcesetLoad","srcUrls","innerHTMLDescriptorPolyfill","cloneNode","dummy","docFrag","getDescriptor","priority","getOwnPropertyDescriptor","firstSourceWatch","resetSourceWatch_","innerDescriptor","getInnerHTMLDescriptor","appendWrapper","appendFn","retval","srcDescriptorPolyfill","setupSourceset","resetSourceset_","srcDescriptor","getSrcDescriptor","oldSetAttribute","oldLoad","currentSrc","_templateObject$1","Html5","crossoriginTracks","initNetworkState_","handleLateInit_","enableSourceset","setupSourcesetHandling_","hasChildNodes","nodes","nodesLength","removeNodes","proxyNativeTracks_","restoreMetadataTracksInIOSNativePlayer_","setControls","proxyWebkitFullscreen_","disposeMediaElement","metadataTracksPreFullscreenState","takeMetadataTrackSnapshot","storedMode","restoreTrackMode","storedTrack","overrideNative_","override","lowerCaseType","eventName","proxyNativeTracksForType_","elTracks","techTracks","currentTarget","removeOldTracks","removeTracks","found","playerElIngest","movingMediaElementInDOM","clone","techId","class","playerId","preload","settingsAttrs","networkState","loadstartFired","setLoadstartFired","triggerLoadstart","eventsToTrigger","checkProgress","NaN","endFn","beginFn","webkitPresentationMode","supportsFullScreen","webkitEnterFullScreen","userAgent","enterFullScreen","HAVE_METADATA","exitFullScreen","webkitExitFullScreen","resetMediaElement","videoPlaybackQuality","webkitDroppedFrameCount","webkitDecodedFrameCount","droppedVideoFrames","totalVideoFrames","TEST_VID","canControlVolume","canMuteVolume","canControlPlaybackRate","canOverrideAttributes","supportsNativeTextTracks","supportsNativeVideoTracks","videoTracks","supportsNativeAudioTracks","featuresNativeVideoTracks","featuresNativeAudioTracks","mpegurlRE","_templateObject$2","patchCanPlayType","unpatchCanPlayType","TECH_EVENTS_RETRIGGER","TECH_EVENTS_QUEUE","canplay","canplaythrough","playing","seeked","BREAKPOINT_ORDER","BREAKPOINT_CLASSES","DEFAULT_BREAKPOINTS","tiny","xsmall","small","medium","large","xlarge","huge","getTagSettings","closest","isPosterFromTech_","queuedCallbacks_","userActive_","tagAttributes","languagesToLower","name$$1","languages_","poster_","controls_","autoplay","scrubbing_","lastPlaybackRate","defaultPlaybackRate","fluid_","updateStyleEl_","playerOptionsCopy","plugins","middleware_","flexNotSupported_","majorVersion","userActive","listenForUserActivity_","handleFullscreenChange_","handleStageClick_","breakpoints","responsive","changingSrc_","playWaitingForReady_","playOnLoadstart_","styleEl_","playerElIngest_","divEmbed","tabindex","defaultsStyleEl","head","fill_","fluid","aspectRatio","links","linkEl","_dimension","privDimension","parsedVal","ratio","aspectRatio_","idClass","ratioParts","videoWidth","videoHeight","ratioMultiplier","width_","height_","_width","_height","techEl","unloadTech_","titleTechName","camelTechName","techName_","techOptions","loop","techCanOverridePoster","TechClass","handleTechReady_","textTracksJson_","eventObj","seeking","handleTechLoadStart_","handleTechSourceset_","handleTechWaiting_","handleTechEnded_","handleTechSeeking_","handleTechPlay_","handleTechFirstPlay_","handleTechPause_","handleTechDurationChange_","handleTechFullscreenChange_","handleTechError_","handleTechPosterChange_","handleTechTextData_","handleTechRateChange_","usingNativeControls","techGet_","addTechControlsListeners_","safety","removeTechControlsListeners_","handleTechClick_","handleTechDoubleClick_","handleTechTouchStart_","handleTechTouchMove_","handleTechTouchEnd_","handleTechTap_","techCall_","hasStarted","manualAutoplay_","promise","previouslyMuted","catch","updateSourceCaches_","matchingSources","findMimetype","sourceElSources","sourceEls","matchingSourceEls","sourceObj","updateSourceCaches","playerSrc","currentSource","eventSrc","lastSource_","updateCache","techSrc","techGet","request","queued","timeWhenWaiting","timeUpdateListener","handleTechCanPlay_","handleTechCanPlayThrough_","handleTechPlaying_","handleTechSeeked_","starttime","userWasActive","set$1","reduceRight","PromiseClass","Promise","resolve","play_","_this8","isScrubbing","liveui","percentAsDecimal","_muted","defaultMuted","_defaultMuted","isFS","isFullscreen_","fsApi","fullscreenchange","documentFullscreenChange","fullscreenElement","enterFullWindow","exitFullWindow","isFullWindow","docOrigOverflow","fullWindowOnEscKey","selectSource","foundSourceAndTech","_this9","techs","findFirstPassingTechSourcePair","outerArray","innerArray","tester","outerChoice","innerChoice","finder","sourceOrder","flip","_this10","middlewareSource","src_","notSupportedMessage","setTech","str1","str2","_this11","sourceTech","currentSources","currentType","techAutoplay","newPoster","usingNativeControls_","errorDisplay","userActivity_","mouseInProgress","lastMoveX","lastMoveY","inactivityTimeout","handleActivity","screenX","screenY","isAudio_","toJSON","createModal","_this12","modal","updateCurrentBreakpoint_","currentBreakpoint","candidateBreakpoint","breakpoints_","breakpoint_","removeCurrentBreakpoint_","currentBreakpointClass","_breakpoints","responsive_","baseOptions","tagOptions","dataSetup","_safeParseTuple","childName","html5","flash","userLanguage","BASE_PLUGIN_NAME","pluginStorage","pluginExists","getPlugin","markPluginAsActive","triggerSetupEvent","before","createPluginFactory","PluginSubClass","plugin","getEventHash","Plugin","VERSION","isBasic","registerPlugin","basicPluginWrapper","createBasicPlugin","deregisterPlugin","getPlugins","getPluginVersion","usingPlugin","hasPlugin","normalizeId","videojs$1","getPlayer","hooks","hookFunction","PlayerComponent","hooks_","hook","hookOnce","original","removeHook","style$1","getPlayers","nId","_tag","_player","getAllPlayers","comp","use","writeable","extend","subClassMethods","methods","super_","_inherits$1","addLanguage","_mergeOptions","createTimeRange","setFormatTime","customImplementation","resetFormatTime","xhr","dom","get$1","property","getPrototypeOf","getter","slicedToArray","_arr","_n","_d","_e","_s","sliceIterator","mergeOptions$1","EventTarget$1","log$1","forEachMediaGroup","mediaType","groupKey","labelKey","mediaProperties","updateMaster","mergedPlaylist","updateSegments","baseUri","resolveSegmentUris","setupMediaPlaylists","resolveMediaGroupUris","refreshDelay","lastSegment","PlaylistLoader","srcUrl","hls","withCredentials","hls_","req","playlistRequestError","haveMetadata","xhr$$1","startingState","responseText","media_","mediaUpdateTimeout","stopRequest","oldRequest","onreadystatechange","abort","mediaChange","started","isFinalRendition","intervalDuration","endSequence","expired","backward","forward","backwardDuration","forwardDuration","sumDurations","durations","safeLiveIndex","distanceFromEnd","safeDistance","playlistEnd","useSafeLiveEnd","isWholeNumber","roundSignificantDigit","increment","numDecimalDigits","ceilLeastSignificantDigit","floorLeastSignificantDigit","isBlacklisted","excludeUntil","isIncompatible","isEnabled","blacklisted","isLowestEnabledRendition","currentBandwidth","MAX_VALUE","Playlist","getMediaInfoForTime","numSegments","mediaIndex","isDisabled","isAes","isFmp4","estimateSegmentRequestTime","segmentDuration","bytesReceived","videojsXHR","mergeOptions$1$1","xhrFactory","XhrFunction","beforeRequest","Hls","newOptions","reqResponse","responseTime","roundTripTime","requestTime","responseHeaders","timedout","aborted","statusCode","originalAbort","textRange","formatHexString","formatAsciiString","createTransferableMessage","transferable","isView","initSegmentId","hexDump","utils","tagDump","textRanges","timeWithinSegment","requestedTime","segmentStart","requestedTimeString","toISOString","segmentTimeString","endTimeString","findSegmentForTime","manifestTime","estimatedEnd","estimatedStart","timeWithinSegmentEnd","timeWithinSegmentDuration","getStreamTime","_ref$time","matchedSegment","findSegmentForPlayerTime","seekTime","streamTime","mediaSeconds","programDateTime","seekToStreamTime","_ref2$retryCount","retryCount","seekTo","_ref2$pauseAfterSeek","pauseAfterSeek","verifyProgramDateTimeTags","findSegmentForStreamTime","mediaOffset","comparisonTimeStamp","segmentDateTime","streamDateTime","segmentTimeEpoch","getOffsetFromTimestamp","seekToTime","TIME_FUDGE_FACTOR","SAFE_TIME_DELTA","filterRanges","timeRanges","findRange","findNextRange","printableRange","strArr","timeRangesToArray","timeRangesList","removeCuesFromTrack","durationOfVideo","addTextTrackData","sourceHandler","captionArray","metadataArray","Cue","inbandTextTracks_","timestampOffset","videoDuration","mediaSource_","deprecateOldCue","metadataTrack_","cuesArray","cuesGroupedByStartTime","timeSlot","sortedStartTimes","cueGroup","nextTime","TARGET","BlobBuilder","WebKitBlobBuilder","MozBlobBuilder","MSBlobBuilder","URL","webkitURL","msURL","Worker","shimWorker","filename","forceFallback","objURL","createSourceObject","worker","term","terminate","revokeObjectURL","wrapTerminate","selfShim","postMessage","onmessage","isThisThread","testWorker","testArray","createObjectURL","Blob","blob","getBlob","TransmuxWorker","document$$1","_findBox","mp4Generator","toUnsigned$1","silence","ONE_SECOND_IN_TS$1","captionPacketParser","streamTypes","_MetadataStream","timestampRolloverStream","_TransportPacketStream","_TransportParseStream","_ElementaryStream","TimestampRolloverStream$1","stream$$1","_AdtsStream","m2ts_1","_H264Stream","_NalByteStream","expGolomb","_AacStream","_VideoSegmentStream","_AudioSegmentStream","_Transmuxer","_CoalesceStream","isLikelyAacData$1","_textifyMp","transmuxer","parseType$2","parse$$1","mp4Inspector","discardEmulationPreventionBytes$1","CaptionStream$1","captionParser","captionStream$$1","MessageHandlers","initArray","typedArray","action","gopInfo","wireTransmuxerEvents","appendStart","transmuxerWorker","messageHandlers","defaultCodecs","videoCodec","videoObjectTypeIndicator","audioProfile","translateLegacyCodecs","orig","profile","avcLevel","parseCodecs","codecCount","makeMimeTypeString","container","mimeTypesForPlaylist","containerType","getContainerType","codecInfo","mediaAttributes","getCodecs","isMuxed","isMaat","audioGroup","groupId","audioGroupId","audioType","audioProfileFromDefault","codecStrings","justAudio","justVideo","bothVideoAudio","isAudioCodec","isVideoCodec","gopsSafeToAlignWith","mapping","currentTimePts","VirtualSourceBuffer","_videojs$EventTarget","mediaSource","timestampOffset_","pendingBuffers_","bufferUpdating_","codecs_","audioCodec_","videoCodec_","audioDisabled_","appendAudioInitSegment_","gopBuffer_","timeMapping_","safeAppend_","transmuxer_","data_","done_","appendGopInfo_","videoBuffer_","audioBuffer_","appendWindowStart","updating","videoBuffer","audioBuffer","audioDisabled","arity","extents","videoBuffered","audioBuffered","sourceBuffer","inBandMetadataTrackDispatchType","createTextTracksIfNecessary","processPendingSegments_","addSourceBuffer","realBuffer_","makeWrappedSourceBuffer","nativeMediaSource_","updateGopBuffer","updatedBuffer","removeGopBuffer","sortedSegments","segmentObj","createRealSourceBuffers_","triggerUpdateend","concatAndAppendSegments_","destinationBuffer","tempBuffer","appendBuffer","originalError","HtmlMediaSource","activeSourceBuffers_","sourceBuffers","updateActiveSourceBuffers_","disableCombined","disableAudioOnly","onPlayerMediachange_","onHlsReset_","onHlsSegmentTimeMapping_","url_","sourcebuffer","parsedType","parameters","parameter","parseContentType","urlCount","mediaSources","msObjectURL","swfId","supportsNativeMediaSources","MediaSource","URL$1","EventTarget$1$1","mergeOptions$2","updateMaster$1","oldMaster","newMaster","playlistUpdate","group","_playlistUpdate","DashPlaylistLoader","srcUrlOrPlaylist","masterPlaylistLoader","refreshXml_","refreshMedia_","masterPlaylistLoader_","masterXml_","clientOffset_","phonyUri","_phonyUri","date","masterLoaded_","syncClientServerClock_","onClientServerClockSync_","utcTiming","serverTime","parseMasterXml","updatedMaster","logger","SourceUpdater","sourceBufferEmitter","callbacks_","pendingCallback_","processedAppend_","mimeType_","logger_","createSourceBuffer_","sourceBuffer_","start_","started_","onUpdateendCallback_","pendingCallback","runCallback_","queueCallback_","Config","GOAL_BUFFER_LENGTH","MAX_GOAL_BUFFER_LENGTH","GOAL_BUFFER_LENGTH_RATE","INITIAL_BANDWIDTH","BANDWIDTH_VARIANCE","BUFFER_LOW_WATER_LINE","MAX_BUFFER_LOW_WATER_LINE","BUFFER_LOW_WATER_LINE_RATE","REQUEST_ERRORS","segmentXhrHeaders","byterangeEnd","Range","abortAll","activeXhrs","handleErrors","waitForCompletion","decrypter","doneFn","didError","endOfAllRequests","encryptedBytes","decryptionHandler","requestId","decryptSegment","handleProgress","progressFn","progressEvent","stats","loaded","firstBytesReceivedAt","mediaSegmentRequest","xhrOptions","decryptionWorker","finishProcessingFn","keyRequestOptions","responseType","keyRequestCallback","errorObj","handleKeyResponse","keyXhr","initSegmentOptions","initSegmentRequestCallback","handleInitSegmentResponse","initSegmentXhr","segmentRequestOptions","segmentRequestCallback","getRequestStats","fmp4Captions","handleSegmentResponse","segmentXhr","safeGetComputedStyle","stableSort","sortFn","newArray","cmp","comparePlaylistBandwidth","leftBandwidth","rightBandwidth","detectEndOfStream","segmentIndex","appendedLastSegment","finite","SegmentLoader","throughput","roundTrip","resetStats_","hasPlayed_","hasPlayed","currentTime_","seekable_","seeking_","loaderType_","loaderType","startingMedia_","segmentMetadataTrack_","segmentMetadataTrack","goalBufferLength_","goalBufferLength","sourceType_","sourceType","inbandTextTracks","state_","checkBufferTimeout_","currentTimeline_","pendingSegment_","sourceUpdater_","xhrOptions_","activeInitSegmentId_","initSegments_","captionParser_","decrypter_","syncController_","syncController","syncPoint_","ended_","fetchAtBuffer_","newState","mediaBytesTransferred","mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaSecondsLoaded","abort_","monitorBuffer_","abortRequests","_error","set$$1","storedMap","playlist_","setDateTimeMapping","couldBeginLoading_","init_","sourceBufferEmitter_","resetEverything","newPlaylist","oldPlaylist","syncInfo","oldId","mediaSequenceDiff","saveExpiredSegmentInfo","resyncLoader","_mimeType","resetLoader","monitorBufferTick_","fillBuffer_","getSyncPoint","checkBuffer_","buffered_","endOfStream","startOfSegment","loadSegment_","lastBufferedEnd","bufferedTime","getSyncSegmentCandidate_","generateSegmentInfo_","mediaSourceInfo","_mediaSourceInfo","segmentIndexArray","isSyncRequest","random","measuredBandwidth","requestTimeRemaining","timeUntilRebuffer$$1","timeUntilRebuffer","switchCandidate","duration$$1","compatiblePlaylists","enabledPlaylists","rebufferingEstimates","numRequests","rebufferingImpact","noRebufferingPlaylists","estimate","minRebufferMaxBandwidthSelector","timeSavedBySwitching","minimumTimeSaving","simpleSegment","abortRequestEarly_","trimBackBuffer_","createSimplifiedSegmentObj_","handleProgress_","segmentRequestFinished_","removeToTime","seekable$$1","safeBackBufferTrimTime","processSegmentResponse_","createCaptionsTrackIfNotExists","WebKitDataCue","VTTCue","addCaptionData","handleSegment_","timingInfo","probeSegmentInfo","containsAudio","containsVideo","startingMedia","newSegmentMedia","illegalMediaSwitchError","blacklistDuration","timelineMapping","mappingForTimeline","initId","_segmentInfo$segment","_segmentInfo$playlist","seq","_segmentInfo$playlist2","segmentInfoString","handleUpdateEnd_","isWalkingForward","recordThroughput_","addSegmentMetadataCue_","segmentProcessingTime","segmentProcessingThroughput","uint8ToUtf8","uintArray","VTT_LINE_TERMINATORS","VTTSegmentLoader","_SegmentLoader","subtitlesTrack_","combinedByteLength","combinedSegment","_track","skipEmptySegments_","timestampOffsetForTimeline","requested","parseVTTCues_","updateTimeMapping_","timelines","decoder","decodeBytesToString","timestampmap","MPEGTS","LOCAL","ontimestampmap","mapData","segmentData","mappingObj","diff","firstStart","lastStart","findAdCue","mediaTime","adStartTime","adEndTime","tsprobe","syncPointStrategies","run","datetimeToDisplayTime","lastDistance","discontinuitySync","discontinuities","SyncController","inspectCache_","syncPoints","runStrategies_","selectSyncPoint_","strategy","bestSyncPoint","bestDistance","bestStrategy","newDistance","lastRemovedSegment","playlistTimestamp","probeMp4Segment_","probeTsSegment_","calculateSegmentTimeMapping_","saveDiscontinuitySyncInfo_","timeInfo","segmentStartTime","segmentEndTime","accuracy","mediaIndexDiff","Decrypter$1","AsyncStream$$1","Decrypter$$1","decrypt$$1","decrypterWorker","audioTrackKind_","stopLoaders","segmentLoader","activePlaylistLoader","startLoaders","playlistLoader","onError","segmentLoaders","mediaTypes","blacklistCurrentPlaylist","activeTrack","activeGroup","defaultTrack","onTrackChanged","setupListeners","requestOptions","byGroupId","byResolvedUri","initialize","_settings$master","_settings$mediaTypes$","groups","groupPlaylists","variantLabel","_settings$mediaTypes$2","_settings$mediaTypes$3","setupMediaGroups","variants","onGroupChanged","_settings$segmentLoad","mainSegmentLoader","previousActiveLoader","_settings$segmentLoad2","onAudioTrackChanged","loaderStats","sumLoaderStat","stat","audioSegmentLoader_","mainSegmentLoader_","MasterPlaylistController","externHls","useCueTags","enableLowInitialPlaylist","seekTo_","useCueTags_","cueTagsTrack_","requestOptions_","mediaTypes_","handleSourceOpen_","segmentLoaderSettings","setupMasterPlaylistLoaderListeners_","subtitleSegmentLoader_","setupSegmentLoaderListeners_","requestTimeout","triggerPresenceUsage_","setupSourceBuffers_","setupFirstPlay","updatedPlaylist","excludeUnsupportedVariants_","selectedMedia","selectInitialPlaylist","selectPlaylist","initialMedia_","updateAdCues_","updateDuration","addSeekableRange","addSeekableRange_","onDurationchange","stuckAtPlaylistEnd_","defaultDemuxed","audioGroupKeys","nextPlaylist","currentPlaylist","forwardBuffer","bufferLowWaterLine","onSyncInfoUpdate_","onEndOfStream","ended","isEndOfStream","getExpiredTime","absolutePlaylistEnd","mainSeekable","audioSeekable","oldDuration","newDuration","setDuration","mimeTypes","configureLoaderMimeTypes_","excludeIncompatibleVariants_","variant","codecString","variantCodecs","adOffset","adTotal","_segment$cueOutCont$s","_segment$cueOutCont$s2","updateAdCues","Representation","hlsHandler","loader","playlistUri","changePlaylistFn","mpc","masterPlaylistController_","qualityChangeFunction","smoothQualityChange","incompatible","currentlyEnabled","timerCancelEvents","PlaybackWatcher","consecutiveUpdates","lastRecordedTime","timer_","checkCurrentTimeTimeout_","canPlayHandler","monitorCurrentTime_","waitingHandler","techWaiting_","cancelTimerHandler","cancelTimer_","fixesBadSeeksHandler","fixesBadSeeks_","checkCurrentTime_","waiting_","afterSeekableWindow_","beforeSeekableWindow_","currentRange","livePoint","nextRange","videoUnderflow_","difference","skipTheGap_","gap","gapFromVideoUnderflow_","scheduledCurrentTime","gaps","findGaps","defaultOptions","errorInterval","getSource","IWillNotUseThisInPlugins","initPlugin","lastCalled","localOptions","loadedMetadataHandler","errorHandler","cleanupEvents","reloadSourceOnError","vhs","source_","Hls$1","STANDARD_PLAYLIST_SELECTOR","playerBandwidth","playerWidth","playerHeight","limitRenditionByPlayerDimensions","sortedPlaylistReps","enabledPlaylistReps","rep","bandwidthPlaylistReps","highestRemainingBandwidthRep","bandwidthBestRep","_chosenRep","haveResolution","resolutionBestRepList","resolutionBestRep","resolutionPlusOneList","resolutionPlusOneSmallest","resolutionPlusOneRep","chosenRep","simpleSelector","systemBandwidth","INITIAL_PLAYLIST_SELECTOR","comparePlaylistResolution","leftWidth","rightWidth","LOCAL_STORAGE_KEY$1","simpleTypeFromSourceType","handleHlsMediaChange","qualityLevels","selectedIndex_","setupEmeOptions","eme","sourceOptions","keySystemOptions","videoPlaylist","audioPlaylist","keySystemContentTypes","audioContentType","videoContentType","emeKeySystems","keySystems","initializeMediaKeys","getVhsLocalStorage","localStorage","storedObject","getItem","supportsNativeHls","canItPlay","supportsNativeDash","supportsTypeNatively","HlsHandler","dash","setOptions_","overrideNative","smoothQualityChange_","pauseLoading","useBandwidthFromLocalStorage","option","playbackWatcher_","invBandwidth","invThroughput","mediaRequests_","mediaRequestsAborted_","mediaRequestsTimedout_","mediaRequestsErrored_","mediaTransferDuration_","mediaBytesTransferred_","mediaSecondsLoaded_","currentTech","playerDimensions","objectToStore","setItem","updateVhsLocalStorage","setupQualityLevels_","qualityLevels_","addQualityLevel","HlsSourceHandler","_videojs$mergeOptions","supportedType","canUseMsePlayback","vttjs","WebVTT","VTTRegion","cueShim","regionShim","nativeVTTCue","nativeVTTRegion","shim","restore","_objCreate","F","ParsingError","errorData","parseTimeStamp","input","computeSeconds","f","Settings","parseOptions","keyValueDelim","groupDelim","kv","parseCue","regionList","oInput","consumeTimeStamp","Errors","BadTimeStamp","skipWhitespace","substr","region","alt","vals","vals0","integer","lineAlign","snapToLines","positionAlign","consumeCueSettings","BadSignature","dflt","defaultKey","ESCAPE","TAG_NAME","u","ruby","rt","TAG_ANNOTATION","NEEDS_PARENT","parseContent","nextToken","unescape1","shouldAdd","current","localName","createElement","annotation","rootDiv","tagStack","createTextNode","createProcessingInstruction","strongRTLRanges","isStrongRTLChar","determineBidi","nodeStack","pushNodes","nextTextNode","StyleBox","CueStyleBox","styleOptions","styles","display","writingMode","unicodeBidi","applyStyles","textAlign","font","whiteSpace","textPos","formatStyle","move","BoxPosition","lh","offsetTop","rects","getClientRects","lineHeight","moveBoxToLinePosition","styleBox","containerBox","boxPositions","boxPosition","linePos","textTrackList","mediaElement","computeLinePos","axis","maxPosition","initialAxis","calculatedPercentage","bestPosition","specifiedPosition","overlapsOppositeAxis","within","overlapsAny","intersectPercentage","findBestPosition","toCSSCompatValues","unit","toMove","overlaps","getSimpleBoxPosition","StringDecoder","decode","encodeURIComponent","convertCueToDOMTree","cuetext","processCues","overlay","paddedOverlay","margin","hasBeenReset","shouldCompute","TextDecoder","reportOrThrowError","collectNextLine","pos","parseHeader","parseTimestampMap","xy","anchor","lines","regionAnchorX","regionAnchorY","viewportAnchorX","viewportAnchorY","scroll","onregion","parseRegion","alreadyCollectedLine","hasSubstring","directionSetting","alignSetting","findAlignSetting","_id","_pauseOnExit","_startTime","_endTime","_text","_region","_vertical","_snapToLines","_line","_lineAlign","_position","_positionAlign","_size","_align","setting","findDirectionSetting","SyntaxError","getCueAsHTML","scrollSetting","isValidPercentValue","_lines","_regionAnchorX","_regionAnchorY","_viewportAnchorX","_viewportAnchorY","_scroll","findScrollSetting","isFunction","parseHeaders","xtend","initParams","createXHR","_createXHR","called","getBody","responseXML","firefoxBugTakenEffect","getXml","isJson","errorFunc","evt","timeoutTimer","failureResponse","loadFunc","useXDR","rawRequest","getAllResponseHeaders","XDomainRequest","XMLHttpRequest","onprogress","onabort","ontimeout","username","password","setRequestHeader","isEmpty","beforeSend","send"],"sourceRoot":""} \ No newline at end of file
diff --git a/package-lock.json b/package-lock.json
index 7fcae4f..5dee809 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1760,6 +1760,70 @@
"dev": true,
"peer": true
},
+ "node_modules/@jridgewell/gen-mapping": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz",
+ "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==",
+ "dev": true,
+ "peer": true,
+ "dependencies": {
+ "@jridgewell/set-array": "^1.0.1",
+ "@jridgewell/sourcemap-codec": "^1.4.10",
+ "@jridgewell/trace-mapping": "^0.3.9"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@jridgewell/resolve-uri": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz",
+ "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==",
+ "dev": true,
+ "peer": true,
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@jridgewell/set-array": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz",
+ "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==",
+ "dev": true,
+ "peer": true,
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@jridgewell/source-map": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz",
+ "integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==",
+ "dev": true,
+ "peer": true,
+ "dependencies": {
+ "@jridgewell/gen-mapping": "^0.3.0",
+ "@jridgewell/trace-mapping": "^0.3.9"
+ }
+ },
+ "node_modules/@jridgewell/sourcemap-codec": {
+ "version": "1.4.14",
+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz",
+ "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==",
+ "dev": true,
+ "peer": true
+ },
+ "node_modules/@jridgewell/trace-mapping": {
+ "version": "0.3.15",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.15.tgz",
+ "integrity": "sha512-oWZNOULl+UbhsgB51uuZzglikfIKSUBO/M9W2OfEjn7cmqoAiCgmv9lyACTUacZwBz0ITnJ2NqjU8Tx0DHL88g==",
+ "dev": true,
+ "peer": true,
+ "dependencies": {
+ "@jridgewell/resolve-uri": "^3.0.3",
+ "@jridgewell/sourcemap-codec": "^1.4.10"
+ }
+ },
"node_modules/@nextcloud/babel-config": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@nextcloud/babel-config/-/babel-config-1.0.0.tgz",
@@ -11758,9 +11822,9 @@
}
},
"node_modules/source-map-support": {
- "version": "0.5.19",
- "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz",
- "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==",
+ "version": "0.5.21",
+ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz",
+ "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==",
"dev": true,
"peer": true,
"dependencies": {
@@ -12617,15 +12681,16 @@
}
},
"node_modules/terser": {
- "version": "5.7.1",
- "resolved": "https://registry.npmjs.org/terser/-/terser-5.7.1.tgz",
- "integrity": "sha512-b3e+d5JbHAe/JSjwsC3Zn55wsBIM7AsHLjKxT31kGCldgbpFePaFo+PiddtO6uwRZWRw7sPXmAN8dTW61xmnSg==",
+ "version": "5.15.1",
+ "resolved": "https://registry.npmjs.org/terser/-/terser-5.15.1.tgz",
+ "integrity": "sha512-K1faMUvpm/FBxjBXud0LWVAGxmvoPbZbfTCYbSgaaYQaIXI3/TdI7a7ZGA73Zrou6Q8Zmz3oeUTsp/dj+ag2Xw==",
"dev": true,
"peer": true,
"dependencies": {
+ "@jridgewell/source-map": "^0.3.2",
+ "acorn": "^8.5.0",
"commander": "^2.20.0",
- "source-map": "~0.7.2",
- "source-map-support": "~0.5.19"
+ "source-map-support": "~0.5.20"
},
"bin": {
"terser": "bin/terser"
@@ -12745,6 +12810,19 @@
"url": "https://github.com/chalk/supports-color?sponsor=1"
}
},
+ "node_modules/terser/node_modules/acorn": {
+ "version": "8.8.0",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz",
+ "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==",
+ "dev": true,
+ "peer": true,
+ "bin": {
+ "acorn": "bin/acorn"
+ },
+ "engines": {
+ "node": ">=0.4.0"
+ }
+ },
"node_modules/terser/node_modules/commander": {
"version": "2.20.3",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
@@ -12752,16 +12830,6 @@
"dev": true,
"peer": true
},
- "node_modules/terser/node_modules/source-map": {
- "version": "0.7.3",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
- "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==",
- "dev": true,
- "peer": true,
- "engines": {
- "node": ">= 8"
- }
- },
"node_modules/text-table": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
@@ -16027,6 +16095,61 @@
"dev": true,
"peer": true
},
+ "@jridgewell/gen-mapping": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz",
+ "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==",
+ "dev": true,
+ "peer": true,
+ "requires": {
+ "@jridgewell/set-array": "^1.0.1",
+ "@jridgewell/sourcemap-codec": "^1.4.10",
+ "@jridgewell/trace-mapping": "^0.3.9"
+ }
+ },
+ "@jridgewell/resolve-uri": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz",
+ "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==",
+ "dev": true,
+ "peer": true
+ },
+ "@jridgewell/set-array": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz",
+ "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==",
+ "dev": true,
+ "peer": true
+ },
+ "@jridgewell/source-map": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz",
+ "integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==",
+ "dev": true,
+ "peer": true,
+ "requires": {
+ "@jridgewell/gen-mapping": "^0.3.0",
+ "@jridgewell/trace-mapping": "^0.3.9"
+ }
+ },
+ "@jridgewell/sourcemap-codec": {
+ "version": "1.4.14",
+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz",
+ "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==",
+ "dev": true,
+ "peer": true
+ },
+ "@jridgewell/trace-mapping": {
+ "version": "0.3.15",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.15.tgz",
+ "integrity": "sha512-oWZNOULl+UbhsgB51uuZzglikfIKSUBO/M9W2OfEjn7cmqoAiCgmv9lyACTUacZwBz0ITnJ2NqjU8Tx0DHL88g==",
+ "dev": true,
+ "peer": true,
+ "requires": {
+ "@jridgewell/resolve-uri": "^3.0.3",
+ "@jridgewell/sourcemap-codec": "^1.4.10"
+ }
+ },
"@nextcloud/babel-config": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@nextcloud/babel-config/-/babel-config-1.0.0.tgz",
@@ -24009,9 +24132,9 @@
}
},
"source-map-support": {
- "version": "0.5.19",
- "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz",
- "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==",
+ "version": "0.5.21",
+ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz",
+ "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==",
"dev": true,
"peer": true,
"requires": {
@@ -24691,30 +24814,31 @@
"peer": true
},
"terser": {
- "version": "5.7.1",
- "resolved": "https://registry.npmjs.org/terser/-/terser-5.7.1.tgz",
- "integrity": "sha512-b3e+d5JbHAe/JSjwsC3Zn55wsBIM7AsHLjKxT31kGCldgbpFePaFo+PiddtO6uwRZWRw7sPXmAN8dTW61xmnSg==",
+ "version": "5.15.1",
+ "resolved": "https://registry.npmjs.org/terser/-/terser-5.15.1.tgz",
+ "integrity": "sha512-K1faMUvpm/FBxjBXud0LWVAGxmvoPbZbfTCYbSgaaYQaIXI3/TdI7a7ZGA73Zrou6Q8Zmz3oeUTsp/dj+ag2Xw==",
"dev": true,
"peer": true,
"requires": {
+ "@jridgewell/source-map": "^0.3.2",
+ "acorn": "^8.5.0",
"commander": "^2.20.0",
- "source-map": "~0.7.2",
- "source-map-support": "~0.5.19"
+ "source-map-support": "~0.5.20"
},
"dependencies": {
+ "acorn": {
+ "version": "8.8.0",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz",
+ "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==",
+ "dev": true,
+ "peer": true
+ },
"commander": {
"version": "2.20.3",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
"dev": true,
"peer": true
- },
- "source-map": {
- "version": "0.7.3",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
- "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==",
- "dev": true,
- "peer": true
}
}
},