Hello
I am concerned by this same problem: : detecting consumer closed/ track ended
The “User Logged Out” system cannot be made by displaying it to both the sender and the recipient.
Do you know where to place this code JavaScript:
consumer.on("transportclose", async () => {
console.warn("consumer.close() by transportclose");
this.emit("@consumerDisconnected", { nickname: "test is disconnected" });
});
For the transmitter, it is placed here:
async sendVideo(track) {
console.warn("room.sendVideo()");
const videoProducer = await this.sendTransport.produce({
track
});
videoProducer.on("trackended", async () => {
console.warn("producer.close() by trackended");
await this._closeProducer(videoProducer);
});
return videoProducer;
}
But I don’t know where to place the transportclose,
do you have an idea ?
I use this: https://github.com/meething/meething-mediasoup
salutations