diff options
| -rw-r--r-- | core/java/android/widget/VideoView2.java | 20 | ||||
| -rw-r--r-- | core/res/res/values/attrs.xml | 10 | ||||
| -rw-r--r-- | media/java/android/media/update/VideoView2Provider.java | 3 |
3 files changed, 18 insertions, 15 deletions
diff --git a/core/java/android/widget/VideoView2.java b/core/java/android/widget/VideoView2.java index ac83313bd835..8404223d91c8 100644 --- a/core/java/android/widget/VideoView2.java +++ b/core/java/android/widget/VideoView2.java @@ -112,14 +112,14 @@ public class VideoView2 extends FrameLayout { public @interface ViewType {} /** - * Indicates video is rendering on SurfaceView + * Indicates video is rendering on SurfaceView. * * @see #setViewType */ public static final int VIEW_TYPE_SURFACEVIEW = 1; /** - * Indicates video is rendering on TextureView + * Indicates video is rendering on TextureView. * * @see #setViewType */ @@ -188,18 +188,12 @@ public class VideoView2 extends FrameLayout { } /** - * Starts rendering closed caption or subtitles if there is any. The first subtitle track will - * be chosen by default if there multiple subtitle tracks exist. + * 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. */ - public void showSubtitle() { - mProvider.showSubtitle_impl(); - } - - /** - * Stops showing closed captions or subtitles. - */ - public void hideSubtitle() { - mProvider.hideSubtitle_impl(); + public void showSubtitle(boolean show) { + mProvider.showSubtitle_impl(show); } /** diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index 5184dda70252..0543305f9880 100644 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -8773,6 +8773,16 @@ <attr name="fontProviderCerts" format="reference" /> </declare-styleable> + <!-- Attributes that are read when parsing a tag. --> + <declare-styleable name="VideoView2"> + <attr name="enableControlView" format="boolean" /> + <attr name="showSubtitle" format="boolean" /> + <attr name="viewType" format="enum"> + <enum name="surfaceView" value="0" /> + <enum name="textureView" value="1" /> + </attr> + </declare-styleable> + <!-- @hide --> <declare-styleable name="RecyclerView"> <attr name="layoutManager" format="string" /> diff --git a/media/java/android/media/update/VideoView2Provider.java b/media/java/android/media/update/VideoView2Provider.java index c5b58f7bb611..10f03d223d9f 100644 --- a/media/java/android/media/update/VideoView2Provider.java +++ b/media/java/android/media/update/VideoView2Provider.java @@ -47,8 +47,7 @@ public interface VideoView2Provider extends ViewProvider { void setMediaControlView2_impl(MediaControlView2 mediaControlView); MediaController getMediaController_impl(); MediaControlView2 getMediaControlView2_impl(); - void showSubtitle_impl(); - void hideSubtitle_impl(); + void showSubtitle_impl(boolean show); // TODO: remove setSpeed_impl once MediaController2 is ready. void setSpeed_impl(float speed); void setAudioFocusRequest_impl(int focusGain); |