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" "svelte": "^2.16.0"
}, },
"dependencies": { "dependencies": {
"rrweb": "^0.7.25" "rrweb": "^0.7.28"
}, },
"scripts": { "scripts": {
"build": "rollup -c", "build": "rollup -c",

View File

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