Beispiel #1
0
 public DemoPlayer(RendererBuilder rendererBuilder) {
   this.rendererBuilder = rendererBuilder;
   player = ExoPlayer.Factory.newInstance(RENDERER_COUNT, 1000, 5000);
   player.addListener(this);
   playerControl = new PlayerControl(player);
   mainHandler = new Handler();
   listeners = new CopyOnWriteArrayList<>();
   lastReportedPlaybackState = STATE_IDLE;
   rendererBuildingState = RENDERER_BUILDING_STATE_IDLE;
   // Disable text initially.
   player.setSelectedTrack(TYPE_TEXT, TRACK_DISABLED);
 }
Beispiel #2
0
 public void setSelectedTrack(int type, int index) {
   player.setSelectedTrack(type, index);
   if (type == TYPE_TEXT && index < 0 && captionListener != null) {
     captionListener.onCues(Collections.<Cue>emptyList());
   }
 }
Beispiel #3
0
 @Override
 protected void doActionImpl(ExoPlayer player) {
   player.setSelectedTrack(rendererIndex, trackIndex);
 }