Display files using Fastboard

Updated

Display and manage files in Fastboard.

The Agora Fastboard SDK supports inserting and displaying multiple types of files on the whiteboard, such as images, audio and video, and documents. This enables users to quickly share information in compelling ways in order to create an immersive experience.

This page describes how to call the Fastboard SDK's APIs to insert images, present documents, and play audio and video on the whiteboard.

Understand the tech

Fastboard provides APIs for displaying files in the whiteboard main window or sub-windows.

Prerequisites

  • Integrate Fastboard in your project and join the room. See Join the whiteboard room.
  • Prepare publicly accessible asset URLs.
  • Make sure file formats are supported, and enable file conversion before presenting documents.

Project setup

Insert Images

Fastboard provides the insertImage method for inserting and displaying an image in the main window of the whiteboard.

fastRoom.join { room ->
    room.insertImage(
        "https://flat-storage.oss-accelerate.aliyuncs.com/cloud-storage/2022-02/15/ebe8320a-a90e-4e03-ad3a-a5dc06ae6eda/ebe8320a-a90e-4e03-ad3a-a5dc06ae6eda.png",
        512,
        512
    )
}

Play audio and video

Fastboard integrates the media player extension and provides the insertVideo method.

fastRoom.join { room ->
    room.insertVideo(
        "https://flat-storage.oss-accelerate.aliyuncs.com/cloud-storage/2022-02/15/55509848-5437-463e-b52c-f81d1319c837/55509848-5437-463e-b52c-f81d1319c837.mp4",
        "test1.mp4"
    )
}

Present documents

Fastboard integrates the docs viewer and slide extensions and provides the insertDocs method.

fastRoom.join { room ->
    val params = FastInsertDocParams(
        "Task UUID",
        "Task Token",
        "pptx",
        "My PPT"
    )
    room.insertDocs(params, object : FastResult<String> {
        override fun onSuccess(value: String) {
        }
        override fun onError(exception: Exception?) {
        }
    })
}

Reference

Run the project. You can see the inserted image, media window, or converted document on the whiteboard after the app refreshes.