cloudinary-video-player 4.1.3 → 4.1.4-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 (50) 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 +2 -2
  8. package/dist/chapters.min.js +2 -2
  9. package/dist/cld-player-core.js +9 -9
  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 +5 -2
  14. package/dist/cld-video-player.js +9 -9
  15. package/dist/cld-video-player.light.js +9 -9
  16. package/dist/cld-video-player.light.min.js +3 -3
  17. package/dist/cld-video-player.min.css +3 -3
  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 +9 -9
  31. package/dist/player-full.min.js +3 -3
  32. package/dist/player.css +5 -2
  33. package/dist/player.js +2 -2
  34. package/dist/player.min.css +3 -3
  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/cld-video-player.min.css +3 -3
  47. package/lib/index2.js +21 -11
  48. package/lib/player.min.css +3 -3
  49. package/lib/video-player.js +44 -39
  50. package/package.json +1 -1
@@ -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 sliceAndUnsetProperties, H as setupCloudinaryMiddleware, J as extendCloudinaryConfig, K as omitVideoOnlyTransformations, i as isPlainObject, L as isElement, M as setPosition, N as getPointerPosition, O as fontFace, p as playerClassPrefix, U as Utils, Q as defaults$6, R as ERROR_CODE, a as get } from './index2.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';
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.3"
564
+ 'X-Cld-Video-Player-Version': "4.1.4-edge.1"
565
565
  }
566
566
  }).then(response => {
567
567
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
@@ -2509,7 +2509,9 @@ class VideoSource extends BaseSource {
2509
2509
  }
2510
2510
  const srcs = this.sourceTypes().map(sourceType => {
2511
2511
  const srcTransformation = this.sourceTransformation()[sourceType] || this.transformation();
2512
- const format = normalizeFormat(sourceType);
2512
+ // An empty source type delivers the asset as-is: like 'auto', but without f_auto:video
2513
+ const deliverAsIs = sourceType === '';
2514
+ const format = normalizeFormat(sourceType || 'auto');
2513
2515
  const isAdaptive = ADAPTIVE_SOURCETYPES.includes(format);
2514
2516
  const opts = {};
2515
2517
  if (srcTransformation) {
@@ -2518,17 +2520,30 @@ class VideoSource extends BaseSource {
2518
2520
  Object.assign(opts, {
2519
2521
  format
2520
2522
  });
2521
- const [type, codecTrans] = formatToMimeTypeAndTransformation(sourceType);
2523
+ let [type, codecTrans] = formatToMimeTypeAndTransformation(sourceType || 'auto');
2522
2524
 
2523
2525
  // If user's transformation include video_codec then don't add another video codec to transformation
2524
2526
  if (codecTrans && !(hasCodec(opts.transformation) || hasCodec(this.rawTransformation()))) {
2525
2527
  opts.transformation = mergeTransformations(opts.transformation, codecTrans);
2526
2528
  }
2527
2529
  if (opts.format === 'auto') {
2530
+ const fetchFormat = getTransformationValue(opts.transformation, 'fetch_format');
2531
+ // `format` is an alias of `fetch_format`
2532
+ const callerFormat = fetchFormat || getTransformationValue(opts.transformation, 'format');
2528
2533
  delete opts.format;
2529
- opts.transformation = mergeTransformations(opts.transformation, {
2530
- fetch_format: 'auto:video'
2531
- });
2534
+ if (callerFormat && !callerFormat.startsWith('auto')) {
2535
+ // Respect the caller's format instead of adding f_auto:video
2536
+ if (!fetchFormat) {
2537
+ opts.transformation = mergeTransformations(opts.transformation, {
2538
+ fetch_format: callerFormat
2539
+ });
2540
+ }
2541
+ [type] = formatToMimeTypeAndTransformation(callerFormat);
2542
+ } else if (!deliverAsIs) {
2543
+ opts.transformation = mergeTransformations(opts.transformation, {
2544
+ fetch_format: 'auto:video'
2545
+ });
2546
+ }
2532
2547
  }
2533
2548
  if (isAdaptive) {
2534
2549
  // Search for streaming_profile anywhere in the transformation
@@ -3196,7 +3211,7 @@ class CloudinaryAnalytics {
3196
3211
  }, {
3197
3212
  ...(isPlainObject(this.analyticsOptions) ? this.analyticsOptions : {}),
3198
3213
  videoPlayerType: 'cloudinary video player',
3199
- videoPlayerVersion: "4.1.3"
3214
+ videoPlayerVersion: "4.1.4-edge.1"
3200
3215
  });
3201
3216
  } else if (this.currentVideoMetadata.cloudName !== metadata.cloudName || this.currentVideoMetadata.publicId !== metadata.publicId) {
3202
3217
  this.cloudinaryAnalytics.stopManualTracking();
@@ -4535,7 +4550,7 @@ const getTranscriptionFileUrl = function (urlPrefix, deliveryType, publicId) {
4535
4550
  function textTracksManager() {
4536
4551
  const player = this;
4537
4552
  const textTracksData = new WeakMap();
4538
- let activeTrack = null;
4553
+ let showingTracks = new Set();
4539
4554
  const removeAllTextTracks = () => {
4540
4555
  const currentTracks = player.remoteTextTracks();
4541
4556
  if (currentTracks) {
@@ -4679,37 +4694,27 @@ function textTracksManager() {
4679
4694
  addTextTrack('transcript', textTrackConfig);
4680
4695
  }
4681
4696
  });
4682
- const defaultTextTrack = Array.from(player.remoteTextTracks()).find(textTrack => textTrack.default);
4683
- if (defaultTextTrack) {
4684
- onChangeActiveTrack(defaultTextTrack);
4685
- }
4686
- };
4687
- const onChangeActiveTrack = textTrack => {
4688
- const prevActiveTrack = activeTrack;
4689
- activeTrack = textTrack;
4690
- const prevTextTrackData = textTracksData.get(prevActiveTrack);
4691
- if (prevTextTrackData) {
4692
- prevTextTrackData.abortLoading();
4693
- }
4694
- const selectedTextTrackData = textTracksData.get(activeTrack);
4695
- if (selectedTextTrackData) {
4696
- selectedTextTrackData.load();
4697
- }
4697
+ syncShowingTracks();
4698
4698
  };
4699
- player.on('texttrackchange', () => {
4700
- const textTracks = player.textTracks();
4701
- let newActiveTrack = null;
4702
- for (let i = 0; i < textTracks.length; i++) {
4703
- const track = textTracks[i];
4704
- if (track.mode === 'showing') {
4705
- newActiveTrack = track;
4706
- break;
4699
+
4700
+ // Several tracks can show at once (e.g. descriptions + captions), so each one needs its cues loaded
4701
+ const syncShowingTracks = () => {
4702
+ const textTracks = Array.from(player.textTracks());
4703
+ // texttrackchange can fire inside addRemoteTextTrack, before the track's data exists - skip it until then
4704
+ const nowShowing = new Set(textTracks.filter(track => track.mode === 'showing' && textTracksData.has(track)));
4705
+ showingTracks.forEach(track => {
4706
+ if (!nowShowing.has(track)) {
4707
+ textTracksData.get(track)?.abortLoading();
4707
4708
  }
4708
- }
4709
- if (activeTrack !== newActiveTrack) {
4710
- onChangeActiveTrack(newActiveTrack);
4711
- }
4712
- });
4709
+ });
4710
+ nowShowing.forEach(track => {
4711
+ if (!showingTracks.has(track)) {
4712
+ textTracksData.get(track)?.load();
4713
+ }
4714
+ });
4715
+ showingTracks = nowShowing;
4716
+ };
4717
+ player.on('texttrackchange', syncShowingTracks);
4713
4718
  return {
4714
4719
  removeAllTextTracks,
4715
4720
  addTextTracks: function () {
@@ -5180,7 +5185,7 @@ class VideoPlayer {
5180
5185
  const analyticsData = getAnalyticsFromPlayerOptions(options);
5181
5186
  const analyticsParams = new URLSearchParams(analyticsData).toString();
5182
5187
  const baseParams = new URLSearchParams({
5183
- vpVersion: "4.1.3",
5188
+ vpVersion: "4.1.4-edge.1",
5184
5189
  vpInstanceId: this.getVPInstanceId(),
5185
5190
  cloudName: options.cloudinary.cloud_name,
5186
5191
  ...internalAnalyticsMetadata
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudinary-video-player",
3
- "version": "4.1.3",
3
+ "version": "4.1.4-edge.1",
4
4
  "description": "Cloudinary Video Player",
5
5
  "author": "Cloudinary",
6
6
  "license": "MIT",