https://bugs.kde.org/show_bug.cgi?id=526146
Bug ID: 526146
Summary: MPRIS player remains 'Playing' with stale metadata
after closing the media tab
Classification: Plasma
Product: plasma-browser-integration
Version First unspecified
Reported In:
Platform: CachyOS
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: Chrome
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
DESCRIPTION
Closing a tab that plays media can leave the MPRIS player exported by
plasma-browser-integration registered on the session bus, still reporting
PlaybackStatus=Playing with the closed tab's title/URL and a frozen position,
until something else touches it. Clients (Plasma's media controls, "now
playing"
displays, KDE Connect) keep showing/controlling the closed tab.
STEPS TO REPRODUCE
1. Open https://kmit.in/ in Brave (Chromium). The homepage embeds a muted,
autoplaying, looping YouTube video (iframe) (can open any other site which
has similar iframe youtube videos) :
https://www.youtube.com/embed/gM4bHG7jF0U?controls=0&showinfo=0&rel=0&autoplay=1&mute=1&loop=1&playlist=gM4bHG7jF0U
(video title: "Keshav Memorial Institute of Technology | Campus Tour").
Let it play for a few seconds; the media controls now show that title.
2. Close ONLY that tab and keep the browser running.
3. Immediately check the bus (within seconds):
$ playerctl -l
plasma-browser-integration
$ playerctl -p plasma-browser-integration status
Playing
$ playerctl -p plasma-browser-integration metadata --format '{{title}} |
{{artist}}'
Keshav Memorial Institute of Technology | Campus Tour | Keshav Memorial
Institute of Technology
$ playerctl -p plasma-browser-integration position # two reads, 27 s
apart
7.845830
7.845831
(no progress while "Playing"; real playback advances millions of us/second)
Raw metadata still reports xesam:url = https://kmit.in/, mpris:length =
144821000; Rate 1, Volume 0,
CanSeek/CanPlay/CanPause/CanGoNext/CanGoPrevious
all true - the player looks fully live although the tab is gone.
4. Sending any command to the stale player clears it within seconds:
$ playerctl -p plasma-browser-integration play-pause
$ playerctl -l
No players found
(this is the failed chrome.tabs.sendMessage path in extension-mpris.js
signalling "player gone"; the tab is already gone at this point)
OBSERVED RESULT
The MPRIS name org.mpris.MediaPlayer2.plasma-browser-integration stays exported
(owner: plasma-browser-integration-host, e.g. PID 15028 in one capture) and
keeps answering PlaybackStatus=Playing with the closed tab's metadata and a
frozen Position. Observed twice on 2026-09-21 (local time, IST):
- 15:21:55 registered while the tab was open; still "Playing" at 15:22:41,
cleared only when a command was sent (the tab had been closed in between).
- ~12:39:58 registered; still "Playing" at 12:43:46, cleared only when a
command
was sent.
The stale state can also disappear on its own after a few minutes, or when
another media session starts/stops (it once disappeared after I opened and
closed a YouTube tab), so it has to be observed right after closing the tab -
but it is easy to trigger with this page.
EXPECTED RESULT
Closing the tab should remove the player from MPRIS (or set PlaybackStatus to
Stopped) promptly, like the already-fixed case where the tab process is killed
(bug 419699).
SOFTWARE/OS VERSIONS
Operating System :CachyOS (Arch-based), kernel 7.2.6-1-cachyos
KDE Plasma Version: 6.7.5 (Wayland, KWin 6.7.5)
KDE Frameworks Version: 6.30.0
Qt Version: 6.11.2
plasma-browser-integration: 6.7.5-1.1 (host:
/usr/bin/plasma-browser-integration-host)
Browser: Brave 1.95.104 (Chromium 153); Plasma Integration extension 2.2
ADDITIONAL INFORMATION
- The extension already has a handler that should cover this:
chrome.tabs.onRemoved -> playerTabGone(tabId) (extension/extension-mpris.js
lines 282-285 and 74-81). It removes all player ids of that tab; the "gone"
message is sent to the host only when the player list becomes empty
(extension-mpris.js lines 117-127). The bookkeeping (playerIds, line 20) is
an
in-memory array in the MV3 service worker and is not persisted anywhere
(no chrome.storage usage in the file). I can only observe the host side, so I
cannot say which step failed; possibilities are that the onRemoved handler
ran
against bookkeeping that no longer contained the entry, or that another entry
kept the list non-empty, so no "gone" was sent. Not verified.
- The video plays inside an iframe (content scripts run with all_frames: true),
so the player id is "<tabId>-<frameId>" and xesam:url is the top-level page.
At the time, playerctl -l listed only this one player.
- The crash heuristic cannot help here: it requires an audible -> inaudible
transition (extension-mpris.js lines 287-315), and this embed autoplays
muted.
- Related reports:
412572 - "After exiting a multimedia tab, mpris still shows the multimedia as
running" (2019, WORKSFORME - the reporter could not reproduce again;
it asked for qdbus output before/after closing the tab)
419699 - media still reported as playing when the process behind the tab is
killed; FIXED 2020 (origin of the failed-command heuristic)
480731 - YouTube hover previews keep being reported as playing (open,
CONFIRMED) - same "state not cleared" family, different trigger
489358 - YouTube Music progress bar not reset (open, ASSIGNED)
- The installed extension (2.2) matches the 6.7.5 sources; current master of
extension-mpris.js differs only by the unrelated artwork fix b5f3bb0 (line
436),
so the tab-close handling is unchanged upstream.
- Downstream impact: this is what keeps e.g. the plasmusic-toolbar widget
visible
after the tab is closed (ccatterina/plasmusic-toolbar#294, where this was
first
diagnosed). A widget-side workaround would have to guess (e.g. treat a frozen
Position as stale), which is unreliable, so it was left alone and reported
here
instead.
- I reproduced this on Chromium (Brave); I have not tested Firefox.
--
You are receiving this mail because:
You are watching all bug changes.