lux_video_thumbnail_android 1.0.0 copy "lux_video_thumbnail_android: ^1.0.0" to clipboard
lux_video_thumbnail_android: ^1.0.0 copied to clipboard

PlatformAndroid

Android video thumbnail implementation using reusable MediaMetadataRetriever sessions and a serial worker with bounded resources.

lux_video_thumbnail_android #

Android implementation of lux_video_thumbnail. Applications should depend on the main package; its federated plugin configuration selects this implementation.

Behavior #

Uses MediaMetadataRetriever for local paths, readable content URIs, HTTP(S) sources and byte buffers. Byte inputs become plugin-owned cache files. Borrowed video paths, including legacy vx://bytes/ paths, are never deleted.

Opening, metadata, extraction, compression and file IO run on a serial worker per engine. Replies use the main Handler and complete once. On engine detach, pending and new calls are rejected; an active decoder is allowed to finish before cleanup. This avoids UI waits but cannot force cancellation of a stuck native decoder.

Ordinary seeks request the nearest decoded frame; preferKeyFrame requests a nearby sync frame. Positions use microseconds with a legacy millisecond fallback. actualTimestamp identifies the normalized request, not measured frame PTS. Codec support and precise output depend on Android's media stack.

Limits include four sessions, batches up to 16 thumbnails, dimensions up to 4096 per axis, 64 MiB byte sources, 8 MiB encoded images/chunks and 64 retained thumbnail temporaries. Dispose advanced results and close sessions when finished. The public one-shot API handles their cleanup automatically.

Requirements and permissions #

Android API 24+, Dart 3.10.9+, Flutter 3.38.10+. Build configuration uses compile SDK 36 and Java 17. The plugin declares INTERNET for remote videos and no broad storage permissions. Paths/content URIs must already be readable by the host app.

File reading, size lookup, copying and deletion are restricted to registered thumbnail outputs, with path/link checks. Legacy copy calls reject existing destinations. The advanced Dart saveToFile returns a path string to a new caller-owned copy in a private subdirectory of the chosen/system-temp parent.

Validation #

JVM tests use real files and worker threads but mock Android media/engine APIs. They verify ownership, cleanup, limits, ordering and detach, not physical-device decoder accuracy or performance. An example APK has been compiled. Device tests remain required for codecs, native file selection and memory/latency measurements.

See FILE_OWNERSHIP.md for ownership details. In a full source checkout, use the root local-dependency preparation script; installed packages use hosted dependencies. Native Gradle tests run through the example Android host.

License #

MIT, Copyright (c) 2026 Jônatas Feitosa. See LICENSE.

0
likes
150
points
0
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Android video thumbnail implementation using reusable MediaMetadataRetriever sessions and a serial worker with bounded resources.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, lux_video_thumbnail_platform_interface

More

Packages that depend on lux_video_thumbnail_android

Packages that implement lux_video_thumbnail_android