Playback

abstract class Playback(    val manager: Manager,     val bucket: Bucket,     val container: ViewGroup,     val config: Playback.Config = Config()) : PlayableContainer, Player.Listener, ErrorListener

Common interface of an object that defines the connection between a Playable and a ViewGroup as an container. When the Master receive a request to bind a Video to a ViewGroup, it first produce a Playable (either by acquiring from cache, or creating a new one) for the Video, and then creating a new instance of this object if needed.

A Playback does not only store the information about the ViewGroup as container, and the Playable, but also help the Master to know if the Playable should be played or paused, by telling it to how much the container is visible and other conditions.

See also

kohii.v1.internal.StaticViewRendererPlayback
kohii.v1.internal.DynamicViewRendererPlayback
kohii.v1.internal.DynamicFragmentRendererPlayback

Constructors

Link copied to clipboard
fun Playback(    manager: Manager,     bucket: Bucket,     container: ViewGroup,     config: Playback.Config = Config())

Types

Link copied to clipboard
interface ArtworkHintListener
Link copied to clipboard
interface Callback

Callbacks for lifecycle events of a Playback.

Link copied to clipboard
object Companion
Link copied to clipboard
data class Config(    val tag: Any = Master.NO_TAG,     val delay: Int = 0,     val threshold: Float = 0.65f,     val preload: Boolean = false,     val releaseOnInActive: Boolean = false,     val repeatMode: Int = Player.REPEAT_MODE_OFF,     val callbacks: Set<Playback.Callback> = emptySet(),     val controller: Playback.Controller? = null,     val initialPlaybackInfo: PlaybackInfo? = null,     val artworkHintListener: Playback.ArtworkHintListener? = null,     val tokenUpdateListener: Playback.TokenUpdateListener? = null,     val networkTypeChangeListener: Playback.NetworkTypeChangeListener? = null)
Link copied to clipboard
interface Controller

Provides necessary information and callbacks to setup a manual controller for a Playback.

Link copied to clipboard
interface NetworkTypeChangeListener
Link copied to clipboard
interface StateListener

Callbacks for events triggered by the underlying Playable.

Link copied to clipboard
class Token(    threshold: Float = 0.65f,     @FloatRange(from = -1.0, to = 1.0) val areaOffset: Float,     val containerRect: Rect,     val containerWidth: Int,     val containerHeight: Int)
Link copied to clipboard
interface TokenUpdateListener

Functions

Link copied to clipboard
fun addStateListener(listener: Playback.StateListener)
Link copied to clipboard
open fun onAudioAttributesChanged(p0: AudioAttributes)
Link copied to clipboard
open fun onAudioSessionIdChanged(p0: Int)
Link copied to clipboard
open fun onAvailableCommandsChanged(p0: Player.Commands)
Link copied to clipboard
open fun onCues(p0: MutableList<Cue>)
Link copied to clipboard
open fun onDeviceInfoChanged(p0: DeviceInfo)
Link copied to clipboard
open fun onDeviceVolumeChanged(p0: Int, p1: Boolean)
Link copied to clipboard
open override fun onError(error: Exception)
Link copied to clipboard
open fun onEvents(p0: Player, p1: Player.Events)
Link copied to clipboard
open fun onIsLoadingChanged(p0: Boolean)
Link copied to clipboard
open fun onIsPlayingChanged(p0: Boolean)
Link copied to clipboard
open fun onMaxSeekToPreviousPositionChanged(p0: Long)
Link copied to clipboard
open fun onMediaItemTransition(@Nullable p0: MediaItem?, p1: Int)
Link copied to clipboard
open fun onMediaMetadataChanged(p0: MediaMetadata)
Link copied to clipboard
open fun onMetadata(p0: Metadata)
Link copied to clipboard
open fun onPlaybackParametersChanged(p0: PlaybackParameters)
Link copied to clipboard
open fun onPlaybackStateChanged(p0: Int)
Link copied to clipboard
open fun onPlaybackSuppressionReasonChanged(p0: Int)
Link copied to clipboard
open fun onPlayerError(p0: PlaybackException)
Link copied to clipboard
open fun onPlayerErrorChanged(@Nullable p0: PlaybackException?)
Link copied to clipboard
open fun onPlaylistMetadataChanged(p0: MediaMetadata)
Link copied to clipboard
open fun onPlayWhenReadyChanged(p0: Boolean, p1: Int)
Link copied to clipboard
open fun onPositionDiscontinuity(    p0: Player.PositionInfo,     p1: Player.PositionInfo,     p2: Int)
Link copied to clipboard
open override fun onRenderedFirstFrame()
Link copied to clipboard
open fun onRepeatModeChanged(p0: Int)
Link copied to clipboard
open fun onSeekBackIncrementChanged(p0: Long)
Link copied to clipboard
open fun onSeekForwardIncrementChanged(p0: Long)
Link copied to clipboard
open fun onShuffleModeEnabledChanged(p0: Boolean)
Link copied to clipboard
open fun onSkipSilenceEnabledChanged(p0: Boolean)
Link copied to clipboard
open fun onSurfaceSizeChanged(p0: Int, p1: Int)
Link copied to clipboard
open fun onTimelineChanged(p0: Timeline, p1: Int)
Link copied to clipboard
open fun onTrackSelectionParametersChanged(p0: TrackSelectionParameters)
Link copied to clipboard
open fun onTracksInfoChanged(p0: TracksInfo)
Link copied to clipboard
open override fun onVideoSizeChanged(videoSize: VideoSize)
Link copied to clipboard
open fun onVolumeChanged(p0: Float)
Link copied to clipboard
fun removeStateListener(listener: Playback.StateListener?)
Link copied to clipboard
fun rewind(refresh: Boolean = true)

Resets the playable to its original state.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun unbind()

Properties

Link copied to clipboard
val bucket: Bucket
Link copied to clipboard
val config: Playback.Config
Link copied to clipboard
val container: ViewGroup
Link copied to clipboard
val containerRect: Rect
Link copied to clipboard
val lock: Boolean

Return true if this Playback is locked, false otherwise.

Link copied to clipboard
val manager: Manager
Link copied to clipboard
val playable: Playable? = null
Link copied to clipboard
var playerParameters: PlayerParameters
Link copied to clipboard
val tag: Any
Link copied to clipboard
val volumeInfo: VolumeInfo