API Server side : Peers state

Hi,

I need to add a route to know the status of the users of the platform. I’m getting their displayName but can’t figure out how to tell if their mic is paused.

Could you help me ?

	_getStatePeers()
	{
		const Peers = [];
		for (const peer of this._getJoinedPeers())
		{
			Peers.push({
				name: peer.data.displayName,
				**mute: peer.data.producer.paused(),**
			});
		}

		return Peers;
	}

The solution :wink:

	{
		const Peers = [];
		for (const peer of this._getJoinedPeers())
		{

			let paused = false;
			peer.data.producers.forEach(function(producer)
			{
				if (producer.kind === 'audio' && producer.paused) {
					paused = true;
				}
			});

			Peers.push({
				name: peer.data.displayName,
				mute: paused
			});
		}

		return Peers;
	}