cloudinary-video-player 4.1.5 → 4.1.6-edge.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/309.min.js +2 -2
  2. package/dist/526.min.js +3 -3
  3. package/dist/689.min.js +2 -2
  4. package/dist/801.min.js +3 -3
  5. package/dist/adaptive-streaming.js +2 -2
  6. package/dist/adaptive-streaming.min.js +2 -2
  7. package/dist/chapters.js +3 -3
  8. package/dist/chapters.min.js +3 -3
  9. package/dist/cld-player-core.js +19 -8
  10. package/dist/cld-player-core.min.js +3 -3
  11. package/dist/cld-poster-url.js +2 -2
  12. package/dist/cld-poster-url.min.js +2 -2
  13. package/dist/cld-video-player.css +2 -2
  14. package/dist/cld-video-player.js +19 -8
  15. package/dist/cld-video-player.light.js +19 -8
  16. package/dist/cld-video-player.light.min.js +3 -3
  17. package/dist/cld-video-player.min.css +2 -2
  18. package/dist/cld-video-player.min.js +3 -3
  19. package/dist/colors.js +2 -2
  20. package/dist/colors.min.js +2 -2
  21. package/dist/dash.js +2 -2
  22. package/dist/dash.min.js +2 -2
  23. package/dist/debug.js +2 -2
  24. package/dist/debug.min.js +2 -2
  25. package/dist/ima.js +2 -2
  26. package/dist/ima.min.js +2 -2
  27. package/dist/interaction-areas.js +2 -2
  28. package/dist/interaction-areas.min.js +2 -2
  29. package/dist/node_modules_lodash_throttle_js.js +2 -2
  30. package/dist/player-full.js +19 -8
  31. package/dist/player-full.min.js +3 -3
  32. package/dist/player.css +2 -2
  33. package/dist/player.js +2 -2
  34. package/dist/player.min.css +2 -2
  35. package/dist/player.min.js +2 -2
  36. package/dist/playlist.js +2 -2
  37. package/dist/playlist.min.js +2 -2
  38. package/dist/recommendations-overlay.js +2 -2
  39. package/dist/recommendations-overlay.min.js +2 -2
  40. package/dist/share.js +2 -2
  41. package/dist/share.min.js +2 -2
  42. package/dist/shoppable.js +2 -2
  43. package/dist/shoppable.min.js +2 -2
  44. package/dist/utils_fetch-config_js.js +2 -2
  45. package/dist/utils_schedule_js.js +2 -2
  46. package/lib/chapters.js +17 -3
  47. package/lib/cld-video-player.min.css +2 -2
  48. package/lib/index2.js +27 -2
  49. package/lib/interaction-areas.js +1 -1
  50. package/lib/player.min.css +2 -2
  51. package/lib/playlist-panel.js +1 -1
  52. package/lib/playlist.js +1 -1
  53. package/lib/toNumber.js +1 -1
  54. package/lib/video-player.js +37 -11
  55. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import { g as getDefaultExportFromCjs } from './_commonjsHelpers.js';
2
2
  import { r as requireToNumber } from './toNumber.js';
3
3
  import { _ as _vjs } from './_videojs-proxy.js';
4
- import { P as PLAYER_EVENT, d as skinClassPrefix, p as playerClassPrefix } from './index2.js';
4
+ import { P as PLAYER_EVENT, e as skinClassPrefix, p as playerClassPrefix } from './index2.js';
5
5
 
6
6
  var toFinite_1;
7
7
  var hasRequiredToFinite;
package/lib/playlist.js CHANGED
@@ -1,4 +1,4 @@
1
- import { i as isPlainObject, b as camelCase, P as PLAYER_EVENT, s as sliceProperties, g as getCloudinaryUrl } from './index2.js';
1
+ import { i as isPlainObject, d as camelCase, P as PLAYER_EVENT, s as sliceProperties, g as getCloudinaryUrl } from './index2.js';
2
2
  import { V as VideoSource } from './video-player.js';
3
3
  import { i as isInteger, P as PlaylistLayout } from './playlist-panel.js';
4
4
  import { _ as _vjs } from './_videojs-proxy.js';
package/lib/toNumber.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { a as requireIsObject } from './video-player.const.js';
2
- import { r as requireIsSymbol } from './index2.js';
2
+ import { a as requireIsSymbol } from './index2.js';
3
3
 
4
4
  /** Used to match a single whitespace character. */
5
5
 
@@ -1,6 +1,6 @@
1
1
  import { _ as _vjs } from './_videojs-proxy.js';
2
2
  import { g as getDefaultExportFromCjs } from './_commonjsHelpers.js';
3
- import { e as require_baseKeys, h as require_getTag, j as requireIsArguments, k as requireIsArrayLike, l as requireIsBuffer, m as requireIsTypedArray, n as require_isPrototype, q as require_assignValue, t as require_castPath, u as require_toKey, v as require_isIndex, w as require_baseGet, x as requireIsLength, y as require_flatRest, P as PLAYER_EVENT, c as componentUtils, s as sliceProperties, z as isElementInViewport, V as VIDEO_CODEC, A as isKeyInTransformation, B as BaseSource, C as normalizeOptions, S as SOURCE_TYPE, I as ImageSource, T as Transformation, D as isSrcEqual, E as castArray, F as mergeTransformations, G as getTransformationValue, H as sliceAndUnsetProperties, J as setupCloudinaryMiddleware, K as extendCloudinaryConfig, L as omitVideoOnlyTransformations, i as isPlainObject, M as isElement, N as setPosition, O as getPointerPosition, Q as fontFace, p as playerClassPrefix, U as Utils, R as defaults$6, W as ERROR_CODE, a as get } from './index2.js';
3
+ import { h as require_baseKeys, j as require_getTag, k as requireIsArguments, l as requireIsArrayLike, m as requireIsBuffer, n as requireIsTypedArray, q as require_isPrototype, u as require_assignValue, v as require_castPath, w as require_toKey, x as require_isIndex, y as require_baseGet, z as requireIsLength, A as require_flatRest, P as PLAYER_EVENT, c as componentUtils, s as sliceProperties, B as isElementInViewport, V as VIDEO_CODEC, C as isKeyInTransformation, D as BaseSource, E as normalizeOptions, S as SOURCE_TYPE, I as ImageSource, T as Transformation, F as isSrcEqual, G as castArray, H as mergeTransformations, J as getTransformationValue, K as sliceAndUnsetProperties, L as setupCloudinaryMiddleware, M as extendCloudinaryConfig, N as omitVideoOnlyTransformations, i as isPlainObject, O as isElement, Q as setPosition, R as getPointerPosition, U as fontFace, p as playerClassPrefix, r as revokeBlobUrls, t as toCredentialedBlobUrl, W as Utils, X as defaults$6, Y as ERROR_CODE, b as get } from './index2.js';
4
4
  import { c as requireIsArray, a as requireIsObject, i as isObject, d as isString, S as SOURCE_PARAMS, C as CROP_MODE, F as FLOATING_TO, e as FLUID_CLASS_NAME, P as PLAYER_PARAMS, A as AUTO_PLAY_MODE } from './video-player.const.js';
5
5
  import { i as isFunction, a as isValidPlayerConfig, b as isValidSourceConfig } from './validators-functions.js';
6
6
  import { a as appendQueryParams, u as utf8ToBase64, i as isRawUrl, g as getCloudinaryConfigFromOptions, C as CLOUDINARY_CONFIG_PARAM } from './cloudinary-config-from-options.js';
@@ -561,7 +561,7 @@ class TitleBar extends Component {
561
561
  const metadataUrl = appendQueryParams(`${urlPrefix}/_applet_/video_service/video_metadata/${deliveryType}/${utf8ToBase64(publicId)}.json`, source.queryParams());
562
562
  fetch(metadataUrl, {
563
563
  headers: {
564
- 'X-Cld-Video-Player-Version': "4.1.5"
564
+ 'X-Cld-Video-Player-Version': "4.1.6-edge.1"
565
565
  }
566
566
  }).then(response => {
567
567
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
@@ -3084,9 +3084,6 @@ class CloudinaryContext {
3084
3084
  }
3085
3085
  return srcs;
3086
3086
  }, []);
3087
- if (src.withCredentials) {
3088
- this.player.crossOrigin('use-credentials');
3089
- }
3090
3087
  this.player.src(_sources);
3091
3088
  _lastSource = src;
3092
3089
  if (this.playlist) {
@@ -3213,7 +3210,7 @@ class CloudinaryAnalytics {
3213
3210
  }, {
3214
3211
  ...(isPlainObject(this.analyticsOptions) ? this.analyticsOptions : {}),
3215
3212
  videoPlayerType: 'cloudinary video player',
3216
- videoPlayerVersion: "4.1.5"
3213
+ videoPlayerVersion: "4.1.6-edge.1"
3217
3214
  });
3218
3215
  } else if (this.currentVideoMetadata.cloudName !== metadata.cloudName || this.currentVideoMetadata.publicId !== metadata.publicId) {
3219
3216
  this.cloudinaryAnalytics.stopManualTracking();
@@ -4552,8 +4549,12 @@ const getTranscriptionFileUrl = function (urlPrefix, deliveryType, publicId) {
4552
4549
  function textTracksManager() {
4553
4550
  const player = this;
4554
4551
  const textTracksData = new WeakMap();
4552
+ const blobUrls = new Set();
4555
4553
  let showingTracks = new Set();
4554
+ let generation = 0;
4556
4555
  const removeAllTextTracks = () => {
4556
+ generation++;
4557
+ revokeBlobUrls(blobUrls);
4557
4558
  const currentTracks = player.remoteTextTracks();
4558
4559
  if (currentTracks) {
4559
4560
  for (let i = currentTracks.tracks_.length - 1; i >= 0; i--) {
@@ -4686,10 +4687,14 @@ function textTracksManager() {
4686
4687
  }
4687
4688
  });
4688
4689
  };
4689
- const addTextTracks = textTracks => {
4690
- textTracks.forEach(textTrackConfig => {
4691
- if (textTrackConfig.src && textTrackConfig.src.endsWith('.vtt')) {
4692
- addNativeVttTrack(textTrackConfig);
4690
+ const isNativeVtt = textTrackConfig => textTrackConfig.src && textTrackConfig.src.endsWith('.vtt');
4691
+ const addResolvedTextTracks = (textTracks, nativeVttSrcs) => {
4692
+ textTracks.forEach((textTrackConfig, index) => {
4693
+ if (isNativeVtt(textTrackConfig)) {
4694
+ addNativeVttTrack({
4695
+ ...textTrackConfig,
4696
+ src: nativeVttSrcs[index]
4697
+ });
4693
4698
  } else if (textTrackConfig.src && textTrackConfig.src.endsWith('.srt')) {
4694
4699
  addTextTrack('srt', textTrackConfig);
4695
4700
  } else if (!textTrackConfig.src || textTrackConfig.src.endsWith('.transcript')) {
@@ -4699,6 +4704,27 @@ function textTracksManager() {
4699
4704
  syncShowingTracks();
4700
4705
  };
4701
4706
 
4707
+ // Credentialed VTT files are fetched up front, in parallel, so Video.js loads them from
4708
+ // same-origin Blob URLs. Tracks are added only once all are resolved to keep their order,
4709
+ // and skipped when the source changed meanwhile.
4710
+ const addTextTracks = textTracks => {
4711
+ const withCredentials = player.cloudinary.source?.().withCredentials;
4712
+ if (!withCredentials || !textTracks.some(isNativeVtt)) {
4713
+ addResolvedTextTracks(textTracks, textTracks.map(textTrackConfig => textTrackConfig.src));
4714
+ return;
4715
+ }
4716
+ const currentGeneration = generation;
4717
+ const pendingBlobUrls = new Set();
4718
+ Promise.all(textTracks.map(textTrackConfig => isNativeVtt(textTrackConfig) ? toCredentialedBlobUrl(textTrackConfig.src, pendingBlobUrls) : textTrackConfig.src)).then(srcs => {
4719
+ if (currentGeneration !== generation) {
4720
+ revokeBlobUrls(pendingBlobUrls);
4721
+ return;
4722
+ }
4723
+ pendingBlobUrls.forEach(blobUrl => blobUrls.add(blobUrl));
4724
+ addResolvedTextTracks(textTracks, srcs);
4725
+ });
4726
+ };
4727
+
4702
4728
  // Several tracks can show at once (e.g. descriptions + captions), so each one needs its cues loaded
4703
4729
  const syncShowingTracks = () => {
4704
4730
  const textTracks = Array.from(player.textTracks());
@@ -5187,7 +5213,7 @@ class VideoPlayer {
5187
5213
  const analyticsData = getAnalyticsFromPlayerOptions(options);
5188
5214
  const analyticsParams = new URLSearchParams(analyticsData).toString();
5189
5215
  const baseParams = new URLSearchParams({
5190
- vpVersion: "4.1.5",
5216
+ vpVersion: "4.1.6-edge.1",
5191
5217
  vpInstanceId: this.getVPInstanceId(),
5192
5218
  cloudName: options.cloudinary.cloud_name,
5193
5219
  ...internalAnalyticsMetadata
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudinary-video-player",
3
- "version": "4.1.5",
3
+ "version": "4.1.6-edge.1",
4
4
  "description": "Cloudinary Video Player",
5
5
  "author": "Cloudinary",
6
6
  "license": "MIT",