private void preparePlayer(boolean playWhenReady) { if (player == null) { player = new DemoPlayer(getRendererBuilder()); player.addListener(this); player.setCaptionListener(this); player.setMetadataListener(this); player.seekTo(playerPosition); playerNeedsPrepare = true; mediaController.setMediaPlayer(player.getPlayerControl()); mediaController.setEnabled(true); eventLogger = new EventLogger(); eventLogger.startSession(); player.addListener(eventLogger); player.setInfoListener(eventLogger); player.setInternalErrorListener(eventLogger); debugViewHelper = new DebugTextViewHelper(player, debugTextView); debugViewHelper.start(); } if (playerNeedsPrepare) { player.prepare(); playerNeedsPrepare = false; updateButtonVisibilities(); } player.setSurface(surfaceView.getHolder().getSurface()); player.setPlayWhenReady(playWhenReady); }
public void startDebugView(VideoPlayer player) { debugViewHelper = new DebugTextViewHelper(player, debugTextView); debugViewHelper.start(); }