2020 API AWARDS WINNER - BEST IN MEDIA APIs LEARN MORE

ScreenShareService

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

Typical application workflow:

1. The application calls the sendRequestStartScreenShare method that asks for permission to share the screen.

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 (getScreenSize), modifies it (setScreenSizeInformation), or scales the screen (getScreenSizeScaled).

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<Boolean>

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

Parameters

NameTypeDescription
providerVideoCapturerProvidernon null provider of VideoCapturer

Returns: @NonNull Promise<Boolean> - the promise to resolve.

startScreenShare

startScreenShare(@NonNull intent: Intent): Promise<Boolean>

Starts sharing the screen.

Parameters

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

Returns: @NonNull Promise<Boolean> - the promise to resolve.

stopScreenShare

stopScreenShare(): Promise<Boolean>

Stops sharing the screen.

Returns: @NonNull Promise<Boolean> - the promise to resolve.

setScreenSizeInformation

setScreenSizeInformation(@NonNull point: Point): ScreenShareService

Changes future ScreenShare propagation information.

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

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
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

Gets the scaled width (from the given screen information) according to the requested 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 about permission to share the screen.

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