mirror of
https://github.com/HumanAIGC-Engineering/gradio-webrtc.git
synced 2026-02-05 18:09:23 +08:00
Fix interactive video (#350)
* n * remove template * Add templates * remove print
This commit is contained in:
@@ -114,14 +114,14 @@ class VideoCallback(VideoStreamTrack):
|
||||
self.channel_set.set()
|
||||
|
||||
def set_args(self, args: list[Any]):
|
||||
self.latest_args = ["__webrtc_value__"] + list(args)
|
||||
self.latest_args = list(args)
|
||||
|
||||
def add_frame_to_payload(
|
||||
self, args: list[Any], frame: np.ndarray | None
|
||||
) -> list[Any]:
|
||||
new_args = []
|
||||
for val in args:
|
||||
if isinstance(val, str) and val == "__webrtc_value__":
|
||||
for i, val in enumerate(args):
|
||||
if i == 0:
|
||||
new_args.append(frame)
|
||||
else:
|
||||
new_args.append(val)
|
||||
|
||||
Reference in New Issue
Block a user