I have a session where a user and livekit agent ar...
# ask-ai
b
I have a session where a user and livekit agent are having conversation. Backend and frontend are built using livekit sdks. I want to build a feature where the agent can stream browser instance that would be spawned by my server using browser use sdk and I want the livekit agent to show that to the user on the call
t
Thanks for reaching out, Ranjeet. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm happy to guide you through streaming a browser instance using LiveKit SDKs so you can share it with others in a call. Here's a simple way to do it: 1. First, create a
BrowserContext
with options like width, height, and framerate that fit your needs. 2. Next, use
BrowserContext.new_page()
to open a new page, where you can specify the URL, dimensions, and framerate. 3. The browser instance will then emit "paint" events containing video frames. These frames can be sent as a video track in your LiveKit room. 4. Finally, you can show these video frames to other participants in the call by using
VideoTrack
components. This approach makes it possible for the LiveKit agent to stream the browser instance smoothly to users during the call. If you have any questions or need further help, feel free to ask—I’m here to support you! Sources: src/components/stream-player.tsx | livekit-plugins/livekit-plugins-browser/src/helper_main_win.cpp