feat: add a destroy function to destroy the whole player (#953)

* feat: add a destroy function to destroy the whole player

* doc: update guidance document

* Update packages/rrweb/src/replay/index.ts

Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>

Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
This commit is contained in:
Yun Feng
2026-04-01 12:00:00 +08:00
committed by GitHub
parent 8fd9d3cea9
commit 132ed2ade0
5 changed files with 47 additions and 8 deletions

View File

@@ -280,6 +280,9 @@ replayer.pause();
// pause at the fifth seconds
replayer.pause(5000);
// destroy the replayer (hint: this operation is irreversible)
replayer.destroy();
```
#### Options
@@ -385,6 +388,7 @@ The event list:
| mouse-interaction | mouse interaction has been replayed | { type, target } |
| event-cast | event has been replayed | event |
| custom-event | custom event has been replayed | event |
| destroy | destroyed the replayer | - |
The rrweb-replayer also re-expose the event listener via a `component.addEventListener` API.