mirror of
https://github.com/HumanAIGC-Engineering/gradio-webrtc.git
synced 2026-02-04 17:39:23 +08:00
update mobile view (#3)
* Update VideoChat.svelte * Delete frontend/package-lock.json
This commit is contained in:
BIN
dist/gradio_webrtc-0.0.30.dev0-py3-none-any.whl
vendored
BIN
dist/gradio_webrtc-0.0.30.dev0-py3-none-any.whl
vendored
Binary file not shown.
6276
frontend/package-lock.json
generated
6276
frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -282,6 +282,7 @@
|
||||
wrapperRef.getBoundingClientRect()
|
||||
wrapperRect.width = wrapperRef.clientWidth
|
||||
wrapperRect.height = wrapperRef.clientHeight
|
||||
isLandScape = wrapperRect.width * 1.5 > wrapperRect.height
|
||||
console.log(wrapperRect)
|
||||
|
||||
})
|
||||
@@ -350,11 +351,12 @@
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
}
|
||||
|
||||
export let isLandScape = true
|
||||
window.addEventListener('resize', () => {
|
||||
wrapperRef.getBoundingClientRect()
|
||||
wrapperRect.width = wrapperRef.clientWidth
|
||||
wrapperRect.height = wrapperRef.clientHeight
|
||||
isLandScape = wrapperRect.width * 1.5 > wrapperRect.height
|
||||
computeLocalPosition()
|
||||
computeRemotePosition()
|
||||
})
|
||||
@@ -371,7 +373,7 @@
|
||||
<WebcamPermissions on:click={async () => access_webcam()} />
|
||||
</div>
|
||||
{/if}
|
||||
<div class="video-container" bind:this={wrapperRef} class:picture-in-picture={videoShowType === 'picture-in-picture'} class:side-by-side={videoShowType === 'side-by-side'} style:visibility="{webcam_accessed ? 'visible' : 'hidden'}">
|
||||
<div class="video-container" bind:this={wrapperRef} class:vertical={!isLandScape} class:picture-in-picture={videoShowType === 'picture-in-picture'} class:side-by-side={videoShowType === 'side-by-side'} style:visibility="{webcam_accessed ? 'visible' : 'hidden'}">
|
||||
<div class=local-video-container bind:this={localVideoContainerRef}
|
||||
style:left={localVideoPosition.width < 10 ? '50%' :localVideoPosition.left + 'px'}
|
||||
style:top={localVideoPosition.height < 10 ? '50%' : localVideoPosition.top + 'px'}
|
||||
@@ -512,6 +514,16 @@
|
||||
backdrop-filter: blur(20px);
|
||||
border-radius: 32px;
|
||||
transition: all 0.3s linear;
|
||||
overflow: hidden;
|
||||
}
|
||||
&.vertical {
|
||||
flex-direction: column-reverse;
|
||||
|
||||
|
||||
.local-video-container, .remote-video-container {
|
||||
width: 100%;
|
||||
height: 49%;
|
||||
}
|
||||
}
|
||||
.local-video, .remote-video {
|
||||
width: 100%;
|
||||
@@ -676,4 +688,4 @@
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user