pds-dev-kit-web-test 2.5.386 → 2.5.390
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/src/common/assets/icons/fill/VideoType.js +1 -1
- package/dist/src/common/assets/icons/line/VideoType.js +1 -1
- package/dist/src/sub/DynamicLayout/mock_video_cb.js +1 -1
- package/dist/src/sub/DynamicLayout/mocks.js +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/VideoPlayer/VideoPlayer.js +13 -4
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/VideoPlayer/helper.d.ts +4 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/VideoPlayer/helper.js +25 -0
- package/package.json +1 -1
@@ -25,6 +25,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
25
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
26
26
|
var VideoType = function (_a) {
|
27
27
|
var color = _a.color, size = _a.size, rest = __rest(_a, ["color", "size"]);
|
28
|
-
return ((0, jsx_runtime_1.jsx)("svg", __assign({ width: size, height: size, viewBox: "0 0 24 24" }, rest, { children: (0, jsx_runtime_1.jsxs)("g", __assign({ fill: "none"
|
28
|
+
return ((0, jsx_runtime_1.jsx)("svg", __assign({ width: size, height: size, viewBox: "0 0 24 24" }, rest, { children: (0, jsx_runtime_1.jsxs)("g", __assign({ fill: "none" }, { children: [(0, jsx_runtime_1.jsx)("path", { stroke: color, strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M4.4776,8.1413 L19.5226,8.1413 M6.4537,4.7562 L9.6937,7.9962 M10.1412,4.279 L13.8592,7.997 M14.3059,4.279 L18.0239,7.997" }), (0, jsx_runtime_1.jsx)("path", { fill: color, fillRule: "evenodd", d: "M17.25,3.2501 C19.183,3.2501 20.75,4.8171 20.75,6.7501 L20.75,17.2501 C20.75,19.1831 19.183,20.7501 17.25,20.7501 L6.75,20.7501 C4.817,20.7501 3.25,19.1831 3.25,17.2501 L3.25,6.7501 C3.25,4.8171 4.817,3.2501 6.75,3.2501 Z M17.25,5.2501 L6.75,5.2501 C5.923,5.2501 5.25,5.9231 5.25,6.7501 L5.25,17.2501 C5.25,18.0771 5.923,18.7501 6.75,18.7501 L17.25,18.7501 C18.077,18.7501 18.75,18.0771 18.75,17.2501 L18.75,6.7501 C18.75,5.9231 18.077,5.2501 17.25,5.2501 Z M10.9181,10.5725 L13.0111,11.7805 L15.1041,12.9895 C15.7251,13.3475 15.7251,14.2435 15.1041,14.6015 L13.0111,15.8105 L10.9181,17.0185 C10.2971,17.3775 9.5211,16.9295 9.5211,16.2125 L9.5211,11.3785 C9.5211,10.6615 10.2971,10.2135 10.9181,10.5725 Z" })] })) })));
|
29
29
|
};
|
30
30
|
exports.default = VideoType;
|
@@ -25,6 +25,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
25
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
26
26
|
var VideoType = function (_a) {
|
27
27
|
var color = _a.color, size = _a.size, rest = __rest(_a, ["color", "size"]);
|
28
|
-
return ((0, jsx_runtime_1.jsx)("svg", __assign({ width: size, height: size, viewBox: "0 0 24 24" }, rest, { children: (0, jsx_runtime_1.jsxs)("g", __assign({ fill: "none"
|
28
|
+
return ((0, jsx_runtime_1.jsx)("svg", __assign({ width: size, height: size, viewBox: "0 0 24 24" }, rest, { children: (0, jsx_runtime_1.jsxs)("g", __assign({ fill: "none" }, { children: [(0, jsx_runtime_1.jsx)("path", { stroke: color, strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.5", d: "M4.4776,8.1413 L19.5226,8.1413 M5.9765,4.279 L9.6945,7.997 M10.1412,4.279 L13.8592,7.997 M14.3059,4.279 L18.0239,7.997" }), (0, jsx_runtime_1.jsx)("path", { fill: color, fillRule: "evenodd", d: "M17.25,3.2501 C19.183,3.2501 20.75,4.8171 20.75,6.7501 L20.75,17.2501 C20.75,19.1831 19.183,20.7501 17.25,20.7501 L6.75,20.7501 C4.817,20.7501 3.25,19.1831 3.25,17.2501 L3.25,6.7501 C3.25,4.8171 4.817,3.2501 6.75,3.2501 Z M17.25,4.7501 L6.75,4.7501 C5.647,4.7501 4.75,5.6471 4.75,6.7501 L4.75,17.2501 C4.75,18.3531 5.647,19.2501 6.75,19.2501 L17.25,19.2501 C18.353,19.2501 19.25,18.3531 19.25,17.2501 L19.25,6.7501 C19.25,5.6471 18.353,4.7501 17.25,4.7501 Z M10.9181,10.5725 L13.0111,11.7805 L15.1041,12.9895 C15.7251,13.3475 15.7251,14.2435 15.1041,14.6015 L13.0111,15.8105 L10.9181,17.0185 C10.2971,17.3775 9.5211,16.9295 9.5211,16.2125 L9.5211,11.3785 C9.5211,10.6615 10.2971,10.2135 10.9181,10.5725 Z" })] })) })));
|
29
29
|
};
|
30
30
|
exports.default = VideoType;
|
@@ -21,7 +21,7 @@ exports.MOCK_VIDEO_CB = {
|
|
21
21
|
CB_CONTENT_PROP_VIDEO_SPEC_ENDTIME: 5,
|
22
22
|
CB_CONTENT_PROP_VIDEO_SPEC_MPLAY: true,
|
23
23
|
CB_CONTENT_PROP_VIDEO_SPEC_REPLAY: true,
|
24
|
-
CB_CONTENT_PROP_VIDEO_SPEC_SELECTOR: '
|
24
|
+
CB_CONTENT_PROP_VIDEO_SPEC_SELECTOR: 'https://publ-upload-dev.s3.ap-northeast-2.amazonaws.com/VSMP4z4pf20250529100121192-6ncx7.mp4?fallbackUrl=publ-upload-dev.s3.ap-northeast-2.amazonaws.com%2F6ce235e9-c103-4ba4-9a3d-f276f703f406.mp4',
|
25
25
|
CB_CONTENT_PROP_VIDEO_SPEC_STARTTIME: 0,
|
26
26
|
CB_CONTENT_PROP_VIDEO_SPEC_THUMB: '',
|
27
27
|
CB_CONTENT_PROP_VIDEO_SPEC_TYPE: 'FILE',
|
@@ -29,6 +29,7 @@ var styled_components_1 = __importDefault(require("styled-components"));
|
|
29
29
|
var S_CB_AnimationObserverBox_1 = require("../components/S_CB_AnimationObserverBox");
|
30
30
|
var S_CB_BoxWithShadow_1 = require("../components/S_CB_BoxWithShadow");
|
31
31
|
var S_HiddenCover_1 = require("../components/S_HiddenCover");
|
32
|
+
var helper_1 = require("./helper");
|
32
33
|
function VideoPlayer(props) {
|
33
34
|
var _a = (0, react_1.useContext)(dynamicLayoutContext_1.dynamicLayoutContext), device = _a.device, mode = _a.mode;
|
34
35
|
var CB_CONTENT_PROP_VIDEO = props.CB_CONTENT_PROP_VIDEO;
|
@@ -55,11 +56,19 @@ function VideoPlayer(props) {
|
|
55
56
|
var CB_CONTENT_PROP_VIDEO_SPEC_SELECTOR = CB_CONTENT_PROP_VIDEO.CB_CONTENT_PROP_VIDEO_SPEC_SELECTOR, CB_CONTENT_PROP_VIDEO_SPEC_STARTTIME = CB_CONTENT_PROP_VIDEO.CB_CONTENT_PROP_VIDEO_SPEC_STARTTIME, CB_CONTENT_PROP_VIDEO_SPEC_THUMB = CB_CONTENT_PROP_VIDEO.CB_CONTENT_PROP_VIDEO_SPEC_THUMB, CB_CONTENT_PROP_VIDEO_SPEC_MAUTOPLAY = CB_CONTENT_PROP_VIDEO.CB_CONTENT_PROP_VIDEO_SPEC_MAUTOPLAY, CB_CONTENT_PROP_VIDEO_SPEC_AUTOPLAY = CB_CONTENT_PROP_VIDEO.CB_CONTENT_PROP_VIDEO_SPEC_AUTOPLAY;
|
56
57
|
var shouldAutoplay = (CB_CONTENT_PROP_VIDEO_SPEC_AUTOPLAY && device === 'DESKTOP') ||
|
57
58
|
(CB_CONTENT_PROP_VIDEO_SPEC_MAUTOPLAY && device === 'MOBILE');
|
58
|
-
var getVideoSrc = function () {
|
59
|
-
return CB_CONTENT_PROP_VIDEO_SPEC_SELECTOR;
|
60
|
-
};
|
61
59
|
var videoRef = (0, react_1.useRef)(null);
|
62
60
|
var _e = (0, react_1.useState)(false), videoLoaded = _e[0], setVideoLoaded = _e[1];
|
61
|
+
var _f = (0, react_1.useState)(function () {
|
62
|
+
return (0, helper_1.parseTargetUrl)(CB_CONTENT_PROP_VIDEO_SPEC_SELECTOR).encodedURL;
|
63
|
+
}), videoURL = _f[0], setVideoURL = _f[1];
|
64
|
+
var onVideoError = function () {
|
65
|
+
var fallbackURL = (0, helper_1.parseTargetUrl)(CB_CONTENT_PROP_VIDEO_SPEC_SELECTOR).fallbackURL;
|
66
|
+
var isFallbackURL = fallbackURL === videoURL;
|
67
|
+
if (fallbackURL && !isFallbackURL) {
|
68
|
+
setVideoURL(fallbackURL);
|
69
|
+
return;
|
70
|
+
}
|
71
|
+
};
|
63
72
|
var onLoadedMetadata = function () {
|
64
73
|
setVideoLoaded(true);
|
65
74
|
};
|
@@ -113,7 +122,7 @@ function VideoPlayer(props) {
|
|
113
122
|
alignItems: 'center',
|
114
123
|
justifyContent: 'center',
|
115
124
|
transform: 'translate(-50%, -50%)'
|
116
|
-
} }, { children: (0, jsx_runtime_1.jsx)(Icon_1.Icon, { iconName: "ic_video_play_circle", fillType: "fill", colorKey: "ui_cpnt_icon_sys_white", size: 48 }) }))), (0, jsx_runtime_1.jsxs)(S_Video, __assign({ muted: true, playsInline: true, controls: !isEditMode, isEditMode: isEditMode, ref: videoRef, poster: CB_CONTENT_PROP_VIDEO_SPEC_THUMB, onLoadedMetadata: onLoadedMetadata, onPlay: onPlay }, { children: [(0, jsx_runtime_1.jsx)("source", { src:
|
125
|
+
} }, { children: (0, jsx_runtime_1.jsx)(Icon_1.Icon, { iconName: "ic_video_play_circle", fillType: "fill", colorKey: "ui_cpnt_icon_sys_white", size: 48 }) }))), (0, jsx_runtime_1.jsxs)(S_Video, __assign({ muted: true, playsInline: true, controls: !isEditMode, isEditMode: isEditMode, ref: videoRef, poster: CB_CONTENT_PROP_VIDEO_SPEC_THUMB, onLoadedMetadata: onLoadedMetadata, onPlay: onPlay, onError: onVideoError, "data-src": CB_CONTENT_PROP_VIDEO_SPEC_SELECTOR }, { children: [(0, jsx_runtime_1.jsx)("source", { src: videoURL }), "Your browser does not support the video tag."] }), videoURL + CB_CONTENT_PROP_VIDEO_SPEC_THUMB)] })) }))] }));
|
117
126
|
}
|
118
127
|
function getBGColorStyles(props, device) {
|
119
128
|
var availableSpecCodes = [
|
@@ -0,0 +1,25 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.parseTargetUrl = void 0;
|
4
|
+
function parseTargetUrl(url) {
|
5
|
+
var _a = url.split('?'), encodedURL = _a[0], query = _a[1];
|
6
|
+
if (!query) {
|
7
|
+
return {
|
8
|
+
encodedURL: encodedURL,
|
9
|
+
fallbackURL: null
|
10
|
+
};
|
11
|
+
}
|
12
|
+
var params = new URLSearchParams(query);
|
13
|
+
var fallbackUrl = params.get('fallbackUrl');
|
14
|
+
if (!fallbackUrl) {
|
15
|
+
return {
|
16
|
+
encodedURL: encodedURL,
|
17
|
+
fallbackURL: null
|
18
|
+
};
|
19
|
+
}
|
20
|
+
return {
|
21
|
+
encodedURL: encodedURL,
|
22
|
+
fallbackURL: "http://".concat(fallbackUrl)
|
23
|
+
};
|
24
|
+
}
|
25
|
+
exports.parseTargetUrl = parseTargetUrl;
|