pds-dev-kit-web-test 2.5.385 → 2.5.387
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/Cam.d.ts +4 -0
- package/dist/src/common/assets/icons/fill/Cam.js +30 -0
- package/dist/src/common/assets/icons/fill/CamOff.d.ts +4 -0
- package/dist/src/common/assets/icons/fill/CamOff.js +30 -0
- package/dist/src/common/assets/icons/fill/Video.js +1 -1
- package/dist/src/common/assets/icons/fill/VideoOff.js +1 -1
- package/dist/src/common/assets/icons/fill/VideoType.js +1 -1
- package/dist/src/common/assets/icons/fill/index.d.ts +2 -0
- package/dist/src/common/assets/icons/fill/index.js +5 -1
- package/dist/src/common/assets/icons/line/Cam.d.ts +4 -0
- package/dist/src/common/assets/icons/line/Cam.js +30 -0
- package/dist/src/common/assets/icons/line/CamOff.d.ts +4 -0
- package/dist/src/common/assets/icons/line/CamOff.js +30 -0
- package/dist/src/common/assets/icons/line/Video.js +1 -1
- package/dist/src/common/assets/icons/line/VideoOff.js +1 -1
- package/dist/src/common/assets/icons/line/VideoType.js +1 -1
- package/dist/src/common/assets/icons/line/index.d.ts +2 -0
- package/dist/src/common/assets/icons/line/index.js +5 -1
- package/dist/src/sub/DynamicLayout/mock_video_cb.js +10 -10
- package/dist/src/sub/DynamicLayout/mocks.d.ts +777 -2
- package/dist/src/sub/DynamicLayout/mocks.js +4234 -4246
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/VideoPlayer/VideoPlayer.js +15 -4
- package/package.json +1 -1
- package/release-note.md +2 -2
@@ -44,6 +44,7 @@ function VideoPlayer(props) {
|
|
44
44
|
var entry = (0, hooks_1.useIntersectionObserver)(cbRef, { threshold: 0.2, freezeOnceVisible: false }, [
|
45
45
|
index
|
46
46
|
]);
|
47
|
+
var _d = (0, react_1.useState)(false), videoStarted = _d[0], setVideoStarted = _d[1];
|
47
48
|
var isVisible = !!(entry === null || entry === void 0 ? void 0 : entry.isIntersecting);
|
48
49
|
var effectCssProperties = isVisible ? effect : {};
|
49
50
|
var isNoneEffectType = device === 'DESKTOP'
|
@@ -52,16 +53,26 @@ function VideoPlayer(props) {
|
|
52
53
|
var hasEffect = !isNoneEffectType;
|
53
54
|
var effectVisibleStyle = hasEffect ? { opacity: isVisible ? 1 : 0 } : {};
|
54
55
|
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;
|
55
|
-
var shouldAutoplay = CB_CONTENT_PROP_VIDEO_SPEC_AUTOPLAY ||
|
56
|
+
var shouldAutoplay = (CB_CONTENT_PROP_VIDEO_SPEC_AUTOPLAY && device === 'DESKTOP') ||
|
56
57
|
(CB_CONTENT_PROP_VIDEO_SPEC_MAUTOPLAY && device === 'MOBILE');
|
57
58
|
var getVideoSrc = function () {
|
58
59
|
return CB_CONTENT_PROP_VIDEO_SPEC_SELECTOR;
|
59
60
|
};
|
60
61
|
var videoRef = (0, react_1.useRef)(null);
|
61
|
-
var
|
62
|
+
var _e = (0, react_1.useState)(false), videoLoaded = _e[0], setVideoLoaded = _e[1];
|
62
63
|
var onLoadedMetadata = function () {
|
63
64
|
setVideoLoaded(true);
|
64
65
|
};
|
66
|
+
var onPlay = function () {
|
67
|
+
var video = videoRef.current;
|
68
|
+
if (!video || isEditMode || videoStarted || shouldAutoplay) {
|
69
|
+
return;
|
70
|
+
}
|
71
|
+
if (typeof CB_CONTENT_PROP_VIDEO_SPEC_STARTTIME === 'number') {
|
72
|
+
video.currentTime = CB_CONTENT_PROP_VIDEO_SPEC_STARTTIME;
|
73
|
+
setVideoStarted(true);
|
74
|
+
}
|
75
|
+
};
|
65
76
|
(0, react_1.useEffect)(function () {
|
66
77
|
var video = videoRef.current;
|
67
78
|
if (!video || isEditMode || !videoLoaded || !shouldAutoplay) {
|
@@ -102,7 +113,7 @@ function VideoPlayer(props) {
|
|
102
113
|
alignItems: 'center',
|
103
114
|
justifyContent: 'center',
|
104
115
|
transform: 'translate(-50%, -50%)'
|
105
|
-
} }, { 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, controls: !isEditMode, isEditMode: isEditMode, ref: videoRef, poster: CB_CONTENT_PROP_VIDEO_SPEC_THUMB, onLoadedMetadata: onLoadedMetadata }, { children: [(0, jsx_runtime_1.jsx)("source", { src: getVideoSrc(), type: "video/mp4" }), "Your browser does not support the video tag."] }), CB_CONTENT_PROP_VIDEO_SPEC_SELECTOR + CB_CONTENT_PROP_VIDEO_SPEC_THUMB)] })) }))] }));
|
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: getVideoSrc(), type: "video/mp4" }), "Your browser does not support the video tag."] }), CB_CONTENT_PROP_VIDEO_SPEC_SELECTOR + CB_CONTENT_PROP_VIDEO_SPEC_THUMB)] })) }))] }));
|
106
117
|
}
|
107
118
|
function getBGColorStyles(props, device) {
|
108
119
|
var availableSpecCodes = [
|
@@ -117,7 +128,7 @@ function getBGColorStyles(props, device) {
|
|
117
128
|
];
|
118
129
|
return (0, colorUtil_1.parseStyleColorToCSSProp)({ availableSpecCodes: availableSpecCodes, props: props, propKey: 'BGCOLOR', device: device });
|
119
130
|
}
|
120
|
-
var S_Video = styled_components_1.default.video(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n aspect-ratio: 16 / 9;\n height: 100%;\n max-height: 100%;\n object-fit: cover;\n
|
131
|
+
var S_Video = styled_components_1.default.video(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n aspect-ratio: 16 / 9;\n height: 100%;\n max-height: 100%;\n object-fit: cover;\n pointer-events: ", ";\n width: 100%;\n"], ["\n aspect-ratio: 16 / 9;\n height: 100%;\n max-height: 100%;\n object-fit: cover;\n pointer-events: ", ";\n width: 100%;\n"])), function (_a) {
|
121
132
|
var isEditMode = _a.isEditMode;
|
122
133
|
return (isEditMode ? 'none' : 'auto');
|
123
134
|
});
|
package/package.json
CHANGED
package/release-note.md
CHANGED