bitmovin-player 8.280.0 → 8.281.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bitmovinplayer-serviceworker.js +2 -2
- package/bitmovinplayer-serviceworker.prod.js +2 -2
- package/bitmovinplayer-ui.js +1 -1
- package/bitmovinplayer.js +2 -2
- package/bitmovinplayer.prod.js +2 -2
- package/modules/bitmovinplayer-abr.js +2 -2
- package/modules/bitmovinplayer-abr.prod.js +2 -2
- package/modules/bitmovinplayer-advertising-bitmovin.js +2 -2
- package/modules/bitmovinplayer-advertising-bitmovin.prod.js +2 -2
- package/modules/bitmovinplayer-advertising-core.js +2 -2
- package/modules/bitmovinplayer-advertising-core.prod.js +2 -2
- package/modules/bitmovinplayer-advertising-ima.js +2 -2
- package/modules/bitmovinplayer-advertising-ima.prod.js +2 -2
- package/modules/bitmovinplayer-advertising-omsdk.js +2 -2
- package/modules/bitmovinplayer-advertising-omsdk.prod.js +2 -2
- package/modules/bitmovinplayer-analytics.js +2 -2
- package/modules/bitmovinplayer-analytics.prod.js +2 -2
- package/modules/bitmovinplayer-container-mp4.js +2 -2
- package/modules/bitmovinplayer-container-mp4.prod.js +2 -2
- package/modules/bitmovinplayer-container-ts.js +2 -2
- package/modules/bitmovinplayer-container-ts.prod.js +2 -2
- package/modules/bitmovinplayer-container-webm.js +2 -2
- package/modules/bitmovinplayer-container-webm.prod.js +2 -2
- package/modules/bitmovinplayer-core.js +2 -2
- package/modules/bitmovinplayer-core.prod.js +2 -2
- package/modules/bitmovinplayer-crypto.js +2 -2
- package/modules/bitmovinplayer-crypto.prod.js +2 -2
- package/modules/bitmovinplayer-dash.js +2 -2
- package/modules/bitmovinplayer-dash.prod.js +2 -2
- package/modules/bitmovinplayer-drm.js +2 -2
- package/modules/bitmovinplayer-drm.prod.js +2 -2
- package/modules/bitmovinplayer-engine-bitmovin.js +2 -2
- package/modules/bitmovinplayer-engine-bitmovin.prod.js +2 -2
- package/modules/bitmovinplayer-engine-native.js +2 -2
- package/modules/bitmovinplayer-engine-native.prod.js +2 -2
- package/modules/bitmovinplayer-engine-webrtc.js +2 -2
- package/modules/bitmovinplayer-engine-webrtc.prod.js +2 -2
- package/modules/bitmovinplayer-envivio.js +1 -1
- package/modules/bitmovinplayer-envivio.prod.js +1 -1
- package/modules/bitmovinplayer-hls.js +2 -2
- package/modules/bitmovinplayer-hls.prod.js +2 -2
- package/modules/bitmovinplayer-lowlatency.js +2 -2
- package/modules/bitmovinplayer-lowlatency.prod.js +2 -2
- package/modules/bitmovinplayer-mserenderer.js +2 -2
- package/modules/bitmovinplayer-mserenderer.prod.js +2 -2
- package/modules/bitmovinplayer-patch.js +1 -1
- package/modules/bitmovinplayer-patch.prod.js +1 -1
- package/modules/bitmovinplayer-playstation4.js +2 -2
- package/modules/bitmovinplayer-playstation4.prod.js +2 -2
- package/modules/bitmovinplayer-playstation5.js +2 -2
- package/modules/bitmovinplayer-playstation5.prod.js +2 -2
- package/modules/bitmovinplayer-polyfill.js +1 -1
- package/modules/bitmovinplayer-polyfill.prod.js +1 -1
- package/modules/bitmovinplayer-reactnative.js +1 -1
- package/modules/bitmovinplayer-reactnative.prod.js +1 -1
- package/modules/bitmovinplayer-remotecontrol.js +2 -2
- package/modules/bitmovinplayer-remotecontrol.prod.js +2 -2
- package/modules/bitmovinplayer-serviceworker-client.js +2 -2
- package/modules/bitmovinplayer-serviceworker-client.prod.js +2 -2
- package/modules/bitmovinplayer-serviceworker.js +2 -2
- package/modules/bitmovinplayer-serviceworker.prod.js +2 -2
- package/modules/bitmovinplayer-sgai.js +2 -2
- package/modules/bitmovinplayer-sgai.prod.js +2 -2
- package/modules/bitmovinplayer-smooth.js +2 -2
- package/modules/bitmovinplayer-smooth.prod.js +2 -2
- package/modules/bitmovinplayer-style.js +2 -2
- package/modules/bitmovinplayer-style.prod.js +2 -2
- package/modules/bitmovinplayer-subtitles-cea608.js +2 -2
- package/modules/bitmovinplayer-subtitles-cea608.prod.js +2 -2
- package/modules/bitmovinplayer-subtitles-native.js +2 -2
- package/modules/bitmovinplayer-subtitles-native.prod.js +2 -2
- package/modules/bitmovinplayer-subtitles-ttml.js +2 -2
- package/modules/bitmovinplayer-subtitles-ttml.prod.js +2 -2
- package/modules/bitmovinplayer-subtitles-vtt.js +2 -2
- package/modules/bitmovinplayer-subtitles-vtt.prod.js +2 -2
- package/modules/bitmovinplayer-subtitles.js +2 -2
- package/modules/bitmovinplayer-subtitles.prod.js +2 -2
- package/modules/bitmovinplayer-thumbnail-imp.js +2 -2
- package/modules/bitmovinplayer-thumbnail-imp.prod.js +2 -2
- package/modules/bitmovinplayer-thumbnail.js +2 -2
- package/modules/bitmovinplayer-thumbnail.prod.js +2 -2
- package/modules/bitmovinplayer-tizen.js +2 -2
- package/modules/bitmovinplayer-tizen.prod.js +2 -2
- package/modules/bitmovinplayer-ui.js +2 -2
- package/modules/bitmovinplayer-ui.prod.js +2 -2
- package/modules/bitmovinplayer-vidaa.js +2 -2
- package/modules/bitmovinplayer-vidaa.prod.js +2 -2
- package/modules/bitmovinplayer-vr.js +2 -2
- package/modules/bitmovinplayer-vr.prod.js +2 -2
- package/modules/bitmovinplayer-webos.js +2 -2
- package/modules/bitmovinplayer-webos.prod.js +2 -2
- package/modules/bitmovinplayer-wpe.js +2 -2
- package/modules/bitmovinplayer-wpe.prod.js +2 -2
- package/modules/bitmovinplayer-xml.js +1 -1
- package/modules/bitmovinplayer-xml.prod.js +1 -1
- package/package.json +1 -1
- package/types/advertising/API.d.ts +9 -0
- package/types/advertising/ConfigAPI.d.ts +6 -5
- package/types/core/BufferSettings.d.ts +58 -0
- package/types/core/LogLevels.d.ts +54 -0
- package/types/core/Logger.d.ts +51 -0
- package/types/core/Settings.d.ts +856 -0
- package/types/core/network/ManifestMimeType.d.ts +5 -0
- package/types/core/util/MimeTypeHelper.d.ts +52 -0
- package/types/sgai/SgaiConfigAPI.d.ts +1 -1
- package/types/sgai/SgaiErrorCode.d.ts +6 -1
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
* This software includes open-source components. See THIRD_PARTY_NOTICES
|
|
10
10
|
* in the distribution for details.
|
|
11
11
|
*
|
|
12
|
-
* Bitmovin Player Version 8.
|
|
12
|
+
* Bitmovin Player Version 8.281.0
|
|
13
13
|
*
|
|
14
14
|
****************************************************************************/
|
|
15
15
|
|
|
16
16
|
(function() {
|
|
17
|
-
"use strict";!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["subtitles-ttml"]=e():(t.bitmovin=t.bitmovin||{},t.bitmovin.player=t.bitmovin.player||{},t.bitmovin.player["subtitles-ttml"]=e())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[840],{90942:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.TTMLSubtitlesModuleDefinition=void 0;var r=n(62756),i=n(95021);e.TTMLSubtitlesModuleDefinition={name:r.ModuleName.SubtitlesTTML,module:function(){return{TTMLParser:i.TTMLParser}},dependencies:[r.ModuleName.Subtitles]},e.default=e.TTMLSubtitlesModuleDefinition},95021:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.TTMLParser=void 0;var r=n(76444),i=n(31207),o=function(){function t(t){this.iq=t}return t.prototype.parse=function(t,e){var n=this;void 0===e&&(e=0);var o=/xmlns:(\S+)="http:\/\/www.w3.org\/ns\/ttml"/.exec(t),a=null!=o?t.replace(new RegExp("(<[/]?)(".concat(o[1],":)([\\s\\S]+?>)"),"g"),"$1$3"):t,u=(new DOMParser).parseFromString(a,"application/xml"),l=(0,r.getFirstElementByTagName)(u,"tt"),s=(0,r.getFirstElementByTagName)(l,"body");if(!l||!s)return[];e&&!isNaN(e)||(e=0);var c=(0,r.extractImages)(l),f=(0,i.getStylingInfo)(l),p=(0,r.getLayoutInfo)(l),g=(0,i.parseBodyStyle)(s,f);return(0,r.splitUpTimedElements)(s).map(function(t){return(0,i.applyStyling)(t,f,c,t.element),(0,r.redistributeLineBreaks)(t.element),(0,i.applyBodyStyle)(t,g),(0,r.getSubtitleCue)({timedElement:t,layouts:p,baseOffset:e,styles:f},n.iq.logger)})},t}();e.TTMLParser=o},32148:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.parseAttributes=function(t){var e=new Map;return(0,i.iterableToArray)(t.attributes).forEach(function(t){return e.set(o(t),t.value)}),e},e.getQualifiedAttributeName=function(t,e){var n=(0,i.iterableToArray)(t).find(function(t){return function(t){return null!=t.localName?t.localName:null!=t.name?o(t):""}(t)===e});return n?n.name:""},e.processAttribute=function(t,e,n,i){var o=n.includes("-")?(0,r.kebabCaseToCamelCase)(n):n,a=t.get(o);if(void 0!==a){var u=i(a);!u||"string"==typeof u&&""===u||e.set(n,u)}};var r=n(20649),i=n(76444);function o(t){var e=t.name;return e.includes(":")?e.split(":")[1]:e}},76444:function(t,e,n){var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},r.apply(this,arguments)},i=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.LayoutStyleProperties=e.LayoutInfoEntryKeys=void 0,e.iterableToArray=p,e.redistributeLineBreaks=function t(e){var n=p(e.children),r=n.filter(function(t){return"br"===t.tagName}),i=n.filter(function(t){return"span"===t.tagName});if(r.length>0&&i.length>0){var o=0;for(r.forEach(function(t){var e;return null===(e=t.parentElement)||void 0===e?void 0:e.removeChild(t)});r.length>0;){var a=r.shift();if(a&&(i[o].nextSibling?e.insertBefore(a,i[o].nextSibling):e.appendChild(a)),++o>=i.length)break}r.forEach(function(t){return e.appendChild(t)})}n.forEach(t)},e.getSubtitleCue=function(t,e){var n,r,i=t.timedElement,a=t.layouts,s=t.baseOffset,f=t.styles,p=i.end?m(i.end):NaN,v=i.dur?m(i.dur):NaN,y=i.begin?m(i.begin):NaN,T=b(i.element),h=function(t,e,n){var r=Boolean(t)&&n.has(t),i=n.get(t),a=(r&&i instanceof Map?function(t){var e=t.get(o.StyleIds);return Array.isArray(e)?e:[]}(i):[]).map(function(t){return(0,c.getCSSFromStyleID)(t,e)}).join("");return a+(i&&i instanceof Map?d(i):"")+(r&&i instanceof Map?g(i):"")}(T,f,a),S=y+s,A=isFinite(p)?p+s:S+v,E=u.ModuleManager.get(l.ModuleName.Subtitles).HtmlTransformer.htmlToText,L=(T?function(t){var e;return t.innerHTML?t.innerHTML:t.parentNode&&null!==(e=t.parentNode.innerHTML)&&void 0!==e?e:""}(i.element):function(t){var e;return null!==(e=t.outerHTML)&&void 0!==e?e:""}(i.element)).replace(/<br><\/br>/g,"<br>").replace(/[\r\n]+\s*/g,""),M={start:S,end:A,text:L?E(L):null!==(r=null===(n=i.element.textContent)||void 0===n?void 0:n.trim())&&void 0!==r?r:"",region:T,regionStyle:h,html:L};return i.backgroundImageSource&&(M.image=i.backgroundImageSource),M},e.extractLayoutStylesCss=g,e.extractLayoutPositionStylesCss=d,e.extractImages=function(t){var e=h(t,"head"),n=h(e,"metadata");return n?p(n.getElementsByTagNameNS("*","image")).filter(function(t){var e;return t.hasAttribute("xml:id")&&(null===(e=t.prefix)||void 0===e?void 0:e.includes("smpte"))}).map(function(t){var e,n,r,i;return{mimeType:null!==(n=null===(e=t.getAttribute("imagetype"))||void 0===e?void 0:e.toLowerCase())&&void 0!==n?n:"png",id:"#"+t.getAttribute("xml:id"),base64:null!==(i=null===(r=t.textContent)||void 0===r?void 0:r.trim())&&void 0!==i?i:""}}):[]},e.getLayoutInfo=function(t){var e=new Map;if(!t)return e;var n=(0,s.parseAttributes)(t),u=r({},f),l=h(t,"head"),g=h(l,"layout"),d=g?p(g.getElementsByTagName("region")):[];if(!d||0===d.length)return e.set("cellResolutionRows",u.rows),e.set("cellResolutionColumns",u.columns),e;var m=n.get("cellResolution");if(m){var b=m.split(" "),y=parseInt(b[0],10),T=parseInt(b[1],10);isFinite(y)&&y>0&&(u.columns=y),isFinite(T)&&T>0&&(u.rows=T)}var S=h(l,"styling"),A=S?p(S.getElementsByTagName("style")):[];return d.forEach(function(t){var n=t.getAttribute("xml:id")||t.getAttribute("id");n&&e.set(n,function(t,e,n){var r=new Map,u=(0,s.parseAttributes)(t);if(r.set(o.CellResolutionRows,e.rows),r.set(o.CellResolutionColumns,e.columns),u.has("style")){var l=u.get("style"),f=l?l.split(" "):[];r.set(o.StyleIds,f),function(t,e){var n=t.get(o.StyleIds);function r(e,n){if((e.getAttribute("xml:id")||e.getAttribute("id"))===n){v(e.getAttribute("tts:origin"),e.getAttribute("tts:extent"),t);var r=(0,s.parseAttributes)(e);Object.values(a).forEach(function(e){(0,s.processAttribute)(r,t,e,function(t){return t})})}}n&&(Array.isArray(n)?n.forEach(function(t){e.forEach(function(e){return r(e,t)})}):e.forEach(function(t){return r(t,n)}))}(r,n)}return function(t,e,n){var r=t.getElementsByTagName("style");r.length&&(p(r).forEach(function(t){(0,s.parseAttributes)(t).forEach(function(t,e){n.set(e,t)})}),i(i([],c.COLOR_STYLE_ATTRIBUTES,!0),c.BASE_STYLE_ATTRIBUTES,!0).forEach(function(t){(0,s.processAttribute)(n,e,t,function(t){return t})}))}(t,r,u),v(u.get("origin"),u.get("extent"),r),Object.values(a).forEach(function(t){(0,s.processAttribute)(u,r,t,function(t){return t})}),r}(t,u,A))}),e},e.splitUpTimedElements=function(t){if(!t||t.children.length<1)return[];var e=u.ModuleManager.get(l.ModuleName.Subtitles).createHtmlElement;return y(t).map(function(n){var r=e("div"),i=(0,s.parseAttributes)(n),o=function(t,e){for(var n=[],r=t,i=function(t){return t.parentElement||t.parentNode};r&&i(r)&&i(r)!==e;)n.unshift(i(r)),r=i(r);return n}(n,t).reduce(function(t,e){return t.appendChild(e.cloneNode(!1))},r);return r.children[0]&&T(r.children[0]),o.appendChild(n),{end:i.get("end"),dur:i.get("dur"),begin:i.get("begin"),element:r.children[0]}})},e.getFirstElementByTagName=h;var o,a,u=n(88052),l=n(62756),s=n(32148),c=n(31207);!function(t){t.CellResolutionRows="cellResolutionRows",t.CellResolutionColumns="cellResolutionColumns",t.Top="top",t.Left="left",t.Width="width",t.Height="height",t.StyleIds="styleIDs"}(o||(e.LayoutInfoEntryKeys=o={})),function(t){t.DisplayAling="displayAlign",t.Padding="padding",t.WritingMode="writingMode",t.ShowBackground="showBackground",t.Overflow="overflow"}(a||(e.LayoutStyleProperties=a={}));var f={rows:15,columns:40};function p(t){for(var e=[],n=0;n<t.length;n++)e.push(t[n]);return e}function g(t){return i(i(i([],c.COLOR_STYLE_ATTRIBUTES,!0),c.BASE_STYLE_ATTRIBUTES,!0),Object.values(a),!0).filter(function(e){return t.has(e)}).map(function(e){var n=t.get(e),r=Array.isArray(n)?"":"".concat(n);return r?Object.values(c.TTMLSpecificAttributes).some(function(t){return t.toString()===e.toString()})?(0,c.getCssFromTtmlSpecificAttribute)(e,r):(0,c.getCssFromCommonAttribute)(e,r):""}).join("")}function d(t){return[o.Top,o.Left,o.Height,o.Width].map(function(e){return"".concat(e,":").concat(t.get(e),";")}).join("")}function m(t){var e=t.match(/^(\d+):(\d+):(\d+)((?:\.)(\d+)$)?/),n=e?function(t){var e=3600*parseInt(t[1]),n=60*parseInt(t[2]),r=parseInt(t[3]),i=0;return t[5]&&(i=.001*parseInt(t[5])),e+n+r+i}(e):function(t){var e=t.charAt(t.length-1);return"h"===e?3600*parseFloat(t.slice(0,-1)):"m"===e?60*parseFloat(t.slice(0,-1)):"s"===e?"m"===t.charAt(t.length-2)?parseFloat(t.slice(0,-2))/1e3:parseFloat(t.slice(0,-1)):NaN}(t);return isFinite(n)?n:-1}function b(t){var e=(0,s.parseAttributes)(t).get("region");if(e)return e;for(var n=t.children,r=0;r<n.length;r++){var i=b(n[r]);if(i)return i}return""}function v(t,e,n){if(t){var r=t.split(" ");n.set(o.Top,r[1]),n.set(o.Left,r[0])}if(e){var i=e.split(" ");n.set(o.Width,i[0]),n.set(o.Height,i[1])}}function y(t){var e=function(t){var e=(0,s.parseAttributes)(t);return e.has("begin")&&(e.has("end")||e.has("dur"))}(t),n=p(t.children).flatMap(y).filter(Boolean);return n.length>0?n:e?[t]:[]}function T(t){["begin","dur","end"].map(function(e){return(0,s.getQualifiedAttributeName)(t.attributes,e)}).filter(function(t){return Boolean(t)}).forEach(function(e){return t.removeAttribute(e)}),p(t.children).forEach(T)}function h(t,e){if(!t)return null;var n=t.getElementsByTagName(e);return n.length>0?n[0]:null}},31207:function(t,e,n){var r;Object.defineProperty(e,"__esModule",{value:!0}),e.TTMLSpecificAttributesToCSS=e.TTMLSpecificAttributes=e.COLOR_STYLE_ATTRIBUTES=e.BASE_STYLE_ATTRIBUTES=void 0,e.applyStyling=function t(e,n,r,i){void 0===i&&(i=e.element);var u=function(t,e){var n="",r=t.getAttribute("style");return r&&(n+=r.split(" ").map(function(t){return d(t,e)}).join(";").replace(/;;+/g,";")),n+=m(y(t))}(i,n);u.length>0&&i.setAttribute("style",u),(0,l.iterableToArray)(i.children).forEach(function(i){return t(e,n,r,i)}),function(t,e,n){var r=e.getAttribute("smpte:backgroundImage"),i=r?n.find(function(t){return t.id===r}):null;if(i){var u=o.ModuleManager.get(a.ModuleName.Subtitles).createHtmlElement("img"),l="data:image/".concat(i.mimeType,";base64,").concat(i.base64);u.setAttribute("style","width:100%"),u.setAttribute("src",l),t.backgroundImageSource=l,e.appendChild(u)}}(e,i,r)},e.getStylingInfo=function(t){var e=new Map,n=(0,l.getFirstElementByTagName)(t,"head"),r=(0,l.getFirstElementByTagName)(n,"styling");return r?((0,l.iterableToArray)(r.getElementsByTagName("style")).forEach(function(t){var n=t.getAttribute("xml:id")||t.getAttribute("id");n&&e.set(n,y(t))}),e):e},e.applyBodyStyle=function(t,e){if(e){var n=t.element.getAttribute("style");t.element.setAttribute("style",n?n+e:e)}},e.parseBodyStyle=function(t,e){var n=t.getAttribute("style"),r=y(t),i=n?d(n,e):"";return T(r).reduce(function(t,e){return"".concat(t).concat(e,":").concat(r.get(e),";")},i)},e.getCssFromCommonAttribute=function(t,e){return t===l.LayoutStyleProperties.Padding?"box-sizing:border-box;".concat(t,":").concat(e,";"):"".concat(t,":").concat(e,";")},e.getCssFromTtmlSpecificAttribute=function(t,n){var r=Object.values(i).find(function(e){return e===t});if(r){var o=e.TTMLSpecificAttributesToCSS[r],a=o.values[n];return o&&a?o.prefix+"".concat(o.cssProperty,":").concat(a,";"):""}return""},e.getCSSColorFromTTML=g,e.getCSSFromStyleID=d;var i,o=n(88052),a=n(62756),u=n(32148),l=n(76444),s=new RegExp("^#([0-9a-fA-F]{3,8})$"),c=16,f=5,p=9;function g(t){var e=0,n=0,r=0,i=1;if(s.test(t)){if(t.length===f)return e=parseInt(t.slice(1,2),c),n=parseInt(t.slice(2,3),c),r=parseInt(t.slice(3,4),c),i=parseInt(t.slice(4),c),"rgba(".concat(e,",").concat(n,",").concat(r,",").concat(i,")");if(t.length===p)return e=parseInt(t.slice(1,3),c),n=parseInt(t.slice(3,5),c),r=parseInt(t.slice(5,7),c),i=parseInt(t.slice(7),c),"rgba(".concat(e,",").concat(n,",").concat(r,",").concat(i,")")}return t}function d(t,e){var n=e.get(t);return n instanceof Map?m(n):n?"".concat(t,":").concat(n):""}function m(t){var e=T(t).filter(function(t){return["cellResolutionRows","cellResolutionColumns"].indexOf(t)<0}).map(function(e){return"".concat(e,":").concat(t.get(e))}).join(";");return""===e?e:"".concat(e,";")}function b(t){return t.replace(/(default)|(monospace(Sans)?Serif)/g,"monospace").replace(/(sansSerif)|(proportional(Sans)?Serif)/g,"sans-serif")}function v(t){return"wrap"===t?"break-word":"normal"}function y(t){var n=new Map,r=(0,u.parseAttributes)(t);return e.BASE_STYLE_ATTRIBUTES.forEach(function(t){(0,u.processAttribute)(r,n,t,function(t){return t})}),e.COLOR_STYLE_ATTRIBUTES.forEach(function(t){(0,u.processAttribute)(r,n,t,g)}),(0,u.processAttribute)(r,n,"font-family",b),(0,u.processAttribute)(r,n,"word-wrap",v),n}function T(t){var e=[];return t.forEach(function(t,n){return e.push(n)}),e}e.BASE_STYLE_ATTRIBUTES=["font-size","line-height","text-align","unicode-bidi","font-weight","direction","text-decoration","font-style","multiRowAlign","linePadding"],e.COLOR_STYLE_ATTRIBUTES=["color","background-color"],function(t){t.DISPLAY_ALIGN="displayAlign"}(i||(e.TTMLSpecificAttributes=i={})),e.TTMLSpecificAttributesToCSS=((r={})[i.DISPLAY_ALIGN]={prefix:"display:flex;justify-content:center;",cssProperty:"align-items",values:{before:"flex-start",center:"center",after:"flex-end"}},r)}},function(t){return function(){return t(90942)}()}])});
|
|
17
|
+
"use strict";!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["subtitles-ttml"]=e():(t.bitmovin=t.bitmovin||{},t.bitmovin.player=t.bitmovin.player||{},t.bitmovin.player["subtitles-ttml"]=e())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[840],{90942:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.TTMLSubtitlesModuleDefinition=void 0;var r=n(62756),i=n(95021);e.TTMLSubtitlesModuleDefinition={name:r.ModuleName.SubtitlesTTML,module:function(){return{TTMLParser:i.TTMLParser}},dependencies:[r.ModuleName.Subtitles]},e.default=e.TTMLSubtitlesModuleDefinition},95021:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.TTMLParser=void 0;var r=n(76444),i=n(31207),o=function(){function t(t){this.Yu=t}return t.prototype.parse=function(t,e){var n=this;void 0===e&&(e=0);var o=/xmlns:(\S+)="http:\/\/www.w3.org\/ns\/ttml"/.exec(t),a=null!=o?t.replace(new RegExp("(<[/]?)(".concat(o[1],":)([\\s\\S]+?>)"),"g"),"$1$3"):t,u=(new DOMParser).parseFromString(a,"application/xml"),l=(0,r.getFirstElementByTagName)(u,"tt"),s=(0,r.getFirstElementByTagName)(l,"body");if(!l||!s)return[];e&&!isNaN(e)||(e=0);var c=(0,r.extractImages)(l),f=(0,i.getStylingInfo)(l),p=(0,r.getLayoutInfo)(l),g=(0,i.parseBodyStyle)(s,f);return(0,r.splitUpTimedElements)(s).map(function(t){return(0,i.applyStyling)(t,f,c,t.element),(0,r.redistributeLineBreaks)(t.element),(0,i.applyBodyStyle)(t,g),(0,r.getSubtitleCue)({timedElement:t,layouts:p,baseOffset:e,styles:f},n.Yu.logger)})},t}();e.TTMLParser=o},32148:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.parseAttributes=function(t){var e=new Map;return(0,i.iterableToArray)(t.attributes).forEach(function(t){return e.set(o(t),t.value)}),e},e.getQualifiedAttributeName=function(t,e){var n=(0,i.iterableToArray)(t).find(function(t){return function(t){return null!=t.localName?t.localName:null!=t.name?o(t):""}(t)===e});return n?n.name:""},e.processAttribute=function(t,e,n,i){var o=n.includes("-")?(0,r.kebabCaseToCamelCase)(n):n,a=t.get(o);if(void 0!==a){var u=i(a);!u||"string"==typeof u&&""===u||e.set(n,u)}};var r=n(20649),i=n(76444);function o(t){var e=t.name;return e.includes(":")?e.split(":")[1]:e}},76444:function(t,e,n){var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},r.apply(this,arguments)},i=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.LayoutStyleProperties=e.LayoutInfoEntryKeys=void 0,e.iterableToArray=p,e.redistributeLineBreaks=function t(e){var n=p(e.children),r=n.filter(function(t){return"br"===t.tagName}),i=n.filter(function(t){return"span"===t.tagName});if(r.length>0&&i.length>0){var o=0;for(r.forEach(function(t){var e;return null===(e=t.parentElement)||void 0===e?void 0:e.removeChild(t)});r.length>0;){var a=r.shift();if(a&&(i[o].nextSibling?e.insertBefore(a,i[o].nextSibling):e.appendChild(a)),++o>=i.length)break}r.forEach(function(t){return e.appendChild(t)})}n.forEach(t)},e.getSubtitleCue=function(t,e){var n,r,i=t.timedElement,a=t.layouts,s=t.baseOffset,f=t.styles,p=i.end?m(i.end):NaN,v=i.dur?m(i.dur):NaN,y=i.begin?m(i.begin):NaN,T=b(i.element),h=function(t,e,n){var r=Boolean(t)&&n.has(t),i=n.get(t),a=(r&&i instanceof Map?function(t){var e=t.get(o.StyleIds);return Array.isArray(e)?e:[]}(i):[]).map(function(t){return(0,c.getCSSFromStyleID)(t,e)}).join("");return a+(i&&i instanceof Map?d(i):"")+(r&&i instanceof Map?g(i):"")}(T,f,a),S=y+s,A=isFinite(p)?p+s:S+v,E=u.ModuleManager.get(l.ModuleName.Subtitles).HtmlTransformer.htmlToText,L=(T?function(t){var e;return t.innerHTML?t.innerHTML:t.parentNode&&null!==(e=t.parentNode.innerHTML)&&void 0!==e?e:""}(i.element):function(t){var e;return null!==(e=t.outerHTML)&&void 0!==e?e:""}(i.element)).replace(/<br><\/br>/g,"<br>").replace(/[\r\n]+\s*/g,""),M={start:S,end:A,text:L?E(L):null!==(r=null===(n=i.element.textContent)||void 0===n?void 0:n.trim())&&void 0!==r?r:"",region:T,regionStyle:h,html:L};return i.backgroundImageSource&&(M.image=i.backgroundImageSource),M},e.extractLayoutStylesCss=g,e.extractLayoutPositionStylesCss=d,e.extractImages=function(t){var e=h(t,"head"),n=h(e,"metadata");return n?p(n.getElementsByTagNameNS("*","image")).filter(function(t){var e;return t.hasAttribute("xml:id")&&(null===(e=t.prefix)||void 0===e?void 0:e.includes("smpte"))}).map(function(t){var e,n,r,i;return{mimeType:null!==(n=null===(e=t.getAttribute("imagetype"))||void 0===e?void 0:e.toLowerCase())&&void 0!==n?n:"png",id:"#"+t.getAttribute("xml:id"),base64:null!==(i=null===(r=t.textContent)||void 0===r?void 0:r.trim())&&void 0!==i?i:""}}):[]},e.getLayoutInfo=function(t){var e=new Map;if(!t)return e;var n=(0,s.parseAttributes)(t),u=r({},f),l=h(t,"head"),g=h(l,"layout"),d=g?p(g.getElementsByTagName("region")):[];if(!d||0===d.length)return e.set("cellResolutionRows",u.rows),e.set("cellResolutionColumns",u.columns),e;var m=n.get("cellResolution");if(m){var b=m.split(" "),y=parseInt(b[0],10),T=parseInt(b[1],10);isFinite(y)&&y>0&&(u.columns=y),isFinite(T)&&T>0&&(u.rows=T)}var S=h(l,"styling"),A=S?p(S.getElementsByTagName("style")):[];return d.forEach(function(t){var n=t.getAttribute("xml:id")||t.getAttribute("id");n&&e.set(n,function(t,e,n){var r=new Map,u=(0,s.parseAttributes)(t);if(r.set(o.CellResolutionRows,e.rows),r.set(o.CellResolutionColumns,e.columns),u.has("style")){var l=u.get("style"),f=l?l.split(" "):[];r.set(o.StyleIds,f),function(t,e){var n=t.get(o.StyleIds);function r(e,n){if((e.getAttribute("xml:id")||e.getAttribute("id"))===n){v(e.getAttribute("tts:origin"),e.getAttribute("tts:extent"),t);var r=(0,s.parseAttributes)(e);Object.values(a).forEach(function(e){(0,s.processAttribute)(r,t,e,function(t){return t})})}}n&&(Array.isArray(n)?n.forEach(function(t){e.forEach(function(e){return r(e,t)})}):e.forEach(function(t){return r(t,n)}))}(r,n)}return function(t,e,n){var r=t.getElementsByTagName("style");r.length&&(p(r).forEach(function(t){(0,s.parseAttributes)(t).forEach(function(t,e){n.set(e,t)})}),i(i([],c.COLOR_STYLE_ATTRIBUTES,!0),c.BASE_STYLE_ATTRIBUTES,!0).forEach(function(t){(0,s.processAttribute)(n,e,t,function(t){return t})}))}(t,r,u),v(u.get("origin"),u.get("extent"),r),Object.values(a).forEach(function(t){(0,s.processAttribute)(u,r,t,function(t){return t})}),r}(t,u,A))}),e},e.splitUpTimedElements=function(t){if(!t||t.children.length<1)return[];var e=u.ModuleManager.get(l.ModuleName.Subtitles).createHtmlElement;return y(t).map(function(n){var r=e("div"),i=(0,s.parseAttributes)(n),o=function(t,e){for(var n=[],r=t,i=function(t){return t.parentElement||t.parentNode};r&&i(r)&&i(r)!==e;)n.unshift(i(r)),r=i(r);return n}(n,t).reduce(function(t,e){return t.appendChild(e.cloneNode(!1))},r);return r.children[0]&&T(r.children[0]),o.appendChild(n),{end:i.get("end"),dur:i.get("dur"),begin:i.get("begin"),element:r.children[0]}})},e.getFirstElementByTagName=h;var o,a,u=n(88052),l=n(62756),s=n(32148),c=n(31207);!function(t){t.CellResolutionRows="cellResolutionRows",t.CellResolutionColumns="cellResolutionColumns",t.Top="top",t.Left="left",t.Width="width",t.Height="height",t.StyleIds="styleIDs"}(o||(e.LayoutInfoEntryKeys=o={})),function(t){t.DisplayAling="displayAlign",t.Padding="padding",t.WritingMode="writingMode",t.ShowBackground="showBackground",t.Overflow="overflow"}(a||(e.LayoutStyleProperties=a={}));var f={rows:15,columns:40};function p(t){for(var e=[],n=0;n<t.length;n++)e.push(t[n]);return e}function g(t){return i(i(i([],c.COLOR_STYLE_ATTRIBUTES,!0),c.BASE_STYLE_ATTRIBUTES,!0),Object.values(a),!0).filter(function(e){return t.has(e)}).map(function(e){var n=t.get(e),r=Array.isArray(n)?"":"".concat(n);return r?Object.values(c.TTMLSpecificAttributes).some(function(t){return t.toString()===e.toString()})?(0,c.getCssFromTtmlSpecificAttribute)(e,r):(0,c.getCssFromCommonAttribute)(e,r):""}).join("")}function d(t){return[o.Top,o.Left,o.Height,o.Width].map(function(e){return"".concat(e,":").concat(t.get(e),";")}).join("")}function m(t){var e=t.match(/^(\d+):(\d+):(\d+)((?:\.)(\d+)$)?/),n=e?function(t){var e=3600*parseInt(t[1]),n=60*parseInt(t[2]),r=parseInt(t[3]),i=0;return t[5]&&(i=.001*parseInt(t[5])),e+n+r+i}(e):function(t){var e=t.charAt(t.length-1);return"h"===e?3600*parseFloat(t.slice(0,-1)):"m"===e?60*parseFloat(t.slice(0,-1)):"s"===e?"m"===t.charAt(t.length-2)?parseFloat(t.slice(0,-2))/1e3:parseFloat(t.slice(0,-1)):NaN}(t);return isFinite(n)?n:-1}function b(t){var e=(0,s.parseAttributes)(t).get("region");if(e)return e;for(var n=t.children,r=0;r<n.length;r++){var i=b(n[r]);if(i)return i}return""}function v(t,e,n){if(t){var r=t.split(" ");n.set(o.Top,r[1]),n.set(o.Left,r[0])}if(e){var i=e.split(" ");n.set(o.Width,i[0]),n.set(o.Height,i[1])}}function y(t){var e=function(t){var e=(0,s.parseAttributes)(t);return e.has("begin")&&(e.has("end")||e.has("dur"))}(t),n=p(t.children).flatMap(y).filter(Boolean);return n.length>0?n:e?[t]:[]}function T(t){["begin","dur","end"].map(function(e){return(0,s.getQualifiedAttributeName)(t.attributes,e)}).filter(function(t){return Boolean(t)}).forEach(function(e){return t.removeAttribute(e)}),p(t.children).forEach(T)}function h(t,e){if(!t)return null;var n=t.getElementsByTagName(e);return n.length>0?n[0]:null}},31207:function(t,e,n){var r;Object.defineProperty(e,"__esModule",{value:!0}),e.TTMLSpecificAttributesToCSS=e.TTMLSpecificAttributes=e.COLOR_STYLE_ATTRIBUTES=e.BASE_STYLE_ATTRIBUTES=void 0,e.applyStyling=function t(e,n,r,i){void 0===i&&(i=e.element);var u=function(t,e){var n="",r=t.getAttribute("style");return r&&(n+=r.split(" ").map(function(t){return d(t,e)}).join(";").replace(/;;+/g,";")),n+=m(y(t))}(i,n);u.length>0&&i.setAttribute("style",u),(0,l.iterableToArray)(i.children).forEach(function(i){return t(e,n,r,i)}),function(t,e,n){var r=e.getAttribute("smpte:backgroundImage"),i=r?n.find(function(t){return t.id===r}):null;if(i){var u=o.ModuleManager.get(a.ModuleName.Subtitles).createHtmlElement("img"),l="data:image/".concat(i.mimeType,";base64,").concat(i.base64);u.setAttribute("style","width:100%"),u.setAttribute("src",l),t.backgroundImageSource=l,e.appendChild(u)}}(e,i,r)},e.getStylingInfo=function(t){var e=new Map,n=(0,l.getFirstElementByTagName)(t,"head"),r=(0,l.getFirstElementByTagName)(n,"styling");return r?((0,l.iterableToArray)(r.getElementsByTagName("style")).forEach(function(t){var n=t.getAttribute("xml:id")||t.getAttribute("id");n&&e.set(n,y(t))}),e):e},e.applyBodyStyle=function(t,e){if(e){var n=t.element.getAttribute("style");t.element.setAttribute("style",n?n+e:e)}},e.parseBodyStyle=function(t,e){var n=t.getAttribute("style"),r=y(t),i=n?d(n,e):"";return T(r).reduce(function(t,e){return"".concat(t).concat(e,":").concat(r.get(e),";")},i)},e.getCssFromCommonAttribute=function(t,e){return t===l.LayoutStyleProperties.Padding?"box-sizing:border-box;".concat(t,":").concat(e,";"):"".concat(t,":").concat(e,";")},e.getCssFromTtmlSpecificAttribute=function(t,n){var r=Object.values(i).find(function(e){return e===t});if(r){var o=e.TTMLSpecificAttributesToCSS[r],a=o.values[n];return o&&a?o.prefix+"".concat(o.cssProperty,":").concat(a,";"):""}return""},e.getCSSColorFromTTML=g,e.getCSSFromStyleID=d;var i,o=n(88052),a=n(62756),u=n(32148),l=n(76444),s=new RegExp("^#([0-9a-fA-F]{3,8})$"),c=16,f=5,p=9;function g(t){var e=0,n=0,r=0,i=1;if(s.test(t)){if(t.length===f)return e=parseInt(t.slice(1,2),c),n=parseInt(t.slice(2,3),c),r=parseInt(t.slice(3,4),c),i=parseInt(t.slice(4),c),"rgba(".concat(e,",").concat(n,",").concat(r,",").concat(i,")");if(t.length===p)return e=parseInt(t.slice(1,3),c),n=parseInt(t.slice(3,5),c),r=parseInt(t.slice(5,7),c),i=parseInt(t.slice(7),c),"rgba(".concat(e,",").concat(n,",").concat(r,",").concat(i,")")}return t}function d(t,e){var n=e.get(t);return n instanceof Map?m(n):n?"".concat(t,":").concat(n):""}function m(t){var e=T(t).filter(function(t){return["cellResolutionRows","cellResolutionColumns"].indexOf(t)<0}).map(function(e){return"".concat(e,":").concat(t.get(e))}).join(";");return""===e?e:"".concat(e,";")}function b(t){return t.replace(/(default)|(monospace(Sans)?Serif)/g,"monospace").replace(/(sansSerif)|(proportional(Sans)?Serif)/g,"sans-serif")}function v(t){return"wrap"===t?"break-word":"normal"}function y(t){var n=new Map,r=(0,u.parseAttributes)(t);return e.BASE_STYLE_ATTRIBUTES.forEach(function(t){(0,u.processAttribute)(r,n,t,function(t){return t})}),e.COLOR_STYLE_ATTRIBUTES.forEach(function(t){(0,u.processAttribute)(r,n,t,g)}),(0,u.processAttribute)(r,n,"font-family",b),(0,u.processAttribute)(r,n,"word-wrap",v),n}function T(t){var e=[];return t.forEach(function(t,n){return e.push(n)}),e}e.BASE_STYLE_ATTRIBUTES=["font-size","line-height","text-align","unicode-bidi","font-weight","direction","text-decoration","font-style","multiRowAlign","linePadding"],e.COLOR_STYLE_ATTRIBUTES=["color","background-color"],function(t){t.DISPLAY_ALIGN="displayAlign"}(i||(e.TTMLSpecificAttributes=i={})),e.TTMLSpecificAttributesToCSS=((r={})[i.DISPLAY_ALIGN]={prefix:"display:flex;justify-content:center;",cssProperty:"align-items",values:{before:"flex-start",center:"center",after:"flex-end"}},r)}},function(t){return function(){return t(90942)}()}])});
|
|
18
18
|
})();
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
* This software includes open-source components. See THIRD_PARTY_NOTICES
|
|
10
10
|
* in the distribution for details.
|
|
11
11
|
*
|
|
12
|
-
* Bitmovin Player Version 8.
|
|
12
|
+
* Bitmovin Player Version 8.281.0
|
|
13
13
|
*
|
|
14
14
|
****************************************************************************/
|
|
15
15
|
|
|
16
16
|
(function() {
|
|
17
|
-
"use strict";!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["subtitles-vtt"]=t():(e.bitmovin=e.bitmovin||{},e.bitmovin.player=e.bitmovin.player||{},e.bitmovin.player["subtitles-vtt"]=t())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[831],{48519:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.WebVttSubtitlesModuleDefinition=void 0;var r=n(62756),i=n(69041),u=n(1757);t.WebVttSubtitlesModuleDefinition={name:r.ModuleName.SubtitlesWebVTT,module:function(){return{WebVttParser:u.WebVttParser,extractVttProperties:i.extractVttProperties}},dependencies:[r.ModuleName.Subtitles]},t.default=t.WebVttSubtitlesModuleDefinition},1757:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.WebVttParser=void 0;var i=n(730),u=/(<\d+:\d{2}:\d{2}[.,]\d{3}>)/g,o=function(){function e(){}return e.prototype.parse=function(e,t){return void 0===t&&(t=0),(e=e.replace(/\r\n/gm,"\n")).startsWith("[EMBEDDEDWEBVTT]")?this.ou(e):this.pu(e,t)},e.prototype.ou=function(e){var t,n,r=e.split("\n"),u=r[1],o=r[2],l=r[3],s=r[4],c=r.slice(5).join("\n"),f=a();f.start=Number(u),f.end=Number(o),f.i=Number(l);var p=i.parseContents(c,0,i.getPlaceholderVttStyleProperties());f.text=null!==(n=null!==(t=null==p?void 0:p.textContent)&&void 0!==t?t:null==p?void 0:p.innerText)&&void 0!==n?n:"";var v=i.stringifyCueHtml(p);if(f.html=v,s){var d=i.parseOptions(s,[]);f.vtt=d}return f.vtt.id=l,[f]},e.prototype.pu=function(e,t){var n=e.split(/\n{2,}|^[WEBVTT\n+]?X-TIMESTAMP-MAP=.*\n+|^WEBVTT\n+/m).filter(function(e){return null!=e&&""!==e}).map(function(e){return e.split("\n")}),r=this.qu(e),i=this.ru(n),u={vtt:r,base:t};return this.yu(n,i,u)},e.prototype.qu=function(e){var t=/X-TIMESTAMP-MAP=(.*)\n/.exec(e);if(null==(null==t?void 0:t[1]))return 0;var n=t[0],r=/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m.exec(n),u=/MPEGTS:(\d+)/m.exec(n),o=0;if(null==r?void 0:r[1]){var l=i.parseTime(r[1]);null!=l&&(o=l)}var a=0;return null!=u&&(a=Number(u[1])),a/9e4-o},e.prototype.ru=function(e){for(var t=[],n=[],r=0,u=e;r<u.length;r++){var o=u[r],l=o[0];/^STYLE/.test(l.trim())&&n.push.apply(n,i.parseStyles(o)),/^region:?/i.test(l.trim())&&t.push.apply(t,i.parseRegions(o))}return{regions:t,styles:n}},e.prototype.su=function(e){var t=/^NOTE/.test(e),n=/^STYLE/.test(e),r=/^region:?/i.test(e);return!t&&!n&&!r},e.prototype.tu=function(e){return null!=e&&""!==e&&!!e.includes("--\x3e")},e.prototype.uu=function(e){var t={},n=[];return e.forEach(function(e){null==e.identifier&&(t=r(r({},t),e.style));var i=n.findIndex(function(t){return t.identifier===e.identifier});-1!==i?n[i]={identifier:e.identifier,style:r(r({},n[i].style),e.style)}:n.push(e)}),i.getPlaceholderVttStyleProperties().forEach(function(e){n.find(function(t){return t.identifier===e.identifier})||n.push(e)}),{globalStyle:t,contentStyles:n}},e.prototype.vu=function(e,t){var n=i.stringifyCssProperties(t);n&&(e.html.setAttribute("style",n),e.subCues.forEach(function(e){e.html.setAttribute("style",n)}))},e.prototype.wu=function(e,t,n,r){var o=function(e){var t=e.indexOf("--\x3e");return t<0?{start:null,end:null}:{start:i.parseTime(e.substring(0,t).trim()),end:i.parseTime(e.substring(t+3).trim())}}(e[t]),l=o.start,a=o.end;if(null!==l&&null!==a){for(var c,f=function(e,t){return e.slice(t).join("\n").trim()}(e,t+1),p=f.split(u),v="",d=f.replace(u,""),b=l,g=[],y=0;y<p.length;y+=2){var m=p[y],h=p[y+1],x=h?i.parseTime(h):a,P=null!=x?x:a;if(b!==P){var A=s(m,v,d=d.substring(m.length));v+=m;var N=i.parseContents(A,r,n);null==c?c=N:g.push({updateTime:b,html:N}),b=P}}if(null!=c)return{start:l,end:a,html:c,subCues:g}}},e.prototype.xu=function(e,t,n){var i=r({},t);if(n)for(var u="#"+n,o=0,l=e;o<l.length;o++){var a=l[o];a.identifier===u&&Object.assign(i,a.style)}return i},e.prototype.yu=function(e,t,n){for(var r=[],u=0,o=t.regions,a=t.styles,s=this.uu(a),c=s.globalStyle,f=s.contentStyles,p=0,v=e;p<v.length;p++){var d=v[p];if(this.su(d[0])){var b=void 0,g=0;d[0].includes("--\x3e")||(b=d[0].trim(),g=1);var y=this.zu(b,u);if(u=y,this.tu(d[g])){var m=i.parseOptions(d[g],o);m.id=b;var h=this.wu(d,g,f,n.base);if(void 0!==h){var x=this.xu(f,c,b);this.vu(h,x);var P=l(h,y,n,m);r.push(P)}}}}return r},e.prototype.zu=function(e,t){var n=Number(e);return null==e||isNaN(n)?t+1:n},e}();function l(e,t,n,u){var o,l,s=a();return s.i=t,s.start=e.start+n.base,s.end=e.end+n.base,s.text=(null===(o=e.html)||void 0===o?void 0:o.textContent)||(null===(l=e.html)||void 0===l?void 0:l.innerText)||"",s.html=i.stringifyCueHtml(e.html),s.vtt=r({},u),0!==n.vtt&&(s.offset=n.vtt),s.updates=e.subCues.map(function(e){return{updateTime:e.updateTime+n.base,html:i.stringifyCueHtml(e.html)}}),s}function a(){return{i:null,start:null,end:null,text:null,html:null,vtt:i.getDefaultVttProperties(),offset:null,updates:[]}}function s(e,t,n){return(t?c(t,"cue-past"):"")+e+(n?c(n,"cue-future"):"")}function c(e,t){return"<c.".concat(t,">").concat(e,"</c>")}t.WebVttParser=o,t.default=o},39157:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.parseContents=function(e,t,n){var u=r.ModuleManager.get(i.ModuleName.Subtitles).createHtmlElement("span");return v({input:e,root:u,current:u,tagStack:[],offset:t,styles:n})};var r=n(88052),i=n(62756),u=n(99735),o=n(69041),l=[[/&/g,"&"],[/</g,"<"],[/>/g,">"],[/‎/g,""],[/‏/g,""],[/ /g," "]],a={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},s={v:"title",lang:"lang"},c={rt:"ruby"},f={"cue-future":":future","cue-past":":past"},p=2;function v(e){var t=function(e){if(!e)return null;var t=/^([^<]*)(<[^>]+>?)?/.exec(e);if(!t)return null;var n=t[1],r=t[2];return n||r}(e.input);return null==t?e.root:(e.input=e.input.substring(t.length),function(e,t){if("<"!==e[0]){var n=t.current.ownerDocument.createTextNode(function(e){for(var t=0,n=l;t<n.length;t++){var r=n[t],i=r[0],u=r[1];e=e.replace(i,u)}return e}(e));return t.current.appendChild(n),v(t)}if("/"===e[1])return function(e,t){return t.length>0&&t[t.length-1]===e.substring(p).replace(">","")}(e,t.tagStack)&&(t.tagStack.pop(),t.current=t.current.parentNode),v(t);var r=(0,o.parseTime)(e.substring(1,e.length-1));if(null!=r){var i=t.current.ownerDocument.createComment("time: ".concat(r+t.offset));return t.current.appendChild(i),v(t)}var u=/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/.exec(e);if(!u)return v(t);var b=u[0],g=u[1],y=u[2],m=u[3],h=function(e,t,n){var r=a[e];if(!r)return null;var i=n.createElement(r),u=s[e];return u&&t&&(i[u]=t.trim()),i}(g,m,t.current.ownerDocument);return h&&function(e,t){return!c[t.localName]||c[t.localName]===e.localName}(t.current,h)?(function(e,t,n){var r=function(e,t){var n,r,i,u="",l="",a={};if(t.type&&"v"!==t.type&&(a=null!==(n=d(e,t.type))&&void 0!==n?n:a),t.contents){a={};for(var s=t.contents.substring(1).split("."),c=0,p=s;c<p.length;c++){var v=p[c],b=d(e,f[v]||".".concat(v));b&&Object.assign(a,b)}u=s.join(" ").trim()}return"v"===t.type&&t.annotation&&(l=t.annotation.substring(1),a=null!==(r=d(e,"".concat(t.type,'[voice="').concat(l,'"]')))&&void 0!==r?r:a),{className:u,title:l,styleString:null!==(i=(0,o.stringifyCssProperties)(a))&&void 0!==i?i:""}}(t,n),i=r.className,u=r.title,l=r.styleString;u&&(e.title=u),i&&(e.className=i),l&&e.setAttribute("style",l)}(h,t.styles,{type:g,contents:y,annotation:m}),t.tagStack.push(b[1]),t.current.appendChild(h),t.current=h,v(t)):v(t)}(t,e))}function d(e,t){for(var n=0,r=e;n<r.length;n++)if((l=r[n]).identifier===t)return l.style;for(var i=0,o=u.webVttDefaultClassStyles;i<o.length;i++){var l;if((l=o[i]).identifier===t)return l.style}}},99735:function(e,t){var n=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,u=t.length;i<u;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.webVttDefaultClassStyles=void 0;var r=["white","lime","cyan","red","yellow","magenta","blue","black"];t.webVttDefaultClassStyles=n(n([],r.map(function(e){return{identifier:".".concat(e),style:{color:e}}}),!0),r.map(function(e){return{identifier:".bg_".concat(e),style:{background:e}}}),!0)},76171:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.parseOptions=function(e,t){for(var n=e.split(/\s/),r=(0,i.getDefaultVttProperties)(),o=0,l=n;o<l.length;o++){var a=l[o],s=a.indexOf(":");-1!==s&&u(a.substring(0,s),a.substring(s+1),t,r)}return function(e){var t=(0,i.getDefaultVttProperties)();null!=e.region&&(e.vertical!==t.vertical||e.size!==t.size||e.line!==t.line)&&delete e.region}(r),r},t.setOptionProperty=u;var r=n(23068),i=n(69041);function u(e,t,n,u){switch(e){case"region":!function(e,t,n){var r=t.find(function(t){return t.id===e});null!=r&&(n.region=r)}(t,n,u);break;case"vertical":!function(e,t){var n=(0,i.ensureArray)(/^(lr|rl)$/.exec(e))[1];null!=n&&(t.vertical=n)}(t,u);break;case"align":!function(e,t){var n=(0,i.ensureArray)(/^(start|middle|center|end|left|right)$/.exec(e))[1];null!=n&&(t.align=n),t.positionAlign=o(void 0,t)}(t,u);break;case"size":!function(e,t){var n=(0,i.ensureArray)(/^([\d.]+)%$/.exec(e))[1];null!=n&&(t.size=Number(n))}(t,u);break;case"position":!function(e,t){var n=(0,i.ensureArray)(/^([\d.]+|auto)%?(?:,(line-left|line-right|center))?$/.exec(e)),r=n[1],u=n[2];"auto"===r?t.position="auto":void 0!==r&&(t.position=Number(r)),t.positionAlign=o(u,t)}(t,u);break;case"line":!function(e,t){var n=(0,i.ensureArray)(/^(-?[\d.]+|auto)(%)?(?:,(start|end|center|auto))?$/.exec(e)),u=n[1],o=n[2],l=n[3],a="%"===o;"auto"===u?t.line="auto":a?t.line="".concat(u,"%"):null!=e&&(t.line=Number(u)),null!=l&&(t.lineAlign=l),t.snapToLines=(0,r.isNumber)(t.line)}(t,u)}}function o(e,t){if(null!=e)return e;switch(t.align){case"start":case"left":return"line-left";case"end":case"right":return"line-right";default:return"center"}}},69041:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.getDefaultVttProperties=l,t.extractVttProperties=function(e){var t=l(),n=a();return Object.keys(t).forEach(function(i){var u=function(e,t,n){var i=t[e],u=n[e],o=String(i||u),l="line"===e;return("position"===e&&(0,r.isNumber)(i)||l&&!1===t.snapToLines)&&(o+="%"),o}(i,e,t);(0,o.setOptionProperty)(i,u,[n],t)}),t},t.getDefaultVttRegionProperties=a,t.parseTime=function(e){var t=/(?:(\d{1,}):)?(\d{2}):(\d{2})[.,](\d{3})/g.exec(e);if(null==t)return null;var n=t[1],r=t[2],i=t[3],u=t[4];return Number(u)/1e3+Number(i)+60*Number(r)+3600*(Number(n)||0)},t.ensureArray=function(e){return Array.isArray(e)?e:[]},t.stringifyCssProperties=function(e){return e?Object.entries(e).map(function(e){return"".concat(e[0],":").concat(e[1],";")}).join(""):null},t.stringifyCueHtml=function(e){return(0,i.ModuleManager.get(u.ModuleName.Subtitles).HtmlTransformer.prepareHtml)((null==e?void 0:e.outerHTML)||"")};var r=n(23068),i=n(88052),u=n(62756),o=n(76171);function l(){return{vertical:"",align:"center",size:100,line:"auto",lineAlign:"start",position:"auto",positionAlign:"center",snapToLines:!1}}function a(){return{id:null,width:100,lines:3,regionAnchorX:0,regionAnchorY:100,viewportAnchorX:0,viewportAnchorY:100,scroll:""}}},79347:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.parseRegions=function(e){for(var t=[],n=0,r=e;n<r.length;n++){var o=r[n];if(o=o.trim(),/^REGION$/i.test(o)){t.push(i(e));break}/^Region:/i.test(o)&&t.push(u(o))}return t};var r=n(69041);function i(e){return o(e.slice(1),":")}function u(e){return o(e.split(/[ \t]+/).slice(1),"=")}function o(e,t){var n=(0,r.getDefaultVttRegionProperties)();return e.forEach(function(e){!function(e,t){var n=e[0],i=e[1];switch(n){case"id":!function(e,t){null!=e&&(t.id=e)}(i,t);break;case"width":!function(e,t){var n=(0,r.ensureArray)(/^(\d{1,2}|100)%$/.exec(e))[1];null!=n&&(t.width=Number(n))}(i,t);break;case"lines":!function(e,t){var n=(0,r.ensureArray)(/^(\d+)$/.exec(e))[1];null!=n&&(t.lines=Number(n))}(i,t);break;case"regionanchor":!function(e,t){var n=(0,r.ensureArray)(/^(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(e)),i=n[1],u=n[2];null!=i&&(t.regionAnchorX=Number(i)),null!=u&&(t.regionAnchorY=Number(u))}(i,t);break;case"viewportanchor":!function(e,t){var n=(0,r.ensureArray)(/^(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(e)),i=n[1],u=n[2];null!=i&&(t.viewportAnchorX=Number(i)),null!=u&&(t.viewportAnchorY=Number(u))}(i,t);break;case"scroll":!function(e,t){var n=(0,r.ensureArray)(/^(up)$/.exec(e))[1];null!=n&&(t.scroll=n)}(i,t)}}(e.split(t),n)}),n}},22649:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.parseStyles=function(e){var t=[],n=/::cue(\((.+)\))?(?= |{)/,r=/([a-zA-Z0-9-]+):(.+?(?=;|}|$))/g,i=n.exec(e[1]);if(!i)return t;for(var u=1;u<e.length;u++){for(var o=n.exec(e[u]),l=null!==o,a=(i=l?o:i)[2],s={},c=r.exec(e[u]);null!==c;){var f=c[1],p=c[2];s[f]=p.trim(),c=r.exec(e[u])}(l||Object.keys(s).length>0)&&t.push({identifier:a,style:s})}return t},t.getPlaceholderVttStyleProperties=function(){return[{identifier:":future",style:{visibility:"hidden"}}]}},730:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(79347),t),i(n(39157),t),i(n(76171),t),i(n(69041),t),i(n(22649),t)}},function(e){return function(){return e(48519)}()}])});
|
|
17
|
+
"use strict";!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["subtitles-vtt"]=t():(e.bitmovin=e.bitmovin||{},e.bitmovin.player=e.bitmovin.player||{},e.bitmovin.player["subtitles-vtt"]=t())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[831],{48519:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.WebVttSubtitlesModuleDefinition=void 0;var r=n(62756),i=n(69041),u=n(1757);t.WebVttSubtitlesModuleDefinition={name:r.ModuleName.SubtitlesWebVTT,module:function(){return{WebVttParser:u.WebVttParser,extractVttProperties:i.extractVttProperties}},dependencies:[r.ModuleName.Subtitles]},t.default=t.WebVttSubtitlesModuleDefinition},1757:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.WebVttParser=void 0;var i=n(730),u=/(<\d+:\d{2}:\d{2}[.,]\d{3}>)/g,o=function(){function e(){}return e.prototype.parse=function(e,t){return void 0===t&&(t=0),(e=e.replace(/\r\n/gm,"\n")).startsWith("[EMBEDDEDWEBVTT]")?this.uu(e):this.vu(e,t)},e.prototype.uu=function(e){var t,n,r=e.split("\n"),u=r[1],o=r[2],l=r[3],s=r[4],c=r.slice(5).join("\n"),f=a();f.start=Number(u),f.end=Number(o),f.i=Number(l);var p=i.parseContents(c,0,i.getPlaceholderVttStyleProperties());f.text=null!==(n=null!==(t=null==p?void 0:p.textContent)&&void 0!==t?t:null==p?void 0:p.innerText)&&void 0!==n?n:"";var v=i.stringifyCueHtml(p);if(f.html=v,s){var d=i.parseOptions(s,[]);f.vtt=d}return f.vtt.id=l,[f]},e.prototype.vu=function(e,t){var n=e.split(/\n{2,}|^[WEBVTT\n+]?X-TIMESTAMP-MAP=.*\n+|^WEBVTT\n+/m).filter(function(e){return null!=e&&""!==e}).map(function(e){return e.split("\n")}),r=this.wu(e),i=this.xu(n),u={vtt:r,base:t};return this.Eu(n,i,u)},e.prototype.wu=function(e){var t=/X-TIMESTAMP-MAP=(.*)\n/.exec(e);if(null==(null==t?void 0:t[1]))return 0;var n=t[0],r=/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m.exec(n),u=/MPEGTS:(\d+)/m.exec(n),o=0;if(null==r?void 0:r[1]){var l=i.parseTime(r[1]);null!=l&&(o=l)}var a=0;return null!=u&&(a=Number(u[1])),a/9e4-o},e.prototype.xu=function(e){for(var t=[],n=[],r=0,u=e;r<u.length;r++){var o=u[r],l=o[0];/^STYLE/.test(l.trim())&&n.push.apply(n,i.parseStyles(o)),/^region:?/i.test(l.trim())&&t.push.apply(t,i.parseRegions(o))}return{regions:t,styles:n}},e.prototype.yu=function(e){var t=/^NOTE/.test(e),n=/^STYLE/.test(e),r=/^region:?/i.test(e);return!t&&!n&&!r},e.prototype.zu=function(e){return null!=e&&""!==e&&!!e.includes("--\x3e")},e.prototype.Au=function(e){var t={},n=[];return e.forEach(function(e){null==e.identifier&&(t=r(r({},t),e.style));var i=n.findIndex(function(t){return t.identifier===e.identifier});-1!==i?n[i]={identifier:e.identifier,style:r(r({},n[i].style),e.style)}:n.push(e)}),i.getPlaceholderVttStyleProperties().forEach(function(e){n.find(function(t){return t.identifier===e.identifier})||n.push(e)}),{globalStyle:t,contentStyles:n}},e.prototype.Bu=function(e,t){var n=i.stringifyCssProperties(t);n&&(e.html.setAttribute("style",n),e.subCues.forEach(function(e){e.html.setAttribute("style",n)}))},e.prototype.Cu=function(e,t,n,r){var o=function(e){var t=e.indexOf("--\x3e");return t<0?{start:null,end:null}:{start:i.parseTime(e.substring(0,t).trim()),end:i.parseTime(e.substring(t+3).trim())}}(e[t]),l=o.start,a=o.end;if(null!==l&&null!==a){for(var c,f=function(e,t){return e.slice(t).join("\n").trim()}(e,t+1),p=f.split(u),v="",d=f.replace(u,""),b=l,g=[],y=0;y<p.length;y+=2){var m=p[y],h=p[y+1],x=h?i.parseTime(h):a,P=null!=x?x:a;if(b!==P){var A=s(m,v,d=d.substring(m.length));v+=m;var N=i.parseContents(A,r,n);null==c?c=N:g.push({updateTime:b,html:N}),b=P}}if(null!=c)return{start:l,end:a,html:c,subCues:g}}},e.prototype.Du=function(e,t,n){var i=r({},t);if(n)for(var u="#"+n,o=0,l=e;o<l.length;o++){var a=l[o];a.identifier===u&&Object.assign(i,a.style)}return i},e.prototype.Eu=function(e,t,n){for(var r=[],u=0,o=t.regions,a=t.styles,s=this.Au(a),c=s.globalStyle,f=s.contentStyles,p=0,v=e;p<v.length;p++){var d=v[p];if(this.yu(d[0])){var b=void 0,g=0;d[0].includes("--\x3e")||(b=d[0].trim(),g=1);var y=this.Fu(b,u);if(u=y,this.zu(d[g])){var m=i.parseOptions(d[g],o);m.id=b;var h=this.Cu(d,g,f,n.base);if(void 0!==h){var x=this.Du(f,c,b);this.Bu(h,x);var P=l(h,y,n,m);r.push(P)}}}}return r},e.prototype.Fu=function(e,t){var n=Number(e);return null==e||isNaN(n)?t+1:n},e}();function l(e,t,n,u){var o,l,s=a();return s.i=t,s.start=e.start+n.base,s.end=e.end+n.base,s.text=(null===(o=e.html)||void 0===o?void 0:o.textContent)||(null===(l=e.html)||void 0===l?void 0:l.innerText)||"",s.html=i.stringifyCueHtml(e.html),s.vtt=r({},u),0!==n.vtt&&(s.offset=n.vtt),s.updates=e.subCues.map(function(e){return{updateTime:e.updateTime+n.base,html:i.stringifyCueHtml(e.html)}}),s}function a(){return{i:null,start:null,end:null,text:null,html:null,vtt:i.getDefaultVttProperties(),offset:null,updates:[]}}function s(e,t,n){return(t?c(t,"cue-past"):"")+e+(n?c(n,"cue-future"):"")}function c(e,t){return"<c.".concat(t,">").concat(e,"</c>")}t.WebVttParser=o,t.default=o},39157:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.parseContents=function(e,t,n){var u=r.ModuleManager.get(i.ModuleName.Subtitles).createHtmlElement("span");return v({input:e,root:u,current:u,tagStack:[],offset:t,styles:n})};var r=n(88052),i=n(62756),u=n(99735),o=n(69041),l=[[/&/g,"&"],[/</g,"<"],[/>/g,">"],[/‎/g,""],[/‏/g,""],[/ /g," "]],a={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},s={v:"title",lang:"lang"},c={rt:"ruby"},f={"cue-future":":future","cue-past":":past"},p=2;function v(e){var t=function(e){if(!e)return null;var t=/^([^<]*)(<[^>]+>?)?/.exec(e);if(!t)return null;var n=t[1],r=t[2];return n||r}(e.input);return null==t?e.root:(e.input=e.input.substring(t.length),function(e,t){if("<"!==e[0]){var n=t.current.ownerDocument.createTextNode(function(e){for(var t=0,n=l;t<n.length;t++){var r=n[t],i=r[0],u=r[1];e=e.replace(i,u)}return e}(e));return t.current.appendChild(n),v(t)}if("/"===e[1])return function(e,t){return t.length>0&&t[t.length-1]===e.substring(p).replace(">","")}(e,t.tagStack)&&(t.tagStack.pop(),t.current=t.current.parentNode),v(t);var r=(0,o.parseTime)(e.substring(1,e.length-1));if(null!=r){var i=t.current.ownerDocument.createComment("time: ".concat(r+t.offset));return t.current.appendChild(i),v(t)}var u=/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/.exec(e);if(!u)return v(t);var b=u[0],g=u[1],y=u[2],m=u[3],h=function(e,t,n){var r=a[e];if(!r)return null;var i=n.createElement(r),u=s[e];return u&&t&&(i[u]=t.trim()),i}(g,m,t.current.ownerDocument);return h&&function(e,t){return!c[t.localName]||c[t.localName]===e.localName}(t.current,h)?(function(e,t,n){var r=function(e,t){var n,r,i,u="",l="",a={};if(t.type&&"v"!==t.type&&(a=null!==(n=d(e,t.type))&&void 0!==n?n:a),t.contents){a={};for(var s=t.contents.substring(1).split("."),c=0,p=s;c<p.length;c++){var v=p[c],b=d(e,f[v]||".".concat(v));b&&Object.assign(a,b)}u=s.join(" ").trim()}return"v"===t.type&&t.annotation&&(l=t.annotation.substring(1),a=null!==(r=d(e,"".concat(t.type,'[voice="').concat(l,'"]')))&&void 0!==r?r:a),{className:u,title:l,styleString:null!==(i=(0,o.stringifyCssProperties)(a))&&void 0!==i?i:""}}(t,n),i=r.className,u=r.title,l=r.styleString;u&&(e.title=u),i&&(e.className=i),l&&e.setAttribute("style",l)}(h,t.styles,{type:g,contents:y,annotation:m}),t.tagStack.push(b[1]),t.current.appendChild(h),t.current=h,v(t)):v(t)}(t,e))}function d(e,t){for(var n=0,r=e;n<r.length;n++)if((l=r[n]).identifier===t)return l.style;for(var i=0,o=u.webVttDefaultClassStyles;i<o.length;i++){var l;if((l=o[i]).identifier===t)return l.style}}},99735:function(e,t){var n=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,u=t.length;i<u;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.webVttDefaultClassStyles=void 0;var r=["white","lime","cyan","red","yellow","magenta","blue","black"];t.webVttDefaultClassStyles=n(n([],r.map(function(e){return{identifier:".".concat(e),style:{color:e}}}),!0),r.map(function(e){return{identifier:".bg_".concat(e),style:{background:e}}}),!0)},76171:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.parseOptions=function(e,t){for(var n=e.split(/\s/),r=(0,i.getDefaultVttProperties)(),o=0,l=n;o<l.length;o++){var a=l[o],s=a.indexOf(":");-1!==s&&u(a.substring(0,s),a.substring(s+1),t,r)}return function(e){var t=(0,i.getDefaultVttProperties)();null!=e.region&&(e.vertical!==t.vertical||e.size!==t.size||e.line!==t.line)&&delete e.region}(r),r},t.setOptionProperty=u;var r=n(23068),i=n(69041);function u(e,t,n,u){switch(e){case"region":!function(e,t,n){var r=t.find(function(t){return t.id===e});null!=r&&(n.region=r)}(t,n,u);break;case"vertical":!function(e,t){var n=(0,i.ensureArray)(/^(lr|rl)$/.exec(e))[1];null!=n&&(t.vertical=n)}(t,u);break;case"align":!function(e,t){var n=(0,i.ensureArray)(/^(start|middle|center|end|left|right)$/.exec(e))[1];null!=n&&(t.align=n),t.positionAlign=o(void 0,t)}(t,u);break;case"size":!function(e,t){var n=(0,i.ensureArray)(/^([\d.]+)%$/.exec(e))[1];null!=n&&(t.size=Number(n))}(t,u);break;case"position":!function(e,t){var n=(0,i.ensureArray)(/^([\d.]+|auto)%?(?:,(line-left|line-right|center))?$/.exec(e)),r=n[1],u=n[2];"auto"===r?t.position="auto":void 0!==r&&(t.position=Number(r)),t.positionAlign=o(u,t)}(t,u);break;case"line":!function(e,t){var n=(0,i.ensureArray)(/^(-?[\d.]+|auto)(%)?(?:,(start|end|center|auto))?$/.exec(e)),u=n[1],o=n[2],l=n[3],a="%"===o;"auto"===u?t.line="auto":a?t.line="".concat(u,"%"):null!=e&&(t.line=Number(u)),null!=l&&(t.lineAlign=l),t.snapToLines=(0,r.isNumber)(t.line)}(t,u)}}function o(e,t){if(null!=e)return e;switch(t.align){case"start":case"left":return"line-left";case"end":case"right":return"line-right";default:return"center"}}},69041:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.getDefaultVttProperties=l,t.extractVttProperties=function(e){var t=l(),n=a();return Object.keys(t).forEach(function(i){var u=function(e,t,n){var i=t[e],u=n[e],o=String(i||u),l="line"===e;return("position"===e&&(0,r.isNumber)(i)||l&&!1===t.snapToLines)&&(o+="%"),o}(i,e,t);(0,o.setOptionProperty)(i,u,[n],t)}),t},t.getDefaultVttRegionProperties=a,t.parseTime=function(e){var t=/(?:(\d{1,}):)?(\d{2}):(\d{2})[.,](\d{3})/g.exec(e);if(null==t)return null;var n=t[1],r=t[2],i=t[3],u=t[4];return Number(u)/1e3+Number(i)+60*Number(r)+3600*(Number(n)||0)},t.ensureArray=function(e){return Array.isArray(e)?e:[]},t.stringifyCssProperties=function(e){return e?Object.entries(e).map(function(e){return"".concat(e[0],":").concat(e[1],";")}).join(""):null},t.stringifyCueHtml=function(e){return(0,i.ModuleManager.get(u.ModuleName.Subtitles).HtmlTransformer.prepareHtml)((null==e?void 0:e.outerHTML)||"")};var r=n(23068),i=n(88052),u=n(62756),o=n(76171);function l(){return{vertical:"",align:"center",size:100,line:"auto",lineAlign:"start",position:"auto",positionAlign:"center",snapToLines:!1}}function a(){return{id:null,width:100,lines:3,regionAnchorX:0,regionAnchorY:100,viewportAnchorX:0,viewportAnchorY:100,scroll:""}}},79347:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.parseRegions=function(e){for(var t=[],n=0,r=e;n<r.length;n++){var o=r[n];if(o=o.trim(),/^REGION$/i.test(o)){t.push(i(e));break}/^Region:/i.test(o)&&t.push(u(o))}return t};var r=n(69041);function i(e){return o(e.slice(1),":")}function u(e){return o(e.split(/[ \t]+/).slice(1),"=")}function o(e,t){var n=(0,r.getDefaultVttRegionProperties)();return e.forEach(function(e){!function(e,t){var n=e[0],i=e[1];switch(n){case"id":!function(e,t){null!=e&&(t.id=e)}(i,t);break;case"width":!function(e,t){var n=(0,r.ensureArray)(/^(\d{1,2}|100)%$/.exec(e))[1];null!=n&&(t.width=Number(n))}(i,t);break;case"lines":!function(e,t){var n=(0,r.ensureArray)(/^(\d+)$/.exec(e))[1];null!=n&&(t.lines=Number(n))}(i,t);break;case"regionanchor":!function(e,t){var n=(0,r.ensureArray)(/^(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(e)),i=n[1],u=n[2];null!=i&&(t.regionAnchorX=Number(i)),null!=u&&(t.regionAnchorY=Number(u))}(i,t);break;case"viewportanchor":!function(e,t){var n=(0,r.ensureArray)(/^(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(e)),i=n[1],u=n[2];null!=i&&(t.viewportAnchorX=Number(i)),null!=u&&(t.viewportAnchorY=Number(u))}(i,t);break;case"scroll":!function(e,t){var n=(0,r.ensureArray)(/^(up)$/.exec(e))[1];null!=n&&(t.scroll=n)}(i,t)}}(e.split(t),n)}),n}},22649:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.parseStyles=function(e){var t=[],n=/::cue(\((.+)\))?(?= |{)/,r=/([a-zA-Z0-9-]+):(.+?(?=;|}|$))/g,i=n.exec(e[1]);if(!i)return t;for(var u=1;u<e.length;u++){for(var o=n.exec(e[u]),l=null!==o,a=(i=l?o:i)[2],s={},c=r.exec(e[u]);null!==c;){var f=c[1],p=c[2];s[f]=p.trim(),c=r.exec(e[u])}(l||Object.keys(s).length>0)&&t.push({identifier:a,style:s})}return t},t.getPlaceholderVttStyleProperties=function(){return[{identifier:":future",style:{visibility:"hidden"}}]}},730:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(79347),t),i(n(39157),t),i(n(76171),t),i(n(69041),t),i(n(22649),t)}},function(e){return function(){return e(48519)}()}])});
|
|
18
18
|
})();
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
* This software includes open-source components. See THIRD_PARTY_NOTICES
|
|
10
10
|
* in the distribution for details.
|
|
11
11
|
*
|
|
12
|
-
* Bitmovin Player Version 8.
|
|
12
|
+
* Bitmovin Player Version 8.281.0
|
|
13
13
|
*
|
|
14
14
|
****************************************************************************/
|
|
15
15
|
|
|
16
16
|
(function() {
|
|
17
|
-
"use strict";!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["subtitles-vtt"]=t():(e.bitmovin=e.bitmovin||{},e.bitmovin.player=e.bitmovin.player||{},e.bitmovin.player["subtitles-vtt"]=t())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[831],{48519:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.WebVttSubtitlesModuleDefinition=void 0;var r=n(62756),i=n(69041),u=n(1757);t.WebVttSubtitlesModuleDefinition={name:r.ModuleName.SubtitlesWebVTT,module:function(){return{WebVttParser:u.WebVttParser,extractVttProperties:i.extractVttProperties}},dependencies:[r.ModuleName.Subtitles]},t.default=t.WebVttSubtitlesModuleDefinition},1757:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.WebVttParser=void 0;var i=n(730),u=/(<\d+:\d{2}:\d{2}[.,]\d{3}>)/g,o=function(){function e(){}return e.prototype.parse=function(e,t){return void 0===t&&(t=0),(e=e.replace(/\r\n/gm,"\n")).startsWith("[EMBEDDEDWEBVTT]")?this.jq(e):this.kq(e,t)},e.prototype.jq=function(e){var t,n,r=e.split("\n"),u=r[1],o=r[2],l=r[3],s=r[4],c=r.slice(5).join("\n"),f=a();f.start=Number(u),f.end=Number(o),f.i=Number(l);var p=i.parseContents(c,0,i.getPlaceholderVttStyleProperties());f.text=null!==(n=null!==(t=null==p?void 0:p.textContent)&&void 0!==t?t:null==p?void 0:p.innerText)&&void 0!==n?n:"";var v=i.stringifyCueHtml(p);if(f.html=v,s){var d=i.parseOptions(s,[]);f.vtt=d}return f.vtt.id=l,[f]},e.prototype.kq=function(e,t){var n=e.split(/\n{2,}|^[WEBVTT\n+]?X-TIMESTAMP-MAP=.*\n+|^WEBVTT\n+/m).filter(function(e){return null!=e&&""!==e}).map(function(e){return e.split("\n")}),r=this.lq(e),i=this.mq(n),u={vtt:r,base:t};return this.tq(n,i,u)},e.prototype.lq=function(e){var t=/X-TIMESTAMP-MAP=(.*)\n/.exec(e);if(null==(null==t?void 0:t[1]))return 0;var n=t[0],r=/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m.exec(n),u=/MPEGTS:(\d+)/m.exec(n),o=0;if(null==r?void 0:r[1]){var l=i.parseTime(r[1]);null!=l&&(o=l)}var a=0;return null!=u&&(a=Number(u[1])),a/9e4-o},e.prototype.mq=function(e){for(var t=[],n=[],r=0,u=e;r<u.length;r++){var o=u[r],l=o[0];/^STYLE/.test(l.trim())&&n.push.apply(n,i.parseStyles(o)),/^region:?/i.test(l.trim())&&t.push.apply(t,i.parseRegions(o))}return{regions:t,styles:n}},e.prototype.nq=function(e){var t=/^NOTE/.test(e),n=/^STYLE/.test(e),r=/^region:?/i.test(e);return!t&&!n&&!r},e.prototype.oq=function(e){return null!=e&&""!==e&&!!e.includes("--\x3e")},e.prototype.pq=function(e){var t={},n=[];return e.forEach(function(e){null==e.identifier&&(t=r(r({},t),e.style));var i=n.findIndex(function(t){return t.identifier===e.identifier});-1!==i?n[i]={identifier:e.identifier,style:r(r({},n[i].style),e.style)}:n.push(e)}),i.getPlaceholderVttStyleProperties().forEach(function(e){n.find(function(t){return t.identifier===e.identifier})||n.push(e)}),{globalStyle:t,contentStyles:n}},e.prototype.qq=function(e,t){var n=i.stringifyCssProperties(t);n&&(e.html.setAttribute("style",n),e.subCues.forEach(function(e){e.html.setAttribute("style",n)}))},e.prototype.rq=function(e,t,n,r){var o=function(e){var t=e.indexOf("--\x3e");return t<0?{start:null,end:null}:{start:i.parseTime(e.substring(0,t).trim()),end:i.parseTime(e.substring(t+3).trim())}}(e[t]),l=o.start,a=o.end;if(null!==l&&null!==a){for(var c,f=function(e,t){return e.slice(t).join("\n").trim()}(e,t+1),p=f.split(u),v="",d=f.replace(u,""),b=l,g=[],y=0;y<p.length;y+=2){var m=p[y],h=p[y+1],x=h?i.parseTime(h):a,P=null!=x?x:a;if(b!==P){var A=s(m,v,d=d.substring(m.length));v+=m;var N=i.parseContents(A,r,n);null==c?c=N:g.push({updateTime:b,html:N}),b=P}}if(null!=c)return{start:l,end:a,html:c,subCues:g}}},e.prototype.sq=function(e,t,n){var i=r({},t);if(n)for(var u="#"+n,o=0,l=e;o<l.length;o++){var a=l[o];a.identifier===u&&Object.assign(i,a.style)}return i},e.prototype.tq=function(e,t,n){for(var r=[],u=0,o=t.regions,a=t.styles,s=this.pq(a),c=s.globalStyle,f=s.contentStyles,p=0,v=e;p<v.length;p++){var d=v[p];if(this.nq(d[0])){var b=void 0,g=0;d[0].includes("--\x3e")||(b=d[0].trim(),g=1);var y=this.uq(b,u);if(u=y,this.oq(d[g])){var m=i.parseOptions(d[g],o);m.id=b;var h=this.rq(d,g,f,n.base);if(void 0!==h){var x=this.sq(f,c,b);this.qq(h,x);var P=l(h,y,n,m);r.push(P)}}}}return r},e.prototype.uq=function(e,t){var n=Number(e);return null==e||isNaN(n)?t+1:n},e}();function l(e,t,n,u){var o,l,s=a();return s.i=t,s.start=e.start+n.base,s.end=e.end+n.base,s.text=(null===(o=e.html)||void 0===o?void 0:o.textContent)||(null===(l=e.html)||void 0===l?void 0:l.innerText)||"",s.html=i.stringifyCueHtml(e.html),s.vtt=r({},u),0!==n.vtt&&(s.offset=n.vtt),s.updates=e.subCues.map(function(e){return{updateTime:e.updateTime+n.base,html:i.stringifyCueHtml(e.html)}}),s}function a(){return{i:null,start:null,end:null,text:null,html:null,vtt:i.getDefaultVttProperties(),offset:null,updates:[]}}function s(e,t,n){return(t?c(t,"cue-past"):"")+e+(n?c(n,"cue-future"):"")}function c(e,t){return"<c.".concat(t,">").concat(e,"</c>")}t.WebVttParser=o,t.default=o},39157:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.parseContents=function(e,t,n){var u=r.ModuleManager.get(i.ModuleName.Subtitles).createHtmlElement("span");return v({input:e,root:u,current:u,tagStack:[],offset:t,styles:n})};var r=n(88052),i=n(62756),u=n(99735),o=n(69041),l=[[/&/g,"&"],[/</g,"<"],[/>/g,">"],[/‎/g,""],[/‏/g,""],[/ /g," "]],a={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},s={v:"title",lang:"lang"},c={rt:"ruby"},f={"cue-future":":future","cue-past":":past"},p=2;function v(e){var t=function(e){if(!e)return null;var t=/^([^<]*)(<[^>]+>?)?/.exec(e);if(!t)return null;var n=t[1],r=t[2];return n||r}(e.input);return null==t?e.root:(e.input=e.input.substring(t.length),function(e,t){if("<"!==e[0]){var n=t.current.ownerDocument.createTextNode(function(e){for(var t=0,n=l;t<n.length;t++){var r=n[t],i=r[0],u=r[1];e=e.replace(i,u)}return e}(e));return t.current.appendChild(n),v(t)}if("/"===e[1])return function(e,t){return t.length>0&&t[t.length-1]===e.substring(p).replace(">","")}(e,t.tagStack)&&(t.tagStack.pop(),t.current=t.current.parentNode),v(t);var r=(0,o.parseTime)(e.substring(1,e.length-1));if(null!=r){var i=t.current.ownerDocument.createComment("time: ".concat(r+t.offset));return t.current.appendChild(i),v(t)}var u=/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/.exec(e);if(!u)return v(t);var b=u[0],g=u[1],y=u[2],m=u[3],h=function(e,t,n){var r=a[e];if(!r)return null;var i=n.createElement(r),u=s[e];return u&&t&&(i[u]=t.trim()),i}(g,m,t.current.ownerDocument);return h&&function(e,t){return!c[t.localName]||c[t.localName]===e.localName}(t.current,h)?(function(e,t,n){var r=function(e,t){var n,r,i,u="",l="",a={};if(t.type&&"v"!==t.type&&(a=null!==(n=d(e,t.type))&&void 0!==n?n:a),t.contents){a={};for(var s=t.contents.substring(1).split("."),c=0,p=s;c<p.length;c++){var v=p[c],b=d(e,f[v]||".".concat(v));b&&Object.assign(a,b)}u=s.join(" ").trim()}return"v"===t.type&&t.annotation&&(l=t.annotation.substring(1),a=null!==(r=d(e,"".concat(t.type,'[voice="').concat(l,'"]')))&&void 0!==r?r:a),{className:u,title:l,styleString:null!==(i=(0,o.stringifyCssProperties)(a))&&void 0!==i?i:""}}(t,n),i=r.className,u=r.title,l=r.styleString;u&&(e.title=u),i&&(e.className=i),l&&e.setAttribute("style",l)}(h,t.styles,{type:g,contents:y,annotation:m}),t.tagStack.push(b[1]),t.current.appendChild(h),t.current=h,v(t)):v(t)}(t,e))}function d(e,t){for(var n=0,r=e;n<r.length;n++)if((l=r[n]).identifier===t)return l.style;for(var i=0,o=u.webVttDefaultClassStyles;i<o.length;i++){var l;if((l=o[i]).identifier===t)return l.style}}},99735:function(e,t){var n=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,u=t.length;i<u;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.webVttDefaultClassStyles=void 0;var r=["white","lime","cyan","red","yellow","magenta","blue","black"];t.webVttDefaultClassStyles=n(n([],r.map(function(e){return{identifier:".".concat(e),style:{color:e}}}),!0),r.map(function(e){return{identifier:".bg_".concat(e),style:{background:e}}}),!0)},76171:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.parseOptions=function(e,t){for(var n=e.split(/\s/),r=(0,i.getDefaultVttProperties)(),o=0,l=n;o<l.length;o++){var a=l[o],s=a.indexOf(":");-1!==s&&u(a.substring(0,s),a.substring(s+1),t,r)}return function(e){var t=(0,i.getDefaultVttProperties)();null!=e.region&&(e.vertical!==t.vertical||e.size!==t.size||e.line!==t.line)&&delete e.region}(r),r},t.setOptionProperty=u;var r=n(23068),i=n(69041);function u(e,t,n,u){switch(e){case"region":!function(e,t,n){var r=t.find(function(t){return t.id===e});null!=r&&(n.region=r)}(t,n,u);break;case"vertical":!function(e,t){var n=(0,i.ensureArray)(/^(lr|rl)$/.exec(e))[1];null!=n&&(t.vertical=n)}(t,u);break;case"align":!function(e,t){var n=(0,i.ensureArray)(/^(start|middle|center|end|left|right)$/.exec(e))[1];null!=n&&(t.align=n),t.positionAlign=o(void 0,t)}(t,u);break;case"size":!function(e,t){var n=(0,i.ensureArray)(/^([\d.]+)%$/.exec(e))[1];null!=n&&(t.size=Number(n))}(t,u);break;case"position":!function(e,t){var n=(0,i.ensureArray)(/^([\d.]+|auto)%?(?:,(line-left|line-right|center))?$/.exec(e)),r=n[1],u=n[2];"auto"===r?t.position="auto":void 0!==r&&(t.position=Number(r)),t.positionAlign=o(u,t)}(t,u);break;case"line":!function(e,t){var n=(0,i.ensureArray)(/^(-?[\d.]+|auto)(%)?(?:,(start|end|center|auto))?$/.exec(e)),u=n[1],o=n[2],l=n[3],a="%"===o;"auto"===u?t.line="auto":a?t.line="".concat(u,"%"):null!=e&&(t.line=Number(u)),null!=l&&(t.lineAlign=l),t.snapToLines=(0,r.isNumber)(t.line)}(t,u)}}function o(e,t){if(null!=e)return e;switch(t.align){case"start":case"left":return"line-left";case"end":case"right":return"line-right";default:return"center"}}},69041:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.getDefaultVttProperties=l,t.extractVttProperties=function(e){var t=l(),n=a();return Object.keys(t).forEach(function(i){var u=function(e,t,n){var i=t[e],u=n[e],o=String(i||u),l="line"===e;return("position"===e&&(0,r.isNumber)(i)||l&&!1===t.snapToLines)&&(o+="%"),o}(i,e,t);(0,o.setOptionProperty)(i,u,[n],t)}),t},t.getDefaultVttRegionProperties=a,t.parseTime=function(e){var t=/(?:(\d{1,}):)?(\d{2}):(\d{2})[.,](\d{3})/g.exec(e);if(null==t)return null;var n=t[1],r=t[2],i=t[3],u=t[4];return Number(u)/1e3+Number(i)+60*Number(r)+3600*(Number(n)||0)},t.ensureArray=function(e){return Array.isArray(e)?e:[]},t.stringifyCssProperties=function(e){return e?Object.entries(e).map(function(e){return"".concat(e[0],":").concat(e[1],";")}).join(""):null},t.stringifyCueHtml=function(e){return(0,i.ModuleManager.get(u.ModuleName.Subtitles).HtmlTransformer.prepareHtml)((null==e?void 0:e.outerHTML)||"")};var r=n(23068),i=n(88052),u=n(62756),o=n(76171);function l(){return{vertical:"",align:"center",size:100,line:"auto",lineAlign:"start",position:"auto",positionAlign:"center",snapToLines:!1}}function a(){return{id:null,width:100,lines:3,regionAnchorX:0,regionAnchorY:100,viewportAnchorX:0,viewportAnchorY:100,scroll:""}}},79347:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.parseRegions=function(e){for(var t=[],n=0,r=e;n<r.length;n++){var o=r[n];if(o=o.trim(),/^REGION$/i.test(o)){t.push(i(e));break}/^Region:/i.test(o)&&t.push(u(o))}return t};var r=n(69041);function i(e){return o(e.slice(1),":")}function u(e){return o(e.split(/[ \t]+/).slice(1),"=")}function o(e,t){var n=(0,r.getDefaultVttRegionProperties)();return e.forEach(function(e){!function(e,t){var n=e[0],i=e[1];switch(n){case"id":!function(e,t){null!=e&&(t.id=e)}(i,t);break;case"width":!function(e,t){var n=(0,r.ensureArray)(/^(\d{1,2}|100)%$/.exec(e))[1];null!=n&&(t.width=Number(n))}(i,t);break;case"lines":!function(e,t){var n=(0,r.ensureArray)(/^(\d+)$/.exec(e))[1];null!=n&&(t.lines=Number(n))}(i,t);break;case"regionanchor":!function(e,t){var n=(0,r.ensureArray)(/^(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(e)),i=n[1],u=n[2];null!=i&&(t.regionAnchorX=Number(i)),null!=u&&(t.regionAnchorY=Number(u))}(i,t);break;case"viewportanchor":!function(e,t){var n=(0,r.ensureArray)(/^(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(e)),i=n[1],u=n[2];null!=i&&(t.viewportAnchorX=Number(i)),null!=u&&(t.viewportAnchorY=Number(u))}(i,t);break;case"scroll":!function(e,t){var n=(0,r.ensureArray)(/^(up)$/.exec(e))[1];null!=n&&(t.scroll=n)}(i,t)}}(e.split(t),n)}),n}},22649:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.parseStyles=function(e){var t=[],n=/::cue(\((.+)\))?(?= |{)/,r=/([a-zA-Z0-9-]+):(.+?(?=;|}|$))/g,i=n.exec(e[1]);if(!i)return t;for(var u=1;u<e.length;u++){for(var o=n.exec(e[u]),l=null!==o,a=(i=l?o:i)[2],s={},c=r.exec(e[u]);null!==c;){var f=c[1],p=c[2];s[f]=p.trim(),c=r.exec(e[u])}(l||Object.keys(s).length>0)&&t.push({identifier:a,style:s})}return t},t.getPlaceholderVttStyleProperties=function(){return[{identifier:":future",style:{visibility:"hidden"}}]}},730:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(79347),t),i(n(39157),t),i(n(76171),t),i(n(69041),t),i(n(22649),t)}},function(e){return function(){return e(48519)}()}])});
|
|
17
|
+
"use strict";!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["subtitles-vtt"]=t():(e.bitmovin=e.bitmovin||{},e.bitmovin.player=e.bitmovin.player||{},e.bitmovin.player["subtitles-vtt"]=t())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[831],{48519:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.WebVttSubtitlesModuleDefinition=void 0;var r=n(62756),i=n(69041),u=n(1757);t.WebVttSubtitlesModuleDefinition={name:r.ModuleName.SubtitlesWebVTT,module:function(){return{WebVttParser:u.WebVttParser,extractVttProperties:i.extractVttProperties}},dependencies:[r.ModuleName.Subtitles]},t.default=t.WebVttSubtitlesModuleDefinition},1757:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.WebVttParser=void 0;var i=n(730),u=/(<\d+:\d{2}:\d{2}[.,]\d{3}>)/g,o=function(){function e(){}return e.prototype.parse=function(e,t){return void 0===t&&(t=0),(e=e.replace(/\r\n/gm,"\n")).startsWith("[EMBEDDEDWEBVTT]")?this.Zu(e):this.au(e,t)},e.prototype.Zu=function(e){var t,n,r=e.split("\n"),u=r[1],o=r[2],l=r[3],s=r[4],c=r.slice(5).join("\n"),f=a();f.start=Number(u),f.end=Number(o),f.i=Number(l);var p=i.parseContents(c,0,i.getPlaceholderVttStyleProperties());f.text=null!==(n=null!==(t=null==p?void 0:p.textContent)&&void 0!==t?t:null==p?void 0:p.innerText)&&void 0!==n?n:"";var v=i.stringifyCueHtml(p);if(f.html=v,s){var d=i.parseOptions(s,[]);f.vtt=d}return f.vtt.id=l,[f]},e.prototype.au=function(e,t){var n=e.split(/\n{2,}|^[WEBVTT\n+]?X-TIMESTAMP-MAP=.*\n+|^WEBVTT\n+/m).filter(function(e){return null!=e&&""!==e}).map(function(e){return e.split("\n")}),r=this.bu(e),i=this.cu(n),u={vtt:r,base:t};return this.ju(n,i,u)},e.prototype.bu=function(e){var t=/X-TIMESTAMP-MAP=(.*)\n/.exec(e);if(null==(null==t?void 0:t[1]))return 0;var n=t[0],r=/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m.exec(n),u=/MPEGTS:(\d+)/m.exec(n),o=0;if(null==r?void 0:r[1]){var l=i.parseTime(r[1]);null!=l&&(o=l)}var a=0;return null!=u&&(a=Number(u[1])),a/9e4-o},e.prototype.cu=function(e){for(var t=[],n=[],r=0,u=e;r<u.length;r++){var o=u[r],l=o[0];/^STYLE/.test(l.trim())&&n.push.apply(n,i.parseStyles(o)),/^region:?/i.test(l.trim())&&t.push.apply(t,i.parseRegions(o))}return{regions:t,styles:n}},e.prototype.du=function(e){var t=/^NOTE/.test(e),n=/^STYLE/.test(e),r=/^region:?/i.test(e);return!t&&!n&&!r},e.prototype.eu=function(e){return null!=e&&""!==e&&!!e.includes("--\x3e")},e.prototype.fu=function(e){var t={},n=[];return e.forEach(function(e){null==e.identifier&&(t=r(r({},t),e.style));var i=n.findIndex(function(t){return t.identifier===e.identifier});-1!==i?n[i]={identifier:e.identifier,style:r(r({},n[i].style),e.style)}:n.push(e)}),i.getPlaceholderVttStyleProperties().forEach(function(e){n.find(function(t){return t.identifier===e.identifier})||n.push(e)}),{globalStyle:t,contentStyles:n}},e.prototype.gu=function(e,t){var n=i.stringifyCssProperties(t);n&&(e.html.setAttribute("style",n),e.subCues.forEach(function(e){e.html.setAttribute("style",n)}))},e.prototype.hu=function(e,t,n,r){var o=function(e){var t=e.indexOf("--\x3e");return t<0?{start:null,end:null}:{start:i.parseTime(e.substring(0,t).trim()),end:i.parseTime(e.substring(t+3).trim())}}(e[t]),l=o.start,a=o.end;if(null!==l&&null!==a){for(var c,f=function(e,t){return e.slice(t).join("\n").trim()}(e,t+1),p=f.split(u),v="",d=f.replace(u,""),b=l,g=[],y=0;y<p.length;y+=2){var m=p[y],h=p[y+1],x=h?i.parseTime(h):a,P=null!=x?x:a;if(b!==P){var A=s(m,v,d=d.substring(m.length));v+=m;var N=i.parseContents(A,r,n);null==c?c=N:g.push({updateTime:b,html:N}),b=P}}if(null!=c)return{start:l,end:a,html:c,subCues:g}}},e.prototype.iu=function(e,t,n){var i=r({},t);if(n)for(var u="#"+n,o=0,l=e;o<l.length;o++){var a=l[o];a.identifier===u&&Object.assign(i,a.style)}return i},e.prototype.ju=function(e,t,n){for(var r=[],u=0,o=t.regions,a=t.styles,s=this.fu(a),c=s.globalStyle,f=s.contentStyles,p=0,v=e;p<v.length;p++){var d=v[p];if(this.du(d[0])){var b=void 0,g=0;d[0].includes("--\x3e")||(b=d[0].trim(),g=1);var y=this.ku(b,u);if(u=y,this.eu(d[g])){var m=i.parseOptions(d[g],o);m.id=b;var h=this.hu(d,g,f,n.base);if(void 0!==h){var x=this.iu(f,c,b);this.gu(h,x);var P=l(h,y,n,m);r.push(P)}}}}return r},e.prototype.ku=function(e,t){var n=Number(e);return null==e||isNaN(n)?t+1:n},e}();function l(e,t,n,u){var o,l,s=a();return s.i=t,s.start=e.start+n.base,s.end=e.end+n.base,s.text=(null===(o=e.html)||void 0===o?void 0:o.textContent)||(null===(l=e.html)||void 0===l?void 0:l.innerText)||"",s.html=i.stringifyCueHtml(e.html),s.vtt=r({},u),0!==n.vtt&&(s.offset=n.vtt),s.updates=e.subCues.map(function(e){return{updateTime:e.updateTime+n.base,html:i.stringifyCueHtml(e.html)}}),s}function a(){return{i:null,start:null,end:null,text:null,html:null,vtt:i.getDefaultVttProperties(),offset:null,updates:[]}}function s(e,t,n){return(t?c(t,"cue-past"):"")+e+(n?c(n,"cue-future"):"")}function c(e,t){return"<c.".concat(t,">").concat(e,"</c>")}t.WebVttParser=o,t.default=o},39157:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.parseContents=function(e,t,n){var u=r.ModuleManager.get(i.ModuleName.Subtitles).createHtmlElement("span");return v({input:e,root:u,current:u,tagStack:[],offset:t,styles:n})};var r=n(88052),i=n(62756),u=n(99735),o=n(69041),l=[[/&/g,"&"],[/</g,"<"],[/>/g,">"],[/‎/g,""],[/‏/g,""],[/ /g," "]],a={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},s={v:"title",lang:"lang"},c={rt:"ruby"},f={"cue-future":":future","cue-past":":past"},p=2;function v(e){var t=function(e){if(!e)return null;var t=/^([^<]*)(<[^>]+>?)?/.exec(e);if(!t)return null;var n=t[1],r=t[2];return n||r}(e.input);return null==t?e.root:(e.input=e.input.substring(t.length),function(e,t){if("<"!==e[0]){var n=t.current.ownerDocument.createTextNode(function(e){for(var t=0,n=l;t<n.length;t++){var r=n[t],i=r[0],u=r[1];e=e.replace(i,u)}return e}(e));return t.current.appendChild(n),v(t)}if("/"===e[1])return function(e,t){return t.length>0&&t[t.length-1]===e.substring(p).replace(">","")}(e,t.tagStack)&&(t.tagStack.pop(),t.current=t.current.parentNode),v(t);var r=(0,o.parseTime)(e.substring(1,e.length-1));if(null!=r){var i=t.current.ownerDocument.createComment("time: ".concat(r+t.offset));return t.current.appendChild(i),v(t)}var u=/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/.exec(e);if(!u)return v(t);var b=u[0],g=u[1],y=u[2],m=u[3],h=function(e,t,n){var r=a[e];if(!r)return null;var i=n.createElement(r),u=s[e];return u&&t&&(i[u]=t.trim()),i}(g,m,t.current.ownerDocument);return h&&function(e,t){return!c[t.localName]||c[t.localName]===e.localName}(t.current,h)?(function(e,t,n){var r=function(e,t){var n,r,i,u="",l="",a={};if(t.type&&"v"!==t.type&&(a=null!==(n=d(e,t.type))&&void 0!==n?n:a),t.contents){a={};for(var s=t.contents.substring(1).split("."),c=0,p=s;c<p.length;c++){var v=p[c],b=d(e,f[v]||".".concat(v));b&&Object.assign(a,b)}u=s.join(" ").trim()}return"v"===t.type&&t.annotation&&(l=t.annotation.substring(1),a=null!==(r=d(e,"".concat(t.type,'[voice="').concat(l,'"]')))&&void 0!==r?r:a),{className:u,title:l,styleString:null!==(i=(0,o.stringifyCssProperties)(a))&&void 0!==i?i:""}}(t,n),i=r.className,u=r.title,l=r.styleString;u&&(e.title=u),i&&(e.className=i),l&&e.setAttribute("style",l)}(h,t.styles,{type:g,contents:y,annotation:m}),t.tagStack.push(b[1]),t.current.appendChild(h),t.current=h,v(t)):v(t)}(t,e))}function d(e,t){for(var n=0,r=e;n<r.length;n++)if((l=r[n]).identifier===t)return l.style;for(var i=0,o=u.webVttDefaultClassStyles;i<o.length;i++){var l;if((l=o[i]).identifier===t)return l.style}}},99735:function(e,t){var n=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,u=t.length;i<u;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.webVttDefaultClassStyles=void 0;var r=["white","lime","cyan","red","yellow","magenta","blue","black"];t.webVttDefaultClassStyles=n(n([],r.map(function(e){return{identifier:".".concat(e),style:{color:e}}}),!0),r.map(function(e){return{identifier:".bg_".concat(e),style:{background:e}}}),!0)},76171:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.parseOptions=function(e,t){for(var n=e.split(/\s/),r=(0,i.getDefaultVttProperties)(),o=0,l=n;o<l.length;o++){var a=l[o],s=a.indexOf(":");-1!==s&&u(a.substring(0,s),a.substring(s+1),t,r)}return function(e){var t=(0,i.getDefaultVttProperties)();null!=e.region&&(e.vertical!==t.vertical||e.size!==t.size||e.line!==t.line)&&delete e.region}(r),r},t.setOptionProperty=u;var r=n(23068),i=n(69041);function u(e,t,n,u){switch(e){case"region":!function(e,t,n){var r=t.find(function(t){return t.id===e});null!=r&&(n.region=r)}(t,n,u);break;case"vertical":!function(e,t){var n=(0,i.ensureArray)(/^(lr|rl)$/.exec(e))[1];null!=n&&(t.vertical=n)}(t,u);break;case"align":!function(e,t){var n=(0,i.ensureArray)(/^(start|middle|center|end|left|right)$/.exec(e))[1];null!=n&&(t.align=n),t.positionAlign=o(void 0,t)}(t,u);break;case"size":!function(e,t){var n=(0,i.ensureArray)(/^([\d.]+)%$/.exec(e))[1];null!=n&&(t.size=Number(n))}(t,u);break;case"position":!function(e,t){var n=(0,i.ensureArray)(/^([\d.]+|auto)%?(?:,(line-left|line-right|center))?$/.exec(e)),r=n[1],u=n[2];"auto"===r?t.position="auto":void 0!==r&&(t.position=Number(r)),t.positionAlign=o(u,t)}(t,u);break;case"line":!function(e,t){var n=(0,i.ensureArray)(/^(-?[\d.]+|auto)(%)?(?:,(start|end|center|auto))?$/.exec(e)),u=n[1],o=n[2],l=n[3],a="%"===o;"auto"===u?t.line="auto":a?t.line="".concat(u,"%"):null!=e&&(t.line=Number(u)),null!=l&&(t.lineAlign=l),t.snapToLines=(0,r.isNumber)(t.line)}(t,u)}}function o(e,t){if(null!=e)return e;switch(t.align){case"start":case"left":return"line-left";case"end":case"right":return"line-right";default:return"center"}}},69041:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.getDefaultVttProperties=l,t.extractVttProperties=function(e){var t=l(),n=a();return Object.keys(t).forEach(function(i){var u=function(e,t,n){var i=t[e],u=n[e],o=String(i||u),l="line"===e;return("position"===e&&(0,r.isNumber)(i)||l&&!1===t.snapToLines)&&(o+="%"),o}(i,e,t);(0,o.setOptionProperty)(i,u,[n],t)}),t},t.getDefaultVttRegionProperties=a,t.parseTime=function(e){var t=/(?:(\d{1,}):)?(\d{2}):(\d{2})[.,](\d{3})/g.exec(e);if(null==t)return null;var n=t[1],r=t[2],i=t[3],u=t[4];return Number(u)/1e3+Number(i)+60*Number(r)+3600*(Number(n)||0)},t.ensureArray=function(e){return Array.isArray(e)?e:[]},t.stringifyCssProperties=function(e){return e?Object.entries(e).map(function(e){return"".concat(e[0],":").concat(e[1],";")}).join(""):null},t.stringifyCueHtml=function(e){return(0,i.ModuleManager.get(u.ModuleName.Subtitles).HtmlTransformer.prepareHtml)((null==e?void 0:e.outerHTML)||"")};var r=n(23068),i=n(88052),u=n(62756),o=n(76171);function l(){return{vertical:"",align:"center",size:100,line:"auto",lineAlign:"start",position:"auto",positionAlign:"center",snapToLines:!1}}function a(){return{id:null,width:100,lines:3,regionAnchorX:0,regionAnchorY:100,viewportAnchorX:0,viewportAnchorY:100,scroll:""}}},79347:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.parseRegions=function(e){for(var t=[],n=0,r=e;n<r.length;n++){var o=r[n];if(o=o.trim(),/^REGION$/i.test(o)){t.push(i(e));break}/^Region:/i.test(o)&&t.push(u(o))}return t};var r=n(69041);function i(e){return o(e.slice(1),":")}function u(e){return o(e.split(/[ \t]+/).slice(1),"=")}function o(e,t){var n=(0,r.getDefaultVttRegionProperties)();return e.forEach(function(e){!function(e,t){var n=e[0],i=e[1];switch(n){case"id":!function(e,t){null!=e&&(t.id=e)}(i,t);break;case"width":!function(e,t){var n=(0,r.ensureArray)(/^(\d{1,2}|100)%$/.exec(e))[1];null!=n&&(t.width=Number(n))}(i,t);break;case"lines":!function(e,t){var n=(0,r.ensureArray)(/^(\d+)$/.exec(e))[1];null!=n&&(t.lines=Number(n))}(i,t);break;case"regionanchor":!function(e,t){var n=(0,r.ensureArray)(/^(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(e)),i=n[1],u=n[2];null!=i&&(t.regionAnchorX=Number(i)),null!=u&&(t.regionAnchorY=Number(u))}(i,t);break;case"viewportanchor":!function(e,t){var n=(0,r.ensureArray)(/^(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(e)),i=n[1],u=n[2];null!=i&&(t.viewportAnchorX=Number(i)),null!=u&&(t.viewportAnchorY=Number(u))}(i,t);break;case"scroll":!function(e,t){var n=(0,r.ensureArray)(/^(up)$/.exec(e))[1];null!=n&&(t.scroll=n)}(i,t)}}(e.split(t),n)}),n}},22649:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.parseStyles=function(e){var t=[],n=/::cue(\((.+)\))?(?= |{)/,r=/([a-zA-Z0-9-]+):(.+?(?=;|}|$))/g,i=n.exec(e[1]);if(!i)return t;for(var u=1;u<e.length;u++){for(var o=n.exec(e[u]),l=null!==o,a=(i=l?o:i)[2],s={},c=r.exec(e[u]);null!==c;){var f=c[1],p=c[2];s[f]=p.trim(),c=r.exec(e[u])}(l||Object.keys(s).length>0)&&t.push({identifier:a,style:s})}return t},t.getPlaceholderVttStyleProperties=function(){return[{identifier:":future",style:{visibility:"hidden"}}]}},730:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(79347),t),i(n(39157),t),i(n(76171),t),i(n(69041),t),i(n(22649),t)}},function(e){return function(){return e(48519)}()}])});
|
|
18
18
|
})();
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
* This software includes open-source components. See THIRD_PARTY_NOTICES
|
|
10
10
|
* in the distribution for details.
|
|
11
11
|
*
|
|
12
|
-
* Bitmovin Player Version 8.
|
|
12
|
+
* Bitmovin Player Version 8.281.0
|
|
13
13
|
*
|
|
14
14
|
****************************************************************************/
|
|
15
15
|
|
|
16
16
|
(function() {
|
|
17
|
-
"use strict";!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.subtitles=e():(t.bitmovin=t.bitmovin||{},t.bitmovin.player=t.bitmovin.player||{},t.bitmovin.player.subtitles=e())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[482],{82657:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},37723:function(t,e){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.EnabledSubtitlesTracker=void 0;var i=function(){function t(){this.aU={},this.bU=0}return t.prototype.addSubtitle=function(t){this.removeSubtitle(t.id),this.aU[this.dU()]=n({isFragmented:!1},t)},t.prototype.removeSubtitle=function(t){var e=this;Object.keys(this.aU).forEach(function(n){e.aU[n].id===t&&delete e.aU[n]})},t.prototype.shouldEnableSubtitle=function(t,e){var n=this,i=Object.keys(this.aU).find(function(i){return n.cU(n.aU[i],e)===t.id});return Boolean(i)},t.prototype.cU=function(t,e){var n=t.id,i=t.kind,o=t.lang,a=t.isFragmented;return r({lang:o,kind:i,isFragmented:a,id:n},e)||r({lang:o,kind:i,isFragmented:a},e)||r({lang:o,kind:i},e)},t.prototype.dU=function(){return this.bU++,this.bU},t.prototype.dispose=function(){this.aU={},this.bU=0},t}();function r(t,e){return Object.keys(e).find(function(n){var i=e[n].getSubtitle(),r=i.id,o=i.lang,a=i.isFragmented,u=i.kind,s=r===t.id,l=!t.isFragmented||a===t.isFragmented,c=o===t.lang;t.isPreferred&&t.lang&&(c=o.includes(t.lang)||t.lang.includes(o));var d=u===t.kind&&c&&l;return s||d})}e.EnabledSubtitlesTracker=i},53396:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.ForcedSubtitleController=void 0;var i=n(55552),r=function(){function t(){this.eU={}}return t.prototype.addSubtitleHandler=function(t){this.eU[t.getSubtitle().id]=t},t.prototype.deactivate=function(){return this.gU()?Promise.all(Object.values(this.eU).map(function(t){return t.deactivate()})).then(function(){}):Promise.resolve()},t.prototype.activate=function(t){var e=this;return void 0===t&&(t=this.fU),this.gU()?(this.fU=t,this.deactivate().then(function(){var t=Object.values(e.eU).find(function(t){return(0,i.isEqualIsoLanguage)(t.getSubtitle().lang,e.fU)});if((t=null!=t?t:Object.values(e.eU)[0])&&!t.isActive())return t.activate().catch(function(){})})):Promise.resolve()},t.prototype.onSeek=function(t,e){Object.values(this.eU).forEach(function(n){return n.onSeek(t,e)})},t.prototype.onSeeked=function(t,e){Object.values(this.eU).forEach(function(n){return n.onSeeked(t,e)})},t.prototype.dispose=function(){Object.values(this.eU).forEach(function(t){return t.dispose()}),this.eU=null},t.prototype.gU=function(){return Object.keys(this.eU).length>0},t.prototype.getForcedSubtitleHandler=function(t){if(this.eU)return Object.values(this.eU).find(function(e){return t(e)})},t}();e.ForcedSubtitleController=r},42009:function(t,e){function n(t){return t.replace(/<[^>]*>?/g,"")}function i(t){return t.replace(/<br\s*\/?>/g,"\n")}Object.defineProperty(e,"__esModule",{value:!0}),e.htmlToText=function(t){return n(i(t))},e.stripHtmlTags=n,e.prepareHtml=function(t){return t.replace(/(\r\n|\r|\n)/g,"<br />")},e.replaceHtmlBreakPointsWithNewLine=i,e.stripAwayHtmlBreakPoints=function(t){return t.replace(/<br\s*\/?>/g,"")}},55552:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.isEqualIsoLanguage=function(t,e){var n;if(void 0===e)return!1;if(null===(n=window.Intl)||void 0===n?void 0:n.DisplayNames){var i=new window.Intl.DisplayNames(["en"],{type:"language"});try{return i.of(t.split("-")[0])===i.of(e.split("-")[0])}catch(t){}}return t===e}},86058:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.parseMP4WrappedSubtitles=function(t,e){var n=t.getTimescale();if(void 0===n||!a.ModuleManager.has(u.ModuleName.ContainerMP4))return[];var o=a.ModuleManager.get(u.ModuleName.ContainerMP4);return function(t,e,n){var o=0,a=[],u=0;return t.forEach(function(t){var c=r.CodecStringHelper.extractCodec(e.getCodec()),d=t.duration/n,f=e.getPlaybackTime()+o,p=f+d;if(o+=d,"wvtt"===c||"vtt"===c){var v=function(t,e,n,r){for(var o=t.data.buffer,a=t.data.byteOffset,u=0,s=[],c="",d="";u<t.data.byteLength;){var f=t.data.getUint32(u),p=a+u,v=i.ArrayHelper.convertBufferSourceToUTF8(new Uint8Array(o,p+4,4));if("vttc"===v){if(c){var h=l(e,n,r,d,c);s.push(h),r+=1,c="",d=""}u+=8}else"payl"===v?(c=i.ArrayHelper.convertBufferSourceToUTF8(new Uint8Array(o,p+8,f-8)),u+=f):"sttg"===v?(d=i.ArrayHelper.convertBufferSourceToUTF8(new Uint8Array(o,p+8,f-8)),u+=f):u+=f}return c&&(h=l(e,n,r,d,c),s.push(h)),s}(t,f,p,u);u+=v.length,v.forEach(function(t){a.push({start:f,end:p,text:t})})}else"stpp"===c&&a.push({start:f,end:p,text:s(t)})}),a}(o.getMp4Fragments(t).flatMap(function(n){return o.getTrackSamples(n.moof,n.mdat,t,e)}),t,n)};var i=n(74853),r=n(34047),o=n(66502),a=n(88052),u=n(62756);function s(t){var e=new Uint8Array(t.data.buffer,t.data.byteOffset,t.data.byteLength);return i.ArrayHelper.convertBufferSourceToUTF8(e,o.TextSegmentAnalyzer.detectEncoding(t.data))}function l(t,e,n,i,r){return["[EMBEDDEDWEBVTT]",t,e,n,i,r].join("\n")}},52112:function(t,e,n){var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(e,n);r&&!("get"in r?!e.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,i,r)}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||i(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.SubtitleModuleDefinition=void 0;var o=n(62756),a=n(71340),u=n(42009),s=n(55552),l=n(78717),c=n(26438),d=n(606),f=n(85224);e.SubtitleModuleDefinition={name:o.ModuleName.Subtitles,module:function(){return{SubtitleService:d.SubtitleService,SubtitleParserFactory:c.SubtitleParserFactory,PlayerSubtitlesApiFactory:l.PlayerSubtitlesApiFactory,HtmlTransformer:u,LanguageComparer:s,hashCode:a.hashCode,createHtmlElement:f.createHtmlElement}},dependencies:[o.ModuleName.EngineBitmovin]},e.default=e.SubtitleModuleDefinition,r(n(82657),e)},15569:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.parsePlainTextSubtitles=function(t){var e,n,o=r.TextSegmentAnalyzer.detectEncoding(t.getData()),a=i.ArrayHelper.convertBufferSourceToUTF8(t.getData(),o),u=null!==(e=t.getPlaybackTime())&&void 0!==e?e:0;return[{start:u,end:u+(null!==(n=t.getDuration())&&void 0!==n?n:0),text:a}]};var i=n(74853),r=n(66502)},78717:function(t,e,n){var i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},i.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.PlayerSubtitlesApiFactory=void 0;var r=n(3714),o=function(){function t(){}return t.build=function(t){return new(function(){function e(){}return e.prototype.add=function(e){t.addSubtitle(e)},e.prototype.remove=function(e){t.removeSubtitle(e)},e.prototype.list=function(){return t.listSubtitles()},e.prototype.enable=function(e,n){void 0===n&&(n=!0),t.enableSubtitle(e,n)},e.prototype.disable=function(e){t.disableSubtitle(e)},e.prototype.cueEnter=function(e){t.fireEvent(r.PlayerEvent.CueEnter,i(i({},e),{type:r.PlayerEvent.CueEnter}))},e.prototype.cueExit=function(e){t.fireEvent(r.PlayerEvent.CueExit,i(i({},e),{type:r.PlayerEvent.CueExit}))},e}())},t}();e.PlayerSubtitlesApiFactory=o},26438:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.SubtitleParserFactory=void 0;var i=n(3714),r=n(88052),o=n(62756),a=n(22374),u=function(){function t(){}return t.createInstance=function(t,e){var n;return e.indexOf("<?")>-1||e.indexOf("<tt")>-1?r.ModuleManager.has(o.ModuleName.SubtitlesTTML)?n=new(0,r.ModuleManager.get(o.ModuleName.SubtitlesTTML).TTMLParser)(t):t.eventHandler.dispatchEvent(i.PlayerEvent.Warning,new a.PlayerModuleMissingWarning(o.ModuleName.SubtitlesTTML,"The ".concat(o.ModuleName.SubtitlesTTML," module is required to parse TTML subtitles."))):r.ModuleManager.has(o.ModuleName.SubtitlesWebVTT)?n=new(r.ModuleManager.get(o.ModuleName.SubtitlesWebVTT).WebVttParser):t.eventHandler.dispatchEvent(i.PlayerEvent.Warning,new a.PlayerModuleMissingWarning(o.ModuleName.SubtitlesWebVTT,"The ".concat(o.ModuleName.SubtitlesWebVTT," module is required to parse WebVTT subtitles."))),n},t}();e.SubtitleParserFactory=u},606:function(t,e,n){var i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},i.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.SubtitleService=void 0;var r=n(80813),o=n(56481),a=n(3714),u=n(91678),s=n(93204),l=n(34047),c=n(85434),d=n(70850),f=n(88052),p=n(62756),v=n(22374),h=n(37723),g=n(53396),y=n(39310),b=n(60672),m=n(88788),S=n(69363),M=n(74715),U=function(){function t(t){var e=this;this.context=t,this.getTransmuxer=function(){return e.it},this.At=function(){e.zt()},this.Gt=function(t){var n;e.zt(),e.nt=t.position;var i=null!==(n=e.nt)&&void 0!==n?n:0,r=function(t){return function(t){return"seekTarget"in t}(t)?t.seekTarget:t.target}(t);Object.values(e.ft).forEach(function(t){return t.onSeek(i,r)}),e.lt.onSeek(i,r)},this.Ht=function(){var t,n=null!==(t=e.nt)&&void 0!==t?t:0,i=e.context.internalPlayer.getCurrentTime();Object.values(e.ft).forEach(function(t){return t.onSeeked(n,i)}),e.lt.onSeeked(n,i)},this.Vu=function(t,n){e.context.logger.debug("Switching periods in subtitleService");var i=e.ht.findPeriod(t);i?(e.Uu(t,n),e.setupControllersForNextPeriod(i),e.Wu()):e.context.logger.log("Can not find period with id = ".concat(t," in Manifest. Skipping period update"))},this.Yu=function(){Object.keys(e.ft).forEach(function(t){return e.ft[t].dispose()}),e.ft={},e.gt&&(e.gt.dispose(),e.gt=void 0),e.mt&&e.mt.reset()},this.ft={},this.jt=t.eventHandler,this.ht=t.serviceManager.get(r.ServiceName.ManifestService,t.sourceContext.sourceIdentifier),this.kt=new h.EnabledSubtitlesTracker,this.lt=new g.ForcedSubtitleController,this.jt.on(a.PlayerEvent.Seek,this.Gt),this.jt.on(a.PlayerEvent.TimeShift,this.Gt),this.jt.on(a.PlayerEvent.Seeked,this.Ht),this.jt.on(a.PlayerEvent.TimeShifted,this.Ht),this.jt.on(a.PlayerEvent.SourceUnloaded,this.Yu),this.pt=f.ModuleManager.has(p.ModuleName.SubtitlesCEA608)?f.ModuleManager.get(p.ModuleName.SubtitlesCEA608):void 0,this.rt()}return t.prototype.qt=function(t,e){var n=t!==e,i=this.ht.isHlsManifest()&&!(e||!t);return n||i},t.prototype.rt=function(){var t=this,e=this.context.serviceManager.get(r.ServiceName.SourceStoreService,this.context.sourceContext.sourceIdentifier);this.ot=(0,s.subscribe)(e)(f.ModuleManager.get(p.ModuleName.EngineBitmovin).selectors.getPlayingPeriodId,this.Vu,function(e,n){return t.qt(e,n)})},t.prototype.setupControllersForNextPeriod=function(t){var e=this;t.AdaptationSet.forEach(function(t){var n=t._mimeType;(0,M.isSubtitleTrack)(n,e.ht.isHlsManifest())&&e.st(t,n)})},t.prototype.st=function(t,e){if((0,M.isFragmentedAdaptationSet)(t))return this.context.store.dispatch((0,u.initializeMetricsForMimeType)(e,this.context.settings)),void this.tt(t,e);this.ut(t,e)},t.prototype.tt=function(t,e){var n=this.context.sourceContext.sourceIdentifier,i=this.context.serviceManager.get(r.ServiceName.SourceStoreService,this.context.sourceContext.sourceIdentifier);if(i){var o={mimeType:e,codec:f.ModuleManager.get(p.ModuleName.EngineBitmovin).getCodecsFromAdaptationSet(t),isHls:this.ht.isHlsManifest(),manifestLoader:this.context.serviceManager.get(r.ServiceName.ManifestLoadingService,n),periodId:t._internalId.periodId,sourceStore:i};this.addFragmentSubtitle(o,t)}},t.prototype.ut=function(t,e){if(f.ModuleManager.has(p.ModuleName.DASH)){var n=new(f.ModuleManager.get(p.ModuleName.DASH).SegmentTemplateMPDHandler)(this.context,this.context.sourceContext),i=this.ht.toSubtitleTrack(t,e);n.setAdaptationSetId(t._internalId),i.url=n.getSubtitleUrl().toString(),this.addExternalSubtitle(i,t)}},t.prototype.setTransmuxer=function(t){this.it=t},t.prototype.hasSubtitle=function(t){return Boolean(this.ft[t])},t.prototype.enableSubtitle=function(t){var e=this,n=this.ft[t];return n&&!n.isActive()?n.activate().then(function(){n.refresh(),e.lt.deactivate()}).then(function(){return e.kt.addSubtitle(n.getSubtitle()),!0}).catch(function(t){return e.context.logger.debug("Error during subtitle activation",t),!1}):Promise.resolve(!1)},t.prototype.addExternalSubtitle=function(t,e){if(void 0===e&&(e=null),t.id||(t.id=t.url),this.vt(t,e))return t;var n=new b.ExternalFileSubtitleHandler(this.context,t,e);return this.wt(n),t},t.prototype.vt=function(t,e){var n,i,r=this.ft[t.id],o=null!==(n=null==r?void 0:r.periodId)&&void 0!==n?n:null,a=null!==(i=null==e?void 0:e._internalId.periodId)&&void 0!==i?i:null;return r&&o===a?r:this.lt.getForcedSubtitleHandler(function(e){var n,i=e.getSubtitle().id===t.id,r=(null!==(n=e.periodId)&&void 0!==n?n:null)===a;return i&&r})},t.prototype.wt=function(t){var e=t.getSubtitle(),n=this.context.config.playback.isForcedSubtitle;if("function"==typeof n?(0,d.safeUserCallback)(function(){return n(e)},this.context.logger):e.forced)this.lt.addSubtitleHandler(t);else{var i=!1,r=e.id;this.ft[r]&&(i=this.ft[r].isActive(),this.Xu(r)),this.xt(t),i&&t.activate()}},t.prototype.xt=function(t){var e=t.getSubtitle();this.yt(e),this.ft[e.id]=t,this.Su(e)},t.prototype.yt=function(t){var e,n,i=this.context.sourceContext.source.labeling,r=this.ht.isHlsManifest()?null===(e=null==i?void 0:i.hls)||void 0===e?void 0:e.subtitles:null===(n=null==i?void 0:i.dash)||void 0===n?void 0:n.subtitles;"function"==typeof r&&(t.label=(0,d.safeUserCallback)(function(){return r(t)},this.context.logger))},t.prototype.addFragmentSubtitle=function(t,e){if(!f.ModuleManager.has(p.ModuleName.EngineBitmovin))return this.context.logger.warn("Unable to add fragmented subtitles because MSE Module is missing"),null;var n=this.ht.toSubtitleTrack(e,t.mimeType);n.isFragmented=!0,n.url=null;var i=new m.FragmentedSubtitleHandler(this.context,t,n,this.getTransmuxer);return this.wt(i),n},t.prototype.setupCea608CaptionExtractor=function(t){var e;if(!this.pt)return this.jt.dispatchEvent(a.PlayerEvent.Warning,new v.PlayerModuleMissingWarning(p.ModuleName.SubtitlesCEA608,"The ".concat(p.ModuleName.SubtitlesCEA608," module is required to parse CEA captions."))),this.context.logger.log("CEA Caption parsing is disabled, because the Cea680 module is not loaded"),null;if(!f.ModuleManager.has(p.ModuleName.ContainerMP4))return this.jt.dispatchEvent(a.PlayerEvent.Warning,new v.PlayerModuleMissingWarning(p.ModuleName.ContainerMP4,"The ".concat(p.ModuleName.ContainerMP4," module is required to parse CEA captions."))),this.context.logger.log("CEA Caption parsing is disabled, because the ContainerMP4 module is not loaded"),null;this.gt&&this.gt.dispose();var n=f.ModuleManager.get(p.ModuleName.ContainerMP4),i=this.pt.Cea608Extractor;return this.gt=new i(t,n,null===(e=this.context.config.tweaks)||void 0===e?void 0:e.parse_cea_708_caption),this.gt},t.prototype.zt=function(){this.gt&&(this.context.logger.debug("Resetting CEA caption extractor..."),this.gt.reset())},t.prototype.Bt=function(){var t=f.ModuleManager.get(p.ModuleName.HLS);this.mt=new t.DiscontinuitySequenceNumberTracker(c.MimeTypeHelper.isVideo),this.mt.subscribe(this.At)},t.prototype.Ct=function(t){this.mt||this.Bt(),this.mt.trackSegment(t)},t.prototype.Dt=function(){return this.ht.getManifest()&&this.ht.isHlsManifest()&&f.ModuleManager.has(p.ModuleName.HLS)},t.prototype.handleClosedCaptions=function(t,e,n,i){var r;return!i&&c.MimeTypeHelper.isVideo(e.getMimeType())&&(null===(r=this.pt)||void 0===r?void 0:r.CEA_EXTRACTOR_SUPPORTED_CODEC_TAGS.includes((0,l.getCodecTag)(e)))?this.Et(e,t.getTimestampOffset()):(this.Ft(n,e.getPeriodId()),Promise.resolve())},t.prototype.Et=function(t,e){var n=this;return this.gt?(this.Dt()&&this.Ct(t),this.gt.extract(t).then(function(i){!function(t,e){t.forEach(function(t){t.start-=e,t.end-=e})}(i,e),i.length>0&&(n.context.logger.insane("Extracted Closed Captions from fMP4: "+JSON.stringify(i)),n.Ft(i,t.getPeriodId()))}).catch(function(t){var e;t instanceof v.PlayerModuleMissingWarning?(null===(e=n.gt)||void 0===e||e.dispose(),n.gt=void 0,n.jt.dispatchEvent(a.PlayerEvent.Warning,t)):n.context.logger.debug("Error parsing CEA-608 Captions from fMP4: "+t)})):Promise.resolve()},t.prototype.Ft=function(t,e){if(t&&Array.isArray(t)&&0!==t.length)for(var n=this.ht.getClosedCaptionLabels(e),i=function(t){var i=t.channel;if(!r.ft[i]){var o=n.find(function(t){return t.id===i})||{id:i,kind:"captions",lang:"unknown",label:"Captions (".concat(t.channel,")")};r.xt(new y.Cea608Handler(r.context,o))}r.ft[i].addCaption(t,e)},r=this,o=0,a=t;o<a.length;o++)i(a[o])},t.prototype.Su=function(t){this.jt.dispatchEvent(a.PlayerEvent.SubtitleAdded,{subtitle:i({},t)})},t.prototype.disableSubtitle=function(t){var e=this,n=this.ft[t];return n?n.deactivate().then(function(){return e.kt.removeSubtitle(t),0===e.getActiveSubtitles().length&&e.lt.activate().catch(function(){}),!0}).catch(function(){return!1}):Promise.resolve(!1)},t.prototype.disableAllSubtitles=function(){var t=this;this.getActiveSubtitles().forEach(function(e){return t.disableSubtitle(e.id)})},t.prototype.removeSubtitle=function(t){this.Xu(t),this.kt.removeSubtitle(t)},t.prototype.getActiveSubtitles=function(){var t=this;return Object.keys(this.ft).filter(function(e){return t.ft[e].isActive()}).map(function(e){return t.ft[e].getSubtitle()})},t.prototype.hasSubtitles=function(){return Object.keys(this.ft).length>0},t.prototype.getAvailableSubtitles=function(t){return Object.values(this.ft).filter(function(e){var n=e.periodId;return!n||t===n}).map(function(t){return t.getSubtitle()})},t.prototype.enableForcedSubtitle=function(t){this.lt.activate(t).catch(function(){})},t.prototype.Tu=function(t,e,n){var i=t.getSubtitleType()===S.SubtitleType.FRAGMENTED&&t.periodId===n,r=t.getSubtitleType()===S.SubtitleType.EXTERNAL_FILE&&t.periodId&&t.periodId!==e;return i||r},t.prototype.Uu=function(t,e){var n=this;Object.keys(this.ft).forEach(function(i){var r=n.ft[i];n.Tu(r,t,e)&&n.Xu(i)})},t.prototype.Wu=function(){var t=this;Object.keys(this.ft).forEach(function(e){var n,i=t.ft[e];if(!i.isActive()&&t.kt.shouldEnableSubtitle(i.getSubtitle(),t.ft)){var r={subtitle:i.getSubtitle()};null===(n=t.jt)||void 0===n||n.dispatchEvent(a.PlayerEvent.SubtitleEnable,r),i.activate().then(function(){var e;null===(e=t.jt)||void 0===e||e.dispatchEvent(a.PlayerEvent.SubtitleEnabled,r)})}})},t.prototype.Xu=function(t){if(this.ft[t]){var e=this.ft[t].getSubtitle();this.ft[t].dispose(),delete this.ft[t],this.jt&&this.jt.dispatchEvent(a.PlayerEvent.SubtitleRemoved,{subtitle:e})}},t.prototype.clearBuffersUntil=function(t){var e=this;Object.keys(this.ft).forEach(function(n){return e.ft[n].clearBuffersUntil(t)})},t.prototype.dispose=function(){this.Yu(),this.kt=(0,o.dispose)(this.kt),this.lt=(0,o.dispose)(this.lt),this.mt=(0,o.dispose)(this.mt),this.it=void 0,this.ht=null,this.jt.off(a.PlayerEvent.Seek,this.Gt),this.jt.off(a.PlayerEvent.TimeShift,this.Gt),this.jt.off(a.PlayerEvent.Seeked,this.Ht),this.jt.off(a.PlayerEvent.TimeShifted,this.Ht),this.jt.off(a.PlayerEvent.SourceUnloaded,this.Yu),this.ot(),this.ft={},this.jt=null},t}();e.SubtitleService=U},74715:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.isSubtitleTrack=function(t,e){return(i.MimeTypeHelper.isText(t)||i.MimeTypeHelper.isTtmlXml(t))&&!e||i.MimeTypeHelper.isApplication(t)},e.isFragmentedAdaptationSet=function(t){var e=[t];return t.Representation&&t.Representation.length>0&&e.push(t.Representation[0]),e.some(function(t){return t.SegmentList||t.SegmentTemplate||t.SegmentBase})};var i=n(85434)},74437:function(t,e,n){var i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},i.apply(this,arguments)},r=this&&this.__runInitializers||function(t,e,n){for(var i=arguments.length>2,r=0;r<e.length;r++)n=i?e[r].call(t,n):e[r].call(t);return i?n:void 0},o=this&&this.__esDecorate||function(t,e,n,i,r,o){function a(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var u,s=i.kind,l="getter"===s?"get":"setter"===s?"set":"value",c=!e&&t?i.static?t:t.prototype:null,d=e||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),f=!1,p=n.length-1;p>=0;p--){var v={};for(var h in i)v[h]="access"===h?{}:i[h];for(var h in i.access)v.access[h]=i.access[h];v.addInitializer=function(t){if(f)throw new TypeError("Cannot add initializers after decoration has completed");o.push(a(t||null))};var g=(0,n[p])("accessor"===s?{get:d.get,set:d.set}:d[l],v);if("accessor"===s){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(u=a(g.get))&&(d.get=u),(u=a(g.set))&&(d.set=u),(u=a(g.init))&&r.unshift(u)}else(u=a(g))&&("field"===s?r.unshift(u):d[l]=u)}c&&Object.defineProperty(c,i.name,d),f=!0};Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractSubtitleHandler=void 0;var a=n(80813),u=n(3714),s=n(80438),l=n(69957),c=n(44468),d=n(88052),f=n(62756),p=function(){var t,e,n=[];return t=function(){function t(t,e,i){void 0===i&&(i=null);var o=this;this.timeline=r(this,n),this.onCueEnter=function(t){o.context.eventHandler.dispatchEvent(u.PlayerEvent.CueEnter,v(t,o.getSubtitle().id))},this.onCueExit=function(t){o.context.eventHandler&&o.context.eventHandler.dispatchEvent(u.PlayerEvent.CueExit,v(t,o.getSubtitle().id))},this.onCueUpdate=function(t){o.context.eventHandler.dispatchEvent(u.PlayerEvent.CueUpdate,v(t,o.getSubtitle().id))},this.context=t,this.ucb=e,this.ucb.enabled=this.ucb.enabled||!1,this.timeline=new s.Timeline(t,{onCueEnter:this.onCueEnter,onCueExit:this.onCueExit,onCueUpdate:this.onCueUpdate}),this.timeline.stopListening(),this.periodId=i,this.vcb=t.serviceManager.get(a.ServiceName.SourceStoreService,t.sourceContext.sourceIdentifier)}return t.prototype.fireOnCueParsedEvents=function(t,e){var n=this;t&&this.context.eventHandler&&t.forEach(function(t){n.context.eventHandler.dispatchEvent(u.PlayerEvent.CueParsed,i(i({subtitleId:n.getSubtitle().id},t),{periodId:e}))})},t.prototype.isActive=function(){return this.ucb.enabled},t.prototype.activate=function(){return this.ucb.enabled=!0,this.timeline.startListening(),this.timeline.show(),Promise.resolve()},t.prototype.deactivate=function(){return this.ucb.enabled=!1,this.timeline.stopListening(),this.timeline.hide(),Promise.resolve()},t.prototype.refresh=function(){this.timeline.show()},t.prototype.getSubtitle=function(){return this.ucb},t.prototype.clearBuffersUntil=function(t){this.timeline.removeCuesUntil(t)},t.prototype.dispose=function(){this.vcb=null,this.deactivate(),this.timeline.dispose()},t.prototype.isTsContainer=function(){var t,e=d.ModuleManager.get(f.ModuleName.EngineBitmovin),n=e.selectors,i=e.mseModuleTypes;return(null===(t=n.getContainerFormat(this.vcb.getState(),c.MediaType.Video))||void 0===t?void 0:t.source)===i.containerFormat.TS},t.prototype.applyVttOffset=function(t){return this.isTsContainer()?t.map(function(t){return null!=t.offset?i(i({},t),{start:t.start+t.offset,end:t.end+t.offset,updates:t.updates.map(function(e){return i(i({},e),{updateTime:e.updateTime+t.offset})})}):t}):t},t}(),function(){var i="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;e=[(0,l.trackPerformance)("SubtitleHandler.activate")],o(t,null,e,{kind:"method",name:"activate",static:!1,private:!1,access:{has:function(t){return"activate"in t},get:function(t){return t.activate}},metadata:i},null,n),i&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:i})}(),t}();function v(t,e){return i({subtitleId:e,start:t.start,end:t.end},t.content)}e.AbstractSubtitleHandler=p},39310:function(t,e,n){var i=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.Cea608Handler=void 0;var r=n(74437),o=n(69363),a=function(t){function e(e,n,i){return void 0===i&&(i=null),t.call(this,e,n,i)||this}return i(e,t),e.prototype.onSeek=function(){},e.prototype.onSeeked=function(t,e){var n=e<t,i=this.context.settings.CLEAR_BUFFERS_ON_SEEKING_BACKWARDS;n&&i&&this.clearBuffersUntil(this.context.renderer.getDuration())},e.prototype.addCaption=function(t,e){t&&(this.fireOnCueParsedEvents([t],e),this.timeline.addCues([t],0))},e.prototype.getSubtitleType=function(){return o.SubtitleType.IN_STREAM},e}(r.AbstractSubtitleHandler);e.Cea608Handler=a},60672:function(t,e,n){var i=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.ExternalFileSubtitleHandler=void 0;var r=n(25926),o=n(4224),a=n(56481),u=n(3714),s=n(4129),l=n(29669),c=n(26438),d=n(74437),f=n(69363),p=function(t){function e(n,i,r){var o=t.call(this,n,i,r&&r._internalId.periodId)||this;return o.lU=function(t){if(o.timeline.removeCues(),null==t?void 0:t.body){o.kU=!0;var e=o.mU(t.body.trim()),n=o.applyVttOffset(e);o.fireOnCueParsedEvents(n,null),o.timeline.addCues(n)}},r&&(i.id=r.Representation[0]._id),i.url?(o.jU=e.enforceHTTPSForSecureOrigins(i.url.trim()),o.kU=!1,o.hU=new s.DefaultContentLoader(o.context,{maxRetries:o.context.settings.MAX_RETRIES,retryDelay:o.context.settings.RETRY_DELAY,requestType:l.HttpRequestType.MEDIA_SUBTITLES})):(o.context.logger.log("No url was provided for an external subtitle, nothing will be loaded."),o.kU=!0,o.iU=Promise.resolve()),o}return i(e,t),e.prototype.activate=function(){var e=this;return this.context.logger.debug("loading "+this.jU),t.prototype.activate.call(this).then(function(){return e.iU?e.iU:e.kU?Promise.resolve():(e.iU=e.hU.load(e.jU).then(e.lU).catch(function(t){var n,i;if(e.iU=void 0,!e.isActive())return Promise.resolve();throw e.context.eventHandler&&e.context.eventHandler.dispatchEvent(u.PlayerEvent.Warning,new r.PlayerWarning(o.WarningCode.NETWORK_COULD_NOT_LOAD_SUBTITLE)),e.context.logger.debug("Could not load subtitles/captions, got HTTP status code ".concat(null!==(i=null===(n=null==t?void 0:t.status)||void 0===n?void 0:n.toString())&&void 0!==i?i:""),t),e.deactivate(),"loading failed"}),e.iU)})},e.prototype.mU=function(t){return c.SubtitleParserFactory.createInstance(this.context,t).parse(t)},e.enforceHTTPSForSecureOrigins=function(t){var e=new RegExp("^(?:[a-z]+:)?//","i");return"https:"===location.protocol?t.replace(e,"//"):t},e.prototype.getSubtitleType=function(){return f.SubtitleType.EXTERNAL_FILE},e.prototype.clearBuffersUntil=function(){},e.prototype.onSeek=function(){},e.prototype.onSeeked=function(){},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.hU=(0,a.dispose)(this.hU)},e}(d.AbstractSubtitleHandler);e.ExternalFileSubtitleHandler=p},88788:function(t,e,n){var i=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},r.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.FragmentedSubtitleHandler=void 0;var o=n(4524),a=n(80813),u=n(3714),s=n(44468),l=n(87827),c=n(86897),d=n(93204),f=n(81199),p=n(34047),v=n(79721),h=n(85434),g=n(66502),y=n(23068),b=n(88052),m=n(62756),S=n(86058),M=n(15569),U=n(26438),E=n(74437),T=n(69363),P=function(t){function e(e,n,i,r){var o=t.call(this,e,i,n.periodId)||this;o.LU=function(t){var e,n=function(t){var e=null==t?void 0:t.getState();return void 0!==e&&void 0!==t?Promise.race(function(t){var e,n=null!==(e=t.activeTracks)&&void 0!==e?e:{};return Object.keys(n).flatMap(function(t){var e;return null!==(e=n[t].mediaTypes)&&void 0!==e?e:[]}).filter(function(t){return t===s.MediaType.Video||t===s.MediaType.Audio})}(e).map(function(n){return function(t,e,n){var i=_(n,e);return void 0!==i?Promise.resolve(i):(0,d.waitForStateChangeThen)(t)(function(t){return _(n,t)},function(t){return void 0!==t})}(t,e,n)})):Promise.reject("SourceState unavailable")}(o.context.serviceManager.get(a.ServiceName.SourceStoreService,o.context.sourceContext.sourceIdentifier)),i=null===(e=t.getSegmentInfo())||void 0===e?void 0:e.discontinuitySequenceNumber;return void 0!==i&&(n=n.then(function(){return o.CU(i)}).then(function(){return o.DU(i)}).then(function(){return o.isActive()}).catch(function(){return!1})),n.then(function(e){o.MU(t),e&&o.JU(t)})},o.dV=function(t){var e;if(t&&void 0!==t.time){var n=t.time;o.clearBuffersUntil(n);var i=(null===(e=o.uU)||void 0===e?void 0:e.getTimeForNextSegment(o.nU))||n,r=i-n,a=(0,f.getPlayableBufferLevel)(o.context.internalPlayer);isNaN(i)||r>=a||o.oU.hasNext(i)&&(o.oU.getMPDHandler().resolvePendingSegmentInfoRequests(),o.oU.getNext(i))}},o.fV=function(){o.oU.updateMpd()},o.eventHandler=e.eventHandler,o.sU=n.sourceStore,o.uU=e.serviceManager.get(a.ServiceName.StreamTimeService),o.tU=e.serviceManager.get(a.ServiceName.ManifestUpdateSchedulingService,e.sourceContext.sourceIdentifier),o.qU=r,o.pU=n.isHls,o.rU=e.bufferSettings;var u=b.ModuleManager.get(m.ModuleName.EngineBitmovin).SegmentController;return o.oU=new u(e,o.LU,n.mimeType,n.codec,n.isHls,n.manifestLoader,n.periodId,n.sourceStore),o.oU.setCurrentLangObj(i),o.nU="".concat(n.mimeType,"/").concat(i.id),o.vU=b.ModuleManager.get(m.ModuleName.HLS,!1),o.xU(),o}return i(e,t),e.prototype.xU=function(){!this.wU&&this.sU&&(this.wU=(0,d.subscribe)(this.sU)(function(t){return null==t?void 0:t.manifest},this.fV,function(t,e){return Boolean((null==t?void 0:t.isInitialized)&&!(null==e?void 0:e.isInitialized))}))},e.prototype.yU=function(){this.wU&&(this.wU(),this.wU=void 0)},e.prototype.zU=function(t){return x(t)?(0,M.parsePlainTextSubtitles)(t):function(t){return h.MimeTypeHelper.isApplication(t.getMimeType())&&!C(t)}(t)?(0,S.parseMP4WrappedSubtitles)(t,this.context.logger):t.getMetadata().subtitles},e.prototype.AU=function(t){var e=t.getMetadata();e.subtitles=this.zU(t),t.setMetadata(e)},e.prototype.BU=function(t){var e,n=null!==(e=t.getPlaybackTime())&&void 0!==e?e:t.getSegmentInfo().startTime;t.setPlaybackTime(n)},e.prototype.CU=function(t){var e=this.qU();return this.pU&&e?(void 0!==t&&this.IU()||(t=-1),e.waitForInitializationForDiscontinuity(t)):Promise.resolve()},e.prototype.DU=function(t){if(!this.IU())return Promise.resolve();if(void 0!==this.KU(t))return Promise.resolve();if(!this.vU)return Promise.reject(new Error("HLS Module missing"));var e=this.vU.selectors,n=e.getHlsState,i=e.getPresentationTimeOffset;return(0,d.waitForStateChangeThen)(this.sU)(function(e){return i(n(e),String(t))},function(t){return void 0!==t}).then()},e.prototype.EU=function(t){var e,n,i=null===(e=this.context.serviceManager.get(a.ServiceName.SourceStoreService,t))||void 0===e?void 0:e.getState(),r=null===(n=this.oU.getCurrentAdaptationSet())||void 0===n?void 0:n.Representation[0];return r&&i?(0,b.ModuleManager.get(m.ModuleName.EngineBitmovin).selectors.getSegmentInfos)(i,r._internalId.key()):[]},e.prototype.FU=function(t,e){var n,i,r,o,u=b.ModuleManager.get(m.ModuleName.EngineBitmovin).AdaptationSetId,s=this.context.serviceManager.get(a.ServiceName.ManifestService,t),l=new u(v.DEFAULT_PERIOD_ID,e),c=null==s?void 0:s.getAdaptationSet(l);return null!==(o=null===(r=null===(i=null===(n=null==c?void 0:c.Representation[0])||void 0===n?void 0:n.SegmentList)||void 0===i?void 0:i[0])||void 0===r?void 0:r.SegmentURL)&&void 0!==o?o:[]},e.prototype.GU=function(){var t=this.context.sourceContext.sourceIdentifier;return this.context.settings.ENABLE_SEGMENT_INFO_PROVIDER_FROM_STORE?this.EU(t):this.FU(t,this.getSubtitle().id)},e.prototype.HU=function(){var t=this.GU();if(t&&0!==t.length)return t.reduce(function(t,e){var n=O(e)?e.startTime:e._playbackTime,i=O(e)?e.discontinuitySequenceNumber:e._discontinuitySequenceNumber;return(0,y.isNumber)(n)&&(0,y.isNumber)(i)&&void 0===t[i]&&(t[i]=n),t},{})},e.prototype.IU=function(){var t,e=b.ModuleManager.get(m.ModuleName.HLS,!1),n=null===(t=this.sU)||void 0===t?void 0:t.getState();if(!e||!n)return!1;var i=e.selectors,r=i.getHlsState,o=i.getMergedDiscontinuityTimings,a=r(n);if(!a)return!1;var u=this.HU();if(!u)return!1;var s=o(a),l=Object.keys(u).find(function(t){return!s[t]||Math.abs(s[t].startTime-u[t])>1}),c=Object.keys(s).find(function(t){return null==u[t]});return null==l&&null==c},e.prototype.JU=function(t){this.NU(t),this.AU(t),this.BU(t),this.PU(t),this.isActive()&&this.timeline.show()},e.prototype.KU=function(t){var e;if(this.vU){var n=this.vU.selectors,i=n.getHlsState,r=n.getPresentationTimeOffset,o=null===(e=this.sU)||void 0===e?void 0:e.getState(),a=o?i(o):void 0;if(a)return r(a,String(t))}},e.prototype.MU=function(t){var e,n=t.getPlaybackTimeRange();if(n){var i=b.ModuleManager.get(m.ModuleName.EngineBitmovin),r=i.actions.removeStreamTimeRange,o=i.mseModuleTypes.streamTimeRangeType;null===(e=this.sU)||void 0===e||e.dispatch(r(this.nU,n,o.Loading))}},e.prototype.NU=function(t){var e,n=t.getPlaybackTimeRange();if(!t.isInit()&&n){var i=b.ModuleManager.get(m.ModuleName.EngineBitmovin).actions.addLoadedRange,o=r(r({},n),{bufferBlockId:-1});null===(e=this.sU)||void 0===e||e.dispatch(i(this.nU,o))}},e.prototype.OU=function(t){var e,n,i=-this.oU.getMPDHandler().getTimestampOffset();if(this.pU){var r=t.getSegmentInfo().discontinuitySequenceNumber,o=this.KU(r);void 0!==o?i=-o:this.context.logger.warn("FragmentedSubtitleHandler: Failed to get PTO for disco sequence ".concat(r," from store, falling back to MPDHandler value of ").concat(-i),t.getSegmentInfo())}return i+(null!==(n=null===(e=this.qU())||void 0===e?void 0:e.getTimestampMappingOffset(t))&&void 0!==n?n:0)},e.prototype.PU=function(t){var n=t.getMetadata().subtitles;if(Array.isArray(n)&&0!==n.length){var i=x(t),r=this.OU(t),o=i||function(t){return"stpp"===p.CodecStringHelper.extractCodec(t.getCodec())}(t)||function(t){return"application/mp4"===t.getMimeType()&&"wvtt"===t.getCodec()&&!C(t)}(t),a=o?this.QU(n,r):n,u=i?this.applyVttOffset(a):a,s=e.ensureCueInSegmentRange(u,t.getPlaybackTime(),t.getDuration(),r,this.isTsContainer());this.fireOnCueParsedEvents(s,this.periodId),this.timeline.addCues(s)}},e.prototype.QU=function(t,e){var n=this;return t.flatMap(function(t){return n.RU(t.text,e)})},e.ensureCueInSegmentRange=function(t,e,n,i,o){if(void 0===o&&(o=!1),!e&&0!==e||e<0||!n)return t;if(t.length>0){var a=n+i;if(t.every(function(t){return t.end<=a}))return t.map(function(t){return o&&null!=t.offset?r(r({},t),{start:t.start+e-i-t.offset,end:t.end+e-i-t.offset}):r(r({},t),{start:t.start+e-i,end:t.end+e-i})})}return t},e.prototype.RU=function(t,e){var n=U.SubtitleParserFactory.createInstance(this.context,t);return e?n.parse(t,e):n.parse(t)},e.prototype.activate=function(){var e=this;return t.prototype.activate.call(this),this.cV().then(function(){if(e.isActive()){var t=function(t,e){var n=(0,l.getPlayerState)(e.getState());return(0,l.getIsSeekingOrTimeshifting)(n)?n.targetPlaybackTime:t.getCurrentTime(!0)}(e.context.renderer,e.context.store);e.oU.activateSubtitleSegmentController(t),e.oU.hasNext(t)&&e.oU.getNext(t),e.eventHandler.on(u.PlayerEvent.TimeChanged,e.dV)}})},e.prototype.cV=function(){var t=this.oU.getCurrentAdaptationSet().Representation[0],e=t._internalId,n=t._mimeType,i=b.ModuleManager.get(m.ModuleName.EngineBitmovin).actions,r=i.setRepresentationIdAction,o=i.setMediaTypeAction;return this.sU.dispatch(r(e)),this.sU.dispatch(o(e,h.MimeTypeHelper.getMediaType(n))),this.tU.waitForRepUpdate(e)},e.prototype.deactivate=function(){var e;this.timeline.removeCues();var n=b.ModuleManager.get(m.ModuleName.EngineBitmovin).actions,i=n.resetStreamTimeline,r=n.resetLoadedRanges;this.eventHandler.off(u.PlayerEvent.TimeChanged,this.dV),this.sU.dispatch(i(this.nU)),this.sU.dispatch(r(this.nU));var o=null===(e=this.oU.getCurrentAdaptationSet())||void 0===e?void 0:e._internalId;return o&&this.sU.dispatch(b.ModuleManager.get(m.ModuleName.EngineBitmovin).actions.removeActiveTrackAction(o)),t.prototype.deactivate.call(this)},e.prototype.getSubtitleType=function(){return T.SubtitleType.FRAGMENTED},e.prototype.clearBuffersUntil=function(e){t.prototype.clearBuffersUntil.call(this,e);var n=b.ModuleManager.get(m.ModuleName.EngineBitmovin).actions.removeLoadedRange;this.sU.dispatch(n(this.nU,{start:0,end:e,bufferBlockId:-1}))},e.prototype.eV=function(t){var e,n=null===(e=this.sU)||void 0===e?void 0:e.getState(),i=(0,c.getBufferState)(n),r=i?(0,c.getLoadedRangesForMimeType)(i,this.nU):[];return(0,o.isInTimeRanges)(r,t)},e.prototype.onSeek=function(t,e){this.isActive()&&(this.eV(e)||this.oU.cancelLoading())},e.prototype.onSeeked=function(t,e){if(this.isActive()&&!this.eV(e)){this.timeline.removeCues();var n=b.ModuleManager.get(m.ModuleName.EngineBitmovin).actions.resetLoadedRanges;this.sU.dispatch(n(this.nU)),this.oU.seekTo(e),this.oU.hasNext(e)&&this.oU.getNext(e)}},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.yU(),this.oU.dispose()},e}(E.AbstractSubtitleHandler);function C(t){return g.TextSegmentAnalyzer.isPlainTextPayload(t.getData())}function x(t){var e=t.getCodec();return("wvtt"===e||"vtt"===e||""===e&&t.getMimeType().includes("vtt"))&&C(t)}function _(t,e){var n=b.ModuleManager.get(m.ModuleName.EngineBitmovin,!1);if(void 0!==e&&void 0!==n)return n.selectors.getContainerFormat(e,t)}function O(t){return"discontinuitySequenceNumber"in t}e.FragmentedSubtitleHandler=P},69363:function(t,e){var n;Object.defineProperty(e,"__esModule",{value:!0}),e.SubtitleType=void 0,function(t){t[t.EXTERNAL_FILE=0]="EXTERNAL_FILE",t[t.FRAGMENTED=1]="FRAGMENTED",t[t.IN_STREAM=2]="IN_STREAM"}(n||(e.SubtitleType=n={}))},71340:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.hashCode=function(t){var e=0;if(0===t.length)return e;for(var n=0;n<t.length;n++)e=(e<<5)-e+t.charCodeAt(n),e&=e;return e}},85224:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.createHtmlElement=function(t){var e;if(function(){if(void 0===o){var t=(0,r.getCapabilities)().isReactNative,e=window&&window.document&&"function"==typeof window.document.createElement;o=!e||t}return o}()){var n=function(){return null!=i||(i=new DOMParser),i}().parseFromString("<".concat(t,"></").concat(t,">"),"text/html");return(null===(e=n.body)||void 0===e?void 0:e.firstChild)||n.firstChild}return document.createElement(t)};var i,r=n(21513),o=void 0}},function(t){return function(){return t(52112)}()}])});
|
|
17
|
+
"use strict";!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.subtitles=e():(t.bitmovin=t.bitmovin||{},t.bitmovin.player=t.bitmovin.player||{},t.bitmovin.player.subtitles=e())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[482],{82657:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},37723:function(t,e){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.EnabledSubtitlesTracker=void 0;var i=function(){function t(){this.qT={},this.rT=0}return t.prototype.addSubtitle=function(t){this.removeSubtitle(t.id),this.qT[this.tT()]=n({isFragmented:!1},t)},t.prototype.removeSubtitle=function(t){var e=this;Object.keys(this.qT).forEach(function(n){e.qT[n].id===t&&delete e.qT[n]})},t.prototype.shouldEnableSubtitle=function(t,e){var n=this,i=Object.keys(this.qT).find(function(i){return n.sT(n.qT[i],e)===t.id});return Boolean(i)},t.prototype.sT=function(t,e){var n=t.id,i=t.kind,o=t.lang,s=t.isFragmented;return r({lang:o,kind:i,isFragmented:s,id:n},e)||r({lang:o,kind:i,isFragmented:s},e)||r({lang:o,kind:i},e)},t.prototype.tT=function(){return this.rT++,this.rT},t.prototype.dispose=function(){this.qT={},this.rT=0},t}();function r(t,e){return Object.keys(e).find(function(n){var i=e[n].getSubtitle(),r=i.id,o=i.lang,s=i.isFragmented,a=i.kind,u=r===t.id,l=!t.isFragmented||s===t.isFragmented,c=o===t.lang;t.isPreferred&&t.lang&&(c=o.includes(t.lang)||t.lang.includes(o));var d=a===t.kind&&c&&l;return u||d})}e.EnabledSubtitlesTracker=i},53396:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.ForcedSubtitleController=void 0;var i=n(55552),r=function(){function t(){this.uT={}}return t.prototype.addSubtitleHandler=function(t){this.uT[t.getSubtitle().id]=t},t.prototype.deactivate=function(){return this.wT()?Promise.all(Object.values(this.uT).map(function(t){return t.deactivate()})).then(function(){}):Promise.resolve()},t.prototype.activate=function(t){var e=this;return void 0===t&&(t=this.vT),this.wT()?(this.vT=t,this.deactivate().then(function(){var t=Object.values(e.uT).find(function(t){return(0,i.isEqualIsoLanguage)(t.getSubtitle().lang,e.vT)});if((t=null!=t?t:Object.values(e.uT)[0])&&!t.isActive())return t.activate().catch(function(){})})):Promise.resolve()},t.prototype.onSeek=function(t,e){Object.values(this.uT).forEach(function(n){return n.onSeek(t,e)})},t.prototype.onSeeked=function(t,e){Object.values(this.uT).forEach(function(n){return n.onSeeked(t,e)})},t.prototype.dispose=function(){Object.values(this.uT).forEach(function(t){return t.dispose()}),this.uT=null},t.prototype.wT=function(){return Object.keys(this.uT).length>0},t.prototype.getForcedSubtitleHandler=function(t){if(this.uT)return Object.values(this.uT).find(function(e){return t(e)})},t}();e.ForcedSubtitleController=r},42009:function(t,e){function n(t){return t.replace(/<[^>]*>?/g,"")}function i(t){return t.replace(/<br\s*\/?>/g,"\n")}Object.defineProperty(e,"__esModule",{value:!0}),e.htmlToText=function(t){return n(i(t))},e.stripHtmlTags=n,e.prepareHtml=function(t){return t.replace(/(\r\n|\r|\n)/g,"<br />")},e.replaceHtmlBreakPointsWithNewLine=i,e.stripAwayHtmlBreakPoints=function(t){return t.replace(/<br\s*\/?>/g,"")}},55552:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.isEqualIsoLanguage=function(t,e){var n;if(void 0===e)return!1;if(null===(n=window.Intl)||void 0===n?void 0:n.DisplayNames){var i=new window.Intl.DisplayNames(["en"],{type:"language"});try{return i.of(t.split("-")[0])===i.of(e.split("-")[0])}catch(t){}}return t===e}},86058:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.parseMP4WrappedSubtitles=function(t,e){var n=t.getTimescale();if(void 0===n||!s.ModuleManager.has(a.ModuleName.ContainerMP4))return[];var o=s.ModuleManager.get(a.ModuleName.ContainerMP4);return function(t,e,n){var o=0,s=[],a=0;return t.forEach(function(t){var c=r.CodecStringHelper.extractCodec(e.getCodec()),d=t.duration/n,f=e.getPlaybackTime()+o,p=f+d;if(o+=d,"wvtt"===c||"vtt"===c){var h=function(t,e,n,r){for(var o=t.data.buffer,s=t.data.byteOffset,a=0,u=[],c="",d="";a<t.data.byteLength;){var f=t.data.getUint32(a),p=s+a,h=i.ArrayHelper.convertBufferSourceToUTF8(new Uint8Array(o,p+4,4));if("vttc"===h){if(c){var v=l(e,n,r,d,c);u.push(v),r+=1,c="",d=""}a+=8}else"payl"===h?(c=i.ArrayHelper.convertBufferSourceToUTF8(new Uint8Array(o,p+8,f-8)),a+=f):"sttg"===h?(d=i.ArrayHelper.convertBufferSourceToUTF8(new Uint8Array(o,p+8,f-8)),a+=f):a+=f}return c&&(v=l(e,n,r,d,c),u.push(v)),u}(t,f,p,a);a+=h.length,h.forEach(function(t){s.push({start:f,end:p,text:t})})}else"stpp"===c&&s.push({start:f,end:p,text:u(t)})}),s}(o.getMp4Fragments(t).flatMap(function(n){return o.getTrackSamples(n.moof,n.mdat,t,e)}),t,n)};var i=n(74853),r=n(34047),o=n(66502),s=n(88052),a=n(62756);function u(t){var e=new Uint8Array(t.data.buffer,t.data.byteOffset,t.data.byteLength);return i.ArrayHelper.convertBufferSourceToUTF8(e,o.TextSegmentAnalyzer.detectEncoding(t.data))}function l(t,e,n,i,r){return["[EMBEDDEDWEBVTT]",t,e,n,i,r].join("\n")}},52112:function(t,e,n){var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(e,n);r&&!("get"in r?!e.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,i,r)}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||i(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.SubtitleModuleDefinition=void 0;var o=n(62756),s=n(71340),a=n(42009),u=n(55552),l=n(78717),c=n(26438),d=n(606),f=n(85224);e.SubtitleModuleDefinition={name:o.ModuleName.Subtitles,module:function(){return{SubtitleService:d.SubtitleService,SubtitleParserFactory:c.SubtitleParserFactory,PlayerSubtitlesApiFactory:l.PlayerSubtitlesApiFactory,HtmlTransformer:a,LanguageComparer:u,hashCode:s.hashCode,createHtmlElement:f.createHtmlElement}},dependencies:[o.ModuleName.EngineBitmovin]},e.default=e.SubtitleModuleDefinition,r(n(82657),e)},15569:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.parsePlainTextSubtitles=function(t){var e,n,o=r.TextSegmentAnalyzer.detectEncoding(t.getData()),s=i.ArrayHelper.convertBufferSourceToUTF8(t.getData(),o),a=null!==(e=t.getPlaybackTime())&&void 0!==e?e:0;return[{start:a,end:a+(null!==(n=t.getDuration())&&void 0!==n?n:0),text:s}]};var i=n(74853),r=n(66502)},78717:function(t,e,n){var i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},i.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.PlayerSubtitlesApiFactory=void 0;var r=n(3714),o=function(){function t(){}return t.build=function(t){return new(function(){function e(){}return e.prototype.add=function(e){t.addSubtitle(e)},e.prototype.remove=function(e){t.removeSubtitle(e)},e.prototype.list=function(){return t.listSubtitles()},e.prototype.enable=function(e,n){void 0===n&&(n=!0),t.enableSubtitle(e,n)},e.prototype.disable=function(e){t.disableSubtitle(e)},e.prototype.cueEnter=function(e){t.fireEvent(r.PlayerEvent.CueEnter,i(i({},e),{type:r.PlayerEvent.CueEnter}))},e.prototype.cueExit=function(e){t.fireEvent(r.PlayerEvent.CueExit,i(i({},e),{type:r.PlayerEvent.CueExit}))},e}())},t}();e.PlayerSubtitlesApiFactory=o},26438:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.SubtitleParserFactory=void 0;var i=n(3714),r=n(88052),o=n(62756),s=n(22374),a=function(){function t(){}return t.createInstance=function(t,e){var n;return e.indexOf("<?")>-1||e.indexOf("<tt")>-1?r.ModuleManager.has(o.ModuleName.SubtitlesTTML)?n=new(0,r.ModuleManager.get(o.ModuleName.SubtitlesTTML).TTMLParser)(t):t.eventHandler.dispatchEvent(i.PlayerEvent.Warning,new s.PlayerModuleMissingWarning(o.ModuleName.SubtitlesTTML,"The ".concat(o.ModuleName.SubtitlesTTML," module is required to parse TTML subtitles."))):r.ModuleManager.has(o.ModuleName.SubtitlesWebVTT)?n=new(r.ModuleManager.get(o.ModuleName.SubtitlesWebVTT).WebVttParser):t.eventHandler.dispatchEvent(i.PlayerEvent.Warning,new s.PlayerModuleMissingWarning(o.ModuleName.SubtitlesWebVTT,"The ".concat(o.ModuleName.SubtitlesWebVTT," module is required to parse WebVTT subtitles."))),n},t}();e.SubtitleParserFactory=a},606:function(t,e,n){var i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},i.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.SubtitleService=void 0;var r=n(80813),o=n(56481),s=n(3714),a=n(91678),u=n(93204),l=n(34047),c=n(85434),d=n(70850),f=n(88052),p=n(62756),h=n(22374),v=n(37723),g=n(53396),y=n(39310),b=n(60672),m=n(88788),S=n(69363),T=n(74715),M=function(){function t(t){var e=this;this.context=t,this.getTransmuxer=function(){return e.gs},this.It=function(){e.xs()},this.Ot=function(t){var n;e.xs(),e.ls=t.position;var i=null!==(n=e.ls)&&void 0!==n?n:0,r=function(t){return function(t){return"seekTarget"in t}(t)?t.seekTarget:t.target}(t);Object.values(e.ds).forEach(function(t){return t.onSeek(i,r)}),e.js.onSeek(i,r)},this.Pt=function(){var t,n=null!==(t=e.ls)&&void 0!==t?t:0,i=e.context.internalPlayer.getCurrentTime();Object.values(e.ds).forEach(function(t){return t.onSeeked(n,i)}),e.js.onSeeked(n,i)},this.Tt=function(t,n){e.context.logger.debug("Switching periods in subtitleService");var i=e.fs.findPeriod(t);i?(e.St(t,n),e.setupControllersForNextPeriod(i),e.Ut()):e.context.logger.log("Can not find period with id = ".concat(t," in Manifest. Skipping period update"))},this.Wt=function(){Object.keys(e.ds).forEach(function(t){return e.ds[t].dispose()}),e.ds={},e.es&&(e.es.dispose(),e.es=void 0),e.ks&&e.ks.reset()},this.ds={},this.hs=t.eventHandler,this.fs=t.serviceManager.get(r.ServiceName.ManifestService,t.sourceContext.sourceIdentifier),this.is=new v.EnabledSubtitlesTracker,this.js=new g.ForcedSubtitleController,this.hs.on(s.PlayerEvent.Seek,this.Ot),this.hs.on(s.PlayerEvent.TimeShift,this.Ot),this.hs.on(s.PlayerEvent.Seeked,this.Pt),this.hs.on(s.PlayerEvent.TimeShifted,this.Pt),this.hs.on(s.PlayerEvent.SourceUnloaded,this.Wt),this.ns=f.ModuleManager.has(p.ModuleName.SubtitlesCEA608)?f.ModuleManager.get(p.ModuleName.SubtitlesCEA608):void 0,this.ps()}return t.prototype.os=function(t,e){var n=t!==e,i=this.fs.isHlsManifest()&&!(e||!t);return n||i},t.prototype.ps=function(){var t=this,e=this.context.serviceManager.get(r.ServiceName.SourceStoreService,this.context.sourceContext.sourceIdentifier);this.ms=(0,u.subscribe)(e)(f.ModuleManager.get(p.ModuleName.EngineBitmovin).selectors.getPlayingPeriodId,this.Tt,function(e,n){return t.os(e,n)})},t.prototype.setupControllersForNextPeriod=function(t){var e=this;t.AdaptationSet.forEach(function(t){var n=t._mimeType;(0,T.isSubtitleTrack)(n,e.fs.isHlsManifest())&&e.qs(t,n)})},t.prototype.qs=function(t,e){if((0,T.isFragmentedAdaptationSet)(t))return this.context.store.dispatch((0,a.initializeMetricsForMimeType)(e,this.context.settings)),void this.rs(t,e);this.ss(t,e)},t.prototype.rs=function(t,e){var n=this.context.sourceContext.sourceIdentifier,i=this.context.serviceManager.get(r.ServiceName.SourceStoreService,this.context.sourceContext.sourceIdentifier);if(i){var o={mimeType:e,codec:f.ModuleManager.get(p.ModuleName.EngineBitmovin).getCodecsFromAdaptationSet(t),isHls:this.fs.isHlsManifest(),manifestLoader:this.context.serviceManager.get(r.ServiceName.ManifestLoadingService,n),periodId:t._internalId.periodId,sourceStore:i};this.addFragmentSubtitle(o,t)}},t.prototype.ss=function(t,e){if(f.ModuleManager.has(p.ModuleName.DASH)){var n=new(f.ModuleManager.get(p.ModuleName.DASH).SegmentTemplateMPDHandler)(this.context,this.context.sourceContext),i=this.fs.toSubtitleTrack(t,e);n.setAdaptationSetId(t._internalId),i.url=n.getSubtitleUrl().toString(),this.addExternalSubtitle(i,t)}},t.prototype.setTransmuxer=function(t){this.gs=t},t.prototype.hasSubtitle=function(t){return Boolean(this.ds[t])},t.prototype.enableSubtitle=function(t){var e=this,n=this.ds[t];return n&&!n.isActive()?n.activate().then(function(){n.refresh(),e.js.deactivate()}).then(function(){return e.is.addSubtitle(n.getSubtitle()),!0}).catch(function(t){return e.context.logger.debug("Error during subtitle activation",t),!1}):Promise.resolve(!1)},t.prototype.addExternalSubtitle=function(t,e){if(void 0===e&&(e=null),t.id||(t.id=t.url),this.ts(t,e))return t;var n=new b.ExternalFileSubtitleHandler(this.context,t,e);return this.us(n),t},t.prototype.ts=function(t,e){var n,i,r=this.ds[t.id],o=null!==(n=null==r?void 0:r.periodId)&&void 0!==n?n:null,s=null!==(i=null==e?void 0:e._internalId.periodId)&&void 0!==i?i:null;return r&&o===s?r:this.js.getForcedSubtitleHandler(function(e){var n,i=e.getSubtitle().id===t.id,r=(null!==(n=e.periodId)&&void 0!==n?n:null)===s;return i&&r})},t.prototype.us=function(t){var e=t.getSubtitle(),n=this.context.config.playback.isForcedSubtitle;if("function"==typeof n?(0,d.safeUserCallback)(function(){return n(e)},this.context.logger):e.forced)this.js.addSubtitleHandler(t);else{var i=!1,r=e.id;this.ds[r]&&(i=this.ds[r].isActive(),this.Vt(r)),this.vs(t),i&&t.activate()}},t.prototype.vs=function(t){var e=t.getSubtitle();this.ws(e),this.ds[e.id]=t,this.Qt(e)},t.prototype.ws=function(t){var e,n,i=this.context.sourceContext.source.labeling,r=this.fs.isHlsManifest()?null===(e=null==i?void 0:i.hls)||void 0===e?void 0:e.subtitles:null===(n=null==i?void 0:i.dash)||void 0===n?void 0:n.subtitles;"function"==typeof r&&(t.label=(0,d.safeUserCallback)(function(){return r(t)},this.context.logger))},t.prototype.addFragmentSubtitle=function(t,e){if(!f.ModuleManager.has(p.ModuleName.EngineBitmovin))return this.context.logger.warn("Unable to add fragmented subtitles because MSE Module is missing"),null;var n=this.fs.toSubtitleTrack(e,t.mimeType);n.isFragmented=!0,n.url=null;var i=new m.FragmentedSubtitleHandler(this.context,t,n,this.getTransmuxer);return this.us(i),n},t.prototype.setupCea608CaptionExtractor=function(t){var e;if(!this.ns)return this.hs.dispatchEvent(s.PlayerEvent.Warning,new h.PlayerModuleMissingWarning(p.ModuleName.SubtitlesCEA608,"The ".concat(p.ModuleName.SubtitlesCEA608," module is required to parse CEA captions."))),this.context.logger.log("CEA Caption parsing is disabled, because the Cea680 module is not loaded"),null;if(!f.ModuleManager.has(p.ModuleName.ContainerMP4))return this.hs.dispatchEvent(s.PlayerEvent.Warning,new h.PlayerModuleMissingWarning(p.ModuleName.ContainerMP4,"The ".concat(p.ModuleName.ContainerMP4," module is required to parse CEA captions."))),this.context.logger.log("CEA Caption parsing is disabled, because the ContainerMP4 module is not loaded"),null;this.es&&this.es.dispose();var n=f.ModuleManager.get(p.ModuleName.ContainerMP4),i=this.ns.Cea608Extractor;return this.es=new i(t,n,null===(e=this.context.config.tweaks)||void 0===e?void 0:e.parse_cea_708_caption),this.es},t.prototype.xs=function(){this.es&&(this.context.logger.debug("Resetting CEA caption extractor..."),this.es.reset())},t.prototype.Jt=function(){var t=f.ModuleManager.get(p.ModuleName.HLS);this.ks=new t.DiscontinuitySequenceNumberTracker(c.MimeTypeHelper.isVideo),this.ks.subscribe(this.It)},t.prototype.Kt=function(t){this.ks||this.Jt(),this.ks.trackSegment(t)},t.prototype.Lt=function(){return this.fs.getManifest()&&this.fs.isHlsManifest()&&f.ModuleManager.has(p.ModuleName.HLS)},t.prototype.handleClosedCaptions=function(t,e,n,i){var r;return!i&&c.MimeTypeHelper.isVideo(e.getMimeType())&&(null===(r=this.ns)||void 0===r?void 0:r.CEA_EXTRACTOR_SUPPORTED_CODEC_TAGS.includes((0,l.getCodecTag)(e)))?this.Mt(e,t.getTimestampOffset()):(this.Nt(n,e.getPeriodId()),Promise.resolve())},t.prototype.Mt=function(t,e){var n=this;return this.es?(this.Lt()&&this.Kt(t),this.es.extract(t).then(function(i){!function(t,e){t.forEach(function(t){t.start-=e,t.end-=e})}(i,e),i.length>0&&(n.context.logger.insane("Extracted Closed Captions from fMP4: "+JSON.stringify(i)),n.Nt(i,t.getPeriodId()))}).catch(function(t){var e;t instanceof h.PlayerModuleMissingWarning?(null===(e=n.es)||void 0===e||e.dispose(),n.es=void 0,n.hs.dispatchEvent(s.PlayerEvent.Warning,t)):n.context.logger.debug("Error parsing CEA-608 Captions from fMP4: "+t)})):Promise.resolve()},t.prototype.Nt=function(t,e){if(t&&Array.isArray(t)&&0!==t.length)for(var n=this.fs.getClosedCaptionLabels(e),i=function(t){var i=t.channel;if(!r.ds[i]){var o=n.find(function(t){return t.id===i})||{id:i,kind:"captions",lang:"unknown",label:"Captions (".concat(t.channel,")")};r.vs(new y.Cea608Handler(r.context,o))}r.ds[i].addCaption(t,e)},r=this,o=0,s=t;o<s.length;o++)i(s[o])},t.prototype.Qt=function(t){this.hs.dispatchEvent(s.PlayerEvent.SubtitleAdded,{subtitle:i({},t)})},t.prototype.disableSubtitle=function(t){var e=this,n=this.ds[t];return n?n.deactivate().then(function(){return e.is.removeSubtitle(t),0===e.getActiveSubtitles().length&&e.js.activate().catch(function(){}),!0}).catch(function(){return!1}):Promise.resolve(!1)},t.prototype.disableAllSubtitles=function(){var t=this;this.getActiveSubtitles().forEach(function(e){return t.disableSubtitle(e.id)})},t.prototype.removeSubtitle=function(t){this.Vt(t),this.is.removeSubtitle(t)},t.prototype.getActiveSubtitles=function(){var t=this;return Object.keys(this.ds).filter(function(e){return t.ds[e].isActive()}).map(function(e){return t.ds[e].getSubtitle()})},t.prototype.hasSubtitles=function(){return Object.keys(this.ds).length>0},t.prototype.getAvailableSubtitles=function(t){return Object.values(this.ds).filter(function(e){var n=e.periodId;return!n||t===n}).map(function(t){return t.getSubtitle()})},t.prototype.enableForcedSubtitle=function(t){this.js.activate(t).catch(function(){})},t.prototype.Rt=function(t,e,n){var i=t.getSubtitleType()===S.SubtitleType.FRAGMENTED&&t.periodId===n,r=t.getSubtitleType()===S.SubtitleType.EXTERNAL_FILE&&t.periodId&&t.periodId!==e;return i||r},t.prototype.St=function(t,e){var n=this;Object.keys(this.ds).forEach(function(i){var r=n.ds[i];n.Rt(r,t,e)&&n.Vt(i)})},t.prototype.Ut=function(){var t=this;Object.keys(this.ds).forEach(function(e){var n,i=t.ds[e];if(!i.isActive()&&t.is.shouldEnableSubtitle(i.getSubtitle(),t.ds)){var r={subtitle:i.getSubtitle()};null===(n=t.hs)||void 0===n||n.dispatchEvent(s.PlayerEvent.SubtitleEnable,r),i.activate().then(function(){var e;null===(e=t.hs)||void 0===e||e.dispatchEvent(s.PlayerEvent.SubtitleEnabled,r)})}})},t.prototype.Vt=function(t){if(this.ds[t]){var e=this.ds[t].getSubtitle();this.ds[t].dispose(),delete this.ds[t],this.hs&&this.hs.dispatchEvent(s.PlayerEvent.SubtitleRemoved,{subtitle:e})}},t.prototype.clearBuffersUntil=function(t){var e=this;Object.keys(this.ds).forEach(function(n){return e.ds[n].clearBuffersUntil(t)})},t.prototype.dispose=function(){this.Wt(),this.is=(0,o.dispose)(this.is),this.js=(0,o.dispose)(this.js),this.ks=(0,o.dispose)(this.ks),this.gs=void 0,this.fs=null,this.hs.off(s.PlayerEvent.Seek,this.Ot),this.hs.off(s.PlayerEvent.TimeShift,this.Ot),this.hs.off(s.PlayerEvent.Seeked,this.Pt),this.hs.off(s.PlayerEvent.TimeShifted,this.Pt),this.hs.off(s.PlayerEvent.SourceUnloaded,this.Wt),this.ms(),this.ds={},this.hs=null},t}();e.SubtitleService=M},74715:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.isSubtitleTrack=function(t,e){return(i.MimeTypeHelper.isText(t)||i.MimeTypeHelper.isTtmlXml(t))&&!e||i.MimeTypeHelper.isApplication(t)},e.isFragmentedAdaptationSet=function(t){var e=[t];return t.Representation&&t.Representation.length>0&&e.push(t.Representation[0]),e.some(function(t){return t.SegmentList||t.SegmentTemplate||t.SegmentBase})};var i=n(85434)},74437:function(t,e,n){var i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},i.apply(this,arguments)},r=this&&this.__runInitializers||function(t,e,n){for(var i=arguments.length>2,r=0;r<e.length;r++)n=i?e[r].call(t,n):e[r].call(t);return i?n:void 0},o=this&&this.__esDecorate||function(t,e,n,i,r,o){function s(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var a,u=i.kind,l="getter"===u?"get":"setter"===u?"set":"value",c=!e&&t?i.static?t:t.prototype:null,d=e||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),f=!1,p=n.length-1;p>=0;p--){var h={};for(var v in i)h[v]="access"===v?{}:i[v];for(var v in i.access)h.access[v]=i.access[v];h.addInitializer=function(t){if(f)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(t||null))};var g=(0,n[p])("accessor"===u?{get:d.get,set:d.set}:d[l],h);if("accessor"===u){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(a=s(g.get))&&(d.get=a),(a=s(g.set))&&(d.set=a),(a=s(g.init))&&r.unshift(a)}else(a=s(g))&&("field"===u?r.unshift(a):d[l]=a)}c&&Object.defineProperty(c,i.name,d),f=!0};Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractSubtitleHandler=void 0;var s=n(80813),a=n(3714),u=n(80438),l=n(69957),c=n(44468),d=n(88052),f=n(62756),p=function(){var t,e,n=[];return t=function(){function t(t,e,i){void 0===i&&(i=null);var o=this;this.timeline=r(this,n),this.onCueEnter=function(t){o.context.eventHandler.dispatchEvent(a.PlayerEvent.CueEnter,h(t,o.getSubtitle().id))},this.onCueExit=function(t){o.context.eventHandler&&o.context.eventHandler.dispatchEvent(a.PlayerEvent.CueExit,h(t,o.getSubtitle().id))},this.onCueUpdate=function(t){o.context.eventHandler.dispatchEvent(a.PlayerEvent.CueUpdate,h(t,o.getSubtitle().id))},this.context=t,this.dbb=e,this.dbb.enabled=this.dbb.enabled||!1,this.timeline=new u.Timeline(t,{onCueEnter:this.onCueEnter,onCueExit:this.onCueExit,onCueUpdate:this.onCueUpdate}),this.timeline.stopListening(),this.periodId=i,this.ebb=t.serviceManager.get(s.ServiceName.SourceStoreService,t.sourceContext.sourceIdentifier)}return t.prototype.fireOnCueParsedEvents=function(t,e){var n=this;t&&this.context.eventHandler&&t.forEach(function(t){n.context.eventHandler.dispatchEvent(a.PlayerEvent.CueParsed,i(i({subtitleId:n.getSubtitle().id},t),{periodId:e}))})},t.prototype.isActive=function(){return this.dbb.enabled},t.prototype.activate=function(){return this.dbb.enabled=!0,this.timeline.startListening(),this.timeline.show(),Promise.resolve()},t.prototype.deactivate=function(){return this.dbb.enabled=!1,this.timeline.stopListening(),this.timeline.hide(),Promise.resolve()},t.prototype.refresh=function(){this.timeline.show()},t.prototype.getSubtitle=function(){return this.dbb},t.prototype.clearBuffersUntil=function(t){this.timeline.removeCuesUntil(t)},t.prototype.dispose=function(){this.ebb=null,this.deactivate(),this.timeline.dispose()},t.prototype.isTsContainer=function(){var t,e=d.ModuleManager.get(f.ModuleName.EngineBitmovin),n=e.selectors,i=e.mseModuleTypes;return(null===(t=n.getContainerFormat(this.ebb.getState(),c.MediaType.Video))||void 0===t?void 0:t.source)===i.containerFormat.TS},t.prototype.applyVttOffset=function(t){return this.isTsContainer()?t.map(function(t){return null!=t.offset?i(i({},t),{start:t.start+t.offset,end:t.end+t.offset,updates:t.updates.map(function(e){return i(i({},e),{updateTime:e.updateTime+t.offset})})}):t}):t},t}(),function(){var i="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;e=[(0,l.trackPerformance)("SubtitleHandler.activate")],o(t,null,e,{kind:"method",name:"activate",static:!1,private:!1,access:{has:function(t){return"activate"in t},get:function(t){return t.activate}},metadata:i},null,n),i&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:i})}(),t}();function h(t,e){return i({subtitleId:e,start:t.start,end:t.end},t.content)}e.AbstractSubtitleHandler=p},39310:function(t,e,n){var i=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.Cea608Handler=void 0;var r=n(74437),o=n(69363),s=function(t){function e(e,n,i){return void 0===i&&(i=null),t.call(this,e,n,i)||this}return i(e,t),e.prototype.onSeek=function(){},e.prototype.onSeeked=function(t,e){var n=e<t,i=this.context.settings.CLEAR_BUFFERS_ON_SEEKING_BACKWARDS;n&&i&&this.clearBuffersUntil(this.context.renderer.getDuration())},e.prototype.addCaption=function(t,e){t&&(this.fireOnCueParsedEvents([t],e),this.timeline.addCues([t],0))},e.prototype.getSubtitleType=function(){return o.SubtitleType.IN_STREAM},e}(r.AbstractSubtitleHandler);e.Cea608Handler=s},60672:function(t,e,n){var i=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.ExternalFileSubtitleHandler=void 0;var r=n(25926),o=n(4224),s=n(56481),a=n(3714),u=n(4129),l=n(29669),c=n(26438),d=n(74437),f=n(69363),p=function(t){function e(n,i,r){var o=t.call(this,n,i,r&&r._internalId.periodId)||this;return o.BT=function(t){if(o.timeline.removeCues(),null==t?void 0:t.body){o.AT=!0;var e=o.CT(t.body.trim()),n=o.applyVttOffset(e);o.fireOnCueParsedEvents(n,null),o.timeline.addCues(n)}},r&&(i.id=r.Representation[0]._id),i.url?(o.zT=e.enforceHTTPSForSecureOrigins(i.url.trim()),o.AT=!1,o.xT=new u.DefaultContentLoader(o.context,{maxRetries:o.context.settings.MAX_RETRIES,retryDelay:o.context.settings.RETRY_DELAY,requestType:l.HttpRequestType.MEDIA_SUBTITLES})):(o.context.logger.log("No url was provided for an external subtitle, nothing will be loaded."),o.AT=!0,o.yT=Promise.resolve()),o}return i(e,t),e.prototype.activate=function(){var e=this;return this.context.logger.debug("loading "+this.zT),t.prototype.activate.call(this).then(function(){return e.yT?e.yT:e.AT?Promise.resolve():(e.yT=e.xT.load(e.zT).then(e.BT).catch(function(t){var n,i;if(e.yT=void 0,!e.isActive())return Promise.resolve();throw e.context.eventHandler&&e.context.eventHandler.dispatchEvent(a.PlayerEvent.Warning,new r.PlayerWarning(o.WarningCode.NETWORK_COULD_NOT_LOAD_SUBTITLE)),e.context.logger.debug("Could not load subtitles/captions, got HTTP status code ".concat(null!==(i=null===(n=null==t?void 0:t.status)||void 0===n?void 0:n.toString())&&void 0!==i?i:""),t),e.deactivate(),"loading failed"}),e.yT)})},e.prototype.CT=function(t){return c.SubtitleParserFactory.createInstance(this.context,t).parse(t)},e.enforceHTTPSForSecureOrigins=function(t){var e=new RegExp("^(?:[a-z]+:)?//","i");return"https:"===location.protocol?t.replace(e,"//"):t},e.prototype.getSubtitleType=function(){return f.SubtitleType.EXTERNAL_FILE},e.prototype.clearBuffersUntil=function(){},e.prototype.onSeek=function(){},e.prototype.onSeeked=function(){},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.xT=(0,s.dispose)(this.xT)},e}(d.AbstractSubtitleHandler);e.ExternalFileSubtitleHandler=p},88788:function(t,e,n){var i=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},r.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.FragmentedSubtitleHandler=void 0;var o=n(4524),s=n(80813),a=n(3714),u=n(44468),l=n(87827),c=n(86897),d=n(93204),f=n(81199),p=n(34047),h=n(79721),v=n(85434),g=n(66502),y=n(23068),b=n(88052),m=n(62756),S=n(86058),T=n(15569),M=n(26438),E=n(74437),P=n(69363),x=function(t){function e(e,n,i,r){var o=t.call(this,e,i,n.periodId)||this;o.lU=function(t){var e,n=function(t){var e=null==t?void 0:t.getState();return void 0!==e&&void 0!==t?Promise.race(function(t){var e,n=null!==(e=t.activeTracks)&&void 0!==e?e:{};return Object.keys(n).flatMap(function(t){var e;return null!==(e=n[t].mediaTypes)&&void 0!==e?e:[]}).filter(function(t){return t===u.MediaType.Video||t===u.MediaType.Audio})}(e).map(function(n){return function(t,e,n){var i=U(n,e);return void 0!==i?Promise.resolve(i):(0,d.waitForStateChangeThen)(t)(function(t){return U(n,t)},function(t){return void 0!==t})}(t,e,n)})):Promise.reject("SourceState unavailable")}(o.context.serviceManager.get(s.ServiceName.SourceStoreService,o.context.sourceContext.sourceIdentifier)),i=null===(e=t.getSegmentInfo())||void 0===e?void 0:e.discontinuitySequenceNumber;return void 0!==i&&(n=n.then(function(){return o.cU(i)}).then(function(){return o.dU(i)}).then(function(){return o.isActive()}).catch(function(){return!1})),n.then(function(e){o.mU(t),e&&o.jU(t)})},o.tU=function(t){var e;if(t&&void 0!==t.time){var n=t.time;o.clearBuffersUntil(n);var i=(null===(e=o.UU)||void 0===e?void 0:e.getTimeForNextSegment(o.DT))||n,r=i-n,s=(0,f.getPlayableBufferLevel)(o.context.internalPlayer);isNaN(i)||r>=s||o.ET.hasNext(i)&&(o.ET.getMPDHandler().resolvePendingSegmentInfoRequests(),o.ET.getNext(i))}},o.vU=function(){o.ET.updateMpd()},o.eventHandler=e.eventHandler,o.SU=n.sourceStore,o.UU=e.serviceManager.get(s.ServiceName.StreamTimeService),o.TU=e.serviceManager.get(s.ServiceName.ManifestUpdateSchedulingService,e.sourceContext.sourceIdentifier),o.GT=r,o.FT=n.isHls,o.HT=e.bufferSettings;var a=b.ModuleManager.get(m.ModuleName.EngineBitmovin).SegmentController;return o.ET=new a(e,o.lU,n.mimeType,n.codec,n.isHls,n.manifestLoader,n.periodId,n.sourceStore),o.ET.setCurrentLangObj(i),o.DT="".concat(n.mimeType,"/").concat(i.id),o.VU=b.ModuleManager.get(m.ModuleName.HLS,!1),o.XU(),o}return i(e,t),e.prototype.XU=function(){!this.WU&&this.SU&&(this.WU=(0,d.subscribe)(this.SU)(function(t){return null==t?void 0:t.manifest},this.vU,function(t,e){return Boolean((null==t?void 0:t.isInitialized)&&!(null==e?void 0:e.isInitialized))}))},e.prototype.YU=function(){this.WU&&(this.WU(),this.WU=void 0)},e.prototype.ZU=function(t){return _(t)?(0,T.parsePlainTextSubtitles)(t):function(t){return v.MimeTypeHelper.isApplication(t.getMimeType())&&!C(t)}(t)?(0,S.parseMP4WrappedSubtitles)(t,this.context.logger):t.getMetadata().subtitles},e.prototype.aU=function(t){var e=t.getMetadata();e.subtitles=this.ZU(t),t.setMetadata(e)},e.prototype.bU=function(t){var e,n=null!==(e=t.getPlaybackTime())&&void 0!==e?e:t.getSegmentInfo().startTime;t.setPlaybackTime(n)},e.prototype.cU=function(t){var e=this.GT();return this.FT&&e?(void 0!==t&&this.iU()||(t=-1),e.waitForInitializationForDiscontinuity(t)):Promise.resolve()},e.prototype.dU=function(t){if(!this.iU())return Promise.resolve();if(void 0!==this.kU(t))return Promise.resolve();if(!this.VU)return Promise.reject(new Error("HLS Module missing"));var e=this.VU.selectors,n=e.getHlsState,i=e.getPresentationTimeOffset;return(0,d.waitForStateChangeThen)(this.SU)(function(e){return i(n(e),String(t))},function(t){return void 0!==t}).then()},e.prototype.eU=function(t){var e,n,i=null===(e=this.context.serviceManager.get(s.ServiceName.SourceStoreService,t))||void 0===e?void 0:e.getState(),r=null===(n=this.ET.getCurrentAdaptationSet())||void 0===n?void 0:n.Representation[0];return r&&i?(0,b.ModuleManager.get(m.ModuleName.EngineBitmovin).selectors.getSegmentInfos)(i,r._internalId.key()):[]},e.prototype.fU=function(t,e){var n,i,r,o,a=b.ModuleManager.get(m.ModuleName.EngineBitmovin).AdaptationSetId,u=this.context.serviceManager.get(s.ServiceName.ManifestService,t),l=new a(h.DEFAULT_PERIOD_ID,e),c=null==u?void 0:u.getAdaptationSet(l);return null!==(o=null===(r=null===(i=null===(n=null==c?void 0:c.Representation[0])||void 0===n?void 0:n.SegmentList)||void 0===i?void 0:i[0])||void 0===r?void 0:r.SegmentURL)&&void 0!==o?o:[]},e.prototype.gU=function(){var t=this.context.sourceContext.sourceIdentifier;return this.context.settings.ENABLE_SEGMENT_INFO_PROVIDER_FROM_STORE?this.eU(t):this.fU(t,this.getSubtitle().id)},e.prototype.hU=function(){var t=this.gU();if(t&&0!==t.length)return t.reduce(function(t,e){var n=O(e)?e.startTime:e._playbackTime,i=O(e)?e.discontinuitySequenceNumber:e._discontinuitySequenceNumber;return(0,y.isNumber)(n)&&(0,y.isNumber)(i)&&void 0===t[i]&&(t[i]=n),t},{})},e.prototype.iU=function(){var t,e=b.ModuleManager.get(m.ModuleName.HLS,!1),n=null===(t=this.SU)||void 0===t?void 0:t.getState();if(!e||!n)return!1;var i=e.selectors,r=i.getHlsState,o=i.getMergedDiscontinuityTimings,s=r(n);if(!s)return!1;var a=this.hU();if(!a)return!1;var u=o(s),l=Object.keys(a).find(function(t){return!u[t]||Math.abs(u[t].startTime-a[t])>1}),c=Object.keys(u).find(function(t){return null==a[t]});return null==l&&null==c},e.prototype.jU=function(t){this.nU(t),this.aU(t),this.bU(t),this.pU(t),this.isActive()&&this.timeline.show()},e.prototype.kU=function(t){var e;if(this.VU){var n=this.VU.selectors,i=n.getHlsState,r=n.getPresentationTimeOffset,o=null===(e=this.SU)||void 0===e?void 0:e.getState(),s=o?i(o):void 0;if(s)return r(s,String(t))}},e.prototype.mU=function(t){var e,n=t.getPlaybackTimeRange();if(n){var i=b.ModuleManager.get(m.ModuleName.EngineBitmovin),r=i.actions.removeStreamTimeRange,o=i.mseModuleTypes.streamTimeRangeType;null===(e=this.SU)||void 0===e||e.dispatch(r(this.DT,n,o.Loading))}},e.prototype.nU=function(t){var e,n=t.getPlaybackTimeRange();if(!t.isInit()&&n){var i=b.ModuleManager.get(m.ModuleName.EngineBitmovin).actions.addLoadedRange,o=r(r({},n),{bufferBlockId:-1});null===(e=this.SU)||void 0===e||e.dispatch(i(this.DT,o))}},e.prototype.oU=function(t){var e,n,i=-this.ET.getMPDHandler().getTimestampOffset();if(this.FT){var r=t.getSegmentInfo().discontinuitySequenceNumber,o=this.kU(r);void 0!==o?i=-o:this.context.logger.warn("FragmentedSubtitleHandler: Failed to get PTO for disco sequence ".concat(r," from store, falling back to MPDHandler value of ").concat(-i),t.getSegmentInfo())}return i+(null!==(n=null===(e=this.GT())||void 0===e?void 0:e.getTimestampMappingOffset(t))&&void 0!==n?n:0)},e.prototype.pU=function(t){var n=t.getMetadata().subtitles;if(Array.isArray(n)&&0!==n.length){var i=_(t),r=this.oU(t),o=i||function(t){return"stpp"===p.CodecStringHelper.extractCodec(t.getCodec())}(t)||function(t){return"application/mp4"===t.getMimeType()&&"wvtt"===t.getCodec()&&!C(t)}(t),s=o?this.qU(n,r):n,a=i?this.applyVttOffset(s):s,u=e.ensureCueInSegmentRange(a,t.getPlaybackTime(),t.getDuration(),r,this.isTsContainer());this.fireOnCueParsedEvents(u,this.periodId),this.timeline.addCues(u)}},e.prototype.qU=function(t,e){var n=this;return t.flatMap(function(t){return n.rU(t.text,e)})},e.ensureCueInSegmentRange=function(t,e,n,i,o){if(void 0===o&&(o=!1),!e&&0!==e||e<0||!n)return t;if(t.length>0){var s=n+i;if(t.every(function(t){return t.end<=s}))return t.map(function(t){return o&&null!=t.offset?r(r({},t),{start:t.start+e-i-t.offset,end:t.end+e-i-t.offset}):r(r({},t),{start:t.start+e-i,end:t.end+e-i})})}return t},e.prototype.rU=function(t,e){var n=M.SubtitleParserFactory.createInstance(this.context,t);return e?n.parse(t,e):n.parse(t)},e.prototype.activate=function(){var e=this;return t.prototype.activate.call(this),this.sU().then(function(){if(e.isActive()){var t=function(t,e){var n=(0,l.getPlayerState)(e.getState());return(0,l.getIsSeekingOrTimeshifting)(n)?n.targetPlaybackTime:t.getCurrentTime(!0)}(e.context.renderer,e.context.store);e.ET.activateSubtitleSegmentController(t),e.ET.hasNext(t)&&e.ET.getNext(t),e.eventHandler.on(a.PlayerEvent.TimeChanged,e.tU)}})},e.prototype.sU=function(){var t=this.ET.getCurrentAdaptationSet().Representation[0],e=t._internalId,n=t._mimeType,i=b.ModuleManager.get(m.ModuleName.EngineBitmovin).actions,r=i.setRepresentationIdAction,o=i.setMediaTypeAction;return this.SU.dispatch(r(e)),this.SU.dispatch(o(e,v.MimeTypeHelper.getMediaType(n))),this.TU.waitForRepUpdate(e)},e.prototype.deactivate=function(){var e;this.timeline.removeCues();var n=b.ModuleManager.get(m.ModuleName.EngineBitmovin).actions,i=n.resetStreamTimeline,r=n.resetLoadedRanges;this.eventHandler.off(a.PlayerEvent.TimeChanged,this.tU),this.SU.dispatch(i(this.DT)),this.SU.dispatch(r(this.DT));var o=null===(e=this.ET.getCurrentAdaptationSet())||void 0===e?void 0:e._internalId;return o&&this.SU.dispatch(b.ModuleManager.get(m.ModuleName.EngineBitmovin).actions.removeActiveTrackAction(o)),t.prototype.deactivate.call(this)},e.prototype.getSubtitleType=function(){return P.SubtitleType.FRAGMENTED},e.prototype.clearBuffersUntil=function(e){t.prototype.clearBuffersUntil.call(this,e);var n=b.ModuleManager.get(m.ModuleName.EngineBitmovin).actions.removeLoadedRange;this.SU.dispatch(n(this.DT,{start:0,end:e,bufferBlockId:-1}))},e.prototype.uU=function(t){var e,n=null===(e=this.SU)||void 0===e?void 0:e.getState(),i=(0,c.getBufferState)(n),r=i?(0,c.getLoadedRangesForMimeType)(i,this.DT):[];return(0,o.isInTimeRanges)(r,t)},e.prototype.onSeek=function(t,e){this.isActive()&&(this.uU(e)||this.ET.cancelLoading())},e.prototype.onSeeked=function(t,e){if(this.isActive()&&!this.uU(e)){this.timeline.removeCues();var n=b.ModuleManager.get(m.ModuleName.EngineBitmovin).actions.resetLoadedRanges;this.SU.dispatch(n(this.DT)),this.ET.seekTo(e),this.ET.hasNext(e)&&this.ET.getNext(e)}},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.YU(),this.ET.dispose()},e}(E.AbstractSubtitleHandler);function C(t){return g.TextSegmentAnalyzer.isPlainTextPayload(t.getData())}function _(t){var e=t.getCodec();return("wvtt"===e||"vtt"===e||""===e&&t.getMimeType().includes("vtt"))&&C(t)}function U(t,e){var n=b.ModuleManager.get(m.ModuleName.EngineBitmovin,!1);if(void 0!==e&&void 0!==n)return n.selectors.getContainerFormat(e,t)}function O(t){return"discontinuitySequenceNumber"in t}e.FragmentedSubtitleHandler=x},69363:function(t,e){var n;Object.defineProperty(e,"__esModule",{value:!0}),e.SubtitleType=void 0,function(t){t[t.EXTERNAL_FILE=0]="EXTERNAL_FILE",t[t.FRAGMENTED=1]="FRAGMENTED",t[t.IN_STREAM=2]="IN_STREAM"}(n||(e.SubtitleType=n={}))},71340:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.hashCode=function(t){var e=0;if(0===t.length)return e;for(var n=0;n<t.length;n++)e=(e<<5)-e+t.charCodeAt(n),e&=e;return e}},85224:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.createHtmlElement=function(t){var e;if(function(){if(void 0===o){var t=(0,r.getCapabilities)().isReactNative,e=window&&window.document&&"function"==typeof window.document.createElement;o=!e||t}return o}()){var n=function(){return null!=i||(i=new DOMParser),i}().parseFromString("<".concat(t,"></").concat(t,">"),"text/html");return(null===(e=n.body)||void 0===e?void 0:e.firstChild)||n.firstChild}return document.createElement(t)};var i,r=n(21513),o=void 0}},function(t){return function(){return t(52112)}()}])});
|
|
18
18
|
})();
|