Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 00f255e7 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "VideoView2: Replace showSubtitle with setSubtitleEnabled"

parents fbbd7583 682483d1
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
@@ -181,11 +181,21 @@ public class VideoView2 extends ViewGroupHelper<VideoView2Provider> {

    /**
     * Shows or hides closed caption or subtitles if there is any.
     * The first subtitle track will be chosen by default if there multiple subtitle tracks exist.
     * @param show shows closed caption or subtitles if this value is true, or hides.
     * The first subtitle track will be chosen if there multiple subtitle tracks exist.
     * Default behavior of VideoView2 is not showing subtitle.
     * @param enable shows closed caption or subtitles if this value is true, or hides.
     */
    public void showSubtitle(boolean show) {
        mProvider.showSubtitle_impl(show);
    public void setSubtitleEnabled(boolean enable) {
        mProvider.setSubtitleEnabled_impl(enable);
    }

    /**
     * Returns true if showing subtitle feature is enabled or returns false.
     * Although there is no subtitle track or closed caption, it can return true, if the feature
     * has been enabled by {@link #setSubtitleEnabled}.
     */
    public boolean isSubtitleEnabled() {
        return mProvider.isSubtitleEnabled_impl();
    }

    /**
+1 −1
Original line number Diff line number Diff line
@@ -8798,7 +8798,7 @@
    <!-- Attributes that are read when parsing a  tag. -->
    <declare-styleable name="VideoView2">
        <attr name="enableControlView" format="boolean" />
        <attr name="showSubtitle" format="boolean" />
        <attr name="enableSubtitle" format="boolean" />
        <attr name="viewType" format="enum">
            <enum name="surfaceView" value="0" />
            <enum name="textureView" value="1" />
+2 −1
Original line number Diff line number Diff line
@@ -51,7 +51,8 @@ public interface VideoView2Provider extends ViewGroupProvider {
    void setMediaControlView2_impl(MediaControlView2 mediaControlView);
    MediaController getMediaController_impl();
    MediaControlView2 getMediaControlView2_impl();
    void showSubtitle_impl(boolean show);
    void setSubtitleEnabled_impl(boolean enable);
    boolean isSubtitleEnabled_impl();
    // TODO: remove setSpeed_impl once MediaController2 is ready.
    void setSpeed_impl(float speed);
    void setAudioFocusRequest_impl(int focusGain);