<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[sknob&#x2F;music v5.3.1 Release Notes, mediaSession Edition!]]></title><description><![CDATA[<p><a href="/sknob/tag:blogpost" rel="nofollow"><span>#</span><span>blogpost</span></a> <a href="/sknob/tag:music" rel="nofollow"><span>#</span><span>music</span></a> <a href="/sknob/tag:coding" rel="nofollow"><span>#</span><span>coding</span></a></p>

<p>So, thanks to <a href="https://noblogo.org/@/limebar@mastodon.social" rel="nofollow">@<span>limebar@mastodon.social</span></a> and <a href="https://noblogo.org/@/scy@chaos.social" rel="nofollow">@<span>scy@chaos.social</span></a> who implemented this feature for <a href="https://theindiebeat.fm" rel="nofollow">TIBR</a> and <a href="https://tv.theindiebeat.fm" rel="nofollow">TIBtv</a>, I discovered how to send metadata to the system media player when you play my music on my site (using the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Media_Session_API" rel="nofollow">Media Session API</a>).</p>

<p>What this means is that you can now see the title, artist and artwork in your system player when you play a song on <a href="https://sknob.fr/music" rel="nofollow">sknob.fr/music</a>.</p>

<p>It could have ended there, but that’s when things got out of hand...

In the following image, you’ll notice you can’t skip to the previous or next track.</p>

<p><img src="https://sknob.fr/img/blog/player_01.jpg" alt="Screen capture of the full-screen music player on an old version of iOS which shows the song title, artist and cover image currently playing (in this case, Ukulele Bonk)" /></p>

<p>But it turns out you can handle these actions with the mediaSession API, provided you have your own functions to do the actual work.</p>

<p>This revealed a different paradigm between what I had implemented on the site, and how a system media player works.</p>
<ul><li>On my site, you could keep skipping tracks, including the last track of an album.</li>
<li>Whereas the mediaSession API sensibly assumes you have “go to the previous/next track” buttons, and if you are on the first or the last track of a playlist, well you can’t go back or forward, respectively.</li></ul>

<p>Which means that in the end, I had to:</p>
<ul><li>Rethink my “skip” function as a “next track” function</li>
<li>Write a “previous track” function</li>
<li>Add a “previous track” button to my weird UI (and to my keyboard shortcuts (available in “about”)</li>
<li>Grey out and deactivate the previous and next buttons in my weird UI when there is no previous or next track (which is what took me the longest to figure out; funny how it’s often the simple things that trip you up)</li>
<li>Add the appropriate calls in the mediaSession function to go to the previous/next track, including code to grey out the previous/next buttons in the system player when there is no previous or next track</li>
<li>This all seemed to work everywhere it was supposed to, until I noticed that the play/pause button was disabled in the media player on my old iPhone 7! So I had to add the appropriate calls in the mediaSession function to call my play/pause function.</li></ul>

<p>Phew... I told you things got out of hand! All this probably deserves more than a 0.0.1 version bump...</p>

<p>Hopefully, it’s all sorted out now. But before you complain, according to the spec, this is supported pretty much everywhere <em>except</em> in the Android WebView!</p>

<p>Media player on the Mac:
<img src="https://sknob.fr/img/blog/player_02.png" alt="Mosaic of the Mac system player, showing the 4 tracks of my Cities EP with previous &amp; next buttons, which are grayed out for the first and last track.)" /></p>

<p>Greyed-out buttons in my UI and in the iPhone 7 media player:</p>

<p><img src="https://sknob.fr/img/blog/player_03.jpg" alt="Mosaic of the same album in my UI, with the grayed out previous and next buttons, successively, plus a capture of the system media player on my old iPhone 7 showing the last track of the album, with a greyed out next button." /></p>

<p><span> </span>
Elsewhere: <a href="https://sknob.fr/music" rel="nofollow">Music</a> | <a href="https://makertube.net/a/sknob/video-channels" rel="nofollow">Videos</a> | <a href="/user/sknob%40mamot.fr" rel="nofollow">Mastodon</a></p>]]></description><link>https://forum.fedi.dk/topic/57b0ede9-2a1c-4385-8729-9763b69287b7/sknob-music-v5.3.1-release-notes-mediasession-edition</link><generator>RSS for Node</generator><lastBuildDate>Mon, 31 Aug 2026 09:39:08 GMT</lastBuildDate><atom:link href="https://forum.fedi.dk/topic/57b0ede9-2a1c-4385-8729-9763b69287b7.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 11 Mar 2026 15:05:53 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to sknob&#x2F;music v5.3.1 Release Notes, mediaSession Edition! on Sat, 15 Aug 2026 09:07:52 GMT]]></title><description><![CDATA[<p><span><a href="https://noblogo.org/sknob/">@<span>sknob</span></a></span> <span><a href="/user/limebar%40mastodon.social">@<span>limebar</span></a></span> <span><a href="/user/scy%40chaos.social">@<span>scy</span></a></span> Compatible mediaplayer for linux? <br />I tried with haruna (<a href="https://expressional.social/tags/KDE" rel="tag">#<span>KDE</span></a> media player), as Elisa (KDE mucic player) does not open URLs.</p>]]></description><link>https://forum.fedi.dk/post/https://expressional.social/users/anderslund/statuses/117098733411341866</link><guid isPermaLink="true">https://forum.fedi.dk/post/https://expressional.social/users/anderslund/statuses/117098733411341866</guid><dc:creator><![CDATA[anderslund@expressional.social]]></dc:creator><pubDate>Sat, 15 Aug 2026 09:07:52 GMT</pubDate></item></channel></rss>