pubspec.yaml of your projectLiteAVSDK_Player or LiteAVSDK_Professional as needed.super_player:git:url: https://github.com/LiteAVSDK/Player_Flutterpath: Flutterref: Player_Premium
## Integration method after version 13.0. If not specified, the professional version is used by default:super_player:sub_spec: 'professional'# player: The basic version of the player, supporting video-on-demand (VOD) and basic live streaming.# professional: The full-featured version, typically used for integrating multiple Tencent plugins simultaneously.# premium: The advanced version of the player, including premium player capabilities.# professional_premium: Combines the full-featured version and the advanced player version, offering compatibility with the full-featured version while utilizing the advanced player features.dependencies:super_player:git:url: https://github.com/LiteAVSDK/Player_Flutterpath: Flutter# Integration method before version 13.0:# Here demonstrates the Professional versionsuper_player:git:url: https://github.com/LiteAVSDK/Player_Flutterpath: Flutterref: Professional
tag that ref depends on as follows:## Integration method after version 13.0. If not specified, the professional version is used by default:super_player:sub_spec: 'professional'# player: The basic version of the player, supporting video-on-demand (VOD) and basic live streaming.# professional: The full-featured version, typically used for integrating multiple Tencent plugins simultaneously.# premium: The advanced version of the player, including premium player capabilities.# professional_premium: Combines the full-featured version and the advanced player version, offering compatibility with the full-featured version while utilizing the advanced player features.dependencies:super_player:git:url: https://github.com/LiteAVSDK/Player_Flutterpath: release_v13.0.0# Integration method before version 13.0:# release_pro_v12.0.0 indicates the integration of Android version# TXLiteAVSDK_Professional_12.0.0.14681 and iOS version TXLiteAVSDK_Professional_12.0.16292.super_player:git:url: https://github.com/LiteAVSDK/Player_Flutterpath: Flutterref: release_pro_v12.0.0
## Integration method after version 13.0. If not specified, the professional version is used by default:super_player:sub_spec: 'professional'# player: The basic version of the player, supporting video-on-demand (VOD) and basic live streaming.# professional: The full-featured version, typically used for integrating multiple Tencent plugins simultaneously.# premium: The advanced version of the player, including premium player capabilities.# professional_premium: Combines the full-featured version and the advanced player version, offering compatibility with the full-featured version while utilizing the advanced player features.dependencies:# Prior to version 13.0, pub integration defaulted to the professional version, whereas after version 13.0, the version can be specified via the sub_spec method mentioned above.super_player: ^13.0.0
flutter pub get
flutter pub upgrade
AndroidManifest.xml.<!--network permission--><uses-permission android:name="android.permission.INTERNET" /><!--storage--><uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /><uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<?xml version="1.0" encoding="utf-8"?><network-security-config><domain-config cleartextTrafficPermitted="true"><domain includeSubdomains="true">127.0.0.1</domain></domain-config></network-security-config>
<?xml version="1.0" encoding="utf-8"?><manifest ... ><application android:networkSecurityConfig="@xml/network_security_config"... >...</application></manifest>
build.gradle in the Android directory uses mavenCenter and can successfully download dependencies.repositories {mavenCentral()}
compileSdkVersion 31defaultConfig {applicationId "com.tencent.liteav.demo"minSdkVersion 19targetSdkVersion 31versionCode flutterVersionCode.toInteger()versionName flutterVersionName}
xmlns:tools="http://schemas.android.com/tools" to the root manifest tag in the AndroidManifest.xml file. Here is an example:<manifestxmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"package="com.example.player"><!-- your config...... --></manifest>
tools:replace="android:label" to the application node. Here is an example:<applicationandroid:label="super_player_example"android:icon="@mipmap/ic_launcher"android:requestLegacyExternalStorage="true"tools:replace="android:label"><!-- your config...... --></application>
build folder in the Android directory or run the following command to force a refresh../gradlew build
Info.plist on iOS:<key>NSAppTransportSecurity</key><dict><key>NSAllowsArbitraryLoads</key><true/></dict>
#pod 'TXLiteAVSDK_Player_Premium' //Player_Premium Editionpod 'TXLiteAVSDK_Player' // Player Edition
LiteAVSDK_Professional:pod 'TXLiteAVSDK_Professional' // Professional Edition
TXLiteAVSDK_Player will be installed.rm -rf Podsrm -rf Podfile.lockpod update
Deployment Info tab on the General page of the iOS project configuration. You can check all options as shown in the figure below:
Background Modes tab on the Signing & Capabilities page of the iOS project configuration to enable the picture-in-picture capability for your project, as shown in the figure below:
String licenceURL = ""; // The license URL obtainedString licenceKey = ""; // The license key obtainedSuperPlayerPlugin.setGlobalLicense(licenceURL, licenceKey);
TXVodPlayerController or live playback API class TXLivePlayerController for custom development. You can refer to the demos we provide (DemoTXVodPlayer and DemoTXLivePlayer in example).SuperPlayerController encapsulates VOD playback and live playback capabilities and includes basic UI elements.example/lib/superplayer) to your project for custom development.No visible @interface for 'TXLivePlayer' declares the selector 'startLivePlay:type:' occur on iOS.
Run the following command to update the iOS SDK:rm -rf Podsrm -rf Podfile.lockpod update
tencent_trtc_cloud and Flutter player are integrated at the same time.java. lang.RuntimeException: Duplicate class com.tencent.liteav.TXLiteAVCode found in modules classes.jartencent_trtc_cloud and the Flutter player both depend on the same version of LiteAVSDK_Professional.TXLiteAVSDK_Professional_10.3.0.11196 for Android or TXLiteAVSDK_Professional to 10.3.12231 for iOS, the dependency declaration is as follows:tencent_trtc_cloud: 2.3.8super_player:git:url: https://github.com/LiteAVSDK/Player_Flutterpath: Flutterref: release_pro_v1.0.3.11196_12231
dispose method of the player to release the player.flutter doctor command to check the runtime environment until "No issues found!" is displayed.flutter pub get to ensure that all dependent components have been updated successfully.Attribute application@label value=(super_player_example) from AndroidManifest.xml:9:9-45is also present at [com.tencent.liteav:LiteAVSDK_Player:10.8.0.13065] AndroidManifest.xml:22:9-41 value=(@string/app_name).Suggestion: add 'tools:replace="android:label"' to <application> element at AndroidManifest.xml:8:4-51:1
xmlns:tools="http://schemas.android.com/tools" to the root manifest tag in your Android project directory's AndroidManifest.xml. Then, add tools:replace="android:label" to the application node. This will override the label attribute and resolve the conflict.uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:super_player]
app directory, and modify the minSdkVersion in the build.gradle file to 19./sdcard/Android/data/packagename/files/log/tencent/liteav, while on the iOS platform, the logs are saved in the sandbox/Documents/log directory. class TXLogLevel {static const LOG_LEVEL_VERBOSE = 0; // Output logs of all levels.static const LOG_LEVEL_DEBUG = 1; // Output logs of DEBUG, INFO, WARNING, ERROR, and FATAL levels.static const LOG_LEVEL_INFO = 2; // Output logs of INFO, WARNING, ERROR, and FATAL levels.static const LOG_LEVEL_WARN = 3; // Output logs of WARNING, ERROR, and FATAL levels.static const LOG_LEVEL_ERROR = 4; // Output logs of ERROR and FATAL levels.static const LOG_LEVEL_FATAL = 5; // Only output logs of FATAL level.static const LOG_LEVEL_NULL = 6; // Do not output any SDK logs.}
Errors :'incompatible types', error: initializing 'BOOL' (aka 'bool') with an expression of incompatible type 'void', etc., are caused by SDK updates, which make the SDK incompatible with the native code in the Flutter end. In this case, you only need to update the SDK version.flutter pub cache cleanflutter cleanflutter pub upgradeflutter pub get
rm -rf Podsrm -rf Podfile.lockpod update
.pub-cache on your computer. Then refresh the Flutter pub dependencies and compile and run the project again.-keep class com.tencent.** { *; }
CocoaPods could not find compatible versions for pod "Flutter" or similar are reported.Feedback