當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。