e-Learning
w
document.addEventListener("DOMContentLoaded", function() {
var stream_url = https://mediacp.jb-radio.net:8001/flac
try {
var url = stream_url + "/metadata";
var eventSource = new EventSource(url);
eventSource.onmessage = function(event) {
var metadata = JSON.parse(event.data);
var artistTitle = metadata['metadata'];
//Print the new metadata to the console.
console.log(artistTitle);
}
} catch (error) {
console.log("EventSource initialization failed");
console.log(error);
}
});
Subscribe to:
Posts (Atom)