## Description This PR moves the native components (ffmpeg decoder, av1 decoder, & `libmpv`) to https://github.com/damontecres/wholphin-extensions. They can be retrieved as gradle dependencies now. This allows for contributors to more easily include these extensions when building Wholphin locally. There are no user facing changes in this PR. Note: the kotlin code for interfacing with `libmpv`, ie `MPVLib` & `MpvPlayer`, is still in this repo for now. ### Related issues Related to #828 ### Testing Emulator ## Screenshots N/A ## AI or LLM usage None
4 KiB
Wholphin developer's guide
See also the Contributing guide for general information on contributing to the project.
Overview
This project is an Android TV client for Jellyfin. It is written in Kotlin and uses the official Jellyfin Kotlin SDK to interact with the server.
The app is a single Activity (MainActivity) with MVVM architecture.
The app uses:
- Compose for the UI
- Navigation 3 for navigating app screen
- Room & DataStore for local data storage
- Hilt for dependency injection
- Media3/ExoPlayer for media playback
- MPV/libmpv for media playback
- Coil for image loading
- OkHttp for HTTP requests
Getting started
We follow GitHub's fork & pull request model for contributions.
After forking and cloning your fork, you can import the project into Android Studio.
Development environment
It is recommended to use a recent version of Android Studio. Make sure the version is compatible with Wholphin's AGP version.
Code formatting should follow ktlint's rules. Find the ktlint version in .pre-commit-config.yaml. Optionally, install the ktlint plugin in Android Studio to run automatically. Configure the version in Settings->Tools->KtLint->Ruleset Version.
Also, it's recommend to add an extra ruleset jar for Compose-specific KtLint: https://mrmans0n.github.io/compose-rules/ktlint/#using-with-ktlint-cli-or-the-ktlint-intellij-plugin
Also setup pre-commit which will run ktlint as well on each commit, plus check for other common issues.
Code organization
Code is split into several packages:
data- app-specific data models and servicespreferences- Non-UI related code for user settings and preferencesservices- hilt injectable services often used by ViewModels for API callsui- User interface code and ViewModelsutil- Utility classes and functions
Extensions
Wholphin uses several native components for extra playback compatibility. This includes Media3 ffmpeg/av1 decoders and libmpv. These extensions are not required to build the app, but without them some functionality will not work.
If you want to include these in a local build, see the instructions here for configuring the repository.
App settings
App settings are available with the AppPreferences object and defined by different AppPreference objects (note the s differences).
The AppPreference objects are used to create the UI for configuring settings using the composable functions in com.github.damontecres.wholphin.ui.preferences.
How to add a new app setting
- Add entry in
WholphinDataStore.proto& build to generate classes - Add new
AppPreferenceobject inAppPreference.kt - Add new object to a
PreferenceGroup(listed inAppPreference.kt) - Update
AppPreferencesSerializerto set the default value for new installs - If needed, update
AppUpgradeHandlerto set the default value for app upgrades- Since preferences use proto3, the default values are zero, false, or the first enum, so only need this step if the default value is different