Keşfet
Bağlan
Video Göstər
POW mahnısını 2026 versiyasında yüksək keyfiyyətli MP3 formatında pulsuz yüklə. Online dinlə və rahat şəkildə telefona və ya kompüterə endir. POW şarkısını 2026 versiyonu ile Blue.az üzerinden yüksek ses kalitesinde MP3 olarak ücretsiz indir. Hem hızlı hem de güvenli indirme deneyimi yaşa. Download POW (2026 version) in high-quality MP3 format for free. Stream online or download to your device from Blue.az. POW mp3 yüklə, yukle, indir
/* =========================================================== BLUE.AZ — Global Player FIX: - PREV: STOP -> neighbors fetch -> prev PLAY (no restart) - NEXT: Random ON => random; Random OFF => real next (neighbors fetch) next tapılmasa => STOP (random atmaz) =========================================================== */ (function(){ // ---------- CSS ---------- const css = ` .gp{position:fixed;left:0;right:0;bottom:0;z-index:2147483000;display:grid; grid-template-columns:64px 1fr auto;grid-template-rows:auto auto auto; gap:12px;align-items:center;padding:10px 14px; background:rgba(3,10,22,.92);backdrop-filter:blur(8px);color:#e6f4ff; font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif; border-top:1px solid rgba(42,168,255,.25)} .gp-cover{grid-column:1;grid-row:1 / span 3;width:56px;height:56px;border-radius:10px;object-fit:cover;background:#0a122a;cursor:pointer} .gp-info{grid-column:2;grid-row:1;min-width:0;cursor:pointer} .gp-title{font-weight:700;font-size:14px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis} .gp-artist{font-size:12px;opacity:.8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px} .gp-time{grid-column:2;grid-row:2;font-size:11px;color:#9dc8ff;margin-top:4px;text-align:left} .gp-ctrls{grid-column:3;grid-row:1 / span 2;display:flex;align-items:center;gap:8px;justify-content:center} .gp-bar{grid-column:2 / span 2;grid-row:3;width:100%;height:8px;background:#163262;border-radius:6px;cursor:pointer;position:relative;box-shadow:inset 0 0 0 1px #1b3c6b} .gp-progress{position:absolute;left:0;top:0;height:100%;width:0;border-radius:6px; background:linear-gradient(90deg,#2aa8ff,#6ad8ff);box-shadow:0 1px 6px #1e9eff66} .gp-btn{height:42px;min-width:42px;border-radius:12px;border:1px solid rgba(42,168,255,.45); background:rgba(255,255,255,.06);color:#cfe6ff;cursor:pointer;display:flex;align-items:center;justify-content:center} .gp-btn:hover{background:rgba(255,255,255,.12);border-color:rgba(42,168,255,.7)} .gp-btn svg{width:24px;height:24px;fill:currentColor;display:block} .gp-btn.play .icon-play{display:inline}.gp-btn.play .icon-pause{display:none} .gp-btn.play.is-playing .icon-play{display:none}.gp-btn.play.is-playing .icon-pause{display:inline} .gp-btn.toggle.active{border-color:rgba(46,224,197,.9);color:#2ee0c5;background:rgba(46,224,197,.1); box-shadow:0 0 0 1px rgba(46,224,197,.35) inset} .gp-vol{width:120px} #gpRateTxt{font-weight:600} @media (max-width:768px){ .gp{grid-template-columns:48px 1fr;grid-template-rows:auto auto auto;gap:6px; padding:8px 10px;} .gp-cover{width:44px;height:44px;grid-row:1 / span 3} .gp-info{display:none} .gp-time{grid-column:2;grid-row:1;text-align:center;font-size:12px;margin-top:0} .gp-ctrls{grid-column:2;grid-row:2;justify-content:center;gap:8px} .gp-bar{grid-column:1 / span 2;grid-row:3;height:6px} .gp-vol{display:none} .gp-btn{min-width:38px;height:38px;border-radius:10px} .gp-btn svg{width:20px;height:20px} }`; if (!document.getElementById('gpStyle')) { const st = document.createElement('style'); st.id = 'gpStyle'; st.textContent = css; document.head.appendChild(st); } // ---------- HTML ---------- if (!document.getElementById('globalPlayer')) { const root = document.createElement('div'); root.id = 'globalPlayer'; root.className = 'gp'; root.innerHTML = `
Player hazırdır
Mahnı seç
00:00 / 00:00
`; document.body.appendChild(root); } // ---------- Selectors ---------- const $ = s => document.querySelector(s); const gp = { info:$('#gpInfo'), cover:$('#gpCover'), title:$('#gpTitle'), artist:$('#gpArtist'), bar:$('#gpBar'), progress:$('#gpProgress'), time:$('#gpTime'), prev:$('#gpPrev'), play:$('#gpPlay'), next:$('#gpNext'), random:$('#gpRandom'), volume:$('#gpVolume'), download:$('#gpDownload'), loopBtn:$('#gpLoop'), mute: $('#gpMute'), rateBtn: $('#gpRate'), rateTxt: $('#gpRateTxt') }; // ---------- Audio ---------- const audio = new Audio(); audio.preload = 'metadata'; audio.crossOrigin = 'anonymous'; window.audioPlayerMain = audio; let current = null; // aktiv track meta let pendingSrc = null; // yalnız PLAY zamanı qoşulacaq src // ---------- Loop persist ---------- let isLoop = false; try { isLoop = localStorage.getItem('gpLoop') === '1'; } catch(_){} function applyLoopUI(){ gp.loopBtn?.classList.toggle('active', isLoop); gp.loopBtn?.classList.add('toggle'); gp.loopBtn?.setAttribute('aria-label', isLoop ? 'Təkrar: açıq' : 'Təkrar: bağlı'); if (gp.loopBtn) gp.loopBtn.title = isLoop ? 'Təkrar: açıq' : 'Təkrar: bağlı'; } function setLoop(v){ isLoop = !!v; audio.loop = isLoop; applyLoopUI(); try { localStorage.setItem('gpLoop', isLoop ? '1' : '0'); } catch(_){} } setLoop(isLoop); // ---------- Random persist ---------- let isRandom = false; try { isRandom = localStorage.getItem('gpRandom') === '1'; } catch(_){} function applyRandomUI(){ if (!gp.random) return; gp.random.classList.add('toggle'); gp.random.classList.toggle('active', isRandom); gp.random.setAttribute('aria-label', isRandom ? 'Random: açıq' : 'Random: bağlı'); gp.random.title = isRandom ? 'Random: açıq' : 'Random: bağlı'; } function setRandom(v){ isRandom = !!v; applyRandomUI(); try { localStorage.setItem('gpRandom', isRandom ? '1' : '0'); } catch(_){} } setRandom(isRandom); // ---------- Queue ---------- const queue = []; function queueAdd(meta){ if (meta && (meta.src||meta.stream||meta.audioUrl)) queue.push(meta); } function queueNext(){ if (queue.length) { const m = queue.shift(); loadAndPlay(m, true); return true; } return false; } // ---------- Anti-repeat helpers ---------- function getTrackId(meta){ if (!meta) return null; if (meta.id != null) return String(meta.id); if (meta.slug) return 'slug:'+meta.slug; const s = meta.src || meta.stream || meta.audioUrl; if (s){ let h=0; for (let i=0;i= 0) recentIds.splice(ix,1); recentIds.push(id); while (recentIds.length > RECENT_LIMIT) recentIds.shift(); } function getExcludeParam(){ return recentIds.join(','); } // ---------- UI helpers ---------- const fmt = s => { s = Math.max(0, Math.floor(s||0)); const m = Math.floor(s/60), x = s%60; return (m<10?'0':'')+m+':' + (x<10?'0':'')+x; }; const fallbackDownload = meta => meta?.downloadUrl || ('/wait.php?id='+ (meta?.id||'')); const decodeHTML = s => { if (s == null) return ''; const el = document.createElement('textarea'); el.innerHTML = String(s); return el.value; }; function setPlayingUI(isPlaying){ gp.play?.classList.toggle('is-playing', !!isPlaying); gp.play?.setAttribute('aria-label', isPlaying ? 'Dayandır' : 'Oynat'); } // ---------- Broadcast ---------- let lastCast = 0; function getPayload(stateForced){ const dur = isFinite(audio.duration) ? audio.duration : null; const cur = isFinite(audio.currentTime) ? audio.currentTime : null; const state = stateForced || (audio.ended ? 'ended' : (audio.paused ? 'paused' : 'playing')); return { state, currentTime: cur, duration: dur, volume: audio.volume, muted: !!audio.muted, track: current }; } function broadcastState(stateForced){ const payload = getPayload(stateForced); const msg = { type: 'PLAYER_STATE', state: payload.state, isPlaying: payload.state === 'playing', payload }; try { window.postMessage(msg, '*'); } catch(_){} for (let i=0;i 400) { lastCast = now; broadcastState(stateForced); } } // ---------- Cross-tab ---------- let bc; try { bc = new BroadcastChannel('blue_gp'); } catch(_){} function castAcross(type,payload){ try { bc && bc.postMessage({type, payload}); } catch(_){} } bc && bc.addEventListener('message', ev=>{ const m = ev.data || {}; if (m.type === 'PLAYING') { if (!audio.paused) { audio.pause(); setPlayingUI(false); broadcastState('paused'); } } }); audio.addEventListener('play', ()=> castAcross('PLAYING', { id: current?.id || null })); // ---------- UI update ---------- function updateUI(meta){ if (!meta) return; const artist = decodeHTML(meta.artist || ''); const title = decodeHTML(meta.title || ''); // Artist üstə, Song altda gp.title.textContent = artist; gp.artist.textContent = title; gp.cover.src = meta.cover || ''; gp.time.textContent = '00:00 / 00:00'; gp.progress.style.width = '0%'; if (gp.download) gp.download.href = fallbackDownload(meta); document.title = (title ? title + ' – ' : '') + 'BLUE.AZ'; } // ---------- HLS attach ---------- function attachSrc(src){ if (!src) return; if (typeof src === 'string' && src.includes('.m3u8') && !audio.canPlayType('application/vnd.apple.mpegurl')) { const add = ()=> { const Hls = window.Hls; if (Hls && Hls.isSupported()) { const hls = new Hls({ maxBufferLength: 30 }); hls.loadSource(src); hls.attachMedia(audio); } else { audio.src = src; } }; if (!window.Hls) { const s = document.createElement('script'); s.src = 'https://cdn.jsdelivr.net/npm/hls.js@latest'; s.onload = add; document.head.appendChild(s); } else add(); } else { audio.src = src; } } // ---------- Preload next ---------- let nextLinkEl = null; function preloadNext(meta){ if (!meta?.next || isRandom) return; const nsrc = meta.next.src || meta.next.stream || meta.next.audioUrl; if (!nsrc) return; try { if (!nextLinkEl) { nextLinkEl = document.createElement('link'); nextLinkEl.rel = 'preload'; nextLinkEl.as = 'audio'; document.head.appendChild(nextLinkEl); } nextLinkEl.href = nsrc; } catch(_){} } // ---------- Core play ---------- function loadAndPlay(meta, autoplay=true){ if (!meta) return; const src = meta.src || meta.stream || meta.audioUrl; if (!src) return; current = meta; updateUI(meta); audio.loop = isLoop; // src-ni yalnız PLAY zamanı qoşmaq üçün pending-də saxlayırıq pendingSrc = src; if (autoplay){ attachSrc(pendingSrc); pendingSrc = null; audio.play().then(()=>{ setPlayingUI(true); broadcastState('playing'); }) .catch(()=>{ setPlayingUI(false); broadcastState('paused'); }); } else { setPlayingUI(false); broadcastState('paused'); } try{ localStorage.setItem('lastTrackMeta', JSON.stringify(meta)); }catch(_){} applyMediaSession(meta); preloadNext(meta); pushRecent(meta); } // ---------- Random fetch ---------- function fetchRandomGlobalAndPlay(retries=5){ const exclude = getExcludeParam(); const url = `/tracks.php?random=1&all=1` + (exclude ? `&exclude=${encodeURIComponent(exclude)}` : ''); return fetch(url) .then(r=>r.json()) .then(m=>{ const id = getTrackId(m); if (!m || !(m.src||m.stream||m.audioUrl)) throw new Error('empty_track'); if (id && recentIds.includes(id) && retries > 0){ return fetchRandomGlobalAndPlay(retries-1); } loadAndPlay(m,true); }) .catch(_=>{ // random alınmadısa heç nə etmə (istəsən burada fallback yazaq) }); } // ---------- Neighbors fetch (prev/next) ---------- let neighborsFetchInFlight = null; function fetchNeighbors(){ if (!current?.id) return Promise.resolve(null); if (neighborsFetchInFlight) return neighborsFetchInFlight; neighborsFetchInFlight = fetch(`/tracks.php?neighbors=1&id=${encodeURIComponent(current.id)}`) .then(r => r.json()) .then(nb => { if (nb?.prev) current.prev = nb.prev; if (nb?.next) current.next = nb.next; return nb || null; }) .catch(() => null) .finally(() => { neighborsFetchInFlight = null; }); return neighborsFetchInFlight; } function ensurePrevMeta(){ if (current?.prev && (current.prev.src || current.prev.stream || current.prev.audioUrl)) { return Promise.resolve(current.prev); } if (!current?.id) return Promise.resolve(null); return fetchNeighbors().then(()=> current?.prev || null); } function ensureNextMeta(){ if (current?.next && (current.next.src || current.next.stream || current.next.audioUrl)) { return Promise.resolve(current.next); } if (!current?.id) return Promise.resolve(null); return fetchNeighbors().then(()=> current?.next || null); } // ---------- STOP helper ---------- function stopNow(){ try { audio.pause(); } catch(e){} try { audio.currentTime = 0; } catch(e){} setPlayingUI(false); broadcastState('paused'); } // ---------- Next / Prev ---------- function playNext(){ // 0) queue varsa onu oynat if (queueNext()) return; // 1) Random ON -> random track if (isRandom) { if (current) pushRecent(current); fetchRandomGlobalAndPlay(); return; } // 2) Random OFF -> next hazırdırsa oynat if (current?.next && (current.next.src || current.next.stream || current.next.audioUrl)) { loadAndPlay(current.next, true); return; } // 3) Random OFF -> neighbors-dan next çək, varsa oynat ensureNextMeta().then(next => { if (next && (next.src || next.stream || next.audioUrl)) { loadAndPlay(next, true); return; } // 4) Next tapılmadı -> random atma, STOP qal stopNow(); }); } function playPrev(){ // 1) cari musiqini STOP et stopNow(); // 2) prev-i tap (neighbors) və PLAY ensurePrevMeta().then(prev => { if (prev && (prev.src || prev.stream || prev.audioUrl)) { loadAndPlay(prev, true); return; } // 3) Prev tapılmadı -> restart eləmə, stopda qal // stopNow() artıq edilib }); } // ---------- Open track page ---------- function openPage(){ if (current?.pageUrl) { try{ window.top.location.href = current.pageUrl; } catch(_){ location.href=current.pageUrl; } } } gp.info?.addEventListener('click', openPage); gp.cover?.addEventListener('click', openPage); // PLAY üçün helper: lazımdırsa pendingSrc-ni qoş function ensureSrcBeforePlay(){ if (pendingSrc){ attachSrc(pendingSrc); pendingSrc = null; } } // ---------- Controls ---------- gp.play?.addEventListener('click', ()=>{ if (!current) return; if (audio.paused) { ensureSrcBeforePlay(); audio.play().then(()=>{ setPlayingUI(true); broadcastState('playing'); }) .catch(()=>{ setPlayingUI(false); broadcastState('paused'); }); } else { stopNow(); } }); gp.next?.addEventListener('click', playNext); gp.prev?.addEventListener('click', playPrev); gp.loopBtn?.addEventListener('click', ()=> setLoop(!isLoop)); gp.random?.addEventListener('click', ()=> setRandom(!isRandom)); // ---------- Seek ---------- const seek = clientX => { const rect = gp.bar.getBoundingClientRect(); const p = Math.min(Math.max((clientX - rect.left)/rect.width, 0), 1); if (!isNaN(audio.duration)) { audio.currentTime = p * audio.duration; throttleBroadcast(); } }; gp.bar?.addEventListener('click', e=>seek(e.clientX)); gp.bar?.addEventListener('mousedown', e=>{ const move = ev=>seek(ev.clientX); const up = ()=>{ document.removeEventListener('mousemove', move); document.removeEventListener('mouseup', up); }; document.addEventListener('mousemove', move); document.addEventListener('mouseup', up); }); // ---------- Time/progress ---------- function syncTime(){ const cur = audio.currentTime||0, dur = audio.duration||0; if (gp.time) gp.time.textContent = fmt(cur) + ' / ' + (isNaN(dur)?'00:00':fmt(dur)); if (gp.progress) gp.progress.style.width = (dur? (cur/dur*100):0).toFixed(2)+'%'; } audio.addEventListener('timeupdate', ()=>{ syncTime(); throttleBroadcast(); }); audio.addEventListener('loadedmetadata', ()=>{ syncTime(); throttleBroadcast(); }); audio.addEventListener('play', ()=>{ setPlayingUI(true); broadcastState('playing'); }); audio.addEventListener('pause', ()=>{ setPlayingUI(false); broadcastState('paused'); }); audio.addEventListener('ended', ()=>{ setPlayingUI(false); broadcastState('ended'); if (!audio.loop) playNext(); }); audio.addEventListener('error', ()=>{ setPlayingUI(false); broadcastState('paused'); if (!audio.loop) playNext(); }); // ---------- Volume/Mute persist ---------- try { const savedVol = localStorage.getItem('gpVolume'); if (savedVol != null) audio.volume = Math.max(0, Math.min(1, parseFloat(savedVol))); if (gp.volume) gp.volume.value = String(audio.volume || 0.9); } catch(_){} function reflectMuteUI(){ const muted = audio.muted || audio.volume === 0; gp.mute?.classList.toggle('active', muted); const x = document.getElementById('gpMuteX'); if (x && x.style) x.style.display = muted ? 'block' : 'none'; gp.mute?.setAttribute('aria-label', muted ? 'Səssiz (açıq)' : 'Səssiz (bağlı)'); } gp.volume?.addEventListener('input', ()=>{ const v = parseFloat(gp.volume.value); if (!isNaN(v)) { audio.volume = Math.max(0, Math.min(1, v)); try { localStorage.setItem('gpVolume', String(audio.volume)); } catch(_){} reflectMuteUI(); throttleBroadcast(); } }); gp.mute?.addEventListener('click', ()=>{ if (audio.muted || audio.volume === 0) { const back = parseFloat(localStorage.getItem('gpVolume') || '0.7') || 0.7; audio.muted = false; audio.volume = back; if (gp.volume) gp.volume.value = String(back); } else { audio.muted = true; } try { localStorage.setItem('gpVolume', String(audio.volume)); } catch(_){} reflectMuteUI(); throttleBroadcast(); }); audio.addEventListener('volumechange', reflectMuteUI); reflectMuteUI(); // ---------- Playback rate persist ---------- const rates = [1, 1.25, 1.5, 2]; let rateIdx = 0; try { const savedRate = parseFloat(localStorage.getItem('gpRate') || '1'); const ix = rates.indexOf(savedRate); if (ix >= 0) rateIdx = ix; audio.playbackRate = rates[rateIdx]; } catch(_){} function renderRate(){ if (gp.rateTxt) gp.rateTxt.textContent = rates[rateIdx] + '×'; } renderRate(); gp.rateBtn?.addEventListener('click', ()=>{ rateIdx = (rateIdx + 1) % rates.length; audio.playbackRate = rates[rateIdx]; try { localStorage.setItem('gpRate', String(rates[rateIdx])); } catch(_){} renderRate(); }); // ---------- Keyboard ---------- document.addEventListener('keydown', e=>{ if (['INPUT','TEXTAREA'].includes((e.target||{}).tagName)) return; if (e.code==='Space'){ e.preventDefault(); gp.play?.click(); } if (e.key==='ArrowRight'){ e.preventDefault(); playNext(); } if (e.key==='ArrowLeft'){ e.preventDefault(); playPrev(); } if (e.key?.toLowerCase()==='l'){ setLoop(!isLoop); } if (e.key?.toLowerCase()==='r'){ setRandom(!isRandom); } }); // ---------- postMessage API ---------- window.addEventListener('message', ev=>{ const d = ev.data||{}; if (!d || typeof d !== 'object') return; if (d.type==='PLAY_TRACK' && d.payload) { loadAndPlay(d.payload,true); return; } if (d.type==='NEXT') { playNext(); return; } if (d.type==='PREV') { playPrev(); return; } if (d.type==='QUEUE_ADD' && d.payload){ queueAdd(d.payload); return; } if (d.type==='PAUSE' || d.type==='STOP') { stopNow(); return; } if (d.type==='TOGGLE') { if (audio.paused) { ensureSrcBeforePlay(); audio.play().then(()=>{ setPlayingUI(true); broadcastState('playing'); }) .catch(()=>{ setPlayingUI(false); broadcastState('paused'); }); } else { stopNow(); } return; } if (d.type==='SEEK_REL') { const sec = Number(d.payload?.seconds) || 0; const dur = isFinite(audio.duration) ? audio.duration : Infinity; const cur = isFinite(audio.currentTime) ? audio.currentTime : 0; audio.currentTime = Math.max(0, Math.min(dur, cur + sec)); syncTime(); throttleBroadcast(); return; } }); // ---------- Media Session ---------- function applyMediaSession(meta){ if (!('mediaSession' in navigator) || !meta) return; try{ navigator.mediaSession.metadata = new MediaMetadata({ title: decodeHTML(meta.title || ''), artist: decodeHTML(meta.artist || ''), artwork: meta.cover ? [{ src: meta.cover, sizes: '512x512', type: 'image/png' }] : [] }); navigator.mediaSession.setActionHandler('play', ()=> { ensureSrcBeforePlay(); audio.play(); }); navigator.mediaSession.setActionHandler('pause', ()=> stopNow()); navigator.mediaSession.setActionHandler('previoustrack', playPrev); navigator.mediaSession.setActionHandler('nexttrack', playNext); }catch(_){} } // ---------- Restore last track (NO autoplay) ---------- try{ const saved = localStorage.getItem('lastTrackMeta'); if (saved){ const meta = JSON.parse(saved); if (meta && (meta.src||meta.stream||meta.audioUrl)) { loadAndPlay(meta,false); } else { broadcastState('paused'); } } else { broadcastState('paused'); } }catch(_){ broadcastState('paused'); } })();