Android TV Video Player Tracking
How do I see events such as buffering and playback statuses for video players in my TestFairy dashboard?
You can take a look at this blog post to do it manually or copy this utility file in your project.
Once you import the extension, you can initialize the tracker with these one liners.
with MediaPlayer
// Initialize
TestFairyMediaPlayerGlue.PlayerWrapper wrapper = TestFairyMediaPlayerGlue.createByWrapping(myMediaPlayer);
// use wrapper to configure further listeners and behavior
or with MediaPlayerAdapter
// Initialize
TestFairyMediaPlayerGlue.PlayerAdapterWrapper wrapper = TestFairyMediaPlayerGlue.createByWrapping(myPlayerAdapter);
// use wrapper to configure further listeners and behavior
or with ExoPlayer
Copy this listener in your project and initialize it with the following line.
// Initialize
exoPlayer.addAnalyticsListener(new TestFairyExoPlayerAnalyticsListener(exoPlayer));
The internals of TestFairyExoPlayerAnalyticsListener
is explained here for curious hackers.
Last updated on 2023-05-23