@elice/material-video-file 1.231227.0 → 1.240112.0-cloud.0
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/cjs/components/material-video-file/MaterialVideoFile.js +29 -32
- package/cjs/components/material-video-file/MaterialVideoFile.styled.js +1 -7
- package/cjs/components/material-video-file/MaterialVideoFilePlayer.js +61 -87
- package/cjs/components/material-video-file/MaterialVideoFilePlayer.styled.js +2 -8
- package/cjs/components/material-video-file/locales.js +2 -4
- package/cjs/components/material-video-file/useMaterialVideoFileApi.js +7 -17
- package/cjs/index.js +1 -3
- package/es/components/material-video-file/MaterialVideoFile.js +24 -22
- package/es/components/material-video-file/MaterialVideoFile.styled.js +1 -1
- package/es/components/material-video-file/MaterialVideoFilePlayer.js +52 -73
- package/es/components/material-video-file/MaterialVideoFilePlayer.styled.js +2 -2
- package/es/components/material-video-file/locales.js +2 -2
- package/es/components/material-video-file/useMaterialVideoFileApi.js +7 -15
- package/package.json +7 -7
- package/cjs/_virtual/_rollupPluginBabelHelpers.js +0 -60
- package/es/_virtual/_rollupPluginBabelHelpers.js +0 -51
|
@@ -14,48 +14,45 @@ var MaterialVideoFilePlayer = require('./MaterialVideoFilePlayer.js');
|
|
|
14
14
|
var useMaterialVideoFileApi = require('./useMaterialVideoFileApi.js');
|
|
15
15
|
var MaterialVideoFile_styled = require('./MaterialVideoFile.styled.js');
|
|
16
16
|
|
|
17
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
18
|
-
|
|
19
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
20
|
-
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
21
|
-
|
|
22
17
|
//
|
|
23
18
|
//
|
|
24
19
|
//
|
|
25
|
-
|
|
20
|
+
const MaterialVideoFile = _a => {
|
|
26
21
|
var _b, _c;
|
|
27
|
-
var
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
var {
|
|
23
|
+
materialVideoFileId,
|
|
24
|
+
className,
|
|
25
|
+
locale = 'en',
|
|
26
|
+
eliceAccountApiConfiguration
|
|
27
|
+
} = _a,
|
|
32
28
|
playerProps = tslib.__rest(_a, ["materialVideoFileId", "className", "locale", "eliceAccountApiConfiguration"]);
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
orgNameShort
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
29
|
+
const prefixCls = 'em-material-video-file';
|
|
30
|
+
const {
|
|
31
|
+
orgNameShort
|
|
32
|
+
} = materialSharedUtils.useMaterialConfig();
|
|
33
|
+
const {
|
|
34
|
+
accountApi
|
|
35
|
+
} = useMaterialVideoFileApi.useMaterialVideoFileApi({
|
|
36
|
+
eliceAccountApiConfiguration
|
|
37
|
+
});
|
|
38
|
+
const {
|
|
39
|
+
materialVideoFile,
|
|
40
|
+
status: materialVideoFileStatus
|
|
41
|
+
} = materialSharedUtils.useMaterialFetch(types.enums.LectureMaterialType.VideoFile, React.useCallback(signal => apiClient.getOrgMaterialVideoFileGet({
|
|
42
|
+
materialVideoFileId
|
|
43
|
+
}, {
|
|
44
|
+
signal
|
|
45
|
+
}), [materialVideoFileId]), apiClient.config.init);
|
|
49
46
|
//
|
|
50
47
|
//
|
|
51
48
|
//
|
|
52
|
-
return
|
|
53
|
-
className:
|
|
54
|
-
},
|
|
49
|
+
return React.createElement(MaterialVideoFile_styled.StyledMaterialVideoFileWrap, {
|
|
50
|
+
className: classnames(prefixCls, className)
|
|
51
|
+
}, React.createElement(reactIntl.IntlProvider, {
|
|
55
52
|
locale: locale,
|
|
56
53
|
defaultLocale: "en",
|
|
57
54
|
messages: locale in locales ? locales[locale] : locales.en
|
|
58
|
-
},
|
|
55
|
+
}, React.createElement(MaterialVideoFilePlayer.default, Object.assign({}, playerProps, {
|
|
59
56
|
orgNameShort: orgNameShort,
|
|
60
57
|
materialVideoFile: materialVideoFile !== null && materialVideoFile !== void 0 ? materialVideoFile : null,
|
|
61
58
|
materialVideoFileStatus: materialVideoFileStatus,
|
|
@@ -64,4 +61,4 @@ var MaterialVideoFile = function MaterialVideoFile(_a) {
|
|
|
64
61
|
}))));
|
|
65
62
|
};
|
|
66
63
|
|
|
67
|
-
exports
|
|
64
|
+
exports.default = MaterialVideoFile;
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var designTokens = require('@elice/design-tokens');
|
|
6
4
|
var styled = require('styled-components');
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
11
|
-
|
|
12
|
-
var StyledMaterialVideoFileWrap = styled__default["default"].div.withConfig({
|
|
6
|
+
const StyledMaterialVideoFileWrap = styled.div.withConfig({
|
|
13
7
|
componentId: "sc-1a1otok-0"
|
|
14
8
|
})(["display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:100%;background:", ";"], designTokens.base.color.gray9);
|
|
15
9
|
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
|
|
6
5
|
var React = require('react');
|
|
7
6
|
var reactIntl = require('react-intl');
|
|
8
7
|
var blocks = require('@elice/blocks');
|
|
@@ -10,11 +9,6 @@ var types = require('@elice/types');
|
|
|
10
9
|
var classnames = require('classnames');
|
|
11
10
|
var MaterialVideoFilePlayer_styled = require('./MaterialVideoFilePlayer.styled.js');
|
|
12
11
|
|
|
13
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
|
-
|
|
15
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
16
|
-
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
17
|
-
|
|
18
12
|
//
|
|
19
13
|
//
|
|
20
14
|
//
|
|
@@ -37,48 +31,37 @@ var VideoMimeType;
|
|
|
37
31
|
//
|
|
38
32
|
//
|
|
39
33
|
//
|
|
40
|
-
|
|
41
|
-
|
|
34
|
+
const ELICE_VIDEO_PLAYER_MESSAGE_EVENT = 'elice-videoplayer';
|
|
35
|
+
const ELICE_VIDEO_PLAYER_MESSAGE_TYPE = 'navigate';
|
|
42
36
|
//
|
|
43
37
|
//
|
|
44
38
|
//
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
emptyComponent = _ref$emptyComponent === void 0 ? null : _ref$emptyComponent,
|
|
68
|
-
_ref$title = _ref.title,
|
|
69
|
-
title = _ref$title === void 0 ? 'elice-videoplayer' : _ref$title,
|
|
70
|
-
onNavigatePreviousLecturePage = _ref.onNavigatePreviousLecturePage,
|
|
71
|
-
onNavigateNextLecturePage = _ref.onNavigateNextLecturePage,
|
|
72
|
-
accountApi = _ref.accountApi;
|
|
73
|
-
var prefixCls = 'em-video-player';
|
|
74
|
-
var _React$useState = React__default["default"].useState(null),
|
|
75
|
-
_React$useState2 = _rollupPluginBabelHelpers.slicedToArray(_React$useState, 2),
|
|
76
|
-
playerFrameSrc = _React$useState2[0],
|
|
77
|
-
setPlayerFrameSrc = _React$useState2[1];
|
|
39
|
+
const MaterialVideoFilePlayer = ({
|
|
40
|
+
className,
|
|
41
|
+
materialVideoFile,
|
|
42
|
+
materialVideoFileStatus = 'idle',
|
|
43
|
+
materialVideoFileTrackerDisabled = false,
|
|
44
|
+
mainLecturePageId,
|
|
45
|
+
orgNameShort,
|
|
46
|
+
lms = false,
|
|
47
|
+
lmsOrganizationBusinessType = null,
|
|
48
|
+
autoPlay = false,
|
|
49
|
+
autoPlayNext = false,
|
|
50
|
+
endControl = false,
|
|
51
|
+
locale,
|
|
52
|
+
eliceVideoPlayerUrl,
|
|
53
|
+
emptyComponent = null,
|
|
54
|
+
title = 'elice-videoplayer',
|
|
55
|
+
onNavigatePreviousLecturePage,
|
|
56
|
+
onNavigateNextLecturePage,
|
|
57
|
+
accountApi
|
|
58
|
+
}) => {
|
|
59
|
+
const prefixCls = 'em-video-player';
|
|
60
|
+
const [playerFrameSrc, setPlayerFrameSrc] = React.useState(null);
|
|
78
61
|
/**
|
|
79
62
|
* Current video status.
|
|
80
63
|
*/
|
|
81
|
-
|
|
64
|
+
const materialVideoFileUploadStatus = React.useMemo(() => {
|
|
82
65
|
var _a, _b, _c, _d;
|
|
83
66
|
switch (true) {
|
|
84
67
|
case typeof ((_a = materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.azureMediaVideo) === null || _a === void 0 ? void 0 : _a.status) === 'undefined':
|
|
@@ -96,67 +79,58 @@ var MaterialVideoFilePlayer = function MaterialVideoFilePlayer(_ref) {
|
|
|
96
79
|
//
|
|
97
80
|
// Get video iframe src.
|
|
98
81
|
//
|
|
99
|
-
|
|
82
|
+
React.useEffect(() => {
|
|
100
83
|
if (!eliceVideoPlayerUrl || !materialVideoFile) {
|
|
101
84
|
return;
|
|
102
85
|
}
|
|
103
|
-
|
|
86
|
+
const abortCtrl = new AbortController();
|
|
104
87
|
accountApi.auth.authOtpPost({
|
|
105
88
|
signal: abortCtrl.signal
|
|
106
89
|
})
|
|
107
90
|
// issue otp key
|
|
108
|
-
.then(
|
|
109
|
-
return res.otp;
|
|
110
|
-
})
|
|
91
|
+
.then(res => res.otp)
|
|
111
92
|
// create search params
|
|
112
|
-
.then(
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
};
|
|
128
|
-
})
|
|
93
|
+
.then(otp => ({
|
|
94
|
+
org: orgNameShort,
|
|
95
|
+
mid: materialVideoFile.id,
|
|
96
|
+
lmid: mainLecturePageId,
|
|
97
|
+
lms,
|
|
98
|
+
lmstype: lms ? lmsOrganizationBusinessType !== null && lmsOrganizationBusinessType !== void 0 ? lmsOrganizationBusinessType : undefined : undefined,
|
|
99
|
+
codec: VideoMimeType.Smooth,
|
|
100
|
+
autoplay: autoPlay,
|
|
101
|
+
autoplaynext: autoPlayNext,
|
|
102
|
+
endctrl: endControl,
|
|
103
|
+
notrack: materialVideoFileTrackerDisabled,
|
|
104
|
+
origin: window.location.origin,
|
|
105
|
+
locale,
|
|
106
|
+
otp
|
|
107
|
+
}))
|
|
129
108
|
// create url from search params
|
|
130
|
-
.then(
|
|
131
|
-
|
|
132
|
-
Object.entries(params).forEach(
|
|
133
|
-
var _ref3 = _rollupPluginBabelHelpers.slicedToArray(_ref2, 2),
|
|
134
|
-
key = _ref3[0],
|
|
135
|
-
value = _ref3[1];
|
|
109
|
+
.then(params => {
|
|
110
|
+
const url = new URL(eliceVideoPlayerUrl);
|
|
111
|
+
Object.entries(params).forEach(([key, value]) => {
|
|
136
112
|
if (value) {
|
|
137
113
|
url.searchParams.set(key, value);
|
|
138
114
|
}
|
|
139
115
|
});
|
|
140
116
|
return url;
|
|
141
|
-
}).then(
|
|
142
|
-
return url.href;
|
|
143
|
-
}).then(setPlayerFrameSrc).catch(function (err) {
|
|
117
|
+
}).then(url => url.href).then(setPlayerFrameSrc).catch(err => {
|
|
144
118
|
if (err.name !== 'AbortError') {
|
|
145
119
|
setPlayerFrameSrc(null);
|
|
146
120
|
}
|
|
147
121
|
});
|
|
148
|
-
return
|
|
122
|
+
return () => {
|
|
149
123
|
abortCtrl.abort();
|
|
150
124
|
};
|
|
151
125
|
}, [orgNameShort, materialVideoFile, materialVideoFileTrackerDisabled, mainLecturePageId, lms, lmsOrganizationBusinessType, eliceVideoPlayerUrl, autoPlay, autoPlayNext, endControl, locale, accountApi]);
|
|
152
126
|
//
|
|
153
127
|
// Add event listener for navigating prev and next lecture page.
|
|
154
128
|
//
|
|
155
|
-
|
|
156
|
-
|
|
129
|
+
React.useEffect(() => {
|
|
130
|
+
const _handle = event => {
|
|
157
131
|
var _a, _b, _c;
|
|
158
132
|
try {
|
|
159
|
-
|
|
133
|
+
const edata = JSON.parse(event.data);
|
|
160
134
|
if (edata.key !== ELICE_VIDEO_PLAYER_MESSAGE_EVENT || ((_a = edata.event) === null || _a === void 0 ? void 0 : _a.type) !== ELICE_VIDEO_PLAYER_MESSAGE_TYPE) {
|
|
161
135
|
return;
|
|
162
136
|
}
|
|
@@ -177,7 +151,7 @@ var MaterialVideoFilePlayer = function MaterialVideoFilePlayer(_ref) {
|
|
|
177
151
|
}
|
|
178
152
|
};
|
|
179
153
|
window.addEventListener('message', _handle);
|
|
180
|
-
return
|
|
154
|
+
return () => {
|
|
181
155
|
window.removeEventListener('message', _handle);
|
|
182
156
|
};
|
|
183
157
|
},
|
|
@@ -188,39 +162,39 @@ var MaterialVideoFilePlayer = function MaterialVideoFilePlayer(_ref) {
|
|
|
188
162
|
//
|
|
189
163
|
// pending
|
|
190
164
|
if (materialVideoFileStatus === 'idle' || materialVideoFileStatus === 'pending' || materialVideoFileStatus === 'resolved' && !playerFrameSrc) {
|
|
191
|
-
return
|
|
165
|
+
return React.createElement(MaterialVideoFilePlayer_styled.StyledVideoPlayerLoading, null, React.createElement(blocks.Spinner, null));
|
|
192
166
|
}
|
|
193
167
|
// rejected / empty video
|
|
194
168
|
if (materialVideoFileStatus === 'rejected' || materialVideoFileUploadStatus === VideoUploadStatus.Empty) {
|
|
195
|
-
return
|
|
169
|
+
return React.createElement(React.Fragment, {
|
|
196
170
|
children: emptyComponent
|
|
197
171
|
});
|
|
198
172
|
}
|
|
199
173
|
// encoding
|
|
200
174
|
if (materialVideoFileUploadStatus === VideoUploadStatus.Encoding) {
|
|
201
|
-
return
|
|
175
|
+
return React.createElement(MaterialVideoFilePlayer_styled.StyledVideoPlayerLoading, null, React.createElement(blocks.Spinner, null), React.createElement(blocks.Text, {
|
|
202
176
|
role: "gray3",
|
|
203
177
|
lineHeight: 1.5,
|
|
204
178
|
textAlign: "center",
|
|
205
179
|
preWrap: true
|
|
206
|
-
},
|
|
180
|
+
}, React.createElement(reactIntl.FormattedMessage, {
|
|
207
181
|
id: "videoFile.player.encoding"
|
|
208
182
|
})));
|
|
209
183
|
}
|
|
210
184
|
// encoding failed
|
|
211
185
|
if (materialVideoFileUploadStatus === VideoUploadStatus.EncodingFailed) {
|
|
212
|
-
return
|
|
186
|
+
return React.createElement(MaterialVideoFilePlayer_styled.StyledVideoPlayerLoading, null, React.createElement(blocks.Text, {
|
|
213
187
|
role: "gray3",
|
|
214
188
|
lineHeight: 1.5,
|
|
215
189
|
textAlign: "center",
|
|
216
190
|
preWrap: true
|
|
217
|
-
},
|
|
191
|
+
}, React.createElement(reactIntl.FormattedMessage, {
|
|
218
192
|
id: "videoFile.player.encodingFailed"
|
|
219
193
|
})));
|
|
220
194
|
}
|
|
221
195
|
// resolved
|
|
222
|
-
return
|
|
223
|
-
className:
|
|
196
|
+
return React.createElement(MaterialVideoFilePlayer_styled.StyledVideoPlayerWrap, {
|
|
197
|
+
className: classnames(prefixCls, className),
|
|
224
198
|
src: playerFrameSrc,
|
|
225
199
|
title: title,
|
|
226
200
|
allow: "autoplay",
|
|
@@ -231,4 +205,4 @@ var MaterialVideoFilePlayer$1 = Object.assign(MaterialVideoFilePlayer, {
|
|
|
231
205
|
MimeType: VideoMimeType
|
|
232
206
|
});
|
|
233
207
|
|
|
234
|
-
exports
|
|
208
|
+
exports.default = MaterialVideoFilePlayer$1;
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var styled = require('styled-components');
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
10
|
-
|
|
11
|
-
var StyledVideoPlayerWrap = styled__default["default"].iframe.withConfig({
|
|
5
|
+
const StyledVideoPlayerWrap = styled.iframe.withConfig({
|
|
12
6
|
componentId: "sc-1ocq3lp-0"
|
|
13
7
|
})(["width:100%;height:100%;border:0;"]);
|
|
14
|
-
|
|
8
|
+
const StyledVideoPlayerLoading = styled.div.withConfig({
|
|
15
9
|
componentId: "sc-1ocq3lp-1"
|
|
16
10
|
})(["display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;height:100%;"]);
|
|
17
11
|
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var en = {
|
|
3
|
+
const en = {
|
|
6
4
|
'videoFile.player.preparing': 'Material on preparing.',
|
|
7
5
|
'videoFile.player.uploadVideoBtn': 'Upload File',
|
|
8
6
|
'videoFile.player.encoding': 'A video is being prepared.\nPlease check back later.',
|
|
9
7
|
'videoFile.player.encodingFailed': 'There was a problem processing the video.\nIf the problem persists, please contact customer service.',
|
|
10
8
|
'videoFile.player.noVideo': 'This file does not exist.'
|
|
11
9
|
};
|
|
12
|
-
|
|
10
|
+
const ko = {
|
|
13
11
|
'videoFile.player.preparing': '자료를 준비 중입니다.',
|
|
14
12
|
'videoFile.player.uploadVideoBtn': '파일 업로드',
|
|
15
13
|
'videoFile.player.encoding': '동영상을 준비 중 입니다.\n잠시 후 다시 확인해주세요.',
|
|
@@ -1,37 +1,27 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
|
|
6
3
|
var React = require('react');
|
|
7
4
|
var openapiClientAccount = require('@elice/openapi-client-account');
|
|
8
5
|
|
|
9
6
|
//
|
|
10
7
|
//
|
|
11
8
|
//
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
const useMaterialVideoFileApi = props => {
|
|
10
|
+
const _return = React.useRef({});
|
|
14
11
|
//
|
|
15
12
|
//
|
|
16
13
|
//
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
});
|
|
21
|
-
};
|
|
14
|
+
const createAccountApi = () => Object.freeze({
|
|
15
|
+
auth: new openapiClientAccount.AuthApi(props.eliceAccountApiConfiguration)
|
|
16
|
+
});
|
|
22
17
|
//
|
|
23
18
|
//
|
|
24
19
|
//
|
|
25
|
-
|
|
26
|
-
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
|
27
|
-
accountApi = _useState2[0],
|
|
28
|
-
setAccountApi = _useState2[1];
|
|
20
|
+
const [accountApi, setAccountApi] = React.useState(createAccountApi);
|
|
29
21
|
//
|
|
30
22
|
//
|
|
31
23
|
//
|
|
32
|
-
React.useEffect(
|
|
33
|
-
return setAccountApi(createAccountApi);
|
|
34
|
-
},
|
|
24
|
+
React.useEffect(() => setAccountApi(createAccountApi),
|
|
35
25
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
36
26
|
[props.eliceAccountApiConfiguration]);
|
|
37
27
|
//
|
package/cjs/index.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var MaterialVideoFile = require('./components/material-video-file/MaterialVideoFile.js');
|
|
6
4
|
|
|
7
5
|
|
|
8
6
|
|
|
9
|
-
exports.MaterialVideoFile = MaterialVideoFile
|
|
7
|
+
exports.MaterialVideoFile = MaterialVideoFile.default;
|
|
@@ -14,30 +14,32 @@ import { StyledMaterialVideoFileWrap } from './MaterialVideoFile.styled.js';
|
|
|
14
14
|
//
|
|
15
15
|
//
|
|
16
16
|
//
|
|
17
|
-
|
|
17
|
+
const MaterialVideoFile = _a => {
|
|
18
18
|
var _b, _c;
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
var {
|
|
20
|
+
materialVideoFileId,
|
|
21
|
+
className,
|
|
22
|
+
locale = 'en',
|
|
23
|
+
eliceAccountApiConfiguration
|
|
24
|
+
} = _a,
|
|
24
25
|
playerProps = __rest(_a, ["materialVideoFileId", "className", "locale", "eliceAccountApiConfiguration"]);
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
orgNameShort
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
26
|
+
const prefixCls = 'em-material-video-file';
|
|
27
|
+
const {
|
|
28
|
+
orgNameShort
|
|
29
|
+
} = useMaterialConfig();
|
|
30
|
+
const {
|
|
31
|
+
accountApi
|
|
32
|
+
} = useMaterialVideoFileApi({
|
|
33
|
+
eliceAccountApiConfiguration
|
|
34
|
+
});
|
|
35
|
+
const {
|
|
36
|
+
materialVideoFile,
|
|
37
|
+
status: materialVideoFileStatus
|
|
38
|
+
} = useMaterialFetch(enums.LectureMaterialType.VideoFile, React.useCallback(signal => getOrgMaterialVideoFileGet({
|
|
39
|
+
materialVideoFileId
|
|
40
|
+
}, {
|
|
41
|
+
signal
|
|
42
|
+
}), [materialVideoFileId]), config.init);
|
|
41
43
|
//
|
|
42
44
|
//
|
|
43
45
|
//
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { base } from '@elice/design-tokens';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
const StyledMaterialVideoFileWrap = styled.div.withConfig({
|
|
5
5
|
componentId: "sc-1a1otok-0"
|
|
6
6
|
})(["display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:100%;background:", ";"], base.color.gray9);
|
|
7
7
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { slicedToArray as _slicedToArray } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { FormattedMessage } from 'react-intl';
|
|
4
3
|
import { Spinner, Text } from '@elice/blocks';
|
|
@@ -28,48 +27,37 @@ var VideoMimeType;
|
|
|
28
27
|
//
|
|
29
28
|
//
|
|
30
29
|
//
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
const ELICE_VIDEO_PLAYER_MESSAGE_EVENT = 'elice-videoplayer';
|
|
31
|
+
const ELICE_VIDEO_PLAYER_MESSAGE_TYPE = 'navigate';
|
|
33
32
|
//
|
|
34
33
|
//
|
|
35
34
|
//
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
emptyComponent = _ref$emptyComponent === void 0 ? null : _ref$emptyComponent,
|
|
59
|
-
_ref$title = _ref.title,
|
|
60
|
-
title = _ref$title === void 0 ? 'elice-videoplayer' : _ref$title,
|
|
61
|
-
onNavigatePreviousLecturePage = _ref.onNavigatePreviousLecturePage,
|
|
62
|
-
onNavigateNextLecturePage = _ref.onNavigateNextLecturePage,
|
|
63
|
-
accountApi = _ref.accountApi;
|
|
64
|
-
var prefixCls = 'em-video-player';
|
|
65
|
-
var _React$useState = React.useState(null),
|
|
66
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
67
|
-
playerFrameSrc = _React$useState2[0],
|
|
68
|
-
setPlayerFrameSrc = _React$useState2[1];
|
|
35
|
+
const MaterialVideoFilePlayer = ({
|
|
36
|
+
className,
|
|
37
|
+
materialVideoFile,
|
|
38
|
+
materialVideoFileStatus = 'idle',
|
|
39
|
+
materialVideoFileTrackerDisabled = false,
|
|
40
|
+
mainLecturePageId,
|
|
41
|
+
orgNameShort,
|
|
42
|
+
lms = false,
|
|
43
|
+
lmsOrganizationBusinessType = null,
|
|
44
|
+
autoPlay = false,
|
|
45
|
+
autoPlayNext = false,
|
|
46
|
+
endControl = false,
|
|
47
|
+
locale,
|
|
48
|
+
eliceVideoPlayerUrl,
|
|
49
|
+
emptyComponent = null,
|
|
50
|
+
title = 'elice-videoplayer',
|
|
51
|
+
onNavigatePreviousLecturePage,
|
|
52
|
+
onNavigateNextLecturePage,
|
|
53
|
+
accountApi
|
|
54
|
+
}) => {
|
|
55
|
+
const prefixCls = 'em-video-player';
|
|
56
|
+
const [playerFrameSrc, setPlayerFrameSrc] = React.useState(null);
|
|
69
57
|
/**
|
|
70
58
|
* Current video status.
|
|
71
59
|
*/
|
|
72
|
-
|
|
60
|
+
const materialVideoFileUploadStatus = React.useMemo(() => {
|
|
73
61
|
var _a, _b, _c, _d;
|
|
74
62
|
switch (true) {
|
|
75
63
|
case typeof ((_a = materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.azureMediaVideo) === null || _a === void 0 ? void 0 : _a.status) === 'undefined':
|
|
@@ -87,67 +75,58 @@ var MaterialVideoFilePlayer = function MaterialVideoFilePlayer(_ref) {
|
|
|
87
75
|
//
|
|
88
76
|
// Get video iframe src.
|
|
89
77
|
//
|
|
90
|
-
React.useEffect(
|
|
78
|
+
React.useEffect(() => {
|
|
91
79
|
if (!eliceVideoPlayerUrl || !materialVideoFile) {
|
|
92
80
|
return;
|
|
93
81
|
}
|
|
94
|
-
|
|
82
|
+
const abortCtrl = new AbortController();
|
|
95
83
|
accountApi.auth.authOtpPost({
|
|
96
84
|
signal: abortCtrl.signal
|
|
97
85
|
})
|
|
98
86
|
// issue otp key
|
|
99
|
-
.then(
|
|
100
|
-
return res.otp;
|
|
101
|
-
})
|
|
87
|
+
.then(res => res.otp)
|
|
102
88
|
// create search params
|
|
103
|
-
.then(
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
};
|
|
119
|
-
})
|
|
89
|
+
.then(otp => ({
|
|
90
|
+
org: orgNameShort,
|
|
91
|
+
mid: materialVideoFile.id,
|
|
92
|
+
lmid: mainLecturePageId,
|
|
93
|
+
lms,
|
|
94
|
+
lmstype: lms ? lmsOrganizationBusinessType !== null && lmsOrganizationBusinessType !== void 0 ? lmsOrganizationBusinessType : undefined : undefined,
|
|
95
|
+
codec: VideoMimeType.Smooth,
|
|
96
|
+
autoplay: autoPlay,
|
|
97
|
+
autoplaynext: autoPlayNext,
|
|
98
|
+
endctrl: endControl,
|
|
99
|
+
notrack: materialVideoFileTrackerDisabled,
|
|
100
|
+
origin: window.location.origin,
|
|
101
|
+
locale,
|
|
102
|
+
otp
|
|
103
|
+
}))
|
|
120
104
|
// create url from search params
|
|
121
|
-
.then(
|
|
122
|
-
|
|
123
|
-
Object.entries(params).forEach(
|
|
124
|
-
var _ref3 = _slicedToArray(_ref2, 2),
|
|
125
|
-
key = _ref3[0],
|
|
126
|
-
value = _ref3[1];
|
|
105
|
+
.then(params => {
|
|
106
|
+
const url = new URL(eliceVideoPlayerUrl);
|
|
107
|
+
Object.entries(params).forEach(([key, value]) => {
|
|
127
108
|
if (value) {
|
|
128
109
|
url.searchParams.set(key, value);
|
|
129
110
|
}
|
|
130
111
|
});
|
|
131
112
|
return url;
|
|
132
|
-
}).then(
|
|
133
|
-
return url.href;
|
|
134
|
-
}).then(setPlayerFrameSrc).catch(function (err) {
|
|
113
|
+
}).then(url => url.href).then(setPlayerFrameSrc).catch(err => {
|
|
135
114
|
if (err.name !== 'AbortError') {
|
|
136
115
|
setPlayerFrameSrc(null);
|
|
137
116
|
}
|
|
138
117
|
});
|
|
139
|
-
return
|
|
118
|
+
return () => {
|
|
140
119
|
abortCtrl.abort();
|
|
141
120
|
};
|
|
142
121
|
}, [orgNameShort, materialVideoFile, materialVideoFileTrackerDisabled, mainLecturePageId, lms, lmsOrganizationBusinessType, eliceVideoPlayerUrl, autoPlay, autoPlayNext, endControl, locale, accountApi]);
|
|
143
122
|
//
|
|
144
123
|
// Add event listener for navigating prev and next lecture page.
|
|
145
124
|
//
|
|
146
|
-
React.useEffect(
|
|
147
|
-
|
|
125
|
+
React.useEffect(() => {
|
|
126
|
+
const _handle = event => {
|
|
148
127
|
var _a, _b, _c;
|
|
149
128
|
try {
|
|
150
|
-
|
|
129
|
+
const edata = JSON.parse(event.data);
|
|
151
130
|
if (edata.key !== ELICE_VIDEO_PLAYER_MESSAGE_EVENT || ((_a = edata.event) === null || _a === void 0 ? void 0 : _a.type) !== ELICE_VIDEO_PLAYER_MESSAGE_TYPE) {
|
|
152
131
|
return;
|
|
153
132
|
}
|
|
@@ -168,7 +147,7 @@ var MaterialVideoFilePlayer = function MaterialVideoFilePlayer(_ref) {
|
|
|
168
147
|
}
|
|
169
148
|
};
|
|
170
149
|
window.addEventListener('message', _handle);
|
|
171
|
-
return
|
|
150
|
+
return () => {
|
|
172
151
|
window.removeEventListener('message', _handle);
|
|
173
152
|
};
|
|
174
153
|
},
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const StyledVideoPlayerWrap = styled.iframe.withConfig({
|
|
4
4
|
componentId: "sc-1ocq3lp-0"
|
|
5
5
|
})(["width:100%;height:100%;border:0;"]);
|
|
6
|
-
|
|
6
|
+
const StyledVideoPlayerLoading = styled.div.withConfig({
|
|
7
7
|
componentId: "sc-1ocq3lp-1"
|
|
8
8
|
})(["display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;height:100%;"]);
|
|
9
9
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
const en = {
|
|
2
2
|
'videoFile.player.preparing': 'Material on preparing.',
|
|
3
3
|
'videoFile.player.uploadVideoBtn': 'Upload File',
|
|
4
4
|
'videoFile.player.encoding': 'A video is being prepared.\nPlease check back later.',
|
|
5
5
|
'videoFile.player.encodingFailed': 'There was a problem processing the video.\nIf the problem persists, please contact customer service.',
|
|
6
6
|
'videoFile.player.noVideo': 'This file does not exist.'
|
|
7
7
|
};
|
|
8
|
-
|
|
8
|
+
const ko = {
|
|
9
9
|
'videoFile.player.preparing': '자료를 준비 중입니다.',
|
|
10
10
|
'videoFile.player.uploadVideoBtn': '파일 업로드',
|
|
11
11
|
'videoFile.player.encoding': '동영상을 준비 중 입니다.\n잠시 후 다시 확인해주세요.',
|
|
@@ -1,33 +1,25 @@
|
|
|
1
|
-
import { slicedToArray as _slicedToArray } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import { useRef, useState, useEffect } from 'react';
|
|
3
2
|
import { AuthApi } from '@elice/openapi-client-account';
|
|
4
3
|
|
|
5
4
|
//
|
|
6
5
|
//
|
|
7
6
|
//
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const useMaterialVideoFileApi = props => {
|
|
8
|
+
const _return = useRef({});
|
|
10
9
|
//
|
|
11
10
|
//
|
|
12
11
|
//
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
});
|
|
17
|
-
};
|
|
12
|
+
const createAccountApi = () => Object.freeze({
|
|
13
|
+
auth: new AuthApi(props.eliceAccountApiConfiguration)
|
|
14
|
+
});
|
|
18
15
|
//
|
|
19
16
|
//
|
|
20
17
|
//
|
|
21
|
-
|
|
22
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
23
|
-
accountApi = _useState2[0],
|
|
24
|
-
setAccountApi = _useState2[1];
|
|
18
|
+
const [accountApi, setAccountApi] = useState(createAccountApi);
|
|
25
19
|
//
|
|
26
20
|
//
|
|
27
21
|
//
|
|
28
|
-
useEffect(
|
|
29
|
-
return setAccountApi(createAccountApi);
|
|
30
|
-
},
|
|
22
|
+
useEffect(() => setAccountApi(createAccountApi),
|
|
31
23
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
32
24
|
[props.eliceAccountApiConfiguration]);
|
|
33
25
|
//
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elice/material-video-file",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.240112.0-cloud.0",
|
|
4
4
|
"description": "User view and editing components of Elice material video file",
|
|
5
5
|
"repository": "https://git.elicer.io/elice/frontend/library/elice-material",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
"start": "run-s watch",
|
|
19
19
|
"prebuild": "run-s clean",
|
|
20
20
|
"build": "run-p build:es build:cjs",
|
|
21
|
-
"build:es": "rollup -c ../../rollup.config.ts -f es",
|
|
22
|
-
"build:cjs": "rollup -c ../../rollup.config.ts -f cjs",
|
|
23
|
-
"watch": "rollup -c ../../rollup.config.ts -f es -w",
|
|
21
|
+
"build:es": "rollup -c ../../rollup.config.ts --configPlugin typescript -f es",
|
|
22
|
+
"build:cjs": "rollup -c ../../rollup.config.ts --configPlugin typescript -f cjs",
|
|
23
|
+
"watch": "rollup -c ../../rollup.config.ts --configPlugin typescript -f es -w",
|
|
24
24
|
"lint": "eslint --ext .ts,.tsx ./src --max-warnings=0",
|
|
25
25
|
"clean": "del-cli \"es/*\" \"cjs/*\" \"dist/*\""
|
|
26
26
|
},
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"@elice/design-tokens": "^1.220803.0",
|
|
50
50
|
"@elice/icons": "^1.230814.0",
|
|
51
51
|
"@elice/icons-legacy": "npm:@elice/icons@0.230814.0",
|
|
52
|
-
"@elice/material-shared-types": "1.
|
|
53
|
-
"@elice/material-shared-utils": "1.
|
|
52
|
+
"@elice/material-shared-types": "1.240112.0-cloud.0",
|
|
53
|
+
"@elice/material-shared-utils": "1.240112.0-cloud.0",
|
|
54
54
|
"@elice/openapi-client-account": "^1.230814.0",
|
|
55
55
|
"@elice/types": "^1.230815.0",
|
|
56
56
|
"@types/classnames": "^2.3.1",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"react-use": "^17.2.4",
|
|
63
63
|
"styled-components": "^5.3.0"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "5724868dc938b0d4987541030e911b60c0dfcff7"
|
|
66
66
|
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
function _iterableToArrayLimit(arr, i) {
|
|
6
|
-
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
7
|
-
if (null != _i) {
|
|
8
|
-
var _s,
|
|
9
|
-
_e,
|
|
10
|
-
_x,
|
|
11
|
-
_r,
|
|
12
|
-
_arr = [],
|
|
13
|
-
_n = !0,
|
|
14
|
-
_d = !1;
|
|
15
|
-
try {
|
|
16
|
-
if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
|
17
|
-
if (Object(_i) !== _i) return;
|
|
18
|
-
_n = !1;
|
|
19
|
-
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
|
|
20
|
-
} catch (err) {
|
|
21
|
-
_d = !0, _e = err;
|
|
22
|
-
} finally {
|
|
23
|
-
try {
|
|
24
|
-
if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
|
|
25
|
-
} finally {
|
|
26
|
-
if (_d) throw _e;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return _arr;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
function _slicedToArray(arr, i) {
|
|
33
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
34
|
-
}
|
|
35
|
-
function _arrayWithHoles(arr) {
|
|
36
|
-
if (Array.isArray(arr)) return arr;
|
|
37
|
-
}
|
|
38
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
39
|
-
if (!o) return;
|
|
40
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
41
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
42
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
43
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
44
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
45
|
-
}
|
|
46
|
-
function _arrayLikeToArray(arr, len) {
|
|
47
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
48
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
49
|
-
return arr2;
|
|
50
|
-
}
|
|
51
|
-
function _nonIterableRest() {
|
|
52
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
exports.arrayLikeToArray = _arrayLikeToArray;
|
|
56
|
-
exports.arrayWithHoles = _arrayWithHoles;
|
|
57
|
-
exports.iterableToArrayLimit = _iterableToArrayLimit;
|
|
58
|
-
exports.nonIterableRest = _nonIterableRest;
|
|
59
|
-
exports.slicedToArray = _slicedToArray;
|
|
60
|
-
exports.unsupportedIterableToArray = _unsupportedIterableToArray;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
function _iterableToArrayLimit(arr, i) {
|
|
2
|
-
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
3
|
-
if (null != _i) {
|
|
4
|
-
var _s,
|
|
5
|
-
_e,
|
|
6
|
-
_x,
|
|
7
|
-
_r,
|
|
8
|
-
_arr = [],
|
|
9
|
-
_n = !0,
|
|
10
|
-
_d = !1;
|
|
11
|
-
try {
|
|
12
|
-
if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
|
13
|
-
if (Object(_i) !== _i) return;
|
|
14
|
-
_n = !1;
|
|
15
|
-
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
|
|
16
|
-
} catch (err) {
|
|
17
|
-
_d = !0, _e = err;
|
|
18
|
-
} finally {
|
|
19
|
-
try {
|
|
20
|
-
if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
|
|
21
|
-
} finally {
|
|
22
|
-
if (_d) throw _e;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return _arr;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
function _slicedToArray(arr, i) {
|
|
29
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
30
|
-
}
|
|
31
|
-
function _arrayWithHoles(arr) {
|
|
32
|
-
if (Array.isArray(arr)) return arr;
|
|
33
|
-
}
|
|
34
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
35
|
-
if (!o) return;
|
|
36
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
37
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
38
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
39
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
40
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
41
|
-
}
|
|
42
|
-
function _arrayLikeToArray(arr, len) {
|
|
43
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
44
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
45
|
-
return arr2;
|
|
46
|
-
}
|
|
47
|
-
function _nonIterableRest() {
|
|
48
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export { _arrayLikeToArray as arrayLikeToArray, _arrayWithHoles as arrayWithHoles, _iterableToArrayLimit as iterableToArrayLimit, _nonIterableRest as nonIterableRest, _slicedToArray as slicedToArray, _unsupportedIterableToArray as unsupportedIterableToArray };
|