Skip to content

Commit 4c75131

Browse files
Updated simple editor
1 parent 6072d8e commit 4c75131

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

src/renderer/routes/editor/SimpleEditor.jsx

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -84,22 +84,9 @@ let SimpleEditor = () => {
8484
setSubs(prev);
8585
};
8686

87-
let onFileOpen = (e) => {
88-
let f = e.target.files[0];
89-
let fr = new FileReader();
90-
handleInterstitial(
91-
new Promise((resolve, reject) => {
92-
fr.onload = async () => {
93-
let url = await VideoAPI.storeTempVideo(fr.result, "clip");
94-
setVideoSource(url);
95-
resolve();
96-
};
97-
}),
98-
(isOpen) => {setInterstitialState({isOpen, message: "Loading video..."})}
99-
);
100-
101-
102-
fr.readAsArrayBuffer(f);
87+
let onFileOpen = async () => {
88+
let filePath = await VideoAPI.getVideoFile();
89+
setVideoSource(`localfile://${filePath}`);
10390
};
10491

10592
let convertSecondsToTimestamp = (seconds) => {
@@ -666,7 +653,7 @@ let SimpleEditor = () => {
666653
Note that the file needs to already be trimmed to the
667654
length you want it.
668655
</p>
669-
<input type="file" accept=".mp4" onChange={onFileOpen} />
656+
<button onClick={onFileOpen}>Open Video</button>
670657
<Link to="/">
671658
<button type="button">Cancel</button>
672659
</Link>

0 commit comments

Comments
 (0)