VideoFrameExtractor.kt
composeApp/src/commonMain/kotlin/eu/friedcutlet/yokan/services/media/VideoFrameExtractor.kt
1package eu.friedcutlet.yokan.services.media23/** Decodes one representative frame (about 10% into the video) of a local file into a JPEG. */4fun interface VideoFrameExtractor {5 /**6 * [url] is the address the player opens ([eu.friedcutlet.yokan.services.files.LocalFileService.readableUrl]).7 * The image fits within [maxDimension] pixels on both axes. Null (or a failure) means no frame on this platform.8 */9 suspend fun extractJpeg(url: String, maxDimension: Int): ByteArray?10}1112expect fun createPlatformVideoFrameExtractor(): VideoFrameExtractor13