pds-dev-kit-web 1.9.2 → 1.9.4

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.
@@ -86,7 +86,7 @@ function Background() {
86
86
  if (backgroundMediaType !== 'YOUTUBE')
87
87
  return;
88
88
  setYoutubeSize(getResponsiveYoutubeSize());
89
- }, [getResponsiveYoutubeSize]);
89
+ }, [getResponsiveYoutubeSize, backgroundMediaSrc]);
90
90
  (0, react_1.useEffect)(function () {
91
91
  if (backgroundMediaType !== 'YOUTUBE')
92
92
  return;
@@ -85,6 +85,13 @@ function YouTubeIframe(_a) {
85
85
  });
86
86
  (_a = event.target) === null || _a === void 0 ? void 0 : _a.destroy();
87
87
  }, []);
88
+ var handleCrossOriginError = (0, react_1.useCallback)(function () {
89
+ if (!playerRef.current)
90
+ return;
91
+ playerRef.current.destroy();
92
+ setError(null);
93
+ onYouTubeIframeAPIReady();
94
+ }, [playerRef.current, setError]);
88
95
  var onYouTubeIframeAPIReady = (0, react_1.useCallback)(function () {
89
96
  if (!videoId || !PLAYER_ID) {
90
97
  return;
@@ -147,22 +154,32 @@ function YouTubeIframe(_a) {
147
154
  if (!playerRef.current)
148
155
  return;
149
156
  if (!videoId) {
150
- (_a = playerRef.current) === null || _a === void 0 ? void 0 : _a.stopVideo();
157
+ try {
158
+ (_a = playerRef.current) === null || _a === void 0 ? void 0 : _a.stopVideo();
159
+ }
160
+ catch (_b) {
161
+ handleCrossOriginError();
162
+ }
151
163
  return;
152
164
  }
153
165
  if (videoId !== prevVideoId) {
154
- playerRef.current.loadVideoById({
155
- videoId: videoId,
156
- playerVars: {
157
- playsinline: 1,
158
- autoplay: 1,
159
- controls: 0,
160
- iv_load_policy: 3,
161
- listType: 'playlist',
162
- playlist: videoId,
163
- loop: 1
164
- }
165
- });
166
+ try {
167
+ playerRef.current.loadVideoById({
168
+ videoId: videoId,
169
+ playerVars: {
170
+ playsinline: 1,
171
+ autoplay: 1,
172
+ controls: 0,
173
+ iv_load_policy: 3,
174
+ listType: 'playlist',
175
+ playlist: videoId,
176
+ loop: 1
177
+ }
178
+ });
179
+ }
180
+ catch (_c) {
181
+ handleCrossOriginError();
182
+ }
166
183
  }
167
184
  }, [playerRef, videoId, prevVideoId, onYouTubeIframeAPIReady]);
168
185
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web",
3
- "version": "1.9.2",
3
+ "version": "1.9.4",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
package/release-note.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # PDS-DEV-KIT-WEB Release Notes
2
- ## [v1.9.2]
2
+ ## [v1.9.4]
3
3
 
4
- ### Layout
5
- * WFL_2 생성
4
+ ### Sub
5
+ * DynamicLayout 수정
6
+ * crossOriginError에 대해 핸들링하기 위해 try/catch 추가