@wix/video 1.81.0 → 1.82.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.
- package/dist/cjs/Video.stories.js +3 -2
- package/dist/cjs/Video.stories.js.map +1 -1
- package/dist/cjs/custom-element/utils.js +7 -0
- package/dist/cjs/custom-element/utils.js.map +1 -1
- package/dist/cjs/storybook/Container.js +33 -9
- package/dist/cjs/storybook/Container.js.map +1 -1
- package/dist/cjs/storybook/args.js +10 -0
- package/dist/cjs/storybook/args.js.map +1 -1
- package/dist/esm/Video.stories.js +2 -1
- package/dist/esm/Video.stories.js.map +1 -1
- package/dist/esm/custom-element/utils.js +7 -0
- package/dist/esm/custom-element/utils.js.map +1 -1
- package/dist/esm/storybook/Container.js +26 -8
- package/dist/esm/storybook/Container.js.map +1 -1
- package/dist/esm/storybook/args.js +10 -0
- package/dist/esm/storybook/args.js.map +1 -1
- package/dist/statics/janet/iframe.html +1 -1
- package/dist/statics/janet/{main.f45a6aa8.iframe.bundle.js → main.4e295f79.iframe.bundle.js} +6 -5
- package/dist/statics/janet/main.4e295f79.iframe.bundle.js.map +1 -0
- package/dist/statics/janet/project.json +1 -1
- package/dist/statics/manifest.json +2 -2
- package/dist/statics/manifest.min.json +2 -2
- package/dist/statics/video.umd.js +2 -2
- package/dist/statics/video.umd.js.map +1 -1
- package/dist/statics/video.umd.min.js +1 -1
- package/dist/statics/video.umd.min.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/Video.stories.d.ts +1 -0
- package/dist/types/Video.stories.d.ts.map +1 -1
- package/dist/types/custom-element/utils.d.ts.map +1 -1
- package/dist/types/storybook/Container.d.ts +3 -1
- package/dist/types/storybook/Container.d.ts.map +1 -1
- package/dist/types/storybook/args.d.ts +10 -0
- package/dist/types/storybook/args.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/statics/janet/main.f45a6aa8.iframe.bundle.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"generatedAt":
|
|
1
|
+
{"generatedAt":1767166893846,"builder":{"name":"webpack5"},"hasCustomBabel":false,"hasCustomWebpack":true,"hasStaticDirs":true,"hasStorybookEslint":false,"refCount":0,"monorepo":"Turborepo","packageManager":{"type":"yarn","version":"4.12.0"},"typescriptOptions":{"check":false,"reactDocgen":false},"language":"typescript","storybookPackages":{"@wix/yoshi-storybook-dependencies":{"version":"6.163.0"}},"framework":{},"addons":{"@storybook/addon-controls":{"version":"6.5.16"},"@storybook/addon-docs":{"version":"6.5.16"}}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
{
|
|
2
|
-
"video.css": "https://static.parastorage.com/services/video/
|
|
3
|
-
"video.js": "https://static.parastorage.com/services/video/
|
|
2
|
+
"video.css": "https://static.parastorage.com/services/video/8c89fba18ac82dfff4803c74686d3a861fa50653d377ea8c48e31e3b/video.css",
|
|
3
|
+
"video.js": "https://static.parastorage.com/services/video/8c89fba18ac82dfff4803c74686d3a861fa50653d377ea8c48e31e3b/video.umd.js"
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
{
|
|
2
|
-
"video.css": "https://static.parastorage.com/services/video/
|
|
3
|
-
"video.js": "https://static.parastorage.com/services/video/
|
|
2
|
+
"video.css": "https://static.parastorage.com/services/video/8c89fba18ac82dfff4803c74686d3a861fa50653d377ea8c48e31e3b/video.min.css",
|
|
3
|
+
"video.js": "https://static.parastorage.com/services/video/8c89fba18ac82dfff4803c74686d3a861fa50653d377ea8c48e31e3b/video.umd.min.js"
|
|
4
4
|
}
|
|
@@ -523,7 +523,7 @@ module.exports = _typeof, module.exports.__esModule = true, module.exports["defa
|
|
|
523
523
|
/******/
|
|
524
524
|
/******/ /* webpack/runtime/publicPath */
|
|
525
525
|
/******/ (() => {
|
|
526
|
-
/******/ __webpack_require__.p = "https://static.parastorage.com/services/video/
|
|
526
|
+
/******/ __webpack_require__.p = "https://static.parastorage.com/services/video/8c89fba18ac82dfff4803c74686d3a861fa50653d377ea8c48e31e3b/";
|
|
527
527
|
/******/ })();
|
|
528
528
|
/******/
|
|
529
529
|
/******/ /* webpack/runtime/jsonp chunk loading */
|
|
@@ -656,7 +656,7 @@ var external_React_ = __webpack_require__(883);
|
|
|
656
656
|
// extracted by mini-css-extract-plugin
|
|
657
657
|
/* harmony default export */ const Video_module = ({"video-container":"nhOWNx","videoContainer":"nhOWNx","video-poster-img":"Jy9J5J","videoPosterImg":"Jy9J5J","video":"b5Y937"});
|
|
658
658
|
;// ./custom-element/utils.ts
|
|
659
|
-
const STATIC_VIDEO_URL='https://video.wixstatic.com/';const STATIC_ADAPTIVE_VIDEO_URL='https://files.wix.com/';const isAbsoluteUrl=url=>url.startsWith('http://')||url.startsWith('https://');function sortQualities(sources){return sources.sort((a,b)=>a.width*a.height-b.width*b.height);}function getCompleteUrl(url,staticVideoUrl){const completeUrl=isAbsoluteUrl(url)?new URL(url):new URL(url,staticVideoUrl);return completeUrl.href;}function getVideoQualityBySize(sources,_ref){let{width,height}=_ref;const targetQuality=sources.find(value=>value.width*value.height>width*height);return targetQuality||sources[sources.length-1];}function getScaleFactor(containerWidth,containerHeight,videoWidth,videoHeight){return{wScale:containerWidth/videoWidth,hScale:containerHeight/videoHeight};}function getVideoDimension(videoScale,videoWidth,videoHeight){const scale=Math.min(videoScale.wScale,videoScale.hScale);return{width:Math.round(videoWidth*scale),height:Math.round(videoHeight*scale)};}function setVideoFocalPoint(videoNode,focalPoint){const focalX=(focalPoint==null?void 0:focalPoint.x)??50;const focalY=(focalPoint==null?void 0:focalPoint.y)??50;videoNode.style.setProperty('--focal-x',focalX.toString());videoNode.style.setProperty('--focal-y',focalY.toString());}async function getVideoSource(width,height,uri,qualityPolicy,sources,adaptiveSources,duration,onError){const hasProgressiveSources=sources&&sources.length>0;const hasAbsoluteUri=uri&&isAbsoluteUrl(uri);const shouldSkipAdaptiveShortVideo=duration&&duration<40;if(qualityPolicy==='adaptive'&&adaptiveSources&&adaptiveSources.length>0&&!shouldSkipAdaptiveShortVideo){const hlsSource=adaptiveSources.find(s=>s.format==='hls');const Hls=await __webpack_require__.e(/*! import() */ 189).then(__webpack_require__.bind(__webpack_require__, /*! hls.js */ 189));if(hlsSource&&Hls&&Hls.default.isSupported()){const videoSourceUrl=getCompleteUrl(hlsSource.uri,STATIC_ADAPTIVE_VIDEO_URL);const patchVideoSource=videoNode=>{const hls=new Hls.default();hls.loadSource(videoSourceUrl);hls.attachMedia(videoNode);hls.on(Hls.default.Events.ERROR,(_,data)=>{if(data.fatal){switch(data.type){case Hls.default.ErrorTypes.NETWORK_ERROR:hls.startLoad();if(onError){onError(new Error(`HLS Network Error: ${data.details}.\nAttempting to reconnect...`));}break;case Hls.default.ErrorTypes.MEDIA_ERROR:hls.recoverMediaError();if(onError){onError(new Error(`HLS Media Error: ${data.details}.\nAttempting to recover...`));}break;default:hls.destroy();if(onError){onError(new Error(`HLS Unknown Error: ${data.details}.\nUnrecoverable playback error`));}break;}}});};return{videoSourceUrl,patchVideoSource};}}if(hasProgressiveSources){const highestQuality=sources[sources.length-1];if(qualityPolicy==='highest'){var _highestQuality$types;const url=(_highestQuality$types=highestQuality.types.find(type=>type.format==='mp4'))==null?void 0:_highestQuality$types.uri;if(url){const videoSourceUrl=getCompleteUrl(url,STATIC_VIDEO_URL);return{videoSourceUrl,patchVideoSource:videoNode=>{videoNode.src=videoSourceUrl;videoNode.load();}};}}else{var _targetQuality$types$;const videoWidth=parseInt(highestQuality.width.toString(),10);const videoHeight=parseInt(highestQuality.height.toString(),10);const scaleFactor=getScaleFactor(width,height,videoWidth,videoHeight);const videoScaledDimensions=getVideoDimension(scaleFactor,videoWidth,videoHeight);const targetQuality=getVideoQualityBySize(sources,videoScaledDimensions);const url=(_targetQuality$types$=targetQuality.types.find(type=>type.format==='mp4'))==null?void 0:_targetQuality$types$.uri;if(url){const videoSourceUrl=getCompleteUrl(url,STATIC_VIDEO_URL);return{videoSourceUrl,patchVideoSource:videoNode=>{videoNode.src=videoSourceUrl;videoNode.load();}};}}}if(hasAbsoluteUri){return{videoSourceUrl:uri,patchVideoSource:videoNode=>{videoNode.src=uri;videoNode.load();}};}return{videoSourceUrl:'',patchVideoSource:()=>{}};}
|
|
659
|
+
const STATIC_VIDEO_URL='https://video.wixstatic.com/';const STATIC_ADAPTIVE_VIDEO_URL='https://files.wix.com/';const isAbsoluteUrl=url=>url.startsWith('http://')||url.startsWith('https://');function sortQualities(sources){return sources.sort((a,b)=>a.width*a.height-b.width*b.height);}function getCompleteUrl(url,staticVideoUrl){const completeUrl=isAbsoluteUrl(url)?new URL(url):new URL(url,staticVideoUrl);return completeUrl.href;}function getVideoQualityBySize(sources,_ref){let{width,height}=_ref;const targetQuality=sources.find(value=>value.width*value.height>width*height);return targetQuality||sources[sources.length-1];}function getScaleFactor(containerWidth,containerHeight,videoWidth,videoHeight){return{wScale:containerWidth/videoWidth,hScale:containerHeight/videoHeight};}function getVideoDimension(videoScale,videoWidth,videoHeight){const scale=Math.min(videoScale.wScale,videoScale.hScale);return{width:Math.round(videoWidth*scale),height:Math.round(videoHeight*scale)};}function setVideoFocalPoint(videoNode,focalPoint){const computedStyle=getComputedStyle(videoNode);const videoFit=computedStyle.getPropertyValue('--video-fit');if(videoFit==='contain'){videoNode.style.setProperty('object-position','center');return;}videoNode.style.removeProperty('object-position');const focalX=(focalPoint==null?void 0:focalPoint.x)??50;const focalY=(focalPoint==null?void 0:focalPoint.y)??50;videoNode.style.setProperty('--focal-x',focalX.toString());videoNode.style.setProperty('--focal-y',focalY.toString());}async function getVideoSource(width,height,uri,qualityPolicy,sources,adaptiveSources,duration,onError){const hasProgressiveSources=sources&&sources.length>0;const hasAbsoluteUri=uri&&isAbsoluteUrl(uri);const shouldSkipAdaptiveShortVideo=duration&&duration<40;if(qualityPolicy==='adaptive'&&adaptiveSources&&adaptiveSources.length>0&&!shouldSkipAdaptiveShortVideo){const hlsSource=adaptiveSources.find(s=>s.format==='hls');const Hls=await __webpack_require__.e(/*! import() */ 189).then(__webpack_require__.bind(__webpack_require__, /*! hls.js */ 189));if(hlsSource&&Hls&&Hls.default.isSupported()){const videoSourceUrl=getCompleteUrl(hlsSource.uri,STATIC_ADAPTIVE_VIDEO_URL);const patchVideoSource=videoNode=>{const hls=new Hls.default();hls.loadSource(videoSourceUrl);hls.attachMedia(videoNode);hls.on(Hls.default.Events.ERROR,(_,data)=>{if(data.fatal){switch(data.type){case Hls.default.ErrorTypes.NETWORK_ERROR:hls.startLoad();if(onError){onError(new Error(`HLS Network Error: ${data.details}.\nAttempting to reconnect...`));}break;case Hls.default.ErrorTypes.MEDIA_ERROR:hls.recoverMediaError();if(onError){onError(new Error(`HLS Media Error: ${data.details}.\nAttempting to recover...`));}break;default:hls.destroy();if(onError){onError(new Error(`HLS Unknown Error: ${data.details}.\nUnrecoverable playback error`));}break;}}});};return{videoSourceUrl,patchVideoSource};}}if(hasProgressiveSources){const highestQuality=sources[sources.length-1];if(qualityPolicy==='highest'){var _highestQuality$types;const url=(_highestQuality$types=highestQuality.types.find(type=>type.format==='mp4'))==null?void 0:_highestQuality$types.uri;if(url){const videoSourceUrl=getCompleteUrl(url,STATIC_VIDEO_URL);return{videoSourceUrl,patchVideoSource:videoNode=>{videoNode.src=videoSourceUrl;videoNode.load();}};}}else{var _targetQuality$types$;const videoWidth=parseInt(highestQuality.width.toString(),10);const videoHeight=parseInt(highestQuality.height.toString(),10);const scaleFactor=getScaleFactor(width,height,videoWidth,videoHeight);const videoScaledDimensions=getVideoDimension(scaleFactor,videoWidth,videoHeight);const targetQuality=getVideoQualityBySize(sources,videoScaledDimensions);const url=(_targetQuality$types$=targetQuality.types.find(type=>type.format==='mp4'))==null?void 0:_targetQuality$types$.uri;if(url){const videoSourceUrl=getCompleteUrl(url,STATIC_VIDEO_URL);return{videoSourceUrl,patchVideoSource:videoNode=>{videoNode.src=videoSourceUrl;videoNode.load();}};}}}if(hasAbsoluteUri){return{videoSourceUrl:uri,patchVideoSource:videoNode=>{videoNode.src=uri;videoNode.load();}};}return{videoSourceUrl:'',patchVideoSource:()=>{}};}
|
|
660
660
|
// EXTERNAL MODULE: ../../../node_modules/@babel/runtime/helpers/defineProperty.js
|
|
661
661
|
var defineProperty = __webpack_require__(929);
|
|
662
662
|
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty);
|