KitePlayer

fun KitePlayer(config: PlayerConfig = PlayerConfig()): KitePlayer

Builds a player on this platform's default stack: FFmpeg for the media, and the platform's own audio output and clock.

val player = KitePlayer()
player.open(MediaItem("https://example.com/movie.mkv"))
player.play()

A backend that PlayerConfig.backends names is used as given, and only a missing one comes from the defaults. KitePlayer.create is the door that uses only what the config names, for a stack of your own.

With the default media backend, this also gives the platform's player views their default renderer, so view.player = player is all a KitePlayerView needs.

Android, iOS, macOS and the desktop JVM always have the default stack in a correctly packaged app. The web has it once its codec module is loaded. Where that can be false, check KitePlayer.isAvailable first, for example to fall back to another engine.

Throws

with PlaybackError.ConfigurationInvalid when a backend is missing and this platform has no default for it. The detail says why.


KitePlayer with its config built in a block, so a nested setting does not need its type named:

val player = KitePlayer { subtitles { preferredLanguages = listOf("ja") } }

Throws

as KitePlayer(config) does.