diff --git a/frontend/shared/VideoChat.svelte b/frontend/shared/VideoChat.svelte index b358a16..7c8ea52 100644 --- a/frontend/shared/VideoChat.svelte +++ b/frontend/shared/VideoChat.svelte @@ -249,7 +249,7 @@ let localVideoRef: HTMLVideoElement let localVideoContainerRef: HTMLDivElement let localVideoPosition = { - left: 0, + left: 10, top: 0, width: 1, height: 1, @@ -267,7 +267,8 @@ let actionsPosition = { left: 0, bottom: 0, - init: false + init: false, + isOverflow: false } // const computeVideoPosition = () => { @@ -289,7 +290,6 @@ videoShowType = 'picture-in-picture' } } - function computeLocalPosition() { if (!localVideoRef || !localVideoContainerRef || !localVideoRef.videoHeight) return if (remoteVideoPosition.init) { @@ -302,8 +302,9 @@ localVideoPosition.height = height actionsPosition.left = remoteVideoPosition.left + remoteVideoPosition.width + 10 + actionsPosition.left = actionsPosition.left > wrapperRect.width ? actionsPosition.left - 60 : actionsPosition.left actionsPosition.bottom = wrapperRect.height - remoteVideoPosition.top - remoteVideoPosition.height + 5 - + actionsPosition.isOverflow = actionsPosition.left + 80 > wrapperRect.width } else { // 否则则占用全屏 let height = wrapperRect.height - 24 @@ -315,7 +316,10 @@ localVideoPosition.height = height actionsPosition.left = localVideoPosition.left + localVideoPosition.width + 10 + actionsPosition.left = actionsPosition.left > wrapperRect.width ? actionsPosition.left-60 : actionsPosition.left actionsPosition.bottom = wrapperRect.height - localVideoPosition.top - localVideoPosition.height + 5 + actionsPosition.isOverflow = actionsPosition.left + 100 > wrapperRect.width + } } function computeRemotePosition() { @@ -393,7 +397,7 @@ {/if} {#if stream_state === "closed"}
{/if} -