Package com.castlabs.android.player

# Class VideoTrackListener

java.lang.Object
com.castlabs.android.player.VideoTrackListener

All Implemented Interfaces:
  `MediaTrackEventListener`, `com.google.android.exoplayer2.video.VideoRendererEventListener`

public class VideoTrackListener extends Object implements com.google.android.exoplayer2.video.VideoRendererEventListener, MediaTrackEventListener
This is an implementation of the `VideoRendererEventListener` that is used to delegate events from the track renderer to the `PlayerListener` instances that are registered with the current `PlayerController`.

Since:
  3.0.0

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from interface com.google.android.exoplayer2.video.VideoRendererEventListener

  `com.google.android.exoplayer2.video.VideoRendererEventListener.EventDispatcher`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `VideoTrackListener(PlayerListeners playerListeners)`
  Creates a new instance of `VideoTrackListener`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `onCryptoError(MediaCodec.CryptoException e)`
  Invoked when a decoder operation raises a `MediaCodec.CryptoException`.
  `void`
  `onDecoderInitializationError(com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.DecoderInitializationException e)`
  Invoked when a decoder fails to initialize.
  `void`
  `onDroppedFrames(int count, long elapsed)`
  `void`
  `onRenderedFirstFrame(Object output, long renderTimeMs)`
  `void`
  `onVideoDecoderInitialized(String decoderName, long initializedTimestampMs, long initializationDurationMs)`
  `void`
  `onVideoDecoderReleased(String decoderName, long releasedTimestampMs, long releaseDurationMs)`
  `void`
  `onVideoDisabled(com.google.android.exoplayer2.decoder.DecoderCounters counters)`
  `void`
  `onVideoEnabled(com.google.android.exoplayer2.decoder.DecoderCounters counters)`
  `void`
  `onVideoInputFormatChanged(com.google.android.exoplayer2.Format format)`
  `void`
  `onVideoSizeChanged(com.google.android.exoplayer2.video.VideoSize videoSize)`

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface com.google.android.exoplayer2.video.VideoRendererEventListener

  `onVideoCodecError, onVideoDecoderReleased, onVideoFrameProcessingOffset, onVideoInputFormatChanged`

- ## Constructor Details

  - ### VideoTrackListener

    public VideoTrackListener(@NonNull PlayerListeners playerListeners)
    Creates a new instance of `VideoTrackListener`.
    Parameters:
      `playerListeners` - The `PlayerListeners` instance to use.

- ## Method Details

  - ### onVideoEnabled

    public void onVideoEnabled(com.google.android.exoplayer2.decoder.DecoderCounters counters)
    Specified by:
      `onVideoEnabled` in interface `com.google.android.exoplayer2.video.VideoRendererEventListener`

  - ### onVideoDecoderInitialized

    public void onVideoDecoderInitialized(String decoderName, long initializedTimestampMs, long initializationDurationMs)
    Specified by:
      `onVideoDecoderInitialized` in interface `com.google.android.exoplayer2.video.VideoRendererEventListener`

  - ### onVideoDecoderReleased

    public void onVideoDecoderReleased(@NonNull String decoderName, long releasedTimestampMs, long releaseDurationMs)
    Specified by:
      `onVideoDecoderReleased` in interface `com.google.android.exoplayer2.video.VideoRendererEventListener`

  - ### onDroppedFrames

    public void onDroppedFrames(int count, long elapsed)
    Specified by:
      `onDroppedFrames` in interface `com.google.android.exoplayer2.video.VideoRendererEventListener`

  - ### onVideoSizeChanged

    public void onVideoSizeChanged(@NonNull com.google.android.exoplayer2.video.VideoSize videoSize)
    Specified by:
      `onVideoSizeChanged` in interface `com.google.android.exoplayer2.video.VideoRendererEventListener`

  - ### onRenderedFirstFrame

    public void onRenderedFirstFrame(@NonNull Object output, long renderTimeMs)
    Specified by:
      `onRenderedFirstFrame` in interface `com.google.android.exoplayer2.video.VideoRendererEventListener`

  - ### onVideoInputFormatChanged

    public void onVideoInputFormatChanged(com.google.android.exoplayer2.Format format)
    Specified by:
      `onVideoInputFormatChanged` in interface `com.google.android.exoplayer2.video.VideoRendererEventListener`

  - ### onVideoDisabled

    public void onVideoDisabled(com.google.android.exoplayer2.decoder.DecoderCounters counters)
    Specified by:
      `onVideoDisabled` in interface `com.google.android.exoplayer2.video.VideoRendererEventListener`

  - ### onDecoderInitializationError

    public void onDecoderInitializationError(@NonNull com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.DecoderInitializationException e)
    Description copied from interface: `MediaTrackEventListener`
    Invoked when a decoder fails to initialize.
    Specified by:
      `onDecoderInitializationError` in interface `MediaTrackEventListener`
    Parameters:
      `e` - The corresponding exception.

  - ### onCryptoError

    public void onCryptoError(@NonNull MediaCodec.CryptoException e)
    Description copied from interface: `MediaTrackEventListener`
    Invoked when a decoder operation raises a `MediaCodec.CryptoException`.
    Specified by:
      `onCryptoError` in interface `MediaTrackEventListener`
    Parameters:
      `e` - The corresponding exception.