Address the first beta's bugs and requested changes
Startup now uses the Android iris animation, and playback can continue in a corner miniplayer while browsing (the video is drawn into a corner rectangle beneath a matching hole in the page). The player keeps the window controls, hides its chrome when the pointer leaves, and gains audio/subtitle tracks, audio sync, source bitrate and playback details in its options. Subtitles can be styled in Settings with a live preview. Categories replace Collections, the A–Z rail magnifies, descriptions expand in place, downloads can be removed in bulk, and search keeps its results while typing. Fixes scroll jank from per-card and scrolling backdrop blurs, the hidden colour wash, the cubic volume curve, loud theme music, the search focus ring, a stray nav indicator, Continue Watching previews and the TV Shows header overlap. Removes the star rating, the duplicate Settings menu entry and the server settings' Show advanced switch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
be865fa992
commit
43c168da95
35 changed files with 1771 additions and 327 deletions
|
|
@ -40,6 +40,7 @@ pub fn run() {
|
|||
.invoke_handler(tauri::generate_handler![
|
||||
player::player_init,
|
||||
player::player_show,
|
||||
player::player_rect,
|
||||
player::player_command,
|
||||
player::player_set,
|
||||
player::player_get,
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ impl VideoSurface {
|
|||
pub fn on_property(&mut self, _: &str, _: &serde_json::Value) {}
|
||||
pub fn show(&mut self, _: bool) {}
|
||||
pub fn fit<R: Runtime>(&mut self, _: &WebviewWindow<R>, _: Option<&Mpv>) {}
|
||||
pub fn set_rect<R: Runtime>(&mut self, _: &WebviewWindow<R>, _: Option<&Mpv>, _: Option<(i32, i32, i32, i32)>) {}
|
||||
}
|
||||
|
||||
pub fn hold_awake(rx: std::sync::mpsc::Receiver<()>) {
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ impl VideoSurface {
|
|||
pub fn on_property(&mut self, _: &str, _: &serde_json::Value) {}
|
||||
pub fn show(&mut self, _: bool) {}
|
||||
pub fn fit<R: Runtime>(&mut self, _: &WebviewWindow<R>, _: Option<&Mpv>) {}
|
||||
pub fn set_rect<R: Runtime>(&mut self, _: &WebviewWindow<R>, _: Option<&Mpv>, _: Option<(i32, i32, i32, i32)>) {}
|
||||
}
|
||||
|
||||
pub fn hold_awake(rx: std::sync::mpsc::Receiver<()>) {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
//! Each platform file exposes the same items:
|
||||
//!
|
||||
//! - `VideoSurface`: composes mpv's output beneath the web view
|
||||
//! (`create`, `mpv_options`, `on_property`, `show`, `fit`).
|
||||
//! (`create`, `mpv_options`, `on_property`, `show`, `fit`, `set_rect`).
|
||||
//! - `SURFACE_PROPERTIES`: mpv properties the surface observes.
|
||||
//! - `MPV_LIBRARIES`: libmpv file names to look for.
|
||||
//! - `hold_awake`: prevents display sleep until the receiver closes.
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ pub struct VideoSurface {
|
|||
_target: IDCompositionTarget,
|
||||
root: IDCompositionVisual,
|
||||
visible: bool,
|
||||
/// Where the video is drawn, in client pixels; `None` fills the window.
|
||||
rect: Option<(i32, i32, i32, i32)>,
|
||||
pub width: i32,
|
||||
pub height: i32,
|
||||
}
|
||||
|
|
@ -49,6 +51,7 @@ impl VideoSurface {
|
|||
_target: target,
|
||||
root,
|
||||
visible: false,
|
||||
rect: None,
|
||||
width,
|
||||
height,
|
||||
})
|
||||
|
|
@ -102,9 +105,20 @@ impl VideoSurface {
|
|||
}
|
||||
}
|
||||
|
||||
/// Matches mpv's composition size and the visual's position to the
|
||||
/// window's client area, or to the miniplayer rectangle when one is set.
|
||||
pub fn fit<R: Runtime>(&mut self, window: &WebviewWindow<R>, mpv: Option<&Mpv>) {
|
||||
let Ok(h) = window.hwnd() else { return };
|
||||
let (w, h) = client_size(HWND(h.0 as _));
|
||||
let (cw, ch) = client_size(HWND(h.0 as _));
|
||||
let (x, y, w, h) = match self.rect {
|
||||
Some((x, y, w, h)) => (x, y, w.max(16), h.max(16)),
|
||||
None => (0, 0, cw, ch),
|
||||
};
|
||||
unsafe {
|
||||
let _ = self.root.SetOffsetX2(x as f32);
|
||||
let _ = self.root.SetOffsetY2(y as f32);
|
||||
let _ = self.device.Commit();
|
||||
}
|
||||
if (w, h) == (self.width, self.height) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -114,6 +128,11 @@ impl VideoSurface {
|
|||
let _ = mpv.set_property("d3d11-composition-size", &serde_json::Value::String(format!("{w}x{h}")));
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_rect<R: Runtime>(&mut self, window: &WebviewWindow<R>, mpv: Option<&Mpv>, rect: Option<(i32, i32, i32, i32)>) {
|
||||
self.rect = rect;
|
||||
self.fit(window, mpv);
|
||||
}
|
||||
}
|
||||
|
||||
/// mpv properties the surface needs to observe.
|
||||
|
|
|
|||
|
|
@ -180,6 +180,28 @@ pub async fn player_show<R: Runtime>(app: AppHandle<R>, window: WebviewWindow<R>
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct VideoRect {
|
||||
x: f64,
|
||||
y: f64,
|
||||
width: f64,
|
||||
height: f64,
|
||||
}
|
||||
|
||||
/// Draws the video in a rectangle of the window (physical pixels), for the
|
||||
/// miniplayer; `None` fills the window again.
|
||||
#[tauri::command]
|
||||
pub async fn player_rect<R: Runtime>(app: AppHandle<R>, window: WebviewWindow<R>, rect: Option<VideoRect>) -> Result<(), String> {
|
||||
let state = app.state::<PlayerState>();
|
||||
let mpv = state.mpv.lock().clone();
|
||||
let mut surface = state.surface.lock();
|
||||
if let Some(surface) = surface.as_mut() {
|
||||
let rect = rect.map(|r| (r.x.round() as i32, r.y.round() as i32, r.width.round() as i32, r.height.round() as i32));
|
||||
surface.set_rect(&window, mpv.as_deref(), rect);
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn player_command<R: Runtime>(app: AppHandle<R>, args: Vec<String>) -> Result<(), String> {
|
||||
player(&app)?.command(&args)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue