Skip to content

kohii-exoplayer / kohii.v1.exoplayer / createKohii

createKohii

fun createKohii(context:Context, config:ExoPlayerConfig):Kohii

Creates a new Kohii instance using an ExoPlayerConfig. Note that an application should not hold many instance of Kohii.

Parameters

context - the Context.

config - the ExoPlayerConfig.@JvmOverloads fun createKohii(context:Context, playerCreator: ((Context) ->Player)? = null, mediaSourceFactoryCreator: ((Media) ->MediaSourceFactory)? = null, rendererProviderFactory:RendererProviderFactory= { PlayerViewProvider() }):Kohii

Creates a new Kohii instance using a custom playerCreator, mediaSourceFactoryCreator and rendererProviderFactory. Note that an application should not hold many instance of Kohii.

Parameters

context - the Context.

playerCreator - the custom creator for the Player. If null, it will use the default one.

mediaSourceFactoryCreator - the custom creator for the MediaSourceFactory. If null, it will use the default one.

rendererProviderFactory - the custom RendererProviderFactory.