public static interface Player.VideoComponent
Player
.Modifier and Type | Method and Description |
---|---|
void |
addVideoListener(VideoListener listener)
Adds a listener to receive video events.
|
void |
clearCameraMotionListener(CameraMotionListener listener)
Clears the listener which receives camera motion events if it matches the one passed.
|
void |
clearVideoFrameMetadataListener(VideoFrameMetadataListener listener)
Clears the listener which receives video frame metadata events if it matches the one passed.
|
void |
clearVideoSurface()
Clears any
Surface , SurfaceHolder , SurfaceView or TextureView
currently set on the player. |
void |
clearVideoSurface(android.view.Surface surface)
Clears the
Surface onto which video is being rendered if it matches the one passed. |
void |
clearVideoSurfaceHolder(android.view.SurfaceHolder surfaceHolder)
Clears the
SurfaceHolder that holds the Surface onto which video is being
rendered if it matches the one passed. |
void |
clearVideoSurfaceView(android.view.SurfaceView surfaceView)
Clears the
SurfaceView onto which video is being rendered if it matches the one
passed. |
void |
clearVideoTextureView(android.view.TextureView textureView)
Clears the
TextureView onto which video is being rendered if it matches the one
passed. |
int |
getVideoScalingMode()
Returns the
C.VideoScalingMode . |
void |
removeVideoListener(VideoListener listener)
Removes a listener of video events.
|
void |
setCameraMotionListener(CameraMotionListener listener)
Sets a listener of camera motion events.
|
void |
setVideoFrameMetadataListener(VideoFrameMetadataListener listener)
Sets a listener to receive video frame metadata events.
|
void |
setVideoScalingMode(int videoScalingMode)
Sets the
C.VideoScalingMode . |
void |
setVideoSurface(android.view.Surface surface)
Sets the
Surface onto which video will be rendered. |
void |
setVideoSurfaceHolder(android.view.SurfaceHolder surfaceHolder)
Sets the
SurfaceHolder that holds the Surface onto which video will be
rendered. |
void |
setVideoSurfaceView(android.view.SurfaceView surfaceView)
Sets the
SurfaceView onto which video will be rendered. |
void |
setVideoTextureView(android.view.TextureView textureView)
Sets the
TextureView onto which video will be rendered. |
void setVideoScalingMode(@C.VideoScalingMode int videoScalingMode)
C.VideoScalingMode
.videoScalingMode
- The C.VideoScalingMode
.@C.VideoScalingMode int getVideoScalingMode()
C.VideoScalingMode
.void addVideoListener(VideoListener listener)
listener
- The listener to register.void removeVideoListener(VideoListener listener)
listener
- The listener to unregister.void setVideoFrameMetadataListener(VideoFrameMetadataListener listener)
This method is intended to be called by the same component that sets the Surface
onto which video will be rendered. If using ExoPlayer's standard UI components, this method
should not be called directly from application code.
listener
- The listener.void clearVideoFrameMetadataListener(VideoFrameMetadataListener listener)
listener
- The listener to clear.void setCameraMotionListener(CameraMotionListener listener)
listener
- The listener.void clearCameraMotionListener(CameraMotionListener listener)
listener
- The listener to clear.void clearVideoSurface()
Surface
, SurfaceHolder
, SurfaceView
or TextureView
currently set on the player.void clearVideoSurface(android.view.Surface surface)
Surface
onto which video is being rendered if it matches the one passed.
Else does nothing.surface
- The surface to clear.void setVideoSurface(@Nullable android.view.Surface surface)
Surface
onto which video will be rendered. The caller is responsible for
tracking the lifecycle of the surface, and must clear the surface by calling setVideoSurface(null)
if the surface is destroyed.
If the surface is held by a SurfaceView
, TextureView
or SurfaceHolder
then it's recommended to use setVideoSurfaceView(SurfaceView)
, setVideoTextureView(TextureView)
or setVideoSurfaceHolder(SurfaceHolder)
rather
than this method, since passing the holder allows the player to track the lifecycle of the
surface automatically.
surface
- The Surface
.void setVideoSurfaceHolder(android.view.SurfaceHolder surfaceHolder)
SurfaceHolder
that holds the Surface
onto which video will be
rendered. The player will track the lifecycle of the surface automatically.surfaceHolder
- The surface holder.void clearVideoSurfaceHolder(android.view.SurfaceHolder surfaceHolder)
SurfaceHolder
that holds the Surface
onto which video is being
rendered if it matches the one passed. Else does nothing.surfaceHolder
- The surface holder to clear.void setVideoSurfaceView(android.view.SurfaceView surfaceView)
SurfaceView
onto which video will be rendered. The player will track the
lifecycle of the surface automatically.surfaceView
- The surface view.void clearVideoSurfaceView(android.view.SurfaceView surfaceView)
SurfaceView
onto which video is being rendered if it matches the one
passed. Else does nothing.surfaceView
- The texture view to clear.void setVideoTextureView(android.view.TextureView textureView)
TextureView
onto which video will be rendered. The player will track the
lifecycle of the surface automatically.textureView
- The texture view.void clearVideoTextureView(android.view.TextureView textureView)
TextureView
onto which video is being rendered if it matches the one
passed. Else does nothing.textureView
- The texture view to clear.