From f388c31ff09fd4b7d4e705bf55f0660c11ad76b2 Mon Sep 17 00:00:00 2001 From: EmreSoyak Date: Wed, 15 Apr 2026 18:58:33 +0300 Subject: [PATCH 1/2] feat: Add virtual desktop, audio-only, playback recovery, and tray hover mini-player Custom feature pack by EmreSoyak: - Virtual Desktop Awareness: Window moves to current virtual desktop instead of yanking you back (Options > Tray toggle) - Audio-Only Plugin: Forces audio-only streaming, saves ~300MB RAM - Playback Recovery Plugin: Auto-recovers from stuck/stalled playback with progressive strategies (seek, seek-forward, skip) - Tray Hover Mini-Player: Hover the tray icon to see album art, song info, and prev/play-pause/next controls - Toast suppression when hover popup is active - Deferred tray event handlers (fixes plugin-before-tray init order) - DevTools gated behind OPEN_DEVTOOLS env var See EMRE-FEATURES.md for full documentation. Co-Authored-By: Claude Opus 4.6 (1M context) --- EMRE-FEATURES.md | 307 +++++++++++++++++++++++ assets/hover-popup.html | 138 ++++++++++ src/config/defaults.ts | 2 + src/i18n/resources/en.json | 13 + src/index.ts | 14 +- src/menu.ts | 13 + src/plugins/audio-only/index.ts | 133 ++++++++++ src/plugins/notifications/hover-popup.ts | 236 +++++++++++++++++ src/plugins/notifications/index.ts | 2 + src/plugins/notifications/interactive.ts | 6 +- src/plugins/notifications/main.ts | 5 + src/plugins/notifications/menu.ts | 9 + src/plugins/playback-recovery/index.ts | 306 ++++++++++++++++++++++ src/tray.ts | 57 ++++- src/window-utils.ts | 12 + 15 files changed, 1245 insertions(+), 8 deletions(-) create mode 100644 EMRE-FEATURES.md create mode 100644 assets/hover-popup.html create mode 100644 src/plugins/audio-only/index.ts create mode 100644 src/plugins/notifications/hover-popup.ts create mode 100644 src/plugins/playback-recovery/index.ts create mode 100644 src/window-utils.ts diff --git a/EMRE-FEATURES.md b/EMRE-FEATURES.md new file mode 100644 index 0000000000..6e1d89b183 --- /dev/null +++ b/EMRE-FEATURES.md @@ -0,0 +1,307 @@ +# Emre's YouTube Music Player - Custom Features + +A collection of custom features and enhancements for [th-ch/youtube-music](https://github.com/th-ch/youtube-music), focused on virtual desktop workflows, memory optimization, playback reliability, and tray UX improvements. + +--- + +## Table of Contents + +1. [Audio-Only Mode](#1-audio-only-mode) (Plugin) +2. [Playback Recovery](#2-playback-recovery) (Plugin) +3. [Virtual Desktop Awareness](#3-virtual-desktop-awareness) (Core setting) +4. [Tray Hover Mini-Player](#4-tray-hover-mini-player) (Notification plugin extension) +5. [DevTools Control](#5-devtools-control) (Core tweak) +6. [Diagnostic Tools](#6-diagnostic-tools) (External scripts) +7. [Build & Launch Scripts](#7-build--launch-scripts) + +--- + +## 1. Audio-Only Mode + +**Type:** Plugin +**Location:** `src/plugins/audio-only/index.ts` +**Toggle:** Settings > Plugins > Audio Only (requires restart) +**Default:** Off + +### What it does + +Forces YouTube Music to stream audio only, eliminating video decoding and buffering entirely. This cuts memory usage by roughly 300+ MB. + +### How it works + +1. Sets `playback-mode="ATV_PREFERRED"` on the `ytmusic-player` element (tells YouTube this is an audio-only device) +2. Calls `moviePlayer.setPlaybackQuality('tiny')` and `setPlaybackQualityRange('tiny')` via the internal player API +3. Hides the `