Loading core/java/android/widget/VideoView2.java +14 −4 Original line number Diff line number Diff line Loading @@ -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(); } /** Loading core/res/res/values/attrs.xml +1 −1 Original line number Diff line number Diff line Loading @@ -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" /> Loading media/java/android/media/update/VideoView2Provider.java +2 −1 Original line number Diff line number Diff line Loading @@ -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); Loading Loading
core/java/android/widget/VideoView2.java +14 −4 Original line number Diff line number Diff line Loading @@ -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(); } /** Loading
core/res/res/values/attrs.xml +1 −1 Original line number Diff line number Diff line Loading @@ -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" /> Loading
media/java/android/media/update/VideoView2Provider.java +2 −1 Original line number Diff line number Diff line Loading @@ -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); Loading