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
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
Indicates that a timed cue event occurred.abstract void
onDurationChanged
(long duration) Indicates that source duration changed.abstract void
onError
(PlayerException exception) Indicates that an error occurred.void
Indicates that the player has lost its network connection.abstract void
onQualityChanged
(Quality quality) Indicates that the playing quality changed either from a user action or from an internal adaptive quality switch.abstract void
Indicates that the player is buffering from a previousPlayer.State.PLAYING
state.abstract void
onSeekCompleted
(long time) Indicates that the player has finished seeking to a given position as requested fromPlayer.seekTo(long)
.void
onSeiMessage
(SeiMessage seiMessage) Indicates that a Supplemental Enhancement Information (SEI) message event occurred.abstract void
onStateChanged
(Player.State state) Indicates that the player state changed.void
onVideoFirstFrame
(long time) Indicates that the first video frame has been displayed after the player started playback.abstract void
onVideoSizeChanged
(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. -
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.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
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.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 previousPlayer.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 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.PLAYING
state and when there is a video track.- Parameters:
time
- the time when the first frame was displayed, in millilseconds
-