AgoraIO / video-sdk-samples-flutter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Agora Video SDK reference app for Flutter

This repository holds the complete code examples presented in the Agora Video SDK for Flutter documentation. The reference app demonstrates use of Agora Video SDK for real-time audio and video communication. It is a robust and comprehensive documentation reference app, designed to enhance your productivity and understanding. It's built to be flexible, easily extensible, and beginner-friendly.

Prerequisites

Before getting started with this example app, please ensure you have the following set up:

  • An Agora account and project.
  • 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 Android:
    • Android Studio on macOS or Windows (latest version recommended)
    • An Android emulator or a physical Android device.
  • If your target platform is iOS:
    • Xcode on macOS (latest version recommended)
    • A physical iOS device
    • iOS version 12.0 or later
  • If you are developing a desktop application for Windows, macOS or Linux, make sure your development device meets the requirements specified in Desktop support for Flutter.

Run the App

  1. Clone the repository

    To clone the repository to your local machine, open Terminal and navigate to the directory where you want to clone the repository. Then, use the following command:

    git clone https://github.com/AgoraIO/video-sdk-samples-flutter.git
  2. Open the project

    Launch Android Studio. From the File menu, select Open... and navigate to the flutter-reference-app folder. Start Gradle sync to automatically install all project dependencies.

  3. Modify config.json

    The app loads connection parameters from the config.json file. Ensure that the file is populated with the required parameter values before running the application.

    • uid: The user ID associated with the application.
    • appId: (Required) The unique ID for the application obtained from Agora Console.
    • channelName: The default name of the channel to join.
    • rtcToken: An RTC (Real-Time Communication) token generated for the channelName. You can generate a temporary token using Agora Console.
    • serverUrl: The URL for the token generator. See Secure authentication with tokens for information on how to set up a token server.
    • tokenExpiryTime: The time in seconds after which a token expires.

    If a valid serverUrl is specified, all examples use the token server to obtain a token except the SDK quickstart project that uses the rtcToken. If a serverUrl is not specified, all examples except Secure authentication with tokens use the rtcToken from config.json.

  4. Launch Android Studio or the IDE of your choice. From the File menu, select Open... then choose the flutter_reference_app folder.

  5. Run the following command to install the project's dependencies:

    flutter pub get
  6. Connect an Android device to your development machine.

  7. In the IDE, click Run app or run the following command:

    flutter run

    A moment later, you see the project installed on your device.

  8. From the main app screen, choose and launch an example.

Examples

This reference app includes several examples that illustrate the functionality and features of Agora Video/Voice SDK. Each example is self-contained and the relevant code can be found in its own folder in the lib directory. For more information about each example, see the README file within the directory.

Contact

If you have any questions, issues, or suggestions, please file an issue in our GitHub Issue Tracker.

About


Languages

Language:Dart 99.9%Language:Kotlin 0.1%