初版改造完成

This commit is contained in:
杍超
2025-01-25 16:55:46 +08:00
parent fded5aeb21
commit 2b7db7ac63
6 changed files with 746 additions and 44 deletions

View File

@@ -762,6 +762,10 @@ class WebRTC(Component):
"waiting": "",
**(button_labels or {}),
}
if video_chat is True:
# ensure modality and mode when video_chat is True
self.modality = "audio-video"
self.mode = "send-receive"
if track_constraints is None and modality == "audio":
track_constraints = {
"echoCancellation": True,
@@ -797,10 +801,7 @@ class WebRTC(Component):
}
self.track_constraints = track_constraints
self.event_handler: Callable | StreamHandler | None = None
if video_chat is True:
# ensure modality and mode when video_chat is True
self.modality = "audio-video"
self.mode = "send-receive"
super().__init__(
label=label,
every=every,