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


Java Util.SDK_INT属性代码示例

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


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

示例1: onMeasure

@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    final int widthSpec = MeasureSpec.getSize(widthMeasureSpec);

    if (computeMeasurements(widthSpec)) {
        final StaticLayout layout = this.mLayout;
        final int paddingX = getPaddingLeft() + getPaddingRight() + mInnerPaddingX * 2;
        final int height = layout.getHeight() + getPaddingTop() + getPaddingBottom();
        int width = 0;
        int lineCount = layout.getLineCount();
        for (int i = 0; i < lineCount; i++) {
            width = Math.max((int) Math.ceil(layout.getLineWidth(i)), width);
        }
        width += paddingX;
        setMeasuredDimension(width, height);
    } else if (Util.SDK_INT >= 11) {
        setTooSmallMeasureDimensionV11();
    } else {
        setMeasuredDimension(0, 0);
    }
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:21,代码来源:SubtitleView.java

示例2: AudioTrack

public AudioTrack() {
  releasingConditionVariable = new ConditionVariable(true);
  if (Util.SDK_INT >= 18) {
    try {
      getLatencyMethod =
          android.media.AudioTrack.class.getMethod("getLatency", (Class<?>[]) null);
    } catch (NoSuchMethodException e) {
      // There's no guarantee this method exists. Do nothing.
    }
  }
  if (Util.SDK_INT >= 19) {
    audioTrackUtil = new AudioTrackUtilV19();
  } else {
    audioTrackUtil = new AudioTrackUtil();
  }
  playheadOffsets = new long[MAX_PLAYHEAD_OFFSET_COUNT];
  volume = 1.0f;
  startMediaTimeState = START_NOT_SET;
}
 
开发者ID:XueyanLiu,项目名称:miku,代码行数:19,代码来源:AudioTrack.java

示例3: getMediaCodecInfo

/**
 * Returns the name of the best decoder and its capabilities for the given mimeType.
 */
private static synchronized Pair<String, CodecCapabilities> getMediaCodecInfo(
    String mimeType, boolean secure) throws DecoderQueryException {
  CodecKey key = new CodecKey(mimeType, secure);
  if (codecs.containsKey(key)) {
    return codecs.get(key);
  }
  MediaCodecListCompat mediaCodecList = Util.SDK_INT >= 21
      ? new MediaCodecListCompatV21(secure) : new MediaCodecListCompatV16();
  Pair<String, CodecCapabilities> codecInfo = getMediaCodecInfo(key, mediaCodecList);
  // TODO: Verify this cannot occur on v22, and change >= to == [Internal: b/18678462].
  if (secure && codecInfo == null && Util.SDK_INT >= 21) {
    // Some devices don't list secure decoders on API level 21. Try the legacy path.
    mediaCodecList = new MediaCodecListCompatV16();
    codecInfo = getMediaCodecInfo(key, mediaCodecList);
    if (codecInfo != null) {
      Log.w(TAG, "MediaCodecList API didn't list secure decoder for: " + mimeType
          + ". Assuming: " + codecInfo.first);
    }
  }
  return codecInfo;
}
 
开发者ID:XueyanLiu,项目名称:miku,代码行数:24,代码来源:MediaCodecUtil.java

示例4: configureSubtitleView

public void configureSubtitleView() {
    CaptionStyleCompat captionStyle;
    float captionFontScale;
    if (Util.SDK_INT >= 19) {
        captionStyle = getUserCaptionStyleV19();
        captionFontScale = getUserCaptionFontScaleV19();
    } else {
        captionStyle = CaptionStyleCompat.DEFAULT;
        captionFontScale = 1.0f;
    }
    subtitleLayout.setStyle(captionStyle);
    subtitleLayout.setFontScale(captionFontScale);
}
 
开发者ID:nextux,项目名称:sbs-android-tv,代码行数:13,代码来源:VideoPlayerView.java

示例5: setAudioTrackVolume

private void setAudioTrackVolume() {
  if (!isInitialized()) {
    // Do nothing.
  } else if (Util.SDK_INT >= 21) {
    setAudioTrackVolumeV21(audioTrack, volume);
  } else {
    setAudioTrackVolumeV3(audioTrack, volume);
  }
}
 
开发者ID:asifkhan11,项目名称:ExoPlayer-Demo,代码行数:9,代码来源:AudioTrack.java

示例6: onError

@Override
public void onError(Exception e) {
	if (e instanceof UnsupportedDrmException) {
		// Special case DRM failures.
		UnsupportedDrmException unsupportedDrmException = (UnsupportedDrmException) e;
		int stringId = Util.SDK_INT < 18 ? R.string.drm_error_not_supported
				: unsupportedDrmException.reason == UnsupportedDrmException.REASON_UNSUPPORTED_SCHEME
						? R.string.drm_error_unsupported_scheme : R.string.drm_error_unknown;
		Toast.makeText(getApplicationContext(), stringId, Toast.LENGTH_LONG).show();
	}
	playerNeedsPrepare = true;
	updateButtonVisibilities();
	showControls();
	goatMediaController.showError();
}
 
开发者ID:vuthanhict,项目名称:ExoPlayerController,代码行数:15,代码来源:PlayerActivity.java

示例7: testH264AdaptiveWithRendererDisabling

public void testH264AdaptiveWithRendererDisabling() throws IOException {
  if (Util.SDK_INT < 16 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_H264)) {
    // Pass.
    return;
  }
  String streamName = "test_h264_adaptive_with_renderer_disabling";
  testDashPlayback(getActivity(), streamName, RENDERER_DISABLING_SCHEDULE, false, H264_MANIFEST,
      AAC_AUDIO_REPRESENTATION_ID, ALLOW_ADDITIONAL_VIDEO_FORMATS, H264_CDD_ADAPTIVE);
}
 
开发者ID:asifkhan11,项目名称:ExoPlayer-Demo,代码行数:9,代码来源:DashTest.java

示例8: requiresPermission

@TargetApi(23)
private boolean requiresPermission(Uri uri) {
    return Util.SDK_INT >= 23
            && Util.isLocalFileUri(uri)
            && checkSelfPermission(permission.READ_EXTERNAL_STORAGE)
            != PackageManager.PERMISSION_GRANTED;
}
 
开发者ID:asifkhan11,项目名称:ExoPlayer-Demo,代码行数:7,代码来源:PlayerActivity.java

示例9: open

@Override
public final void open(DrmInitData drmInitData) {
  if (++openCount != 1) {
    return;
  }
  if (postRequestHandler == null) {
    requestHandlerThread = new HandlerThread("DrmRequestHandler");
    requestHandlerThread.start();
    postRequestHandler = new PostRequestHandler(requestHandlerThread.getLooper());
  }
  if (schemeData == null) {
    mimeType = drmInitData.mimeType;
    schemeData = drmInitData.get(uuid);
    if (schemeData == null) {
      onError(new IllegalStateException("Media does not support uuid: " + uuid));
      return;
    }
    if (Util.SDK_INT < 21) {
      // Prior to L the Widevine CDM required data to be extracted from the PSSH atom.
      byte[] psshData = PsshAtomUtil.parseSchemeSpecificData(schemeData, WIDEVINE_UUID);
      if (psshData == null) {
        // Extraction failed. schemeData isn't a Widevine PSSH atom, so leave it unchanged.
      } else {
        schemeData = psshData;
      }
    }
  }
  state = STATE_OPENING;
  openInternal(true);
}
 
开发者ID:XueyanLiu,项目名称:miku,代码行数:30,代码来源:StreamingDrmSessionManager.java

示例10: testH265AdaptiveWithRendererDisabling

public void testH265AdaptiveWithRendererDisabling() throws IOException {
if (Util.SDK_INT < 24 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_H265)) {
  // Pass.
  return;
}
String streamName = "test_h265_adaptive_with_renderer_disabling";
testDashPlayback(getActivity(), streamName, RENDERER_DISABLING_SCHEDULE, false,
    H265_MANIFEST, AAC_AUDIO_REPRESENTATION_ID, ALLOW_ADDITIONAL_VIDEO_FORMATS,
    H265_CDD_ADAPTIVE);
}
 
开发者ID:asifkhan11,项目名称:ExoPlayer-Demo,代码行数:10,代码来源:DashTest.java

示例11: onStart

@Override
public void onStart() {
    super.onStart();
    if (Util.SDK_INT > 23) {
        onShown();
    }
}
 
开发者ID:konifar,项目名称:droidkaigi2016,代码行数:7,代码来源:VideoPlayerActivity.java

示例12: onResume

@Override
public void onResume() {
    super.onResume();
    if (Util.SDK_INT <= 23 || player == null) {
        onShown();
    }
}
 
开发者ID:asifkhan11,项目名称:ExoPlayer-Demo,代码行数:7,代码来源:PlayerActivity.java

示例13: testH265AdaptiveWithSeeking

public void testH265AdaptiveWithSeeking() throws IOException {
  if (Util.SDK_INT < 24 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_H265)) {
    // Pass.
    return;
  }
  String streamName = "test_h265_adaptive_with_seeking";
  testDashPlayback(getActivity(), streamName, SEEKING_SCHEDULE, false, H265_MANIFEST,
      AAC_AUDIO_REPRESENTATION_ID, ALLOW_ADDITIONAL_VIDEO_FORMATS, H265_CDD_ADAPTIVE);
}
 
开发者ID:asifkhan11,项目名称:ExoPlayer-Demo,代码行数:9,代码来源:DashTest.java

示例14: testH264Adaptive

public void testH264Adaptive() throws IOException {
  if (Util.SDK_INT < 16 || shouldSkipAdaptiveTest(MimeTypes.VIDEO_H264)) {
    // Pass.
    return;
  }
  String streamName = "test_h264_adaptive";
  testDashPlayback(getActivity(), streamName, H264_MANIFEST, AAC_AUDIO_REPRESENTATION_ID,
      ALLOW_ADDITIONAL_VIDEO_FORMATS, H264_CDD_ADAPTIVE);
}
 
开发者ID:asifkhan11,项目名称:ExoPlayer-Demo,代码行数:9,代码来源:DashTest.java

示例15: onStop

@Override
public void onStop() {
    super.onStop();
    if (Util.SDK_INT > 23) {
        onHidden();
    }
}
 
开发者ID:konifar,项目名称:droidkaigi2016,代码行数:7,代码来源:VideoPlayerActivity.java


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