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.
Description
Section titled “Description”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.
Learn more
Section titled “Learn more”Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
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. |
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. |
Method details
Section titled “Method details”repository
Section titled “repository”void repository(String repository) static
Sets the Maven repository the natives are downloaded from, such as a mirror of your own.
install
Section titled “install”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.
getRepository
Section titled “getRepository”String getRepository() static
Returns the repository the natives are downloaded from, Maven Central by default.
isInstalled
Section titled “isInstalled”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
