File tree Expand file tree Collapse file tree 1 file changed +4
-17
lines changed
src/renderer/routes/editor Expand file tree Collapse file tree 1 file changed +4
-17
lines changed Original file line number Diff line number Diff line change @@ -84,22 +84,9 @@ let SimpleEditor = () => {
84
84
setSubs ( prev ) ;
85
85
} ;
86
86
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 } ` ) ;
103
90
} ;
104
91
105
92
let convertSecondsToTimestamp = ( seconds ) => {
@@ -666,7 +653,7 @@ let SimpleEditor = () => {
666
653
Note that the file needs to already be trimmed to the
667
654
length you want it.
668
655
</ p >
669
- < input type = "file" accept = ".mp4" onChange = { onFileOpen } / >
656
+ < button onClick = { onFileOpen } > Open Video </ button >
670
657
< Link to = "/" >
671
658
< button type = "button" > Cancel</ button >
672
659
</ Link >
You can’t perform that action at this time.
0 commit comments