Playable

abstract class Playable(val media: Media, config: Playable.Config)

A Playable contains necessary information about a Media item, and the config provided by client for it to start the media with expected result. Instance of Playable is provided by PlayableCreator.

An implementation of Playable must take into account about the following points:

AbstractPlayable is a base implementation that leverage actual playback logic to a Bridge.

See also

Constructors

Link copied to clipboard
fun Playable(media: Media, config: Playable.Config)

Types

Link copied to clipboard
data class Config(tag: Any = Master.NO_TAG, rendererType: Class<*>)

Functions

Link copied to clipboard
abstract fun isPlaying(): Boolean
Link copied to clipboard
abstract fun onConfigChange(): Boolean

Return true to indicate that this Playable would survive configuration changes and no playback reloading would be required. In special cases like YouTube playback, it is recommended to return false so Kohii will handle the resource recycling correctly.

Link copied to clipboard
abstract fun onPause()
Link copied to clipboard
abstract fun onPlay()
Link copied to clipboard
abstract fun onPrepare(loadSource: Boolean)
Link copied to clipboard
abstract fun onReady()
Link copied to clipboard
abstract fun onRelease()
Link copied to clipboard
abstract fun onReset()
Link copied to clipboard
abstract fun onUnbind(playback: Playback)
Link copied to clipboard
abstract fun setupRenderer(playback: Playback)

Once the Playback finds it is good time for the Playable to request/release the Renderer, it will trigger these calls to send that signal. The 'good time' can varies due to the actual use case. In Kohii, there are 2 following cases:

Link copied to clipboard
abstract fun teardownRenderer(playback: Playback)

Once the Playback finds it is good time for the Playable to request/release the Renderer, it will trigger these calls to send that signal. The 'good time' can varies due to the actual use case. In Kohii, there are 2 following cases:

Properties

Link copied to clipboard
val media: Media
Link copied to clipboard
abstract val renderer: Any?
Link copied to clipboard
abstract val tag: Any

Inheritors

Link copied to clipboard