This topic provides an overview of ApsaraVideo Player SDK for Flutter and describes how to integrate ApsaraVideo Player SDK for Flutter.
Environment requirements
Item | Requirement |
---|---|
Flutter version | Flutter 3.3.0 on the Stable channel |
Dart version | Dart 2.18.0 |
OS version | Android 5.0 or later |
Mobile phone processor | armeabi-v7a or arm64-v8a |
Development tool | Recommended: Android Studio or Visual Studio (VS) Code |
SDK download
- To download Flutter SDK, visit Flutter SDK.
- To download the latest version of ApsaraVideo Player SDK for Flutter, visit SDK overview and download.
- To download the ApsaraVideo Player SDK for Flutter plug-ins (provided in patches on ApsaraVideo Player SDK for Flutter), visit ApsaraVideo Player SDK for Flutter plug-ins.
Project description
The native layer of ApsaraVideo Player SDK for Flutter is based on ApsaraVideo Player SDK for Android and ApsaraVideo Player SDK for iOS. The source code is included in the dependencies of the demo. You can modify the source code based on your business requirements.

The following table describes the folders in the directory.
Folder | Description | Required |
---|---|---|
android | The native code for Android and ApsaraVideo Player SDK for Android. | Yes |
ios | The native code for iOS and ApsaraVideo Player SDK for iOS. | Yes |
lib | The code of the API for Flutter. | Yes |
example | The demo of ApsaraVideo Player for Flutter. | No |
Limits
ApsaraVideo Player SDK for Android does not support emulators. After the integration is complete, you must run the SDK on a device.
Integration
- Start VS Code.
- Choose .
- Enter flutter and select Flutter: New Project.
- Enter a project name such as myapp and press the Enter key.
- Specify a location for storing the project and click OK. Wait for the project creation to finish. When the main.dart file appears, the project is created.
- Integrate ApsaraVideo Player SDK for Flutter into your project. You can integrate ApsaraVideo Player SDK for Flutter by adding flutter_aliplayer as a dependency to the pubspec.yaml file of the project.
dependencies: flutter_aliplayer: ^version # version specifies the version number of ApsaraVideo Player SDK for Flutter, such as 5.4.0. Replace version with the actual version number.
- Optional:If your business scenario requires RTS, add the following dependencies. For more information about RTS, see Overview. You can use one of the following methods:Note The version numbers used in the following examples are for reference only. For more information about the latest versions of ApsaraVideo Player SDK, see Release notes for ApsaraVideo Player SDK for Android and Release notes for ApsaraVideo Player SDK for iOS. For more information about the latest versions of RTS SDKs, see Download SDKs.
- Method 1: Implement integration on the native layer of your Android or iOS deviceAndroid: Include the dependencies in the build.gradle file. Example:
dependencies{ implementation 'com.aliyun.sdk.android:AlivcArtc:$version' implementation 'com.aliyun.rts.android:RtsSDK:$version' } # In com.aliyun.sdk.android:AlivcArtc:$version, $version specifies the version number of ApsaraVideo Player SDK for Android. In com.aliyun.rts.android:RtsSDK:$version, $version specifies the version number of RTS SDK for Android. Examples: 'com.aliyun.sdk.android:AlivcArtc:5.4.9.1' and 'com.aliyun.rts.android:RtsSDK:2.5.0'.
iOS: Include the dependencies in the Podfile file. Example:target 'Runner' do flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) pod 'AliPlayerSDK_iOS_ARTC', '$version' #$version specifies the version number of ApsaraVideo Player SDK for iOS. Example: 5.4.9.1. pod 'RtsSDK', '$version' #$version specifies the version number of RTS SDK for iOS. Example: 2.5.0. end
- Method 2: Use the Flutter plug-in
Update support for this method has ended. You cannot obtain the latest versions of RTS SDK and ApsaraVideo Player SDK by using the Flutter plug-in. You can obtain the version numbers of RTS SDK and ApsaraVideo Player SDK from the CHANGELOG.md file of the
flutter_aliplayer
project.flutter_aliplayer_artc: ^version flutter_aliplayer_rts: ^version # version specifies the version number. Examples: flutter_aliplayer_artc: ^5.2.3 and flutter_aliplayer_rts: ^1.5.0. Replace version with the actual version number.
- Method 1: Implement integration on the native layer of your Android or iOS device
FAQ
Can I debug apps on the Xcode simulator after I integrate ApsaraVideo Player SDK on iOS devices?
setFilterConfig:
, updateFilterConfig:
, and setFilterInvalid:
and the code that is used to call these operations in ApsaraVideo Player SDK for Flutter. 