Video internals
How Video plays media through GStreamer, talks to Plex, Jellyfin and Emby servers, and handles Plex account approval.
This page maps Video's source for contributors: the playback path, the media-server clients, and Plex account approval. For using the app, see Video.
Source layout
| Module | Owns |
|---|---|
src/main.rs | process entry |
src/app/ | state and update routing: open.rs (files, folders, URIs), playback.rs, plex.rs and sources.rs (server flows), menus.rs, native_drop.rs, chooser.rs |
src/model/ | pure rules: file recognition, resume history, time and speed values |
src/view/ | the playback surface, controls, playlist, dialogs, title bar, and the server screens (plex.rs, plex_onboarding.rs) |
src/plex.rs, src/plex/ | the Plex client, artwork and cast photos |
src/jellyfin.rs | the Jellyfin and Emby client |
src/keys.rs | the keyboard map |
src/persistence.rs | preferences, resume positions and recents |
src/l10n.rs | Fluent catalogs |
Playback
Playback uses GStreamer through the framework's media service (enzui_services::media::VideoService); the app does not drive a pipeline itself. Seeking asks for an accurate seek first and falls back to a fast keyframe seek, telling the user with a toast when it does.
Opening is careful about provenance and ordering. Relative paths resolve from the calling directory; folders queue files with recognised video extensions, while individual files are probed regardless of extension. Late or cancelled opens are discarded rather than replacing newer media. Desktop launches, URI forwarding and native file drops are routed into the existing instance.
Media-server clients
Plex, Jellyfin and Emby share one set of screens. The Jellyfin client maps its responses onto the same item model the Plex client uses, so the views do not care which server they show; Emby is served by the Jellyfin client with Emby's path prefix.
| Plex | Jellyfin and Emby | |
|---|---|---|
| Local discovery | UDP broadcast and multicast on port 32414 | UDP broadcast on port 7359 |
| Sign-in | Plex account approval, Home profiles and PINs | password or Quick Connect |
| Progress reporting | the Plex timeline endpoint | the sessions playing endpoints |
| Streams | direct play | direct static streams |
Server tokens are kept in the Secret Service. If the keyring is unavailable or unlocking is cancelled, the sign-in lasts for the session only. Tokens are excluded from preferences and diagnostics, and the Plex client never handles passwords.
Libraries support search, paged browsing, artwork, movie details and show, season and episode navigation, with audio and subtitle selection, resume and progress reporting. Server transcoding, multipart media, downloads and online discovery are out of scope.
Plex sign-in
Video presents the Plex approval link. Open it with the system browser or approve from another signed-in device. Video polls for the result before opening the account’s libraries.
Development options
The optional performance-check and scroll-diagnostics features add bounded timing instrumentation and synthetic Plex layouts. Neither is needed for normal builds.
The opt-in format matrix generates synthetic media covering more codecs and containers and checks recovery from bad input. VIDEO_REQUIRE_ALL_CODECS=1 makes missing codecs fail the matrix, and VIDEO_TEST_HTTPS adds a real remote stream. Isolated state for tests and visual checks is selected with ENZUI_VIDEO_STATE_DIR.