Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix docs to point to correct event format #523

Merged
merged 4 commits into from
Mar 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/recipes/customize-replayer.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,17 @@ And there are some ways to listen rrweb-player's state:
```js
// get current timing
rrwebPlayer.addEventListener('ui-update-current-time', (event) => {
console.log(event.detail.payload);
console.log(event.payload);
});

// get current state
rrwebPlayer.addEventListener('ui-update-player-state', (event) => {
console.log(event.detail.payload);
console.log(event.payload);
});

// get current progress
rrwebPlayer.addEventListener('ui-update-progress', (event) => {
console.log(event.detail.payload);
console.log(event.payload);
});
```

Expand Down
6 changes: 3 additions & 3 deletions docs/recipes/customize-replayer.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,17 @@ rrwebPlayer.goto(3000);
```js
// 当前播放时间
rrwebPlayer.addEventListener('ui-update-current-time', (event) => {
console.log(event.detail.payload);
console.log(event.payload);
});

// 当前播放状态
rrwebPlayer.addEventListener('ui-update-player-state', (event) => {
console.log(event.detail.payload);
console.log(event.payload);
});

// 当前播放进度
rrwebPlayer.addEventListener('ui-update-progress', (event) => {
console.log(event.detail.payload);
console.log(event.payload);
});
```

Expand Down
6 changes: 3 additions & 3 deletions guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -378,9 +378,9 @@ And there are three rrweb-replayer event will be emitted in the same way:

| Event | Description | Value |
| ---------------------- | -------------------------------- | ----------------------- |
| ui-update-current-time | current time has changed | { detail: { payload } } |
| ui-update-player-state | current player state has changed | { detail: { payload } } |
| ui-update-progress | current progress has changed | { detail: { payload } } |
| ui-update-current-time | current time has changed | { payload } |
| ui-update-player-state | current player state has changed | { payload } |
| ui-update-progress | current progress has changed | { payload } |

## REPL tool

Expand Down
6 changes: 3 additions & 3 deletions guide.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,9 @@ replayer.on(EVENT_NAME, (payload) => {

| 事件类型 | 描述 | 值 |
| ---------------------- | -------------- | ----------------------- |
| ui-update-current-time | 当前回放时间点 | { detail: { payload } } |
| ui-update-player-state | 当前回放状态 | { detail: { payload } } |
| ui-update-progress | 当前回放百分比 | { detail: { payload } } |
| ui-update-current-time | 当前回放时间点 | { payload } |
| ui-update-player-state | 当前回放状态 | { payload } |
| ui-update-progress | 当前回放百分比 | { payload } |

## REPL 工具

Expand Down