Add info about using SurfaceView instead of TextureView

PiperOrigin-RevId: 580145645
This commit is contained in:
andrewlewis 2023-11-07 05:32:52 -08:00 committed by Copybara-Service
parent 4311cf1d6c
commit a7d47d4526
2 changed files with 9 additions and 2 deletions

View File

@ -3326,6 +3326,12 @@ public interface Player {
* Sets the {@link TextureView} onto which video will be rendered. The player will track the
* lifecycle of the surface automatically.
*
* <p>Consider using {@link SurfaceView} via {@link #setVideoSurfaceView} instead of {@link
* TextureView}. {@link SurfaceView} generally causes lower battery consumption, and has better
* handling for HDR and secure content. See <a
* href="https://developer.android.com/guide/topics/media/ui/playerview#surfacetype">Choosing a
* surface type</a> for more information.
*
* <p>The thread that calls the {@link TextureView.SurfaceTextureListener} methods must be the
* thread associated with {@link #getApplicationLooper()}.
*

View File

@ -146,8 +146,9 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
* values are {@code surface_view}, {@code texture_view}, {@code spherical_gl_surface_view},
* {@code video_decoder_gl_surface_view} and {@code none}. Using {@code none} is recommended
* for audio only applications, since creating the surface can be expensive. Using {@code
* surface_view} is recommended for video applications. Note, TextureView can only be used in
* a hardware accelerated window. When rendered in software, TextureView will draw nothing.
* surface_view} is recommended for video applications. See <a
* href="https://developer.android.com/guide/topics/media/ui/playerview#surfacetype">Choosing
* a surface type</a> for more information.
* <ul>
* <li>Corresponding method: None
* <li>Default: {@code surface_view}