ScreenShareService

The ScreenShareService allows an application to share a screen during the conference.

Typical application workflow:

1. The application calls the sendRequestStartScreenShare method to obtain a screen-sharing permission.

2. The application receives the RequestScreenSharePermissionEvent asking the participant for permission to share the screen.

3. The application calls the sendUserPermissionRequest method that allows sharing the screen.

4. The application calls the consumeRightsToScreenShare method which manages previously received information and grants the right to share the screen.

5. The application starts sharing the screen through the startScreenShare method. If there is a need to share a screen of an external device, the application calls the startCustomScreenShare method.

6. The application gets information about the screen size, modifies the size, and scales the screen.

7. The onActivityResults method manages the activity results.

8. The application calls the stopScreenShare method to stop sharing the screen.

Available in the package com.voxeet.sdk.services.ScreenShareService.

Methods

startCustomScreenShare

startCustomScreenShare(@NonNull provider: VideoCapturerProvider): Promise

Starts sharing the screen of an external device during a conference.

Parameters

NameTypeDescription
providerVideoCapturerProvidernon null provider of VideoCapturer

Returns: @NonNull Promise - the promise to resolve.


startScreenShare

startScreenShare(@NonNull intent: Intent): Promise

Starts sharing the local participant's screen. The method is available only to participants who joined a conference using the join method; it is not available for listeners.

The SDK 3.10 and earlier support sharing only one screen per conference. The SDK 3.11 and later allow sharing two screens in one conference, so two participants can share their screens at the same time.

Parameters

NameTypeDescription
intentIntentnon null intent information obtained when the participant receives a permission to share a screen

Returns: @NonNull Promise - the promise to resolve.


stopScreenShare

stopScreenShare(): Promise

Stops sharing the screen. The method is available only to participants who joined a conference using the join method; it is not available for listeners.

Returns: @NonNull Promise - the promise to resolve.


setScreenSizeInformation

setScreenSizeInformation(@NonNull point: Point): ScreenShareService

Changes the size of the shared screen.

Parameters

NameTypeDescription
pointPointnon null point representing the width and height of the shared screen

Returns: ScreenShareService - the current service instance.


sendRequestStartScreenShare

sendRequestStartScreenShare(): void

Sends a request to share the screen to the VoxeetAppCompatActivity instance which presents the permission request modal to the participant. After granting permission, the VoxeetAppCompatActivity requests the start call.


sendUserPermissionRequest

sendUserPermissionRequest(@NonNull activity: Activity): boolean

Enables the proper permission dialog to the given Activity instance.

Parameters

NameTypeDescription
activityActivitynon null valid activity used to start the system and get the callback result

Returns: boolean - the compatibility result.


sendUserPermissionRequest

sendUserPermissionRequest(@NonNull activity: Activity, full_quality: boolean): boolean

Permits the provided activity instance to share the screen.

Parameters

NameTypeDescription
activityActivitynon null valid activity used to start the system and get the callback result
full_qualitybooleanflag indicating if the screen-share forces the maximum dimensions (in pixels) displayed by the user.

Returns: boolean - the compatibility result.


consumeRightsToScreenShare

consumeRightsToScreenShare(): void

Automatically manages information obtained from the activity lifecycle and calls the startScreenshare method.


onActivityResult

onActivityResult(requestCode: int, resultCode: int, @NonNull data: Intent): boolean

Manages the activity results in the context of sharing the screen.

Parameters

NameTypeDescription
requestCodeintthe obtained requestCode
resultCodeintthe obtained resultCode
dataIntentnon null incoming data

Returns: boolean - true if the logic is managed, false otherwise.


getScreenSize

getScreenSize(@NonNull context: Context): Point

Gets the current screen size information.

Parameters

NameTypeDescription
contextContextnon null context that is a source of screen size information

Returns: @NonNull Point - the valid point information.


getScreenSizeScaled

getScreenSizeScaled(@NonNull screen_size: Point, height: int): Point

Provides the scaled width, based on the provided screen size information and the requested screen height.

Parameters

NameTypeDescription
screen_sizePointnon null point object containing information about the width and the height of the screen
heightintthe requested height of the screen

Returns: @NonNull Point - the scaled up/down screen size.

Events

RequestScreenSharePermissionEvent

Emitted when the sendUserPermissionRequest method is received. It asks the participant for a permission to share the screen.

Available in the package com.voxeet.sdk.services.screenshare.RequestScreenSharePermissionEvent.