• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java MappedTrackInfo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



MappedTrackInfo类属于com.google.android.exoplayer2.trackselection.MappingTrackSelector包,在下文中一共展示了MappedTrackInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: onTracksChanged

import com.google.android.exoplayer2.trackselection.MappingTrackSelector.MappedTrackInfo; //导入依赖的package包/类
@Override
@SuppressWarnings("ReferenceEquality")
public void onTracksChanged(TrackGroupArray trackGroups, TrackSelectionArray trackSelections) {
  updateButtonVisibilities();
  if (trackGroups != lastSeenTrackGroupArray) {
    MappedTrackInfo mappedTrackInfo = trackSelector.getCurrentMappedTrackInfo();
    if (mappedTrackInfo != null) {
      if (mappedTrackInfo.getTrackTypeRendererSupport(C.TRACK_TYPE_VIDEO)
          == MappedTrackInfo.RENDERER_SUPPORT_UNSUPPORTED_TRACKS) {
        showToast(R.string.error_unsupported_video);
      }
      if (mappedTrackInfo.getTrackTypeRendererSupport(C.TRACK_TYPE_AUDIO)
          == MappedTrackInfo.RENDERER_SUPPORT_UNSUPPORTED_TRACKS) {
        showToast(R.string.error_unsupported_audio);
      }
    }
    lastSeenTrackGroupArray = trackGroups;
  }
}
 
开发者ID:y20k,项目名称:transistor,代码行数:20,代码来源:PlayerActivity.java


示例6: onClick

import com.google.android.exoplayer2.trackselection.MappingTrackSelector.MappedTrackInfo; //导入依赖的package包/类
@Override
public void onClick(View view) {
    if (view == retryButton) {
        initializePlayer();
    } else if (view.getParent() == debugRootView) {
        MappedTrackInfo mappedTrackInfo = trackSelector.getCurrentMappedTrackInfo();
        if (mappedTrackInfo != null) {
            trackSelectionHelper.showSelectionDialog(this, ((Button) view).getText(),
                    trackSelector.getCurrentMappedTrackInfo(), (int) view.getTag());
        }
    }
}
 
开发者ID:ashwanijanghu,项目名称:ExoPlayer-Offline,代码行数:13,代码来源:PlayerActivity.java


示例7: onTracksChanged

import com.google.android.exoplayer2.trackselection.MappingTrackSelector.MappedTrackInfo; //导入依赖的package包/类
@Override
public void onTracksChanged(TrackGroupArray trackGroups, TrackSelectionArray trackSelections) {
    updateButtonVisibilities();
    MappedTrackInfo mappedTrackInfo = trackSelector.getCurrentMappedTrackInfo();
    if (mappedTrackInfo != null) {
        if (mappedTrackInfo.getTrackTypeRendererSupport(C.TRACK_TYPE_VIDEO)
                == MappedTrackInfo.RENDERER_SUPPORT_UNSUPPORTED_TRACKS) {
            showToast(R.string.error_unsupported_video);
        }
        if (mappedTrackInfo.getTrackTypeRendererSupport(C.TRACK_TYPE_AUDIO)
                == MappedTrackInfo.RENDERER_SUPPORT_UNSUPPORTED_TRACKS) {
            showToast(R.string.error_unsupported_audio);
        }
    }
}
 
开发者ID:ashwanijanghu,项目名称:ExoPlayer-Offline,代码行数:16,代码来源:PlayerActivity.java


示例8: 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


示例9: onTrackSelectionsChanged

import com.google.android.exoplayer2.trackselection.MappingTrackSelector.MappedTrackInfo; //导入依赖的package包/类
@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);
        }
    }
 
开发者ID:AndroidTips,项目名称:MDVideo,代码行数:12,代码来源:PlayerActivityV2.java


示例10:

import com.google.android.exoplayer2.trackselection.MappingTrackSelector.MappedTrackInfo; //导入依赖的package包/类
/**
 * @param rendererTrackTypes The track type supported by each renderer.
 * @param trackGroups The {@link TrackGroupArray}s for each renderer.
 * @param mixedMimeTypeAdaptiveSupport The result of
 *     {@link RendererCapabilities#supportsMixedMimeTypeAdaptation()} for each renderer.
 * @param formatSupport The result of {@link RendererCapabilities#supportsFormat} for each
 *     track, indexed by renderer index, group index and track index (in that order).
 * @param unassociatedTrackGroups Contains {@link TrackGroup}s not associated with any renderer.
 */
/* package */ MappedTrackInfo(int[] rendererTrackTypes,
    TrackGroupArray[] trackGroups, int[] mixedMimeTypeAdaptiveSupport,
    int[][][] formatSupport, TrackGroupArray unassociatedTrackGroups) {
  this.rendererTrackTypes = rendererTrackTypes;
  this.trackGroups = trackGroups;
  this.formatSupport = formatSupport;
  this.mixedMimeTypeAdaptiveSupport = mixedMimeTypeAdaptiveSupport;
  this.unassociatedTrackGroups = unassociatedTrackGroups;
  this.rendererCount = trackGroups.length;
}
 
开发者ID:zhanglibin123488,项目名称:videoPickPlayer,代码行数:20,代码来源:MappingTrackSelector.java


示例11: onClick

import com.google.android.exoplayer2.trackselection.MappingTrackSelector.MappedTrackInfo; //导入依赖的package包/类
@Override
public void onClick(View view) {
  if (view == retryButton) {
    initializePlayer();
  } else if (view.getParent() == debugRootView) {
    MappedTrackInfo mappedTrackInfo = trackSelector.getCurrentMappedTrackInfo();
    if (mappedTrackInfo != null) {
      trackSelectionHelper.showSelectionDialog(this, ((Button) view).getText(),
          trackSelector.getCurrentMappedTrackInfo(), (int) view.getTag());
    }
  }
}
 
开发者ID:TakumaMochizuki,项目名称:Komica,代码行数:13,代码来源:PlayerActivity.java


示例12: onTracksChanged

import com.google.android.exoplayer2.trackselection.MappingTrackSelector.MappedTrackInfo; //导入依赖的package包/类
@Override
public void onTracksChanged(TrackGroupArray trackGroups, TrackSelectionArray trackSelections) {
  updateButtonVisibilities();
  MappedTrackInfo mappedTrackInfo = trackSelector.getCurrentMappedTrackInfo();
  if (mappedTrackInfo != null) {
    if (mappedTrackInfo.getTrackTypeRendererSupport(C.TRACK_TYPE_VIDEO)
        == MappedTrackInfo.RENDERER_SUPPORT_UNSUPPORTED_TRACKS) {
      showToast(R.string.error_unsupported_video);
    }
    if (mappedTrackInfo.getTrackTypeRendererSupport(C.TRACK_TYPE_AUDIO)
        == MappedTrackInfo.RENDERER_SUPPORT_UNSUPPORTED_TRACKS) {
      showToast(R.string.error_unsupported_audio);
    }
  }
}
 
开发者ID:TakumaMochizuki,项目名称:Komica,代码行数:16,代码来源:PlayerActivity.java


示例13: 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


示例14: onClick

import com.google.android.exoplayer2.trackselection.MappingTrackSelector.MappedTrackInfo; //导入依赖的package包/类
@Override
public void onClick(View view) {
  if (view == retryButton) {
    initializePlayer();
  } else if (view.getParent() == debugRootView) {
    MappedTrackInfo mappedTrackInfo = trackSelector.getCurrentMappedTrackInfo();
    if (mappedTrackInfo != null) {
      trackSelectionHelper.showSelectionDialog(
          this, ((Button) view).getText(), mappedTrackInfo, (int) view.getTag());
    }
  }
}
 
开发者ID:y20k,项目名称:transistor,代码行数:13,代码来源:PlayerActivity.java


示例15: 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类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ArrayMath类代码示例发布时间:2022-05-22
下一篇:
Java SyncService类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap