@carbon/ibmdotcom-web-components 2.23.0 → 2.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/custom-elements.json +17 -9
  2. package/dist/dotcom-shell.js +3 -3
  3. package/dist/dotcom-shell.min.js +2 -2
  4. package/dist/ibmdotcom-web-components-dotcom-shell.js +3 -3
  5. package/dist/ibmdotcom-web-components-dotcom-shell.min.js +2 -2
  6. package/dist/{index-4a2b99e5.js → index-1dfaa907.js} +529 -701
  7. package/dist/{index-90537714.js → index-8e5904a0.js} +5 -5
  8. package/dist/{left-nav-menu-ccf3a6ec.js → left-nav-menu-08b77355.js} +2 -2
  9. package/dist/{left-nav-menu-category-heading-3016e990.js → left-nav-menu-category-heading-1874e85f.js} +2 -2
  10. package/dist/{left-nav-menu-category-heading-cb17a84f.js → left-nav-menu-category-heading-907c5870.js} +3 -3
  11. package/dist/{left-nav-menu-a22a1a6e.js → left-nav-menu-ee66480f.js} +3 -3
  12. package/dist/{left-nav-menu-item-18d051bc.js → left-nav-menu-item-463c0a47.js} +2 -2
  13. package/dist/{left-nav-menu-item-85006ef1.js → left-nav-menu-item-62b3aeb4.js} +3 -3
  14. package/dist/{left-nav-menu-section-027d6043.js → left-nav-menu-section-36fa5f37.js} +2 -2
  15. package/dist/{left-nav-menu-section-cee5e8b9.js → left-nav-menu-section-620f3e39.js} +3 -3
  16. package/dist/{left-nav-overlay-225f893f.js → left-nav-overlay-11083652.js} +2 -2
  17. package/dist/{left-nav-overlay-e559d687.js → left-nav-overlay-4aa89969.js} +3 -3
  18. package/dist/{megamenu-category-group-75dd0587.js → megamenu-category-group-38ebe02a.js} +2 -2
  19. package/dist/{megamenu-category-group-89eb9dd2.js → megamenu-category-group-768aa48a.js} +3 -3
  20. package/dist/{megamenu-category-group-copy-94e321c8.js → megamenu-category-group-copy-0036630c.js} +3 -3
  21. package/dist/{megamenu-category-group-copy-533d77ca.js → megamenu-category-group-copy-0770e2d1.js} +2 -2
  22. package/dist/{megamenu-category-heading-5c562696.js → megamenu-category-heading-25325ce1.js} +3 -3
  23. package/dist/{megamenu-category-heading-370cb6dc.js → megamenu-category-heading-5fae5a7f.js} +2 -2
  24. package/dist/{megamenu-category-link-6060a359.js → megamenu-category-link-3a79d2ea.js} +2 -2
  25. package/dist/{megamenu-category-link-66573e4b.js → megamenu-category-link-d1712222.js} +3 -3
  26. package/dist/{megamenu-category-link-group-83d39e8b.js → megamenu-category-link-group-ba6e3528.js} +3 -3
  27. package/dist/{megamenu-category-link-group-4f9fcb1a.js → megamenu-category-link-group-fe0164c9.js} +2 -2
  28. package/dist/{megamenu-left-navigation-35cca50a.js → megamenu-left-navigation-29fdbefc.js} +2 -2
  29. package/dist/{megamenu-left-navigation-ab38535c.js → megamenu-left-navigation-dba059eb.js} +3 -3
  30. package/dist/{megamenu-overlay-977e9e98.js → megamenu-overlay-6fcf6e91.js} +2 -2
  31. package/dist/{megamenu-overlay-9b73f118.js → megamenu-overlay-899719ba.js} +3 -3
  32. package/dist/{megamenu-tab-e4488ebd.js → megamenu-tab-1835d1a2.js} +3 -3
  33. package/dist/{megamenu-tab-69382393.js → megamenu-tab-1a79a248.js} +2 -2
  34. package/es/components/background-media/background-media.css.js +1 -1
  35. package/es/components/background-media/background-media.d.ts +7 -1
  36. package/es/components/background-media/background-media.js +29 -1
  37. package/es/components/background-media/background-media.js.map +1 -1
  38. package/es/components/background-media/defs.d.ts +5 -1
  39. package/es/components/background-media/defs.js +2 -1
  40. package/es/components/background-media/defs.js.map +1 -1
  41. package/es/components/card-group/card-group.css.js +1 -1
  42. package/es/components/card-group/card-group.d.ts +688 -1
  43. package/es/components/card-group/card-group.js +47 -12
  44. package/es/components/card-group/card-group.js.map +1 -1
  45. package/es/components/card-section-offset/card-section-offset.css.js +1 -1
  46. package/es/components/content-block/content-block.css.js +1 -1
  47. package/es/components/content-block-cards/content-block-cards.d.ts +2 -1
  48. package/es/components/content-block-cards/content-block-cards.js +17 -1
  49. package/es/components/content-block-cards/content-block-cards.js.map +1 -1
  50. package/es/components/cta/video-cta-container.d.ts +1 -0
  51. package/es/components/lightbox-media-viewer/lightbox-video-player-container.d.ts +1 -0
  52. package/es/components/masthead/left-nav.d.ts +2 -1
  53. package/es/components/masthead/left-nav.js +23 -6
  54. package/es/components/masthead/left-nav.js.map +1 -1
  55. package/es/components/table-of-contents/table-of-contents.js +2 -2
  56. package/es/components/table-of-contents/table-of-contents.js.map +1 -1
  57. package/es/components/video-player/video-player-container.d.ts +3 -1
  58. package/es/components/video-player/video-player-container.js +276 -195
  59. package/es/components/video-player/video-player-container.js.map +1 -1
  60. package/es/components/video-player/video-player.d.ts +2 -1
  61. package/es/components/video-player/video-player.js +5 -3
  62. package/es/components/video-player/video-player.js.map +1 -1
  63. package/es/components-react/video-player/video-player.d.ts +1 -0
  64. package/es/internal/vendor/@carbon/ibmdotcom-services/services/KalturaPlayer/KalturaPlayer.js +7 -1
  65. package/es/internal/vendor/@carbon/ibmdotcom-utilities/utilities/settings/settings.js +2 -2
  66. package/lib/components/background-media/defs.js +2 -1
  67. package/lib/components/background-media/defs.js.map +1 -1
  68. package/lib/internal/vendor/@carbon/ibmdotcom-services/services/KalturaPlayer/KalturaPlayer.js +7 -1
  69. package/lib/internal/vendor/@carbon/ibmdotcom-utilities/utilities/settings/settings.js +2 -2
  70. package/package.json +6 -6
@@ -1,11 +1,11 @@
1
- import _decorate from "@babel/runtime/helpers/esm/decorate";
2
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+ import _decorate from "@babel/runtime/helpers/esm/decorate";
3
3
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
4
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
5
  /**
6
6
  * @license
7
7
  *
8
- * Copyright IBM Corp. 2020, 2024
8
+ * Copyright IBM Corp. 2020, 2025
9
9
  *
10
10
  * This source code is licensed under the Apache-2.0 license found in the
11
11
  * LICENSE file in the root directory of this source tree.
@@ -13,6 +13,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
13
13
 
14
14
  import { bindActionCreators } from 'redux';
15
15
  import 'lit';
16
+ import { property } from 'lit/decorators.js';
16
17
  import KalturaPlayerAPI from '@carbon/ibmdotcom-services/es/services/KalturaPlayer/KalturaPlayer.js';
17
18
  import settings from '@carbon/ibmdotcom-utilities/es/utilities/settings/settings.js';
18
19
  import store from '../../internal/vendor/@carbon/ibmdotcom-services-store/store.js';
@@ -68,204 +69,284 @@ export const C4DVideoPlayerContainerMixin = Base => {
68
69
  /**
69
70
  * A mix-in class that sets up and cleans up event listeners defined by `@HostListener` decorator.
70
71
  */
71
- class C4DVideoPlayerContainerMixinImpl extends StableSelectorMixin(Base) {
72
- constructor(...args) {
73
- var _this;
74
- super(...args);
75
- _this = this;
76
- /**
77
- * The video player.
78
- */
79
- /**
80
- * The embedded Kaltura player element (that has `.sendNotification()`, etc. APIs), keyed by the video ID.
81
- */
82
- /**
83
- * The request for the embedded Kaltura player element (that has `.sendNotification()`, etc. APIs), keyed by the video ID.
84
- *
85
- * @protected
86
- */
87
- // Not using TypeScript `private` due to: microsoft/TypeScript#17744
88
- _defineProperty(this, "_requestsEmbedVideo", {});
89
- /**
90
- * Sends the API call for embedding video for the given video ID, and tracks the progress and the error of the REST call.
91
- *
92
- * @param videoId The video ID.
93
- * @internal
94
- */
95
- _defineProperty(this, "_embedMedia", async function (videoId) {
96
- const {
97
- _requestsEmbedVideo: requestsEmbedVideo
98
- } = _this;
99
- const requestEmbedVideo = requestsEmbedVideo[videoId];
100
- if (requestEmbedVideo) {
101
- return requestEmbedVideo;
72
+ let C4DVideoPlayerContainerMixinImpl = _decorate(null, function (_initialize, _StableSelectorMixin) {
73
+ class C4DVideoPlayerContainerMixinImpl extends _StableSelectorMixin {
74
+ constructor(...args) {
75
+ super(...args);
76
+ _initialize(this);
77
+ }
78
+ }
79
+ return {
80
+ F: C4DVideoPlayerContainerMixinImpl,
81
+ d: [{
82
+ kind: "field",
83
+ key: "_requestsEmbedVideo",
84
+ value() {
85
+ return {};
102
86
  }
103
- const promiseEmbedVideo = _this._embedVideoImpl(videoId);
104
- _this._setRequestEmbedVideoInProgress(videoId, promiseEmbedVideo);
105
- try {
106
- _this._setEmbeddedVideo(videoId, await promiseEmbedVideo);
107
- } catch (error) {
108
- _this._setErrorRequestEmbedVideo(videoId, error);
87
+ }, {
88
+ kind: "field",
89
+ decorators: [property({
90
+ type: String,
91
+ attribute: 'customvideoname'
92
+ })],
93
+ key: "customVideoName",
94
+ value() {
95
+ return '';
109
96
  }
110
- return promiseEmbedVideo;
111
- });
112
- _defineProperty(this, "prefersAutoplayStorageKey", `${c4dPrefix}-background-video-prefers-autoplay`);
113
- }
114
- /**
115
- * Sets the state that the API call for embedding the video for the given video ID is in progress.
116
- *
117
- * @param videoId The video ID.
118
- * @param request The promise of the API call for embedding the video of the given video ID that is in progress.
119
- * @private
120
- */
121
- // Not using TypeScript `private` due to: microsoft/TypeScript#17744
122
- _setRequestEmbedVideoInProgress(videoId, request) {
123
- const {
124
- _requestsEmbedVideo: oldRequestsEmbedVideo
125
- } = this;
126
- this._requestsEmbedVideo = _objectSpread(_objectSpread({}, oldRequestsEmbedVideo), {}, {
127
- [videoId]: request
128
- });
129
- }
97
+ }, {
98
+ kind: "method",
99
+ key: "_setRequestEmbedVideoInProgress",
100
+ value:
101
+ /**
102
+ * The video player.
103
+ */
130
104
 
131
- /**
132
- * Set the state that the API call for embedding the video for the given video ID is failed.
133
- *
134
- * @param videoId The video ID.
135
- * @param error An error from the API call for embedding the video of the given video ID.
136
- * @private
137
- */
138
- // Not using TypeScript `private` due to: microsoft/TypeScript#17744
139
- _setErrorRequestEmbedVideo(videoId, error) {
140
- this._setRequestEmbedVideoInProgress(videoId, Promise.reject(error));
141
- }
105
+ /**
106
+ * The embedded Kaltura player element (that has `.sendNotification()`, etc. APIs), keyed by the video ID.
107
+ */
142
108
 
143
- /**
144
- * Sets the given embedded Kaltura player element (that has `.sendNotification()`, etc. APIs) for the given video ID.
145
- *
146
- * @param videoId The video ID.
147
- * @param kWidget The embedded Kaltura player element (that has `.sendNotification()`, etc. APIs).
148
- * @private
149
- */
150
- // Not using TypeScript `private` due to: microsoft/TypeScript#17744
151
- _setEmbeddedVideo(videoId, kWidget) {
152
- this._setRequestEmbedVideoInProgress(videoId, Promise.resolve(kWidget));
153
- const {
154
- embeddedVideos: oldEmbeddedVideos
155
- } = this;
156
- this.embeddedVideos = _objectSpread(_objectSpread({}, oldEmbeddedVideos), {}, {
157
- [videoId]: kWidget
158
- });
159
- }
160
- _setAutoplayPreference(preference) {
161
- const updatedValue = preference ? '1' : '0';
162
- localStorage.setItem(`${this.prefersAutoplayStorageKey}`, updatedValue);
163
- }
164
- _getAutoplayPreference() {
165
- const storedValue = localStorage.getItem(`${this.prefersAutoplayStorageKey}`);
166
- if (storedValue === null) {
167
- return !window.matchMedia('(prefers-reduced-motion: reduce)').matches;
168
- } else {
169
- return Boolean(parseInt(storedValue, 10));
170
- }
171
- }
172
- _getPlayerOptions() {
173
- const {
174
- backgroundMode,
175
- intersectionMode,
176
- autoPlay,
177
- muted
178
- } = this;
179
- let playerOptions = {};
180
- const autoplayPreference = this._getAutoplayPreference();
181
- switch (true) {
182
- case autoPlay:
183
- playerOptions = {
184
- autoMute: muted,
185
- autoPlay: autoplayPreference
186
- };
187
- break;
188
- case backgroundMode || intersectionMode:
189
- playerOptions = {
190
- 'topBarContainer.plugin': false,
191
- 'controlBarContainer.plugin': false,
192
- 'largePlayBtn.plugin': false,
193
- 'loadingSpinner.plugin': false,
194
- 'unMuteOverlayButton.plugin': false,
195
- 'EmbedPlayer.DisableVideoTagSupport': false,
196
- loop: true,
197
- autoMute: true,
198
- autoPlay: autoplayPreference,
199
- // Turn off CTA's including mid-roll card and end cards.
200
- 'ibm.callToActions': false,
201
- // Turn off captions display, background/ambient videos have no
202
- // audio.
203
- closedCaptions: {
204
- plugin: false
109
+ /**
110
+ * The request for the embedded Kaltura player element (that has `.sendNotification()`, etc. APIs), keyed by the video ID.
111
+ *
112
+ * @protected
113
+ */
114
+ // Not using TypeScript `private` due to: microsoft/TypeScript#17744
115
+
116
+ /**
117
+ * Sets the state that the API call for embedding the video for the given video ID is in progress.
118
+ *
119
+ * @param videoId The video ID.
120
+ * @param request The promise of the API call for embedding the video of the given video ID that is in progress.
121
+ * @private
122
+ */
123
+ // Not using TypeScript `private` due to: microsoft/TypeScript#17744
124
+ function _setRequestEmbedVideoInProgress(videoId, request) {
125
+ const {
126
+ _requestsEmbedVideo: oldRequestsEmbedVideo
127
+ } = this;
128
+ this._requestsEmbedVideo = _objectSpread(_objectSpread({}, oldRequestsEmbedVideo), {}, {
129
+ [videoId]: request
130
+ });
131
+ }
132
+
133
+ /**
134
+ * Set the state that the API call for embedding the video for the given video ID is failed.
135
+ *
136
+ * @param videoId The video ID.
137
+ * @param error An error from the API call for embedding the video of the given video ID.
138
+ * @private
139
+ */
140
+ // Not using TypeScript `private` due to: microsoft/TypeScript#17744
141
+ }, {
142
+ kind: "method",
143
+ key: "_setErrorRequestEmbedVideo",
144
+ value: function _setErrorRequestEmbedVideo(videoId, error) {
145
+ this._setRequestEmbedVideoInProgress(videoId, Promise.reject(error));
146
+ }
147
+
148
+ /**
149
+ * Sets the given embedded Kaltura player element (that has `.sendNotification()`, etc. APIs) for the given video ID.
150
+ *
151
+ * @param videoId The video ID.
152
+ * @param kWidget The embedded Kaltura player element (that has `.sendNotification()`, etc. APIs).
153
+ * @private
154
+ */
155
+ // Not using TypeScript `private` due to: microsoft/TypeScript#17744
156
+ }, {
157
+ kind: "method",
158
+ key: "_setEmbeddedVideo",
159
+ value: function _setEmbeddedVideo(videoId, kWidget) {
160
+ this._setRequestEmbedVideoInProgress(videoId, Promise.resolve(kWidget));
161
+ const {
162
+ embeddedVideos: oldEmbeddedVideos
163
+ } = this;
164
+ this.embeddedVideos = _objectSpread(_objectSpread({}, oldEmbeddedVideos), {}, {
165
+ [videoId]: kWidget
166
+ });
167
+ }
168
+ }, {
169
+ kind: "method",
170
+ key: "_setAutoplayPreference",
171
+ value: function _setAutoplayPreference(preference) {
172
+ const updatedValue = preference ? '1' : '0';
173
+ localStorage.setItem(`${this.prefersAutoplayStorageKey}`, updatedValue);
174
+ }
175
+ }, {
176
+ kind: "method",
177
+ key: "_getAutoplayPreference",
178
+ value: function _getAutoplayPreference() {
179
+ const storedValue = localStorage.getItem(`${this.prefersAutoplayStorageKey}`);
180
+ if (storedValue === null) {
181
+ return !window.matchMedia('(prefers-reduced-motion: reduce)').matches;
182
+ } else {
183
+ return Boolean(parseInt(storedValue, 10));
184
+ }
185
+ }
186
+ }, {
187
+ kind: "method",
188
+ key: "_getPlayerOptions",
189
+ value: function _getPlayerOptions() {
190
+ const {
191
+ backgroundMode,
192
+ intersectionMode,
193
+ autoPlay,
194
+ muted
195
+ } = this;
196
+ /**
197
+ * The overwritten media title.
198
+ *
199
+ * Quick and dirty turn around as C4DVideoPlayerComposite uses caption
200
+ * and C4DLightboxVideoPlayer uses customVideoName and none are
201
+ * part of the same type
202
+ *
203
+ * <c4d-video-player-container customVideoName="overwritten media title here">...
204
+ *
205
+ */
206
+ const mediaTitle = (this === null || this === void 0 ? void 0 : this['customVideoName']) || (this === null || this === void 0 ? void 0 : this['caption']);
207
+ let playerOptions = {};
208
+ const autoplayPreference = this._getAutoplayPreference();
209
+ switch (true) {
210
+ case autoPlay:
211
+ playerOptions = {
212
+ autoMute: muted,
213
+ autoPlay: autoplayPreference
214
+ };
215
+ break;
216
+ case backgroundMode || intersectionMode:
217
+ playerOptions = {
218
+ 'topBarContainer.plugin': false,
219
+ 'controlBarContainer.plugin': false,
220
+ 'largePlayBtn.plugin': false,
221
+ 'loadingSpinner.plugin': false,
222
+ 'unMuteOverlayButton.plugin': false,
223
+ 'EmbedPlayer.DisableVideoTagSupport': false,
224
+ loop: true,
225
+ autoMute: true,
226
+ autoPlay: autoplayPreference,
227
+ // Turn off CTA's including mid-roll card and end cards.
228
+ 'ibm.callToActions': false,
229
+ // Turn off captions display, background/ambient videos have no
230
+ // audio.
231
+ closedCaptions: {
232
+ plugin: false
233
+ }
234
+ };
235
+ break;
236
+ default:
237
+ playerOptions = {
238
+ autoMute: muted
239
+ };
240
+ break;
241
+ }
242
+ if (mediaTitle) {
243
+ playerOptions = _objectSpread(_objectSpread({}, playerOptions), {
244
+ titleLabel: {
245
+ plugin: true,
246
+ align: 'left',
247
+ text: mediaTitle
248
+ }
249
+ });
250
+ }
251
+ return playerOptions;
252
+ }
253
+
254
+ /**
255
+ * Sets up and sends the API call for embedding video for the given video ID.
256
+ *
257
+ * @param videoId The video ID.
258
+ * @private
259
+ */
260
+ // Not using TypeScript `private` due to: microsoft/TypeScript#17744
261
+ }, {
262
+ kind: "method",
263
+ key: "_embedVideoImpl",
264
+ value: async function _embedVideoImpl(videoId) {
265
+ var _getElementById;
266
+ const doc = Object.prototype.hasOwnProperty.call(this, 'getRootNode') ? this.getRootNode() : this.ownerDocument;
267
+ // Given Kaltura replaces the `<div>` here with `<iframe>` with the video player,
268
+ // rendering this `<div>` in `renderLightDOM()` will cause the video player being clobbered
269
+ const playerId = Math.random().toString(36).slice(2);
270
+ const div = document.createElement('div');
271
+ div.id = playerId;
272
+ div.className = `${c4dPrefix}--video-player__video`;
273
+ const {
274
+ _videoPlayer: videoPlayer
275
+ } = this;
276
+ if (!videoPlayer) {
277
+ throw new TypeError('Cannot find the video player component to put the video content into.');
278
+ }
279
+ videoPlayer.appendChild(div);
280
+ const embedVideoHandle = await KalturaPlayerAPI.embedMedia(videoId, playerId, this._getPlayerOptions());
281
+ const {
282
+ width,
283
+ height
284
+ } = await KalturaPlayerAPI.api(videoId);
285
+ videoPlayer.style.setProperty('--native-file-width', `${width}px`);
286
+ videoPlayer.style.setProperty('--native-file-height', `${height}px`);
287
+ videoPlayer.style.setProperty('--native-file-aspect-ratio', `${width} / ${height}`);
288
+ doc.getElementById(playerId).dataset.videoId = videoId;
289
+ const videoEmbed = (_getElementById = doc.getElementById(playerId)) === null || _getElementById === void 0 ? void 0 : _getElementById.firstElementChild;
290
+ if (videoEmbed) {
291
+ videoEmbed.focus();
292
+ }
293
+ return embedVideoHandle.kWidget();
294
+ }
295
+
296
+ /**
297
+ * Sends the API call for embedding video for the given video ID, and tracks the progress and the error of the REST call.
298
+ *
299
+ * @param videoId The video ID.
300
+ * @internal
301
+ */
302
+ }, {
303
+ kind: "field",
304
+ key: "_embedMedia",
305
+ value() {
306
+ return async videoId => {
307
+ const {
308
+ _requestsEmbedVideo: requestsEmbedVideo
309
+ } = this;
310
+ const requestEmbedVideo = requestsEmbedVideo[videoId];
311
+ if (requestEmbedVideo) {
312
+ return requestEmbedVideo;
205
313
  }
314
+ const promiseEmbedVideo = this._embedVideoImpl(videoId);
315
+ this._setRequestEmbedVideoInProgress(videoId, promiseEmbedVideo);
316
+ try {
317
+ this._setEmbeddedVideo(videoId, await promiseEmbedVideo);
318
+ } catch (error) {
319
+ this._setErrorRequestEmbedVideo(videoId, error);
320
+ }
321
+ return promiseEmbedVideo;
206
322
  };
207
- break;
208
- default:
209
- playerOptions = {
210
- autoMute: muted
211
- };
212
- break;
213
- }
214
- return playerOptions;
215
- }
216
-
217
- /**
218
- * Sets up and sends the API call for embedding video for the given video ID.
219
- *
220
- * @param videoId The video ID.
221
- * @private
222
- */
223
- // Not using TypeScript `private` due to: microsoft/TypeScript#17744
224
- async _embedVideoImpl(videoId) {
225
- var _getElementById;
226
- const doc = Object.prototype.hasOwnProperty.call(this, 'getRootNode') ? this.getRootNode() : this.ownerDocument;
227
- // Given Kaltura replaces the `<div>` here with `<iframe>` with the video player,
228
- // rendering this `<div>` in `renderLightDOM()` will cause the video player being clobbered
229
- const playerId = Math.random().toString(36).slice(2);
230
- const div = document.createElement('div');
231
- div.id = playerId;
232
- div.className = `${c4dPrefix}--video-player__video`;
233
- const {
234
- _videoPlayer: videoPlayer
235
- } = this;
236
- if (!videoPlayer) {
237
- throw new TypeError('Cannot find the video player component to put the video content into.');
238
- }
239
- videoPlayer.appendChild(div);
240
- const embedVideoHandle = await KalturaPlayerAPI.embedMedia(videoId, playerId, this._getPlayerOptions());
241
- const {
242
- width,
243
- height
244
- } = await KalturaPlayerAPI.api(videoId);
245
- videoPlayer.style.setProperty('--native-file-width', `${width}px`);
246
- videoPlayer.style.setProperty('--native-file-height', `${height}px`);
247
- videoPlayer.style.setProperty('--native-file-aspect-ratio', `${width} / ${height}`);
248
- doc.getElementById(playerId).dataset.videoId = videoId;
249
- const videoEmbed = (_getElementById = doc.getElementById(playerId)) === null || _getElementById === void 0 ? void 0 : _getElementById.firstElementChild;
250
- if (videoEmbed) {
251
- videoEmbed.focus();
252
- }
253
- return embedVideoHandle.kWidget();
254
- }
255
- /**
256
- * Calls the data-* attribute transpose function to target `c4d-video-player`'s button element.
257
- */
258
- firstUpdated() {
259
- window.requestAnimationFrame(() => {
260
- var _this$querySelector;
261
- const button = (_this$querySelector = this.querySelector('c4d-video-player')) === null || _this$querySelector === void 0 || (_this$querySelector = _this$querySelector.shadowRoot) === null || _this$querySelector === void 0 ? void 0 : _this$querySelector.querySelector('button');
262
- if (!this.getAttribute('href') && this.getAttribute('video-id')) {
263
- this.setAttribute('href', `https://mediacenter.ibm.com/id/${this.getAttribute('video-id')}`);
264
323
  }
265
- this.transposeAttributes(button, ['href']);
266
- });
267
- }
268
- }
324
+ }, {
325
+ kind: "method",
326
+ key: "firstUpdated",
327
+ value:
328
+ /**
329
+ * Calls the data-* attribute transpose function to target `c4d-video-player`'s button element.
330
+ */
331
+ function firstUpdated() {
332
+ window.requestAnimationFrame(() => {
333
+ var _this$querySelector;
334
+ const button = (_this$querySelector = this.querySelector('c4d-video-player')) === null || _this$querySelector === void 0 || (_this$querySelector = _this$querySelector.shadowRoot) === null || _this$querySelector === void 0 ? void 0 : _this$querySelector.querySelector('button');
335
+ if (!this.getAttribute('href') && this.getAttribute('video-id')) {
336
+ this.setAttribute('href', `https://mediacenter.ibm.com/id/${this.getAttribute('video-id')}`);
337
+ }
338
+ this.transposeAttributes(button, ['href']);
339
+ });
340
+ }
341
+ }, {
342
+ kind: "field",
343
+ key: "prefersAutoplayStorageKey",
344
+ value() {
345
+ return `${c4dPrefix}-background-video-prefers-autoplay`;
346
+ }
347
+ }]
348
+ };
349
+ }, StableSelectorMixin(Base));
269
350
  return C4DVideoPlayerContainerMixinImpl;
270
351
  };
271
352
 
@@ -274,11 +355,11 @@ export const C4DVideoPlayerContainerMixin = Base => {
274
355
  *
275
356
  * @element c4d-video-player-container
276
357
  */
277
- let C4DVideoPlayerContainer = _decorate([customElement(`${c4dPrefix}-video-player-container`)], function (_initialize, _ConnectMixin) {
358
+ let C4DVideoPlayerContainer = _decorate([customElement(`${c4dPrefix}-video-player-container`)], function (_initialize2, _ConnectMixin) {
278
359
  class C4DVideoPlayerContainer extends _ConnectMixin {
279
360
  constructor(...args) {
280
361
  super(...args);
281
- _initialize(this);
362
+ _initialize2(this);
282
363
  }
283
364
  }
284
365
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"video-player-container.js","names":["bindActionCreators","KalturaPlayerAPI","settings","store","loadMediaData","ConnectMixin","StableSelectorMixin","C4DVideoPlayerComposite","carbonElement","customElement","stablePrefix","c4dPrefix","mapStateToProps","state","kalturaPlayerAPI","mediaData","mapDispatchToProps","dispatch","_loadVideoData","C4DVideoPlayerContainerMixin","Base","C4DVideoPlayerContainerMixinImpl","constructor","args","_this","this","_defineProperty","videoId","_requestsEmbedVideo","requestsEmbedVideo","requestEmbedVideo","promiseEmbedVideo","_embedVideoImpl","_setRequestEmbedVideoInProgress","_setEmbeddedVideo","error","_setErrorRequestEmbedVideo","request","oldRequestsEmbedVideo","_objectSpread","Promise","reject","kWidget","resolve","embeddedVideos","oldEmbeddedVideos","_setAutoplayPreference","preference","updatedValue","localStorage","setItem","prefersAutoplayStorageKey","_getAutoplayPreference","storedValue","getItem","window","matchMedia","matches","Boolean","parseInt","_getPlayerOptions","backgroundMode","intersectionMode","autoPlay","muted","playerOptions","autoplayPreference","autoMute","loop","closedCaptions","plugin","_getElementById","doc","Object","prototype","hasOwnProperty","call","getRootNode","ownerDocument","playerId","Math","random","toString","slice","div","document","createElement","id","className","_videoPlayer","videoPlayer","TypeError","appendChild","embedVideoHandle","embedMedia","width","height","api","style","setProperty","getElementById","dataset","videoEmbed","firstElementChild","focus","firstUpdated","requestAnimationFrame","_this$querySelector","button","querySelector","shadowRoot","getAttribute","setAttribute","transposeAttributes","C4DVideoPlayerContainer","_decorate","_initialize","_ConnectMixin","F","d"],"sources":["components/video-player/video-player-container.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 {\n ActionCreatorsMapObject,\n Dispatch,\n Store,\n bindActionCreators,\n} from 'redux';\nimport {} from 'lit';\nimport KalturaPlayerAPI from '@carbon/ibmdotcom-services/es/services/KalturaPlayer/KalturaPlayer.js';\nimport settings from '@carbon/ibmdotcom-utilities/es/utilities/settings/settings.js';\nimport store from '../../internal/vendor/@carbon/ibmdotcom-services-store/store.js';\nimport {\n MediaData,\n MediaPlayerAPIState,\n} from '../../internal/vendor/@carbon/ibmdotcom-services-store/types/kalturaPlayerAPI';\nimport { loadMediaData } from '../../internal/vendor/@carbon/ibmdotcom-services-store/actions/kalturaPlayerAPI.js';\nimport { MediaPlayerAPIActions } from '../../internal/vendor/@carbon/ibmdotcom-services-store/actions/kalturaPlayerAPI';\nimport { Constructor } from '../../globals/defs';\nimport ConnectMixin from '../../globals/mixins/connect';\nimport StableSelectorMixin from '../../globals/mixins/stable-selector';\nimport C4DVideoPlayerComposite from './video-player-composite';\nimport { carbonElement as customElement } from '@carbon/web-components/es/globals/decorators/carbon-element.js';\n\nconst { stablePrefix: c4dPrefix } = settings;\n\n/**\n * The Redux state used for `<c4d-video-player-container>`.\n */\nexport interface VideoPlayerContainerState {\n /**\n * The Redux state for `KalturaPlayerAPI`.\n */\n kalturaPlayerAPI?: MediaPlayerAPIState;\n}\n\n/**\n * The properties for `<c4d-video-player-container>` from Redux state.\n */\nexport interface VideoPlayerContainerStateProps {\n /**\n * The video data, keyed by the video ID.\n */\n mediaData?: { [videoId: string]: MediaData };\n}\n\nexport type VideoPlayerActions = ReturnType<typeof loadMediaData>;\n\n/**\n * @param state The Redux state for video player.\n * @returns The converted version of the given state, tailored for `<c4d-video-player-container>`.\n */\nexport function mapStateToProps(\n state: VideoPlayerContainerState\n): VideoPlayerContainerStateProps {\n const { kalturaPlayerAPI } = state;\n const { mediaData } = kalturaPlayerAPI ?? {};\n return !mediaData ? {} : { mediaData };\n}\n\n/**\n * @param dispatch The Redux `dispatch()` API.\n * @returns The methods in `<c4d-video-player-container>` to dispatch Redux actions.\n */\nexport function mapDispatchToProps(dispatch: Dispatch<MediaPlayerAPIActions>) {\n return bindActionCreators<\n VideoPlayerActions,\n ActionCreatorsMapObject<VideoPlayerActions>\n >(\n {\n _loadVideoData: loadMediaData,\n },\n dispatch as Dispatch // TS definition of `bindActionCreators()` seems to have no templated `Dispatch`\n );\n}\n\n/**\n * @param Base The base class.\n * @returns A mix-in that implements video embedding API calls.\n */\nexport const C4DVideoPlayerContainerMixin = <\n T extends Constructor<HTMLElement>\n>(\n Base: T\n) => {\n /**\n * A mix-in class that sets up and cleans up event listeners defined by `@HostListener` decorator.\n */\n abstract class C4DVideoPlayerContainerMixinImpl extends StableSelectorMixin(\n Base\n ) {\n /**\n * The video player.\n */\n abstract _videoPlayer?: HTMLElement;\n\n /**\n * The embedded Kaltura player element (that has `.sendNotification()`, etc. APIs), keyed by the video ID.\n */\n abstract embeddedVideos?: { [videoId: string]: any };\n\n /**\n * The request for the embedded Kaltura player element (that has `.sendNotification()`, etc. APIs), keyed by the video ID.\n *\n * @protected\n */\n // Not using TypeScript `private` due to: microsoft/TypeScript#17744\n _requestsEmbedVideo: { [videoId: string]: Promise<any> } = {};\n\n /**\n * Sets the state that the API call for embedding the video for the given video ID is in progress.\n *\n * @param videoId The video ID.\n * @param request The promise of the API call for embedding the video of the given video ID that is in progress.\n * @private\n */\n // Not using TypeScript `private` due to: microsoft/TypeScript#17744\n _setRequestEmbedVideoInProgress(videoId: string, request: Promise<any>) {\n const { _requestsEmbedVideo: oldRequestsEmbedVideo } = this;\n this._requestsEmbedVideo = {\n ...oldRequestsEmbedVideo,\n [videoId]: request,\n };\n }\n\n /**\n * Set the state that the API call for embedding the video for the given video ID is failed.\n *\n * @param videoId The video ID.\n * @param error An error from the API call for embedding the video of the given video ID.\n * @private\n */\n // Not using TypeScript `private` due to: microsoft/TypeScript#17744\n _setErrorRequestEmbedVideo(videoId: string, error: Error) {\n this._setRequestEmbedVideoInProgress(videoId, Promise.reject(error));\n }\n\n /**\n * Sets the given embedded Kaltura player element (that has `.sendNotification()`, etc. APIs) for the given video ID.\n *\n * @param videoId The video ID.\n * @param kWidget The embedded Kaltura player element (that has `.sendNotification()`, etc. APIs).\n * @private\n */\n // Not using TypeScript `private` due to: microsoft/TypeScript#17744\n _setEmbeddedVideo(videoId: string, kWidget: any) {\n this._setRequestEmbedVideoInProgress(videoId, Promise.resolve(kWidget));\n const { embeddedVideos: oldEmbeddedVideos } = this;\n this.embeddedVideos = {\n ...oldEmbeddedVideos,\n [videoId]: kWidget,\n };\n }\n\n _setAutoplayPreference(preference: boolean) {\n const updatedValue = preference ? '1' : '0';\n localStorage.setItem(`${this.prefersAutoplayStorageKey}`, updatedValue);\n }\n\n _getAutoplayPreference() {\n const storedValue = localStorage.getItem(\n `${this.prefersAutoplayStorageKey}`\n );\n\n if (storedValue === null) {\n return !window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n } else {\n return Boolean(parseInt(storedValue, 10));\n }\n }\n\n _getPlayerOptions() {\n const { backgroundMode, intersectionMode, autoPlay, muted } =\n this as unknown as C4DVideoPlayerComposite;\n let playerOptions = {};\n const autoplayPreference = this._getAutoplayPreference();\n\n switch (true) {\n case autoPlay:\n playerOptions = {\n autoMute: muted,\n autoPlay: autoplayPreference,\n };\n break;\n\n case backgroundMode || intersectionMode:\n playerOptions = {\n 'topBarContainer.plugin': false,\n 'controlBarContainer.plugin': false,\n 'largePlayBtn.plugin': false,\n 'loadingSpinner.plugin': false,\n 'unMuteOverlayButton.plugin': false,\n 'EmbedPlayer.DisableVideoTagSupport': false,\n loop: true,\n autoMute: true,\n autoPlay: autoplayPreference,\n // Turn off CTA's including mid-roll card and end cards.\n 'ibm.callToActions': false,\n // Turn off captions display, background/ambient videos have no\n // audio.\n closedCaptions: {\n plugin: false,\n },\n };\n break;\n\n default:\n playerOptions = {\n autoMute: muted,\n };\n break;\n }\n\n return playerOptions;\n }\n\n /**\n * Sets up and sends the API call for embedding video for the given video ID.\n *\n * @param videoId The video ID.\n * @private\n */\n // Not using TypeScript `private` due to: microsoft/TypeScript#17744\n async _embedVideoImpl(videoId: string) {\n const doc = Object.prototype.hasOwnProperty.call(this, 'getRootNode')\n ? (this.getRootNode() as Document | ShadowRoot)\n : this.ownerDocument;\n // Given Kaltura replaces the `<div>` here with `<iframe>` with the video player,\n // rendering this `<div>` in `renderLightDOM()` will cause the video player being clobbered\n const playerId = Math.random().toString(36).slice(2);\n const div = document.createElement('div');\n div.id = playerId;\n div.className = `${c4dPrefix}--video-player__video`;\n const { _videoPlayer: videoPlayer } = this;\n if (!videoPlayer) {\n throw new TypeError(\n 'Cannot find the video player component to put the video content into.'\n );\n }\n videoPlayer.appendChild(div);\n\n const embedVideoHandle = await KalturaPlayerAPI.embedMedia(\n videoId,\n playerId,\n this._getPlayerOptions()\n );\n const { width, height } = await KalturaPlayerAPI.api(videoId);\n videoPlayer.style.setProperty('--native-file-width', `${width}px`);\n videoPlayer.style.setProperty('--native-file-height', `${height}px`);\n videoPlayer.style.setProperty(\n '--native-file-aspect-ratio',\n `${width} / ${height}`\n );\n\n doc!.getElementById(playerId)!.dataset.videoId = videoId;\n const videoEmbed = doc!.getElementById(playerId)?.firstElementChild;\n if (videoEmbed) {\n (videoEmbed as HTMLElement).focus();\n }\n return embedVideoHandle.kWidget();\n }\n\n /**\n * Sends the API call for embedding video for the given video ID, and tracks the progress and the error of the REST call.\n *\n * @param videoId The video ID.\n * @internal\n */\n _embedMedia = async (videoId: string) => {\n const { _requestsEmbedVideo: requestsEmbedVideo } = this;\n const requestEmbedVideo = requestsEmbedVideo[videoId];\n\n if (requestEmbedVideo) {\n return requestEmbedVideo;\n }\n\n const promiseEmbedVideo = this._embedVideoImpl(videoId);\n\n this._setRequestEmbedVideoInProgress(videoId, promiseEmbedVideo);\n try {\n this._setEmbeddedVideo(videoId, await promiseEmbedVideo);\n } catch (error) {\n this._setErrorRequestEmbedVideo(videoId, error as Error);\n }\n return promiseEmbedVideo;\n };\n\n /**\n * Calls the data-* attribute transpose function to target `c4d-video-player`'s button element.\n */\n firstUpdated() {\n window.requestAnimationFrame(() => {\n const button =\n this.querySelector('c4d-video-player')?.shadowRoot?.querySelector(\n 'button'\n );\n if (!this.getAttribute('href') && this.getAttribute('video-id')) {\n this.setAttribute(\n 'href',\n `https://mediacenter.ibm.com/id/${this.getAttribute('video-id')}`\n );\n }\n this.transposeAttributes(button, ['href']);\n });\n }\n\n prefersAutoplayStorageKey = `${c4dPrefix}-background-video-prefers-autoplay`;\n }\n\n return C4DVideoPlayerContainerMixinImpl;\n};\n\n/**\n * Container component for video player.\n *\n * @element c4d-video-player-container\n */\n@customElement(`${c4dPrefix}-video-player-container`)\nclass C4DVideoPlayerContainer extends ConnectMixin<\n VideoPlayerContainerState,\n MediaPlayerAPIActions,\n VideoPlayerContainerStateProps,\n ActionCreatorsMapObject<VideoPlayerActions>\n>(\n store as Store<VideoPlayerContainerState, MediaPlayerAPIActions>,\n mapStateToProps,\n mapDispatchToProps\n)(C4DVideoPlayerContainerMixin(C4DVideoPlayerComposite)) {}\n\n/* @__GENERATE_REACT_CUSTOM_ELEMENT_TYPE__ */\nexport default C4DVideoPlayerContainer;\n"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAIEA,kBAAkB,QACb,OAAO;AACd,OAAe,KAAK;AACpB,OAAOC,gBAAgB,MAAM,uEAAuE;AACpG,OAAOC,QAAQ,MAAM,+DAA+D;AACpF,OAAOC,KAAK,MAAM,iEAAiE;AAKnF,SAASC,aAAa,QAAQ,oFAAoF;AAGlH,OAAOC,YAAY,MAAM,iCAA8B;AACvD,OAAOC,mBAAmB,MAAM,yCAAsC;AACtE,OAAOC,uBAAuB,MAAM,6BAA0B;AAC9D,SAASC,aAAa,IAAIC,aAAa,QAAQ,gEAAgE;AAE/G,MAAM;EAAEC,YAAY,EAAEC;AAAU,CAAC,GAAGT,QAAQ;;AAE5C;AACA;AACA;;AAQA;AACA;AACA;;AAUA;AACA;AACA;AACA;AACA,OAAO,SAASU,eAAeA,CAC7BC,KAAgC,EACA;EAChC,MAAM;IAAEC;EAAiB,CAAC,GAAGD,KAAK;EAClC,MAAM;IAAEE;EAAU,CAAC,GAAGD,gBAAgB,aAAhBA,gBAAgB,cAAhBA,gBAAgB,GAAI,CAAC,CAAC;EAC5C,OAAO,CAACC,SAAS,GAAG,CAAC,CAAC,GAAG;IAAEA;EAAU,CAAC;AACxC;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,kBAAkBA,CAACC,QAAyC,EAAE;EAC5E,OAAOjB,kBAAkB,CAIvB;IACEkB,cAAc,EAAEd;EAClB,CAAC,EACDa,QAAQ,CAAa;EACvB,CAAC;A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AlDA,mBAAA,CAAoDE,aAAa,CAC/D,QACF,CAAC;QACH,IAAI,CAAC,IAAI,CAACE,YAAY,CAAC,MAAM,CAAC,IAAI,IAAI,CAACA,YAAY,CAAC,UAAU,CAAC,EAAE;UAC/D,IAAI,CAACC,YAAY,CACf,MAAM,EACN,kCAAkC,IAAI,CAACD,YAAY,CAAC,UAAU,CAAC,EACjE,CAAC;QACH;QACA,IAAI,CAACE,mBAAmB,CAACL,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC;MAC5C,CAAC,CAAC;IACJ;EAGF;EAEA,OAAOvF,gCAAgC;AACzC,CAAC;;AAED;AACA;AACA;AACA;AACA;AAJA,IAMM6F,uBAAuB,GAAAC,SAAA,EAD5B1G,aAAa,CAAC,GAAGE,SAAS,yBAAyB,CAAC,aAAAyG,WAAA,EAAAC,aAAA;EAArD,MACMH,uBAAuB,SAAAG,aAAA,CAS4B;IAAA/F,YAAA,GAAAC,IAAA;MAAA,SAAAA,IAAA;MAAA6F,WAAA;IAAA;EAAC;EAAC;IAAAE,CAAA,EATrDJ,uBAAuB;IAAAK,CAAA;EAAA;AAAA,GAASlH,YAAY,CAMhDF,KAAK,EACLS,eAAe,EACfI,kBACF,CAAC,CAACG,4BAA4B,CAACZ,uBAAuB,CAAC,CAAC;AAExD;AACA,eAAe2G,uBAAuB","ignoreList":[]}
1
+ {"version":3,"file":"video-player-container.js","names":["bindActionCreators","property","KalturaPlayerAPI","settings","store","loadMediaData","ConnectMixin","StableSelectorMixin","C4DVideoPlayerComposite","carbonElement","customElement","stablePrefix","c4dPrefix","mapStateToProps","state","kalturaPlayerAPI","mediaData","mapDispatchToProps","dispatch","_loadVideoData","C4DVideoPlayerContainerMixin","Base","C4DVideoPlayerContainerMixinImpl","_decorate","_initialize","_StableSelectorMixin","constructor","args","F","d","kind","key","value","decorators","type","String","attribute","_setRequestEmbedVideoInProgress","videoId","request","_requestsEmbedVideo","oldRequestsEmbedVideo","_objectSpread","_setErrorRequestEmbedVideo","error","Promise","reject","_setEmbeddedVideo","kWidget","resolve","embeddedVideos","oldEmbeddedVideos","_setAutoplayPreference","preference","updatedValue","localStorage","setItem","prefersAutoplayStorageKey","_getAutoplayPreference","storedValue","getItem","window","matchMedia","matches","Boolean","parseInt","_getPlayerOptions","backgroundMode","intersectionMode","autoPlay","muted","mediaTitle","playerOptions","autoplayPreference","autoMute","loop","closedCaptions","plugin","titleLabel","align","text","_embedVideoImpl","_getElementById","doc","Object","prototype","hasOwnProperty","call","getRootNode","ownerDocument","playerId","Math","random","toString","slice","div","document","createElement","id","className","_videoPlayer","videoPlayer","TypeError","appendChild","embedVideoHandle","embedMedia","width","height","api","style","setProperty","getElementById","dataset","videoEmbed","firstElementChild","focus","requestsEmbedVideo","requestEmbedVideo","promiseEmbedVideo","firstUpdated","requestAnimationFrame","_this$querySelector","button","querySelector","shadowRoot","getAttribute","setAttribute","transposeAttributes","C4DVideoPlayerContainer","_initialize2","_ConnectMixin"],"sources":["components/video-player/video-player-container.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2020, 2025\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 {\n ActionCreatorsMapObject,\n Dispatch,\n Store,\n bindActionCreators,\n} from 'redux';\nimport {} from 'lit';\nimport { property } from 'lit/decorators.js';\nimport KalturaPlayerAPI from '@carbon/ibmdotcom-services/es/services/KalturaPlayer/KalturaPlayer.js';\nimport settings from '@carbon/ibmdotcom-utilities/es/utilities/settings/settings.js';\nimport store from '../../internal/vendor/@carbon/ibmdotcom-services-store/store.js';\nimport {\n MediaData,\n MediaPlayerAPIState,\n} from '../../internal/vendor/@carbon/ibmdotcom-services-store/types/kalturaPlayerAPI';\nimport { loadMediaData } from '../../internal/vendor/@carbon/ibmdotcom-services-store/actions/kalturaPlayerAPI.js';\nimport { MediaPlayerAPIActions } from '../../internal/vendor/@carbon/ibmdotcom-services-store/actions/kalturaPlayerAPI';\nimport { Constructor } from '../../globals/defs';\nimport ConnectMixin from '../../globals/mixins/connect';\nimport StableSelectorMixin from '../../globals/mixins/stable-selector';\nimport C4DVideoPlayerComposite from './video-player-composite';\nimport { carbonElement as customElement } from '@carbon/web-components/es/globals/decorators/carbon-element.js';\n\nconst { stablePrefix: c4dPrefix } = settings;\n\n/**\n * The Redux state used for `<c4d-video-player-container>`.\n */\nexport interface VideoPlayerContainerState {\n /**\n * The Redux state for `KalturaPlayerAPI`.\n */\n kalturaPlayerAPI?: MediaPlayerAPIState;\n}\n\n/**\n * The properties for `<c4d-video-player-container>` from Redux state.\n */\nexport interface VideoPlayerContainerStateProps {\n /**\n * The video data, keyed by the video ID.\n */\n mediaData?: { [videoId: string]: MediaData };\n}\n\nexport type VideoPlayerActions = ReturnType<typeof loadMediaData>;\n\n/**\n * @param state The Redux state for video player.\n * @returns The converted version of the given state, tailored for `<c4d-video-player-container>`.\n */\nexport function mapStateToProps(\n state: VideoPlayerContainerState\n): VideoPlayerContainerStateProps {\n const { kalturaPlayerAPI } = state;\n const { mediaData } = kalturaPlayerAPI ?? {};\n return !mediaData ? {} : { mediaData };\n}\n\n/**\n * @param dispatch The Redux `dispatch()` API.\n * @returns The methods in `<c4d-video-player-container>` to dispatch Redux actions.\n */\nexport function mapDispatchToProps(dispatch: Dispatch<MediaPlayerAPIActions>) {\n return bindActionCreators<\n VideoPlayerActions,\n ActionCreatorsMapObject<VideoPlayerActions>\n >(\n {\n _loadVideoData: loadMediaData,\n },\n dispatch as Dispatch // TS definition of `bindActionCreators()` seems to have no templated `Dispatch`\n );\n}\n\n/**\n * @param Base The base class.\n * @returns A mix-in that implements video embedding API calls.\n */\nexport const C4DVideoPlayerContainerMixin = <\n T extends Constructor<HTMLElement>\n>(\n Base: T\n) => {\n /**\n * A mix-in class that sets up and cleans up event listeners defined by `@HostListener` decorator.\n */\n abstract class C4DVideoPlayerContainerMixinImpl extends StableSelectorMixin(\n Base\n ) {\n /**\n * The video player.\n */\n abstract _videoPlayer?: HTMLElement;\n\n /**\n * The embedded Kaltura player element (that has `.sendNotification()`, etc. APIs), keyed by the video ID.\n */\n abstract embeddedVideos?: { [videoId: string]: any };\n\n /**\n * The request for the embedded Kaltura player element (that has `.sendNotification()`, etc. APIs), keyed by the video ID.\n *\n * @protected\n */\n // Not using TypeScript `private` due to: microsoft/TypeScript#17744\n _requestsEmbedVideo: { [videoId: string]: Promise<any> } = {};\n\n @property({ type: String, attribute: 'customvideoname' })\n customVideoName = '';\n\n /**\n * Sets the state that the API call for embedding the video for the given video ID is in progress.\n *\n * @param videoId The video ID.\n * @param request The promise of the API call for embedding the video of the given video ID that is in progress.\n * @private\n */\n // Not using TypeScript `private` due to: microsoft/TypeScript#17744\n _setRequestEmbedVideoInProgress(videoId: string, request: Promise<any>) {\n const { _requestsEmbedVideo: oldRequestsEmbedVideo } = this;\n this._requestsEmbedVideo = {\n ...oldRequestsEmbedVideo,\n [videoId]: request,\n };\n }\n\n /**\n * Set the state that the API call for embedding the video for the given video ID is failed.\n *\n * @param videoId The video ID.\n * @param error An error from the API call for embedding the video of the given video ID.\n * @private\n */\n // Not using TypeScript `private` due to: microsoft/TypeScript#17744\n _setErrorRequestEmbedVideo(videoId: string, error: Error) {\n this._setRequestEmbedVideoInProgress(videoId, Promise.reject(error));\n }\n\n /**\n * Sets the given embedded Kaltura player element (that has `.sendNotification()`, etc. APIs) for the given video ID.\n *\n * @param videoId The video ID.\n * @param kWidget The embedded Kaltura player element (that has `.sendNotification()`, etc. APIs).\n * @private\n */\n // Not using TypeScript `private` due to: microsoft/TypeScript#17744\n _setEmbeddedVideo(videoId: string, kWidget: any) {\n this._setRequestEmbedVideoInProgress(videoId, Promise.resolve(kWidget));\n const { embeddedVideos: oldEmbeddedVideos } = this;\n this.embeddedVideos = {\n ...oldEmbeddedVideos,\n [videoId]: kWidget,\n };\n }\n\n _setAutoplayPreference(preference: boolean) {\n const updatedValue = preference ? '1' : '0';\n localStorage.setItem(`${this.prefersAutoplayStorageKey}`, updatedValue);\n }\n\n _getAutoplayPreference() {\n const storedValue = localStorage.getItem(\n `${this.prefersAutoplayStorageKey}`\n );\n\n if (storedValue === null) {\n return !window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n } else {\n return Boolean(parseInt(storedValue, 10));\n }\n }\n\n _getPlayerOptions() {\n const { backgroundMode, intersectionMode, autoPlay, muted } =\n this as unknown as C4DVideoPlayerComposite;\n /**\n * The overwritten media title.\n *\n * Quick and dirty turn around as C4DVideoPlayerComposite uses caption\n * and C4DLightboxVideoPlayer uses customVideoName and none are\n * part of the same type\n *\n * <c4d-video-player-container customVideoName=\"overwritten media title here\">...\n *\n */\n const mediaTitle = this?.['customVideoName'] || this?.['caption'];\n\n let playerOptions = {};\n const autoplayPreference = this._getAutoplayPreference();\n\n switch (true) {\n case autoPlay:\n playerOptions = {\n autoMute: muted,\n autoPlay: autoplayPreference,\n };\n break;\n\n case backgroundMode || intersectionMode:\n playerOptions = {\n 'topBarContainer.plugin': false,\n 'controlBarContainer.plugin': false,\n 'largePlayBtn.plugin': false,\n 'loadingSpinner.plugin': false,\n 'unMuteOverlayButton.plugin': false,\n 'EmbedPlayer.DisableVideoTagSupport': false,\n loop: true,\n autoMute: true,\n autoPlay: autoplayPreference,\n // Turn off CTA's including mid-roll card and end cards.\n 'ibm.callToActions': false,\n // Turn off captions display, background/ambient videos have no\n // audio.\n closedCaptions: {\n plugin: false,\n },\n };\n break;\n\n default:\n playerOptions = {\n autoMute: muted,\n };\n break;\n }\n\n if (mediaTitle) {\n playerOptions = {\n ...playerOptions,\n ...{\n titleLabel: {\n plugin: true,\n align: 'left',\n text: mediaTitle,\n },\n },\n };\n }\n\n return playerOptions;\n }\n\n /**\n * Sets up and sends the API call for embedding video for the given video ID.\n *\n * @param videoId The video ID.\n * @private\n */\n // Not using TypeScript `private` due to: microsoft/TypeScript#17744\n async _embedVideoImpl(videoId: string) {\n const doc = Object.prototype.hasOwnProperty.call(this, 'getRootNode')\n ? (this.getRootNode() as Document | ShadowRoot)\n : this.ownerDocument;\n // Given Kaltura replaces the `<div>` here with `<iframe>` with the video player,\n // rendering this `<div>` in `renderLightDOM()` will cause the video player being clobbered\n const playerId = Math.random().toString(36).slice(2);\n const div = document.createElement('div');\n div.id = playerId;\n div.className = `${c4dPrefix}--video-player__video`;\n const { _videoPlayer: videoPlayer } = this;\n if (!videoPlayer) {\n throw new TypeError(\n 'Cannot find the video player component to put the video content into.'\n );\n }\n videoPlayer.appendChild(div);\n\n const embedVideoHandle = await KalturaPlayerAPI.embedMedia(\n videoId,\n playerId,\n this._getPlayerOptions()\n );\n const { width, height } = await KalturaPlayerAPI.api(videoId);\n videoPlayer.style.setProperty('--native-file-width', `${width}px`);\n videoPlayer.style.setProperty('--native-file-height', `${height}px`);\n videoPlayer.style.setProperty(\n '--native-file-aspect-ratio',\n `${width} / ${height}`\n );\n\n doc!.getElementById(playerId)!.dataset.videoId = videoId;\n const videoEmbed = doc!.getElementById(playerId)?.firstElementChild;\n if (videoEmbed) {\n (videoEmbed as HTMLElement).focus();\n }\n return embedVideoHandle.kWidget();\n }\n\n /**\n * Sends the API call for embedding video for the given video ID, and tracks the progress and the error of the REST call.\n *\n * @param videoId The video ID.\n * @internal\n */\n _embedMedia = async (videoId: string) => {\n const { _requestsEmbedVideo: requestsEmbedVideo } = this;\n const requestEmbedVideo = requestsEmbedVideo[videoId];\n\n if (requestEmbedVideo) {\n return requestEmbedVideo;\n }\n\n const promiseEmbedVideo = this._embedVideoImpl(videoId);\n\n this._setRequestEmbedVideoInProgress(videoId, promiseEmbedVideo);\n try {\n this._setEmbeddedVideo(videoId, await promiseEmbedVideo);\n } catch (error) {\n this._setErrorRequestEmbedVideo(videoId, error as Error);\n }\n return promiseEmbedVideo;\n };\n\n /**\n * Calls the data-* attribute transpose function to target `c4d-video-player`'s button element.\n */\n firstUpdated() {\n window.requestAnimationFrame(() => {\n const button =\n this.querySelector('c4d-video-player')?.shadowRoot?.querySelector(\n 'button'\n );\n if (!this.getAttribute('href') && this.getAttribute('video-id')) {\n this.setAttribute(\n 'href',\n `https://mediacenter.ibm.com/id/${this.getAttribute('video-id')}`\n );\n }\n this.transposeAttributes(button, ['href']);\n });\n }\n\n prefersAutoplayStorageKey = `${c4dPrefix}-background-video-prefers-autoplay`;\n }\n\n return C4DVideoPlayerContainerMixinImpl;\n};\n\n/**\n * Container component for video player.\n *\n * @element c4d-video-player-container\n */\n@customElement(`${c4dPrefix}-video-player-container`)\nclass C4DVideoPlayerContainer extends ConnectMixin<\n VideoPlayerContainerState,\n MediaPlayerAPIActions,\n VideoPlayerContainerStateProps,\n ActionCreatorsMapObject<VideoPlayerActions>\n>(\n store as Store<VideoPlayerContainerState, MediaPlayerAPIActions>,\n mapStateToProps,\n mapDispatchToProps\n)(C4DVideoPlayerContainerMixin(C4DVideoPlayerComposite)) {}\n\n/* @__GENERATE_REACT_CUSTOM_ELEMENT_TYPE__ */\nexport default C4DVideoPlayerContainer;\n"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAIEA,kBAAkB,QACb,OAAO;AACd,OAAe,KAAK;AACpB,SAASC,QAAQ,QAAQ,mBAAmB;AAC5C,OAAOC,gBAAgB,MAAM,uEAAuE;AACpG,OAAOC,QAAQ,MAAM,+DAA+D;AACpF,OAAOC,KAAK,MAAM,iEAAiE;AAKnF,SAASC,aAAa,QAAQ,oFAAoF;AAGlH,OAAOC,YAAY,MAAM,iCAA8B;AACvD,OAAOC,mBAAmB,MAAM,yCAAsC;AACtE,OAAOC,uBAAuB,MAAM,6BAA0B;AAC9D,SAASC,aAAa,IAAIC,aAAa,QAAQ,gEAAgE;AAE/G,MAAM;EAAEC,YAAY,EAAEC;AAAU,CAAC,GAAGT,QAAQ;;AAE5C;AACA;AACA;;AAQA;AACA;AACA;;AAUA;AACA;AACA;AACA;AACA,OAAO,SAASU,eAAeA,CAC7BC,KAAgC,EACA;EAChC,MAAM;IAAEC;EAAiB,CAAC,GAAGD,KAAK;EAClC,MAAM;IAAE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IBM Corp. 2020, 2024
4
+ * Copyright IBM Corp. 2020, 2025
5
5
  *
6
6
  * This source code is licensed under the Apache-2.0 license found in the
7
7
  * LICENSE file in the root directory of this source tree.
@@ -687,6 +687,7 @@ declare const C4DVideoPlayer_base: (new (...args: any[]) => {
687
687
  * @csspart video - The video. Usage `c4d-video-player::part(video)`
688
688
  * @csspart button - The play button. Usage `c4d-video-player::part(button)`
689
689
  * @csspart image - The thumbnail image. Usage `c4d-video-player::part(image)`
690
+ * @csspart play-video - The play video icon. Usage `c4d-video-player::part(play-video)`
690
691
  * @csspart video-container - The video container. Usage `c4d-video-player::part(video-container)`
691
692
  * @csspart caption - The caption. Usage `c4d-video-player::part(caption)`
692
693
  */