Update Player.svelte: fix the bug. (#1028)
The progress bar and controls now can be displayed under the fullscreen mode.
This commit is contained in:
@@ -24,7 +24,7 @@
|
|||||||
export let tags: Record<string, string> = {};
|
export let tags: Record<string, string> = {};
|
||||||
|
|
||||||
let replayer: Replayer;
|
let replayer: Replayer;
|
||||||
|
|
||||||
export const getMirror = () => replayer.getMirror();
|
export const getMirror = () => replayer.getMirror();
|
||||||
|
|
||||||
const controllerHeight = 80;
|
const controllerHeight = 80;
|
||||||
@@ -59,8 +59,7 @@
|
|||||||
const scale = [widthScale, heightScale];
|
const scale = [widthScale, heightScale];
|
||||||
if (maxScale) scale.push(maxScale);
|
if (maxScale) scale.push(maxScale);
|
||||||
el.style.transform =
|
el.style.transform =
|
||||||
`scale(${Math.min(...scale)})` +
|
`scale(${Math.min(...scale)})` + 'translate(-50%, -50%)';
|
||||||
'translate(-50%, -50%)';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const triggerResize = () => {
|
export const triggerResize = () => {
|
||||||
@@ -124,7 +123,7 @@
|
|||||||
afterHook: undefined | (() => void) = undefined,
|
afterHook: undefined | (() => void) = undefined,
|
||||||
) => {
|
) => {
|
||||||
controller.playRange(timeOffset, endTimeOffset, startLooping, afterHook);
|
controller.playRange(timeOffset, endTimeOffset, startLooping, afterHook);
|
||||||
};
|
};
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
// runtime type check
|
// runtime type check
|
||||||
@@ -168,7 +167,8 @@
|
|||||||
_width = width;
|
_width = width;
|
||||||
_height = height;
|
_height = height;
|
||||||
width = player.offsetWidth;
|
width = player.offsetWidth;
|
||||||
height = player.offsetHeight;
|
height =
|
||||||
|
player.offsetHeight - (showController ? controllerHeight : 0);
|
||||||
updateScale(replayer.wrapper, {
|
updateScale(replayer.wrapper, {
|
||||||
width: replayer.iframe.offsetWidth,
|
width: replayer.iframe.offsetWidth,
|
||||||
height: replayer.iframe.offsetHeight,
|
height: replayer.iframe.offsetHeight,
|
||||||
@@ -229,6 +229,7 @@
|
|||||||
{speedOption}
|
{speedOption}
|
||||||
{skipInactive}
|
{skipInactive}
|
||||||
{tags}
|
{tags}
|
||||||
on:fullscreen={() => toggleFullscreen()} />
|
on:fullscreen={() => toggleFullscreen()}
|
||||||
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user