2020 API AWARDS WINNER - BEST IN MEDIA APIs LEARN MORE

FilePresentationService

The FilePresentationService allows an application to present a file during the conference. The Voxeet service converts the participant provided file into multiple pages (as images) accessible through the getImage method.

Typical application workflow:

1. The application calls the convertFile method to upload and convert a file.

2. The application can display the converted file locally by retrieving individual images through the getImage method.

3. The application then starts presenting the file by calling the start method.

4. The application is responsible for coordinating the page flip between local and presented files. It needs to call the update method to inform the service to send the updated page number to the participants.

5. The application calls the stop method to end the file presentation.

6. The application may choose to call the getThumbnail method to obtain thumbnail images of the file to implement a carousel control for the presenting participant to flip pages locally. This way of flipping pages can be also used for standard size images by using the getImage method.

The application receives information about changes during the file presentation through the FilePresentation event.

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

Methods

getImage

getImage(fileId: String, pageNumber: int): String

Displays the converted file locally by retrieving URLs of individual images.

Parameters

NameTypeDescription
fileIdStringthe ID of the remote file
pageNumberintthe requested page number

Returns: @NonNull String - the formatted string.

getThumbnail

getThumbnail(fileId: String, pageNumber: int): String

Obtains URLs of thumbnail images of the file to implement a carousel control for the presenting participant to flip pages locally.

Parameters

NameTypeDescription
fileIdStringthe ID of the remote file
pageNumberintthe requested page number

Returns: @NonNull String - the formatted string.

convertFile

convertFile(@NonNull file: File): Promise<FilePresentation>

Starts uploading and converting the local file and waits for its management on the server side.

Parameters

NameTypeDescription
fileFilenon null valid file to uploa

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

start

start(@NonNull body: FilePresentationConverted): Promise<FilePresentation>

Starts presenting the converted file.

Parameters

NameTypeDescription
bodyFilePresentationConvertednon null valid descriptor of the file

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

start

start(@NonNull body: FilePresentationConverted, position: int): Promise<FilePresentation>

Starts presenting the specific page of the converted file.

Parameters

NameTypeDescription
bodyFilePresentationConvertednon null valid descriptor of the file
positionintthe starting position

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

stop

stop(@NonNull fileId: String): Promise<FilePresentation>

Stops presenting the file.

Parameters

NameTypeDescription
fileIdStringnon null ID of the file

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

update

update(@NonNull fileId: String, position: int): Promise<FilePresentation>

Changes the position (page of the presented file) to the specific one in the current presentation.

Parameters

NameTypeDescription
fileIdStringnon null ID of the file
positionintthe new position (page of the presented file)

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

Events

FilePresentationStarted

Emitted when one of the conference participants starts presenting a file.

Available in the package com.voxeet.sdk.json.FilePresentationStarted.

This object can be accessed through the Websocket usage.

FilePresentationStarted

FilePresentationStarted()

conferenceId (String)

The ID of the conference.

userId (String)

The ID of the conference participant that shares a file.

imageCount (int)

The number of images of the presented file.

fileId (String)

The ID of the presented file.

position (int)

The currently displayed file.#### isOwner

isOwner(): boolean

Returns: boolean

getType

getType(): String

Returns: String

FilePresentationUpdated

Emitted when the participant changes the position (page) of the presented file.

Available in the package com.voxeet.sdk.json.FilePresentationUpdated.

This object can be accessed through the Websocket usage.

FilePresentationUpdated

FilePresentationUpdated()

conferenceId (String)

The ID of the conference.

userId (String)

The ID of the conference participant that shares a file.

fileId (String)

The ID of the presented file.

position (int)

The currently displayed file.#### getType

getType(): String

Returns: String

FilePresentationStopped

Emitted when the participant ends the file presentation.

Available in the package com.voxeet.sdk.json.FilePresentationStopped.

This object can be accessed through the Websocket usage.

conferenceId (String)

The ID of the conference.

userId (String)

The ID of the conference participant that shares a file.

fileId (String)

The ID of the presented file.