@seafile/sdoc-editor 1.0.206-test0.1.6 → 1.0.206-test0.1.8
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.
|
@@ -61,6 +61,7 @@ const InsertElementDialog = _ref => {
|
|
|
61
61
|
}, []);
|
|
62
62
|
const onVideoFileChanged = (0, _react.useCallback)(event => {
|
|
63
63
|
const files = event.target.files;
|
|
64
|
+
console.log(files);
|
|
64
65
|
// Show warning for 3s and no further insertion if video file is more than 5MB
|
|
65
66
|
if (files[0].size > _index5.VIDEO_MAX_SIZE_5MB) {
|
|
66
67
|
handleDisplayAlert();
|
|
@@ -73,7 +73,9 @@ const SelectSdocFileDialog = _ref => {
|
|
|
73
73
|
const encodedUrl = encodeURI(url);
|
|
74
74
|
console.log(5, url, encodedUrl);
|
|
75
75
|
insertVideo && insertVideo(editor, {
|
|
76
|
-
videoFiles:
|
|
76
|
+
videoFiles: [{
|
|
77
|
+
name: fileInfo.name
|
|
78
|
+
}]
|
|
77
79
|
}, [encodedUrl]);
|
|
78
80
|
break;
|
|
79
81
|
default:
|
|
@@ -91,6 +93,11 @@ const SelectSdocFileDialog = _ref => {
|
|
|
91
93
|
|
|
92
94
|
// Insert video element in sdoc
|
|
93
95
|
if (dialogType === _constants.ELEMENT_TYPE.VIDEO) {
|
|
96
|
+
_context.default.getSeafileVideo(fileInfo.name).then(res => {
|
|
97
|
+
if (res.status === 200) {
|
|
98
|
+
console.log(5, res);
|
|
99
|
+
}
|
|
100
|
+
});
|
|
94
101
|
console.log(1, fileInfo);
|
|
95
102
|
insertFile(fileInfo);
|
|
96
103
|
closeDialog();
|
|
@@ -26,6 +26,7 @@ const Video = _ref => {
|
|
|
26
26
|
const [videoStates, setVideoStates] = (0, _react.useState)({});
|
|
27
27
|
const videoFileName = data.videoFiles && ((_data$videoFiles$ = data.videoFiles[0]) === null || _data$videoFiles$ === void 0 ? void 0 : _data$videoFiles$.name) || null;
|
|
28
28
|
const videoFileSize = data.videoFiles && ((_data$videoFiles$2 = data.videoFiles[0]) === null || _data$videoFiles$2 === void 0 ? void 0 : _data$videoFiles$2.size) || null;
|
|
29
|
+
console.log(55, (0, _helpers.getVideoURL)(data));
|
|
29
30
|
const handlePlay = () => {
|
|
30
31
|
setVideoStates(prev => ({
|
|
31
32
|
...prev,
|
package/dist/context.js
CHANGED
|
@@ -51,6 +51,15 @@ class Context {
|
|
|
51
51
|
return relative_path;
|
|
52
52
|
});
|
|
53
53
|
});
|
|
54
|
+
(0, _defineProperty2.default)(this, "getSeafileVideo", videoName => {
|
|
55
|
+
const docUuid = this.getSetting('docUuid');
|
|
56
|
+
return this.api.getSdocDownloadImageUrl(docUuid, videoName).then(res => {
|
|
57
|
+
const {
|
|
58
|
+
relative_path
|
|
59
|
+
} = res.data;
|
|
60
|
+
return relative_path;
|
|
61
|
+
});
|
|
62
|
+
});
|
|
54
63
|
this.settings = null;
|
|
55
64
|
this.sdocServerApi = null;
|
|
56
65
|
this.api = null;
|