Home/docs/guide/Quick start

Quick start

Quickstart

liberika supports several integration paths: the Flutter plugin erika_flutter, the SwiftPM package liberika-swift, the OpenHarmony ArkTS native package erika, the native Rust crate, the standard C ABI dynamic and static libraries, and a standalone Web / WASM browser backend.

Prebuilt artifacts#

GitHub Releases (github.com/AimesSoft/liberika/releases) provides self-contained prebuilt archives for all major platforms:

ArchiveContentsArchitectures
erika-swift-core-0.3.8.xcframework.zipApple XCFramework core runtime (macOS / iOS / tvOS)arm64 / x86_64
erika-capi-macos-universal.zipliberika_capi.dylib / .aarm64 / x86_64
erika-capi-windows-x64.ziperika_capi.dll / .libx86_64
erika-capi-android.zipShared libraries for four ABIsarm64-v8a / armeabi-v7a / x86_64 / x86
erika-capi-openharmony-arm64.zipliberika_capi.so + C ABI headerarm64
erika-capi-linux-{x64,arm64}-{bundled,system}.zipliberika_capi.so / .a · glibc 2.35+x86_64 / ARM64

SwiftPM and OHPM packages use their own published versions; the Swift XCFramework archive in the core Release is the 0.3.8 runtime.

Flutter integration#

pubspec.yaml

dependencies:
  erika_flutter: ^0.3.8

lib/main.dart

final player = ErikaPlayer();
await player.open('/path/to/video.mp4');
await player.play();

The plugin covers macOS, iOS, tvOS, Windows, Android, and OpenHarmony, and now adds experimental Linux support. For usage, see Flutter integration. For Linux dependencies and build steps, see Linux integration.

Swift / Apple native integration#

Add the SwiftPM dependency https://github.com/AimesSoft/liberika-swift to your Xcode project to get started quickly with Metal rendering and system hardware decoding:

Swift example

import Erika

let player = try ErikaPlayer()
try player.open("https://example.com/video.mp4")
try player.play()

For the native view ErikaPlayerView and lifecycle management, see Swift integration.

OpenHarmony / ArkTS#

Install the native ArkTS package through OHPM and drive playback from an XComponent surface:

shell

ohpm install erika

For the ArkTS page lifecycle and frame scheduling, see OpenHarmony / OHPM integration.

Rust integration#

Cargo.toml

[dependencies]
erika = { git = "https://github.com/AimesSoft/liberika", tag = "v0.3.8" }

src/main.rs

use erika::{Player, PlayerConfig, MediaRequest};

let player = Player::new(PlayerConfig::default());
player.open(MediaRequest::new("/path/to/video.mp4"))?;
player.play()?;

For the full API and channel subscriptions, see Rust integration.

C / C++ ABI integration#

Integrate through erika.h and the prebuilt liberika_capi. We recommend ErikaPresenterHandle, where the kernel manages rendering and audio:

main.c

#include "erika.h"

ErikaPresenterHandle *p = erika_presenter_create();
erika_presenter_attach_metal_layer(p, (uint64_t)layer, w, h, scale);
erika_presenter_open(p, "https://example.com/video.mp4");
erika_presenter_play(p);

/* Drive once per frame from the display clock callback */
ErikaPresenterStats stats;
erika_presenter_render_tick(p, host_time, &stats);

For the full specification and a comparison with the headless ErikaHandle, see C ABI integration.

Platform matrix#

PlatformMinimum versionHardware decodingRenderingAudio outputSupport status
macOSmacOS 11VideoToolboxMetalCoreAudioOfficially supported
iOSiOS 13VideoToolboxMetalAudioQueueOfficially supported
tvOStvOS 13VideoToolboxMetalAudioQueueOfficially supported
WindowsWindows 10D3D11VADirect3D 11WASAPIOfficially supported
AndroidAndroid 8.0MediaCodecwgpu (Vulkan / GLES)AAudioOfficially supported
OpenHarmonyAPI 18AVCodecwgpu (Vulkan)OHAudioOfficially supported
Linuxglibc 2.35+NVDEC / VA-APIwgpu (Vulkan / EGL)PulseAudio / pipewire-pulseExperimental · x64 / ARM64 · bundled / system

Web / WASM#

Download liberika-web-0.3.8.zip, extract it completely, and open the demo page over HTTPS or localhost. Integrate from JavaScript with Player.create({ canvas }). It supports local MKV files, ASS fonts, danmaku, multiple tracks, chapters, and screenshots. Codec support depends on the browser's WebCodecs implementation, and output is currently SDR. For details, see Web / WASM integration.

liberika v0.3.8 Section Guide License MPL-2.0