fix controller height compute

This commit is contained in:
Yanzhen Yu
2026-04-01 12:00:00 +08:00
parent 70c8a6b9d1
commit 6b81e939cb
2 changed files with 15 additions and 9 deletions

View File

@@ -16,7 +16,7 @@
"svelte": "^2.16.0"
},
"dependencies": {
"rrweb": "^0.7.25"
"rrweb": "^0.7.28"
},
"scripts": {
"build": "rollup -c",

View File

@@ -1,7 +1,15 @@
<div class="rr-player" ref:player style="{playerStyle}">
<div class="rr-player__frame" ref:frame { style }></div>
{#if replayer}
<Controller { replayer } {showController} {autoPlay} {skipInactive} on:fullscreen="fullscreen()" />
<Controller
{
replayer
}
{showController}
{autoPlay}
{skipInactive}
on:fullscreen="fullscreen()"
/>
{/if}
</div>
@@ -40,10 +48,10 @@
height: `${height}px`,
});
},
playerStyle({ width, height }) {
playerStyle({ width, height, showController }) {
return inlineCss({
width: `${width}px`,
height: `${height + controllerHeight}px`,
height: `${height + showController ? controllerHeight : 0}px`,
});
},
},
@@ -77,8 +85,8 @@
skipInactive: true,
showWarning: true,
});
replayer.on('resize', (dimension) =>
this.updateScale(replayer.wrapper, dimension)
replayer.on('resize', dimension =>
this.updateScale(replayer.wrapper, dimension),
);
this.set({
replayer,
@@ -118,8 +126,6 @@
}
},
};
</script>
<style>
@@ -146,4 +152,4 @@
:global(.replayer-wrapper > iframe) {
border: none;
}
</style>
</style>