android {
packagingOptions {
exclude 'META-INF/*.kotlin_module'
}
}
dependencies {
implementation "com.firework:sdk:+"
// Uncomment the next line if you want to integrate the single-host live stream
// implementation "com.firework.external.livestream:singleHostPlayer:+"
// Uncomment the next line if you want to integrate the multi-host live stream
// implementation "com.firework.external.livestream:multiHostPlayer:+"
}
configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.firework' && details.requested.name == 'sdk') {
details.useVersion rootProject.ext.get("fwNativeVersion")
}
if (details.requested.group == 'com.firework.external.livestream' && details.requested.name == 'singleHostPlayer') {
details.useVersion rootProject.ext.get("fwNativeVersion")
}
if (details.requested.group == 'com.firework.external.livestream' && details.requested.name == 'multiHostPlayer') {
details.useVersion rootProject.ext.get("fwNativeVersion")
}
}
}
App Id Configuration
iOS
Include the app ID in your app Info.plist file using the key FireworkVideoAppID .
See the image below:
Android
Include the appid in your app AndroidManifest.xml file, like below:
<application ... > <activity .../> ... // Include the app ID <meta-dataandroid:name="Firework:Appid"android:value="your firework appid" /> </application>
SDK Initialization
iOS
Import fw_flutter_sdk and call FWFlutterSDK.initializeSDK() in application(:, didFinishLaunchingWithOptions:) -> Bool
// If you have the modules below, you need to add the modules before the SDK init method// FWFlutterSDK.addLivestreamPlayerInitializer(SingleHostLivestreamPlayerInitializer())// FWFlutterSDK.addLivestreamPlayerInitializer(MultiHostLivestreamPlayerInitializer())// FWFlutterSDK.setImageLoader(GlideImageLoaderFactory.createInstance(this))// FWFlutterSDK.setImageLoader(PicassoImageLoaderFactory.createInstance(this)) FWFlutterSDK.init(this)
We support passing an option to the SDK initialization method. The sample codes are:
Step 2: Please check the Inject Image Loader section. Choose an image loader(Glide or Picasso) that works for you. If you're not sure which one to use, Glide image loader is recommended.
Dart
Call FireworkSDK.getInstance().markInitCalled() on the Dart side.
import'package:fw_flutter_sdk/fw_flutter_sdk.dart';/// Optional: set listener for SDK initFireworkSDK.getInstance().onSDKInit = (event) {};/// Although we call the initialization method on the native side, /// we also need to mark the initialization method as being called /// on the Dart side.FireworkSDK.getInstance().markInitCalled();
Please don't call FireworkSDK.getInstance().init() on the Dart side anymore.
Video Feed
If you want to integrate the video feed, please follow the instruction here.
Live stream support
If you want to integrate the live stream, please follow the instruction here.
Navigate to Flutter page from player
If you want to navigate Flutter page from player, please follow the instruction here.
Shopping
If you want to integrate video shopping, please follow the instruction here.