const defaultBackground = 'https://s1.directupload.eu/images/user/260104/9dbp5y66.jpg';
const djBackgrounds = {
'OTO':' https://s1.directupload.eu/images/user/250418/pjknl99d.jpg',
'SERDAR':'https://s1.directupload.eu/images/user/251007/ai79sdp8.jpg',
'BABACAN':'https://s1.directupload.eu/images/user/251007/ikc9ak9r.jpg',
'B A B A C A N':'https://s1.directupload.eu/images/user/250313/l78e8yk2.jpg ',
'BLUE':'https://s1.directupload.eu/images/user/251007/jgif6dq2.jpg',
'SELMA':'https://s1.directupload.eu/images/user/260504/ei8nub9y.jpg',
};
let lastDJ = "";
function updateBackground() {
const streamInfoElement = document.querySelector('.cc_streaminfo');
if (streamInfoElement) {
const currentDJ = streamInfoElement.textContent.trim().toUpperCase();
if (currentDJ !== lastDJ) {
lastDJ = currentDJ;
let backgroundImage = defaultBackground;
for (let key in djBackgrounds) {
if (currentDJ.includes(key)) {
backgroundImage = djBackgrounds[key];
break;
}
}
const iframeContainer = document.getElementById('iframe-container');
if (iframeContainer) {
iframeContainer.style.backgroundImage = `url('${backgroundImage}')`;
iframeContainer.style.backgroundSize = "cover";
}
}
}
}
function loadStreamInfo() {
const script = document.createElement('script');
script.src = 'https://eu1.fastcast4u.com/system/streaminfo.js?t=' + new Date().getTime();
script.onload = updateBackground;
document.body.appendChild(script);
}
loadStreamInfo();
setInterval(loadStreamInfo, 5000);