Class StartShareScreen

StartShareScreen - Service to initiate screen sharing with configurable options for different environments.

This service initiates the screen sharing process, handling both successful and failed attempts and updating the shared state accordingly.

StartShareScreen

const startShareScreenService = new StartShareScreen();
await startShareScreenService.startShareScreen({
parameters: {
shared: false,
showAlert: (alert) => console.log(alert.message),
updateShared: (shared) => console.log('Shared state:', shared),
onWeb: true,
targetWidth: 1920,
targetHeight: 1080,
streamSuccessScreen: async ({ stream }) => {
// Handle the successful stream here
console.log('Stream started:', stream);
},
},
});

The options for starting screen sharing.

The parameters controlling screen sharing behavior.

Indicates if the screen is currently shared.

Function to display alerts.

Function to update the shared state.

Indicates if the app is running in a web environment.

Optional width setting for shared screen resolution.

Optional height setting for shared screen resolution.

Function to handle successful screen sharing.

startShareScreen - Initiates the screen sharing process based on the provided parameters.

Resolves when the screen sharing process is complete or fails.

Constructors

Methods

Constructors

Methods

  • Starts the screen sharing process.

    Parameters

    Returns Promise<void>

    A promise that resolves when the screen sharing process is complete.

    Will log an error message if there is an issue starting the screen share.