Skip to content

Commit

Permalink
Fix webcam when streaming=True (#6865)
Browse files Browse the repository at this point in the history
* show webcam when streaming value is true

* add story

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
  • Loading branch information
hannahblair and gradio-pr-bot committed Dec 21, 2023
1 parent e974cf0 commit 15c97c6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/nine-forks-raise.md
@@ -0,0 +1,6 @@
---
"@gradio/image": patch
"gradio": patch
---

fix:Fix webcam when `streaming=True`
15 changes: 15 additions & 0 deletions js/image/Image.stories.svelte
Expand Up @@ -84,3 +84,18 @@
interactive: true
}}
/>

<Story
name="interactive webcam with streaming"
args={{
sources: ["webcam"],
show_download_button: true,
interactive: true,
value: {
path: "https://gradio-builds.s3.amazonaws.com/demo-files/ghepardo-primo-piano.jpg",
url: "https://gradio-builds.s3.amazonaws.com/demo-files/ghepardo-primo-piano.jpg",
orig_name: "cheetah.jpg"
},
streaming: true
}}
/>
2 changes: 1 addition & 1 deletion js/image/shared/ImageUploader.svelte
Expand Up @@ -122,7 +122,7 @@
<slot />
{/if}
</Upload>
{#if active_source === "webcam" && !value}
{#if active_source === "webcam" && (streaming || (!streaming && !value))}
<Webcam
on:capture={(e) => handle_save(e.detail)}
on:stream={(e) => handle_save(e.detail)}
Expand Down

0 comments on commit 15c97c6

Please sign in to comment.