Skip to content

fix(youtube-explorer): defer mpv window creation for video - #1561

Open
nullflake wants to merge 1 commit into
noctalia-dev:mainfrom
nullflake:fix/youtube-explorer-wayland
Open

nullflake wants to merge 1 commit into
noctalia-dev:mainfrom
nullflake:fix/youtube-explorer-wayland

Conversation

@nullflake

Copy link
Copy Markdown
Contributor

Plugin

  • Id: nullflake/youtube-explorer
  • New plugin
  • Update to an existing plugin (version bumped in plugin.toml)

What it does

Let mpv create its window when the video loads. Opening an empty window first could trigger a duplicate Wayland color-management surface error when playback started. Audio-only mode still opens a window for playback controls. mpv keeps its default color-space hint behavior.

External dependencies

  • yt-dlp queries YouTube for search results, channel listings and recommendations, and resolves media for playback.
  • mpv plays media from YouTube and its media hosts, saves native resume positions, and exposes a private Unix socket for queue control.
  • python3 runs the bundled search, queue and thumbnail-cache helpers.
  • mkdir creates playback storage directories.
  • noctalia relays queue updates and playback errors to the plugin.

The plugin fetches thumbnails from YouTube image hosts. It stores library data, queue state, progress, playback events, backups, search tickets and cached thumbnails in Noctalia’s plugin data directory. The queue helper uses a private directory under $XDG_RUNTIME_DIR or /tmp for its lock and socket. This update adds no network requests, filesystem writes or spawned processes.

Testing

  • Tested on Niri
  • Tested on Hyprland
  • Tested on Sway
  • Tested on another compositor: Umbriel
  • Noctalia version tested against: 5.6.0
  • Plugin API level: 43

Played the same video from the Noctalia launcher with Max quality set to Auto, then Audio only, then Auto again. All three attempts played successfully. The first video window closed at the end of playback.

Tested with mpv 0.42.0 and libplacebo 7.387.0. Noctalia lint and local package, playback argument, queue and resume tests passed. The automated Unix socket test was skipped because the test environment prohibited socket binding.

Screenshots / Videos

The Noctalia UI is unchanged. Playback and mode switching were verified as described above.

Checklist

  • The directory name matches the part of id after the / in plugin.toml exactly.
  • It ships plugin.toml, README.md, thumbnail.webp, and translations/en.json.
  • README.md follows the
    README template, documents
    every entry id and dependency, and includes exact panel IPC commands and launcher prefixes where applicable.
  • thumbnail.webp is present and relevant; for a new plugin I created it with the thumbnail generator, and for an update I regenerated it with the generator if the visual identity or user-facing appearance changed.
  • version follows semver and is bumped in this PR; plugin_api is the oldest API level this plugin requires.
  • Every non-English translation in this PR uses a locale supported by Noctalia core, and I can read, write, and
    understand that language well enough to review and maintain it (no unreviewed machine/LLM translations).
  • I did not edit catalog.toml; CI generates it.
  • This PR touches exactly one plugin directory.

Code review attestation

  • The code is readable and not obfuscated, minified, or generated.
  • Code identifiers and code comments are in English.
  • It does not download and execute remote code.
  • Every network call, filesystem write, and spawned process is something the description above accounts for.
  • I have the right to publish this code under the license declared in plugin.toml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant