diff --git a/.changeset/chilly-jeans-fail.md b/.changeset/chilly-jeans-fail.md new file mode 100644 index 0000000000..00ae586a1c --- /dev/null +++ b/.changeset/chilly-jeans-fail.md @@ -0,0 +1,5 @@ +--- +"rrweb": patch +--- + +Don't allow video/audio autoplay to automatically unfreeze page diff --git a/packages/rrweb/src/record/index.ts b/packages/rrweb/src/record/index.ts index 1308c378a6..e4f0f8a777 100644 --- a/packages/rrweb/src/record/index.ts +++ b/packages/rrweb/src/record/index.ts @@ -209,7 +209,16 @@ function record( e.type !== EventType.FullSnapshot && !( e.type === EventType.IncrementalSnapshot && - e.data.source === IncrementalSource.Mutation + [ + IncrementalSource.Mutation, + IncrementalSource.MediaInteraction, // often automatic e.g. background video loop + IncrementalSource.StyleSheetRule, + IncrementalSource.CanvasMutation, + IncrementalSource.Font, + IncrementalSource.Log, + IncrementalSource.StyleDeclaration, + IncrementalSource.AdoptedStyleSheet, + ].includes(e.data.source) ) ) { // we've got a user initiated event so first we need to apply