@elice/material-video-file 1.240618.0 → 1.240620.0-editorevent.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;
22
+ var _b, _c, _d, _e;
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: (_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
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
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();
@@ -47,16 +47,36 @@ const MaterialVideoFilePlayer = ({
47
47
  * Current video status.
48
48
  */
49
49
  const materialVideoFileUploadStatus = React.useMemo(() => {
50
- var _a, _b, _c, _d;
51
- switch (true) {
52
- case typeof ((_a = materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.azureMediaVideo) === null || _a === void 0 ? void 0 : _a.status) === 'undefined':
53
- return VideoUploadStatus.Empty;
54
- case ((_b = materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.azureMediaVideo) === null || _b === void 0 ? void 0 : _b.status) === types.enums.AzureMediaVideoStatus.Encoding:
50
+ var _a, _b, _c;
51
+ // empty
52
+ 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') {
53
+ return VideoUploadStatus.Empty;
54
+ }
55
+ //
56
+ // Cloudflare Stream
57
+ //
58
+ if (materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.cloudflareStream) {
59
+ switch (materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.cloudflareStream.status) {
60
+ case types.enums.CloudflareStreamStatus.Uploaded:
61
+ return VideoUploadStatus.Encoding;
62
+ case types.enums.CloudflareStreamStatus.EncodeFailed:
63
+ return VideoUploadStatus.EncodingFailed;
64
+ case types.enums.CloudflareStreamStatus.Encoded:
65
+ return typeof materialVideoFile.cloudflareStream.downloadUrl === 'string' ? VideoUploadStatus.Ready : VideoUploadStatus.Empty;
66
+ default:
67
+ return VideoUploadStatus.Empty;
68
+ }
69
+ }
70
+ //
71
+ // Azure Media Video
72
+ //
73
+ switch ((_c = materialVideoFile.azureMediaVideo) === null || _c === void 0 ? void 0 : _c.status) {
74
+ case types.enums.AzureMediaVideoStatus.Encoding:
55
75
  return VideoUploadStatus.Encoding;
56
- case ((_c = materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.azureMediaVideo) === null || _c === void 0 ? void 0 : _c.status) === types.enums.AzureMediaVideoStatus.Error:
76
+ case types.enums.AzureMediaVideoStatus.Error:
57
77
  return VideoUploadStatus.EncodingFailed;
58
- 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':
59
- return VideoUploadStatus.Ready;
78
+ case types.enums.AzureMediaVideoStatus.Done:
79
+ return typeof materialVideoFile.azureMediaVideo.videoStreamingUrl === 'string' ? VideoUploadStatus.Ready : VideoUploadStatus.Empty;
60
80
  default:
61
81
  return VideoUploadStatus.Empty;
62
82
  }
@@ -15,7 +15,7 @@ import { StyledMaterialVideoFileWrap } from './MaterialVideoFile.styled.js';
15
15
  //
16
16
  //
17
17
  const MaterialVideoFile = _a => {
18
- var _b, _c;
18
+ var _b, _c, _d, _e;
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: (_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
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
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();
@@ -43,16 +43,36 @@ const MaterialVideoFilePlayer = ({
43
43
  * Current video status.
44
44
  */
45
45
  const materialVideoFileUploadStatus = React.useMemo(() => {
46
- var _a, _b, _c, _d;
47
- switch (true) {
48
- case typeof ((_a = materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.azureMediaVideo) === null || _a === void 0 ? void 0 : _a.status) === 'undefined':
49
- return VideoUploadStatus.Empty;
50
- case ((_b = materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.azureMediaVideo) === null || _b === void 0 ? void 0 : _b.status) === enums.AzureMediaVideoStatus.Encoding:
46
+ var _a, _b, _c;
47
+ // empty
48
+ 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') {
49
+ return VideoUploadStatus.Empty;
50
+ }
51
+ //
52
+ // Cloudflare Stream
53
+ //
54
+ if (materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.cloudflareStream) {
55
+ switch (materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.cloudflareStream.status) {
56
+ case enums.CloudflareStreamStatus.Uploaded:
57
+ return VideoUploadStatus.Encoding;
58
+ case enums.CloudflareStreamStatus.EncodeFailed:
59
+ return VideoUploadStatus.EncodingFailed;
60
+ case enums.CloudflareStreamStatus.Encoded:
61
+ return typeof materialVideoFile.cloudflareStream.downloadUrl === 'string' ? VideoUploadStatus.Ready : VideoUploadStatus.Empty;
62
+ default:
63
+ return VideoUploadStatus.Empty;
64
+ }
65
+ }
66
+ //
67
+ // Azure Media Video
68
+ //
69
+ switch ((_c = materialVideoFile.azureMediaVideo) === null || _c === void 0 ? void 0 : _c.status) {
70
+ case enums.AzureMediaVideoStatus.Encoding:
51
71
  return VideoUploadStatus.Encoding;
52
- case ((_c = materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.azureMediaVideo) === null || _c === void 0 ? void 0 : _c.status) === enums.AzureMediaVideoStatus.Error:
72
+ case enums.AzureMediaVideoStatus.Error:
53
73
  return VideoUploadStatus.EncodingFailed;
54
- 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':
55
- return VideoUploadStatus.Ready;
74
+ case enums.AzureMediaVideoStatus.Done:
75
+ return typeof materialVideoFile.azureMediaVideo.videoStreamingUrl === 'string' ? VideoUploadStatus.Ready : VideoUploadStatus.Empty;
56
76
  default:
57
77
  return VideoUploadStatus.Empty;
58
78
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elice/material-video-file",
3
- "version": "1.240618.0",
3
+ "version": "1.240620.0-editorevent.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",
@@ -32,6 +32,7 @@
32
32
  "@elice/intl": "^0",
33
33
  "@elice/material-shared-types": "*",
34
34
  "@elice/material-shared-utils": "*",
35
+ "@elice/messenger": "^1",
35
36
  "@elice/openapi-client-account": "^1",
36
37
  "@elice/types": "^1",
37
38
  "@elice/videoplayer-client": "^2",
@@ -45,17 +46,17 @@
45
46
  "tslib": "^2.6.1"
46
47
  },
47
48
  "devDependencies": {
48
- "@elice/api-client": "^1.230815.0",
49
+ "@elice/api-client": "1.240619.0",
49
50
  "@elice/blocks": "^1.240514.0",
50
51
  "@elice/design-tokens": "^1.220803.0",
51
52
  "@elice/icons": "^1.230814.0",
52
53
  "@elice/icons-legacy": "npm:@elice/icons@0.230814.0",
53
54
  "@elice/intl": "0.240425.0-rc.2",
54
- "@elice/material-shared-types": "1.240618.0",
55
- "@elice/material-shared-utils": "1.240618.0",
55
+ "@elice/material-shared-types": "1.240620.0-editorevent.0",
56
+ "@elice/material-shared-utils": "1.240620.0-editorevent.0",
56
57
  "@elice/openapi-client-account": "^1.230814.0",
57
- "@elice/types": "^1.240208.0",
58
- "@elice/videoplayer-client": "^2.240618.0",
58
+ "@elice/types": "1.240619.0",
59
+ "@elice/videoplayer-client": "^2.240618.1",
59
60
  "@types/classnames": "^2.3.1",
60
61
  "@types/query-string": "^6.3.0",
61
62
  "@types/react": "~17.0.9",
@@ -64,5 +65,5 @@
64
65
  "react-use": "^17.2.4",
65
66
  "styled-components": "^5.3.0"
66
67
  },
67
- "gitHead": "63d4bb89b897e3f211035a7b3c7d8677ab43e4ff"
68
+ "gitHead": "d0b5976de6ea3217fe8472427c005fa77ae247fc"
68
69
  }