Skip to main content

Setup

What's Included

The library package would include the following:

  • Android Archive Library
  • Debug (.aar)
  • Release (.aar)
  • Sample App

Support

  • Minimum Android SDK Version : 21
  • Minimum Java Version : 1.8
  • Recommended Gradle version : 4.2.2

Gradle Build System Changes

  • Root build.gradle
   buildscript {
repositories {
google()
jcenter()
gradlePluginPortal() //https://plugins.gradle.org/m2/
}
dependencies {
classpath "com.android.tools.build:gradle:4.2.2"
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10'
}
}
  • Application's build.gradle
  plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-kapt'
}

repositories {
flatDir {
google()
mavenCentral()
// The FL libraries can go into the below folder
dirs "$rootDir/libs/fl"
}
}

android {
compileSdk 31

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}
defaultConfig {
// application specific configs
minSdkVersion 21
targetSdkVersion 33
}
packagingOptions {
exclude 'META-INF/kotlin-stdlib.kotlin_module'
}
buildTypes {
debug {
debuggable true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt')
}
release {
debuggable false
minifyEnabled true
signingConfig signingConfigs.Default
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-release.pro'
}
}
}

dependencies {
// FL Dependencies
debugImplementation(name:'fl-foundation-debug', ext:'aar')
releaseImplementation(name:'fl-foundation', ext:'aar')
debugImplementation(name:'fl-player-interface-debug', ext:'aar')
releaseImplementation(name:'fl-player-interface', ext:'aar')
debugImplementation(name:'fl-player-debug', ext:'aar')
releaseImplementation(name:'fl-player', ext:'aar')

//moshi library => Transitive dependency for FL's foundation Library
implementation "com.squareup.moshi:moshi:1.13.0"
kapt 'com.squareup.moshi:moshi-kotlin-codegen:1.13.0'
kaptTest 'com.squareup.moshi:moshi-kotlin-codegen:1.13.0'

//okhttp3 => Transitive dependency for FL's foundation Library
implementation("com.squareup.okhttp3:okhttp:4.9.3")

// Exoplayer Dependencies
implementation 'com.google.android.exoplayer:exoplayer-core:2.18.4'
implementation 'com.google.android.exoplayer:exoplayer-ui:2.18.4'
implementation 'com.google.android.exoplayer:exoplayer-dash:2.18.4'
implementation 'com.google.android.exoplayer:exoplayer-hls:2.18.4'
implementation 'com.google.android.exoplayer:exoplayer-smoothstreaming:2.18.4'
implementation 'com.google.android.exoplayer:extension-mediasession:2.18.4'

// Kotlin dependencies
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.72'

// Kotlin Coroutines
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4"

// Android Dependencies
implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'

//lifecycle
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0'
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.4.0"
implementation "androidx.lifecycle:lifecycle-viewmodel-savedstate:2.4.0"
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"

// Material UI
implementation 'com.google.android.material:material:1.4.0'
}

The Quickplay, Moshi, OkHttp3, Kotlin and Exoplayer dependencies are mandatory for basic playback features. According to the UI preferences, the above-mentioned Android dependencies (and more) can be added as required. As more features / FL Libraries are added, the corresponding dependent libraries should also be added.

note

Quickplay Player library code uses ProGuard rules to obfuscate sensitive internal logic and only public APIs are not obfuscated. When building the final version of your app (“release” build type) you enable R8 code shrinking, obfuscation, and optimization by setting isMinifyEnabled flag to true (see the build.gradle example above) you may encounter a runtime crash as a result of Quickplay Player library public API being obfuscated. In order to avoid that you must add to your application project’s proguard rules file a new rule: -keep class com.quickplay.vstb7.** {*;}

If using fl-analytics library you must add to your application project’s proguard rules file a new rule

  • -keep class com.datazoom.collector.** {*;}
  • -keep class com.dz.collector.android.** {*;}