export timer to public API

This commit is contained in:
Yanzhen Yu
2018-12-26 20:58:14 +08:00
parent 05b42322d7
commit 533885a707
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