lib / tv.smartclip.smartclientandroid.lib.dto.sequencer / InstreamState

InstreamState

sealed class InstreamState

These states are used to manage the playback in the SxSequencer class. They can be changed by using the InstreamEvent classes/objects.

Types

AdLoadingFailed

Is used to indicate a failed advertisement loading.

object AdLoadingFailed : InstreamState

ClickThroughDialogIsActive

Is used when event InstreamEvent.ClickThroughDialogOpened was fired. With an active dialog all playback related events should be ignored to avoid playing the AD video in background. After the ClickThrough dialog gets closed the state that was active before should be restored.

data class ClickThroughDialogIsActive : InstreamState

Finished

Is used when the whole sequence, including ads and content, has finished playback.

object Finished : InstreamState

Inactive

Defines the state of a sequencer which is not active. This is the case directly after the initialization of SxSequencer or when the content video and all defined ad tags finished their playback.

object Inactive : InstreamState

Initializing

Is used when SxSequencer.playWhenReady changes to true after the SxSequencer was inactive. After the loading of an advertisement or the content was initiated this state will change to LoadingAd respectively LoadingContent.

object Initializing : InstreamState

LoadingAd

Is used after the core called SxAdSlotDelegate.load until the playback state changes to SxSequencerPlaybackState.PLAY.

object LoadingAd : InstreamState

LoadingContent

Is used when RequestContentLoading is fired to initiate the loading of the content.

object LoadingContent : InstreamState

PlayWhenReadyTogglingDetected

The PlayWhenReadyTogglingDetected state will be set active when PlayWhenReady(false) is received directly after PlyWhenReady(true), but the state is still at ShowingAdPaused. This is the case, when playWhenReady is toggled very fast (below 100ms). Unfortunately this short toggle initiates an endless toggling of the current playWhenReady state. Such short playWhenReady toggles occur on the FireTV4k Stick for example, when the stick is put into standby mode while the app has some ad playback active. In this case onPause() is called within 100ms after onResume(). Because we set our playWhenReady property in these callbacks, the standby mode of the FireTV4k will initiate endless toggling of the playback state. When the PlayWhenReadyTogglingDetected state is active, all incoming events will be ignored, After approx 500ms the state is set to the previous state of PlayWhenReadyTogglingDetected to ensure, playback state toggling does not start and the video can be resumed without any problems.

object PlayWhenReadyTogglingDetected : InstreamState

ProcessAdTag

Is used when an ad tag load request was dispatched to the core. Will be changed when the core calls SxAdSlotDelegate.load or throws ON_AD_ERROR event.

object ProcessAdTag : InstreamState

ShowingAd

Is used to indicate active playback of the advertisement.

object ShowingAd : InstreamState

ShowingAdPaused

Is used to indicate paused playback of the advertisement.

object ShowingAdPaused : InstreamState

ShowingContent

Is used to indicate active playback of the content.

object ShowingContent : InstreamState

ShowingContentPaused

Is used to indicate paused playback of the content.

object ShowingContentPaused : InstreamState

Functions

toString

open fun toString(): String