@elice/material-video-file 1.250828.0 → 1.250904.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.
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { WithIntlComponentBuilderProps } from '@elice/intl';
2
+ import type { EliceVideoplayerApis } from '@elice/videoplayer-client';
3
3
  import type { MaterialVideoFilePlayerProps } from './MaterialVideoFilePlayer';
4
4
  import type { UseMaterialVideoFileApiProps } from './useMaterialVideoFileApi';
5
5
  type PickedVideoPlayerProps = Pick<MaterialVideoFilePlayerProps, 'materialVideoFileTrackerDisabled' | 'mainLecturePageId' | 'lms' | 'lmsOrganizationBusinessType' | 'emptyComponent' | 'autoPlay' | 'autoPlayNext' | 'endControl' | 'eliceVideoPlayerUrl' | 'onNavigatePreviousLecturePage' | 'onNavigateNextLecturePage' | 'onTranscriptToggle'>;
@@ -7,5 +7,7 @@ export interface MaterialVideoFileProps extends PickedVideoPlayerProps, UseMater
7
7
  materialVideoFileId: number;
8
8
  className?: string;
9
9
  }
10
- declare const _default: React.ForwardRefExoticComponent<import("@elice/intl").IntlComponentExtraProps & Omit<WithIntlComponentBuilderProps<MaterialVideoFileProps>, keyof import("@elice/intl").IntlComponentExtraProps | "__intl"> & React.RefAttributes<any>>;
10
+ declare const _default: React.ForwardRefExoticComponent<Omit<import("@elice/intl").IntlComponentExtraProps & Omit<import("@elice/intl").IntlComponentExtraProps & Omit<MaterialVideoFileProps, keyof import("@elice/intl").IntlComponentExtraProps | "__intl"> & {
11
+ __intl: import("@elice/intl").EliceIntlShape;
12
+ } & React.RefAttributes<EliceVideoplayerApis>, keyof import("@elice/intl").IntlComponentExtraProps | "__intl">, "ref"> & React.RefAttributes<EliceVideoplayerApis>>;
11
13
  export default _default;
@@ -24,7 +24,7 @@ var classnames__default = /*#__PURE__*/_interopDefaultCompat(classnames);
24
24
  //
25
25
  //
26
26
  //
27
- var MaterialVideoFile = function MaterialVideoFile(_a) {
27
+ var MaterialVideoFile = React.forwardRef(function (_a, ref) {
28
28
  var _b, _c, _d, _e;
29
29
  var materialVideoFileId = _a.materialVideoFileId,
30
30
  className = _a.className,
@@ -59,11 +59,12 @@ var MaterialVideoFile = function MaterialVideoFile(_a) {
59
59
  materialVideoFile: materialVideoFile !== null && materialVideoFile !== void 0 ? materialVideoFile : null,
60
60
  materialVideoFileStatus: materialVideoFileStatus,
61
61
  accountApi: accountApi,
62
- title: (_e = (_c = (_b = materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.cloudflareStream) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : (_d = materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.azureMediaVideo) === null || _d === void 0 ? void 0 : _d.videoAssetName) !== null && _e !== void 0 ? _e : undefined
62
+ title: (_e = (_c = (_b = materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.cloudflareStream) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : (_d = materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.azureMediaVideo) === null || _d === void 0 ? void 0 : _d.videoAssetName) !== null && _e !== void 0 ? _e : undefined,
63
+ ref: ref
63
64
  }))
64
65
  })
65
66
  });
66
- };
67
+ });
67
68
  var MaterialVideoFile$1 = new intl.IntlComponentBuilder(MaterialVideoFile).add('en', en.default).add('ko', ko.default).addAsync('th', Promise.resolve().then(function () { return require('./locales/th.json.js'); })).addAsync('ja', Promise.resolve().then(function () { return require('./locales/ja.json.js'); })).build();
68
69
 
69
70
  exports.default = MaterialVideoFile$1;
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { APIStatus } from '@elice/material-shared-types';
3
3
  import type { EliceVideoPlayerSearchParams, GetOrgMaterialVideoFileGetResponses } from '@elice/types';
4
+ import type { EliceVideoplayerApis } from '@elice/videoplayer-client';
4
5
  import type { UseMaterialVideoFileApiReturn } from './useMaterialVideoFileApi';
5
6
  export interface MaterialVideoFilePlayerProps extends UseMaterialVideoFileApiReturn {
6
7
  /** Classname for the element. */
@@ -41,5 +42,5 @@ export interface MaterialVideoFilePlayerProps extends UseMaterialVideoFileApiRet
41
42
  /** Toggle transcript. */
42
43
  onTranscriptToggle?: (enabled: boolean) => void;
43
44
  }
44
- declare const MaterialVideoFilePlayer: React.FC<MaterialVideoFilePlayerProps>;
45
+ declare const MaterialVideoFilePlayer: React.ForwardRefExoticComponent<MaterialVideoFilePlayerProps & React.RefAttributes<EliceVideoplayerApis>>;
45
46
  export default MaterialVideoFilePlayer;
@@ -28,7 +28,7 @@ var VideoUploadStatus;
28
28
  //
29
29
  //
30
30
  //
31
- var MaterialVideoFilePlayer = function MaterialVideoFilePlayer(_ref) {
31
+ var MaterialVideoFilePlayer = React.forwardRef(function (_ref, ref) {
32
32
  var className = _ref.className,
33
33
  materialVideoFile = _ref.materialVideoFile,
34
34
  _ref$materialVideoFil = _ref.materialVideoFileStatus,
@@ -54,7 +54,6 @@ var MaterialVideoFilePlayer = function MaterialVideoFilePlayer(_ref) {
54
54
  onNavigateNextLecturePage = _ref.onNavigateNextLecturePage,
55
55
  _onTranscriptToggle = _ref.onTranscriptToggle,
56
56
  accountApi = _ref.accountApi;
57
- var _a;
58
57
  var prefixCls = 'em-video-player';
59
58
  var intl$1 = intl.useRawEliceIntl();
60
59
  /**
@@ -95,79 +94,104 @@ var MaterialVideoFilePlayer = function MaterialVideoFilePlayer(_ref) {
95
94
  return VideoUploadStatus.Empty;
96
95
  }
97
96
  }, [materialVideoFile]);
97
+ /**
98
+ *
99
+ */
100
+ var renderVideoPlayerOverlayContent = function renderVideoPlayerOverlayContent() {
101
+ // pending
102
+ if (materialVideoFileStatus === 'idle' || materialVideoFileStatus === 'pending') {
103
+ return jsxRuntime.jsx(MaterialVideoFilePlayer_styled.StyledVideoPlayerLoading, {
104
+ children: jsxRuntime.jsx(blocks.Spinner, {})
105
+ });
106
+ }
107
+ // rejected / empty video
108
+ if (materialVideoFileStatus === 'rejected' || materialVideoFileUploadStatus === VideoUploadStatus.Empty) {
109
+ return jsxRuntime.jsx(React__default.default.Fragment, {
110
+ children: emptyComponent
111
+ });
112
+ }
113
+ // encoding
114
+ if (materialVideoFileUploadStatus === VideoUploadStatus.Encoding) {
115
+ return jsxRuntime.jsxs(MaterialVideoFilePlayer_styled.StyledVideoPlayerLoading, {
116
+ children: [jsxRuntime.jsx(blocks.Spinner, {}), jsxRuntime.jsx(blocks.Text, {
117
+ role: "gray3",
118
+ lineHeight: 1.5,
119
+ textAlign: "center",
120
+ preWrap: true,
121
+ children: intl$1.formatMessage({
122
+ id: 'videoFile.player.encoding'
123
+ })
124
+ })]
125
+ });
126
+ }
127
+ // encoding failed
128
+ if (materialVideoFileUploadStatus === VideoUploadStatus.EncodingFailed) {
129
+ return jsxRuntime.jsx(MaterialVideoFilePlayer_styled.StyledVideoPlayerLoading, {
130
+ children: jsxRuntime.jsx(blocks.Text, {
131
+ role: "gray3",
132
+ lineHeight: 1.5,
133
+ textAlign: "center",
134
+ preWrap: true,
135
+ children: intl$1.formatMessage({
136
+ id: 'videoFile.player.encodingFailed'
137
+ })
138
+ })
139
+ });
140
+ }
141
+ return null;
142
+ };
143
+ /**
144
+ *
145
+ */
146
+ var renderVideoPlayerOverlay = function renderVideoPlayerOverlay() {
147
+ var content = renderVideoPlayerOverlayContent();
148
+ return content ? jsxRuntime.jsx(MaterialVideoFilePlayer_styled.StyledVideoPlayerOverlay, {
149
+ children: content
150
+ }) : null;
151
+ };
152
+ /**
153
+ *
154
+ */
155
+ var renderVideoPlayer = function renderVideoPlayer() {
156
+ var _a;
157
+ return jsxRuntime.jsx(MaterialVideoFilePlayer_styled.StyledVideoPlayer, {
158
+ className: classnames__default.default(prefixCls, className),
159
+ orgNameShort: orgNameShort !== null && orgNameShort !== void 0 ? orgNameShort : '',
160
+ materialVideoId: (_a = materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.id) !== null && _a !== void 0 ? _a : 0,
161
+ linkedMaterialId: mainLecturePageId,
162
+ lmsType: lms ? lmsOrganizationBusinessType !== null && lmsOrganizationBusinessType !== void 0 ? lmsOrganizationBusinessType : undefined : undefined,
163
+ noAutoplay: !autoPlay,
164
+ noAutoplayNext: !autoPlayNext,
165
+ noEndControl: !endControl,
166
+ noTracker: materialVideoFileTrackerDisabled,
167
+ playerBaseUrl: eliceVideoPlayerUrl,
168
+ otp: function otp() {
169
+ return accountApi.auth.authOtpPost().then(function (res) {
170
+ return res.otp;
171
+ });
172
+ },
173
+ onLecturePageNavigate: function onLecturePageNavigate(dir) {
174
+ if (dir === 'prev' && onNavigatePreviousLecturePage) {
175
+ onNavigatePreviousLecturePage();
176
+ } else if (dir === 'next' && onNavigateNextLecturePage) {
177
+ onNavigateNextLecturePage();
178
+ }
179
+ },
180
+ onTranscriptToggle: function onTranscriptToggle(enabled) {
181
+ if (typeof _onTranscriptToggle === 'function') {
182
+ _onTranscriptToggle(enabled);
183
+ }
184
+ },
185
+ ref: ref
186
+ });
187
+ };
98
188
  //
99
189
  //
100
190
  //
101
- // pending
102
- if (materialVideoFileStatus === 'idle' || materialVideoFileStatus === 'pending') {
103
- return jsxRuntime.jsx(MaterialVideoFilePlayer_styled.StyledVideoPlayerLoading, {
104
- children: jsxRuntime.jsx(blocks.Spinner, {})
105
- });
106
- }
107
- // rejected / empty video
108
- if (materialVideoFileStatus === 'rejected' || materialVideoFileUploadStatus === VideoUploadStatus.Empty) {
109
- return jsxRuntime.jsx(React__default.default.Fragment, {
110
- children: emptyComponent
111
- });
112
- }
113
- // encoding
114
- if (materialVideoFileUploadStatus === VideoUploadStatus.Encoding) {
115
- return jsxRuntime.jsxs(MaterialVideoFilePlayer_styled.StyledVideoPlayerLoading, {
116
- children: [jsxRuntime.jsx(blocks.Spinner, {}), jsxRuntime.jsx(blocks.Text, {
117
- role: "gray3",
118
- lineHeight: 1.5,
119
- textAlign: "center",
120
- preWrap: true,
121
- children: intl$1.formatMessage({
122
- id: 'videoFile.player.encoding'
123
- })
124
- })]
125
- });
126
- }
127
- // encoding failed
128
- if (materialVideoFileUploadStatus === VideoUploadStatus.EncodingFailed) {
129
- return jsxRuntime.jsx(MaterialVideoFilePlayer_styled.StyledVideoPlayerLoading, {
130
- children: jsxRuntime.jsx(blocks.Text, {
131
- role: "gray3",
132
- lineHeight: 1.5,
133
- textAlign: "center",
134
- preWrap: true,
135
- children: intl$1.formatMessage({
136
- id: 'videoFile.player.encodingFailed'
137
- })
138
- })
139
- });
140
- }
141
191
  // resolved
142
- return jsxRuntime.jsx(MaterialVideoFilePlayer_styled.StyledVideoPlayer, {
143
- className: classnames__default.default(prefixCls, className),
144
- orgNameShort: orgNameShort !== null && orgNameShort !== void 0 ? orgNameShort : '',
145
- materialVideoId: (_a = materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.id) !== null && _a !== void 0 ? _a : 0,
146
- linkedMaterialId: mainLecturePageId,
147
- lmsType: lms ? lmsOrganizationBusinessType !== null && lmsOrganizationBusinessType !== void 0 ? lmsOrganizationBusinessType : undefined : undefined,
148
- noAutoplay: !autoPlay,
149
- noAutoplayNext: !autoPlayNext,
150
- noEndControl: !endControl,
151
- noTracker: materialVideoFileTrackerDisabled,
152
- playerBaseUrl: eliceVideoPlayerUrl,
153
- otp: function otp() {
154
- return accountApi.auth.authOtpPost().then(function (res) {
155
- return res.otp;
156
- });
157
- },
158
- onLecturePageNavigate: function onLecturePageNavigate(dir) {
159
- if (dir === 'prev' && onNavigatePreviousLecturePage) {
160
- onNavigatePreviousLecturePage();
161
- } else if (dir === 'next' && onNavigateNextLecturePage) {
162
- onNavigateNextLecturePage();
163
- }
164
- },
165
- onTranscriptToggle: function onTranscriptToggle(enabled) {
166
- if (typeof _onTranscriptToggle === 'function') {
167
- _onTranscriptToggle(enabled);
168
- }
169
- }
192
+ return jsxRuntime.jsxs(MaterialVideoFilePlayer_styled.StyledVideoPlayerContainer, {
193
+ children: [renderVideoPlayer(), renderVideoPlayerOverlay()]
170
194
  });
171
- };
195
+ });
172
196
 
173
197
  exports.default = MaterialVideoFilePlayer;
@@ -1,5 +1,7 @@
1
1
  /// <reference types="react" />
2
- export declare const StyledVideoPlayer: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elice/intl").IntlComponentExtraProps & Omit<import("@elice/intl").IntlComponentExtraProps & Omit<import("@elice/videoplayer-client").EliceVideoplayerProps, keyof import("@elice/intl").IntlComponentExtraProps | "__intl"> & {
2
+ export declare const StyledVideoPlayer: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<Omit<import("@elice/intl").IntlComponentExtraProps & Omit<import("@elice/intl").IntlComponentExtraProps & Omit<import("@elice/videoplayer-client").EliceVideoplayerProps, keyof import("@elice/intl").IntlComponentExtraProps | "__intl"> & {
3
3
  __intl: import("@elice/intl").EliceIntlShape;
4
- }, keyof import("@elice/intl").IntlComponentExtraProps | "__intl"> & import("react").RefAttributes<any>>, any, {}, never>;
4
+ } & import("react").RefAttributes<import("@elice/videoplayer-client").EliceVideoplayerApis>, keyof import("@elice/intl").IntlComponentExtraProps | "__intl">, "ref"> & import("react").RefAttributes<import("@elice/videoplayer-client").EliceVideoplayerApis>>, any, {}, never>;
5
+ export declare const StyledVideoPlayerContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
5
6
  export declare const StyledVideoPlayerLoading: import("styled-components").StyledComponent<"div", any, {}, never>;
7
+ export declare const StyledVideoPlayerOverlay: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -10,9 +10,17 @@ var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
10
10
  var StyledVideoPlayer = styled__default.default(videoplayerClient.EliceVideoplayer).withConfig({
11
11
  componentId: "sc-1ocq3lp-0"
12
12
  })(["width:100%;height:100%;border:0;"]);
13
- var StyledVideoPlayerLoading = styled__default.default.div.withConfig({
13
+ var StyledVideoPlayerContainer = styled__default.default.div.withConfig({
14
14
  componentId: "sc-1ocq3lp-1"
15
+ })(["position:relative;width:100%;height:100%;"]);
16
+ var StyledVideoPlayerLoading = styled__default.default.div.withConfig({
17
+ componentId: "sc-1ocq3lp-2"
15
18
  })(["display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;height:100%;"]);
19
+ var StyledVideoPlayerOverlay = styled__default.default.div.withConfig({
20
+ componentId: "sc-1ocq3lp-3"
21
+ })(["position:absolute;top:0;left:0;width:100%;height:100%;background-color:#000;z-index:1;"]);
16
22
 
17
23
  exports.StyledVideoPlayer = StyledVideoPlayer;
24
+ exports.StyledVideoPlayerContainer = StyledVideoPlayerContainer;
18
25
  exports.StyledVideoPlayerLoading = StyledVideoPlayerLoading;
26
+ exports.StyledVideoPlayerOverlay = StyledVideoPlayerOverlay;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { WithIntlComponentBuilderProps } from '@elice/intl';
2
+ import type { EliceVideoplayerApis } from '@elice/videoplayer-client';
3
3
  import type { MaterialVideoFilePlayerProps } from './MaterialVideoFilePlayer';
4
4
  import type { UseMaterialVideoFileApiProps } from './useMaterialVideoFileApi';
5
5
  type PickedVideoPlayerProps = Pick<MaterialVideoFilePlayerProps, 'materialVideoFileTrackerDisabled' | 'mainLecturePageId' | 'lms' | 'lmsOrganizationBusinessType' | 'emptyComponent' | 'autoPlay' | 'autoPlayNext' | 'endControl' | 'eliceVideoPlayerUrl' | 'onNavigatePreviousLecturePage' | 'onNavigateNextLecturePage' | 'onTranscriptToggle'>;
@@ -7,5 +7,7 @@ export interface MaterialVideoFileProps extends PickedVideoPlayerProps, UseMater
7
7
  materialVideoFileId: number;
8
8
  className?: string;
9
9
  }
10
- declare const _default: React.ForwardRefExoticComponent<import("@elice/intl").IntlComponentExtraProps & Omit<WithIntlComponentBuilderProps<MaterialVideoFileProps>, keyof import("@elice/intl").IntlComponentExtraProps | "__intl"> & React.RefAttributes<any>>;
10
+ declare const _default: React.ForwardRefExoticComponent<Omit<import("@elice/intl").IntlComponentExtraProps & Omit<import("@elice/intl").IntlComponentExtraProps & Omit<MaterialVideoFileProps, keyof import("@elice/intl").IntlComponentExtraProps | "__intl"> & {
11
+ __intl: import("@elice/intl").EliceIntlShape;
12
+ } & React.RefAttributes<EliceVideoplayerApis>, keyof import("@elice/intl").IntlComponentExtraProps | "__intl">, "ref"> & React.RefAttributes<EliceVideoplayerApis>>;
11
13
  export default _default;
@@ -1,8 +1,8 @@
1
1
  import { __rest } from 'tslib';
2
2
  import { jsx } from 'react/jsx-runtime';
3
- import React from 'react';
3
+ import React, { forwardRef } from 'react';
4
4
  import { getOrgMaterialVideoFileGet, config } from '@elice/api-client';
5
- import { IntlComponentBuilder, RawEliceIntlProvider } from '@elice/intl';
5
+ import { RawEliceIntlProvider, IntlComponentBuilder } from '@elice/intl';
6
6
  import { useMaterialConfig, useMaterialFetch } from '@elice/material-shared-utils';
7
7
  import { enums } from '@elice/types';
8
8
  import classnames from 'classnames';
@@ -15,7 +15,7 @@ import { StyledMaterialVideoFileWrap } from './MaterialVideoFile.styled.js';
15
15
  //
16
16
  //
17
17
  //
18
- var MaterialVideoFile = function MaterialVideoFile(_a) {
18
+ var MaterialVideoFile = forwardRef(function (_a, ref) {
19
19
  var _b, _c, _d, _e;
20
20
  var materialVideoFileId = _a.materialVideoFileId,
21
21
  className = _a.className,
@@ -50,11 +50,12 @@ var MaterialVideoFile = function MaterialVideoFile(_a) {
50
50
  materialVideoFile: materialVideoFile !== null && materialVideoFile !== void 0 ? materialVideoFile : null,
51
51
  materialVideoFileStatus: materialVideoFileStatus,
52
52
  accountApi: accountApi,
53
- title: (_e = (_c = (_b = materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.cloudflareStream) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : (_d = materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.azureMediaVideo) === null || _d === void 0 ? void 0 : _d.videoAssetName) !== null && _e !== void 0 ? _e : undefined
53
+ title: (_e = (_c = (_b = materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.cloudflareStream) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : (_d = materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.azureMediaVideo) === null || _d === void 0 ? void 0 : _d.videoAssetName) !== null && _e !== void 0 ? _e : undefined,
54
+ ref: ref
54
55
  }))
55
56
  })
56
57
  });
57
- };
58
+ });
58
59
  var MaterialVideoFile$1 = new IntlComponentBuilder(MaterialVideoFile).add('en', messageEn).add('ko', messageKo).addAsync('th', import('./locales/th.json.js')).addAsync('ja', import('./locales/ja.json.js')).build();
59
60
 
60
61
  export { MaterialVideoFile$1 as default };
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { APIStatus } from '@elice/material-shared-types';
3
3
  import type { EliceVideoPlayerSearchParams, GetOrgMaterialVideoFileGetResponses } from '@elice/types';
4
+ import type { EliceVideoplayerApis } from '@elice/videoplayer-client';
4
5
  import type { UseMaterialVideoFileApiReturn } from './useMaterialVideoFileApi';
5
6
  export interface MaterialVideoFilePlayerProps extends UseMaterialVideoFileApiReturn {
6
7
  /** Classname for the element. */
@@ -41,5 +42,5 @@ export interface MaterialVideoFilePlayerProps extends UseMaterialVideoFileApiRet
41
42
  /** Toggle transcript. */
42
43
  onTranscriptToggle?: (enabled: boolean) => void;
43
44
  }
44
- declare const MaterialVideoFilePlayer: React.FC<MaterialVideoFilePlayerProps>;
45
+ declare const MaterialVideoFilePlayer: React.ForwardRefExoticComponent<MaterialVideoFilePlayerProps & React.RefAttributes<EliceVideoplayerApis>>;
45
46
  export default MaterialVideoFilePlayer;
@@ -1,10 +1,10 @@
1
- import { jsx, jsxs } from 'react/jsx-runtime';
2
- import React from 'react';
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import React, { forwardRef } from 'react';
3
3
  import { Spinner, Text } from '@elice/blocks';
4
4
  import { useRawEliceIntl } from '@elice/intl';
5
5
  import { enums } from '@elice/types';
6
6
  import classnames from 'classnames';
7
- import { StyledVideoPlayerLoading, StyledVideoPlayer } from './MaterialVideoFilePlayer.styled.js';
7
+ import { StyledVideoPlayerContainer, StyledVideoPlayerOverlay, StyledVideoPlayer, StyledVideoPlayerLoading } from './MaterialVideoFilePlayer.styled.js';
8
8
 
9
9
  //
10
10
  //
@@ -19,7 +19,7 @@ var VideoUploadStatus;
19
19
  //
20
20
  //
21
21
  //
22
- var MaterialVideoFilePlayer = function MaterialVideoFilePlayer(_ref) {
22
+ var MaterialVideoFilePlayer = forwardRef(function (_ref, ref) {
23
23
  var className = _ref.className,
24
24
  materialVideoFile = _ref.materialVideoFile,
25
25
  _ref$materialVideoFil = _ref.materialVideoFileStatus,
@@ -45,7 +45,6 @@ var MaterialVideoFilePlayer = function MaterialVideoFilePlayer(_ref) {
45
45
  onNavigateNextLecturePage = _ref.onNavigateNextLecturePage,
46
46
  _onTranscriptToggle = _ref.onTranscriptToggle,
47
47
  accountApi = _ref.accountApi;
48
- var _a;
49
48
  var prefixCls = 'em-video-player';
50
49
  var intl = useRawEliceIntl();
51
50
  /**
@@ -86,79 +85,104 @@ var MaterialVideoFilePlayer = function MaterialVideoFilePlayer(_ref) {
86
85
  return VideoUploadStatus.Empty;
87
86
  }
88
87
  }, [materialVideoFile]);
88
+ /**
89
+ *
90
+ */
91
+ var renderVideoPlayerOverlayContent = function renderVideoPlayerOverlayContent() {
92
+ // pending
93
+ if (materialVideoFileStatus === 'idle' || materialVideoFileStatus === 'pending') {
94
+ return jsx(StyledVideoPlayerLoading, {
95
+ children: jsx(Spinner, {})
96
+ });
97
+ }
98
+ // rejected / empty video
99
+ if (materialVideoFileStatus === 'rejected' || materialVideoFileUploadStatus === VideoUploadStatus.Empty) {
100
+ return jsx(React.Fragment, {
101
+ children: emptyComponent
102
+ });
103
+ }
104
+ // encoding
105
+ if (materialVideoFileUploadStatus === VideoUploadStatus.Encoding) {
106
+ return jsxs(StyledVideoPlayerLoading, {
107
+ children: [jsx(Spinner, {}), jsx(Text, {
108
+ role: "gray3",
109
+ lineHeight: 1.5,
110
+ textAlign: "center",
111
+ preWrap: true,
112
+ children: intl.formatMessage({
113
+ id: 'videoFile.player.encoding'
114
+ })
115
+ })]
116
+ });
117
+ }
118
+ // encoding failed
119
+ if (materialVideoFileUploadStatus === VideoUploadStatus.EncodingFailed) {
120
+ return jsx(StyledVideoPlayerLoading, {
121
+ children: jsx(Text, {
122
+ role: "gray3",
123
+ lineHeight: 1.5,
124
+ textAlign: "center",
125
+ preWrap: true,
126
+ children: intl.formatMessage({
127
+ id: 'videoFile.player.encodingFailed'
128
+ })
129
+ })
130
+ });
131
+ }
132
+ return null;
133
+ };
134
+ /**
135
+ *
136
+ */
137
+ var renderVideoPlayerOverlay = function renderVideoPlayerOverlay() {
138
+ var content = renderVideoPlayerOverlayContent();
139
+ return content ? jsx(StyledVideoPlayerOverlay, {
140
+ children: content
141
+ }) : null;
142
+ };
143
+ /**
144
+ *
145
+ */
146
+ var renderVideoPlayer = function renderVideoPlayer() {
147
+ var _a;
148
+ return jsx(StyledVideoPlayer, {
149
+ className: classnames(prefixCls, className),
150
+ orgNameShort: orgNameShort !== null && orgNameShort !== void 0 ? orgNameShort : '',
151
+ materialVideoId: (_a = materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.id) !== null && _a !== void 0 ? _a : 0,
152
+ linkedMaterialId: mainLecturePageId,
153
+ lmsType: lms ? lmsOrganizationBusinessType !== null && lmsOrganizationBusinessType !== void 0 ? lmsOrganizationBusinessType : undefined : undefined,
154
+ noAutoplay: !autoPlay,
155
+ noAutoplayNext: !autoPlayNext,
156
+ noEndControl: !endControl,
157
+ noTracker: materialVideoFileTrackerDisabled,
158
+ playerBaseUrl: eliceVideoPlayerUrl,
159
+ otp: function otp() {
160
+ return accountApi.auth.authOtpPost().then(function (res) {
161
+ return res.otp;
162
+ });
163
+ },
164
+ onLecturePageNavigate: function onLecturePageNavigate(dir) {
165
+ if (dir === 'prev' && onNavigatePreviousLecturePage) {
166
+ onNavigatePreviousLecturePage();
167
+ } else if (dir === 'next' && onNavigateNextLecturePage) {
168
+ onNavigateNextLecturePage();
169
+ }
170
+ },
171
+ onTranscriptToggle: function onTranscriptToggle(enabled) {
172
+ if (typeof _onTranscriptToggle === 'function') {
173
+ _onTranscriptToggle(enabled);
174
+ }
175
+ },
176
+ ref: ref
177
+ });
178
+ };
89
179
  //
90
180
  //
91
181
  //
92
- // pending
93
- if (materialVideoFileStatus === 'idle' || materialVideoFileStatus === 'pending') {
94
- return jsx(StyledVideoPlayerLoading, {
95
- children: jsx(Spinner, {})
96
- });
97
- }
98
- // rejected / empty video
99
- if (materialVideoFileStatus === 'rejected' || materialVideoFileUploadStatus === VideoUploadStatus.Empty) {
100
- return jsx(React.Fragment, {
101
- children: emptyComponent
102
- });
103
- }
104
- // encoding
105
- if (materialVideoFileUploadStatus === VideoUploadStatus.Encoding) {
106
- return jsxs(StyledVideoPlayerLoading, {
107
- children: [jsx(Spinner, {}), jsx(Text, {
108
- role: "gray3",
109
- lineHeight: 1.5,
110
- textAlign: "center",
111
- preWrap: true,
112
- children: intl.formatMessage({
113
- id: 'videoFile.player.encoding'
114
- })
115
- })]
116
- });
117
- }
118
- // encoding failed
119
- if (materialVideoFileUploadStatus === VideoUploadStatus.EncodingFailed) {
120
- return jsx(StyledVideoPlayerLoading, {
121
- children: jsx(Text, {
122
- role: "gray3",
123
- lineHeight: 1.5,
124
- textAlign: "center",
125
- preWrap: true,
126
- children: intl.formatMessage({
127
- id: 'videoFile.player.encodingFailed'
128
- })
129
- })
130
- });
131
- }
132
182
  // resolved
133
- return jsx(StyledVideoPlayer, {
134
- className: classnames(prefixCls, className),
135
- orgNameShort: orgNameShort !== null && orgNameShort !== void 0 ? orgNameShort : '',
136
- materialVideoId: (_a = materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.id) !== null && _a !== void 0 ? _a : 0,
137
- linkedMaterialId: mainLecturePageId,
138
- lmsType: lms ? lmsOrganizationBusinessType !== null && lmsOrganizationBusinessType !== void 0 ? lmsOrganizationBusinessType : undefined : undefined,
139
- noAutoplay: !autoPlay,
140
- noAutoplayNext: !autoPlayNext,
141
- noEndControl: !endControl,
142
- noTracker: materialVideoFileTrackerDisabled,
143
- playerBaseUrl: eliceVideoPlayerUrl,
144
- otp: function otp() {
145
- return accountApi.auth.authOtpPost().then(function (res) {
146
- return res.otp;
147
- });
148
- },
149
- onLecturePageNavigate: function onLecturePageNavigate(dir) {
150
- if (dir === 'prev' && onNavigatePreviousLecturePage) {
151
- onNavigatePreviousLecturePage();
152
- } else if (dir === 'next' && onNavigateNextLecturePage) {
153
- onNavigateNextLecturePage();
154
- }
155
- },
156
- onTranscriptToggle: function onTranscriptToggle(enabled) {
157
- if (typeof _onTranscriptToggle === 'function') {
158
- _onTranscriptToggle(enabled);
159
- }
160
- }
183
+ return jsxs(StyledVideoPlayerContainer, {
184
+ children: [renderVideoPlayer(), renderVideoPlayerOverlay()]
161
185
  });
162
- };
186
+ });
163
187
 
164
188
  export { MaterialVideoFilePlayer as default };
@@ -1,5 +1,7 @@
1
1
  /// <reference types="react" />
2
- export declare const StyledVideoPlayer: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elice/intl").IntlComponentExtraProps & Omit<import("@elice/intl").IntlComponentExtraProps & Omit<import("@elice/videoplayer-client").EliceVideoplayerProps, keyof import("@elice/intl").IntlComponentExtraProps | "__intl"> & {
2
+ export declare const StyledVideoPlayer: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<Omit<import("@elice/intl").IntlComponentExtraProps & Omit<import("@elice/intl").IntlComponentExtraProps & Omit<import("@elice/videoplayer-client").EliceVideoplayerProps, keyof import("@elice/intl").IntlComponentExtraProps | "__intl"> & {
3
3
  __intl: import("@elice/intl").EliceIntlShape;
4
- }, keyof import("@elice/intl").IntlComponentExtraProps | "__intl"> & import("react").RefAttributes<any>>, any, {}, never>;
4
+ } & import("react").RefAttributes<import("@elice/videoplayer-client").EliceVideoplayerApis>, keyof import("@elice/intl").IntlComponentExtraProps | "__intl">, "ref"> & import("react").RefAttributes<import("@elice/videoplayer-client").EliceVideoplayerApis>>, any, {}, never>;
5
+ export declare const StyledVideoPlayerContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
5
6
  export declare const StyledVideoPlayerLoading: import("styled-components").StyledComponent<"div", any, {}, never>;
7
+ export declare const StyledVideoPlayerOverlay: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -4,8 +4,14 @@ import styled from 'styled-components';
4
4
  var StyledVideoPlayer = styled(EliceVideoplayer).withConfig({
5
5
  componentId: "sc-1ocq3lp-0"
6
6
  })(["width:100%;height:100%;border:0;"]);
7
- var StyledVideoPlayerLoading = styled.div.withConfig({
7
+ var StyledVideoPlayerContainer = styled.div.withConfig({
8
8
  componentId: "sc-1ocq3lp-1"
9
+ })(["position:relative;width:100%;height:100%;"]);
10
+ var StyledVideoPlayerLoading = styled.div.withConfig({
11
+ componentId: "sc-1ocq3lp-2"
9
12
  })(["display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;height:100%;"]);
13
+ var StyledVideoPlayerOverlay = styled.div.withConfig({
14
+ componentId: "sc-1ocq3lp-3"
15
+ })(["position:absolute;top:0;left:0;width:100%;height:100%;background-color:#000;z-index:1;"]);
10
16
 
11
- export { StyledVideoPlayer, StyledVideoPlayerLoading };
17
+ export { StyledVideoPlayer, StyledVideoPlayerContainer, StyledVideoPlayerLoading, StyledVideoPlayerOverlay };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elice/material-video-file",
3
- "version": "1.250828.0",
3
+ "version": "1.250904.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",
@@ -50,12 +50,12 @@
50
50
  "@elice/icons": "^1.230814.0",
51
51
  "@elice/icons-legacy": "npm:@elice/icons@0.230814.0",
52
52
  "@elice/intl": "0.241127.0",
53
- "@elice/material-shared-types": "1.250828.0",
54
- "@elice/material-shared-utils": "1.250828.0",
53
+ "@elice/material-shared-types": "1.250904.0",
54
+ "@elice/material-shared-utils": "1.250904.0",
55
55
  "@elice/messenger": "^1.240426.0",
56
56
  "@elice/openapi-client-account": "^1.230814.0",
57
57
  "@elice/types": "^1.250612.0-teamleaderboard.1",
58
- "@elice/videoplayer-client": "^2.240717.0-transcript.0",
58
+ "@elice/videoplayer-client": "^2.250903.1",
59
59
  "@types/classnames": "^2.3.1",
60
60
  "@types/query-string": "^6.3.0",
61
61
  "@types/react": "~17.0.9",