## Description
Fixes track selection issues with MPV. This was especially focused on
libraries that disable embedded subtitles, but also fixes issues where
the audio streams are listed before video streams.
Also includes test media source JSON and unit tests to verify many
scenarios.
### Related issues
Fixes#494
## Description
Processing segments happens in a separate coroutine which wasn't
cancelled until _after_ playback of the next item begins. So in some
cases the outro from a previous item might be triggered during the very
beginning of the newly starting item.
So this PR instead cancels segment processing immediately when starting
the process for playback of an item. Additionally, the processing also
now checks that the current segment is for the current playback item as
an additional safeguard.
### Related issues
I believe this should fix both of these issues:
Fixes#369Fixes#647
## Description
Creates a `MediaSession` during playback which allows for external
control such as via smart speakers, Google Home app, etc
Note: one limitation is that seeking previous/next items in the playlist
isn't supported. This is because Wholphin manages that independent of
the `Player`, so additional dev work is needed for this.
### Related issues
Closes#622
Might help with #415
## 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
## 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
## Description
Removes an incorrect optimization for showing the home page header
Separates logic for focusing on rows on the home page
### Related issues
Fixes#624Fixes#620
## 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
## Description
On both movie & series detail pages, show a button to play trailers
instead of the row of cards below.
The button works like this:
- If no trailers, the button shows "No trailers" and is
disabled/non-clickable
- If only a single trailer, the button shows "Play trailer" and clicking
it plays the trailer
- Otherwise, shows "Trailers" and clicking displays a dialog to choose
one
Local trailers are shown first in the list. Then there is an attempt to
sort the trailers for the dialog so that names with "Official Trailer"
or "Official Theatrical Trailer" are listed first and "Teaser" is listed
last. This isn't perfect and doesn't work for non-English, but there's
no other metadata to use.
### Related issues
Closes#408
## Description
Makes sure the `ServerEventListener` and `DatePlayedInvalidationService`
are injected so that they run. This was broken in #538.
Also fixes the a delayed stopping of theme music
Also fixes for detecting a non-seamless refresh rate switch
### Related issues
Fixes#615Fixes#568
## Description
Yet more focus issue fixes:
- Restore focus when going back to home page from a later row
- Don't jump to episode row when going back to series overview (such as
from a person page)
This PR also changes how backgrounding the app during playback works.
Now the only goes back to the previous page when the app comes back to
the foreground. This helps with focusing back on the page properly.
There's also a bit more clean up performed.
## Description
Adds a settings for automatic resolution switching. When enabled, the
app tries to output content at the video stream's resolution.
For example, if playing 1080p content on a 4K TV, the actual output by
the Android TV device will be 1080p.
This works in hand-in-hand with automatic refresh rate switching. So
enabling both allows for the output to match both refresh rate and
content resolution. Outputting the best refresh rate is preferred over
best resolution.
Also, shows the current display mode in the playback debug info.
### Related issues
Closes#428Fixes#531