Push SDK for Flutter is a stream ingest tool developed based on the native Push SDKs for Android and iOS. This topic describes how to use the demo of Push SDK for Flutter.
Demo download
For the demo source code and package of the latest version of the Push SDK, see Download SDK.
Demo compilation
Environment requirements
Item | Requirement |
Flutter version | Version 2.5.0 and later, but earlier than 3.0.0. Recommended: Version 2.8.0. |
Dart version | Version 2.12.0 and later, but earlier than 3.0.0. |
System version |
|
CPU architecture | armeabi-v7a or arm64-v8a |
Development tool |
Procedure
IDE
Android Studio
Open the project.
In Android Studio, click Open, select the
flutter_livepush_pluginproject, and open theexampledirectory.Install dependencies.
Click the
pubspec.yamlfile, then click thePub Getbutton in the upper-right corner to install dependencies.Configure the device.
Make sure an Android device is connected.
Run the application.
Click the green button
Runin the toolbar and select the target device to run the application.
Visual Studio Code
Open the project.
Launch Visual Studio Code. Select File > Open Folder, select the
flutter_livepush_pluginproject, and open theexampledirectory.Install dependencies.
In the example directory, open the command line and run the following command:
flutter pub getConfigure the device.
Make sure an Android or iOS device is connected. Use the device selector in the bottom left corner to select the target device.
Run the application.
Press
F5or click theRun and Debugicon in the left-side activity bar, select theFlutterconfiguration, and start the debugging session.
Xcode (iOS)
Open the project.
Click the
flutter_livepush_pluginproject and open theiosdirectory under theexampledirectory.Install CocoaPods dependencies.
Open the command line in the
iosdirectory and run the following command:pod installConfigure signing.
In Xcode, select the
Runnerproject, click the Signing & Capabilities tab, and configure a valid developer account and signing certificate.Run the application.
Click the icon
▶️in the Xcode toolbar and select the target device.
Command line
Go to flutter_livepush_plugin > example and open the command line.
Install dependencies.
flutter pub getCompile the project.
Android
ImportantBefore compiling, make sure Android SDK and Gradle are installed.
Execute the following command to run the program:
# Run debug version flutter run --debug # Run release version flutter run --releaseExecute the following command to package the APK file.
flutter build apkNoteThe APK file is located at
build/app/outputs/flutter-apk/app-release.apk.
iOS
ImportantBefore compiling, make sure Xcode and CocoaPods are installed.
Initialize CocoaPods dependencies.
cd ios && pod install && cd ..Execute the following command to run the program:
# Run debug version flutter run --debug # Run release version flutter run --releaseExecute the following command to package the IPA file:
flutter build ipaNoteThe IPA file is located at
build/ios/ipa/Runner.ipa.
FAQ
Other compilation issues
Check whether your Flutter version meets the environment requirements.
How do I obtain an ingest URL?
To obtain an ingest URL, see Generate ingest and streaming URLs.
Why did I fail to ingest a stream using the demo?
Use the troubleshooting tool to check if the ingest URL is valid.
How do I obtain information about ingested audio and video streams?
Go to Stream Management in the console and click Active Streams to view and manage the ingested audio and video streams.
How do I play a stream?
After starting stream ingest, you can use a player, such as ApsaraVideo Player, FFplay, and VLC, to test stream pulling. To obtain a streaming URL, see Generate ingest and streaming URLs.
