2020 API AWARDS WINNER - BEST IN MEDIA APIs LEARN MORE

FilePresentationService

The FilePresentationService allows an application to present a file to the conference. The Voxeet service converts the user-provided file into multiple pages as images, accessible through the image method. The application can access the number of pages through the ImageCount API in the FilePresentation object.

Typical workflow of the app is:

For presenter:

  • The app calls the convert method to upload and convert a file.
  • The app receives a FilePresentation object through the converted event.
  • The app can display the converted file locally by retrieving individual images through the image method.
  • The app then starts presenting the file by calling the start method.
  • The app 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 updated page number to the participants.
  • The app calls the stop method to end the file presentation.
  • The app may choose to call the thumbnail method to obtain thumbnail images of the file to implement a carousel control for the presenting user to flip pages locally.

For viewers:

  • The app listens for the converted event.
  • The app receives a FilePresentation object through the converted event.
  • The app receives an updated event with the current page number.
  • The app downloads the page as image through the image method.
  • The app presents the image to the user.

Events

started

started(e: FilePresentation): void

Emitted when a file presentation is started.

example

VoxeetSDK.filePresentation.on("started", (e: FilePresentation) => {})

Parameters:

NameType
eFilePresentation

Returns: void


stopped

stopped(e: FilePresentation): void

Emitted when a file presentation is stopped.

example

VoxeetSDK.filePresentation.on("stopped", (e: FilePresentation) => {})

Parameters:

NameType
eFilePresentation

Returns: void


conversionProgress

conversionProgress(e: FileConversionProgress): void

Emitted when a file conversion is progressing.

example

VoxeetSDK.filePresentation.on(
  "conversionProgress",
  (e: FileConversionProgress) => {}
)

Parameters:

NameType
eFileConversionProgress

Returns: void


converted

converted(e: FilePresentation): void

Emitted when a file is converted.

example

VoxeetSDK.filePresentation.on("converted", (e: FilePresentation) => {})

Parameters:

NameType
eFilePresentation

Returns: void


updated

updated(e: FilePresentation): void

Emitted when a file presentation is updated.

example

VoxeetSDK.filePresentation.on("updated", (e: FilePresentation) => {})

Parameters:

NameType
eFilePresentation

Returns: void

Accessors

current

get current(): FilePresentation‹›

Provides the current file presentation.

Returns: FilePresentation‹›

Methods

convert

convert(file: string): any

Converts a 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 a converted event.

Parameters:

NameTypeDescription
filestringFile to be converted

Returns: any


image

image(page: number, fileId?: string): Promise‹string›

Returns the URL of a page as image during file presentation.

Parameters:

NameTypeDescription
pagenumberThe number of the presented page. Files that do not include any pages, for example jpg images, require setting the value of this parameter to 0.
fileId?stringThe file ID that allows presenting files without joining a conference.

Returns: Promise‹string›


start

start(file: FileConverted): any

Starts a file presentation after the file is converted by the voxeet service.

Parameters:

NameTypeDescription
fileFileConverted

Returns: any


stop

stop(): Promise‹any›

Stops the presentation

Returns: Promise‹any›


thumbnail

thumbnail(page: number, fileId?: string): Promise‹string›

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

Parameters:

NameTypeDescription
pagenumberThe number of the presented page. Files that do not include any pages, for example jpg images, require setting the value of this parameter to 0.
fileId?stringThe file ID that allows presenting files without joining a conference.

Returns: Promise‹string›


update

update(page: number): Promise‹any›

Updates the presentation to the corresponding page.

Parameters:

NameTypeDescription
pagenumber

Returns: Promise‹any›