@carbon/ibmdotcom-web-components 2.55.1 → 2.55.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/dotcom-shell.js +1 -1
  2. package/dist/dotcom-shell.min.js +1 -1
  3. package/dist/ibmdotcom-web-components-dotcom-shell.js +1 -1
  4. package/dist/ibmdotcom-web-components-dotcom-shell.min.js +1 -1
  5. package/dist/{index-b430b0ae.js → index-5becb925.js} +195 -22
  6. package/dist/{index-7a169f38.js → index-9b1155d4.js} +265 -265
  7. package/dist/{left-nav-menu-8c8dd8f6.js → left-nav-menu-4a6c5357.js} +1 -1
  8. package/dist/{left-nav-menu-f4e37cd0.js → left-nav-menu-96dbffa3.js} +1 -1
  9. package/dist/{left-nav-menu-category-heading-5327ae32.js → left-nav-menu-category-heading-4eaaa1cb.js} +1 -1
  10. package/dist/{left-nav-menu-category-heading-bd361f31.js → left-nav-menu-category-heading-8c2b8ed1.js} +1 -1
  11. package/dist/{left-nav-menu-item-0e1fd732.js → left-nav-menu-item-2919662e.js} +1 -1
  12. package/dist/{left-nav-menu-item-57370ce4.js → left-nav-menu-item-e3cb7a75.js} +1 -1
  13. package/dist/{left-nav-menu-section-87419045.js → left-nav-menu-section-3f725e26.js} +1 -1
  14. package/dist/{left-nav-menu-section-c8f7f7b2.js → left-nav-menu-section-ee8222d1.js} +1 -1
  15. package/dist/{left-nav-overlay-24894419.js → left-nav-overlay-69df9fd0.js} +1 -1
  16. package/dist/{left-nav-overlay-dfd13a09.js → left-nav-overlay-eb67d1de.js} +1 -1
  17. package/dist/{megamenu-category-group-f8e3a37e.js → megamenu-category-group-3f2bfe7c.js} +1 -1
  18. package/dist/{megamenu-category-group-f1604a05.js → megamenu-category-group-6c76c126.js} +1 -1
  19. package/dist/{megamenu-category-group-copy-27038d51.js → megamenu-category-group-copy-2f09fb89.js} +1 -1
  20. package/dist/{megamenu-category-group-copy-32dbffb9.js → megamenu-category-group-copy-62f21ae2.js} +1 -1
  21. package/dist/{megamenu-category-heading-217fdbb3.js → megamenu-category-heading-32e44d96.js} +1 -1
  22. package/dist/{megamenu-category-heading-7329423a.js → megamenu-category-heading-478cfb1a.js} +1 -1
  23. package/dist/{megamenu-category-link-8eb1e240.js → megamenu-category-link-05dee472.js} +1 -1
  24. package/dist/{megamenu-category-link-b50a0ba1.js → megamenu-category-link-82d0de27.js} +1 -1
  25. package/dist/{megamenu-category-link-group-cb65ec0f.js → megamenu-category-link-group-8099bca4.js} +1 -1
  26. package/dist/{megamenu-category-link-group-29472273.js → megamenu-category-link-group-8e7eb5a1.js} +1 -1
  27. package/dist/{megamenu-left-navigation-f1a8beee.js → megamenu-left-navigation-5cea51eb.js} +1 -1
  28. package/dist/{megamenu-left-navigation-e1b82079.js → megamenu-left-navigation-946e6ecd.js} +1 -1
  29. package/dist/{megamenu-overlay-6936cfe6.js → megamenu-overlay-8b50d36d.js} +1 -1
  30. package/dist/{megamenu-overlay-65c1352d.js → megamenu-overlay-babb56ff.js} +1 -1
  31. package/dist/{megamenu-tab-1870d088.js → megamenu-tab-62d05074.js} +1 -1
  32. package/dist/{megamenu-tab-4a5b3184.js → megamenu-tab-8b71189a.js} +1 -1
  33. package/es/components/cta/video-cta-container.d.ts +1 -0
  34. package/es/components/lightbox-media-viewer/lightbox-video-player-container.d.ts +1 -0
  35. package/es/components/pricing-table/pricing-table.css.js +1 -1
  36. package/es/components/video-player-v7/video-player-composite.d.ts +18 -0
  37. package/es/components/video-player-v7/video-player-composite.js +136 -7
  38. package/es/components/video-player-v7/video-player-composite.js.map +1 -1
  39. package/es/components/video-player-v7/video-player-container.d.ts +20 -0
  40. package/es/components/video-player-v7/video-player-container.js +63 -10
  41. package/es/components/video-player-v7/video-player-container.js.map +1 -1
  42. package/es/icons/IBM-8bar-logo--h65-white.js +1 -1
  43. package/es/internal/vendor/@carbon/ibmdotcom-services/services/KalturaPlayerV7/KalturaPlayer.js +192 -19
  44. package/lib/internal/vendor/@carbon/ibmdotcom-services/services/KalturaPlayerV7/KalturaPlayer.js +192 -19
  45. package/package.json +5 -5
@@ -691,6 +691,24 @@ declare const C4DVideoPlayerComposite_base: (abstract new (...args: any[]) => {
691
691
  * @csspart video-player - The video player. Usage `c4d-video-player-composite-v7::part(video-player)`
692
692
  */
693
693
  declare class C4DVideoPlayerComposite extends C4DVideoPlayerComposite_base {
694
+ /**
695
+ * Listener registered on `at-content-rendering-succeeded/failed` while waiting
696
+ * for Adobe Target to settle before setting up the IntersectionObserver.
697
+ * Stored so it can be removed in `disconnectedCallback`.
698
+ */
699
+ private _atSettleHandler?;
700
+ /**
701
+ * Fallback timer ID used when Adobe Target never fires its settle events.
702
+ */
703
+ private _atFallback?;
704
+ /**
705
+ * Observer watching for removal of the AEP Web SDK (alloy) prehiding style
706
+ * (`<style id="alloy-prehiding">`), which signals that personalization
707
+ * decisions have been rendered. Used instead of the at.js
708
+ * `at-content-rendering-*` events on pages running alloy, which never fires
709
+ * those events.
710
+ */
711
+ private _atPrehidingObserver?;
694
712
  /**
695
713
  * The placeholder for `_setAutoplayPreference()` Redux action that may be mixed in.
696
714
  */
@@ -64,6 +64,35 @@ let C4DVideoPlayerComposite = _decorate([customElement(`${c4dPrefix}-video-playe
64
64
  * @internal
65
65
  */
66
66
 
67
+ /**
68
+ * Listener registered on `at-content-rendering-succeeded/failed` while waiting
69
+ * for Adobe Target to settle before setting up the IntersectionObserver.
70
+ * Stored so it can be removed in `disconnectedCallback`.
71
+ */
72
+
73
+ /**
74
+ * Fallback timer ID used when Adobe Target never fires its settle events.
75
+ */
76
+
77
+ /**
78
+ * Observer watching for removal of the AEP Web SDK (alloy) prehiding style
79
+ * (`<style id="alloy-prehiding">`), which signals that personalization
80
+ * decisions have been rendered. Used instead of the at.js
81
+ * `at-content-rendering-*` events on pages running alloy, which never fires
82
+ * those events.
83
+ */
84
+
85
+ /**
86
+ * Placeholder divs parked in `document.body` by `_embedVideoImpl` (mixed in
87
+ * by the container) while a Kaltura embed is queued or in flight. Tracked so
88
+ * `disconnectedCallback` can remove them: once removed, the
89
+ * `getElementById(targetId)` guard in `legacyPromiseKWidget` returns null
90
+ * and the dead embed drains from `_ibmKalturaEmbedQueue` immediately instead
91
+ * of fully embedding a hidden orphaned player.
92
+ *
93
+ * @internal
94
+ */
95
+
67
96
  /**
68
97
  * The placeholder for `_setAutoplayPreference()` Redux action that may be mixed in.
69
98
  */
@@ -154,11 +183,19 @@ let C4DVideoPlayerComposite = _decorate([customElement(`${c4dPrefix}-video-playe
154
183
  const {
155
184
  videoId
156
185
  } = this;
157
- entries.forEach(entry => {
186
+ entries.forEach(async entry => {
158
187
  if (entry.isIntersecting && this._getAutoplayPreference() !== false) {
159
- var _this$_embedMedia;
160
- (_this$_embedMedia = this._embedMedia) === null || _this$_embedMedia === void 0 || _this$_embedMedia.call(this, videoId);
161
- this.playAllVideos();
188
+ var _this$_embedMedia, _this$_embedMedia$the, _this$_embedMedia$the2;
189
+ await this.updateComplete;
190
+ (_this$_embedMedia = this._embedMedia) === null || _this$_embedMedia === void 0 || (_this$_embedMedia = _this$_embedMedia.call(this, videoId)) === null || _this$_embedMedia === void 0 || (_this$_embedMedia$the = _this$_embedMedia.then) === null || _this$_embedMedia$the === void 0 || (_this$_embedMedia$the = _this$_embedMedia$the.call(_this$_embedMedia, player => {
191
+ if (player) {
192
+ this.playAllVideos();
193
+ }
194
+ })) === null || _this$_embedMedia$the === void 0 || (_this$_embedMedia$the2 = _this$_embedMedia$the.catch) === null || _this$_embedMedia$the2 === void 0 || _this$_embedMedia$the2.call(_this$_embedMedia$the, err => {
195
+ if (process.env.NODE_ENV !== 'production') {
196
+ console.warn('[VP-DEBUG] embed failed in IO handler', err);
197
+ }
198
+ });
162
199
  }
163
200
  });
164
201
  }
@@ -564,9 +601,70 @@ let C4DVideoPlayerComposite = _decorate([customElement(`${c4dPrefix}-video-playe
564
601
  }
565
602
  }
566
603
  if (this.intersectionMode) {
567
- this._cleanAndCreateObserverIntersection({
568
- create: true
569
- });
604
+ var _adobe;
605
+ // alloy never fires at.js events, so we watch for #alloy-prehiding
606
+ // removal instead; classic at.js fires at-content-rendering-*. No
607
+ // signal pending means no personalization is coming, so skip the wait.
608
+ const prehidingEl = document.getElementById('alloy-prehiding');
609
+ const atObj = (_adobe = window.adobe) === null || _adobe === void 0 ? void 0 : _adobe.target;
610
+ const realAtJs = !!atObj && (typeof atObj.getOffers === 'function' || typeof atObj.getOffer === 'function' || typeof atObj.applyOffers === 'function');
611
+ if (prehidingEl || realAtJs) {
612
+ // Warm the Kaltura SDK while we wait for AT to settle, so loader.js
613
+ // downloads in parallel with the AT defer instead of after it.
614
+ KalturaPlayerAPI.checkScript().catch(() => {});
615
+ let settled = false;
616
+ const setupIO = () => this._cleanAndCreateObserverIntersection({
617
+ create: true
618
+ });
619
+ const onATSettle = () => {
620
+ if (settled) {
621
+ return;
622
+ }
623
+ settled = true;
624
+ document.removeEventListener('at-content-rendering-succeeded', onATSettle);
625
+ document.removeEventListener('at-content-rendering-failed', onATSettle);
626
+ if (this._atPrehidingObserver) {
627
+ this._atPrehidingObserver.disconnect();
628
+ this._atPrehidingObserver = undefined;
629
+ }
630
+ if (this._atFallback) {
631
+ clearTimeout(this._atFallback);
632
+ this._atFallback = undefined;
633
+ }
634
+ this._atSettleHandler = undefined;
635
+ setupIO();
636
+ };
637
+ this._atSettleHandler = onATSettle;
638
+ document.addEventListener('at-content-rendering-succeeded', onATSettle, {
639
+ once: true
640
+ });
641
+ document.addEventListener('at-content-rendering-failed', onATSettle, {
642
+ once: true
643
+ });
644
+ if (prehidingEl) {
645
+ // alloy: settle when the prehiding style is removed from the DOM.
646
+ this._atPrehidingObserver = new MutationObserver(() => {
647
+ if (!document.getElementById('alloy-prehiding')) {
648
+ onATSettle();
649
+ }
650
+ });
651
+ this._atPrehidingObserver.observe(prehidingEl.parentNode || document.documentElement, {
652
+ childList: true
653
+ });
654
+ // Guard against a race: removed between getElementById and observe().
655
+ if (!document.getElementById('alloy-prehiding')) {
656
+ onATSettle();
657
+ }
658
+ }
659
+ // Fallback: if no settle signal ever arrives, set up IO after 4s so video still works
660
+ if (!settled) {
661
+ this._atFallback = setTimeout(onATSettle, 4000);
662
+ }
663
+ } else {
664
+ this._cleanAndCreateObserverIntersection({
665
+ create: true
666
+ });
667
+ }
570
668
  }
571
669
 
572
670
  // initializing the MutationObserver to observe for changes in the direction mode
@@ -588,7 +686,38 @@ let C4DVideoPlayerComposite = _decorate([customElement(`${c4dPrefix}-video-playe
588
686
  key: "disconnectedCallback",
589
687
  value: function disconnectedCallback() {
590
688
  _superPropGet(C4DVideoPlayerComposite, "disconnectedCallback", this, 3)([]);
689
+ if (this._atSettleHandler) {
690
+ document.removeEventListener('at-content-rendering-succeeded', this._atSettleHandler);
691
+ document.removeEventListener('at-content-rendering-failed', this._atSettleHandler);
692
+ this._atSettleHandler = undefined;
693
+ }
694
+ if (this._atPrehidingObserver) {
695
+ this._atPrehidingObserver.disconnect();
696
+ this._atPrehidingObserver = undefined;
697
+ }
698
+ if (this._atFallback) {
699
+ clearTimeout(this._atFallback);
700
+ this._atFallback = undefined;
701
+ }
702
+ // Removing these placeholders makes legacyPromiseKWidget's getElementById
703
+ // guard fail fast, draining dead embeds from the queue instead of
704
+ // blocking the next one behind a hidden orphaned player.
705
+ if (this._ibmPendingEmbedDivs) {
706
+ this._ibmPendingEmbedDivs.forEach(div => div.remove());
707
+ this._ibmPendingEmbedDivs.clear();
708
+ }
591
709
  this._cleanAndCreateObserverIntersection();
710
+ const {
711
+ embeddedVideos = {}
712
+ } = this;
713
+ Object.values(embeddedVideos).forEach(player => {
714
+ try {
715
+ var _player$destroy;
716
+ player === null || player === void 0 || (_player$destroy = player.destroy) === null || _player$destroy === void 0 || _player$destroy.call(player);
717
+ } catch (error) {
718
+ // Ignore errors from destroy.
719
+ }
720
+ });
592
721
  }
593
722
  }, {
594
723
  kind: "method",
@@ -1 +1 @@
1
- {"version":3,"file":"video-player-composite.js","names":["LitElement","html","property","state","HostListener","HostListenerMixin","settings","KalturaPlayerAPI","HybridRenderMixin","VIDEO_PLAYER_CONTENT_STATE","VIDEO_PLAYER_PLAYING_MODE","carbonElement","customElement","BUTTON_POSITION","ifNonEmpty","stablePrefix","c4dPrefix","C4DVideoPlayerComposite","_decorate","_initialize","_HybridRenderMixin","constructor","args","F","d","kind","key","value","_activateEmbeddedVideo","videoId","embeddedVideos","Object","keys","forEach","kalturaPlayer","play","pause","selectorVideoPlayer","querySelector","_cleanAndCreateObserverIntersection","create","_observerIntersectionIntoView","unobserve","_observerIntersectionOutOfView","IntersectionObserver","_intersectionIntoViewHandler","bind","root","closest","rootMargin","threshold","_intersectionOutOfViewHandler","observe","entries","entry","isIntersecting","_getAutoplayPreference","_this$_embedMedia","_embedMedia","call","playAllVideos","pauseAllVideos","decorators","_handleContentStateChange","event","contentState","playingMode","ctaElement","detail","VIDEO","INLINE","_this$_embedMedia2","_handlePlaybackStateChange","isPlaying","_setAutoplayPreference","playbackTriggered","_handleEventTogglePlayback","_this$_embedMedia3","updateAutoplayPreference","_embeddedVideos$video","_embeddedVideos$video2","getIsVideoPlaying","_iframe$contentWindow","iframe","playerContainer","contentWindow","document","type","Boolean","attribute","reflect","BOTTOM_RIGHT","Number","connectedCallback","_superPropGet","backgroundMode","hideCaption","autoPlay","storedPreference","window","matchMedia","matches","intersectionMode","observer","MutationObserver","isRTL","dir","getComputedStyle","direction","documentElement","attributes","attributeFilter","disconnectedCallback","updated","changedProperties","has","_this$_loadVideoData","_loadVideoData","_this$_embedMedia4","renderLightDOM","_this$querySelector","setAttribute","aspectRatio","formatCaption","formatDuration","caption","customVideoDescription","mediaData","videoThumbnailWidth","thumbnail","buttonPosition","currentVideoData","duration","name","thumbnailUrl","getThumbnailUrl","mediaId","width","_t","_","THUMBNAIL","render","_t2","static"],"sources":["components/video-player-v7/video-player-composite.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2020, 2024\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement, html } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport HostListener from '@carbon/web-components/es/globals/decorators/host-listener.js';\nimport HostListenerMixin from '@carbon/web-components/es/globals/mixins/host-listener.js';\nimport settings from '@carbon/ibmdotcom-utilities/es/utilities/settings/settings.js';\nimport KalturaPlayerAPI from '@carbon/ibmdotcom-services/es/services/KalturaPlayerV7/KalturaPlayer.js';\nimport HybridRenderMixin from '../../globals/mixins/hybrid-render';\nimport { MediaData } from '../../internal/vendor/@carbon/ibmdotcom-services-store/types/kalturaPlayerAPIv7';\nimport {\n VIDEO_PLAYER_CONTENT_STATE,\n VIDEO_PLAYER_PLAYING_MODE,\n} from './video-player';\n// Above import is interface-only ref and thus code won't be brought into the build\nimport './video-player';\nimport { carbonElement as customElement } from '@carbon/web-components/es/globals/decorators/carbon-element.js';\nimport { BUTTON_POSITION } from './defs';\nimport ifNonEmpty from '@carbon/web-components/es/globals/directives/if-non-empty.js';\n\nconst { stablePrefix: c4dPrefix } = settings;\n\n/**\n * Component that renders video player from its metadata, etc.\n *\n * @element c4d-video-player-composite-v7\n * @csspart video-player - The video player. Usage `c4d-video-player-composite-v7::part(video-player)`\n */\n@customElement(`${c4dPrefix}-video-player-composite-v7`)\nclass C4DVideoPlayerComposite extends HybridRenderMixin(\n HostListenerMixin(LitElement)\n) {\n /**\n * The placeholder for `_loadVideoData()` Redux action that may be mixed in.\n *\n * @internal\n */\n _loadVideoData?: (videoId: string) => Promise<MediaData>;\n\n /**\n * The placeholder for `_loadVideoData()` Redux action that may be mixed in.\n *\n * @internal\n */\n _embedMedia?: (videoId: string) => Promise<any>;\n\n /**\n * The placeholder for `_setAutoplayPreference()` Redux action that may be mixed in.\n */\n // @ts-ignore\n _setAutoplayPreference: (preference: boolean) => void;\n\n /**\n * The placeholder for `_getAutoplayPreference()` Redux action that may be mixed in.\n */\n // @ts-ignore\n _getAutoplayPreference: () => null | boolean;\n\n /**\n * Activate the DOM nodes for the embedded video of the given video ID, and deactivates others.\n *\n * @param videoId The video ID to activate.\n */\n protected _activateEmbeddedVideo(videoId: string) {\n const { embeddedVideos = {} } = this;\n Object.keys(embeddedVideos).forEach((key) => {\n const kalturaPlayer = embeddedVideos[key];\n key === videoId ? kalturaPlayer.play() : kalturaPlayer.pause();\n });\n }\n\n /**\n * The video player.\n */\n protected get _videoPlayer() {\n const { selectorVideoPlayer } = this\n .constructor as typeof C4DVideoPlayerComposite;\n return this.querySelector(selectorVideoPlayer);\n }\n\n /**\n * Clean-up and create intersection observers.\n *\n * When this.intersectionMode, we use intersection observers to track when\n * the video container is in view, and embed / play / pause the video\n * accordingly.\n *\n * @param [options] The options.\n * @param [options.create] `true` to create necessary intersection observers.\n */\n private _cleanAndCreateObserverIntersection({\n create,\n }: { create?: boolean } = {}) {\n // Cleanup.\n if (this._observerIntersectionIntoView) {\n this._observerIntersectionIntoView.unobserve(this);\n }\n if (this._observerIntersectionOutOfView) {\n this._observerIntersectionOutOfView.unobserve(this);\n }\n // Create new intersection observers.\n if (create) {\n this._observerIntersectionIntoView = new IntersectionObserver(\n this._intersectionIntoViewHandler.bind(this),\n {\n root: this.closest('c4d-carousel'),\n rootMargin: '0px',\n threshold: 0.9,\n }\n );\n this._observerIntersectionOutOfView = new IntersectionObserver(\n this._intersectionOutOfViewHandler.bind(this),\n {\n root: this.closest('c4d-carousel'),\n rootMargin: '0px',\n threshold: 0.5,\n }\n );\n this._observerIntersectionIntoView.observe(this);\n this._observerIntersectionOutOfView.observe(this);\n }\n }\n\n /**\n * Observer for when the video container enters into view.\n *\n * Autoplay the video, resecting the users stored autoplay preference.\n */\n private _intersectionIntoViewHandler(entries: IntersectionObserverEntry[]) {\n const { videoId } = this;\n entries.forEach((entry) => {\n if (entry.isIntersecting && this._getAutoplayPreference() !== false) {\n this._embedMedia?.(videoId);\n this.playAllVideos();\n }\n });\n }\n\n /**\n * Observer for when the video container goes out of view.\n *\n * Auto-pause the video, video playback controlled by intersection observers\n * here are meant to be ambient, without audio. No reason for playback when\n * user is not seeing the video content.\n */\n private _intersectionOutOfViewHandler(entries: IntersectionObserverEntry[]) {\n entries.forEach((entry) => {\n if (!entry.isIntersecting) {\n this.pauseAllVideos(false);\n }\n });\n }\n\n /**\n * Handles `c4d-video-player-content-state-changed` event.\n * Such event is fired when user changes video content state, e.g. from thumbnail to video player.\n *\n * @param event The event.\n */\n @HostListener('eventContentStateChange')\n protected _handleContentStateChange(event: CustomEvent) {\n const { contentState, playingMode, videoId, ctaElement } = event.detail;\n\n // Store CTA element for potential forwarding\n if (ctaElement) {\n this.ctaElement = ctaElement;\n }\n\n if (\n contentState === VIDEO_PLAYER_CONTENT_STATE.VIDEO &&\n playingMode === VIDEO_PLAYER_PLAYING_MODE.INLINE &&\n videoId\n ) {\n this._embedMedia?.(videoId);\n }\n }\n\n @HostListener('eventPlaybackStateChange')\n protected _handlePlaybackStateChange(event: CustomEvent) {\n const { videoId } = event.detail;\n const { embeddedVideos = {} } = this;\n\n if (this.isPlaying) {\n embeddedVideos[videoId].pause();\n this.isPlaying = false;\n } else {\n embeddedVideos[videoId].play();\n this.isPlaying = true;\n }\n\n this._setAutoplayPreference(this.isPlaying);\n this.playbackTriggered = true;\n }\n\n @HostListener('eventTogglePlayback')\n protected _handleEventTogglePlayback(event: CustomEvent) {\n const { videoId } = event.detail;\n if (videoId) {\n this._setAutoplayPreference(!this.isPlaying);\n\n // First ensure that the media has actually been embedded.\n this._embedMedia?.(videoId);\n if (this.isPlaying) {\n this.pauseAllVideos();\n } else {\n this.playAllVideos();\n }\n }\n }\n\n pauseAllVideos(updateAutoplayPreference = true) {\n const { embeddedVideos = {} } = this;\n\n Object.keys(embeddedVideos).forEach((videoId) => {\n embeddedVideos[videoId]?.pause();\n });\n this.isPlaying = false;\n if (updateAutoplayPreference) {\n this._setAutoplayPreference(false);\n }\n }\n\n playAllVideos(updateAutoplayPreference = true) {\n const { embeddedVideos = {} } = this;\n\n Object.keys(embeddedVideos).forEach((videoId) => {\n embeddedVideos[videoId]?.play();\n });\n this.isPlaying = true;\n this.playbackTriggered = true;\n if (updateAutoplayPreference) {\n this._setAutoplayPreference(true);\n }\n }\n getIsVideoPlaying() {\n const iframe = this.querySelector('iframe');\n const playerContainer =\n iframe?.contentWindow?.document.querySelector('div.play-state');\n return !(playerContainer == null);\n }\n\n /**\n * `true` to autoplay the videos.\n */\n @property({ type: Boolean, attribute: 'auto-play' })\n autoPlay = false;\n\n /**\n * `true` load videos with sound muted.\n */\n @property({ type: Boolean, attribute: 'muted' })\n muted = false;\n\n /**\n * The embedded Kaltura player element (that has APIs), keyed by the video ID.\n */\n @property({ attribute: false })\n embeddedVideos?: { [videoId: string]: any };\n\n /**\n * Optional custom video caption.\n */\n @property({ reflect: true, attribute: 'caption' })\n caption?: '';\n\n /**\n * Custom video description. This property should only be set when `playing-mode=\"lightbox\"`.\n */\n @property({ reflect: true, attribute: 'video-description' })\n customVideoDescription?: string;\n\n /**\n * The formatter for the video caption, composed with the video name and the video duration.\n * Should be changed upon the locale the UI is rendered with.\n */\n @property({ attribute: false })\n formatCaption?: ({\n duration,\n name,\n }: {\n duration?: string;\n name?: string;\n }) => string;\n\n /**\n * The formatter for the video duration.\n * Should be changed upon the locale the UI is rendered with.\n */\n @property({ attribute: false })\n formatDuration?: ({ duration }: { duration?: number }) => string;\n\n /**\n * `true` to hide the caption.\n */\n @property({ type: Boolean, attribute: 'hide-caption' })\n hideCaption = false;\n\n /**\n * `true` to autoplay, mute, and hide player UI.\n */\n @property({ type: Boolean, attribute: 'background-mode', reflect: true })\n backgroundMode = false;\n\n /**\n * Triggers playback on intersection with the viewport / carousel.\n */\n @property({ attribute: 'intersection-mode', reflect: true, type: Boolean })\n intersectionMode = false;\n\n /**\n * The position of the toggle playback button.\n */\n @property({ attribute: 'button-position', reflect: true })\n buttonPosition = BUTTON_POSITION.BOTTOM_RIGHT;\n\n /**\n * Track when we have triggered initial playback.\n */\n @state()\n playbackTriggered = false;\n\n /**\n * The video data, keyed by the video ID.\n */\n @property({ attribute: false })\n mediaData?: { [videoId: string]: MediaData };\n\n /**\n * The video ID.\n */\n @property({ attribute: 'video-id' })\n videoId = '';\n\n /**\n * The aspect ratio.\n */\n @property({ attribute: 'aspect-ratio' })\n aspectRatio?: '';\n\n /**\n * The current playback state\n */\n @property({ type: Boolean })\n isPlaying = false;\n\n /**\n * The video player's mode showing Inline or Lightbox.\n */\n @property({ reflect: true, attribute: 'playing-mode' })\n playingMode = VIDEO_PLAYER_PLAYING_MODE.INLINE;\n\n /**\n * Optional custom video thumbnail\n */\n @property({ reflect: true, attribute: 'thumbnail' })\n thumbnail?: '';\n\n /**\n * The video thumbnail width.\n */\n @property({ type: Number, attribute: 'video-thumbnail-width' })\n videoThumbnailWidth = 3;\n\n /**\n * Determines if the direction is right-to-left\n */\n @property({ type: Boolean })\n isRTL = false;\n\n /**\n * Stored CTA element for forwarding to lightbox\n */\n @property({ attribute: false })\n ctaElement?: HTMLElement | null;\n\n private observer!: MutationObserver;\n\n /**\n * Observe when the video container enters into view.\n */\n private _observerIntersectionIntoView?: IntersectionObserver;\n\n /**\n * Observe when the video container goes out of view.\n */\n private _observerIntersectionOutOfView?: IntersectionObserver;\n\n connectedCallback() {\n super.connectedCallback();\n\n if (this.backgroundMode) {\n this.hideCaption = true;\n }\n\n if (this.autoPlay || this.backgroundMode) {\n const storedPreference = this._getAutoplayPreference();\n if (storedPreference === null) {\n this.isPlaying = !window.matchMedia('(prefers-reduced-motion: reduce)')\n .matches;\n } else {\n this.isPlaying = storedPreference;\n }\n }\n\n if (this.intersectionMode) {\n this._cleanAndCreateObserverIntersection({ create: true });\n }\n\n // initializing the MutationObserver to observe for changes in the direction mode\n this.observer = new MutationObserver(() => {\n this.isRTL =\n this.dir === 'rtl' || getComputedStyle(this).direction === 'rtl';\n });\n\n // observing the 'dir' attr in the root element\n this.observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['dir'],\n });\n\n // Initial check for the direction\n this.isRTL =\n this.dir === 'rtl' || getComputedStyle(this).direction === 'rtl';\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this._cleanAndCreateObserverIntersection();\n }\n\n updated(changedProperties) {\n if (changedProperties.has('videoId')) {\n const { autoPlay, videoId, backgroundMode } = this;\n this._activateEmbeddedVideo(videoId);\n if (videoId) {\n this._loadVideoData?.(videoId);\n if (autoPlay || backgroundMode) {\n this._embedMedia?.(videoId);\n }\n }\n }\n }\n\n renderLightDOM() {\n // setting the direction mode of the video player.\n this.querySelector('.c4d--video-player__video')?.setAttribute(\n 'dir-mode',\n `${this.isRTL ? 'rtl' : 'ltr'}`\n );\n\n const {\n aspectRatio,\n formatCaption,\n formatDuration,\n hideCaption,\n caption,\n customVideoDescription,\n mediaData = {},\n videoId,\n videoThumbnailWidth,\n thumbnail,\n playingMode,\n buttonPosition,\n } = this;\n\n const { [videoId]: currentVideoData = {} as MediaData } = mediaData;\n const { duration, name } = currentVideoData;\n const thumbnailUrl =\n thumbnail ||\n KalturaPlayerAPI.getThumbnailUrl({\n mediaId: videoId,\n width: videoThumbnailWidth,\n });\n return html`\n <c4d-video-player-v7\n part=\"video-player\"\n duration=\"${ifNonEmpty(duration)}\"\n ?hide-caption=${hideCaption}\n name=\"${ifNonEmpty(caption || name)}\"\n video-description=\"${ifNonEmpty(customVideoDescription)}\"\n thumbnail-url=\"${ifNonEmpty(thumbnailUrl)}\"\n video-id=\"${ifNonEmpty(videoId)}\"\n aspect-ratio=\"${ifNonEmpty(aspectRatio)}\"\n playing-mode=\"${ifNonEmpty(playingMode)}\"\n content-state=\"${this.playbackTriggered\n ? VIDEO_PLAYER_CONTENT_STATE.VIDEO\n : VIDEO_PLAYER_CONTENT_STATE.THUMBNAIL}\"\n button-position=\"${buttonPosition}\"\n .formatCaption=\"${ifNonEmpty(formatCaption)}\"\n .formatDuration=\"${ifNonEmpty(formatDuration)}\"\n .isPlaying=${this.isPlaying}>\n </c4d-video-player-v7>\n `;\n }\n\n render() {\n return html` <slot></slot> `;\n }\n\n /**\n * A selector selecting the video player component.\n */\n static get selectorVideoPlayer() {\n return `${c4dPrefix}-video-player-v7`;\n }\n\n /**\n * The name of the custom event fired after video content state is changed upon a user gesture.\n */\n static get eventContentStateChange() {\n return `${c4dPrefix}-video-player-content-state-changed`;\n }\n\n /**\n * The name of the custom event fired requesting playback state change.\n */\n static get eventPlaybackStateChange() {\n return `${c4dPrefix}-video-player-playback-state-changed`;\n }\n\n /**\n * The name of the custom event fired requesting to toggle playback.\n */\n static get eventTogglePlayback() {\n return `${c4dPrefix}-video-player-toggle-playback`;\n }\n}\n\n/* @__GENERATE_REACT_CUSTOM_ELEMENT_TYPE__ */\nexport default C4DVideoPlayerComposite;\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,EAAEC,IAAI,QAAQ,KAAK;AACtC,SAASC,QAAQ,EAAEC,KAAK,QAAQ,mBAAmB;AACnD,OAAOC,YAAY,MAAM,+DAA+D;AACxF,OAAOC,iBAAiB,MAAM,2DAA2D;AACzF,OAAOC,QAAQ,MAAM,+DAA+D;AACpF,OAAOC,gBAAgB,MAAM,yEAAyE;AACtG,OAAOC,iBAAiB,MAAM,uCAAoC;AAElE,SACEC,0BAA0B,EAC1BC,yBAAyB,QACpB,mBAAgB;AACvB;AAAA;AAAA;AACA,OAAO,mBAAgB;AACvB,SAASC,aAAa,IAAIC,aAAa,QAAQ,gEAAgE;AAC/G,SAASC,eAAe,QAAQ,WAAQ;AACxC,OAAOC,UAAU,MAAM,8DAA8D;AAErF,MAAM;EAAEC,YAAY,EAAEC;AAAU,CAAC,GAAGV,QAAQ;;AAE5C;AACA;AACA;AACA;AACA;AACA;AALA,IAOMW,uBAAuB,GAAAC,SAAA,EAD5BN,aAAa,CAAC,GAAGI,SAAS,4BAA4B,CAAC,aAAAG,WAAA,EAAAC,kBAAA;EAAxD,MACMH,uBAAuB,SAAAG,kBAAA,CAE3B;IAAAC,YAAA,G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A,GAhfmCR,iBAAiB,CACrDH,iBAAiB,CAACL,UAAU,CAC9B,CAAC;AAifD;AACA,eAAeiB,uBAAuB","ignoreList":[]}
1
+ {"version":3,"file":"video-player-composite.js","names":["LitElement","html","property","state","HostListener","HostListenerMixin","settings","KalturaPlayerAPI","HybridRenderMixin","VIDEO_PLAYER_CONTENT_STATE","VIDEO_PLAYER_PLAYING_MODE","carbonElement","customElement","BUTTON_POSITION","ifNonEmpty","stablePrefix","c4dPrefix","C4DVideoPlayerComposite","_decorate","_initialize","_HybridRenderMixin","constructor","args","F","d","kind","key","value","_activateEmbeddedVideo","videoId","embeddedVideos","Object","keys","forEach","kalturaPlayer","play","pause","selectorVideoPlayer","querySelector","_cleanAndCreateObserverIntersection","create","_observerIntersectionIntoView","unobserve","_observerIntersectionOutOfView","IntersectionObserver","_intersectionIntoViewHandler","bind","root","closest","rootMargin","threshold","_intersectionOutOfViewHandler","observe","entries","entry","isIntersecting","_getAutoplayPreference","_this$_embedMedia","_this$_embedMedia$the","_this$_embedMedia$the2","updateComplete","_embedMedia","call","then","player","playAllVideos","catch","err","process","env","NODE_ENV","console","warn","pauseAllVideos","decorators","_handleContentStateChange","event","contentState","playingMode","ctaElement","detail","VIDEO","INLINE","_this$_embedMedia2","_handlePlaybackStateChange","isPlaying","_setAutoplayPreference","playbackTriggered","_handleEventTogglePlayback","_this$_embedMedia3","updateAutoplayPreference","_embeddedVideos$video","_embeddedVideos$video2","getIsVideoPlaying","_iframe$contentWindow","iframe","playerContainer","contentWindow","document","type","Boolean","attribute","reflect","BOTTOM_RIGHT","Number","connectedCallback","_superPropGet","backgroundMode","hideCaption","autoPlay","storedPreference","window","matchMedia","matches","intersectionMode","_adobe","prehidingEl","getElementById","atObj","adobe","target","realAtJs","getOffers","getOffer","applyOffers","checkScript","settled","setupIO","onATSettle","removeEventListener","_atPrehidingObserver","disconnect","undefined","_atFallback","clearTimeout","_atSettleHandler","addEventListener","once","MutationObserver","parentNode","documentElement","childList","setTimeout","observer","isRTL","dir","getComputedStyle","direction","attributes","attributeFilter","disconnectedCallback","_ibmPendingEmbedDivs","div","remove","clear","values","_player$destroy","destroy","error","updated","changedProperties","has","_this$_loadVideoData","_loadVideoData","_this$_embedMedia4","renderLightDOM","_this$querySelector","setAttribute","aspectRatio","formatCaption","formatDuration","caption","customVideoDescription","mediaData","videoThumbnailWidth","thumbnail","buttonPosition","currentVideoData","duration","name","thumbnailUrl","getThumbnailUrl","mediaId","width","_t","_","THUMBNAIL","render","_t2","static"],"sources":["components/video-player-v7/video-player-composite.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2020, 2024\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement, html } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport HostListener from '@carbon/web-components/es/globals/decorators/host-listener.js';\nimport HostListenerMixin from '@carbon/web-components/es/globals/mixins/host-listener.js';\nimport settings from '@carbon/ibmdotcom-utilities/es/utilities/settings/settings.js';\nimport KalturaPlayerAPI from '@carbon/ibmdotcom-services/es/services/KalturaPlayerV7/KalturaPlayer.js';\nimport HybridRenderMixin from '../../globals/mixins/hybrid-render';\nimport { MediaData } from '../../internal/vendor/@carbon/ibmdotcom-services-store/types/kalturaPlayerAPIv7';\nimport {\n VIDEO_PLAYER_CONTENT_STATE,\n VIDEO_PLAYER_PLAYING_MODE,\n} from './video-player';\n// Above import is interface-only ref and thus code won't be brought into the build\nimport './video-player';\nimport { carbonElement as customElement } from '@carbon/web-components/es/globals/decorators/carbon-element.js';\nimport { BUTTON_POSITION } from './defs';\nimport ifNonEmpty from '@carbon/web-components/es/globals/directives/if-non-empty.js';\n\nconst { stablePrefix: c4dPrefix } = settings;\n\n/**\n * Component that renders video player from its metadata, etc.\n *\n * @element c4d-video-player-composite-v7\n * @csspart video-player - The video player. Usage `c4d-video-player-composite-v7::part(video-player)`\n */\n@customElement(`${c4dPrefix}-video-player-composite-v7`)\nclass C4DVideoPlayerComposite extends HybridRenderMixin(\n HostListenerMixin(LitElement)\n) {\n /**\n * The placeholder for `_loadVideoData()` Redux action that may be mixed in.\n *\n * @internal\n */\n _loadVideoData?: (videoId: string) => Promise<MediaData>;\n\n /**\n * The placeholder for `_loadVideoData()` Redux action that may be mixed in.\n *\n * @internal\n */\n _embedMedia?: (videoId: string) => Promise<any>;\n\n /**\n * Listener registered on `at-content-rendering-succeeded/failed` while waiting\n * for Adobe Target to settle before setting up the IntersectionObserver.\n * Stored so it can be removed in `disconnectedCallback`.\n */\n private _atSettleHandler?: () => void;\n\n /**\n * Fallback timer ID used when Adobe Target never fires its settle events.\n */\n private _atFallback?: number;\n\n /**\n * Observer watching for removal of the AEP Web SDK (alloy) prehiding style\n * (`<style id=\"alloy-prehiding\">`), which signals that personalization\n * decisions have been rendered. Used instead of the at.js\n * `at-content-rendering-*` events on pages running alloy, which never fires\n * those events.\n */\n private _atPrehidingObserver?: MutationObserver;\n\n /**\n * Placeholder divs parked in `document.body` by `_embedVideoImpl` (mixed in\n * by the container) while a Kaltura embed is queued or in flight. Tracked so\n * `disconnectedCallback` can remove them: once removed, the\n * `getElementById(targetId)` guard in `legacyPromiseKWidget` returns null\n * and the dead embed drains from `_ibmKalturaEmbedQueue` immediately instead\n * of fully embedding a hidden orphaned player.\n *\n * @internal\n */\n _ibmPendingEmbedDivs?: Set<HTMLElement>;\n\n /**\n * The placeholder for `_setAutoplayPreference()` Redux action that may be mixed in.\n */\n // @ts-ignore\n _setAutoplayPreference: (preference: boolean) => void;\n\n /**\n * The placeholder for `_getAutoplayPreference()` Redux action that may be mixed in.\n */\n // @ts-ignore\n _getAutoplayPreference: () => null | boolean;\n\n /**\n * Activate the DOM nodes for the embedded video of the given video ID, and deactivates others.\n *\n * @param videoId The video ID to activate.\n */\n protected _activateEmbeddedVideo(videoId: string) {\n const { embeddedVideos = {} } = this;\n Object.keys(embeddedVideos).forEach((key) => {\n const kalturaPlayer = embeddedVideos[key];\n key === videoId ? kalturaPlayer.play() : kalturaPlayer.pause();\n });\n }\n\n /**\n * The video player.\n */\n protected get _videoPlayer() {\n const { selectorVideoPlayer } = this\n .constructor as typeof C4DVideoPlayerComposite;\n return this.querySelector(selectorVideoPlayer);\n }\n\n /**\n * Clean-up and create intersection observers.\n *\n * When this.intersectionMode, we use intersection observers to track when\n * the video container is in view, and embed / play / pause the video\n * accordingly.\n *\n * @param [options] The options.\n * @param [options.create] `true` to create necessary intersection observers.\n */\n private _cleanAndCreateObserverIntersection({\n create,\n }: { create?: boolean } = {}) {\n // Cleanup.\n if (this._observerIntersectionIntoView) {\n this._observerIntersectionIntoView.unobserve(this);\n }\n if (this._observerIntersectionOutOfView) {\n this._observerIntersectionOutOfView.unobserve(this);\n }\n // Create new intersection observers.\n if (create) {\n this._observerIntersectionIntoView = new IntersectionObserver(\n this._intersectionIntoViewHandler.bind(this),\n {\n root: this.closest('c4d-carousel'),\n rootMargin: '0px',\n threshold: 0.9,\n }\n );\n this._observerIntersectionOutOfView = new IntersectionObserver(\n this._intersectionOutOfViewHandler.bind(this),\n {\n root: this.closest('c4d-carousel'),\n rootMargin: '0px',\n threshold: 0.5,\n }\n );\n this._observerIntersectionIntoView.observe(this);\n this._observerIntersectionOutOfView.observe(this);\n }\n }\n\n /**\n * Observer for when the video container enters into view.\n *\n * Autoplay the video, resecting the users stored autoplay preference.\n */\n private _intersectionIntoViewHandler(entries: IntersectionObserverEntry[]) {\n const { videoId } = this;\n entries.forEach(async (entry) => {\n if (entry.isIntersecting && this._getAutoplayPreference() !== false) {\n await this.updateComplete;\n this._embedMedia?.(videoId)\n ?.then?.((player) => {\n if (player) {\n this.playAllVideos();\n }\n })\n ?.catch?.((err) => {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('[VP-DEBUG] embed failed in IO handler', err);\n }\n });\n }\n });\n }\n\n /**\n * Observer for when the video container goes out of view.\n *\n * Auto-pause the video, video playback controlled by intersection observers\n * here are meant to be ambient, without audio. No reason for playback when\n * user is not seeing the video content.\n */\n private _intersectionOutOfViewHandler(entries: IntersectionObserverEntry[]) {\n entries.forEach((entry) => {\n if (!entry.isIntersecting) {\n this.pauseAllVideos(false);\n }\n });\n }\n\n /**\n * Handles `c4d-video-player-content-state-changed` event.\n * Such event is fired when user changes video content state, e.g. from thumbnail to video player.\n *\n * @param event The event.\n */\n @HostListener('eventContentStateChange')\n protected _handleContentStateChange(event: CustomEvent) {\n const { contentState, playingMode, videoId, ctaElement } = event.detail;\n\n // Store CTA element for potential forwarding\n if (ctaElement) {\n this.ctaElement = ctaElement;\n }\n\n if (\n contentState === VIDEO_PLAYER_CONTENT_STATE.VIDEO &&\n playingMode === VIDEO_PLAYER_PLAYING_MODE.INLINE &&\n videoId\n ) {\n this._embedMedia?.(videoId);\n }\n }\n\n @HostListener('eventPlaybackStateChange')\n protected _handlePlaybackStateChange(event: CustomEvent) {\n const { videoId } = event.detail;\n const { embeddedVideos = {} } = this;\n\n if (this.isPlaying) {\n embeddedVideos[videoId].pause();\n this.isPlaying = false;\n } else {\n embeddedVideos[videoId].play();\n this.isPlaying = true;\n }\n\n this._setAutoplayPreference(this.isPlaying);\n this.playbackTriggered = true;\n }\n\n @HostListener('eventTogglePlayback')\n protected _handleEventTogglePlayback(event: CustomEvent) {\n const { videoId } = event.detail;\n if (videoId) {\n this._setAutoplayPreference(!this.isPlaying);\n\n // First ensure that the media has actually been embedded.\n this._embedMedia?.(videoId);\n if (this.isPlaying) {\n this.pauseAllVideos();\n } else {\n this.playAllVideos();\n }\n }\n }\n\n pauseAllVideos(updateAutoplayPreference = true) {\n const { embeddedVideos = {} } = this;\n\n Object.keys(embeddedVideos).forEach((videoId) => {\n embeddedVideos[videoId]?.pause();\n });\n this.isPlaying = false;\n if (updateAutoplayPreference) {\n this._setAutoplayPreference(false);\n }\n }\n\n playAllVideos(updateAutoplayPreference = true) {\n const { embeddedVideos = {} } = this;\n\n Object.keys(embeddedVideos).forEach((videoId) => {\n embeddedVideos[videoId]?.play();\n });\n this.isPlaying = true;\n this.playbackTriggered = true;\n if (updateAutoplayPreference) {\n this._setAutoplayPreference(true);\n }\n }\n getIsVideoPlaying() {\n const iframe = this.querySelector('iframe');\n const playerContainer =\n iframe?.contentWindow?.document.querySelector('div.play-state');\n return !(playerContainer == null);\n }\n\n /**\n * `true` to autoplay the videos.\n */\n @property({ type: Boolean, attribute: 'auto-play' })\n autoPlay = false;\n\n /**\n * `true` load videos with sound muted.\n */\n @property({ type: Boolean, attribute: 'muted' })\n muted = false;\n\n /**\n * The embedded Kaltura player element (that has APIs), keyed by the video ID.\n */\n @property({ attribute: false })\n embeddedVideos?: { [videoId: string]: any };\n\n /**\n * Optional custom video caption.\n */\n @property({ reflect: true, attribute: 'caption' })\n caption?: '';\n\n /**\n * Custom video description. This property should only be set when `playing-mode=\"lightbox\"`.\n */\n @property({ reflect: true, attribute: 'video-description' })\n customVideoDescription?: string;\n\n /**\n * The formatter for the video caption, composed with the video name and the video duration.\n * Should be changed upon the locale the UI is rendered with.\n */\n @property({ attribute: false })\n formatCaption?: ({\n duration,\n name,\n }: {\n duration?: string;\n name?: string;\n }) => string;\n\n /**\n * The formatter for the video duration.\n * Should be changed upon the locale the UI is rendered with.\n */\n @property({ attribute: false })\n formatDuration?: ({ duration }: { duration?: number }) => string;\n\n /**\n * `true` to hide the caption.\n */\n @property({ type: Boolean, attribute: 'hide-caption' })\n hideCaption = false;\n\n /**\n * `true` to autoplay, mute, and hide player UI.\n */\n @property({ type: Boolean, attribute: 'background-mode', reflect: true })\n backgroundMode = false;\n\n /**\n * Triggers playback on intersection with the viewport / carousel.\n */\n @property({ attribute: 'intersection-mode', reflect: true, type: Boolean })\n intersectionMode = false;\n\n /**\n * The position of the toggle playback button.\n */\n @property({ attribute: 'button-position', reflect: true })\n buttonPosition = BUTTON_POSITION.BOTTOM_RIGHT;\n\n /**\n * Track when we have triggered initial playback.\n */\n @state()\n playbackTriggered = false;\n\n /**\n * The video data, keyed by the video ID.\n */\n @property({ attribute: false })\n mediaData?: { [videoId: string]: MediaData };\n\n /**\n * The video ID.\n */\n @property({ attribute: 'video-id' })\n videoId = '';\n\n /**\n * The aspect ratio.\n */\n @property({ attribute: 'aspect-ratio' })\n aspectRatio?: '';\n\n /**\n * The current playback state\n */\n @property({ type: Boolean })\n isPlaying = false;\n\n /**\n * The video player's mode showing Inline or Lightbox.\n */\n @property({ reflect: true, attribute: 'playing-mode' })\n playingMode = VIDEO_PLAYER_PLAYING_MODE.INLINE;\n\n /**\n * Optional custom video thumbnail\n */\n @property({ reflect: true, attribute: 'thumbnail' })\n thumbnail?: '';\n\n /**\n * The video thumbnail width.\n */\n @property({ type: Number, attribute: 'video-thumbnail-width' })\n videoThumbnailWidth = 3;\n\n /**\n * Determines if the direction is right-to-left\n */\n @property({ type: Boolean })\n isRTL = false;\n\n /**\n * Stored CTA element for forwarding to lightbox\n */\n @property({ attribute: false })\n ctaElement?: HTMLElement | null;\n\n private observer!: MutationObserver;\n\n /**\n * Observe when the video container enters into view.\n */\n private _observerIntersectionIntoView?: IntersectionObserver;\n\n /**\n * Observe when the video container goes out of view.\n */\n private _observerIntersectionOutOfView?: IntersectionObserver;\n\n connectedCallback() {\n super.connectedCallback();\n\n if (this.backgroundMode) {\n this.hideCaption = true;\n }\n\n if (this.autoPlay || this.backgroundMode) {\n const storedPreference = this._getAutoplayPreference();\n if (storedPreference === null) {\n this.isPlaying = !window.matchMedia('(prefers-reduced-motion: reduce)')\n .matches;\n } else {\n this.isPlaying = storedPreference;\n }\n }\n\n if (this.intersectionMode) {\n // alloy never fires at.js events, so we watch for #alloy-prehiding\n // removal instead; classic at.js fires at-content-rendering-*. No\n // signal pending means no personalization is coming, so skip the wait.\n const prehidingEl = document.getElementById('alloy-prehiding');\n const atObj = (window as any).adobe?.target;\n const realAtJs =\n !!atObj &&\n (typeof atObj.getOffers === 'function' ||\n typeof atObj.getOffer === 'function' ||\n typeof atObj.applyOffers === 'function');\n if (prehidingEl || realAtJs) {\n // Warm the Kaltura SDK while we wait for AT to settle, so loader.js\n // downloads in parallel with the AT defer instead of after it.\n KalturaPlayerAPI.checkScript().catch(() => {});\n let settled = false;\n const setupIO = () =>\n this._cleanAndCreateObserverIntersection({ create: true });\n const onATSettle = () => {\n if (settled) {\n return;\n }\n settled = true;\n document.removeEventListener(\n 'at-content-rendering-succeeded',\n onATSettle\n );\n document.removeEventListener(\n 'at-content-rendering-failed',\n onATSettle\n );\n if (this._atPrehidingObserver) {\n this._atPrehidingObserver.disconnect();\n this._atPrehidingObserver = undefined;\n }\n if (this._atFallback) {\n clearTimeout(this._atFallback);\n this._atFallback = undefined;\n }\n this._atSettleHandler = undefined;\n setupIO();\n };\n this._atSettleHandler = onATSettle;\n document.addEventListener(\n 'at-content-rendering-succeeded',\n onATSettle,\n { once: true }\n );\n document.addEventListener('at-content-rendering-failed', onATSettle, {\n once: true,\n });\n if (prehidingEl) {\n // alloy: settle when the prehiding style is removed from the DOM.\n this._atPrehidingObserver = new MutationObserver(() => {\n if (!document.getElementById('alloy-prehiding')) {\n onATSettle();\n }\n });\n this._atPrehidingObserver.observe(\n prehidingEl.parentNode || document.documentElement,\n { childList: true }\n );\n // Guard against a race: removed between getElementById and observe().\n if (!document.getElementById('alloy-prehiding')) {\n onATSettle();\n }\n }\n // Fallback: if no settle signal ever arrives, set up IO after 4s so video still works\n if (!settled) {\n this._atFallback = setTimeout(onATSettle, 4000) as unknown as number;\n }\n } else {\n this._cleanAndCreateObserverIntersection({ create: true });\n }\n }\n\n // initializing the MutationObserver to observe for changes in the direction mode\n this.observer = new MutationObserver(() => {\n this.isRTL =\n this.dir === 'rtl' || getComputedStyle(this).direction === 'rtl';\n });\n\n // observing the 'dir' attr in the root element\n this.observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['dir'],\n });\n\n // Initial check for the direction\n this.isRTL =\n this.dir === 'rtl' || getComputedStyle(this).direction === 'rtl';\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n if (this._atSettleHandler) {\n document.removeEventListener(\n 'at-content-rendering-succeeded',\n this._atSettleHandler\n );\n document.removeEventListener(\n 'at-content-rendering-failed',\n this._atSettleHandler\n );\n this._atSettleHandler = undefined;\n }\n if (this._atPrehidingObserver) {\n this._atPrehidingObserver.disconnect();\n this._atPrehidingObserver = undefined;\n }\n if (this._atFallback) {\n clearTimeout(this._atFallback);\n this._atFallback = undefined;\n }\n // Removing these placeholders makes legacyPromiseKWidget's getElementById\n // guard fail fast, draining dead embeds from the queue instead of\n // blocking the next one behind a hidden orphaned player.\n if (this._ibmPendingEmbedDivs) {\n this._ibmPendingEmbedDivs.forEach((div) => div.remove());\n this._ibmPendingEmbedDivs.clear();\n }\n this._cleanAndCreateObserverIntersection();\n const { embeddedVideos = {} } = this;\n Object.values(embeddedVideos).forEach((player: any) => {\n try {\n player?.destroy?.();\n } catch (error) {\n // Ignore errors from destroy.\n }\n });\n }\n\n updated(changedProperties) {\n if (changedProperties.has('videoId')) {\n const { autoPlay, videoId, backgroundMode } = this;\n this._activateEmbeddedVideo(videoId);\n if (videoId) {\n this._loadVideoData?.(videoId);\n if (autoPlay || backgroundMode) {\n this._embedMedia?.(videoId);\n }\n }\n }\n }\n\n renderLightDOM() {\n // setting the direction mode of the video player.\n this.querySelector('.c4d--video-player__video')?.setAttribute(\n 'dir-mode',\n `${this.isRTL ? 'rtl' : 'ltr'}`\n );\n\n const {\n aspectRatio,\n formatCaption,\n formatDuration,\n hideCaption,\n caption,\n customVideoDescription,\n mediaData = {},\n videoId,\n videoThumbnailWidth,\n thumbnail,\n playingMode,\n buttonPosition,\n } = this;\n\n const { [videoId]: currentVideoData = {} as MediaData } = mediaData;\n const { duration, name } = currentVideoData;\n const thumbnailUrl =\n thumbnail ||\n KalturaPlayerAPI.getThumbnailUrl({\n mediaId: videoId,\n width: videoThumbnailWidth,\n });\n return html`\n <c4d-video-player-v7\n part=\"video-player\"\n duration=\"${ifNonEmpty(duration)}\"\n ?hide-caption=${hideCaption}\n name=\"${ifNonEmpty(caption || name)}\"\n video-description=\"${ifNonEmpty(customVideoDescription)}\"\n thumbnail-url=\"${ifNonEmpty(thumbnailUrl)}\"\n video-id=\"${ifNonEmpty(videoId)}\"\n aspect-ratio=\"${ifNonEmpty(aspectRatio)}\"\n playing-mode=\"${ifNonEmpty(playingMode)}\"\n content-state=\"${this.playbackTriggered\n ? VIDEO_PLAYER_CONTENT_STATE.VIDEO\n : VIDEO_PLAYER_CONTENT_STATE.THUMBNAIL}\"\n button-position=\"${buttonPosition}\"\n .formatCaption=\"${ifNonEmpty(formatCaption)}\"\n .formatDuration=\"${ifNonEmpty(formatDuration)}\"\n .isPlaying=${this.isPlaying}>\n </c4d-video-player-v7>\n `;\n }\n\n render() {\n return html` <slot></slot> `;\n }\n\n /**\n * A selector selecting the video player component.\n */\n static get selectorVideoPlayer() {\n return `${c4dPrefix}-video-player-v7`;\n }\n\n /**\n * The name of the custom event fired after video content state is changed upon a user gesture.\n */\n static get eventContentStateChange() {\n return `${c4dPrefix}-video-player-content-state-changed`;\n }\n\n /**\n * The name of the custom event fired requesting playback state change.\n */\n static get eventPlaybackStateChange() {\n return `${c4dPrefix}-video-player-playback-state-changed`;\n }\n\n /**\n * The name of the custom event fired requesting to toggle playback.\n */\n static get eventTogglePlayback() {\n return `${c4dPrefix}-video-player-toggle-playback`;\n }\n}\n\n/* @__GENERATE_REACT_CUSTOM_ELEMENT_TYPE__ */\nexport default C4DVideoPlayerComposite;\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,EAAEC,IAAI,QAAQ,KAAK;AACtC,SAASC,QAAQ,EAAEC,KAAK,QAAQ,mBAAmB;AACnD,OAAOC,YAAY,MAAM,+DAA+D;AACxF,OAAOC,iBAAiB,MAAM,2DAA2D;AACzF,OAAOC,QAAQ,MAAM,+DAA+D;AACpF,OAAOC,gBAAgB,MAAM,yEAAyE;AACtG,OAAOC,iBAAiB,MAAM,uCAAoC;AAElE,SACEC,0BAA0B,EAC1BC,yBAAy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MAAAoK,MAAA;MAAAnK,GAAA;MAAAC,KAAA,EAGA,SAAAA,CAAA,EAAiC;QAC/B,OAAO,GAAGX,SAAS,kBAAkB;MACvC;;MAEA;AACF;AACA;IAFE;MAAAS,IAAA;MAAAoK,MAAA;MAAAnK,GAAA;MAAAC,KAAA,EAGA,SAAAA,CAAA,EAAqC;QACnC,OAAO,GAAGX,SAAS,qCAAqC;MAC1D;;MAEA;AACF;AACA;IAFE;MAAAS,IAAA;MAAAoK,MAAA;MAAAnK,GAAA;MAAAC,KAAA,EAGA,SAAAA,CAAA,EAAsC;QACpC,OAAO,GAAGX,SAAS,sCAAsC;MAC3D;;MAEA;AACF;AACA;IAFE;MAAAS,IAAA;MAAAoK,MAAA;MAAAnK,GAAA;MAAAC,KAAA,EAGA,SAAAA,CAAA,EAAiC;QAC/B,OAAO,GAAGX,SAAS,+BAA+B;MACpD;IAAC;EAAA;AAAA,GAroBmCR,iBAAiB,CACrDH,iBAAiB,CAACL,UAAU,CAC9B,CAAC;AAsoBD;AACA,eAAeiB,uBAAuB","ignoreList":[]}
@@ -68,6 +68,16 @@ export declare const C4DVideoPlayerContainerMixin: <T extends Constructor<HTMLEl
68
68
  _requestsEmbedVideo: {
69
69
  [videoId: string]: Promise<any>;
70
70
  };
71
+ /**
72
+ * Placeholder divs parked in `document.body` by `_embedVideoImpl` while a
73
+ * Kaltura embed is queued or in flight. `disconnectedCallback` (in the
74
+ * composite) removes them so dead embeds drain from
75
+ * `_ibmKalturaEmbedQueue` immediately after this component is removed
76
+ * (e.g. when Adobe Target swaps DC for an XF).
77
+ *
78
+ * @internal
79
+ */
80
+ _ibmPendingEmbedDivs?: Set<HTMLElement>;
71
81
  /**
72
82
  * Custom video name
73
83
  */
@@ -827,6 +837,16 @@ declare const C4DVideoPlayerContainer_base: {
827
837
  _requestsEmbedVideo: {
828
838
  [videoId: string]: Promise<any>;
829
839
  };
840
+ /**
841
+ * Placeholder divs parked in `document.body` by `_embedVideoImpl` while a
842
+ * Kaltura embed is queued or in flight. `disconnectedCallback` (in the
843
+ * composite) removes them so dead embeds drain from
844
+ * `_ibmKalturaEmbedQueue` immediately after this component is removed
845
+ * (e.g. when Adobe Target swaps DC for an XF).
846
+ *
847
+ * @internal
848
+ */
849
+ _ibmPendingEmbedDivs?: Set<HTMLElement>;
830
850
  /**
831
851
  * Custom video name
832
852
  */
@@ -128,6 +128,16 @@ export const C4DVideoPlayerContainerMixin = Base => {
128
128
  */
129
129
  // Not using TypeScript `private` due to: microsoft/TypeScript#17744
130
130
 
131
+ /**
132
+ * Placeholder divs parked in `document.body` by `_embedVideoImpl` while a
133
+ * Kaltura embed is queued or in flight. `disconnectedCallback` (in the
134
+ * composite) removes them so dead embeds drain from
135
+ * `_ibmKalturaEmbedQueue` immediately after this component is removed
136
+ * (e.g. when Adobe Target swaps DC for an XF).
137
+ *
138
+ * @internal
139
+ */
140
+
131
141
  /**
132
142
  * Custom video name
133
143
  */
@@ -327,16 +337,59 @@ export const C4DVideoPlayerContainerMixin = Base => {
327
337
  if (!videoPlayer) {
328
338
  throw new TypeError('Cannot find the video player component to put the video content into.');
329
339
  }
330
- videoPlayer.appendChild(div);
331
- const embedVideoHandle = await KalturaPlayerAPI.embedMedia(videoId, playerId, this._getPlayerOptions());
332
- const {
333
- width,
334
- height
335
- } = await KalturaPlayerAPI.api(videoId);
336
- videoPlayer.style.setProperty('--native-file-width', `${width}px`);
337
- videoPlayer.style.setProperty('--native-file-height', `${height}px`);
338
- videoPlayer.style.setProperty('--native-file-aspect-ratio', `${width} / ${height}`);
339
- doc.getElementById(playerId).dataset.videoId = videoId;
340
+ // Parked in document.body, not videoPlayer, so Lit's renderLightDOM()
341
+ // can't detach it mid-embed (the queue wait can run 6-20s) and orphan
342
+ // legacyPromiseKWidget's getElementById(playerId) lookup.
343
+ div.style.cssText = 'position:fixed;left:-9999px;visibility:hidden';
344
+ document.body.appendChild(div);
345
+ // Tracked so disconnectedCallback can remove it if this component is
346
+ // torn down mid-queue, freeing the embed instead of leaving it to
347
+ // finish as a hidden orphan.
348
+ if (!this._ibmPendingEmbedDivs) {
349
+ this._ibmPendingEmbedDivs = new Set();
350
+ }
351
+ this._ibmPendingEmbedDivs.add(div);
352
+ let embedVideoHandle;
353
+ try {
354
+ var _this$_videoPlayer, _this$_ibmPendingEmbe2;
355
+ // Run the embed and the metadata fetch in parallel — saves a round-trip.
356
+ const [handle, {
357
+ width,
358
+ height
359
+ }] = await Promise.all([KalturaPlayerAPI.embedMedia(videoId, playerId, this._getPlayerOptions()), KalturaPlayerAPI.api(videoId)]);
360
+ embedVideoHandle = handle;
361
+
362
+ // If we were disconnected during the wait, discard the embed.
363
+ if (!this.isConnected) {
364
+ var _this$_ibmPendingEmbe;
365
+ div.remove();
366
+ (_this$_ibmPendingEmbe = this._ibmPendingEmbedDivs) === null || _this$_ibmPendingEmbe === void 0 || _this$_ibmPendingEmbe.delete(div);
367
+ return null;
368
+ }
369
+
370
+ // Move the div (now containing Kaltura's iframe) into the video player.
371
+ // Re-fetch _videoPlayer in case Lit re-rendered and replaced the element
372
+ // while we were awaiting the embed queue.
373
+ const currentVideoPlayer = (_this$_videoPlayer = this._videoPlayer) !== null && _this$_videoPlayer !== void 0 ? _this$_videoPlayer : videoPlayer;
374
+ div.style.cssText = '';
375
+ currentVideoPlayer.appendChild(div);
376
+ (_this$_ibmPendingEmbe2 = this._ibmPendingEmbedDivs) === null || _this$_ibmPendingEmbe2 === void 0 || _this$_ibmPendingEmbe2.delete(div);
377
+ currentVideoPlayer.style.setProperty('--native-file-width', `${width}px`);
378
+ currentVideoPlayer.style.setProperty('--native-file-height', `${height}px`);
379
+ currentVideoPlayer.style.setProperty('--native-file-aspect-ratio', `${width} / ${height}`);
380
+ } catch (error) {
381
+ var _this$_ibmPendingEmbe3;
382
+ // Clean up hidden div if embed failed
383
+ if (div.parentElement) {
384
+ div.remove();
385
+ }
386
+ (_this$_ibmPendingEmbe3 = this._ibmPendingEmbedDivs) === null || _this$_ibmPendingEmbe3 === void 0 || _this$_ibmPendingEmbe3.delete(div);
387
+ throw error;
388
+ }
389
+ const playerEl = doc.getElementById(playerId);
390
+ if (playerEl) {
391
+ playerEl.dataset.videoId = videoId;
392
+ }
340
393
  const videoEmbed = (_getElementById = doc.getElementById(playerId)) === null || _getElementById === void 0 ? void 0 : _getElementById.firstElementChild;
341
394
  if (videoEmbed) {
342
395
  videoEmbed.focus({