export timer to public API

This commit is contained in:
Yanzhen Yu
2026-04-01 12:00:00 +08:00
parent 68abd28c0a
commit e8fea1f93b
2 changed files with 11 additions and 5 deletions

View File

@@ -40,6 +40,8 @@ const defaultConfig: playerConfig = {
export class Replayer {
public wrapper: HTMLDivElement;
public timer: Timer;
private events: eventWithTime[] = [];
private config: playerConfig = defaultConfig;
@@ -55,8 +57,6 @@ export class Replayer {
private nextUserInteractionEvent: eventWithTime | null;
private noramlSpeed: number;
private timer: Timer;
private missingNodeRetryMap: missingNodeMap = {};
constructor(events: eventWithTime[], config?: Partial<playerConfig>) {
@@ -90,6 +90,10 @@ export class Replayer {
};
}
public getTimeOffset(): number {
return this.baselineTime - this.events[0].timestamp;
}
/**
* This API was designed to be used as play at any time offset.
* Since we minimized the data collected from recorder, we do not