Package com.castlabs.android.player

## Interface FormatChangeListener

-     public interface FormatChangeListener

  This interface will receive events whenever the downstream `Format`s change.

  Note that all callbacks will be triggered on the UI thread.

  Since:
    4.2.0

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `onAudioFormatChange​(com.google.android.exoplayer2.Format format, int trigger, long mediaTimeMs)` | Invoked when the downstream audio format changed.
    `void` | `onSubtitleFormatChange​(com.google.android.exoplayer2.Format format, int trigger, long mediaTimeMs)` | Invoked when the downstream subtitle format changed.
    `void` | `onVideoFormatChange​(com.google.android.exoplayer2.Format format, int trigger, long mediaTimeMs, VideoTrackQuality videoTrackQuality)` | Invoked when the downstream video format changed.

- - ### Method Detail

    - #### onVideoFormatChange

          void onVideoFormatChange​(@NonNull
                                   com.google.android.exoplayer2.Format format,
                                   int trigger,
                                   long mediaTimeMs,
                                   @Nullable
                                   VideoTrackQuality videoTrackQuality)

      Invoked when the downstream video format changed. Please note that the videoTrackQuality might be null if no registered quality could be found that matched the given format.
      Parameters:
        `format` - The format.
        `trigger` - The trigger specified in the corresponding upstream load. This is one of `C.SELECTION_REASON_UNKNOWN`, `C.SELECTION_REASON_INITIAL`, `C.SELECTION_REASON_MANUAL`, `C.SELECTION_REASON_ADAPTIVE`, or `C.SELECTION_REASON_TRICK_PLAY`.
        `mediaTimeMs` - The media time at which the change occurred.
        `videoTrackQuality` - the new quality if it was found in the set of registered qualities, null otherwise.

    - #### onAudioFormatChange

          void onAudioFormatChange​(@NonNull
                                   com.google.android.exoplayer2.Format format,
                                   int trigger,
                                   long mediaTimeMs)

      Invoked when the downstream audio format changed. Please note that the videoTrackQuality might be null if no registered quality could be found that matched the given format.
      Parameters:
        `format` - The format.
        `trigger` - The trigger specified in the corresponding upstream load. This is one of `C.SELECTION_REASON_UNKNOWN`, `C.SELECTION_REASON_INITIAL`, `C.SELECTION_REASON_MANUAL`, `C.SELECTION_REASON_ADAPTIVE`, or `C.SELECTION_REASON_TRICK_PLAY`.
        `mediaTimeMs` - The media time at which the change occurred.

    - #### onSubtitleFormatChange

          void onSubtitleFormatChange​(@NonNull
                                      com.google.android.exoplayer2.Format format,
                                      int trigger,
                                      long mediaTimeMs)

      Invoked when the downstream subtitle format changed.
      Parameters:
        `format` - The format.
        `trigger` - The trigger specified in the corresponding upstream load. This is one of `C.SELECTION_REASON_UNKNOWN`, `C.SELECTION_REASON_INITIAL`, `C.SELECTION_REASON_MANUAL`, `C.SELECTION_REASON_ADAPTIVE`, or `C.SELECTION_REASON_TRICK_PLAY`.
        `mediaTimeMs` - The media time at which the change occurred.