pds-dev-kit-web-test 0.2.27 → 0.2.29

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.
@@ -37,6 +37,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.CustomSectionBackgroundMedia = void 0;
38
38
  var jsx_runtime_1 = require("react/jsx-runtime");
39
39
  var react_1 = require("react");
40
+ var utils_1 = require("../../../../DynamicLayout/utils");
40
41
  var styled_components_1 = __importStar(require("styled-components"));
41
42
  var YouTubeIframe_1 = require("../../YouTubeIframe");
42
43
  var util_1 = require("../util");
@@ -44,6 +45,14 @@ function CustomSectionBackgroundMedia(_a) {
44
45
  var specs = _a.specs, playerId = _a.playerId, mediaType = _a.mediaType, componentStyle = _a.componentStyle, device = _a.device, backgroundRef = _a.backgroundRef;
45
46
  var _b = (0, util_1.parseSectionBackgroundMediaData)(specs, device), CB_STYLE_PROP_BGMEDIA_SPEC_YSRC = _b.CB_STYLE_PROP_BGMEDIA_SPEC_YSRC, CB_STYLE_PROP_BGMEDIA_SPEC_REPLAY = _b.CB_STYLE_PROP_BGMEDIA_SPEC_REPLAY, CB_STYLE_PROP_BGMEDIA_SPEC_STARTTIME = _b.CB_STYLE_PROP_BGMEDIA_SPEC_STARTTIME, CB_STYLE_PROP_BGMEDIA_SPEC_ENDTIME = _b.CB_STYLE_PROP_BGMEDIA_SPEC_ENDTIME, CB_STYLE_PROP_BGMEDIA_SPEC_IMAGESELECTOR = _b.CB_STYLE_PROP_BGMEDIA_SPEC_IMAGESELECTOR;
46
47
  var _c = (0, react_1.useState)({ width: 0, height: 0 }), youtubeSize = _c[0], setYoutubeSize = _c[1];
48
+ var youTubeIframeKey = (0, react_1.useMemo)(function () {
49
+ return utils_1.YouTubeLinkParser.getId(String(CB_STYLE_PROP_BGMEDIA_SPEC_YSRC)) + "-" + CB_STYLE_PROP_BGMEDIA_SPEC_REPLAY + "-" + CB_STYLE_PROP_BGMEDIA_SPEC_STARTTIME + "-" + CB_STYLE_PROP_BGMEDIA_SPEC_ENDTIME;
50
+ }, [
51
+ CB_STYLE_PROP_BGMEDIA_SPEC_YSRC,
52
+ CB_STYLE_PROP_BGMEDIA_SPEC_REPLAY,
53
+ CB_STYLE_PROP_BGMEDIA_SPEC_STARTTIME,
54
+ CB_STYLE_PROP_BGMEDIA_SPEC_ENDTIME
55
+ ]);
47
56
  var getResponsiveYoutubeSize = (0, react_1.useCallback)(function () {
48
57
  var backgroundWrapper = backgroundRef.current;
49
58
  if (!backgroundWrapper)
@@ -90,7 +99,7 @@ function CustomSectionBackgroundMedia(_a) {
90
99
  case 'IMAGE':
91
100
  return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: CB_STYLE_PROP_BGMEDIA_SPEC_IMAGESELECTOR && ((0, jsx_runtime_1.jsx)(S_Image, __assign({ src: String(CB_STYLE_PROP_BGMEDIA_SPEC_IMAGESELECTOR), normalStyle: componentStyle }, { children: (0, jsx_runtime_1.jsx)("img", { src: String(CB_STYLE_PROP_BGMEDIA_SPEC_IMAGESELECTOR), style: { visibility: 'hidden', width: '100%', height: '100%' } }, void 0) }), void 0)) }, void 0));
92
101
  case 'YOUTUBE':
93
- return ((0, jsx_runtime_1.jsx)(S_YoutubeContainer, __assign({}, youtubeSize, { children: youtubeSize.height > 0 && youtubeSize.width > 0 && ((0, jsx_runtime_1.jsx)(YouTubeIframe_1.YouTubeIframe, { id: playerId, src: String(CB_STYLE_PROP_BGMEDIA_SPEC_YSRC), loopMode: CB_STYLE_PROP_BGMEDIA_SPEC_REPLAY ? 'use' : 'none', startSeconds: Number(CB_STYLE_PROP_BGMEDIA_SPEC_STARTTIME), endSeconds: Number(CB_STYLE_PROP_BGMEDIA_SPEC_ENDTIME), customHeight: youtubeSize.height, customWidth: youtubeSize.width }, CB_STYLE_PROP_BGMEDIA_SPEC_REPLAY + "-" + CB_STYLE_PROP_BGMEDIA_SPEC_STARTTIME + "-" + CB_STYLE_PROP_BGMEDIA_SPEC_ENDTIME)) }), void 0));
102
+ return ((0, jsx_runtime_1.jsx)(S_YoutubeContainer, __assign({}, youtubeSize, { children: youtubeSize.height > 0 && youtubeSize.width > 0 && ((0, jsx_runtime_1.jsx)(YouTubeIframe_1.YouTubeIframe, { src: String(CB_STYLE_PROP_BGMEDIA_SPEC_YSRC), id: playerId, loopMode: CB_STYLE_PROP_BGMEDIA_SPEC_REPLAY ? 'use' : 'none', startSeconds: Number(CB_STYLE_PROP_BGMEDIA_SPEC_STARTTIME), endSeconds: Number(CB_STYLE_PROP_BGMEDIA_SPEC_ENDTIME), customHeight: youtubeSize.height, customWidth: youtubeSize.width }, youTubeIframeKey)) }), void 0));
94
103
  case 'NONE':
95
104
  default:
96
105
  return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}, void 0);
@@ -3,6 +3,17 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
3
3
  if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
4
  return cooked;
5
5
  };
6
+ var __assign = (this && this.__assign) || function () {
7
+ __assign = Object.assign || function(t) {
8
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
9
+ s = arguments[i];
10
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
+ t[p] = s[p];
12
+ }
13
+ return t;
14
+ };
15
+ return __assign.apply(this, arguments);
16
+ };
6
17
  var __importDefault = (this && this.__importDefault) || function (mod) {
7
18
  return (mod && mod.__esModule) ? mod : { "default": mod };
8
19
  };
@@ -104,21 +115,22 @@ function YouTubeIframe(_a) {
104
115
  try {
105
116
  // api 참고
106
117
  // https://developers.google.com/youtube/player_parameters?hl=ko
118
+ var playerVars = {
119
+ cc_load_policy: 0,
120
+ playsinline: 1,
121
+ autoplay: 1,
122
+ controls: 0,
123
+ iv_load_policy: 3,
124
+ listType: 'playlist',
125
+ disablekb: 1,
126
+ playlist: videoId,
127
+ start: startSeconds
128
+ };
107
129
  var player = new window.YT.Player(PLAYER_ID, {
108
130
  videoId: videoId,
109
131
  height: customHeight || 720,
110
132
  width: customWidth || 1920,
111
- playerVars: {
112
- cc_load_policy: 0,
113
- playsinline: 1,
114
- autoplay: 1,
115
- controls: 0,
116
- iv_load_policy: 3,
117
- listType: 'playlist',
118
- disablekb: 1,
119
- playlist: videoId,
120
- start: startSeconds
121
- },
133
+ playerVars: endSeconds ? __assign(__assign({}, playerVars), { end: endSeconds }) : playerVars,
122
134
  events: {
123
135
  onReady: onPlayerReady,
124
136
  onStateChange: onPlayerStateChange,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web-test",
3
- "version": "0.2.27",
3
+ "version": "0.2.29",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
package/release-note.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # pds-dev-kit-web-test Release Notes
2
- ## [v0.2.27]
2
+ ## [v0.2.29]
3
3
  ## 기준 pds-dev-kit-web 버전 @2.1.19
4
4
 
5
5
  ### sub