examples: capture camera or screen. allow setting framerate

This commit is contained in:
Aleix Conchillo Flaqué
2025-05-29 10:15:18 -07:00
parent 67dd146038
commit ca7b0650c2
11 changed files with 34 additions and 21 deletions

View File

@@ -43,11 +43,21 @@ def get_transport_client_id(transport: BaseTransport, client: Any) -> str:
return ""
async def maybe_capture_participant_video(transport: BaseTransport, client: Any):
async def maybe_capture_participant_camera(
transport: BaseTransport, client: Any, framerate: int = 0
):
if isinstance(transport, DailyTransport):
await transport.capture_participant_video(client["id"], framerate=0, video_source="camera")
await transport.capture_participant_video(
client["id"], framerate=0, video_source="screenVideo"
client["id"], framerate=framerate, video_source="camera"
)
async def maybe_capture_participant_screen(
transport: BaseTransport, client: Any, framerate: int = 0
):
if isinstance(transport, DailyTransport):
await transport.capture_participant_video(
client["id"], framerate=framerate, video_source="screenVideo"
)