bitmovin-player 8.280.0 → 8.281.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bitmovinplayer-serviceworker.js +2 -2
- package/bitmovinplayer-serviceworker.prod.js +2 -2
- package/bitmovinplayer-ui.js +1 -1
- package/bitmovinplayer.js +2 -2
- package/bitmovinplayer.prod.js +2 -2
- package/modules/bitmovinplayer-abr.js +2 -2
- package/modules/bitmovinplayer-abr.prod.js +2 -2
- package/modules/bitmovinplayer-advertising-bitmovin.js +2 -2
- package/modules/bitmovinplayer-advertising-bitmovin.prod.js +2 -2
- package/modules/bitmovinplayer-advertising-core.js +2 -2
- package/modules/bitmovinplayer-advertising-core.prod.js +2 -2
- package/modules/bitmovinplayer-advertising-ima.js +2 -2
- package/modules/bitmovinplayer-advertising-ima.prod.js +2 -2
- package/modules/bitmovinplayer-advertising-omsdk.js +2 -2
- package/modules/bitmovinplayer-advertising-omsdk.prod.js +2 -2
- package/modules/bitmovinplayer-analytics.js +2 -2
- package/modules/bitmovinplayer-analytics.prod.js +2 -2
- package/modules/bitmovinplayer-container-mp4.js +2 -2
- package/modules/bitmovinplayer-container-mp4.prod.js +2 -2
- package/modules/bitmovinplayer-container-ts.js +2 -2
- package/modules/bitmovinplayer-container-ts.prod.js +2 -2
- package/modules/bitmovinplayer-container-webm.js +2 -2
- package/modules/bitmovinplayer-container-webm.prod.js +2 -2
- package/modules/bitmovinplayer-core.js +2 -2
- package/modules/bitmovinplayer-core.prod.js +2 -2
- package/modules/bitmovinplayer-crypto.js +2 -2
- package/modules/bitmovinplayer-crypto.prod.js +2 -2
- package/modules/bitmovinplayer-dash.js +2 -2
- package/modules/bitmovinplayer-dash.prod.js +2 -2
- package/modules/bitmovinplayer-drm.js +2 -2
- package/modules/bitmovinplayer-drm.prod.js +2 -2
- package/modules/bitmovinplayer-engine-bitmovin.js +2 -2
- package/modules/bitmovinplayer-engine-bitmovin.prod.js +2 -2
- package/modules/bitmovinplayer-engine-native.js +2 -2
- package/modules/bitmovinplayer-engine-native.prod.js +2 -2
- package/modules/bitmovinplayer-engine-webrtc.js +2 -2
- package/modules/bitmovinplayer-engine-webrtc.prod.js +2 -2
- package/modules/bitmovinplayer-envivio.js +1 -1
- package/modules/bitmovinplayer-envivio.prod.js +1 -1
- package/modules/bitmovinplayer-hls.js +2 -2
- package/modules/bitmovinplayer-hls.prod.js +2 -2
- package/modules/bitmovinplayer-lowlatency.js +2 -2
- package/modules/bitmovinplayer-lowlatency.prod.js +2 -2
- package/modules/bitmovinplayer-mserenderer.js +2 -2
- package/modules/bitmovinplayer-mserenderer.prod.js +2 -2
- package/modules/bitmovinplayer-patch.js +1 -1
- package/modules/bitmovinplayer-patch.prod.js +1 -1
- package/modules/bitmovinplayer-playstation4.js +2 -2
- package/modules/bitmovinplayer-playstation4.prod.js +2 -2
- package/modules/bitmovinplayer-playstation5.js +2 -2
- package/modules/bitmovinplayer-playstation5.prod.js +2 -2
- package/modules/bitmovinplayer-polyfill.js +1 -1
- package/modules/bitmovinplayer-polyfill.prod.js +1 -1
- package/modules/bitmovinplayer-reactnative.js +1 -1
- package/modules/bitmovinplayer-reactnative.prod.js +1 -1
- package/modules/bitmovinplayer-remotecontrol.js +2 -2
- package/modules/bitmovinplayer-remotecontrol.prod.js +2 -2
- package/modules/bitmovinplayer-serviceworker-client.js +2 -2
- package/modules/bitmovinplayer-serviceworker-client.prod.js +2 -2
- package/modules/bitmovinplayer-serviceworker.js +2 -2
- package/modules/bitmovinplayer-serviceworker.prod.js +2 -2
- package/modules/bitmovinplayer-sgai.js +2 -2
- package/modules/bitmovinplayer-sgai.prod.js +2 -2
- package/modules/bitmovinplayer-smooth.js +2 -2
- package/modules/bitmovinplayer-smooth.prod.js +2 -2
- package/modules/bitmovinplayer-style.js +2 -2
- package/modules/bitmovinplayer-style.prod.js +2 -2
- package/modules/bitmovinplayer-subtitles-cea608.js +2 -2
- package/modules/bitmovinplayer-subtitles-cea608.prod.js +2 -2
- package/modules/bitmovinplayer-subtitles-native.js +2 -2
- package/modules/bitmovinplayer-subtitles-native.prod.js +2 -2
- package/modules/bitmovinplayer-subtitles-ttml.js +2 -2
- package/modules/bitmovinplayer-subtitles-ttml.prod.js +2 -2
- package/modules/bitmovinplayer-subtitles-vtt.js +2 -2
- package/modules/bitmovinplayer-subtitles-vtt.prod.js +2 -2
- package/modules/bitmovinplayer-subtitles.js +2 -2
- package/modules/bitmovinplayer-subtitles.prod.js +2 -2
- package/modules/bitmovinplayer-thumbnail-imp.js +2 -2
- package/modules/bitmovinplayer-thumbnail-imp.prod.js +2 -2
- package/modules/bitmovinplayer-thumbnail.js +2 -2
- package/modules/bitmovinplayer-thumbnail.prod.js +2 -2
- package/modules/bitmovinplayer-tizen.js +2 -2
- package/modules/bitmovinplayer-tizen.prod.js +2 -2
- package/modules/bitmovinplayer-ui.js +2 -2
- package/modules/bitmovinplayer-ui.prod.js +2 -2
- package/modules/bitmovinplayer-vidaa.js +2 -2
- package/modules/bitmovinplayer-vidaa.prod.js +2 -2
- package/modules/bitmovinplayer-vr.js +2 -2
- package/modules/bitmovinplayer-vr.prod.js +2 -2
- package/modules/bitmovinplayer-webos.js +2 -2
- package/modules/bitmovinplayer-webos.prod.js +2 -2
- package/modules/bitmovinplayer-wpe.js +2 -2
- package/modules/bitmovinplayer-wpe.prod.js +2 -2
- package/modules/bitmovinplayer-xml.js +1 -1
- package/modules/bitmovinplayer-xml.prod.js +1 -1
- package/package.json +1 -1
- package/types/advertising/API.d.ts +9 -0
- package/types/advertising/ConfigAPI.d.ts +6 -5
- package/types/core/BufferSettings.d.ts +58 -0
- package/types/core/LogLevels.d.ts +54 -0
- package/types/core/Logger.d.ts +51 -0
- package/types/core/Settings.d.ts +856 -0
- package/types/core/network/ManifestMimeType.d.ts +5 -0
- package/types/core/util/MimeTypeHelper.d.ts +52 -0
- package/types/sgai/SgaiConfigAPI.d.ts +1 -1
- package/types/sgai/SgaiErrorCode.d.ts +6 -1
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
* This software includes open-source components. See THIRD_PARTY_NOTICES
|
|
10
10
|
* in the distribution for details.
|
|
11
11
|
*
|
|
12
|
-
* Bitmovin Player Version 8.
|
|
12
|
+
* Bitmovin Player Version 8.281.0
|
|
13
13
|
*
|
|
14
14
|
****************************************************************************/
|
|
15
15
|
|
|
16
16
|
(function() {
|
|
17
|
-
"use strict";!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.subtitles=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.TS={},this.US=0}return t.prototype.addSubtitle=function(t){this.removeSubtitle(t.id),this.TS[this.WS()]=n({isFragmented:!1},t)},t.prototype.removeSubtitle=function(t){var e=this;Object.keys(this.TS).forEach(function(n){e.TS[n].id===t&&delete e.TS[n]})},t.prototype.shouldEnableSubtitle=function(t,e){var n=this,i=Object.keys(this.TS).find(function(i){return n.VS(n.TS[i],e)===t.id});return Boolean(i)},t.prototype.VS=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.WS=function(){return this.US++,this.US},t.prototype.dispose=function(){this.TS={},this.US=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 p=u===t.kind&&c&&l;return s||p})}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.XS={}}return t.prototype.addSubtitleHandler=function(t){this.XS[t.getSubtitle().id]=t},t.prototype.deactivate=function(){return this.ZS()?Promise.all(Object.values(this.XS).map(function(t){return t.deactivate()})).then(function(){}):Promise.resolve()},t.prototype.activate=function(t){var e=this;return void 0===t&&(t=this.YS),this.ZS()?(this.YS=t,this.deactivate().then(function(){var t=Object.values(e.XS).find(function(t){return(0,i.isEqualIsoLanguage)(t.getSubtitle().lang,e.YS)});if((t=null!=t?t:Object.values(e.XS)[0])&&!t.isActive())return t.activate().catch(function(){})})):Promise.resolve()},t.prototype.onSeek=function(t,e){Object.values(this.XS).forEach(function(n){return n.onSeek(t,e)})},t.prototype.onSeeked=function(t,e){Object.values(this.XS).forEach(function(n){return n.onSeeked(t,e)})},t.prototype.dispose=function(){Object.values(this.XS).forEach(function(t){return t.dispose()}),this.XS=null},t.prototype.ZS=function(){return Object.keys(this.XS).length>0},t.prototype.getForcedSubtitleHandler=function(t){if(this.XS)return Object.values(this.XS).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()),p=t.duration/n,d=e.getPlaybackTime()+o,f=d+p;if(o+=p,"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="",p="";u<t.data.byteLength;){var d=t.data.getUint32(u),f=a+u,v=i.ArrayHelper.convertBufferSourceToUTF8(new Uint8Array(o,f+4,4));if("vttc"===v){if(c){var h=l(e,n,r,p,c);s.push(h),r+=1,c="",p=""}u+=8}else"payl"===v?(c=i.ArrayHelper.convertBufferSourceToUTF8(new Uint8Array(o,f+8,d-8)),u+=d):"sttg"===v?(p=i.ArrayHelper.convertBufferSourceToUTF8(new Uint8Array(o,f+8,d-8)),u+=d):u+=d}return c&&(h=l(e,n,r,p,c),s.push(h)),s}(t,d,f,u);u+=v.length,v.forEach(function(t){a.push({start:d,end:f,text:t})})}else"stpp"===c&&a.push({start:d,end:f,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),p=n(606),d=n(85224);e.SubtitleModuleDefinition={name:o.ModuleName.Subtitles,module:function(){return{SubtitleService:p.SubtitleService,SubtitleParserFactory:c.SubtitleParserFactory,PlayerSubtitlesApiFactory:l.PlayerSubtitlesApiFactory,HtmlTransformer:u,LanguageComparer:s,hashCode:a.hashCode,createHtmlElement:d.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),p=n(70850),d=n(88052),f=n(62756),v=n(22374),h=n(37723),S=n(53396),g=n(39310),y=n(60672),b=n(88788),m=n(69363),T=n(74715),M=function(){function t(t){var e=this;this.context=t,this.getTransmuxer=function(){return e.rp},this.Jp=function(){e.Ip()},this.Pp=function(t){var n;e.Ip(),e.wp=t.position;var i=null!==(n=e.wp)&&void 0!==n?n:0,r=function(t){return function(t){return"seekTarget"in t}(t)?t.seekTarget:t.target}(t);Object.values(e.op).forEach(function(t){return t.onSeek(i,r)}),e.up.onSeek(i,r)},this.Qp=function(){var t,n=null!==(t=e.wp)&&void 0!==t?t:0,i=e.context.internalPlayer.getCurrentTime();Object.values(e.op).forEach(function(t){return t.onSeeked(n,i)}),e.up.onSeeked(n,i)},this.eq=function(t,n){var i=e.qp.findPeriod(t);i&&(e.Tp(t,n),e.setupControllersForNextPeriod(i),e.fq())},this.hq=function(){Object.keys(e.op).forEach(function(t){return e.op[t].dispose()}),e.op={},e.pp&&(e.pp.dispose(),e.pp=void 0),e.vp&&e.vp.reset()},this.op={},this.sp=t.eventHandler,this.qp=t.serviceManager.get(r.ServiceName.ManifestService,t.sourceContext.sourceIdentifier),this.tp=new h.EnabledSubtitlesTracker,this.up=new S.ForcedSubtitleController,this.sp.on(a.PlayerEvent.Seek,this.Pp),this.sp.on(a.PlayerEvent.TimeShift,this.Pp),this.sp.on(a.PlayerEvent.Seeked,this.Qp),this.sp.on(a.PlayerEvent.TimeShifted,this.Qp),this.sp.on(a.PlayerEvent.SourceUnloaded,this.hq),this.yp=d.ModuleManager.has(f.ModuleName.SubtitlesCEA608)?d.ModuleManager.get(f.ModuleName.SubtitlesCEA608):void 0,this.Ap()}return t.prototype.zp=function(t,e){var n=t!==e,i=this.qp.isHlsManifest()&&!(e||!t);return n||i},t.prototype.Ap=function(){var t=this,e=this.context.serviceManager.get(r.ServiceName.SourceStoreService,this.context.sourceContext.sourceIdentifier);this.xp=(0,s.subscribe)(e)(d.ModuleManager.get(f.ModuleName.EngineBitmovin).selectors.getPlayingPeriodId,this.eq,function(e,n){return t.zp(e,n)})},t.prototype.setupControllersForNextPeriod=function(t){var e=this;t.AdaptationSet.forEach(function(t){var n=t._mimeType;(0,T.isSubtitleTrack)(n,e.qp.isHlsManifest())&&e.Bp(t,n)})},t.prototype.Bp=function(t,e){if((0,T.isFragmentedAdaptationSet)(t))return this.context.store.dispatch((0,u.initializeMetricsForMimeType)(e,this.context.settings)),void this.Cp(t,e);this.Dp(t,e)},t.prototype.Cp=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:d.ModuleManager.get(f.ModuleName.EngineBitmovin).getCodecsFromAdaptationSet(t),isHls:this.qp.isHlsManifest(),manifestLoader:this.context.serviceManager.get(r.ServiceName.ManifestLoadingService,n),periodId:t._internalId.periodId,sourceStore:i};this.addFragmentSubtitle(o,t)}},t.prototype.Dp=function(t,e){if(d.ModuleManager.has(f.ModuleName.DASH)){var n=new(d.ModuleManager.get(f.ModuleName.DASH).SegmentTemplateMPDHandler)(this.context,this.context.sourceContext),i=this.qp.toSubtitleTrack(t,e);n.setAdaptationSetId(t._internalId),i.url=n.getSubtitleUrl().toString(),this.addExternalSubtitle(i,t)}},t.prototype.setTransmuxer=function(t){this.rp=t},t.prototype.hasSubtitle=function(t){return Boolean(this.op[t])},t.prototype.enableSubtitle=function(t){var e=this,n=this.op[t];return n&&!n.isActive()?n.activate().then(function(){n.refresh(),e.up.deactivate()}).then(function(){return e.tp.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.Ep(t,e))return t;var n=new y.ExternalFileSubtitleHandler(this.context,t,e);return this.Fp(n),t},t.prototype.Ep=function(t,e){var n,i,r=this.op[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.up.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.Fp=function(t){var e=t.getSubtitle(),n=this.context.config.playback.isForcedSubtitle;if("function"==typeof n?(0,p.safeUserCallback)(function(){return n(e)},this.context.logger):e.forced)this.up.addSubtitleHandler(t);else{var i=!1,r=e.id;this.op[r]&&(i=this.op[r].isActive(),this.gq(r)),this.Gp(t),i&&t.activate()}},t.prototype.Gp=function(t){var e=t.getSubtitle();this.Hp(e),this.op[e.id]=t,this.Rp(e)},t.prototype.Hp=function(t){var e,n,i=this.context.sourceContext.source.labeling,r=this.qp.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,p.safeUserCallback)(function(){return r(t)},this.context.logger))},t.prototype.addFragmentSubtitle=function(t,e){if(!d.ModuleManager.has(f.ModuleName.EngineBitmovin))return null;var n=this.qp.toSubtitleTrack(e,t.mimeType);n.isFragmented=!0,n.url=null;var i=new b.FragmentedSubtitleHandler(this.context,t,n,this.getTransmuxer);return this.Fp(i),n},t.prototype.setupCea608CaptionExtractor=function(t){var e;if(!this.yp)return this.sp.dispatchEvent(a.PlayerEvent.Warning,new v.PlayerModuleMissingWarning(f.ModuleName.SubtitlesCEA608,"The ".concat(f.ModuleName.SubtitlesCEA608," module is required to parse CEA captions."))),null;if(!d.ModuleManager.has(f.ModuleName.ContainerMP4))return this.sp.dispatchEvent(a.PlayerEvent.Warning,new v.PlayerModuleMissingWarning(f.ModuleName.ContainerMP4,"The ".concat(f.ModuleName.ContainerMP4," module is required to parse CEA captions."))),null;this.pp&&this.pp.dispose();var n=d.ModuleManager.get(f.ModuleName.ContainerMP4),i=this.yp.Cea608Extractor;return this.pp=new i(t,n,null===(e=this.context.config.tweaks)||void 0===e?void 0:e.parse_cea_708_caption),this.pp},t.prototype.Ip=function(){this.pp&&this.pp.reset()},t.prototype.Kp=function(){var t=d.ModuleManager.get(f.ModuleName.HLS);this.vp=new t.DiscontinuitySequenceNumberTracker(c.MimeTypeHelper.isVideo),this.vp.subscribe(this.Jp)},t.prototype.Lp=function(t){this.vp||this.Kp(),this.vp.trackSegment(t)},t.prototype.Mp=function(){return this.qp.getManifest()&&this.qp.isHlsManifest()&&d.ModuleManager.has(f.ModuleName.HLS)},t.prototype.handleClosedCaptions=function(t,e,n,i){var r;return!i&&c.MimeTypeHelper.isVideo(e.getMimeType())&&(null===(r=this.yp)||void 0===r?void 0:r.CEA_EXTRACTOR_SUPPORTED_CODEC_TAGS.includes((0,l.getCodecTag)(e)))?this.Np(e,t.getTimestampOffset()):(this.Op(n,e.getPeriodId()),Promise.resolve())},t.prototype.Np=function(t,e){var n=this;return this.pp?(this.Mp()&&this.Lp(t),this.pp.extract(t).then(function(i){!function(t,e){t.forEach(function(t){t.start-=e,t.end-=e})}(i,e),i.length>0&&n.Op(i,t.getPeriodId())}).catch(function(t){var e;t instanceof v.PlayerModuleMissingWarning&&(null===(e=n.pp)||void 0===e||e.dispose(),n.pp=void 0,n.sp.dispatchEvent(a.PlayerEvent.Warning,t))})):Promise.resolve()},t.prototype.Op=function(t,e){if(t&&Array.isArray(t)&&0!==t.length)for(var n=this.qp.getClosedCaptionLabels(e),i=function(t){var i=t.channel;if(!r.op[i]){var o=n.find(function(t){return t.id===i})||{id:i,kind:"captions",lang:"unknown",label:"Captions (".concat(t.channel,")")};r.Gp(new g.Cea608Handler(r.context,o))}r.op[i].addCaption(t,e)},r=this,o=0,a=t;o<a.length;o++)i(a[o])},t.prototype.Rp=function(t){this.sp.dispatchEvent(a.PlayerEvent.SubtitleAdded,{subtitle:i({},t)})},t.prototype.disableSubtitle=function(t){var e=this,n=this.op[t];return n?n.deactivate().then(function(){return e.tp.removeSubtitle(t),0===e.getActiveSubtitles().length&&e.up.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.gq(t),this.tp.removeSubtitle(t)},t.prototype.getActiveSubtitles=function(){var t=this;return Object.keys(this.op).filter(function(e){return t.op[e].isActive()}).map(function(e){return t.op[e].getSubtitle()})},t.prototype.hasSubtitles=function(){return Object.keys(this.op).length>0},t.prototype.getAvailableSubtitles=function(t){return Object.values(this.op).filter(function(e){var n=e.periodId;return!n||t===n}).map(function(t){return t.getSubtitle()})},t.prototype.enableForcedSubtitle=function(t){this.up.activate(t).catch(function(){})},t.prototype.Sp=function(t,e,n){var i=t.getSubtitleType()===m.SubtitleType.FRAGMENTED&&t.periodId===n,r=t.getSubtitleType()===m.SubtitleType.EXTERNAL_FILE&&t.periodId&&t.periodId!==e;return i||r},t.prototype.Tp=function(t,e){var n=this;Object.keys(this.op).forEach(function(i){var r=n.op[i];n.Sp(r,t,e)&&n.gq(i)})},t.prototype.fq=function(){var t=this;Object.keys(this.op).forEach(function(e){var n,i=t.op[e];if(!i.isActive()&&t.tp.shouldEnableSubtitle(i.getSubtitle(),t.op)){var r={subtitle:i.getSubtitle()};null===(n=t.sp)||void 0===n||n.dispatchEvent(a.PlayerEvent.SubtitleEnable,r),i.activate().then(function(){var e;null===(e=t.sp)||void 0===e||e.dispatchEvent(a.PlayerEvent.SubtitleEnabled,r)})}})},t.prototype.gq=function(t){if(this.op[t]){var e=this.op[t].getSubtitle();this.op[t].dispose(),delete this.op[t],this.sp&&this.sp.dispatchEvent(a.PlayerEvent.SubtitleRemoved,{subtitle:e})}},t.prototype.clearBuffersUntil=function(t){var e=this;Object.keys(this.op).forEach(function(n){return e.op[n].clearBuffersUntil(t)})},t.prototype.dispose=function(){this.hq(),this.tp=(0,o.dispose)(this.tp),this.up=(0,o.dispose)(this.up),this.vp=(0,o.dispose)(this.vp),this.rp=void 0,this.qp=null,this.sp.off(a.PlayerEvent.Seek,this.Pp),this.sp.off(a.PlayerEvent.TimeShift,this.Pp),this.sp.off(a.PlayerEvent.Seeked,this.Qp),this.sp.off(a.PlayerEvent.TimeShifted,this.Qp),this.sp.off(a.PlayerEvent.SourceUnloaded,this.hq),this.xp(),this.op={},this.sp=null},t}();e.SubtitleService=M},74715:function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.isSubtitleTrack=function(t,e){return(i.MimeTypeHelper.isText(t)||i.MimeTypeHelper.isTtmlXml(t))&&!e||i.MimeTypeHelper.isApplication(t)},e.isFragmentedAdaptationSet=function(t){var e=[t];return t.Representation&&t.Representation.length>0&&e.push(t.Representation[0]),e.some(function(t){return t.SegmentList||t.SegmentTemplate||t.SegmentBase})};var i=n(85434)},74437:function(t,e,n){var i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},i.apply(this,arguments)};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,p(t,i.getSubtitle().id))},this.onCueExit=function(t){i.context.eventHandler&&i.context.eventHandler.dispatchEvent(o.PlayerEvent.CueExit,p(t,i.getSubtitle().id))},this.onCueUpdate=function(t){i.context.eventHandler.dispatchEvent(o.PlayerEvent.CueUpdate,p(t,i.getSubtitle().id))},this.context=t,this.sab=e,this.sab.enabled=this.sab.enabled||!1,this.timeline=new a.Timeline(t,{onCueEnter:this.onCueEnter,onCueExit:this.onCueExit,onCueUpdate:this.onCueUpdate}),this.timeline.stopListening(),this.periodId=n,this.tab=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.sab.enabled},t.prototype.activate=function(){return this.sab.enabled=!0,this.timeline.startListening(),this.timeline.show(),Promise.resolve()},t.prototype.deactivate=function(){return this.sab.enabled=!1,this.timeline.stopListening(),this.timeline.hide(),Promise.resolve()},t.prototype.refresh=function(){this.timeline.show()},t.prototype.getSubtitle=function(){return this.sab},t.prototype.clearBuffersUntil=function(t){this.timeline.removeCuesUntil(t)},t.prototype.dispose=function(){this.tab=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.tab.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 p(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),p=n(74437),d=n(69363),f=function(t){function e(n,i,r){var o=t.call(this,n,i,r&&r._internalId.periodId)||this;return o.eS=function(t){if(o.timeline.removeCues(),null==t?void 0:t.body){o.dS=!0;var e=o.fS(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.cS=e.enforceHTTPSForSecureOrigins(i.url.trim()),o.dS=!1,o.aS=new s.DefaultContentLoader(o.context,{maxRetries:o.context.settings.MAX_RETRIES,retryDelay:o.context.settings.RETRY_DELAY,requestType:l.HttpRequestType.MEDIA_SUBTITLES})):(o.dS=!0,o.bS=Promise.resolve()),o}return i(e,t),e.prototype.activate=function(){var e=this;return t.prototype.activate.call(this).then(function(){return e.bS?e.bS:e.dS?Promise.resolve():(e.bS=e.aS.load(e.cS).then(e.eS).catch(function(t){if(e.bS=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.bS)})},e.prototype.fS=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 d.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.aS=(0,a.dispose)(this.aS)},e}(p.AbstractSubtitleHandler);e.ExternalFileSubtitleHandler=f},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),p=n(93204),d=n(81199),f=n(34047),v=n(79721),h=n(85434),S=n(66502),g=n(23068),y=n(88052),b=n(62756),m=n(86058),T=n(15569),M=n(26438),E=n(74437),P=n(69363),_=function(t){function e(e,n,i,r){var o=t.call(this,e,i,n.periodId)||this;o.OT=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=O(n,e);return void 0!==i?Promise.resolve(i):(0,p.waitForStateChangeThen)(t)(function(t){return O(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.vS(i)}).then(function(){return o.wS(i)}).then(function(){return o.isActive()}).catch(function(){return!1})),n.then(function(e){o.PT(t),e&&o.MT(t)})},o.WT=function(t){var e;if(t&&void 0!==t.time){var n=t.time;o.clearBuffersUntil(n);var i=(null===(e=o.nS)||void 0===e?void 0:e.getTimeForNextSegment(o.gS))||n,r=i-n,a=(0,d.getPlayableBufferLevel)(o.context.internalPlayer);isNaN(i)||r>=a||o.hS.hasNext(i)&&(o.hS.getMPDHandler().resolvePendingSegmentInfoRequests(),o.hS.getNext(i))}},o.YT=function(){o.hS.updateMpd()},o.eventHandler=e.eventHandler,o.lS=n.sourceStore,o.nS=e.serviceManager.get(a.ServiceName.StreamTimeService),o.mS=e.serviceManager.get(a.ServiceName.ManifestUpdateSchedulingService,e.sourceContext.sourceIdentifier),o.jS=r,o.iS=n.isHls,o.kS=e.bufferSettings;var u=y.ModuleManager.get(b.ModuleName.EngineBitmovin).SegmentController;return o.hS=new u(e,o.OT,n.mimeType,n.codec,n.isHls,n.manifestLoader,n.periodId,n.sourceStore),o.hS.setCurrentLangObj(i),o.gS="".concat(n.mimeType,"/").concat(i.id),o.oS=y.ModuleManager.get(b.ModuleName.HLS,!1),o.qS(),o}return i(e,t),e.prototype.qS=function(){!this.pS&&this.lS&&(this.pS=(0,p.subscribe)(this.lS)(function(t){return null==t?void 0:t.manifest},this.YT,function(t,e){return Boolean((null==t?void 0:t.isInitialized)&&!(null==e?void 0:e.isInitialized))}))},e.prototype.rS=function(){this.pS&&(this.pS(),this.pS=void 0)},e.prototype.sS=function(t){return x(t)?(0,T.parsePlainTextSubtitles)(t):function(t){return h.MimeTypeHelper.isApplication(t.getMimeType())&&!C(t)}(t)?(0,m.parseMP4WrappedSubtitles)(t,this.context.logger):t.getMetadata().subtitles},e.prototype.tS=function(t){var e=t.getMetadata();e.subtitles=this.sS(t),t.setMetadata(e)},e.prototype.uS=function(t){var e,n=null!==(e=t.getPlaybackTime())&&void 0!==e?e:t.getSegmentInfo().startTime;t.setPlaybackTime(n)},e.prototype.vS=function(t){var e=this.jS();return this.iS&&e?(void 0!==t&&this.LT()||(t=-1),e.waitForInitializationForDiscontinuity(t)):Promise.resolve()},e.prototype.wS=function(t){if(!this.LT())return Promise.resolve();if(void 0!==this.NT(t))return Promise.resolve();if(!this.oS)return Promise.reject(new Error("HLS Module missing"));var e=this.oS.selectors,n=e.getHlsState,i=e.getPresentationTimeOffset;return(0,p.waitForStateChangeThen)(this.lS)(function(e){return i(n(e),String(t))},function(t){return void 0!==t}).then()},e.prototype.xS=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.hS.getCurrentAdaptationSet())||void 0===n?void 0:n.Representation[0];return r&&i?(0,y.ModuleManager.get(b.ModuleName.EngineBitmovin).selectors.getSegmentInfos)(i,r._internalId.key()):[]},e.prototype.IT=function(t,e){var n,i,r,o,u=y.ModuleManager.get(b.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.JT=function(){var t=this.context.sourceContext.sourceIdentifier;return this.context.settings.ENABLE_SEGMENT_INFO_PROVIDER_FROM_STORE?this.xS(t):this.IT(t,this.getSubtitle().id)},e.prototype.KT=function(){var t=this.JT();if(t&&0!==t.length)return t.reduce(function(t,e){var n=A(e)?e.startTime:e._playbackTime,i=A(e)?e.discontinuitySequenceNumber:e._discontinuitySequenceNumber;return(0,g.isNumber)(n)&&(0,g.isNumber)(i)&&void 0===t[i]&&(t[i]=n),t},{})},e.prototype.LT=function(){var t,e=y.ModuleManager.get(b.ModuleName.HLS,!1),n=null===(t=this.lS)||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.KT();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.MT=function(t){this.QT(t),this.tS(t),this.uS(t),this.ST(t),this.isActive()&&this.timeline.show()},e.prototype.NT=function(t){var e;if(this.oS){var n=this.oS.selectors,i=n.getHlsState,r=n.getPresentationTimeOffset,o=null===(e=this.lS)||void 0===e?void 0:e.getState(),a=o?i(o):void 0;if(a)return r(a,String(t))}},e.prototype.PT=function(t){var e,n=t.getPlaybackTimeRange();if(n){var i=y.ModuleManager.get(b.ModuleName.EngineBitmovin),r=i.actions.removeStreamTimeRange,o=i.mseModuleTypes.streamTimeRangeType;null===(e=this.lS)||void 0===e||e.dispatch(r(this.gS,n,o.Loading))}},e.prototype.QT=function(t){var e,n=t.getPlaybackTimeRange();if(!t.isInit()&&n){var i=y.ModuleManager.get(b.ModuleName.EngineBitmovin).actions.addLoadedRange,o=r(r({},n),{bufferBlockId:-1});null===(e=this.lS)||void 0===e||e.dispatch(i(this.gS,o))}},e.prototype.RT=function(t){var e,n,i=-this.hS.getMPDHandler().getTimestampOffset();if(this.iS){var r=t.getSegmentInfo().discontinuitySequenceNumber,o=this.NT(r);void 0!==o&&(i=-o)}return i+(null!==(n=null===(e=this.jS())||void 0===e?void 0:e.getTimestampMappingOffset(t))&&void 0!==n?n:0)},e.prototype.ST=function(t){var n=t.getMetadata().subtitles;if(Array.isArray(n)&&0!==n.length){var i=x(t),r=this.RT(t),o=i||function(t){return"stpp"===f.CodecStringHelper.extractCodec(t.getCodec())}(t)||function(t){return"application/mp4"===t.getMimeType()&&"wvtt"===t.getCodec()&&!C(t)}(t),a=o?this.TT(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.TT=function(t,e){var n=this;return t.flatMap(function(t){return n.UT(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.UT=function(t,e){var n=M.SubtitleParserFactory.createInstance(this.context,t);return e?n.parse(t,e):n.parse(t)},e.prototype.activate=function(){var e=this;return t.prototype.activate.call(this),this.VT().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.hS.activateSubtitleSegmentController(t),e.hS.hasNext(t)&&e.hS.getNext(t),e.eventHandler.on(u.PlayerEvent.TimeChanged,e.WT)}})},e.prototype.VT=function(){var t=this.hS.getCurrentAdaptationSet().Representation[0],e=t._internalId,n=t._mimeType,i=y.ModuleManager.get(b.ModuleName.EngineBitmovin).actions,r=i.setRepresentationIdAction,o=i.setMediaTypeAction;return this.lS.dispatch(r(e)),this.lS.dispatch(o(e,h.MimeTypeHelper.getMediaType(n))),this.mS.waitForRepUpdate(e)},e.prototype.deactivate=function(){var e;this.timeline.removeCues();var n=y.ModuleManager.get(b.ModuleName.EngineBitmovin).actions,i=n.resetStreamTimeline,r=n.resetLoadedRanges;this.eventHandler.off(u.PlayerEvent.TimeChanged,this.WT),this.lS.dispatch(i(this.gS)),this.lS.dispatch(r(this.gS));var o=null===(e=this.hS.getCurrentAdaptationSet())||void 0===e?void 0:e._internalId;return o&&this.lS.dispatch(y.ModuleManager.get(b.ModuleName.EngineBitmovin).actions.removeActiveTrackAction(o)),t.prototype.deactivate.call(this)},e.prototype.getSubtitleType=function(){return P.SubtitleType.FRAGMENTED},e.prototype.clearBuffersUntil=function(e){t.prototype.clearBuffersUntil.call(this,e);var n=y.ModuleManager.get(b.ModuleName.EngineBitmovin).actions.removeLoadedRange;this.lS.dispatch(n(this.gS,{start:0,end:e,bufferBlockId:-1}))},e.prototype.XT=function(t){var e,n=null===(e=this.lS)||void 0===e?void 0:e.getState(),i=(0,c.getBufferState)(n),r=i?(0,c.getLoadedRangesForMimeType)(i,this.gS):[];return(0,o.isInTimeRanges)(r,t)},e.prototype.onSeek=function(t,e){this.isActive()&&(this.XT(e)||this.hS.cancelLoading())},e.prototype.onSeeked=function(t,e){if(this.isActive()&&!this.XT(e)){this.timeline.removeCues();var n=y.ModuleManager.get(b.ModuleName.EngineBitmovin).actions.resetLoadedRanges;this.lS.dispatch(n(this.gS)),this.hS.seekTo(e),this.hS.hasNext(e)&&this.hS.getNext(e)}},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.rS(),this.hS.dispose()},e}(E.AbstractSubtitleHandler);function C(t){return S.TextSegmentAnalyzer.isPlainTextPayload(t.getData())}function x(t){var e=t.getCodec();return("wvtt"===e||"vtt"===e||""===e&&t.getMimeType().includes("vtt"))&&C(t)}function O(t,e){var n=y.ModuleManager.get(b.ModuleName.EngineBitmovin,!1);if(void 0!==e&&void 0!==n)return n.selectors.getContainerFormat(e,t)}function A(t){return"discontinuitySequenceNumber"in t}e.FragmentedSubtitleHandler=_},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.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)}()}])});
|
|
18
18
|
})();
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
* This software includes open-source components. See THIRD_PARTY_NOTICES
|
|
10
10
|
* in the distribution for details.
|
|
11
11
|
*
|
|
12
|
-
* Bitmovin Player Version 8.
|
|
12
|
+
* Bitmovin Player Version 8.281.0
|
|
13
13
|
*
|
|
14
14
|
****************************************************************************/
|
|
15
15
|
|
|
16
16
|
(function() {
|
|
17
|
-
"use strict";!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["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,
|
|
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)}()}])});
|
|
18
18
|
})();
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
* This software includes open-source components. See THIRD_PARTY_NOTICES
|
|
10
10
|
* in the distribution for details.
|
|
11
11
|
*
|
|
12
|
-
* Bitmovin Player Version 8.
|
|
12
|
+
* Bitmovin Player Version 8.281.0
|
|
13
13
|
*
|
|
14
14
|
****************************************************************************/
|
|
15
15
|
|
|
16
16
|
(function() {
|
|
17
|
-
"use strict";!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["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,
|
|
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)}()}])});
|
|
18
18
|
})();
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
* This software includes open-source components. See THIRD_PARTY_NOTICES
|
|
10
10
|
* in the distribution for details.
|
|
11
11
|
*
|
|
12
|
-
* Bitmovin Player Version 8.
|
|
12
|
+
* Bitmovin Player Version 8.281.0
|
|
13
13
|
*
|
|
14
14
|
****************************************************************************/
|
|
15
15
|
|
|
16
16
|
(function() {
|
|
17
|
-
"use strict";!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.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),a=i(2758),o=i(93617),s=function(){function t(t){this.context=t,this.aA=new o.ThumbnailTimelineStore(t)}return t.prototype.addThumbnails=function(t){var e=this;if(!this.aA||!(0,r.isContextAvailable)(this.context))return Promise.resolve();this.aA.clear();var i=(0,a.createThumbnailParser)(this.context,t);return i.parse(t).then(function(t){var i;return null===(i=e.aA)||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.aA)||void 0===i?void 0:i.getThumbnail(t,e))&&void 0!==n?n:null},t.prototype.dispose=function(){this.aA=(0,n.dispose)(this.aA)},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),a=i(23068),o=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,a.isNumber)(t.timing.startTime)});if(0===i.length)return Promise.resolve([]);var r=i.flatMap(function(t){try{return e.kcb(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.kcb=function(t){var e=this;return t.adaptationSet.Representation.reduce(function(i,n){var r=(0,o.parseThumbnailRepresentation)(n,t,e.context),a=(0,s.mapToThumbnailTrack)(r);return null!=a&&i.push(a),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),a=i(89927),o=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.Zhb=this.source.timing;var t=(0,u.getSegmentTemplate)(this.source.adaptationSet);return!(!t||!this.representation||(this.ahb=t,!(this.ahb._media&&this.representation.BaseURL&&this.representation.BaseURL[0].url)||(this.dhb=this.ahb._media,this.bhb=this.representation.BaseURL[0].url,!this.representation.EssentialProperty||!this.representation.EssentialProperty[0]||(this.ehb=this.representation.EssentialProperty[0],this.ahb.SegmentTimeline&&this.ahb.SegmentTimeline[0]&&(this.chb=this.ahb.SegmentTimeline[0]),0))))},t.prototype.parseRepresentation=function(){return this.hasValidData?this.chb?this.ghb():this.fhb():[]},t.prototype.fhb=function(){var t,e=this.jhb(),i=Number(this.ahb._timescale)||1,n=Number(null!==(t=this.ahb._startNumber)&&void 0!==t?t:1),r=Number(this.ahb._duration)/i,a=(this.ahb._presentationTimeOffset||0)/i,u=this.khb(),h=r/u.ttiles,l=Math.ceil(this.Zhb.duration/h),c=n-1+Math.ceil(this.Zhb.duration/r),p=[],b=o.ModuleManager.get(s.ModuleName.DASH).replaceAllPlaceholders;if(e>0){var d=e/r;n+=Math.floor(d),this.Zhb.startTime=Math.ceil(this.Zhb.startTime+e)}for(var f=n;f<=c;f++){var m=p[p.length-1]||{start:0,end:this.Zhb.startTime},v=b(this.dhb,this.representation,f),T={start:m.end,end:r-a,url:this.bhb+v,text:v};p=p.concat(this.ihb(u,T,h,this.representation))}return p.slice(0,l)},t.prototype.ghb=function(){for(var t=parseInt(this.ahb._timescale)||1,e=o.ModuleManager.get(s.ModuleName.DASH).replaceAllPlaceholders,i=Number(this.ahb._startNumber)||0,n=this.khb(),r=this.ahb._presentationTimeOffset||0,a=this.Zhb.startTime,u=[],h=0,l=0,c=0;c<this.chb.S.length;c++){var p=this.chb.S[c],b=(Number(p._r)||0)+1,d=Number(p._d),f=this.chb.S[c+1];isNaN(d)&&null!=f&&(d=(Number(f._t)-Number(p._t))/b);for(var m=d/t/n.ttiles,v=0;v<b;v++){var T=null==p._t?l:Number(p._t)+v*d;l=T+d;var g=e(this.dhb,this.representation,i+h,T);h++;var y={start:(T-r)/t+a,end:(l-r)/t+a,url:this.bhb+g,text:g};u=u.concat(this.ihb(n,y,m,this.representation))}}return u},t.prototype.hhb=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.ihb=function(t,e,i,r){for(var a,o,s=[],u=null!==(a=r._width)&&void 0!==a?a:this.source.adaptationSet._width,h=null!==(o=r._height)&&void 0!==o?o: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 d=e.start+c;s.push(n(n({},e),{start:d,end:d+i,x:b*l.width,y:p*l.height,width:l.width,height:l.height})),c+=i}return s},t.prototype.jhb=function(){var t;if(isFinite(this.Zhb.duration))return 0;var e=this.context.serviceManager.get(r.ServiceName.ManifestService,this.context.sourceContext.sourceIdentifier);if(!e)return 0;this.Zhb.startTime=(0,a.toSeconds)(e.getAvailabilityStartTime());var i=null===(t=e.findPeriod(this.representation._internalId.periodId))||void 0===t?void 0:t.start;return isFinite(i)&&(this.Zhb.startTime=i),this.Zhb.duration=(0,a.toSeconds)(Date.now())-this.Zhb.startTime,this.Zhb.startTime+this.Zhb.duration+e.getTimeShiftBufferDepthSeconds()-this.Zhb.startTime},t.prototype.khb=function(){var t,e=1,i=1;return["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"].includes(this.ehb._schemeIdUri)&&(e=(t=this.ehb._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.Odb=[],this.Pdb=t.width,this.Qdb=t.height}return t.prototype.addThumbnails=function(t){this.Odb=this.Odb.concat(t)},t.prototype.getThumbnail=function(t){var e=this.Odb.length;return 0===e||t<this.Odb[0].start||t>this.Odb[e-1].end?null:n(t,this.Odb,{start:0,end:e})||null},t.prototype.getThumbnailWidth=function(){return this.Pdb},t.prototype.getThumbnailHeight=function(){return this.Qdb},t.prototype.clearThumbnails=function(){this.Odb=[]},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,a=void 0===r?0:r,o=i.end,s=void 0===o?e.length:o,u=a+Math.floor((s-a)/2),h=e[u];return function(t,e){return e>=t.start&&e<=t.end}(h,t)?h:u===a?null:h.start>t?n(t,e,{start:a,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=a(i,t,e);return a(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 a(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),a=i(29669),o=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,o.isContextAvailable)(this.context))return Promise.resolve([]);var i=t.slice(0,t.lastIndexOf("/")+1);return this.lcb(t,this.context).then(function(t){if(!t)return[];var r=e.ncb().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 a=r.indexOf(i)+6,o=r.substring(a);r=r.slice(0,a-6);var u=o.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)}),a=(0,l.mapToThumbnailTrack)(r);return null!=a?[a]:[]}).catch(function(t){return(0,o.isContextAvailable)(e.context)&&e.context.logger.warn("Error trying to get WebVtt thumbnails: ".concat(t)),[]})},t.prototype.lcb=function(t,e){if(s.URLHelper.isDataUri(t))return Promise.resolve(this.mcb(t,e.logger));var i=new r.DefaultContentLoader(e,{requestType:a.HttpRequestType.MEDIA_THUMBNAILS});return i.load(t).then(function(t){return t.body}).finally(function(){return i.dispose()})},t.prototype.mcb=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.ncb=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.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)}()}])});
|
|
18
18
|
})();
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
* This software includes open-source components. See THIRD_PARTY_NOTICES
|
|
10
10
|
* in the distribution for details.
|
|
11
11
|
*
|
|
12
|
-
* Bitmovin Player Version 8.
|
|
12
|
+
* Bitmovin Player Version 8.281.0
|
|
13
13
|
*
|
|
14
14
|
****************************************************************************/
|
|
15
15
|
|
|
16
16
|
(function() {
|
|
17
|
-
"use strict";!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.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.aA=new a.ThumbnailTimelineStore(t)}return t.prototype.addThumbnails=function(t){var e=this;if(!this.aA||!(0,r.isContextAvailable)(this.context))return Promise.resolve();this.aA.clear();var i=(0,o.createThumbnailParser)(this.context,t);return i.parse(t).then(function(t){var i;return null===(i=e.aA)||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.aA)||void 0===i?void 0:i.getThumbnail(t,e))&&void 0!==n?n:null},t.prototype.dispose=function(){this.aA=(0,n.dispose)(this.aA)},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),[]}});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.Hib=this.source.timing;var t=(0,u.getSegmentTemplate)(this.source.adaptationSet);return!(!t||!this.representation||(this.Iib=t,!(this.Iib._media&&this.representation.BaseURL&&this.representation.BaseURL[0].url)||(this.Lib=this.Iib._media,this.Jib=this.representation.BaseURL[0].url,!this.representation.EssentialProperty||!this.representation.EssentialProperty[0]||(this.Mib=this.representation.EssentialProperty[0],this.Iib.SegmentTimeline&&this.Iib.SegmentTimeline[0]&&(this.Kib=this.Iib.SegmentTimeline[0]),0))))},t.prototype.parseRepresentation=function(){return this.hasValidData?this.Kib?this.Oib():this.Nib():[]},t.prototype.Nib=function(){var t,e=this.Rib(),i=Number(this.Iib._timescale)||1,n=Number(null!==(t=this.Iib._startNumber)&&void 0!==t?t:1),r=Number(this.Iib._duration)/i,o=(this.Iib._presentationTimeOffset||0)/i,u=this.Sib(),h=r/u.ttiles,l=Math.ceil(this.Hib.duration/h),c=n-1+Math.ceil(this.Hib.duration/r),p=[],d=a.ModuleManager.get(s.ModuleName.DASH).replaceAllPlaceholders;if(e>0){var b=e/r;n+=Math.floor(b),this.Hib.startTime=Math.ceil(this.Hib.startTime+e)}for(var f=n;f<=c;f++){var m=p[p.length-1]||{start:0,end:this.Hib.startTime},v=d(this.Lib,this.representation,f),T={start:m.end,end:r-o,url:this.Jib+v,text:v};p=p.concat(this.Qib(u,T,h,this.representation))}return p.slice(0,l)},t.prototype.Oib=function(){for(var t=parseInt(this.Iib._timescale)||1,e=a.ModuleManager.get(s.ModuleName.DASH).replaceAllPlaceholders,i=Number(this.Iib._startNumber)||0,n=this.Sib(),r=this.Iib._presentationTimeOffset||0,o=this.Hib.startTime,u=[],h=0,l=0,c=0;c<this.Kib.S.length;c++){var p=this.Kib.S[c],d=(Number(p._r)||0)+1,b=Number(p._d),f=this.Kib.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 y=e(this.Lib,this.representation,i+h,T);h++;var g={start:(T-r)/t+o,end:(l-r)/t+o,url:this.Jib+y,text:y};u=u.concat(this.Qib(n,g,m,this.representation))}}return u},t.prototype.Pib=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.Qib=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.Rib=function(){var t;if(isFinite(this.Hib.duration))return 0;var e=this.context.serviceManager.get(r.ServiceName.ManifestService,this.context.sourceContext.sourceIdentifier);if(!e)return 0;this.Hib.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.Hib.startTime=i),this.Hib.duration=(0,o.toSeconds)(Date.now())-this.Hib.startTime,this.Hib.startTime+this.Hib.duration+e.getTimeShiftBufferDepthSeconds()-this.Hib.startTime},t.prototype.Sib=function(){var t,e=1,i=1;return["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"].includes(this.Mib._schemeIdUri)&&(e=(t=this.Mib._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.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.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],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.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 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.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)}()}])});
|
|
18
18
|
})();
|