add media state check

This commit is contained in:
Yanzhen Yu
2026-04-01 12:00:00 +08:00
parent ef3fb5ab60
commit 35070d9dcc
4 changed files with 50 additions and 0 deletions

View File

@@ -253,6 +253,12 @@ function serializeNode(
if (tagName === 'canvas') {
attributes.rr_dataURL = (n as HTMLCanvasElement).toDataURL();
}
// media elements
if (tagName === 'audio' || tagName === 'video') {
attributes.rr_mediaState = (n as HTMLMediaElement).paused
? 'paused'
: 'played';
}
if (needBlock) {
const { width, height } = (n as HTMLElement).getBoundingClientRect();
attributes.rr_width = `${width}px`;