You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I have some problems in doing a connection to an existing audio room. I'm creating an audio room, where two or more user can talk to each other:
const channel = new rtc.WebSocketChannel("wss://easy.innovailable.eu/" + encodeURI(roomName));
const signaling = new rtc.MucSignaling(channel);
const options = {
stun: "stun:stun.innovailable.eu",
}
var room = new rtc.Room(signaling, options)
this.room = room
var current_this = this
this.room.on('peer_joined', function(peer) {
// create a video tag for the peer
const view = $('<video playsinline autoplay>');
$('#peers').append(view);
const ve = new rtc.MediaDomElement(view[0], peer);
// remove the tag after peer leftd
peer.on('left', function() {
view.remove();
});
});
},`
When someone wants to join the audio room I'm doing this:
`
const roomName = "raumname"
try {
// create a local stream from the users camera
const stream = await this.room.local.addStream({ video: false, audio: true });
// display that stream
const ve = new rtc.MediaDomElement($('video'), stream);
} catch(err) {
alert("Unable to get stream, please give permission. You might have to go into settings if you denied before.");
return;
}
try {
await this.room.connect();
} catch(err) {
alert("Unable to join room: " + err.message)
}
`
This works fine.. two or more user can talk to each other. Now I just try to define a function for a user, that only can listen to the users who are in the audio room.. how can I do this? The listening user have already the video tags of the peers, which are in the audio room, at the DOM. But the listening user can't hear anything. I tried something like a Listening Button and this function:
Hello, I have some problems in doing a connection to an existing audio room. I'm creating an audio room, where two or more user can talk to each other:
This is my initial code on opening the page:
`
async initAudioRoom() {
const roomName = "raumname"
When someone wants to join the audio room I'm doing this:
`
const roomName = "raumname"
`
This works fine.. two or more user can talk to each other. Now I just try to define a function for a user, that only can listen to the users who are in the audio room.. how can I do this? The listening user have already the video tags of the peers, which are in the audio room, at the DOM. But the listening user can't hear anything. I tried something like a Listening Button and this function:
try { await this.room.join(); } catch(err) { alert("Unable to join room: " + err.message) }
Do you have an idea and could help me? Im trying it since days and im not able to finish that.
Thank you very much!
The text was updated successfully, but these errors were encountered: