git clone https://github.com/paulherter/swiftly-player.git
cd swiftly-playerThe shared core and the Windows and Linux app are Rust. The Apple apps are
SwiftUI on top of the Rust core, and the Android app is Kotlin on top of it.
Rust 1.99.0 is pinned in rust-toolchain.toml; rustup installs it on the
first cargo call.
cargo test --workspace # the whole core and both desktop UIs, no device needed
cargo fmt --all -- --check
cargo clippy --workspace --all-targets -- -D warningsOn Linux, pkg-config and the fontconfig development headers
(libfontconfig1-dev on Debian and Ubuntu) must be installed; the text engine
links fontconfig.
The app is crates/swiftly-desktop: its own Rust UI in a winit window, drawn
with wgpu, and video through libmpv. libmpv is loaded at run time, so it is not
needed to build, only to play. Without the mpv feature the app builds but has
no video.
cargo build -p swiftly-desktop --release --features mpvThe binary is target/release/swiftly-desktop.
-
Linux: install libmpv (
libmpv2on Debian and Ubuntu,mpv-libson Fedora,mpvon Arch). The app looks forlibmpv.so.2; setSWIFTLY_LIBMPVto a full path to use another one. -
Windows: put
libmpv-2.dllnext to the.exe. The build used for the releases is named in Players. Build on Windows with the command above, or cross-compile from Linux withcargo-xwin:cargo xwin build --release --target x86_64-pc-windows-msvc -p swiftly-desktop --features mpv
Werkzeuge/package-desktop.shRun on Linux, it writes to target/desktop-dist:
.tar.gz,.deband.rpmfor Linux (needsdpkg-debandrpmbuild). With Podman installed, the binary is built in an Ubuntu 22.04 container so it runs on older glibc;SWIFTLY_NATIVE_LINUX_BUILD=1builds on the host instead.SWIFTLY_LINUX_ONLY=1stops after these three.- A Windows
Setup.exe(NSIS) and a portable.zip, cross-compiled withcargo xwin(needsmakensisandzip).libmpv-2.dllis read fromSWIFTLY_LIBMPV_DLL(default~/swiftly-vendor/libmpv-2.dll); without it the Windows packages are skipped.
The script stops if MARKETING_VERSION in project.yml and the version in
crates/swiftly-desktop/Cargo.toml differ.
cargo xtask fixture-server --port 8096 --real-shapesstarts a small Jellyfin-shaped server (user demo, password demo) with libraries, films, series, pictures and a short playable
clip. Sign in to it from any build. --real-shapes adds the odd cases a real
server has, such as a missing film or two libraries with the same titles. The
other switches (--big, --mode, --latency-ms) are listed at the top of
xtask/src/fixture_server.rs.
Xcode 26 or newer, and xcodegen (brew install xcodegen). The .xcodeproj is
generated, not checked in. The apps link the Rust core as a binary framework
(Packages/SwiftlyCore/SwiftlyCoreFFI.xcframework), which is not checked in
either:
export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
Werkzeuge/rust-kern.sh # builds the xcframework if missing, then runs xcodegen
Werkzeuge/rust-kern.sh --rebuild # after a change under crates/
xcodebuild -project Swiftly.xcodeproj -scheme Swiftly-iOS \
-destination 'platform=iOS Simulator,name=iPhone 17 Pro' buildThe Apple player, AetherEngine, and its FFmpeg frameworks come in as Swift
packages (Packages/SwiftlyAether) and are resolved by Xcode on the first
build. The Swift package tests run with cd Packages/JellyfinKit && swift test,
and Werkzeuge/check.sh runs them together with the Apple builds.
JDK, the Android SDK and NDK 27 are needed; Werkzeuge/android-environment.sh
sets them up for the shell (the scripts below are written for a Mac). The Rust core is built first, as
libswiftly_uniffi.so for each ABI plus the Kotlin bindings, into
build/android-core:
Werkzeuge/rust-kern-android.sh # needs cargo-ndk and the Android Rust targets
cd Android && ./gradlew :phone:assembleDirectDebugAndroid uses Media3 with an FFmpeg audio decoder that
Werkzeuge/media3-ffmpeg-bauen.sh builds. Which engine plays on which system
is in Players.
crates/ The Rust core (server access, playback rules, view models) and the UI crates
crates/swiftly-desktop/ Windows and Linux app
xtask/ Build helpers: Apple framework, packaging, the fixture server
Packages/SwiftlyCore/ Swift wrapper around the Rust core
Packages/JellyfinKit/ Swift logic and tests used by the Apple apps
Sources/Shared/ SwiftUI shared by the Apple platforms
Sources/iOS/, tvOS/, macOS/ Entry points and views per platform
Android/ Kotlin app and the bindings to the core
Linux/, Windows/ Install scripts and the earlier desktop app (being retired)
Anything that decides behaviour belongs in the shared core, not in a view, including rules that look like presentation: what a player does at the end of an episode, how a resume position is chosen, which file counts as played. The core has tests that run without a simulator or a device.
The Jellyfin OpenAPI description is not included; fetch it from any server at
/openapi.json if you need it.