diff options
author | lonkaars <loek@pipeframe.xyz> | 2021-07-24 16:55:07 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2021-07-24 16:55:07 +0200 |
commit | def71ea56c99873af04dadc1c0e801d42c406826 (patch) | |
tree | a083576cf451f6370c273d5d4586ac02aaa10998 /pages | |
parent | ff0609458ab50dd627b13b604f7c8c42af9a67b3 (diff) |
import net video saves in the cool new file format :tada:
Diffstat (limited to 'pages')
-rw-r--r-- | pages/editor.tsx | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/pages/editor.tsx b/pages/editor.tsx index 5a63cb4..b90ba7f 100644 --- a/pages/editor.tsx +++ b/pages/editor.tsx @@ -18,7 +18,7 @@ import KeybindSelector from '../components/keybindselector'; import PlaySkipIconAni from '../components/play-skip'; import Selection from '../components/selection'; import TimecodeInput from '../components/timeinput'; -import Project, { LocalVideo, VideoSources, VideoSourceType } from '../project'; +import Project, { arrayBufferToBase64, VideoSources, VideoSourceType } from '../project'; import timeline, { anySlide, clickThroughBehaviours, @@ -1064,7 +1064,7 @@ function DefaultSettings() { {(() => { if (!projectFile.video) return null; var SourceSettings = VideoSources.find(s => s.type == projectFile.video.type).settings; - return <SourceSettings settings={projectFile.video} />; + return <SourceSettings settings={projectFile.video} player={player} />; })()} </div> <div className={'section ' + (ready.timeline.value ? '' : 'disabled')}> @@ -1094,10 +1094,7 @@ function DefaultSettings() { global.update.refreshLiveTimeline.value(); global.ready.timeline.set(true); - player.loadVideo( - 'data:' + projectFile.video.mimetype + ';base64,' - + btoa(String.fromCharCode.apply(null, new Uint8Array(projectFile.video.source))), - ); + player.loadVideo(arrayBufferToBase64(projectFile.video.source, projectFile.video.mimetype)); global.ready.video.available.set(true); player.player.addEventListener( @@ -1124,11 +1121,7 @@ function DefaultSettings() { children='Download .prspr' startIcon={<DescriptionRoundedIcon />} onClick={async () => { - var vidSrc = player.player.src.split(';'); projectFile.loadProject(player.timeline); - projectFile.video = new LocalVideo(); - await projectFile.video.load(Uint8Array.from(atob(vidSrc[1].substr(7)), c => c.charCodeAt(0))); - projectFile.video.mimetype = vidSrc[0].substr(5); projectFile.saveProject(); projectFile.downloadProjectFile(); }} |