FileGrowth
How a MediaItem whose file is still being written is played (#430).
The item plays to the file's current end and on as it grows. At what looks like the end, the player waits for more and reads again, and the item ends once the file has not grown for endsAfter. Its length follows the file: PlayerSnapshot.duration is an estimate that grows with it, as PlayerSnapshot.durationIsEstimate says, and a seek reaches any part already written, not only the part that existed at the open. While playback waits at the end it buffers, as it does for a slow network.
The file is read through Kotlin rather than by FFmpeg's own file reader, which reports the end at the first read that finds no more bytes. The item's MediaItem.io does that reading when it has one. A local path with none needs a provider that serves local files, which kiteplayer-io installs on the JVM, Android, Apple and Linux; without one, the item plays as a complete file and the player says so with PlaybackWarning.GrowthUnavailable.
mpv's appending:// protocol plays such files the same way, and waits about two seconds, the default here, before it calls the end.
Throws
when endsAfter is not positive and finite.