Fix docs to point to correct event format (#523)

* Fix docs to point to correct event attribute

* Update customize-replayer.zh_CN.md

* correct event object in guide

* Update guide.zh_CN.md
This commit is contained in:
Justin Halsall
2026-04-01 12:00:00 +08:00
committed by GitHub
parent 0e688bba0c
commit 83045059f9
4 changed files with 12 additions and 12 deletions

View File

@@ -53,17 +53,17 @@ And there are some ways to listen rrweb-player's state:
```js ```js
// get current timing // get current timing
rrwebPlayer.addEventListener('ui-update-current-time', (event) => { rrwebPlayer.addEventListener('ui-update-current-time', (event) => {
console.log(event.detail.payload); console.log(event.payload);
}); });
// get current state // get current state
rrwebPlayer.addEventListener('ui-update-player-state', (event) => { rrwebPlayer.addEventListener('ui-update-player-state', (event) => {
console.log(event.detail.payload); console.log(event.payload);
}); });
// get current progress // get current progress
rrwebPlayer.addEventListener('ui-update-progress', (event) => { rrwebPlayer.addEventListener('ui-update-progress', (event) => {
console.log(event.detail.payload); console.log(event.payload);
}); });
``` ```

View File

@@ -53,17 +53,17 @@ rrwebPlayer.goto(3000);
```js ```js
// 当前播放时间 // 当前播放时间
rrwebPlayer.addEventListener('ui-update-current-time', (event) => { rrwebPlayer.addEventListener('ui-update-current-time', (event) => {
console.log(event.detail.payload); console.log(event.payload);
}); });
// 当前播放状态 // 当前播放状态
rrwebPlayer.addEventListener('ui-update-player-state', (event) => { rrwebPlayer.addEventListener('ui-update-player-state', (event) => {
console.log(event.detail.payload); console.log(event.payload);
}); });
// 当前播放进度 // 当前播放进度
rrwebPlayer.addEventListener('ui-update-progress', (event) => { rrwebPlayer.addEventListener('ui-update-progress', (event) => {
console.log(event.detail.payload); console.log(event.payload);
}); });
``` ```

View File

@@ -378,9 +378,9 @@ And there are three rrweb-replayer event will be emitted in the same way:
| Event | Description | Value | | Event | Description | Value |
| ---------------------- | -------------------------------- | ----------------------- | | ---------------------- | -------------------------------- | ----------------------- |
| ui-update-current-time | current time has changed | { detail: { payload } } | | ui-update-current-time | current time has changed | { payload } |
| ui-update-player-state | current player state has changed | { detail: { payload } } | | ui-update-player-state | current player state has changed | { payload } |
| ui-update-progress | current progress has changed | { detail: { payload } } | | ui-update-progress | current progress has changed | { payload } |
## REPL tool ## REPL tool

View File

@@ -376,9 +376,9 @@ replayer.on(EVENT_NAME, (payload) => {
| 事件类型 | 描述 | 值 | | 事件类型 | 描述 | 值 |
| ---------------------- | -------------- | ----------------------- | | ---------------------- | -------------- | ----------------------- |
| ui-update-current-time | 当前回放时间点 | { detail: { payload } } | | ui-update-current-time | 当前回放时间点 | { payload } |
| ui-update-player-state | 当前回放状态 | { detail: { payload } } | | ui-update-player-state | 当前回放状态 | { payload } |
| ui-update-progress | 当前回放百分比 | { detail: { payload } } | | ui-update-progress | 当前回放百分比 | { payload } |
## REPL 工具 ## REPL 工具