The options for the new pipe producer.
A promise that resolves when the operation is complete.
import { newPipeProducer } from 'mediasfu-reactnative';
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();
Handles the creation of a new pipe producer by signaling for a new consumer transport and updating the necessary parameters.