Lively wallpaper integration
Screenbox uses Lively Wallpaper visualizers to present music-driven visuals during audio playback. The integration finds built-in and user-installed web wallpapers, lets the user select one, and sends current track and pause state to the selected wallpaper.
Integration role
The Lively extension connects Screenbox playback state to a local web page that follows the Lively Wallpaper contract. It keeps wallpaper discovery and installation separate from the player surface, so the player can load the selected visualizer and update it as media changes.
The integration is part of the wider external media integrations area. It complements casting, which sends media to another playback device instead of rendering a visualizer in the Screenbox player.
Service boundary
The ILivelyWallpaperService contract in Screenbox.Lively/…/ILivelyWallpaperService.cs provides the two operations needed by the rest of the feature: list available visualizers and install a visualizer from a wallpaper file. LivelyWallpaperService reads Lively metadata, builds the application model, and manages the built-in and user visualizer locations.
Built-in visualizers come from the packaged assets. User visualizers come from the app's local data. An imported archive is accepted only when its metadata describes a local web wallpaper with music support, then it is unpacked into the user visualizer area.
References: Screenbox.Lively/…/ILivelyWallpaperService.cs• L8-12 Screenbox.Lively/…/LivelyWallpaperService.cs• L19-73
Wallpaper catalog
The catalog turns a Lively wallpaper package into a visualizer that Screenbox can show, select, and load. Each item combines Lively metadata with local paths and capability flags that guide the user interface and player.
Wallpaper metadata
LivelyInfoModel in Screenbox.Lively/…/LivelyInfoModel.cs represents the metadata contract in LivelyInfo.json. It identifies the wallpaper, its preview files, its web entry page, its author, and the arguments that declare supported Lively features.
LivelyWallpaperModel adds the local folder and preview path that Screenbox needs. It also records whether the item is a preset, supports music updates, needs audio data, or accepts pause notifications. The selector uses this model as its single item type.
References: Screenbox.Lively/…/LivelyInfoModel.cs• L11-46 Screenbox.Lively/…/LivelyWallpaperModel.cs• L9-18 Screenbox.Lively/…/LivelyWallpaperService.cs• L75-99
Wallpaper types
LivelyWallpaperType in Screenbox.Lively/…/LivelyWallpaperType.cs describes the wallpaper forms known by the Lively format. The integration recognizes local web and web-audio types as local web wallpapers, but its import path further requires the music-now-playing capability.
The helper rules derive capabilities from the type and the metadata arguments. A web-audio type implies audio support. The --system-nowplaying argument enables track updates, while --pause-event true enables pause notifications.
References: Screenbox.Lively/…/LivelyWallpaperType.cs• L7-21 Screenbox.Lively/…/LivelyWallpaperUtil.cs• L11-53
Wallpaper data contracts
The integration uses small data contracts for the messages sent into a wallpaper page. LivelyMusicModel carries track and artwork data. LivelyPlaybackStateModel carries the paused state. LivelyJsonContext defines the supported JSON types for metadata and these runtime messages.
The contracts keep Screenbox media data independent from the wallpaper page. Screenbox maps the current media item into the Lively shape before it calls the page's JavaScript functions.
References: Screenbox.Lively/…/LivelyMusicModel.cs• L10-31 Screenbox.Lively/…/LivelyPlaybackStateModel.cs• L7-10 Screenbox.Lively/…/LivelyJsonContext.cs• L5-10
Selection and playback
The selector chooses the visualizer and the player renders it only for audio media. A saved path links both view models to the same active item and allows the visualizer choice to persist across sessions.
Visualizer selection
LivelyWallpaperSelectorViewModel in Screenbox.Lively/…/LivelyWallpaperSelectorViewModel.cs loads the catalog and adds a default no-wallpaper item. It restores the item that matches the saved active path, stores a new selection in PlayerSettingsContext, and sends a VisualizerChangedMessage so the player page can update its visualizer state.
The selector also owns user actions for importing wallpaper ZIP files, opening a wallpaper folder, and deleting user-installed visualizers. Presets remain available and cannot be deleted.
The following flow shows how a selection reaches the audio player.
flowchart LR
A[Wallpaper selector] -->|save active path| B[Player settings]
A -->|send selected path| C[Visualizer changed message]
C --> D[Player page]
D -->|audio item and active path| E[Web wallpaper player]
References: Screenbox.Lively/…/LivelyWallpaperSelectorViewModel.cs• L25-34 Screenbox.Lively/…/LivelyWallpaperSelectorViewModel.cs• L62-91 Screenbox.Lively/…/LivelyWallpaperSelectorViewModel.cs• L108-156 Screenbox.Core/…/VisualizerChangedMessage.cs• L6-24
Web wallpaper player
LivelyWallpaperPlayerViewModel in Screenbox.Lively/…/LivelyWallpaperPlayerViewModel.cs resolves the saved visualizer and current queue item. It loads the wallpaper's local HTML entry page and exchanges data with that page through the Lively JavaScript interface.
The player surface is Screenbox/…/LivelyWebWallpaperPlayer.xaml.cs. It creates and closes the WebView with the control lifetime, tracks navigation, and refreshes the page when the selected visualizer changes. The surface mutes wallpaper audio because Screenbox remains the source of playback sound.
References: Screenbox.Lively/…/LivelyWallpaperPlayerViewModel.cs• L29-79 Screenbox.Lively/…/LivelyWallpaperPlayerViewModel.cs• L94-122 Screenbox/…/LivelyWebWallpaperPlayer.xaml.cs• L17-66 Screenbox/…/LivelyWebWallpaperPlayer.xaml.cs• L88-142
Media state updates
When the current queue item or its title or artist changes, the player asks a music-enabled wallpaper to refresh its track data. If artwork exists, Screenbox includes it as base64 data so the local page can display it without a separate media request.
When the visualizer declares pause-event support, the player sends a pause state when the visualizer becomes hidden or visible. This lets the wallpaper stop or resume work with the player surface rather than treating visibility as a new media session.
The player also reads LivelyProperties.json after navigation. It sends supported saved property values to the page, while page-only controls such as buttons and labels remain under the wallpaper's own control.
References: Screenbox.Lively/…/LivelyWallpaperPlayerViewModel.cs• L124-220 Screenbox.Lively/…/LivelyWallpaperPlayerViewModel.cs• L222-259 Screenbox/…/LivelyWebWallpaperPlayer.xaml.cs• L159-205 Screenbox/Assets/Visualizers/Music Tunnel/LivelyProperties.json#L1-L54
Application connection
The extension is registered with the application service container and shares the core player settings and message bus. The core player shows the visualizer for an audio item only when an active wallpaper path exists.
Service registration
AddLivelyWallpaperServices registers the wallpaper service and both view models. The application calls this registration during startup, so the selector and player controls can request their view models through the shared service provider.
References: Screenbox.Lively/LivelyWallpaperServiceExtensions.cs• L11-27 Screenbox/App.xaml.cs• L129-135 Screenbox/…/LivelyWallpaperSelector.xaml.cs• L12-27 Screenbox/…/LivelyWebWallpaperPlayer.xaml.cs• L17-45
Audio player visibility
The core PlayerPageViewModel treats a selected visualizer as an audio-only player feature. It listens for visualizer changes and shows the visualizer when the current item is audio and the selected path is not empty.
References: Screenbox.Core/…/PlayerPageViewModel.cs• L160-180 Screenbox.Core/…/PlayerPageViewModel.cs• L803-808 Screenbox.Core/…/PlayerSettingsContext.cs• L134-138
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the accepted wallpaper types and capability flags aligned with the Lively metadata arguments used by imported and packaged visualizers.
- Keep the saved active path contract aligned between
PlayerSettingsContext,VisualizerChangedMessage, the selector, and the player visibility rule. - Keep names and payload shapes for the Lively JavaScript callbacks aligned with the wallpaper page contract.
- Keep model changes covered by
LivelyJsonContextwhen they are serialized across the WebView boundary.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A wallpaper archive has no valid LivelyInfo.json | Screenbox cannot catalog or install the wallpaper | Metadata parsing rejects the item and returns no model |
| An imported wallpaper is not a local music-enabled web wallpaper | The wallpaper is not installed | The import path checks type and --system-nowplaying support |
| The saved active path no longer points to an available visualizer | The player has no source to load | Startup selection falls back to the default item |
| A wallpaper lacks the pause-event argument | It does not receive pause updates | Pause messages are sent only when the model declares support |
| The visualizer WebView is hidden or suspended | Track updates can be delayed or skipped | Updates are gated by visibility and WebView state |
Key files
| File | Why to read it |
|---|---|
| Screenbox.Lively/…/LivelyWallpaperService.cs | Catalogs packaged and user visualizers and imports supported wallpaper archives |
| Screenbox.Lively/…/LivelyWallpaperSelectorViewModel.cs | Coordinates selection, persistence, import, and removal |
| Screenbox.Lively/…/LivelyWallpaperPlayerViewModel.cs | Connects Screenbox queue and media state to the Lively page contract |
| Screenbox/…/LivelyWebWallpaperPlayer.xaml.cs | Hosts the local wallpaper page and manages its WebView lifetime |
| Screenbox.Lively/…/LivelyInfoModel.cs | Defines the Lively package metadata understood by Screenbox |
| Screenbox.Lively/…/LivelyWallpaperUtil.cs | Defines wallpaper type and capability checks |
| Screenbox.Core/…/PlayerPageViewModel.cs | Determines when the visualizer is shown for audio playback |
Screenbox/Assets/Visualizers/Music Tunnel/LivelyInfo.json | Shows the metadata and capability flags of the packaged visualizer |