PlayerController { void prepare(PlayerActivity.PlayerItem item) { try { setUpCallToAction(item); setUpMediaControl(item.looping, item.showVideoControls); final View.OnTouchListener listener = SwipeToDismissTouchListener .createFromView(videoView, callback); videoView.setOnTouchListener(listener); videoView.setOnPreparedListener(mediaPlayer -> videoProgressView.setVisibility(View.GONE)); videoView.setOnInfoListener((mediaPlayer, what, extra) -> { if (what == MediaPlayer.MEDIA_INFO_BUFFERING_END) { videoProgressView.setVisibility(View.GONE); return true; } else if (what == MediaPlayer.MEDIA_INFO_BUFFERING_START) { videoProgressView.setVisibility(View.VISIBLE); return true; } return false; }); final Uri uri = Uri.parse(item.url); videoView.setVideoURI(uri, item.looping); videoView.requestFocus(); } catch (Exception e) { Twitter.getLogger().e(TAG, "Error occurred during video playback", e); } } PlayerController(View rootView, SwipeToDismissTouchListener.Callback callback);   PlayerController(View rootView, VideoView videoView, VideoControlView videoControlView,
            ProgressBar videoProgressView, TextView callToActionView,
            SwipeToDismissTouchListener.Callback callback);   }
@Test public void testPrepare() { doNothing().when(subject).setUpMediaControl(); subject.prepare(playerItem); verify(subject).setUpMediaControl(false, true); verify(videoView).setOnTouchListener(any(View.OnTouchListener.class)); verify(videoView).setVideoURI(TEST_URI, false); verify(videoView).requestFocus(); verify(videoView).setOnPreparedListener(any(MediaPlayer.OnPreparedListener.class)); verify(videoView).setOnInfoListener(any(MediaPlayer.OnInfoListener.class)); }