Skip to content

Commit b9f5784

Browse files
committed
Don't allow video autoplay to automatically unfreeze page. If it's a 'real' playback, there should be a mount or a keyboard event which will serve to unfreeze the page. Also add other non-user events to the list (we really should have an isUserEvent function)
1 parent fd9d274 commit b9f5784

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/rrweb/src/record/index.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,15 @@ function record<T = eventWithTime>(
209209
e.type !== EventType.FullSnapshot &&
210210
!(
211211
e.type === EventType.IncrementalSnapshot &&
212-
e.data.source === IncrementalSource.Mutation
212+
[IncrementalSource.Mutation,
213+
IncrementalSource.MediaInteraction, // often automatic e.g. background video loop
214+
IncrementalSource.StyleSheetRule,
215+
IncrementalSource.CanvasMutation,
216+
IncrementalSource.Font,
217+
IncrementalSource.Log,
218+
IncrementalSource.StyleDeclaration,
219+
IncrementalSource.AdoptedStyleSheet,
220+
].includes(e.data.source)
213221
)
214222
) {
215223
// we've got a user initiated event so first we need to apply

0 commit comments

Comments
 (0)