An easy way to have a 24/7 audio stream of music.

Compare changes

Choose any two refs to compare.

+1
.env.example
···
ICECAST_RELAY_PASSWORD=APasswordForRelaysIGuess
ICECAST_HOSTNAME=localhost
ICECAST_MAX_SOURCES=1
+
ICECAST_CHARSET=UTF-8
STREAM_NAME=Radio
STREAM_DESC=Our selection of music
STREAM_URL=https://google.com
+2 -2
docker-compose.yml
···
services:
icecast:
image: docker.io/mkody/icecast:latest
-
restart: always
+
restart: unless-stopped
ports:
- "${ICECAST_PORT:-8000}:8000"
environment:
···
liquidsoap:
image: docker.io/savonet/liquidsoap:v2.2.2
-
restart: always
+
restart: unless-stopped
command: ["/script.liq"]
environment:
- ICECAST_SOURCE_PASSWORD
+5
style-status.css
···
margin-right: 0;
}
+
.audiooplayer .plyr__controls .plyr__controls__item.plyr__time {
+
flex-grow: 1;
+
text-align: left;
+
}
+
#footer {
border-top: 1px groove #ACACAC;
font-size: 80%;
+12 -14
status.xsl
···
let lastTitle = ''
// Store the current mount point
let currentMount = ''
-
// Store the last notification
-
let lastNotification = null
// On every audio element, create a new Plyr instance
document.querySelectorAll('div[data-mount]').forEach((e) => {
···
// If we have permission, send a notification
if ('Notification' in window && Notification.permission === 'granted') {
-
lastNotification = new Notification(
+
const lastNotification = new Notification(
'RRM - Now Playing',
{
body: j.icestats.source.title,
icon: 'https://rita.moe/rita-icon.png',
renotify: true,
-
requireInteraction: false,
+
requireInteraction: true,
+
silent: true,
tag: 'now-playing',
}
)
+
+
// Close the notification after 10 seconds, as renotify
+
// isn't working perfectly when the track changes
+
setTimeout(
+
(_) => {
+
lastNotification.close()
+
},
+
10000
+
)
}
}
} else {
···
if ('Notification' in window && Notification.permission === 'default') {
Notification.requestPermission()
}
-
-
document.addEventListener(
-
'visibilitychange',
-
() => {
-
// If the page is visible, close the last notification
-
if (document.visibilityState === 'visible') {
-
lastNotification?.close()
-
}
-
}
-
)
]]>
</script>
</body>