Skip to content

Visualize Your Ideas With Code

fix: load project state correctly (#27)

Lucas Simon8ae02335d718
diff --git a/src/player/Player.ts b/src/player/Player.ts
index 5611d4e4..f1038159 100644
--- a/src/player/Player.ts
+++ b/src/player/Player.ts
@@ -1,10 +1,11 @@
-import type {Project} from '../Project';
-import {AudioManager} from '../audio';
import {
PromiseSimpleEventDispatcher,
SimpleEventDispatcher,
} from 'strongly-typed-events';
+import {AudioManager} from '../audio';
+import type {Project} from '../Project';
+
const MAX_AUDIO_DESYNC = 1 / 50;
export interface PlayerState extends Record<string, unknown> {
@@ -117,6 +118,8 @@ export class Player {
public loadState(state: Partial<PlayerState>) {
this.updateState(state);
+ this.project.framerate = state.fps;
+ this.project.resolutionScale = state.scale;
this.setRange(state.startFrame, state.endFrame);
}