Class Player.Listener

java.lang.Object
com.amazonaws.ivs.player.Player.Listener
Enclosing interface:
Player

public abstract static class Player.Listener extends Object
Player listener interface. Provide an implementation of this interface to Player.addListener(Listener) to receive events from a Player instance.
  • Constructor Details

    • Listener

      public Listener()
  • Method Details

    • onCue

      public abstract void onCue(@NonNull Cue cue)
      Indicates that a timed cue event occurred.
      Parameters:
      cue - timed cue event object Cue
    • onSeiMessage

      public void onSeiMessage(@NonNull SeiMessage seiMessage)
      Indicates that a Supplemental Enhancement Information (SEI) message event occurred.
      Parameters:
      seiMessage - message object, currently always subtype UserDataUnregisteredSeiMessage
    • onDurationChanged

      public abstract void onDurationChanged(long duration)
      Indicates that source duration changed. This can occur after the Player.State.READY state to indicate a change in the duration of the media. This value can be set to -1 for unknown or indefinite length streams.
      Parameters:
      duration - the current duration of the source in milliseconds.
    • onStateChanged

      public abstract void onStateChanged(@NonNull Player.State state)
      Indicates that the player state changed.
      Parameters:
      state - current player state
    • onError

      public abstract void onError(@NonNull PlayerException exception)
      Indicates that an error occurred. Errors are fatal and stop playback of the stream. The player moves into Player.State.IDLE on an error.
      Parameters:
      exception - exception object with information for the error that occurred.
    • onRebuffering

      public abstract void onRebuffering()
      Indicates that the player is buffering from a previous Player.State.PLAYING state. Excludes user actions such as seeking, starting or resuming the stream.
    • onSeekCompleted

      public abstract void onSeekCompleted(long time)
      Indicates that the player has finished seeking to a given position as requested from Player.seekTo(long).
      Parameters:
      time - the seek time in milliseconds.
    • onVideoSizeChanged

      public abstract void onVideoSizeChanged(int width, int height)
      Indicates that the video dimensions changed.
      Parameters:
      width - updated video width in pixels
      height - updated video height in pixels
    • onQualityChanged

      public abstract void onQualityChanged(@NonNull Quality quality)
      Indicates that the playing quality changed either from a user action or from an internal adaptive quality switch.
      Parameters:
      quality - current quality
    • onNetworkUnavailable

      public void onNetworkUnavailable()
      Indicates that the player has lost its network connection. Users can customize network recovery behavior using Player.setNetworkRecoveryMode(com.amazonaws.ivs.player.Player.NetworkRecoveryMode)
      See Also:
    • onVideoFirstFrame

      public void onVideoFirstFrame(long time)
      Indicates that the first video frame has been displayed after the player started playback. Note that this callback only fires when the player is in Player.State.PLAYING state and when there is a video track.
      Parameters:
      time - the time when the first frame was displayed, in millilseconds
    • onSyncTimeChanged

      public void onSyncTimeChanged(long syncTime)
      Indicates that synchronization time has changed. See Player.getSyncTime()
      Parameters:
      syncTime - the current player syncTime, in milliseconds.