예제 #1
0
 private void maybeReportPlayerState() {
   boolean playWhenReady = player.getPlayWhenReady();
   int playbackState = getPlaybackState();
   if (lastReportedPlayWhenReady != playWhenReady || lastReportedPlaybackState != playbackState) {
     for (Listener listener : listeners) {
       listener.onStateChanged(playWhenReady, playbackState);
     }
     lastReportedPlayWhenReady = playWhenReady;
     lastReportedPlaybackState = playbackState;
   }
 }
예제 #2
0
  private void pushTrackSelection(int type, boolean allowRendererEnable) {
    if (rendererBuildingState != RenderBuildingState.BUILT) {
      return;
    }

    int trackIndex = selectedTracks[type];
    if (trackIndex == DISABLED_TRACK) {
      player.setRendererEnabled(type, false);
    } else if (multiTrackSources[type] == null) {
      player.setRendererEnabled(type, allowRendererEnable);
    } else {
      boolean playWhenReady = player.getPlayWhenReady();
      player.setPlayWhenReady(false);
      player.setRendererEnabled(type, false);
      player.sendMessage(
          multiTrackSources[type], MultiTrackChunkSource.MSG_SELECT_TRACK, trackIndex);
      player.setRendererEnabled(type, allowRendererEnable);
      player.setPlayWhenReady(playWhenReady);
    }
  }
예제 #3
0
 public boolean getPlayWhenReady() {
   return player.getPlayWhenReady();
 }