Basic-Video-Call
Basic-Video-Call copied to clipboard
Is there an option of creating multiple rooms in Agora Console?
Hi there,
I have an account by Agora for videochat. For now there are 2 rooms with unique App Ids. What I need is: when users come to a website, by button click they can enter a videochat room. Users can be unknown mulltiple number, but they have to be devided into unknown quantity of rooms.
Is it possible without manually creating in Agora console multiple rooms with unique ids?
i don't quite get it. you can specify channel name when call joinChannel api. it's up to you how to divide the user group.
To make it straight: I want rooms to have 10 to 12 users each. But I don't know how many users will come, lets say 30 to 80 at once. I have 3 Projects in my account. That means there can be only 3 rooms to chat, right? You say that with joinChannel I can create any amount of rooms as long as previous are full? Is there an example code to this?
This is how I use it:
(this is one room with unknown number of users)
room = 'Roomname'; // <- this comes from Agora Account and is hardcoded
clientInit = '463lrkgdv8z5w34ofvn3p943m4ct9muvnilsc943'; // <- this comes from Agora Account and is hardcoded
let client = AgoraRTC.createClient({
mode: "rtc",
codec: "vp8",
});
client.init(clientInit);
client.join(token, room, null, (uid) => { // uid - > null
let localStream = AgoraRTC.createStream({
audio: true,
video: true
});
localStream.init(() => {
localStream.play("wrapper");
client.publish(localStream, handleError);
enableUiControls(localStream);
}, handleError);
client.on("stream-added", function (evt) {
client.subscribe(evt.stream, handleError);
});
client.on("stream-subscribed", function (evt) {
let stream = evt.stream;
let streamId = String(stream.getId());
addVideoStream(streamId);
stream.play(streamId);
});