start to support live mode (#73)

1. add a liveMode flag to config, when liveMode is set, the timer
will keep running even though all the actions casted
2. add a public method addEvent, which will cast newly added event
in sync
3. move mouse in sync mode with the latest position info
This commit is contained in:
yz-yu
2026-04-01 12:00:00 +08:00
committed by GitHub
parent d23c0cd0c1
commit 689840d237
5 changed files with 14 additions and 3 deletions

View File

@@ -22,6 +22,7 @@ export declare class Replayer {
play(timeOffset?: number): void;
pause(): void;
resume(timeOffset?: number): void;
addEvent(event: eventWithTime): void;
private setupDom;
private handleResize;
private getDelay;

1
typings/types.d.ts vendored
View File

@@ -192,6 +192,7 @@ export declare type playerConfig = {
showWarning: boolean;
showDebug: boolean;
blockClass: string;
liveMode: boolean;
};
export declare type playerMetaData = {
totalTime: number;