@elice/material-video-file 1.240614.0-cloudflare.2 → 1.240614.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.
@@ -19,7 +19,7 @@ var MaterialVideoFile_styled = require('./MaterialVideoFile.styled.js');
19
19
  //
20
20
  //
21
21
  const MaterialVideoFile = _a => {
22
- var _b, _c, _d, _e;
22
+ var _b, _c;
23
23
  var {
24
24
  materialVideoFileId,
25
25
  className,
@@ -56,7 +56,7 @@ const MaterialVideoFile = _a => {
56
56
  materialVideoFile: materialVideoFile !== null && materialVideoFile !== void 0 ? materialVideoFile : null,
57
57
  materialVideoFileStatus: materialVideoFileStatus,
58
58
  accountApi: accountApi,
59
- 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
59
+ title: (_c = (_b = materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.azureMediaVideo) === null || _b === void 0 ? void 0 : _b.videoAssetName) !== null && _c !== void 0 ? _c : undefined
60
60
  }))));
61
61
  };
62
62
  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();
@@ -63,36 +63,16 @@ const MaterialVideoFilePlayer = ({
63
63
  * Current video status.
64
64
  */
65
65
  const materialVideoFileUploadStatus = React.useMemo(() => {
66
- var _a, _b, _c;
67
- // empty
68
- if (typeof ((_a = materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.cloudflareStream) === null || _a === void 0 ? void 0 : _a.status) === 'undefined' && typeof ((_b = materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.azureMediaVideo) === null || _b === void 0 ? void 0 : _b.status) === 'undefined') {
69
- return VideoUploadStatus.Empty;
70
- }
71
- //
72
- // Cloudflare Stream
73
- //
74
- if (materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.cloudflareStream) {
75
- switch (materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.cloudflareStream.status) {
76
- case types.enums.CloudflareStreamStatus.Uploaded:
77
- return VideoUploadStatus.Encoding;
78
- case types.enums.CloudflareStreamStatus.EncodeFailed:
79
- return VideoUploadStatus.EncodingFailed;
80
- case types.enums.CloudflareStreamStatus.Encoded:
81
- return typeof materialVideoFile.cloudflareStream.downloadUrl === 'string' ? VideoUploadStatus.Ready : VideoUploadStatus.Empty;
82
- default:
83
- return VideoUploadStatus.Empty;
84
- }
85
- }
86
- //
87
- // Azure Media Video
88
- //
89
- switch ((_c = materialVideoFile.azureMediaVideo) === null || _c === void 0 ? void 0 : _c.status) {
90
- case types.enums.AzureMediaVideoStatus.Encoding:
66
+ var _a, _b, _c, _d;
67
+ switch (true) {
68
+ case typeof ((_a = materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.azureMediaVideo) === null || _a === void 0 ? void 0 : _a.status) === 'undefined':
69
+ return VideoUploadStatus.Empty;
70
+ case ((_b = materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.azureMediaVideo) === null || _b === void 0 ? void 0 : _b.status) === types.enums.AzureMediaVideoStatus.Encoding:
91
71
  return VideoUploadStatus.Encoding;
92
- case types.enums.AzureMediaVideoStatus.Error:
72
+ case ((_c = materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.azureMediaVideo) === null || _c === void 0 ? void 0 : _c.status) === types.enums.AzureMediaVideoStatus.Error:
93
73
  return VideoUploadStatus.EncodingFailed;
94
- case types.enums.AzureMediaVideoStatus.Done:
95
- return typeof materialVideoFile.azureMediaVideo.videoStreamingUrl === 'string' ? VideoUploadStatus.Ready : VideoUploadStatus.Empty;
74
+ case ((_d = materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.azureMediaVideo) === null || _d === void 0 ? void 0 : _d.status) === types.enums.AzureMediaVideoStatus.Done && typeof materialVideoFile.azureMediaVideo.videoStreamingUrl === 'string':
75
+ return VideoUploadStatus.Ready;
96
76
  default:
97
77
  return VideoUploadStatus.Empty;
98
78
  }
@@ -15,7 +15,7 @@ import { StyledMaterialVideoFileWrap } from './MaterialVideoFile.styled.js';
15
15
  //
16
16
  //
17
17
  const MaterialVideoFile = _a => {
18
- var _b, _c, _d, _e;
18
+ var _b, _c;
19
19
  var {
20
20
  materialVideoFileId,
21
21
  className,
@@ -52,7 +52,7 @@ const MaterialVideoFile = _a => {
52
52
  materialVideoFile: materialVideoFile !== null && materialVideoFile !== void 0 ? materialVideoFile : null,
53
53
  materialVideoFileStatus: materialVideoFileStatus,
54
54
  accountApi: accountApi,
55
- 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
55
+ title: (_c = (_b = materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.azureMediaVideo) === null || _b === void 0 ? void 0 : _b.videoAssetName) !== null && _c !== void 0 ? _c : undefined
56
56
  }))));
57
57
  };
58
58
  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,36 +59,16 @@ const MaterialVideoFilePlayer = ({
59
59
  * Current video status.
60
60
  */
61
61
  const materialVideoFileUploadStatus = React.useMemo(() => {
62
- var _a, _b, _c;
63
- // empty
64
- if (typeof ((_a = materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.cloudflareStream) === null || _a === void 0 ? void 0 : _a.status) === 'undefined' && typeof ((_b = materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.azureMediaVideo) === null || _b === void 0 ? void 0 : _b.status) === 'undefined') {
65
- return VideoUploadStatus.Empty;
66
- }
67
- //
68
- // Cloudflare Stream
69
- //
70
- if (materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.cloudflareStream) {
71
- switch (materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.cloudflareStream.status) {
72
- case enums.CloudflareStreamStatus.Uploaded:
73
- return VideoUploadStatus.Encoding;
74
- case enums.CloudflareStreamStatus.EncodeFailed:
75
- return VideoUploadStatus.EncodingFailed;
76
- case enums.CloudflareStreamStatus.Encoded:
77
- return typeof materialVideoFile.cloudflareStream.downloadUrl === 'string' ? VideoUploadStatus.Ready : VideoUploadStatus.Empty;
78
- default:
79
- return VideoUploadStatus.Empty;
80
- }
81
- }
82
- //
83
- // Azure Media Video
84
- //
85
- switch ((_c = materialVideoFile.azureMediaVideo) === null || _c === void 0 ? void 0 : _c.status) {
86
- case enums.AzureMediaVideoStatus.Encoding:
62
+ var _a, _b, _c, _d;
63
+ switch (true) {
64
+ case typeof ((_a = materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.azureMediaVideo) === null || _a === void 0 ? void 0 : _a.status) === 'undefined':
65
+ return VideoUploadStatus.Empty;
66
+ case ((_b = materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.azureMediaVideo) === null || _b === void 0 ? void 0 : _b.status) === enums.AzureMediaVideoStatus.Encoding:
87
67
  return VideoUploadStatus.Encoding;
88
- case enums.AzureMediaVideoStatus.Error:
68
+ case ((_c = materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.azureMediaVideo) === null || _c === void 0 ? void 0 : _c.status) === enums.AzureMediaVideoStatus.Error:
89
69
  return VideoUploadStatus.EncodingFailed;
90
- case enums.AzureMediaVideoStatus.Done:
91
- return typeof materialVideoFile.azureMediaVideo.videoStreamingUrl === 'string' ? VideoUploadStatus.Ready : VideoUploadStatus.Empty;
70
+ case ((_d = materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.azureMediaVideo) === null || _d === void 0 ? void 0 : _d.status) === enums.AzureMediaVideoStatus.Done && typeof materialVideoFile.azureMediaVideo.videoStreamingUrl === 'string':
71
+ return VideoUploadStatus.Ready;
92
72
  default:
93
73
  return VideoUploadStatus.Empty;
94
74
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elice/material-video-file",
3
- "version": "1.240614.0-cloudflare.2",
3
+ "version": "1.240614.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",
@@ -44,16 +44,16 @@
44
44
  "tslib": "^2.6.1"
45
45
  },
46
46
  "devDependencies": {
47
- "@elice/api-client": "1.240612.0-cloudflare.0",
47
+ "@elice/api-client": "^1.230815.0",
48
48
  "@elice/blocks": "^1.240514.0",
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
52
  "@elice/intl": "0.240425.0-rc.2",
53
- "@elice/material-shared-types": "1.240614.0-cloudflare.0",
54
- "@elice/material-shared-utils": "1.240614.0-cloudflare.0",
53
+ "@elice/material-shared-types": "1.240614.0",
54
+ "@elice/material-shared-utils": "1.240614.0",
55
55
  "@elice/openapi-client-account": "^1.230814.0",
56
- "@elice/types": "1.240527.0-cloudflare.3",
56
+ "@elice/types": "^1.240208.0",
57
57
  "@types/classnames": "^2.3.1",
58
58
  "@types/query-string": "^6.3.0",
59
59
  "@types/react": "~17.0.9",
@@ -62,5 +62,5 @@
62
62
  "react-use": "^17.2.4",
63
63
  "styled-components": "^5.3.0"
64
64
  },
65
- "gitHead": "9aa8bc15db4cc1448be55b3e8be5d540cedb67d2"
65
+ "gitHead": "129db3c8074dd01f6949eb115bfc4f2f13c68f29"
66
66
  }