cloudinary-video-player 3.2.0 → 3.2.1-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.
- package/dist/adaptive-streaming.js +2 -2
- package/dist/adaptive-streaming.min.js +2 -2
- package/dist/chapters.js +2 -2
- package/dist/chapters.min.js +2 -2
- package/dist/cld-video-player.css +2 -2
- package/dist/cld-video-player.js +6 -6
- package/dist/cld-video-player.light.js +6 -6
- package/dist/cld-video-player.light.min.js +4 -4
- package/dist/cld-video-player.min.css +2 -2
- package/dist/cld-video-player.min.js +4 -4
- package/dist/colors.js +2 -2
- package/dist/colors.min.js +2 -2
- package/dist/dash.js +2 -2
- package/dist/dash.min.js +2 -2
- package/dist/debug.js +2 -2
- package/dist/debug.min.js +2 -2
- package/dist/ima.js +2 -2
- package/dist/ima.min.js +2 -2
- package/dist/interaction-areas.js +2 -2
- package/dist/interaction-areas.min.js +2 -2
- package/dist/node_modules_lodash_throttle_js.js +2 -2
- package/dist/playlist.js +2 -2
- package/dist/playlist.min.js +2 -2
- package/dist/recommendations-overlay.js +2 -2
- package/dist/recommendations-overlay.min.js +2 -2
- package/dist/schema.json +4 -0
- package/dist/share.js +3 -3
- package/dist/share.min.js +3 -3
- package/dist/shoppable.js +2 -2
- package/dist/shoppable.min.js +2 -2
- package/dist/srt-text-tracks.js +2 -2
- package/dist/srt-text-tracks.min.js +2 -2
- package/dist/visual-search.js +2 -2
- package/dist/visual-search.min.js +2 -2
- package/lib/all.js +1 -1
- package/lib/cld-video-player.js +1 -1
- package/lib/player.js +1 -1
- package/lib/schema.json +4 -0
- package/lib/share.js +1 -1
- package/lib/videoPlayer.js +1 -1
- package/package.json +1 -1
package/lib/schema.json
CHANGED
package/lib/share.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.cloudinaryVideoPlayerChunkLoading=self.cloudinaryVideoPlayerChunkLoading||[]).push([[976],{2130:(e,
|
|
1
|
+
(self.cloudinaryVideoPlayerChunkLoading=self.cloudinaryVideoPlayerChunkLoading||[]).push([[976],{2130:(o,e,t)=>{t.d(e,{default:()=>s});var n=t(6673),a=t.n(n);const r=a().getComponent("ClickableComponent");a().registerComponent("ShareDownloadButton",class extends r{constructor(o){super(o,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}handleClick(o){super.handleClick(o),this.player().share&&"function"==typeof this.player().share.download&&this.player().share.download()}createEl(){const o=a().dom.createEl("button",{className:"vjs-control vjs-share-download-button vjs-button",ariaLabel:"Download video",title:"Download video"}),e=a().dom.createEl("span",{className:"vjs-icon-file-download vjs-icon-placeholder"});o.appendChild(e);const t=a().dom.createEl("span",{className:"vjs-loading-spinner"});return o.appendChild(t),o}setPreparing(o){const e=this.el();o?(e.classList.add("vjs-waiting"),e.setAttribute("title","Download is being prepared")):(e.classList.remove("vjs-waiting"),e.setAttribute("title","Download video"))}});var d=t(8033),i=t(4319),l=t.n(i);const s=function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=(arguments.length>1?arguments[1]:void 0)||this;e.addClass("vjs-share");const t=()=>{const o=e.getChild("ControlBar");if(!o||o.getChild("ShareDownloadButton"))return;const t=o.children().findIndex((o=>"FullscreenToggle"===o.name_));o.addChild("ShareDownloadButton",{},-1!==t?t:void 0)};o.download&&t(),e.share={download:()=>{const o=(()=>{const o=e.currentSource?.();if(!o)return null;const t=["format","video_codec","streaming_profile"],n=o=>{if(Array.isArray(o))return o.map(n);if(o&&"object"==typeof o){const e=l()(o,t);return Object.keys(e).forEach((o=>{e[o]=n(e[o])})),e}return o},a=n(e.cloudinary.transformation()||{}),r=e.cloudinary.currentPublicId()?.split("/")?.pop(),i={...e.cloudinary.cloudinaryConfig(),...a,resource_type:"video",format:"mp4",video_codec:"h264",flags:`streaming_attachment:${r}`};return o.isAdaptive&&Object.assign(i,{crop:"limit",width:1920,height:1920}),"AudioSource"===e.cloudinary.source()?.getType()&&Object.assign(i,{format:"mp3",video_codec:void 0}),(0,d.KA)(e.cloudinary.currentPublicId(),i)})();if(!o)return void console.warn("Share plugin: Unable to resolve download URL.");const t=[423],n=e.controlBar?.getChild("ShareDownloadButton"),a=o=>{n?.setPreparing?.(o)},r=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const n=await fetch(o,{method:"HEAD"});if(t.includes(n.status)&&e<60)return await(1e4,new Promise((o=>setTimeout(o,1e4)))),r(e+1);a(!1),(()=>{const e=document.createElement("a");e.href=o,e.download="",document.body.appendChild(e),e.click(),document.body.removeChild(e)})()};a(!0),r()},addDownloadButton:t,removeDownloadButton:()=>{if(!e.controlBar)return;const o=e.controlBar.getChild("ShareDownloadButton");o&&e.controlBar.removeChild(o)}}}}}]);
|