Use the FastPix Video Data SDK for Media3 to monitor streaming quality, playback performance, and user interactions in your Android app. It is the official FastPix Video Data SDK for AndroidX Media3 - wrap your Media3 player with FastPixBaseMedia3Player and it automatically tracks startup time, rebuffering, bitrate changes, playback errors, and viewer engagement, then streams them as real-time quality-of-experience (QoE) analytics to the FastPix dashboard. It builds on FastPix's Android Data Core SDK.
It is not a video player - it is a drop-in analytics layer for the Media3 player you already use. Under the hood it hooks into Media3's AnalyticsListener, so there is no manual event wiring.
Works with: AndroidX Media3 on Android 7.0 (API 24) and above, HLS and MP4 sources, Kotlin and Java. Powered by FastPix, the video API platform.
FastPix docs · Video Data overview · Create a free account
New to the SDK? Follow these in order and you will have Media3 analytics flowing to your dashboard:
- Why FastPix for Media3?
- What you can track
- How it works
- Who it's for
- Requirements
- Before you start
- Add the GitHub Packages repositories
- Add the SDK dependency
- Add the required permissions
- Attach the SDK to your Media3 player
- Track ads
- Enable CMCD (optional)
- Run the sample app
- Verify events in your dashboard
- Which FastPix data SDK do I need?
- FAQ
- Troubleshooting
Media3's AnalyticsListener and PlaybackStatsListener give you raw playback events, but turning them into startup-time, rebuffering, and error dashboards is work you have to build and maintain. FastPix does that for you: wrap your Media3 player, pass your workspace key, and every session shows up on the dashboard with QoE metrics you can slice by device, app version, video, and custom dimensions.
- No new player required. Keep the Media3 player you already ship. The SDK observes it; it does not replace it.
- Real-time QoE analytics. Startup time, rebuffering, bitrate/resolution changes, and playback failures, collected as the video plays.
- Viewer engagement. See what people actually watch, and where they drop off.
- Built on Media3's own hooks. It attaches through
AnalyticsListener, so it stays accurate across Media3 versions. - Custom and beacon domains. Attach up to ten custom dimensions and send analytics to a custom tracking domain.
- User engagement - how viewers interact with your video in real time.
- Playback quality - buffering, resolution changes, and network-aware context.
- Renditions - rendition name, dynamic range (SDR, PQ, HLG), video and audio codecs, and audio bitrate.
- Player state - subtitles and audio language, picture-in-picture, fullscreen, mute, volume, playback rate, and looping.
- Requests - CMCD data from each segment request, and the CDN edge that served it.
- Ads - Google IMA ads and HLS interstitials: ad breaks, ads, and ad errors, kept out of content metrics.
- Device and app diagnostics - spot playback issues specific to a device, OS, or app version.
- Errors - automatic capture of fatal and handled playback errors, optionally classified as business or technical.
- Custom metadata - domain-specific dimensions you can filter the dashboard by.
Your app plays a video with AndroidX Media3. You wrap that player with FastPixBaseMedia3Player, which attaches to its AnalyticsListener and turns playback signals (startup, bitrate, rebuffering, errors, engagement) into beacons sent to FastPix, keyed to your workspace. A few minutes later the session appears in your FastPix dashboard as QoE and engagement analytics.
Any Android team that streams video with Media3 and needs to see how playback actually performs:
- OTT and streaming apps - track startup time and rebuffering across phones, tablets, and Android TV.
- E-learning and course apps - see which lessons stall or get abandoned.
- Live events and sports - catch stream-quality problems while they are happening.
- Short-form and UGC platforms - measure engagement and playback failures at scale.
- AndroidX Media3: 1.8.0
- Minimum SDK: 24 (Android 7.0)
- Target SDK: 35 (Android 15)
- Compile SDK: 36
- Java: 11 bytecode (
sourceCompatibility/targetCompatibility)
To build this repository and its sample app:
- Android Studio: a release that supports Android Gradle Plugin 9.4
- Gradle: 9.7.1 (wrapper included)
- Android Gradle Plugin: 9.4.1
- Kotlin: 2.3.21
- JDK: 17 to 25 (set it under Settings > Build Tools > Gradle > Gradle JDK)
You will need:
- A FastPix account and workspace key. Create a free account, then copy the Workspace Key from your FastPix dashboard. See Set up a workspace. This is the only value the SDK strictly requires.
- A Media3 player that already plays a video. The SDK wraps your Media3 player, so it must already be playing before you add analytics.
- A GitHub Personal Access Token (PAT) with the
read:packagesscope. The SDK and its core dependency are published to GitHub Packages, which requires authentication even for public packages. Create a token.
The SDK (io.fastpix.data:media3) and its required core dependency (io.fastpix.data:core) live in two GitHub Packages repositories. Add both, or the core dependency will fail to resolve.
GitHub Packages requires authentication, so provide your GitHub username and a PAT (read:packages). Put them in local.properties (which is git-ignored, so your token is never committed):
# local.properties
gpr.user=YOUR_GITHUB_USERNAME
gpr.key=YOUR_PERSONAL_ACCESS_TOKENThen read those values in settings.gradle.kts and apply them to both repositories:
import java.util.Properties
val credsProps = Properties().apply {
val f = file("${rootDir}/local.properties")
if (f.exists()) f.inputStream().use { load(it) }
}
val githubUser = credsProps.getProperty("gpr.user") ?: System.getenv("GITHUB_ACTOR")
val githubToken = credsProps.getProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven {
url = uri("https://maven.pkg.github.com/FastPix/android-data-androidXmedia3")
credentials {
username = githubUser
password = githubToken
}
}
maven {
url = uri("https://maven.pkg.github.com/FastPix/android-core-data-sdk")
credentials {
username = githubUser
password = githubToken
}
}
}
}Never commit your PAT. Keep
gpr.user/gpr.keyinlocal.properties(git-ignored) or in theGITHUB_ACTOR/GITHUB_TOKENenvironment variables for CI - never inline in a tracked file.
In your app module's build.gradle:
dependencies {
implementation 'io.fastpix.data:media3:1.2.8'
}This pulls in io.fastpix.data:core transitively, which is why the core repository above is required.
The SDK sends analytics over the network, so your app's AndroidManifest.xml needs both:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />Optionally, add READ_PHONE_STATE so the SDK can report the cellular radio type (2G, 3G, LTE, 5G) as the viewer's connection speed. Without it, the SDK uses the bandwidth estimate instead:
<uses-permission android:name="android.permission.READ_PHONE_STATE" />Set up your Media3 player as usual, then create a FastPixBaseMedia3Player with your player view, the player instance, and your workspace key. The video, player, and custom metadata objects are optional but make the dashboard easier to slice. Release the SDK alongside the player.
class VideoPlayerActivity : AppCompatActivity() {
private lateinit var binding: ActivityVideoPlayerBinding
private lateinit var exoPlayer: ExoPlayer
private lateinit var fastPixDataSDK: FastPixBaseMedia3Player
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivityVideoPlayerBinding.inflate(layoutInflater)
setContentView(binding.root)
setupPlayer()
setupAnalytics()
}
private fun setupPlayer() {
exoPlayer = ExoPlayer.Builder(this).build()
binding.playerView.player = exoPlayer
val mediaItem = MediaItem.fromUri("YOUR_VIDEO_URL")
exoPlayer.setMediaItem(mediaItem)
exoPlayer.prepare()
}
private fun setupAnalytics() {
// Optional
val videoDataDetails = VideoDataDetails(
videoId = UUID.randomUUID().toString(),
videoTitle = "My Video"
).apply {
videoSeries = "Demo Series"
videoProducer = "Demo Producer"
videoContentType = "VOD"
// ..etc
}
// Optional
val playerDataDetails = PlayerDataDetails(
playerName = "media3",
playerVersion = "latest-version"
)
// Optional
val customDataDetails = CustomDataDetails().apply {
customField1 = "Custom Value 1"
customField2 = "Custom Value 2"
// ..etc
}
fastPixDataSDK = FastPixBaseMedia3Player(
context = this,
playerView = binding.playerView,
exoPlayer = exoPlayer,
workSpaceId = "workspace-key",
playerDataDetails = playerDataDetails,
videoDataDetails = videoDataDetails,
customDataDetails = customDataDetails
)
}
override fun onDestroy() {
super.onDestroy()
exoPlayer.release()
fastPixDataSDK.release()
}
}Replace workspace-key with your real Workspace Key and YOUR_VIDEO_URL with your stream. For the full list of metadata fields, see Use custom dimensions.
| Parameter | What it does |
|---|---|
beaconUrl |
Sends analytics to a custom tracking domain. |
enableLogging |
Logs each event's payload to Logcat, for debugging. |
applicationDataDetails |
App and page context: app name and version, page type, content ID, device ID. |
viewerDataDetails |
Viewer details, such as the viewer's plan. |
adDataDetails |
The view's ad details from your ad server or VAST, sent on view begin and view completed. |
errorClassifier |
(PlaybackException) -> Boolean?. Return true for a business rule (geo-block, entitlement), false for a technical fault, or null when you can't tell. |
controlsEnabled |
() -> Boolean?. Whether your player controls are enabled. Set it when you draw your own controls (use_controller = false). |
autoPlay |
Whether your app starts playback on its own. |
The SDK tracks Google IMA ads and HLS interstitials. Ad breaks and ads are read from the player, so ad time never counts as content.
The SDK brings in the Media3 IMA extension (androidx.media3:media3-exoplayer-ima), so you don't need to add it yourself. Forward IMA's events and errors to the SDK, and call onAdsRequested with the ad tag:
private val adsLoader: ImaAdsLoader by lazy {
ImaAdsLoader.Builder(this)
.setAdEventListener { fastPixDataSDK.onImaAdEvent(it) }
.setAdErrorListener { fastPixDataSDK.onImaAdError(it) }
.build()
}
// After creating FastPixBaseMedia3Player
fastPixDataSDK.onAdsRequested(AD_TAG_URL)Register the SDK's listener on your HlsInterstitialsAdsLoader so it sees asset-list requests, responses, and failures:
hlsAdsLoader.addListener(fastPixDataSDK.hlsInterstitialsListener)
// When you release or replace the SDK
hlsAdsLoader.removeListener(fastPixDataSDK.hlsInterstitialsListener)The SDK reports the CMCD data Media3 sends with each request. Turn CMCD on in your media source factory:
val mediaSourceFactory = DefaultMediaSourceFactory(this)
.setCmcdConfigurationFactory(CmcdConfiguration.Factory.DEFAULT)Media3 leaves out the CMCD version (v) because it is 1, as the CMCD spec allows. It sends requested maximum throughput (rtp) only if your CmcdConfiguration.RequestConfig returns a value from getRequestedMaximumThroughputKbps.
This repo includes a runnable sample in the app/ module that plays FastPix sample streams with the SDK attached. To build and run it:
-
Clone the repository and open it in Android Studio:
git clone https://github.com/FastPix/android-data-androidXmedia3.git cd android-data-androidXmedia3 -
Add your GitHub credentials to
local.propertiesso Gradle can download the SDK (see Add the GitHub Packages repositories):gpr.user=YOUR_GITHUB_USERNAME gpr.key=YOUR_PERSONAL_ACCESS_TOKEN
-
To send analytics to your own workspace, open
app/src/main/java/io/fastpix/exo/VideoPlayerActivity.ktand replace theworkSpaceIdvalue with the Workspace Key from your FastPix dashboard. The video list (VideoPrefs.kt) plays ready-made streams, so you can run it as-is without changing the video URLs. -
Select a device or emulator running Android 7.0 (API 24) or higher.
-
Run the app from Android Studio, or from the command line:
./gradlew :app:installDebug
The app opens a video list. Pick a video and it starts playing. As it plays, the SDK sends QoE beacons (startup, buffering, bitrate changes, engagement) to FastPix; confirm them in Verify events in your dashboard. The list includes samples for specific cases:
- apple-interstitial-sample - HLS interstitials: a preroll, a two-ad pod at 0:25, and a midroll at 0:55.
- broken-ads-sample - two ads that fail to load (HTTP 404), for ad error tracking.
- Broken Video - a stream that returns HTTP 404, for playback error tracking.
- Multiple Audio Tracks - several audio and subtitle languages.
The player screen has controls for subtitles, audio track, quality, playback speed, picture-in-picture, mute and volume, so you can watch each of those reach the dashboard.
If the build fails with "
android.useAndroidXproperty is not enabled", addandroid.useAndroidX=trueto the project'sgradle.properties, then rebuild.
- Run the app and play a video for at least 10 seconds. Pause, resume, and seek so the SDK captures a few events.
- Open the FastPix dashboard and go to Video Data.
- A few minutes after playback, your session appears with views, startup time, rebuffering, and any errors.
If nothing shows up, see Troubleshooting.
Pick the data SDK that matches the player you ship. All of them report to the same FastPix Video Data dashboard.
| You are using | Use this SDK |
|---|---|
| AndroidX Media3 | This repo (android-data-androidXmedia3) |
The legacy standalone com.google.android.exoplayer2 library |
android-data-exoplayer-sdk |
Android native MediaPlayer |
android-media-player-data |
| AVPlayer (iOS) | iOS-data-avplayer-sdk |
| React Native (Android + iOS) | react-native-video-data |
| An HTML5 web player (Video.js, Shaka, HLS.js) | web-video-data-core-sdk |
Related building block: android-core-data-sdk - the foundational data layer this SDK wraps.
How do I monitor Media3 playback performance in Android?
Wrap your Media3 player with FastPixBaseMedia3Player and pass your workspace key (see Attach the SDK to your Media3 player). From then on, streaming quality, startup time, rebuffering, playback errors, and engagement appear in the FastPix dashboard - no manual AnalyticsListener wiring.
How do I track video analytics in an Android app?
If your app uses AndroidX Media3, add this SDK, wrap your Media3 player, and pass your workspace key. It builds on Media3's AnalyticsListener and sends the data to the FastPix dashboard. Start at Add the GitHub Packages repositories.
Is this an alternative to Mux Data for Media3? Yes. Like Mux Data for Android, FastPix provides a native tracking wrapper for AndroidX Media3 that monitors startup time, rebuffering, bitrate, playback errors, and engagement, and reports them to the FastPix dashboard.
Does it work with the old standalone player library?
This repo is for AndroidX Media3 (the current Android media library). For the legacy standalone com.google.android.exoplayer2 library, use android-data-exoplayer-sdk. Both report to the same FastPix dashboard.
What metrics does it track? Startup time, rebuffering, bitrate and resolution changes, playback errors, and viewer engagement - the signals that make up a quality-of-experience (QoE) score - plus device, OS, and app diagnostics.
What is the minimum Android version? Android 7.0 (API level 24).
Why do I need a GitHub Personal Access Token to install it?
The SDK and its core dependency are hosted on GitHub Packages, which requires authentication (a PAT with read:packages) even for public packages. This is a GitHub requirement.
Why does Gradle say it can't find io.fastpix.data:core?
Because you only added the media3 repository. The SDK depends on the core artifact in a separate GitHub Packages repo. Add both repositories from Add the GitHub Packages repositories.
Where do I get my workspace key? From the FastPix dashboard. Create a free account and copy the Workspace Key. See Set up a workspace.
- No data in the dashboard. Confirm the
INTERNETpermission is present (Add the required permissions), that the workspace key is your real key, and that the video actually played. Data can take a few minutes to appear. - Build fails resolving
io.fastpix.data:core. Add the core GitHub Packages repository (Add the GitHub Packages repositories). - 401 / 403 from GitHub Packages. Your PAT is missing or lacks the
read:packagesscope. Regenerate it and re-run the build.
Copyright © 2025 FastPix. All rights reserved. This project is proprietary software; the FastPix SDK components require appropriate licensing. See LICENSE.
For questions, issues, or feature requests:
- Email: support@fastpix.com
- Documentation: Monitor AndroidX Media3
- Issues: GitHub Issues
