setting navigator.mediaSession.metadata on iOS using icecast-metadata-player isn't working. Setting this property provides metadata to the OS to allow iOS to display a user control interface in iOS on the lock screen when a feed is streaming. I'm not dynamically (yet) trying to update this metadata from the stream itself, just setting it when the audio player loads. It works in normal audio tag scenarios fine but not when using icecast-metadata-player
See: https://developer.mozilla.org/en-US/docs/Web/API/MediaSession/metadata
if ("mediaSession" in navigator) {
console.log("Set Metadata...");
navigator.mediaSession.metadata = new MediaMetadata({
title: "Test Feed",
artist: "Broadcastify",
album: "Broadcastify Live Audio Feeds",
artwork: [
{
src: "https://s.broadcastify.com/pwa/ios/128.png",
sizes: "128x128",
type: "image/png",
},
{
src: "https://s.broadcastify.com/pwa/ios/192.png",
sizes: "192x192",
type: "image/png",
},
{
src: "https://s.broadcastify.com/pwa/ios/256.png",
sizes: "256x256",
type: "image/png",
},
{
src: "https://s.broadcastify.com/pwa/ios/512.png",
sizes: "512x512",
type: "image/png",
},
],
});
}
setting navigator.mediaSession.metadata on iOS using icecast-metadata-player isn't working. Setting this property provides metadata to the OS to allow iOS to display a user control interface in iOS on the lock screen when a feed is streaming. I'm not dynamically (yet) trying to update this metadata from the stream itself, just setting it when the audio player loads. It works in normal audio tag scenarios fine but not when using icecast-metadata-player
See: https://developer.mozilla.org/en-US/docs/Web/API/MediaSession/metadata