Package com.amazonaws.ivs.player
Class Player.Listener
java.lang.Object
com.amazonaws.ivs.player.Player.Listener
- Enclosing interface:
Player
Player listener interface. Provide an implementation of this interface to
Player.addListener(Listener) to receive events from a Player instance.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidIndicates that a timed cue event occurred.abstract voidonDurationChanged(long duration) Indicates that source duration changed.abstract voidonError(PlayerException exception) Indicates that an error occurred.voidIndicates that the player has lost its network connection.abstract voidonQualityChanged(Quality quality) Indicates that the playing quality changed either from a user action or from an internal adaptive quality switch.abstract voidIndicates that the player is buffering from a previousPlayer.State.PLAYINGstate.abstract voidonSeekCompleted(long time) Indicates that the player has finished seeking to a given position as requested fromPlayer.seekTo(long).voidonSeiMessage(SeiMessage seiMessage) Indicates that a Supplemental Enhancement Information (SEI) message event occurred.abstract voidonStateChanged(Player.State state) Indicates that the player state changed.voidonSyncTimeChanged(long syncTime) Indicates that synchronization time has changed.voidonVideoFirstFrame(long time) Indicates that the first video frame has been displayed after the player started playback.abstract voidonVideoSizeChanged(int width, int height) Indicates that the video dimensions changed.
-
Constructor Details
-
Listener
public Listener()
-
-
Method Details
-
onCue
Indicates that a timed cue event occurred.- Parameters:
cue- timed cue event objectCue
-
onSeiMessage
Indicates that a Supplemental Enhancement Information (SEI) message event occurred.- Parameters:
seiMessage- message object, currently always subtypeUserDataUnregisteredSeiMessage
-
onDurationChanged
public abstract void onDurationChanged(long duration) Indicates that source duration changed. This can occur after thePlayer.State.READYstate 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
Indicates that the player state changed.- Parameters:
state- current player state
-
onError
Indicates that an error occurred. Errors are fatal and stop playback of the stream. The player moves intoPlayer.State.IDLEon 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 previousPlayer.State.PLAYINGstate. 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 fromPlayer.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 pixelsheight- updated video height in pixels
-
onQualityChanged
Indicates that the playing quality changed either from a user action or from an internal adaptive quality switch.- Parameters:
quality- current quality
-
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 inPlayer.State.PLAYINGstate 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. SeePlayer.getSyncTime()- Parameters:
syncTime- the current player syncTime, in milliseconds.
-