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); }, },}); Copy
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.
Starts the screen sharing process.
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.
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.
Name
StartShareScreen
Example
Param: options
The options for starting screen sharing.
Param: options.parameters
The parameters controlling screen sharing behavior.
Param: options.parameters.shared
Indicates if the screen is currently shared.
Param: options.parameters.showAlert
Function to display alerts.
Param: options.parameters.updateShared
Function to update the shared state.
Param: options.parameters.onWeb
Indicates if the app is running in a web environment.
Param: options.parameters.targetWidth
Optional width setting for shared screen resolution.
Param: options.parameters.targetHeight
Optional height setting for shared screen resolution.
Param: options.parameters.streamSuccessScreen
Function to handle successful screen sharing.
Method
startShareScreen - Initiates the screen sharing process based on the provided parameters.
Returns
Resolves when the screen sharing process is complete or fails.