Skip to content

VideoNatives

final class VideoNatives
Package: dev.joid.lib.video · Module: core · Source: VideoNatives.java

Installs the FFmpeg natives that videos need, from the classpath or downloaded once into the cache folder.

The first video that decodes installs them by itself; call install() at startup to download them before a video shows. When the FFmpeg natives of the platform are on the classpath, nothing is downloaded. Otherwise the jar of the platform (Windows x64, Linux x64, macOS x64 and arm64) is downloaded from the repository, checked against its SHA-256, and extracted into the ffmpeg area of the cache folder.

ReturnsSignatureSummary
voidrepository(String repository) staticSets the Maven repository the natives are downloaded from, such as a mirror of your own.
CompletableFuture<Void>install() staticReturns a future that completes once the natives are ready, downloading them on a background thread the first time.
StringgetRepository() staticReturns the repository the natives are downloaded from, Maven Central by default.
booleanisInstalled() staticIf true, the natives are ready and videos can decode.

void repository(String repository) static

Sets the Maven repository the natives are downloaded from, such as a mirror of your own.

CompletableFuture<Void> install() static

Returns a future that completes once the natives are ready, downloading them on a background thread the first time. It completes exceptionally with VideoNativesException when the platform has no natives, the download fails or does not match its checksum, or the cache folder cannot be written; the next call tries again.

String getRepository() static

Returns the repository the natives are downloaded from, Maven Central by default.

boolean isInstalled() static

If true, the natives are ready and videos can decode.


fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses

Report a problem with this page