Commit graph

74 commits

Author SHA1 Message Date
Ray
03871579f5
Fixes MPV crash when playing next up (#772)
## Description
Ensure that MPV is always destroyed before being initialized again.
Also, now creating a new player is only done when switching backends
which means faster, more efficient playing the next up.

### Related issues
Fixes #766
2026-01-25 21:38:41 -05:00
Ray
4dd44b935c
Add optional AV1 software decoding via dav1d for ExoPlayer (#721)
## Description
Adds the [`dav1d` decoder
module](https://github.com/androidx/media/tree/release/libraries/decoder_av1)
for ExoPlayer as an option. It can be enabled in advanced settings.

Performance will vary between devices.

### Related issues
Closes #103

### Dev notes

As with the ffmpeg module, this one is not required to build the entire
app so it's easier for developers to get started.

This also introduces a customized `DefaultRenderersFactory` for
ExoPlayer, but its largely copied from the super class's implementation.
2026-01-18 18:35:41 -05:00
Ray
4c7c465c67
Add integration with Jellyseerr/Seerr (#558)
## Description
This PR add the ability to integrate with a [Jellyseerr/Seerr
server](https://github.com/seerr-team/seerr).

### Features
- Login to the Seerr server using API Key, Jellyfin credentials, or
local Seerr credentials
    - Separate Seerr logins per user profile
- Search Seerr from the search page
- Discover media from Seerr on the nav drawer `Discover` page
    - Also from movie, series, or person pages
- Seamless integration with existing media, i.e. selecting media found
from Seerr that already exists on the Jellyfin server, will go directly
to the regular media page
- Mostly consistent UI between Jellyfin media & Seerr media
- Submit requests to Seerr
- Cancel submitted requests

### Screenshots

![discover](https://github.com/user-attachments/assets/f830b48f-e2f1-43f4-9680-9c6d4e071765)

### Related issues
Closes #54

## Acknowledgements

The `app/src/main/seerr/seerr-api.yml` file is copied & modified from
https://github.com/seerr-team/seerr/blob/develop/seerr-api.yml. I hope
to try to upstream some of the changes in the future.
2026-01-12 16:35:27 -05:00
Ludovico de Nittis
197265e7f5
Add option to always direct play Dolby Vision Profile 7 (#670)
## Description
A few devices, like the Nvidia Shield Pro 2019, are able to correctly
handle Dolby Vision Profile 7. However, when a Full Enhancement Layer
(FEL) is present, these devices effectively ignore the enhancement layer
and only apply the RPU metadata.

Due to this behavior, device capabilities are reported as not supporting
`DOVIWithEL`, which causes the Jellyfin server to strip the DV layer
entirely with a remux.

This commit adds an option to force direct play of Dolby Vision Profile
7 content, preventing the server from stripping the Dolby Vision layer
and allowing compatible devices to handle playback as intended.

### Related issues
Fixes https://github.com/damontecres/Wholphin/issues/449

### Screenshots
<img width="1280" height="720" alt="dovi7"
src="https://github.com/user-attachments/assets/849e9897-93b6-419f-a1fb-7f361f9c88dd"
/>

### AI/LLM usage
None

Co-authored-by: Ray <154766448+damontecres@users.noreply.github.com>
2026-01-11 21:11:25 -05:00
Ray
b78f5fcc77
Better support for remote media (HLS/DASH) (#675)
## Description
Check if playback is for a remote source and, if so, play that remote
URL directly. Works for both ExoPlayer & MPV.

Also adds support for direct playback for DASH in ExoPlayer.

### Related issues
Closes #471
Closes #666
2026-01-11 19:43:21 -05:00
Ray
ee73e7d723
Fix duplicate commands from key presses/MediaSession (#663)
## Description
Fixes duplicate play/pause commands from a remote button press and
`MediaSession`.

This ended up being a bit complicated because Wholphin overrides the
default play/pause behavior for the skip back setting and to show the
controller on pause. This means using a forwarding player which meant
implementing more functionality into `MpvPlayer`.

### Related issues
Fixes #653
2026-01-09 16:59:37 -05:00
Damontecres
6906813bbc
Fix mpv error with MediaSession 2026-01-07 14:03:28 -05:00
Ray
356a93310f
MPV: Handle resolution switch (#635)
## Description
When switching resolution (and possibly refresh rate less frequently),
the initial surface is not always valid. This means, the MPV playback
treated it as detaching the surface and would never update.

This PR instead subscribes to the `SurfaceHolder`'s callbacks which will
provide a new, valid surface once the switch is ready. Then the surface
is attached and queued commands execute to start playback.

Also temporarily disables content scale options for MPV since the
compose implementation conflicts with MPV rendering.

### Related issues
Fixes #626
2026-01-05 15:38:36 -05:00
Ray
4f1c730736
Don't process reqeued MPV commands (#633)
## Description
This is an embarrassing bug... In #619, a change was made to avoid a
race condition and wait for the video output surface to be ready by
re-enqueuing commands. Except I missed cancelling executing the current
command.

This meant the command would both be executed and queued again. So, if
attaching the video surface takes a while, such as needing to wait for a
refresh rate change, _a lot_ of commands could have been added to the
queue and trigger a constant start-stop playback loop.

I think technically it would eventually resolve itself, but can take a
while.

### Related issues
Should fix #626
2026-01-04 17:25:43 -05:00
Ray
4d9e3cb6de
Fix MPV race condition causing no video output (#619)
## Description
Fixes a race condition where `libmpv` is beginning playback before it
has been attached to the output video surface.

The solution is for the handler to re-enqueue commands if MPV is either
not initialized or not attached yet. Once `libmpv` is ready, the
commands will be processed.

### Related issues
Should fix #576
2026-01-02 14:13:03 -05:00
Ray
977db0474a
Small bug fixes (#614)
## Description
Fixes the screen showing endless loading when toggling on automatic sign
in

Ports a bug fix to the device profile from the official app
(https://github.com/jellyfin/jellyfin-androidtv/pull/5268)
2026-01-01 15:07:32 -05:00
Ray
38697b011d
Switch from synchronized mutations to copy-on-write (#609)
## Description
Instead of synchronizing all access to event observers, use a
`CopyOnWriteArrayList`. This means sending events doesn't need to lock.
2025-12-31 16:10:29 -05:00
Ray
20fe5e2626
Move MPV init & destroy to looper thread (#534)
## Description
No user facing changes in this PR

This is a continuation of #481 to move initializing and tearing down
`libmpv` onto the looper thread to prevent main thread blocking.

~The only function left that runs on the main thread is
`setVideoSurfaceView`. Since this has to directly interact with the UI,
I need to read the docs and ExoPlayer code a bit more to see how this
can safely done multi-threaded.~ It is safe/correct to attach on another
thread.
2025-12-22 10:40:42 -05:00
Ray
13d70e7623
Rework internals of ApiRequestPager (#518)
## Description
Changes how `init()` works for `ApiRequestPager` so that it 1) always
forces updating the total count if needed and 2) propagates errors
during the initial fetch up to the original caller

This means if an error occurs during the initialization of the pager
data, it won't be quietly logged and ignored. Instead, ViewModel code
will catch it and display an error in the UI.

### Related issues
Should fix #492
2025-12-20 14:39:48 -05:00
Ray
8b40e89b8a
Update MPV playback threading model (#481)
There's no user facing changes in this PR

This PR updates `MpvPlayer` to use a threading model more similar to
[ExoPlayer's
model](https://developer.android.com/reference/androidx/media3/exoplayer/ExoPlayer#threading-model).

There's now a dedicated thread looper message queue between the UI
interactions on the main thread and calls to `libmpv`. This is necessary
because previously, the main thread would make the calls into `libmpv`.
`libmpv` uses internal mutex locking for some operations which meant
that the main thread would be blocked momentarily.

Now, the UI issues a command (eg seek to X position) and the command is
added to the thread looper queue and processed on that separate thread.
This uses the standard Android Handler/Looper mechanisms.

Related to #235
2025-12-17 18:24:25 -05:00
Ray
8479d8621d
Bump dependency versions, notably media3 (#496)
## Description
Bumps dependency versions, notably media3/ExoPlayer to `1.9.0`

### Related issues

Fixes #108
Fixes #355
Fixes #479
2025-12-17 17:00:15 -05:00
damontecres
ab8bbf2bd7
MPV: Adjust subtitle delay/offset (#470)
**This is for MPV playback backend only!** Since this only works in MPV
for now, the option is not shown if using ExoPlayer.

Adds a setting (the gear icon during playback) to adjust the subtitle
delay.

A negative delay shows subtitles sooner. A positive delay shows them
later. For example, if a subtitle is supposed to show between
1000ms-2000ms, a negative 250ms delay will show it at 750ms-1750ms
instead.

The delay is persisted between plays of the same media & subtitle track.

Ref: #12 


![subtitle_delay](https://github.com/user-attachments/assets/824e3a28-650a-4619-9535-b67addaabf1e)
2025-12-15 10:06:36 -05:00
damontecres
9e7742034a
Update style for ktlint 1.8 (#390)
Updated `ktlint`, so lots of code style changes, no user facing changes
2025-12-06 18:11:07 -05:00
damontecres
ac10517028
Add setting for subtitle outline size (#375)
Adds a settings allowing for adjusting the thickness of unstyled
subtitle outlines, if outline is enabled.

This is applied for both ExoPlayer & MPV

Closes #179

![outline
Large](https://github.com/user-attachments/assets/dfef74a5-a4d4-49db-a8d2-231e46ab151e)

Dev note: the ExoPlayer implementation is bad code, don't write code
like this. It works though
2025-12-05 16:55:46 -05:00
damontecres
a294661520
Support custom mpv.conf (#327)
Part of #235 
Closes #305

Adds a preference for specifying a custom `mpv.conf`

Also adds a preference to toggle between `vo=gpu` and `vo=gpu-next`, see
https://github.com/mpv-player/mpv/wiki/GPU-Next-vs-GPU

There are some caveats:
* Multi-line text entry via a remote is rough
* [Track selection
options](https://mpv.io/manual/stable/#track-selection) may not work as
expected because Wholphin manages this itself
* Bad settings will crash the app hard

Dev note: This rewrites the text field inputs to use the [state based
implementations](https://developer.android.com/develop/ui/compose/text/migrate-state-based)
2025-12-04 13:21:40 -05:00
damontecres
bddf51e076
Fix some threading issues (#364)
Fixes thread used by changes from #359 

Also create the device direct play profile lazily-ish off of the main
thread because this can take some time to create.

Should help address some of the "too much work" reported in #363, and
also fixes the network-on-main exception in the logs on #363
2025-12-02 19:17:28 -05:00
damontecres
56bf3cb7a0
Optimizes recommended content & image caching (#359)
## Details
This PR contains a number of optimizations

### Images
Updates to request images with maximum sizes

The max sizes are estimates on the maximum number of pixels that will be
actually displayed. This means the server is downscaling large images
which means 1) better quality downscaling and 2) smaller images sent
over the network and cached

This should mean slightly better quality images and more images that can
be cached locally

### Paging
Reduces network calls when fetching paginated data, ie grid pages and
some rows. This PR combines the total record count & first page queries
which slightly reduces total time to load paginated data.

Additionally, on movies/tv show recommended pages, the rows now only
fetch a limited number of items (same as number on home page). While
they previously fetched using pagination, there is an overhead required
to paginate requests, so this is slightly faster.

### Async recommended fetching
On movies/tv show recommended pages, the rows are now fetched completely
separately from each other. Previously, the rows were requested
separtely, but each was only added to the UI in order as each completed.
Now they will add as the data arrived.

Note: Top unwatched TV shows is still very slow on `10.11.x`, see #204


### Image cache

The local, on-disk image cache size is increased from 100mb to 200mb.
Combined with the smaller images, this covers about 1500-2000 poster
images, but will vary by server.

The cache size is now also configurable in advanced settings from 25mb
to 1000mb. Additionally, you can see how much of both the disk and
memory caches are in use.

## Issues
Closes #330 
Related to #120
2025-12-02 16:00:21 -05:00
damontecres
10233eb459
Support VC-1 direct play if device supports it (#362)
Adds VC-1 to ExoPlayer direct play profile, if the device supports it.

Also proposed to add this to the official app in
https://github.com/jellyfin/jellyfin-androidtv/pull/5208
2025-12-02 10:56:39 -05:00
damontecres
eca3268a7d
Add setting to increase logging verbosity (#354)
Adds a toggle to increase the verbosity of the app logs for
release/production builds

Most users won't need to use this, but it can be helpful when [gathering
app
logs](https://github.com/damontecres/Wholphin/wiki/Gathering-app-logs)
to report an issue.
2025-11-30 17:27:41 -05:00
damontecres
5b96be6662
Updates to details pages including videos' stream details display (#279)
## Details

This PR updates the detail pages for Movies & TV Shows.

- Increase backdrop image size & brightness (now matches home page)
- Increase max width for titles
- Decrease max width for detail text
- Switch to using a customized display labels for video, audio, &
subtitle streams

Additional change for movie pages:

- Don't dim movie details text
- Move video stream details below play buttons
- Move first row up higher

### Labels

Instead of using the server provided `DisplayTitle`, create display
labels in-app. In general, this shortens the text without losing
significant detail. It is similar to the official app.

Some of the changes:
- Don't show "SDR", only "HDR"
- Simplify audio channel info, eg "Surround 5.1" => "5.1"
- Show chosen subtitle language
- Show chosen subtitle codec
- Show "(+#)" if there are additional audio or subtitle tracks
- Use gray background slightly tinted by the theme color

## Issues
Closes #239
2025-11-24 15:35:55 -05:00
damontecres
20ab146c97
Update device profile for Jellyfin 10.11 (#293)
## Details

This PR updates the device profile used by ExoPlayer. It should more
accurately report support for HDR formats.

## Acknowledgements
This PR contains a commit (cd6351912af72d274b0baf50af4d777b986f0f46)
that has code copied and slightly modified from
https://github.com/jellyfin/jellyfin-androidtv `v0.19.4`.

Major acknowledgement & credit to the Jellyfin Android TV developers for
this code!

## Issues
Related to #15
2025-11-21 20:16:49 -05:00
damontecres
45567bf4eb
Variety of UI changes for grids, home page order, & tv guide (#272)
## Details
This PR ended up being larger than I meant. It contains some UI changes
and code organization.

## TV & DVR
- Uses the "Recordings" library position to order "Recently added in
Recordings" instead of Live TV position
- The times at the top of the TV guide are more distinguishable from
each other
- Removes the duplicate title on the Live TV->Recordings tab

## Other libraries
- Bare-bone support for "Music Video" libraries. Full support for "Music
Video" is work-in-progress in #267, but the libraries should be
browseable now.
- Bare-bone support for "Other" (aka Mixed Movies & TV Shows) libraries.
Note: this type of library is considered [broken and
deprecated](https://jellyfin.org/docs/general/server/media/mixed-movies-and-shows),
so this won't be expanded any further


## Grids
Updates various grid types to use poster vs wide cards. For example,
Favorite TV Episodes will use episode images in a wide card now.

## Issues
Closes #249 
Closes #271
2025-11-20 17:00:11 -05:00
damontecres
6be2662d4e
Add experimental MPV player backend (#161)
Experimental MPV player backend

Related to #14, #22, & #85

You can switch to MPV in advanced settings and toggle using hardware
decoding or not.

This uses code and buildscripts from
https://github.com/mpv-android/mpv-android, plus other third party
libraries to build MPV
2025-11-16 18:46:25 -05:00
damontecres
b7cb6efc4f
Dev: Move services into their own package (#214)
Moves service classes into their own files and package for easier
organization and discovery

No user facing changes in the PR
2025-11-13 19:39:37 -05:00
damontecres
fe29b0cd88
Show local & remote trailers for TV Shows (#212)
Shows local & remote trailers for TV Shows similar to how its shown for
Movies

Closes #141
2025-11-13 18:31:23 -05:00
Jakub Syty
f61e819a98
Add FLAG_ACTIVITY_NEW_TASK to fix updates for some older devices (#211)
Without this the installation intent is crashing with an error on my
Xiaomi Mi Box S (Android 8.1)
2025-11-13 17:27:20 -05:00
damontecres
19b712d54b
More favorite tabs & add people to favorites (#210)
Adds Video, Playlists, & People tabs to the favorites page

Also adds ability to add people to favorites via context menu or on
their page

Closes #199
2025-11-13 16:12:42 -05:00
damontecres
5061277fd1
Keep activity tracking alive even after errors (#209)
Previously if the activity tracker got an error from the server during
one of the reports, the timer thread would stop and no further reports
would be sent.

This PR fixes that so it will continue to attempt to send reports since
if playback is continuing without error, the report error is likely
transient. For example, I observed the server returning an error during
its DB optimization scheduled task.

I think this will fix #208
2025-11-13 11:36:57 -05:00
damontecres
58395e9adf
Refactoring switching server or user (#205)
Now when initiating a user or server switch, you can't back out of it
and must select a user/server. This will be useful when PIN code are
implemented down the road.

The app will now disconnect the web socket when backgrounded.

Also lots of internal refactoring
2025-11-12 17:44:16 -05:00
damontecres
2e3e4e3f5f
Add long clicking context menus everywhere (#202)
Adds long click context menus to just about every card throughout the
app. Previously only a few pages had this.

Closes #196
2025-11-12 15:36:36 -05:00
damontecres
5e2c75bb70
Log while navigating around the app (#195)
Just adds some logging while navigating around the app. If an error or
crash occurs and users want to share their logs, this information is
useful to know what page.

Logs are never sent without explicit user content and they are only
shared with the Jellyfin server the app is currently connected to. [See
here for more
details](https://github.com/damontecres/Wholphin/wiki/Gathering-app-logs#privacy)

Also stops theme music when the app is paused similar to #191
2025-11-11 20:10:16 -05:00
Damontecres
d6c9b236ef
Fix reversed logic 2025-11-10 18:45:31 -05:00
damontecres
fbf77b9376
Better playback lifecycle handling (#191)
Refactors lifecycle event observers

When the app is "paused", aka not actively focused, but still visible
(such as when opening Android TV OS menu), playback will pause.

When the app is "stopped", aka not visible (such as pressing Home
button), playback will stop, report playback progress, and return to the
previous screen.

I think this will fix #181, but I don't have a controller to test with
2025-11-10 17:55:58 -05:00
damontecres
98fc996bd5
Load movie & tv recommendations asynchronously (#183)
Previously all of the rows on the recommended tab for Movies & TV Shows
were loaded sequentially before any results were shown. This is not a
great experience because some of the queries (eg top rated unwatched)
can take a while sometimes.

This PR starts displaying content once the first 1 or 2 rows is loaded
and then shows placeholders while the rest are querying.

Finally the row queries are now mostly independent so if one errors out,
the rest of the rows will still be displayed.

Closes #180
2025-11-09 17:40:47 -05:00
damontecres
0fb1a69556
Fix only loading 100 episode in a season (#187)
Fixes #184

Data was being fetched, but the UI wasn't being properly notified to
display the data.

This PR also adjusts so that "focused episode header" still takes up the
space even if the focused episode hasn't fully loaded yet. This prevents
the UI from jumping up and down.

Also #42 is _not_ fixed by this PR because it is a different issue.
2025-11-09 17:40:13 -05:00
damontecres
5720603447
Add ability to style subtitles (#177)
Adds settings for styling text subtitles such as srt/subrip

## Issues
Closes #11
2025-11-08 19:54:51 -05:00
damontecres
5d085a3ab4
Show update download progress (#165)
Shows a simple dialog while the app update is downloading to show
progress
2025-11-06 18:15:25 -05:00
damontecres
77c787b51f
Add settings to show the current time (#155)
Closes #154 

Adds a settings to show the current time in the upper right corner.

If enabled, it will also show the end time for the playback on the
overlay.
2025-11-04 15:27:38 -05:00
damontecres
40a8249469
Support basic adding to playlists (#157)
Closes #143 

Adds option in the "More" menu to add the item to a playlist. Can also
create a playlist if needed.
2025-11-04 15:27:26 -05:00
damontecres
2840fa3f2a
Extract strings into resources (#151)
Move all strings into resource files to make future translating easier

No user facing changes in this PR
2025-11-03 15:38:12 -05:00
damontecres
08577b8a31
Play theme song for movies (#149)
Closes #133 
Fixes #142 

Theme songs will play for both TV shows and movies, if available. Also,
if there are multiple theme songs, one will be picked randomly instead
of always playing the first.

Additionally, the music now waits to start until the UI has loaded.
2025-11-03 11:50:47 -05:00
damontecres
9f3691fd1b
Optional to automatically go to new page on focus instead of clicking (#127)
Closes #95 

Adds a setting (defaults to enabled) to automatically go to a page when
the navigation drawer item is focused after a brief delay.

Basically, if you open the left nav drawer, and scroll down to "Movies"
after a brief delay (600ms), the app will switch to the Movies page
without having to click.

It can be disabled in advanced settings.
2025-10-31 15:09:13 -04:00
damontecres
1508fa1ea3
Show file details in overview dialog (#126)
When clicking the overview for an item, the dialog now shows details
about each file/media source including video, audio, & subtitle
information.

It only shows the full file path if the user is an administrator.
2025-10-31 12:27:30 -04:00
damontecres
982506555f
Add page to details about people (#119)
Adds a page to show details about people (actors, directors, etc) when
clicking on the person card

<img width="1280" height="771" alt="wholphin_person"
src="https://github.com/user-attachments/assets/ceba6c77-2943-4faf-a2c2-81471fb3acff"
/>
2025-10-30 19:24:36 -04:00
damontecres
3f7c2ac730
UI Updates & Fixes (#114)
Fixes #113 

- Ensures all audio and subtitle options are shown during playback
- Fix home rows not being at top when going back
- Show error message when background home page refresh fails

Also shows more details for login failures and adds a link to the debug
page (with log info) after multiple login failure attempts. Hopefully
this can help diagnose #112 and #18
2025-10-30 13:41:46 -04:00