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

90 lines 5.49 kB
import { stopShareScreen as sharedStopShareScreen } from 'mediasfu-shared'; /** * Stops the screen sharing process and updates the relevant parameters and states. * * @param {StopShareScreenOptions} options - The options for stopping the screen share. * @param {Object} options.parameters - The parameters required for stopping the screen share. * @param {Function} options.parameters.getUpdatedAllParams - Function to get updated parameters. * @param {boolean} options.parameters.shared - Indicates if the screen is currently shared. * @param {boolean} options.parameters.shareScreenStarted - Indicates if the screen sharing has started. * @param {boolean} options.parameters.shareEnded - Indicates if the screen sharing has ended. * @param {boolean} options.parameters.updateMainWindow - Indicates if the main window needs to be updated. * @param {boolean} options.parameters.defer_receive - Indicates if receiving is deferred. * @param {string} options.parameters.hostLabel - The label of the host. * @param {boolean} options.parameters.lock_screen - Indicates if the screen is locked. * @param {boolean} options.parameters.forceFullDisplay - Indicates if full display is forced. * @param {boolean} options.parameters.firstAll - Indicates if it is the first all. * @param {boolean} options.parameters.first_round - Indicates if it is the first round. * @param {MediaStream} options.parameters.localStreamScreen - The local screen stream. * @param {string} options.parameters.eventType - The type of event. * @param {boolean} options.parameters.prevForceFullDisplay - Indicates if full display was previously forced. * @param {boolean} options.parameters.annotateScreenStream - Indicates if the screen stream is annotated. * @param {Function} options.parameters.updateShared - Function to update the shared state. * @param {Function} options.parameters.updateShareScreenStarted - Function to update the share screen started state. * @param {Function} options.parameters.updateShareEnded - Function to update the share ended state. * @param {Function} options.parameters.updateUpdateMainWindow - Function to update the main window state. * @param {Function} options.parameters.updateDefer_receive - Function to update the defer receive state. * @param {Function} options.parameters.updateLock_screen - Function to update the lock screen state. * @param {Function} options.parameters.updateForceFullDisplay - Function to update the force full display state. * @param {Function} options.parameters.updateFirstAll - Function to update the first all state. * @param {Function} options.parameters.updateFirst_round - Function to update the first round state. * @param {Function} options.parameters.updateLocalStreamScreen - Function to update the local screen stream. * @param {Function} options.parameters.updateMainHeightWidth - Function to update the main height and width. * @param {Function} options.parameters.updateAnnotateScreenStream - Function to update the annotate screen stream state. * @param {Function} options.parameters.updateIsScreenboardModalVisible - Function to update the screenboard modal visibility. * @param {Function} options.parameters.disconnectSendTransportScreen - Function to disconnect the send transport screen. * @param {Function} options.parameters.prepopulateUserMedia - Function to prepopulate user media. * @param {Function} options.parameters.reorderStreams - Function to reorder streams. * @param {Function} options.parameters.getVideos - Function to get videos. * * @returns {Promise<void>} A promise that resolves when the screen sharing process is stopped. * * @example * const options = { * parameters: { * shared: true, * shareScreenStarted: true, * shareEnded: false, * updateMainWindow: true, * defer_receive: false, * hostLabel: "Host", * lock_screen: false, * forceFullDisplay: false, * firstAll: false, * first_round: false, * localStreamScreen: localStream, // MediaStream object * eventType: "conference", * prevForceFullDisplay: false, * annotateScreenStream: false, * updateShared: updateSharedFunction, * updateShareScreenStarted: updateShareScreenStartedFunction, * updateShareEnded: updateShareEndedFunction, * updateUpdateMainWindow: updateUpdateMainWindowFunction, * updateDefer_receive: updateDefer_receiveFunction, * updateLock_screen: updateLock_screenFunction, * updateForceFullDisplay: updateForceFullDisplayFunction, * updateFirstAll: updateFirstAllFunction, * updateFirst_round: updateFirst_roundFunction, * updateLocalStreamScreen: updateLocalStreamScreenFunction, * updateMainHeightWidth: updateMainHeightWidthFunction, * updateAnnotateScreenStream: updateAnnotateScreenStreamFunction, * updateIsScreenboardModalVisible: updateIsScreenboardModalVisibleFunction, * disconnectSendTransportScreen: disconnectSendTransportScreenFunction, * prepopulateUserMedia: prepopulateUserMediaFunction, * reorderStreams: reorderStreamsFunction, * getVideos: getVideosFunction, * }, * }; * * stopShareScreen(options) * .then(() => { * console.log('Screen sharing stopped successfully'); * }) * .catch(error => { * console.error('Error stopping screen share:', error); * }); */ export const stopShareScreen = async (options) => { await sharedStopShareScreen(options); }; //# sourceMappingURL=stopShareScreen.js.map