Package kohii.v1.core

Types

Link copied to clipboard
abstract class AbstractBridge<RENDERER : Any> : Bridge<RENDERER>
Link copied to clipboard
abstract class AbstractPlayable<RENDERER : Any>(    master: Master,     val media: Media,     config: Playable.Config,     bridge: Bridge<RENDERER>) : Playable, Playback.Callback, PlayerParametersChangeListener
Link copied to clipboard
class Binder(engine: Engine<*>, media: Media)
Link copied to clipboard
interface Bridge<RENDERER : Any>
Link copied to clipboard
interface BridgeCreator<RENDERER : Any>
Link copied to clipboard
abstract class Bucket(    val manager: Manager,     val root: View,     strategy: Strategy,     selector: Selector) : View.OnLayoutChangeListener
Link copied to clipboard
object Common
Link copied to clipboard
interface DefaultTrackSelectorHolder
Link copied to clipboard
abstract class Engine<RENDERER : Any>(val master: Master, val playableCreator: PlayableCreator<RENDERER>)
Link copied to clipboard
interface ErrorListener
Link copied to clipboard
class ErrorListeners : CopyOnWriteArraySet<ErrorListener> , ErrorListener
Link copied to clipboard
class Group(master: Master, activity: FragmentActivity) : DefaultLifecycleObserver, LifecycleEventObserver, Handler.Callback
Link copied to clipboard

Manager is a component designed to manage a Fragment or an Activity which contains big Views like RecyclerView or ViewPager. Manager creates and manages Buckets for Views on demand. You only need to create Bucket for the View whose manages Videos. For example, your app has 2 RecyclerViews A and B, but only B contains Videos. You can ask the Manager to create and manage a Bucket for the RecyclerView B only. That way, the library doesn't need to observe and handle the changes of the RecyclerView A.

Link copied to clipboard
class Master : PlayableManager
Link copied to clipboard
enum MemoryMode : Enum<MemoryMode>
Link copied to clipboard
typealias NetworkType = Int

Refer to values of com.google.android.exoplayer2.C.NetworkType

Link copied to clipboard
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.

Link copied to clipboard
interface PlayableContainer
Link copied to clipboard
abstract class PlayableCreator<RENDERER : Any>(val rendererType: Class<RENDERER>)
Link copied to clipboard
interface PlayableManager
Link copied to clipboard
typealias PlayableObserver = (Any, Playback?, Playback?) -> Unit

An observer to allow client to know when the Playable (defined by its tag)'s Playback is changed. Client can use the Manager.observe method to register an observer.

Link copied to clipboard
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.

Link copied to clipboard
class PlayerEventListeners : CopyOnWriteArraySet<Player.Listener> , Player.Listener
Link copied to clipboard
data class PlayerParameters(    val maxVideoWidth: Int = Int.MAX_VALUE,     val maxVideoHeight: Int = Int.MAX_VALUE,     val maxVideoBitrate: Int = Int.MAX_VALUE,     val maxAudioBitrate: Int = Int.MAX_VALUE)
Link copied to clipboard
abstract class PlayerPool<PLAYER : Any> @JvmOverloads constructor(@IntRange(from = 1) poolSize: Int = DEFAULT_POOL_SIZE)

Definition of a pool to provide PLAYER instance for the consumer.

Link copied to clipboard
interface Prioritized : Comparable<Prioritized>
Link copied to clipboard
data class Rebinder(val tag: Any) : Parcelable
Link copied to clipboard
abstract class RecycledRendererProvider @JvmOverloads constructor(poolSize: Int = 2) : RendererProvider
Link copied to clipboard
interface RendererProvider : DefaultLifecycleObserver

A pool to cache the renderer for the Playback.

Link copied to clipboard
typealias RendererProviderFactory = () -> RendererProvider
Link copied to clipboard
enum Scope : Enum<Scope>
Link copied to clipboard
typealias Selector = (Collection<Playback>) -> Collection<Playback>
Link copied to clipboard
sealed class Strategy : Function1<Collection<Playback>, Collection<Playback>>
Link copied to clipboard
abstract class ViewRendererProvider @JvmOverloads constructor(poolSize: Int = 2) : RecycledRendererProvider
Link copied to clipboard
interface VolumeChangedListener
Link copied to clipboard
interface VolumeInfoController

Functions

Link copied to clipboard
inline fun controller(    kohiiCanStart: Boolean = true,     kohiiCanPause: Boolean = true,     crossinline setupRenderer: (playback: Playback, renderer: Any?) -> Unit): Playback.Controller

Quickly setup the Controller that only needs to setup the renderer.