daily: only subscribe to participant video source

This commit is contained in:
Aleix Conchillo Flaqué
2024-04-09 14:57:22 -07:00
parent 989252bb52
commit 0bf15fd6eb

View File

@@ -244,9 +244,12 @@ class DailyTransport(ThreadedTransport, EventHandler):
) )
self._my_participant_id = self.client.participants()["local"]["id"] 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({ self.client.update_subscription_profiles({
"base": { "base": {
"camera": "subscribed" if self._video_rendering_enabled else "unsubscribed", "camera": "unsubscribed",
"screenVideo": "unsubscribed"
} }
}) })
@@ -285,6 +288,16 @@ class DailyTransport(ThreadedTransport, EventHandler):
color_format="RGB") -> None: color_format="RGB") -> None:
if not self._video_rendering_enabled: if not self._video_rendering_enabled:
self._logger.warn("Video rendering is not 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] = { self._video_renderers[participant_id] = {
"framerate": framerate, "framerate": framerate,