Package com.google.android.exoplayer2
Interface ExoPlayer.VideoComponent
-
- All Known Implementing Classes:
SimpleExoPlayer
- Enclosing interface:
- ExoPlayer
public static interface ExoPlayer.VideoComponent
The video component of anExoPlayer
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
addVideoListener(VideoListener listener)
Deprecated.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()
void
clearVideoSurface(Surface surface)
Clears theSurface
onto which video is being rendered if it matches the one passed.void
clearVideoSurfaceHolder(SurfaceHolder surfaceHolder)
Clears theSurfaceHolder
that holds theSurface
onto which video is being rendered if it matches the one passed.void
clearVideoSurfaceView(SurfaceView surfaceView)
Clears theSurfaceView
onto which video is being rendered if it matches the one passed.void
clearVideoTextureView(TextureView textureView)
Clears theTextureView
onto which video is being rendered if it matches the one passed.int
getVideoScalingMode()
Returns theC.VideoScalingMode
.VideoSize
getVideoSize()
Gets the size of the video.void
removeVideoListener(VideoListener listener)
Deprecated.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 theC.VideoScalingMode
.void
setVideoSurface(Surface surface)
Sets theSurface
onto which video will be rendered.void
setVideoSurfaceHolder(SurfaceHolder surfaceHolder)
Sets theSurfaceHolder
that holds theSurface
onto which video will be rendered.void
setVideoSurfaceView(SurfaceView surfaceView)
Sets theSurfaceView
onto which video will be rendered.void
setVideoTextureView(TextureView textureView)
Sets theTextureView
onto which video will be rendered.
-
-
-
Method Detail
-
setVideoScalingMode
void setVideoScalingMode(@VideoScalingMode int videoScalingMode)
Sets theC.VideoScalingMode
.- Parameters:
videoScalingMode
- TheC.VideoScalingMode
.
-
getVideoScalingMode
@VideoScalingMode int getVideoScalingMode()
Returns theC.VideoScalingMode
.
-
addVideoListener
@Deprecated void addVideoListener(VideoListener listener)
Deprecated.Adds a listener to receive video events.- Parameters:
listener
- The listener to register.
-
removeVideoListener
@Deprecated void removeVideoListener(VideoListener listener)
Deprecated.Removes a listener of video events.- Parameters:
listener
- The listener to unregister.
-
setVideoFrameMetadataListener
void setVideoFrameMetadataListener(VideoFrameMetadataListener listener)
Sets a listener to receive video frame metadata events.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.- Parameters:
listener
- The listener.
-
clearVideoFrameMetadataListener
void clearVideoFrameMetadataListener(VideoFrameMetadataListener listener)
Clears the listener which receives video frame metadata events if it matches the one passed. Else does nothing.- Parameters:
listener
- The listener to clear.
-
setCameraMotionListener
void setCameraMotionListener(CameraMotionListener listener)
Sets a listener of camera motion events.- Parameters:
listener
- The listener.
-
clearCameraMotionListener
void clearCameraMotionListener(CameraMotionListener listener)
Clears the listener which receives camera motion events if it matches the one passed. Else does nothing.- Parameters:
listener
- The listener to clear.
-
clearVideoSurface
void clearVideoSurface()
-
clearVideoSurface
void clearVideoSurface(@Nullable Surface surface)
Clears theSurface
onto which video is being rendered if it matches the one passed. Else does nothing.- Parameters:
surface
- The surface to clear.
-
setVideoSurface
void setVideoSurface(@Nullable Surface surface)
Sets theSurface
onto which video will be rendered. The caller is responsible for tracking the lifecycle of the surface, and must clear the surface by callingsetVideoSurface(null)
if the surface is destroyed.If the surface is held by a
SurfaceView
,TextureView
orSurfaceHolder
then it's recommended to usesetVideoSurfaceView(SurfaceView)
,setVideoTextureView(TextureView)
orsetVideoSurfaceHolder(SurfaceHolder)
rather than this method, since passing the holder allows the player to track the lifecycle of the surface automatically.- Parameters:
surface
- TheSurface
.
-
setVideoSurfaceHolder
void setVideoSurfaceHolder(@Nullable SurfaceHolder surfaceHolder)
Sets theSurfaceHolder
that holds theSurface
onto which video will be rendered. The player will track the lifecycle of the surface automatically.- Parameters:
surfaceHolder
- The surface holder.
-
clearVideoSurfaceHolder
void clearVideoSurfaceHolder(@Nullable SurfaceHolder surfaceHolder)
Clears theSurfaceHolder
that holds theSurface
onto which video is being rendered if it matches the one passed. Else does nothing.- Parameters:
surfaceHolder
- The surface holder to clear.
-
setVideoSurfaceView
void setVideoSurfaceView(@Nullable SurfaceView surfaceView)
Sets theSurfaceView
onto which video will be rendered. The player will track the lifecycle of the surface automatically.- Parameters:
surfaceView
- The surface view.
-
clearVideoSurfaceView
void clearVideoSurfaceView(@Nullable SurfaceView surfaceView)
Clears theSurfaceView
onto which video is being rendered if it matches the one passed. Else does nothing.- Parameters:
surfaceView
- The texture view to clear.
-
setVideoTextureView
void setVideoTextureView(@Nullable TextureView textureView)
Sets theTextureView
onto which video will be rendered. The player will track the lifecycle of the surface automatically.- Parameters:
textureView
- The texture view.
-
clearVideoTextureView
void clearVideoTextureView(@Nullable TextureView textureView)
Clears theTextureView
onto which video is being rendered if it matches the one passed. Else does nothing.- Parameters:
textureView
- The texture view to clear.
-
getVideoSize
VideoSize getVideoSize()
Gets the size of the video.The width and height of size could be 0 if there is no video or the size has not been determined yet.
-
-