api.video is the video infrastructure for product builders. Lightning fast video APIs for integrating, scaling, and managing on-demand & low latency live streaming features in your app.
This library sends player events from the player to api.video.
For ExoPlayer, add the following code in your module build.gradle
:
dependencies {
implementation 'video.api.player.analytics:android-player-analytics-exoplayer:3.0.0'
}
Register the ExoPlayer player analytics agent with:
import androidx.media3.exoplayer.ExoPlayer
import video.api.player.analytics.exoplayer.extensions.addApiVideoAnalyticsListener
val exoplayer = ExoPlayer.Builder(context).build()
val listener =
exoplayer.addApiVideoAnalyticsListener() // Register the ApiVideo exoplayer analytics listener so it sends player events to api.video.
// Remove the analytics listener when you don't need it anymore.
exoplayer.removeAnalyticsListener(listener)
For a custom domain collector, use:
val listener =
exoplayer.addApiVideoAnalyticsListener(collectorUrl = "https://collector.mycustomdomain.com") // Register the player analytics listener so it sends player events to api.video.
A demo application demonstrates how to use player.
See /example
folder.
While running the example, you can set your video Id:
- Enter a new media Id
- Press on
Load
button
A complete Android player analytics documentation is available.
If you have any questions, ask us in the community or use Issues.