Skip to main content

General states

You can get various player states from the app by setting the PlayerStateDelegate.

videoPlayer?.setPlayerStateDelegate(object : PlayerStateDelegate {
override fun onPlayerStateChanged(playerEvent: PlayerEvent<Any>) {
if (playerEvent.type == PlayerState.RELATED_PLAYED) {
videoPlayer?.changeVideo(playerEvent.value.toString())
}
}
})

PlayerState Types and Return Value

Player State: VIDEO_PAUSED

DescriptionVideo is paused.
Value Return TypeBoolean

Player State: VIDEO_RESUMED

DescriptionVideo is resumed.
Value Return TypeBoolean

Player State: VIDEO_TIME_UPDATE

DescriptionNotifies each second of the current video that is playing.
Value Return TypePair - seconds[Float], totalSeconds[Float]

Player State: VIDEO_ENDED

DescriptionVideo has ended.
Value Return TypeBoolean

Player State: AUTO_PLAY

DescriptionAutoplay is enabled.
Value Return TypeBoolean

Player State: REPLAY

DescriptionVideo is replayed.
Value Return TypeBoolean

Player State: REWIND

DescriptionUser clicked the rewind button.
Value Return TypeInt

Player State: FORWARD

DescriptionUser Clicked the forward button.
Value Return TypeInt

Player State: SEEKING

DescriptionThe user is seeking with a slider.
Value Return TypeFloat

Player State: MUTE

DescriptionVideo is muted.
Value Return TypeBoolean

Player State: CHANGE_QUALITY

DescriptionUser changed the quality of the video.
Value Return TypeInt

Player State: CHANGE_CAPTIONS

DescriptionUser changed the captions.
Value Return TypeTrackModel

Player State: ORIENTATION_CHANGE

DescriptionThe orientation of the screen changed.
Value Return TypeInt

Player State: VOLUME_CHANGE

DescriptionUser changed the volume.
Value Return TypeFloat

Player State: SHARE_CLICKED

DescriptionUser clicked the share button.
Value Return TypeBoolean

Player State: VIDEO_BUFFERING

DescriptionVideo is buffering.
Value Return TypeBoolean

Player State: VIDEO_BUFFERED

DescriptionVideo buffered.
Value Return TypeBoolean

Player State: FULL_SCREEN_OPENED

DescriptionThe video was set to full screen.
Value Return TypeBoolean

Player State: FULL_SCREEN_OPEN_INITIALIZATION

DescriptionFull screen initialization started.
Value Return TypeBoolean

Player State: FULL_SCREEN_CLOSE_INITIALIZATION

DescriptionClose full screen initialization started.
Value Return TypeBoolean

Player State: FULL_SCREEN_CLOSED

DescriptionThe user exited out of full screen mode.
Value Return TypeInt

Player State: SETTINGS_OPENED

DescriptionSettings opened.
Value Return TypeBoolean

Player State: SETTINGS_CLOSED

DescriptionSettings tab was closed.
Value Return TypeBoolean

Player State: HELPER_BUTTON_CLICKED

DescriptionThe user clicked the help button.
Value Return TypeBoolean

Player State: NEXT_VIDEO_CLICKED

DescriptionThe user clicked the next video.
Value Return TypeBoolean

Player State: PREVIOUS_VIDEO_CLICKED

DescriptionThe user clicked the previous video.
Value Return TypeBoolean

Player State: CHROME_CAST_CONNECTED

DescriptionChromecast is connected.
Value Return TypeLong (The current playback position)

Player State: CHROME_CAST_DISCONNECTED

DescriptionChromecast is disconnected.
Value Return TypeLong (The current playback position)

Player State: CAST_STATE_READY

DescriptionCast state is ready.
Value Return TypeBoolean

Player State: CAST_STATE_BUFFERING

DescriptionCast is buffering.
Value Return TypeBoolean

Player State: CAST_STATE_ENDED

DescriptionCast ended.
Value Return TypeBoolean

Player State: CAST_QUEUE_MOVED_ITEM

DescriptionCast moved in queue.
Value Return TypeBoolean

Player State: CAST_VIDEO_PLAYED_DIRECTLY

DescriptionVideo played directly in cast.
Value Return TypeVPVideoModel

Player State: CAST_VIDEO_ADDED_TO_QUEUE

DescriptionVideo added to queue in cast.
Value Return TypeVPVideoModel

Player State: CAST_VIDEO_QUEUE_CLEARED

DescriptionQueue has been cleared.
Value Return TypeBoolean

Player State: CAST_QUEUE_REMOVED_ITEM

DescriptionCast item removed.
Value Return TypeInt

Player State: PLAYER_ERROR

DescriptionPlayer has an error
Value Return TypeBoolean

Player State: PLAYER_DRM_ERROR

DescriptionPlayer has DRM error.
Value Return TypeBoolean

Player State: VIDEO_AD_PLAYED

DescriptionPlay video ad is requested.
Value Return TypeBoolean

Player State: PLAYER_RELEASED

DescriptionPlayer is released (ChromeCast or Player).
Value Return TypeLong (Current playback position)

Player State: PLAYER_INITIALIZED

DescriptionPlayer is initialized (ChromeCast or Player).
Value Return TypeLong (Current playback position)
DescriptionRelated slding panel is expanded.
Value Return TypeBoolean
DescriptionRelated slding panel is collapsed.
Value Return TypeBoolean
DescriptionRelated item is clicked to play.
Value Return TypevideoId

Player State: CHANGED_VIDEO

DescriptionUser changed the video.
Value Return TypeLong (Current playback position)