bitmovin-player 8.281.0 → 8.282.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.
Files changed (96) hide show
  1. package/bitmovinplayer-serviceworker.js +2 -2
  2. package/bitmovinplayer-serviceworker.prod.js +2 -2
  3. package/bitmovinplayer-ui.js +1 -1
  4. package/bitmovinplayer.js +2 -2
  5. package/bitmovinplayer.prod.js +2 -2
  6. package/modules/bitmovinplayer-abr.js +2 -2
  7. package/modules/bitmovinplayer-abr.prod.js +2 -2
  8. package/modules/bitmovinplayer-advertising-bitmovin.js +2 -2
  9. package/modules/bitmovinplayer-advertising-bitmovin.prod.js +2 -2
  10. package/modules/bitmovinplayer-advertising-core.js +2 -2
  11. package/modules/bitmovinplayer-advertising-core.prod.js +2 -2
  12. package/modules/bitmovinplayer-advertising-ima.js +2 -2
  13. package/modules/bitmovinplayer-advertising-ima.prod.js +2 -2
  14. package/modules/bitmovinplayer-advertising-omsdk.js +2 -2
  15. package/modules/bitmovinplayer-advertising-omsdk.prod.js +2 -2
  16. package/modules/bitmovinplayer-analytics.js +1 -1
  17. package/modules/bitmovinplayer-analytics.prod.js +1 -1
  18. package/modules/bitmovinplayer-container-mp4.js +2 -2
  19. package/modules/bitmovinplayer-container-mp4.prod.js +2 -2
  20. package/modules/bitmovinplayer-container-ts.js +2 -2
  21. package/modules/bitmovinplayer-container-ts.prod.js +2 -2
  22. package/modules/bitmovinplayer-container-webm.js +2 -2
  23. package/modules/bitmovinplayer-container-webm.prod.js +2 -2
  24. package/modules/bitmovinplayer-core.js +2 -2
  25. package/modules/bitmovinplayer-core.prod.js +2 -2
  26. package/modules/bitmovinplayer-crypto.js +2 -2
  27. package/modules/bitmovinplayer-crypto.prod.js +2 -2
  28. package/modules/bitmovinplayer-dash.js +2 -2
  29. package/modules/bitmovinplayer-dash.prod.js +2 -2
  30. package/modules/bitmovinplayer-drm.js +2 -2
  31. package/modules/bitmovinplayer-drm.prod.js +2 -2
  32. package/modules/bitmovinplayer-engine-bitmovin.js +2 -2
  33. package/modules/bitmovinplayer-engine-bitmovin.prod.js +2 -2
  34. package/modules/bitmovinplayer-engine-native.js +2 -2
  35. package/modules/bitmovinplayer-engine-native.prod.js +2 -2
  36. package/modules/bitmovinplayer-engine-webrtc.js +2 -2
  37. package/modules/bitmovinplayer-engine-webrtc.prod.js +2 -2
  38. package/modules/bitmovinplayer-envivio.js +1 -1
  39. package/modules/bitmovinplayer-envivio.prod.js +1 -1
  40. package/modules/bitmovinplayer-hls.js +2 -2
  41. package/modules/bitmovinplayer-hls.prod.js +2 -2
  42. package/modules/bitmovinplayer-lowlatency.js +2 -2
  43. package/modules/bitmovinplayer-lowlatency.prod.js +2 -2
  44. package/modules/bitmovinplayer-mserenderer.js +2 -2
  45. package/modules/bitmovinplayer-mserenderer.prod.js +2 -2
  46. package/modules/bitmovinplayer-patch.js +1 -1
  47. package/modules/bitmovinplayer-patch.prod.js +1 -1
  48. package/modules/bitmovinplayer-playstation4.js +2 -2
  49. package/modules/bitmovinplayer-playstation4.prod.js +2 -2
  50. package/modules/bitmovinplayer-playstation5.js +2 -2
  51. package/modules/bitmovinplayer-playstation5.prod.js +2 -2
  52. package/modules/bitmovinplayer-polyfill.js +1 -1
  53. package/modules/bitmovinplayer-polyfill.prod.js +1 -1
  54. package/modules/bitmovinplayer-reactnative.js +1 -1
  55. package/modules/bitmovinplayer-reactnative.prod.js +1 -1
  56. package/modules/bitmovinplayer-remotecontrol.js +2 -2
  57. package/modules/bitmovinplayer-remotecontrol.prod.js +2 -2
  58. package/modules/bitmovinplayer-serviceworker-client.js +2 -2
  59. package/modules/bitmovinplayer-serviceworker-client.prod.js +2 -2
  60. package/modules/bitmovinplayer-serviceworker.js +2 -2
  61. package/modules/bitmovinplayer-serviceworker.prod.js +2 -2
  62. package/modules/bitmovinplayer-sgai.js +2 -2
  63. package/modules/bitmovinplayer-sgai.prod.js +2 -2
  64. package/modules/bitmovinplayer-smooth.js +2 -2
  65. package/modules/bitmovinplayer-smooth.prod.js +2 -2
  66. package/modules/bitmovinplayer-style.js +2 -2
  67. package/modules/bitmovinplayer-style.prod.js +2 -2
  68. package/modules/bitmovinplayer-subtitles-cea608.js +2 -2
  69. package/modules/bitmovinplayer-subtitles-cea608.prod.js +2 -2
  70. package/modules/bitmovinplayer-subtitles-native.js +2 -2
  71. package/modules/bitmovinplayer-subtitles-native.prod.js +2 -2
  72. package/modules/bitmovinplayer-subtitles-ttml.js +2 -2
  73. package/modules/bitmovinplayer-subtitles-ttml.prod.js +2 -2
  74. package/modules/bitmovinplayer-subtitles-vtt.js +2 -2
  75. package/modules/bitmovinplayer-subtitles-vtt.prod.js +2 -2
  76. package/modules/bitmovinplayer-subtitles.js +2 -2
  77. package/modules/bitmovinplayer-subtitles.prod.js +2 -2
  78. package/modules/bitmovinplayer-thumbnail-imp.js +2 -2
  79. package/modules/bitmovinplayer-thumbnail-imp.prod.js +2 -2
  80. package/modules/bitmovinplayer-thumbnail.js +2 -2
  81. package/modules/bitmovinplayer-thumbnail.prod.js +2 -2
  82. package/modules/bitmovinplayer-tizen.js +2 -2
  83. package/modules/bitmovinplayer-tizen.prod.js +2 -2
  84. package/modules/bitmovinplayer-ui.js +2 -2
  85. package/modules/bitmovinplayer-ui.prod.js +2 -2
  86. package/modules/bitmovinplayer-vidaa.js +2 -2
  87. package/modules/bitmovinplayer-vidaa.prod.js +2 -2
  88. package/modules/bitmovinplayer-vr.js +2 -2
  89. package/modules/bitmovinplayer-vr.prod.js +2 -2
  90. package/modules/bitmovinplayer-webos.js +2 -2
  91. package/modules/bitmovinplayer-webos.prod.js +2 -2
  92. package/modules/bitmovinplayer-wpe.js +2 -2
  93. package/modules/bitmovinplayer-wpe.prod.js +2 -2
  94. package/modules/bitmovinplayer-xml.js +1 -1
  95. package/modules/bitmovinplayer-xml.prod.js +1 -1
  96. package/package.json +1 -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.281.0
12
+ * Bitmovin Player Version 8.282.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.rU={},this.sU=0}return t.prototype.addSubtitle=function(t){this.removeSubtitle(t.id),this.rU[this.uU()]=n({isFragmented:!1},t)},t.prototype.removeSubtitle=function(t){var e=this;Object.keys(this.rU).forEach(function(n){e.rU[n].id===t&&delete e.rU[n]})},t.prototype.shouldEnableSubtitle=function(t,e){var n=this,i=Object.keys(this.rU).find(function(i){return n.tU(n.rU[i],e)===t.id});return Boolean(i)},t.prototype.tU=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.uU=function(){return this.sU++,this.sU},t.prototype.dispose=function(){this.rU={},this.sU=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.vU={}}return t.prototype.addSubtitleHandler=function(t){this.vU[t.getSubtitle().id]=t},t.prototype.deactivate=function(){return this.xU()?Promise.all(Object.values(this.vU).map(function(t){return t.deactivate()})).then(function(){}):Promise.resolve()},t.prototype.activate=function(t){var e=this;return void 0===t&&(t=this.wU),this.xU()?(this.wU=t,this.deactivate().then(function(){var t=Object.values(e.vU).find(function(t){return(0,i.isEqualIsoLanguage)(t.getSubtitle().lang,e.wU)});if((t=null!=t?t:Object.values(e.vU)[0])&&!t.isActive())return t.activate().catch(function(){})})):Promise.resolve()},t.prototype.onSeek=function(t,e){Object.values(this.vU).forEach(function(n){return n.onSeek(t,e)})},t.prototype.onSeeked=function(t,e){Object.values(this.vU).forEach(function(n){return n.onSeeked(t,e)})},t.prototype.dispose=function(){Object.values(this.vU).forEach(function(t){return t.dispose()}),this.vU=null},t.prototype.xU=function(){return Object.keys(this.vU).length>0},t.prototype.getForcedSubtitleHandler=function(t){if(this.vU)return Object.values(this.vU).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),E=function(){function t(t){var e=this;this.context=t,this.getTransmuxer=function(){return e.ct},this.ut=function(){e.tt()},this.At=function(t){var n;e.tt(),e.ht=t.position;var i=null!==(n=e.ht)&&void 0!==n?n:0,r=function(t){return function(t){return"seekTarget"in t}(t)?t.seekTarget:t.target}(t);Object.values(e.Zt).forEach(function(t){return t.onSeek(i,r)}),e.ft.onSeek(i,r)},this.Bt=function(){var t,n=null!==(t=e.ht)&&void 0!==t?t:0,i=e.context.internalPlayer.getCurrentTime();Object.values(e.Zt).forEach(function(t){return t.onSeeked(n,i)}),e.ft.onSeeked(n,i)},this.Ft=function(t,n){var i=e.bt.findPeriod(t);i&&(e.Et(t,n),e.setupControllersForNextPeriod(i),e.Gt())},this.Su=function(){Object.keys(e.Zt).forEach(function(t){return e.Zt[t].dispose()}),e.Zt={},e.at&&(e.at.dispose(),e.at=void 0),e.gt&&e.gt.reset()},this.Zt={},this.dt=t.eventHandler,this.bt=t.serviceManager.get(r.ServiceName.ManifestService,t.sourceContext.sourceIdentifier),this.et=new h.EnabledSubtitlesTracker,this.ft=new g.ForcedSubtitleController,this.dt.on(a.PlayerEvent.Seek,this.At),this.dt.on(a.PlayerEvent.TimeShift,this.At),this.dt.on(a.PlayerEvent.Seeked,this.Bt),this.dt.on(a.PlayerEvent.TimeShifted,this.Bt),this.dt.on(a.PlayerEvent.SourceUnloaded,this.Su),this.jt=f.ModuleManager.has(p.ModuleName.SubtitlesCEA608)?f.ModuleManager.get(p.ModuleName.SubtitlesCEA608):void 0,this.lt()}return t.prototype.kt=function(t,e){var n=t!==e,i=this.bt.isHlsManifest()&&!(e||!t);return n||i},t.prototype.lt=function(){var t=this,e=this.context.serviceManager.get(r.ServiceName.SourceStoreService,this.context.sourceContext.sourceIdentifier);this.it=(0,s.subscribe)(e)(f.ModuleManager.get(p.ModuleName.EngineBitmovin).selectors.getPlayingPeriodId,this.Ft,function(e,n){return t.kt(e,n)})},t.prototype.setupControllersForNextPeriod=function(t){var e=this;t.AdaptationSet.forEach(function(t){var n=t._mimeType;(0,M.isSubtitleTrack)(n,e.bt.isHlsManifest())&&e.mt(t,n)})},t.prototype.mt=function(t,e){if((0,M.isFragmentedAdaptationSet)(t))return this.context.store.dispatch((0,u.initializeMetricsForMimeType)(e,this.context.settings)),void this.nt(t,e);this.ot(t,e)},t.prototype.nt=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.bt.isHlsManifest(),manifestLoader:this.context.serviceManager.get(r.ServiceName.ManifestLoadingService,n),periodId:t._internalId.periodId,sourceStore:i};this.addFragmentSubtitle(o,t)}},t.prototype.ot=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.bt.toSubtitleTrack(t,e);n.setAdaptationSetId(t._internalId),i.url=n.getSubtitleUrl().toString(),this.addExternalSubtitle(i,t)}},t.prototype.setTransmuxer=function(t){this.ct=t},t.prototype.hasSubtitle=function(t){return Boolean(this.Zt[t])},t.prototype.enableSubtitle=function(t){var e=this,n=this.Zt[t];return n&&!n.isActive()?n.activate().then(function(){n.refresh(),e.ft.deactivate()}).then(function(){return e.et.addSubtitle(n.getSubtitle()),!0}).catch(function(t){return!1}):Promise.resolve(!1)},t.prototype.addExternalSubtitle=function(t,e){if(void 0===e&&(e=null),t.id||(t.id=t.url),this.pt(t,e))return t;var n=new b.ExternalFileSubtitleHandler(this.context,t,e);return this.qt(n),t},t.prototype.pt=function(t,e){var n,i,r=this.Zt[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.ft.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.qt=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.ft.addSubtitleHandler(t);else{var i=!1,r=e.id;this.Zt[r]&&(i=this.Zt[r].isActive(),this.Ht(r)),this.rt(t),i&&t.activate()}},t.prototype.rt=function(t){var e=t.getSubtitle();this.st(e),this.Zt[e.id]=t,this.Ct(e)},t.prototype.st=function(t){var e,n,i=this.context.sourceContext.source.labeling,r=this.bt.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 null;var n=this.bt.toSubtitleTrack(e,t.mimeType);n.isFragmented=!0,n.url=null;var i=new m.FragmentedSubtitleHandler(this.context,t,n,this.getTransmuxer);return this.qt(i),n},t.prototype.setupCea608CaptionExtractor=function(t){var e;if(!this.jt)return this.dt.dispatchEvent(a.PlayerEvent.Warning,new v.PlayerModuleMissingWarning(p.ModuleName.SubtitlesCEA608,"The ".concat(p.ModuleName.SubtitlesCEA608," module is required to parse CEA captions."))),null;if(!f.ModuleManager.has(p.ModuleName.ContainerMP4))return this.dt.dispatchEvent(a.PlayerEvent.Warning,new v.PlayerModuleMissingWarning(p.ModuleName.ContainerMP4,"The ".concat(p.ModuleName.ContainerMP4," module is required to parse CEA captions."))),null;this.at&&this.at.dispose();var n=f.ModuleManager.get(p.ModuleName.ContainerMP4),i=this.jt.Cea608Extractor;return this.at=new i(t,n,null===(e=this.context.config.tweaks)||void 0===e?void 0:e.parse_cea_708_caption),this.at},t.prototype.tt=function(){this.at&&this.at.reset()},t.prototype.vt=function(){var t=f.ModuleManager.get(p.ModuleName.HLS);this.gt=new t.DiscontinuitySequenceNumberTracker(c.MimeTypeHelper.isVideo),this.gt.subscribe(this.ut)},t.prototype.wt=function(t){this.gt||this.vt(),this.gt.trackSegment(t)},t.prototype.xt=function(){return this.bt.getManifest()&&this.bt.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.jt)||void 0===r?void 0:r.CEA_EXTRACTOR_SUPPORTED_CODEC_TAGS.includes((0,l.getCodecTag)(e)))?this.yt(e,t.getTimestampOffset()):(this.zt(n,e.getPeriodId()),Promise.resolve())},t.prototype.yt=function(t,e){var n=this;return this.at?(this.xt()&&this.wt(t),this.at.extract(t).then(function(i){!function(t,e){t.forEach(function(t){t.start-=e,t.end-=e})}(i,e),i.length>0&&n.zt(i,t.getPeriodId())}).catch(function(t){var e;t instanceof v.PlayerModuleMissingWarning&&(null===(e=n.at)||void 0===e||e.dispose(),n.at=void 0,n.dt.dispatchEvent(a.PlayerEvent.Warning,t))})):Promise.resolve()},t.prototype.zt=function(t,e){if(t&&Array.isArray(t)&&0!==t.length)for(var n=this.bt.getClosedCaptionLabels(e),i=function(t){var i=t.channel;if(!r.Zt[i]){var o=n.find(function(t){return t.id===i})||{id:i,kind:"captions",lang:"unknown",label:"Captions (".concat(t.channel,")")};r.rt(new y.Cea608Handler(r.context,o))}r.Zt[i].addCaption(t,e)},r=this,o=0,a=t;o<a.length;o++)i(a[o])},t.prototype.Ct=function(t){this.dt.dispatchEvent(a.PlayerEvent.SubtitleAdded,{subtitle:i({},t)})},t.prototype.disableSubtitle=function(t){var e=this,n=this.Zt[t];return n?n.deactivate().then(function(){return e.et.removeSubtitle(t),0===e.getActiveSubtitles().length&&e.ft.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.Ht(t),this.et.removeSubtitle(t)},t.prototype.getActiveSubtitles=function(){var t=this;return Object.keys(this.Zt).filter(function(e){return t.Zt[e].isActive()}).map(function(e){return t.Zt[e].getSubtitle()})},t.prototype.hasSubtitles=function(){return Object.keys(this.Zt).length>0},t.prototype.getAvailableSubtitles=function(t){return Object.values(this.Zt).filter(function(e){var n=e.periodId;return!n||t===n}).map(function(t){return t.getSubtitle()})},t.prototype.enableForcedSubtitle=function(t){this.ft.activate(t).catch(function(){})},t.prototype.Dt=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.Et=function(t,e){var n=this;Object.keys(this.Zt).forEach(function(i){var r=n.Zt[i];n.Dt(r,t,e)&&n.Ht(i)})},t.prototype.Gt=function(){var t=this;Object.keys(this.Zt).forEach(function(e){var n,i=t.Zt[e];if(!i.isActive()&&t.et.shouldEnableSubtitle(i.getSubtitle(),t.Zt)){var r={subtitle:i.getSubtitle()};null===(n=t.dt)||void 0===n||n.dispatchEvent(a.PlayerEvent.SubtitleEnable,r),i.activate().then(function(){var e;null===(e=t.dt)||void 0===e||e.dispatchEvent(a.PlayerEvent.SubtitleEnabled,r)})}})},t.prototype.Ht=function(t){if(this.Zt[t]){var e=this.Zt[t].getSubtitle();this.Zt[t].dispose(),delete this.Zt[t],this.dt&&this.dt.dispatchEvent(a.PlayerEvent.SubtitleRemoved,{subtitle:e})}},t.prototype.clearBuffersUntil=function(t){var e=this;Object.keys(this.Zt).forEach(function(n){return e.Zt[n].clearBuffersUntil(t)})},t.prototype.dispose=function(){this.Su(),this.et=(0,o.dispose)(this.et),this.ft=(0,o.dispose)(this.ft),this.gt=(0,o.dispose)(this.gt),this.ct=void 0,this.bt=null,this.dt.off(a.PlayerEvent.Seek,this.At),this.dt.off(a.PlayerEvent.TimeShift,this.At),this.dt.off(a.PlayerEvent.Seeked,this.Bt),this.dt.off(a.PlayerEvent.TimeShifted,this.Bt),this.dt.off(a.PlayerEvent.SourceUnloaded,this.Su),this.it(),this.Zt={},this.dt=null},t}();e.SubtitleService=E},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)};Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractSubtitleHandler=void 0;var r=n(80813),o=n(3714),a=n(80438),u=n(44468),s=n(88052),l=n(62756),c=function(){function t(t,e,n){void 0===n&&(n=null);var i=this;this.onCueEnter=function(t){i.context.eventHandler.dispatchEvent(o.PlayerEvent.CueEnter,d(t,i.getSubtitle().id))},this.onCueExit=function(t){i.context.eventHandler&&i.context.eventHandler.dispatchEvent(o.PlayerEvent.CueExit,d(t,i.getSubtitle().id))},this.onCueUpdate=function(t){i.context.eventHandler.dispatchEvent(o.PlayerEvent.CueUpdate,d(t,i.getSubtitle().id))},this.context=t,this.Rbb=e,this.Rbb.enabled=this.Rbb.enabled||!1,this.timeline=new a.Timeline(t,{onCueEnter:this.onCueEnter,onCueExit:this.onCueExit,onCueUpdate:this.onCueUpdate}),this.timeline.stopListening(),this.periodId=n,this.Sbb=t.serviceManager.get(r.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(o.PlayerEvent.CueParsed,i(i({subtitleId:n.getSubtitle().id},t),{periodId:e}))})},t.prototype.isActive=function(){return this.Rbb.enabled},t.prototype.activate=function(){return this.Rbb.enabled=!0,this.timeline.startListening(),this.timeline.show(),Promise.resolve()},t.prototype.deactivate=function(){return this.Rbb.enabled=!1,this.timeline.stopListening(),this.timeline.hide(),Promise.resolve()},t.prototype.refresh=function(){this.timeline.show()},t.prototype.getSubtitle=function(){return this.Rbb},t.prototype.clearBuffersUntil=function(t){this.timeline.removeCuesUntil(t)},t.prototype.dispose=function(){this.Sbb=null,this.deactivate(),this.timeline.dispose()},t.prototype.isTsContainer=function(){var t,e=s.ModuleManager.get(l.ModuleName.EngineBitmovin),n=e.selectors,i=e.mseModuleTypes;return(null===(t=n.getContainerFormat(this.Sbb.getState(),u.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 d(t,e){return i({subtitleId:e,start:t.start,end:t.end},t.content)}e.AbstractSubtitleHandler=c},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.CU=function(t){if(o.timeline.removeCues(),null==t?void 0:t.body){o.BU=!0;var e=o.DU(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.AU=e.enforceHTTPSForSecureOrigins(i.url.trim()),o.BU=!1,o.yU=new s.DefaultContentLoader(o.context,{maxRetries:o.context.settings.MAX_RETRIES,retryDelay:o.context.settings.RETRY_DELAY,requestType:l.HttpRequestType.MEDIA_SUBTITLES})):(o.BU=!0,o.zU=Promise.resolve()),o}return i(e,t),e.prototype.activate=function(){var e=this;return t.prototype.activate.call(this).then(function(){return e.zU?e.zU:e.BU?Promise.resolve():(e.zU=e.yU.load(e.AU).then(e.CU).catch(function(t){if(e.zU=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.deactivate(),"loading failed"}),e.zU)})},e.prototype.DU=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.yU=(0,a.dispose)(this.yU)},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),E=n(26438),T=n(74437),U=n(69363),P=function(t){function e(e,n,i,r){var o=t.call(this,e,i,n.periodId)||this;o.mV=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=x(n,e);return void 0!==i?Promise.resolve(i):(0,d.waitForStateChangeThen)(t)(function(t){return x(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.dV(i)}).then(function(){return o.eV(i)}).then(function(){return o.isActive()}).catch(function(){return!1})),n.then(function(e){o.nV(t),e&&o.kV(t)})},o.uV=function(t){var e;if(t&&void 0!==t.time){var n=t.time;o.clearBuffersUntil(n);var i=(null===(e=o.LU)||void 0===e?void 0:e.getTimeForNextSegment(o.EU))||n,r=i-n,a=(0,f.getPlayableBufferLevel)(o.context.internalPlayer);isNaN(i)||r>=a||o.FU.hasNext(i)&&(o.FU.getMPDHandler().resolvePendingSegmentInfoRequests(),o.FU.getNext(i))}},o.wV=function(){o.FU.updateMpd()},o.eventHandler=e.eventHandler,o.JU=n.sourceStore,o.LU=e.serviceManager.get(a.ServiceName.StreamTimeService),o.KU=e.serviceManager.get(a.ServiceName.ManifestUpdateSchedulingService,e.sourceContext.sourceIdentifier),o.HU=r,o.GU=n.isHls,o.IU=e.bufferSettings;var u=b.ModuleManager.get(m.ModuleName.EngineBitmovin).SegmentController;return o.FU=new u(e,o.mV,n.mimeType,n.codec,n.isHls,n.manifestLoader,n.periodId,n.sourceStore),o.FU.setCurrentLangObj(i),o.EU="".concat(n.mimeType,"/").concat(i.id),o.MU=b.ModuleManager.get(m.ModuleName.HLS,!1),o.OU(),o}return i(e,t),e.prototype.OU=function(){!this.NU&&this.JU&&(this.NU=(0,d.subscribe)(this.JU)(function(t){return null==t?void 0:t.manifest},this.wV,function(t,e){return Boolean((null==t?void 0:t.isInitialized)&&!(null==e?void 0:e.isInitialized))}))},e.prototype.PU=function(){this.NU&&(this.NU(),this.NU=void 0)},e.prototype.QU=function(t){return C(t)?(0,M.parsePlainTextSubtitles)(t):function(t){return h.MimeTypeHelper.isApplication(t.getMimeType())&&!_(t)}(t)?(0,S.parseMP4WrappedSubtitles)(t,this.context.logger):t.getMetadata().subtitles},e.prototype.RU=function(t){var e=t.getMetadata();e.subtitles=this.QU(t),t.setMetadata(e)},e.prototype.cV=function(t){var e,n=null!==(e=t.getPlaybackTime())&&void 0!==e?e:t.getSegmentInfo().startTime;t.setPlaybackTime(n)},e.prototype.dV=function(t){var e=this.HU();return this.GU&&e?(void 0!==t&&this.jV()||(t=-1),e.waitForInitializationForDiscontinuity(t)):Promise.resolve()},e.prototype.eV=function(t){if(!this.jV())return Promise.resolve();if(void 0!==this.lV(t))return Promise.resolve();if(!this.MU)return Promise.reject(new Error("HLS Module missing"));var e=this.MU.selectors,n=e.getHlsState,i=e.getPresentationTimeOffset;return(0,d.waitForStateChangeThen)(this.JU)(function(e){return i(n(e),String(t))},function(t){return void 0!==t}).then()},e.prototype.fV=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.FU.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.gV=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.hV=function(){var t=this.context.sourceContext.sourceIdentifier;return this.context.settings.ENABLE_SEGMENT_INFO_PROVIDER_FROM_STORE?this.fV(t):this.gV(t,this.getSubtitle().id)},e.prototype.iV=function(){var t=this.hV();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.jV=function(){var t,e=b.ModuleManager.get(m.ModuleName.HLS,!1),n=null===(t=this.JU)||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.iV();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.kV=function(t){this.oV(t),this.RU(t),this.cV(t),this.qV(t),this.isActive()&&this.timeline.show()},e.prototype.lV=function(t){var e;if(this.MU){var n=this.MU.selectors,i=n.getHlsState,r=n.getPresentationTimeOffset,o=null===(e=this.JU)||void 0===e?void 0:e.getState(),a=o?i(o):void 0;if(a)return r(a,String(t))}},e.prototype.nV=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.JU)||void 0===e||e.dispatch(r(this.EU,n,o.Loading))}},e.prototype.oV=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.JU)||void 0===e||e.dispatch(i(this.EU,o))}},e.prototype.pV=function(t){var e,n,i=-this.FU.getMPDHandler().getTimestampOffset();if(this.GU){var r=t.getSegmentInfo().discontinuitySequenceNumber,o=this.lV(r);void 0!==o&&(i=-o)}return i+(null!==(n=null===(e=this.HU())||void 0===e?void 0:e.getTimestampMappingOffset(t))&&void 0!==n?n:0)},e.prototype.qV=function(t){var n=t.getMetadata().subtitles;if(Array.isArray(n)&&0!==n.length){var i=C(t),r=this.pV(t),o=i||function(t){return"stpp"===p.CodecStringHelper.extractCodec(t.getCodec())}(t)||function(t){return"application/mp4"===t.getMimeType()&&"wvtt"===t.getCodec()&&!_(t)}(t),a=o?this.rV(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.rV=function(t,e){var n=this;return t.flatMap(function(t){return n.sV(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.sV=function(t,e){var n=E.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.tV().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.FU.activateSubtitleSegmentController(t),e.FU.hasNext(t)&&e.FU.getNext(t),e.eventHandler.on(u.PlayerEvent.TimeChanged,e.uV)}})},e.prototype.tV=function(){var t=this.FU.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.JU.dispatch(r(e)),this.JU.dispatch(o(e,h.MimeTypeHelper.getMediaType(n))),this.KU.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.uV),this.JU.dispatch(i(this.EU)),this.JU.dispatch(r(this.EU));var o=null===(e=this.FU.getCurrentAdaptationSet())||void 0===e?void 0:e._internalId;return o&&this.JU.dispatch(b.ModuleManager.get(m.ModuleName.EngineBitmovin).actions.removeActiveTrackAction(o)),t.prototype.deactivate.call(this)},e.prototype.getSubtitleType=function(){return U.SubtitleType.FRAGMENTED},e.prototype.clearBuffersUntil=function(e){t.prototype.clearBuffersUntil.call(this,e);var n=b.ModuleManager.get(m.ModuleName.EngineBitmovin).actions.removeLoadedRange;this.JU.dispatch(n(this.EU,{start:0,end:e,bufferBlockId:-1}))},e.prototype.vV=function(t){var e,n=null===(e=this.JU)||void 0===e?void 0:e.getState(),i=(0,c.getBufferState)(n),r=i?(0,c.getLoadedRangesForMimeType)(i,this.EU):[];return(0,o.isInTimeRanges)(r,t)},e.prototype.onSeek=function(t,e){this.isActive()&&(this.vV(e)||this.FU.cancelLoading())},e.prototype.onSeeked=function(t,e){if(this.isActive()&&!this.vV(e)){this.timeline.removeCues();var n=b.ModuleManager.get(m.ModuleName.EngineBitmovin).actions.resetLoadedRanges;this.JU.dispatch(n(this.EU)),this.FU.seekTo(e),this.FU.hasNext(e)&&this.FU.getNext(e)}},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.PU(),this.FU.dispose()},e}(T.AbstractSubtitleHandler);function _(t){return g.TextSegmentAnalyzer.isPlainTextPayload(t.getData())}function C(t){var e=t.getCodec();return("wvtt"===e||"vtt"===e||""===e&&t.getMimeType().includes("vtt"))&&_(t)}function x(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.tT={},this.uT=0}return t.prototype.addSubtitle=function(t){this.removeSubtitle(t.id),this.tT[this.wT()]=n({isFragmented:!1},t)},t.prototype.removeSubtitle=function(t){var e=this;Object.keys(this.tT).forEach(function(n){e.tT[n].id===t&&delete e.tT[n]})},t.prototype.shouldEnableSubtitle=function(t,e){var n=this,i=Object.keys(this.tT).find(function(i){return n.vT(n.tT[i],e)===t.id});return Boolean(i)},t.prototype.vT=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.wT=function(){return this.uT++,this.uT},t.prototype.dispose=function(){this.tT={},this.uT=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.xT={}}return t.prototype.addSubtitleHandler=function(t){this.xT[t.getSubtitle().id]=t},t.prototype.deactivate=function(){return this.zT()?Promise.all(Object.values(this.xT).map(function(t){return t.deactivate()})).then(function(){}):Promise.resolve()},t.prototype.activate=function(t){var e=this;return void 0===t&&(t=this.yT),this.zT()?(this.yT=t,this.deactivate().then(function(){var t=Object.values(e.xT).find(function(t){return(0,i.isEqualIsoLanguage)(t.getSubtitle().lang,e.yT)});if((t=null!=t?t:Object.values(e.xT)[0])&&!t.isActive())return t.activate().catch(function(){})})):Promise.resolve()},t.prototype.onSeek=function(t,e){Object.values(this.xT).forEach(function(n){return n.onSeek(t,e)})},t.prototype.onSeeked=function(t,e){Object.values(this.xT).forEach(function(n){return n.onSeeked(t,e)})},t.prototype.dispose=function(){Object.values(this.xT).forEach(function(t){return t.dispose()}),this.xT=null},t.prototype.zT=function(){return Object.keys(this.xT).length>0},t.prototype.getForcedSubtitleHandler=function(t){if(this.xT)return Object.values(this.xT).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),T=function(){function t(t){var e=this;this.context=t,this.getTransmuxer=function(){return e.Cq},this.Uq=function(){e.Tq()},this.aq=function(t){var n;e.Tq(),e.Hq=t.position;var i=null!==(n=e.Hq)&&void 0!==n?n:0,r=function(t){return function(t){return"seekTarget"in t}(t)?t.seekTarget:t.target}(t);Object.values(e.zq).forEach(function(t){return t.onSeek(i,r)}),e.Fq.onSeek(i,r)},this.bq=function(){var t,n=null!==(t=e.Hq)&&void 0!==t?t:0,i=e.context.internalPlayer.getCurrentTime();Object.values(e.zq).forEach(function(t){return t.onSeeked(n,i)}),e.Fq.onSeeked(n,i)},this.pr=function(t,n){var i=e.Bq.findPeriod(t);i&&(e.or(t,n),e.setupControllersForNextPeriod(i),e.qr())},this.sr=function(){Object.keys(e.zq).forEach(function(t){return e.zq[t].dispose()}),e.zq={},e.Aq&&(e.Aq.dispose(),e.Aq=void 0),e.Gq&&e.Gq.reset()},this.zq={},this.Dq=t.eventHandler,this.Bq=t.serviceManager.get(r.ServiceName.ManifestService,t.sourceContext.sourceIdentifier),this.Eq=new h.EnabledSubtitlesTracker,this.Fq=new g.ForcedSubtitleController,this.Dq.on(a.PlayerEvent.Seek,this.aq),this.Dq.on(a.PlayerEvent.TimeShift,this.aq),this.Dq.on(a.PlayerEvent.Seeked,this.bq),this.Dq.on(a.PlayerEvent.TimeShifted,this.bq),this.Dq.on(a.PlayerEvent.SourceUnloaded,this.sr),this.Jq=f.ModuleManager.has(p.ModuleName.SubtitlesCEA608)?f.ModuleManager.get(p.ModuleName.SubtitlesCEA608):void 0,this.Lq()}return t.prototype.Kq=function(t,e){var n=t!==e,i=this.Bq.isHlsManifest()&&!(e||!t);return n||i},t.prototype.Lq=function(){var t=this,e=this.context.serviceManager.get(r.ServiceName.SourceStoreService,this.context.sourceContext.sourceIdentifier);this.Iq=(0,s.subscribe)(e)(f.ModuleManager.get(p.ModuleName.EngineBitmovin).selectors.getPlayingPeriodId,this.pr,function(e,n){return t.Kq(e,n)})},t.prototype.setupControllersForNextPeriod=function(t){var e=this;t.AdaptationSet.forEach(function(t){var n=t._mimeType;(0,M.isSubtitleTrack)(n,e.Bq.isHlsManifest())&&e.Mq(t,n)})},t.prototype.Mq=function(t,e){if((0,M.isFragmentedAdaptationSet)(t))return this.context.store.dispatch((0,u.initializeMetricsForMimeType)(e,this.context.settings)),void this.Nq(t,e);this.Oq(t,e)},t.prototype.Nq=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.Bq.isHlsManifest(),manifestLoader:this.context.serviceManager.get(r.ServiceName.ManifestLoadingService,n),periodId:t._internalId.periodId,sourceStore:i};this.addFragmentSubtitle(o,t)}},t.prototype.Oq=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.Bq.toSubtitleTrack(t,e);n.setAdaptationSetId(t._internalId),i.url=n.getSubtitleUrl().toString(),this.addExternalSubtitle(i,t)}},t.prototype.setTransmuxer=function(t){this.Cq=t},t.prototype.hasSubtitle=function(t){return Boolean(this.zq[t])},t.prototype.enableSubtitle=function(t){var e=this,n=this.zq[t];return n&&!n.isActive()?n.activate().then(function(){n.refresh(),e.Fq.deactivate()}).then(function(){return e.Eq.addSubtitle(n.getSubtitle()),!0}).catch(function(t){return!1}):Promise.resolve(!1)},t.prototype.addExternalSubtitle=function(t,e){if(void 0===e&&(e=null),t.id||(t.id=t.url),this.Pq(t,e))return t;var n=new b.ExternalFileSubtitleHandler(this.context,t,e);return this.Qq(n),t},t.prototype.Pq=function(t,e){var n,i,r=this.zq[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.Fq.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.Qq=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.Fq.addSubtitleHandler(t);else{var i=!1,r=e.id;this.zq[r]&&(i=this.zq[r].isActive(),this.rr(r)),this.Rq(t),i&&t.activate()}},t.prototype.Rq=function(t){var e=t.getSubtitle();this.Sq(e),this.zq[e.id]=t,this.cq(e)},t.prototype.Sq=function(t){var e,n,i=this.context.sourceContext.source.labeling,r=this.Bq.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 null;var n=this.Bq.toSubtitleTrack(e,t.mimeType);n.isFragmented=!0,n.url=null;var i=new m.FragmentedSubtitleHandler(this.context,t,n,this.getTransmuxer);return this.Qq(i),n},t.prototype.setupCea608CaptionExtractor=function(t){var e;if(!this.Jq)return this.Dq.dispatchEvent(a.PlayerEvent.Warning,new v.PlayerModuleMissingWarning(p.ModuleName.SubtitlesCEA608,"The ".concat(p.ModuleName.SubtitlesCEA608," module is required to parse CEA captions."))),null;if(!f.ModuleManager.has(p.ModuleName.ContainerMP4))return this.Dq.dispatchEvent(a.PlayerEvent.Warning,new v.PlayerModuleMissingWarning(p.ModuleName.ContainerMP4,"The ".concat(p.ModuleName.ContainerMP4," module is required to parse CEA captions."))),null;this.Aq&&this.Aq.dispose();var n=f.ModuleManager.get(p.ModuleName.ContainerMP4),i=this.Jq.Cea608Extractor;return this.Aq=new i(t,n,null===(e=this.context.config.tweaks)||void 0===e?void 0:e.parse_cea_708_caption),this.Aq},t.prototype.Tq=function(){this.Aq&&this.Aq.reset()},t.prototype.Vq=function(){var t=f.ModuleManager.get(p.ModuleName.HLS);this.Gq=new t.DiscontinuitySequenceNumberTracker(c.MimeTypeHelper.isVideo),this.Gq.subscribe(this.Uq)},t.prototype.Wq=function(t){this.Gq||this.Vq(),this.Gq.trackSegment(t)},t.prototype.Xq=function(){return this.Bq.getManifest()&&this.Bq.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.Jq)||void 0===r?void 0:r.CEA_EXTRACTOR_SUPPORTED_CODEC_TAGS.includes((0,l.getCodecTag)(e)))?this.Yq(e,t.getTimestampOffset()):(this.Zq(n,e.getPeriodId()),Promise.resolve())},t.prototype.Yq=function(t,e){var n=this;return this.Aq?(this.Xq()&&this.Wq(t),this.Aq.extract(t).then(function(i){!function(t,e){t.forEach(function(t){t.start-=e,t.end-=e})}(i,e),i.length>0&&n.Zq(i,t.getPeriodId())}).catch(function(t){var e;t instanceof v.PlayerModuleMissingWarning&&(null===(e=n.Aq)||void 0===e||e.dispose(),n.Aq=void 0,n.Dq.dispatchEvent(a.PlayerEvent.Warning,t))})):Promise.resolve()},t.prototype.Zq=function(t,e){if(t&&Array.isArray(t)&&0!==t.length)for(var n=this.Bq.getClosedCaptionLabels(e),i=function(t){var i=t.channel;if(!r.zq[i]){var o=n.find(function(t){return t.id===i})||{id:i,kind:"captions",lang:"unknown",label:"Captions (".concat(t.channel,")")};r.Rq(new y.Cea608Handler(r.context,o))}r.zq[i].addCaption(t,e)},r=this,o=0,a=t;o<a.length;o++)i(a[o])},t.prototype.cq=function(t){this.Dq.dispatchEvent(a.PlayerEvent.SubtitleAdded,{subtitle:i({},t)})},t.prototype.disableSubtitle=function(t){var e=this,n=this.zq[t];return n?n.deactivate().then(function(){return e.Eq.removeSubtitle(t),0===e.getActiveSubtitles().length&&e.Fq.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.rr(t),this.Eq.removeSubtitle(t)},t.prototype.getActiveSubtitles=function(){var t=this;return Object.keys(this.zq).filter(function(e){return t.zq[e].isActive()}).map(function(e){return t.zq[e].getSubtitle()})},t.prototype.hasSubtitles=function(){return Object.keys(this.zq).length>0},t.prototype.getAvailableSubtitles=function(t){return Object.values(this.zq).filter(function(e){var n=e.periodId;return!n||t===n}).map(function(t){return t.getSubtitle()})},t.prototype.enableForcedSubtitle=function(t){this.Fq.activate(t).catch(function(){})},t.prototype.dq=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.or=function(t,e){var n=this;Object.keys(this.zq).forEach(function(i){var r=n.zq[i];n.dq(r,t,e)&&n.rr(i)})},t.prototype.qr=function(){var t=this;Object.keys(this.zq).forEach(function(e){var n,i=t.zq[e];if(!i.isActive()&&t.Eq.shouldEnableSubtitle(i.getSubtitle(),t.zq)){var r={subtitle:i.getSubtitle()};null===(n=t.Dq)||void 0===n||n.dispatchEvent(a.PlayerEvent.SubtitleEnable,r),i.activate().then(function(){var e;null===(e=t.Dq)||void 0===e||e.dispatchEvent(a.PlayerEvent.SubtitleEnabled,r)})}})},t.prototype.rr=function(t){if(this.zq[t]){var e=this.zq[t].getSubtitle();this.zq[t].dispose(),delete this.zq[t],this.Dq&&this.Dq.dispatchEvent(a.PlayerEvent.SubtitleRemoved,{subtitle:e})}},t.prototype.clearBuffersUntil=function(t){var e=this;Object.keys(this.zq).forEach(function(n){return e.zq[n].clearBuffersUntil(t)})},t.prototype.dispose=function(){this.sr(),this.Eq=(0,o.dispose)(this.Eq),this.Fq=(0,o.dispose)(this.Fq),this.Gq=(0,o.dispose)(this.Gq),this.Cq=void 0,this.Bq=null,this.Dq.off(a.PlayerEvent.Seek,this.aq),this.Dq.off(a.PlayerEvent.TimeShift,this.aq),this.Dq.off(a.PlayerEvent.Seeked,this.bq),this.Dq.off(a.PlayerEvent.TimeShifted,this.bq),this.Dq.off(a.PlayerEvent.SourceUnloaded,this.sr),this.Iq(),this.zq={},this.Dq=null},t}();e.SubtitleService=T},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)};Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractSubtitleHandler=void 0;var r=n(80813),o=n(3714),a=n(80438),u=n(44468),s=n(88052),l=n(62756),c=function(){function t(t,e,n){void 0===n&&(n=null);var i=this;this.onCueEnter=function(t){i.context.eventHandler.dispatchEvent(o.PlayerEvent.CueEnter,d(t,i.getSubtitle().id))},this.onCueExit=function(t){i.context.eventHandler&&i.context.eventHandler.dispatchEvent(o.PlayerEvent.CueExit,d(t,i.getSubtitle().id))},this.onCueUpdate=function(t){i.context.eventHandler.dispatchEvent(o.PlayerEvent.CueUpdate,d(t,i.getSubtitle().id))},this.context=t,this.Mbb=e,this.Mbb.enabled=this.Mbb.enabled||!1,this.timeline=new a.Timeline(t,{onCueEnter:this.onCueEnter,onCueExit:this.onCueExit,onCueUpdate:this.onCueUpdate}),this.timeline.stopListening(),this.periodId=n,this.Nbb=t.serviceManager.get(r.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(o.PlayerEvent.CueParsed,i(i({subtitleId:n.getSubtitle().id},t),{periodId:e}))})},t.prototype.isActive=function(){return this.Mbb.enabled},t.prototype.activate=function(){return this.Mbb.enabled=!0,this.timeline.startListening(),this.timeline.show(),Promise.resolve()},t.prototype.deactivate=function(){return this.Mbb.enabled=!1,this.timeline.stopListening(),this.timeline.hide(),Promise.resolve()},t.prototype.refresh=function(){this.timeline.show()},t.prototype.getSubtitle=function(){return this.Mbb},t.prototype.clearBuffersUntil=function(t){this.timeline.removeCuesUntil(t)},t.prototype.dispose=function(){this.Nbb=null,this.deactivate(),this.timeline.dispose()},t.prototype.isTsContainer=function(){var t,e=s.ModuleManager.get(l.ModuleName.EngineBitmovin),n=e.selectors,i=e.mseModuleTypes;return(null===(t=n.getContainerFormat(this.Nbb.getState(),u.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 d(t,e){return i({subtitleId:e,start:t.start,end:t.end},t.content)}e.AbstractSubtitleHandler=c},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.HU=function(t){if(o.timeline.removeCues(),null==t?void 0:t.body){o.GU=!0;var e=o.IU(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.FU=e.enforceHTTPSForSecureOrigins(i.url.trim()),o.GU=!1,o.DU=new s.DefaultContentLoader(o.context,{maxRetries:o.context.settings.MAX_RETRIES,retryDelay:o.context.settings.RETRY_DELAY,requestType:l.HttpRequestType.MEDIA_SUBTITLES})):(o.GU=!0,o.EU=Promise.resolve()),o}return i(e,t),e.prototype.activate=function(){var e=this;return t.prototype.activate.call(this).then(function(){return e.EU?e.EU:e.GU?Promise.resolve():(e.EU=e.DU.load(e.FU).then(e.HU).catch(function(t){if(e.EU=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.deactivate(),"loading failed"}),e.EU)})},e.prototype.IU=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.DU=(0,a.dispose)(this.DU)},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),T=n(26438),E=n(74437),U=n(69363),q=function(t){function e(e,n,i,r){var o=t.call(this,e,i,n.periodId)||this;o.sU=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=x(n,e);return void 0!==i?Promise.resolve(i):(0,d.waitForStateChangeThen)(t)(function(t){return x(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.jU(i)}).then(function(){return o.kU(i)}).then(function(){return o.isActive()}).catch(function(){return!1})),n.then(function(e){o.tU(t),e&&o.qU(t)})},o.AU=function(t){var e;if(t&&void 0!==t.time){var n=t.time;o.clearBuffersUntil(n);var i=(null===(e=o.bU)||void 0===e?void 0:e.getTimeForNextSegment(o.UU))||n,r=i-n,a=(0,f.getPlayableBufferLevel)(o.context.internalPlayer);isNaN(i)||r>=a||o.VU.hasNext(i)&&(o.VU.getMPDHandler().resolvePendingSegmentInfoRequests(),o.VU.getNext(i))}},o.CU=function(){o.VU.updateMpd()},o.eventHandler=e.eventHandler,o.ZU=n.sourceStore,o.bU=e.serviceManager.get(a.ServiceName.StreamTimeService),o.aU=e.serviceManager.get(a.ServiceName.ManifestUpdateSchedulingService,e.sourceContext.sourceIdentifier),o.XU=r,o.WU=n.isHls,o.YU=e.bufferSettings;var u=b.ModuleManager.get(m.ModuleName.EngineBitmovin).SegmentController;return o.VU=new u(e,o.sU,n.mimeType,n.codec,n.isHls,n.manifestLoader,n.periodId,n.sourceStore),o.VU.setCurrentLangObj(i),o.UU="".concat(n.mimeType,"/").concat(i.id),o.cU=b.ModuleManager.get(m.ModuleName.HLS,!1),o.eU(),o}return i(e,t),e.prototype.eU=function(){!this.dU&&this.ZU&&(this.dU=(0,d.subscribe)(this.ZU)(function(t){return null==t?void 0:t.manifest},this.CU,function(t,e){return Boolean((null==t?void 0:t.isInitialized)&&!(null==e?void 0:e.isInitialized))}))},e.prototype.fU=function(){this.dU&&(this.dU(),this.dU=void 0)},e.prototype.gU=function(t){return _(t)?(0,M.parsePlainTextSubtitles)(t):function(t){return h.MimeTypeHelper.isApplication(t.getMimeType())&&!P(t)}(t)?(0,S.parseMP4WrappedSubtitles)(t,this.context.logger):t.getMetadata().subtitles},e.prototype.hU=function(t){var e=t.getMetadata();e.subtitles=this.gU(t),t.setMetadata(e)},e.prototype.iU=function(t){var e,n=null!==(e=t.getPlaybackTime())&&void 0!==e?e:t.getSegmentInfo().startTime;t.setPlaybackTime(n)},e.prototype.jU=function(t){var e=this.XU();return this.WU&&e?(void 0!==t&&this.pU()||(t=-1),e.waitForInitializationForDiscontinuity(t)):Promise.resolve()},e.prototype.kU=function(t){if(!this.pU())return Promise.resolve();if(void 0!==this.rU(t))return Promise.resolve();if(!this.cU)return Promise.reject(new Error("HLS Module missing"));var e=this.cU.selectors,n=e.getHlsState,i=e.getPresentationTimeOffset;return(0,d.waitForStateChangeThen)(this.ZU)(function(e){return i(n(e),String(t))},function(t){return void 0!==t}).then()},e.prototype.lU=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.VU.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.mU=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.nU=function(){var t=this.context.sourceContext.sourceIdentifier;return this.context.settings.ENABLE_SEGMENT_INFO_PROVIDER_FROM_STORE?this.lU(t):this.mU(t,this.getSubtitle().id)},e.prototype.oU=function(){var t=this.nU();if(t&&0!==t.length)return t.reduce(function(t,e){var n=C(e)?e.startTime:e._playbackTime,i=C(e)?e.discontinuitySequenceNumber:e._discontinuitySequenceNumber;return(0,y.isNumber)(n)&&(0,y.isNumber)(i)&&void 0===t[i]&&(t[i]=n),t},{})},e.prototype.pU=function(){var t,e=b.ModuleManager.get(m.ModuleName.HLS,!1),n=null===(t=this.ZU)||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.oU();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.qU=function(t){this.uU(t),this.hU(t),this.iU(t),this.wU(t),this.isActive()&&this.timeline.show()},e.prototype.rU=function(t){var e;if(this.cU){var n=this.cU.selectors,i=n.getHlsState,r=n.getPresentationTimeOffset,o=null===(e=this.ZU)||void 0===e?void 0:e.getState(),a=o?i(o):void 0;if(a)return r(a,String(t))}},e.prototype.tU=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.ZU)||void 0===e||e.dispatch(r(this.UU,n,o.Loading))}},e.prototype.uU=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.ZU)||void 0===e||e.dispatch(i(this.UU,o))}},e.prototype.vU=function(t){var e,n,i=-this.VU.getMPDHandler().getTimestampOffset();if(this.WU){var r=t.getSegmentInfo().discontinuitySequenceNumber,o=this.rU(r);void 0!==o&&(i=-o)}return i+(null!==(n=null===(e=this.XU())||void 0===e?void 0:e.getTimestampMappingOffset(t))&&void 0!==n?n:0)},e.prototype.wU=function(t){var n=t.getMetadata().subtitles;if(Array.isArray(n)&&0!==n.length){var i=_(t),r=this.vU(t),o=i||function(t){return"stpp"===p.CodecStringHelper.extractCodec(t.getCodec())}(t)||function(t){return"application/mp4"===t.getMimeType()&&"wvtt"===t.getCodec()&&!P(t)}(t),a=o?this.xU(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.xU=function(t,e){var n=this;return t.flatMap(function(t){return n.yU(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.yU=function(t,e){var n=T.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.zU().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.VU.activateSubtitleSegmentController(t),e.VU.hasNext(t)&&e.VU.getNext(t),e.eventHandler.on(u.PlayerEvent.TimeChanged,e.AU)}})},e.prototype.zU=function(){var t=this.VU.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.ZU.dispatch(r(e)),this.ZU.dispatch(o(e,h.MimeTypeHelper.getMediaType(n))),this.aU.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.AU),this.ZU.dispatch(i(this.UU)),this.ZU.dispatch(r(this.UU));var o=null===(e=this.VU.getCurrentAdaptationSet())||void 0===e?void 0:e._internalId;return o&&this.ZU.dispatch(b.ModuleManager.get(m.ModuleName.EngineBitmovin).actions.removeActiveTrackAction(o)),t.prototype.deactivate.call(this)},e.prototype.getSubtitleType=function(){return U.SubtitleType.FRAGMENTED},e.prototype.clearBuffersUntil=function(e){t.prototype.clearBuffersUntil.call(this,e);var n=b.ModuleManager.get(m.ModuleName.EngineBitmovin).actions.removeLoadedRange;this.ZU.dispatch(n(this.UU,{start:0,end:e,bufferBlockId:-1}))},e.prototype.BU=function(t){var e,n=null===(e=this.ZU)||void 0===e?void 0:e.getState(),i=(0,c.getBufferState)(n),r=i?(0,c.getLoadedRangesForMimeType)(i,this.UU):[];return(0,o.isInTimeRanges)(r,t)},e.prototype.onSeek=function(t,e){this.isActive()&&(this.BU(e)||this.VU.cancelLoading())},e.prototype.onSeeked=function(t,e){if(this.isActive()&&!this.BU(e)){this.timeline.removeCues();var n=b.ModuleManager.get(m.ModuleName.EngineBitmovin).actions.resetLoadedRanges;this.ZU.dispatch(n(this.UU)),this.VU.seekTo(e),this.VU.hasNext(e)&&this.VU.getNext(e)}},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.fU(),this.VU.dispose()},e}(E.AbstractSubtitleHandler);function P(t){return g.TextSegmentAnalyzer.isPlainTextPayload(t.getData())}function _(t){var e=t.getCodec();return("wvtt"===e||"vtt"===e||""===e&&t.getMimeType().includes("vtt"))&&P(t)}function x(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 C(t){return"discontinuitySequenceNumber"in t}e.FragmentedSubtitleHandler=q},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
  })();
@@ -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.281.0
12
+ * Bitmovin Player Version 8.282.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["thumbnail-imp"]=e():(t.bitmovin=t.bitmovin||{},t.bitmovin.player=t.bitmovin.player||{},t.bitmovin.player["thumbnail-imp"]=e())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[336],{70246:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.extendAdaptationSets=function(t,e,n){var l,d=function(t,e,n){var l=t.tags.filter(function(t){return"EXT-X-IMAGE-STREAM-INF"===t.name});return l.length?function(t){var e={};return t.forEach(function(t){var n,i,r=null!==(i=null===(n=t.attributes)||void 0===n?void 0:n["GROUP-ID"])&&void 0!==i?i:"_";e[r]=e[r]||[],e[r].push(t)}),Object.values(e)}(l).map(function(t,l){return n+=1,function(t,e,n,l){var d=l.toString(),s=new(o.ModuleManager.get(a.ModuleName.EngineBitmovin).AdaptationSetId)(i.DEFAULT_PERIOD_ID,d),h=e.filter(u).map(function(t){return function(t,e,n){var i,u=o.ModuleManager.get(a.ModuleName.HLS).PlaylistUtils,l=null!==(i=null==t?void 0:t.attributes)&&void 0!==i?i:{},d=l.RESOLUTION,s=l.BANDWIDTH,h=l.CODECS,c=l.URI,p=l["GROUP-ID"],v=l.NAME,f=l.LANGUAGE,m=d.split("x"),g=m[0],_=m[1],I="".concat(_,"_").concat(s),b=new(o.ModuleManager.get(a.ModuleName.EngineBitmovin).RepresentationId)(n,I),y=c;y&&!r.URLHelper.isUrlAbsolute(y)&&(y=r.URLHelper.concatBaseUrlWithPartial(e,y));var T={BaseURL:[{url:u.getBaseUrl(e,c)}],SegmentList:[{SegmentURL:[],entries:[],totalDuration:0}],Uri:y,_hls:{requestTimestamp:0},_requestTimestamp:0,_id:I,_internalId:b,_groupId:p||"",_mimeType:"image/jpeg",_width:parseInt(g),_height:parseInt(_),_bandwidth:Number(s),_codecs:h,_name:v||"",_lang:f};return v&&(T._label=v),T}(t,n,s)});return{Representation:h,_id:d,_internalId:s,_periodId:i.DEFAULT_PERIOD_ID,_contentType:"image",_mimeType:"image/jpeg",_group:t,_label:d}}(l.toString(),t,e,n)}):[]}(e,n,null!==(l=t.map(function(t){return parseInt(t._id)}).sort().pop())&&void 0!==l?l:-1);return t.concat(d)};var i=n(79721),r=n(58313),o=n(88052),a=n(62756);function u(t){if(!t.attributes)return!1;var e=t.attributes;return["RESOLUTION","BANDWIDTH","CODECS","URI"].every(function(t){return t in e})}},94895:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.parseImpThumbnails=function(t,e){return t.filter(s).flatMap(function(t){return d(t)&&a(t)&&function(t){return t.metadata.some(function(t){return o(t)&&u(t)&&l(t)})}(t)?function(t){var e=function(t){var e,n=function(t){return t.filter(l)}(function(t){var e,n;return null!==(n=null===(e=t.metadata)||void 0===e?void 0:e.filter(o))&&void 0!==n?n:[]}(t)).find(Boolean);return n&&u(n)&&null!==(e=n.attributes)&&void 0!==e?e:{}}(t);if(!function(t){return["LAYOUT","DURATION","RESOLUTION"].every(function(e){return e in t})}(e))return[];var n=function(t){return parseFloat(t)}(e.DURATION),i=r(e.LAYOUT),a=r(e.RESOLUTION);if(!a||!i)return[];for(var d=Math.min(Math.ceil(t.duration/n),i.width*i.height),s=[],h=t.startTime+t.duration,c=a.width,p=a.height,v=0;v<d;v++){var f=v%i.width,m=Math.floor(v/i.width),g=t.startTime+n*v;s.push({start:g,end:Math.min(g+n,h),width:c,height:p,x:f*c,y:m*p,url:t.url,text:t.url})}return s}(t):d(t)&&a(t)&&function(t){return t.metadata.some(function(t){return o(t)&&u(t)&&function(t){return"EXT-X-GAP"===t.name}(t)})}(t)?[]:function(t,e,n){return[{start:t.startTime,end:t.startTime+t.duration,url:t.url,x:0,y:0,width:e,height:n,text:t.url}]}(t,e._width,e._height)})};var i=n(3714);function r(t){var e=t.split("x"),n=e[0],i=e[1],r=parseFloat(n),o=parseFloat(i);if(!isNaN(r)&&!isNaN(o))return{width:r,height:o}}function o(t){return t.type===i.MetadataType.CUSTOM}function a(t){var e,n;return null!==(n=null===(e=t.metadata)||void 0===e?void 0:e.some(o))&&void 0!==n&&n}function u(t){return"name"in t}function l(t){return u(t)&&"EXT-X-TILES"===t.name}function d(t){return"metadata"in t}function s(t){return["duration","startTime"].every(function(e){return e in t})}},40521:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.ImpThumbnailService=void 0;var i=n(3714),r=n(94685),o=n(85434),a=n(80813),u=n(88052),l=n(62756),d=n(94895),s=function(){function t(t){var e=this;this.context=t,this.lz=function(t){if(e.gz){var n=e.mz(t),i=n.width,r=n.height;e.qz({height:r,width:i})}},this.jz=t.sourceContext.sourceIdentifier,this.hz=t.serviceManager.get(a.ServiceName.SourceStoreService,this.jz),this.iz=[],this.context.eventHandler.on(i.PlayerEvent.PlayerResized,this.lz,!0)}return Object.defineProperty(t.prototype,"kz",{get:function(){var t;return null===(t=this.context.serviceManager)||void 0===t?void 0:t.get(a.ServiceName.ManifestService,this.jz)},enumerable:!1,configurable:!0}),t.prototype.mz=function(t){var e=new RegExp(/(^\d+\.?\d*)\w*/),n=e.test(t.height)?e.exec(t.height)[1]:"-1",i=e.test(t.width)?e.exec(t.width)[1]:"-1";return{height:parseFloat(n),width:parseFloat(i)}},t.prototype.nz=function(t){if(this.gz){this.gz.setAdaptationSetId(t[0]._internalId);var e=this.oz();e&&(this.iz=(0,d.parseImpThumbnails)(this.gz.getSegmentListEntries(e._internalId),e))}},t.prototype.oz=function(){var t,e,n,i=this,r=null===(e=null===(t=this.hz)||void 0===t?void 0:t.getState())||void 0===e?void 0:e.activeTracks;if(r){var o=Object.values(r).find(function(t){var e,n,r=t.selectedRepresentationId;return"image/jpeg"===(null===(n=null===(e=i.kz)||void 0===e?void 0:e.getRepresentationById(r))||void 0===n?void 0:n._mimeType)});if(o&&o.selectedRepresentationId){var a=null===(n=this.kz)||void 0===n?void 0:n.getRepresentationById(o.selectedRepresentationId);return a&&c(a)?a:void 0}}},t.prototype.pz=function(){var t,e,n,i;return null!==(i=null===(n=null===(e=null===(t=this.kz)||void 0===t?void 0:t.getAllAdaptationSets().filter(h))||void 0===e?void 0:e.shift())||void 0===n?void 0:n.Representation)&&void 0!==i?i:[]},t.prototype.qz=function(t){var e,n,i,r=function(t,e){if(t.length)return 1===t.length?t[0]:t.reduce(function(t,n){return Math.abs(e.height-t._height)+Math.abs(e.width-t._width)<Math.abs(e.height-n._height)+Math.abs(e.width-n._width)?t:n})}(this.pz(),t),a=this.oz();if(r&&(!a||!r._internalId.equals(a._internalId))){var d=u.ModuleManager.get(l.ModuleName.EngineBitmovin).actions,s=d.setRepresentationIdAction,h=d.setMediaTypeAction,c=r._internalId,p=r._mimeType;null===(e=this.hz)||void 0===e||e.dispatch(s(c)),null===(n=this.hz)||void 0===n||n.dispatch(h(c,o.MimeTypeHelper.getMediaType(p))),null===(i=this.gz)||void 0===i||i.setRepresentationId(r._internalId)}},t.prototype.addThumbnails=function(t){var e,n,i,r;if("string"==typeof t||!t.length||!this.context)return Promise.resolve();if(!this.gz){var o=u.ModuleManager.get(l.ModuleName.EngineBitmovin).SegmentListMPDHandler;this.gz=new o(this.context,this.context.sourceContext)}var a=function(t){if("string"==typeof t||!t.length)return[];for(var e=[],n=0,i=t;n<i.length;n++){var r=i[n];h(r.adaptationSet)&&e.push(r.adaptationSet)}return e}(t);return this.qz({width:null!==(n=null===(e=this.context.parentHtmlElement)||void 0===e?void 0:e.clientWidth)&&void 0!==n?n:-1,height:null!==(r=null===(i=this.context.parentHtmlElement)||void 0===i?void 0:i.clientHeight)&&void 0!==r?r:-1}),this.nz(a),Promise.resolve()},t.prototype.getThumbnail=function(t,e){var n=this.rz(t)||null;return this.qz(e),n},t.prototype.rz=function(t){return this.iz.find(function(e){return e.start<=t&&e.end>=t})},t.prototype.dispose=function(){(0,r.isContextAvailable)(this.context)&&this.context.eventHandler.off(i.PlayerEvent.PlayerResized,this.lz),this.hz=void 0,this.gz=void 0,this.iz=[]},t}();function h(t){return"Representation"in t&&t.Representation.every(c)}function c(t){return["SegmentList","_groupId","_width","_height","_name"].every(function(e){return e in t})}e.ImpThumbnailService=s},75219:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.ImpThumbnailModuleDefinition=void 0;var i=n(62756),r=n(70246),o=n(40521);e.ImpThumbnailModuleDefinition={name:i.ModuleName.Thumbnail,module:function(){return{createThumbnailService:function(t){return new o.ImpThumbnailService(t)},extendAdaptationSets:r.extendAdaptationSets}},dependencies:[i.ModuleName.HLS,i.ModuleName.EngineBitmovin]},e.default=e.ImpThumbnailModuleDefinition}},function(t){return function(){return t(75219)}()}])});
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["thumbnail-imp"]=e():(t.bitmovin=t.bitmovin||{},t.bitmovin.player=t.bitmovin.player||{},t.bitmovin.player["thumbnail-imp"]=e())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[336],{70246:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.extendAdaptationSets=function(t,e,n){var l,d=function(t,e,n){var l=t.tags.filter(function(t){return"EXT-X-IMAGE-STREAM-INF"===t.name});return l.length?function(t){var e={};return t.forEach(function(t){var n,i,r=null!==(i=null===(n=t.attributes)||void 0===n?void 0:n["GROUP-ID"])&&void 0!==i?i:"_";e[r]=e[r]||[],e[r].push(t)}),Object.values(e)}(l).map(function(t,l){return n+=1,function(t,e,n,l){var d=l.toString(),s=new(o.ModuleManager.get(a.ModuleName.EngineBitmovin).AdaptationSetId)(i.DEFAULT_PERIOD_ID,d),h=e.filter(u).map(function(t){return function(t,e,n){var i,u=o.ModuleManager.get(a.ModuleName.HLS).PlaylistUtils,l=null!==(i=null==t?void 0:t.attributes)&&void 0!==i?i:{},d=l.RESOLUTION,s=l.BANDWIDTH,h=l.CODECS,c=l.URI,f=l["GROUP-ID"],p=l.NAME,v=l.LANGUAGE,m=d.split("x"),g=m[0],_=m[1],I="".concat(_,"_").concat(s),b=new(o.ModuleManager.get(a.ModuleName.EngineBitmovin).RepresentationId)(n,I),y=c;y&&!r.URLHelper.isUrlAbsolute(y)&&(y=r.URLHelper.concatBaseUrlWithPartial(e,y));var T={BaseURL:[{url:u.getBaseUrl(e,c)}],SegmentList:[{SegmentURL:[],entries:[],totalDuration:0}],Uri:y,_hls:{requestTimestamp:0},_requestTimestamp:0,_id:I,_internalId:b,_groupId:f||"",_mimeType:"image/jpeg",_width:parseInt(g),_height:parseInt(_),_bandwidth:Number(s),_codecs:h,_name:p||"",_lang:v};return p&&(T._label=p),T}(t,n,s)});return{Representation:h,_id:d,_internalId:s,_periodId:i.DEFAULT_PERIOD_ID,_contentType:"image",_mimeType:"image/jpeg",_group:t,_label:d}}(l.toString(),t,e,n)}):[]}(e,n,null!==(l=t.map(function(t){return parseInt(t._id)}).sort().pop())&&void 0!==l?l:-1);return t.concat(d)};var i=n(79721),r=n(58313),o=n(88052),a=n(62756);function u(t){if(!t.attributes)return!1;var e=t.attributes;return["RESOLUTION","BANDWIDTH","CODECS","URI"].every(function(t){return t in e})}},94895:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.parseImpThumbnails=function(t,e){return t.filter(s).flatMap(function(t){return d(t)&&a(t)&&function(t){return t.metadata.some(function(t){return o(t)&&u(t)&&l(t)})}(t)?function(t){var e=function(t){var e,n=function(t){return t.filter(l)}(function(t){var e,n;return null!==(n=null===(e=t.metadata)||void 0===e?void 0:e.filter(o))&&void 0!==n?n:[]}(t)).find(Boolean);return n&&u(n)&&null!==(e=n.attributes)&&void 0!==e?e:{}}(t);if(!function(t){return["LAYOUT","DURATION","RESOLUTION"].every(function(e){return e in t})}(e))return[];var n=function(t){return parseFloat(t)}(e.DURATION),i=r(e.LAYOUT),a=r(e.RESOLUTION);if(!a||!i)return[];for(var d=Math.min(Math.ceil(t.duration/n),i.width*i.height),s=[],h=t.startTime+t.duration,c=a.width,f=a.height,p=0;p<d;p++){var v=p%i.width,m=Math.floor(p/i.width),g=t.startTime+n*p;s.push({start:g,end:Math.min(g+n,h),width:c,height:f,x:v*c,y:m*f,url:t.url,text:t.url})}return s}(t):d(t)&&a(t)&&function(t){return t.metadata.some(function(t){return o(t)&&u(t)&&function(t){return"EXT-X-GAP"===t.name}(t)})}(t)?[]:function(t,e,n){return[{start:t.startTime,end:t.startTime+t.duration,url:t.url,x:0,y:0,width:e,height:n,text:t.url}]}(t,e._width,e._height)})};var i=n(3714);function r(t){var e=t.split("x"),n=e[0],i=e[1],r=parseFloat(n),o=parseFloat(i);if(!isNaN(r)&&!isNaN(o))return{width:r,height:o}}function o(t){return t.type===i.MetadataType.CUSTOM}function a(t){var e,n;return null!==(n=null===(e=t.metadata)||void 0===e?void 0:e.some(o))&&void 0!==n&&n}function u(t){return"name"in t}function l(t){return u(t)&&"EXT-X-TILES"===t.name}function d(t){return"metadata"in t}function s(t){return["duration","startTime"].every(function(e){return e in t})}},40521:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.ImpThumbnailService=void 0;var i=n(3714),r=n(94685),o=n(85434),a=n(80813),u=n(88052),l=n(62756),d=n(94895),s=function(){function t(t){var e=this;this.context=t,this.jz=function(t){if(e.ez){var n=e.kz(t),i=n.width,r=n.height;e.oz({height:r,width:i})}},this.hz=t.sourceContext.sourceIdentifier,this.fz=t.serviceManager.get(a.ServiceName.SourceStoreService,this.hz),this.gz=[],this.context.eventHandler.on(i.PlayerEvent.PlayerResized,this.jz,!0)}return Object.defineProperty(t.prototype,"iz",{get:function(){var t;return null===(t=this.context.serviceManager)||void 0===t?void 0:t.get(a.ServiceName.ManifestService,this.hz)},enumerable:!1,configurable:!0}),t.prototype.kz=function(t){var e=new RegExp(/(^\d+\.?\d*)\w*/),n=e.test(t.height)?e.exec(t.height)[1]:"-1",i=e.test(t.width)?e.exec(t.width)[1]:"-1";return{height:parseFloat(n),width:parseFloat(i)}},t.prototype.lz=function(t){if(this.ez){this.ez.setAdaptationSetId(t[0]._internalId);var e=this.mz();e&&(this.gz=(0,d.parseImpThumbnails)(this.ez.getSegmentListEntries(e._internalId),e))}},t.prototype.mz=function(){var t,e,n,i=this,r=null===(e=null===(t=this.fz)||void 0===t?void 0:t.getState())||void 0===e?void 0:e.activeTracks;if(r){var o=Object.values(r).find(function(t){var e,n,r=t.selectedRepresentationId;return"image/jpeg"===(null===(n=null===(e=i.iz)||void 0===e?void 0:e.getRepresentationById(r))||void 0===n?void 0:n._mimeType)});if(o&&o.selectedRepresentationId){var a=null===(n=this.iz)||void 0===n?void 0:n.getRepresentationById(o.selectedRepresentationId);return a&&c(a)?a:void 0}}},t.prototype.nz=function(){var t,e,n,i;return null!==(i=null===(n=null===(e=null===(t=this.iz)||void 0===t?void 0:t.getAllAdaptationSets().filter(h))||void 0===e?void 0:e.shift())||void 0===n?void 0:n.Representation)&&void 0!==i?i:[]},t.prototype.oz=function(t){var e,n,i,r=function(t,e){if(t.length)return 1===t.length?t[0]:t.reduce(function(t,n){return Math.abs(e.height-t._height)+Math.abs(e.width-t._width)<Math.abs(e.height-n._height)+Math.abs(e.width-n._width)?t:n})}(this.nz(),t),a=this.mz();if(r&&(!a||!r._internalId.equals(a._internalId))){var d=u.ModuleManager.get(l.ModuleName.EngineBitmovin).actions,s=d.setRepresentationIdAction,h=d.setMediaTypeAction,c=r._internalId,f=r._mimeType;null===(e=this.fz)||void 0===e||e.dispatch(s(c)),null===(n=this.fz)||void 0===n||n.dispatch(h(c,o.MimeTypeHelper.getMediaType(f))),null===(i=this.ez)||void 0===i||i.setRepresentationId(r._internalId)}},t.prototype.addThumbnails=function(t){var e,n,i,r;if("string"==typeof t||!t.length||!this.context)return Promise.resolve();if(!this.ez){var o=u.ModuleManager.get(l.ModuleName.EngineBitmovin).SegmentListMPDHandler;this.ez=new o(this.context,this.context.sourceContext)}var a=function(t){if("string"==typeof t||!t.length)return[];for(var e=[],n=0,i=t;n<i.length;n++){var r=i[n];h(r.adaptationSet)&&e.push(r.adaptationSet)}return e}(t);return this.oz({width:null!==(n=null===(e=this.context.parentHtmlElement)||void 0===e?void 0:e.clientWidth)&&void 0!==n?n:-1,height:null!==(r=null===(i=this.context.parentHtmlElement)||void 0===i?void 0:i.clientHeight)&&void 0!==r?r:-1}),this.lz(a),Promise.resolve()},t.prototype.getThumbnail=function(t,e){var n=this.pz(t)||null;return this.oz(e),n},t.prototype.pz=function(t){return this.gz.find(function(e){return e.start<=t&&e.end>=t})},t.prototype.dispose=function(){(0,r.isContextAvailable)(this.context)&&this.context.eventHandler.off(i.PlayerEvent.PlayerResized,this.jz),this.fz=void 0,this.ez=void 0,this.gz=[]},t}();function h(t){return"Representation"in t&&t.Representation.every(c)}function c(t){return["SegmentList","_groupId","_width","_height","_name"].every(function(e){return e in t})}e.ImpThumbnailService=s},75219:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.ImpThumbnailModuleDefinition=void 0;var i=n(62756),r=n(70246),o=n(40521);e.ImpThumbnailModuleDefinition={name:i.ModuleName.Thumbnail,module:function(){return{createThumbnailService:function(t){return new o.ImpThumbnailService(t)},extendAdaptationSets:r.extendAdaptationSets}},dependencies:[i.ModuleName.HLS,i.ModuleName.EngineBitmovin]},e.default=e.ImpThumbnailModuleDefinition}},function(t){return function(){return t(75219)}()}])});
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.281.0
12
+ * Bitmovin Player Version 8.282.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["thumbnail-imp"]=e():(t.bitmovin=t.bitmovin||{},t.bitmovin.player=t.bitmovin.player||{},t.bitmovin.player["thumbnail-imp"]=e())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[336],{70246:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.extendAdaptationSets=function(t,e,n){var l,d=function(t,e,n){var l=t.tags.filter(function(t){return"EXT-X-IMAGE-STREAM-INF"===t.name});return l.length?function(t){var e={};return t.forEach(function(t){var n,i,r=null!==(i=null===(n=t.attributes)||void 0===n?void 0:n["GROUP-ID"])&&void 0!==i?i:"_";e[r]=e[r]||[],e[r].push(t)}),Object.values(e)}(l).map(function(t,l){return n+=1,function(t,e,n,l){var d=l.toString(),s=new(o.ModuleManager.get(a.ModuleName.EngineBitmovin).AdaptationSetId)(i.DEFAULT_PERIOD_ID,d),h=e.filter(u).map(function(t){return function(t,e,n){var i,u=o.ModuleManager.get(a.ModuleName.HLS).PlaylistUtils,l=null!==(i=null==t?void 0:t.attributes)&&void 0!==i?i:{},d=l.RESOLUTION,s=l.BANDWIDTH,h=l.CODECS,c=l.URI,v=l["GROUP-ID"],f=l.NAME,p=l.LANGUAGE,m=d.split("x"),y=m[0],g=m[1],_="".concat(g,"_").concat(s),b=new(o.ModuleManager.get(a.ModuleName.EngineBitmovin).RepresentationId)(n,_),I=c;I&&!r.URLHelper.isUrlAbsolute(I)&&(I=r.URLHelper.concatBaseUrlWithPartial(e,I));var T={BaseURL:[{url:u.getBaseUrl(e,c)}],SegmentList:[{SegmentURL:[],entries:[],totalDuration:0}],Uri:I,_hls:{requestTimestamp:0},_requestTimestamp:0,_id:_,_internalId:b,_groupId:v||"",_mimeType:"image/jpeg",_width:parseInt(y),_height:parseInt(g),_bandwidth:Number(s),_codecs:h,_name:f||"",_lang:p};return f&&(T._label=f),T}(t,n,s)});return{Representation:h,_id:d,_internalId:s,_periodId:i.DEFAULT_PERIOD_ID,_contentType:"image",_mimeType:"image/jpeg",_group:t,_label:d}}(l.toString(),t,e,n)}):[]}(e,n,null!==(l=t.map(function(t){return parseInt(t._id)}).sort().pop())&&void 0!==l?l:-1);return t.concat(d)};var i=n(79721),r=n(58313),o=n(88052),a=n(62756);function u(t){if(!t.attributes)return!1;var e=t.attributes;return["RESOLUTION","BANDWIDTH","CODECS","URI"].every(function(t){return t in e})}},94895:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.parseImpThumbnails=function(t,e){return t.filter(s).flatMap(function(t){return d(t)&&a(t)&&function(t){return t.metadata.some(function(t){return o(t)&&u(t)&&l(t)})}(t)?function(t){var e=function(t){var e,n=function(t){return t.filter(l)}(function(t){var e,n;return null!==(n=null===(e=t.metadata)||void 0===e?void 0:e.filter(o))&&void 0!==n?n:[]}(t)).find(Boolean);return n&&u(n)&&null!==(e=n.attributes)&&void 0!==e?e:{}}(t);if(!function(t){return["LAYOUT","DURATION","RESOLUTION"].every(function(e){return e in t})}(e))return[];var n=function(t){return parseFloat(t)}(e.DURATION),i=r(e.LAYOUT),a=r(e.RESOLUTION);if(!a||!i)return[];for(var d=Math.min(Math.ceil(t.duration/n),i.width*i.height),s=[],h=t.startTime+t.duration,c=a.width,v=a.height,f=0;f<d;f++){var p=f%i.width,m=Math.floor(f/i.width),y=t.startTime+n*f;s.push({start:y,end:Math.min(y+n,h),width:c,height:v,x:p*c,y:m*v,url:t.url,text:t.url})}return s}(t):d(t)&&a(t)&&function(t){return t.metadata.some(function(t){return o(t)&&u(t)&&function(t){return"EXT-X-GAP"===t.name}(t)})}(t)?[]:function(t,e,n){return[{start:t.startTime,end:t.startTime+t.duration,url:t.url,x:0,y:0,width:e,height:n,text:t.url}]}(t,e._width,e._height)})};var i=n(3714);function r(t){var e=t.split("x"),n=e[0],i=e[1],r=parseFloat(n),o=parseFloat(i);if(!isNaN(r)&&!isNaN(o))return{width:r,height:o}}function o(t){return t.type===i.MetadataType.CUSTOM}function a(t){var e,n;return null!==(n=null===(e=t.metadata)||void 0===e?void 0:e.some(o))&&void 0!==n&&n}function u(t){return"name"in t}function l(t){return u(t)&&"EXT-X-TILES"===t.name}function d(t){return"metadata"in t}function s(t){return["duration","startTime"].every(function(e){return e in t})}},40521:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.ImpThumbnailService=void 0;var i=n(3714),r=n(94685),o=n(85434),a=n(80813),u=n(88052),l=n(62756),d=n(94895),s=function(){function t(t){var e=this;this.context=t,this.dy=function(t){if(e.Yy){var n=e.ey(t),i=n.width,r=n.height;e.iy({height:r,width:i})}},this.by=t.sourceContext.sourceIdentifier,this.Zy=t.serviceManager.get(a.ServiceName.SourceStoreService,this.by),this.ay=[],this.context.eventHandler.on(i.PlayerEvent.PlayerResized,this.dy,!0)}return Object.defineProperty(t.prototype,"cy",{get:function(){var t;return null===(t=this.context.serviceManager)||void 0===t?void 0:t.get(a.ServiceName.ManifestService,this.by)},enumerable:!1,configurable:!0}),t.prototype.ey=function(t){var e=new RegExp(/(^\d+\.?\d*)\w*/),n=e.test(t.height)?e.exec(t.height)[1]:"-1",i=e.test(t.width)?e.exec(t.width)[1]:"-1";return{height:parseFloat(n),width:parseFloat(i)}},t.prototype.fy=function(t){if(this.Yy){this.Yy.setAdaptationSetId(t[0]._internalId);var e=this.gy();e&&(this.ay=(0,d.parseImpThumbnails)(this.Yy.getSegmentListEntries(e._internalId),e))}},t.prototype.gy=function(){var t,e,n,i=this,r=null===(e=null===(t=this.Zy)||void 0===t?void 0:t.getState())||void 0===e?void 0:e.activeTracks;if(r){var o=Object.values(r).find(function(t){var e,n,r=t.selectedRepresentationId;return"image/jpeg"===(null===(n=null===(e=i.cy)||void 0===e?void 0:e.getRepresentationById(r))||void 0===n?void 0:n._mimeType)});if(o&&o.selectedRepresentationId){var a=null===(n=this.cy)||void 0===n?void 0:n.getRepresentationById(o.selectedRepresentationId);return a&&c(a)?a:void 0}}},t.prototype.hy=function(){var t,e,n,i;return null!==(i=null===(n=null===(e=null===(t=this.cy)||void 0===t?void 0:t.getAllAdaptationSets().filter(h))||void 0===e?void 0:e.shift())||void 0===n?void 0:n.Representation)&&void 0!==i?i:[]},t.prototype.iy=function(t){var e,n,i,r=function(t,e){if(t.length)return 1===t.length?t[0]:t.reduce(function(t,n){return Math.abs(e.height-t._height)+Math.abs(e.width-t._width)<Math.abs(e.height-n._height)+Math.abs(e.width-n._width)?t:n})}(this.hy(),t),a=this.gy();if(r&&(!a||!r._internalId.equals(a._internalId))){var d=u.ModuleManager.get(l.ModuleName.EngineBitmovin).actions,s=d.setRepresentationIdAction,h=d.setMediaTypeAction,c=r._internalId,v=r._mimeType;null===(e=this.Zy)||void 0===e||e.dispatch(s(c)),null===(n=this.Zy)||void 0===n||n.dispatch(h(c,o.MimeTypeHelper.getMediaType(v))),null===(i=this.Yy)||void 0===i||i.setRepresentationId(r._internalId)}},t.prototype.addThumbnails=function(t){var e,n,i,r;if("string"==typeof t||!t.length||!this.context)return Promise.resolve();if(!this.Yy){var o=u.ModuleManager.get(l.ModuleName.EngineBitmovin).SegmentListMPDHandler;this.Yy=new o(this.context,this.context.sourceContext)}var a=function(t){if("string"==typeof t||!t.length)return[];for(var e=[],n=0,i=t;n<i.length;n++){var r=i[n];h(r.adaptationSet)&&e.push(r.adaptationSet)}return e}(t);return this.iy({width:null!==(n=null===(e=this.context.parentHtmlElement)||void 0===e?void 0:e.clientWidth)&&void 0!==n?n:-1,height:null!==(r=null===(i=this.context.parentHtmlElement)||void 0===i?void 0:i.clientHeight)&&void 0!==r?r:-1}),this.fy(a),Promise.resolve()},t.prototype.getThumbnail=function(t,e){var n=this.jy(t)||null;return this.iy(e),n},t.prototype.jy=function(t){return this.ay.find(function(e){return e.start<=t&&e.end>=t})},t.prototype.dispose=function(){(0,r.isContextAvailable)(this.context)&&this.context.eventHandler.off(i.PlayerEvent.PlayerResized,this.dy),this.Zy=void 0,this.Yy=void 0,this.ay=[]},t}();function h(t){return"Representation"in t&&t.Representation.every(c)}function c(t){return["SegmentList","_groupId","_width","_height","_name"].every(function(e){return e in t})}e.ImpThumbnailService=s},75219:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.ImpThumbnailModuleDefinition=void 0;var i=n(62756),r=n(70246),o=n(40521);e.ImpThumbnailModuleDefinition={name:i.ModuleName.Thumbnail,module:function(){return{createThumbnailService:function(t){return new o.ImpThumbnailService(t)},extendAdaptationSets:r.extendAdaptationSets}},dependencies:[i.ModuleName.HLS,i.ModuleName.EngineBitmovin]},e.default=e.ImpThumbnailModuleDefinition}},function(t){return function(){return t(75219)}()}])});
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["thumbnail-imp"]=e():(t.bitmovin=t.bitmovin||{},t.bitmovin.player=t.bitmovin.player||{},t.bitmovin.player["thumbnail-imp"]=e())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[336],{70246:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.extendAdaptationSets=function(t,e,n){var l,d=function(t,e,n){var l=t.tags.filter(function(t){return"EXT-X-IMAGE-STREAM-INF"===t.name});return l.length?function(t){var e={};return t.forEach(function(t){var n,i,r=null!==(i=null===(n=t.attributes)||void 0===n?void 0:n["GROUP-ID"])&&void 0!==i?i:"_";e[r]=e[r]||[],e[r].push(t)}),Object.values(e)}(l).map(function(t,l){return n+=1,function(t,e,n,l){var d=l.toString(),s=new(o.ModuleManager.get(a.ModuleName.EngineBitmovin).AdaptationSetId)(i.DEFAULT_PERIOD_ID,d),h=e.filter(u).map(function(t){return function(t,e,n){var i,u=o.ModuleManager.get(a.ModuleName.HLS).PlaylistUtils,l=null!==(i=null==t?void 0:t.attributes)&&void 0!==i?i:{},d=l.RESOLUTION,s=l.BANDWIDTH,h=l.CODECS,c=l.URI,v=l["GROUP-ID"],p=l.NAME,f=l.LANGUAGE,m=d.split("x"),x=m[0],g=m[1],y="".concat(g,"_").concat(s),_=new(o.ModuleManager.get(a.ModuleName.EngineBitmovin).RepresentationId)(n,y),I=c;I&&!r.URLHelper.isUrlAbsolute(I)&&(I=r.URLHelper.concatBaseUrlWithPartial(e,I));var b={BaseURL:[{url:u.getBaseUrl(e,c)}],SegmentList:[{SegmentURL:[],entries:[],totalDuration:0}],Uri:I,_hls:{requestTimestamp:0},_requestTimestamp:0,_id:y,_internalId:_,_groupId:v||"",_mimeType:"image/jpeg",_width:parseInt(x),_height:parseInt(g),_bandwidth:Number(s),_codecs:h,_name:p||"",_lang:f};return p&&(b._label=p),b}(t,n,s)});return{Representation:h,_id:d,_internalId:s,_periodId:i.DEFAULT_PERIOD_ID,_contentType:"image",_mimeType:"image/jpeg",_group:t,_label:d}}(l.toString(),t,e,n)}):[]}(e,n,null!==(l=t.map(function(t){return parseInt(t._id)}).sort().pop())&&void 0!==l?l:-1);return t.concat(d)};var i=n(79721),r=n(58313),o=n(88052),a=n(62756);function u(t){if(!t.attributes)return!1;var e=t.attributes;return["RESOLUTION","BANDWIDTH","CODECS","URI"].every(function(t){return t in e})}},94895:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.parseImpThumbnails=function(t,e){return t.filter(s).flatMap(function(t){return d(t)&&a(t)&&function(t){return t.metadata.some(function(t){return o(t)&&u(t)&&l(t)})}(t)?function(t){var e=function(t){var e,n=function(t){return t.filter(l)}(function(t){var e,n;return null!==(n=null===(e=t.metadata)||void 0===e?void 0:e.filter(o))&&void 0!==n?n:[]}(t)).find(Boolean);return n&&u(n)&&null!==(e=n.attributes)&&void 0!==e?e:{}}(t);if(!function(t){return["LAYOUT","DURATION","RESOLUTION"].every(function(e){return e in t})}(e))return[];var n=function(t){return parseFloat(t)}(e.DURATION),i=r(e.LAYOUT),a=r(e.RESOLUTION);if(!a||!i)return[];for(var d=Math.min(Math.ceil(t.duration/n),i.width*i.height),s=[],h=t.startTime+t.duration,c=a.width,v=a.height,p=0;p<d;p++){var f=p%i.width,m=Math.floor(p/i.width),x=t.startTime+n*p;s.push({start:x,end:Math.min(x+n,h),width:c,height:v,x:f*c,y:m*v,url:t.url,text:t.url})}return s}(t):d(t)&&a(t)&&function(t){return t.metadata.some(function(t){return o(t)&&u(t)&&function(t){return"EXT-X-GAP"===t.name}(t)})}(t)?[]:function(t,e,n){return[{start:t.startTime,end:t.startTime+t.duration,url:t.url,x:0,y:0,width:e,height:n,text:t.url}]}(t,e._width,e._height)})};var i=n(3714);function r(t){var e=t.split("x"),n=e[0],i=e[1],r=parseFloat(n),o=parseFloat(i);if(!isNaN(r)&&!isNaN(o))return{width:r,height:o}}function o(t){return t.type===i.MetadataType.CUSTOM}function a(t){var e,n;return null!==(n=null===(e=t.metadata)||void 0===e?void 0:e.some(o))&&void 0!==n&&n}function u(t){return"name"in t}function l(t){return u(t)&&"EXT-X-TILES"===t.name}function d(t){return"metadata"in t}function s(t){return["duration","startTime"].every(function(e){return e in t})}},40521:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.ImpThumbnailService=void 0;var i=n(3714),r=n(94685),o=n(85434),a=n(80813),u=n(88052),l=n(62756),d=n(94895),s=function(){function t(t){var e=this;this.context=t,this.Cx=function(t){if(e.xx){var n=e.Dx(t),i=n.width,r=n.height;e.Hx({height:r,width:i})}},this.Ax=t.sourceContext.sourceIdentifier,this.yx=t.serviceManager.get(a.ServiceName.SourceStoreService,this.Ax),this.zx=[],this.context.eventHandler.on(i.PlayerEvent.PlayerResized,this.Cx,!0)}return Object.defineProperty(t.prototype,"Bx",{get:function(){var t;return null===(t=this.context.serviceManager)||void 0===t?void 0:t.get(a.ServiceName.ManifestService,this.Ax)},enumerable:!1,configurable:!0}),t.prototype.Dx=function(t){var e=new RegExp(/(^\d+\.?\d*)\w*/),n=e.test(t.height)?e.exec(t.height)[1]:"-1",i=e.test(t.width)?e.exec(t.width)[1]:"-1";return{height:parseFloat(n),width:parseFloat(i)}},t.prototype.Ex=function(t){if(this.xx){this.xx.setAdaptationSetId(t[0]._internalId);var e=this.Fx();e&&(this.zx=(0,d.parseImpThumbnails)(this.xx.getSegmentListEntries(e._internalId),e))}},t.prototype.Fx=function(){var t,e,n,i=this,r=null===(e=null===(t=this.yx)||void 0===t?void 0:t.getState())||void 0===e?void 0:e.activeTracks;if(r){var o=Object.values(r).find(function(t){var e,n,r=t.selectedRepresentationId;return"image/jpeg"===(null===(n=null===(e=i.Bx)||void 0===e?void 0:e.getRepresentationById(r))||void 0===n?void 0:n._mimeType)});if(o&&o.selectedRepresentationId){var a=null===(n=this.Bx)||void 0===n?void 0:n.getRepresentationById(o.selectedRepresentationId);return a&&c(a)?a:void 0}}},t.prototype.Gx=function(){var t,e,n,i;return null!==(i=null===(n=null===(e=null===(t=this.Bx)||void 0===t?void 0:t.getAllAdaptationSets().filter(h))||void 0===e?void 0:e.shift())||void 0===n?void 0:n.Representation)&&void 0!==i?i:[]},t.prototype.Hx=function(t){var e,n,i,r=function(t,e){if(t.length)return 1===t.length?t[0]:t.reduce(function(t,n){return Math.abs(e.height-t._height)+Math.abs(e.width-t._width)<Math.abs(e.height-n._height)+Math.abs(e.width-n._width)?t:n})}(this.Gx(),t),a=this.Fx();if(r&&(!a||!r._internalId.equals(a._internalId))){var d=u.ModuleManager.get(l.ModuleName.EngineBitmovin).actions,s=d.setRepresentationIdAction,h=d.setMediaTypeAction,c=r._internalId,v=r._mimeType;null===(e=this.yx)||void 0===e||e.dispatch(s(c)),null===(n=this.yx)||void 0===n||n.dispatch(h(c,o.MimeTypeHelper.getMediaType(v))),null===(i=this.xx)||void 0===i||i.setRepresentationId(r._internalId)}},t.prototype.addThumbnails=function(t){var e,n,i,r;if("string"==typeof t||!t.length||!this.context)return Promise.resolve();if(!this.xx){var o=u.ModuleManager.get(l.ModuleName.EngineBitmovin).SegmentListMPDHandler;this.xx=new o(this.context,this.context.sourceContext)}var a=function(t){if("string"==typeof t||!t.length)return[];for(var e=[],n=0,i=t;n<i.length;n++){var r=i[n];h(r.adaptationSet)&&e.push(r.adaptationSet)}return e}(t);return this.Hx({width:null!==(n=null===(e=this.context.parentHtmlElement)||void 0===e?void 0:e.clientWidth)&&void 0!==n?n:-1,height:null!==(r=null===(i=this.context.parentHtmlElement)||void 0===i?void 0:i.clientHeight)&&void 0!==r?r:-1}),this.Ex(a),Promise.resolve()},t.prototype.getThumbnail=function(t,e){var n=this.Ix(t)||null;return this.Hx(e),n},t.prototype.Ix=function(t){return this.zx.find(function(e){return e.start<=t&&e.end>=t})},t.prototype.dispose=function(){(0,r.isContextAvailable)(this.context)&&this.context.eventHandler.off(i.PlayerEvent.PlayerResized,this.Cx),this.yx=void 0,this.xx=void 0,this.zx=[]},t}();function h(t){return"Representation"in t&&t.Representation.every(c)}function c(t){return["SegmentList","_groupId","_width","_height","_name"].every(function(e){return e in t})}e.ImpThumbnailService=s},75219:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.ImpThumbnailModuleDefinition=void 0;var i=n(62756),r=n(70246),o=n(40521);e.ImpThumbnailModuleDefinition={name:i.ModuleName.Thumbnail,module:function(){return{createThumbnailService:function(t){return new o.ImpThumbnailService(t)},extendAdaptationSets:r.extendAdaptationSets}},dependencies:[i.ModuleName.HLS,i.ModuleName.EngineBitmovin]},e.default=e.ImpThumbnailModuleDefinition}},function(t){return function(){return t(75219)}()}])});
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.281.0
12
+ * Bitmovin Player Version 8.282.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.thumbnail=e():(t.bitmovin=t.bitmovin||{},t.bitmovin.player=t.bitmovin.player||{},t.bitmovin.player.thumbnail=e())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[898],{5214:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.BitmovinThumbnailService=void 0;var n=i(56481),r=i(94685),o=i(2758),a=i(93617),s=function(){function t(t){this.context=t,this.fz=new a.ThumbnailTimelineStore(t)}return t.prototype.addThumbnails=function(t){var e=this;if(!this.fz||!(0,r.isContextAvailable)(this.context))return Promise.resolve();this.fz.clear();var i=(0,o.createThumbnailParser)(this.context,t);return i.parse(t).then(function(t){var i;return null===(i=e.fz)||void 0===i?void 0:i.addTracks(t)}).finally(function(){return i.dispose()})},t.prototype.getThumbnail=function(t,e){var i,n;return null!==(n=null===(i=this.fz)||void 0===i?void 0:i.getThumbnail(t,e))&&void 0!==n?n:null},t.prototype.dispose=function(){this.fz=(0,n.dispose)(this.fz)},t}();e.BitmovinThumbnailService=s},78270:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.DashThumbnailParser=void 0,e.isDashThumbnailSet=h,e.getSegmentTemplate=l;var n=i(94685),r=i(85434),o=i(23068),a=i(15827),s=i(59462),u=function(){function t(t){this.context=t}return t.prototype.parse=function(t){var e=this,i=t.filter(function(t){return h(t.adaptationSet)&&(0,o.isNumber)(t.timing.startTime)});if(0===i.length)return Promise.resolve([]);var r=i.flatMap(function(t){try{return e.Rdb(t)}catch(t){return(0,n.isContextAvailable)(e.context)&&e.context.logger.warn("Error parsing DASH thumbnails: ".concat(t)),[]}});return Promise.resolve(r)},t.prototype.Rdb=function(t){var e=this;return t.adaptationSet.Representation.reduce(function(i,n){var r=(0,a.parseThumbnailRepresentation)(n,t,e.context),o=(0,s.mapToThumbnailTrack)(r);return null!=o&&i.push(o),i},[])},t.prototype.dispose=function(){},t}();function h(t){if(!t)return!1;var e=r.MimeTypeHelper.isImage(t._mimeType)&&"image"===t._contentType,i=Array.isArray(t.Representation)&&null!=l(t);return Boolean(e&&i)}function l(t){return c(null==t?void 0:t.Representation[0])||c(t)}function c(t){var e,i;return null!==(i=null===(e=null==t?void 0:t.SegmentTemplate)||void 0===e?void 0:e[0])&&void 0!==i?i:null}e.DashThumbnailParser=u},15827:function(t,e,i){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.parseThumbnailRepresentation=function(t,e,i){return new h(t,e,i).parseRepresentation()};var r=i(80813),o=i(89927),a=i(88052),s=i(62756),u=i(78270),h=function(){function t(t,e,i){this.representation=t,this.source=e,this.context=i,this.hasValidData=!!(t&&e&&i)&&this.validate()}return t.prototype.validate=function(){this.ghb=this.source.timing;var t=(0,u.getSegmentTemplate)(this.source.adaptationSet);return!(!t||!this.representation||(this.hhb=t,!(this.hhb._media&&this.representation.BaseURL&&this.representation.BaseURL[0].url)||(this.khb=this.hhb._media,this.ihb=this.representation.BaseURL[0].url,!this.representation.EssentialProperty||!this.representation.EssentialProperty[0]||(this.lhb=this.representation.EssentialProperty[0],this.hhb.SegmentTimeline&&this.hhb.SegmentTimeline[0]&&(this.jhb=this.hhb.SegmentTimeline[0]),0))))},t.prototype.parseRepresentation=function(){return this.hasValidData?this.jhb?this.nhb():this.mhb():[]},t.prototype.mhb=function(){var t,e=this.Aib(),i=Number(this.hhb._timescale)||1,n=Number(null!==(t=this.hhb._startNumber)&&void 0!==t?t:1),r=Number(this.hhb._duration)/i,o=(this.hhb._presentationTimeOffset||0)/i,u=this.Bib(),h=r/u.ttiles,l=Math.ceil(this.ghb.duration/h),c=n-1+Math.ceil(this.ghb.duration/r),d=[],p=a.ModuleManager.get(s.ModuleName.DASH).replaceAllPlaceholders;if(e>0){var b=e/r;n+=Math.floor(b),this.ghb.startTime=Math.ceil(this.ghb.startTime+e)}for(var f=n;f<=c;f++){var m=d[d.length-1]||{start:0,end:this.ghb.startTime},v=p(this.khb,this.representation,f),g={start:m.end,end:r-o,url:this.ihb+v,text:v};d=d.concat(this.zib(u,g,h,this.representation))}return d.slice(0,l)},t.prototype.nhb=function(){for(var t=parseInt(this.hhb._timescale)||1,e=a.ModuleManager.get(s.ModuleName.DASH).replaceAllPlaceholders,i=Number(this.hhb._startNumber)||0,n=this.Bib(),r=this.hhb._presentationTimeOffset||0,o=this.ghb.startTime,u=[],h=0,l=0,c=0;c<this.jhb.S.length;c++){var d=this.jhb.S[c],p=(Number(d._r)||0)+1,b=Number(d._d),f=this.jhb.S[c+1];isNaN(b)&&null!=f&&(b=(Number(f._t)-Number(d._t))/p);for(var m=b/t/n.ttiles,v=0;v<p;v++){var g=null==d._t?l:Number(d._t)+v*b;l=g+b;var T=e(this.khb,this.representation,i+h,g);h++;var y={start:(g-r)/t+o,end:(l-r)/t+o,url:this.ihb+T,text:T};u=u.concat(this.zib(n,y,m,this.representation))}}return u},t.prototype.yib=function(){var t,e=this.context.sourceContext.sourceIdentifier,i=this.context.serviceManager.get(r.ServiceName.ManifestService,e);return null!==(t=null==i?void 0:i.isLive())&&void 0!==t&&t},t.prototype.zib=function(t,e,i,r){for(var o,a,s=[],u=null!==(o=r._width)&&void 0!==o?o:this.source.adaptationSet._width,h=null!==(a=r._height)&&void 0!==a?a:this.source.adaptationSet._height,l={width:u/t.htiles,height:h/t.vtiles},c=0,d=0;d<t.vtiles;d++)for(var p=0;p<t.htiles;p++){var b=e.start+c;s.push(n(n({},e),{start:b,end:b+i,x:p*l.width,y:d*l.height,width:l.width,height:l.height})),c+=i}return s},t.prototype.Aib=function(){var t;if(isFinite(this.ghb.duration))return 0;var e=this.context.serviceManager.get(r.ServiceName.ManifestService,this.context.sourceContext.sourceIdentifier);if(!e)return 0;this.ghb.startTime=(0,o.toSeconds)(e.getAvailabilityStartTime());var i=null===(t=e.findPeriod(this.representation._internalId.periodId))||void 0===t?void 0:t.start;return isFinite(i)&&(this.ghb.startTime=i),this.ghb.duration=(0,o.toSeconds)(Date.now())-this.ghb.startTime,this.ghb.startTime+this.ghb.duration+e.getTimeShiftBufferDepthSeconds()-this.ghb.startTime},t.prototype.Bib=function(){var t,e=1,i=1;return["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"].includes(this.lhb._schemeIdUri)&&(e=(t=this.lhb._value.split("x").map(function(t){return parseInt(t)}))[0],i=t[1]),{vtiles:i,htiles:e,ttiles:i*e}},t}()},86200:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.BitmovinThumbnailModuleDefinition=void 0;var n=i(62756),r=i(5214);e.BitmovinThumbnailModuleDefinition={name:n.ModuleName.Thumbnail,module:{createThumbnailService:function(t){return new r.BitmovinThumbnailService(t)},extendAdaptationSets:function(t,e,i){return t}}},e.default=e.BitmovinThumbnailModuleDefinition},2758:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.createThumbnailParser=function(t,e){return"string"==typeof e?new r.WebVttThumbnailParser(t):Array.isArray(e)&&e.some(function(t){return(0,n.isDashThumbnailSet)(t.adaptationSet)})?new n.DashThumbnailParser(t):function(){return{parse:function(){return Promise.resolve([])},dispose:function(){}}}()};var n=i(78270),r=i(75042)},41358:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ThumbnailTimeline=void 0;var i=function(){function t(t){this.Vdb=[],this.Wdb=t.width,this.Xdb=t.height}return t.prototype.addThumbnails=function(t){this.Vdb=this.Vdb.concat(t)},t.prototype.getThumbnail=function(t){var e=this.Vdb.length;return 0===e||t<this.Vdb[0].start||t>this.Vdb[e-1].end?null:n(t,this.Vdb,{start:0,end:e})||null},t.prototype.getThumbnailWidth=function(){return this.Wdb},t.prototype.getThumbnailHeight=function(){return this.Xdb},t.prototype.clearThumbnails=function(){this.Vdb=[]},t.prototype.isMatchingTimeline=function(t){return this.getThumbnailWidth()===t.width&&this.getThumbnailHeight()===t.height},t.prototype.dispose=function(){this.clearThumbnails()},t}();function n(t,e,i){var r=i.start,o=void 0===r?0:r,a=i.end,s=void 0===a?e.length:a,u=o+Math.floor((s-o)/2),h=e[u];return function(t,e){return e>=t.start&&e<=t.end}(h,t)?h:u===o?null:h.start>t?n(t,e,{start:o,end:u}):n(t,e,{start:u,end:s})}e.ThumbnailTimeline=i},93617:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.ThumbnailTimelineStore=void 0;var n=i(41358),r=function(){function t(t){this.context=t,this.dY=[]}return t.prototype.addTracks=function(t){var e=this;0!==t.length&&t.forEach(function(t){return e.eY(t).addThumbnails(t.thumbnails)})},t.prototype.getThumbnail=function(t,e){var i,n;if(0===this.dY.length)return null;var r=null!==(n=null===(i=this.context.settings)||void 0===i?void 0:i.THUMBNAIL_TO_PLAYER_SIZE_RATIO)&&void 0!==n?n:1;return function(t,e,i){return i.reduce(function(i,n){var r=o(i,t,e);return o(n,t,e)<r?n:i})}(e.width*r,e.height*r,this.dY).getThumbnail(t)},t.prototype.eY=function(t){var e=this.dY.find(function(e){return e.isMatchingTimeline(t)});return e||(e=new n.ThumbnailTimeline(t),this.dY.push(e),e)},t.prototype.clear=function(){this.dY.forEach(function(t){return t.dispose()}),this.dY=[]},t.prototype.dispose=function(){this.clear()},t}();function o(t,e,i){return Math.abs(e-t.getThumbnailWidth())+Math.abs(i-t.getThumbnailHeight())}e.ThumbnailTimelineStore=r},75042:function(t,e,i){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.WebVttThumbnailParser=void 0;var r=i(4129),o=i(29669),a=i(94685),s=i(58313),u=i(88052),h=i(62756),l=i(59462),c=function(){function t(t){this.context=t}return t.prototype.parse=function(t){var e=this;if(!(0,a.isContextAvailable)(this.context))return Promise.resolve([]);var i=t.slice(0,t.lastIndexOf("/")+1);return this.Sdb(t,this.context).then(function(t){if(!t)return[];var r=e.Udb().parse(t).map(function(t){return function(t,e){var i="#xywh=",r=t.text;if(-1===r.indexOf(i))return n(n({},t),{url:s.URLHelper.concatUrlParts(e,r)});var o=r.indexOf(i)+6,a=r.substring(o);r=r.slice(0,o-6);var u=a.split(","),h=u[0],l=u[1],c=u[2],d=u[3];return n(n({},t),{url:s.URLHelper.concatUrlParts(e,r),x:parseFloat(h),y:parseFloat(l),w:parseFloat(c),h:parseFloat(d)})}(t,i)}).map(function(t){return function(t){return{start:t.start,end:t.end,width:t.w,height:t.h,x:t.x,y:t.y,url:t.url,text:t.text}}(t)}),o=(0,l.mapToThumbnailTrack)(r);return null!=o?[o]:[]}).catch(function(t){return(0,a.isContextAvailable)(e.context)&&e.context.logger.warn("Error trying to get WebVtt thumbnails: ".concat(t)),[]})},t.prototype.Sdb=function(t,e){if(s.URLHelper.isDataUri(t))return Promise.resolve(this.Tdb(t,e.logger));var i=new r.DefaultContentLoader(e,{requestType:o.HttpRequestType.MEDIA_THUMBNAILS});return i.load(t).then(function(t){return t.body}).finally(function(){return i.dispose()})},t.prototype.Tdb=function(t,e){try{return s.URLHelper.parseDataUri(t).data}catch(t){throw e.warn("Error decoding WebVtt thumbnail data URI: ".concat(t)),t}},t.prototype.Udb=function(){return new(u.ModuleManager.get(h.ModuleName.SubtitlesWebVTT).WebVttParser)},t.prototype.dispose=function(){},t}();e.WebVttThumbnailParser=c},59462:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.mapToThumbnailTrack=function(t){return 0===t.length?null:{thumbnails:t,width:t[0].width,height:t[0].height}}}},function(t){return function(){return t(86200)}()}])});
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.thumbnail=e():(t.bitmovin=t.bitmovin||{},t.bitmovin.player=t.bitmovin.player||{},t.bitmovin.player.thumbnail=e())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[898],{5214:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.BitmovinThumbnailService=void 0;var n=i(56481),r=i(94685),o=i(2758),a=i(93617),s=function(){function t(t){this.context=t,this.dz=new a.ThumbnailTimelineStore(t)}return t.prototype.addThumbnails=function(t){var e=this;if(!this.dz||!(0,r.isContextAvailable)(this.context))return Promise.resolve();this.dz.clear();var i=(0,o.createThumbnailParser)(this.context,t);return i.parse(t).then(function(t){var i;return null===(i=e.dz)||void 0===i?void 0:i.addTracks(t)}).finally(function(){return i.dispose()})},t.prototype.getThumbnail=function(t,e){var i,n;return null!==(n=null===(i=this.dz)||void 0===i?void 0:i.getThumbnail(t,e))&&void 0!==n?n:null},t.prototype.dispose=function(){this.dz=(0,n.dispose)(this.dz)},t}();e.BitmovinThumbnailService=s},78270:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.DashThumbnailParser=void 0,e.isDashThumbnailSet=h,e.getSegmentTemplate=l;var n=i(94685),r=i(85434),o=i(23068),a=i(15827),s=i(59462),u=function(){function t(t){this.context=t}return t.prototype.parse=function(t){var e=this,i=t.filter(function(t){return h(t.adaptationSet)&&(0,o.isNumber)(t.timing.startTime)});if(0===i.length)return Promise.resolve([]);var r=i.flatMap(function(t){try{return e.Bdb(t)}catch(t){return(0,n.isContextAvailable)(e.context)&&e.context.logger.warn("Error parsing DASH thumbnails: ".concat(t)),[]}});return Promise.resolve(r)},t.prototype.Bdb=function(t){var e=this;return t.adaptationSet.Representation.reduce(function(i,n){var r=(0,a.parseThumbnailRepresentation)(n,t,e.context),o=(0,s.mapToThumbnailTrack)(r);return null!=o&&i.push(o),i},[])},t.prototype.dispose=function(){},t}();function h(t){if(!t)return!1;var e=r.MimeTypeHelper.isImage(t._mimeType)&&"image"===t._contentType,i=Array.isArray(t.Representation)&&null!=l(t);return Boolean(e&&i)}function l(t){return c(null==t?void 0:t.Representation[0])||c(t)}function c(t){var e,i;return null!==(i=null===(e=null==t?void 0:t.SegmentTemplate)||void 0===e?void 0:e[0])&&void 0!==i?i:null}e.DashThumbnailParser=u},15827:function(t,e,i){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.parseThumbnailRepresentation=function(t,e,i){return new h(t,e,i).parseRepresentation()};var r=i(80813),o=i(89927),a=i(88052),s=i(62756),u=i(78270),h=function(){function t(t,e,i){this.representation=t,this.source=e,this.context=i,this.hasValidData=!!(t&&e&&i)&&this.validate()}return t.prototype.validate=function(){this.fhb=this.source.timing;var t=(0,u.getSegmentTemplate)(this.source.adaptationSet);return!(!t||!this.representation||(this.ghb=t,!(this.ghb._media&&this.representation.BaseURL&&this.representation.BaseURL[0].url)||(this.jhb=this.ghb._media,this.hhb=this.representation.BaseURL[0].url,!this.representation.EssentialProperty||!this.representation.EssentialProperty[0]||(this.khb=this.representation.EssentialProperty[0],this.ghb.SegmentTimeline&&this.ghb.SegmentTimeline[0]&&(this.ihb=this.ghb.SegmentTimeline[0]),0))))},t.prototype.parseRepresentation=function(){return this.hasValidData?this.ihb?this.mhb():this.lhb():[]},t.prototype.lhb=function(){var t,e=this.zib(),i=Number(this.ghb._timescale)||1,n=Number(null!==(t=this.ghb._startNumber)&&void 0!==t?t:1),r=Number(this.ghb._duration)/i,o=(this.ghb._presentationTimeOffset||0)/i,u=this.Aib(),h=r/u.ttiles,l=Math.ceil(this.fhb.duration/h),c=n-1+Math.ceil(this.fhb.duration/r),p=[],b=a.ModuleManager.get(s.ModuleName.DASH).replaceAllPlaceholders;if(e>0){var f=e/r;n+=Math.floor(f),this.fhb.startTime=Math.ceil(this.fhb.startTime+e)}for(var d=n;d<=c;d++){var m=p[p.length-1]||{start:0,end:this.fhb.startTime},v=b(this.jhb,this.representation,d),g={start:m.end,end:r-o,url:this.hhb+v,text:v};p=p.concat(this.yib(u,g,h,this.representation))}return p.slice(0,l)},t.prototype.mhb=function(){for(var t=parseInt(this.ghb._timescale)||1,e=a.ModuleManager.get(s.ModuleName.DASH).replaceAllPlaceholders,i=Number(this.ghb._startNumber)||0,n=this.Aib(),r=this.ghb._presentationTimeOffset||0,o=this.fhb.startTime,u=[],h=0,l=0,c=0;c<this.ihb.S.length;c++){var p=this.ihb.S[c],b=(Number(p._r)||0)+1,f=Number(p._d),d=this.ihb.S[c+1];isNaN(f)&&null!=d&&(f=(Number(d._t)-Number(p._t))/b);for(var m=f/t/n.ttiles,v=0;v<b;v++){var g=null==p._t?l:Number(p._t)+v*f;l=g+f;var T=e(this.jhb,this.representation,i+h,g);h++;var y={start:(g-r)/t+o,end:(l-r)/t+o,url:this.hhb+T,text:T};u=u.concat(this.yib(n,y,m,this.representation))}}return u},t.prototype.nhb=function(){var t,e=this.context.sourceContext.sourceIdentifier,i=this.context.serviceManager.get(r.ServiceName.ManifestService,e);return null!==(t=null==i?void 0:i.isLive())&&void 0!==t&&t},t.prototype.yib=function(t,e,i,r){for(var o,a,s=[],u=null!==(o=r._width)&&void 0!==o?o:this.source.adaptationSet._width,h=null!==(a=r._height)&&void 0!==a?a:this.source.adaptationSet._height,l={width:u/t.htiles,height:h/t.vtiles},c=0,p=0;p<t.vtiles;p++)for(var b=0;b<t.htiles;b++){var f=e.start+c;s.push(n(n({},e),{start:f,end:f+i,x:b*l.width,y:p*l.height,width:l.width,height:l.height})),c+=i}return s},t.prototype.zib=function(){var t;if(isFinite(this.fhb.duration))return 0;var e=this.context.serviceManager.get(r.ServiceName.ManifestService,this.context.sourceContext.sourceIdentifier);if(!e)return 0;this.fhb.startTime=(0,o.toSeconds)(e.getAvailabilityStartTime());var i=null===(t=e.findPeriod(this.representation._internalId.periodId))||void 0===t?void 0:t.start;return isFinite(i)&&(this.fhb.startTime=i),this.fhb.duration=(0,o.toSeconds)(Date.now())-this.fhb.startTime,this.fhb.startTime+this.fhb.duration+e.getTimeShiftBufferDepthSeconds()-this.fhb.startTime},t.prototype.Aib=function(){var t,e=1,i=1;return["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"].includes(this.khb._schemeIdUri)&&(e=(t=this.khb._value.split("x").map(function(t){return parseInt(t)}))[0],i=t[1]),{vtiles:i,htiles:e,ttiles:i*e}},t}()},86200:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.BitmovinThumbnailModuleDefinition=void 0;var n=i(62756),r=i(5214);e.BitmovinThumbnailModuleDefinition={name:n.ModuleName.Thumbnail,module:{createThumbnailService:function(t){return new r.BitmovinThumbnailService(t)},extendAdaptationSets:function(t,e,i){return t}}},e.default=e.BitmovinThumbnailModuleDefinition},2758:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.createThumbnailParser=function(t,e){return"string"==typeof e?new r.WebVttThumbnailParser(t):Array.isArray(e)&&e.some(function(t){return(0,n.isDashThumbnailSet)(t.adaptationSet)})?new n.DashThumbnailParser(t):function(){return{parse:function(){return Promise.resolve([])},dispose:function(){}}}()};var n=i(78270),r=i(75042)},41358:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ThumbnailTimeline=void 0;var i=function(){function t(t){this.ocb=[],this.pcb=t.width,this.Adb=t.height}return t.prototype.addThumbnails=function(t){this.ocb=this.ocb.concat(t)},t.prototype.getThumbnail=function(t){var e=this.ocb.length;return 0===e||t<this.ocb[0].start||t>this.ocb[e-1].end?null:n(t,this.ocb,{start:0,end:e})||null},t.prototype.getThumbnailWidth=function(){return this.pcb},t.prototype.getThumbnailHeight=function(){return this.Adb},t.prototype.clearThumbnails=function(){this.ocb=[]},t.prototype.isMatchingTimeline=function(t){return this.getThumbnailWidth()===t.width&&this.getThumbnailHeight()===t.height},t.prototype.dispose=function(){this.clearThumbnails()},t}();function n(t,e,i){var r=i.start,o=void 0===r?0:r,a=i.end,s=void 0===a?e.length:a,u=o+Math.floor((s-o)/2),h=e[u];return function(t,e){return e>=t.start&&e<=t.end}(h,t)?h:u===o?null:h.start>t?n(t,e,{start:o,end:u}):n(t,e,{start:u,end:s})}e.ThumbnailTimeline=i},93617:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.ThumbnailTimelineStore=void 0;var n=i(41358),r=function(){function t(t){this.context=t,this.MX=[]}return t.prototype.addTracks=function(t){var e=this;0!==t.length&&t.forEach(function(t){return e.NX(t).addThumbnails(t.thumbnails)})},t.prototype.getThumbnail=function(t,e){var i,n;if(0===this.MX.length)return null;var r=null!==(n=null===(i=this.context.settings)||void 0===i?void 0:i.THUMBNAIL_TO_PLAYER_SIZE_RATIO)&&void 0!==n?n:1;return function(t,e,i){return i.reduce(function(i,n){var r=o(i,t,e);return o(n,t,e)<r?n:i})}(e.width*r,e.height*r,this.MX).getThumbnail(t)},t.prototype.NX=function(t){var e=this.MX.find(function(e){return e.isMatchingTimeline(t)});return e||(e=new n.ThumbnailTimeline(t),this.MX.push(e),e)},t.prototype.clear=function(){this.MX.forEach(function(t){return t.dispose()}),this.MX=[]},t.prototype.dispose=function(){this.clear()},t}();function o(t,e,i){return Math.abs(e-t.getThumbnailWidth())+Math.abs(i-t.getThumbnailHeight())}e.ThumbnailTimelineStore=r},75042:function(t,e,i){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.WebVttThumbnailParser=void 0;var r=i(4129),o=i(29669),a=i(94685),s=i(58313),u=i(88052),h=i(62756),l=i(59462),c=function(){function t(t){this.context=t}return t.prototype.parse=function(t){var e=this;if(!(0,a.isContextAvailable)(this.context))return Promise.resolve([]);var i=t.slice(0,t.lastIndexOf("/")+1);return this.Cdb(t,this.context).then(function(t){if(!t)return[];var r=e.Edb().parse(t).map(function(t){return function(t,e){var i="#xywh=",r=t.text;if(-1===r.indexOf(i))return n(n({},t),{url:s.URLHelper.concatUrlParts(e,r)});var o=r.indexOf(i)+6,a=r.substring(o);r=r.slice(0,o-6);var u=a.split(","),h=u[0],l=u[1],c=u[2],p=u[3];return n(n({},t),{url:s.URLHelper.concatUrlParts(e,r),x:parseFloat(h),y:parseFloat(l),w:parseFloat(c),h:parseFloat(p)})}(t,i)}).map(function(t){return function(t){return{start:t.start,end:t.end,width:t.w,height:t.h,x:t.x,y:t.y,url:t.url,text:t.text}}(t)}),o=(0,l.mapToThumbnailTrack)(r);return null!=o?[o]:[]}).catch(function(t){return(0,a.isContextAvailable)(e.context)&&e.context.logger.warn("Error trying to get WebVtt thumbnails: ".concat(t)),[]})},t.prototype.Cdb=function(t,e){if(s.URLHelper.isDataUri(t))return Promise.resolve(this.Ddb(t,e.logger));var i=new r.DefaultContentLoader(e,{requestType:o.HttpRequestType.MEDIA_THUMBNAILS});return i.load(t).then(function(t){return t.body}).finally(function(){return i.dispose()})},t.prototype.Ddb=function(t,e){try{return s.URLHelper.parseDataUri(t).data}catch(t){throw e.warn("Error decoding WebVtt thumbnail data URI: ".concat(t)),t}},t.prototype.Edb=function(){return new(u.ModuleManager.get(h.ModuleName.SubtitlesWebVTT).WebVttParser)},t.prototype.dispose=function(){},t}();e.WebVttThumbnailParser=c},59462:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.mapToThumbnailTrack=function(t){return 0===t.length?null:{thumbnails:t,width:t[0].width,height:t[0].height}}}},function(t){return function(){return t(86200)}()}])});
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.281.0
12
+ * Bitmovin Player Version 8.282.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.thumbnail=e():(t.bitmovin=t.bitmovin||{},t.bitmovin.player=t.bitmovin.player||{},t.bitmovin.player.thumbnail=e())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[898],{5214:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.BitmovinThumbnailService=void 0;var n=i(56481),r=i(94685),o=i(2758),a=i(93617),s=function(){function t(t){this.context=t,this.Xy=new a.ThumbnailTimelineStore(t)}return t.prototype.addThumbnails=function(t){var e=this;if(!this.Xy||!(0,r.isContextAvailable)(this.context))return Promise.resolve();this.Xy.clear();var i=(0,o.createThumbnailParser)(this.context,t);return i.parse(t).then(function(t){var i;return null===(i=e.Xy)||void 0===i?void 0:i.addTracks(t)}).finally(function(){return i.dispose()})},t.prototype.getThumbnail=function(t,e){var i,n;return null!==(n=null===(i=this.Xy)||void 0===i?void 0:i.getThumbnail(t,e))&&void 0!==n?n:null},t.prototype.dispose=function(){this.Xy=(0,n.dispose)(this.Xy)},t}();e.BitmovinThumbnailService=s},78270:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.DashThumbnailParser=void 0,e.isDashThumbnailSet=h,e.getSegmentTemplate=l;var n=i(94685),r=i(85434),o=i(23068),a=i(15827),s=i(59462),u=function(){function t(t){this.context=t}return t.prototype.parse=function(t){var e=this,i=t.filter(function(t){return h(t.adaptationSet)&&(0,o.isNumber)(t.timing.startTime)});if(0===i.length)return Promise.resolve([]);var r=i.flatMap(function(t){try{return e.Jdb(t)}catch(t){return(0,n.isContextAvailable)(e.context),[]}});return Promise.resolve(r)},t.prototype.Jdb=function(t){var e=this;return t.adaptationSet.Representation.reduce(function(i,n){var r=(0,a.parseThumbnailRepresentation)(n,t,e.context),o=(0,s.mapToThumbnailTrack)(r);return null!=o&&i.push(o),i},[])},t.prototype.dispose=function(){},t}();function h(t){if(!t)return!1;var e=r.MimeTypeHelper.isImage(t._mimeType)&&"image"===t._contentType,i=Array.isArray(t.Representation)&&null!=l(t);return Boolean(e&&i)}function l(t){return c(null==t?void 0:t.Representation[0])||c(t)}function c(t){var e,i;return null!==(i=null===(e=null==t?void 0:t.SegmentTemplate)||void 0===e?void 0:e[0])&&void 0!==i?i:null}e.DashThumbnailParser=u},15827:function(t,e,i){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.parseThumbnailRepresentation=function(t,e,i){return new h(t,e,i).parseRepresentation()};var r=i(80813),o=i(89927),a=i(88052),s=i(62756),u=i(78270),h=function(){function t(t,e,i){this.representation=t,this.source=e,this.context=i,this.hasValidData=!!(t&&e&&i)&&this.validate()}return t.prototype.validate=function(){this.ghb=this.source.timing;var t=(0,u.getSegmentTemplate)(this.source.adaptationSet);return!(!t||!this.representation||(this.hhb=t,!(this.hhb._media&&this.representation.BaseURL&&this.representation.BaseURL[0].url)||(this.khb=this.hhb._media,this.ihb=this.representation.BaseURL[0].url,!this.representation.EssentialProperty||!this.representation.EssentialProperty[0]||(this.lhb=this.representation.EssentialProperty[0],this.hhb.SegmentTimeline&&this.hhb.SegmentTimeline[0]&&(this.jhb=this.hhb.SegmentTimeline[0]),0))))},t.prototype.parseRepresentation=function(){return this.hasValidData?this.jhb?this.nhb():this.mhb():[]},t.prototype.mhb=function(){var t,e=this.Aib(),i=Number(this.hhb._timescale)||1,n=Number(null!==(t=this.hhb._startNumber)&&void 0!==t?t:1),r=Number(this.hhb._duration)/i,o=(this.hhb._presentationTimeOffset||0)/i,u=this.Bib(),h=r/u.ttiles,l=Math.ceil(this.ghb.duration/h),c=n-1+Math.ceil(this.ghb.duration/r),p=[],d=a.ModuleManager.get(s.ModuleName.DASH).replaceAllPlaceholders;if(e>0){var b=e/r;n+=Math.floor(b),this.ghb.startTime=Math.ceil(this.ghb.startTime+e)}for(var f=n;f<=c;f++){var m=p[p.length-1]||{start:0,end:this.ghb.startTime},v=d(this.khb,this.representation,f),T={start:m.end,end:r-o,url:this.ihb+v,text:v};p=p.concat(this.zib(u,T,h,this.representation))}return p.slice(0,l)},t.prototype.nhb=function(){for(var t=parseInt(this.hhb._timescale)||1,e=a.ModuleManager.get(s.ModuleName.DASH).replaceAllPlaceholders,i=Number(this.hhb._startNumber)||0,n=this.Bib(),r=this.hhb._presentationTimeOffset||0,o=this.ghb.startTime,u=[],h=0,l=0,c=0;c<this.jhb.S.length;c++){var p=this.jhb.S[c],d=(Number(p._r)||0)+1,b=Number(p._d),f=this.jhb.S[c+1];isNaN(b)&&null!=f&&(b=(Number(f._t)-Number(p._t))/d);for(var m=b/t/n.ttiles,v=0;v<d;v++){var T=null==p._t?l:Number(p._t)+v*b;l=T+b;var g=e(this.khb,this.representation,i+h,T);h++;var y={start:(T-r)/t+o,end:(l-r)/t+o,url:this.ihb+g,text:g};u=u.concat(this.zib(n,y,m,this.representation))}}return u},t.prototype.yib=function(){var t,e=this.context.sourceContext.sourceIdentifier,i=this.context.serviceManager.get(r.ServiceName.ManifestService,e);return null!==(t=null==i?void 0:i.isLive())&&void 0!==t&&t},t.prototype.zib=function(t,e,i,r){for(var o,a,s=[],u=null!==(o=r._width)&&void 0!==o?o:this.source.adaptationSet._width,h=null!==(a=r._height)&&void 0!==a?a:this.source.adaptationSet._height,l={width:u/t.htiles,height:h/t.vtiles},c=0,p=0;p<t.vtiles;p++)for(var d=0;d<t.htiles;d++){var b=e.start+c;s.push(n(n({},e),{start:b,end:b+i,x:d*l.width,y:p*l.height,width:l.width,height:l.height})),c+=i}return s},t.prototype.Aib=function(){var t;if(isFinite(this.ghb.duration))return 0;var e=this.context.serviceManager.get(r.ServiceName.ManifestService,this.context.sourceContext.sourceIdentifier);if(!e)return 0;this.ghb.startTime=(0,o.toSeconds)(e.getAvailabilityStartTime());var i=null===(t=e.findPeriod(this.representation._internalId.periodId))||void 0===t?void 0:t.start;return isFinite(i)&&(this.ghb.startTime=i),this.ghb.duration=(0,o.toSeconds)(Date.now())-this.ghb.startTime,this.ghb.startTime+this.ghb.duration+e.getTimeShiftBufferDepthSeconds()-this.ghb.startTime},t.prototype.Bib=function(){var t,e=1,i=1;return["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"].includes(this.lhb._schemeIdUri)&&(e=(t=this.lhb._value.split("x").map(function(t){return parseInt(t)}))[0],i=t[1]),{vtiles:i,htiles:e,ttiles:i*e}},t}()},86200:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.BitmovinThumbnailModuleDefinition=void 0;var n=i(62756),r=i(5214);e.BitmovinThumbnailModuleDefinition={name:n.ModuleName.Thumbnail,module:{createThumbnailService:function(t){return new r.BitmovinThumbnailService(t)},extendAdaptationSets:function(t,e,i){return t}}},e.default=e.BitmovinThumbnailModuleDefinition},2758:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.createThumbnailParser=function(t,e){return"string"==typeof e?new r.WebVttThumbnailParser(t):Array.isArray(e)&&e.some(function(t){return(0,n.isDashThumbnailSet)(t.adaptationSet)})?new n.DashThumbnailParser(t):function(){return{parse:function(){return Promise.resolve([])},dispose:function(){}}}()};var n=i(78270),r=i(75042)},41358:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ThumbnailTimeline=void 0;var i=function(){function t(t){this.Kdb=[],this.Ldb=t.width,this.Mdb=t.height}return t.prototype.addThumbnails=function(t){this.Kdb=this.Kdb.concat(t)},t.prototype.getThumbnail=function(t){var e=this.Kdb.length;return 0===e||t<this.Kdb[0].start||t>this.Kdb[e-1].end?null:n(t,this.Kdb,{start:0,end:e})||null},t.prototype.getThumbnailWidth=function(){return this.Ldb},t.prototype.getThumbnailHeight=function(){return this.Mdb},t.prototype.clearThumbnails=function(){this.Kdb=[]},t.prototype.isMatchingTimeline=function(t){return this.getThumbnailWidth()===t.width&&this.getThumbnailHeight()===t.height},t.prototype.dispose=function(){this.clearThumbnails()},t}();function n(t,e,i){var r=i.start,o=void 0===r?0:r,a=i.end,s=void 0===a?e.length:a,u=o+Math.floor((s-o)/2),h=e[u];return function(t,e){return e>=t.start&&e<=t.end}(h,t)?h:u===o?null:h.start>t?n(t,e,{start:o,end:u}):n(t,e,{start:u,end:s})}e.ThumbnailTimeline=i},93617:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.ThumbnailTimelineStore=void 0;var n=i(41358),r=function(){function t(t){this.context=t,this.WY=[]}return t.prototype.addTracks=function(t){var e=this;0!==t.length&&t.forEach(function(t){return e.XY(t).addThumbnails(t.thumbnails)})},t.prototype.getThumbnail=function(t,e){var i,n;if(0===this.WY.length)return null;var r=null!==(n=null===(i=this.context.settings)||void 0===i?void 0:i.THUMBNAIL_TO_PLAYER_SIZE_RATIO)&&void 0!==n?n:1;return function(t,e,i){return i.reduce(function(i,n){var r=o(i,t,e);return o(n,t,e)<r?n:i})}(e.width*r,e.height*r,this.WY).getThumbnail(t)},t.prototype.XY=function(t){var e=this.WY.find(function(e){return e.isMatchingTimeline(t)});return e||(e=new n.ThumbnailTimeline(t),this.WY.push(e),e)},t.prototype.clear=function(){this.WY.forEach(function(t){return t.dispose()}),this.WY=[]},t.prototype.dispose=function(){this.clear()},t}();function o(t,e,i){return Math.abs(e-t.getThumbnailWidth())+Math.abs(i-t.getThumbnailHeight())}e.ThumbnailTimelineStore=r},75042:function(t,e,i){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.WebVttThumbnailParser=void 0;var r=i(4129),o=i(29669),a=i(94685),s=i(58313),u=i(88052),h=i(62756),l=i(59462),c=function(){function t(t){this.context=t}return t.prototype.parse=function(t){var e=this;if(!(0,a.isContextAvailable)(this.context))return Promise.resolve([]);var i=t.slice(0,t.lastIndexOf("/")+1);return this.Ndb(t,this.context).then(function(t){if(!t)return[];var r=e.Pdb().parse(t).map(function(t){return function(t,e){var i="#xywh=",r=t.text;if(-1===r.indexOf(i))return n(n({},t),{url:s.URLHelper.concatUrlParts(e,r)});var o=r.indexOf(i)+6,a=r.substring(o);r=r.slice(0,o-6);var u=a.split(","),h=u[0],l=u[1],c=u[2],p=u[3];return n(n({},t),{url:s.URLHelper.concatUrlParts(e,r),x:parseFloat(h),y:parseFloat(l),w:parseFloat(c),h:parseFloat(p)})}(t,i)}).map(function(t){return function(t){return{start:t.start,end:t.end,width:t.w,height:t.h,x:t.x,y:t.y,url:t.url,text:t.text}}(t)}),o=(0,l.mapToThumbnailTrack)(r);return null!=o?[o]:[]}).catch(function(t){return(0,a.isContextAvailable)(e.context),[]})},t.prototype.Ndb=function(t,e){if(s.URLHelper.isDataUri(t))return Promise.resolve(this.Odb(t,e.logger));var i=new r.DefaultContentLoader(e,{requestType:o.HttpRequestType.MEDIA_THUMBNAILS});return i.load(t).then(function(t){return t.body}).finally(function(){return i.dispose()})},t.prototype.Odb=function(t,e){try{return s.URLHelper.parseDataUri(t).data}catch(t){throw t}},t.prototype.Pdb=function(){return new(u.ModuleManager.get(h.ModuleName.SubtitlesWebVTT).WebVttParser)},t.prototype.dispose=function(){},t}();e.WebVttThumbnailParser=c},59462:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.mapToThumbnailTrack=function(t){return 0===t.length?null:{thumbnails:t,width:t[0].width,height:t[0].height}}}},function(t){return function(){return t(86200)}()}])});
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.thumbnail=e():(t.bitmovin=t.bitmovin||{},t.bitmovin.player=t.bitmovin.player||{},t.bitmovin.player.thumbnail=e())}(self,function(){return(self.webpackChunkbitmovin_player=self.webpackChunkbitmovin_player||[]).push([[898],{5214:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.BitmovinThumbnailService=void 0;var n=i(56481),r=i(94685),o=i(2758),a=i(93617),s=function(){function t(t){this.context=t,this.wx=new a.ThumbnailTimelineStore(t)}return t.prototype.addThumbnails=function(t){var e=this;if(!this.wx||!(0,r.isContextAvailable)(this.context))return Promise.resolve();this.wx.clear();var i=(0,o.createThumbnailParser)(this.context,t);return i.parse(t).then(function(t){var i;return null===(i=e.wx)||void 0===i?void 0:i.addTracks(t)}).finally(function(){return i.dispose()})},t.prototype.getThumbnail=function(t,e){var i,n;return null!==(n=null===(i=this.wx)||void 0===i?void 0:i.getThumbnail(t,e))&&void 0!==n?n:null},t.prototype.dispose=function(){this.wx=(0,n.dispose)(this.wx)},t}();e.BitmovinThumbnailService=s},78270:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.DashThumbnailParser=void 0,e.isDashThumbnailSet=h,e.getSegmentTemplate=l;var n=i(94685),r=i(85434),o=i(23068),a=i(15827),s=i(59462),u=function(){function t(t){this.context=t}return t.prototype.parse=function(t){var e=this,i=t.filter(function(t){return h(t.adaptationSet)&&(0,o.isNumber)(t.timing.startTime)});if(0===i.length)return Promise.resolve([]);var r=i.flatMap(function(t){try{return e.Gcb(t)}catch(t){return(0,n.isContextAvailable)(e.context),[]}});return Promise.resolve(r)},t.prototype.Gcb=function(t){var e=this;return t.adaptationSet.Representation.reduce(function(i,n){var r=(0,a.parseThumbnailRepresentation)(n,t,e.context),o=(0,s.mapToThumbnailTrack)(r);return null!=o&&i.push(o),i},[])},t.prototype.dispose=function(){},t}();function h(t){if(!t)return!1;var e=r.MimeTypeHelper.isImage(t._mimeType)&&"image"===t._contentType,i=Array.isArray(t.Representation)&&null!=l(t);return Boolean(e&&i)}function l(t){return c(null==t?void 0:t.Representation[0])||c(t)}function c(t){var e,i;return null!==(i=null===(e=null==t?void 0:t.SegmentTemplate)||void 0===e?void 0:e[0])&&void 0!==i?i:null}e.DashThumbnailParser=u},15827:function(t,e,i){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.parseThumbnailRepresentation=function(t,e,i){return new h(t,e,i).parseRepresentation()};var r=i(80813),o=i(89927),a=i(88052),s=i(62756),u=i(78270),h=function(){function t(t,e,i){this.representation=t,this.source=e,this.context=i,this.hasValidData=!!(t&&e&&i)&&this.validate()}return t.prototype.validate=function(){this.Rhb=this.source.timing;var t=(0,u.getSegmentTemplate)(this.source.adaptationSet);return!(!t||!this.representation||(this.Shb=t,!(this.Shb._media&&this.representation.BaseURL&&this.representation.BaseURL[0].url)||(this.Vhb=this.Shb._media,this.Thb=this.representation.BaseURL[0].url,!this.representation.EssentialProperty||!this.representation.EssentialProperty[0]||(this.Whb=this.representation.EssentialProperty[0],this.Shb.SegmentTimeline&&this.Shb.SegmentTimeline[0]&&(this.Uhb=this.Shb.SegmentTimeline[0]),0))))},t.prototype.parseRepresentation=function(){return this.hasValidData?this.Uhb?this.Yhb():this.Xhb():[]},t.prototype.Xhb=function(){var t,e=this.bhb(),i=Number(this.Shb._timescale)||1,n=Number(null!==(t=this.Shb._startNumber)&&void 0!==t?t:1),r=Number(this.Shb._duration)/i,o=(this.Shb._presentationTimeOffset||0)/i,u=this.chb(),h=r/u.ttiles,l=Math.ceil(this.Rhb.duration/h),c=n-1+Math.ceil(this.Rhb.duration/r),p=[],b=a.ModuleManager.get(s.ModuleName.DASH).replaceAllPlaceholders;if(e>0){var f=e/r;n+=Math.floor(f),this.Rhb.startTime=Math.ceil(this.Rhb.startTime+e)}for(var d=n;d<=c;d++){var m=p[p.length-1]||{start:0,end:this.Rhb.startTime},v=b(this.Vhb,this.representation,d),T={start:m.end,end:r-o,url:this.Thb+v,text:v};p=p.concat(this.ahb(u,T,h,this.representation))}return p.slice(0,l)},t.prototype.Yhb=function(){for(var t=parseInt(this.Shb._timescale)||1,e=a.ModuleManager.get(s.ModuleName.DASH).replaceAllPlaceholders,i=Number(this.Shb._startNumber)||0,n=this.chb(),r=this.Shb._presentationTimeOffset||0,o=this.Rhb.startTime,u=[],h=0,l=0,c=0;c<this.Uhb.S.length;c++){var p=this.Uhb.S[c],b=(Number(p._r)||0)+1,f=Number(p._d),d=this.Uhb.S[c+1];isNaN(f)&&null!=d&&(f=(Number(d._t)-Number(p._t))/b);for(var m=f/t/n.ttiles,v=0;v<b;v++){var T=null==p._t?l:Number(p._t)+v*f;l=T+f;var y=e(this.Vhb,this.representation,i+h,T);h++;var g={start:(T-r)/t+o,end:(l-r)/t+o,url:this.Thb+y,text:y};u=u.concat(this.ahb(n,g,m,this.representation))}}return u},t.prototype.Zhb=function(){var t,e=this.context.sourceContext.sourceIdentifier,i=this.context.serviceManager.get(r.ServiceName.ManifestService,e);return null!==(t=null==i?void 0:i.isLive())&&void 0!==t&&t},t.prototype.ahb=function(t,e,i,r){for(var o,a,s=[],u=null!==(o=r._width)&&void 0!==o?o:this.source.adaptationSet._width,h=null!==(a=r._height)&&void 0!==a?a:this.source.adaptationSet._height,l={width:u/t.htiles,height:h/t.vtiles},c=0,p=0;p<t.vtiles;p++)for(var b=0;b<t.htiles;b++){var f=e.start+c;s.push(n(n({},e),{start:f,end:f+i,x:b*l.width,y:p*l.height,width:l.width,height:l.height})),c+=i}return s},t.prototype.bhb=function(){var t;if(isFinite(this.Rhb.duration))return 0;var e=this.context.serviceManager.get(r.ServiceName.ManifestService,this.context.sourceContext.sourceIdentifier);if(!e)return 0;this.Rhb.startTime=(0,o.toSeconds)(e.getAvailabilityStartTime());var i=null===(t=e.findPeriod(this.representation._internalId.periodId))||void 0===t?void 0:t.start;return isFinite(i)&&(this.Rhb.startTime=i),this.Rhb.duration=(0,o.toSeconds)(Date.now())-this.Rhb.startTime,this.Rhb.startTime+this.Rhb.duration+e.getTimeShiftBufferDepthSeconds()-this.Rhb.startTime},t.prototype.chb=function(){var t,e=1,i=1;return["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"].includes(this.Whb._schemeIdUri)&&(e=(t=this.Whb._value.split("x").map(function(t){return parseInt(t)}))[0],i=t[1]),{vtiles:i,htiles:e,ttiles:i*e}},t}()},86200:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.BitmovinThumbnailModuleDefinition=void 0;var n=i(62756),r=i(5214);e.BitmovinThumbnailModuleDefinition={name:n.ModuleName.Thumbnail,module:{createThumbnailService:function(t){return new r.BitmovinThumbnailService(t)},extendAdaptationSets:function(t,e,i){return t}}},e.default=e.BitmovinThumbnailModuleDefinition},2758:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.createThumbnailParser=function(t,e){return"string"==typeof e?new r.WebVttThumbnailParser(t):Array.isArray(e)&&e.some(function(t){return(0,n.isDashThumbnailSet)(t.adaptationSet)})?new n.DashThumbnailParser(t):function(){return{parse:function(){return Promise.resolve([])},dispose:function(){}}}()};var n=i(78270),r=i(75042)},41358:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ThumbnailTimeline=void 0;var i=function(){function t(t){this.Pcb=[],this.Qcb=t.width,this.Rcb=t.height}return t.prototype.addThumbnails=function(t){this.Pcb=this.Pcb.concat(t)},t.prototype.getThumbnail=function(t){var e=this.Pcb.length;return 0===e||t<this.Pcb[0].start||t>this.Pcb[e-1].end?null:n(t,this.Pcb,{start:0,end:e})||null},t.prototype.getThumbnailWidth=function(){return this.Qcb},t.prototype.getThumbnailHeight=function(){return this.Rcb},t.prototype.clearThumbnails=function(){this.Pcb=[]},t.prototype.isMatchingTimeline=function(t){return this.getThumbnailWidth()===t.width&&this.getThumbnailHeight()===t.height},t.prototype.dispose=function(){this.clearThumbnails()},t}();function n(t,e,i){var r=i.start,o=void 0===r?0:r,a=i.end,s=void 0===a?e.length:a,u=o+Math.floor((s-o)/2),h=e[u];return function(t,e){return e>=t.start&&e<=t.end}(h,t)?h:u===o?null:h.start>t?n(t,e,{start:o,end:u}):n(t,e,{start:u,end:s})}e.ThumbnailTimeline=i},93617:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.ThumbnailTimelineStore=void 0;var n=i(41358),r=function(){function t(t){this.context=t,this.mX=[]}return t.prototype.addTracks=function(t){var e=this;0!==t.length&&t.forEach(function(t){return e.nX(t).addThumbnails(t.thumbnails)})},t.prototype.getThumbnail=function(t,e){var i,n;if(0===this.mX.length)return null;var r=null!==(n=null===(i=this.context.settings)||void 0===i?void 0:i.THUMBNAIL_TO_PLAYER_SIZE_RATIO)&&void 0!==n?n:1;return function(t,e,i){return i.reduce(function(i,n){var r=o(i,t,e);return o(n,t,e)<r?n:i})}(e.width*r,e.height*r,this.mX).getThumbnail(t)},t.prototype.nX=function(t){var e=this.mX.find(function(e){return e.isMatchingTimeline(t)});return e||(e=new n.ThumbnailTimeline(t),this.mX.push(e),e)},t.prototype.clear=function(){this.mX.forEach(function(t){return t.dispose()}),this.mX=[]},t.prototype.dispose=function(){this.clear()},t}();function o(t,e,i){return Math.abs(e-t.getThumbnailWidth())+Math.abs(i-t.getThumbnailHeight())}e.ThumbnailTimelineStore=r},75042:function(t,e,i){var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},n.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.WebVttThumbnailParser=void 0;var r=i(4129),o=i(29669),a=i(94685),s=i(58313),u=i(88052),h=i(62756),l=i(59462),c=function(){function t(t){this.context=t}return t.prototype.parse=function(t){var e=this;if(!(0,a.isContextAvailable)(this.context))return Promise.resolve([]);var i=t.slice(0,t.lastIndexOf("/")+1);return this.Hcb(t,this.context).then(function(t){if(!t)return[];var r=e.Jcb().parse(t).map(function(t){return function(t,e){var i="#xywh=",r=t.text;if(-1===r.indexOf(i))return n(n({},t),{url:s.URLHelper.concatUrlParts(e,r)});var o=r.indexOf(i)+6,a=r.substring(o);r=r.slice(0,o-6);var u=a.split(","),h=u[0],l=u[1],c=u[2],p=u[3];return n(n({},t),{url:s.URLHelper.concatUrlParts(e,r),x:parseFloat(h),y:parseFloat(l),w:parseFloat(c),h:parseFloat(p)})}(t,i)}).map(function(t){return function(t){return{start:t.start,end:t.end,width:t.w,height:t.h,x:t.x,y:t.y,url:t.url,text:t.text}}(t)}),o=(0,l.mapToThumbnailTrack)(r);return null!=o?[o]:[]}).catch(function(t){return(0,a.isContextAvailable)(e.context),[]})},t.prototype.Hcb=function(t,e){if(s.URLHelper.isDataUri(t))return Promise.resolve(this.Icb(t,e.logger));var i=new r.DefaultContentLoader(e,{requestType:o.HttpRequestType.MEDIA_THUMBNAILS});return i.load(t).then(function(t){return t.body}).finally(function(){return i.dispose()})},t.prototype.Icb=function(t,e){try{return s.URLHelper.parseDataUri(t).data}catch(t){throw t}},t.prototype.Jcb=function(){return new(u.ModuleManager.get(h.ModuleName.SubtitlesWebVTT).WebVttParser)},t.prototype.dispose=function(){},t}();e.WebVttThumbnailParser=c},59462:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.mapToThumbnailTrack=function(t){return 0===t.length?null:{thumbnails:t,width:t[0].width,height:t[0].height}}}},function(t){return function(){return t(86200)}()}])});
18
18
  })();