Java 类com.google.android.exoplayer2.trackselection.TrackSelections 实例源码

项目:MDVideo    文件:PlayerActivityV2.java   
@Override
    public void onTrackSelectionsChanged(TrackSelections<? extends MappedTrackInfo> trackSelections) {
//        updateButtonVisibilities();
        MappedTrackInfo trackInfo = trackSelections.info;
        if (trackInfo.hasOnlyUnplayableTracks(C.TRACK_TYPE_VIDEO)) {
            showToast(R.string.error_unsupported_video);
        }
        if (trackInfo.hasOnlyUnplayableTracks(C.TRACK_TYPE_AUDIO)) {
            showToast(R.string.error_unsupported_audio);
        }
    }
项目:videoPickPlayer    文件:ExoPlayerImplInternal.java   
public boolean selectTracks() throws ExoPlaybackException {
  TrackSelections<T> newTrackSelections = trackSelector.selectTracks(rendererCapabilities,
      mediaPeriod.getTrackGroups());
  if (newTrackSelections.equals(periodTrackSelections)) {
    return false;
  }
  trackSelections = newTrackSelections;
  return true;
}
项目:videoPickPlayer    文件:DefaultLoadControl.java   
@Override
public void onTracksSelected(Renderer[] renderers, TrackGroupArray trackGroups,
    TrackSelections<?> trackSelections) {
  targetBufferSize = 0;
  for (int i = 0; i < renderers.length; i++) {
    if (trackSelections.get(i) != null) {
      targetBufferSize += Util.getDefaultBufferSize(renderers[i].getTrackType());
    }
  }
  allocator.setTargetBufferSize(targetBufferSize);
}
项目:videoPickPlayer    文件:SimpleExoPlayer.java   
@Override
public void onTrackSelectionsChanged(TrackSelections<?> trackSelections) {
  boolean videoTracksEnabled = false;
  for (int i = 0; i < renderers.length; i++) {
    if (renderers[i].getTrackType() == C.TRACK_TYPE_VIDEO && trackSelections.get(i) != null) {
      videoTracksEnabled = true;
      break;
    }
  }
  if (videoListener != null && SimpleExoPlayer.this.videoTracksEnabled && !videoTracksEnabled) {
    videoListener.onVideoTracksDisabled();
  }
  SimpleExoPlayer.this.videoTracksEnabled = videoTracksEnabled;
}
项目:itplayer    文件:ExoPlayerGlue.java   
@Override
public void onTrackSelectionsChanged(TrackSelections<? extends MappingTrackSelector.MappedTrackInfo> trackSelections) {
    int textRenderIndex = getRenderIndex(C.TRACK_TYPE_TEXT);
    boolean status = trackSelector.getRendererDisabled(textRenderIndex);
    closedCaptionAction.setIndex(status ? PlaybackControlsRow.ClosedCaptioningAction.ON : PlaybackControlsRow.ClosedCaptioningAction.OFF);
    primaryActionsAdapter.notifyArrayItemRangeChanged(primaryActionsAdapter.indexOf(closedCaptionAction), 1);
}
项目:videoPickPlayer    文件:LoadControl.java   
/**
 * Called by the player when a track selection occurs.
 *
 * @param renderers The renderers.
 * @param trackGroups The {@link TrackGroup}s from which the selection was made.
 * @param trackSelections The track selections that were made.
 */
void onTracksSelected(Renderer[] renderers, TrackGroupArray trackGroups,
    TrackSelections<?> trackSelections);