mirror of
https://github.com/gradio-app/gradio.git
synced 2025-03-01 11:45:36 +08:00
ensure webcam video value is propogated correctly (#1218)
* ensure webcam video value is propogated correctly * remove logs
This commit is contained in:
parent
291e287302
commit
0c422b75ea
@ -23,12 +23,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
function clearphoto() {
|
||||
var context = canvas.getContext("2d")!;
|
||||
context.fillStyle = "#AAA";
|
||||
context.fillRect(0, 0, canvas.width, canvas.height);
|
||||
}
|
||||
|
||||
function take_picture() {
|
||||
var context = canvas.getContext("2d")!;
|
||||
|
||||
@ -98,7 +92,7 @@
|
||||
|
||||
<div class="h-full w-full relative">
|
||||
<!-- svelte-ignore a11y-media-has-caption -->
|
||||
<video bind:this={video_source} class=" h-full w-full" />
|
||||
<video bind:this={video_source} class="h-full w-full " />
|
||||
<button
|
||||
on:click={mode === "image" ? take_picture : take_recording}
|
||||
class="rounded-xl w-10 h-10 flex justify-center items-center absolute inset-x-0 bottom-2 md:bottom-4 xl:bottom-8 m-auto drop-shadow-lg bg-black/90"
|
||||
@ -110,7 +104,7 @@
|
||||
</div>
|
||||
{:else}
|
||||
<div class="w-2/4 h-2/4 dark:text-white opacity-80">
|
||||
<Square />
|
||||
<Circle />
|
||||
</div>
|
||||
{/if}
|
||||
{:else}
|
||||
@ -120,10 +114,3 @@
|
||||
{/if}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<style lang="postcss">
|
||||
video {
|
||||
-webkit-transform: scaleX(-1);
|
||||
transform: scaleX(-1);
|
||||
}
|
||||
</style>
|
||||
|
@ -57,7 +57,10 @@
|
||||
</div>
|
||||
</Upload>
|
||||
{:else if source === "webcam"}
|
||||
<Webcam mode="video" on:capture={({ detail }) => (value = detail)} />
|
||||
<Webcam
|
||||
mode="video"
|
||||
on:capture={({ detail }) => dispatch("change", detail)}
|
||||
/>
|
||||
{/if}
|
||||
{:else}
|
||||
<ModifyUpload on:clear={handle_clear} />
|
||||
|
Loading…
Reference in New Issue
Block a user