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.
@@ -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 _d = (0, react_1.useState)(false), videoLoaded = _d[0], setVideoLoaded = _d[1];
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 /* overflow: hidden; */\n pointer-events: ", ";\n width: 100%;\n"], ["\n aspect-ratio: 16 / 9;\n height: 100%;\n max-height: 100%;\n object-fit: cover;\n /* overflow: hidden; */\n pointer-events: ", ";\n width: 100%;\n"])), function (_a) {
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web-test",
3
- "version": "2.5.385",
3
+ "version": "2.5.387",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
package/release-note.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # PDS-DEV-KIT-WEB Release Notes
2
- ## [v2.2.170]
2
+ ## [v2.2.174]
3
3
  ## daily|https://design.storybook.publ.biz/
4
4
 
5
5
  ### 업데이트 사항
6
- * [PDS-1304] basefontsize 수정
6
+ * [PDS-1302] fix / video가 모바일에서 풀화면으로 됨