Skip to content

Commit

Permalink
resolve rrweb-io#28, init replayer config in the constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuyz0112 committed Jan 1, 2019
1 parent 96bb177 commit 0d000b5
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/replay/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,13 @@ smoothscroll.polyfill();
// tslint:disable-next-line
const mitt = (mittProxy as any).default || mittProxy;

const defaultConfig: playerConfig = {
speed: 1,
root: document.body,
loadTimeout: 0,
skipInactive: false,
};

export class Replayer {
public wrapper: HTMLDivElement;

public timer: Timer;

private events: eventWithTime[] = [];
private config: playerConfig = defaultConfig;
private config: playerConfig;

private iframe: HTMLIFrameElement;
private mouse: HTMLDivElement;
Expand All @@ -66,8 +59,15 @@ export class Replayer {
this.events = events;
this.handleResize = this.handleResize.bind(this);

const defaultConfig: playerConfig = {
speed: 1,
root: document.body,
loadTimeout: 0,
skipInactive: false,
};
this.config = Object.assign({}, defaultConfig, config);

this.timer = new Timer(this.config);
this.setConfig(Object.assign({}, config));
this.setupDom();
this.emitter.on('resize', this.handleResize as mitt.Handler);
}
Expand Down

0 comments on commit 0d000b5

Please sign in to comment.