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:
| Archive | Contents | Architectures |
|---|---|---|
| erika-swift-core-0.3.8.xcframework.zip | Apple XCFramework core runtime (macOS / iOS / tvOS) | arm64 / x86_64 |
| erika-capi-macos-universal.zip | liberika_capi.dylib / .a | arm64 / x86_64 |
| erika-capi-windows-x64.zip | erika_capi.dll / .lib | x86_64 |
| erika-capi-android.zip | Shared libraries for four ABIs | arm64-v8a / armeabi-v7a / x86_64 / x86 |
| erika-capi-openharmony-arm64.zip | liberika_capi.so + C ABI header | arm64 |
| erika-capi-linux-{x64,arm64}-{bundled,system}.zip | liberika_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 integrationFlutter#
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 integrationSwift#
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 / ArkTSOpenHarmony#
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 integrationRust#
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 integrationC ABI#
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対応環境#
| Platform | Minimum version | Hardware decoding | Rendering | Audio output | Support status |
|---|---|---|---|---|---|
| macOS | macOS 11 | VideoToolbox | Metal | CoreAudio | Officially supported |
| iOS | iOS 13 | VideoToolbox | Metal | AudioQueue | Officially supported |
| tvOS | tvOS 13 | VideoToolbox | Metal | AudioQueue | Officially supported |
| Windows | Windows 10 | D3D11VA | Direct3D 11 | WASAPI | Officially supported |
| Android | Android 8.0 | MediaCodec | wgpu (Vulkan / GLES) | AAudio | Officially supported |
| OpenHarmony | API 18 | AVCodec | wgpu (Vulkan) | OHAudio | Officially supported |
| Linux | glibc 2.35+ | NVDEC / VA-API | wgpu (Vulkan / EGL) | PulseAudio / pipewire-pulse | Experimental · 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.