# Installation

ByteArk Player SDK for Flutter is published on pub.dev (opens new window). You can add it as a dependency in your Flutter project.

# Requirements

Item Version
Flutter 3.22.0 or higher
Dart SDK 3.5.0 or higher
iOS Deployment Target iOS 14.0 or higher
Android Min SDK API 21 (Android 5.0) or higher

# Add the dependency

Edit your project's pubspec.yaml:

dependencies:
  byteark_player_flutter: ^1.1.6
1
2

Then run:

flutter pub get
1

Or use flutter pub add:

flutter pub add byteark_player_flutter
1

# iOS setup

Open ios/Podfile and set the platform:

platform :ios, '14.0'
1

Then run:

cd ios && pod install
1

For Picture-in-Picture or Background Audio, open your Xcode project's Capabilities and enable Background Mode "Audio, AirPlay, and Picture in Picture".

# Android setup

In android/app/build.gradle, ensure minSdk is at least 21:

android {
  defaultConfig {
    minSdk 21
  }
}
1
2
3
4
5

In your app's AndroidManifest.xml, add the required permissions:

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
1
2

# License key

ByteArk Player SDK requires separate license keys for iOS and Android. Contact sales@byteark.com to request your license keys.

The license keys are used when creating ByteArkPlayerConfig via ByteArkPlayerLicenseKey:

final config = ByteArkPlayerConfig(
  licenseKey: ByteArkPlayerLicenseKey(
    android: "<ANDROID_LICENSE_KEY>",
    iOS: "<IOS_LICENSE_KEY>",
  ),
  playerItem: playerItem,
);
1
2
3
4
5
6
7