From bba9a3cb8648ca865ca0c32565e66b48b9ab6f5a Mon Sep 17 00:00:00 2001 From: lonkaars Date: Wed, 21 Jul 2021 20:13:59 +0200 Subject: project file beginnings --- pages/editor.tsx | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'pages') diff --git a/pages/editor.tsx b/pages/editor.tsx index 9460605..47402ec 100644 --- a/pages/editor.tsx +++ b/pages/editor.tsx @@ -17,6 +17,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 } from '../project'; import timeline, { anySlide, clickThroughBehaviours, @@ -545,7 +546,7 @@ function TimelineSelection(props: { selectionDragArea: Ref; }) { var sel = global.selection.slides.attach(Downgraded).value .map(s => ({ id: s.id.toString(), type: s.type.toString() })) - .filter(s => slideTypes.includes(s.type)); + .filter(s => slideTypes.includes(s.type as slideTypes)); sel.forEach(slide => global.timeline.workingTimeline.find(s => s.value?.id == slide.id).set(none)); global.update.refreshLiveTimeline.value(); @@ -1141,20 +1142,23 @@ function DefaultSettings() { { var file = event.target.files[0]; if (!file) return; var reader = new FileReader(); reader.addEventListener('load', ev => { - player.loadSlides(ev.target.result as string); - project.timeline.set(player.timeline); - global.timeline.workingTimeline.set(player.timeline.slides); - global.update.refreshLiveTimeline.value(); - global.ready.timeline.set(true); + var proj = new Project(); + proj.video = new LocalVideo(); + proj.video.load(ev.target.result as ArrayBuffer); + // player.loadSlides(ev.target.result as string); + // project.timeline.set(player.timeline); + // global.timeline.workingTimeline.set(player.timeline.slides); + // global.update.refreshLiveTimeline.value(); + // global.ready.timeline.set(true); }); - reader.readAsText(file); + reader.readAsArrayBuffer(file); }} />