diff --git a/CHANGELOG.md b/CHANGELOG.md index af2420c54..475301ba4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to **Pipecat** will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Added + +- Added `DailyTransport.update_subscriptions()`. This allows you to have fine + grained control of what media subscriptions you want for each participant in a + room. + ## [0.0.47] - 2024-10-22 ### Added diff --git a/src/pipecat/transports/services/daily.py b/src/pipecat/transports/services/daily.py index 5ddd126d6..da232c224 100644 --- a/src/pipecat/transports/services/daily.py +++ b/src/pipecat/transports/services/daily.py @@ -491,6 +491,18 @@ class DailyTransportClient(EventHandler): color_format=color_format, ) + async def update_subscriptions(self, participant_settings=None, profile_settings=None): + if not self._joined or self._leaving: + return + + future = self._loop.create_future() + self._client.update_subscriptions( + participant_settings=participant_settings, + profile_settings=profile_settings, + completion=completion_callback(future), + ) + await future + # # # Daily (EventHandler) @@ -901,6 +913,11 @@ class DailyTransport(BaseTransport): participant_id, framerate, video_source, color_format ) + async def update_subscriptions(self, participant_settings=None, profile_settings=None): + await self._client.update_subscriptions( + participant_settings=participant_settings, profile_settings=profile_settings + ) + async def _on_joined(self, data): await self._call_event_handler("on_joined", data)