Java 类com.google.android.exoplayer.text.CaptionStyleCompat 实例源码

项目:androidtv-sample    文件:RichTvInputService.java   
@Override
public View onCreateOverlayView() {
    LayoutInflater inflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
    mSubtitleView = (SubtitleLayout) inflater.inflate(R.layout.subtitleview, null);

    // Configure the subtitle view.
    CaptionStyleCompat captionStyle;
    float captionTextSize = getCaptionFontSize();
    captionStyle = CaptionStyleCompat
            .createFromCaptionStyle(mCaptioningManager.getUserStyle());
    captionTextSize *= mCaptioningManager.getFontScale();
    mSubtitleView.setStyle(captionStyle);
    mSubtitleView.setFixedTextSize(TEXT_UNIT_PIXELS, captionTextSize);
    mSubtitleView.setVisibility(View.VISIBLE);

    return mSubtitleView;
}
项目:android_packages_apps_tv    文件:CaptionWindowLayout.java   
public CaptionWindowLayout(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);

    // Add a subtitle view to the layout.
    mSubtitleView = new SubtitleView(context);
    LayoutParams params = new RelativeLayout.LayoutParams(
            ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    addView(mSubtitleView, params);

    // Set the system wide cc preferences to the subtitle view.
    CaptioningManager captioningManager =
            (CaptioningManager) context.getSystemService(Context.CAPTIONING_SERVICE);
    mFontScale = captioningManager.getFontScale();
    mCaptionStyleCompat =
            CaptionStyleCompat.createFromCaptionStyle(captioningManager.getUserStyle());
    mSubtitleView.setStyle(mCaptionStyleCompat);
    mSubtitleView.setText("");
    captioningManager.addCaptioningChangeListener(new SystemWideCaptioningChangeListener());
    updateWidestChar();
}
项目:androidtv-sample-inputs    文件:RichTvInputService.java   
@Override
public View onCreateOverlayView() {
    LayoutInflater inflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
    mSubtitleView = (SubtitleLayout) inflater.inflate(R.layout.subtitleview, null);

    // Configure the subtitle view.
    CaptionStyleCompat captionStyle;
    float captionTextSize = getCaptionFontSize();
    captionStyle = CaptionStyleCompat
            .createFromCaptionStyle(mCaptioningManager.getUserStyle());
    captionTextSize *= mCaptioningManager.getFontScale();
    mSubtitleView.setStyle(captionStyle);
    mSubtitleView.setFixedTextSize(TEXT_UNIT_PIXELS, captionTextSize);
    mSubtitleView.setVisibility(View.VISIBLE);

    return mSubtitleView;
}
项目:ExoPlayerController    文件:PlayerActivity.java   
private void configureSubtitleView() {
    CaptionStyleCompat style;
    float fontScale;
    if (Util.SDK_INT >= 19) {
        style = getUserCaptionStyleV19();
        fontScale = getUserCaptionFontScaleV19();
    } else {
        style = CaptionStyleCompat.DEFAULT;
        fontScale = 1.0f;
    }
    subtitleLayout.setStyle(style);
    subtitleLayout.setFractionalTextSize(SubtitleLayout.DEFAULT_TEXT_SIZE_FRACTION * fontScale);
}
项目:ExoPlayer-Demo    文件:PlayerActivity.java   
private void configureSubtitleView() {
    CaptionStyleCompat style;
    float fontScale;
    if (Util.SDK_INT >= 19) {
        style = getUserCaptionStyleV19();
        fontScale = getUserCaptionFontScaleV19();
    } else {
        style = CaptionStyleCompat.DEFAULT;
        fontScale = 1.0f;
    }
    subtitleLayout.setStyle(style);
    subtitleLayout.setFractionalTextSize(SubtitleLayout.DEFAULT_TEXT_SIZE_FRACTION * fontScale);
}
项目:sbs-android-tv    文件:VideoPlayerView.java   
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);
}
项目:droidkaigi2016    文件:VideoPlayerActivity.java   
private void configureSubtitleView() {
    CaptionStyleCompat style;
    float fontScale;
    if (Util.SDK_INT >= 19) {
        style = getUserCaptionStyleV19();
        fontScale = getUserCaptionFontScaleV19();
    } else {
        style = CaptionStyleCompat.DEFAULT;
        fontScale = 1.0f;
    }
    subtitleLayout.setStyle(style);
    subtitleLayout.setFractionalTextSize(SubtitleLayout.DEFAULT_TEXT_SIZE_FRACTION * fontScale);
}
项目:Android-Example-HLS-ExoPlayer    文件:PlayerActivity.java   
private void configureSubtitleView() {
    CaptionStyleCompat style;
    float fontScale;
    if (Util.SDK_INT >= 19) {
        style = getUserCaptionStyleV19();
        fontScale = getUserCaptionFontScaleV19();
    } else {
        style = CaptionStyleCompat.DEFAULT;
        fontScale = 1.0f;
    }
    subtitleLayout.setStyle(style);
    subtitleLayout.setFractionalTextSize(SubtitleLayout.DEFAULT_TEXT_SIZE_FRACTION * fontScale);
}
项目:ExoPlayerWrapper    文件:SimpleVideoPlayer.java   
private void configureSubtitleView() {
    CaptionStyleCompat captionStyle;
    float fontScale;
    if (Util.SDK_INT >= 19) {
        captionStyle = getUserCaptionStyleV19();
        fontScale = getUserCaptionFontScaleV19();
    } else {
        captionStyle = CaptionStyleCompat.DEFAULT;
        fontScale = 1.0f;
    }
    subtitleLayout.setStyle(captionStyle);
    subtitleLayout.setFractionalTextSize(SubtitleLayout.DEFAULT_TEXT_SIZE_FRACTION * fontScale);
}
项目:android-exoplayer    文件:FullPlayerActivity.java   
private void configureSubtitleView() {
  CaptionStyleCompat captionStyle;
  float captionTextSize = getCaptionFontSize();
  if (Util.SDK_INT >= 19) {
    captionStyle = getUserCaptionStyleV19();
    captionTextSize *= getUserCaptionFontScaleV19();
  } else {
    captionStyle = CaptionStyleCompat.DEFAULT;
  }
  subtitleView.setStyle(captionStyle);
  subtitleView.setTextSize(captionTextSize);
}
项目:iview-android-tv    文件:VideoPlayerView.java   
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);
}
项目:Exoplayer_VLC    文件:PlayerActivity.java   
private void configureSubtitleView() {
  CaptionStyleCompat captionStyle;
  float captionTextSize = getCaptionFontSize();
  if (Util.SDK_INT >= 19) {
    captionStyle = getUserCaptionStyleV19();
    captionTextSize *= getUserCaptionFontScaleV19();
  } else {
    captionStyle = CaptionStyleCompat.DEFAULT;
  }
  subtitleView.setStyle(captionStyle);
  subtitleView.setTextSize(captionTextSize);
}
项目:droidkaigi2016    文件:VideoPlayerActivity.java   
private void configureSubtitleView() {
    CaptionStyleCompat style;
    float fontScale;
    if (Util.SDK_INT >= 19) {
        style = getUserCaptionStyleV19();
        fontScale = getUserCaptionFontScaleV19();
    } else {
        style = CaptionStyleCompat.DEFAULT;
        fontScale = 1.0f;
    }
    subtitleLayout.setStyle(style);
    subtitleLayout.setFractionalTextSize(SubtitleLayout.DEFAULT_TEXT_SIZE_FRACTION * fontScale);
}
项目:ExoPlayer    文件:PlayerActivity.java   
private 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);
}
项目:player-sdk-native-android    文件:KExoPlayer.java   
private void configureSubtitleView() {
    CaptionStyleCompat style;
    float fontScale;
    if (Util.SDK_INT >= 19) {
        style = getUserCaptionStyleV19();
        fontScale = getUserCaptionFontScaleV19();
    } else {
        style = CaptionStyleCompat.DEFAULT;
        fontScale = 1.0f;
    }
    if (mSubtView != null) {
        mSubtView.setStyle(style);
        mSubtView.setFractionalTextSize(SubtitleLayout.DEFAULT_TEXT_SIZE_FRACTION * fontScale);
    }
}
项目:ExoPlayerController    文件:PlayerActivity.java   
@TargetApi(19)
private CaptionStyleCompat getUserCaptionStyleV19() {
    CaptioningManager captioningManager = (CaptioningManager) getSystemService(Context.CAPTIONING_SERVICE);
    return CaptionStyleCompat.createFromCaptionStyle(captioningManager.getUserStyle());
}
项目:android_packages_apps_tv    文件:CaptionWindowLayout.java   
@Override
public void onUserStyleChanged(CaptionStyle userStyle) {
    mCaptionStyleCompat = CaptionStyleCompat.createFromCaptionStyle(userStyle);
    mSubtitleView.setStyle(mCaptionStyleCompat);
    updateWidestChar();
}
项目:ExoPlayer-Demo    文件:PlayerActivity.java   
@TargetApi(19)
private CaptionStyleCompat getUserCaptionStyleV19() {
    CaptioningManager captioningManager =
            (CaptioningManager) getSystemService(Context.CAPTIONING_SERVICE);
    return CaptionStyleCompat.createFromCaptionStyle(captioningManager.getUserStyle());
}
项目:sbs-android-tv    文件:VideoPlayerView.java   
@TargetApi(19)
private CaptionStyleCompat getUserCaptionStyleV19() {
    CaptioningManager captioningManager =
            (CaptioningManager) mContext.getSystemService(Context.CAPTIONING_SERVICE);
    return CaptionStyleCompat.createFromCaptionStyle(captioningManager.getUserStyle());
}
项目:droidkaigi2016    文件:VideoPlayerActivity.java   
@TargetApi(19)
private CaptionStyleCompat getUserCaptionStyleV19() {
    CaptioningManager captioningManager =
            (CaptioningManager) getSystemService(Context.CAPTIONING_SERVICE);
    return CaptionStyleCompat.createFromCaptionStyle(captioningManager.getUserStyle());
}
项目:Android-Example-HLS-ExoPlayer    文件:PlayerActivity.java   
@TargetApi(19)
private CaptionStyleCompat getUserCaptionStyleV19() {
    CaptioningManager captioningManager =
            (CaptioningManager) getSystemService(Context.CAPTIONING_SERVICE);
    return CaptionStyleCompat.createFromCaptionStyle(captioningManager.getUserStyle());
}
项目:ExoPlayerWrapper    文件:SimpleVideoPlayer.java   
@TargetApi(19)
private CaptionStyleCompat getUserCaptionStyleV19() {
    CaptioningManager captioningManager =
            (CaptioningManager) activity.getSystemService(Context.CAPTIONING_SERVICE);
    return CaptionStyleCompat.createFromCaptionStyle(captioningManager.getUserStyle());
}
项目:android-exoplayer    文件:FullPlayerActivity.java   
@TargetApi(19)
private CaptionStyleCompat getUserCaptionStyleV19() {
  CaptioningManager captioningManager =
      (CaptioningManager) getSystemService(Context.CAPTIONING_SERVICE);
  return CaptionStyleCompat.createFromCaptionStyle(captioningManager.getUserStyle());
}
项目:iview-android-tv    文件:VideoPlayerView.java   
@TargetApi(19)
private CaptionStyleCompat getUserCaptionStyleV19() {
    CaptioningManager captioningManager =
            (CaptioningManager) mContext.getSystemService(Context.CAPTIONING_SERVICE);
    return CaptionStyleCompat.createFromCaptionStyle(captioningManager.getUserStyle());
}
项目:Android-Birdcopy-Application    文件:FlyingPlayerActivity.java   
@TargetApi(19)
private CaptionStyleCompat getUserCaptionStyleV19() {
    CaptioningManager captioningManager =
            (CaptioningManager) getSystemService(Context.CAPTIONING_SERVICE);
    return CaptionStyleCompat.createFromCaptionStyle(captioningManager.getUserStyle());
}
项目:Exoplayer_VLC    文件:PlayerActivity.java   
@TargetApi(19)
private CaptionStyleCompat getUserCaptionStyleV19() {
  CaptioningManager captioningManager =
      (CaptioningManager) getSystemService(Context.CAPTIONING_SERVICE);
  return CaptionStyleCompat.createFromCaptionStyle(captioningManager.getUserStyle());
}
项目:droidkaigi2016    文件:VideoPlayerActivity.java   
@TargetApi(19)
private CaptionStyleCompat getUserCaptionStyleV19() {
    CaptioningManager captioningManager =
            (CaptioningManager) getSystemService(Context.CAPTIONING_SERVICE);
    return CaptionStyleCompat.createFromCaptionStyle(captioningManager.getUserStyle());
}
项目:ExoPlayer    文件:PlayerActivity.java   
@TargetApi(19)
private CaptionStyleCompat getUserCaptionStyleV19() {
  CaptioningManager captioningManager =
      (CaptioningManager) getSystemService(Context.CAPTIONING_SERVICE);
  return CaptionStyleCompat.createFromCaptionStyle(captioningManager.getUserStyle());
}
项目:player-sdk-native-android    文件:KExoPlayer.java   
@TargetApi(19)
private CaptionStyleCompat getUserCaptionStyleV19() {
    CaptioningManager captioningManager =
            (CaptioningManager) getContext().getSystemService(Context.CAPTIONING_SERVICE);
    return CaptionStyleCompat.createFromCaptionStyle(captioningManager.getUserStyle());
}