Rust already reported `use_html5_element: false` on Android, but two frontend overrides threw that answer away, so ExoPlayer's video path had never actually run. Both are lifted behind an `experimentalNativeVideo` opt-in (default off). The flag is a suppressor, never a promoter: off forces HTML5 even where Rust says native, so an in-progress spike cannot ship as the default, but it can never select native where Rust reported HTML5 — Linux cannot composite behind WebKitGTK, and promoting there would be a black screen. Two blockers the spec did not anticipate, both in code assumed to be merely unreachable rather than broken: - `JellyTauPlayer.setActivity()` had zero callers, so `currentActivity` was always null and `autoAttachSurface()` bailed. The SurfaceView was created and wired to ExoPlayer but never added to the view hierarchy — video would have decoded to a surface that was never on screen, whatever the webview did. This also revives PiP on the video path, which gated on the same flag. - `createAdapter()` was not the real gate; it is never called in production. The actual override was in VideoPlayer.svelte, which forced HTML5 and stopped the native backend `player_play_item` had just started. Both sites now route through `createAdapter()`. Compositing needs two independent opaque layers cleared, not one. Clearing only the page leaves the WebView widget opaque — audio over a black picture, exactly the symptom the old INTERIM comment described. `videoSurface.ts` toggles both: the widget background and window drawable from Kotlin, the page backgrounds via a `data-native-video` attribute keyed by app.css. Transparency lives in `tauri.android.conf.json` so Linux keeps an opaque window, and is scoped to the playback session so the launcher never shows through the rest of the app. Phase 3's rect plumbing turned out to be unnecessary: video is fullscreen on the player route, and `fitSurfaceToScreen()` already letterboxes and re-fits on rotation. The mini-player transition remains unverified on device. Also removes the `navigator.userAgent` sniffing in webviewAudio.ts, which was a second copy of the Rust cfg gate free to drift from it. `player_get_capabilities` now reports `usesWebviewAudio` and `supportsNativeVideo` from those same gates. Tests: adapter selection covers the full matrix, including the regression guard that the flag off beats Rust. Written first and confirmed failing (2 of 7) before the fix. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
82 lines
3.3 KiB
CSS
82 lines
3.3 KiB
CSS
@import "tailwindcss";
|
|
|
|
/* Exclude the generated tauri-specta bindings from Tailwind's content scan.
|
|
It contains no CSS classes (only TS types/command wrappers), and scanning a
|
|
large generated file can confuse Tailwind v4's automatic class detection. */
|
|
@source not "./lib/api/bindings.ts";
|
|
|
|
/* Custom theme variables for JellyTau */
|
|
@theme {
|
|
--color-jellyfin: #00a4dc;
|
|
--color-jellyfin-dark: #0085b3;
|
|
--color-background: #101010;
|
|
--color-surface: #1a1a1a;
|
|
--color-surface-hover: #252525;
|
|
}
|
|
|
|
/* Safe-area insets — the single source of edge padding for the whole app.
|
|
*
|
|
* TRACES: UR-066 | DR-112
|
|
*
|
|
* Two independent sources have to be folded together:
|
|
*
|
|
* - `env(safe-area-inset-*)` — iOS/desktop, and the *display cutout* on
|
|
* Android. Requires `viewport-fit=cover` (see src/app.html) or it is 0px.
|
|
* - `var(--jt-inset-*)` — real Android `WindowInsets` (status bar, navigation/
|
|
* gesture bar, cutout) pushed in from Kotlin, because Android WebView never
|
|
* reports the *system bars* through `env()`. See WindowInsetsBridge.kt and
|
|
* $lib/utils/safeArea.ts.
|
|
*
|
|
* `max()` takes whichever is real on this platform; both are 0 on desktop.
|
|
* Consumers must use `--safe-*` and never `env()` directly — a bare `env()` is
|
|
* silently 0 for the Android system bars, which is what put the bottom nav
|
|
* under the navigation bar on 3-button-nav devices.
|
|
*
|
|
* Applied at the edges that own them: the app shell (top/left/right) and
|
|
* BottomUi (bottom, so its surface colour extends behind the gesture bar).
|
|
* Deliberately NOT applied to `body` — the shell is `h-screen`, and body
|
|
* padding would push 100vh past the viewport, and `position: fixed` overlays
|
|
* (the video/audio players) ignore body padding anyway.
|
|
*/
|
|
:root {
|
|
--safe-top: max(env(safe-area-inset-top, 0px), var(--jt-inset-top, 0px));
|
|
--safe-right: max(env(safe-area-inset-right, 0px), var(--jt-inset-right, 0px));
|
|
--safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--jt-inset-bottom, 0px));
|
|
--safe-left: max(env(safe-area-inset-left, 0px), var(--jt-inset-left, 0px));
|
|
}
|
|
|
|
/* Global styles */
|
|
html, body {
|
|
@apply h-full;
|
|
background-color: var(--color-background);
|
|
}
|
|
|
|
/* Native-video compositing (Android).
|
|
*
|
|
* TRACES: UR-003, UR-004 | DR-150
|
|
*
|
|
* When ExoPlayer renders into a SurfaceView *behind* the WebView, every opaque
|
|
* layer between the viewport and that surface hides the video. The WebView
|
|
* itself is made transparent by `"transparent": true` in
|
|
* tauri.android.conf.json; these rules clear the app's own painted backgrounds.
|
|
*
|
|
* Scoped to `[data-native-video="active"]` — set on <html> by
|
|
* $lib/stores/nativeVideo.ts only while a native video session is on screen —
|
|
* because every other screen genuinely needs its opaque background. The app
|
|
* shell (+layout.svelte) also paints --color-background across the viewport, so
|
|
* it is cleared here too; the shell is the layer directly over the surface.
|
|
*
|
|
* `background: transparent` (not a colour) is required: an alpha-0 colour still
|
|
* composites in some WebView versions.
|
|
*/
|
|
html[data-native-video="active"],
|
|
html[data-native-video="active"] body,
|
|
html[data-native-video="active"] [data-app-shell] {
|
|
background: transparent !important;
|
|
}
|
|
|
|
body {
|
|
@apply text-white antialiased;
|
|
font-family: system-ui, -apple-system, sans-serif;
|
|
}
|