Class ClickScreenShare

Handles the action for the screen button, including starting and stopping screen sharing.

Options for handling the screen button action.

The parameters required for the screen share action.

Function to show alert messages.

The name of the room where the screen share is taking place.

The member initiating the screen share.

The socket connection used for communication.

The participant's level.

Indicates if the user is a co-host.

Indicates if there are restrictions set by the admin.

Current audio setting.

Current video setting.

Current screen share setting.

Current chat setting.

Indicates if a screen action is currently taking place.

Indicates if screen sharing is currently active.

State of the screen share request.

Timestamp of when the screen share request was made.

Indicates if the room is audio-only.

Interval time for updating request state.

Function to update the screen request state.

Function to update the screen sharing status.

Function to check permissions for screen sharing.

Function to check and initiate screen sharing.

Function to stop screen sharing.

A promise that resolves when the screen share action has been handled.

This function checks the current status of screen sharing and handles the logic for starting or stopping screen sharing. It validates permissions and room settings before allowing screen sharing to be activated or deactivated.

const options: ClickScreenShareOptions = {
parameters: {
showAlert: (alert) => console.log(alert.message),
roomName: 'myRoom',
member: 'John Doe',
socket: socketInstance,
islevel: '1',
youAreCoHost: false,
adminRestrictSetting: false,
audioSetting: 'on',
videoSetting: 'on',
screenshareSetting: 'off',
chatSetting: 'allow',
screenAction: false,
screenAlreadyOn: false,
screenRequestState: null,
screenRequestTime: 0,
audioOnlyRoom: false,
updateRequestIntervalSeconds: 30,
updateScreenRequestState: (state) => console.log(`Screen request state: ${state}`),
updateScreenAlreadyOn: (status) => console.log(`Screen already on: ${status}`),
checkPermission: checkPermissionFunction,
checkScreenShare: checkScreenShareFunction,
stopShareScreen: stopShareScreenFunction,
getUpdatedAllParams: () => parameters,
},
};

const clickScreenShareService = new ClickScreenShare();
await clickScreenShareService.clickScreenShare(options);

Constructors

Methods

Constructors

Methods