File tree 2 files changed +9
-4
lines changed
packages/rrweb/src/replay
2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -528,6 +528,12 @@ export class Replayer {
528
528
}
529
529
530
530
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
+
531
537
if ( this . service . state . matches ( 'paused' ) ) {
532
538
this . service . send ( {
533
539
type : 'PLAY_SINGLE_EVENT' ,
Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ export function createPlayerService(
150
150
actions : [ 'recordTimeOffset' , 'play' ] ,
151
151
} ,
152
152
PLAY_SINGLE_EVENT : {
153
- target : 'paused ' ,
153
+ target : 'playing ' ,
154
154
actions : [ 'playSingleEvent' ] ,
155
155
} ,
156
156
CAST_EVENT : {
@@ -210,14 +210,13 @@ export function createPlayerService(
210
210
211
211
const { singleEvent } = event . payload ;
212
212
213
- const neededEvents2 = discardPriorSnapshotsToEvent (
213
+ const neededEvents = discardPriorSnapshotsToEvent (
214
214
ctx . events ,
215
215
singleEvent ,
216
216
) ;
217
217
218
- applyEventsSynchronously ( neededEvents2 ) ;
218
+ applyEventsSynchronously ( neededEvents ) ;
219
219
emitter . emit ( ReplayerEvents . Flush ) ;
220
- // emitter.emit(ReplayerEvents.Finish);
221
220
} ,
222
221
223
222
play ( ctx ) {
You can’t perform that action at this time.
0 commit comments