diff --git a/web/components/TitleNotifier/TitleNotifier.tsx b/web/components/TitleNotifier/TitleNotifier.tsx index a6f3dce62..e69c7fad0 100644 --- a/web/components/TitleNotifier/TitleNotifier.tsx +++ b/web/components/TitleNotifier/TitleNotifier.tsx @@ -21,7 +21,7 @@ export const TitleNotifier: FC = ({ name }) => { const [backgrounded, setBackgrounded] = useState(false); const [title, setTitle] = useState(name); - const { online } = serverStatus; + const { online, streamTitle } = serverStatus; const onBlur = () => { setBackgrounded(true); @@ -66,6 +66,17 @@ export const TitleNotifier: FC = ({ name }) => { setTitle(`💬 :: ${name}`); }, [chatMessages, name]); + useEffect(() => { + if (navigator.mediaSession === undefined) { + return; + } + navigator.mediaSession.metadata = new MediaMetadata({ + title: streamTitle, + artist: name, + artwork: [{ src: '/logo' }], + }); + }, [name, streamTitle]); + useEffect(() => { if (!backgrounded) { return;