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<Boolean>
Starts sharing the screen of an external device during a conference.
Parameters
Name | Type | Description |
---|---|---|
provider | VideoCapturerProvider | non null provider of VideoCapturer |
Returns: @NonNull Promise<Boolean> - the promise to resolve.
startScreenShare
▸ startScreenShare(@NonNull intent
: Intent): Promise<Boolean>
Starts sharing the screen.
Parameters
Name | Type | Description |
---|---|---|
intent | Intent | non 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 the size of the shared screen.
Parameters
Name | Type | Description |
---|---|---|
point | Point | non 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
Name | Type | Description |
---|---|---|
activity | Activity | non 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
Name | Type | Description |
---|---|---|
activity | Activity | non null valid activity used to start the system and get the callback result |
full_quality | boolean | flag 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
Name | Type | Description |
---|---|---|
requestCode | int | the obtained requestCode |
resultCode | int | the obtained resultCode |
data | Intent | non 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
Name | Type | Description |
---|---|---|
context | Context | non 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
Name | Type | Description |
---|---|---|
screen_size | Point | non null point object containing information about the width and the height of the screen |
height | int | the 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.
Updated about 1 year ago