I was wondering if there is a method when obtaining a producer to mute their audio server side ? The feature is built in node. I’m investigating a solution to do that server side instead of disabling the audio track client side.
The transport for the producer is created like so. So can muting be done on the transport ?
createWebRtcTransport(meetings[socket.meetingId].router).then(transport => {
callback({
params: {
id: transport.id,
iceParameters: transport.iceParameters,
iceCandidates: transport.iceCandidates,
dtlsParameters: transport.dtlsParameters,
producersExist: !!producers.length
}
});
addTransport(transport, socket.meetingId, options.consumer, socket.id);
});
async function createWebRtcTransport(router) {
return new Promise(async (resolve, reject) => {
try {
let transport = await router.createWebRtcTransport({
listenIps: [
{
ip: process.env.IP,
announcedIp: process.env.ANNOUNCED_IP,
}
],
});
transport.on('dtlsstatechange', dtlsState => {
if (dtlsState === 'closed') {
transport.close()
}
});
transport.on('close', () => { });
resolve(transport);
} catch (e) {
reject(e)
}
});
}