UNPKG

react-streamify-play

Version:

react-streamify-play is a simple yet customizable video player for reactjs.

552 lines (485 loc) 1.83 MB
'use strict'; var jsxRuntime = require('react/jsx-runtime'); var react = require('react'); /****************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */ var extendStatics = function(d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; function __extends(d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); } var __assign = function() { __assign = Object.assign || function __assign(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; function __spreadArray(to, from, pack) { if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { if (ar || !(i in from)) { if (!ar) ar = Array.prototype.slice.call(from, 0, i); ar[i] = from[i]; } } return to.concat(ar || Array.prototype.slice.call(from)); } typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { var e = new Error(message); return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; }; exports.controlOptionsEnum = void 0; (function (controlOptionsEnum) { controlOptionsEnum["PLAY"] = "play"; controlOptionsEnum["PREVIOUS"] = "previous"; controlOptionsEnum["NEXT"] = "next"; controlOptionsEnum["MUTE"] = "mute"; controlOptionsEnum["SETTINGS"] = "settings"; controlOptionsEnum["PICTURE_IN_PICTURE"] = "picture-in-picture"; controlOptionsEnum["THEATER_MODE"] = "theater-mode"; controlOptionsEnum["FULLSCREEN"] = "fullscreen"; })(exports.controlOptionsEnum || (exports.controlOptionsEnum = {})); /** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(); const mergeClasses = (...classes) => classes.filter((className, index, array) => { return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index; }).join(" ").trim(); /** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ var defaultAttributes = { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }; /** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const Icon = react.forwardRef( ({ color = "currentColor", size = 24, strokeWidth = 2, absoluteStrokeWidth, className = "", children, iconNode, ...rest }, ref) => { return react.createElement( "svg", { ref, ...defaultAttributes, width: size, height: size, stroke: color, strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth, className: mergeClasses("lucide", className), ...rest }, [ ...iconNode.map(([tag, attrs]) => react.createElement(tag, attrs)), ...Array.isArray(children) ? children : [children] ] ); } ); /** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const createLucideIcon = (iconName, iconNode) => { const Component = react.forwardRef( ({ className, ...props }, ref) => react.createElement(Icon, { ref, iconNode, className: mergeClasses(`lucide-${toKebabCase(iconName)}`, className), ...props }) ); Component.displayName = `${iconName}`; return Component; }; /** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const ChevronRight = createLucideIcon("ChevronRight", [ ["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }] ]); /** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const CircleChevronLeft = createLucideIcon("CircleChevronLeft", [ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }], ["path", { d: "m14 16-4-4 4-4", key: "ojs7w8" }] ]); /** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const Maximize = createLucideIcon("Maximize", [ ["path", { d: "M8 3H5a2 2 0 0 0-2 2v3", key: "1dcmit" }], ["path", { d: "M21 8V5a2 2 0 0 0-2-2h-3", key: "1e4gt3" }], ["path", { d: "M3 16v3a2 2 0 0 0 2 2h3", key: "wsl5sc" }], ["path", { d: "M16 21h3a2 2 0 0 0 2-2v-3", key: "18trek" }] ]); /** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const Pause = createLucideIcon("Pause", [ ["rect", { x: "14", y: "4", width: "4", height: "16", rx: "1", key: "zuxfzm" }], ["rect", { x: "6", y: "4", width: "4", height: "16", rx: "1", key: "1okwgv" }] ]); /** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const PictureInPicture2 = createLucideIcon("PictureInPicture2", [ ["path", { d: "M21 9V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h4", key: "daa4of" }], ["rect", { width: "10", height: "7", x: "12", y: "13", rx: "2", key: "1nb8gs" }] ]); /** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const Play = createLucideIcon("Play", [ ["polygon", { points: "6 3 20 12 6 21 6 3", key: "1oa8hb" }] ]); /** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const RectangleHorizontal = createLucideIcon("RectangleHorizontal", [ ["rect", { width: "20", height: "12", x: "2", y: "6", rx: "2", key: "9lu3g6" }] ]); /** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const Settings$1 = createLucideIcon("Settings", [ [ "path", { d: "M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z", key: "1qme2f" } ], ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }] ]); /** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const Shrink = createLucideIcon("Shrink", [ ["path", { d: "m15 15 6 6m-6-6v4.8m0-4.8h4.8", key: "17vawe" }], ["path", { d: "M9 19.8V15m0 0H4.2M9 15l-6 6", key: "chjx8e" }], ["path", { d: "M15 4.2V9m0 0h4.8M15 9l6-6", key: "lav6yq" }], ["path", { d: "M9 4.2V9m0 0H4.2M9 9 3 3", key: "1pxi2q" }] ]); /** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const SkipBack = createLucideIcon("SkipBack", [ ["polygon", { points: "19 20 9 12 19 4 19 20", key: "o2sva" }], ["line", { x1: "5", x2: "5", y1: "19", y2: "5", key: "1ocqjk" }] ]); /** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const SkipForward = createLucideIcon("SkipForward", [ ["polygon", { points: "5 4 15 12 5 20 5 4", key: "16p6eg" }], ["line", { x1: "19", x2: "19", y1: "5", y2: "19", key: "futhcm" }] ]); /** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const Volume2 = createLucideIcon("Volume2", [ [ "path", { d: "M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z", key: "uqj9uw" } ], ["path", { d: "M16 9a5 5 0 0 1 0 6", key: "1q6k2b" }], ["path", { d: "M19.364 18.364a9 9 0 0 0 0-12.728", key: "ijwkga" }] ]); /** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */ const VolumeOff = createLucideIcon("VolumeOff", [ ["path", { d: "M16 9a5 5 0 0 1 .95 2.293", key: "1fgyg8" }], ["path", { d: "M19.364 5.636a9 9 0 0 1 1.889 9.96", key: "l3zxae" }], ["path", { d: "m2 2 20 20", key: "1ooewy" }], [ "path", { d: "m7 7-.587.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298V11", key: "1gbwow" } ], ["path", { d: "M9.828 4.172A.686.686 0 0 1 11 4.657v.686", key: "s2je0y" }] ]); var playBackRates = [ { label: "0.25x" }, { label: "0.5x" }, { label: "Normal" }, { label: "1.5x" }, { label: "2x" }, ]; // Example settings menu data var settingsMenu = [ { label: "Playback Quality", children: [], }, { label: "Playback Speed", children: [], }, ]; var SettingMenu = function (_a) { var videoInstance = _a.videoInstance; var _b = react.useState([settingsMenu]), menuStack = _b[0], setMenuStack = _b[1]; react.useEffect(function () { var qualities = videoInstance.getPlaybackQuality(); var qualityOption = settingsMenu.find(function (option) { return option.label === "Playback Quality"; }); if (qualityOption) { qualityOption.children = qualities.map(function (quality) { return ({ label: quality.label, action: function () { videoInstance.setPlaybackQuality(quality.index); }, }); }); } var speedOption = settingsMenu.find(function (option) { return option.label === "Playback Speed"; }); if (speedOption) { speedOption.children = playBackRates.map(function (rate) { return ({ label: rate.label, action: function () { videoInstance.setPlaybackRate(rate.label); }, }); }); } }, [videoInstance]); // Current menu options are the last in the stack var currentMenu = menuStack[menuStack.length - 1]; var handleOptionClick = function (option) { if (option.children) { // Navigate to the next level of the menu setMenuStack(function (prev) { return __spreadArray(__spreadArray([], prev, true), [option.children], false); }); } else if (option.action) { // Perform the action option.action(); } }; var handleBack = function () { // Go back to the previous menu if (menuStack.length > 1) { setMenuStack(function (prev) { return prev.slice(0, -1); }); } }; return (jsxRuntime.jsxs("div", { className: "setting-container", children: [menuStack.length > 1 && (jsxRuntime.jsx("button", { className: "back-button", onClick: handleBack, children: jsxRuntime.jsx(CircleChevronLeft, {}) })), jsxRuntime.jsx("ul", { className: "menu-list", children: currentMenu.map(function (option, index) { return (jsxRuntime.jsxs("li", { className: "menu-item ".concat(option.children ? "has-children" : ""), onClick: function () { return handleOptionClick(option); }, children: [jsxRuntime.jsx("div", { children: option.label }), jsxRuntime.jsx("div", { children: option.children && jsxRuntime.jsx(ChevronRight, {}) })] }, index)); }) })] })); }; var VideoControls = function (_a) { var videoInstance = _a.videoInstance, controlOptions = _a.controlOptions, handleNext = _a.handleNext, handlePrev = _a.handlePrev, handleTheaterMode = _a.handleTheaterMode; var _b = react.useState({ isPlaying: false, isMuted: false, isFullScreen: false, }), controlStates = _b[0], setControlStates = _b[1]; var _c = react.useState({ isSeeking: false, duration: 0, currentTime: 0, bufferPercent: 0, progressPercent: 0, }), timelineStates = _c[0], setTimelineStates = _c[1]; var _d = react.useState(false), settingsVisible = _d[0], setSettingsVisible = _d[1]; react.useEffect(function () { var video = videoInstance.getVideo(); var videoContainer = videoInstance.getVideoContainer(); if (video) { var handlePlay_1 = function () { setControlStates(function (prev) { return (__assign(__assign({}, prev), { isPlaying: !video.paused })); }); }; var handleMute_1 = function () { setControlStates(function (prev) { return (__assign(__assign({}, prev), { isMuted: video.muted })); }); }; var handleFullScreen_1 = function () { setControlStates(function (prev) { return (__assign(__assign({}, prev), { isFullScreen: videoInstance.isFullScreen() })); }); }; var handleProgress_1 = function () { if (video.buffered.length > 0 && video.duration) { var bufferEnd = video.buffered.end(video.buffered.length - 1); var bufferPercent_1 = (bufferEnd / video.duration) * 100; setTimelineStates(function (prev) { return (__assign(__assign({}, prev), { bufferPercent: bufferPercent_1 })); }); } }; var handleTimeUpdate_1 = function () { if (video.duration) { var progressPercent_1 = (video.currentTime / video.duration) * 100; setTimelineStates(function (prev) { return (__assign(__assign({}, prev), { currentTime: video.currentTime, duration: video.duration, progressPercent: progressPercent_1 })); }); } }; video.addEventListener("play", handlePlay_1); video.addEventListener("pause", handlePlay_1); video.addEventListener("volumechange", handleMute_1); videoContainer === null || videoContainer === void 0 ? void 0 : videoContainer.addEventListener("fullscreenchange", handleFullScreen_1); video.addEventListener("timeupdate", handleTimeUpdate_1); video.addEventListener("progress", handleProgress_1); return function () { video.removeEventListener("play", handlePlay_1); video.removeEventListener("pause", handlePlay_1); video.removeEventListener("volumechange", handleMute_1); videoContainer === null || videoContainer === void 0 ? void 0 : videoContainer.removeEventListener("fullscreenchange", handleFullScreen_1); video.removeEventListener("timeupdate", handleTimeUpdate_1); video.removeEventListener("progress", handleProgress_1); }; } }, [videoInstance]); var handleSeekStart = function (e) { if (!videoInstance.getVideo()) return; var video = videoInstance.getVideo(); var videoContainer = videoInstance.getVideoContainer(); if (video && videoContainer) { var videoRect_1 = video.getBoundingClientRect(); var offsetX = e.clientX - videoRect_1.left; var seekPercent = (offsetX / videoRect_1.width) * 100; var seekTime = (seekPercent / 100) * video.duration; setTimelineStates(function (prev) { return (__assign(__assign({}, prev), { isSeeking: true })); }); video.currentTime = seekTime; var handleSeekMove_1 = function (e) { var offsetX = e.clientX - videoRect_1.left; var seekPercent = (offsetX / videoRect_1.width) * 100; var seekTime = (seekPercent / 100) * video.duration; video.currentTime = seekTime; }; var handleSeekEnd_1 = function () { setTimelineStates(function (prev) { return (__assign(__assign({}, prev), { isSeeking: false })); }); document.removeEventListener("mousemove", handleSeekMove_1); document.removeEventListener("mouseup", handleSeekEnd_1); }; document.addEventListener("mousemove", handleSeekMove_1); document.addEventListener("mouseup", handleSeekEnd_1); } }; var toggleSettings = function () { setSettingsVisible(function (prev) { return !prev; }); }; return (jsxRuntime.jsxs("div", { className: "video-controls-container", children: [jsxRuntime.jsx("div", { className: "timeline-wrapper", onMouseDown: handleSeekStart, children: jsxRuntime.jsxs("div", { className: "timeline", children: [jsxRuntime.jsx("div", { className: "buffer-timeline", style: { width: "".concat(timelineStates.bufferPercent, "%") } }), jsxRuntime.jsx("div", { className: "progress-timeline", style: { width: "".concat(timelineStates.progressPercent, "%") } })] }) }), jsxRuntime.jsxs("div", { className: "control-container", children: [jsxRuntime.jsxs("div", { className: "control-left", children: [(controlOptions === null || controlOptions === void 0 ? void 0 : controlOptions.includes(exports.controlOptionsEnum.PREVIOUS)) && (handlePrev && jsxRuntime.jsx("button", { onClick: handlePrev, children: jsxRuntime.jsx(SkipBack, {}) })), (controlOptions === null || controlOptions === void 0 ? void 0 : controlOptions.includes(exports.controlOptionsEnum.PLAY)) && (jsxRuntime.jsx("button", { children: controlStates.isPlaying ? (jsxRuntime.jsx(Pause, { onClick: function () { return videoInstance.togglePlay(); } })) : (jsxRuntime.jsx(Play, { onClick: function () { return videoInstance.togglePlay(); } })) })), (controlOptions === null || controlOptions === void 0 ? void 0 : controlOptions.includes(exports.controlOptionsEnum.NEXT)) && (handleNext && jsxRuntime.jsx("button", { onClick: handleNext, children: jsxRuntime.jsx(SkipForward, {}) })), (controlOptions === null || controlOptions === void 0 ? void 0 : controlOptions.includes(exports.controlOptionsEnum.MUTE)) && (jsxRuntime.jsx("button", { children: controlStates.isMuted ? (jsxRuntime.jsx(VolumeOff, { onClick: function () { return videoInstance.toggleMute(); } })) : (jsxRuntime.jsx(Volume2, { onClick: function () { return videoInstance.toggleMute(); } })) })), jsxRuntime.jsxs("div", { className: "time-display", children: [jsxRuntime.jsx("span", { children: formatTime(timelineStates.currentTime) }), jsxRuntime.jsx("span", { children: "/" }), jsxRuntime.jsx("span", { children: formatTime(timelineStates.duration) })] })] }), jsxRuntime.jsxs("div", { className: "control-right", children: [(controlOptions === null || controlOptions === void 0 ? void 0 : controlOptions.includes(exports.controlOptionsEnum.SETTINGS)) && jsxRuntime.jsxs("div", { className: "setting-wrapper", children: [settingsVisible && jsxRuntime.jsx(SettingMenu, { videoInstance: videoInstance }), jsxRuntime.jsx("button", { onClick: toggleSettings, children: jsxRuntime.jsx(Settings$1, {}) })] }), (controlOptions === null || controlOptions === void 0 ? void 0 : controlOptions.includes(exports.controlOptionsEnum.PICTURE_IN_PICTURE)) && (jsxRuntime.jsx("button", { onClick: function () { return videoInstance.togglePictureInPictureMode(); }, children: jsxRuntime.jsx(PictureInPicture2, {}) })), (controlOptions === null || controlOptions === void 0 ? void 0 : controlOptions.includes(exports.controlOptionsEnum.THEATER_MODE)) && (jsxRuntime.jsx("button", { onClick: handleTheaterMode, children: jsxRuntime.jsx(RectangleHorizontal, {}) })), (controlOptions === null || controlOptions === void 0 ? void 0 : controlOptions.includes(exports.controlOptionsEnum.FULLSCREEN)) && (jsxRuntime.jsx("button", { onClick: function () { return videoInstance.toggleFullScreenMode(); }, children: controlStates.isFullScreen ? jsxRuntime.jsx(Shrink, {}) : jsxRuntime.jsx(Maximize, {}) }))] })] })] })); }; var formatTime = function (time) { var hours = Math.floor(time / 3600); var minutes = Math.floor((time % 3600) / 60); var seconds = Math.floor(time % 60); var displayHours = hours > 0 ? "".concat(hours, ":") : ""; var displayMinutes = minutes < 10 ? "0".concat(minutes) : "".concat(minutes); var displaySeconds = seconds < 10 ? "0".concat(seconds) : "".concat(seconds); return "".concat(displayHours).concat(displayMinutes, ":").concat(displaySeconds); }; var defaultKeyConfig = { PLAY_PAUSE: [" ", "k"], MUTE: ["m"], FULLSCREEN: ["f"], PICTURE_IN_PICTURE: ["p"], THEATER_MODE: ["t"], NEXT: ["n"], PREVIOUS: ["b"], SETTINGS: ["s"], SKIP_FORWARD: ["ArrowRight"], SKIP_BACKWARD: ["ArrowLeft"], }; function getDefaultExportFromCjs$1 (x) { return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; } var dash_all_min = {exports: {}}; /*! For license information please see dash.all.min.js.LICENSE.txt */ var hasRequiredDash_all_min; function requireDash_all_min () { if (hasRequiredDash_all_min) return dash_all_min.exports; hasRequiredDash_all_min = 1; (function (module, exports) { !function(e,t){module.exports=t();}(self,(function(){return function(){var e={4593:function(e,t){var n,r,i,o,u,l=function(e){for(var t=[],n=0;n<e.length;++n){var r=e.charCodeAt(n);r<128?t.push(r):r<2048?(t.push(192|r>>6),t.push(128|63&r)):r<65536?(t.push(224|r>>12),t.push(128|63&r>>6),t.push(128|63&r)):(t.push(240|r>>18),t.push(128|63&r>>12),t.push(128|63&r>>6),t.push(128|63&r));}return t},c=function(e){for(var t=[],n=0;n<e.length;){var r=e[n++];r<128||(r<224?(r=(31&r)<<6,r|=63&e[n++]):r<240?(r=(15&r)<<12,r|=(63&e[n++])<<6,r|=63&e[n++]):(r=(7&r)<<18,r|=(63&e[n++])<<12,r|=(63&e[n++])<<6,r|=63&e[n++])),t.push(String.fromCharCode(r));}return t.join("")},f={};n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=function(e){for(var t=0,r=[],i=0|e.length/3;0<i--;){var a=(e[t]<<16)+(e[t+1]<<8)+e[t+2];t+=3,r.push(n.charAt(63&a>>18)),r.push(n.charAt(63&a>>12)),r.push(n.charAt(63&a>>6)),r.push(n.charAt(63&a));}return 2==e.length-t?(a=(e[t]<<16)+(e[t+1]<<8),r.push(n.charAt(63&a>>18)),r.push(n.charAt(63&a>>12)),r.push(n.charAt(63&a>>6)),r.push("=")):1==e.length-t&&(a=e[t]<<16,r.push(n.charAt(63&a>>18)),r.push(n.charAt(63&a>>12)),r.push("==")),r.join("")},i=function(){for(var e=[],t=0;t<n.length;++t)e[n.charCodeAt(t)]=t;return e["=".charCodeAt(0)]=0,e}(),o=function(e){for(var t=0,n=[],r=0|e.length/4;0<r--;){var a=(i[e.charCodeAt(t)]<<18)+(i[e.charCodeAt(t+1)]<<12)+(i[e.charCodeAt(t+2)]<<6)+i[e.charCodeAt(t+3)];n.push(255&a>>16),n.push(255&a>>8),n.push(255&a),t+=4;}return n&&("="==e.charAt(t-2)?(n.pop(),n.pop()):"="==e.charAt(t-1)&&n.pop()),n},u={encode:function(e){for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t},decode:function(e){for(var t=0;t<s.length;++t)a[t]=String.fromCharCode(a[t]);return a.join("")}},f.decodeArray=function(e){var t=o(e);return new Uint8Array(t)},f.encodeASCII=function(e){var t=u.encode(e);return r(t)},f.decodeASCII=function(e){var t=o(e);return u.decode(t)},f.encode=function(e){var t=l(e);return r(t)},f.decode=function(e){var t=o(e);return c(t)},t.decode=f.decode,t.decodeArray=f.decodeArray,t.encode=f.encode,t.encodeASCII=f.encodeASCII;},452:function(e,t){!function(e){var t={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},n=function(e){var n=e;return t.hasOwnProperty(e)&&(n=t[e]),String.fromCharCode(n)},r=15,i=32,a={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},o={17:2,18:4,21:6,22:8,23:10,19:13,20:15},s={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},u={25:2,26:4,29:6,30:8,31:10,27:13,28:15},l=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],c={verboseFilter:{DATA:3,DEBUG:3,INFO:2,WARNING:2,TEXT:1,ERROR:0},time:null,verboseLevel:0,setTime:function(e){this.time=e;},log:function(e,t){var n=this.verboseFilter[e];this.verboseLevel>=n&&console.log(this.time+" ["+e+"] "+t);}},f=function(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n].toString(16));return t},d=function(e,t,n,r,i){this.foreground=e||"white",this.underline=t||!1,this.italics=n||!1,this.background=r||"black",this.flash=i||!1;};d.prototype={reset:function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1;},setStyles:function(e){for(var t=["foreground","underline","italics","background","flash"],n=0;n<t.length;n++){var r=t[n];e.hasOwnProperty(r)&&(this[r]=e[r]);}},isDefault:function(){return "white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash},equals:function(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash},copy:function(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash;},toString:function(){return "color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}};var g=function(e,t,n,r,i,a){this.uchar=e||" ",this.penState=new d(t,n,r,i,a);};g.prototype={reset:function(){this.uchar=" ",this.penState.reset();},setChar:function(e,t){this.uchar=e,this.penState.copy(t);},setPenState:function(e){this.penState.copy(e);},equals:function(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)},copy:function(e){this.uchar=e.uchar,this.penState.copy(e.penState);},isEmpty:function(){return " "===this.uchar&&this.penState.isDefault()}};var h=function(){this.chars=[];for(var e=0;e<i;e++)this.chars.push(new g);this.pos=0,this.currPenState=new d;};h.prototype={equals:function(e){for(var t=!0,n=0;n<i;n++)if(!this.chars[n].equals(e.chars[n])){t=!1;break}return t},copy:function(e){for(var t=0;t<i;t++)this.chars[t].copy(e.chars[t]);},isEmpty:function(){for(var e=!0,t=0;t<i;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e},setCursor:function(e){this.pos!==e&&(this.pos=e),this.pos<0?(c.log("ERROR","Negative cursor position "+this.pos),this.pos=0):this.pos>i&&(c.log("ERROR","Too large cursor position "+this.pos),this.pos=i);},moveCursor:function(e){var t=this.pos+e;if(e>1)for(var n=this.pos+1;n<t+1;n++)this.chars[n].setPenState(this.currPenState);this.setCursor(t);},backSpace:function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState);},insertChar:function(e){e>=144&&this.backSpace();var t=n(e);this.pos>=i?c.log("ERROR","Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1));},clearFromPos:function(e){var t;for(t=e;t<i;t++)this.chars[t].reset();},clear:function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset();},clearToEndOfRow:function(){this.clearFromPos(this.pos);},getTextString:function(){for(var e=[],t=!0,n=0;n<i;n++){var r=this.chars[n].uchar;" "!==r&&(t=!1),e.push(r);}return t?"":e.join("")},setPenStyles:function(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState);}};var p=function(){this.rows=[];for(var e=0;e<r;e++)this.rows.push(new h);this.currRow=14,this.nrRollUpRows=null,this.reset();};p.prototype={reset:function(){for(var e=0;e<r;e++)this.rows[e].clear();this.currRow=14;},equals:function(e){for(var t=!0,n=0;n<r;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t},copy:function(e){for(var t=0;t<r;t++)this.rows[t].copy(e.rows[t]);},isEmpty:function(){for(var e=!0,t=0;t<r;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e},backSpace:function(){this.rows[this.currRow].backSpace();},clearToEndOfRow:function(){this.rows[this.currRow].clearToEndOfRow();},insertChar:function(e){this.rows[this.currRow].insertChar(e);},setPen:function(e){this.rows[this.currRow].setPenStyles(e);},moveCursor:function(e){this.rows[this.currRow].moveCursor(e);},setCursor:function(e){c.log("INFO","setCursor: "+e),this.rows[this.currRow].setCursor(e);},setPAC:function(e){c.log("INFO","pacData = "+JSON.stringify(e));var t=e.row-1;this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.currRow=t;var n=this.rows[this.currRow];if(null!==e.indent){var r=e.indent,i=Math.max(r-1,0);n.setCursor(e.indent),e.color=n.chars[i].penState.foreground;}var a={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(a);},setBkgData:function(e){c.log("INFO","bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32);},setRollUpRows:function(e){this.nrRollUpRows=e;},rollUp:function(){if(null!==this.nrRollUpRows){c.log("TEXT",this.getDisplayText());var e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),c.log("INFO","Rolling up");}else c.log("DEBUG","roll_up but nrRollUpRows not set yet");},getDisplayText:function(e){e=e||!1;for(var t=[],n="",i=-1,a=0;a<r;a++){var o=this.rows[a].getTextString();o&&(i=a+1,e?t.push("Row "+i+': "'+o+'"'):t.push(o.trim()));}return t.length>0&&(n=e?"["+t.join(" | ")+"]":t.join("\n")),n},getTextAndFormat:function(){return this.rows}};var m=function(e,t){this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new p,this.nonDisplayedMemory=new p,this.lastOutputScreen=new p,this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null;};m.prototype={modes:["MODE_ROLL-UP","MODE_POP-ON","MODE_PAINT-ON","MODE_TEXT"],reset:function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.lastCueEndTime=null;},getHandler:function(){return this.outputFilter},setHandler:function(e){this.outputFilter=e;},setPAC:function(e){this.writeScreen.setPAC(e);},setBkgData:function(e){this.writeScreen.setBkgData(e);},setMode:function(e){e!==this.mode&&(this.mode=e,c.log("INFO","MODE="+e),"MODE_POP-ON"==this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e);},insertChars:function(e){for(var t=0;t<e.length;t++)this.writeScreen.insertChar(e[t]);var n=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";c.log("INFO",n+": "+this.writeScreen.getDisplayText(!0)),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(c.log("TEXT","DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate());},cc_RCL:function(){c.log("INFO","RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON");},cc_BS:function(){c.log("INFO","BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate());},cc_AOF:function(){},cc_AON:function(){},cc_DER:function(){c.log("INFO","DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate();},cc_RU:function(e){c.log("INFO","RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e);},cc_FON:function(){c.log("INFO","FON - Flash On"),this.writeScreen.setPen({flash:!0});},cc_RDC:function(){c.log("INFO","RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON");},cc_TR:function(){c.log("INFO","TR"),this.setMode("MODE_TEXT");},cc_RTD:function(){c.log("INFO","RTD"),this.setMode("MODE_TEXT");},cc_EDM:function(){c.log("INFO","EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate();},cc_CR:function(){c.log("CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate();},cc_ENM:function(){c.log("INFO","ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset();},cc_EOC:function(){if(c.log("INFO","EOC - End Of Caption"),"MODE_POP-ON"===this.mode){var e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,c.log("TEXT","DISP: "+this.displayedMemory.getDisplayText());}this.outputDataUpdate();},cc_TO:function(e){c.log("INFO","TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e);},cc_MIDROW:function(e){var t={flash:!1};if(t.underline=e%2==1,t.italics=e>=46,t.italics)t.foreground="white";else {var n=Math.floor(e/2)-16;t.foreground=["white","green","blue","cyan","red","yellow","magenta"][n];}c.log("INFO","MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t);},outputDataUpdate:function(){var e=c.time;null!==e&&this.outputFilter&&(this.outputFilter.updateData&&this.outputFilter.updateData(e,this.displayedMemory),null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory));},cueSplitAtTime:function(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e));}};var y=function(e,t,n){this.field=e||1,this.outputs=[t,n],this.channels=[new m(1,t),new m(2,n)],this.currChNr=-1,this.lastCmdA=null,this.lastCmdB=null,this.bufferedData=[],this.startTime=null,this.lastTime=null,this.dataCounters={padding:0,char:0,cmd:0,other:0};};y.prototype={getHandler:function(e){return this.channels[e].getHandler()},setHandler:function(e,t){this.channels[e].setHandler(t);},addData:function(e,t){var n,r,i,a=!1;this.lastTime=e,c.setTime(e);for(var o=0;o<t.length;o+=2)r=127&t[o],i=127&t[o+1],r>=16&&r<=31&&r===this.lastCmdA&&i===this.lastCmdB?(this.lastCmdA=null,this.lastCmdB=null,c.log("DEBUG","Repeated command ("+f([r,i])+") is dropped")):0!==r||0!==i?(c.log("DATA","["+f([t[o],t[o+1]])+"] -> ("+f([r,i])+")"),(n=this.parseCmd(r,i))||(n=this.parseMidrow(r,i)),n||(n=this.parsePAC(r,i)),n||(n=this.parseBackgroundAttributes(r,i)),n||(a=this.parseChars(r,i))&&(this.currChNr&&this.currChNr>=0?this.channels[this.currChNr-1].insertChars(a):c.log("WARNING","No channel found yet. TEXT-MODE?")),n?this.dataCounters.cmd+=2:a?this.dataCounters.char+=2:(this.dataCounters.other+=2,c.log("WARNING","Couldn't parse cleaned data "+f([r,i])+" orig: "+f([t[o],t[o+1]])))):this.dataCounters.padding+=2;},parseCmd:function(e,t){var n;if(!((20===e||21===e||28===e||29===e)&&32<=t&&t<=47||(23===e||31===e)&&33<=t&&t<=35))return !1;n=20===e||21===e||23===e?1:2;var r=this.channels[n-1];return 20===e||21===e||28===e||29===e?32===t?r.cc_RCL():33===t?r.cc_BS():34===t?r.cc_AOF():35===t?r.cc_AON():36===t?r.cc_DER():37===t?r.cc_RU(2):38===t?r.cc_RU(3):39===t?r.cc_RU(4):40===t?r.cc_FON():41===t?r.cc_RDC():42===t?r.cc_TR():43===t?r.cc_RTD():44===t?r.cc_EDM():45===t?r.cc_CR():46===t?r.cc_ENM():47===t&&r.cc_EOC():r.cc_TO(t-32),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=n,!0},parseMidrow:function(e,t){var n=null;if((17===e||25===e)&&32<=t&&t<=47){if((n=17===e?1:2)!==this.currChNr)return c.log("ERROR","Mismatch channel in midrow parsing"),!1;var r=this.channels[n-1];return r.insertChars([32]),r.cc_MIDROW(t),c.log("DEBUG","MIDROW ("+f([e,t])+")"),this.lastCmdA=e,this.lastCmdB=t,!0}return !1},parsePAC:function(e,t){var n,r;if(!((17<=e&&e<=23||25<=e&&e<=31)&&64<=t&&t<=127||(16===e||24===e)&&64<=t&&t<=95))return !1;n=e<=23?1:2,r=64<=t&&t<=95?1===n?a[e]:s[e]:1===n?o[e]:u[e];var i=this.interpretPAC(r,t);return this.channels[n-1].setPAC(i),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=n,!0},interpretPAC:function(e,t){var n,r={color:null,italics:!1,indent:null,underline:!1,row:e};return n=t>95?t-96:t-64,r.underline=1==(1&n),n<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(r.italics=!0,r.color="white"):r.indent=4*Math.floor((n-16)/2),r},parseChars:function(e,t){var r=null,i=null,a=null;if(e>=25?(r=2,a=e-8):(r=1,a=e),17<=a&&a<=19){var o;o=17===a?t+80:18===a?t+112:t+144,c.log("INFO","Special char '"+n(o)+"' in channel "+r),i=[o],this.lastCmdA=e,this.lastCmdB=t;}else 32<=e&&e<=127&&(i=0===t?[e]:[e,t],this.lastCmdA=null,this.lastCmdB=null);if(i){var s=f(i);c.log("DEBUG","Char codes = "+s.join(","));}return i},parseBackgroundAttributes:function(e,t){var n,r,i;return ((16===e||24===e)&&32<=t&&t<=47||(23===e||31===e)&&45<=t&&t<=47)&&(n={},16===e||24===e?(r=Math.floor((t-32)/2),n.background=l[r],t%2==1&&(n.background=n.background+"_semi")):45===t?n.background="transparent":(n.foreground="black",47===t&&(n.underline=!0)),i=e<24?1:2,this.channels[i-1].setBkgData(n),this.lastCmdA=e,this.lastCmdB=t,!0)},reset:function(){for(var e=0;e<this.channels.length;e++)this.channels[e]&&this.channels[e].reset();this.lastCmdA=null,this.lastCmdB=null;},cueSplitAtTime:function(e){for(var t=0;t<this.channels.length;t++)this.channels[t]&&this.channels[t].cueSplitAtTime(e);}},e.logger=c,e.PenState=d,e.CaptionScreen=p,e.Cea608Parser=y,e.findCea608Nalus=function(e,t,n){for(var r=0,i=t,a=[],o=function(e,t,n,r){if(4!==e||t<8)return null;var i=n.getUint8(r),a=n.getUint16(r+1),o=n.getUint32(r+3),s=n.getUint8(r+7);return 181==i&&49==a&&1195456820==o&&3==s};i<t+n;){if(r=e.getUint32(i),6==(31&e.getUint8(i+4)))for(var s=i+5,u=-1;s<i+4+r-1;){u=0;for(var l=255;255===l;)u+=l=e.getUint8(s),s++;var c=0;for(l=255;255===l;)c+=l=e.getUint8(s),s++;o(u,c,e,s)&&a.push([s,c]),s+=c;}i+=r+4;}return a},e.extractCea608DataFromRange=function(e,t){var n=t[0],r=[[],[]];n+=8;var i=31&e.getUint8(n);n+=2;for(var a=0;a<i;a++){var o=e.getUint8(n),s=4&o,u=3&o;n++;var l=e.getUint8(n);n++;var c=e.getUint8(n);n++,s&&(127&l)+(127&c)!=0&&(0===u?(r[0].push(l),r[0].push(c)):1===u&&(r[1].push(l),r[1].push(c)));}return r};}(t);},8416:function(e,t,n){var r=n(1139),i=n(5448),a=n(6398),o=n(2032),s=(n(5530),"undefined"!=typeof window&&window||n.g),u=s.dashjs;u||(u=s.dashjs={}),u.MediaPlayer=r.Z,u.FactoryMaker=i.Z,u.Debug=a.Z,u.Version=(0, o.e)();},6398:function(e,t,n){var r=n(5595),i=n(8512),a=n(5448),o=1,s=2,u=3,l=4,c=5;function f(e){e=e||{};var t,n,a,f,d=this.context,g=(0, r.Z)(d).getInstance(),h=e.settings,p=[];function m(e){return e&&e.bind?e.bind(window.console):window.console.log.bind(window.console)}function y(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];S.apply(void 0,[o,this].concat(t));}function E(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];S.apply(void 0,[s,this].concat(t));}function v(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];S.apply(void 0,[u,this].concat(t));}function _(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];S.apply(void 0,[l,this].concat(t));}function T(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];S.apply(void 0,[c,this].concat(t));}function S(e,t){var r="",o=null;n&&(o=(new Date).getTime(),r+="["+(o-f)+"]"),a&&t&&t.getClassName&&(r+="["+t.getClassName()+"]",t.getType&&(r+="["+t.getType()+"]")),r.length>0&&(r+=" ");for(var s=arguments.length,u=new Array(s>2?s-2:0),l=2;l<s;l++)u[l-2]=arguments[l];Array.apply(null,u).forEach((function(e){r+=e+" ";})),p[e]&&h&&h.get().debug.logLevel>=e&&p[e](r),h&&h.get().debug.dispatchEvent&&g.trigger(i.Z.LOG,{message:r,level:e});}return t={getLogger:function(e){return {fatal:y.bind(e),error:E.bind(e),warn:v.bind(e),info:_.bind(e),debug:T.bind(e)}},setLogTimestampVisible:function(e){n=e;},setCalleeNameVisible:function(e){a=e;}},n=!0,a=!0,f=(new Date).getTime(),"undefined"!=typeof window&&window.console&&(p[o]=m(window.console.error),p[s]=m(window.console.error),p[u]=m(window.console.warn),p[l]=m(window.console.info),p[c]=m(window.console.debug)),t}f.__dashjs_factory_name="Debug";var d=a.Z.getSingletonFactory(f);d.LOG_LEVEL_NONE=0,d.LOG_LEVEL_FATAL=o,d.LOG_LEVEL_ERROR=s,d.LOG_LEVEL_WARNING=u,d.LOG_LEVEL_INFO=l,d.LOG_LEVEL_DEBUG=c,a.Z.updateSingletonFactory(f.__dashjs_factory_name,d),t.Z=d;},5595:function(e,t,n){var r=n(5448),i=n(8825);function a(){var e={};function t(t,n,r){var i=-1;return e[t]?(e[t].some((function(e,t){if(e&&e.callback===n&&(!r||r===e.scope))return i=t,!0})),i):i}var n={on:function(n,r,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!n)throw new Error("event type cannot be null or undefined");if(!r||"function"!=typeof r)throw new Error("listener must be a function: "+r);var o=a.priority||0;if(!(t(n,r,i)>=0)){e[n]=e[n]||[];var s={callback:r,scope:i,priority:o};i&&i.getStreamId&&(s.streamId=i.getStreamId()),i&&i.getType&&(s.mediaType=i.getType()),a&&a.mode&&(s.mode=a.mode);var u=e[n].some((function(t,r){if(t&&o>t.priority)return e[n].splice(r,0,s),!0}));u||e[n].push(s);}},off:function(n,r,i){if(n&&r&&e[n]){var a=t(n,r,i);a<0||(e[n][a]=null);}},trigger:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t&&e[t]){if((n=n||{}).hasOwnProperty("type"))throw new Error("'type' is a reserved word for event dispatching");n.type=t,r.streamId&&(n.streamId=r.streamId),r.mediaType&&(n.mediaType=r.mediaType),e[t].filter((function(e){return !(!e||r.streamId&&e.streamId&&e.streamId!==r.streamId||r.mediaType&&e.mediaType&&e.mediaType!==r.mediaType||r.mode&&e.mode&&e.mode!==r.mode||!e.mode&&r.mode&&r.mode===i.Z.EVENT_MODE_ON_RECEIVE)})).forEach((function(e){return e&&e.callback.call(e.scope,n)}));}},reset:function(){e={};}};return n}a.__dashjs_factory_name="EventBus";var o=r.Z.getSingletonFactory(a);o.EVENT_PRIORITY_LOW=0,o.EVENT_PRIORITY_HIGH=5e3,r.Z.updateSingletonFactory(a.__dashjs_factory_name,o),t.Z=o;},5448:function(e,t){var n=function(){var e,t=[],n={},r={};function i(e,n){for(var r in t){var i=t[r];if(i.context===e&&i.name===n)return i.instance}return null}function a(e,t){return t[e]}function o(e,t,n){e in n&&(n[e]=t);}function s(t,n,r){var i,a=t.__dashjs_factory_name,o=n[a];if(o){var s=o.instance;if(!o.override)return s.apply({context:n,factory:e},r);for(var u in i=t.apply({context:n},r),s=s.apply({context:n,factory:e,parent:i},r))i.hasOwnProperty(u)&&(i[u]=s[u]);}else i=t.apply({context:n},r);return i.getClassName=function(){return a},i}return e={extend:function(e,t,n,r){!r[e]&&t&&(r[e]={instance:t,override:n});},getSingletonInstance:i,setSingletonInstance:function(e,n,r){for(var i in t){var a=t[i];if(a.context===e&&a.name===n)return void(t[i].instance=r)}t.push({name:n,context:e,instance:r});},deleteSingletonInstances:function(e){t=t.filter((function(t){return t.context!==e}));},getSingletonFactory:function(e){var r=a(e.__dashjs_factory_name,n);return r||(r=function(n){var r;return void 0===n&&(n={}),{getInstance:function(){return r||(r=i(n,e.__dashjs_factory_name)),r||(r=s(e,n,arguments),t.push({name:e.__dashjs_factory_name,context:n,instance:r})),r}}},n[e.__dashjs_factory_name]=r),r},getSingletonFactoryByName:function(e){return a(e,n)},updateSingletonFactory:function(e,t){o(e,t,n);},getClassFactory:function(e){var t=a(e.__dashjs_factory_name,r);return t||(t=function(t){return void 0===t&&(t={}),{create:function(){return s(e,t,arguments)}}},r[e.__dashjs_factory_name]=t),t},getClassFactoryByName:function(e){return a(e,r)},updateClassFactory:function(e,t){o(e,t,r);}},e}();t.Z=n;},1264:function(e,t,n){var r=n(5448),i=n(703),a=n(6398),o=n(3393),s=n(7855),u=n(5595),l=n(8512);function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(){var e,t,n=this.context,r=(0, u.Z)(n).getInstance(),d={"streaming.delay.liveDelay":l.Z.SETTING_UPDATED_LIVE_DELAY,"streaming.delay.liveDelayFragmentCount":l.Z.SETTING_UPDATED_LIVE_DELAY_FRAGMENT_COUNT,"streaming.liveCatchup.enabled":l.Z.SETTING_UPDATED_CATCHUP_ENABLED,"streaming.liveCatchup.playbackRate.min":l.Z.SETTING_UPDATED_PLAYBACK_RATE_MIN,"streaming.liveCatchup.playbackRate.max":l.Z.SETTING_UPDATED_PLAYBACK_RATE_MAX},g={debug:{logLevel:a.Z.LOG_LEVEL_WARNING,dispatchEvent:!1},streaming:{abandonLoadTimeout:1e4,wallclockTimeUpdateInterval:100,manifestUpdateRetryInterval:100,liveUpdateTimeThresholdInMilliseconds:0,cacheInitSegments:!1,applyServiceDescription:!0,applyProducerReferenceTime:!0,applyContentSteering:!0,eventControllerRefreshDelay:100,enableManifestDurationMismatchFix:!0,parseInbandPrft:!1,enableManifestTimescaleMismatchFix:!1,capabilities:{filterUnsupportedEssentialProperties:!0,useMediaCapabilitiesApi:!1},timeShiftBuffer:{calcFromSegmentTimeline:!1,fallbackToSegmentTimeline:!0},metrics:{maxListDepth:100},delay:{liveDelayFragmentCount:NaN,liveDelay:NaN,useSuggestedPresentationDelay:!0},protection:{keepProtectionMediaKeys:!1,ignoreEmeEncryptedEvent:!1,detectPlayreadyMessageFormat:!0},buffer:{enableSeekDecorrelationFix:!1,fastSwitchEnabled:!0,flushBufferAtTrackSwitch:!1,reuseExistingSourceBuffers:!0,bufferPruningInterval:10,bufferToKeep:20,bufferTimeAtTopQuality:30,bufferTimeAtTopQualityLongForm:60,initialBufferLevel:NaN,stableBufferTime:12,longFormContentDurationThreshold:600,stallThreshold:.3,useAppendWindow:!0,setStallState:!0,avoidCurrentTimeRangePruning:!1,useChangeTypeForTrackSwitch:!0,mediaSourceDurationInfinity:!0,resetSourceBuffersForTrackSwitch:!1},gaps:{jumpGaps:!0,jumpLargeGaps:!0,smallGapLimit:1.5,threshold:.3,enableSeekFix:!0,enableStallFix:!1,stallSeek:.1},utcSynchronization:{enabled:!0,useManifestDateHeaderTimeSource:!0,backgroundAttempts:2,timeBetweenSyncAttempts:30,maximumTimeBetweenSyncAttempts:600,minimumTimeBetweenSyncAttempts:2,timeBetweenSyncAttemptsAdjustmentFactor:2,maximumAllowedDrift:100,enableBackgroundSyncAfterSegmentDownloadError:!0,defaultTimingSource:{scheme:"urn:mpeg:dash:utc:http-xsdate:2014",value:"https://time.akamai.com/?iso&ms"}},scheduling:{defaultTimeout:500,lowLatencyTimeout:0,scheduleWhilePaused:!0},text:{defaultEnabled:!0,dispatchForManualRendering:!1,extendSegmentedCues:!0,imsc:{displayForcedOnlyMode:!1,enableRollUp:!0},webvtt:{customRenderingEnabled:!1}},liveCatchup:{maxDrift:NaN,playbackRate:{min:NaN,max:NaN},playbackBufferMin:.5,enabled:null,mode:o.Z.LIVE_CATCHUP_MODE_DEFAULT},lastBitrateCachingInfo:{enabled:!0,ttl:36e4},lastMediaSettingsCachingInfo:{enabled:!0,ttl:36e4},saveLastMediaSettingsForCurrentStreamingSession:!0,cacheLoadThresholds:{video:50,audio:5},trackSwitchMode:{audio:o.Z.TRACK_SWITCH_MODE_ALWAYS_REPLACE,video:o.Z.TRACK_SWITCH_MODE_NEVER_REPLACE},selectionModeForInitialTrack:o.Z.TRACK_SELECTION_MODE_HIGH