cloudinary-video-player 2.0.3-edge.0 → 2.0.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.
@@ -502,6 +502,9 @@
502
502
  .cld-video-player .vjs-text-track-display > div {
503
503
  margin: 3% !important;
504
504
  }
505
+ .cld-video-player .vjs-text-track-display.cld-paced-text-tracks b {
506
+ color: var(--color-accent);
507
+ }
505
508
  .cld-video-player .vjs-text-track-cue {
506
509
  top: auto !important;
507
510
  bottom: 3.4rem !important;
@@ -9545,7 +9545,7 @@ class CloudinaryAnalytics {
9545
9545
  this.currentVideMetadata = metadata;
9546
9546
  this.cloudinaryAnalytics.startManualTracking(metadata, {
9547
9547
  videoPlayerType: 'cloudinary video player',
9548
- videoPlayerVersion: "2.0.3-edge.0"
9548
+ videoPlayerVersion: "2.0.3"
9549
9549
  });
9550
9550
  } else if (this.currentVideMetadata.cloudName !== metadata.cloudName || this.currentVideMetadata.publicId !== metadata.publicId) {
9551
9551
  this.cloudinaryAnalytics.stopManualTracking();
@@ -9898,7 +9898,7 @@ class CloudinaryContext {
9898
9898
  options.sourceTypes = options.sourceTypes || _this.sourceTypes();
9899
9899
  options.poster = options.poster || posterOptionsForCurrent();
9900
9900
  options.queryParams = Object.assign(options.queryParams || {}, options.usageReport ? {
9901
- _s: "vp-".concat("2.0.3-edge.0")
9901
+ _s: "vp-".concat("2.0.3")
9902
9902
  } : {});
9903
9903
  if (options.sourceTypes.indexOf('audio') > -1) {
9904
9904
  builtSrc = new _models_audio_source_audio_source__WEBPACK_IMPORTED_MODULE_7__["default"](publicId, options);
@@ -10525,6 +10525,7 @@ class VideoSource extends _base_source__WEBPACK_IMPORTED_MODULE_7__["default"] {
10525
10525
  this._chapters = null;
10526
10526
  this._type = utils_consts__WEBPACK_IMPORTED_MODULE_3__.SOURCE_TYPE.VIDEO;
10527
10527
  this.isRawUrl = _isRawUrl;
10528
+ this.isLiveStream = options.type === 'live';
10528
10529
  this._rawTransformation = options.raw_transformation;
10529
10530
  this.withCredentials = !!withCredentials;
10530
10531
  this.getInitOptions = () => initOptions;
@@ -10605,6 +10606,9 @@ class VideoSource extends _base_source__WEBPACK_IMPORTED_MODULE_7__["default"] {
10605
10606
  if (!publicId && this.isRawUrl) {
10606
10607
  return null;
10607
10608
  }
10609
+ if (this.isLiveStream) {
10610
+ return null;
10611
+ }
10608
10612
  if (!publicId) {
10609
10613
  publicId = this.publicId();
10610
10614
  options = Object.assign({}, options, _video_source_const__WEBPACK_IMPORTED_MODULE_4__.DEFAULT_POSTER_PARAMS);
@@ -10648,7 +10652,8 @@ class VideoSource extends _base_source__WEBPACK_IMPORTED_MODULE_7__["default"] {
10648
10652
  }
10649
10653
  if (isAdaptive) {
10650
10654
  // Search for streaming_profile anywhere in the transformation
10651
- if (!JSON.stringify(opts.transformation || {}).includes('"streaming_profile":')) {
10655
+ const hasStreamingProfile = JSON.stringify(opts.transformation || {}).includes('"streaming_profile":');
10656
+ if (!hasStreamingProfile && !this.isLiveStream) {
10652
10657
  opts.transformation = (0,_common__WEBPACK_IMPORTED_MODULE_6__.mergeTransformations)(opts.transformation, {
10653
10658
  streaming_profile: 'auto'
10654
10659
  });
@@ -10959,7 +10964,7 @@ const contextMenuContent = player => {
10959
10964
  const isFullscreen = player.isFullscreen();
10960
10965
  const aboutMenuItem = {
10961
10966
  class: 'player-version',
10962
- label: 'Cloudinary Player v' + "2.0.3-edge.0"
10967
+ label: 'Cloudinary Player v' + "2.0.3"
10963
10968
  };
10964
10969
  if (!player.controls()) {
10965
10970
  return [aboutMenuItem];
@@ -12641,14 +12646,14 @@ const isKeyInTransformation = (transformation, key) => {
12641
12646
  };
12642
12647
  const addTextTracks = (tracks, videojs) => {
12643
12648
  tracks.forEach(track => {
12644
- if ((track.maxWords || track.wordHighlight) && videojs.pacedTranscript) {
12645
- videojs.pacedTranscript(track);
12646
- } else if (track.src) {
12649
+ if (track.src) {
12647
12650
  fetch(track.src, GET_ERROR_DEFAULT_REQUEST).then(r => {
12648
12651
  if (r.status >= 200 && r.status <= 399) {
12649
12652
  videojs.addRemoteTextTrack(track, true);
12650
12653
  }
12651
12654
  });
12655
+ } else if (videojs.pacedTranscript) {
12656
+ videojs.pacedTranscript(track);
12652
12657
  }
12653
12658
  });
12654
12659
  };
@@ -13595,7 +13600,7 @@ class VideoPlayer extends _utils__WEBPACK_IMPORTED_MODULE_8__["default"].mixin(_
13595
13600
  const analyticsData = (0,_utils_get_analytics_player_options__WEBPACK_IMPORTED_MODULE_17__.getAnalyticsFromPlayerOptions)(options);
13596
13601
  const analyticsParams = new URLSearchParams(analyticsData).toString();
13597
13602
  const baseParams = new URLSearchParams({
13598
- vpVersion: "2.0.3-edge.0",
13603
+ vpVersion: "2.0.3",
13599
13604
  vpInstanceId: this.getVPInstanceId(),
13600
13605
  // #if (process.env.WEBPACK_BUILD_LIGHT)
13601
13606
  // vpLightBuild: true,
@@ -13710,6 +13715,8 @@ class VideoPlayer extends _utils__WEBPACK_IMPORTED_MODULE_8__["default"].mixin(_
13710
13715
  } = _ref;
13711
13716
  if (!source || source.getType() === _utils_consts__WEBPACK_IMPORTED_MODULE_16__.SOURCE_TYPE.AUDIO ||
13712
13717
  // Is Audio
13718
+ source.resourceConfig().type === 'live' ||
13719
+ // Is live stream
13713
13720
  (0,_plugins_cloudinary_common__WEBPACK_IMPORTED_MODULE_18__.isRawUrl)(source.publicId()) ||
13714
13721
  // Is a raw url
13715
13722
  this.videojs.activePlugins_ && this.videojs.activePlugins_.vr // It's a VR (i.e. 360)
@@ -502,6 +502,9 @@
502
502
  .cld-video-player .vjs-text-track-display > div {
503
503
  margin: 3% !important;
504
504
  }
505
+ .cld-video-player .vjs-text-track-display.cld-paced-text-tracks b {
506
+ color: var(--color-accent);
507
+ }
505
508
  .cld-video-player .vjs-text-track-cue {
506
509
  top: auto !important;
507
510
  bottom: 3.4rem !important;
@@ -1330,7 +1330,7 @@ class CloudinaryAnalytics {
1330
1330
  this.currentVideMetadata = metadata;
1331
1331
  this.cloudinaryAnalytics.startManualTracking(metadata, {
1332
1332
  videoPlayerType: 'cloudinary video player',
1333
- videoPlayerVersion: "2.0.3-edge.0"
1333
+ videoPlayerVersion: "2.0.3"
1334
1334
  });
1335
1335
  } else if (this.currentVideMetadata.cloudName !== metadata.cloudName || this.currentVideMetadata.publicId !== metadata.publicId) {
1336
1336
  this.cloudinaryAnalytics.stopManualTracking();
@@ -1683,7 +1683,7 @@ class CloudinaryContext {
1683
1683
  options.sourceTypes = options.sourceTypes || _this.sourceTypes();
1684
1684
  options.poster = options.poster || posterOptionsForCurrent();
1685
1685
  options.queryParams = Object.assign(options.queryParams || {}, options.usageReport ? {
1686
- _s: "vp-".concat("2.0.3-edge.0")
1686
+ _s: "vp-".concat("2.0.3")
1687
1687
  } : {});
1688
1688
  if (options.sourceTypes.indexOf('audio') > -1) {
1689
1689
  builtSrc = new _models_audio_source_audio_source__WEBPACK_IMPORTED_MODULE_7__["default"](publicId, options);
@@ -2310,6 +2310,7 @@ class VideoSource extends _base_source__WEBPACK_IMPORTED_MODULE_7__["default"] {
2310
2310
  this._chapters = null;
2311
2311
  this._type = utils_consts__WEBPACK_IMPORTED_MODULE_3__.SOURCE_TYPE.VIDEO;
2312
2312
  this.isRawUrl = _isRawUrl;
2313
+ this.isLiveStream = options.type === 'live';
2313
2314
  this._rawTransformation = options.raw_transformation;
2314
2315
  this.withCredentials = !!withCredentials;
2315
2316
  this.getInitOptions = () => initOptions;
@@ -2390,6 +2391,9 @@ class VideoSource extends _base_source__WEBPACK_IMPORTED_MODULE_7__["default"] {
2390
2391
  if (!publicId && this.isRawUrl) {
2391
2392
  return null;
2392
2393
  }
2394
+ if (this.isLiveStream) {
2395
+ return null;
2396
+ }
2393
2397
  if (!publicId) {
2394
2398
  publicId = this.publicId();
2395
2399
  options = Object.assign({}, options, _video_source_const__WEBPACK_IMPORTED_MODULE_4__.DEFAULT_POSTER_PARAMS);
@@ -2433,7 +2437,8 @@ class VideoSource extends _base_source__WEBPACK_IMPORTED_MODULE_7__["default"] {
2433
2437
  }
2434
2438
  if (isAdaptive) {
2435
2439
  // Search for streaming_profile anywhere in the transformation
2436
- if (!JSON.stringify(opts.transformation || {}).includes('"streaming_profile":')) {
2440
+ const hasStreamingProfile = JSON.stringify(opts.transformation || {}).includes('"streaming_profile":');
2441
+ if (!hasStreamingProfile && !this.isLiveStream) {
2437
2442
  opts.transformation = (0,_common__WEBPACK_IMPORTED_MODULE_6__.mergeTransformations)(opts.transformation, {
2438
2443
  streaming_profile: 'auto'
2439
2444
  });
@@ -2744,7 +2749,7 @@ const contextMenuContent = player => {
2744
2749
  const isFullscreen = player.isFullscreen();
2745
2750
  const aboutMenuItem = {
2746
2751
  class: 'player-version',
2747
- label: 'Cloudinary Player v' + "2.0.3-edge.0"
2752
+ label: 'Cloudinary Player v' + "2.0.3"
2748
2753
  };
2749
2754
  if (!player.controls()) {
2750
2755
  return [aboutMenuItem];
@@ -4137,14 +4142,14 @@ const isKeyInTransformation = (transformation, key) => {
4137
4142
  };
4138
4143
  const addTextTracks = (tracks, videojs) => {
4139
4144
  tracks.forEach(track => {
4140
- if ((track.maxWords || track.wordHighlight) && videojs.pacedTranscript) {
4141
- videojs.pacedTranscript(track);
4142
- } else if (track.src) {
4145
+ if (track.src) {
4143
4146
  fetch(track.src, GET_ERROR_DEFAULT_REQUEST).then(r => {
4144
4147
  if (r.status >= 200 && r.status <= 399) {
4145
4148
  videojs.addRemoteTextTrack(track, true);
4146
4149
  }
4147
4150
  });
4151
+ } else if (videojs.pacedTranscript) {
4152
+ videojs.pacedTranscript(track);
4148
4153
  }
4149
4154
  });
4150
4155
  };
@@ -5090,7 +5095,7 @@ class VideoPlayer extends _utils__WEBPACK_IMPORTED_MODULE_8__["default"].mixin(_
5090
5095
  const analyticsData = (0,_utils_get_analytics_player_options__WEBPACK_IMPORTED_MODULE_17__.getAnalyticsFromPlayerOptions)(options);
5091
5096
  const analyticsParams = new URLSearchParams(analyticsData).toString();
5092
5097
  const baseParams = new URLSearchParams({
5093
- vpVersion: "2.0.3-edge.0",
5098
+ vpVersion: "2.0.3",
5094
5099
  vpInstanceId: this.getVPInstanceId(),
5095
5100
  // #if (process.env.WEBPACK_BUILD_LIGHT)
5096
5101
  vpLightBuild: true,
@@ -5205,6 +5210,8 @@ class VideoPlayer extends _utils__WEBPACK_IMPORTED_MODULE_8__["default"].mixin(_
5205
5210
  } = _ref;
5206
5211
  if (!source || source.getType() === _utils_consts__WEBPACK_IMPORTED_MODULE_16__.SOURCE_TYPE.AUDIO ||
5207
5212
  // Is Audio
5213
+ source.resourceConfig().type === 'live' ||
5214
+ // Is live stream
5208
5215
  (0,_plugins_cloudinary_common__WEBPACK_IMPORTED_MODULE_18__.isRawUrl)(source.publicId()) ||
5209
5216
  // Is a raw url
5210
5217
  this.videojs.activePlugins_ && this.videojs.activePlugins_.vr // It's a VR (i.e. 360)