Skip to content

Commit

Permalink
Update Player.svelte: fix the bug. (#1028)
Browse files Browse the repository at this point in the history
The progress bar and controls now can be displayed under the fullscreen mode.
  • Loading branch information
MengZihan712 authored Oct 17, 2022
1 parent ae643f4 commit 2286c11
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/rrweb-player/src/Player.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
export let tags: Record<string, string> = {};
let replayer: Replayer;
export const getMirror = () => replayer.getMirror();
const controllerHeight = 80;
Expand Down Expand Up @@ -59,8 +59,7 @@
const scale = [widthScale, heightScale];
if (maxScale) scale.push(maxScale);
el.style.transform =
`scale(${Math.min(...scale)})` +
'translate(-50%, -50%)';
`scale(${Math.min(...scale)})` + 'translate(-50%, -50%)';
};
export const triggerResize = () => {
Expand Down Expand Up @@ -124,7 +123,7 @@
afterHook: undefined | (() => void) = undefined,
) => {
controller.playRange(timeOffset, endTimeOffset, startLooping, afterHook);
};
};
onMount(() => {
// runtime type check
Expand Down Expand Up @@ -168,7 +167,8 @@
_width = width;
_height = height;
width = player.offsetWidth;
height = player.offsetHeight;
height =
player.offsetHeight - (showController ? controllerHeight : 0);
updateScale(replayer.wrapper, {
width: replayer.iframe.offsetWidth,
height: replayer.iframe.offsetHeight,
Expand Down Expand Up @@ -229,6 +229,7 @@
{speedOption}
{skipInactive}
{tags}
on:fullscreen={() => toggleFullscreen()} />
on:fullscreen={() => toggleFullscreen()}
/>
{/if}
</div>

0 comments on commit 2286c11

Please sign in to comment.