Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
5ccf842
ALI-2358: Proposed design tokens for the video and music player
michaelaguiar Dec 2, 2026
2cfb136
ALI-2358: Videos and songs play, in the jailed GPU helper
michaelaguiar Dec 2, 2026
94b32da
ALI-2358: The player's controls, music view and screen-reader support
michaelaguiar Dec 2, 2026
713294a
alias-playback: follow #3 to 6afd318 (#2's warm start, Intel and revi…
michaelaguiar Dec 2, 2026
9d4a7f3
Merge branch 'ali-2358-player-video' into ali-2358-player-ui
michaelaguiar Dec 2, 2026
8add445
Review fixes: buffers the helper sends, frames on resize, failures, F…
michaelaguiar Dec 2, 2026
6c90566
Merge #7's review fixes; #8 review fixes: focus, announcements, overl…
michaelaguiar Dec 2, 2026
d13d9cf
alias-playback: follow #3 to 74c8c87 (cover art always drawn, warm-lo…
michaelaguiar Dec 2, 2026
3eaae85
Merge branch 'ali-2358-player-video' into ali-2358-player-ui
michaelaguiar Dec 2, 2026
5648de2
Review round 2: a failed file's helper ends; a helper's exit code is …
michaelaguiar Dec 2, 2026
78e57f2
Merge branch 'ali-2358-player-video' into ali-2358-player-ui
michaelaguiar Dec 2, 2026
756fbf4
Commands to the helper wait out a full socket; video needs viewporter
michaelaguiar Dec 2, 2026
44c1a86
Merge branch 'ali-2358-player-video' into ali-2358-player-ui
michaelaguiar Dec 2, 2026
b2f1106
Review round 2: back from the grid where it was; hover contrast held;…
michaelaguiar Dec 2, 2026
d4c5ab0
Follow alias-playback #3 to e11d5f4; a helper's exit code survives a …
michaelaguiar Dec 2, 2026
bf09af0
Merge branch 'ali-2358-player-video' into ali-2358-player-ui
michaelaguiar Dec 2, 2026
b5c527b
Review round 3: the grid's kept place can't outlive it; a paused resu…
michaelaguiar Dec 2, 2026
42d4ab2
Follow alias-playback #3 to a314208 (#2's late-Loaded fixes; no pictu…
michaelaguiar Dec 2, 2026
f2be3d6
Merge remote-tracking branch 'origin/ali-2358-player-video' into HEAD
michaelaguiar Dec 2, 2026
b6cbe18
A buffer's modifier must be one the compositor listed for its format
michaelaguiar Dec 2, 2026
4e4e812
Merge remote-tracking branch 'origin/ali-2358-player-video' into HEAD
michaelaguiar Dec 2, 2026
c4eeb7d
Follow alias-playback #3 to its merge of 6c0187c (GPU setup freed on …
michaelaguiar Dec 2, 2026
97a957a
Merge remote-tracking branch 'origin/ali-2358-player-video' into HEAD
michaelaguiar Dec 2, 2026
2373ba9
Merge main (#6 and #7 squash-merged) into ali-2358-player-ui
michaelaguiar Dec 2, 2026
6d2f67e
Player tokens approved: their usage notes drop "Proposed"
michaelaguiar Dec 2, 2026
bf75c8e
Hide the pointer with the control bar while a video plays
michaelaguiar Dec 2, 2026
2fec5ed
README: what brings the pointer back, and where it hides
michaelaguiar Dec 2, 2026
caa95f4
Use alias-playback from main, now that #2 and #3 are merged
michaelaguiar Dec 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ xkbcommon = { version = "0.9.0", default-features = false }
swash = "0.2.10"
rustix = { version = "1.1.6", features = ["fs", "event", "time", "pipe", "process"] }
# Video and music: libmpv in a jailed helper that draws on the graphics card and hands its
# frames over as dmabufs (ALI-2358). On the branch of alias-playback PR #3 (stacked on #2)
# until those merge; then this moves to main.
alias-playback = { git = "https://github.com/aliasproject/alias-playback", branch = "ali-2358-gpu-media" }
# frames over as dmabufs (ALI-2358).
alias-playback = { git = "https://github.com/aliasproject/alias-playback", branch = "main" }

[profile.release]
opt-level = 3
Expand Down
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,25 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

---

The player's icons in src/player/icons.rs (previous, play, pause, replay, next, sound,
muted, full screen and the music note) are from Lucide (https://lucide.dev), under the ISC
licence:

ISC License

Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT).
All other copyright (c) for Lucide are held by Lucide Contributors 2022.

Permission to use, copy, modify, and/or distribute this software for any purpose with or
without fee is hereby granted, provided that the above copyright notice and this permission
notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
61 changes: 57 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Alias View

aliasOS's picture viewer. It replaces `imv` as the default for pictures; video and
audio stay with `mpv`. Rust, drawn on the CPU straight onto Wayland with no toolkit, in
aliasOS's picture viewer, which also plays video and music (ALI-2358, to replace `mpv`). It
replaces `imv` as the default for pictures. Rust, drawn on the CPU straight onto Wayland with no toolkit, in
the style of [Gannet](../gannet), aliasOS's file manager.

alias-view FILE... # those pictures, in that order
alias-view FILE... # those pictures (or videos and songs), in that order
alias-view FILE # that picture, then the rest of its folder
alias-view FOLDER # the folder, from its first picture

Expand All @@ -29,6 +29,36 @@ already has the picture in it.
| `?` | The key list |
| Escape, `q` | Escape closes a panel, leaves zoom or the grid, then quits; `q` quits |

### In a video or song

From the design canvas's player boards, with Mike's decisions of 2026-12-02.

| Keys | What they do |
| --- | --- |
| Space, `k` | Play or pause; after the end, play again from the start |
| Left, Right | Back or forward 5 s. Pictures keep Left and Right for the previous and next file |
| Up, Down | Volume down or up by 5 |
| `m` | Mute or unmute |
| `f`, double-click | Full screen, or back (videos) |
| `n`, Page Down / `p`, Page Up | Next or previous file in the folder |
| Home | Back to the start |
| `t` | Says the position to a screen reader: "1:23 of 4:56" |
| Tab, Shift+Tab | Through the control bar: Previous, Play, Next, Position, Mute, Volume, Full screen. Enter or Space presses a button; arrows move a slider |
| `?` | The key list |
| Escape, `q` | Escape leaves full screen, then quits |

The media keys (play, pause, next, previous, volume, mute) work while the window has the
keyboard.

The control bar hides 2 s after the pointer last moved or a key was pressed while a video
plays, in a window and in full screen. It stays while the video is paused or has ended,
for music, and while the keyboard focus is in it. The mouse pointer hides with the bar and
comes back with it: on any pointer motion, and on a key, a click or a pause. It hides only
where the desktop offers cursor-shape-v1, without which its shape couldn't be set again.
A video stops on its last frame with a
replay icon and never goes on by itself; a song plays on to the next song in the folder
and stops after the last.

## Formats

JPEG, PNG, WebP (still and animated), GIF (animated), BMP, TIFF, ICO, AVIF, HEIC/HEIF,
Expand All @@ -40,6 +70,16 @@ file that claims more is shown at screen size where its format allows that witho
holding the whole picture (baseline JPEG, PNG that isn't interlaced); zooming in then enlarges the screen
copy and says why, and copying offers only the file itself.

Video: mp4, m4v, mkv, webm, mov, avi, flv, wmv, mpeg, ogv, 3gp and asf. Music: mp3, flac,
ogg, opus, m4a, aac, wav, wma, aiff, mka, wv and ape, with the cover art the file holds.
They play in [alias-playback](https://github.com/aliasproject/alias-playback)'s GPU
helper: libmpv in a bubblewrap jail (with Landlock and a seccomp filter), decoding on the
graphics card where it can (NVDEC, VA-API or V4L2, else the CPU) and drawing into
buffers it hands over as dmabufs. They show in a subsurface above the window, so video
never decodes in this process and its frames never pass through it. Sound goes through
the session's PulseAudio socket (PipeWire serves it), bound into the jail read-only. Needs
`bwrap`, libmpv, and a compositor with linux-dmabuf.

## How it's fast

Measured with `make startup` in a headless sway (1920x1080, pixman), three runs each, on
Expand Down Expand Up @@ -138,6 +178,7 @@ Each is here for one job, and the crate itself has no unsafe code
| `resvg` | SVG, drawn at the window's size |
| `libheif-rs` | HEIC and AVIF through libheif. No pure Rust HEVC decoder exists, and libheif with its codec threads decodes the 24 MP HEIC in about 100 ms. |
| `accesskit`, `accesskit_unix` | Screen readers, over AT-SPI |
| `alias-playback` | Video and music: libmpv in a jailed helper, its frames as dmabufs (Alias Project's own crate; its `unsafe` FFI lives there) |
| `blocking` | Not used directly; pinned to 1.6.2 for zbus under accesskit_unix, because 1.7.0's last pool thread never exits and wakes twice a second |

Test-only: `jpeg-encoder` and `zune-jpegxl` make test pictures; `zune-core` is the
Expand All @@ -155,6 +196,15 @@ latter's options.
background and the tiles; all text is held to 4.5:1 on what it sits on. A theme whose
colours fall short is pulled up to those ratios, and a unit test checks the built-in
palettes with the WCAG formula.
- The player's controls are AccessKit buttons, toggle buttons (Play, Mute, Full screen,
pressed or not) and sliders (Position "1:23 of 4:56", Volume "80%" or "Muted, 80% when
unmuted") in Tab order, with the focus ring on the focused one. Opening, pausing,
playing, the end, a failure, a change of volume and a seek by key (once the keys stop)
are announced politely; nothing is announced by itself while a video plays.
- Nothing in the player is told by colour alone: play, pause and replay are different
icons, the played part of a slider is 4 px against the rest's 2 px, and hover fills a
button behind its icon. The bar is opaque, so its text and icons keep their contrast
over any video.
- Grid tiles are 168 px; nothing clickable is smaller than 44x44. Overlays rearrange
themselves to fit (two columns, or label above value), and a test checks the key list
fits the smallest window at 100%, 125% and 200%.
Expand Down Expand Up @@ -189,6 +239,8 @@ that the list matches what the viewer derives (`cargo test`).
src/view.rs fit and zoom maths
src/ui.rs overlays and the grid's layout
src/a11y.rs the AccessKit tree
src/player/ video and music: the helper (gpu.rs), the bar (bar.rs), icons
src/app/player_ui.rs the player's keys, pointer, bar hiding and announcements
src/exif.rs orientation, date and camera
src/trash.rs the freedesktop Trash, and putting things back
src/theme.rs, text.rs, canvas.rs, sort.rs Gannet's, trimmed
Expand All @@ -197,4 +249,5 @@ that the list matches what the viewer derives (`cargo test`).

## Licence

MIT. Copyright (c) 2026 Alias Project, Inc.
MIT. Copyright (c) 2026 Alias Project, Inc. The player's icons are Lucide's, under the
ISC licence (see `LICENSE`).
61 changes: 43 additions & 18 deletions design/tokens.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"light": "#c3c4c6",
"dark": "#4a4d51"
},
"usage": "A panel's and toast's 1 px edge: the background blended 25% toward the theme's text. Decorative: panels aren't controls, so it isn't in the contrast list. Proposed (ALI-2358): also a player button's fill under the pointer, behind its icon in foreground."
"usage": "A panel's and toast's 1 px edge: the background blended 25% toward the theme's text. Decorative: panels aren't controls, so it isn't in the contrast list. Also the fill of a player button under the pointer, behind its icon in foreground."
},
{
"name": "foreground",
Expand Down Expand Up @@ -137,7 +137,7 @@
"light": "#65686c",
"dark": "#9b9ea2"
},
"usage": "Labels in a panel of rows (Name, Size; a key in the key list): foreground blended 35% toward panel, then held to 4.5:1 on panel. Proposed (ALI-2358): also the unplayed part of the seek and volume bars, the time's total, and the artist and album under a song's title."
"usage": "Labels in a panel of rows (Name, Size; a key in the key list): foreground blended 35% toward panel, then held to 4.5:1 on panel. Also the unplayed part of the player's seek and volume bars, the time's total, and the artist and album under a song's title."
},
{
"name": "accent",
Expand All @@ -154,7 +154,7 @@
"light": "#2f6feb",
"dark": "#5b9bf5"
},
"usage": "The grid's focus ring. The theme's accent (or color4, or blue), moved until it has 3:1 against base and panel, the two things it sits beside. Proposed (ALI-2358): also the played part of the player's seek and volume bars, and the focus ring around its buttons."
"usage": "The grid's focus ring. The theme's accent (or color4, or blue), moved until it has 3:1 against base and panel, the two things it sits beside. Also the played part of the player's seek and volume bars, and the focus ring around its buttons."
},
{
"name": "danger",
Expand Down Expand Up @@ -234,12 +234,22 @@
{
"name": "controls-gap",
"value": "4px",
"usage": "Proposed for the video and music player (ALI-2358), not drawn yet: between the buttons in the player's control bar, so each keeps its 44 px target."
"usage": "Between the buttons in the player's control bar, so each keeps its 44 px target."
},
{
"name": "cover-gap",
"value": "24px",
"usage": "Proposed for the video and music player (ALI-2358), not drawn yet: in the music view, between the cover art and the title under it."
"usage": "In the music view, between the cover art and the title under it."
},
{
"name": "time-pad",
"value": "12px",
"usage": "Either side of the time (1:23 / 4:56) in the player's control bar (src/player/bar.rs)."
},
{
"name": "controls-group-gap",
"value": "8px",
"usage": "In the player's control bar, the extra space before the Mute and Full screen buttons, which sets the sound and window controls apart from the position (src/player/bar.rs)."
}
]
},
Expand Down Expand Up @@ -297,37 +307,42 @@
{
"name": "controls-height",
"value": "64px",
"usage": "Proposed for the video and music player (ALI-2358), not drawn yet: the player's control bar along the window's foot: a 44 px button with 10 px above and below. Opaque panel, so its text and icons keep their contrast over any video."
"usage": "The player's control bar along the window's foot: a 44 px button with 10 px above and below. Opaque panel, so its text and icons keep their contrast over any video."
},
{
"name": "control-icon",
"value": "20px",
"usage": "Proposed for the video and music player (ALI-2358), not drawn yet: an icon inside a 44 px control button, drawn in foreground (border behind it under the pointer)."
"usage": "An icon inside a 44 px control button, drawn in foreground (border behind it under the pointer)."
},
{
"name": "seek-track",
"value": "2px",
"usage": "Proposed for the video and music player (ALI-2358), not drawn yet: the part of the seek and volume bars still to come, in muted. Thinner than the played part, so the two differ in shape, not colour alone."
"usage": "The part of the seek and volume bars still to come, in muted. Thinner than the played part, so the two differ in shape, not colour alone."
},
{
"name": "seek-played",
"value": "4px",
"usage": "Proposed for the video and music player (ALI-2358), not drawn yet: the part of the seek and volume bars already played or set, in accent."
"usage": "The part of the seek and volume bars already played or set, in accent."
},
{
"name": "seek-thumb",
"value": "14px",
"usage": "Proposed for the video and music player (ALI-2358), not drawn yet: the round handle on the seek and volume bars, in foreground; its 44 px target is the bar's whole height."
"usage": "The round handle on the seek and volume bars, in foreground; its 44 px target is the bar's whole height."
},
{
"name": "volume-width",
"value": "96px",
"usage": "Proposed for the video and music player (ALI-2358), not drawn yet: the volume bar's length in the control bar."
"usage": "The volume bar's length in the control bar."
},
{
"name": "cover-art",
"value": "320px",
"usage": "Proposed for the video and music player (ALI-2358), not drawn yet: the music view's cover art, square, at most; smaller in a smaller window. No cover art: a panel square with a note icon in muted."
"usage": "The music view's cover art, square, at most; smaller in a smaller window. No cover art: a panel square with a note icon in muted."
},
{
"name": "cover-icon",
"value": "96px",
"usage": "The note icon in the panel square a song with no cover art shows, in muted (src/player/bar.rs)."
}
]
},
Expand All @@ -351,12 +366,22 @@
{
"name": "controls-hide",
"value": "2s",
"usage": "Proposed for the video and music player (ALI-2358), not drawn yet: while a video plays, how long the control bar stays after the pointer last moved or a key was pressed. Paused, ended, loading, failed, music, or a keyboard focus inside the bar: it stays."
"usage": "While a video plays, how long the control bar stays after the pointer last moved or a key was pressed. Paused, ended, loading, failed, music, or a keyboard focus inside the bar: it stays. The mouse pointer hides and comes back with it."
},
{
"name": "seek-step",
"value": "5s",
"usage": "Proposed for the video and music player (ALI-2358), not drawn yet: how far Left and Right (or a click on the seek bar's keyboard focus) move in a video."
"usage": "How far Left and Right (or a click on the seek bar's keyboard focus) move in a video."
},
{
"name": "seek-announce",
"value": "500ms",
"usage": "After the last seek by key, how long the player waits before telling the screen reader the new position, so a held key is announced once, where it stops (src/app.rs)."
},
{
"name": "double-click",
"value": "400ms",
"usage": "Two clicks on a video this close together are a double-click, which toggles full screen (src/app.rs)."
}
]
},
Expand All @@ -375,7 +400,7 @@
{
"name": "volume-step",
"value": 5,
"usage": "Proposed for the video and music player (ALI-2358), not drawn yet: how many points of 100 Up and Down (and the volume bar's arrow keys) move the volume."
"usage": "How many points of 100 Up and Down (and the volume bar's arrow keys) move the volume."
}
]
},
Expand Down Expand Up @@ -540,19 +565,19 @@
"fg": "foreground",
"bg": "border",
"min": 3,
"usage": "Proposed (ALI-2358): a player button's icon under the pointer, on its border-coloured fill."
"usage": "A player button's icon under the pointer, on its border-coloured fill."
},
{
"fg": "muted",
"bg": "base",
"min": 4.5,
"usage": "Proposed (ALI-2358): the artist and album under a song's title in the music view, straight on the background."
"usage": "The artist and album under a song's title in the music view, straight on the background."
},
{
"fg": "muted",
"bg": "panel",
"min": 3,
"usage": "Proposed (ALI-2358): the unplayed part of the seek and volume bars, a 2 px line on the control bar."
"usage": "The unplayed part of the seek and volume bars, a 2 px line on the control bar."
}
]
}
Loading
Loading