Package com.google.android.exoplayer2
Interface ExoPlayer.VideoComponent
-
- All Known Implementing Classes:
SimpleExoPlayer
- Enclosing interface:
- ExoPlayer
public static interface ExoPlayer.VideoComponentThe video component of anExoPlayer.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidaddVideoListener(VideoListener listener)Deprecated.voidclearCameraMotionListener(CameraMotionListener listener)Clears the listener which receives camera motion events if it matches the one passed.voidclearVideoFrameMetadataListener(VideoFrameMetadataListener listener)Clears the listener which receives video frame metadata events if it matches the one passed.voidclearVideoSurface()voidclearVideoSurface(Surface surface)Clears theSurfaceonto which video is being rendered if it matches the one passed.voidclearVideoSurfaceHolder(SurfaceHolder surfaceHolder)Clears theSurfaceHolderthat holds theSurfaceonto which video is being rendered if it matches the one passed.voidclearVideoSurfaceView(SurfaceView surfaceView)Clears theSurfaceViewonto which video is being rendered if it matches the one passed.voidclearVideoTextureView(TextureView textureView)Clears theTextureViewonto which video is being rendered if it matches the one passed.intgetVideoScalingMode()Returns theC.VideoScalingMode.VideoSizegetVideoSize()Gets the size of the video.voidremoveVideoListener(VideoListener listener)Deprecated.voidsetCameraMotionListener(CameraMotionListener listener)Sets a listener of camera motion events.voidsetVideoFrameMetadataListener(VideoFrameMetadataListener listener)Sets a listener to receive video frame metadata events.voidsetVideoScalingMode(int videoScalingMode)Sets theC.VideoScalingMode.voidsetVideoSurface(Surface surface)Sets theSurfaceonto which video will be rendered.voidsetVideoSurfaceHolder(SurfaceHolder surfaceHolder)Sets theSurfaceHolderthat holds theSurfaceonto which video will be rendered.voidsetVideoSurfaceView(SurfaceView surfaceView)Sets theSurfaceViewonto which video will be rendered.voidsetVideoTextureView(TextureView textureView)Sets theTextureViewonto 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
Surfaceonto 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 theSurfaceonto 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 theSurfaceonto 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,TextureVieworSurfaceHolderthen 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 theSurfaceHolderthat holds theSurfaceonto 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 theSurfaceHolderthat holds theSurfaceonto 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 theSurfaceViewonto 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 theSurfaceViewonto 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 theTextureViewonto 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 theTextureViewonto 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.
-
-