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


Java TrackSelectionArray.get方法代码示例

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


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

示例1: updateForCurrentTrackSelections

import com.google.android.exoplayer2.trackselection.TrackSelectionArray; //导入方法依赖的package包/类
private void updateForCurrentTrackSelections() {
    if (player == null) {
        return;
    }
    TrackSelectionArray selections = player.getCurrentTrackSelections();
    for (int i = 0; i < selections.length; i++) {
        if (player.getRendererType(i) == C.TRACK_TYPE_VIDEO && selections.get(i) != null) {
            // Video enabled so artwork must be hidden. If the shutter is closed, it will be opened in
            // onRenderedFirstFrame().
            return;
        }
    }
    // Video disabled so the shutter must be closed.
    shutterView.setVisibility(VISIBLE);
}
 
开发者ID:12d,项目名称:react-native-videoplayer,代码行数:16,代码来源:ExoPlayerView.java

示例2: onTracksSelected

import com.google.android.exoplayer2.trackselection.TrackSelectionArray; //导入方法依赖的package包/类
@Override
public void onTracksSelected(Renderer[] renderers, TrackGroupArray trackGroups, TrackSelectionArray 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);
}
 
开发者ID:yangchaojiang,项目名称:yjPlay,代码行数:11,代码来源:BufferingLoadControl.java

示例3: updateForCurrentTrackSelections

import com.google.android.exoplayer2.trackselection.TrackSelectionArray; //导入方法依赖的package包/类
private void updateForCurrentTrackSelections() {
    if (player == null) {
        return;
    }
    TrackSelectionArray selections = player.getCurrentTrackSelections();
    for (int i = 0; i < selections.length; i++) {
        if (player.getRendererType(i) == C.TRACK_TYPE_VIDEO && selections.get(i) != null) {
            // Video enabled so artwork must be hidden. If the shutter is closed, it will be opened in
            // onRenderedFirstFrame().
            hideArtwork();
            return;
        }
    }
    // Video disabled so the shutter must be closed.
    if (shutterView != null) {
        shutterView.setVisibility(VISIBLE);
    }
    // Display artwork if enabled and available, else hide it.
    if (useArtwork) {
        for (int i = 0; i < selections.length; i++) {
            TrackSelection selection = selections.get(i);
            if (selection != null) {
                for (int j = 0; j < selection.length(); j++) {
                    Metadata metadata = selection.getFormat(j).metadata;
                    if (metadata != null && setArtworkFromMetadata(metadata)) {
                        return;
                    }
                }
            }
        }
        if (setArtworkFromBitmap(null)) {
            return;
        }
    }
    // Artwork disabled or unavailable.
    hideArtwork();
}
 
开发者ID:yangchaojiang,项目名称:yjPlay,代码行数:38,代码来源:SimpleExoPlayerView.java

示例4: updateForCurrentTrackSelections

import com.google.android.exoplayer2.trackselection.TrackSelectionArray; //导入方法依赖的package包/类
private void updateForCurrentTrackSelections() {
    if (player == null) {
        return;
    }
    TrackSelectionArray selections = player.getCurrentTrackSelections();
    for (int i = 0; i < selections.length; i++) {
        if (player.getRendererType(i) == C.TRACK_TYPE_VIDEO && selections.get(i) != null) {
            // Video enabled so artwork must be hidden. If the shutter is closed, it will be opened in
            // onRenderedFirstFrame().
            hideArtwork();
            return;
        }
    }
    // Video disabled so the shutter must be closed.
    if (shutterView != null) {
        shutterView.setVisibility(VISIBLE);
    }
    // Display artwork if enabled and available, else hide it.
    if (useArtwork) {
        for (int i = 0; i < selections.length; i++) {
            TrackSelection selection = selections.get(i);
            if (selection != null) {
                for (int j = 0; j < selection.length(); j++) {
                    Metadata metadata = selection.getFormat(j).metadata;
                    if (metadata != null && setArtworkFromMetadata(metadata)) {
                        return;
                    }
                }
            }
        }
        if (setArtworkFromBitmap(defaultArtwork)) {
            return;
        }
    }
    // Artwork disabled or unavailable.
    hideArtwork();
}
 
开发者ID:Tubitv,项目名称:TubiPlayer,代码行数:38,代码来源:TubiExoPlayerView.java

示例5: onTracksSelected

import com.google.android.exoplayer2.trackselection.TrackSelectionArray; //导入方法依赖的package包/类
@Override
public void onTracksSelected(Renderer[] renderers, TrackGroupArray trackGroups,
                             TrackSelectionArray trackSelections) {
    int targetBufferSize = 0;
    for (int i = 0; i < renderers.length; i++) {
        if (trackSelections.get(i) != null) {
            targetBufferSize += Util.getDefaultBufferSize(renderers[i].getTrackType());
        }
    }
    allocator.setTargetBufferSize(targetBufferSize);
}
 
开发者ID:hongcwamazing,项目名称:PreviewSeekBar-master,代码行数:12,代码来源:PreviewLoadControl.java

示例6: onTracksSelected

import com.google.android.exoplayer2.trackselection.TrackSelectionArray; //导入方法依赖的package包/类
@Override
public void onTracksSelected(Renderer[] renderers, TrackGroupArray trackGroups,
    TrackSelectionArray 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);
}
 
开发者ID:sanjaysingh1990,项目名称:Exoplayer2Radio,代码行数:12,代码来源:DefaultLoadControl.java

示例7: updateForCurrentTrackSelections

import com.google.android.exoplayer2.trackselection.TrackSelectionArray; //导入方法依赖的package包/类
private void updateForCurrentTrackSelections() {
  if (player == null) {
    return;
  }
  TrackSelectionArray selections = player.getCurrentTrackSelections();
  for (int i = 0; i < selections.length; i++) {
    if (player.getRendererType(i) == C.TRACK_TYPE_VIDEO && selections.get(i) != null) {
      // Video enabled so artwork must be hidden. If the shutter is closed, it will be opened in
      // onRenderedFirstFrame().
      hideArtwork();
      return;
    }
  }
  // Video disabled so the shutter must be closed.
  if (shutterView != null) {
    shutterView.setVisibility(VISIBLE);
  }
  // Display artwork if enabled and available, else hide it.
  if (useArtwork) {
    for (int i = 0; i < selections.length; i++) {
      TrackSelection selection = selections.get(i);
      if (selection != null) {
        for (int j = 0; j < selection.length(); j++) {
          Metadata metadata = selection.getFormat(j).metadata;
          if (metadata != null && setArtworkFromMetadata(metadata)) {
            return;
          }
        }
      }
    }
    if (setArtworkFromBitmap(defaultArtwork)) {
      return;
    }
  }
  // Artwork disabled or unavailable.
  hideArtwork();
}
 
开发者ID:jcodeing,项目名称:K-Sonic,代码行数:38,代码来源:SimpleExoPlayerView.java

示例8: calculateTargetBufferSize

import com.google.android.exoplayer2.trackselection.TrackSelectionArray; //导入方法依赖的package包/类
/**
 * Calculate target buffer size in bytes based on the selected tracks. The player will try not to
 * exceed this target buffer. Only used when {@code targetBufferBytes} is {@link C#LENGTH_UNSET}.
 *
 * @param renderers The renderers for which the track were selected.
 * @param trackSelectionArray The selected tracks.
 * @return The target buffer size in bytes.
 */
protected int calculateTargetBufferSize(
    Renderer[] renderers, TrackSelectionArray trackSelectionArray) {
  int targetBufferSize = 0;
  for (int i = 0; i < renderers.length; i++) {
    if (trackSelectionArray.get(i) != null) {
      targetBufferSize += Util.getDefaultBufferSize(renderers[i].getTrackType());
    }
  }
  return targetBufferSize;
}
 
开发者ID:y20k,项目名称:transistor,代码行数:19,代码来源:DefaultLoadControl.java


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