cloudinary-video-player 4.1.4-edge.0 → 4.1.4-edge.2

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 +18 -7
  48. package/lib/player.min.css +3 -3
  49. package/lib/video-player.js +26 -34
  50. package/package.json +1 -1
@@ -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.4-edge.0"
564
+ 'X-Cld-Video-Player-Version': "4.1.4-edge.2"
565
565
  }
566
566
  }).then(response => {
567
567
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
@@ -2906,7 +2906,9 @@ class CloudinaryContext {
2906
2906
  // Inherit source transformation
2907
2907
  const srcTx = options.transformation;
2908
2908
  if (srcTx && !isEmpty(srcTx)) {
2909
- const imageSafeTx = omitVideoOnlyTransformations(srcTx);
2909
+ const imageSafeTx = omitVideoOnlyTransformations(srcTx, {
2910
+ keepAutoFormat: true
2911
+ });
2910
2912
  const merged = mergeTransformations(posterOptions.transformation || {}, imageSafeTx);
2911
2913
  // Remove height when aspect_ratio is set
2912
2914
  if (merged.aspect_ratio) {
@@ -3211,7 +3213,7 @@ class CloudinaryAnalytics {
3211
3213
  }, {
3212
3214
  ...(isPlainObject(this.analyticsOptions) ? this.analyticsOptions : {}),
3213
3215
  videoPlayerType: 'cloudinary video player',
3214
- videoPlayerVersion: "4.1.4-edge.0"
3216
+ videoPlayerVersion: "4.1.4-edge.2"
3215
3217
  });
3216
3218
  } else if (this.currentVideoMetadata.cloudName !== metadata.cloudName || this.currentVideoMetadata.publicId !== metadata.publicId) {
3217
3219
  this.cloudinaryAnalytics.stopManualTracking();
@@ -4550,7 +4552,7 @@ const getTranscriptionFileUrl = function (urlPrefix, deliveryType, publicId) {
4550
4552
  function textTracksManager() {
4551
4553
  const player = this;
4552
4554
  const textTracksData = new WeakMap();
4553
- let activeTrack = null;
4555
+ let showingTracks = new Set();
4554
4556
  const removeAllTextTracks = () => {
4555
4557
  const currentTracks = player.remoteTextTracks();
4556
4558
  if (currentTracks) {
@@ -4694,37 +4696,27 @@ function textTracksManager() {
4694
4696
  addTextTrack('transcript', textTrackConfig);
4695
4697
  }
4696
4698
  });
4697
- const defaultTextTrack = Array.from(player.remoteTextTracks()).find(textTrack => textTrack.default);
4698
- if (defaultTextTrack) {
4699
- onChangeActiveTrack(defaultTextTrack);
4700
- }
4699
+ syncShowingTracks();
4701
4700
  };
4702
- const onChangeActiveTrack = textTrack => {
4703
- const prevActiveTrack = activeTrack;
4704
- activeTrack = textTrack;
4705
- const prevTextTrackData = textTracksData.get(prevActiveTrack);
4706
- if (prevTextTrackData) {
4707
- prevTextTrackData.abortLoading();
4708
- }
4709
- const selectedTextTrackData = textTracksData.get(activeTrack);
4710
- if (selectedTextTrackData) {
4711
- selectedTextTrackData.load();
4712
- }
4713
- };
4714
- player.on('texttrackchange', () => {
4715
- const textTracks = player.textTracks();
4716
- let newActiveTrack = null;
4717
- for (let i = 0; i < textTracks.length; i++) {
4718
- const track = textTracks[i];
4719
- if (track.mode === 'showing') {
4720
- newActiveTrack = track;
4721
- break;
4701
+
4702
+ // Several tracks can show at once (e.g. descriptions + captions), so each one needs its cues loaded
4703
+ const syncShowingTracks = () => {
4704
+ const textTracks = Array.from(player.textTracks());
4705
+ // texttrackchange can fire inside addRemoteTextTrack, before the track's data exists - skip it until then
4706
+ const nowShowing = new Set(textTracks.filter(track => track.mode === 'showing' && textTracksData.has(track)));
4707
+ showingTracks.forEach(track => {
4708
+ if (!nowShowing.has(track)) {
4709
+ textTracksData.get(track)?.abortLoading();
4722
4710
  }
4723
- }
4724
- if (activeTrack !== newActiveTrack) {
4725
- onChangeActiveTrack(newActiveTrack);
4726
- }
4727
- });
4711
+ });
4712
+ nowShowing.forEach(track => {
4713
+ if (!showingTracks.has(track)) {
4714
+ textTracksData.get(track)?.load();
4715
+ }
4716
+ });
4717
+ showingTracks = nowShowing;
4718
+ };
4719
+ player.on('texttrackchange', syncShowingTracks);
4728
4720
  return {
4729
4721
  removeAllTextTracks,
4730
4722
  addTextTracks: function () {
@@ -5195,7 +5187,7 @@ class VideoPlayer {
5195
5187
  const analyticsData = getAnalyticsFromPlayerOptions(options);
5196
5188
  const analyticsParams = new URLSearchParams(analyticsData).toString();
5197
5189
  const baseParams = new URLSearchParams({
5198
- vpVersion: "4.1.4-edge.0",
5190
+ vpVersion: "4.1.4-edge.2",
5199
5191
  vpInstanceId: this.getVPInstanceId(),
5200
5192
  cloudName: options.cloudinary.cloud_name,
5201
5193
  ...internalAnalyticsMetadata
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudinary-video-player",
3
- "version": "4.1.4-edge.0",
3
+ "version": "4.1.4-edge.2",
4
4
  "description": "Cloudinary Video Player",
5
5
  "author": "Cloudinary",
6
6
  "license": "MIT",