+ {[
+ { type: 'Producer', track: videoProducer, audio: audioProducer },
+ ...consumers.map((consumer, index) => ({
+ type: `Consumer ${index + 1}`,
+ track: consumer.videoConsumer,
+ audio: consumer.audioConsumer,
+ })),
+ ].map((user, index) => (
+
+
{
+ user.audio?.pause();
+ user.track?.pause();
+ }}
+ onPlay={() => {
+ user.track?.resume();
+ user.audio?.resume();
+ }}
+ />
+ {user.type}
+
+ ))}
+