cloudinary-video-player 2.0.6-edge.0 → 2.1.1-edge.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.
@@ -1,2 +1,2 @@
1
- "use strict";(self.cloudinaryVideoPlayerChunkLoading=self.cloudinaryVideoPlayerChunkLoading||[]).push([[625],{9234:(t,e,r)=>{r.d(e,{default:()=>n});var s=r(6673),a=r.n(s),i=r(8033);const o=function(){function t(t,e){return this.player=t,this.options=e,this.player.one("loadedmetadata",this.initializeChapters.bind(this)),this}return t.prototype.src=function(t){this.resetPlugin(),this.options=t,this.player.one("loadedmetadata",this.initializeChapters.bind(this))},t.prototype.detach=function(){this.resetPlugin()},t.prototype.resetPlugin=function(){this.chaptersTrack&&(this.player.$(".vjs-control-bar-chapter-display").remove(),this.player.$(".vjs-chapter-display").remove(),this.player.$$(".vjs-chapter-marker").forEach((t=>t.remove())),this.player.removeRemoteTextTrack(this.chaptersTrack),delete this.chaptersTrack)},t.prototype.getChaptersFileUrlByName=function(){const t=this.player.cloudinary.currentPublicId();if(!t)return null;return`${(0,i.KA)(`${t}-chapters.vtt`,(0,i.lP)(this.player.cloudinary.cloudinaryConfig(),{resource_type:"raw",version:"1"}))}?t=${Date.now()}`},t.prototype.initializeChapters=async function(){const t=!0===this.options?this.getChaptersFileUrlByName():this.options.url;if(t){const e={kind:"chapters",src:t,default:!0},r=this.player.addRemoteTextTrack(e);r.addEventListener("load",(()=>{this.chaptersTrack=r.track,this.setupChaptersDisplays()}))}else if(Object.entries(this.options).length){const t=this.player.addRemoteTextTrack({kind:"chapters",default:!0});await new Promise((t=>setTimeout(t,100)));const e=this.player.duration();Object.entries(this.options).forEach(((r,s,a)=>{const i=new VTTCue(parseFloat(r[0]),parseFloat(a[s+1]?a[s+1][0]:e),r[1]);t.track.addCue(i)})),this.chaptersTrack=t.track,this.setupChaptersDisplays(),this.player.controlBar.chaptersButton&&this.player.controlBar.chaptersButton.update()}},t.prototype.setupChaptersDisplays=function(){this.setupProgressBarMarkers(),this.setupProgressBarChapter(),this.setupControlBarChapter()},t.prototype.setupControlBarChapter=function(){const t=this.player.$(".vjs-control-bar-chapter-display")||document.createElement("div");t.setAttribute("class","vjs-control-bar-chapter-display");const e=this.player.$(".vjs-control-bar .vjs-spacer");e.innerHTML="",e.classList.add("vjs-control-bar-chapter-wrapper"),e.appendChild(t),this.chaptersTrack.addEventListener("cuechange",(()=>{const e=Array.from(this.chaptersTrack.activeCues);t.innerText=e.length>0?e[0].text:""}))},t.prototype.setupProgressBarMarkers=function(){const t=this.player.duration(),{seekBar:e}=this.player.controlBar.progressControl;Array.from(this.chaptersTrack.cues).forEach((r=>{if(0!==r.startTime){const s=r.startTime/t*100+"%",i=a().dom.createEl("div",void 0,{class:"vjs-chapter-marker",style:`left: ${s}`});e.el().append(i)}}))},t.prototype.setupProgressBarChapter=function(){const t=a().dom.createEl("div",void 0,{class:"vjs-chapter-display",style:`max-width: ${this.player.$(".vjs-vtt-thumbnail-display")?this.player.$(".vjs-vtt-thumbnail-display").style.width:"160px"}`}),e=this.player.getDescendant(["controlBar","progressControl","seekBar","mouseTimeDisplay"]),r=e.getDescendant(["timeTooltip"]);r.el().parentElement.prepend(t);const s=t=>{const e=t*this.player.duration(),r=Array.from(this.chaptersTrack.cues).find((t=>e>=t.startTime&&e<=t.endTime));return r?r.text:""};r.update=function(e,r,a){Object.getPrototypeOf(this).update.call(this,e,r,a),t.innerText=s(r)},"object"!=typeof this.player.vttThumbnails&&(e.update=function(e,s){const i=s*this.player_.duration(),o=e.width,n=t.clientWidth/2;r.updateTime(e,s,i,(()=>{e.width*s<n?this.el_.style.left=`${n}px`:e.width*s+n>o?this.el_.style.left=e.width-n+"px":this.el_.style.left=e.width*s+"px"})),r.write(a().time.formatTime(i))})},t}(),n=function(t,e){e.addClass("vjs-chapters"),e.chapters=new o(e,t)}}}]);
1
+ "use strict";(self.cloudinaryVideoPlayerChunkLoading=self.cloudinaryVideoPlayerChunkLoading||[]).push([[625],{9234:(t,e,r)=>{r.d(e,{default:()=>n});var s=r(6673),a=r.n(s),i=r(9388);const o=function(){function t(t,e){return this.player=t,this.options=e,this.player.one("loadedmetadata",this.initializeChapters.bind(this)),this}return t.prototype.src=function(t){this.resetPlugin(),this.options=t,this.player.one("loadedmetadata",this.initializeChapters.bind(this))},t.prototype.detach=function(){this.resetPlugin()},t.prototype.resetPlugin=function(){this.chaptersTrack&&(this.player.$(".vjs-control-bar-chapter-display").remove(),this.player.$(".vjs-chapter-display").remove(),this.player.$$(".vjs-chapter-marker").forEach((t=>t.remove())),this.player.removeRemoteTextTrack(this.chaptersTrack),delete this.chaptersTrack)},t.prototype.getChaptersFileUrlByName=function(){const t=this.player.cloudinary.currentPublicId();if(!t)return null;return`${(0,i.KA)(`${t}-chapters.vtt`,(0,i.lP)(this.player.cloudinary.cloudinaryConfig(),{resource_type:"raw",version:"1"}))}?t=${Date.now()}`},t.prototype.initializeChapters=async function(){const t=!0===this.options?this.getChaptersFileUrlByName():this.options.url;if(t){const e={kind:"chapters",src:t,default:!0},r=this.player.addRemoteTextTrack(e);r.addEventListener("load",(()=>{this.chaptersTrack=r.track,this.setupChaptersDisplays()}))}else if(Object.entries(this.options).length){const t=this.player.addRemoteTextTrack({kind:"chapters",default:!0});await new Promise((t=>setTimeout(t,100)));const e=this.player.duration();Object.entries(this.options).forEach(((r,s,a)=>{const i=new VTTCue(parseFloat(r[0]),parseFloat(a[s+1]?a[s+1][0]:e),r[1]);t.track.addCue(i)})),this.chaptersTrack=t.track,this.setupChaptersDisplays(),this.player.controlBar.chaptersButton&&this.player.controlBar.chaptersButton.update()}},t.prototype.setupChaptersDisplays=function(){this.setupProgressBarMarkers(),this.setupProgressBarChapter(),this.setupControlBarChapter()},t.prototype.setupControlBarChapter=function(){const t=this.player.$(".vjs-control-bar-chapter-display")||document.createElement("div");t.setAttribute("class","vjs-control-bar-chapter-display");const e=this.player.$(".vjs-control-bar .vjs-spacer");e.innerHTML="",e.classList.add("vjs-control-bar-chapter-wrapper"),e.appendChild(t),this.chaptersTrack.addEventListener("cuechange",(()=>{const e=Array.from(this.chaptersTrack.activeCues);t.innerText=e.length>0?e[0].text:""}))},t.prototype.setupProgressBarMarkers=function(){const t=this.player.duration(),{seekBar:e}=this.player.controlBar.progressControl;Array.from(this.chaptersTrack.cues).forEach((r=>{if(0!==r.startTime){const s=r.startTime/t*100+"%",i=a().dom.createEl("div",void 0,{class:"vjs-chapter-marker",style:`left: ${s}`});e.el().append(i)}}))},t.prototype.setupProgressBarChapter=function(){const t=a().dom.createEl("div",void 0,{class:"vjs-chapter-display",style:`max-width: ${this.player.$(".vjs-vtt-thumbnail-display")?this.player.$(".vjs-vtt-thumbnail-display").style.width:"160px"}`}),e=this.player.getDescendant(["controlBar","progressControl","seekBar","mouseTimeDisplay"]),r=e.getDescendant(["timeTooltip"]);r.el().parentElement.prepend(t);const s=t=>{const e=t*this.player.duration(),r=Array.from(this.chaptersTrack.cues).find((t=>e>=t.startTime&&e<=t.endTime));return r?r.text:""};r.update=function(e,r,a){Object.getPrototypeOf(this).update.call(this,e,r,a),t.innerText=s(r)},"object"!=typeof this.player.vttThumbnails&&(e.update=function(e,s){const i=s*this.player_.duration(),o=e.width,n=t.clientWidth/2;r.updateTime(e,s,i,(()=>{e.width*s<n?this.el_.style.left=`${n}px`:e.width*s+n>o?this.el_.style.left=e.width-n+"px":this.el_.style.left=e.width*s+"px"})),r.write(a().time.formatTime(i))})},t}(),n=function(t,e){e.addClass("vjs-chapters"),e.chapters=new o(e,t)}}}]);
2
2
  //# sourceMappingURL=chapters.light.min.js.map
@@ -1,2 +1,2 @@
1
- "use strict";(self.cloudinaryVideoPlayerChunkLoading=self.cloudinaryVideoPlayerChunkLoading||[]).push([[625],{9234:(t,e,r)=>{r.d(e,{default:()=>n});var s=r(7938),a=r.n(s),i=r(8033);const o=function(){function t(t,e){return this.player=t,this.options=e,this.player.one("loadedmetadata",this.initializeChapters.bind(this)),this}return t.prototype.src=function(t){this.resetPlugin(),this.options=t,this.player.one("loadedmetadata",this.initializeChapters.bind(this))},t.prototype.detach=function(){this.resetPlugin()},t.prototype.resetPlugin=function(){this.chaptersTrack&&(this.player.$(".vjs-control-bar-chapter-display").remove(),this.player.$(".vjs-chapter-display").remove(),this.player.$$(".vjs-chapter-marker").forEach((t=>t.remove())),this.player.removeRemoteTextTrack(this.chaptersTrack),delete this.chaptersTrack)},t.prototype.getChaptersFileUrlByName=function(){const t=this.player.cloudinary.currentPublicId();if(!t)return null;return`${(0,i.KA)(`${t}-chapters.vtt`,(0,i.lP)(this.player.cloudinary.cloudinaryConfig(),{resource_type:"raw",version:"1"}))}?t=${Date.now()}`},t.prototype.initializeChapters=async function(){const t=!0===this.options?this.getChaptersFileUrlByName():this.options.url;if(t){const e={kind:"chapters",src:t,default:!0},r=this.player.addRemoteTextTrack(e);r.addEventListener("load",(()=>{this.chaptersTrack=r.track,this.setupChaptersDisplays()}))}else if(Object.entries(this.options).length){const t=this.player.addRemoteTextTrack({kind:"chapters",default:!0});await new Promise((t=>setTimeout(t,100)));const e=this.player.duration();Object.entries(this.options).forEach(((r,s,a)=>{const i=new VTTCue(parseFloat(r[0]),parseFloat(a[s+1]?a[s+1][0]:e),r[1]);t.track.addCue(i)})),this.chaptersTrack=t.track,this.setupChaptersDisplays(),this.player.controlBar.chaptersButton&&this.player.controlBar.chaptersButton.update()}},t.prototype.setupChaptersDisplays=function(){this.setupProgressBarMarkers(),this.setupProgressBarChapter(),this.setupControlBarChapter()},t.prototype.setupControlBarChapter=function(){const t=this.player.$(".vjs-control-bar-chapter-display")||document.createElement("div");t.setAttribute("class","vjs-control-bar-chapter-display");const e=this.player.$(".vjs-control-bar .vjs-spacer");e.innerHTML="",e.classList.add("vjs-control-bar-chapter-wrapper"),e.appendChild(t),this.chaptersTrack.addEventListener("cuechange",(()=>{const e=Array.from(this.chaptersTrack.activeCues);t.innerText=e.length>0?e[0].text:""}))},t.prototype.setupProgressBarMarkers=function(){const t=this.player.duration(),{seekBar:e}=this.player.controlBar.progressControl;Array.from(this.chaptersTrack.cues).forEach((r=>{if(0!==r.startTime){const s=r.startTime/t*100+"%",i=a().dom.createEl("div",void 0,{class:"vjs-chapter-marker",style:`left: ${s}`});e.el().append(i)}}))},t.prototype.setupProgressBarChapter=function(){const t=a().dom.createEl("div",void 0,{class:"vjs-chapter-display",style:`max-width: ${this.player.$(".vjs-vtt-thumbnail-display")?this.player.$(".vjs-vtt-thumbnail-display").style.width:"160px"}`}),e=this.player.getDescendant(["controlBar","progressControl","seekBar","mouseTimeDisplay"]),r=e.getDescendant(["timeTooltip"]);r.el().parentElement.prepend(t);const s=t=>{const e=t*this.player.duration(),r=Array.from(this.chaptersTrack.cues).find((t=>e>=t.startTime&&e<=t.endTime));return r?r.text:""};r.update=function(e,r,a){Object.getPrototypeOf(this).update.call(this,e,r,a),t.innerText=s(r)},"object"!=typeof this.player.vttThumbnails&&(e.update=function(e,s){const i=s*this.player_.duration(),o=e.width,n=t.clientWidth/2;r.updateTime(e,s,i,(()=>{e.width*s<n?this.el_.style.left=`${n}px`:e.width*s+n>o?this.el_.style.left=e.width-n+"px":this.el_.style.left=e.width*s+"px"})),r.write(a().time.formatTime(i))})},t}(),n=function(t,e){e.addClass("vjs-chapters"),e.chapters=new o(e,t)}}}]);
1
+ "use strict";(self.cloudinaryVideoPlayerChunkLoading=self.cloudinaryVideoPlayerChunkLoading||[]).push([[625],{9234:(t,e,r)=>{r.d(e,{default:()=>n});var s=r(7938),a=r.n(s),i=r(9388);const o=function(){function t(t,e){return this.player=t,this.options=e,this.player.one("loadedmetadata",this.initializeChapters.bind(this)),this}return t.prototype.src=function(t){this.resetPlugin(),this.options=t,this.player.one("loadedmetadata",this.initializeChapters.bind(this))},t.prototype.detach=function(){this.resetPlugin()},t.prototype.resetPlugin=function(){this.chaptersTrack&&(this.player.$(".vjs-control-bar-chapter-display").remove(),this.player.$(".vjs-chapter-display").remove(),this.player.$$(".vjs-chapter-marker").forEach((t=>t.remove())),this.player.removeRemoteTextTrack(this.chaptersTrack),delete this.chaptersTrack)},t.prototype.getChaptersFileUrlByName=function(){const t=this.player.cloudinary.currentPublicId();if(!t)return null;return`${(0,i.KA)(`${t}-chapters.vtt`,(0,i.lP)(this.player.cloudinary.cloudinaryConfig(),{resource_type:"raw",version:"1"}))}?t=${Date.now()}`},t.prototype.initializeChapters=async function(){const t=!0===this.options?this.getChaptersFileUrlByName():this.options.url;if(t){const e={kind:"chapters",src:t,default:!0},r=this.player.addRemoteTextTrack(e);r.addEventListener("load",(()=>{this.chaptersTrack=r.track,this.setupChaptersDisplays()}))}else if(Object.entries(this.options).length){const t=this.player.addRemoteTextTrack({kind:"chapters",default:!0});await new Promise((t=>setTimeout(t,100)));const e=this.player.duration();Object.entries(this.options).forEach(((r,s,a)=>{const i=new VTTCue(parseFloat(r[0]),parseFloat(a[s+1]?a[s+1][0]:e),r[1]);t.track.addCue(i)})),this.chaptersTrack=t.track,this.setupChaptersDisplays(),this.player.controlBar.chaptersButton&&this.player.controlBar.chaptersButton.update()}},t.prototype.setupChaptersDisplays=function(){this.setupProgressBarMarkers(),this.setupProgressBarChapter(),this.setupControlBarChapter()},t.prototype.setupControlBarChapter=function(){const t=this.player.$(".vjs-control-bar-chapter-display")||document.createElement("div");t.setAttribute("class","vjs-control-bar-chapter-display");const e=this.player.$(".vjs-control-bar .vjs-spacer");e.innerHTML="",e.classList.add("vjs-control-bar-chapter-wrapper"),e.appendChild(t),this.chaptersTrack.addEventListener("cuechange",(()=>{const e=Array.from(this.chaptersTrack.activeCues);t.innerText=e.length>0?e[0].text:""}))},t.prototype.setupProgressBarMarkers=function(){const t=this.player.duration(),{seekBar:e}=this.player.controlBar.progressControl;Array.from(this.chaptersTrack.cues).forEach((r=>{if(0!==r.startTime){const s=r.startTime/t*100+"%",i=a().dom.createEl("div",void 0,{class:"vjs-chapter-marker",style:`left: ${s}`});e.el().append(i)}}))},t.prototype.setupProgressBarChapter=function(){const t=a().dom.createEl("div",void 0,{class:"vjs-chapter-display",style:`max-width: ${this.player.$(".vjs-vtt-thumbnail-display")?this.player.$(".vjs-vtt-thumbnail-display").style.width:"160px"}`}),e=this.player.getDescendant(["controlBar","progressControl","seekBar","mouseTimeDisplay"]),r=e.getDescendant(["timeTooltip"]);r.el().parentElement.prepend(t);const s=t=>{const e=t*this.player.duration(),r=Array.from(this.chaptersTrack.cues).find((t=>e>=t.startTime&&e<=t.endTime));return r?r.text:""};r.update=function(e,r,a){Object.getPrototypeOf(this).update.call(this,e,r,a),t.innerText=s(r)},"object"!=typeof this.player.vttThumbnails&&(e.update=function(e,s){const i=s*this.player_.duration(),o=e.width,n=t.clientWidth/2;r.updateTime(e,s,i,(()=>{e.width*s<n?this.el_.style.left=`${n}px`:e.width*s+n>o?this.el_.style.left=e.width-n+"px":this.el_.style.left=e.width*s+"px"})),r.write(a().time.formatTime(i))})},t}(),n=function(t,e){e.addClass("vjs-chapters"),e.chapters=new o(e,t)}}}]);
2
2
  //# sourceMappingURL=chapters.min.js.map
@@ -8448,7 +8448,6 @@ __webpack_require__.r(__webpack_exports__);
8448
8448
  /* harmony export */ player: () => (/* binding */ player),
8449
8449
  /* harmony export */ players: () => (/* binding */ players),
8450
8450
  /* harmony export */ videoPlayer: () => (/* binding */ videoPlayer),
8451
- /* harmony export */ videoPlayerWithProfile: () => (/* binding */ videoPlayerWithProfile),
8452
8451
  /* harmony export */ videoPlayers: () => (/* binding */ videoPlayers)
8453
8452
  /* harmony export */ });
8454
8453
  /* harmony import */ var assets_styles_main_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! assets/styles/main.scss */ "./assets/styles/main.scss");
@@ -8484,10 +8483,6 @@ const getPlayers = config => (selector, playerOptions, ready) => {
8484
8483
  };
8485
8484
  const videoPlayer = getVideoPlayer();
8486
8485
  const videoPlayers = getVideoPlayers();
8487
- const videoPlayerWithProfile = (id, playerOptions, ready) => {
8488
- console.warn('videoPlayerWithProfile method is DEPRECATED and will be removed soon, please use new `player` method instead');
8489
- return getPlayer()(id, playerOptions, ready);
8490
- };
8491
8486
  const player = getPlayer();
8492
8487
  const players = getPlayers();
8493
8488
  const cloudinaryVideoPlayerLegacyConfig = config => {
@@ -8501,7 +8496,6 @@ const cloudinary = {
8501
8496
  ...(window.cloudinary || {}),
8502
8497
  videoPlayer,
8503
8498
  videoPlayers,
8504
- videoPlayerWithProfile,
8505
8499
  player,
8506
8500
  players,
8507
8501
  Cloudinary: {
@@ -8602,19 +8596,20 @@ __webpack_require__.r(__webpack_exports__);
8602
8596
  /* harmony import */ var _video_player__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./video-player */ "./video-player.js");
8603
8597
  /* harmony import */ var _config_profiles__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./config/profiles */ "./config/profiles/index.js");
8604
8598
  /* harmony import */ var _plugins_cloudinary_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./plugins/cloudinary/common */ "./plugins/cloudinary/common.js");
8599
+ /* harmony import */ var _cloudinary_url_gen_backwards_utils_unsigned_url_prefix__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @cloudinary/url-gen/backwards/utils/unsigned_url_prefix */ "../node_modules/@cloudinary/url-gen/backwards/utils/unsigned_url_prefix.js");
8600
+
8605
8601
 
8606
8602
 
8607
8603
 
8608
- const getProfile = async (cloudName, profile) => {
8604
+ const getProfile = async (profile, initOptions) => {
8609
8605
  if (Object.keys(_config_profiles__WEBPACK_IMPORTED_MODULE_1__.defaultProfiles).includes(profile)) {
8610
8606
  return _config_profiles__WEBPACK_IMPORTED_MODULE_1__.defaultProfiles[profile];
8611
8607
  }
8612
- if ((0,_plugins_cloudinary_common__WEBPACK_IMPORTED_MODULE_2__.isRawUrl)(profile)) {
8613
- return await fetch(profile, {
8614
- method: 'GET'
8615
- }).then(res => res.json());
8616
- }
8617
- throw new Error('Custom profiles will be supported soon, please use one of default profiles: "cldDefault", "cldLooping" or "cldAdaptiveStream"');
8608
+ const urlPrefix = (0,_cloudinary_url_gen_backwards_utils_unsigned_url_prefix__WEBPACK_IMPORTED_MODULE_3__.unsigned_url_prefix)(null, initOptions.cloudName ?? initOptions.cloud_name, initOptions.private_cdn, initOptions.cdn_subdomain, initOptions.secure_cdn_subdomain, initOptions.cname, initOptions.secure ?? true, initOptions.secure_distribution);
8609
+ const profileUrl = (0,_plugins_cloudinary_common__WEBPACK_IMPORTED_MODULE_2__.isRawUrl)(profile) ? profile : `${urlPrefix}/_applet_/video_service/video_player_profiles/${profile.replaceAll(' ', '+')}.json`;
8610
+ return fetch(profileUrl, {
8611
+ method: 'GET'
8612
+ }).then(res => res.json());
8618
8613
  };
8619
8614
  const player = async (elem, initOptions, ready) => {
8620
8615
  const {
@@ -8622,7 +8617,7 @@ const player = async (elem, initOptions, ready) => {
8622
8617
  ...otherInitOptions
8623
8618
  } = initOptions;
8624
8619
  try {
8625
- const profileOptions = profile ? await getProfile(otherInitOptions.cloud_name, profile) : {};
8620
+ const profileOptions = profile ? await getProfile(profile, otherInitOptions) : {};
8626
8621
  const options = Object.assign({}, profileOptions.playerOptions, otherInitOptions);
8627
8622
  const videoPlayer = new _video_player__WEBPACK_IMPORTED_MODULE_0__["default"](elem, options, ready);
8628
8623
  const nativeVideoPlayerSourceMethod = videoPlayer.source;
@@ -9249,7 +9244,7 @@ class CloudinaryAnalytics {
9249
9244
  this.cloudinaryAnalytics.startManualTracking(metadata, {
9250
9245
  ...(lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_1___default()(this.analyticsOptions) ? this.analyticsOptions : {}),
9251
9246
  videoPlayerType: 'cloudinary video player',
9252
- videoPlayerVersion: "2.0.6-edge.0"
9247
+ videoPlayerVersion: "2.1.1-edge.0"
9253
9248
  });
9254
9249
  } else if (this.currentVideMetadata.cloudName !== metadata.cloudName || this.currentVideMetadata.publicId !== metadata.publicId) {
9255
9250
  this.cloudinaryAnalytics.stopManualTracking();
@@ -9619,7 +9614,7 @@ class CloudinaryContext {
9619
9614
  options.sourceTypes = options.sourceTypes || _this.sourceTypes();
9620
9615
  options.poster = options.poster || posterOptionsForCurrent();
9621
9616
  options.queryParams = Object.assign(options.queryParams || {}, options.usageReport ? {
9622
- _s: `vp-${"2.0.6-edge.0"}`
9617
+ _s: `vp-${"2.1.1-edge.0"}`
9623
9618
  } : {});
9624
9619
  if (options.sourceTypes.indexOf('audio') > -1) {
9625
9620
  builtSrc = new _models_audio_source_audio_source__WEBPACK_IMPORTED_MODULE_7__["default"](publicId, options);
@@ -10883,7 +10878,7 @@ const contextMenuContent = player => {
10883
10878
  const isFullscreen = player.isFullscreen();
10884
10879
  const aboutMenuItem = {
10885
10880
  class: 'player-version',
10886
- label: 'Cloudinary Player v' + "2.0.6-edge.0"
10881
+ label: 'Cloudinary Player v' + "2.1.1-edge.0"
10887
10882
  };
10888
10883
  if (!player.controls()) {
10889
10884
  return [aboutMenuItem];
@@ -13479,7 +13474,7 @@ class VideoPlayer extends _utils__WEBPACK_IMPORTED_MODULE_9__["default"].mixin(_
13479
13474
  const analyticsData = (0,_utils_get_analytics_player_options__WEBPACK_IMPORTED_MODULE_18__.getAnalyticsFromPlayerOptions)(options);
13480
13475
  const analyticsParams = new URLSearchParams(analyticsData).toString();
13481
13476
  const baseParams = new URLSearchParams({
13482
- vpVersion: "2.0.6-edge.0",
13477
+ vpVersion: "2.1.1-edge.0",
13483
13478
  vpInstanceId: this.getVPInstanceId(),
13484
13479
  // #if (process.env.WEBPACK_BUILD_LIGHT)
13485
13480
  // vpLightBuild: true,
@@ -612,7 +612,6 @@ __webpack_require__.r(__webpack_exports__);
612
612
  /* harmony export */ player: () => (/* binding */ player),
613
613
  /* harmony export */ players: () => (/* binding */ players),
614
614
  /* harmony export */ videoPlayer: () => (/* binding */ videoPlayer),
615
- /* harmony export */ videoPlayerWithProfile: () => (/* binding */ videoPlayerWithProfile),
616
615
  /* harmony export */ videoPlayers: () => (/* binding */ videoPlayers)
617
616
  /* harmony export */ });
618
617
  /* harmony import */ var assets_styles_main_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! assets/styles/main.scss */ "./assets/styles/main.scss");
@@ -648,10 +647,6 @@ const getPlayers = config => (selector, playerOptions, ready) => {
648
647
  };
649
648
  const videoPlayer = getVideoPlayer();
650
649
  const videoPlayers = getVideoPlayers();
651
- const videoPlayerWithProfile = (id, playerOptions, ready) => {
652
- console.warn('videoPlayerWithProfile method is DEPRECATED and will be removed soon, please use new `player` method instead');
653
- return getPlayer()(id, playerOptions, ready);
654
- };
655
650
  const player = getPlayer();
656
651
  const players = getPlayers();
657
652
  const cloudinaryVideoPlayerLegacyConfig = config => {
@@ -665,7 +660,6 @@ const cloudinary = {
665
660
  ...(window.cloudinary || {}),
666
661
  videoPlayer,
667
662
  videoPlayers,
668
- videoPlayerWithProfile,
669
663
  player,
670
664
  players,
671
665
  Cloudinary: {
@@ -766,19 +760,20 @@ __webpack_require__.r(__webpack_exports__);
766
760
  /* harmony import */ var _video_player__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./video-player */ "./video-player.js");
767
761
  /* harmony import */ var _config_profiles__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./config/profiles */ "./config/profiles/index.js");
768
762
  /* harmony import */ var _plugins_cloudinary_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./plugins/cloudinary/common */ "./plugins/cloudinary/common.js");
763
+ /* harmony import */ var _cloudinary_url_gen_backwards_utils_unsigned_url_prefix__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @cloudinary/url-gen/backwards/utils/unsigned_url_prefix */ "../node_modules/@cloudinary/url-gen/backwards/utils/unsigned_url_prefix.js");
764
+
769
765
 
770
766
 
771
767
 
772
- const getProfile = async (cloudName, profile) => {
768
+ const getProfile = async (profile, initOptions) => {
773
769
  if (Object.keys(_config_profiles__WEBPACK_IMPORTED_MODULE_1__.defaultProfiles).includes(profile)) {
774
770
  return _config_profiles__WEBPACK_IMPORTED_MODULE_1__.defaultProfiles[profile];
775
771
  }
776
- if ((0,_plugins_cloudinary_common__WEBPACK_IMPORTED_MODULE_2__.isRawUrl)(profile)) {
777
- return await fetch(profile, {
778
- method: 'GET'
779
- }).then(res => res.json());
780
- }
781
- throw new Error('Custom profiles will be supported soon, please use one of default profiles: "cldDefault", "cldLooping" or "cldAdaptiveStream"');
772
+ const urlPrefix = (0,_cloudinary_url_gen_backwards_utils_unsigned_url_prefix__WEBPACK_IMPORTED_MODULE_3__.unsigned_url_prefix)(null, initOptions.cloudName ?? initOptions.cloud_name, initOptions.private_cdn, initOptions.cdn_subdomain, initOptions.secure_cdn_subdomain, initOptions.cname, initOptions.secure ?? true, initOptions.secure_distribution);
773
+ const profileUrl = (0,_plugins_cloudinary_common__WEBPACK_IMPORTED_MODULE_2__.isRawUrl)(profile) ? profile : `${urlPrefix}/_applet_/video_service/video_player_profiles/${profile.replaceAll(' ', '+')}.json`;
774
+ return fetch(profileUrl, {
775
+ method: 'GET'
776
+ }).then(res => res.json());
782
777
  };
783
778
  const player = async (elem, initOptions, ready) => {
784
779
  const {
@@ -786,7 +781,7 @@ const player = async (elem, initOptions, ready) => {
786
781
  ...otherInitOptions
787
782
  } = initOptions;
788
783
  try {
789
- const profileOptions = profile ? await getProfile(otherInitOptions.cloud_name, profile) : {};
784
+ const profileOptions = profile ? await getProfile(profile, otherInitOptions) : {};
790
785
  const options = Object.assign({}, profileOptions.playerOptions, otherInitOptions);
791
786
  const videoPlayer = new _video_player__WEBPACK_IMPORTED_MODULE_0__["default"](elem, options, ready);
792
787
  const nativeVideoPlayerSourceMethod = videoPlayer.source;
@@ -1413,7 +1408,7 @@ class CloudinaryAnalytics {
1413
1408
  this.cloudinaryAnalytics.startManualTracking(metadata, {
1414
1409
  ...(lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_1___default()(this.analyticsOptions) ? this.analyticsOptions : {}),
1415
1410
  videoPlayerType: 'cloudinary video player',
1416
- videoPlayerVersion: "2.0.6-edge.0"
1411
+ videoPlayerVersion: "2.1.1-edge.0"
1417
1412
  });
1418
1413
  } else if (this.currentVideMetadata.cloudName !== metadata.cloudName || this.currentVideMetadata.publicId !== metadata.publicId) {
1419
1414
  this.cloudinaryAnalytics.stopManualTracking();
@@ -1783,7 +1778,7 @@ class CloudinaryContext {
1783
1778
  options.sourceTypes = options.sourceTypes || _this.sourceTypes();
1784
1779
  options.poster = options.poster || posterOptionsForCurrent();
1785
1780
  options.queryParams = Object.assign(options.queryParams || {}, options.usageReport ? {
1786
- _s: `vp-${"2.0.6-edge.0"}`
1781
+ _s: `vp-${"2.1.1-edge.0"}`
1787
1782
  } : {});
1788
1783
  if (options.sourceTypes.indexOf('audio') > -1) {
1789
1784
  builtSrc = new _models_audio_source_audio_source__WEBPACK_IMPORTED_MODULE_7__["default"](publicId, options);
@@ -3047,7 +3042,7 @@ const contextMenuContent = player => {
3047
3042
  const isFullscreen = player.isFullscreen();
3048
3043
  const aboutMenuItem = {
3049
3044
  class: 'player-version',
3050
- label: 'Cloudinary Player v' + "2.0.6-edge.0"
3045
+ label: 'Cloudinary Player v' + "2.1.1-edge.0"
3051
3046
  };
3052
3047
  if (!player.controls()) {
3053
3048
  return [aboutMenuItem];
@@ -5353,7 +5348,7 @@ class VideoPlayer extends _utils__WEBPACK_IMPORTED_MODULE_9__["default"].mixin(_
5353
5348
  const analyticsData = (0,_utils_get_analytics_player_options__WEBPACK_IMPORTED_MODULE_18__.getAnalyticsFromPlayerOptions)(options);
5354
5349
  const analyticsParams = new URLSearchParams(analyticsData).toString();
5355
5350
  const baseParams = new URLSearchParams({
5356
- vpVersion: "2.0.6-edge.0",
5351
+ vpVersion: "2.1.1-edge.0",
5357
5352
  vpInstanceId: this.getVPInstanceId(),
5358
5353
  // #if (process.env.WEBPACK_BUILD_LIGHT)
5359
5354
  vpLightBuild: true,