Yokan / rebuild
Course 1 8624561

PLAYER_SUBTITLES_PIP_EXTERNAL.md

docs/features/PLAYER_SUBTITLES_PIP_EXTERNAL.md

documentation / design asset74 lines
1# Player subtitles, picture-in-picture and external players23Settings are stored in `DbSettings.features.player`. Defaults keep the4previous behavior.56## Subtitle selection78- Internal player settings include a language priority list, preferred9  (whitelist) names and excluded (blacklist) names. All are comma-separated.10- When a stream loads, excluded tracks are never auto-selected. The first11  listed language that still has a track wins. Codes match as words and English12  names match too ("en" or "English"). Preferred names win within that13  language.14- If no language matches, the first allowed track is used, as before. With no15  list, the legacy default subtitle language is used.16- mpv also receives the list as `slang` for embedded tracks. It is unset when17  the list is empty.1819## Secondary subtitles2021- The subtitle tab has a Secondary subtitle choice and its own delay.22- mpv adds the file with `sub-add … auto`, finds its id in `track-list` and23  sets `secondary-sid` and `secondary-sub-delay`. mpv draws it at the top.24- compose-mediaplayer (web, iOS simulator, Linux fallback) shows a second cue25  layer at the top, offset by the delay. Primary subtitles now render on this26  backend too.2728## Screenshots with subtitles2930- Off by default. "Include subtitles in screenshots" makes mpv capture with31  `screenshot-to-file … subtitles` instead of `video`.32- Screenshots remain mpv-only. Other backends keep the existing33  "unavailable" notice.3435## Picture-in-picture3637| Setting | Default | Effect |38|---|---|---|39| Picture-in-picture | On | Shows the PiP button and keeps automatic PiP when the app is left while playing. Off removes both. |40| PiP on exit | Off | Back while playing enters system PiP. Without it, the player shrinks to Yokan's mini player. |41| PiP episode notices | On | Shows the episode name when the episode changes while in PiP. |42| Replace +10 s with previous episode | Off | Sets the first PiP control. |4344- **Android:** activity PiP with remote actions: +10 s or previous episode,45  play/pause, and next episode. Actions arrive through a non-exported46  receiver.47- **Web:** the browser's video PiP. Media Session handlers supply next track48  and either seek-forward or previous track.49- **iOS and desktop:** no system PiP. mpv renders through its own layer, so50  `AVPictureInPictureController`, which needs an AVPlayer layer, cannot host it.51  PiP on exit uses the in-app mini player.5253## External player5455- Choose an External player and turn on Always use external player. The56  episode's first stream is then handed over when it loads, and the player57  closes. If launching fails, playback stays in-app with a notice.58- Header-requiring streams use the local proxy, as before.59- **Android:** installed apps that handle `video/*`. The package is set on the60  intent; `<queries>` in the manifest lists them.61- **Desktop:** mpv (with headers), IINA or VLC, depending on OS and what is62  installed, or the system handler.63- **iOS:** VLC, Infuse and Outplayer URL schemes (`LSApplicationQueriesSchemes`),64  or the system handler.65- **Web:** blocked. Browsers cannot launch native apps with a stream URL, so66  settings say so and the option is hidden.6768## Verification69702026-10-18: `PlaybackPoliciesTest` covers priority, whitelist, blacklist and71fallback selection. `MpvFeaturesTest` covers `slang`, subtitle screenshots,72`secondary-sub-delay` and volume commands. `ComposeControllerRetirementTest`73covers track and error reset and retirement. All passed on desktop JVM and74Kotlin/Wasm. Android, iOS simulator, desktop and Wasm compiled.75

Search chapters, reference and source filenames.