From 7a271798f7e827967dc7e5842bc1efe312146017 Mon Sep 17 00:00:00 2001 From: Justin Halsall Date: Thu, 25 Mar 2021 14:28:16 +0100 Subject: [PATCH 1/4] Fix docs to point to correct event attribute --- docs/recipes/customize-replayer.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/recipes/customize-replayer.md b/docs/recipes/customize-replayer.md index de2bcec851..a066f19970 100644 --- a/docs/recipes/customize-replayer.md +++ b/docs/recipes/customize-replayer.md @@ -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); }); ``` From 4ab6d0e0fecc96a8c26ea3348b4347df88a13bff Mon Sep 17 00:00:00 2001 From: Justin Halsall Date: Thu, 25 Mar 2021 14:30:42 +0100 Subject: [PATCH 2/4] Update customize-replayer.zh_CN.md --- docs/recipes/customize-replayer.zh_CN.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/recipes/customize-replayer.zh_CN.md b/docs/recipes/customize-replayer.zh_CN.md index e0db0d2739..7d76e2ab33 100644 --- a/docs/recipes/customize-replayer.zh_CN.md +++ b/docs/recipes/customize-replayer.zh_CN.md @@ -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); }); ``` From bc2689291495c267b90f0f6344f264b28b16624a Mon Sep 17 00:00:00 2001 From: Justin Halsall Date: Thu, 25 Mar 2021 14:34:59 +0100 Subject: [PATCH 3/4] correct event object in guide --- guide.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/guide.md b/guide.md index a8fb804509..87fc47004c 100644 --- a/guide.md +++ b/guide.md @@ -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 From cb6d3e6bf59169039c8227e0a60c154b20ff1bc1 Mon Sep 17 00:00:00 2001 From: Justin Halsall Date: Thu, 25 Mar 2021 14:35:35 +0100 Subject: [PATCH 4/4] Update guide.zh_CN.md --- guide.zh_CN.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/guide.zh_CN.md b/guide.zh_CN.md index 3414fb0d25..9a54488d0f 100644 --- a/guide.zh_CN.md +++ b/guide.zh_CN.md @@ -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 工具