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QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,QACT,QAAS,QACT,QAAS,WACT,QAAS,WACT,QAAS,WACT,QAAS,WACT,QAAS,WACT,QAAS,WACT,QAAS,SACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,WACT,QAAS,QACT,QAAS,QACT,QAAS,SACT,QAAS,WACT,QAAS,mBACT,QAAS,WACT,QAAS,MACT,QAAS,QACT,QAAS,MACT,QAAS,WACT,QAAS,WACT,QAAS,iCACT,QAAS,iBACT,QAAS,kBACT,QAAS,QACT,QAAS,SACT,QAAS,sBACT,QAAS,wBACT,QAAS,SACT,QAAS,UACT,aAAc,SACd,QAAS,aACT,QAAS,YACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,MACT,QAAS,SACT,QAAS,aACT,QAAS,OACT,QAAS,cASAC,EAA2C,CACpD,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KAC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A,GAAsBS,wBAC/CE,gBAAiBX,EAAAA,GAAsBW,gBACvCD,iBAAkBV,EAAAA,GAAsBU,iBACxCE,aAAcZ,EAAAA,GAAsBY,aACpCG,uBAAwBf,EAAAA,GAAsBe,uBAC9CC,mBAAoBhB,EAAAA,GAAsBgB,oBAE9C8jC,YAAa,KAGO5xB,EAAAktB,uBAAiC,GAAG5vB,EAAAA,iBAAiBC,iCAErDyC,EAAA6sB,sBAAgC,qECrCrD,IAAKgF,GAAZ,SAAYA,GACRA,EAAA,UACAA,EAAA,QACAA,EAAA,QACAA,EAAA,QAJJ,CAAYA,IAAAA,EAAkB","sources":["webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/utilities/key-codes.ts?1004","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/utilities/string-extensions.ts?3689","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/utilities/html-extensions.ts?9642","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/utilities/player-utility.ts?33e3","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/utilities/utilities.ts?65c9","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/helper/localization-helper.ts?26d0","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/helper/closed-caption-helper.ts?8eff","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/helper/player-helper.ts?800e","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/player.tsx?8176","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/closed-captions/ttml-settings.ts?ff45","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/closed-captions/ttml-context.ts?2af4","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/closed-captions/ttml-time-parser.ts?72f5","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/closed-captions/ttml-parser.ts?6362","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/closed-captions/video-closed-captions.tsx?4d40","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/action-toggle/action-toggle.tsx?246b","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/age-gate/age-gate.tsx?96c8","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/data/player-constants.ts?0a75","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/data/player-metadata.ts?24d6","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/closed-captions/video-closed-captions-settings.ts?2fc2","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/menu/menu.tsx?4ce6","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/menu-item/menu-item.tsx?471c","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/play-pause-trigger/play-pause-trigger.tsx?3fa4","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/video-controls/video-controls.tsx?32a5","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/data/player-options.ts?0c9c"],"sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/**\n * KeyCodes Enum.\n */\nexport enum KeyCodes {\n Back = 8,\n Tab = 9,\n Enter = 13,\n Shift = 16,\n Ctrl = 17,\n Alt = 18,\n Break = 19,\n CapsLock = 20,\n Escape = 27,\n Space = 32,\n PageUp = 33,\n PageDown = 34,\n End = 35,\n Home = 36,\n ArrowLeft = 37,\n ArrowUp = 38,\n ArrowRight = 39,\n ArrowDown = 40,\n Print = 44,\n Insert = 45,\n Delete = 46,\n Colon2 = 59, // Opera and Firefox\n Equals2 = 61, // Opera\n Equals3 = 107, // Firefox\n Minus2 = 109, // Opera and Firefox\n Period = 190,\n WindowsLeft = 91,\n WindowsRight = 92,\n WindowsOpera = 219, // Opera\n Menu = 93,\n NumPad0 = 96,\n NumPad1 = 97,\n NumPad2 = 98,\n NumPad3 = 99,\n NumPad4 = 100,\n NumPad5 = 101,\n NumPad6 = 102,\n NumPad7 = 103,\n NumPad8 = 104,\n NumPad9 = 105,\n NumPadMultiply = 106,\n NumPadPlus = 107,\n NumPadMinus = 109,\n NumPadDot = 110,\n NumPadDivide = 111,\n Function1 = 112,\n Function2 = 113,\n Function3 = 114,\n Function4 = 115,\n Function5 = 116,\n Function6 = 117,\n Function7 = 118,\n Function8 = 119,\n Function9 = 120,\n Function10 = 121,\n Function11 = 122,\n Function12 = 123,\n NavigationUp = 138,\n NavigationDown = 139,\n NavigationLeft = 140,\n NavigationRight = 141,\n NavigationAccept = 142,\n NumLock = 144,\n ScrollLock = 145,\n Colon = 186,\n Equals = 187,\n Comma = 188,\n Minus = 189,\n ForwardSlash = 191,\n Tilde = 192,\n GamepadA = 195,\n GamepadB = 196,\n GamepadX = 197,\n GamepadY = 198,\n GamepadRightButton = 199,\n GamepadLeftButton = 200,\n GamepadLeftTrigger = 201,\n GamepadRightTrigger = 202,\n GamepadDPadUp = 203,\n GamepadDPadDown = 204,\n GamepadDPadLeft = 205,\n GamepadDPadRight = 206,\n GamepadSelect = 207,\n GamepadStart = 208,\n GamepadLeftThumbstick = 209,\n GamepadRightThumbstick = 210,\n GamepadLeftThumbstickUp = 211,\n GamepadLeftThumbstickDown = 212,\n GamepadLeftThumbstickRight = 213,\n GamepadLeftThumbstickLeft = 214,\n GamepadRightThumbstickUp = 215,\n GamepadRightThumbstickDown = 216,\n GamepadRightThumbstickRight = 217,\n GamepadRightThumbstickLeft = 218,\n OpenBracket = 219,\n BackSlash = 220,\n CloseBracket = 221,\n Quote = 222\n}\n\n/**\n * Here for test coverage.\n */\nexport class KeycodesClass {\n public testCoverage(): string {\n return ':(';\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/**\n * Format the passed string.\n * @param formatSpecifier - FormatSpecifier.\n * @param parameters -- Any number of parameters.\n * @returns The formated string.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function format(formatSpecifier: string, ...parameters: any[]): string {\n if (!formatSpecifier) {\n return '';\n }\n\n return formatSpecifier.replace(/{(\\d+)}/g, (match: string, index: number) => {\n if (index >= parameters.length) {\n return match;\n }\n\n const value = parameters[index];\n\n if (typeof value !== 'number' && !value) {\n return '';\n }\n\n if (typeof value === 'string') {\n return value;\n }\n\n return value.toString();\n });\n}\n\n/**\n * Determines if the specified string is undefined, null, empty, or whitespace.\n * @param value - The string to examine.\n * @returns - True if the value is undefined, null, empty, or whitespace, otherwise false.\n */\nexport function isNullOrWhiteSpace(value: string): boolean {\n return !value || typeof value !== 'string' || !trim(value);\n}\n\n/**\n * Trims leading and trailing whitespace from the string.\n * @param value - The string to examine.\n * @returns - The trimmed string.\n */\nexport function trim(value: string): string {\n // Any flavor of !value (ie. null/undefined/'') should return itself.\n if (!value || typeof value !== 'string') {\n return value;\n }\n\n if (value.trim) {\n return value.trim();\n }\n\n return value.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determines if the specified string starts with the specified value.\n * @param value - The string to look in.\n * @param prefix - The prefix to look for.\n * @param ignoreCase - Ignore Case.\n * @returns - True if the string starts with the prefix, otherwise false.\n */\nexport function startsWith(value: string, prefix: string, ignoreCase: boolean = true): boolean {\n if (!value || !prefix) {\n return false;\n }\n\n if (ignoreCase) {\n value = value.toLocaleLowerCase();\n prefix = prefix.toLocaleLowerCase();\n }\n\n if (value.startsWith) {\n return value.startsWith(prefix);\n }\n\n return value.startsWith(prefix);\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { isNullOrWhiteSpace, trim } from './string-extensions';\n\n/**\n * Get the text of the element.\n * @param element - HTML element.\n * @returns The content of the element.\n */\nexport function getText(element?: HTMLElement | Element): string {\n return element ? element.textContent || '' : '';\n}\n\n/**\n * Add a css class to an element.\n * @param element - The element to add the css class to.\n * @param cssClass - The css class to add.\n */\nexport function addClass(element: HTMLElement, cssClass: string): void {\n if (element && !isNullOrWhiteSpace(cssClass) && !hasClass(element, cssClass)) {\n if (element.classList) {\n element.classList.add(cssClass);\n } else {\n element.className = trim(`${element.className} ${cssClass}`);\n }\n }\n}\n\n/**\n * Checks for the presence of a css class on an element.\n * @param element - The element to check the css class of.\n * @param cssClass - The css class to check for.\n * @returns True if the element's className has the specified class, otherwise false.\n */\nexport function hasClass(element: HTMLElement, cssClass: string): boolean {\n if (!element || isNullOrWhiteSpace(cssClass)) {\n return false;\n } else if (element.classList) {\n return element.classList.contains(cssClass);\n }\n return `' ' ${element.className} ' '`.includes(`' ' ${trim(cssClass)} ' '`);\n}\n\n/**\n * Convert node list to array.\n * @param nodeList - Node List.\n * @returns Array of the node list.\n */\nexport function nodeListToArray(\n nodeList: NodeListOf | NodeListOf | HTMLCollection | NodeList | NamedNodeMap\n): T[] {\n if (!nodeList) {\n return [];\n }\n\n const elements: T[] = [];\n\n for (let n = 0; n < nodeList.length; n++) {\n elements.push(nodeList[n]);\n }\n\n return elements;\n}\n\n/**\n * Select elements in a context.\n * @param selector - Can be class, id or tag selector.\n * @param [context] - Any element to scope the selection. It's optional. If not provided document will be assumed.\n * @returns HTMLElement[].\n */\nexport function selectElements(selector: string, context?: HTMLElement): HTMLElement[] {\n return selectElementsT(selector, context);\n}\n\n/**\n * Select elements in a context.\n * @param selector - Can be class, id or tag selector.\n * @param [context] - Any element to scope the selection. It's optional. If not provided document will be assumed.\n * @returns T[].\n */\nexport function selectElementsT(selector: string, context?: HTMLElement): T[] {\n if (isNullOrWhiteSpace(selector) || selector === '#') {\n return [];\n }\n\n const currentContext: HTMLElement | Document = context || document;\n\n // Check if the first character is class or id.\n if (/^[#.]?[\\w-]+$/.test(selector)) {\n // eslint-disable-next-line default-case\n switch (selector[0]) {\n case '.':\n if (currentContext.getElementsByClassName) {\n return nodeListToArray(currentContext.getElementsByClassName(selector.slice(1)));\n }\n return nodeListToArray(currentContext.querySelectorAll(selector));\n\n case '#':\n const element = currentContext.querySelector(selector);\n return (element ? [element] : []);\n }\n\n return nodeListToArray(currentContext.getElementsByTagName(selector));\n }\n\n return nodeListToArray(currentContext.querySelectorAll(selector));\n}\n\n/**\n * Sets or gets CSS properties.\n * @param element - HTML Element.\n * @param property - The CSS property name.\n * @param [value] - The value to set on the CSS property.\n * @returns - The value of the CSS property.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function css(element: HTMLElement | Node, property: string, value?: any): any {\n if (!element) {\n return null;\n }\n\n if (value || value === '') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (element).style[property] = value;\n } else {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value = (element).style[property];\n\n if (isNullOrWhiteSpace(value)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value = getComputedStyle(element as any);\n value = value[property];\n }\n\n return value;\n }\n}\n\n/**\n * Remove all inner HTML from a parent element - used to delete child elements.\n * @param parentElement - The parent element from which all children should be removed.\n */\nexport function removeInnerHtml(parentElement: HTMLElement): void {\n if (parentElement) {\n parentElement.innerHTML = '';\n }\n}\n\n/**\n * Select first element from the selected elements using provided selector.\n * @param selector - Element selector.\n * @param [context] - An optional context to scope the selection.\n * @returns - The first element from the match.\n */\nexport function selectFirstElement(selector: string, context?: HTMLElement): HTMLElement | null {\n const elementsSelected = selectElementsT(selector, context);\n return !elementsSelected || !elementsSelected.length ? null : elementsSelected[0];\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ndeclare let window: any;\n\n/**\n * @name - XDomainRequest\n * @description - typescript declaration for XDomainRequest object.\n * @type {object}\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ndeclare let XDomainRequest: any;\n\n/**\n * PlayerUtilities class.\n * @classdesc - The PlayerOptions class is used to pass player options settings to the player.\n * It supplies default values which can be overridden via overrides passed to the constructor.\n */\n// eslint-disable-next-line @typescript-eslint/no-extraneous-class\nexport class PlayerUtility {\n /**\n * @name - pendingAjaxRequests\n * @description - array to hold pending ajax requests.\n * @private\n * @static\n * @returns {any}\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private static readonly pendingAjaxRequests: any = [];\n\n /**\n * Gets request data using ajax call.\n * @param url - Url from where to fetch data.\n * @param done - On success callback function.\n * @param failed - On failed callback function.\n */\n public static ajax(url: string, done: Function, failed?: Function): void {\n if (!url) {\n return;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let ajaxRequest: any = null;\n\n // For IE 9 and below use XDomainRequest\n if (window.XDomainRequest) {\n ajaxRequest = new XDomainRequest();\n\n ajaxRequest.addEventListener('load', () => {\n done && done(ajaxRequest.responseText);\n PlayerUtility._removeFromPendingAjaxRequests(ajaxRequest);\n });\n\n // IE8 and IE9 have a bug where garbage collector will clear XDomainRequest object\n // before the call is completed. Thus add a reference to the object so that request\n // is not aborted by garbage collector.\n PlayerUtility.pendingAjaxRequests.push(ajaxRequest);\n } else if (window.XMLHttpRequest) {\n ajaxRequest = new XMLHttpRequest();\n\n ajaxRequest.onreadystatechange = () => {\n if (ajaxRequest.readyState === 4) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let result: any = null;\n if (ajaxRequest.status === 200) {\n result = ajaxRequest.responseText;\n }\n done && done(result);\n } else {\n // The following console.log useful for debugging and is left in commented out for easy restoration.\n // console.log('Localization-helper: readystate(' + xhttp.readyState + ') status(' + xhttp.status + ')');\n }\n };\n }\n\n // Attach common event handlers and make the request.\n if (ajaxRequest) {\n ajaxRequest.ontimeout = ajaxRequest.addEventListener('error', () => {\n PlayerUtility._removeFromPendingAjaxRequests(ajaxRequest);\n failed && failed();\n });\n ajaxRequest.open('GET', url, true);\n ajaxRequest.send();\n }\n }\n\n /**\n * Removes object from array to hold pending ajax requests.\n * @param obj - Object.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private static _removeFromPendingAjaxRequests(obj: any): void {\n // When the call is completed remove it from the array\n let index = -1;\n for (let i = 0; i < PlayerUtility.pendingAjaxRequests.length; i++) {\n if (obj === PlayerUtility.pendingAjaxRequests[i]) {\n index = i;\n break;\n }\n }\n if (index >= 0) {\n PlayerUtility.pendingAjaxRequests.splice(index, 1);\n }\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/**\n * Client Dimension Interface.\n */\nexport interface IClientDimension {\n width: number;\n height: number;\n}\n\n/**\n * Dictionary String Interface.\n */\nexport interface IDictionaryStringString {\n [key: string]: string;\n}\n\n/**\n * @interface IGrid\n * @classdesc - The IGrid interface contract.\n */\nexport interface IGrid {\n rows: number;\n columns: number;\n}\n\n/**\n * Clamp position between a range.\n * @param value - Value to be clamped.\n * @param min - Minimum value in range.\n * @param max - Maximum value in range.\n * @returns The clap value if min passed is less than max else returns 0.\n */\nexport function clamp(value: number, min: number, max: number): number {\n if (min <= max) {\n return Math.min(Math.max(value, min), max);\n }\n return 0;\n}\n\n/**\n * Upper case the first letter of the string, if only one char exists on the string, uppercase it.\n * @param value - Value to be upper cased.\n * @returns The upper cased string of the passed value, if it has just one char uppercase it.\n */\nexport function toUpperCaseFirstChar(value: string): string {\n if (value.length > 1) {\n return value.charAt(0).toUpperCase() + value.substr(1);\n }\n if (value.length === 1) {\n return value.charAt(0).toUpperCase();\n }\n return '';\n}\n\n/**\n * HTML collectio to Array.\n * @param nodeList - Html Collection.\n * @returns - An array of the HTML Element.\n */\nexport function htmlCollectionToArray(nodeList: HTMLCollection): HTMLElement[] {\n return Array.prototype.slice.call(nodeList);\n}\n\n/**\n * Get CSS for the Element.\n * @param element - The HTML Element.\n * @param property - The HTML property.\n * @returns - The value of the required property.\n */\nexport function getCSS(element: HTMLElement, property: string): string {\n let style = element.style[property];\n\n if (!style) {\n style = getComputedStyle(element)[property];\n }\n\n return style;\n}\n\n/**\n * Create Throttled Event.\n * @param listener - The Event Listener.\n * @param threshold - The threshold number.\n * @returns The event.\n */\nexport function createThrottledEvent(listener: EventListener, threshold: number): (event: Event) => void {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let timer: any;\n let last = 0;\n\n return (event: Event) => {\n const now = Date.now();\n\n if (timer) {\n clearTimeout(timer);\n timer = undefined;\n }\n\n if (last && now < last + threshold) {\n timer = setTimeout(() => {\n last = Date.now();\n listener(event);\n }, threshold - (now - last));\n } else {\n last = now;\n listener(event);\n }\n };\n}\n\n/**\n * Add the Throrrled Event.\n * @param target - Event Targer.\n * @param name - Name of the Event.\n * @param listener - The Event Listener.\n * @param threshold - The Threshold number.\n * @returns - Returns the Throttled Event.\n */\nexport function addThrottledEvent(\n target: EventTarget,\n name: string,\n listener: EventListener,\n threshold: number = 150\n): (event: Event) => void {\n const throttledEventHandler = createThrottledEvent(listener, threshold);\n target.addEventListener(name, throttledEventHandler, false);\n\n return throttledEventHandler;\n}\n\n/**\n * Map the CSS to the modules.\n * @param className - Class name.\n * @param cssModule - CSS modules.\n * @returns - Returns the map CSS.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function mapToCssModules(className: string = '', cssModule: any): string {\n if (!cssModule) {\n return className;\n }\n\n return className\n .split(' ')\n .map((c: string) => cssModule[c] || c)\n .join(' ');\n}\n\n/**\n * Check the raget object is reference.\n * @param target - Target object.\n * @returns Returns boolean.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function isRef(target: any): boolean {\n if (!target) {\n return false;\n }\n\n return (>target).current !== undefined;\n}\n\n/**\n * Check if the passed target is element.\n * @param target - Target element.\n * @returns Returns boolean.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function isElement(target: any): boolean {\n if (!target) {\n return false;\n }\n\n return (target).addEventListener !== undefined;\n}\n\n/**\n * KeyCodes Enum.\n */\nexport const keyCodes = {\n esc: 27,\n space: 32,\n tab: 9,\n up: 38,\n down: 40,\n enter: 13\n};\n\n/**\n * Map Interface.\n */\ninterface IMap {\n [key: string]: T;\n}\nconst warned: IMap = {};\n\n/**\n * Warn once.\n * @param message - Message to warned.\n */\nexport function warnOnce(message: string): void {\n if (!warned[message]) {\n if (typeof console !== 'undefined') {\n throw new Error(message);\n }\n warned[message] = true;\n }\n}\n\n/**\n * Can use DOM..\n */\nexport const canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);\n\n/**\n * Find the required DOM element.\n * @param target - Targert Dom Element.\n * @returns - The DOM Element or string or null.\n */\nexport function findDOMElements(target: string): NodeListOf | string | null {\n try {\n if (typeof target === 'string' && canUseDOM) {\n let selection = document.querySelectorAll(target);\n\n if (!selection.length) {\n selection = document.querySelectorAll(`#${target}`);\n }\n\n if (!selection.length) {\n throw new Error();\n }\n return selection;\n }\n\n return target;\n } catch {\n console.error(`The target '${target}' could not be identified in the dom, tip: check spelling`);\n return null;\n }\n}\n\n/**\n * Get the Target element.\n * @param target - Target Element.\n * @returns - Returns the HTMLElement or null or string.\n */\nexport function getTarget(target: string | HTMLElement | React.Ref): HTMLElement | React.Ref | null | string {\n const selection = findDOMElements(target);\n if (selection && selection.length) {\n return selection[0];\n }\n\n return target;\n}\n\n/**\n * Get the Target element.\n * @param target - Target Element.\n * @returns - Returns the HTMLElement or null or string.\n */\nexport function getTargetElement(target: string | HTMLElement | React.Ref): HTMLElement | null {\n const targetElement = getTarget(target);\n if (isRef(targetElement)) {\n return (>targetElement).current;\n }\n if (isElement(targetElement)) {\n return targetElement;\n }\n\n return null;\n}\n\n/**\n * Transition Timeouts.\n */\nexport const TransitionTimeouts = {\n Fade: 150,\n Collapse: 350,\n Modal: 300,\n Carousel: 600\n};\n\n/**\n * Transition Statuses.\n */\nexport type TransitionStatuses = 'entering' | 'entered' | 'exiting' | 'exited';\n\n/**\n * Focusable Elements.\n */\nexport const focusableElements = [\n 'a[href]',\n 'area[href]',\n 'input:not([disabled]):not([type=hidden])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n 'button:not([disabled])',\n 'iframe',\n 'object',\n 'embed',\n '[tabindex]:not(.modal)',\n 'audio[controls]',\n 'video[controls]',\n '[contenteditable]:not([contenteditable=\"false\"])'\n];\n\n/**\n * Extends an object with properties/values from one or more others.\n * @param parameters - The objects to merge together.\n * @returns - The extended object.\n */\n// eslint-disable-next-line complexity, @typescript-eslint/no-explicit-any\nexport function extend(...parameters: any[]): any {\n if (!parameters || !parameters.length) {\n return null;\n }\n\n const recursive = typeof parameters[0] === 'boolean' && parameters[0];\n\n if (parameters.length < 2) {\n return recursive ? null : parameters[0];\n }\n\n if (recursive && parameters.length < 3) {\n return parameters[1];\n }\n\n const target = recursive ? parameters[1] : parameters[0];\n\n for (let paramIndex = recursive ? 2 : 1; paramIndex < parameters.length; paramIndex++) {\n if (parameters[paramIndex] !== undefined) {\n for (const key of Object.keys(parameters[paramIndex])) {\n if (parameters[paramIndex].hasOwnProperty(key)) {\n const source = parameters[paramIndex][key];\n\n if (recursive) {\n let isSourceArray = Array.isArray ? Array.isArray(source) : {}.toString.call(source) === '[object Array]';\n let isTargetArray =\n !!target[key] &&\n (Array.isArray ? Array.isArray(target[key]) : {}.toString.call(target[key]) === '[object Array]');\n let isSourceObject = !isSourceArray && typeof source === 'object';\n let isTargetObject = !isTargetArray && !!target[key] && typeof target[key] === 'object';\n\n if (isSourceArray && isTargetArray) {\n for (const [arrayIndex, element] of source.entries()) {\n isSourceArray = Array.isArray ? Array.isArray(element) : {}.toString.call(element) === '[object Array]';\n isTargetArray =\n !!target[key][arrayIndex] &&\n (Array.isArray\n ? Array.isArray(target[key][arrayIndex])\n : {}.toString.call(target[key][arrayIndex]) === '[object Array]');\n isSourceObject = !isSourceArray && typeof element === 'object';\n isTargetObject = !isTargetArray && !!target[key][arrayIndex] && typeof target[key][arrayIndex] === 'object';\n\n if (isSourceArray) {\n target[key][arrayIndex] = extend(true, isTargetArray ? target[key][arrayIndex] : [], element);\n } else if (isSourceObject) {\n target[key][arrayIndex] = extend(true, isTargetObject ? target[key][arrayIndex] : {}, element);\n } else {\n target[key][arrayIndex] = element;\n }\n }\n continue;\n } else if (isSourceArray) {\n target[key] = extend(true, [], source);\n continue;\n } else if (isSourceObject) {\n target[key] = extend(true, isTargetObject ? target[key] : {}, source);\n continue;\n }\n }\n\n target[key] = source;\n }\n }\n }\n }\n\n return target;\n}\n\n/**\n * Gets the dimension of an element.\n * @param containerElement - The container element.\n * @returns - {IClientDimension} - The client dimension.\n * {IClientDimension.width} - The client width.\n * {IClientDimension.height} - The client height.\n */\nexport function getDimensions(containerElement: HTMLElement): IClientDimension | null {\n if (containerElement === null) {\n return null;\n }\n return {\n width: containerElement.clientWidth,\n height: containerElement.clientHeight\n };\n}\n\n/**\n * Check if the browser is Safari or not.\n * @returns Ture or false.\n */\nexport function isSafari(): boolean {\n if (navigator.vendor && navigator.userAgent) {\n return navigator.vendor.includes('Apple') && !navigator.userAgent.includes('CriOS') && !navigator.userAgent.includes('FxiOS');\n }\n return false;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IPlayerResources } from '../data';\nimport { IDictionaryStringString } from '../utilities';\n\n/**\n * @name - ccCultureLocStrings\n * @description - The localized names for the close caption menu options.\n * @constant\n * @type {IDictionaryStringString}\n */\nexport const ccCultureLocStrings: IDictionaryStringString = {\n 'ar-ab': 'عربي',\n 'ar-xm': 'عربي',\n 'ar-ma': 'عربي',\n 'ar-sa': 'عربي',\n 'eu-es': 'Euskara',\n 'bg-bg': 'Български',\n 'ca-es': 'Català',\n 'zh-cn': '简体中文',\n 'zh-hk': '繁體中文',\n 'zh-tw': '繁體中文',\n 'hr-hr': 'Hrvatski',\n 'cs-cz': 'Čeština',\n 'da-dk': 'Dansk',\n 'nl-be': 'Nederlands',\n 'nl-nl': 'Nederlands',\n 'en-ab': 'English',\n 'en-aa': 'English',\n 'en-au': 'English',\n 'en-ca': 'English',\n 'en-eu': 'English',\n 'en-hk': 'English',\n 'en-in': 'English',\n 'en-id': 'English',\n 'en-ie': 'English',\n 'en-jm': 'English',\n 'en-my': 'English',\n 'en-nz': 'English',\n 'en-pk': 'English',\n 'en-ph': 'English',\n 'en-sg': 'English',\n 'en-za': 'English',\n 'en-tt': 'English',\n 'en-gb': 'English',\n 'en-us': 'English',\n 'et-ee': 'Eesti',\n 'fi-fi': 'Suomi',\n 'fr-ab': 'Français',\n 'fr-be': 'Français',\n 'fr-ca': 'Français',\n 'fr-fr': 'Français',\n 'fr-xf': 'Français',\n 'fr-ch': 'Français',\n 'gl-es': 'Galego',\n 'de-de': 'Deutsch',\n 'de-at': 'Deutsch',\n 'de-ch': 'Deutsch',\n 'el-gr': 'Ελληνικά',\n 'he-il': 'עברית',\n 'hi-in': 'हिंदी',\n 'hu-hu': 'Magyar',\n 'is-is': 'Íslenska',\n 'id-id': 'Bahasa Indonesia',\n 'it-it': 'Italiano',\n 'ja-jp': '日本語',\n 'kk-kz': 'Қазақ',\n 'ko-kr': '한국어',\n 'lv-lv': 'Latviešu',\n 'lt-lt': 'Lietuvių',\n 'ms-my': 'Bahasa Melayu (Asia Tenggara)‎',\n 'nb-no': 'Norsk (bokmål)',\n 'nn-no': 'Norsk (nynorsk)',\n 'fa-ir': 'فارسی',\n 'pl-pl': 'Polski',\n 'pt-br': 'Português (Brasil)‎',\n 'pt-pt': 'Português (Portugal)‎',\n 'ro-ro': 'Română',\n 'ru-ru': 'Русский',\n 'sr-latn-rs': 'Srpski',\n 'sk-sk': 'Slovenčina',\n 'sl-si': 'Slovenski',\n 'es-ar': 'Español',\n 'es-cl': 'Español',\n 'es-co': 'Español',\n 'es-cr': 'Español',\n 'es-do': 'Español',\n 'es-ec': 'Español',\n 'es-us': 'Español',\n 'es-gt': 'Español',\n 'es-hn': 'Español',\n 'es-xl': 'Español',\n 'es-mx': 'Español',\n 'es-ni': 'Español',\n 'es-pa': 'Español',\n 'es-py': 'Español',\n 'es-pe': 'Español',\n 'es-pr': 'Español',\n 'es-es': 'Español',\n 'es-uy': 'Español',\n 'es-ve': 'Español',\n 'sv-se': 'Svenska',\n 'tl-ph': 'Tagalog',\n 'th-th': 'ไทย',\n 'tr-tr': 'Türkçe',\n 'uk-ua': 'Українська',\n 'ur-pk': 'اردو',\n 'vi-vn': 'Tiếng Việt'\n};\n\n/**\n * @name - ccLanguageCodes\n * @description - The 2 character language codes for use with the lang attribute .\n * @constant\n * @type {IDictionaryStringString}\n */\nexport const ccLanguageCodes: IDictionaryStringString = {\n 'ar-ab': 'ar',\n 'ar-xm': 'ar',\n 'ar-ma': 'ar',\n 'ar-sa': 'ar',\n 'eu-es': 'eu',\n 'bg-bg': 'bg',\n 'ca-es': 'ca',\n 'zh-cn': 'zh',\n 'zh-hk': 'zh',\n 'zh-tw': 'zh',\n 'hr-hr': 'hr',\n 'cs-cz': 'cs',\n 'da-dk': 'da',\n 'nl-be': 'nl',\n 'nl-nl': 'nl',\n 'en-ab': 'en',\n 'en-aa': 'en',\n 'en-au': 'en',\n 'en-ca': 'en',\n 'en-eu': 'en',\n 'en-hk': 'en',\n 'en-in': 'en',\n 'en-id': 'en',\n 'en-ie': 'en',\n 'en-jm': 'en',\n 'en-my': 'en',\n 'en-nz': 'en',\n 'en-pk': 'en',\n 'en-ph': 'en',\n 'en-sg': 'en',\n 'en-za': 'en',\n 'en-tt': 'en',\n 'en-gb': 'en',\n 'en-us': 'en',\n 'et-ee': 'et',\n 'fi-fi': 'fi',\n 'fr-ab': 'fr',\n 'fr-be': 'fr',\n 'fr-ca': 'fr',\n 'fr-fr': 'fr',\n 'fr-xf': 'fr',\n 'fr-ch': 'fr',\n 'gl-es': 'gl',\n 'de-de': 'de',\n 'de-at': 'de',\n 'de-ch': 'de',\n 'el-gr': 'el',\n 'he-il': 'he',\n 'hi-in': 'hi',\n 'hu-hu': 'hu',\n 'is-is': 'is',\n 'id-id': 'id',\n 'it-it': 'it',\n 'ja-jp': 'ja',\n 'kk-kz': 'kk',\n 'ko-kr': 'ko',\n 'lv-lv': 'lv',\n 'lt-lt': 'lt',\n 'ms-my': 'ms‎',\n 'nb-no': 'nb',\n 'nn-no': 'nn',\n 'fa-ir': 'fa',\n 'pl-pl': 'pl',\n 'pt-br': 'pt‎',\n 'pt-pt': 'pt‎',\n 'ro-ro': 'ro',\n 'ru-ru': 'ru',\n 'sr-latn-rs': 'sr',\n 'sk-sk': 'sk',\n 'sl-si': 'sl',\n 'es-ar': 'es',\n 'es-cl': 'es',\n 'es-co': 'es',\n 'es-cr': 'es',\n 'es-do': 'es',\n 'es-ec': 'es',\n 'es-us': 'es',\n 'es-gt': 'es',\n 'es-hn': 'es',\n 'es-xl': 'es',\n 'es-mx': 'es',\n 'es-ni': 'es',\n 'es-pa': 'es',\n 'es-py': 'es',\n 'es-pe': 'es',\n 'es-pr': 'es',\n 'es-es': 'es',\n 'es-uy': 'es',\n 'es-ve': 'es',\n 'sv-se': 'sv',\n 'tl-ph': 'tl',\n 'th-th': 'th',\n 'tr-tr': 'tr',\n 'uk-ua': 'uk',\n 'ur-pk': 'ur',\n 'vi-vn': 'vi'\n};\n\n/**\n * @name - playerLocKeys\n * @description - Key names to get localized values.\n * @constant\n */\nexport const PlayerLocKeys = {\n audio_tracks: 'audio_tracks',\n closecaption_off: 'closecaption_off',\n audio_tracks_default: 'audio_tracks_default',\n geolocation_error: 'geolocation_error',\n media_err_aborted: 'media_err_aborted',\n media_err_decode: 'media_err_decode',\n media_err_network: 'media_err_network',\n media_err_src_not_supported: 'media_err_src_not_supported',\n media_err_unknown_error: 'media_err_unknown_error',\n media_err_amp_encrypt: 'media_err_amp_encrypt',\n media_err_amp_player_mismatch: 'media_err_amp_player_mismatch',\n browserunsupported: 'browserunsupported',\n browserunsupported_download: 'browserunsupported_download',\n expand: 'expand',\n mute: 'mute',\n nullvideoerror: 'nullvideoerror',\n pause: 'pause',\n play: 'play',\n play_video: 'play_video',\n playing: 'playing',\n paused: 'paused',\n play_pause_button_tooltip: 'play_pause_button_tooltip',\n live_caption: 'live_caption',\n live_label: 'live_label',\n playbackerror: 'playbackerror',\n standarderror: 'standarderror',\n time: 'time',\n more_caption: 'more_caption',\n data_error: 'data_error',\n seek: 'seek',\n unexpand: 'unexpand',\n unmute: 'unmute',\n volume: 'volume',\n quality: 'quality',\n quality_hd: 'quality_hd',\n quality_hq: 'quality_hq',\n quality_lo: 'quality_lo',\n quality_sd: 'quality_sd',\n quality_auto: 'quality_auto',\n cc_customize: 'cc_customize',\n cc_text_font: 'cc_text_font',\n cc_text_color: 'cc_text_color',\n cc_color_black: 'cc_color_black',\n cc_color_blue: 'cc_color_blue',\n cc_color_cyan: 'cc_color_cyan',\n cc_color_green: 'cc_color_green',\n cc_color_grey: 'cc_color_grey',\n cc_color_magenta: 'cc_color_magenta',\n cc_color_red: 'cc_color_red',\n cc_color_white: 'cc_color_white',\n cc_color_yellow: 'cc_color_yellow',\n cc_font_name_casual: 'cc_font_name_casual',\n cc_font_name_cursive: 'cc_font_name_cursive',\n cc_font_name_monospacedsansserif: 'cc_font_name_monospacedsansserif',\n cc_font_name_proportionalsansserif: 'cc_font_name_proportionalsansserif',\n cc_font_name_monospacedserif: 'cc_font_name_monospacedserif',\n cc_font_name_proportionalserif: 'cc_font_name_proportionalserif',\n cc_font_name_smallcapitals: 'cc_font_name_smallcapitals',\n cc_text_size: 'cc_text_size',\n cc_text_size_default: 'cc_text_size_default',\n cc_text_size_extralarge: 'cc_text_size_extralarge',\n cc_text_size_large: 'cc_text_size_large',\n cc_text_size_maximum: 'cc_text_size_maximum',\n cc_text_size_small: 'cc_text_size_small',\n cc_appearance: 'cc_appearance',\n cc_preset1: 'cc_preset1',\n cc_preset2: 'cc_preset2',\n cc_preset3: 'cc_preset3',\n cc_preset4: 'cc_preset4',\n cc_preset5: 'cc_preset5',\n cc_presettings: 'cc_presettings',\n cc_text_background_color: 'cc_text_background_color',\n cc_text_background_opacity: 'cc_text_background_opacity',\n cc_text_opacity: 'cc_text_opacity',\n cc_percent_0: 'cc_percent_0',\n cc_percent_100: 'cc_percent_100',\n cc_percent_25: 'cc_percent_25',\n cc_percent_50: 'cc_percent_50',\n cc_percent_75: 'cc_percent_75',\n cc_text_edge_color: 'cc_text_edge_color',\n cc_text_edge_style: 'cc_text_edge_style',\n cc_text_edge_style_depressed: 'cc_text_edge_style_depressed',\n cc_text_edge_style_dropshadow: 'cc_text_edge_style_dropshadow',\n cc_text_edge_style_none: 'cc_text_edge_style_none',\n cc_text_edge_style_raised: 'cc_text_edge_style_raised',\n cc_text_edge_style_uniform: 'cc_text_edge_style_uniform',\n cc_window_color: 'cc_window_color',\n cc_window_opacity: 'cc_window_opacity',\n cc_reset: 'cc_reset',\n closecaption: 'closecaption',\n close_text: 'close_text',\n playbackspeed: 'playbackspeed',\n playbackspeed_normal: 'playbackspeed_normal',\n sharing_label: 'sharing_label',\n sharing_facebook: 'sharing_facebook',\n sharing_twitter: 'sharing_twitter',\n sharing_linkedin: 'sharing_linkedin',\n sharing_skype: 'sharing_skype',\n sharing_mail: 'sharing_mail',\n sharing_copy: 'sharing_copy',\n loading_value_text: 'loading_value_text',\n loading_aria_label: 'loading_aria_label',\n descriptive_audio: 'descriptive_audio',\n unknown_language: 'unknown_language',\n download_label: 'download_label',\n download_transcript: 'download_transcript',\n download_audio: 'download_audio',\n download_video: 'download_video',\n download_videoWithCC: 'download_videoWithCC',\n agegate_day: 'agegate_day',\n agegate_month: 'agegate_month',\n agegate_year: 'agegate_year',\n agegate_enterdate: 'agegate_enterdate',\n agegate_enterdate_arialabel: 'agegate_enterdate_arialabel',\n agegate_fail: 'agegate_fail',\n agegate_verifyyourage: 'agegate_verifyyourage',\n agegate_submit: 'agegate_submit',\n agegate_dateorder: 'agegate_dateorder',\n previous_menu_aria_label: 'previous_menu_aria_label',\n reactive_menu_aria_label: 'reactive_menu_aria_label',\n reactive_menu_aria_label_closedcaption: 'reactive_menu_aria_label_closedcaption',\n interactivity_show: 'interactivity_show',\n interactivity_hide: 'interactivity_hide'\n};\n\n/**\n * Localization Constants.\n */\nexport const LocalizationConstants = {\n playVideoAriaLabel: 'play video',\n playAriaLabel: 'play',\n pauseAriaLabel: 'pause',\n closeAriaLabel: 'close',\n optionAriaLabel: 'More options',\n muteAriaLabel: 'mute',\n unMuteAriaLabel: 'unmute',\n fullScreenAriaLabel: 'full screen',\n exitFullScreenAriaLabel: 'exit full screen',\n playingAriaLabel: 'paying',\n pausedAriaLabel: 'paused',\n seekBarLabel: 'Seek bar',\n sliderThumbLabel: 'Slider thumb',\n volumeThumbLabel: 'Volume thumb',\n videoTimeDurationLabel: 'Video time duration',\n closedCaptionLabel: 'Closed caption',\n audio_tracks: 'Audio Tracks',\n descriptive_audio: 'Audio descriptions',\n closecaption_off: 'Off',\n audio_tracks_default: 'Default Track',\n cc_customize: 'Customize',\n cc_text_font: 'Font',\n cc_text_color: 'Text color',\n cc_color_black: 'Black',\n cc_color_blue: 'Blue',\n cc_color_cyan: 'Cyan',\n cc_color_green: 'Green',\n cc_color_grey: 'Grey',\n cc_color_magenta: 'Magenta',\n cc_color_red: 'Red',\n cc_color_white: 'White',\n cc_color_yellow: 'Yellow',\n cc_font_name_casual: 'Casual',\n cc_font_name_cursive: 'Cursive',\n cc_font_name_monospacedsansserif: 'Monospaced Sans Serif',\n cc_font_name_monospacedserif: 'Monospaced Serif',\n cc_font_name_proportionalserif: 'Proportional Serif',\n cc_font_name_proportionalsansserif: 'Proportional Sans Serif',\n cc_font_name_smallcapitals: 'Small Capitals',\n cc_text_size: 'Text size',\n cc_text_size_default: 'Default',\n cc_text_size_extralarge: 'Extra Large',\n cc_text_size_large: 'Large',\n cc_text_size_maximum: 'Maximum',\n cc_text_size_small: 'Small',\n cc_appearance: 'Appearance',\n cc_preset1: 'Preset 1 ',\n cc_preset2: 'Preset 2',\n cc_preset3: 'Preset 3',\n cc_preset4: 'Preset 4',\n cc_preset5: 'Preset 5',\n cc_presettings: 'Close captions appearance {0}: ({1}:{2}, {3}:{4})',\n cc_text_background_color: 'Background color',\n cc_text_background_opacity: 'Background opacity',\n cc_text_opacity: 'Text opacity',\n cc_percent_0: '0%',\n cc_percent_100: '100%',\n cc_percent_25: '25%',\n cc_percent_50: '50%',\n cc_percent_75: '75%',\n cc_text_edge_color: 'Text edge color',\n cc_text_edge_style: 'Text edge style',\n cc_text_edge_style_depressed: 'Depressed',\n cc_text_edge_style_dropshadow: 'Drop shadow',\n cc_text_edge_style_none: 'No edge',\n cc_text_edge_style_raised: 'Raised',\n cc_text_edge_style_uniform: 'Uniform',\n cc_window_color: 'Window color',\n cc_window_opacity: 'Window opacity',\n cc_reset: 'Reset'\n};\n\n/**\n *\n * Closed Caption helper class.\n *\n */\nexport default class LocalizationHelper {\n private readonly playerResources: IPlayerResources;\n\n public constructor(props: IPlayerResources) {\n this.playerResources = props;\n }\n\n /**\n * Gets the localized value for given key.\n * @param key - The key to look for.\n * @returns The localization string.\n */\n public getLocalizedValue(key: string): string {\n return this.playerResources[key] || LocalizationConstants[key] || '';\n }\n\n /**\n * Converts from a locale ID to a 2 character language code.\n * @public\n * @param locale - Locale ID string.\n * @returns The localization string.\n */\n public getLanguageCodeFromLocale(locale: string): string {\n return ccLanguageCodes[locale] || '';\n }\n\n /**\n * Converts from language ID or locale name to a localized language name.\n * @public\n * @param locale - Language ID string or locale name string.\n * @returns Language Name from locale.\n */\n public getLanguageNameFromLocale(locale: string): string {\n return ccCultureLocStrings[locale] || this.getLocalizedValue(PlayerLocKeys.unknown_language);\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n closedCaptionsPresetMap,\n closedCaptionsSettingsMap,\n closedCaptionsSettingsOptions,\n videoClosedCaptionsConstant\n} from '../closed-captions';\nimport { ClosedCaptionTypes, ICurrentClosedCaptionsSettings, IPlayerMenu, IPlayerMenuItem, IVideoMetadata, MenuCategories } from '../data';\nimport { format } from '../utilities';\nimport LocalizationHelper, { ccCultureLocStrings, PlayerLocKeys } from './localization-helper';\nimport PlayerHelper from './player-helper';\n\n/**\n *\n * Closed Caption helper class.\n *\n */\nexport default class ClosedCaptionHelper {\n private readonly playerMetaData: IVideoMetadata;\n\n private readonly playerHelper: PlayerHelper;\n\n private readonly localizationHelper: LocalizationHelper;\n\n public constructor(props: IVideoMetadata, playerHelper: PlayerHelper, localizationHelper: LocalizationHelper) {\n this.playerMetaData = props;\n this.playerHelper = playerHelper;\n this.localizationHelper = localizationHelper;\n }\n\n public checkClosedCaptionsFiles(): boolean {\n if (this.playerMetaData.ccFiles && this.playerMetaData.ccFiles.length > 0) {\n return true;\n }\n return false;\n }\n\n public getClosedCaptionMenu(): IPlayerMenu | null {\n if (this.playerMetaData.ccFiles && this.playerMetaData.ccFiles.length > 0) {\n const ccFiles = this.playerMetaData.ccFiles;\n\n const ccMenuItems: IPlayerMenuItem[] = [];\n\n for (const ccFile of ccFiles) {\n // If ccType is not provided we default to TTML\n if (!ccFile.ccType || ccFile.ccType === ClosedCaptionTypes.TTML) {\n const lang = this.localizationHelper.getLanguageCodeFromLocale(ccFile.locale.toLowerCase());\n\n const ccMenuItem: IPlayerMenuItem = {\n id: this.playerHelper.addIdPrefix(ccFile.locale),\n label: ccCultureLocStrings[ccFile.locale],\n language: lang,\n data: ccFile.locale,\n selected: false,\n selectable: true,\n persistOnClick: true,\n ariaLabel: `${ccCultureLocStrings[ccFile.locale]} ${this.localizationHelper.getLocalizedValue(\n PlayerLocKeys.closecaption\n )}`\n };\n ccMenuItems.push(ccMenuItem);\n }\n }\n\n ccMenuItems.push({\n id: this.playerHelper.addIdPrefix('appearance'),\n label: this.localizationHelper.getLocalizedValue(PlayerLocKeys.cc_appearance),\n selected: false,\n selectable: false,\n subMenu: this._getClosedCaptionsSettingsMenu()\n });\n\n // Add 'off' option to the top of the list\n ccMenuItems.unshift({\n id: this.playerHelper.addIdPrefix('off'),\n label: this.localizationHelper.getLocalizedValue(PlayerLocKeys.closecaption_off),\n selected: false,\n data: 'off',\n selectable: true,\n persistOnClick: true,\n ariaLabel: `${this.localizationHelper.getLocalizedValue(\n PlayerLocKeys.closecaption_off\n )} ${this.localizationHelper.getLocalizedValue(PlayerLocKeys.closecaption)}`\n });\n\n return {\n category: MenuCategories.ClosedCaption,\n id: this.playerHelper.addIdPrefix(MenuCategories.ClosedCaption),\n label: this.localizationHelper.getLocalizedValue(PlayerLocKeys.closecaption),\n items: ccMenuItems\n };\n }\n return null;\n }\n\n public getUpdatedClosedCaptionSetting(\n currentClosedCaptionsSetting: ICurrentClosedCaptionsSettings,\n settingKey: string,\n optionKey: string\n ): ICurrentClosedCaptionsSettings {\n if (settingKey === videoClosedCaptionsConstant.presetKey) {\n const presetValue = closedCaptionsPresetMap[optionKey];\n\n return {\n window_color: currentClosedCaptionsSetting.window_color,\n window_opacity: currentClosedCaptionsSetting.window_opacity,\n text_background_color: presetValue.text_background_color,\n text_background_opacity: presetValue.text_background_opacity,\n text_color: presetValue.text_color,\n text_edge_style: presetValue.text_edge_style,\n text_font: presetValue.text_font,\n text_opacity: presetValue.text_opacity,\n text_size: presetValue.text_size,\n preset: optionKey\n };\n }\n if (this._getOptionValue(settingKey, optionKey)) {\n currentClosedCaptionsSetting[videoClosedCaptionsConstant.presetKey] = 'none';\n currentClosedCaptionsSetting[settingKey] = optionKey;\n return currentClosedCaptionsSetting;\n }\n return currentClosedCaptionsSetting;\n }\n\n /**\n * Gets the value of closed captions URL from the locale.\n * @param locale - Locale.\n * @returns Returns the closed caption URL.\n */\n public getClosedCaptionURLFromLocale(locale: string): string {\n let url: string = '';\n const ccFiles = this.playerMetaData.ccFiles!;\n for (const ccFile of ccFiles) {\n if (ccFile.locale === locale) {\n url = ccFile.url;\n }\n }\n return url;\n }\n\n /**\n * Gets the value of closed captions settings option.\n * @private\n * @param settingKey - The closed ceptions settings key.\n * @param optionKey - The closed captions option key.\n * @returns - The option value.\n */\n private _getOptionValue(settingKey: string, optionKey: string): string {\n const setting = closedCaptionsSettingsMap[settingKey];\n if (setting) {\n const option = closedCaptionsSettingsOptions[setting.option];\n return option && option.map[optionKey];\n }\n return '';\n }\n\n /**\n * Gets the closed captions settings menu to be added to options menu.\n * @returns - The player menu.\n */\n private _getClosedCaptionsSettingsMenu(): IPlayerMenu {\n // Const currentSettings = currentClosedCaptionsSetting;\n\n // create customize settings menu\n const settingsMenuItems: IPlayerMenuItem[] = [];\n\n for (const settingKey of Object.keys(closedCaptionsSettingsMap)) {\n const setting = closedCaptionsSettingsMap[settingKey];\n\n const option = closedCaptionsSettingsOptions[setting.option];\n const optionMenuItem: IPlayerMenuItem[] = [];\n\n // eslint-disable-next-line guard-for-in\n for (const optionKey in option.map) {\n optionMenuItem.push({\n id: this._getCCMenuItemId(settingKey, optionKey),\n label: this.localizationHelper.getLocalizedValue(`${option.pre}${optionKey}`),\n selectable: true,\n selected: false,\n persistOnClick: true,\n data: `${settingKey}:${optionKey}`\n });\n }\n\n // Add back button\n optionMenuItem.unshift({\n id: '',\n label: this.localizationHelper.getLocalizedValue(`cc_${settingKey}`),\n ariaLabel: `${settingKey} - go back to previous menu`,\n selectable: false,\n selected: false,\n persistOnClick: false,\n isBackButton: true\n });\n\n settingsMenuItems.push({\n id: this.playerHelper.addIdPrefix(`${settingKey}_item`),\n label: this.localizationHelper.getLocalizedValue(`cc_${settingKey}`),\n selectable: false,\n subMenu: {\n id: this._getCCSettingsMenuId(settingKey),\n category: MenuCategories.ClosedCaptionSettings,\n items: optionMenuItem,\n label: this.localizationHelper.getLocalizedValue(`cc_${settingKey}`)\n }\n });\n }\n\n settingsMenuItems.unshift({\n id: '',\n label: this.localizationHelper.getLocalizedValue(PlayerLocKeys.cc_customize),\n ariaLabel: 'Customize - go back to previous menu',\n selectable: false,\n selected: false,\n persistOnClick: false,\n isBackButton: true\n });\n\n const settingsMenu: IPlayerMenu = {\n id: this.playerHelper.addIdPrefix(MenuCategories.ClosedCaptionSettings),\n label: this.localizationHelper.getLocalizedValue(PlayerLocKeys.cc_customize),\n category: MenuCategories.ClosedCaptionSettings,\n items: settingsMenuItems\n };\n\n // Create preset items menu\n const presetItems: IPlayerMenuItem[] = [];\n\n for (const preset of Object.keys(closedCaptionsPresetMap)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const presetSetting: any = closedCaptionsPresetMap[preset];\n const font: string = presetSetting.text_font;\n const color: string = presetSetting.text_color;\n\n const ariaLabelValue = format(\n this.localizationHelper.getLocalizedValue(PlayerLocKeys.cc_presettings),\n '',\n this.localizationHelper.getLocalizedValue(PlayerLocKeys.cc_text_font),\n this.localizationHelper.getLocalizedValue(`cc_font_name_${font}`),\n this.localizationHelper.getLocalizedValue(PlayerLocKeys.cc_text_color),\n this.localizationHelper.getLocalizedValue(`cc_color_${color}`)\n );\n\n presetItems.push({\n id: this._getCCMenuItemId(videoClosedCaptionsConstant.presetKey, preset),\n label: this.localizationHelper.getLocalizedValue(`cc_${preset}`),\n data: `preset:${preset}`,\n selectable: true,\n selected: false,\n persistOnClick: true,\n ariaLabel: ariaLabelValue,\n hasMouseHoverEvents: true\n });\n }\n\n presetItems.push({\n id: this.playerHelper.addIdPrefix('cc-customize'),\n label: this.localizationHelper.getLocalizedValue(PlayerLocKeys.cc_customize),\n subMenu: settingsMenu,\n hasMouseHoverEvents: true\n });\n\n presetItems.push({\n id: 'reset',\n label: this.localizationHelper.getLocalizedValue(PlayerLocKeys.cc_reset),\n data: 'reset',\n persistOnClick: true,\n hasMouseHoverEvents: true\n });\n\n presetItems.unshift({\n id: '',\n label: this.localizationHelper.getLocalizedValue(PlayerLocKeys.cc_appearance),\n ariaLabel: 'Appreance - go back to previous menu',\n selectable: false,\n selected: false,\n persistOnClick: false,\n isBackButton: true,\n hasMouseHoverEvents: true\n });\n\n return {\n id: this._getCCSettingsMenuId(videoClosedCaptionsConstant.presetKey),\n label: this.localizationHelper.getLocalizedValue(PlayerLocKeys.cc_appearance),\n category: MenuCategories.ClosedCaptionSettings,\n items: presetItems\n };\n }\n\n /**\n * Gets the close captions setting menu item id.\n * @param settingId - The setting key.\n * @param optionId - The option key.\n * @returns - Menu Id.\n */\n private _getCCMenuItemId(settingId: string, optionId: string): string {\n return this.playerHelper.addIdPrefix(`cc-${settingId}-${optionId}`);\n }\n\n /**\n * Gets the close captions setting menu id.\n * @param settingId - The setting key.\n * @returns Setting menu Id.\n */\n private _getCCSettingsMenuId(settingId: string): string {\n return this.playerHelper.addIdPrefix(`cc-${settingId}`);\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n ClosedCaptionTypes,\n IAudioTrack,\n IBinaryReference,\n ICCFile,\n IPlayerMenu,\n IPlayerMenuItem,\n IPlayerProps,\n IVideoFile,\n IVideoMetadata,\n MediaQuality,\n MediaTypes,\n MenuCategories,\n PlayerConstants\n} from '../data';\nimport { startsWith } from '../utilities';\nimport LocalizationHelper, { PlayerLocKeys } from './localization-helper';\n\n/**\n *\n * Player helper class.\n *\n */\nexport default class PlayerHelper {\n private playerProps: IPlayerProps;\n\n private readonly localizationHelper: LocalizationHelper;\n\n private readonly _isMobileDevice?: boolean;\n\n public constructor(props: IPlayerProps, localizationHelper: LocalizationHelper, isMobileDevice?: boolean) {\n this.playerProps = props;\n this.localizationHelper = localizationHelper;\n this._isMobileDevice = isMobileDevice;\n }\n\n public getMetadata(): IVideoMetadata {\n this._mapVideoFiles();\n this._setCCFiles();\n this._setAudioTracks();\n return this.playerProps.playerData.metaData;\n }\n\n public updatePlayerProps(props: IPlayerProps): void {\n this.playerProps = props;\n this._clearVideoPlayerMetaData();\n }\n\n public getOptionMenu(): IPlayerMenu | null {\n const audioTracks = this._getAudioTracksMenu();\n if (audioTracks === null) {\n return null;\n }\n const optionMenuItems: IPlayerMenuItem[] = [];\n\n optionMenuItems.push({\n id: this.addIdPrefix('audioTracks'),\n label: this.localizationHelper.getLocalizedValue(PlayerLocKeys.audio_tracks),\n selected: false,\n selectable: false,\n subMenu: audioTracks\n });\n\n return {\n category: MenuCategories.Options,\n id: this.addIdPrefix(MenuCategories.Options),\n label: 'Options',\n items: optionMenuItems\n };\n }\n\n /**\n * Get Poster Frame URL.\n * @returns Returns the poster image URL.\n */\n public getPosterFrameUrl(): string {\n let posterFrameUrl = '';\n if (!this.playerProps.playerData.options.hidePosterFrame && this.playerProps.playerData.metaData.posterframeUrl) {\n posterFrameUrl = this._removeProtocolFromUrl(this.playerProps.playerData.metaData.posterframeUrl);\n if (this.playerProps.playerData.options.thumbnailFullWidth) {\n if (posterFrameUrl.indexOf('?') > 0) {\n posterFrameUrl = `${posterFrameUrl}${'&w='}${PlayerConstants.thumbnailFullWidth}${'&h='}${\n PlayerConstants.thumbnailFullHeight\n }`;\n } else {\n posterFrameUrl = `${posterFrameUrl}${'?w='}${PlayerConstants.thumbnailFullWidth}${'&h='}${\n PlayerConstants.thumbnailFullHeight\n }`;\n }\n }\n }\n return posterFrameUrl;\n }\n\n public getVideoFileToPlay(): IVideoFile {\n let videoFile: IVideoFile = {\n url: '',\n mediaType: MediaTypes.MP4,\n quality: MediaQuality.LO\n };\n const videoMetaData: IVideoMetadata = this.playerProps.playerData.metaData;\n\n const mpVideoFiles = this._getVideoFileByType(MediaTypes.MP4, videoMetaData.videoFiles!);\n\n if (this._isMobileDevice && this.playerProps.playerData.options.mobileVideoQuality) {\n const mobileVideoFile = this._getVideoFileByQuality(\n this.playerProps.playerData.options.mobileVideoQuality.toUpperCase() as MediaQuality,\n mpVideoFiles\n );\n if (mobileVideoFile) {\n return mobileVideoFile;\n }\n }\n\n const hdVideoFile = this._getVideoFileByQuality(MediaQuality.HDX, mpVideoFiles);\n if (hdVideoFile !== null) {\n videoFile = hdVideoFile;\n } else {\n const hqVideoFile = this._getVideoFileByQuality(MediaQuality.HQ, mpVideoFiles);\n if (hqVideoFile !== null) {\n videoFile = hqVideoFile;\n } else {\n const sdVideoFile = this._getVideoFileByQuality(MediaQuality.SD, mpVideoFiles);\n if (sdVideoFile !== null) {\n videoFile = sdVideoFile;\n } else {\n const loVideoFile = this._getVideoFileByQuality(MediaQuality.LO, mpVideoFiles);\n if (loVideoFile !== null) {\n videoFile = loVideoFile;\n }\n }\n }\n }\n return videoFile;\n }\n\n /**\n * Callback function when error happen.\n * @param errorType - Error Type.\n * @param message - Error message.\n */\n public onErrorCallback = (errorType: string, message: string): void => {\n console.log(`ErrorType : ${errorType}, Message : ${message}`);\n };\n\n public isEmptyOrUndefined(value?: string): boolean {\n if (value === undefined || value === '') {\n return true;\n }\n return false;\n }\n\n /**\n * Adds the id prefix to form a child id.\n * @param childId - The child id to prefix.\n * @returns - The prefixed id or the original id if no prefix is built.\n */\n public addIdPrefix(childId: string): string {\n const prefix = this.isEmptyOrUndefined(this.playerProps.playerId) ? null : `${this.playerProps.playerId}-`;\n\n return prefix && !startsWith(childId, prefix, false) ? prefix + childId : childId;\n }\n\n /**\n * Removes the id prefix from a child id.\n * @param childId - The child id to prefix.\n * @returns - The un-prefixed id or the original id if no prefix was found.\n */\n public removeIdPrefix(childId: string): string {\n const prefix = this.isEmptyOrUndefined(this.playerProps.playerId) ? null : `${this.playerProps.playerId}-`;\n\n return prefix && startsWith(childId, prefix, false) ? childId.substring(prefix.length) : childId;\n }\n\n private _getAudioTracksMenu(): IPlayerMenu | null {\n const audioTracksMenuItems: IPlayerMenuItem[] = [];\n const videoMetaData: IVideoMetadata = this.playerProps.playerData.metaData;\n if (videoMetaData.audioTracks !== undefined && videoMetaData.audioTracks.length > 0) {\n // Check if there are multiple \"Descriptive Audio\" tracks, in which case we will want to show language\n let descriptiveAudioTrackCount = 0;\n for (const track of videoMetaData.audioTracks) {\n if (track.isDescriptiveAudio) {\n descriptiveAudioTrackCount++;\n }\n }\n\n let trackIndex: number = 0;\n for (const audioTrack of videoMetaData.audioTracks) {\n let label: string;\n let languageCode: string = '';\n if (audioTrack.isDescriptiveAudio) {\n // Descriptive audio labels look like:\n // \"Descriptive audio\" -- when only one descriptive audio track exists\n // or\n // \"Descriptive audio - English\" -- if there is more than one descriptive audio track\n const descriptiveAudioLabel = this.localizationHelper.getLocalizedValue(PlayerLocKeys.descriptive_audio);\n if (descriptiveAudioTrackCount > 1) {\n const language = this.localizationHelper.getLanguageNameFromLocale(audioTrack.languageCode);\n label = `${descriptiveAudioLabel} - ${language}`;\n } else {\n label = descriptiveAudioLabel;\n }\n languageCode = `daudio-${audioTrack.languageCode.toLowerCase()}`;\n } else {\n // Regular tracks display language of the stream only.\n label = this.localizationHelper.getLanguageNameFromLocale(audioTrack.languageCode);\n languageCode = audioTrack.languageCode.toLowerCase();\n }\n\n const audioMenuItem: IPlayerMenuItem = {\n label,\n language: languageCode,\n data: audioTrack.url,\n id: this.addIdPrefix(`audio-${trackIndex}`),\n selected: false,\n selectable: true,\n persistOnClick: true\n };\n\n audioTracksMenuItems.push(audioMenuItem);\n trackIndex++;\n }\n\n audioTracksMenuItems.unshift({\n id: '',\n label: this.localizationHelper.getLocalizedValue(PlayerLocKeys.audio_tracks_default),\n ariaLabel: this.localizationHelper.getLocalizedValue(PlayerLocKeys.audio_tracks_default),\n language: 'default',\n data: 'default',\n selectable: true,\n selected: false,\n persistOnClick: true\n });\n\n audioTracksMenuItems.unshift({\n id: '',\n label: this.localizationHelper.getLocalizedValue(PlayerLocKeys.audio_tracks),\n ariaLabel: `${this.localizationHelper.getLocalizedValue(PlayerLocKeys.audio_tracks)} - go back to previous menu`,\n selectable: false,\n selected: false,\n persistOnClick: false,\n isBackButton: true\n });\n return {\n category: MenuCategories.AudioTracks,\n id: this.addIdPrefix(MenuCategories.AudioTracks),\n label: this.localizationHelper.getLocalizedValue(PlayerLocKeys.audio_tracks),\n items: audioTracksMenuItems\n };\n }\n return null;\n }\n\n private _clearVideoPlayerMetaData(): void {\n this.playerProps.playerData.metaData.videoFiles = [];\n this.playerProps.playerData.metaData.audioTracks = [];\n this.playerProps.playerData.metaData.ccFiles = [];\n }\n\n private _setCCFiles(): void {\n const videoMetaData: IVideoMetadata = this.playerProps.playerData.metaData;\n const ccFiles: ICCFile[] = [];\n if (!(videoMetaData.ccFiles && videoMetaData.ccFiles.length > 0)) {\n if (videoMetaData.videoBinaryReferences && videoMetaData.videoBinaryReferences.length > 0) {\n for (const binaryRef of videoMetaData.videoBinaryReferences) {\n // Skip all other format except ttml/closedcaption\n if (\n (binaryRef.extension && binaryRef.extension === 'ttml') ||\n binaryRef.$type === 'videoClosedCaptionBinaryReference'\n ) {\n const ccFile: ICCFile = {\n ccType: ClosedCaptionTypes.TTML,\n locale: binaryRef.locale!,\n url: binaryRef.sourceHref!\n };\n ccFiles.push(ccFile);\n }\n }\n this.playerProps.playerData.metaData.ccFiles = ccFiles;\n }\n }\n }\n\n private _setAudioTracks(): void {\n const videoMetaData: IVideoMetadata = this.playerProps.playerData.metaData;\n const audioTracks: IAudioTrack[] = [];\n if (videoMetaData.videoBinaryReferences && videoMetaData.videoBinaryReferences.length > 0) {\n for (const binaryRef of videoMetaData.videoBinaryReferences) {\n if (binaryRef.$type && binaryRef.$type === 'audioBinaryReference') {\n const audioTrack: IAudioTrack = {\n isDescriptiveAudio: binaryRef.audioType === 'descriptiveAudio',\n bitrate: binaryRef.bitrate!,\n languageCode: binaryRef.locale === undefined ? '' : binaryRef.locale,\n name: binaryRef.alias!,\n url: binaryRef.clientHref!\n };\n audioTracks.push(audioTrack);\n }\n }\n }\n this.playerProps.playerData.metaData.audioTracks = audioTracks;\n }\n\n private _mapVideoFiles(): void {\n const videoMetaData: IVideoMetadata = this.playerProps.playerData.metaData;\n if (!videoMetaData.videoFiles || videoMetaData.videoFiles.length === 0) {\n const videoFiles: IVideoFile[] = [];\n const videoBinaryFiles: IBinaryReference[] = videoMetaData.videoBinaryReferences!;\n if (videoBinaryFiles && videoBinaryFiles.length > 0) {\n for (const binaryRef of videoBinaryFiles) {\n if (binaryRef.format) {\n // Skip the unsupported 1001 format\n if (binaryRef.format === '1001') {\n continue;\n }\n\n // Handle all other video/audio format\n const mediaTypeAndQuality = this._getMediaTypeAndQuality(binaryRef.format);\n let urlRef;\n if (mediaTypeAndQuality.mediaType === MediaTypes.MP4) {\n urlRef = binaryRef.clientHref;\n } else {\n urlRef = binaryRef.sourceHref;\n }\n\n if (urlRef) {\n urlRef = this._removeProtocolFromUrl(urlRef);\n }\n\n if (urlRef) {\n videoFiles.push({\n url: urlRef,\n quality: mediaTypeAndQuality.quality,\n mediaType: mediaTypeAndQuality.mediaType,\n formatCode: binaryRef.format\n });\n }\n }\n }\n }\n this.playerProps.playerData.metaData.videoFiles = videoFiles;\n }\n }\n\n /**\n * Gets video quality and media type from stream name.\n * @param format - The stream name.\n * @returns The mediaType and MediaQuality.\n */\n private _getMediaTypeAndQuality(format: string): { mediaType: MediaTypes; quality: MediaQuality } {\n let mType: MediaTypes = MediaTypes.MP4;\n let mQuality: MediaQuality = MediaQuality.SD;\n\n switch (format) {\n case '101':\n mType = MediaTypes.MP4;\n mQuality = MediaQuality.LO;\n break;\n case '102':\n mType = MediaTypes.MP4;\n mQuality = MediaQuality.SD;\n break;\n case '103':\n mType = MediaTypes.MP4;\n mQuality = MediaQuality.HQ;\n break;\n case '104':\n mType = MediaTypes.MP4;\n mQuality = MediaQuality.HDX;\n break;\n case '105':\n mType = MediaTypes.MP4;\n mQuality = MediaQuality.HD;\n break;\n case '1004':\n mType = MediaTypes.SMOOTH;\n break;\n case '1006':\n mType = MediaTypes.HLS;\n break;\n case '1007':\n mType = MediaTypes.DASH;\n break;\n default:\n mType = MediaTypes.MP4;\n mQuality = MediaQuality.SD;\n }\n\n return {\n mediaType: mType,\n quality: mQuality\n };\n }\n\n /**\n * Removes protocol from url.\n * @param url - The url.\n * @returns The URL.\n */\n private _removeProtocolFromUrl(url: string): string {\n return url.replace(/(^\\w+:|^)\\/\\//, '//');\n }\n\n /**\n * Gets the video file of specified quality.\n * @param quality - The desired quality to look for.\n * @param videoFiles - The video files.\n * @returns Returns the video file.\n */\n private _getVideoFileByQuality(quality: MediaQuality, videoFiles: IVideoFile[]): IVideoFile | null {\n let videoFile = null;\n for (const file of videoFiles) {\n if (file.quality === quality) {\n videoFile = file;\n break;\n }\n }\n\n return videoFile;\n }\n\n /**\n * Gets the video file of specified type.\n * @param mediaType - The media type to look for.\n * @param videoFiles - The video files.\n * @returns Returns the video file.\n */\n private _getVideoFileByType(mediaType: MediaTypes, videoFiles: IVideoFile[]): IVideoFile[] {\n const videoFile: IVideoFile[] = [];\n for (const file of videoFiles) {\n if (file.mediaType === mediaType) {\n videoFile.push(file);\n }\n }\n return videoFile;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as MsDyn365 from '@msdyn365-commerce/core';\nimport { getPayloadObject, IPayLoad, ISliderChangeNotification, onTelemetryClick, Waiting } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport {\n AgeGate,\n ClosedCaptionHelper,\n ClosedCaptions,\n closedCaptionsSettingDefaults,\n ClosedCaptionTypes,\n format,\n ICCFile,\n ICurrentClosedCaptionsSettings,\n IPlayerMenu,\n IPlayerMenuItemClickNotification,\n IPlayerProps,\n IPlayPosition,\n isNullOrWhiteSpace,\n isSafari,\n IVideoErrorData,\n IVideoErrorMessageData,\n IVideoMetadata,\n KeyCodes,\n LocalizationConstants,\n LocalizationHelper,\n MediaEvents,\n MenuCategories,\n PlayerConstants,\n PlayerHelper,\n PlayerStates,\n PlayPauseTrigger,\n videoClosedCaptionsConstant,\n VideoControls,\n VideoErrorCodes,\n VideoPlayerNames\n} from './components';\n\n/**\n * Player state interface.\n */\nexport interface IPlayerState {\n playing: boolean;\n mouseHovered: boolean;\n isControlPanelVisible: boolean;\n doControlsHaveFocus: boolean;\n playPosition: IPlayPosition;\n currentVolume: number;\n isTriggerEnabled: boolean;\n previousVolume: number;\n isMuted: boolean;\n isInFullScreen: boolean;\n showSpinner: boolean;\n showErrorMessage: boolean;\n videoErrorMessage: IVideoErrorMessageData;\n screenReaderText: string;\n showClosedCaptions: boolean;\n isAgegateEnabled: boolean;\n currentAudioTrack: string;\n currentAudioTrackURL: string;\n closedCaptionLanguage: string;\n closedCaptionsURL: string;\n currentClosedCaptionsSettings: ICurrentClosedCaptionsSettings;\n mounted: boolean;\n tempClosedCaptionsSettings?: {};\n}\n\n/**\n *\n * Player component.\n *\n */\nexport default class Player extends React.Component {\n public static defaultProps: Partial = {\n playerData: {\n options: {\n autoplay: true,\n ageGate: false,\n mute: true,\n loop: false,\n playPauseTrigger: false,\n controls: true,\n hidePosterFrame: false,\n lazyLoad: true\n },\n metaData: {\n playerName: 'videoPlayer',\n videoId: '',\n title: '',\n description: '',\n duration: 0,\n posterframeUrl: '',\n shareUrl: '',\n videoFiles: [],\n externalPlayerUrl: '',\n externalSourceId: '',\n videoBinaryReferences: []\n }\n },\n playerResources: {\n playAriaLabel: LocalizationConstants.playAriaLabel,\n pauseAriaLabel: LocalizationConstants.pauseAriaLabel,\n closeAriaLabel: LocalizationConstants.closeAriaLabel,\n muteAriaLabel: LocalizationConstants.muteAriaLabel,\n unMuteAriaLabel: LocalizationConstants.unMuteAriaLabel,\n fullScreenAriaLabel: LocalizationConstants.fullScreenAriaLabel,\n exitFullScreenAriaLabel: LocalizationConstants.exitFullScreenAriaLabel,\n pausedAriaLabel: LocalizationConstants.pausedAriaLabel,\n playingAriaLabel: LocalizationConstants.playingAriaLabel,\n seekBarLabel: LocalizationConstants.seekBarLabel,\n videoTimeDurationLabel: LocalizationConstants.videoTimeDurationLabel,\n closedCaptionLabel: LocalizationConstants.closedCaptionLabel,\n sliderThumbLabel: LocalizationConstants.sliderThumbLabel,\n volumeThumbLabel: LocalizationConstants.volumeThumbLabel\n }\n };\n\n private controlPanelTimer: number = 0;\n\n private readonly playerId: string;\n\n private readonly player: React.RefObject = React.createRef();\n\n private readonly audio: React.RefObject = React.createRef();\n\n private readonly playerContainer: React.RefObject = React.createRef();\n\n private readonly videoControl: React.RefObject = React.createRef();\n\n private readonly ClosedCaptions: React.RefObject = React.createRef();\n\n private readonly ageGateContainer: React.RefObject = React.createRef();\n\n private videoUrl: string = '';\n\n private posterFrameUrl: string = '';\n\n private seekFrom: number | null = null;\n\n private playerState: PlayerStates;\n\n private readonly playerHelper: PlayerHelper;\n\n private readonly localizationHelper: LocalizationHelper;\n\n private closedCaptionHelper: ClosedCaptionHelper | null = null;\n\n private closedCaptionMenu: IPlayerMenu | null = null;\n\n private optionsMenu: IPlayerMenu | null = null;\n\n private selectedClosedCaptionsLocale: string | null = '';\n\n private isPlayerManuallyPaused: boolean = false;\n\n private isPlayerLoaded: boolean = false;\n\n private playerMetaData: IVideoMetadata;\n\n private readonly isMobileDevice: boolean;\n\n private readonly payLoad: IPayLoad;\n\n private readonly _shouldAutoPlay: boolean;\n\n /**\n * Checks if fullscreen is supported by browser or not.\n * @returns - If native fullscreen enabled.\n */\n private static _isNativeFullscreenEnabled(): boolean {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const doc = document as any;\n return (\n doc.fullscreenEnabled ||\n doc.mozFullScreenEnabled ||\n doc.webkitFullscreenEnabled ||\n doc.webkitSupportsFullscreen ||\n doc.msFullscreenEnabled\n );\n }\n /**\n * Gets the current fullscreen element.\n * @returns - The element in full screen.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private static _getElementInFullScreen(): any {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const doc = document as any;\n return doc.fullscreenElement || doc.mozFullScreenElement || doc.webkitFullscreenElement || doc.msFullscreenElement;\n }\n\n public constructor(props: IPlayerProps) {\n super(props);\n\n const {\n playerData: {\n options: {\n shouldDisableAutoPlayOnMobile,\n autoplay: isAutoPlay,\n playPauseTrigger: isPlayPauseTrigger,\n ageGate: isAgeGateEnabled,\n controls: isControlsEnabled,\n mute: isMuted,\n lazyLoad: isLazyLoaded,\n isMobileDevice\n }\n }\n } = this.props;\n\n this.isMobileDevice = this._isMobile() || isMobileDevice!;\n\n this._shouldAutoPlay = this.isMobileDevice && shouldDisableAutoPlayOnMobile ? false : isAutoPlay!;\n\n const state = {\n playing: false,\n mouseHovered: isPlayPauseTrigger! || !this._shouldAutoPlay,\n isControlPanelVisible: !isPlayPauseTrigger,\n doControlsHaveFocus: false,\n isTriggerEnabled: isPlayPauseTrigger! && !this._shouldAutoPlay && isControlsEnabled!,\n currentVolume: isMuted && !this.isMobileDevice ? 0 : PlayerConstants.defaultVolume * 100,\n previousVolume: 0,\n isMuted: isMuted ?? false,\n isInFullScreen: false,\n showSpinner: false,\n isAgegateEnabled: isAgeGateEnabled! && !this._shouldAutoPlay,\n showErrorMessage: false,\n screenReaderText: '',\n closedCaptionLanguage: 'off',\n currentAudioTrack: 'default',\n currentAudioTrackURL: '',\n showClosedCaptions: false,\n mounted: false,\n currentClosedCaptionsSettings: {\n preset: closedCaptionsSettingDefaults.preset,\n text_font: closedCaptionsSettingDefaults.text_font,\n text_color: closedCaptionsSettingDefaults.text_color,\n text_opacity: closedCaptionsSettingDefaults.text_opacity,\n text_size: closedCaptionsSettingDefaults.text_size,\n text_edge_style: closedCaptionsSettingDefaults.text_edge_style,\n text_background_color: closedCaptionsSettingDefaults.text_background_color,\n text_background_opacity: closedCaptionsSettingDefaults.text_background_opacity,\n window_color: closedCaptionsSettingDefaults.window_color,\n window_opacity: closedCaptionsSettingDefaults.window_opacity\n },\n closedCaptionsURL: '',\n videoErrorMessage: {\n title: '',\n message: ''\n },\n playPosition: {\n currentTime: 0,\n startTime: 0,\n endTime: 0,\n bufferedDuration: 0\n },\n tempClosedCaptionsSettings: undefined\n };\n\n this.playerState = 'init';\n this._onTriggerClicked = this._onTriggerClicked.bind(this);\n this._onMouseEvent = this._onMouseEvent.bind(this);\n this._onPlay = this._onPlay.bind(this);\n this._onPause = this._onPause.bind(this);\n this._triggerEvents = this._triggerEvents.bind(this);\n this._triggerAudioEvents = this._triggerAudioEvents.bind(this);\n this._onProgressChange = this._onProgressChange.bind(this);\n this._setMuted = this._setMuted.bind(this);\n this._onVolumeChange = this._onVolumeChange.bind(this);\n this._onFullScreenChanged = this._onFullScreenChanged.bind(this);\n this._toggleFullScreen = this._toggleFullScreen.bind(this);\n this._showControlBar = this._showControlBar.bind(this);\n this._handleControlsKeyDownEvent = this._handleControlsKeyDownEvent.bind(this);\n this._onFullscreenError = this._onFullscreenError.bind(this);\n this._onPlayerKeyDown = this._onPlayerKeyDown.bind(this);\n this._onTriggerFocus = this._onTriggerFocus.bind(this);\n this._onTriggerBlur = this._onTriggerBlur.bind(this);\n this._onVideoControlsFocus = this._onVideoControlsFocus.bind(this);\n this._onVideoControlsBlur = this._onVideoControlsBlur.bind(this);\n this._onPlayerMenuItemClick = this._onPlayerMenuItemClick.bind(this);\n this._onPlayerMenuItemFocus = this._onPlayerMenuItemFocus.bind(this);\n this._onPlayerMenuItemBlur = this._onPlayerMenuItemBlur.bind(this);\n this._validateAgeSubmitHandler = this._validateAgeSubmitHandler.bind(this);\n this._onContextMenuClicked = this._onContextMenuClicked.bind(this);\n this.localizationHelper = new LocalizationHelper(this.props.playerResources!);\n this.playerHelper = new PlayerHelper(this.props, this.localizationHelper, this.isMobileDevice);\n this.playerId = this.playerHelper.isEmptyOrUndefined(this.props.playerId) ? 'vid-0' : this.props.playerId!;\n this.playerMetaData = this.playerHelper.getMetadata();\n this.state = state;\n this.posterFrameUrl = this.playerHelper.getPosterFrameUrl();\n this.payLoad = getPayloadObject('click', this.props.telemetryContent!, '');\n\n if (!isLazyLoaded) {\n this.videoUrl = this.playerHelper.getVideoFileToPlay().url;\n }\n }\n\n public shouldComponentUpdate(nextProps: IPlayerProps, nextState: IPlayerState): boolean {\n if (this.state === nextState && this.props.playerData.options === nextProps.playerData.options) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element {\n const {\n playerData: {\n options: { loop: isLoop }\n }\n } = this.props;\n\n const maskLevelStyle: React.CSSProperties = {};\n maskLevelStyle.backgroundColor = this._getMaskLevelStyle();\n\n if (this.props.isEditor) {\n this.playerHelper.updatePlayerProps(this.props);\n this.playerMetaData = this.playerHelper.getMetadata();\n if (this.posterFrameUrl !== this.playerHelper.getPosterFrameUrl()) {\n this.posterFrameUrl = this.playerHelper.getPosterFrameUrl();\n }\n if (this.isPlayerLoaded && this.videoUrl !== this.playerHelper.getVideoFileToPlay().url) {\n this._loadPlayer();\n }\n }\n\n const loadMetaData = this._shouldAutoPlay ? 'auto' : 'metadata';\n\n // Set play aria label\n let playAriaLabel: string = '';\n if (this.playerMetaData.title) {\n playAriaLabel = `${this.localizationHelper.getLocalizedValue('playAriaLabel')} ${this.playerMetaData.title}`;\n } else {\n playAriaLabel = LocalizationConstants.playVideoAriaLabel;\n }\n\n return (\n \n
\n {this.state.currentAudioTrack !== '' && this.state.currentAudioTrackURL !== '' && (\n \n )}\n
\n
\n {this.state.screenReaderText}\n
\n \n \n \n {this.props.playerData.options.ageGate && this._renderAgeGate()}\n {this._renderPlayPauseTrigger(playAriaLabel, maskLevelStyle)}\n {this.state.showClosedCaptions && this._renderClosedCaptions()}\n {this._renderVideoControls(playAriaLabel)}\n \n \n );\n }\n\n /**\n * Play the video.\n */\n public play(): void {\n this.player.current!.play().catch(() => {\n this._onVideoError();\n });\n if (this.audio.current) {\n this.audio.current.play().catch(() => {\n this._onAudioError();\n });\n }\n }\n\n /**\n * Pause the video.\n */\n public pause(): void {\n this.player.current!.pause();\n if (this.audio.current) {\n this.audio.current.pause();\n }\n }\n\n public componentDidMount(): void {\n const {\n playerData: {\n options: { playPauseTrigger: isPlayPauseTrigger, lazyLoad: isLazyLoaded }\n }\n } = this.props;\n if (!isLazyLoaded) {\n this._onVideoLoadedData();\n this._showControlBar(false);\n }\n\n if (this._shouldAutoPlay || (isLazyLoaded && !isPlayPauseTrigger) || !isLazyLoaded) {\n this._loadPlayer();\n }\n document.addEventListener('fullscreenchange', this._onFullScreenChanged);\n document.addEventListener('mozfullscreenchange', this._onFullScreenChanged);\n document.addEventListener('webkitfullscreenchange', this._onFullScreenChanged);\n document.addEventListener('MSFullscreenChange', this._onFullScreenChanged);\n\n document.addEventListener('fullscreenerror', this._onFullscreenError);\n document.addEventListener('mozfullscreenerror', this._onFullscreenError);\n document.addEventListener('webkitfullscreenerror', this._onFullscreenError);\n document.addEventListener('MSFullscreenError', this._onFullscreenError);\n }\n\n public componentWillUnmount(): void {\n if (this.player.current) {\n for (const mediaEvent of MediaEvents) {\n this.player.current.removeEventListener(mediaEvent, this._triggerEvents);\n }\n }\n document.removeEventListener('fullscreenchange', this._onFullScreenChanged);\n document.removeEventListener('mozfullscreenchange', this._onFullScreenChanged);\n document.removeEventListener('webkitfullscreenchange', this._onFullScreenChanged);\n document.removeEventListener('MSFullscreenChange', this._onFullScreenChanged);\n\n document.removeEventListener('fullscreenerror', this._onFullscreenError);\n document.removeEventListener('mozfullscreenerror', this._onFullscreenError);\n document.removeEventListener('webkitfullscreenerror', this._onFullscreenError);\n document.removeEventListener('MSFullscreenError', this._onFullscreenError);\n }\n\n /**\n * Renders closed captions.\n * @returns Returns closed captions.\n */\n private readonly _renderClosedCaptions = (): JSX.Element => {\n return (\n \n );\n };\n\n /**\n * Renders the play pause trigger.\n * @param playAriaLabel - Aria label for the play button.\n * @param maskLevelStyle - Mask level.\n * @returns Returns play pause trigger.\n */\n private readonly _renderPlayPauseTrigger = (playAriaLabel: string, maskLevelStyle: React.CSSProperties): JSX.Element | undefined => {\n const {\n playerData: {\n options: {\n autoplay: shouldAutoPlay,\n playPauseTrigger: isPlayPauseTrigger,\n controls: isControlsEnabled,\n shouldDisableAutoPlayOnMobile\n }\n }\n } = this.props;\n\n if (!MsDyn365.msdyn365Commerce.isBrowser && isPlayPauseTrigger && shouldAutoPlay && shouldDisableAutoPlayOnMobile) {\n // Rendering an empty div because on server side isMobile will be false at server side.\n return
;\n }\n\n if (isPlayPauseTrigger && (!isControlsEnabled || this.state.isTriggerEnabled) && !this.state.isAgegateEnabled) {\n return (\n \n );\n }\n\n return undefined;\n };\n\n /**\n * Renders the video controls.\n * @param playAriaLabel - Arial label for the play button.\n * @returns Returns the video control.\n */\n private readonly _renderVideoControls = (playAriaLabel: string): JSX.Element | undefined => {\n const {\n playerData: {\n options: { controls: isControlsEnabled }\n }\n } = this.props;\n\n if (isControlsEnabled && !this.state.isTriggerEnabled && !this.state.isAgegateEnabled) {\n return (\n \n );\n }\n return undefined;\n };\n\n /**\n * Renders the age gate module.\n * @returns Renders the age gate module.\n */\n private readonly _renderAgeGate = (): JSX.Element => {\n return (\n \n );\n };\n\n private _loadPlayer(): void {\n if (this.player.current) {\n this.player.current.volume = this.state.currentVolume / 100;\n\n // Register the media events\n for (const mediaEvent of MediaEvents) {\n this.player.current.addEventListener(mediaEvent, this._triggerEvents);\n }\n }\n\n if (this.props.playerData.options.lazyLoad || this.props.isEditor) {\n this.videoUrl = this.playerHelper.getVideoFileToPlay().url;\n if (this.player.current) {\n this.player.current.src = this.videoUrl;\n this.player.current.load();\n }\n }\n\n this.isPlayerLoaded = true;\n\n if (this.props.playerData.options.controls) {\n this.closedCaptionHelper = new ClosedCaptionHelper(this.playerMetaData, this.playerHelper, this.localizationHelper);\n this.closedCaptionMenu = this.closedCaptionHelper.getClosedCaptionMenu()!;\n this.optionsMenu = this.playerHelper.getOptionMenu();\n const ccFiles = this.playerMetaData.ccFiles!;\n if (ccFiles !== undefined && ccFiles.length > 0) {\n const autoCaptionsLang = this.props.playerData && this.props.playerData.options.autoCaptions;\n let autoCaptionsLocale: string | null = null;\n for (const ccFile of ccFiles) {\n if (!autoCaptionsLocale && autoCaptionsLang && ccFile.locale.includes(autoCaptionsLang)) {\n autoCaptionsLocale = ccFile.locale;\n }\n }\n this.selectedClosedCaptionsLocale = autoCaptionsLocale;\n if (!isNullOrWhiteSpace(this.selectedClosedCaptionsLocale!)) {\n this.setState({\n closedCaptionLanguage: this.selectedClosedCaptionsLocale!,\n closedCaptionsURL: this.closedCaptionHelper.getClosedCaptionURLFromLocale(this.selectedClosedCaptionsLocale!),\n showClosedCaptions: true\n });\n }\n }\n }\n }\n\n /**\n * Validates the age submitted by the user.\n */\n private _validateAgeSubmitHandler(): void {\n if (this.ageGateContainer.current!.getCalculatedAge()) {\n this.videoUrl = this.playerHelper.getVideoFileToPlay().url;\n this.setState({ isAgegateEnabled: false });\n } else {\n this.setState({ isAgegateEnabled: true });\n this._displayErrorMessage({ title: 'you are not allowed to watch video' });\n }\n }\n\n private _onVideoControlsFocus(): void {\n // No need to call showControlBar, this will make sure it shows\n this.setState({ doControlsHaveFocus: true });\n }\n\n private _onVideoControlsBlur(): void {\n // Call showControlBar to give it the 6 second timeout\n this._showControlBar(true);\n\n this.setState({ doControlsHaveFocus: false });\n }\n\n private _onPlayerMenuItemFocus(notification: IPlayerMenuItemClickNotification): void {\n if (notification.data && notification.data.indexOf(':') > 0) {\n const dataSplit = notification.data.split(':');\n const settingKey = dataSplit[0];\n if (settingKey === videoClosedCaptionsConstant.presetKey) {\n if (this.state.closedCaptionLanguage === 'off') {\n this.setState(\n {\n showClosedCaptions: true\n },\n () => {\n this.ClosedCaptions.current!.showSampleCaptions();\n this._setCCSettings(notification, false);\n }\n );\n } else {\n this._setCCSettings(notification, false);\n }\n }\n } else if (this.state.closedCaptionLanguage === 'off') {\n this.setState({\n showClosedCaptions: false\n });\n }\n }\n\n private _onPlayerMenuItemBlur(): void {\n this._setCCSettings({\n category: MenuCategories.ClosedCaptionSettings,\n id: '',\n data: 'current'\n });\n }\n\n private _onPlayerMenuItemClick(notification: IPlayerMenuItemClickNotification): void {\n switch (notification.category) {\n case MenuCategories.ClosedCaption: {\n this._setCC(notification.id);\n break;\n }\n\n case MenuCategories.ClosedCaptionSettings: {\n this._setCCSettings(notification);\n break;\n }\n\n case MenuCategories.AudioTracks: {\n this._setAudioTracks(notification);\n break;\n }\n default:\n }\n }\n\n /**\n * Sets the close captioning language/locale.\n * @param ccLanguageId - The desired new cc value.\n */\n private _setCC(ccLanguageId: string): void {\n ccLanguageId = this.playerHelper.removeIdPrefix(ccLanguageId);\n let selectedOption: ICCFile | null = null;\n\n if (ccLanguageId && this.playerMetaData.ccFiles) {\n for (const ccFile of this.playerMetaData.ccFiles) {\n if (ccFile.locale === ccLanguageId && (!ccFile.ccType || ccFile.ccType === ClosedCaptionTypes.TTML)) {\n selectedOption = ccFile;\n break;\n }\n }\n }\n\n if (ccLanguageId === 'off') {\n this.setState({\n closedCaptionLanguage: 'off',\n closedCaptionsURL: '',\n showClosedCaptions: false\n });\n } else {\n this.setState({\n closedCaptionLanguage: selectedOption!.locale,\n closedCaptionsURL: selectedOption!.url,\n showClosedCaptions: true\n });\n }\n }\n\n /**\n * Sets the close caption settings.\n * @param notification - The desired new cc value.\n * @param updatePreferences - Update Preferences.\n */\n private _setCCSettings(notification: IPlayerMenuItemClickNotification, updatePreferences?: boolean): void {\n if (notification.data === 'reset') {\n this.setState(\n {\n currentClosedCaptionsSettings: closedCaptionsSettingDefaults\n },\n () => {\n if (this.ClosedCaptions.current !== null) {\n this.ClosedCaptions.current.applySettings();\n this.ClosedCaptions.current.resetCaptions();\n this.ClosedCaptions.current.updateCaptions(this.state.playPosition.currentTime);\n }\n }\n );\n } else if (notification.data === 'current') {\n this.setState({\n tempClosedCaptionsSettings: undefined\n });\n\n if (this.state.closedCaptionLanguage === 'off') {\n this.setState({\n showClosedCaptions: false\n });\n }\n } else {\n const dataSplit = notification.data!.split(':');\n if (!dataSplit) {\n return;\n }\n const settingKey = dataSplit[0];\n const optionKey = dataSplit[1];\n const currentSetting = this.closedCaptionHelper!.getUpdatedClosedCaptionSetting(\n this.state.currentClosedCaptionsSettings,\n settingKey,\n optionKey\n );\n if (updatePreferences === undefined || updatePreferences) {\n this.setState(\n {\n tempClosedCaptionsSettings: undefined,\n currentClosedCaptionsSettings: currentSetting\n },\n () => {\n if (this.ClosedCaptions.current) {\n this.ClosedCaptions.current.applySettings();\n this.ClosedCaptions.current.resetCaptions();\n this.ClosedCaptions.current.updateCaptions(this.state.playPosition.currentTime);\n }\n }\n );\n } else {\n this.setState({\n tempClosedCaptionsSettings: currentSetting\n });\n }\n }\n }\n\n private _setAudioTracks(notification: IPlayerMenuItemClickNotification): void {\n const data = JSON.parse(notification.data!);\n if (data.lang === 'default') {\n this.setState(\n {\n currentAudioTrack: 'default',\n currentAudioTrackURL: ''\n },\n () => {\n this.player.current!.volume = this.state.currentVolume / 100;\n }\n );\n } else {\n this.setState(\n {\n currentAudioTrack: data.lang,\n currentAudioTrackURL: data.url\n },\n () => {\n this.audio.current!.currentTime = this.player.current!.currentTime;\n this.audio.current!.volume = this.state.currentVolume / 100;\n this.player.current!.volume = 0;\n if (!this.player.current!.paused) {\n this.audio.current!.load();\n for (const mediaEvent of MediaEvents) {\n this.audio.current!.addEventListener(mediaEvent, this._triggerAudioEvents);\n }\n }\n }\n );\n }\n }\n\n private _triggerAudioEvents(event: Event): void {\n switch (event.type.toLowerCase()) {\n case 'error':\n this._onAudioError();\n break;\n case 'waiting':\n if (this.playerState === 'playing') {\n this.isPlayerManuallyPaused = true;\n this.pause();\n }\n break;\n\n case 'loadeddata':\n if (this.isPlayerManuallyPaused) {\n this.isPlayerManuallyPaused = false;\n this.play();\n }\n if (!this.player.current!.paused) {\n this.play();\n }\n break;\n\n default:\n }\n }\n\n private _triggerEvents(event: Event): void {\n switch (event.type.toLowerCase()) {\n case 'canplay':\n case 'canplaythrough':\n break;\n\n case 'error':\n this._onVideoError();\n break;\n\n case 'play':\n break;\n\n case 'pause':\n this._updateState('paused');\n if (this.props.playerData.options.playPauseTrigger) {\n this.setState({\n mouseHovered: true\n });\n }\n break;\n\n case 'seeking':\n if (this.playerState !== 'ended' && this.player.current!.seeking) {\n this.seekFrom = this.player.current!.currentTime;\n this._updateState('seeking');\n }\n break;\n\n case 'seeked':\n const currentPlayer = this.player.current;\n const currentTime = currentPlayer!.currentTime;\n if (this.playerState !== 'ended' && this.player.current!.seeking && this.seekFrom !== currentTime) {\n this.seekFrom = null;\n }\n this._updateState(currentPlayer!.paused ? 'paused' : 'playing');\n break;\n\n case 'waiting':\n this._updateState('buffering');\n break;\n\n case 'loadedmetadata':\n break;\n\n case 'loadeddata':\n this._onVideoLoadedData();\n if (!this._shouldAutoPlay) {\n this._showControlBar(false);\n }\n break;\n\n case 'timeupdate':\n this._onTimeUpdate();\n break;\n\n case 'ended':\n this._updateState('ended');\n this._stop();\n break;\n\n case 'playing':\n this._updateState('playing');\n break;\n\n case 'volumechange':\n break;\n\n default:\n }\n }\n\n private _onAudioError(): void {\n this.pause();\n const errorMessage: IVideoErrorMessageData = { title: 'Error while playing audio Track. Switching back to default track' };\n this._displayErrorMessage(errorMessage);\n this._setAudioTracks({ category: 'audioTracks', data: '{ \"lang\": \"default\", \"url\": \"\"}', id: '' });\n setTimeout(() => {\n this.setState(\n {\n showErrorMessage: false\n },\n () => {\n this.play();\n }\n );\n }, 2000);\n }\n\n private _onVideoError(): void {\n this._updateState('error');\n const error: IVideoErrorData | null = this._getError();\n let errorMessage = '';\n if (error?.errorCode) {\n switch (error.errorCode) {\n case VideoErrorCodes.MediaErrorAborted:\n errorMessage = 'video playback was aborted';\n break;\n case VideoErrorCodes.MediaErrorNetwork:\n errorMessage = 'video failed to download';\n break;\n case VideoErrorCodes.MediaErrorDecode:\n errorMessage = 'video is not readable';\n break;\n case VideoErrorCodes.MediaErrorSourceNotSupported:\n errorMessage = 'video format is not supported';\n break;\n default:\n errorMessage = 'unknown error occurred';\n }\n\n this._stopMedia(errorMessage);\n } else {\n this._stopMedia();\n }\n }\n\n private _stopMedia(msgToDisplay?: string): void {\n if (msgToDisplay) {\n this._displayErrorMessage({ title: msgToDisplay });\n this._updateState('stopped');\n }\n }\n\n /**\n * Create an error message overlay.\n * @param errorMessage - Error message content.\n */\n private _displayErrorMessage(errorMessage: IVideoErrorMessageData): void {\n this.setState({ videoErrorMessage: { title: errorMessage.title, message: errorMessage.message } });\n this.setState({ showErrorMessage: true });\n }\n\n /**\n * Gets the video error code of the current error.\n * @returns : Returns the video error code.\n */\n private _getError(): IVideoErrorData | null {\n let contentErrorCode: VideoErrorCodes;\n if (this.player.current!.error) {\n // Video playback failed - show a message saying why\n switch (this.player.current!.error.code) {\n case this.player.current!.error.MEDIA_ERR_ABORTED:\n contentErrorCode = VideoErrorCodes.MediaErrorAborted;\n break;\n case this.player.current!.error.MEDIA_ERR_NETWORK:\n contentErrorCode = VideoErrorCodes.MediaErrorNetwork;\n break;\n case this.player.current!.error.MEDIA_ERR_DECODE:\n contentErrorCode = VideoErrorCodes.MediaErrorDecode;\n break;\n case this.player.current!.error.MEDIA_ERR_SRC_NOT_SUPPORTED:\n contentErrorCode = VideoErrorCodes.MediaErrorSourceNotSupported;\n break;\n default:\n contentErrorCode = VideoErrorCodes.MediaErrorUnknown;\n }\n return { errorCode: contentErrorCode };\n }\n return null;\n }\n\n private _handleControlsKeyDownEvent(e: React.KeyboardEvent): void {\n const keyBrdEvent = (e as unknown) as KeyboardEvent;\n const keycode = keyBrdEvent.keyCode;\n this._showControlBar(true);\n\n // Const castTarget = e.target as HTMLElement;\n\n switch (keycode) {\n case KeyCodes.Home:\n e.stopPropagation();\n e.preventDefault();\n this.player.current!.currentTime = 0;\n if (this.audio.current) {\n this.audio.current.currentTime = 0;\n }\n break;\n case KeyCodes.End:\n e.stopPropagation();\n e.preventDefault();\n this.player.current!.currentTime = this.state.playPosition.endTime;\n if (this.audio.current) {\n this.audio.current.currentTime = this.state.playPosition.endTime;\n }\n break;\n case KeyCodes.ArrowLeft:\n case KeyCodes.ArrowRight:\n e.stopPropagation();\n e.preventDefault();\n let jumpToTime =\n keycode === KeyCodes.ArrowLeft\n ? this.state.playPosition.currentTime - PlayerConstants.defaultVideoSliderSteps\n : this.state.playPosition.currentTime + PlayerConstants.defaultVideoSliderSteps;\n jumpToTime = Math.min(Math.max(this.state.playPosition.startTime, jumpToTime), this.state.playPosition.endTime);\n this.player.current!.currentTime = jumpToTime;\n if (this.audio.current) {\n this.audio.current.currentTime = jumpToTime;\n }\n break;\n case KeyCodes.ArrowUp:\n case KeyCodes.ArrowDown:\n e.stopPropagation();\n e.preventDefault();\n this.videoControl.current!.showVolumeControl(true).call(this);\n const volume =\n keycode === KeyCodes.ArrowDown\n ? Math.max((this.state.currentVolume - PlayerConstants.defaultVolumeSliderSteps) / 100, 0)\n : Math.min((this.state.currentVolume + PlayerConstants.defaultVolumeSliderSteps) / 100, 1);\n this.setState({ currentVolume: Math.round(volume * 100) });\n if (this.audio.current) {\n this.audio.current.volume = volume;\n } else {\n this.player.current!.volume = volume;\n }\n if (volume === 0) {\n this.setState({ isMuted: true });\n } else {\n this.setState({ isMuted: false });\n }\n break;\n default:\n }\n }\n\n private _onPlay(): void {\n this.setState({ playing: true });\n }\n\n private _onPause(): void {\n this.setState({ playing: false });\n }\n\n private _onVolumeChange(notification: ISliderChangeNotification): void {\n this.setState({ currentVolume: notification.firstThumbValue });\n if (this.audio.current) {\n this.audio.current.volume = notification.firstThumbValue / 100;\n } else {\n this.player.current!.volume = notification.firstThumbValue / 100;\n }\n\n if (notification.firstThumbValue === 0) {\n this.setState({ isMuted: true });\n } else if (this.state.isMuted && notification.firstThumbValue > 0) {\n this.setState({ isMuted: false });\n }\n }\n\n private _setMuted(): void {\n if (this.state.isMuted) {\n const newVolume = this.state.previousVolume === 0 ? PlayerConstants.defaultVolume * 100 : this.state.previousVolume;\n\n if (this.audio.current) {\n this.audio.current.volume = newVolume / 100;\n } else {\n this.player.current!.volume = newVolume / 100;\n }\n this.setState({ isMuted: false, currentVolume: newVolume });\n this._updateScreenReaderElement(this.localizationHelper.getLocalizedValue('unMuteAriaLabel'));\n onTelemetryClick(this.props.telemetryContent!, this.payLoad, LocalizationConstants.unMuteAriaLabel).call(this);\n } else {\n this.setState({ isMuted: true, previousVolume: this.player.current!.volume * 100, currentVolume: 0 });\n this._updateScreenReaderElement(this.localizationHelper.getLocalizedValue('muteAriaLabel'));\n onTelemetryClick(this.props.telemetryContent!, this.payLoad, LocalizationConstants.muteAriaLabel).call(this);\n }\n }\n\n private _onPlayerKeyDown(e: React.KeyboardEvent): void {\n const keyBrdEvent = (e as unknown) as KeyboardEvent;\n const keycode = keyBrdEvent.keyCode;\n\n if (keycode === KeyCodes.Tab) {\n this._showControlsBasedOnState();\n }\n }\n\n private _onMouseEvent(event: React.MouseEvent): void {\n if (this.props.playerData.options.controls) {\n this._showControlBar();\n }\n if (!this.state.isTriggerEnabled && this.state.playing) {\n this.setState({ mouseHovered: event.type === 'mouseenter' });\n }\n }\n\n private _showControlBar(autoHide: boolean = true): void {\n if (!this.state.isTriggerEnabled && !this.state.isAgegateEnabled) {\n if (!this.state.isControlPanelVisible) {\n this.setState({ isControlPanelVisible: true });\n }\n if (this.controlPanelTimer) {\n window && window.clearTimeout(this.controlPanelTimer);\n this.controlPanelTimer = 0;\n }\n if (autoHide) {\n this.controlPanelTimer =\n window &&\n window.setTimeout(() => {\n this._hideControlBar();\n }, PlayerConstants.defaultControlPanelTimeout);\n }\n }\n }\n\n private _hideControlBar(): void {\n window && window.clearTimeout(this.controlPanelTimer);\n this.controlPanelTimer = 0;\n this.setState({ isControlPanelVisible: false });\n }\n\n private _onFullScreenChanged(): void {\n this.state.isInFullScreen ? this._onFullscreenExit() : this._onFullscreenEnter();\n }\n\n /**\n * Event handler for fullscreen enter.\n */\n private _onFullscreenEnter(): void {\n this.setState({\n isInFullScreen: true\n });\n }\n\n /**\n * Event handler for fullscreen exit.\n */\n private _onFullscreenExit(): void {\n this.setState({\n isInFullScreen: false\n });\n }\n\n private _toggleFullScreen(): void {\n this.state.isInFullScreen ? this._exitFullScreen() : this._enterFullScreen();\n }\n\n private _onFullscreenError(): void {\n this.setState({\n isInFullScreen: false\n });\n }\n\n private _enterFullScreen(): void {\n if (!Player._isNativeFullscreenEnabled()) {\n return;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const fullscreenElement = this.playerContainer.current! as any;\n const elementInFullScreen = Player._getElementInFullScreen();\n\n // We go to fullscreen only when there is no other element in fullscreen and browser supports fullscreen\n if (fullscreenElement && !elementInFullScreen) {\n const enterFullScreen =\n fullscreenElement.requestFullscreen ||\n fullscreenElement.msRequestFullscreen ||\n fullscreenElement.mozRequestFullScreen ||\n fullscreenElement.webkitRequestFullscreen ||\n fullscreenElement.webkitEnterFullScreen;\n\n enterFullScreen.call(fullscreenElement);\n this._updateScreenReaderElement(this.localizationHelper.getLocalizedValue('fullScreenLabel'));\n onTelemetryClick(this.props.telemetryContent!, this.payLoad, LocalizationConstants.fullScreenAriaLabel).call(this);\n }\n }\n\n private _exitFullScreen(): void {\n if (!Player._isNativeFullscreenEnabled()) {\n return;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const fullscreenElement = this.playerContainer.current! as any;\n const elementInFullScreen = Player._getElementInFullScreen();\n\n // We only call cancel if we are in fullscreen. If another element went fullscreen that took the player with it then\n // we shouldn't call cancel fullscreen\n if (fullscreenElement && fullscreenElement === elementInFullScreen) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const doc = document as any;\n const cancelFullScreen = doc.cancelFullScreen || doc.msExitFullscreen || doc.mozCancelFullScreen || doc.webkitCancelFullScreen;\n\n cancelFullScreen.call(doc);\n this._updateScreenReaderElement(this.localizationHelper.getLocalizedValue('exitFullScreenLabel'));\n onTelemetryClick(this.props.telemetryContent!, this.payLoad, LocalizationConstants.exitFullScreenAriaLabel).call(this);\n }\n }\n\n private _onVideoLoadedData(): void {\n this._updateState('ready');\n if (this.props.playerData.options.controls) {\n const position = this._getPlayPosition();\n this.setState({ playPosition: position });\n }\n }\n\n private _onTimeUpdate(): void {\n if (this.props.playerData.options.controls) {\n const position = this._getPlayPosition();\n\n // EndTime changes after playing video for certain time. Keeping this constant.\n position.endTime = this.state.playPosition.endTime;\n this.setState({ playPosition: position });\n if (this.state.playing) {\n if (this.playerState === 'buffering') {\n this._updateState('playing');\n }\n }\n }\n }\n\n private _getBufferedDuration(): number {\n let buffered = 0;\n if (this.player.current!.buffered && this.player.current!.buffered.length) {\n buffered = this.player.current!.buffered.end(this.player.current!.buffered.length - 1);\n }\n return buffered;\n }\n\n private _getPlayPosition(): IPlayPosition {\n const bufferedDuration = this._getBufferedDuration();\n return {\n currentTime: this.player.current!.currentTime,\n startTime: 0,\n endTime: this.player.current!.duration,\n bufferedDuration\n };\n }\n\n private _onProgressChange(notification: ISliderChangeNotification): void {\n let time = notification.firstThumbValue;\n const position = this._getPlayPosition();\n time = Math.max(position.startTime, Math.min(time, position.endTime));\n\n if (Math.abs(time - position.currentTime) >= PlayerConstants.defaultPositionUpdateThreshold) {\n this.player.current!.currentTime = time;\n if (this.audio.current) {\n this.audio.current.currentTime = time;\n }\n }\n }\n\n private _onTriggerClicked(): void {\n const currentPlayer = this.player.current;\n if (!this.isPlayerLoaded) {\n this._loadPlayer();\n this.player.current!.autoplay = true;\n } else if (currentPlayer!.paused) {\n this.play();\n this._updateScreenReaderElement(this.localizationHelper.getLocalizedValue('playingAriaLabel'));\n onTelemetryClick(this.props.telemetryContent!, this.payLoad, LocalizationConstants.playAriaLabel).call(this);\n if (this.videoControl.current) {\n this.videoControl.current.setFocusOnPause();\n }\n } else {\n this.pause();\n this._updateScreenReaderElement(this.localizationHelper.getLocalizedValue('pausedAriaLabel'));\n onTelemetryClick(this.props.telemetryContent!, this.payLoad, LocalizationConstants.pauseAriaLabel).call(this);\n if (this.videoControl.current) {\n this.videoControl.current.setFocusOnPlay();\n }\n }\n\n if (this.state.isTriggerEnabled) {\n this.setState({ isTriggerEnabled: false }, () => {\n setTimeout(() => {\n if (this.videoControl.current) {\n this.videoControl.current.setFocusOnPause();\n }\n }, 500);\n });\n onTelemetryClick(this.props.telemetryContent!, this.payLoad, LocalizationConstants.pauseAriaLabel).call(this);\n if (this.props.playerData.options.playFullScreen) {\n this._enterFullScreen();\n }\n }\n }\n\n private _stop(): void {\n const videoStartingTime: number = 0.1;\n if (isSafari()) {\n // Safari browser has issues with showing the poster frame of the video when ended. So setting the same to 0.1 seconds.\n this._seek(videoStartingTime);\n } else {\n this._seek(0);\n }\n\n if (this.props.playerData.options.controls) {\n this.pause();\n const playPosition = this._getPlayPosition();\n playPosition.endTime = this.state.playPosition.endTime;\n this.setState({ playPosition });\n if (this.audio.current) {\n this.audio.current.pause();\n }\n }\n }\n\n private _seek(time: number): void {\n const position = this._getPlayPosition();\n time = Math.max(position.startTime, Math.min(time, position.endTime));\n\n if (Math.abs(time - position.currentTime) >= PlayerConstants.defaultPositionUpdateThreshold) {\n this.seekFrom = position.currentTime;\n this.player.current!.currentTime = time;\n if (this.audio.current) {\n this.audio.current.currentTime = time;\n }\n }\n }\n\n /**\n * Returns the mask level style.\n * @returns Returns the mask level style.\n */\n private _getMaskLevelStyle(): string {\n let result: string = '';\n if (this.state.isTriggerEnabled) {\n const maskLevel = this.props.playerData.options.maskLevel || PlayerConstants.defaultMaskLevel;\n result = format('rgba(0,0,0,{0})', Number(maskLevel) / 100);\n }\n return result;\n }\n\n /**\n * Updates the current player state.\n * @param newState - Player state.\n */\n private _updateState(newState: PlayerStates): void {\n if (!newState || newState === this.playerState) {\n return;\n }\n\n this.playerState = newState;\n\n this._showControlsBasedOnState();\n this._showSpinnerBasedOnState();\n }\n\n /**\n * Shows or hides the spinner based on player state.\n */\n private _showSpinnerBasedOnState(): void {\n switch (this.playerState) {\n case 'ready':\n case 'playing':\n case 'paused':\n case 'ended':\n case 'stopped':\n case 'error':\n this._hideSpinner();\n break;\n default:\n this._showSpinner();\n }\n }\n\n /**\n * Shows or hides the player controls based on player state.\n */\n private _showControlsBasedOnState(): void {\n switch (this.playerState) {\n case 'error':\n case 'loading':\n case 'init':\n this._hideControlBar();\n break;\n case 'ended':\n this._showControlBar(false);\n break;\n case 'ready':\n case 'paused':\n case 'stopped':\n this._showControlBar(false);\n break;\n default:\n this._showControlBar(true);\n }\n }\n\n private _hideSpinner(): void {\n this.setState({ showSpinner: false });\n }\n\n private _showSpinner(): void {\n this.setState({ showSpinner: true });\n }\n\n /**\n * Play Trigger focus event.\n */\n private _onTriggerFocus(): void {\n this.setState({ mouseHovered: true });\n }\n\n /**\n * Play Trigger Blur event.\n */\n private _onTriggerBlur(): void {\n if (!this.state.isTriggerEnabled && this.state.playing) {\n this.setState({ mouseHovered: false });\n }\n }\n\n /**\n * Updates the screen reader element.\n * @param text - Update the screen reader element with the pased text.\n */\n private _updateScreenReaderElement(text: string): void {\n this.setState({\n screenReaderText: text\n });\n }\n\n /**\n * Avoid opening context menu on righ click.\n * @param e - Mouse Event.\n */\n private _onContextMenuClicked(e: React.MouseEvent): void {\n e.preventDefault();\n }\n\n /**\n * Check for mobile devices.\n * @returns - Return true or false.\n */\n private _isMobile(): boolean {\n if (MsDyn365.msdyn365Commerce.isBrowser) {\n const userAgent = window.navigator.userAgent;\n const isIphone = !!userAgent.match(/iphone/i);\n const isSilk = !!userAgent.match(/silk/i);\n const isWindowsPhone = !!userAgent.match(/windows phone/i);\n const isAndroid = !isWindowsPhone && (isSilk || !!userAgent.match(/android/i));\n return isIphone || isWindowsPhone || isAndroid;\n }\n return false;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { extend, IClientDimension, IDictionaryStringString, IGrid } from '../utilities';\n\n/**\n * Timed Text Markup Language (TTML).\n * See http://www.w3.org/TR/ttml1/ for more details.\n */\nexport const xmlNS = 'http://www.w3.org/XML/1998/namespace';\n\n/**\n * @interface ITtmlSettings\n * @classdesc - The ITtmlSettings interface contract.\n */\nexport interface ITtmlSettings {\n ttmlNamespace?: string;\n ttmlStyleNamespace?: string;\n ttmlParameterNamespace?: string;\n ttmlMetaNamespace?: string;\n idPrefix?: string;\n mediaFrameRate?: number;\n mediaFrameRateMultiplier?: number;\n mediaSubFrameRate?: number;\n mediaTickRate?: number;\n supportedTimeBase?: string;\n rootContainerRegionDimensions?: IClientDimension | null;\n relatedMediaObjectRegion?: IClientDimension | null;\n cellResolution?: IGrid;\n defaultRegionStyle?: IDictionaryStringString;\n fontMap?: IDictionaryStringString;\n log?: Function;\n}\n\n/**\n *\n * The TtmlSettings class.\n * The TtmlSettings class is used to pass settings between the ttml parser, the ttml context, and the outside world.\n * It supplies default values which can be overridden via overrides passed to the constructor.\n */\nexport class TtmlSettings implements ITtmlSettings {\n /**\n * @name - ttmlNamespace\n * @description - The ttml namespace to use.\n * @public\n * @type {string}\n */\n public ttmlNamespace: string = 'http://www.w3.org/ns/ttml';\n\n /**\n * @name - ttmlStyleNamespace\n * @description - The ttml style namespace to use.\n * @public\n * @type {string}\n */\n public ttmlStyleNamespace: string = 'http://www.w3.org/ns/ttml#styling';\n\n /**\n * @name - ttmlParameterNamespace\n * @description - The ttml parameter namespace to use.\n * @public\n * @type {string}\n */\n public ttmlParameterNamespace: string = 'http://www.w3.org/ns/ttml#parameter';\n\n /**\n * @name - ttmlMetaNamespace\n * @description - The ttml metadata namespace to use.\n * @public\n * @type {string}\n */\n public ttmlMetaNamespace: string = 'http://www.w3.org/ns/ttml#metadata';\n\n /**\n * @name - idPrefix\n * @description - The id prefix to use so ids copied from the ttml doc are unique.\n * @public\n * @type {string}\n */\n public idPrefix: string = '';\n\n /**\n * @name - mediaFrameRate\n * @description - The media frame rate to use.\n * @public\n * @type {number}\n */\n public mediaFrameRate: number = 30;\n\n /**\n * @name - mediaFrameRateMultiplier\n * @description - The media frame rate multiplier to use.\n * @public\n * @type {number}\n */\n public mediaFrameRateMultiplier: number = 1;\n\n /**\n * @name - mediaSubFrameRate\n * @description - The media sub frame rate to use.\n * @public\n * @type {number}\n */\n public mediaSubFrameRate: number = 1;\n\n /**\n * @name - mediaTickRate\n * @description - The media tick rate to use.\n * @public\n * @type {number}\n */\n public mediaTickRate: number = 1000;\n\n /**\n * @name - supportedTimeBase\n * @description - The support timebase value.\n * @public\n * @type {string}\n */\n public supportedTimeBase: string = 'media';\n\n /**\n * @name - rootContainerRegionDimensions\n * @description - The root container's dimensions.\n * @public\n * @type {IClientDimension}\n */\n public rootContainerRegionDimensions: IClientDimension | null = null;\n\n /**\n * @name - relatedMediaObjectRegion\n * @description - The media object's dimensions.\n * @public\n * @type {IClientDimension}\n */\n public relatedMediaObjectRegion: IClientDimension | null = null;\n\n /**\n * @name - cellResolution\n * @description - The default cell grid.\n * @public\n * @type {IGrid}\n */\n public cellResolution: IGrid = { rows: 15, columns: 32 };\n\n /**\n * @name - defaultRegionStyle\n * @description - The default region style.\n * @public\n * @type {IDictionaryStringString}\n */\n public defaultRegionStyle: IDictionaryStringString = {\n backgroundColor: 'transparent',\n color: '#E8E9EA',\n direction: 'ltr',\n display: 'auto',\n displayAlign: 'before',\n extent: 'auto',\n fontFamily: 'default',\n fontSize: '1c',\n fontStyle: 'normal',\n fontWeight: 'normal',\n lineHeight: 'normal',\n opacity: '1',\n origin: 'auto',\n overflow: 'hidden',\n padding: '0',\n showBackground: 'always',\n textAlign: 'start',\n textDecoration: 'none',\n textOutline: 'none',\n unicodeBidi: 'normal',\n visibility: 'visible',\n wrapOption: 'normal',\n writingMode: 'lrtb'\n };\n\n /**\n * @name - fontMap\n * @description - The default font map.\n * @public\n * @type {IDictionaryStringString}\n */\n public fontMap: IDictionaryStringString = {};\n\n /**\n * @name - log\n * @description - The logging function to use in debug mode.\n * @public\n * @type {Function}\n */\n public log: Function | undefined;\n\n /*\n * Constructor for the TtmlSettings class.\n */\n public constructor(settingsOverrides?: ITtmlSettings) {\n // These are from the Simple Delivery Profile\n // Per spec recommendation that default be monospace sans serif.\n this.fontMap.default = 'Lucida sans typewriter, Lucida console, Consolas';\n this.fontMap.monospaceSerif = 'Courier';\n this.fontMap.proportionalSerif = 'Times New Roman, Serif';\n this.fontMap.monospaceSansSerif = 'Lucida sans typewriter, Lucida console, Consolas';\n this.fontMap.proportionalSansSerif = 'Arial, Sans-serif';\n this.fontMap.casual = 'Verdana';\n this.fontMap.cursive = 'Zapf-Chancery, Segoe script, Cursive';\n this.fontMap.smallCaps = 'Arial, Helvetica';\n\n // These are others from the broader ttml (v1.0)\n this.fontMap.monospace = 'Lucida sans typewriter, Lucida console, Consolas';\n this.fontMap.sansSerif = 'Arial, Sans-serif';\n this.fontMap.serif = 'Times New Roman, Serif';\n\n if (settingsOverrides) {\n extend(this, settingsOverrides);\n }\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n addClass,\n css,\n extend,\n format,\n getDimensions,\n getText,\n IClientDimension,\n IDictionaryStringString,\n isNullOrWhiteSpace,\n nodeListToArray,\n trim\n} from '../utilities';\nimport { ITtmlEvent, TtmlParser } from './ttml-parser';\nimport { TtmlSettings, xmlNS } from './ttml-settings';\n\n// Timed Text Markup Language (TTML).\n// See http://www.w3.org/TR/ttml1/ for more details.\n\n/**\n * @interface ITtmlContext\n * @classdesc - The TtmlContext interface contract.\n */\nexport interface ITtmlContext {\n setOwnerDocument(ownerDocument: Document): void;\n updateRelatedMediaObjectRegion(dimensions: IClientDimension): boolean;\n resetCurrentEvents(): void;\n hasEvents(): boolean;\n updateCurrentEvents(time: number): boolean;\n getCues(time: number): HTMLElement[];\n}\n\n/**\n * @interface ITtmlTranslationResult\n * @classdesc - The ITtmlTranslationResult interface contract.\n */\ninterface ITtmlTranslationResult {\n outerNode: HTMLElement | null;\n innerNode: HTMLElement | null;\n inheritableStyleSet?: IDictionaryStringString | null;\n}\n\n/**\n * @interface ITtmlPruneResult\n * @classdesc - The ITtmlPruneResult interface contract.\n */\ninterface ITtmlPruneResult {\n prunedElement: Element;\n hasPreservedContent: boolean;\n}\n\n/**\n * The TtmlContext. An instance of this class is returned from the TttmlParser.parse() method after it parses a ttml file.\n * This context is then used by the VideoClosedCaptions object to get the captions for any play position of the video.\n */\nexport class TtmlContext implements ITtmlContext {\n /**\n * @name - lengthRegEx\n * The regular expression pattern used in ttml->css text outline conersion.\n * @static\n * @private\n * @type {RegExp}\n */\n private static readonly lengthRegEx: RegExp = /\\s*(\\d+\\.*\\d*)(.*)\\s*/;\n\n /**\n * @name - rgbaRegEx\n * The regular expression pattern used in ttml->css color conersion.\n * @static\n * @private\n * @type {RegExp}\n */\n private static readonly rgbaRegEx: RegExp = /\\s*rgba\\(\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*\\)\\s*/;\n\n /**\n * @name - TtmlNamedColorMap\n * The table used to map named ttml color values to css color values.\n * @static\n * @private\n * @type {IDictionaryStringString}\n */\n private static readonly TtmlNamedColorMap: IDictionaryStringString = {\n transparent: 'rgba(0,0,0,0)',\n black: 'rgba(0,0,0,1)',\n silver: 'rgba(192,192,192,1)',\n gray: 'rgba(128,128,128,1)',\n white: 'rgba(255,255,255,1)',\n maroon: 'rgba(128,0,0,1)',\n red: 'rgba(255,0,0,1)',\n purple: 'rgba(128,0,128,1)',\n fuchsia: 'rgba(255,0,255,1)',\n magenta: 'rgba(255,0,255,1)',\n green: 'rgba(0,128,0,1)',\n lime: 'rgba(0,255,0,1)',\n olive: 'rgba(128,128,0,1)',\n yellow: 'rgba(255,255,0,1)',\n navy: 'rgba(0,0,128,1)',\n blue: 'rgba(0,0,255,1)',\n teal: 'rgba(0,128,128,1)',\n aqua: 'rgba(0,255,255,1)',\n cyan: 'rgba(0,255,255,1)'\n };\n\n /**\n * @name - events\n * The set of all ttml events.\n * @public\n * @type {ITtmlEvent[]}\n */\n public events!: ITtmlEvent[];\n\n /**\n * @name - settings\n * The ttml settings.\n * @public\n * @type {TtmlSettings}\n */\n public settings!: TtmlSettings;\n\n /**\n * @name - styleSetCache\n * The ttml styleSet cache.\n * @public\n * @type {IDictionaryStringString[]}\n */\n public styleSetCache!: IDictionaryStringString[];\n\n /**\n * @name - rootContainerRegion\n * The root container region.\n * @public\n * @type {Element}\n */\n public rootContainerRegion!: Element;\n\n /**\n * @name - root\n * The root element.\n * @public\n * @type {Element}\n */\n public root!: Element;\n\n /**\n * @name - body\n * The body element.\n * @public\n * @type {Element}\n */\n public body!: Element;\n\n /**\n * @name - layout\n * The layout element.\n * @public\n * @type {Element}\n */\n public layout!: Element;\n\n /**\n * @name - ownerDocument\n * The owner document for this context. Used to create html elements.\n * @private\n * @type {Document}\n */\n private ownerDocument!: Document;\n\n /**\n * @name - currentEvents\n * The current set of temporally active events.\n * @private\n * @type {ITtmlEvent[]}\n */\n private currentEvents!: ITtmlEvent[];\n\n /**\n * @name - currentEventsTime\n * The time the currentEvents was populated.\n * @private\n * @type {number}\n */\n private currentEventsTime!: number;\n\n /**\n * Converts a ttml text decoration style value to a css one.\n * @param ttmlTextDecoration - The ttml value.\n * @returns - The css value.\n */\n private static _ttmlToCssTextDecoration(ttmlTextDecoration: string): string {\n let textDecoration = '';\n const parts = ttmlTextDecoration.split(/\\s+/);\n\n // Since we have no CSS for the 'no' values just replace them all with a none at the front of the list.\n for (const value of parts) {\n // eslint-disable-next-line default-case\n switch (value) {\n case 'none':\n case 'noUnderline':\n case 'noLineThrough':\n case 'noOverline':\n textDecoration = 'none';\n }\n }\n\n // Then append all the others.\n for (const value of parts) {\n switch (value) {\n case 'none':\n case 'noUnderline':\n case 'noLineThrough':\n case 'noOverline':\n break;\n case 'lineThrough':\n textDecoration += ' line-through';\n break;\n default:\n textDecoration += ` ${value}`;\n }\n }\n\n return trim(textDecoration);\n }\n\n /**\n * Converts a ttml text color style value to a css one.\n * #RRGGBB and rgb(rrr,ggg,bbb) do not need conversion and are not modified.\n * #RRGGBBAA is modified because css doesn't support it (at least as implemented in todays browsers).\n * rgba(rrr,ggg,bbb,aaa) is converted to rgba(rrr,ggg,bbb,0-1).\n * ttml namedColors are converted to rgb(rrr,ggg,bbb) in the unlikely event that their alpha (only) is overridden.\n * @param color - The ttml value.\n * @returns - The css value.\n */\n private static _ttmlToCssColor(color: string): string {\n let mappedColor = color;\n\n color = color.toLowerCase();\n\n if (color.startsWith('rgba')) {\n const parts = TtmlContext.rgbaRegEx.exec(color);\n\n if (parts && parts.length === 5) {\n const red = parts[1];\n const green = parts[2];\n const blue = parts[3];\n const alpha = Number.parseInt(parts[4], 10);\n\n mappedColor = format('rgba({0},{1},{2},{3})', red, green, blue, Math.round((alpha * 100) / 255) / 100);\n }\n } else if (color.startsWith('#') && color.length === 9) {\n const red = Number.parseInt(color.substr(1, 2), 16);\n const green = Number.parseInt(color.substr(3, 2), 16);\n const blue = Number.parseInt(color.substr(5, 2), 16);\n const alpha = Number.parseInt(color.substr(7, 2), 16);\n\n mappedColor = format('rgba({0},{1},{2},{3})', red, green, blue, Math.round((alpha * 100) / 255) / 100);\n } else if (TtmlContext.TtmlNamedColorMap[color]) {\n mappedColor = TtmlContext.TtmlNamedColorMap[color];\n }\n\n return mappedColor;\n }\n\n /**\n * Applies default styles to the element to match the ttml defaults.\n * @param element - The element to set the default styles on.\n * @returns - The specified element (for chaining).\n */\n private static _defaultStyle(element: HTMLElement): HTMLElement {\n // Set some element styles to our ttml defaults for them.\n css(element, 'background-color', TtmlContext.TtmlNamedColorMap.transparent);\n css(element, 'offset', '0');\n css(element, 'margin', '0');\n css(element, 'padding', '0');\n css(element, 'border', '0');\n return element;\n }\n\n /**\n * Set the context's owner document. It will use this to create elements during translation.\n * @param ownerDocument - The owner document for this context.\n */\n public setOwnerDocument(ownerDocument: Document): void {\n this.ownerDocument = ownerDocument;\n }\n\n /**\n * Updates the context's media object region.\n * @public\n * @param dimensions - The desired dimensions for the region.\n * @returns - True if the dimensions where changed, otherwise false.\n */\n public updateRelatedMediaObjectRegion(dimensions: IClientDimension): boolean {\n if (\n dimensions !== null &&\n (!this.settings.relatedMediaObjectRegion ||\n dimensions.width !== this.settings.relatedMediaObjectRegion.width ||\n dimensions.height !== this.settings.relatedMediaObjectRegion.height)\n ) {\n this.settings.relatedMediaObjectRegion = {\n width: dimensions.width,\n height: dimensions.height\n };\n\n return true;\n }\n\n return false;\n }\n\n /**\n * Indicates whether or not the context has events.\n * @returns - True if the context has events, otherwise false.\n */\n public hasEvents(): boolean {\n return this.events && !!this.events.length;\n }\n\n /**\n * Resets the context's currentEvents.\n */\n public resetCurrentEvents(): void {\n this.currentEvents = [];\n }\n\n /**\n * Updates the context's currentEvents if there are new events for the specified time.\n * @param time - The time to get events for.\n * @returns - True if the events for the specified time are different than the currentEvents, otherwise false.\n */\n public updateCurrentEvents(time: number): boolean {\n const timeEvents = this._getTemporallyActiveEvents(time);\n\n // As a shortcut compare lengths first.\n const currentEventsLength = this.currentEvents ? this.currentEvents.length : 0;\n const timeEventsLength = timeEvents ? timeEvents.length : 0;\n\n if (currentEventsLength !== timeEventsLength) {\n this.currentEventsTime = time;\n this.currentEvents = timeEvents;\n return true;\n }\n\n if (this.currentEvents) {\n for (let index = 0; index < currentEventsLength; index++) {\n if (this.currentEvents[index].time !== timeEvents[index].time) {\n this.currentEventsTime = time;\n this.currentEvents = timeEvents;\n return true;\n }\n }\n }\n\n return false;\n }\n\n /**\n * The set of cues that apply to the specified time.\n * @param time - The time to get cues for.\n * @returns - The set of cues for the specified time, otherwise an empty [].\n */\n public getCues(time: number): HTMLElement[] {\n let cues: HTMLElement[] = [];\n\n if (this.currentEventsTime !== time) {\n this.updateCurrentEvents(time);\n }\n\n // Find all the region elements in the TTML namespace.\n const preserveSpace = TtmlParser.getAttributeNS(this.root, 'space', xmlNS) === 'preserve';\n const regions = (this.layout ? this.layout.getElementsByTagNameNS(this.settings.ttmlNamespace, 'region') : []);\n\n for (const region of regions) {\n const regionId = TtmlParser.getAttributeNS(region, 'id', xmlNS);\n const anonymousId = region.getAttribute('data-isanonymous');\n\n if (anonymousId || regionId) {\n const translation = this._translate(region, this.settings.defaultRegionStyle, preserveSpace, time, this.translateToHtml);\n\n if (translation.outerNode && translation.innerNode) {\n const innerNode = translation.innerNode;\n const outerNode = translation.outerNode;\n\n // Create a new subtree for the body element, prune elements\n // not associated with the region, and if its not empty then\n // select it into this region by adding it to div container.\n for (const event of this.events) {\n if (event.element) {\n if (this._isInRegion(event.element, anonymousId ? '' : regionId)) {\n const pruneResult = this._prune(\n event.element,\n translation.inheritableStyleSet!,\n preserveSpace,\n time,\n this.translateToHtml\n );\n let cueBody: Element | null = pruneResult.prunedElement;\n\n if (!pruneResult.hasPreservedContent && cueBody && !trim(getText(cueBody)).length) {\n cueBody = null;\n }\n\n if (cueBody) {\n innerNode.appendChild(cueBody);\n }\n }\n }\n }\n\n const showAlways = outerNode.getAttribute('data-showBackground') === 'always';\n\n if (showAlways || innerNode.children.length) {\n if (showAlways) {\n // Just needed internally for the previous check, don't pass through on the cue.\n outerNode.removeAttribute('data-showBackground');\n }\n\n cues.push(outerNode);\n }\n }\n }\n }\n\n // If we ended up with any displayable cues add them all to the rootContainerRegion cue.\n if (cues.length) {\n const rcr = this._translate(this.rootContainerRegion, { overflow: 'hidden', padding: '0' }, false, time, this.translateToHtml);\n\n for (const cue of cues) {\n rcr.innerNode!.appendChild(cue);\n }\n\n cues = [];\n cues.push(rcr.outerNode!);\n }\n\n return cues;\n }\n\n /**\n * Get the list of temporally active events for the specified time.\n * @private\n * @param time - The time to get the active events for.\n * @returns - The set of active events for the specified time, otherwise an empty [].\n */\n private _getTemporallyActiveEvents(time: number): ITtmlEvent[] {\n return this.events.filter(event => {\n return event.element ? this._isTemporallyActive(event.element, time) : true;\n });\n }\n\n /**\n * Determines whether or not the specified element is temporally active at the specified time.\n * @param element - The element to check.\n * @param time - The time to check against.\n * @returns - True if the element is active at the specified time, otherwise false.\n */\n private _isTemporallyActive(element: Element, time: number): boolean {\n return (\n (Number.parseInt(element.getAttribute('data-time-start')!, 10) || 0) <= time &&\n time < (Number.parseInt(element.getAttribute('data-time-end')!, 10) || 0)\n );\n }\n\n /**\n * Convert a ttml element into the equivalent in another format via the supplied translator function.\n * @param element - The ttml element to translate.\n * @param inheritedStyleSet - The element's inherited style set.\n * @param preserveSpace - Indicates whether or not space should be preserved.\n * @param time - The time to translate against. Elements and styles are temporally transient.\n * @param translator - The translator function to use. Originally supported both xml/html but is always using html in MWF.\n * @returns - A ITtmlTranslationResult instance containing the translation results.\n */\n private _translate(\n element: Element,\n inheritedStyleSet: IDictionaryStringString,\n preserveSpace: boolean,\n time: number,\n translator: Function\n ): ITtmlTranslationResult {\n let translation: ITtmlTranslationResult;\n let computedStyleSet: IDictionaryStringString;\n\n if (this._isTemporallyActive(element, time)) {\n const tag = this._getTagNameEquivalent(element);\n\n computedStyleSet = this._getComputedStyleSet(element, inheritedStyleSet, tag, time);\n\n if (computedStyleSet.display !== 'none') {\n const applicableStyleSet = this._getApplicableStyleSet(computedStyleSet, tag);\n\n translation = translator(element, applicableStyleSet, preserveSpace);\n\n return {\n outerNode: translation.outerNode,\n innerNode: translation.innerNode,\n inheritableStyleSet: this._getInheritableStyleSet(computedStyleSet)\n };\n }\n }\n\n return { outerNode: null, innerNode: null, inheritableStyleSet: null };\n }\n\n /**\n * Convert a ttml element into the its equivalent html element.\n * @param element - The ttml element to translate.\n * @param applicableStyleSet - The style set applicable to this element.\n * @param preserveSpace - Indicates whether or not space should be preserved.\n * @returns - A ITtmlTranslationResult instance containing the translation results.\n */\n private readonly translateToHtml = (\n element: Element,\n applicableStyleSet: IDictionaryStringString,\n preserveSpace: boolean\n ): ITtmlTranslationResult => {\n let translation: HTMLElement;\n let innerNode: HTMLElement;\n const name = this._getTagNameEquivalent(element);\n let htmlName = '';\n let htmlClass = '';\n switch (name) {\n case 'ttml:region':\n htmlClass = 'cue ';\n\n /* Falls through */\n // break;\n case 'ttml:rootcontainerregion':\n case 'ttml:body':\n case 'ttml:div':\n htmlName = 'div';\n break;\n case 'ttml:p':\n htmlName = 'p';\n break;\n case 'ttml:span':\n htmlName = 'span';\n break;\n case 'ttml:br':\n htmlName = 'br';\n break;\n default:\n }\n\n const role = TtmlParser.getAttributeNS(element, 'role', this.settings.ttmlMetaNamespace);\n\n if (role) {\n htmlClass += ` ${role}`;\n }\n\n const agent = TtmlParser.getAttributeNS(element, 'agent', this.settings.ttmlMetaNamespace);\n\n if (agent) {\n htmlClass += ` ${agent}`;\n }\n\n // Hack until display:ruby on other elements works.\n if (role === 'x-ruby') {\n htmlName = 'ruby';\n } else if (role === 'x-rubybase') {\n htmlName = 'rb';\n } else if (role === 'x-rubytext') {\n htmlName = 'rt';\n }\n\n if (!isNullOrWhiteSpace(htmlName)) {\n translation = TtmlContext._defaultStyle(this.ownerDocument.createElement(htmlName));\n addClass(translation, trim(htmlClass));\n\n const title = TtmlParser.getAttributeNS(element, 'title', this.settings.ttmlMetaNamespace);\n\n if (title) {\n translation.setAttribute('title', title);\n }\n\n const id = TtmlParser.getAttributeNS(element, 'id', xmlNS);\n\n if (id && this.settings.idPrefix) {\n // Migrate the ttml doc id's over to the html markup.\n // Use idPrefix to ensure there are no name clases on id's already in target doc.\n translation.setAttribute('id', this.settings.idPrefix + id);\n }\n\n if (name === 'ttml:region') {\n // To get a to display properly we are actually going to need to create two nested
s\n // This is because for displayAlign to work we need a table-cell
inside a table
.\n innerNode = translation.appendChild(TtmlContext._defaultStyle(this.ownerDocument.createElement('div')));\n innerNode.setAttribute('style', 'display:table; border-spacing:0; cell-spacing:0; cell-padding:0; width:100%; height:100%');\n innerNode = innerNode.appendChild(TtmlContext._defaultStyle(this.ownerDocument.createElement('div')));\n css(innerNode, 'display', 'table-cell');\n\n // Apply the displayAlign style to inner table-cell
\n if (applicableStyleSet.displayAlign) {\n this._translateStyle(name, innerNode, { displayAlign: applicableStyleSet.displayAlign });\n\n // Then remove displayAlign from the applicableStyleSet so as not to also later apply it to the outer table
\n applicableStyleSet.displayAlign = '';\n }\n }\n\n // If we're preserving space add an inner with 'white-space: pre'.\n // This is how we implement preserving space in css and we need an inner\n // span because the 'real' span will already be setting it's css white-space\n // value to either normal or nowrap and we can't collide with that.\n if (preserveSpace && name === 'ttml:span') {\n innerNode = translation.appendChild(TtmlContext._defaultStyle(this.ownerDocument.createElement('span')));\n css(innerNode, 'white-space', 'pre');\n }\n\n // Default some css properties that we don't want to inadvertantly end up\n // inheriting values for that might cause adverse layout impacts for us.\n css(translation, 'position', 'static');\n css(translation, 'width', '100%');\n\n // Copy style from element over to html, translating into CSS as we go.\n this._translateStyle(name, translation, applicableStyleSet);\n }\n\n return { outerNode: translation!, innerNode: innerNode! ? innerNode! : translation! };\n };\n\n /**\n * Translate the ttml styles in a styleSet to their equivalent css styles and apply them to the specified html element.\n * @param tagName - The ttml element tagName. All styles do not apply to all tagNames.\n * @param element - The ttml element to translate.\n * @param applicableStyleSet - The style set applicable to this element.\n */\n private _translateStyle(tagName: string, element: HTMLElement, applicableStyleSet: IDictionaryStringString): void {\n for (const style in applicableStyleSet) {\n if (applicableStyleSet[style]) {\n this._applyStyle(element, tagName, style, applicableStyleSet[style]);\n }\n }\n }\n\n /**\n * Convert the element if it is in the region, then recurse into its contents.\n * If it ends up with no children then we dont add it to the region, we prune it.\n * @param element - The ttml element to translate.\n * @param inheritedStyleSet - The style set inherited by this element.\n * @param preserveSpace - Indicates whether or not space should be preserved.\n * @param time - The time to translate against. Elements and styles are temporally transient.\n * @param translator - The translator function to use. Originally supported both xml/html but is always using html in MWF.\n * @param [ignoreAncestors] - Specifies whether or not to ignore the element's ancestors.\n * @returns - A ITtmlPruneResult instance containing the prune results.\n */\n private _prune(\n element: Element,\n inheritedStyleSet: IDictionaryStringString,\n preserveSpace: boolean,\n time: number,\n translator: Function,\n ignoreAncestors: boolean = false\n ): ITtmlPruneResult {\n let outerNode: Element;\n let hasPreservedContent = false;\n\n let translation = this._translate(element, inheritedStyleSet, preserveSpace, time, translator);\n\n if (translation.outerNode !== null) {\n const tag = this._getTagNameEquivalent(element);\n\n outerNode = translation.outerNode;\n let innerNode = translation.innerNode;\n\n for (const child of nodeListToArray(element.childNodes)) {\n if (child.nodeType === Node.COMMENT_NODE) {\n // Do nothing.\n } else if (child.nodeType === Node.TEXT_NODE) {\n innerNode!.appendChild(document.createTextNode((child).data));\n\n if (preserveSpace && tag === 'ttml:span') {\n hasPreservedContent = true;\n }\n } else {\n let childPreserveSpace = preserveSpace;\n const spaceAttr = TtmlParser.getAttributeNS(child, 'space', xmlNS);\n\n if (spaceAttr) {\n childPreserveSpace = spaceAttr === 'preserve';\n }\n\n const pruneRecord = this._prune(\n child,\n translation.inheritableStyleSet!,\n childPreserveSpace,\n time,\n translator,\n true\n );\n\n hasPreservedContent = hasPreservedContent || pruneRecord.hasPreservedContent;\n\n if (pruneRecord.prunedElement) {\n innerNode!.appendChild(pruneRecord.prunedElement);\n }\n }\n }\n\n // Now traverse back till the body and build the corresponding structures.\n if (!ignoreAncestors) {\n let ancestor = element.parentNode;\n\n while (ancestor !== null && ancestor.nodeType === Node.ELEMENT_NODE && ancestor !== this.body) {\n translation = this._translate(ancestor, inheritedStyleSet, preserveSpace, time, translator);\n if (translation.outerNode) {\n innerNode = translation.innerNode;\n innerNode!.appendChild(outerNode);\n outerNode = translation.outerNode;\n } else {\n break;\n }\n\n ancestor = ancestor.parentNode;\n }\n }\n }\n\n return { prunedElement: outerNode!, hasPreservedContent };\n }\n\n /**\n * Build this element's ttml computed styleset.\n * This is used as the base styleSet to filter the inherited styleSet from for an element's children.\n * @param element - The ttml element to translate.\n * @param inheritedStyleSet - The styleSet inherited by this element.\n * @param tagName - The ttml element tagName. All styles do not apply to all tagNames.\n * @param time - The time to translate against. Elements and styles are temporally transient.\n * @returns - The resulting computed styleSet.\n */\n private _getComputedStyleSet(\n element: Element,\n inheritedStyleSet: IDictionaryStringString,\n tagName: string,\n time: number\n ): IDictionaryStringString {\n // Start off with a clone of the inherited styleset.\n const computedStyleSet = extend({}, inheritedStyleSet);\n\n // Iterate over this nodes ttml styles and pave them onto it's computed styleset.\n extend(computedStyleSet, this.styleSetCache[Number.parseInt(element.getAttribute('data-styleSet')!, 10)]);\n\n // Apply any temporally active style animations.\n const sets = element.getElementsByTagNameNS(this.settings.ttmlNamespace, 'set');\n\n for (const set of nodeListToArray(sets)) {\n if (this._isTemporallyActive(set, time)) {\n TtmlParser.applyInlineStyles(this.settings, computedStyleSet, set);\n }\n }\n\n if (tagName === 'ttml:p' && computedStyleSet.lineHeight === 'normal') {\n // Special case for

's with tts:lineHeight='normal'\n // This means use the largest tts:fontSize value of any\n // of it's descendant 's. Since we don't know what\n // values those might be until translateStyle we'll just\n // save them all and figure it out then.\n const fontSizes = this._appendSpanFontSizes(element, this._getInheritableStyleSet(computedStyleSet), time, '');\n\n if (fontSizes) {\n computedStyleSet['computed-lineHeight'] = fontSizes;\n }\n }\n\n return computedStyleSet;\n }\n\n /**\n * Build this tags ttml applicable styleset from the specified computed styleSet to apply only to it.\n * @param computedStyleSet - The style set inherited by this element.\n * @param tagName - The ttml element tagName. All styles do not apply to all tagNames.\n * @returns - The resulting applicable styleSet.\n */\n private _getApplicableStyleSet(computedStyleSet: IDictionaryStringString, tagName: string): IDictionaryStringString {\n const applicableStyleSet: IDictionaryStringString = {};\n\n // Special case extent to the front of the list as later processing of\n // padding will depend on it having already been set first.\n if (computedStyleSet.extent && this._isStyleApplicable(tagName, 'extent')) {\n applicableStyleSet.extent = computedStyleSet.extent;\n }\n\n // Special case color to the front of the list as later processing of\n // textOutline will depend on it having already been set first.\n if (computedStyleSet.color && this._isStyleApplicable(tagName, 'color')) {\n applicableStyleSet.color = computedStyleSet.color;\n }\n\n for (const style in computedStyleSet) {\n if (this._isStyleApplicable(tagName, style)) {\n applicableStyleSet[style] = computedStyleSet[style];\n }\n }\n\n return applicableStyleSet;\n }\n\n /**\n * Determines if the specified style applies to the specified ttml tagName.\n * NOTE: The ttml spec doesn't mention ttml:br in the styles 'applies to' sections but\n * as noted in the span section everything that applies to ttml:span also applies to ttml:br.\n * @private\n * @param tagName - The ttml element tagName. All styles do not apply to all tagNames.\n * @param style - The style to check against the tagName.\n * @returns - True if the ttml:style applies to the ttml:tag, otherwise false.\n */\n private _isStyleApplicable(tagName: string, style: string): boolean {\n switch (style) {\n case 'backgroundColor':\n case 'display':\n case 'visibility':\n return 'ttml:body ttml:div ttml:p ttml:region ttml:rootcontainerregion ttml:span ttml:br'.includes(tagName);\n\n // Technically these font styles do not apply to

s but for some reason the resulting html/css\n // for span/br doesnt compute line-height correctly if the entire containing

(div) isn't all the same...\n case 'fontFamily':\n case 'fontSize':\n case 'fontStyle':\n case 'fontWeight':\n return 'ttml:p ttml:span ttml:br'.includes(tagName);\n\n case 'color':\n case 'textDecoration':\n case 'textOutline':\n case 'wrapOption':\n return 'ttml:span ttml:br'.includes(tagName);\n\n case 'direction':\n case 'unicodeBidi':\n return 'ttml:p ttml:span ttml:br'.includes(tagName);\n\n case 'displayAlign':\n case 'opacity':\n case 'origin':\n case 'overflow':\n case 'padding':\n case 'showBackground':\n case 'writingMode':\n case 'zIndex':\n return 'ttml:region ttml:rootcontainerregion'.includes(tagName);\n\n case 'extent':\n return 'ttml:tt ttml:region ttml:rootcontainerregion'.includes(tagName);\n\n case 'computed-lineHeight':\n case 'lineHeight':\n case 'textAlign':\n return 'ttml:p'.includes(tagName);\n\n default:\n return false;\n }\n }\n\n /**\n * Filters a computed styleSet into an inheritable styleSet subset to pass on to children.\n * Not all styles are inheritable.\n * @private\n * @param computedStyleSet - The computed styleSet to filter.\n * @returns - The resulting inheritable styleSet.\n */\n private _getInheritableStyleSet(computedStyleSet: IDictionaryStringString): IDictionaryStringString {\n const inheritedStyleSet: IDictionaryStringString = {};\n\n for (const style in computedStyleSet) {\n if (computedStyleSet.hasOwnProperty(style)) {\n switch (style) {\n case 'backgroundColor':\n case 'computed-lineHeight':\n case 'display':\n case 'displayAlign':\n case 'extent':\n case 'opacity':\n case 'origin':\n case 'overflow':\n case 'padding':\n case 'showBackground':\n case 'unicodeBidi':\n case 'writingMode':\n case 'zIndex':\n break;\n default:\n inheritedStyleSet[style] = computedStyleSet[style];\n }\n }\n }\n\n return inheritedStyleSet;\n // eslint-disable-next-line max-lines\n }\n\n /**\n * Recurses through an element and it's descendants finding the font sizess of all it's 's.\n * @param element - The ttml element to translate.\n * @param inheritedStyleSet - The element's inherited styleSet.\n * @param time - The time to translate against. Elements and styles are temporally transient.\n * @param value - The list of font sizes to append to.\n * @returns - The value with any additional font sizes appended to it.\n */\n private _appendSpanFontSizes(element: Element, inheritedStyleSet: IDictionaryStringString, time: number, value: string): string {\n for (const child of nodeListToArray(element.childNodes)) {\n if (child.nodeType === Node.ELEMENT_NODE) {\n const tag = this._getTagNameEquivalent(child);\n\n if (tag === 'ttml:span') {\n const computedStyleSet = this._getComputedStyleSet(child, inheritedStyleSet, 'ttml:span', time);\n const fontSize = computedStyleSet.fontSize;\n\n if (fontSize) {\n value += (value ? ',' : '') + fontSize;\n }\n\n value = this._appendSpanFontSizes(child, this._getInheritableStyleSet(computedStyleSet), time, value);\n }\n }\n }\n\n return value;\n }\n\n /**\n * Determines whether or not the specified element is associated with the specified region.\n * Ttml defines 5 ordered rules, where the first rule satisfied is used and remaining rules are skipped.\n * @param element - The ttml element to check.\n * @param regionId - The id of the region to see if the element is associated with.\n * @returns - True if the specified element is within the specified region, otherwise false.\n */\n private _isInRegion(element: Element, regionId: string): boolean {\n // Quick test: Out of normal order, but makes following rules simpler.\n // This is a shortcut to check step #4 first\n if (!regionId) {\n return true;\n }\n\n const elemRegion = TtmlParser.getAttributeNS(element, 'region', this.settings.ttmlNamespace);\n\n // 1. If the element specifies a region attribute, then the element is\n // associated with the region referenced by that attribute;\n if (elemRegion === regionId) {\n return true;\n }\n\n if (!elemRegion) {\n // 2. If some ancestor of that element specifies a region attribute, then the element is\n // associated with the region referenced by the most immediate ancestor that specifies\n // this attribute;\n let ancestor = element.parentNode;\n\n while (ancestor !== null && ancestor.nodeType === Node.ELEMENT_NODE) {\n const id = this._getRegionId(ancestor);\n if (id) {\n return id === regionId;\n }\n ancestor = ancestor.parentNode;\n }\n\n // 3. If the element contains a descendant element that specifies a region attribute,\n // then the element is associated with the region referenced by that attribute;\n for (const node of nodeListToArray(element.getElementsByTagName('*'))) {\n if (this._getRegionId(node) === regionId) {\n return true;\n }\n }\n }\n\n // 5. The element is not associated with any region.\n return false;\n }\n\n /**\n * Gets the region id for the specified element.\n * @param element - The ttml element to check.\n * @returns - The id of the region the element is associated with.\n */\n private _getRegionId(element: Element): string {\n let regionId: string;\n\n if (element.nodeType === Node.ELEMENT_NODE && element.namespaceURI === this.settings.ttmlNamespace) {\n if (TtmlParser.getLocalTagName(element) === 'region') {\n regionId = TtmlParser.getAttributeNS(element, 'id', xmlNS);\n } else {\n regionId = TtmlParser.getAttributeNS(element, 'region', this.settings.ttmlNamespace);\n }\n }\n\n return regionId!;\n }\n\n /**\n * Gets the tagName of the element with the current ttml namespace prepended if non-standard.\n * @param element - The ttml element to get the tagName of.\n * @returns - The tagName or '' if the namespace isn't one of the ttml ones.\n */\n private _getTagNameEquivalent(element: Element): string {\n const tagName = TtmlParser.getLocalTagName(element);\n const nameSpace = element.namespaceURI;\n\n if (nameSpace === this.settings.ttmlNamespace) {\n return `ttml:${tagName}`;\n }\n\n if (nameSpace === 'http://www.w3.org/1999/xhtml') {\n return tagName;\n }\n\n return '';\n }\n\n /**\n * Translates the ttml style/value into one or more css styles/values and applies them to the element.\n * @param element - The ttml element to apply the css style(s) too.\n * @param tagName - The ttml tagName associated with the element.\n * @param style - The ttml style name.\n * @param value - The ttml style value.\n */\n // eslint-disable-next-line complexity\n private _applyStyle(element: HTMLElement, tagName: string, style: string, value: string): void {\n let mappedValue = value;\n\n switch (style) {\n case 'color':\n case 'backgroundColor': {\n mappedValue = TtmlContext._ttmlToCssColor(value);\n css(element, style, mappedValue);\n return;\n }\n\n case 'direction':\n case 'display': {\n // No change.\n css(element, style, mappedValue);\n return;\n }\n\n case 'displayAlign': {\n // eslint-disable-next-line default-case\n switch (value) {\n case 'before':\n mappedValue = 'top';\n break;\n case 'center':\n mappedValue = 'middle';\n break;\n case 'after':\n mappedValue = 'bottom';\n }\n\n css(element, 'vertical-align', mappedValue);\n return;\n }\n\n case 'extent': {\n let width: string;\n let height: string;\n\n if (value !== 'auto') {\n // Get the individual components.\n const coords = value.split(/\\s+/);\n\n if (coords.length === 2) {\n width = this._ttmlToCssUnits(coords[0], true);\n height = this._ttmlToCssUnits(coords[1], false);\n }\n }\n\n if (!width!) {\n width = `${(this.settings.rootContainerRegionDimensions\n ? this.settings.rootContainerRegionDimensions.width\n : this.settings.relatedMediaObjectRegion!.width\n ).toString()}px`;\n height = `${(this.settings.rootContainerRegionDimensions\n ? this.settings.rootContainerRegionDimensions.height\n : this.settings.relatedMediaObjectRegion!.height\n ).toString()}px`;\n }\n\n css(element, 'position', 'absolute');\n css(element, 'width', width!);\n css(element, 'min-width', width!);\n css(element, 'max-width', width!);\n css(element, 'height', height!);\n css(element, 'min-height', height!);\n css(element, 'max-height', height!);\n return;\n }\n\n case 'fontFamily': {\n if (this.settings.fontMap && this.settings.fontMap[value]) {\n mappedValue = this.settings.fontMap[value];\n }\n\n if (value === 'smallCaps') {\n // Need to additionally add font-variant: small-caps.\n css(element, 'fontVariant', 'small-caps');\n }\n\n css(element, style, mappedValue);\n return;\n }\n\n case 'fontSize': {\n const parts = value.split(/\\s+/);\n\n // For two part fontSize values we use the vertical size which is in the second part.\n const size = parts.length > 1 ? parts[1] : parts[0];\n\n // Set the fontsize scaleFactor to 75% (of cell size) to account for ascenders/descenders etc.\n mappedValue = this._ttmlToCssFontSize(size, false, 0.75, tagName === 'ttml:region');\n\n css(element, style, mappedValue);\n return;\n }\n\n case 'fontStyle':\n case 'fontWeight': {\n // No change.\n css(element, style, mappedValue);\n return;\n }\n\n case 'lineHeight': {\n // Spec doesn't qualify what % lengths mean so I'm going to assume it's % of a\n // cell and therefore use fontSize conversion method.\n mappedValue = value === 'normal' ? value : this._ttmlToCssFontSize(value, false);\n\n css(element, 'line-height', mappedValue);\n return;\n }\n\n case 'computed-lineHeight': {\n const values = value.split(',');\n let max = -1;\n\n for (const fontSize of values) {\n // Computed-lineHeight is based off of fontSize so use fontSize conversion method.\n mappedValue = this._ttmlToCssFontSize(fontSize, false);\n\n if (mappedValue && mappedValue.indexOf('px') === mappedValue.length - 2) {\n const height = Number.parseFloat(mappedValue.substr(0, mappedValue.length - 2));\n\n if (!isNaN(height) && height > max) {\n max = height;\n }\n }\n }\n\n if (max >= 0) {\n css(element, 'line-height', `${max}px`);\n }\n\n return;\n }\n\n case 'origin': {\n if (value !== 'auto') {\n // Get the individual components.\n const coords = value.split(/\\s+/);\n\n if (coords.length === 2) {\n css(element, 'position', 'absolute');\n css(element, 'left', this._ttmlToCssUnits(coords[0], true));\n css(element, 'top', this._ttmlToCssUnits(coords[1], false));\n }\n }\n\n return;\n }\n\n case 'opacity': {\n // No change.\n css(element, style, mappedValue);\n return;\n }\n\n case 'padding': {\n const contextRect = getDimensions(element);\n\n // Get the individual components.\n const parts = value.split(/\\s+/);\n let first: string;\n let second: string;\n let third: string;\n let forth: string;\n\n // eslint-disable-next-line default-case\n switch (parts.length) {\n case 1:\n // Value is used for all 4 sides.\n first = this._ttmlToCssUnits(parts[0], false, contextRect!);\n second = this._ttmlToCssUnits(parts[0], true, contextRect!);\n mappedValue = format('{0} {1} {0} {1}', first, second);\n break;\n case 2:\n // First is top/bottom, second is left/right.\n first = this._ttmlToCssUnits(parts[0], false, contextRect!);\n second = this._ttmlToCssUnits(parts[1], true, contextRect!);\n mappedValue = format('{0} {1} {0} {1}', first, second);\n break;\n case 3:\n // First is top, second is left/right, third is bottom.\n first = this._ttmlToCssUnits(parts[0], false, contextRect!);\n second = this._ttmlToCssUnits(parts[1], true, contextRect!);\n third = this._ttmlToCssUnits(parts[2], false, contextRect!);\n mappedValue = format('{0} {1} {2} {1}', first, second, third);\n break;\n case 4:\n // Top, right, bottom, left.\n first = this._ttmlToCssUnits(parts[0], false, contextRect!);\n second = this._ttmlToCssUnits(parts[1], true, contextRect!);\n third = this._ttmlToCssUnits(parts[2], false, contextRect!);\n forth = this._ttmlToCssUnits(parts[3], true, contextRect!);\n mappedValue = format('{0} {1} {2} {3}', first, second, third, forth);\n }\n\n // Using border width to implement tts:padding as neither padding nor margin fix the size (height) of the content area.\n css(element, 'box-sizing', 'border-box');\n\n // TODO: See if we work in FF without the following commented out -moz-box-sizing line now and if so remove it.\n /// /// css(element, '-moz-box-sizing', 'border-box');\n css(element, 'border-style', 'solid');\n css(element, 'border-color', 'transparent');\n\n // It can be helpful when debugging to change the border-color from transparent to something like rgba(255,255,200,0.5)\n // css(element, 'border-color', 'rgba(255,255,200,0.5)');\n css(element, 'border-width', mappedValue);\n return;\n }\n\n // If you know what this was for please document it here and uncomment it.\n // As of now the caller appeared to be doing nothing with it so commenting it out.\n /// /// case 'showBackground': {\n /// /// return this.getAttribute('data-showBackground', value);\n /// /// }\n\n case 'textAlign': {\n // eslint-disable-next-line default-case\n switch (value) {\n case 'start':\n mappedValue = 'left'; // TODO: handle rtl correctly.\n break;\n case 'end':\n mappedValue = 'right'; // TODO: handle rtl correctly.\n }\n\n css(element, 'text-align', mappedValue);\n return;\n }\n\n case 'textDecoration': {\n mappedValue = TtmlContext._ttmlToCssTextDecoration(value);\n css(element, 'text-decoration', mappedValue);\n return;\n }\n\n case 'textOutline': {\n const defaultColor = css(element, 'color');\n css(element, 'text-shadow', this._ttmlToCssTextOutline(mappedValue, defaultColor));\n return;\n }\n\n case 'unicodeBidi': {\n // TODO: Handle multiple options correctly.\n // eslint-disable-next-line default-case\n switch (value) {\n case 'bidiOverride':\n mappedValue = 'bidi-override';\n }\n css(element, 'unicode-bidi', mappedValue);\n return;\n }\n\n case 'visibility': {\n // No change.\n css(element, style, mappedValue);\n return;\n }\n\n case 'writingMode': {\n // eslint-disable-next-line default-case\n switch (value) {\n case 'lr':\n case 'lrtb': {\n css(element, 'writing-mode', 'horizontal-tb'); // CCS3 standard: Doesn't work yet\n css(element, '-webkit-writing-mode', 'horizontal-tb'); // Webkit for Chrome\n css(element, 'writing-mode', 'lr-tb'); // IE specific\n return;\n }\n case 'rl':\n case 'rltb': {\n css(element, 'writing-mode', 'horizontal-tb'); // CCS3 standard: Doesn't work yet\n css(element, '-webkit-writing-mode', 'horizontal-tb'); // Webkit for Chrome\n css(element, 'writing-mode', 'rl-tb'); // IE specific\n return;\n }\n case 'tblr': {\n css(element, 'text-orientation', 'upright'); // CCS3 standard: Doesn't work yet\n css(element, 'writing-mode', 'vertical-lr'); // CCS3 standard: Doesn't work yet\n css(element, '-webkit-text-orientation', 'upright'); // Webkit for Chrome\n css(element, '-webkit-writing-mode', 'vertical-lr'); // Webkit for Chrome\n css(element, 'writing-mode', 'tb-lr'); // IE specific\n return;\n }\n case 'tb':\n case 'tbrl': {\n css(element, 'text-orientation', 'upright'); // CCS3 standard: Doesn't work yet\n css(element, 'writing-mode', 'vertical-rl'); // CCS3 standard: Doesn't work yet\n css(element, '-webkit-text-orientation', 'upright'); // Webkit for Chrome\n css(element, '-webkit-writing-mode', 'vertical-rl'); // Webkit for Chrome\n css(element, 'writing-mode', 'tb-rl'); // IE specific\n return;\n }\n }\n return;\n }\n\n case 'wrapOption': {\n css(element, 'white-space', value === 'noWrap' ? 'nowrap' : value === 'pre' ? 'pre' : 'normal');\n return;\n }\n\n case 'zIndex': {\n css(element, style, mappedValue); // Requires global information...\n return;\n }\n\n default: {\n css(element, style, mappedValue);\n }\n }\n }\n\n /**\n * Converts a ttml unit string to a css one.\n * @param ttmlUnits - The ttml value.\n * @param width - Indicates whether to perform a width based or a height based conversion.\n * @param [contextRect] - The context rectangle to use for conversion.\n * @returns - The css value.\n */\n private _ttmlToCssUnits(ttmlUnits: string, width: boolean, contextRect?: IClientDimension): string {\n let cssUnits = ttmlUnits;\n\n if (ttmlUnits) {\n const unit = ttmlUnits.charAt(ttmlUnits.length - 1);\n\n // Need to special case handle ttml cell metrics.\n if (unit === 'c' || unit === '%') {\n const container = this.settings.rootContainerRegionDimensions\n ? this.settings.rootContainerRegionDimensions\n : this.settings.relatedMediaObjectRegion;\n const length = Number.parseFloat(ttmlUnits.substr(0, ttmlUnits.length - 1));\n let containerSize = width ? container!.width : container!.height;\n let value: number;\n\n if (unit === 'c') {\n const gridSize = width ? this.settings.cellResolution.columns : this.settings.cellResolution.rows;\n\n value = (length * containerSize) / gridSize;\n } else if (unit === '%') {\n // If % units calls also specify a contextRect use that instead of the container.\n if (contextRect) {\n containerSize = width ? contextRect.width : contextRect.height;\n }\n\n // Have to convert % to px because padding and vertical-align (displayAlign) are not\n // working together if the extent width/height are % instead of px.\n value = (containerSize * length) / 100;\n }\n\n // Round to 1 decimal place\n value = Math.round(value! * 10) / 10;\n cssUnits = `${value}px`;\n }\n }\n\n return cssUnits;\n }\n\n /**\n * Converts a ttml font size to a css one.\n * @param ttmlUnits - The ttml value.\n * @param width - Indicates whether to perform a width based or a height based conversion.\n * @param [scaleFactor] - The scale factor to use for conversion.\n * @param [isRegion] - Indicates whether or not the conversion is being done for a .\n * @returns - The css value.\n */\n private _ttmlToCssFontSize(ttmlUnits: string, width: boolean, scaleFactor: number = 1, isRegion: boolean = false): string {\n let cssUnits = ttmlUnits;\n\n if (ttmlUnits) {\n const unit = ttmlUnits.charAt(ttmlUnits.length - 1);\n\n // Need to special case handle ttml cell metrics and % units.\n if (unit === 'c' || (isRegion && unit === '%')) {\n const container = this.settings.rootContainerRegionDimensions\n ? this.settings.rootContainerRegionDimensions\n : this.settings.relatedMediaObjectRegion;\n const length = Number.parseFloat(ttmlUnits.substr(0, ttmlUnits.length - 1));\n const containerSize = width ? container!.width : container!.height;\n const gridSize = width ? this.settings.cellResolution.columns : this.settings.cellResolution.rows;\n let value = (length * containerSize) / gridSize;\n\n if (unit === '%') {\n // Length is % so divide by 100.\n value /= 100;\n }\n\n // Apply the scale factor and limit to one decimal place precision.\n value = Math.floor(value * scaleFactor * 10) / 10;\n\n cssUnits = `${value}px`;\n }\n }\n\n return cssUnits;\n }\n\n /**\n * Converts a ttml text outline style value to a css one.\n * @param textOutline - The ttml value.\n * @param defaultColor - Default value of the outline color.\n * @returns - The css value.\n */\n private _ttmlToCssTextOutline(textOutline: string, defaultColor: string): string {\n let textShadow = 'none';\n\n if (!isNullOrWhiteSpace(textOutline) && textOutline !== 'none') {\n let parts: string[] = textOutline.split(/\\s+/);\n let color: string = '';\n let thickness: string = '';\n let blur: string = '';\n\n if (parts.length === 1) {\n color = defaultColor;\n thickness = parts[0];\n blur = '';\n } else if (parts.length === 3) {\n color = parts[0];\n thickness = parts[1];\n blur = parts[2];\n } else if (parts.length === 2) {\n const firstChar = parts[0].charAt(0);\n\n if (firstChar >= '0' && firstChar <= '9') {\n color = defaultColor;\n thickness = parts[0];\n blur = parts[1];\n } else {\n color = parts[0];\n thickness = parts[1];\n blur = '';\n }\n }\n\n // Spec doesn't qualify what % lengths mean so I'm going to assume it's % of a cell\n // and therefore use fontSize conversion method with the same scaleFactor applied\n // to fontSize since it's the font that we're outlining here.\n blur = this._ttmlToCssFontSize(blur, false, 0.75);\n thickness = this._ttmlToCssFontSize(thickness, false, 0.75);\n\n parts = TtmlContext.lengthRegEx.exec(thickness);\n\n if (parts && parts.length === 3) {\n const width = Math.round(Number.parseFloat(parts[1]));\n const units = parts[2];\n\n textShadow = '';\n\n for (let x = -width; x <= width; x++) {\n for (let y = -width; y <= width; y++) {\n if (x !== 0 || y !== 0) {\n textShadow += format('{0}{4} {1}{4} {2} {3}, ', x, y, blur, TtmlContext._ttmlToCssColor(color), units);\n }\n }\n }\n\n if (textShadow) {\n textShadow = textShadow.substr(0, textShadow.length - 2);\n }\n }\n }\n\n return textShadow;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/**\n * TtmlTimeParser class.\n * @classdesc - The TtmlTimeParser class is used to parse ttml time expressions which can be absolute or relative.\n */\nexport class TtmlTimeParser {\n /**\n * @name - absoluteTimeRegex\n * Regex to parse absolute ttml times. (clock-time).\n * Hours \":\" minutes \":\" seconds ( fraction | \":\" frames ( \".\" sub-frames )? )?.\n * NOTE: (johnlemi) Our clocktime regex matches 1 or 2 digits for hours instead of 2 because even.\n * though the spec says 2 we have some existing ttml from the Office team with end attrs with 1 hour digit.\n * @static\n * @private\n * @type {string}\n */\n private static readonly absoluteTimeRegex: RegExp = /^(\\d+):(\\d{2}):(\\d{2})((\\.\\d+)|:(\\d{2,}(\\.\\d+)?))?$/;\n\n /**\n * @name - relativeTimeRegex\n * Regex to parse relative ttml times. (offset-time).\n * time-count fraction? metric.\n * @static\n * @private\n * @type {string}\n */\n private static readonly relativeTimeRegex: RegExp = /^(\\d+(\\.\\d+)?)(ms|[fhmst])$/;\n\n /**\n * @name - mediaFrameRate.\n * @description - mediaFrameRate.\n * @private\n * @type {string}\n */\n private readonly mediaFrameRate: number;\n\n /**\n * @name - mediaTickRate.\n * @description - mediaTickRate.\n * @private\n * @type {string}\n */\n private readonly mediaTickRate: number;\n\n /**\n * Constructor for the TtmlTimeParser class.\n * @param _mediaFrameRate - The ttml media frame rate.\n * @param _mediaTickRate - The ttml media tick rate.\n */\n public constructor(_mediaFrameRate: number, _mediaTickRate: number) {\n this.mediaFrameRate = _mediaFrameRate;\n this.mediaTickRate = _mediaTickRate;\n }\n\n /**\n * Parses a ttml time expression string into a number.\n * @param ttmlTime - The time expression to parse.\n * @returns - The number the time expression represents, or 0 if the exression doesn't match.\n */\n public parse(ttmlTime: string): number {\n if (!ttmlTime) {\n return 0;\n }\n\n const absoluteTime = TtmlTimeParser.absoluteTimeRegex.exec(ttmlTime);\n\n if (absoluteTime && absoluteTime.length > 3) {\n const hours = Number.parseInt(absoluteTime[1], 10) * 60 * 60;\n const minutes = Number.parseInt(absoluteTime[2], 10) * 60;\n const seconds = Number.parseInt(absoluteTime[3], 10);\n let subseconds = 0;\n\n if (absoluteTime[5]) {\n subseconds = Number.parseFloat(absoluteTime[4]) * 1000;\n }\n\n if (absoluteTime[6]) {\n subseconds = Math.round(Number.parseFloat(absoluteTime[6]) * this._getTimeUnitMultiplier('f'));\n }\n\n return (hours + minutes + seconds) * 1000 + subseconds;\n }\n\n const relativeTime = TtmlTimeParser.relativeTimeRegex.exec(ttmlTime);\n\n if (relativeTime && relativeTime.length > 3) {\n return Math.round(Number.parseFloat(relativeTime[1]) * this._getTimeUnitMultiplier(relativeTime[3]));\n }\n\n return 0;\n }\n\n /**\n * Converts a ttml time unit expression string into a multiplier number.\n * @param timeUnit - The time unit expression.\n * @returns - The multiplier value, or 0 if the unit exression doesn't match.\n */\n private _getTimeUnitMultiplier(timeUnit: string): number {\n switch (timeUnit) {\n case 'h':\n return 1000 * 60 * 60;\n case 'ms':\n return 1;\n case 'm':\n return 1000 * 60;\n case 's':\n return 1000;\n case 'f':\n return 1000 / this.mediaFrameRate;\n case 't':\n return 1000 / this.mediaTickRate;\n default:\n return 0;\n }\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { format, IDictionaryStringString, IGrid, nodeListToArray, trim } from '../utilities';\nimport { ITtmlContext, TtmlContext } from './ttml-context';\nimport { ITtmlSettings, TtmlSettings, xmlNS } from './ttml-settings';\nimport { TtmlTimeParser } from './ttml-time-parser';\n\n// Timed Text Markup Language (TTML).\n// See http://www.w3.org/TR/ttml1/ for more details.\n\n/**\n * @interface ITtmlEvent\n * @classdesc - The ITtmlEvent interface contract.\n * @export\n */\nexport interface ITtmlEvent {\n time: number;\n element?: Element;\n}\n\n/**\n * @interface ITtmlTimingBounds\n * @classdesc - The ITtmlTimingBounds interface contract.\n * @export\n */\ninterface ITtmlTimingBounds {\n start: number;\n end: number;\n}\n\n/**\n *\n * The TtmlParser class.\n *\n */\n// eslint-disable-next-line @typescript-eslint/no-extraneous-class\nexport class TtmlParser {\n /**\n * @name - mediaStart\n * Used as the start time for applyTiming when applying to the entire document.\n * @static\n * @private\n * @type {number}\n */\n private static readonly mediaStart: number = -1;\n\n /**\n * @name - mediaEnd\n * Used as the end time for applyTiming when applying to the entire document.\n * Picking a number that should always be greater than any real media end time.\n * @static\n * @private\n * @type {number}\n */\n private static readonly mediaEnd: number = 99_999_999;\n\n /**\n * Gets the local tagName of a Node.\n * @param node - The node to get the tagName of.\n * @returns - The tagName.\n */\n public static getLocalTagName(node: Node): string {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (node).localName || (node).baseName;\n }\n\n /**\n * Gets the value of a namespaced attribute. First tries element.getAttributeNS() but falls back\n * to scanning each attribute if that fails.\n * If you know which cases go into the fallback code please document it here.\n * @param element - The element to get the attribute of.\n * @param name - The attribute name.\n * @param namespace - The attribute namespace.\n * @returns - The attribute value. Or an empty string if a matching attribute is not found.\n */\n public static getAttributeNS(element: Element, name: string, namespace: string): string {\n let result = element.getAttributeNS(namespace, name);\n\n if (!result) {\n // Go through all the attributes looking for a match.\n for (const attribute of nodeListToArray(element.attributes)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((attribute).localName === name && attribute.lookupNamespaceURI((attribute).prefix) === namespace) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n result = (attribute).value;\n break;\n }\n }\n }\n\n return result!;\n }\n\n /**\n * Parses a ttml document and builds a ttmlContext instance from it.\n * @param ttmlDocument - The ttml document to parse.\n * @param settingsOverrides - The ttml settings overrides to use.\n * @returns - The resulting ttmlContext instance that can be used to get cues by time.\n */\n public static parse(ttmlDocument: XMLDocument, settingsOverrides: ITtmlSettings): ITtmlContext {\n ttmlDocument = typeof ttmlDocument === 'string' ? TtmlParser._parseXml(ttmlDocument) : ttmlDocument;\n\n const ttmlContext = new TtmlContext();\n\n // Start initializing the context.\n ttmlContext.settings = new TtmlSettings(settingsOverrides);\n ttmlContext.root = TtmlParser._verifyRoot(ttmlDocument, ttmlContext);\n ttmlContext.body = TtmlParser._getFirstElementByTagNameNS(ttmlContext.root, 'body', ttmlContext.settings.ttmlNamespace);\n ttmlContext.events = [];\n ttmlContext.styleSetCache = [];\n\n if (ttmlContext.body) {\n // Parse the root attributes.\n TtmlParser._parseTtAttrs(ttmlContext);\n\n // Set up our regions.\n const head = TtmlParser._ensureRegions(ttmlContext);\n\n const timeBase =\n TtmlParser.getAttributeNS(ttmlContext.root, 'timeBase', ttmlContext.settings.ttmlParameterNamespace) || 'media';\n\n if (ttmlContext.settings.supportedTimeBase.includes(timeBase)) {\n // Process textnodes into anonymous spans.\n TtmlParser._processAnonymousSpans(ttmlContext, ttmlContext.body);\n\n const timeParser = new TtmlTimeParser(ttmlContext.settings.mediaFrameRate, ttmlContext.settings.mediaTickRate);\n\n // Apply the intervals over the tree.\n TtmlParser._applyTiming(\n ttmlContext,\n ttmlContext.root,\n { start: TtmlParser.mediaStart, end: TtmlParser.mediaEnd },\n true,\n timeParser\n );\n\n // Apply the style inheritance over the tree.\n TtmlParser._applyStyling(ttmlContext, head);\n }\n\n // Add an dummy end event for the captions to appear until end of video.\n // Not sure why we need to do this, please add to this comment if you know.\n ttmlContext.events.push({ time: TtmlParser.mediaEnd, element: undefined });\n\n // Sort events into temporal order.\n ttmlContext.events.sort((event1: ITtmlEvent, event2: ITtmlEvent) => {\n return event1.time - event2.time;\n });\n }\n\n return ttmlContext;\n }\n\n /**\n * Applies the elements inline styles into the styleSet.\n * @param settings - The TtmlSettings for this document.\n * @param styleSet - The styleSet to build upon.\n * @param element - The element to apply the styles of.\n */\n public static applyInlineStyles(settings: TtmlSettings, styleSet: IDictionaryStringString, element: Element): void {\n for (const attribute of nodeListToArray(element.attributes)) {\n if (attribute.namespaceURI === settings.ttmlStyleNamespace) {\n // Trim() because we see lots of ttml attribute values with trailing space...\n styleSet[TtmlParser.getLocalTagName(attribute)] = trim(attribute.nodeValue!);\n }\n }\n }\n\n /**\n * Parses an xml document in string format to an XMLDocument.\n * @param xmlString - The xml string to parse.\n * @returns - The resulting XMLDocument, or null if the xml string failed to parse.\n */\n private static _parseXml(xmlString: string): XMLDocument {\n let xml: XMLDocument;\n\n if (window.DOMParser) {\n const domParser = new window.DOMParser();\n xml = domParser.parseFromString(xmlString, 'application/xml');\n } else {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const domParser = new (window).ActiveXObject('Microsoft.XMLDOM');\n domParser.async = false;\n domParser.loadXML(xmlString);\n xml = domParser;\n }\n return xml;\n }\n\n /**\n * Verifies that root of the specified document is the expected ttml tagName and\n * updates the settings namespaces from it if they are non standard.\n * @param ttmlDocument - The ttml document to verify.\n * @param ttmlContext - The ttmlContext for this document.\n * @returns - The valid root Element, or or null if the root Element was not valid.\n */\n private static _verifyRoot(ttmlDocument: XMLDocument, ttmlContext: TtmlContext): Element {\n let root: Element;\n const candidate = ttmlDocument.documentElement;\n\n if (TtmlParser.getLocalTagName(candidate) === 'tt') {\n if (candidate.namespaceURI !== 'http://www.w3.org/ns/ttml') {\n ttmlContext.settings.ttmlNamespace = candidate.namespaceURI!;\n ttmlContext.settings.ttmlStyleNamespace = `${ttmlContext.settings.ttmlNamespace}#styling`;\n ttmlContext.settings.ttmlParameterNamespace = `${ttmlContext.settings.ttmlNamespace}#parameter`;\n ttmlContext.settings.ttmlMetaNamespace = `${ttmlContext.settings.ttmlNamespace}#metadata`;\n }\n\n root = candidate;\n }\n\n return root!;\n }\n\n /**\n * Parses the tag attributes and initializes ttmlContext properties from them.\n * @param ttmlContext - The ttmlContext for this document.\n */\n private static _parseTtAttrs(ttmlContext: TtmlContext): void {\n const cellRes = TtmlParser.getAttributeNS(ttmlContext.root, 'cellResolution', ttmlContext.settings.ttmlParameterNamespace);\n const extent = TtmlParser.getAttributeNS(ttmlContext.root, 'extent', ttmlContext.settings.ttmlStyleNamespace);\n let cellGrid: IGrid | null = null;\n\n if (cellRes) {\n const parts = trim(cellRes).split(/\\s+/);\n\n if (parts.length === 2) {\n const columns = Math.round(Number.parseFloat(parts[0]));\n const rows = Math.round(Number.parseFloat(parts[1]));\n\n if (rows > 0 && columns > 0) {\n cellGrid = { rows, columns };\n }\n }\n }\n\n if (cellGrid) {\n ttmlContext.settings.cellResolution = cellGrid;\n }\n\n if (extent) {\n if (extent !== 'auto') {\n // Get the individual components.\n const coords = extent.split(/\\s+/);\n\n if (\n coords.length === 2 &&\n coords[0].substr(coords[0].length - 2) === 'px' &&\n coords[1].substr(coords[1].length - 2) === 'px'\n ) {\n const width = Number.parseFloat(coords[0].substr(0, coords[0].length - 2));\n const height = Number.parseFloat(coords[1].substr(0, coords[1].length - 2));\n\n // Round to integer.\n ttmlContext.settings.rootContainerRegionDimensions = { width: Math.round(width), height: Math.round(height) };\n }\n }\n }\n }\n\n /**\n * Ensures we have the elements/regions we require by either finding them or creating them if they are not present.\n * @param ttmlContext - The ttmlContext for this document.\n * @returns - The element.\n */\n private static _ensureRegions(ttmlContext: TtmlContext): Element {\n // Create our rootContainerRegion\n ttmlContext.rootContainerRegion = ttmlContext.root.ownerDocument.createElementNS(\n ttmlContext.settings.ttmlNamespace,\n 'rootcontainerregion'\n );\n\n ttmlContext.root.appendChild(ttmlContext.rootContainerRegion);\n\n const extents = ttmlContext.settings.rootContainerRegionDimensions\n ? format(\n '{0}px {1}px',\n ttmlContext.settings.rootContainerRegionDimensions.width,\n ttmlContext.settings.rootContainerRegionDimensions.height\n )\n : 'auto';\n\n ttmlContext.rootContainerRegion.setAttributeNS(ttmlContext.settings.ttmlStyleNamespace, 'extent', extents);\n\n let head = TtmlParser._getFirstElementByTagNameNS(ttmlContext.root, 'head', ttmlContext.settings.ttmlNamespace);\n\n // Ensure we have a \n if (!head) {\n // No so we need to create that now.\n head = ttmlContext.root.ownerDocument.createElementNS(ttmlContext.settings.ttmlNamespace, 'head');\n ttmlContext.root.appendChild(head);\n }\n\n // Ensure we have a \n ttmlContext.layout = TtmlParser._getFirstElementByTagNameNS(head, 'layout', ttmlContext.settings.ttmlNamespace);\n\n if (!ttmlContext.layout) {\n // No so we need to create that now.\n ttmlContext.layout = ttmlContext.root.ownerDocument.createElementNS(ttmlContext.settings.ttmlNamespace, 'layout');\n ttmlContext.root.appendChild(ttmlContext.layout);\n }\n\n // Create an anonymous region if we have no regions.\n const regions = ttmlContext.layout.getElementsByTagNameNS(ttmlContext.settings.ttmlNamespace, 'region');\n\n if (!regions.length) {\n const anonymousRegion = ttmlContext.root.ownerDocument.createElementNS(ttmlContext.settings.ttmlNamespace, 'region');\n\n anonymousRegion.setAttributeNS(xmlNS, 'id', 'anonymous');\n anonymousRegion.setAttribute('data-isanonymous', '1');\n ttmlContext.layout.appendChild(anonymousRegion);\n\n ttmlContext.body.setAttributeNS(ttmlContext.settings.ttmlNamespace, 'region', 'anonymous');\n }\n\n return head;\n }\n\n /**\n * Recurses through all the

elements in the document and groups all the contiguous TEXT_NODES together into 's.\n * @param ttmlContext - The ttmlContext for this document.\n * @param element - The element to process the TEXT_NODES of.\n */\n private static _processAnonymousSpans(ttmlContext: TtmlContext, element: Element): void {\n // If this element is

then group all contiguous textnodes together in \n if (TtmlParser._isTagNS(element, 'p', ttmlContext.settings.ttmlNamespace)) {\n const textNodeGroups: Node[][] = [];\n let prevNodeType: number = 0;\n\n for (const child of nodeListToArray(element.childNodes)) {\n if (child.nodeType === Node.TEXT_NODE) {\n if (prevNodeType !== Node.TEXT_NODE) {\n textNodeGroups.push([]);\n }\n\n textNodeGroups[textNodeGroups.length - 1].push(child);\n }\n\n prevNodeType = child.nodeType;\n }\n\n for (const group of textNodeGroups) {\n const anonSpan = ttmlContext.root.ownerDocument.createElementNS(ttmlContext.settings.ttmlNamespace, 'span');\n\n anonSpan.appendChild(group[0].parentNode!.replaceChild(anonSpan, group[0]));\n\n for (let index = 1; index < group.length; index++) {\n anonSpan.appendChild(group[index]);\n }\n }\n }\n\n // Then recurse through the contents doing the same thing for those.\n for (const child of nodeListToArray(element.childNodes)) {\n this._processAnonymousSpans(ttmlContext, child);\n }\n }\n\n /**\n * Recurses through the document element tree to determine the absolute start and end times of all the elements\n * using the TTML subset of the SMIL timing model. The reference times passed in 'bound' are absolute times.\n * The result of calling this is to set the local start time and end time to absolute times between these two\n * reference times, based on the begin, end and dur attributes and to recursively set all of the children.\n * @param ttmlContext - The ttmlContext for this document.\n * @param element - The element to apply the timing to.\n * @param bound - The bounds for the timing.\n * @param isParallelContext - Indicates whether or not this element is in a parallel timing context.\n * @param timeParser - The TtmlTimeParser to use to parse this elements time attributes.\n */\n private static _applyTiming(\n ttmlContext: TtmlContext,\n element: Element,\n bound: ITtmlTimingBounds,\n isParallelContext: boolean,\n timeParser: TtmlTimeParser\n ): void {\n const beginAttribute = TtmlParser.getAttributeNS(element, 'begin', ttmlContext.settings.ttmlNamespace);\n let startTime = beginAttribute ? timeParser.parse(beginAttribute) : bound.start;\n let endTime = 0;\n\n // Compute the simple duration of the interval.\n let duration = 0;\n let end = 0;\n const durationAttribute = TtmlParser.getAttributeNS(element, 'dur', ttmlContext.settings.ttmlNamespace);\n const endAttribute = TtmlParser.getAttributeNS(element, 'end', ttmlContext.settings.ttmlNamespace);\n\n if (!durationAttribute && !endAttribute) {\n // No direct timing attested, so use default based on context.\n // Parallel children have indefinite default duration, truncated by bounds.\n if (isParallelContext) {\n // Sequential children have zero default duration.\n if (startTime <= bound.end) {\n endTime = bound.end;\n } else {\n endTime = 0;\n }\n }\n } else if (durationAttribute && endAttribute) {\n // Both duration and end attested, the minimum interval applies.\n duration = timeParser.parse(durationAttribute);\n end = timeParser.parse(endAttribute);\n const minEnd = Math.min(startTime + duration, bound.start + end);\n endTime = Math.min(minEnd, bound.end);\n } else if (endAttribute) {\n // Only end attested.\n end = timeParser.parse(endAttribute);\n endTime = Math.min(bound.start + end, bound.end);\n } else {\n // Only dur attested.\n duration = timeParser.parse(durationAttribute);\n endTime = Math.min(startTime + duration, bound.end);\n }\n\n if (endTime < startTime) {\n endTime = startTime;\n }\n\n startTime = Math.floor(startTime);\n endTime = Math.floor(endTime);\n\n element.setAttribute('data-time-start', startTime.toString());\n element.setAttribute('data-time-end', endTime.toString());\n\n if (\n startTime >= 0 &&\n ttmlContext.events.filter(event => {\n return event.time === startTime;\n }).length <= 0\n ) {\n ttmlContext.events.push({ time: startTime, element });\n }\n\n let start = startTime;\n\n for (const child of nodeListToArray(element.childNodes)) {\n if (child.nodeType === Node.ELEMENT_NODE) {\n // Parallel is the default so null is OK here.\n if (TtmlParser.getAttributeNS(element, 'timeContainer', ttmlContext.settings.ttmlNamespace) !== 'seq') {\n this._applyTiming(ttmlContext, child, { start: startTime, end: endTime }, true, timeParser);\n } else {\n this._applyTiming(ttmlContext, child, { start, end: endTime }, false, timeParser);\n start = Number.parseInt(child.getAttribute('data-time-end')!, 10);\n }\n }\n }\n }\n\n /**\n * Recurses through all the elements in applying the ttml sytling to them based on the