Package com.google.android.exoplayer2

## Interface Player.VideoComponent

- All Known Implementing Classes:
    `SimpleExoPlayer`
  Enclosing interface:
    Player

      public static interface Player.VideoComponent

  The video component of a `Player`.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | 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​(Surface surface)` | Clears the `Surface` onto which video is being rendered if it matches the one passed.
    `void` | `clearVideoSurfaceHolder​(SurfaceHolder surfaceHolder)` | Clears the `SurfaceHolder` that holds the `Surface` onto which video is being rendered if it matches the one passed.
    `void` | `clearVideoSurfaceView​(SurfaceView surfaceView)` | Clears the `SurfaceView` onto which video is being rendered if it matches the one passed.
    `void` | `clearVideoTextureView​(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​(Surface surface)` | Sets the `Surface` onto which video will be rendered.
    `void` | `setVideoSurfaceHolder​(SurfaceHolder surfaceHolder)` | Sets the `SurfaceHolder` that holds the `Surface` onto which video will be rendered.
    `void` | `setVideoSurfaceView​(SurfaceView surfaceView)` | Sets the `SurfaceView` onto which video will be rendered.
    `void` | `setVideoTextureView​(TextureView textureView)` | Sets the `TextureView` onto which video will be rendered.

- - ### Method Detail

    - #### setVideoScalingMode

          void setVideoScalingMode​(@VideoScalingMode
                                   int videoScalingMode)

      Sets the `C.VideoScalingMode`.
      Parameters:
        `videoScalingMode` - The `C.VideoScalingMode`.

    - #### getVideoScalingMode

          @VideoScalingMode
          int getVideoScalingMode()

      Returns the `C.VideoScalingMode`.

    - #### addVideoListener

          void addVideoListener​(VideoListener listener)

      Adds a listener to receive video events.
      Parameters:
        `listener` - The listener to register.

    - #### removeVideoListener

          void removeVideoListener​(VideoListener listener)

      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()

      Clears any `Surface`, `SurfaceHolder`, `SurfaceView` or `TextureView` currently set on the player.

    - #### clearVideoSurface

          void clearVideoSurface​(@Nullable
                                 Surface surface)

      Clears the `Surface` 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 the `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.

      Parameters:
        `surface` - The `Surface`.

    - #### setVideoSurfaceHolder

          void setVideoSurfaceHolder​(@Nullable
                                     SurfaceHolder surfaceHolder)

      Sets the `SurfaceHolder` that holds the `Surface` 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 the `SurfaceHolder` that holds the `Surface` 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 the `SurfaceView` 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 the `SurfaceView` 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 the `TextureView` 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 the `TextureView` onto which video is being rendered if it matches the one passed. Else does nothing.
      Parameters:
        `textureView` - The texture view to clear.