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 user-provided file into multiple pages (images) accessible through the image method.

Typical application workflow:

For presenter:

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

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

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

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

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

7. The application may choose to call thumbnail method to obtain thumbnail images of the file to implement a carousel control for the presenting participant to flip pages locally.

For viewers:

1. The application receives the converted event informing that the file is converted.

2. The application receives the FilePresentation object through the converted event.

3. The application receives the updated event with the current page number.

4. The application downloads the page as an image through the image method.

5. The application presents the image to the participant. Participants are notified about it through the started event.

6. The application receives the stopped event when the file presentation ends.

Events

converted

converted(fileConverted: VTFileConverted)

Emitted when a file is converted.

Parameters:

NameType
fileConvertedVTFileConverted

started

started(filePresentation: VTFilePresentation)

Emitted when a file presentation is started.

Parameters:

NameType
filePresentationVTFilePresentation

updated

updated(filePresentation: VTFilePresentation)

Emitted when a file presentation is updated.

Parameters:

NameType
filePresentationVTFilePresentation

stopped

stopped(filePresentation: VTFilePresentation)

Emitted when a file presentation is stopped.

Parameters:

NameType
filePresentationVTFilePresentation

Accessors

current

current: VTFilePresentation

Provides the current file presentation.

Returns: VTFilePresentation


delegate

delegate: VTFilePresentationDelegate

Delegate, a means of communication between objects in the file presentation service.

Returns: VTFilePresentationDelegate

Methods

convert

convert(path: URL, progress: (( progress: Double) -> Void)?, success: (( json: [String: Any]?) -> Void)?, fail: ((_ error: NSError) -> Void)?)

Converts the file before file presentation. The file is uploaded as FormData.

Supported file formats are:

  • doc/docx (Microsoft Word)
  • ppt/pptx
  • pdf

After conversion the files are broken into individual images with maximum resolution capped at 2560x1600.

When the file is converted and ready for the presentation, the application will receive the converted event.

Parameters:

NameTypeDefaultDescription
pathURL-The file path to convert
progress((_ progress: Double) -> Void)?nil-
success((_ json: [String: Any]?) -> Void)?--
fail((_ error: NSError) -> Void)?--

start

start(file: VTConvertedFile, completion: ((_ error: NSError?) -> Void)?)

Starts the file presentation.

Parameters:

NameTypeDefault
fileVTConvertedFile-
completion((_ error: NSError?) -> Void)?nil

update

update(page: Int, completion: ((_ error: NSError?) -> Void)?)

Sends the updated page number to the participants.

Parameters:

NameTypeDefault
pageInt-
completion((_ error: NSError?) -> Void)?nil

stop

stop( completion: ((_ error: NSError?) -> Void)?)

Stops the presentation.

Parameters:

NameTypeDefault
completion((_ error: NSError?) -> Void)?nil

image

image(page: Int): URL?

Displays the converted file locally by retrieving individual images (referring to specific pages of the file) during file presentation.

Parameters:

NameType
pageInt

Returns: URL?


thumbnail

thumbnail(page: number): URL?

Provides the URL of a thumbnail (referring to a specific page of a file) during file presentation.

Parameters:

NameType
pageInt

Returns: URL?