UNPKG

mediasfu-reactnative-expo

Version:

mediasfu-reactnative-expo – Expo-managed React Native WebRTC SDK for video conferencing, webinars, live streaming, broadcast, screen sharing, whiteboard, chat, recording, live subtitles, translation, and AI agent rooms on iOS, Android, and web. Prebuilt r

38 lines 1.49 kB
import { connectRecvTransport as sharedConnectRecvTransport } from 'mediasfu-shared'; /** * Connects the receiving transport to consume media from a remote producer. * * @param {ConnectRecvTransportOptions} options - The options for connecting the receiving transport. * @param {Transport} options.consumerTransport - The transport used for consuming media. * @param {string} options.remoteProducerId - The ID of the remote producer. * @param {string} options.serverConsumerTransportId - The ID of the server consumer transport. * @param {Socket} options.nsock - The socket used for communication. * @param {ConnectRecvTransportParameters} options.parameters - The parameters for the connection. * * @returns {Promise<void>} A promise that resolves when the connection is established. * * @throws Will throw an error if the connection or consumption fails. * * @example * ```typescript * const options = { * consumerTransport, * remoteProducerId: 'producer-id', * serverConsumerTransportId: 'transport-id', * nsock: socket, * parameters: connectRecvTransportOptions, * }; * * connectRecvTransport(options) * .then(() => { * console.log('Transport connected and consuming media'); * }) * .catch((error) => { * console.error('Error connecting transport:', error); * }); * ``` */ export const connectRecvTransport = async (options) => { await sharedConnectRecvTransport(options); }; //# sourceMappingURL=connectRecvTransport.js.map