Skip to main content
Android
iOS
macOS
Web
Windows
Electron
Flutter
React Native
Python
React JS
Unity
Unreal Engine
Unreal (Blueprint)

Integrate an extension

Extensions are add-ons designed to rapidly extend the functionality of your app. Extensions Marketplace is home to extensions that make your app more fun. Extensions provide features such as Audio effects and voice changing, Face filters and background removal, and Live transcription and captioning.

In the Agora Extensions Marketplace:

  • Vendors create and publish extensions to provide functionality such as audio and video processing.
  • App developers use extensions to quickly implement fun and interactive functionality.

This page shows you how to integrate an extension from Agora Extensions Marketplace into your app. There can be specific guidance for each extension.

Understand the tech

An extension accesses voice and video data when it is captured from the user's local device, modifies it, then plays the updated data to local and remote video channels.

img

A typical transmission pipeline consists of a chain of procedures, including capture, pre-processing, encoding, transmitting, decoding, post-processing, and play. Audio or video extensions are inserted into either the pre-processing or post-processing procedure, in order to modify the voice or video data in the transmission pipeline.

Prerequisites

To test the code used in this page you need to have:

  • Flutter 2.0.0 or higher

  • Dart 2.15.1 or higher

  • Android Studio, IntelliJ, VS Code, or any other IDE that supports Flutter, see Set up an editor.

  • If your target platform is iOS:

    • Xcode on macOS (latest version recommended)
    • A physical iOS device
    • iOS version 12.0 or later
  • If your target platform is Android:

    • Android Studio on macOS or Windows (latest version recommended)
    • An Android emulator or a physical Android device.
  • If you are developing a desktop application for Windows, macOS or Linux, make sure your development device meets the Flutter desktop development requirements.

  • An Agora account and project.

  • A computer with Internet access.

    Ensure that no firewall is blocking your network communication.

Project setup

In order to integrate an extension into your project:

  1. Activate an extension

    1. Log in to Agora Console.

    2. In the left navigation panel, click Extension Marketplace, then click the extension you want to activate.

      You are now on the extension detail page.

    3. Select a pricing plan and click Buy and Activate.

      • If you have already created an Agora project:

        The Projects section appears and lists all of your projects.

      • If you have not created an Agora project:

        Create a new project, the project appears in the Projects section.

    4. Under Projects on the extension detail page, find the project in which you want to use the extension, then turn on the switch in the Action column.

  2. Get the apiKey and apiSecret for the extension

    If required for the extension, to get the extension apiKey and apiSecret, in the Projects extension detail page, click View in the Secret column.

  1. Open your Flutter project

    Load the SDK quickstart Voice Calling project you created previously.

  2. Get the extension

    Visit the Agora Extensions Marketplace and follow the procedure to download and install the desired extension.

You are now ready to integrate the extension in your app.

Integrate the extension into your project

This section presents the framework code you add to your Flutter project to integrate an extension.

  1. Load the extension provider

    You call loadExtensionProvider during Agora Engine initialization to specify the extension library path. To do this, add the following code to the setupVideoSDKEngine method after you initialize the engine with agoraEngine.initialize:

    agoraEngine.loadExtensionProvider("<extensionLibraryPath>");
    Copy
  2. Enable the extension

    To enable the extension, add the following code to the setupVideoSDKEngine method before await agoraEngine.enableVideo();:

    // Extensions marketplace hosts both third-party extensions as well as those developed by Agora. To use an Agora extensions, you do not need to call addExtension or enableExtension.
    agoraEngine.enableExtension(
    provider: "<The name of the extension provider>",
    extension: "<extensionName>",
    type: MediaSourceType.unknownMediaSource,
    enable: true
    );
    Copy

    If the extension uses the second camera to capture video, set the type parameter to secondaryCameraSource.

    To enable multiple extensions, call enableExtension for each extension. The calls to enableExtension determines the order of each extension in the transmission pipeline. For example, if you enable extension A before extension B, extension A processes data from Video SDK before extension B.

  3. Set extension properties

    To customize the extension for your particular app, set suitable values for the extension properties. Refer to the extension documentation for a list of available property names and allowable values. To set a property, add the following code to the setupVideoSDKEngine method after agoraEngine.enableExtension:

    agoraEngine.setExtensionProperty(
    provider: "<providerName>",
    extension: "<extensionName>",
    key: "<keyName>",
    value: "<keyValue>");
    Copy

Test your implementation

To ensure that you have integrated the extension in your app:

  1. Set the variables and properties in the framework code to values suitable for your chosen extension.

  2. In your IDE, open /lib/main.dart and update appId, channelName and token with the values from Agora Console.

  3. Connect a test device to your development device.

  4. In your IDE, click Run app or execute the flutter run command in the terminal. A moment later, you see the project installed on your device.

    If this is the first time you run the app, grant camera and microphone permissions.

  5. Join the same channel from another test device or the Agora web demo.

  6. Experience the features of your new extension.

Reference

This section contains content that completes the information on this page, or points you to documentation that explains other aspects to this product.

Voice Calling