@elice/material-video-file 1.240612.0 → 1.240614.0-cloudflare.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 +1 -0
- package/cjs/components/material-video-file/MaterialVideoFilePlayer.js +28 -8
- package/es/components/material-video-file/MaterialVideoFile.js +1 -0
- package/es/components/material-video-file/MaterialVideoFilePlayer.js +28 -8
- package/package.json +6 -6
|
@@ -56,6 +56,7 @@ 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
|
|
59
60
|
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
61
|
}))));
|
|
61
62
|
};
|
|
@@ -63,16 +63,36 @@ const MaterialVideoFilePlayer = ({
|
|
|
63
63
|
* Current video status.
|
|
64
64
|
*/
|
|
65
65
|
const materialVideoFileUploadStatus = React.useMemo(() => {
|
|
66
|
-
var _a, _b, _c
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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:
|
|
71
91
|
return VideoUploadStatus.Encoding;
|
|
72
|
-
case
|
|
92
|
+
case types.enums.AzureMediaVideoStatus.Error:
|
|
73
93
|
return VideoUploadStatus.EncodingFailed;
|
|
74
|
-
case
|
|
75
|
-
return VideoUploadStatus.Ready;
|
|
94
|
+
case types.enums.AzureMediaVideoStatus.Done:
|
|
95
|
+
return typeof materialVideoFile.azureMediaVideo.videoStreamingUrl === 'string' ? VideoUploadStatus.Ready : VideoUploadStatus.Empty;
|
|
76
96
|
default:
|
|
77
97
|
return VideoUploadStatus.Empty;
|
|
78
98
|
}
|
|
@@ -52,6 +52,7 @@ 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
|
|
55
56
|
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
57
|
}))));
|
|
57
58
|
};
|
|
@@ -59,16 +59,36 @@ const MaterialVideoFilePlayer = ({
|
|
|
59
59
|
* Current video status.
|
|
60
60
|
*/
|
|
61
61
|
const materialVideoFileUploadStatus = React.useMemo(() => {
|
|
62
|
-
var _a, _b, _c
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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:
|
|
67
87
|
return VideoUploadStatus.Encoding;
|
|
68
|
-
case
|
|
88
|
+
case enums.AzureMediaVideoStatus.Error:
|
|
69
89
|
return VideoUploadStatus.EncodingFailed;
|
|
70
|
-
case
|
|
71
|
-
return VideoUploadStatus.Ready;
|
|
90
|
+
case enums.AzureMediaVideoStatus.Done:
|
|
91
|
+
return typeof materialVideoFile.azureMediaVideo.videoStreamingUrl === 'string' ? VideoUploadStatus.Ready : VideoUploadStatus.Empty;
|
|
72
92
|
default:
|
|
73
93
|
return VideoUploadStatus.Empty;
|
|
74
94
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elice/material-video-file",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.240614.0-cloudflare.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": "
|
|
47
|
+
"@elice/api-client": "1.240612.0-cloudflare.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.
|
|
54
|
-
"@elice/material-shared-utils": "1.
|
|
53
|
+
"@elice/material-shared-types": "1.240614.0-cloudflare.0",
|
|
54
|
+
"@elice/material-shared-utils": "1.240614.0-cloudflare.0",
|
|
55
55
|
"@elice/openapi-client-account": "^1.230814.0",
|
|
56
|
-
"@elice/types": "
|
|
56
|
+
"@elice/types": "1.240527.0-cloudflare.2",
|
|
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": "
|
|
65
|
+
"gitHead": "5bbe89e1c936c1a1027482b3840f7fa9763ccdb9"
|
|
66
66
|
}
|