Skip to navigation

Monitor video data

Learn how to enable playback analytics in the FastPix Android Player using the FastPix Data Core SDK.

The FastPix Android Data Core SDK captures playback analytics automatically, including playback lifecycle events (play, pause, ready, complete, errors), buffering behavior, seek patterns, and engagement signals. The SDK sends collected data to your FastPix workspace for near real-time monitoring through the dashboard.

The integration is lightweight and doesn’t interrupt or degrade playback. If analytics setup fails at runtime, playback continues. Analytics is fail-safe by design.

When to use analytics

Use analytics when you want to:

  • Measure viewer engagement and completion trends.
  • Detect buffering and quality-of-experience issues.
  • Correlate playback behavior with video metadata (for example, title and ID).
  • Monitor player health and failures in production.

Configure analytics

Set up analytics using AnalyticsConfig and pass it to FastPixPlayer.Builder:

import io.fastpix.data.domain.model.VideoDataDetails
import io.fastpix.media3.analytics.AnalyticsConfig
import io.fastpix.media3.core.FastPixPlayer
val videoDataDetails = VideoDataDetails("video-123", "Launch Demo")
val analyticsConfig = AnalyticsConfig.Builder(
playerView = binding.playerView, // Optional
workSpaceId = "your-workspace-id" // Required
)
.setVideoDataDetails(videoDataDetails) // Optional metadata
.setEnabled(true) // Default is true
.build()
val fastPixPlayer = FastPixPlayer.Builder(this)
.setAutoplay(true)
.setLoop(false)
.setAnalyticsConfig(analyticsConfig)
.build()
binding.playerView.player = fastPixPlayer

Required and optional parameters

  • workSpaceId is mandatory.
  • playerView is optional. Use the two-argument constructor AnalyticsConfig.Builder(playerView, workSpaceId) when a single view shows the player. Use the single-argument constructor AnalyticsConfig.Builder(workSpaceId) (no view) when the player is shown in different views over time, as with a FastPixPlayerPool, where each page’s view is measured through the PlayerView showing it.
  • videoDataDetails, playerDataDetails, and customDataDetails are optional and can be added based on your use case.

Note: Since 2.2.0, a view begins when the first video starts, not when the player is built. A player that never plays anything reports nothing.

One view per video watched

Analytics reports one view for each video the user actually watches:

  • A view begins when a video starts playing. That happens when you set it with setMediaItem or setFastPixMediaItem, when it is reached in a playlist (through setPlaylist, next(), previous(), skipTo(), or auto-advance), or when it is made current in a FastPixPlayerPool through setCurrentIndex.
  • A view ends when playback moves to another video, the playlist is cleared, or the player is released.
  • Entries that are only preloaded or pre-rendered are never reported.

The FastPix Data SDK reports one view at a time per app. Beginning a view on one player ends any view still open on another.

Add per-entry metadata

Give each playlist entry its own metadata with PlaylistItem.withVideoData(...). When an entry has no metadata of its own, setVideoDataDetails on the config is the fallback, and failing that the entry id is reported:

player.setPlaylist(
episodes.map { episode ->
PlaylistItem.fastPix(episode.playbackId)
.withVideoData(VideoDataDetails(videoId = episode.id, videoTitle = episode.title))
}
)

For more on building and editing playlists, see Manage playlists.

Analytics in a feed (FastPixPlayerPool)

A pool’s players move between pages, so build the config without a view. Each page’s view is measured through the PlayerView showing it. Pass the config to the pool:

val pool = FastPixPlayerPool.Builder(context)
.setAnalyticsConfig(AnalyticsConfig.Builder("your-workspace-id").build())
.setPrerenderConfig(PrerenderConfig(count = 1, behind = 1))
.build()
pool.setPlaylist(
reels.map { reel ->
PlaylistItem.fastPix(reel.playbackId)
.withVideoData(VideoDataDetails(videoId = reel.id, videoTitle = reel.caption))
}
)

Each page the user lands on is one view, and swiping away ends it. Pages pre-rendered off screen are not views, so pre-rendering does not inflate view counts.

For the full feed setup, see Build video feeds.

Notes

  • If analytics setup fails at runtime, playback continues. Analytics is fail-safe by design.
  • Current analytics APIs are optimized for Java-first Android integration.

Frequently asked questions

How do I add analytics to the FastPix Android player?

Build an AnalyticsConfig with your workSpaceId (and optionally the PlayerView), then pass it to FastPixPlayer.Builder(...).setAnalyticsConfig(...). Analytics starts automatically and does not interrupt playback.

What counts as a view?

A view begins when a video starts playing, whether through setFastPixMediaItem, playlist navigation, or setCurrentIndex in a pool. Preloaded and pre-rendered entries are never counted, so a view maps to one video the user actually watched.

Is playerView required in AnalyticsConfig?

No. Only workSpaceId is mandatory. Pass a PlayerView for a single view, or omit it and use AnalyticsConfig.Builder(workSpaceId) when players move between views, as in a FastPixPlayerPool.

Does analytics affect playback if it fails?

No. Analytics is fail-safe by design. If setup fails at runtime, playback continues without interruption.


What’s next