@clickview/lite 0.103.0-rc.0 → 0.103.1
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/dist/.vite/manifest.json +447 -447
- package/dist/bundles.json +1 -1
- package/dist/en.json +1 -1
- package/dist/scripts/{BXosUOUS.chunk.js → 14z5Gy8L.chunk.js} +2 -2
- package/dist/scripts/{BXosUOUS.chunk.js.map → 14z5Gy8L.chunk.js.map} +1 -1
- package/dist/scripts/{BqkK_0Jk2.chunk.js → B4AZn1xm2.chunk.js} +2 -2
- package/dist/scripts/{BqkK_0Jk2.chunk.js.map → B4AZn1xm2.chunk.js.map} +1 -1
- package/dist/scripts/{_wBbQ-0z2.chunk.js → BBndy2td2.chunk.js} +2 -2
- package/dist/scripts/{_wBbQ-0z2.chunk.js.map → BBndy2td2.chunk.js.map} +1 -1
- package/dist/scripts/{DBdkd4Ag2.chunk.js → BFH_tnSb2.chunk.js} +3 -3
- package/dist/scripts/{DBdkd4Ag2.chunk.js.map → BFH_tnSb2.chunk.js.map} +1 -1
- package/dist/scripts/{BhgNNQjX.chunk.js → BOQck-Qs.chunk.js} +2 -2
- package/dist/scripts/{BhgNNQjX.chunk.js.map → BOQck-Qs.chunk.js.map} +1 -1
- package/dist/scripts/{_eRiDJm1.chunk.js → Ba4uGz_V.chunk.js} +2 -2
- package/dist/scripts/{_eRiDJm1.chunk.js.map → Ba4uGz_V.chunk.js.map} +1 -1
- package/dist/scripts/{Bx6qaXLc.chunk.js → Bdbe2u0R.chunk.js} +2 -2
- package/dist/scripts/{Bx6qaXLc.chunk.js.map → Bdbe2u0R.chunk.js.map} +1 -1
- package/dist/scripts/{C4CuJJXy2.chunk.js → BeW5XQTb2.chunk.js} +2 -2
- package/dist/scripts/{C4CuJJXy2.chunk.js.map → BeW5XQTb2.chunk.js.map} +1 -1
- package/dist/scripts/{syYCrnUX.chunk.js → BgoVmaXQ.chunk.js} +2 -2
- package/dist/scripts/{syYCrnUX.chunk.js.map → BgoVmaXQ.chunk.js.map} +1 -1
- package/dist/scripts/{B5DWwtp0.chunk.js → BjA9XV5y.chunk.js} +2 -2
- package/dist/scripts/{B5DWwtp0.chunk.js.map → BjA9XV5y.chunk.js.map} +1 -1
- package/dist/scripts/{BYMMqtaN.chunk.js → BqdHoEFM.chunk.js} +2 -2
- package/dist/scripts/{BYMMqtaN.chunk.js.map → BqdHoEFM.chunk.js.map} +1 -1
- package/dist/scripts/{BIvmcqND2.chunk.js → CCUznsdX2.chunk.js} +2 -2
- package/dist/scripts/{BIvmcqND2.chunk.js.map → CCUznsdX2.chunk.js.map} +1 -1
- package/dist/scripts/{BsNCh4UD.chunk.js → CFqL2Hm5.chunk.js} +3 -3
- package/dist/scripts/{BsNCh4UD.chunk.js.map → CFqL2Hm5.chunk.js.map} +1 -1
- package/dist/scripts/{BE8Ze3Fa2.chunk.js → CHmbcl4Y2.chunk.js} +2 -2
- package/dist/scripts/{BE8Ze3Fa2.chunk.js.map → CHmbcl4Y2.chunk.js.map} +1 -1
- package/dist/scripts/{Dp8z_udC.chunk.js → CIzlhCeS.chunk.js} +2 -2
- package/dist/scripts/{Dp8z_udC.chunk.js.map → CIzlhCeS.chunk.js.map} +1 -1
- package/dist/scripts/{CO8EIpI8.chunk.js → CXUrMkZu.chunk.js} +2 -2
- package/dist/scripts/{CO8EIpI8.chunk.js.map → CXUrMkZu.chunk.js.map} +1 -1
- package/dist/scripts/{DLqG-wwP.chunk.js → CYrelpYt.chunk.js} +2 -2
- package/dist/scripts/{DLqG-wwP.chunk.js.map → CYrelpYt.chunk.js.map} +1 -1
- package/dist/scripts/{wmwWqIeA.chunk.js → CfrfHGSh.chunk.js} +2 -2
- package/dist/scripts/{wmwWqIeA.chunk.js.map → CfrfHGSh.chunk.js.map} +1 -1
- package/dist/scripts/{B5M-3wpn.chunk.js → CjwT65ug.chunk.js} +2 -2
- package/dist/scripts/{B5M-3wpn.chunk.js.map → CjwT65ug.chunk.js.map} +1 -1
- package/dist/scripts/{B-aaIChO2.chunk.js → CsCjBSq62.chunk.js} +2 -2
- package/dist/scripts/{B-aaIChO2.chunk.js.map → CsCjBSq62.chunk.js.map} +1 -1
- package/dist/scripts/{ygwO7HPs2.chunk.js → DIaT_eGy2.chunk.js} +2 -2
- package/dist/scripts/{ygwO7HPs2.chunk.js.map → DIaT_eGy2.chunk.js.map} +1 -1
- package/dist/scripts/{DXRsxBJw.chunk.js → DTliAJ8L.chunk.js} +2 -2
- package/dist/scripts/{DXRsxBJw.chunk.js.map → DTliAJ8L.chunk.js.map} +1 -1
- package/dist/scripts/{DE5jvfAx2.chunk.js → D_t70KgV2.chunk.js} +2 -2
- package/dist/scripts/{DE5jvfAx2.chunk.js.map → D_t70KgV2.chunk.js.map} +1 -1
- package/dist/scripts/{Dc01PBv1.chunk.js → Dn2EPvQj.chunk.js} +2 -2
- package/dist/scripts/{Dc01PBv1.chunk.js.map → Dn2EPvQj.chunk.js.map} +1 -1
- package/dist/scripts/{RuVwpX36.chunk.js → Drh1bb9z.chunk.js} +2 -2
- package/dist/scripts/{RuVwpX36.chunk.js.map → Drh1bb9z.chunk.js.map} +1 -1
- package/dist/scripts/{YzhKditE.chunk.js → ESLgHTNq.chunk.js} +2 -2
- package/dist/scripts/{YzhKditE.chunk.js.map → ESLgHTNq.chunk.js.map} +1 -1
- package/dist/scripts/{DfSzsD3P.chunk.js → FysETOFv.chunk.js} +2 -2
- package/dist/scripts/{DfSzsD3P.chunk.js.map → FysETOFv.chunk.js.map} +1 -1
- package/dist/scripts/QVwuOts3.chunk.js +12 -0
- package/dist/scripts/QVwuOts3.chunk.js.map +1 -0
- package/dist/scripts/{OmYpHs7g.chunk.js → _Cm5O72d.chunk.js} +3 -3
- package/dist/scripts/{OmYpHs7g.chunk.js.map → _Cm5O72d.chunk.js.map} +1 -1
- package/dist/scripts/{app-BzCWmnrr.js → app-BHlllGhO.js} +4 -4
- package/dist/scripts/{app-BzCWmnrr.js.map → app-BHlllGhO.js.map} +1 -1
- package/dist/scripts/{C46080Xd.chunk.js → dxqgnrOi.chunk.js} +2 -2
- package/dist/scripts/{C46080Xd.chunk.js.map → dxqgnrOi.chunk.js.map} +1 -1
- package/dist/scripts/{BCTM3KG42.chunk.js → kLCNzxrH2.chunk.js} +2 -2
- package/dist/scripts/{BCTM3KG42.chunk.js.map → kLCNzxrH2.chunk.js.map} +1 -1
- package/dist/scripts/{CfVIZBcI2.chunk.js → wpRpI9h02.chunk.js} +2 -2
- package/dist/scripts/{CfVIZBcI2.chunk.js.map → wpRpI9h02.chunk.js.map} +1 -1
- package/package.json +1 -1
- package/dist/scripts/QrUfkwZX.chunk.js +0 -12
- package/dist/scripts/QrUfkwZX.chunk.js.map +0 -1
|
@@ -222,7 +222,7 @@ ${xp(e)}`),t.map&&!t.map.bytes&&(this.logger_(`going to request init segment.`),
|
|
|
222
222
|
fill='currentColor'
|
|
223
223
|
/>
|
|
224
224
|
</svg>
|
|
225
|
-
`,Qh=class extends Yh{constructor(e,t){super(e,t)}createEl(){let e=Xh.prototype.createEl.call(this,`button`,{className:this.buildCSSClass()},{type:`button`,title:this.controlText_});return e.innerHTML=Zh,this.createControlTextEl(e),e}handleClick(e){e.stopPropagation(),e.preventDefault(),this.options_?.onClick&&this.options_.onClick()}buildCSSClass(){return`cv-remove-video-button`}};K.registerComponent(`removeVideoButton`,Qh),Qh.prototype.controlText_=`Remove from watch history`;var $h=`cvplayer-playback-quality:v2`,eg=`cvplayer-localcache-playback-quality:v2`,tg=class{static isQualityUserPreference(){let e=localStorage.getItem($h),t=localStorage.getItem(eg);return!!(e||t)}static getPlayerMode(e){let t=e.isFullscreen?.()??!1,n=e.usingPlugin?.(`playerModePlugin`)?e.playerModePlugin()?.isHovering?.()??!1:!1,r=e.usingPlugin?.(`theatreModePlugin`)?e.theatreModePlugin()?.getTheatreMode?.()??!1:!1;return t?`fullscreen`:n?`hover`:r?`theatre`:`default`}static findQualityLevel(e,t){for(let n=0;n<e.length;n++)if(e[n].quality<=t)return e[n];let n=e[e.length-1];if(!n)throw Error(`No quality levels available`);return n}static enableQualityLevel(e,t){for(let n=0;n<e.length;n++){let r=e[n];r.enabled=r.id===t}}},ng=function(e){return e.Default=`play`,e.Hover=`hover`,e}({}),rg=K.getPlugin(`plugin`),ig=`cv-preview-mode`,ag=`cv-force-16-9`,og=class extends rg{constructor(e,t){super(e),this.hasSeeked=!1,this.buttonAdded=!1,this.mode=null,this.defaultDisplayMode=`normal`,this.onQualityReady=null,t?.defaultDisplayMode&&(this.defaultDisplayMode=t.defaultDisplayMode),t?.startTime&&(this.startTime=t.startTime),this.onSeek=this.onSeek.bind(this),this.player.one(`seeking`,this.onSeek)}onSeek(){this.hasSeeked=!0}dispose(){this.cleanupQualityListener(),this.player.off(`seeking`,this.onSeek),super.dispose()}getMode(){return this.mode}isHovering(){return this.mode===`hover`}setPlayerMode(e,t,n){this.player.trigger(`flushprogress`);let r=this.mode;if(this.mode=e,e===`hover`){this.buttonAdded||this.addButtons(t,n),this.player.addClass(ig),this.applyAspectRatioFix(),this.enableSubtitles(),this.mute(),this.setLowQuality(),this.removeActivityTimeout(),this.player.trigger(`resize`);return}r===`hover`&&(this.applyDefaultModeLayout(),this.player.removeClass(ig),this.player.removeClass(ag),this.disableSubtitles(),this.unmute(),this.cleanupQualityListener(),this.restorePreviousQuality(),this.restoreActivityTimeout(),this.player.trigger(`resize`),this.hasSeeked||=(this.player.currentTime(this.startTime??0),!1))}applyDefaultModeLayout(){let e=this.player.usingPlugin?.(`theatreModePlugin`);this.defaultDisplayMode===`theatre`?(e&&this.player.theatreModePlugin()?.toggleTheatreMode(!0),this.player.fill(!0)):(e&&this.player.theatreModePlugin()?.toggleTheatreMode(!1),this.player.fluid(!0))}applyAspectRatioFix(){let e=()=>{let e=this.player.videoWidth(),t=this.player.videoHeight();if(e>0&&t>0){let n=e/t;Math.abs(n-16/9)<.01||this.player.addClass(ag)}};this.player.readyState()>=1?e():this.player.one(`loadedmetadata`,e)}addButtons(e,t){let n=new Kh(this.player),r=new Jh(this.player,{onClickHandler:e}),i=new Qh(this.player,{onClick:t});t&&ce.isFunction(t)&&this.player.addChild(i),this.player.addChild(n),this.player.addChild(r),this.buttonAdded=!0}enableSubtitles(){this.player.dataLoaded(()=>this.player.persistSubtitleSettingsPlugin().previewModeSubtitles())}disableSubtitles(){this.player.dataLoaded(()=>this.player.persistSubtitleSettingsPlugin().applyUserPreferences())}mute(){this.player.ready(()=>{this.player.persistVolumePlugin().disable(),this.player.muted(!0)})}unmute(){this.player.ready(()=>{this.player.persistVolumePlugin().applyUserPreferences(),this.player.persistVolumePlugin().enable()})}setLowQuality(){this.player.dataLoaded(()=>{this.player.persistQualitySettingsPlugin().disable();let e=this.player.qualityLevels();if(e.length>0){this.switchToLowestQuality(e);return}this.cleanupQualityListener(),this.onQualityReady=()=>{this.onQualityReady=null,this.switchToLowestQuality(e)},e.one(`change`,this.onQualityReady)})}cleanupQualityListener(){this.onQualityReady&&=(this.player.qualityLevels().off(`change`,this.onQualityReady),null)}switchToLowestQuality(e){let t=e[e.length-1];t&&tg.enableQualityLevel(e,t.id)}restorePreviousQuality(){this.player.dataLoaded(()=>{this.player.persistQualitySettingsPlugin().applyUserPreferences(),this.player.persistQualitySettingsPlugin().enable()})}removeActivityTimeout(){this.player.cache_.inactivityTimeout=this.player.options_.inactivityTimeout,this.player.options_.inactivityTimeout=0}restoreActivityTimeout(){this.player.options_.inactivityTimeout=this.player.cache_.inactivityTimeout}};K.registerPlugin(`playerModePlugin`,og);var sg=1e3*60*60*8,cg=class{constructor(e){this.options=e,this.initialize()}logStream(){let e=`v:${this.options.videoId}`,t=this.getPlayerMetrics();te.cacheExists(e)||(this.collectionApiClient.log({type:k.WebPlayerStream,actionContext:this.getActionContext(),data:{...this.getAnalyticsData(),player:t},eventVersion:re.V3}),te&&te.cacheSet(e,null,300))}logVideoProgress(e,t,n){let r=this.getAnalyticsData(),i=this.getPlayerMetrics(),a=n?k.PreviewStreamProgress:k.StreamProgress,o=e.map(e=>({type:a,actionContext:this.getActionContext(),data:{...r,player:i,progress:e},eventVersion:re.V2}));for(let e of t)o.push({type:k.StreamBuffering,actionContext:this.getActionContext(),data:{...r,player:i,buffering:e},eventVersion:re.V2});this.collectionApiClient.log(o)}logUserAction(e,t){let n={...this.getAnalyticsData(),...e},r={...this.getActionContext(),...t};this.collectionApiClient.log({type:t.actionType,data:n,actionContext:r,eventVersion:t.eventVersion||re.V2})}getAnalyticsData(){let e={video:{id:this.options.videoId},flags:{isUsingLocalCache:this.options.isUsingLocalCache,isQualityUserPreference:tg.isQualityUserPreference()},...this.options.additionalAnalyticsData||{}};this.options.shareId&&(e.video.shareId=this.options.shareId);let t=this.getEntityType();return t===O.Interactive?e.interactive={id:+this.options.mediaId}:t===O.Clip&&(e.clip={id:+this.options.mediaId}),e}initialize(){this.setupCollectionApiClient(),A.lockWindowSession(this.options.userId,sg),this.options.player.one(`dispose`,()=>A.unlockWindowSession(this.options.userId))}setupCollectionApiClient(){this.collectionApiClient=new oe({productName:`player.web`,productVersion:this.options.productVersion,regionName:this.options.regionName,collectionApiUrls:this.options.collectionApiUrls,collectionApiClientId:this.options.collectionApiClientId,getUser:()=>this.getCurrentUser(),shouldLog:se.shouldLog,formatData:se.formatData})}async getCurrentUser(){return{id:this.options.userId,customerId:this.options.customerId,sessionId:this.options.authSessionId}}getActionContext(){return{entity:this.getEntityType(),location:this.getLocationContext(),productArea:void 0,descriptor:this.options.isEmbedded?ie.Embedded:void 0,workflowPhase:void 0}}getEntityType(){switch(this.options.mediaType){case`MasterVideo`:return O.Video;case`MasterInteractive`:return O.Interactive;case`MasterClip`:return O.Clip}}getLocationContext(){switch(this.options.playerType){case`player`:return ae.Player;case`interactive-player`:return ae.InteractivePlayer;case`create-clip-player`:return ae.CreateClipPlayer}}getPlayerMetrics(){let e=this.options.player,t=e.qualityLevels?.();return{mode:tg.getPlayerMode(e),width:e.currentWidth(),height:e.currentHeight(),quality:t?.[t?.selectedIndex]?.id}}},q=e(t(((e,t)=>{function n(e){if(e&&typeof e==`object`){var t=e.which||e.keyCode||e.charCode;t&&(e=t)}if(typeof e==`number`)return o[e];var n=String(e),a=r[n.toLowerCase()];if(a)return a;var a=i[n.toLowerCase()];if(a)return a;if(n.length===1)return n.charCodeAt(0)}n.isEventKey=function(e,t){if(e&&typeof e==`object`){var n=e.which||e.keyCode||e.charCode;if(n==null)return!1;if(typeof t==`string`){var a=r[t.toLowerCase()];if(a)return a===n;var a=i[t.toLowerCase()];if(a)return a===n}else if(typeof t==`number`)return t===n;return!1}},e=t.exports=n;var r=e.code=e.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},i=e.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};for(a=97;a<123;a++)r[String.fromCharCode(a)]=a-32;for(var a=48;a<58;a++)r[a-48]=a;for(a=1;a<13;a++)r[`f`+a]=a+111;for(a=0;a<10;a++)r[`numpad `+a]=a+96;var o=e.names=e.title={};for(a in r)o[r[a]]=a;for(var s in i)r[s]=i[s]}))());function lg(e){document[e.fsApi_.fullscreenEnabled]&&(e.isFullscreen()?e.exitFullscreen():e.requestFullscreen())}function ug(e){let t=e.theatreModePlugin().getTheatreMode();e.theatreModePlugin().toggleTheatreMode(!t,{shouldLog:!0})}function dg(e){let t=e.volume(),n=e.lastVolume_();if(t===0){let t=n<.1?.1:n;e.volume(t),e.muted(!1)}else e.muted(!e.muted())}function fg(e){e.paused()?e.play():e.pause()}function pg(e,t){e.currentTime(e.currentTime()+t)}function mg(e,t){t>0&&e.muted()&&e.muted(!1),e.volume(e.volume()+t)}function hg(e){let t=e.target;return t.tagName.toLowerCase()===`video`||!![`video-js`,`vjs-tech`].find(e=>t.classList.contains(e))}var gg={f:lg,m:dg,k:fg,space:fg,t:ug,left:e=>pg(e,-5),right:e=>pg(e,5),j:e=>pg(e,-10),l:e=>pg(e,10),up:e=>mg(e,.05),down:e=>mg(e,-.05)};function _g(e,t,n){if(e.ctrlKey||e.metaKey||e.altKey)return;let r=(0,q.default)(e),i=[`up`,`down`].includes(r);if(i&&!e.shiftKey||!i&&e.shiftKey||r===`t`&&!n.allowTheatreMode||r===`f`&&!n.allowFullscreen||!gg[r])return;gg[r](t,e);let a=hg(e),o=[`space`].includes(r);(a||o)&&(e.preventDefault(),e.stopPropagation())}var vg=function(e){return e.PhysicallyChapteredVideo=`physically-chaptered-video`,e}({}),yg={name:`@clickview/player`,version:`1.53.0`,description:`ClickView Player`,main:`dist/player-app.js`,type:`module`,scripts:{"type-check":`tsc --noEmit`,"build-app":`node ../../../node_modules/vite/bin/vite.js build --config vite.config.app.ts`,"build-styles":`node ../../../node_modules/vite/bin/vite.js build --config vite.config.styles.ts`,build:`npm run type-check && npm run build-player && npm run build-interactive-player`,"build-player":`node ../../../node_modules/vite/bin/vite.js build --config vite.player.config.ts`,"build-interactive-player":`node ../../../node_modules/vite/bin/vite.js build --config vite.interactive-player.config.ts`,"build-font":`cross-env NODE_ENV=development npm run start`,test:`jest`,"test-watch":`jest --watch`,"test-harness":`npm run build && node ../../../node_modules/vite/bin/vite.js --config vite.test-harness.config.ts`},repository:{type:`git`,url:`https://gitlab.cvinternal.net/front-end/clickview`},author:`Matt Trengrove, Cameron Hill, Shale Kuzmanovski`,license:`ISC`,devDependencies:{"@clickview/player-font":`0.0.17`,"@types/chromecast-caf-sender":`1.0.3`,"@types/cropperjs":`1.3.0`,"@types/draft-js":`0.10.44`,"@types/node-polyglot":`0.4.34`,"@types/react-draft-wysiwyg":`1.13.1`,"@types/signalr-no-jquery":`0.1.3`,"@types/simplebar":`5.1.1`,"@types/video.js":`7.3.58`,jest:`29.6.4`,"ts-jest":`29.1.1`,"vite-plugin-mkcert":`1.17.12`},dependencies:{"@microsoft/signalr":`5.0.2`,"@types/react-canvas-draw":`1.2.1`,cropperjs:`1.5.6`,"draft-convert":`2.1.10`,"draft-js":`0.11.7`,keycode:`2.2.0`,"node-polyglot":`2.3.0`,"react-canvas-draw":`1.2.1`,"react-draft-wysiwyg":`1.15.0`,"react-textarea-autosize":`8.3.2`,"signalr-no-jquery":`0.2.0`,simplebar:`5.3.0`,"simplebar-react":`2.3.0`,"video.js":`8.20.0`,"videojs-contrib-quality-levels":`2.0.9`}},bg=t(((e,t)=>{t.exports=n;function n(e,t){var n,r=null;try{n=JSON.parse(e,t)}catch(e){r=e}return[r,n]}})),xg=t(((e,t)=>{var n=ke(),r=function(e,t){return t===void 0&&(t=!1),function(r,a,o){if(r){e(r);return}if(a.statusCode>=400&&a.statusCode<=599){var s=o;if(t)if(n.TextDecoder){var c=i(a.headers&&a.headers[`content-type`]);try{s=new TextDecoder(c).decode(o)}catch{}}else s=String.fromCharCode.apply(null,new Uint8Array(o));e({cause:s});return}e(null,o)}};function i(e){return e===void 0&&(e=``),e.toLowerCase().split(`;`).reduce(function(e,t){var n=t.split(`=`),r=n[0],i=n[1];return r.trim()===`charset`?i.trim():e},`utf-8`)}t.exports=r})),Sg=t(((e,t)=>{var n=ke(),r=M(),i=I();l.httpHandler=xg();var a=function(e){var t={};return e&&e.trim().split(`
|
|
225
|
+
`,Qh=class extends Yh{constructor(e,t){super(e,t)}createEl(){let e=Xh.prototype.createEl.call(this,`button`,{className:this.buildCSSClass()},{type:`button`,title:this.controlText_});return e.innerHTML=Zh,this.createControlTextEl(e),e}handleClick(e){e.stopPropagation(),e.preventDefault(),this.options_?.onClick&&this.options_.onClick()}buildCSSClass(){return`cv-remove-video-button`}};K.registerComponent(`removeVideoButton`,Qh),Qh.prototype.controlText_=`Remove from watch history`;var $h=`cvplayer-playback-quality:v2`,eg=`cvplayer-localcache-playback-quality:v2`,tg=class{static isQualityUserPreference(){let e=localStorage.getItem($h),t=localStorage.getItem(eg);return!!(e||t)}static getPlayerMode(e){let t=e.isFullscreen?.()??!1,n=e.usingPlugin?.(`playerModePlugin`)?e.playerModePlugin()?.isHovering?.()??!1:!1,r=e.usingPlugin?.(`theatreModePlugin`)?e.theatreModePlugin()?.getTheatreMode?.()??!1:!1;return t?`fullscreen`:n?`hover`:r?`theatre`:`default`}static findQualityLevel(e,t){for(let n=0;n<e.length;n++)if(e[n].quality<=t)return e[n];let n=e[e.length-1];if(!n)throw Error(`No quality levels available`);return n}static enableQualityLevel(e,t){for(let n=0;n<e.length;n++){let r=e[n];r.enabled=r.id===t}}},ng=function(e){return e.Default=`play`,e.Hover=`hover`,e}({}),rg=K.getPlugin(`plugin`),ig=`cv-preview-mode`,ag=`cv-force-16-9`,og=class extends rg{constructor(e,t){super(e),this.hasSeeked=!1,this.buttonAdded=!1,this.mode=null,this.defaultDisplayMode=`normal`,this.onQualityReady=null,t?.defaultDisplayMode&&(this.defaultDisplayMode=t.defaultDisplayMode),t?.startTime&&(this.startTime=t.startTime),this.onSeek=this.onSeek.bind(this),this.player.one(`seeking`,this.onSeek)}onSeek(){this.hasSeeked=!0}dispose(){this.cleanupQualityListener(),this.player.off(`seeking`,this.onSeek),super.dispose()}getMode(){return this.mode}isHovering(){return this.mode===`hover`}setPlayerMode(e,t,n){this.player.trigger(`flushprogress`);let r=this.mode;if(this.mode=e,e===`hover`){this.buttonAdded||this.addButtons(t,n),this.player.addClass(ig),this.applyAspectRatioFix(),this.enableSubtitles(),this.mute(),this.setLowQuality(),this.removeActivityTimeout(),this.player.trigger(`resize`);return}r===`hover`&&(this.applyDefaultModeLayout(),this.player.removeClass(ig),this.player.removeClass(ag),this.disableSubtitles(),this.unmute(),this.cleanupQualityListener(),this.restorePreviousQuality(),this.restoreActivityTimeout(),this.player.trigger(`resize`),this.hasSeeked||=(this.player.currentTime(this.startTime??0),!1))}applyDefaultModeLayout(){let e=this.player.usingPlugin?.(`theatreModePlugin`);this.defaultDisplayMode===`theatre`?(e&&this.player.theatreModePlugin()?.toggleTheatreMode(!0),this.player.fill(!0)):(e&&this.player.theatreModePlugin()?.toggleTheatreMode(!1),this.player.fluid(!0))}applyAspectRatioFix(){let e=()=>{let e=this.player.videoWidth(),t=this.player.videoHeight();if(e>0&&t>0){let n=e/t;Math.abs(n-16/9)<.01||this.player.addClass(ag)}};this.player.readyState()>=1?e():this.player.one(`loadedmetadata`,e)}addButtons(e,t){let n=new Kh(this.player),r=new Jh(this.player,{onClickHandler:e}),i=new Qh(this.player,{onClick:t});t&&ce.isFunction(t)&&this.player.addChild(i),this.player.addChild(n),this.player.addChild(r),this.buttonAdded=!0}enableSubtitles(){this.player.dataLoaded(()=>this.player.persistSubtitleSettingsPlugin().previewModeSubtitles())}disableSubtitles(){this.player.dataLoaded(()=>this.player.persistSubtitleSettingsPlugin().applyUserPreferences())}mute(){this.player.ready(()=>{this.player.persistVolumePlugin().disable(),this.player.muted(!0)})}unmute(){this.player.ready(()=>{this.player.persistVolumePlugin().applyUserPreferences(),this.player.persistVolumePlugin().enable()})}setLowQuality(){this.player.dataLoaded(()=>{this.player.persistQualitySettingsPlugin().disable();let e=this.player.qualityLevels();if(e.length>0){this.switchToLowestQuality(e);return}this.cleanupQualityListener(),this.onQualityReady=()=>{this.onQualityReady=null,this.switchToLowestQuality(e)},e.one(`change`,this.onQualityReady)})}cleanupQualityListener(){this.onQualityReady&&=(this.player.qualityLevels().off(`change`,this.onQualityReady),null)}switchToLowestQuality(e){let t=e[e.length-1];t&&tg.enableQualityLevel(e,t.id)}restorePreviousQuality(){this.player.dataLoaded(()=>{this.player.persistQualitySettingsPlugin().applyUserPreferences(),this.player.persistQualitySettingsPlugin().enable()})}removeActivityTimeout(){this.player.cache_.inactivityTimeout=this.player.options_.inactivityTimeout,this.player.options_.inactivityTimeout=0}restoreActivityTimeout(){this.player.options_.inactivityTimeout=this.player.cache_.inactivityTimeout}};K.registerPlugin(`playerModePlugin`,og);var sg=1e3*60*60*8,cg=class{constructor(e){this.options=e,this.initialize()}logStream(){let e=`v:${this.options.videoId}`,t=this.getPlayerMetrics();te.cacheExists(e)||(this.collectionApiClient.log({type:k.WebPlayerStream,actionContext:this.getActionContext(),data:{...this.getAnalyticsData(),player:t},eventVersion:re.V3}),te&&te.cacheSet(e,null,300))}logVideoProgress(e,t,n){let r=this.getAnalyticsData(),i=this.getPlayerMetrics(),a=n?k.PreviewStreamProgress:k.StreamProgress,o=e.map(e=>({type:a,actionContext:this.getActionContext(),data:{...r,player:i,progress:e},eventVersion:re.V2}));for(let e of t)o.push({type:k.StreamBuffering,actionContext:this.getActionContext(),data:{...r,player:i,buffering:e},eventVersion:re.V2});this.collectionApiClient.log(o)}logUserAction(e,t){let n={...this.getAnalyticsData(),...e},r={...this.getActionContext(),...t};this.collectionApiClient.log({type:t.actionType,data:n,actionContext:r,eventVersion:t.eventVersion||re.V2})}getAnalyticsData(){let e={video:{id:this.options.videoId},flags:{isUsingLocalCache:this.options.isUsingLocalCache,isQualityUserPreference:tg.isQualityUserPreference()},...this.options.additionalAnalyticsData||{}};this.options.shareId&&(e.video.shareId=this.options.shareId);let t=this.getEntityType();return t===O.Interactive?e.interactive={id:+this.options.mediaId}:t===O.Clip&&(e.clip={id:+this.options.mediaId}),e}initialize(){this.setupCollectionApiClient(),A.lockWindowSession(this.options.userId,sg),this.options.player.one(`dispose`,()=>A.unlockWindowSession(this.options.userId))}setupCollectionApiClient(){this.collectionApiClient=new oe({productName:`player.web`,productVersion:this.options.productVersion,regionName:this.options.regionName,collectionApiUrls:this.options.collectionApiUrls,collectionApiClientId:this.options.collectionApiClientId,getUser:()=>this.getCurrentUser(),shouldLog:se.shouldLog,formatData:se.formatData})}async getCurrentUser(){return{id:this.options.userId,customerId:this.options.customerId,sessionId:this.options.authSessionId}}getActionContext(){return{entity:this.getEntityType(),location:this.getLocationContext(),productArea:void 0,descriptor:this.options.isEmbedded?ie.Embedded:void 0,workflowPhase:void 0}}getEntityType(){switch(this.options.mediaType){case`MasterVideo`:return O.Video;case`MasterInteractive`:return O.Interactive;case`MasterClip`:return O.Clip}}getLocationContext(){switch(this.options.playerType){case`player`:return ae.Player;case`interactive-player`:return ae.InteractivePlayer;case`create-clip-player`:return ae.CreateClipPlayer}}getPlayerMetrics(){let e=this.options.player,t=e.qualityLevels?.();return{mode:tg.getPlayerMode(e),width:e.currentWidth(),height:e.currentHeight(),quality:t?.[t?.selectedIndex]?.id}}},q=e(t(((e,t)=>{function n(e){if(e&&typeof e==`object`){var t=e.which||e.keyCode||e.charCode;t&&(e=t)}if(typeof e==`number`)return o[e];var n=String(e),a=r[n.toLowerCase()];if(a)return a;var a=i[n.toLowerCase()];if(a)return a;if(n.length===1)return n.charCodeAt(0)}n.isEventKey=function(e,t){if(e&&typeof e==`object`){var n=e.which||e.keyCode||e.charCode;if(n==null)return!1;if(typeof t==`string`){var a=r[t.toLowerCase()];if(a)return a===n;var a=i[t.toLowerCase()];if(a)return a===n}else if(typeof t==`number`)return t===n;return!1}},e=t.exports=n;var r=e.code=e.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},i=e.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};for(a=97;a<123;a++)r[String.fromCharCode(a)]=a-32;for(var a=48;a<58;a++)r[a-48]=a;for(a=1;a<13;a++)r[`f`+a]=a+111;for(a=0;a<10;a++)r[`numpad `+a]=a+96;var o=e.names=e.title={};for(a in r)o[r[a]]=a;for(var s in i)r[s]=i[s]}))());function lg(e){document[e.fsApi_.fullscreenEnabled]&&(e.isFullscreen()?e.exitFullscreen():e.requestFullscreen())}function ug(e){let t=e.theatreModePlugin().getTheatreMode();e.theatreModePlugin().toggleTheatreMode(!t,{shouldLog:!0})}function dg(e){let t=e.volume(),n=e.lastVolume_();if(t===0){let t=n<.1?.1:n;e.volume(t),e.muted(!1)}else e.muted(!e.muted())}function fg(e){e.paused()?e.play():e.pause()}function pg(e,t){e.currentTime(e.currentTime()+t)}function mg(e,t){t>0&&e.muted()&&e.muted(!1),e.volume(e.volume()+t)}function hg(e){let t=e.target;return t.tagName.toLowerCase()===`video`||!![`video-js`,`vjs-tech`].find(e=>t.classList.contains(e))}var gg={f:lg,m:dg,k:fg,space:fg,t:ug,left:e=>pg(e,-5),right:e=>pg(e,5),j:e=>pg(e,-10),l:e=>pg(e,10),up:e=>mg(e,.05),down:e=>mg(e,-.05)};function _g(e,t,n){if(e.ctrlKey||e.metaKey||e.altKey)return;let r=(0,q.default)(e),i=[`up`,`down`].includes(r);if(i&&!e.shiftKey||!i&&e.shiftKey||r===`t`&&!n.allowTheatreMode||r===`f`&&!n.allowFullscreen||!gg[r])return;gg[r](t,e);let a=hg(e),o=[`space`].includes(r);(a||o)&&(e.preventDefault(),e.stopPropagation())}var vg=function(e){return e.PhysicallyChapteredVideo=`physically-chaptered-video`,e}({}),yg={name:`@clickview/player`,version:`1.54.0-rc.0`,description:`ClickView Player`,main:`dist/player-app.js`,type:`module`,scripts:{"type-check":`tsc --noEmit`,"build-app":`node ../../../node_modules/vite/bin/vite.js build --config vite.config.app.ts`,"build-styles":`node ../../../node_modules/vite/bin/vite.js build --config vite.config.styles.ts`,build:`npm run type-check && npm run build-player && npm run build-interactive-player`,"build-player":`node ../../../node_modules/vite/bin/vite.js build --config vite.player.config.ts`,"build-interactive-player":`node ../../../node_modules/vite/bin/vite.js build --config vite.interactive-player.config.ts`,"build-font":`cross-env NODE_ENV=development npm run start`,test:`jest`,"test-watch":`jest --watch`,"test-harness":`npm run build && node ../../../node_modules/vite/bin/vite.js --config vite.test-harness.config.ts`},repository:{type:`git`,url:`https://gitlab.cvinternal.net/front-end/clickview`},author:`Matt Trengrove, Cameron Hill, Shale Kuzmanovski`,license:`ISC`,devDependencies:{"@clickview/player-font":`0.0.17`,"@types/chromecast-caf-sender":`1.0.3`,"@types/cropperjs":`1.3.0`,"@types/draft-js":`0.10.44`,"@types/node-polyglot":`0.4.34`,"@types/react-draft-wysiwyg":`1.13.1`,"@types/signalr-no-jquery":`0.1.3`,"@types/simplebar":`5.1.1`,"@types/video.js":`7.3.58`,jest:`29.6.4`,"ts-jest":`29.1.1`,"vite-plugin-mkcert":`1.17.12`},dependencies:{"@microsoft/signalr":`5.0.2`,"@types/react-canvas-draw":`1.2.1`,cropperjs:`1.5.6`,"draft-convert":`2.1.10`,"draft-js":`0.11.7`,keycode:`2.2.0`,"node-polyglot":`2.3.0`,"react-canvas-draw":`1.2.1`,"react-draft-wysiwyg":`1.15.0`,"react-textarea-autosize":`8.3.2`,"signalr-no-jquery":`0.2.0`,simplebar:`5.3.0`,"simplebar-react":`2.3.0`,"video.js":`8.20.0`,"videojs-contrib-quality-levels":`2.0.9`}},bg=t(((e,t)=>{t.exports=n;function n(e,t){var n,r=null;try{n=JSON.parse(e,t)}catch(e){r=e}return[r,n]}})),xg=t(((e,t)=>{var n=ke(),r=function(e,t){return t===void 0&&(t=!1),function(r,a,o){if(r){e(r);return}if(a.statusCode>=400&&a.statusCode<=599){var s=o;if(t)if(n.TextDecoder){var c=i(a.headers&&a.headers[`content-type`]);try{s=new TextDecoder(c).decode(o)}catch{}}else s=String.fromCharCode.apply(null,new Uint8Array(o));e({cause:s});return}e(null,o)}};function i(e){return e===void 0&&(e=``),e.toLowerCase().split(`;`).reduce(function(e,t){var n=t.split(`=`),r=n[0],i=n[1];return r.trim()===`charset`?i.trim():e},`utf-8`)}t.exports=r})),Sg=t(((e,t)=>{var n=ke(),r=M(),i=I();l.httpHandler=xg();var a=function(e){var t={};return e&&e.trim().split(`
|
|
226
226
|
`).forEach(function(e){var n=e.indexOf(`:`),r=e.slice(0,n).trim().toLowerCase(),i=e.slice(n+1).trim();t[r]===void 0?t[r]=i:Array.isArray(t[r])?t[r].push(i):t[r]=[t[r],i]}),t};t.exports=l,t.exports.default=l,l.XMLHttpRequest=n.XMLHttpRequest||f,l.XDomainRequest=`withCredentials`in new l.XMLHttpRequest?l.XMLHttpRequest:n.XDomainRequest,o([`get`,`put`,`post`,`patch`,`head`,`delete`],function(e){l[e===`delete`?`del`:e]=function(t,n,r){return n=c(t,n,r),n.method=e.toUpperCase(),u(n)}});function o(e,t){for(var n=0;n<e.length;n++)t(e[n])}function s(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function c(e,t,n){var a=e;return i(t)?(n=t,typeof e==`string`&&(a={uri:e})):a=r({},t,{uri:e}),a.callback=n,a}function l(e,t,n){return t=c(e,t,n),u(t)}function u(e){if(e.callback===void 0)throw Error(`callback argument missing`);var t=!1,n=function(n,r,i){t||(t=!0,e.callback(n,r,i))};function r(){u.readyState===4&&setTimeout(c,0)}function i(){var e=void 0;if(e=u.response?u.response:u.responseText||d(u),y)try{e=JSON.parse(e)}catch{}return e}function o(e){return clearTimeout(b),e instanceof Error||(e=Error(``+(e||`Unknown XMLHttpRequest Error`))),e.statusCode=0,n(e,x)}function c(){if(!p){var t;clearTimeout(b),t=e.useXDR&&u.status===void 0?200:u.status===1223?204:u.status;var r=x,o=null;return t===0?o=Error(`Internal XMLHttpRequest Error`):(r={body:i(),statusCode:t,method:h,headers:{},url:m,rawRequest:u},u.getAllResponseHeaders&&(r.headers=a(u.getAllResponseHeaders()))),n(o,r,r.body)}}var u=e.xhr||null;u||=e.cors||e.useXDR?new l.XDomainRequest:new l.XMLHttpRequest;var f,p,m=u.url=e.uri||e.url,h=u.method=e.method||`GET`,g=e.body||e.data,_=u.headers=e.headers||{},v=!!e.sync,y=!1,b,x={body:void 0,headers:{},statusCode:0,method:h,url:m,rawRequest:u};if(`json`in e&&e.json!==!1&&(y=!0,_.accept||_.Accept||(_.Accept=`application/json`),h!==`GET`&&h!==`HEAD`&&(_[`content-type`]||_[`Content-Type`]||(_[`Content-Type`]=`application/json`),g=JSON.stringify(e.json===!0?g:e.json))),u.onreadystatechange=r,u.onload=c,u.onerror=o,u.onprogress=function(){},u.onabort=function(){p=!0},u.ontimeout=o,u.open(h,m,!v,e.username,e.password),v||(u.withCredentials=!!e.withCredentials),!v&&e.timeout>0&&(b=setTimeout(function(){if(!p){p=!0,u.abort(`timeout`);var e=Error(`XMLHttpRequest timeout`);e.code=`ETIMEDOUT`,o(e)}},e.timeout)),u.setRequestHeader)for(f in _)_.hasOwnProperty(f)&&u.setRequestHeader(f,_[f]);else if(e.headers&&!s(e.headers))throw Error(`Headers cannot be set on an XDomainRequest object`);return`responseType`in e&&(u.responseType=e.responseType),`beforeSend`in e&&typeof e.beforeSend==`function`&&e.beforeSend(u),u.send(g||null),u}function d(e){try{if(e.responseType===`document`)return e.responseXML;var t=e.responseXML&&e.responseXML.documentElement.nodeName===`parsererror`;if(e.responseType===``&&!t)return e.responseXML}catch{}return null}function f(){}})),Cg=e(bg()),wg=e(Sg());function Tg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Tg=function(){return!!e})()}function Eg(e,t,n){if(Tg())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&T(i,n.prototype),i}function Dg(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&T(e,t)}var Og=e(t(((e,t)=>{(function(n){var r=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,a=/(?:\/|^)\.(?=\/)/g,o=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,s={buildAbsoluteURL:function(e,t,n){if(n||={},e=e.trim(),t=t.trim(),!t){if(!n.alwaysNormalize)return e;var r=s.parseURL(e);if(!r)throw Error(`Error trying to parse base URL.`);return r.path=s.normalizePath(r.path),s.buildURLFromParts(r)}var a=s.parseURL(t);if(!a)throw Error(`Error trying to parse relative URL.`);if(a.scheme)return n.alwaysNormalize?(a.path=s.normalizePath(a.path),s.buildURLFromParts(a)):t;var o=s.parseURL(e);if(!o)throw Error(`Error trying to parse base URL.`);if(!o.netLoc&&o.path&&o.path[0]!==`/`){var c=i.exec(o.path);o.netLoc=c[1],o.path=c[2]}o.netLoc&&!o.path&&(o.path=`/`);var l={scheme:o.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(l.netLoc=o.netLoc,a.path[0]!==`/`))if(!a.path)l.path=o.path,a.params||(l.params=o.params,a.query||(l.query=o.query));else{var u=o.path,d=u.substring(0,u.lastIndexOf(`/`)+1)+a.path;l.path=s.normalizePath(d)}return l.path===null&&(l.path=n.alwaysNormalize?s.normalizePath(a.path):a.path),s.buildURLFromParts(l)},parseURL:function(e){var t=r.exec(e);return t?{scheme:t[1]||``,netLoc:t[2]||``,path:t[3]||``,params:t[4]||``,query:t[5]||``,fragment:t[6]||``}:null},normalizePath:function(e){for(e=e.split(``).reverse().join(``).replace(a,``);e.length!==(e=e.replace(o,``)).length;);return e.split(``).reverse().join(``)},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};typeof e==`object`&&typeof t==`object`?t.exports=s:typeof define==`function`&&define.amd?define([],function(){return s}):typeof e==`object`?e.URLToolkit=s:n.URLToolkit=s})(e)}))()),kg=`http://example.com`,Ag=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=R.default.location&&R.default.location.href||``);var n=typeof R.default.URL==`function`,r=/^\/\//.test(e),i=!R.default.location&&!/\/\//i.test(e);if(n?e=new R.default.URL(e,R.default.location||kg):/\/\//i.test(e)||(e=Og.default.buildAbsoluteURL(R.default.location&&R.default.location.href||``,e)),n){var a=new URL(t,e);return i?a.href.slice(kg.length):r?a.href.slice(a.protocol.length):a.href}return Og.default.buildAbsoluteURL(e,t)},jg=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var n=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(n,1),n>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(arguments.length===2)for(var n=t.length,r=0;r<n;++r)t[r].call(this,arguments[1]);else for(var i=Array.prototype.slice.call(arguments,1),a=t.length,o=0;o<a;++o)t[o].apply(this,i)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on(`data`,function(t){e.push(t)})},e}(),Mg=function(e){return R.default.atob?R.default.atob(e):Buffer.from(e,`base64`).toString(`binary`)};function Ng(e){for(var t=Mg(e),n=new Uint8Array(t.length),r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}var Pg=function(e){w(t,e);function t(){var t=e.call(this)||this;return t.buffer=``,t}var n=t.prototype;return n.push=function(e){var t;for(this.buffer+=e,t=this.buffer.indexOf(`
|
|
227
227
|
`);t>-1;t=this.buffer.indexOf(`
|
|
228
228
|
`))this.trigger(`data`,this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)},t}(jg),Fg=` `,Ig=function(e){var t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||``),n={};return t[1]&&(n.length=parseInt(t[1],10)),t[2]&&(n.offset=parseInt(t[2],10)),n},Lg=function(){return RegExp(`(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))`)},Rg=function(e){for(var t=e.split(Lg()),n={},r=t.length,i;r--;)t[r]!==``&&(i=/([^=]*)=(.*)/.exec(t[r]).slice(1),i[0]=i[0].replace(/^\s+|\s+$/g,``),i[1]=i[1].replace(/^\s+|\s+$/g,``),i[1]=i[1].replace(/^['"](.*)['"]$/g,`$1`),n[i[0]]=i[1]);return n},zg=function(e){w(t,e);function t(){var t=e.call(this)||this;return t.customParsers=[],t.tagMappers=[],t}var n=t.prototype;return n.push=function(e){var t=this,n,r;if(e=e.trim(),e.length!==0){if(e[0]!==`#`){this.trigger(`data`,{type:`uri`,uri:e});return}this.tagMappers.reduce(function(t,n){var r=n(e);return r===e?t:t.concat([r])},[e]).forEach(function(e){for(var i=0;i<t.customParsers.length;i++)if(t.customParsers[i].call(t,e))return;if(e.indexOf(`#EXT`)!==0){t.trigger(`data`,{type:`comment`,text:e.slice(1)});return}if(e=e.replace(`\r`,``),n=/^#EXTM3U/.exec(e),n){t.trigger(`data`,{type:`tag`,tagType:`m3u`});return}if(n=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(e),n){r={type:`tag`,tagType:`inf`},n[1]&&(r.duration=parseFloat(n[1])),n[2]&&(r.title=n[2]),t.trigger(`data`,r);return}if(n=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(e),n){r={type:`tag`,tagType:`targetduration`},n[1]&&(r.duration=parseInt(n[1],10)),t.trigger(`data`,r);return}if(n=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(e),n){r={type:`tag`,tagType:`version`},n[1]&&(r.version=parseInt(n[1],10)),t.trigger(`data`,r);return}if(n=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(e),n){r={type:`tag`,tagType:`media-sequence`},n[1]&&(r.number=parseInt(n[1],10)),t.trigger(`data`,r);return}if(n=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(e),n){r={type:`tag`,tagType:`discontinuity-sequence`},n[1]&&(r.number=parseInt(n[1],10)),t.trigger(`data`,r);return}if(n=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(e),n){r={type:`tag`,tagType:`playlist-type`},n[1]&&(r.playlistType=n[1]),t.trigger(`data`,r);return}if(n=/^#EXT-X-BYTERANGE:?(.*)?$/.exec(e),n){r=C(Ig(n[1]),{type:`tag`,tagType:`byterange`}),t.trigger(`data`,r);return}if(n=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(e),n){r={type:`tag`,tagType:`allow-cache`},n[1]&&(r.allowed=!/NO/.test(n[1])),t.trigger(`data`,r);return}if(n=/^#EXT-X-MAP:?(.*)$/.exec(e),n){if(r={type:`tag`,tagType:`map`},n[1]){var a=Rg(n[1]);a.URI&&(r.uri=a.URI),a.BYTERANGE&&(r.byterange=Ig(a.BYTERANGE))}t.trigger(`data`,r);return}if(n=/^#EXT-X-STREAM-INF:?(.*)$/.exec(e),n){if(r={type:`tag`,tagType:`stream-inf`},n[1]){if(r.attributes=Rg(n[1]),r.attributes.RESOLUTION){var o=r.attributes.RESOLUTION.split(`x`),s={};o[0]&&(s.width=parseInt(o[0],10)),o[1]&&(s.height=parseInt(o[1],10)),r.attributes.RESOLUTION=s}r.attributes.BANDWIDTH&&(r.attributes.BANDWIDTH=parseInt(r.attributes.BANDWIDTH,10)),r.attributes[`FRAME-RATE`]&&(r.attributes[`FRAME-RATE`]=parseFloat(r.attributes[`FRAME-RATE`])),r.attributes[`PROGRAM-ID`]&&(r.attributes[`PROGRAM-ID`]=parseInt(r.attributes[`PROGRAM-ID`],10))}t.trigger(`data`,r);return}if(n=/^#EXT-X-MEDIA:?(.*)$/.exec(e),n){r={type:`tag`,tagType:`media`},n[1]&&(r.attributes=Rg(n[1])),t.trigger(`data`,r);return}if(n=/^#EXT-X-ENDLIST/.exec(e),n){t.trigger(`data`,{type:`tag`,tagType:`endlist`});return}if(n=/^#EXT-X-DISCONTINUITY/.exec(e),n){t.trigger(`data`,{type:`tag`,tagType:`discontinuity`});return}if(n=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(e),n){r={type:`tag`,tagType:`program-date-time`},n[1]&&(r.dateTimeString=n[1],r.dateTimeObject=new Date(n[1])),t.trigger(`data`,r);return}if(n=/^#EXT-X-KEY:?(.*)$/.exec(e),n){r={type:`tag`,tagType:`key`},n[1]&&(r.attributes=Rg(n[1]),r.attributes.IV&&(r.attributes.IV.substring(0,2).toLowerCase()===`0x`&&(r.attributes.IV=r.attributes.IV.substring(2)),r.attributes.IV=r.attributes.IV.match(/.{8}/g),r.attributes.IV[0]=parseInt(r.attributes.IV[0],16),r.attributes.IV[1]=parseInt(r.attributes.IV[1],16),r.attributes.IV[2]=parseInt(r.attributes.IV[2],16),r.attributes.IV[3]=parseInt(r.attributes.IV[3],16),r.attributes.IV=new Uint32Array(r.attributes.IV))),t.trigger(`data`,r);return}if(n=/^#EXT-X-START:?(.*)$/.exec(e),n){r={type:`tag`,tagType:`start`},n[1]&&(r.attributes=Rg(n[1]),r.attributes[`TIME-OFFSET`]=parseFloat(r.attributes[`TIME-OFFSET`]),r.attributes.PRECISE=/YES/.test(r.attributes.PRECISE)),t.trigger(`data`,r);return}if(n=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(e),n){r={type:`tag`,tagType:`cue-out-cont`},n[1]?r.data=n[1]:r.data=``,t.trigger(`data`,r);return}if(n=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(e),n){r={type:`tag`,tagType:`cue-out`},n[1]?r.data=n[1]:r.data=``,t.trigger(`data`,r);return}if(n=/^#EXT-X-CUE-IN:?(.*)?$/.exec(e),n){r={type:`tag`,tagType:`cue-in`},n[1]?r.data=n[1]:r.data=``,t.trigger(`data`,r);return}if(n=/^#EXT-X-SKIP:(.*)$/.exec(e),n&&n[1]){r={type:`tag`,tagType:`skip`},r.attributes=Rg(n[1]),r.attributes.hasOwnProperty(`SKIPPED-SEGMENTS`)&&(r.attributes[`SKIPPED-SEGMENTS`]=parseInt(r.attributes[`SKIPPED-SEGMENTS`],10)),r.attributes.hasOwnProperty(`RECENTLY-REMOVED-DATERANGES`)&&(r.attributes[`RECENTLY-REMOVED-DATERANGES`]=r.attributes[`RECENTLY-REMOVED-DATERANGES`].split(Fg)),t.trigger(`data`,r);return}if(n=/^#EXT-X-PART:(.*)$/.exec(e),n&&n[1]){r={type:`tag`,tagType:`part`},r.attributes=Rg(n[1]),[`DURATION`].forEach(function(e){r.attributes.hasOwnProperty(e)&&(r.attributes[e]=parseFloat(r.attributes[e]))}),[`INDEPENDENT`,`GAP`].forEach(function(e){r.attributes.hasOwnProperty(e)&&(r.attributes[e]=/YES/.test(r.attributes[e]))}),r.attributes.hasOwnProperty(`BYTERANGE`)&&(r.attributes.byterange=Ig(r.attributes.BYTERANGE)),t.trigger(`data`,r);return}if(n=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(e),n&&n[1]){r={type:`tag`,tagType:`server-control`},r.attributes=Rg(n[1]),[`CAN-SKIP-UNTIL`,`PART-HOLD-BACK`,`HOLD-BACK`].forEach(function(e){r.attributes.hasOwnProperty(e)&&(r.attributes[e]=parseFloat(r.attributes[e]))}),[`CAN-SKIP-DATERANGES`,`CAN-BLOCK-RELOAD`].forEach(function(e){r.attributes.hasOwnProperty(e)&&(r.attributes[e]=/YES/.test(r.attributes[e]))}),t.trigger(`data`,r);return}if(n=/^#EXT-X-PART-INF:(.*)$/.exec(e),n&&n[1]){r={type:`tag`,tagType:`part-inf`},r.attributes=Rg(n[1]),[`PART-TARGET`].forEach(function(e){r.attributes.hasOwnProperty(e)&&(r.attributes[e]=parseFloat(r.attributes[e]))}),t.trigger(`data`,r);return}if(n=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(e),n&&n[1]){r={type:`tag`,tagType:`preload-hint`},r.attributes=Rg(n[1]),[`BYTERANGE-START`,`BYTERANGE-LENGTH`].forEach(function(e){if(r.attributes.hasOwnProperty(e)){r.attributes[e]=parseInt(r.attributes[e],10);var t=e===`BYTERANGE-LENGTH`?`length`:`offset`;r.attributes.byterange=r.attributes.byterange||{},r.attributes.byterange[t]=r.attributes[e],delete r.attributes[e]}}),t.trigger(`data`,r);return}if(n=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(e),n&&n[1]){r={type:`tag`,tagType:`rendition-report`},r.attributes=Rg(n[1]),[`LAST-MSN`,`LAST-PART`].forEach(function(e){r.attributes.hasOwnProperty(e)&&(r.attributes[e]=parseInt(r.attributes[e],10))}),t.trigger(`data`,r);return}t.trigger(`data`,{type:`tag`,data:e.slice(4)})})}},n.addParser=function(e){var t=this,n=e.expression,r=e.customType,i=e.dataParser,a=e.segment;typeof i!=`function`&&(i=function(e){return e}),this.customParsers.push(function(e){if(n.exec(e))return t.trigger(`data`,{type:`custom`,data:i(e),customType:r,segment:a}),!0})},n.addTagMapper=function(e){var t=e.expression,n=e.map;this.tagMappers.push(function(e){return t.test(e)?n(e):e})},t}(jg),Bg=function(e){return e.toLowerCase().replace(/-(\w)/g,function(e){return e[1].toUpperCase()})},Vg=function(e){var t={};return Object.keys(e).forEach(function(n){t[Bg(n)]=e[n]}),t},Hg=function(e){var t=e.serverControl,n=e.targetDuration,r=e.partTargetDuration;if(t){var i=`#EXT-X-SERVER-CONTROL`,a=`holdBack`,o=`partHoldBack`,s=n&&n*3,c=r&&r*2;n&&!t.hasOwnProperty(a)&&(t[a]=s,this.trigger(`info`,{message:i+` defaulting HOLD-BACK to targetDuration * 3 (`+s+`).`})),s&&t[a]<s&&(this.trigger(`warn`,{message:i+` clamping HOLD-BACK (`+t[a]+`) to targetDuration * 3 (`+s+`)`}),t[a]=s),r&&!t.hasOwnProperty(o)&&(t[o]=r*3,this.trigger(`info`,{message:i+` defaulting PART-HOLD-BACK to partTargetDuration * 3 (`+t[o]+`).`})),r&&t[o]<c&&(this.trigger(`warn`,{message:i+` clamping PART-HOLD-BACK (`+t[o]+`) to partTargetDuration * 2 (`+c+`).`}),t[o]=c)}},Ug=function(e){w(t,e);function t(){var t=e.call(this)||this;t.lineStream=new Pg,t.parseStream=new zg,t.lineStream.pipe(t.parseStream);var n=_(t),r=[],i={},a,o,s=!1,c=function(){},l={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},u=`urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed`,d=0;t.manifest={allowCache:!0,discontinuityStarts:[],segments:[]};var f=0,p=0;return t.on(`end`,function(){i.uri||!i.parts&&!i.preloadHints||(!i.map&&a&&(i.map=a),!i.key&&o&&(i.key=o),!i.timeline&&typeof d==`number`&&(i.timeline=d),t.manifest.preloadSegment=i)}),t.parseStream.on(`data`,function(e){var t,m;({tag:function(){({version:function(){e.version&&(this.manifest.version=e.version)},"allow-cache":function(){this.manifest.allowCache=e.allowed,`allowed`in e||(this.trigger(`info`,{message:`defaulting allowCache to YES`}),this.manifest.allowCache=!0)},byterange:function(){var t={};`length`in e&&(i.byterange=t,t.length=e.length,`offset`in e||(e.offset=f)),`offset`in e&&(i.byterange=t,t.offset=e.offset),f=t.offset+t.length},endlist:function(){this.manifest.endList=!0},inf:function(){`mediaSequence`in this.manifest||(this.manifest.mediaSequence=0,this.trigger(`info`,{message:`defaulting media sequence to zero`})),`discontinuitySequence`in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger(`info`,{message:`defaulting discontinuity sequence to zero`})),e.duration>0&&(i.duration=e.duration),e.duration===0&&(i.duration=.01,this.trigger(`info`,{message:`updating zero segment duration to a small value`})),this.manifest.segments=r},key:function(){if(!e.attributes){this.trigger(`warn`,{message:`ignoring key declaration without attribute list`});return}if(e.attributes.METHOD===`NONE`){o=null;return}if(!e.attributes.URI){this.trigger(`warn`,{message:`ignoring key declaration without URI`});return}if(e.attributes.KEYFORMAT===`com.apple.streamingkeydelivery`){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection[`com.apple.fps.1_0`]={attributes:e.attributes};return}if(e.attributes.KEYFORMAT===`com.microsoft.playready`){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection[`com.microsoft.playready`]={uri:e.attributes.URI};return}if(e.attributes.KEYFORMAT===u){if([`SAMPLE-AES`,`SAMPLE-AES-CTR`,`SAMPLE-AES-CENC`].indexOf(e.attributes.METHOD)===-1){this.trigger(`warn`,{message:`invalid key method provided for Widevine`});return}if(e.attributes.METHOD===`SAMPLE-AES-CENC`&&this.trigger(`warn`,{message:`SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead`}),e.attributes.URI.substring(0,23)!==`data:text/plain;base64,`){this.trigger(`warn`,{message:`invalid key URI provided for Widevine`});return}if(!(e.attributes.KEYID&&e.attributes.KEYID.substring(0,2)===`0x`)){this.trigger(`warn`,{message:`invalid key ID provided for Widevine`});return}this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection[`com.widevine.alpha`]={attributes:{schemeIdUri:e.attributes.KEYFORMAT,keyId:e.attributes.KEYID.substring(2)},pssh:Ng(e.attributes.URI.split(`,`)[1])};return}e.attributes.METHOD||this.trigger(`warn`,{message:`defaulting key method to AES-128`}),o={method:e.attributes.METHOD||`AES-128`,uri:e.attributes.URI},e.attributes.IV!==void 0&&(o.iv=e.attributes.IV)},"media-sequence":function(){if(!isFinite(e.number)){this.trigger(`warn`,{message:`ignoring invalid media sequence: `+e.number});return}this.manifest.mediaSequence=e.number},"discontinuity-sequence":function(){if(!isFinite(e.number)){this.trigger(`warn`,{message:`ignoring invalid discontinuity sequence: `+e.number});return}this.manifest.discontinuitySequence=e.number,d=e.number},"playlist-type":function(){if(!/VOD|EVENT/.test(e.playlistType)){this.trigger(`warn`,{message:`ignoring unknown playlist type: `+e.playlist});return}this.manifest.playlistType=e.playlistType},map:function(){a={},e.uri&&(a.uri=e.uri),e.byterange&&(a.byterange=e.byterange),o&&(a.key=o)},"stream-inf":function(){if(this.manifest.playlists=r,this.manifest.mediaGroups=this.manifest.mediaGroups||l,!e.attributes){this.trigger(`warn`,{message:`ignoring empty stream-inf attributes`});return}i.attributes||={},C(i.attributes,e.attributes)},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||l,!(e.attributes&&e.attributes.TYPE&&e.attributes[`GROUP-ID`]&&e.attributes.NAME)){this.trigger(`warn`,{message:`ignoring incomplete or missing media group`});return}var n=this.manifest.mediaGroups[e.attributes.TYPE];n[e.attributes[`GROUP-ID`]]=n[e.attributes[`GROUP-ID`]]||{},t=n[e.attributes[`GROUP-ID`]],m={default:/yes/i.test(e.attributes.DEFAULT)},m.default?m.autoselect=!0:m.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(m.language=e.attributes.LANGUAGE),e.attributes.URI&&(m.uri=e.attributes.URI),e.attributes[`INSTREAM-ID`]&&(m.instreamId=e.attributes[`INSTREAM-ID`]),e.attributes.CHARACTERISTICS&&(m.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(m.forced=/yes/i.test(e.attributes.FORCED)),t[e.attributes.NAME]=m},discontinuity:function(){d+=1,i.discontinuity=!0,this.manifest.discontinuityStarts.push(r.length)},"program-date-time":function(){this.manifest.dateTimeString===void 0&&(this.manifest.dateTimeString=e.dateTimeString,this.manifest.dateTimeObject=e.dateTimeObject),i.dateTimeString=e.dateTimeString,i.dateTimeObject=e.dateTimeObject},targetduration:function(){if(!isFinite(e.duration)||e.duration<0){this.trigger(`warn`,{message:`ignoring invalid target duration: `+e.duration});return}this.manifest.targetDuration=e.duration,Hg.call(this,this.manifest)},start:function(){if(!e.attributes||isNaN(e.attributes[`TIME-OFFSET`])){this.trigger(`warn`,{message:`ignoring start declaration without appropriate attribute list`});return}this.manifest.start={timeOffset:e.attributes[`TIME-OFFSET`],precise:e.attributes.PRECISE}},"cue-out":function(){i.cueOut=e.data},"cue-out-cont":function(){i.cueOutCont=e.data},"cue-in":function(){i.cueIn=e.data},skip:function(){this.manifest.skip=Vg(e.attributes),this.warnOnMissingAttributes_(`#EXT-X-SKIP`,e.attributes,[`SKIPPED-SEGMENTS`])},part:function(){var t=this;s=!0;var n=this.manifest.segments.length,r=Vg(e.attributes);i.parts=i.parts||[],i.parts.push(r),r.byterange&&(r.byterange.hasOwnProperty(`offset`)||(r.byterange.offset=p),p=r.byterange.offset+r.byterange.length);var a=i.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #`+a+` for segment #`+n,e.attributes,[`URI`,`DURATION`]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach(function(e,n){e.hasOwnProperty(`lastPart`)||t.trigger(`warn`,{message:`#EXT-X-RENDITION-REPORT #`+n+` lacks required attribute(s): LAST-PART`})})},"server-control":function(){var t=this.manifest.serverControl=Vg(e.attributes);t.hasOwnProperty(`canBlockReload`)||(t.canBlockReload=!1,this.trigger(`info`,{message:`#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false`})),Hg.call(this,this.manifest),t.canSkipDateranges&&!t.hasOwnProperty(`canSkipUntil`)&&this.trigger(`warn`,{message:`#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set`})},"preload-hint":function(){var t=this.manifest.segments.length,n=Vg(e.attributes),r=n.type&&n.type===`PART`;i.preloadHints=i.preloadHints||[],i.preloadHints.push(n),n.byterange&&(n.byterange.hasOwnProperty(`offset`)||(n.byterange.offset=r?p:0,r&&(p=n.byterange.offset+n.byterange.length)));var a=i.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #`+a+` for segment #`+t,e.attributes,[`TYPE`,`URI`]),n.type)for(var o=0;o<i.preloadHints.length-1;o++){var s=i.preloadHints[o];s.type&&s.type===n.type&&this.trigger(`warn`,{message:`#EXT-X-PRELOAD-HINT #`+a+` for segment #`+t+` has the same TYPE `+n.type+` as preload hint #`+o})}},"rendition-report":function(){var t=Vg(e.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(t);var n=this.manifest.renditionReports.length-1,r=[`LAST-MSN`,`URI`];s&&r.push(`LAST-PART`),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #`+n,e.attributes,r)},"part-inf":function(){this.manifest.partInf=Vg(e.attributes),this.warnOnMissingAttributes_(`#EXT-X-PART-INF`,e.attributes,[`PART-TARGET`]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),Hg.call(this,this.manifest)}}[e.tagType]||c).call(n)},uri:function(){i.uri=e.uri,r.push(i),this.manifest.targetDuration&&!(`duration`in i)&&(this.trigger(`warn`,{message:`defaulting segment duration to the target duration`}),i.duration=this.manifest.targetDuration),o&&(i.key=o),i.timeline=d,a&&(i.map=a),p=0,i={}},comment:function(){},custom:function(){e.segment?(i.custom=i.custom||{},i.custom[e.customType]=e.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[e.customType]=e.data)}})[e.type].call(n)}),t}var n=t.prototype;return n.warnOnMissingAttributes_=function(e,t,n){var r=[];n.forEach(function(e){t.hasOwnProperty(e)||r.push(e)}),r.length&&this.trigger(`warn`,{message:e+` lacks required attribute(s): `+r.join(`, `)})},n.push=function(e){this.lineStream.push(e)},n.end=function(){this.lineStream.push(`
|
|
@@ -292,4 +292,4 @@ browserWorkerPolyFill(self);
|
|
|
292
292
|
<path d="M268.06 2.91764L254.192 14.8403L262.401 17.4661L258.324 27.0679L272.192 15.1453L263.983 12.5194L268.06 2.91764Z" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
|
|
293
293
|
</svg>
|
|
294
294
|
`})}};K.registerComponent(`ErrorDisplay`,fP);var pP=K.getComponent(`FullscreenToggle`),mP=`Fullscreen (f)`,hP=class extends pP{handleFullscreenChange(){pP.prototype.handleFullscreenChange.call(this),this.controlText(mP)}};K.registerComponent(`FullscreenToggle`,hP),hP.prototype.controlText_=mP;var gP=K.getComponent(`MuteToggle`),_P=`Mute (m)`,vP=`Unmute (m)`,yP=class extends gP{updateControlText_(){let e=this.player_.muted()||this.player_.volume()===0?vP:_P;this.controlText_!==e&&this.controlText(e)}};K.registerComponent(`MuteToggle`,yP),yP.prototype.controlText_=_P;var bP=K.getComponent(`Player`),xP=e=>e.indexOf(`#`)===0?e.slice(1):e,SP=3,CP,wP=class e{static{this.options_={viewKey:null,controls:!0,playbackRates:[.25,.5,.75,1,1.25,1.5,1.75,2],playerApi:new URL(`http://localhost:52000`),enableLocalCache:!0,eventLogging:!0,allowFullscreen:!0}}constructor(t,n){if(this.streamLogged=!1,this.options=K.obj.merge({},e.options_,n),this.options.playerApi===null)throw Error(`PlayerApi required`);this.initialize(),this.createEl(t),this.buildVideoJs(),this.options.splash&&this.setupSplash(this.options.splash),this.bindEventListeners(),this.setupSeekBar(),this.fetchConfig(),this.logStream=this.logStream.bind(this),this.player.ready(()=>{this._configurePlugins(),this.options.setup&&this.options.setup(this.options,this.player),this.fetch().catch(e=>this.handleFetchError(e))})}initialize(){}_configurePlugins(){this.player.configureMenuDimensionsPlugin({mobile:this.options.mobile,overflowControls:this.options.overflowControls,seekBarName:this.getSeekBarName()}),this.player.progressReporterPlugin({onFlush:this.onFlushProgress=this.onFlushProgress.bind(this)}),this.player.persistVolumePlugin(),!this.options.mobile&&this.options.allowFullscreen&&this.player.fullscreenOnRotatePlugin(),this.player.touchControls(),this.player.playerModePlugin({defaultDisplayMode:this.options.nextDefaultDisplayMode,startTime:this.options.startTime}),this.options.getExternalLink&&this.player.openExternallyPlugin({getExternalLink:this.options.getExternalLink}),this.player.oldVersionRefreshPlugin?.(),this.configurePlugins()}configurePlugins(){}onFlushProgress(e,t){let n=this.player.playerModePlugin().isHovering();this.analyticsService?.logVideoProgress(e,t,n)}buildVideoJs(){return this.player=K(this.el,this.getPlayerOptions())}getInactivityTimeout(){if(typeof this.options.inactivityTimeout==`number`)return this.options.inactivityTimeout;let e=500;return(this.options.mobile||K.browser.IS_IOS||K.browser.IS_ANDROID)&&(e=3e3),e}getFluid(){return!(this.options.theatreMode||this.options.embed||this.options.mobile)}getFill(){return!!(this.options.theatreMode||this.options.embed||this.options.mobile)}getPlayerOptions(){let e=bP.prototype.options_.children;return e=e.filter(e=>!(e===`bigPlayButton`||e===`posterImage`)),{controls:this.options.controls,fluid:this.getFluid(),fill:this.getFill(),inactivityTimeout:this.getInactivityTimeout(),controlBar:{children:[`timeWrapper`,`progressControl`]},children:[...e,{name:`collapserator`,children:Uh.filter(e=>!(e===`fullscreenToggle`&&!this.options.allowFullscreen||e===`playbackRateMenuButton`&&!this.options.playbackRates?.length))},`playPauseFeedback`,`controlBarGradient`],userActions:{hotkeys:e=>_g(e,this.player,this.options)},playbackRates:this.options.playbackRates,techOrder:[`html5`],html5:{nativeTextTracks:!1},playsinline:!0,aspectRatio:this.options.aspectRatio,mobile:this.options.mobile,allowTheatreMode:this.options.allowTheatreMode,deferMenus:this.options.deferMenus,muted:this.options.muted,devicesConfig:this.options.devicesConfig}}async getPlaybackObject(){if(this.options.offlinePlaybackObject)return this.options.offlinePlaybackObject;let e=this.options.fetch;if(this.options.fetch===void 0&&(e=e=>{let t=`${this.options.playerApi.origin}/api/playback?viewKey=${e}`;return Ve.get(t)}),!this.options.viewKey)throw Error(`Please specify a viewKey or a fetch function`);let t=await e(this.options.viewKey);if(!t)throw Error(`Error fetching playback object`);return t}setChaptersInternal(e,t){let n=wh.getTrack(this.player,`chapters`,null);n||=this.player.addTextTrack(`chapters`),[...n.cues.cues_].forEach(e=>n.removeCue(e)),e.forEach(e=>{n.addCue({startTime:e.timestamp,endTime:e.endTimestamp,text:e.name})}),t&&n.trigger({type:`cv:cuechange`,target:n}),n.trigger({type:`loadeddata`,target:n})}setChapters(e){this.setChaptersInternal(e,!0)}setPlayerMode(e,t,n){this.player.playerModePlugin().setPlayerMode(e,t,n)}getPlayerMode(){return this.player.playerModePlugin().getMode()}setFavourite(e,t){this.player.favouritePlugin().setFavourite(e,t)}async fetch(){let e=await this.getPlaybackObject();if(this.isDisposed())return;let t=e.mediaType===`MasterClip`,n=e.additionalData?.clipData;e.chapters?.list?.length>0&&!t&&!n&&this.setChaptersInternal(e.chapters.list,!1),this.player.localCache({localCacheAddresses:e.localCacheAddresses??[],enabled:this.options.enableLocalCache??!0}),this.player.progressiveFiles({sources:e.files.progressive.map(e=>({id:e.profile,mimeType:e.mimeType,url:e.url,quality:e.quality,label:e.label}))}),this.player.handleNetworkErrors({playerApi:this.options.playerApi,fileToken:e.files.fileToken}),e.subtitles.list.length>0&&e.subtitles.list.forEach(e=>{if(e.mimeType!==`text/vtt`)return;let t=this.player.addRemoteTextTrack({kind:`subtitles`,src:e.url,language:e.language,label:e.label},!0);if(wh.sanitizeTrack(t.track,this.player),this.options.allowTranscript){let t=this.player.addRemoteTextTrack({kind:`metadata`,src:e.url+(e.url.includes(`?`)?`&`:`?`)+`fullSentences=true`,language:e.language,label:`transcript`},!0);t.track.isClickViewProduced=e.isClickViewProduced,wh.sanitizeTrack(t.track,this.player)}}),e.posterUrl&&this.player.poster(fe.createUrl(e.posterUrl,{size:de.Large})),this.setupSplash({title:e.title,posterUrl:e.posterUrl,episodeNumber:e.episodeNumber,ratingCode:e.ratingCode,seasonNumber:e.seasonNumber,seriesName:e.seriesName}),this.additionalSetup(e),this.handleAutoplay(e),this.options.startTime&&(this.player.currentTime(this.options.startTime),this.player.one(`canplay`,()=>{this.player.currentTime(this.options.startTime)})),this.player.trigger(`cv-playback-data-loaded`,e)}handleFetchError(e){let t=e.message;e instanceof Be&&e.response?.type===vg.PhysicallyChapteredVideo&&(t=`Video cannot be played because it is either corrupt or damaged.`),this.player.error(t),this.options.onError&&this.options.onError(e)}async fetchConfig(){if(CP||this.options.fetch||this.options.offlinePlaybackObject)return;let e=`${this.options.playerApi.origin}/api/config`;CP=await Ve.get(e),!this.isDisposed()&&this.trigger(`config:loaded`)}additionalSetup(e){this.player.whiteboardModePlugin(),this.player.deferMenusPlugin();let t=this.options.enableLocalCache&&!!e.localCacheAddresses?.length;CP?this.setupAnalyticsService(e,t):this.one(`config:loaded`,()=>this.setupAnalyticsService(e,t)),this.analyticsService||!this.isAnalyticsEnabled()?this.setupAnalyticsDependentPlugins(e):this.one(`analytics:loaded`,()=>this.setupAnalyticsDependentPlugins(e))}setupAnalyticsService(e,t){this.options.eventLogging&&(this.analyticsService=new cg({player:this.player,collectionApiUrls:CP.collectionApi.urls,collectionApiClientId:CP.collectionApi.clientId,productVersion:yg.version,authSessionId:e.viewerAuthSessionId,videoId:e.videoId,mediaId:e.mediaId,userId:e.viewerId,shareId:e.shareId,customerId:e.viewerCustomerId,mediaType:e.mediaType,playerType:this.getAnalyticsPlayerType(),isEmbedded:this.options.embed,isUsingLocalCache:t,additionalAnalyticsData:this.getAdditionalAnalyticsData(e),regionName:e.instanceRegion||this.options.sharerInstanceRegion||ue.CvApSoutheast1}),this.on(`timeupdate`,this.logStream),this.trigger(`analytics:loaded`))}setupAnalyticsDependentPlugins(e){this.player.persistSubtitleSettingsPlugin({showSubtitles:e.settings?.showSubtitles,subtitleSize:e.settings?.playbackSubtitleSizeDefault,analyticsService:this.analyticsService}),this.player.persistQualitySettingsPlugin({playbackQuality:e.settings?.playbackQuality,playbackQualityLocalCache:e.settings?.playbackQualityLocalCache,playbackQualityFallback:e.settings?.playbackQualityFallback,analyticsService:this.analyticsService}),this.player.persistPlaybackRatePlugin({analyticsService:this.analyticsService})}getAdditionalAnalyticsData(e){return{}}isAnalyticsEnabled(){return this.options.fetch||this.options.offlinePlaybackObject?!1:this.options.eventLogging}handleAutoplay(e){this.options.autoplay&&this.player.ready(()=>{this.player.play().catch(()=>{this.isDisposed()||this.showSplash()})})}logStream(){this.analyticsService&&(this.player.currentTime()<SP||this.streamLogged||this.player.playerModePlugin().getMode()!==ng.Hover&&(this.analyticsService.logStream(),this.streamLogged=!0,this.off(`timeupdate`,this.logStream)))}getAnalyticsPlayerType(){return`player`}createEl(e){let t;typeof e==`string`?(e=xP(e),t=K.dom.$(`#`+e)):t=e;let n=`video-js`;return this.getPlayerClassName()&&(n+=` ${this.getPlayerClassName()}`),this.el=K.dom.createEl(`video`,{},{class:n}),t.appendChild(this.el),this.el}getPlayerClassName(){return``}on(e,t){this.player.on(e,t)}one(e,t){this.player.one(e,t)}off(e,t){this.player.off(e,t)}trigger(e,t){return this.player.trigger(e,t)}dispose(){this.player.dispose()}ready(e){this.player.ready(e)}isDisposed(){return this.player.isDisposed()}play(){this.player.play()}pause(){this.player.pause()}isPaused(){return this.player.paused()}currentTime(e){return this.player.currentTime(e)}muted(e){return this.player.muted(e)}duration(){return this.player.duration()}isFullscreen(){return this.player.isFullscreen()}requestFullscreen(){this.player.requestFullscreen()}exitFullscreen(){this.player.exitFullscreen()}playbackRate(e){return this.player.playbackRate(e)}quality(e){let t=this.player.qualityLevels();for(let n=0;n<t.length;n++){let r=t[n];if(e){r.enabled=r.id===e.toString();continue}if(r.enabled)return r.id}}subtitles(e){let t=this.player.textTracks();for(let n=0;n<t.length;n++){let r=t[n];if(r.kind===`subtitles`){if(e!==void 0){r.label===e?r.mode=`showing`:r.mode=`disabled`;continue}if(r.mode===`showing`)return r.label}}}bindEventListeners(){let e=e=>e.preventDefault();if(this.showSplash=this.showSplash.bind(this),this.hideSplash=this.hideSplash.bind(this),this.player.on(`ended`,this.showSplash),this.player.on(`play`,this.hideSplash),this.player.tech(!0).on(`contextmenu`,e),this.player.one(`dispose`,()=>{this.off(`ended`,this.showSplash),this.off(`play`,this.hideSplash),this.player.qualityLevels().off(`change`,this.hideSplash),this.player.tech(!0).off(`contextmenu`,e)}),!this.options.hotkeyElQuerySelector)return;let t=K.dom.$(this.options.hotkeyElQuerySelector);t&&(this.player.on(t,`keydown`,this.player.handleKeyDown),this.player.one(`dispose`,()=>{this.player.off(t,`keydown`,this.player.handleKeyDown)}))}setupSeekBar(){let e=this.getSeekBarName(),t=this.player.controlBar.getChild(`progressControl`);t.addChild(e,{...this.getSeekBarOptions(),playerOptions:this.player.options_.playerOptions}),t.setSeekBarName(e)}setupSplash(e){this._splashAdded||(this._splashAdded=!0,this.player.addChild(`posterImage`,{embed:this.options.embed,...e}),this.player.addChild(`bigPlayButton`),this.options.autoplay?this.hideSplash():this.showSplash())}showSplash(){this.player.hasStarted(!1),this.player.getChild(`posterImage`).show(),this.player.getChild(`bigPlayButton`).show()}hideSplash(){this.player.getChild(`posterImage`).hide(),this.player.getChild(`bigPlayButton`).hide()}getSeekBarOptions(){return{}}getSeekBarName(){return`ChapterSeekBar`}};export{jM as a,AA as c,wh as d,ph as f,zM as i,Dh as l,Ve as m,yN as n,sM as o,K as p,BM as r,aM as s,wP as t,Eh as u};
|
|
295
|
-
//# sourceMappingURL=
|
|
295
|
+
//# sourceMappingURL=DTliAJ8L.chunk.js.map
|