@elice/material-video-file 1.240614.0-cloudflare.0 → 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.
@@ -56,7 +56,6 @@ const MaterialVideoFile = _a => {
56
56
  materialVideoFile: materialVideoFile !== null && materialVideoFile !== void 0 ? materialVideoFile : null,
57
57
  materialVideoFileStatus: materialVideoFileStatus,
58
58
  accountApi: accountApi,
59
- // TODO: change to cloudflareStream
60
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
61
60
  }))));
62
61
  };
@@ -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
  }
@@ -52,7 +52,6 @@ const MaterialVideoFile = _a => {
52
52
  materialVideoFile: materialVideoFile !== null && materialVideoFile !== void 0 ? materialVideoFile : null,
53
53
  materialVideoFileStatus: materialVideoFileStatus,
54
54
  accountApi: accountApi,
55
- // TODO: change to cloudflareStream
56
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
57
56
  }))));
58
57
  };
@@ -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.0",
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.2",
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": "5bbe89e1c936c1a1027482b3840f7fa9763ccdb9"
65
+ "gitHead": "129db3c8074dd01f6949eb115bfc4f2f13c68f29"
66
66
  }