com.google.android.exoplayer2.ui.SubtitleView Java Examples

The following examples show how to use com.google.android.exoplayer2.ui.SubtitleView. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ExoPlayerView.java    From react-native-video with MIT License 5 votes vote down vote up
public ExoPlayerView(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);

    this.context = context;

    layoutParams = new ViewGroup.LayoutParams(
            ViewGroup.LayoutParams.MATCH_PARENT,
            ViewGroup.LayoutParams.MATCH_PARENT);

    componentListener = new ComponentListener();

    FrameLayout.LayoutParams aspectRatioParams = new FrameLayout.LayoutParams(
            FrameLayout.LayoutParams.MATCH_PARENT,
            FrameLayout.LayoutParams.MATCH_PARENT);
    aspectRatioParams.gravity = Gravity.CENTER;
    layout = new AspectRatioFrameLayout(context);
    layout.setLayoutParams(aspectRatioParams);

    shutterView = new View(getContext());
    shutterView.setLayoutParams(layoutParams);
    shutterView.setBackgroundColor(ContextCompat.getColor(context, android.R.color.black));

    subtitleLayout = new SubtitleView(context);
    subtitleLayout.setLayoutParams(layoutParams);
    subtitleLayout.setUserDefaultStyle();
    subtitleLayout.setUserDefaultTextSize();

    updateSurfaceView();

    layout.addView(shutterView, 1, layoutParams);
    layout.addView(subtitleLayout, 2, layoutParams);

    addViewInLayout(layout, 0, aspectRatioParams);
}
 
Example #2
Source File: CustomizePlayerView.java    From bcm-android with GNU General Public License v3.0 4 votes vote down vote up
public SubtitleView getSubtitleView() {
    return subtitleView;
}
 
Example #3
Source File: TubiExoPlayerView.java    From TubiPlayer with MIT License 2 votes vote down vote up
/**
 * Gets the {@link SubtitleView}.
 *
 * @return The {@link SubtitleView}, or {@code null} if the layout has been customized and the
 * subtitle view is not present.
 */
public SubtitleView getSubtitleView() {
    return subtitleView;
}
 
Example #4
Source File: ExoVideoView.java    From ExoVideoView with Apache License 2.0 2 votes vote down vote up
/**
 * Gets the {@link SubtitleView}.
 *
 * @return The {@link SubtitleView}, or {@code null} if the layout has been customized and the
 * subtitle view is not present.
 */
public SubtitleView getSubtitleView() {
    return subtitleView;
}