pds-dev-kit-web-test 2.5.395 → 2.5.400

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.
@@ -20,10 +20,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
21
  var jsx_runtime_1 = require("react/jsx-runtime");
22
22
  var react_1 = require("react");
23
+ var helper_1 = require("../../../../DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/VideoPlayer/helper");
23
24
  var styled_components_1 = __importDefault(require("styled-components"));
24
25
  function VideoBGMedia(_a) {
25
26
  var src = _a.src, startTime = _a.startTime, endTime = _a.endTime, loop = _a.loop;
26
27
  var videoRef = (0, react_1.useRef)(null);
28
+ var _b = (0, react_1.useState)(function () {
29
+ return (0, helper_1.parseTargetUrl)(src).encodedURL;
30
+ }), videoURL = _b[0], setVideoURL = _b[1];
31
+ (0, react_1.useEffect)(function () {
32
+ setVideoURL((0, helper_1.parseTargetUrl)(src).encodedURL);
33
+ }, [src]);
27
34
  var onLoadedMetadata = function () {
28
35
  var video = videoRef.current;
29
36
  if (!video)
@@ -55,7 +62,15 @@ function VideoBGMedia(_a) {
55
62
  video.play();
56
63
  }
57
64
  };
58
- return ((0, jsx_runtime_1.jsx)(S_Video, __assign({ ref: videoRef, onLoadedMetadata: onLoadedMetadata, onTimeUpdate: onTimeUpdate, onEnded: onEnded, autoPlay: true, muted: true, playsInline: true }, { children: (0, jsx_runtime_1.jsx)("source", { src: src, type: "video/mp4" }) }), src));
65
+ var onVideoError = function () {
66
+ var fallbackURL = (0, helper_1.parseTargetUrl)(src).fallbackURL;
67
+ var isFallbackURL = fallbackURL === videoURL;
68
+ if (fallbackURL && !isFallbackURL) {
69
+ setVideoURL(fallbackURL);
70
+ return;
71
+ }
72
+ };
73
+ return ((0, jsx_runtime_1.jsx)(S_Video, __assign({ "data-src": src, ref: videoRef, onLoadedMetadata: onLoadedMetadata, onTimeUpdate: onTimeUpdate, onEnded: onEnded, onError: onVideoError, autoPlay: true, muted: true, playsInline: true }, { children: (0, jsx_runtime_1.jsx)("source", { src: videoURL }) }), videoURL));
59
74
  }
60
75
  var S_Video = styled_components_1.default.video(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 100%;\n left: 0;\n object-fit: cover;\n position: absolute;\n top: 0;\n width: 100%;\n z-index: -9999;\n"], ["\n height: 100%;\n left: 0;\n object-fit: cover;\n position: absolute;\n top: 0;\n width: 100%;\n z-index: -9999;\n"])));
61
76
  exports.default = VideoBGMedia;
@@ -4374,7 +4374,7 @@ exports.MOCK_SECTIONS = [
4374
4374
  'CB_STYLE_PROP_BGMEDIA_SPEC_IMAGEFIT:MOBILE': null,
4375
4375
  'CB_STYLE_PROP_BGMEDIA_SPEC_REPLAY:HOVER': null,
4376
4376
  'CB_STYLE_PROP_BGMEDIA_SPEC_STARTTIME:MOBILE:HOVER': null,
4377
- CB_STYLE_PROP_BGMEDIA_SPEC_VIDEOSELECTOR: 'https://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4'
4377
+ CB_STYLE_PROP_BGMEDIA_SPEC_VIDEOSELECTOR: 'https://publ-upload-prod.s3.ap-northeast-2.amazonaws.com/VSMPj3k7020250529153815853-g7c8x.mp4?fallbackUrl=publ-upload-prod.s3.ap-northeast-2.amazonaws.com%2F2d9ca5b4-3d6d-4088-934d-00bcbf46f9a6.mov'
4378
4378
  },
4379
4379
  CB_STYLE_PROP_BGOVERLAY: {
4380
4380
  CB_STYLE_PROP_BGOVERLAY_SPEC_ANGLE: 90,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web-test",
3
- "version": "2.5.395",
3
+ "version": "2.5.400",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",