Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with retrieving the room name and metadata #227

Open
love4php opened this issue Jul 30, 2024 · 1 comment
Open

Problem with retrieving the room name and metadata #227

love4php opened this issue Jul 30, 2024 · 1 comment

Comments

@love4php
Copy link

In the worker, I am trying to obtain the room name and metadata using the following method, but unfortunately, after the latest update, these two values are no longer displayed.

`async def entrypoint(ctx: JobContext):
try:
print(ctx.room.name)
print(ctx.room.metadata)

if name == "main":
# Initialize the worker with the entrypoint
cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint))
`

@keepingitneil
Copy link
Contributor

I pushed a fix to today to participant metadata: #226 but I'm unable to reproduce your issue for room metadata.

For example, this code:

    lkapi = livekit.api.LiveKitAPI()
    await lkapi.room.update_room_metadata(
        livekit.api.UpdateRoomMetadataRequest(room=ctx.room.name, metadata="test")
    )
    await asyncio.sleep(1)
    print("room md", ctx.room.metadata)

prints "room md test" as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants