Skip to content

Bug: Media keys ignored when other apps register SMTC (Proof of Concept Fix Included) #84

Description

@harshmishra312

Describing the bug
On Windows 10/11, Stremio relies purely on WM_APPCOMMAND messages to intercept hardware media keys. Because the app does not register a SystemMediaTransportControls (SMTC) session, modern apps (like Chrome, Edge, Spotify) that do register SMTC will completely hijack media keys. Windows prioritizes SMTC and stops broadcasting the legacy WM_APPCOMMAND messages to background apps, leaving Stremio starved of media key inputs.

Proposed Fix (Proof of Concept)
I've attached a .patch file that integrates the souvlaki crate into app.rs.
It registers an SMTC session tied to the window handle, synchronizes mpv-prop-change (pause/play) and mpv-event-ended states with the OS, and routes SMTC events back to the web UI using the existing web_tx channel.

Note: I do not have a Rust environment to compile and test this locally, so it is provided as an untested proof-of-concept/starting point for the team to evaluate.

stremio_smtc_fix.patch

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions