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
45 lines • 1.95 kB
JavaScript
import { startShareScreen as sharedStartShareScreen } from 'mediasfu-shared';
/**
* Starts the screen sharing process.
*
* @param {StartShareScreenOptions} options - The options for starting screen sharing.
* @param {Object} options.parameters - The parameters for screen sharing.
* @param {boolean} options.parameters.shared - Indicates if the screen is currently being shared.
* @param {Function} options.parameters.showAlert - Function to show alert messages.
* @param {Function} options.parameters.updateShared - Function to update the shared state.
* @param {MediaDevices} options.parameters.mediaDevices - The media devices available for screen sharing.
* @param {boolean} options.parameters.onWeb - Indicates if the application is running on a web platform.
* @param {number} [options.parameters.targetWidth] - The target width for screen sharing.
* @param {number} [options.parameters.targetHeight] - The target height for screen sharing.
* @param {Function} options.parameters.streamSuccessScreen - Function to handle successful screen sharing.
*
* @returns {Promise<void>} A promise that resolves when the screen sharing process is complete.
*
* @throws Will log an error message if there is an issue starting the screen share.
*
* @example
* const options = {
* parameters: {
* shared: false,
* showAlert: showAlertFunction,
* updateShared: updateSharedFunction,
* mediaDevices: navigator.mediaDevices,
* onWeb: true,
* targetWidth: 1280,
* targetHeight: 720,
* streamSuccessScreen: streamSuccessFunction,
* },
* };
*
* startShareScreen(options)
* .then(() => {
* console.log('Screen sharing started successfully');
* })
* .catch(error => {
* console.error('Error starting screen share:', error);
* });
*/
export const startShareScreen = async (options) => {
await sharedStartShareScreen(options);
};
//# sourceMappingURL=startShareScreen.js.map