Function newPipeProducer

Handles the creation of a new pipe producer by signaling for a new consumer transport and updating the necessary parameters.

Will throw an error if the operation fails to signal the new consumer transport.

import { newPipeProducer } from 'mediasfu-reactjs';
import { io } from 'socket.io-client';

const parameters = {
shareScreenStarted: true,
shared: true,
landScaped: false,
showAlert: (alert) => console.log(alert.message),
isWideScreen: false,
updateFirst_round: (firstRound) => console.log('First round updated:', firstRound),
updateLandScaped: (landScaped) => console.log('Landscape status updated:', landScaped),
};

const producerId = 'producer-123';
const islevel = '2';
const nsock = io("http://localhost:3000");

async function init() {
try {
await newPipeProducer({
producerId,
islevel,
nsock,
parameters,
});
console.log('New pipe producer created successfully');
} catch (error) {
console.error('Error creating new pipe producer:', error);
}
}

init();