Skip to content

Commit

Permalink
daily: only subscribe to participant video source
Browse files Browse the repository at this point in the history
  • Loading branch information
aconchillo committed Apr 10, 2024
1 parent 989252b commit 0bf15fd
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/dailyai/transports/daily_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
})

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 0bf15fd

Please sign in to comment.