Skip to content

Commit 57c8a53

Browse files
committed
add events
1 parent 4dded10 commit 57c8a53

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

packages/rrweb/src/replay/index.ts

+6
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,12 @@ export class Replayer {
528528
}
529529

530530
public playSingleEvent(eventIndex: number) {
531+
const handleFinish = () => {
532+
this.service.send('END');
533+
this.emitter.off(ReplayerEvents.FlushEnd, handleFinish);
534+
};
535+
this.emitter.on(ReplayerEvents.FlushEnd, handleFinish);
536+
531537
if (this.service.state.matches('paused')) {
532538
this.service.send({
533539
type: 'PLAY_SINGLE_EVENT',

packages/rrweb/src/replay/machine.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export function createPlayerService(
150150
actions: ['recordTimeOffset', 'play'],
151151
},
152152
PLAY_SINGLE_EVENT: {
153-
target: 'paused',
153+
target: 'playing',
154154
actions: ['playSingleEvent'],
155155
},
156156
CAST_EVENT: {

0 commit comments

Comments
 (0)