Skip to content

YouTube Music adapter broken: playerApi replaced by async resolvePlayerApi() #59

Description

@Skaut0071

Extension version: 3.1.0
Browser: Opera (Chromium-based)
Site: music.youtube.com

Problem
The built-in "YouTube Music" adapter no longer detects playback. Media info never registers with external adapters (tested with Macro Deck 2), while other sites (YouTube, Jellyfin, etc.) work fine and the WNP <-> adapter connection itself is confirmed working.

Root cause
The adapter's Be() helper reads:

document.querySelector("ytmusic-player-bar")?.playerApi

This property no longer exists on the element. Checked via console:

document.querySelector("ytmusic-player-bar").playerApi
// undefined

YouTube Music appears to have replaced it with a method:

document.querySelector("ytmusic-player-bar").resolvePlayerApi()
// returns Promise<PlayerApi>, not a synchronous value

Because Be() (and therefore ready(), getCurrentTime(), etc.) is written as synchronous, the whole adapter silently fails:

window._wnp["YouTubeMusic"].ready()
// undefined

Meanwhile the actual player element still works fine:

document.querySelector("#movie_player")
// <div class="html5-video-player ...">

and navigator.mediaSession.metadata / navigator.mediaSession.playbackState are populated correctly, confirming this is purely a stale-selector issue, not a page-detection or extension-permission problem.

Happy to test a fix or provide more console output if needed.
AI helped me to find whats wrong so it could be wrong too.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions