impl media interactions recording

close #159
close #72
listen to HTMLMediaElement's play/pause events, and replay them
by programmatically play and pause the target element.
This commit is contained in:
Yanzhen Yu
2020-01-12 21:37:01 +08:00
parent 2d07b37701
commit abfb90a778
5 changed files with 89 additions and 4 deletions

View File

@@ -35,7 +35,7 @@ function record(options: recordOptions = {}): listenerHandler | undefined {
inlineStylesheet = true,
maskAllInputs = false,
hooks,
mousemoveWait = 50
mousemoveWait = 50,
} = options;
// runtime checks for user options
if (!emit) {
@@ -178,11 +178,21 @@ function record(options: recordOptions = {}): listenerHandler | undefined {
},
}),
),
mediaInteractionCb: p =>
wrappedEmit(
wrapEvent({
type: EventType.IncrementalSnapshot,
data: {
source: IncrementalSource.MediaInteraction,
...p,
},
}),
),
blockClass,
ignoreClass,
maskAllInputs,
inlineStylesheet,
mousemoveWait
mousemoveWait,
},
hooks,
),