This SDK enables seamless integration with AndroidX Media3 ExoPlayer, offering advanced video analytics via the FastPix Dashboard. It's a wrapper built on FastPix’s core Java library to deliver performance monitoring for video applications using Google's ExoPlayer via AndroidX Media3.
- User engagement tracking – Monitor viewer interactions in real-time.
- Playback quality analytics – Evaluate buffering, resolution changes, and network issues.
- Custom event tracking – Track domain-specific user behaviors.
- Device & app diagnostics – Gain insights into playback issues across devices.
- Error logging – Automatically capture fatal and handled playback errors.
- Beacon domain support – Send analytics to a custom tracking domain.
- Android Studio Arctic Fox or newer
- Android SDK version 21+
- AndroidX Media3 dependency for ExoPlayer
- FastPix ExoPlayer SDK (media3-compatible) as a dependency
- GitHub Personal Access Token (PAT) for private Maven access
repositories {
maven {
url = uri("https://maven.pkg.github.com/FastPix/android-data-media3-player-sdk")
credentials {
username = "<your-github-username>"
password = "<your-personal-access-token>"
}
}
}
dependencies {
implementation 'io.fastpix.data:media3:1.0.0'
}
Ensure Media3 ExoPlayer is initialized properly:
import androidx.media3.exoplayer.ExoPlayer
import androidx.media3.ui.PlayerView
class VideoPlayerActivity : AppCompatActivity() {
private lateinit var exoPlayer: ExoPlayer
private lateinit var fastPixBaseMedia3Player: FastPixBaseMedia3Player
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_video_player)
val playerView: PlayerView = findViewById(R.id.player_view)
exoPlayer = ExoPlayer.Builder(this).build()
playerView.player = exoPlayer
val customerDataEntity = CustomerDataEntity(
CustomerPlayerDataEntity().apply {
workspaceKey = Constants.wsKey
playerName = "Media3 ExoPlayer"
},
CustomerVideoDataEntity().apply {
videoId = "id"
videoTitle = "title"
videoSourceUrl = "url"
},
CustomerViewDataEntity().apply {
viewSessionId = UUID.randomUUID().toString()
}
)
val customOptions = CustomOptions().apply {
beaconDomain = "your.custom.domain"
}
fastPixBaseMedia3Player = FastPixBaseMedia3Player(this, exoPlayer, customerDataEntity, customOptions)
fastPixBaseMedia3Player.setPlayerView(playerView)
}
override fun onDestroy() {
super.onDestroy()
fastPixBaseMedia3Player.release()
}
}
<androidx.media3.ui.PlayerView
android:id="@+id/player_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/black"
app:auto_show="true"
app:hide_on_touch="true"
app:surface_type="surface_view" />
Call fastPixBaseMedia3Player.videoChange(CustomerVideoData)
when switching videos to reset analytics context:
val newVideoData = CustomerVideoDataEntity().apply {
videoId = "newId"
videoTitle = "New Video"
videoSourceUrl = "newUrl"
}
fastPixBaseMedia3Player.videoChange(newVideoData)
To manually report handled errors:
fastPixBaseMedia3Player.error(FastPixErrorException("Custom playback error"))
Disable automatic error tracking if needed:
fastPixBaseMedia3Player.setAutomaticErrorTracking(false)
For advanced usage and APIs, refer to the FastPix Developer Docs.