Skip to content

Commit ae95e97

Browse files
Code (#313)
1 parent 8f61ad8 commit ae95e97

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

backend/fastrtc/templates/component/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22474,9 +22474,9 @@ function Mp(n) {
2247422474
function Bp(n, e, t) {
2247522475
let { elem_id: r = "" } = e, { elem_classes: a = [] } = e, { visible: i = !0 } = e, { value: l = "__webrtc_value__" } = e, { button_labels: s } = e, { label: o } = e, { root: c } = e, { show_label: h } = e, { loading_status: m } = e, { height: f } = e, { width: p } = e, { server: v } = e, { container: w = !1 } = e, { scale: S = null } = e, { min_width: A = void 0 } = e, { gradio: b } = e, { rtc_configuration: y } = e, { time_limit: E = null } = e, { modality: F = "video" } = e, { mode: T = "send-receive" } = e, { rtp_params: z = {} } = e, { track_constraints: I = {} } = e, { icon: B = void 0 } = e, { icon_button_color: R = "var(--color-accent)" } = e, { pulse_color: L = "var(--color-accent)" } = e, { icon_radius: W = 50 } = e;
2247622476
const oe = (N) => {
22477-
(N == null ? void 0 : N.type) === "info" || (N == null ? void 0 : N.type) === "warning" || (N == null ? void 0 : N.type) === "error" ? b.dispatch(
22477+
console.log("on_change_cb", N), (N == null ? void 0 : N.type) === "info" || (N == null ? void 0 : N.type) === "warning" || (N == null ? void 0 : N.type) === "error" ? b.dispatch(
2247822478
(N == null ? void 0 : N.type) === "error" ? "error" : "warning",
22479-
N.data
22479+
(N == null ? void 0 : N.data) || (N == null ? void 0 : N.message)
2248022480
) : (N == null ? void 0 : N.type) === "end_stream" ? b.dispatch("warning", N.data) : (N == null ? void 0 : N.type) === "fetch_output" ? b.dispatch("state_change") : (N == null ? void 0 : N.type) === "send_input" ? b.dispatch("tick") : (N == null ? void 0 : N.type) === "connection_timeout" && b.dispatch("warning", "Taking a while to connect. Are you on a VPN?"), N.type === "state_change" && b.dispatch(N === "change" ? "state_change" : "tick");
2248122481
}, q = (N) => {
2248222482
var le, qt;

docs/userguide/video.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ and set the `mode="receive"` in the `WebRTC` component.
4040
=== "Code"
4141
``` py title="Server-To-Client"
4242
from fastrtc import Stream
43+
import cv2
4344

4445
def generation():
4546
url = "https://download.tsi.telecom-paristech.fr/gpac/dataset/dash/uhd/mux_sources/hevcds_720p30_2M.mp4"

frontend/Index.svelte

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@
4747
msg?.type === "warning" ||
4848
msg?.type === "error"
4949
) {
50-
gradio.dispatch(msg?.type === "error" ? "error" : "warning", msg.data);
50+
gradio.dispatch(
51+
msg?.type === "error" ? "error" : "warning",
52+
msg?.data || msg?.message,
53+
);
5154
} else if (msg?.type === "end_stream") {
5255
gradio.dispatch("warning", msg.data);
5356
} else if (msg?.type === "fetch_output") {

0 commit comments

Comments
 (0)