Getting started

Update notice

This section contains documentation for the legacy version of the Wowza Flowplayer Android SDK. To continue working with the SDK, we recommend that you migrate to version 4. The legacy version of the SDK is not actively maintained and will be retired on February 1, 2024.

This article provides an introduction to the core features of the Flowplayer Android SDK and lists all the requirements for adding the SDK in an Android project. This guide assumes that you have basic understanding of Android development and that you are familiar with Android Studio and Gradle.

The Wowza Flowplayer Android SDK is a native media player. It's written entirely in Kotlin and provides an easy-to-use API that enables developers to create beautiful Android applications that play audio and video both locally and over the Internet. The Wowza Flowplayer Android SDK uses ExoPlayer in its core so it takes advantage of all its powerful and well-tested features. The SDK supports adaptive streaming technologies such as DASH, HLS, and SmoothStreaming, as well as the most popular single container formats, such as MP4, MP3, WebM, and several more.

Our demo application is available open source on Github and it will help you better understand how to include the Wowza Flowplayer Android SDK in your Android project.

Supported features

Some of the most important features of the Wowza Flowplayer Android SDK include, but, are not limited to:

  • DASH, HLS, SmoothStreaming, MP4, WebM, MP3 formats
  • Chromecast
  • Fullscreen playback and configurable device orientation management
  • Callbacks for monitoring a wide range of player events
  • Interactive Media Ads (IMA)
  • VAST and VMAP advertisement
  • DRM-protected media playback
  • Customizable user interface

Prerequisites

To be able to compile and run your application using the Wowza Flowplayer Android SDK, there are a few requirements that must be met as follows.

Minimum Android SDK

The minimum required Android SDK version is 19. Set the minSdkVersion in your app level module as follows:

Copy
Copied
android {
    defaultConfig {
        minSdkVersion 19
     }
}

AndroidX

If your project does not use an older version of the Support Library, simply enable AndroidX by setting the following attributes inside your gradle.properties file:

Copy
Copied
android.useAndroidX=true
android.enableJetifier=true

If, however, your project already uses an older version of the Support Library, then you will have to migrate to AndroidX. This can easily be achieved using Android Studio and by simply following the AndroidX migration instructions.

Java 8

The Wowza Flowplayer Android SDK is written using Java 8 features. To make your project compatible with Java 8, you need to configure the targetCompatibility in your app level build.gradle file as follows:

Copy
Copied
android {
    compileOptions {
        targetCompatibility JavaVersion.VERSION_1_8
     }
}

Add the SDK to your project

Once you have met all the prerequisites, you are ready to add the Wowza Flowplayer Android SDK to your project and start developing.

Download dependencies

First, add the mavenCentral in your project level build.gradle as follows:

Copy
Copied
allprojects {
    repositories {
        mavenCentral()
    }
}

Finally, add the SDK as a dependency in your app level build.gradle and replace "x.x.x" with the latest version as noted below:

Copy
Copied
dependencies {
    implementation 'com.flowplayer.android.player:flowplayer-core:x.x.x'
}

Update AndroidManifest

In your application's AndroidManifest.xml, there are two things that need to be configured:

  1. Add a <meta-data> tag with your Wowza Flowplayer access token to enable the player to play content.
  2. In every <activity> that will contain the player, add android:configChanges="keyboard|keyboardHidden|orientation|screenSize" to prevent the activity from being destroyed on orientation changes.

A correctly configured manifest looks similar to this:

Copy
Copied
<application>
    <activity
        android:name="com.my.package.MyAwesomePlayerActivity"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize" />
    <meta-data
        android:name="com.flowplayer.accessToken"
        android:value="MY_FLOWPLAYER_ACCESS_TOKEN" />
</application>