Search code examples
javascripthtmlwebrtcbroadcastbroadcasting

How to start a broadcaster using daily.co prebuilt code


I have created a room and set Owner only broadcast to true. but when I run the link, I am only able to join it as a viewer. And get the screen saying "waiting for your host to arrive". How can i join to it as a broadcaster. Can anyone help in resolving it.

enter image description here


Solution

  • This blog post might be helpful: https://www.daily.co/blog/intro-to-room-access-control/

    To answer your specific question, broadcast meetings require a meeting owner (I think this is what you mean by joining as a "broadcaster"). You can create an owner token using the /meeting-tokens REST API endpoint and set the is_owner property to true. To use the token, pass it in as a property to the join method. This reference guide provides more details: https://docs.daily.co/reference/rest-api/meeting-tokens#using-meeting-tokens.

    If you just want to test using a Daily direct link (i.e. yourdomain.daily.co/ROOMNAME), then you can just append the token as a query param. For example: https://yourdomain.daily.co/ROOMNAME?t=YOURTOKEN.

    You'll need your Daily API key for all of this.