Skip to content

A glue class for capturing media player events from Android TV apps

License

Notifications You must be signed in to change notification settings

testfairy-blog/TestFairyMediaPlayerGlue

Repository files navigation

TestFairyMediaPlayerGlue

A glue class for capturing media player events from Android TV apps.

Usage with MediaPlayer

// Find/create a media player
android.media.MediaPlayer myMediaPlayer = ...;

// Initialize
TestFairyMediaPlayerGlue.PlayerWrapper wrapper = TestFairyMediaPlayerGlue.createByWrapping(myMediaPlayer);
// use wrapper to configure further listeners and behavior

Usage with MediaPlayerAdapter

// The usual suspects from the support library
PlaybackVideoFragment myPlaybackVideoFragment = ...;
VideoSupportFragmentGlueHost myGlueHost = VideoSupportFragmentGlueHost(myPlaybackVideoFragment);
MediaPlayerAdapter myPlayerAdapter = MediaPlayerAdapter(myPlaybackVideoFragment.getContext());
PlaybackTransportControlGlue transportGlue = PlaybackTransportControlGlue(myPlaybackVideoFragment.getActivity(), myPlayerAdapter);
transportGlue.setHost(myGlueHost);

// Initialize
TestFairyMediaPlayerGlue.PlayerAdapterWrapper wrapper = TestFairyMediaPlayerGlue.createByWrapping(myPlayerAdapter);
// use wrapper to configure further listeners and behavior

Usage with ExoPlayer

exoPlayer.addAnalyticsListener(new TestFairyExoPlayerAnalyticsListener(exoPlayer));

About

A glue class for capturing media player events from Android TV apps

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages