From 0bf15fd6eb54e04a88eb358eb2ab6e06ab7392f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Tue, 9 Apr 2024 14:57:22 -0700 Subject: [PATCH] daily: only subscribe to participant video source --- src/dailyai/transports/daily_transport.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/dailyai/transports/daily_transport.py b/src/dailyai/transports/daily_transport.py index 8eb23d23b..3adbf57a2 100644 --- a/src/dailyai/transports/daily_transport.py +++ b/src/dailyai/transports/daily_transport.py @@ -244,9 +244,12 @@ def _prerun(self): ) self._my_participant_id = self.client.participants()["local"]["id"] + # For performance reasons, never subscribe to video streams (unless a + # video renderer is registered). self.client.update_subscription_profiles({ "base": { - "camera": "subscribed" if self._video_rendering_enabled else "unsubscribed", + "camera": "unsubscribed", + "screenVideo": "unsubscribed" } }) @@ -285,6 +288,16 @@ def render_participant_video(self, color_format="RGB") -> None: if not self._video_rendering_enabled: self._logger.warn("Video rendering is not enabled") + return + + # Only enable camera subscription on this participant + self.client.update_subscriptions(participant_settings={ + participant_id: { + "media": { + video_source: "subscribed" + } + } + }) self._video_renderers[participant_id] = { "framerate": framerate,