Skip to content

Commit

Permalink
fix video element snapshotting
Browse files Browse the repository at this point in the history
  • Loading branch information
Vadman97 committed Oct 1, 2024
1 parent 953c8d1 commit 63d3342
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
13 changes: 5 additions & 8 deletions packages/rrweb/src/record/observers/canvas/canvas-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -446,17 +446,14 @@ export class CanvasManager {
// video is not yet ready... this retry on the next sampling iteration.
// we don't want to crash the worker by sending an undefined bitmap
// if the video is not yet rendered.
if (
video.width === 0 ||
video.height === 0 ||
actualWidth === 0 ||
actualHeight === 0 ||
boxWidth === 0 ||
boxHeight === 0
) {
if (maxDim === 0) {
this.debug(video, 'not yet ready', {
width: video.width,
height: video.height,
actualWidth,
actualHeight,
boxWidth,
boxHeight,
});
return;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/rrweb/src/replay/media/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class MediaManager {
private syncAllMediaElements(options = { pause: false }) {
this.mediaMap.forEach((_mediaState, target) => {
this.syncTargetWithState(target);
if (options.pause) {
if (options.pause && target.pause) {
target.pause();
}
});
Expand Down

0 comments on commit 63d3342

Please sign in to comment.