From 9ce5686c40c8d3c2a6a335b11dfd89346dee84aa Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Thu, 12 Nov 2026 07:56:48 +0100 Subject: [PATCH] Correct MPC navigation IDs and document cueing limitation --- .../media-player-classic/README.md | 23 +++++++++++++++---- .../media-player-classic/companion/HELP.md | 4 +++- .../media-player-classic/src/commands.js | 10 ++++---- .../media-player-classic/src/definitions.js | 4 ++-- .../media-player-classic/test/state.test.js | 2 +- 5 files changed, 30 insertions(+), 13 deletions(-) diff --git a/companion-modules/media-player-classic/README.md b/companion-modules/media-player-classic/README.md index 7d91198..1b5a53d 100644 --- a/companion-modules/media-player-classic/README.md +++ b/companion-modules/media-player-classic/README.md @@ -57,10 +57,12 @@ spare page. These presets already include their feedback and variable references | Elapsed | Live elapsed media time and progress bar | | Playback state | Playing, paused, stopped, idle, or offline with matching colors | -The Previous/Next transport presets swap command IDs (Previous → `919`, Next → -`918`) to compensate for reversed navigation observed on this player. Original -numeric actions remain unchanged. Re-add copied presets to existing buttons -to apply this correction; linked presets follow the module update. +The Previous/Next transport presets use command IDs verified against this +player's `/commands.json`: Previous → `919`, Next → `920`. The old catalog was +outdated: `918` is **After Playback: Turn off the monitor**, not navigation. +Navigation-related labels are corrected; numeric action IDs still send their +same numeric commands. Re-add copied presets to existing buttons to apply +this correction; linked presets follow the module update. The progress bar fills from left to right. It turns amber with 10 seconds left and red with 5 seconds left. Timing displays are passive: pressing them does @@ -86,6 +88,19 @@ with the player, follows seeks, and does not predict wall-clock completion at nonstandard playback speeds. Playback state is MPC's reported state, not proof that frames or audio are physically reaching an output device. +## Loading the next item without playback + +The current MPC-HC web API cannot reliably cue the next playlist item in the +player without starting it. Both Next File and the playlist-index command open +the selected item through MPC-HC's normal autoplay path; neither exposes an +open-paused option. Sending Next followed by Stop can briefly play audio/video, +so this module does not offer that sequence as a safe cue preset. + +To load the next file in MPC-HC itself and keep it at the beginning until Play, +MPC-HC needs an open-paused playlist-selection API, or an additional helper on +the Windows player computer. Selecting a future item only inside Companion +would not preload it in MPC-HC and is not implemented here. + ## Variables and custom feedback These are connection/module variables, not button-local variables. With the diff --git a/companion-modules/media-player-classic/companion/HELP.md b/companion-modules/media-player-classic/companion/HELP.md index 4330226..63f0b01 100644 --- a/companion-modules/media-player-classic/companion/HELP.md +++ b/companion-modules/media-player-classic/companion/HELP.md @@ -10,7 +10,9 @@ Choose **Transport & timing** in this connection's Presets: - **Play**: green while playing; amber while paused. Press to play/resume. - **Stop**: red while stopped. -- **Previous / Next**: navigate playlist items. +- **Previous / Next**: navigate playlist items (verified command IDs 919/920). + These load and start playback; the web API has no reliable open-next-paused + command. A Next-then-Stop sequence can briefly play and is not offered as cueing. - **Mute**: red **MUTED** when the player mute switch is on. - **Pause**: amber while paused. - **Remaining / Elapsed**: live time with a progress bar (passive displays). diff --git a/companion-modules/media-player-classic/src/commands.js b/companion-modules/media-player-classic/src/commands.js index 6bb8efb..27292ef 100644 --- a/companion-modules/media-player-classic/src/commands.js +++ b/companion-modules/media-player-classic/src/commands.js @@ -84,11 +84,11 @@ export const commands = { 907: 'Volume Up', 908: 'Volume Down', 909: 'Volume Mute', - 918: 'Previous Playlist Item', - 919: 'Next Playlist Item', - 920: 'Previous', - 921: 'Next', - 922: 'DVD Title Menu', + 918: 'After Playback: Turn off the monitor', + 919: 'Previous Playlist Item', + 920: 'Next Playlist Item', + 921: 'Previous (chapter/file)', + 922: 'Next (chapter/file)', 923: 'DVD Root Menu', 924: 'DVD Subtitle Menu', 925: 'DVD Audio Menu', diff --git a/companion-modules/media-player-classic/src/definitions.js b/companion-modules/media-player-classic/src/definitions.js index 624be80..0b32ee4 100644 --- a/companion-modules/media-player-classic/src/definitions.js +++ b/companion-modules/media-player-classic/src/definitions.js @@ -51,9 +51,9 @@ export function presets(label = 'MPC_DEV') { active('paused', colors.amber, 'Ⅱ\nPAUSED'), ]), transport_stop: button('Stop — red while stopped', '■\nSTOP', '890', [active('stopped', colors.red)]), - // This player's playlist navigation is reversed; keep legacy numeric actions unchanged. + // Verified against MPC-HC 2.8.5's /commands.json: 918 is an after-playback setting. transport_previous: button('Previous playlist item', '◀◀\nPREV', '919'), - transport_next: button('Next playlist item', '▶▶\nNEXT', '918'), + transport_next: button('Next playlist item', '▶▶\nNEXT', '920'), transport_mute: button('Toggle mute — red while muted', 'MUTE', '909', [active('muted', colors.red, 'MUTED')]), transport_pause: button('Pause — amber while paused', 'Ⅱ\nPAUSE', '888', [active('paused', colors.amber)]), transport_remaining: button('Remaining time and progress', `LEFT\n$(${label}:remaining)`, null, [ diff --git a/companion-modules/media-player-classic/test/state.test.js b/companion-modules/media-player-classic/test/state.test.js index 0a689b8..3e77415 100644 --- a/companion-modules/media-player-classic/test/state.test.js +++ b/companion-modules/media-player-classic/test/state.test.js @@ -56,7 +56,7 @@ test('transport presets use playlist commands and state feedback; time displays ['play', '887'], ['stop', '890'], ['previous', '919'], - ['next', '918'], + ['next', '920'], ['mute', '909'], ]) { assert.equal(buttons[`transport_${preset}`].steps[0].down[0].actionId, command)