当前位置: 首页>>代码示例>>Java>>正文


Java MappedTrackInfo.getTrackGroups方法代码示例

本文整理汇总了Java中com.google.android.exoplayer2.trackselection.MappingTrackSelector.MappedTrackInfo.getTrackGroups方法的典型用法代码示例。如果您正苦于以下问题:Java MappedTrackInfo.getTrackGroups方法的具体用法?Java MappedTrackInfo.getTrackGroups怎么用?Java MappedTrackInfo.getTrackGroups使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.android.exoplayer2.trackselection.MappingTrackSelector.MappedTrackInfo的用法示例。


在下文中一共展示了MappedTrackInfo.getTrackGroups方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: showSelectionDialog

import com.google.android.exoplayer2.trackselection.MappingTrackSelector.MappedTrackInfo; //导入方法依赖的package包/类
/**
 * Shows the selection dialog for a given renderer.
 *
 * @param activity The parent activity.
 * @param title The dialog's title.
 * @param trackInfo The current track information.
 * @param rendererIndex The index of the renderer.
 */
public void showSelectionDialog(Activity activity, CharSequence title, MappedTrackInfo trackInfo,
    int rendererIndex) {
  this.trackInfo = trackInfo;
  this.rendererIndex = rendererIndex;

  trackGroups = trackInfo.getTrackGroups(rendererIndex);
  trackGroupsAdaptive = new boolean[trackGroups.length];
  for (int i = 0; i < trackGroups.length; i++) {
    trackGroupsAdaptive[i] = adaptiveVideoTrackSelectionFactory != null
        && trackInfo.getAdaptiveSupport(rendererIndex, i, false)
            != RendererCapabilities.ADAPTIVE_NOT_SUPPORTED
        && trackGroups.get(i).length > 1;
  }
  isDisabled = selector.getRendererDisabled(rendererIndex);
  override = selector.getSelectionOverride(rendererIndex, trackGroups);

  AlertDialog.Builder builder = new AlertDialog.Builder(activity);
  builder.setTitle(title)
      .setView(buildView(builder.getContext()))
      .setPositiveButton(android.R.string.ok, this)
      .setNegativeButton(android.R.string.cancel, null)
      .create()
      .show();
}
 
开发者ID:ashwanijanghu,项目名称:ExoPlayer-Offline,代码行数:33,代码来源:TrackSelectionHelper.java

示例2: showSelectionDialog

import com.google.android.exoplayer2.trackselection.MappingTrackSelector.MappedTrackInfo; //导入方法依赖的package包/类
/**
 * Shows the selection dialog for a given renderer.
 *
 * @param activity      The parent activity.
 * @param title         The dialog's title.
 * @param trackInfo     The current track information.
 * @param rendererIndex The index of the renderer.
 */
public void showSelectionDialog(Activity activity, CharSequence title, MappedTrackInfo trackInfo,
                                int rendererIndex) {
    this.trackInfo = trackInfo;
    this.rendererIndex = rendererIndex;

    trackGroups = trackInfo.getTrackGroups(rendererIndex);
    trackGroupsAdaptive = new boolean[trackGroups.length];
    for (int i = 0; i < trackGroups.length; i++) {
        trackGroupsAdaptive[i] = adaptiveVideoTrackSelectionFactory != null
                && trackInfo.getAdaptiveSupport(rendererIndex, i, false)
                != RendererCapabilities.ADAPTIVE_NOT_SUPPORTED
                && trackGroups.get(i).length > 1;
    }
    isDisabled = selector.getRendererDisabled(rendererIndex);
    override = selector.getSelectionOverride(rendererIndex, trackGroups);

    AlertDialog.Builder builder = new AlertDialog.Builder(activity);
    builder.setTitle(title)
            .setView(buildView(LayoutInflater.from(builder.getContext())))
            .setPositiveButton(android.R.string.ok, this)
            .setNegativeButton(android.R.string.cancel, null)
            .create()
            .show();
}
 
开发者ID:AndroidTips,项目名称:MDVideo,代码行数:33,代码来源:TrackSelectionHelper.java

示例3: showSelectionDialog

import com.google.android.exoplayer2.trackselection.MappingTrackSelector.MappedTrackInfo; //导入方法依赖的package包/类
/**
 * Shows the selection dialog for a given renderer.
 *
 * @param activity The parent activity.
 * @param title The dialog's title.
 * @param trackInfo The current track information.
 * @param rendererIndex The index of the renderer.
 */
public void showSelectionDialog(Activity activity, CharSequence title, MappedTrackInfo trackInfo,
                                int rendererIndex) {
  this.trackInfo = trackInfo;
  this.rendererIndex = rendererIndex;

  trackGroups = trackInfo.getTrackGroups(rendererIndex);
  trackGroupsAdaptive = new boolean[trackGroups.length];
  for (int i = 0; i < trackGroups.length; i++) {
    trackGroupsAdaptive[i] = adaptiveVideoTrackSelectionFactory != null
        && trackInfo.getAdaptiveSupport(rendererIndex, i, false)
            != RendererCapabilities.ADAPTIVE_NOT_SUPPORTED
        && trackGroups.get(i).length > 1;
  }
  isDisabled = selector.getRendererDisabled(rendererIndex);
  override = selector.getSelectionOverride(rendererIndex, trackGroups);

  AlertDialog.Builder builder = new AlertDialog.Builder(activity);
  builder.setTitle(title)
      .setView(buildView(builder.getContext()))
      .setPositiveButton(android.R.string.ok, this)
      .setNegativeButton(android.R.string.cancel, null)
      .create()
      .show();
}
 
开发者ID:TakumaMochizuki,项目名称:Komica,代码行数:33,代码来源:TrackSelectionHelper.java

示例4: showSelectionDialog

import com.google.android.exoplayer2.trackselection.MappingTrackSelector.MappedTrackInfo; //导入方法依赖的package包/类
/**
 * Shows the selection dialog for a given renderer.
 *
 * @param activity The parent activity.
 * @param title The dialog's title.
 * @param trackInfo The current track information.
 * @param rendererIndex The index of the renderer.
 */
public void showSelectionDialog(Activity activity, CharSequence title, MappedTrackInfo trackInfo,
    int rendererIndex) {
  this.trackInfo = trackInfo;
  this.rendererIndex = rendererIndex;

  trackGroups = trackInfo.getTrackGroups(rendererIndex);
  trackGroupsAdaptive = new boolean[trackGroups.length];
  for (int i = 0; i < trackGroups.length; i++) {
    trackGroupsAdaptive[i] = adaptiveTrackSelectionFactory != null
        && trackInfo.getAdaptiveSupport(rendererIndex, i, false)
            != RendererCapabilities.ADAPTIVE_NOT_SUPPORTED
        && trackGroups.get(i).length > 1;
  }
  isDisabled = selector.getRendererDisabled(rendererIndex);
  override = selector.getSelectionOverride(rendererIndex, trackGroups);

  AlertDialog.Builder builder = new AlertDialog.Builder(activity);
  builder.setTitle(title)
      .setView(buildView(builder.getContext()))
      .setPositiveButton(android.R.string.ok, this)
      .setNegativeButton(android.R.string.cancel, null)
      .create()
      .show();
}
 
开发者ID:y20k,项目名称:transistor,代码行数:33,代码来源:TrackSelectionHelper.java

示例5: updateButtonVisibilities

import com.google.android.exoplayer2.trackselection.MappingTrackSelector.MappedTrackInfo; //导入方法依赖的package包/类
private void updateButtonVisibilities() {
    debugRootView.removeAllViews();

    retryButton.setVisibility(playerNeedsSource ? View.VISIBLE : View.GONE);
    debugRootView.addView(retryButton);

    if (player == null) {
        return;
    }

    MappedTrackInfo mappedTrackInfo = trackSelector.getCurrentMappedTrackInfo();
    if (mappedTrackInfo == null) {
        return;
    }

    for (int i = 0; i < mappedTrackInfo.length; i++) {
        TrackGroupArray trackGroups = mappedTrackInfo.getTrackGroups(i);
        if (trackGroups.length != 0) {
            Button button = new Button(this);
            int label;
            switch (player.getRendererType(i)) {
                case C.TRACK_TYPE_AUDIO:
                    label = R.string.audio;
                    break;
                case C.TRACK_TYPE_VIDEO:
                    label = R.string.video;
                    break;
                case C.TRACK_TYPE_TEXT:
                    label = R.string.text;
                    break;
                default:
                    continue;
            }
            button.setText(label);
            button.setTag(i);
            button.setOnClickListener(this);
            debugRootView.addView(button, debugRootView.getChildCount() - 1);
        }
    }
}
 
开发者ID:ashwanijanghu,项目名称:ExoPlayer-Offline,代码行数:41,代码来源:PlayerActivity.java

示例6: updateButtonVisibilities

import com.google.android.exoplayer2.trackselection.MappingTrackSelector.MappedTrackInfo; //导入方法依赖的package包/类
private void updateButtonVisibilities() {
  debugRootView.removeAllViews();

  retryButton.setVisibility(playerNeedsSource ? View.VISIBLE : View.GONE);
  debugRootView.addView(retryButton);

  if (player == null) {
    return;
  }

  MappedTrackInfo mappedTrackInfo = trackSelector.getCurrentMappedTrackInfo();
  if (mappedTrackInfo == null) {
    return;
  }

  for (int i = 0; i < mappedTrackInfo.length; i++) {
    TrackGroupArray trackGroups = mappedTrackInfo.getTrackGroups(i);
    if (trackGroups.length != 0) {
      Button button = new Button(this);
      int label;
      switch (player.getRendererType(i)) {
        case C.TRACK_TYPE_AUDIO:
          label = R.string.audio;
          break;
        case C.TRACK_TYPE_VIDEO:
          label = R.string.video;
          break;
        case C.TRACK_TYPE_TEXT:
          label = R.string.text;
          break;
        default:
          continue;
      }
      button.setText(label);
      button.setTag(i);
      button.setOnClickListener(this);
      debugRootView.addView(button, debugRootView.getChildCount() - 1);
    }
  }
}
 
开发者ID:TakumaMochizuki,项目名称:Komica,代码行数:41,代码来源:PlayerActivity.java

示例7: updateButtonVisibilities

import com.google.android.exoplayer2.trackselection.MappingTrackSelector.MappedTrackInfo; //导入方法依赖的package包/类
private void updateButtonVisibilities() {
  debugRootView.removeAllViews();

  retryButton.setVisibility(inErrorState ? View.VISIBLE : View.GONE);
  debugRootView.addView(retryButton);

  if (player == null) {
    return;
  }

  MappedTrackInfo mappedTrackInfo = trackSelector.getCurrentMappedTrackInfo();
  if (mappedTrackInfo == null) {
    return;
  }

  for (int i = 0; i < mappedTrackInfo.length; i++) {
    TrackGroupArray trackGroups = mappedTrackInfo.getTrackGroups(i);
    if (trackGroups.length != 0) {
      Button button = new Button(this);
      int label;
      switch (player.getRendererType(i)) {
        case C.TRACK_TYPE_AUDIO:
          label = R.string.audio;
          break;
        case C.TRACK_TYPE_VIDEO:
          label = R.string.video;
          break;
        case C.TRACK_TYPE_TEXT:
          label = R.string.text;
          break;
        default:
          continue;
      }
      button.setText(label);
      button.setTag(i);
      button.setOnClickListener(this);
      debugRootView.addView(button, debugRootView.getChildCount() - 1);
    }
  }
}
 
开发者ID:y20k,项目名称:transistor,代码行数:41,代码来源:PlayerActivity.java


注:本文中的com.google.android.exoplayer2.trackselection.MappingTrackSelector.MappedTrackInfo.getTrackGroups方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。