examples: add 14a-local-render-remote-participant

This commit is contained in:
Aleix Conchillo Flaqué
2024-04-09 14:58:06 -07:00
parent 0bf15fd6eb
commit 9fcbb36997
3 changed files with 75 additions and 6 deletions

View File

@@ -4,8 +4,6 @@ import logging
from typing import AsyncGenerator
from PIL import Image
from dailyai.pipeline.aggregators import FrameProcessor
from dailyai.pipeline.frames import ImageFrame, Frame, UserImageFrame
@@ -25,14 +23,13 @@ logger.setLevel(logging.DEBUG)
class UserImageProcessor(FrameProcessor):
async def process_frame(self, frame: Frame) -> AsyncGenerator[Frame, None]:
print(frame)
if isinstance(frame, UserImageFrame):
yield ImageFrame(frame.image, frame.size)
else:
yield frame
async def main(room_url):
async def main(room_url: str, token):
transport = DailyTransport(
room_url,
token,
@@ -53,4 +50,4 @@ async def main(room_url):
if __name__ == "__main__":
(url, token) = configure()
asyncio.run(main(url))
asyncio.run(main(url, token))