Description
This issue respects the following points:
- This issue is not already reported on GitHub (I've searched it).
- I agree to follow Jellyfin's Code of Conduct.
- This report addresses only a single issue; If you encounter multiple issues, kindly create separate reports for each one.
Describe the bug
When playing back music, I'm able to play/pause using my keyboard media Play/Pause button, but for some reason the next track / previous track buttons often do not work when I navigate to a playlist or album before playing it.
The Play/pause button always works for me, only the forward/back buttons are inconsistent depending on whether I navigated before playing (broken) or landed on a page and started playing without navigating (works fine).
Reproduction Steps
- Load jellyfin in Firefox
- Navigate to a playlist or album
- Click on the first song
- Press media key next track (doesn't work)
- Press media key play/pause (works)
For some reason, this DOES work:
- Load direct url of a specific album / playlist
- Click on the first song
- Press media key next - works fine
Also interestingly, this also DOES work:
- Load home page url
- Click play on album on homescreen without navigating
- Use next track media key - works fine
As well as:
- Load direct URL of playlists page
- Click play on playlist without navigating to playlist
- Use next track media key - works fine
Expected/Actual behaviour
It should go to next/previous song
Logs
No relevant logs are generated
Server version
10.10.6
Web version
10.10.6
Build version
10.10.6
Platform
Ubuntu 24.04.1 LTS with Docker
Browser
Firefox
Additional information
I investigated the event listener at
And overrode the main jellyfin bundle to add a console.log at the beginning of the event listener and noticed that it prints when Ctrl / Alt is pressed but not any of the media keys, which makes sense because it bails if hasMediaSession
anyways. I have mediaSession
in my navigator so I assume the media keys are handled through another code path which is causing the issue.
So in summary, it seems like the act of navigating to a playlist or album causes the prev/next media keys to stop working, but curiously the play/pause keeps working. If I play anything directly after landing on the page without navigating (by loading the direct URL of an album, playlist, or page that lets you play either without navigating eg home/playlists), the issue is also avoided.