Yokan / rebuild
Course 1 8624561

Main.kt

vendor/kmp-mpv/samples/desktop/Main.kt

implementation21 lines
1import io.github.kmpmpv.MpvConfiguration2import io.github.kmpmpv.MpvPlayer3import kotlinx.coroutines.runBlocking45fun main(args: Array<String>) = runBlocking {6    require(args.isNotEmpty()) { "Pass a media path or URL" }7    val player = MpvPlayer.create(8        MpvConfiguration(9            options = MpvConfiguration.DefaultOptions + mapOf(10                "force-window" to "yes",11                "keep-open" to "yes",12            ),13        ),14    )15    try {16        player.load(args.first())17        player.events.collect(::println)18    } finally {19        player.release()20    }21}22

Search chapters, reference and source filenames.