{"id":180,"date":"2024-01-02T04:30:55","date_gmt":"2024-01-02T04:30:55","guid":{"rendered":"https:\/\/divinewisdomministries.com\/?page_id=180"},"modified":"2025-11-21T05:51:39","modified_gmt":"2025-11-21T05:51:39","slug":"testtv","status":"publish","type":"page","link":"https:\/\/divinewisdomministries.com\/ta\/testtv\/","title":{"rendered":"TestTV"},"content":{"rendered":"<div data-elementor-type=\"wp-page\" data-elementor-id=\"180\" class=\"elementor elementor-180\">\n\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-f5cd685 e-flex e-con-boxed e-con e-parent\" data-id=\"f5cd685\" data-element_type=\"container\" data-settings=\"{&quot;content_width&quot;:&quot;boxed&quot;}\" data-core-v316-plus=\"true\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-cff4af0 elementor-widget elementor-widget-shortcode\" data-id=\"cff4af0\" data-element_type=\"widget\" data-widget_type=\"shortcode.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-shortcode\">    <style>\r\n    .custom-tv-wrapper {\r\n        position: relative;\r\n        width: 100%;\r\n        max-width: 960px;\r\n        margin: 0 auto;\r\n        background: #000;\r\n        border-radius: 12px;\r\n        box-shadow: 0 10px 30px rgba(0,0,0,0.45);\r\n        overflow: hidden;\r\n    }\r\n    .custom-tv-wrapper video, .custom-tv-embed { display:block; width:100%; height:auto; background:black; border-radius:12px; }\r\n    .tv-logo-overlay { position:absolute; top:12px; right:12px; z-index:1002; pointer-events:none; opacity:0; transform:translateY(-4px); transition:opacity .3s, transform .3s; }\r\n    .tv-logo-overlay.show { opacity:0.95; transform:translateY(0); }\r\n    .tv-info-bar { display:flex; align-items:center; justify-content:space-between; padding:8px 12px; color:#e9eef5; font-size:13px; background:linear-gradient(to bottom, rgba(0,0,0,0.35), rgba(0,0,0,0.25)); }\r\n    .tv-title { font-weight:600; color:#ffa14f; }\r\n    @media (max-width:600px) { .tv-logo-overlay img { max-width:72px; } }\r\n    \/* embed blocked banner inside wrapper *\/\r\n    .ttv-embed-banner { position:absolute; left:0; right:0; top:0; bottom:0; display:flex; align-items:center; justify-content:center; background:rgba(0,0,0,0.6); z-index:9999; color:#fff; flex-direction:column; gap:10px; padding:16px; }\r\n    .ttv-embed-banner a { background:#ff0000; color:#fff; padding:10px 16px; border-radius:6px; text-decoration:none; font-weight:600; }\r\n    <\/style>\r\n\r\n    <div class=\"custom-tv-wrapper\" id=\"tvWrapper\">\r\n        <video id=\"custom-tv-player\" controls autoplay playsinline muted preload=\"metadata\">\r\n            <source id=\"video-source\" src=\"\" type=\"video\/mp4\">\r\n            Your browser does not support the video tag.\r\n        <\/video>\r\n\r\n        <div id=\"embedContainer\" style=\"display:none;\"><\/div>\r\n\r\n        <div class=\"tv-logo-overlay\" id=\"tvLogo\" aria-hidden=\"true\">\r\n            <img decoding=\"async\" src=\"https:\/\/divinewisdomministries.com\/wp-content\/themes\/oceanwp\/assets\/img\/logo.png\" alt=\"ThiruThoothar TV\" style=\"max-width:110px; filter:drop-shadow(0 4px 10px rgba(0,0,0,0.45));\">\r\n        <\/div>\r\n\r\n        <div class=\"tv-info-bar\" id=\"tvInfoBar\">\r\n            <div class=\"tv-info-left\">\r\n                <div class=\"tv-title\">ThiruThoothar TV<\/div>\r\n                <div class=\"tv-sub\" id=\"tvNowPlaying\" style=\"margin-left:10px; color:#bcd6ff; font-size:12px;\">Loading...<\/div>\r\n            <\/div>\r\n            <div class=\"tv-hint\" style=\"font-size:12px; color:rgba(255,255,255,0.8);\">Space = Play\/Pause \u2022 F = Fullscreen \u2022 \u2192 = Next<\/div>\r\n        <\/div>\r\n    <\/div>\r\n\r\n    <script>\r\n    (function(){\r\n        const pollMs = 8000;\r\n        const adminAjax = 'https:\/\/divinewisdomministries.com\/wp-admin\/admin-ajax.php';\r\n\r\n        const wrapper = document.getElementById('tvWrapper');\r\n        const player = document.getElementById('custom-tv-player');\r\n        const videoSource = document.getElementById('video-source');\r\n        const embedContainer = document.getElementById('embedContainer');\r\n        const logo = document.getElementById('tvLogo');\r\n        const nowPlayingEl = document.getElementById('tvNowPlaying');\r\n\r\n        \/\/ program display element\r\n        let programEl = document.getElementById('ttv_program_display');\r\n        if (!programEl) {\r\n            programEl = document.createElement('div');\r\n            programEl.id = 'ttv_program_display';\r\n            programEl.style.position = 'absolute';\r\n            programEl.style.left = '12px';\r\n            programEl.style.bottom = '60px';\r\n            programEl.style.zIndex = '1003';\r\n            programEl.style.color = '#fff';\r\n            programEl.style.fontSize = '14px';\r\n            programEl.style.background = 'rgba(0,0,0,0.45)';\r\n            programEl.style.padding = '6px 10px';\r\n            programEl.style.borderRadius = '6px';\r\n            programEl.style.maxWidth = '70%';\r\n            programEl.style.overflow = 'hidden';\r\n            programEl.style.whiteSpace = 'nowrap';\r\n            programEl.style.textOverflow = 'ellipsis';\r\n            wrapper.appendChild(programEl);\r\n        }\r\n\r\n        \/\/ LocalStorage keys\r\n        const LS_STATE = 'ttv_playlist_state_v1';\r\n        const LS_LAST_PROGRAM = 'ttv_last_program';\r\n\r\n        let originalVideos = [], playlist = [], currentIndex = 0, currentlyLive = false, logoTimeout = null;\r\n\r\n        function shuffleArray(array) {\r\n            const a = array.slice();\r\n            for (let i = a.length - 1; i > 0; i--) {\r\n                const j = Math.floor(Math.random() * (i + 1));\r\n                [a[i], a[j]] = [a[j], a[i]];\r\n            }\r\n            return a;\r\n        }\r\n        function filenameFromUrl(url) {\r\n            try { return decodeURIComponent(url.split('\/').pop().split('?')[0]); } catch(e) { return url; }\r\n        }\r\n\r\n        function savePlaylistState() {\r\n            try {\r\n                const state = {\r\n                    playlist: playlist,\r\n                    currentIndex: currentIndex,\r\n                    currentTime: Math.max(0, Math.floor(player.currentTime || 0)),\r\n                    updated_at: Date.now()\r\n                };\r\n                localStorage.setItem(LS_STATE, JSON.stringify(state));\r\n            } catch(e){}\r\n        }\r\n        function loadPlaylistState() {\r\n            try {\r\n                const raw = localStorage.getItem(LS_STATE);\r\n                if (!raw) return null;\r\n                const state = JSON.parse(raw);\r\n                if (!state || !Array.isArray(state.playlist)) return null;\r\n                return state;\r\n            } catch(e){ return null; }\r\n        }\r\n\r\n        function showProgramInfo(djName, programTitle) {\r\n            let text = '';\r\n            if (programTitle) text += programTitle;\r\n            if (djName) text += (text ? ' \u2022 Presented By ' : 'Presented By ') + djName;\r\n            if (!text) {\r\n                try {\r\n                    const last = JSON.parse(localStorage.getItem(LS_LAST_PROGRAM) || 'null');\r\n                    if (last && (last.program_title || last.dj_name)) {\r\n                        text = (last.program_title || '') + (last.program_title && last.dj_name ? ' \u2022 Presented By ' : '') + (last.dj_name || '');\r\n                    }\r\n                } catch(e){}\r\n            }\r\n            programEl.textContent = text;\r\n            programEl.style.display = text ? 'block' : 'none';\r\n        }\r\n\r\n        function initPlaylist(videos) {\r\n            if (!Array.isArray(videos) || videos.length === 0) {\r\n                nowPlayingEl.textContent = 'No videos available';\r\n                return;\r\n            }\r\n            originalVideos = videos.slice();\r\n\r\n            const saved = loadPlaylistState();\r\n            if ( saved && Array.isArray(saved.playlist) && saved.playlist.length > 0 ) {\r\n                const serverSet = new Set(originalVideos);\r\n                const ok = saved.playlist.every(u => serverSet.has(u));\r\n                if ( ok ) {\r\n                    playlist = saved.playlist.slice();\r\n                    currentIndex = Math.min(saved.currentIndex || 0, playlist.length - 1);\r\n                    const src = playlist[currentIndex];\r\n                    videoSource.src = src;\r\n                    player.load();\r\n                    player.addEventListener('canplay', function __seekOnce(){\r\n                        try {\r\n                            const t = Math.max(0, Math.floor(saved.currentTime || 0));\r\n                            if ( t > 1 && player.duration && t < player.duration - 1 ) player.currentTime = t;\r\n                        } catch(e){}\r\n                        player.play().catch(()=>{});\r\n                        player.removeEventListener('canplay', __seekOnce);\r\n                    });\r\n                    updateNowPlaying();\r\n                    startPeriodicSave();\r\n                    return;\r\n                }\r\n            }\r\n\r\n            playlist = shuffleArray(originalVideos);\r\n            currentIndex = 0;\r\n            updateNowPlaying();\r\n            playCurrent();\r\n            startPeriodicSave();\r\n        }\r\n\r\n        function updateNowPlaying() {\r\n            const name = playlist[currentIndex] ? filenameFromUrl(playlist[currentIndex]) : '\u2014';\r\n            nowPlayingEl.textContent = name;\r\n        }\r\n\r\n        function playCurrent() {\r\n            if (!playlist || playlist.length === 0) return;\r\n            const src = playlist[currentIndex];\r\n            videoSource.src = src;\r\n            player.load();\r\n            const p = player.play();\r\n            if (p && typeof p.catch === 'function') p.catch(()=>{});\r\n            updateNowPlaying();\r\n            revealLogoTemporarily();\r\n        }\r\n\r\n        player.addEventListener('ended', function(){\r\n            currentIndex++;\r\n            if (currentIndex >= playlist.length) {\r\n                playlist = shuffleArray(originalVideos);\r\n                currentIndex = 0;\r\n            }\r\n            playCurrent();\r\n        });\r\n\r\n        player.addEventListener('error', function(e){\r\n            console.warn('Video error; skipping to next.', e);\r\n            currentIndex++;\r\n            if (currentIndex >= playlist.length) {\r\n                playlist = shuffleArray(originalVideos);\r\n                currentIndex = 0;\r\n            }\r\n            setTimeout(playCurrent, 600);\r\n        });\r\n\r\n        function revealLogoTemporarily() {\r\n            logo.classList.add('show');\r\n            if (logoTimeout) clearTimeout(logoTimeout);\r\n            logoTimeout = setTimeout(()=>{ logo.classList.remove('show'); }, 6000);\r\n        }\r\n        wrapper.addEventListener('mouseenter', ()=>{ if (logoTimeout) clearTimeout(logoTimeout); logo.classList.add('show'); });\r\n        wrapper.addEventListener('mouseleave', ()=>{ if (logoTimeout) clearTimeout(logoTimeout); logoTimeout = setTimeout(()=>logo.classList.remove('show'),900); });\r\n\r\n        let periodicSave = null;\r\n        function startPeriodicSave() {\r\n            if ( periodicSave ) return;\r\n            periodicSave = setInterval(savePlaylistState, 5000);\r\n            window.addEventListener('beforeunload', savePlaylistState);\r\n        }\r\n\r\n        function activateLive(embedUrl, djName, programTitle, embedBlocked) {\r\n            if (currentlyLive) return;\r\n            currentlyLive = true;\r\n            try { player.pause(); } catch(e){}\r\n            player.style.display = 'none';\r\n\r\n            showProgramInfo(djName, programTitle);\r\n\r\n            embedContainer.innerHTML = '';\r\n            const div = document.createElement('div');\r\n            div.className = 'custom-tv-embed';\r\n            div.style.position = 'relative';\r\n            div.style.paddingTop = '56.25%';\r\n            div.style.width = '100%';\r\n            div.style.height = '0';\r\n            div.style.overflow = 'hidden';\r\n\r\n            const iframe = document.createElement('iframe');\r\n            iframe.setAttribute('src', embedUrl + (embedUrl.includes('?') ? '&autoplay=1&mute=1' : '?autoplay=1&mute=1'));\r\n            iframe.setAttribute('allow','autoplay; encrypted-media; picture-in-picture; fullscreen');\r\n            iframe.setAttribute('frameborder','0');\r\n            iframe.style.position = 'absolute';\r\n            iframe.style.top = '0';\r\n            iframe.style.left = '0';\r\n            iframe.style.width = '100%';\r\n            iframe.style.height = '100%';\r\n            iframe.style.border = '0';\r\n            div.appendChild(iframe);\r\n            embedContainer.appendChild(div);\r\n            embedContainer.style.display = 'block';\r\n            logo.classList.add('show');\r\n\r\n            \/\/ if embed_blocked flag is set, show banner overlay\r\n            if ( embedBlocked ) {\r\n                let banner = document.getElementById('ttv_embed_banner');\r\n                if (!banner) {\r\n                    banner = document.createElement('div');\r\n                    banner.id = 'ttv_embed_banner';\r\n                    banner.className = 'ttv-embed-banner';\r\n                    banner.innerHTML = '<div style=\"font-size:18px;font-weight:600;\">Embedding blocked by video owner<\/div><div style=\"max-width:480px;text-align:center;\">This stream cannot be played inside other websites \u2014 open it on YouTube to watch.<\/div>';\r\n                    const btn = document.createElement('a');\r\n                    \/\/ derive watch URL\r\n                    let watchUrl = embedUrl;\r\n                    if ( embedUrl.indexOf('\/embed\/') !== -1 ) {\r\n                        const vid = embedUrl.split('\/embed\/').pop().split('?')[0];\r\n                        watchUrl = 'https:\/\/www.youtube.com\/watch?v=' + vid;\r\n                    }\r\n                    btn.href = watchUrl;\r\n                    btn.target = '_blank';\r\n                    btn.textContent = 'Watch on YouTube';\r\n                    banner.appendChild(btn);\r\n                    const close = document.createElement('button');\r\n                    close.textContent = 'Close';\r\n                    close.style.marginTop = '6px';\r\n                    close.onclick = function(){ banner.remove(); };\r\n                    banner.appendChild(close);\r\n                    wrapper.appendChild(banner);\r\n                }\r\n            } else {\r\n                const b = document.getElementById('ttv_embed_banner');\r\n                if ( b ) b.remove();\r\n            }\r\n        }\r\n\r\n        function deactivateLive() {\r\n            if (!currentlyLive) return;\r\n            currentlyLive = false;\r\n            embedContainer.innerHTML = '';\r\n            embedContainer.style.display = 'none';\r\n            player.style.display = '';\r\n\r\n            \/\/ restore program info from last saved program\r\n            try {\r\n                const last = JSON.parse(localStorage.getItem(LS_LAST_PROGRAM) || 'null');\r\n                if ( last && (last.program_title || last.dj_name) ) showProgramInfo(last.dj_name, last.program_title);\r\n                else showProgramInfo('', '');\r\n            } catch(e){ showProgramInfo('',''); }\r\n\r\n            \/\/ resume playlist from saved state if valid\r\n            const saved = loadPlaylistState();\r\n            if ( saved && Array.isArray(saved.playlist) && saved.playlist.length > 0 ) {\r\n                const serverSet = new Set(originalVideos);\r\n                const ok = saved.playlist.every(u => serverSet.has(u));\r\n                if ( ok ) {\r\n                    playlist = saved.playlist.slice();\r\n                    currentIndex = Math.min(saved.currentIndex || 0, playlist.length - 1);\r\n                    const src = playlist[currentIndex];\r\n                    videoSource.src = src;\r\n                    player.load();\r\n                    player.addEventListener('canplay', function __seekOnce(){\r\n                        try {\r\n                            const t = Math.max(0, Math.floor(saved.currentTime || 0));\r\n                            if ( t > 1 && player.duration && t < player.duration - 1 ) player.currentTime = t;\r\n                        } catch(e){}\r\n                        player.play().catch(()=>{});\r\n                        player.removeEventListener('canplay', __seekOnce);\r\n                    });\r\n                    updateNowPlaying();\r\n                    return;\r\n                }\r\n            }\r\n\r\n            \/\/ fallback: just play current index\r\n            playCurrent();\r\n        }\r\n\r\n        async function checkLiveStatus() {\r\n            try {\r\n                const resp = await fetch(adminAjax + '?action=ttv_get_live_status', {cache:'no-store'});\r\n                const json = await resp.json();\r\n                if (!json || !json.success) return;\r\n                const p = json.data || { live:0, embed_url:'', embed_blocked:0, dj_name:'', program_title:'' };\r\n                const isLive = p.live === 1 || p.live === '1' || p.live === true;\r\n                const embed = p.embed_url || '';\r\n                const djName = p.dj_name || '';\r\n                const programTitle = p.program_title || '';\r\n                const blocked = p.embed_blocked === 1 || p.embed_blocked === '1';\r\n\r\n                if ( isLive && !currentlyLive ) activateLive(embed, djName, programTitle, blocked);\r\n                else if ( !isLive && currentlyLive ) deactivateLive();\r\n                else if ( isLive && currentlyLive ) showProgramInfo(djName, programTitle);\r\n            } catch(e) {\r\n                console.warn('Error polling live status:', e);\r\n            }\r\n        }\r\n\r\n        setInterval(checkLiveStatus, pollMs);\r\n        checkLiveStatus();\r\n\r\n        \/\/ load playlist\r\n        fetch(adminAjax + '?action=get_videos', {cache:'no-store'})\r\n            .then(r => r.json())\r\n            .then(videos => initPlaylist(videos))\r\n            .catch(e => { console.error('Error loading videos:', e); nowPlayingEl.textContent = 'Error loading videos'; });\r\n\r\n        \/\/ interaction to trigger play\r\n        function tryPlayOnInteraction() {\r\n            const p = player.play();\r\n            if (p && typeof p.catch === 'function') p.catch(()=>{});\r\n            document.removeEventListener('click', tryPlayOnInteraction);\r\n            document.removeEventListener('touchstart', tryPlayOnInteraction);\r\n        }\r\n        document.addEventListener('click', tryPlayOnInteraction);\r\n        document.addEventListener('touchstart', tryPlayOnInteraction);\r\n\r\n        \/\/ keep a lightweight updater of last_program in localStorage while live\r\n        setInterval(async function() {\r\n            try {\r\n                const resp = await fetch(adminAjax + '?action=ttv_get_live_status', {cache:'no-store'});\r\n                const j = await resp.json();\r\n                if ( j && j.success && j.data && j.data.live ) {\r\n                    const p = j.data;\r\n                    try { localStorage.setItem(LS_LAST_PROGRAM, JSON.stringify({ dj_name: p.dj_name || '', program_title: p.program_title || '', updated_at: Date.now() })); } catch(e){}\r\n                }\r\n            } catch(e){}\r\n        }, 15000);\r\n\r\n    })();\r\n    <\/script>\r\n    \n<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-36dc7e7 e-flex e-con-boxed e-con e-parent\" data-id=\"36dc7e7\" data-element_type=\"container\" data-settings=\"{&quot;content_width&quot;:&quot;boxed&quot;}\" data-core-v316-plus=\"true\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-1a74d75 e-flex e-con-boxed e-con e-parent\" data-id=\"1a74d75\" data-element_type=\"container\" data-settings=\"{&quot;content_width&quot;:&quot;boxed&quot;}\" data-core-v316-plus=\"true\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-8706c00 elementor-widget elementor-widget-shortcode\" data-id=\"8706c00\" data-element_type=\"widget\" data-widget_type=\"shortcode.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-shortcode\">    <style>\n    \/* Container *\/\n    .wrp-box{max-width:520px;margin:14px auto;padding:16px;border-radius:14px;background:linear-gradient(180deg,#0f1720,#0b1220);color:#fff;font-family:Arial,Helvetica,sans-serif;box-shadow:0 8px 30px rgba(2,6,23,.6);position:relative;overflow:hidden}\n    .wrp-top{display:flex;gap:12px;align-items:center}\n    .wrp-logo{width:72px;height:72px;border-radius:8px;object-fit:cover;border:2px solid rgba(255,255,255,.06)}\n    .wrp-meta{flex:1}\n    .wrp-title{font-size:18px;font-weight:700}\n    .wrp-sub{font-size:13px;opacity:.85;margin-top:4px}\n    .wrp-controls{display:flex;gap:8px;align-items:center;margin-top:12px}\n    .wrp-play{background:#ffd54a;border:none;padding:10px 14px;border-radius:999px;font-weight:700;cursor:pointer}\n    .wrp-play.paused{background:#03a9f4}\n    .wrp-vol{width:120px}\n    .wrp-wave{height:20px;margin-top:12px;display:flex;gap:4px;align-items:center;justify-content:center}\n    .wrp-wave span{display:inline-block;width:4px;background:#ffd54a;height:6px;border-radius:3px;animation:wrpwave 1s linear infinite;opacity:.9}\n    .wrp-wave span:nth-child(2){animation-delay:.12s}\n    .wrp-wave span:nth-child(3){animation-delay:.24s}\n    .wrp-wave span:nth-child(4){animation-delay:.36s}\n    @keyframes wrpwave{0%{height:6px}50%{height:22px}100%{height:6px}}\n    .wrp-bottom{display:flex;justify-content:space-between;align-items:center;margin-top:12px;gap:8px}\n    .wrp-now{font-size:13px;opacity:.95}\n    .wrp-rights{font-size:12px;opacity:.6}\n\n    \/* floating mini-player *\/\n    .wrp-floating{position:fixed;right:18px;bottom:18px;background:#0b1220;border-radius:12px;padding:10px 12px;display:flex;align-items:center;gap:10px;z-index:99999;box-shadow:0 10px 30px rgba(0,0,0,.6)}\n    .wrp-floating img{width:44px;height:44px;border-radius:6px}\n    .wrp-floating .mini-btn{background:#ffd54a;padding:8px;border-radius:8px;border:none;cursor:pointer}\n\n    \/* theme toggle *\/\n    .wrp-theme-toggle{background:transparent;border:1px solid rgba(255,255,255,.06);color:#fff;padding:6px 8px;border-radius:8px;cursor:pointer;font-size:12px}\n\n    \/* mobile full width bar *\/\n    @media(max-width:600px){\n        .wrp-box{border-radius:0;max-width:100%;padding:10px}\n        .wrp-play{padding:12px 16px;font-size:16px}\n    }\n    <\/style>\n\n    <div id=\"wrp_8cb96b6b\" class=\"wrp-box\" data-stream=\"https:\/\/165.22.217.209:8000\/radio.mp3\" data-api=\"https:\/\/165.22.217.209\/api\/nowplaying\/1\" data-autoplay=\"0\">\n        <div class=\"wrp-top\">\n            <img decoding=\"async\" class=\"wrp-logo\" id=\"wrp_8cb96b6b_logo\" src=\"https:\/\/divinewisdomministries.com\/wp-content\/plugins\/wisdom-radio-player\/wp-content\/uploads\/logo.png\" alt=\"logo\">\n            <div class=\"wrp-meta\">\n                <div class=\"wrp-title\">Divine Wisdom Radio <small style=\"font-weight:600;color:#ffd54a;margin-left:6px\">LIVE<\/small><\/div>\n                <div class=\"wrp-sub\" id=\"wrp_8cb96b6b_now\">Connecting\u2026<\/div>\n                <div class=\"wrp-wave\" id=\"wrp_8cb96b6b_wave\">\n                    <span><\/span><span><\/span><span><\/span><span><\/span>\n                <\/div>\n            <\/div>\n        <\/div>\n\n        <div class=\"wrp-controls\">\n            <button class=\"wrp-play\" id=\"wrp_8cb96b6b_play\">\u25b6 Play<\/button>\n            <input type=\"range\" class=\"wrp-vol\" id=\"wrp_8cb96b6b_vol\" min=\"0\" max=\"1\" step=\"0.05\" value=\"1\">\n            <button class=\"wrp-theme-toggle\" id=\"wrp_8cb96b6b_theme\">Dark\/Light<\/button>\n            <button style=\"background:#25D366;color:white;border:none;padding:8px;border-radius:8px;cursor:pointer\" id=\"wrp_8cb96b6b_whats\">Share<\/button>\n        <\/div>\n\n        <div class=\"wrp-bottom\">\n            <div class=\"wrp-now\" id=\"wrp_8cb96b6b_dj\">DJ: \u2014 \u2022 Listeners: \u2014<\/div>\n            <div class=\"wrp-rights\">\u0b9f\u0bbf\u0bb5\u0bc8\u0ba9\u0bcd \u0bb5\u0bbf\u0bb8\u0bcd\u0b9f\u0bae\u0bcd \u0bae\u0bbf\u0ba9\u0bbf\u0bb8\u0bcd\u0b9f\u0bcd\u0bb0\u0bbf\u0bb8\u0bcd<\/div>\n        <\/div>\n\n        <audio id=\"wrp_8cb96b6b_audio\" preload=\"none\">\n            <source src=\"https:\/\/165.22.217.209:8000\/radio.mp3\" type=\"audio\/mpeg\">\n            Your browser does not support audio.\n        <\/audio>\n    <\/div>\n\n    <!-- Floating mini-player -->\n    <div id=\"wrp_8cb96b6b_float\" class=\"wrp-floating\" style=\"display:none\">\n        <img decoding=\"async\" id=\"wrp_8cb96b6b_f_logo\" src=\"https:\/\/divinewisdomministries.com\/wp-content\/plugins\/wisdom-radio-player\/wp-content\/uploads\/logo.png\" alt=\"mini\">\n        <div style=\"min-width:140px\">\n            <div style=\"font-size:13px;font-weight:700\">Divine Wisdom Radio<\/div>\n            <div id=\"wrp_8cb96b6b_f_now\" style=\"font-size:12px;opacity:.85\">Connecting\u2026<\/div>\n        <\/div>\n        <button class=\"mini-btn\" id=\"wrp_8cb96b6b_f_play\">\u25b6<\/button>\n    <\/div>\n\n    <script>\n    (function(){\n        const rootId = \"wrp_8cb96b6b\";\n        const container = document.getElementById(rootId);\n        const audio = document.getElementById(rootId + '_audio');\n        const playBtn = document.getElementById(rootId + '_play');\n        const vol = document.getElementById(rootId + '_vol');\n        const nowBox = document.getElementById(rootId + '_now');\n        const djBox = document.getElementById(rootId + '_dj');\n        const logo = document.getElementById(rootId + '_logo');\n        const floatWrap = document.getElementById(rootId + '_float');\n        const floatPlay = document.getElementById(rootId + '_f_play');\n        const floatNow = document.getElementById(rootId + '_f_now');\n        const floatLogo = document.getElementById(rootId + '_f_logo');\n        const themeBtn = document.getElementById(rootId + '_theme');\n        const whatsBtn = document.getElementById(rootId + '_whats');\n\n        const apiEndpoint = 'https:\/\/divinewisdomministries.com\/wp-admin\/admin-ajax.php?action=wr_get_nowplaying';\n        const cfg_autoplay = container.getAttribute('data-autoplay') === '1';\n\n        \/\/ volume\n        audio.volume = parseFloat(vol.value || 1);\n        vol.addEventListener('input', ()=> audio.volume = vol.value);\n\n        \/\/ play\/pause with UI state\n        function setPlaying(state){\n            if(state){\n                playBtn.innerText = '\u23f8 Pause';\n                playBtn.classList.remove('paused');\n                floatPlay.innerText = '\u23f8';\n                floatWrap.style.display = 'flex';\n            } else {\n                playBtn.innerText = '\u25b6 Play';\n                playBtn.classList.add('paused');\n                floatPlay.innerText = '\u25b6';\n            }\n        }\n\n        playBtn.addEventListener('click', async ()=> {\n            try {\n                if(audio.paused){\n                    await audio.play();\n                    setPlaying(true);\n                } else {\n                    audio.pause();\n                    setPlaying(false);\n                }\n            } catch(e){\n                \/\/ Autoplay blocked \u2014 show friendly message by changing button text\n                playBtn.innerText = '\u25b6 Tap to play';\n            }\n        });\n\n        floatPlay.addEventListener('click', async ()=>{\n            try {\n                if(audio.paused){ await audio.play(); setPlaying(true); }\n                else { audio.pause(); setPlaying(false); }\n            } catch(e){ playBtn.innerText = '\u25b6 Tap to play'; }\n        });\n\n        \/\/ attempt autoplay if requested (may fail on mobile)\n        if(cfg_autoplay){\n            audio.autoplay = true;\n            audio.muted = false;\n            audio.play().then(()=> setPlaying(true)).catch(()=> {\n                \/\/ keep button for manual play\n                setPlaying(false);\n            });\n        }\n\n        \/\/ fetch now-playing every 12s\n        async function refreshNowPlaying(){\n            try {\n                const r = await fetch(apiEndpoint);\n                const json = await r.json();\n                if(json.success && json.data){\n                    const data = json.data;\n                    \/\/ Try common AzuraCast structure: data.now_playing\n                    const np = data.now_playing || data;\n                    let title = 'Live';\n                    let artist = '';\n                    let art = '';\n                    let listeners = '\u2014';\n                    let source_title = '';\n\n                    \/\/ AzuraCast v0.13+ structure:\n                    if(np && np.currently_playing){\n                        const cur = np.currently_playing;\n                        if(cur.song && cur.song.title) title = cur.song.title;\n                        if(cur.song && cur.song.artist) artist = cur.song.artist;\n                        art = (cur.song && cur.song.thumbnail) ? cur.song.thumbnail : '';\n                        listeners = (np.listeners && np.listeners.current) ? np.listeners.current : listeners;\n                        source_title = (np.station && np.station.name) ? np.station.name : '';\n                    } else if(np && np.now_playing){ \/\/ some variants\n                        const cur = np.now_playing;\n                        if(cur.song && cur.song.title) title = cur.song.title;\n                        if(cur.song && cur.song.artist) artist = cur.song.artist;\n                        art = (cur.song && cur.song.thumbnail) ? cur.song.thumbnail : '';\n                        listeners = (np.listeners && np.listeners.current) ? np.listeners.current : listeners;\n                    } else {\n                        \/\/ fallback try keys directly\n                        if(np.song && np.song.title) title = np.song.title;\n                        if(np.artist) artist = np.artist;\n                        if(np.listeners) listeners = np.listeners;\n                    }\n\n                    nowBox.innerText = (artist ? (artist + ' \u2014 ') : '') + title;\n                    djBox.innerText = 'DJ: ' + (source_title || '\u2014') + ' \u2022 Listeners: ' + listeners;\n                    floatNow.innerText = nowBox.innerText;\n                    if(art) { logo.src = art; floatLogo.src = art; }\n                } else {\n                    nowBox.innerText = 'Live Streaming\u2026';\n                }\n            } catch (e){\n                nowBox.innerText = 'Live Streaming\u2026';\n            }\n        }\n\n        \/\/ initial\n        refreshNowPlaying();\n        setInterval(refreshNowPlaying, 12000);\n\n        \/\/ show floating mini-player when playing\n        audio.addEventListener('play', ()=> { floatWrap.style.display = 'flex'; setPlaying(true); });\n        audio.addEventListener('pause', ()=> { setPlaying(false); });\n\n        \/\/ theme toggle (dark\/light) - simple implementation\n        themeBtn.addEventListener('click', ()=> {\n            const el = container;\n            if(el.dataset.theme === 'light'){ el.dataset.theme = 'dark'; el.style.background = 'linear-gradient(180deg,#0f1720,#0b1220)'; el.style.color='#fff'; }\n            else { el.dataset.theme = 'light'; el.style.background = '#fff'; el.style.color = '#222'; }\n        });\n\n        \/\/ WhatsApp share\n        whatsBtn.addEventListener('click', ()=> {\n            const url = 'https:\/\/divinewisdomministries.com\/reflection\/';\n            const msg = 'Listen Divine Wisdom Radio LIVE: https:\/\/divinewisdomministries.com';\n            const shareUrl = 'https:\/\/api.whatsapp.com\/send?text=' + encodeURIComponent(msg + ' ' + url);\n            window.open(shareUrl, '_blank');\n        });\n\n        \/\/ on page load: if not playing hide floating until user plays\n        floatWrap.style.display = 'none';\n\n        \/\/ expose small API for other scripts if needed\n        window['wrp_' + rootId] = { audio: audio, play: ()=> audio.play(), pause: ()=> audio.pause() };\n\n    })();\n    <\/script>\n\n    <\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-205b409 e-flex e-con-boxed e-con e-parent\" data-id=\"205b409\" data-element_type=\"container\" data-settings=\"{&quot;content_width&quot;:&quot;boxed&quot;}\" data-core-v316-plus=\"true\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-fa5d510 e-flex e-con-boxed e-con e-parent\" data-id=\"fa5d510\" data-element_type=\"container\" data-settings=\"{&quot;content_width&quot;:&quot;boxed&quot;}\" data-core-v316-plus=\"true\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-ce19329 elementor-widget elementor-widget-shortcode\" data-id=\"ce19329\" data-element_type=\"widget\" data-widget_type=\"shortcode.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-shortcode\">        <div id=\"dw-bible-app\" class=\"dw-bible-reader\">\n            <div class=\"dw-reader-top\">\n                <button id=\"dw-theme-toggle\" class=\"dw-btn\">Theme<\/button>\n                <button id=\"dw-open-book-list\" class=\"dw-btn\">Choose Book<\/button>\n                <select id=\"dw-chapter-select\" disabled><option>Select Chapter<\/option><\/select>\n                <button id=\"dw-fav-btn\" class=\"dw-btn\">\u2764 Favorite<\/button>\n            <\/div>\n            <div class=\"dw-reader-top\">\n   <!-- theme toggle etc -->\n<\/div>\n\n<div class=\"dw-header-large\">\n    <div id=\"dw-header-book\"><\/div>\n    <div id=\"dw-header-chapter\"><\/div>\n<\/div>\n\n\n            <div id=\"dw-mobile-book-list\" class=\"dw-book-list-modal\" style=\"display:none;\">\n                <div class=\"dw-book-list-inner\">\n                    <input id=\"dw-book-search\" placeholder=\"Search book...\" \/>\n                    <div id=\"dw-book-items\"><\/div>\n                    <button id=\"dw-book-close\" class=\"dw-btn\">Close<\/button>\n                <\/div>\n            <\/div>\n\n            <div id=\"dw-reader-audio\" class=\"dw-reader-audio\"><\/div>\n            <div id=\"dw-reader-content\" class=\"dw-reader-content\"><\/div>\n\n            <div class=\"dw-reader-nav\">\n                <button id=\"dw-prev-chap\" class=\"dw-btn\">Previous<\/button>\n                <span>Chapter <span id=\"dw-current-chap\">\u2014<\/span><\/span>\n                <button id=\"dw-next-chap\" class=\"dw-btn\">Next<\/button>\n            <\/div>\n\n            <div class=\"dw-reader-search\" style=\"margin-top:16px;\">\n                <input id=\"dw-search-input\" placeholder=\"Search verses...\" \/>\n                <button id=\"dw-search-btn\" class=\"dw-btn\">Search<\/button>\n                <div id=\"dw-search-results\"><\/div>\n            <\/div>\n\n            <button id=\"dw-share-selected-btn\">Share Selected<\/button>\n\n        <\/div>\n\n        <\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-180","page","type-page","status-publish","hentry","entry"],"_links":{"self":[{"href":"https:\/\/divinewisdomministries.com\/ta\/wp-json\/wp\/v2\/pages\/180","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/divinewisdomministries.com\/ta\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/divinewisdomministries.com\/ta\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/divinewisdomministries.com\/ta\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/divinewisdomministries.com\/ta\/wp-json\/wp\/v2\/comments?post=180"}],"version-history":[{"count":76,"href":"https:\/\/divinewisdomministries.com\/ta\/wp-json\/wp\/v2\/pages\/180\/revisions"}],"predecessor-version":[{"id":9171,"href":"https:\/\/divinewisdomministries.com\/ta\/wp-json\/wp\/v2\/pages\/180\/revisions\/9171"}],"wp:attachment":[{"href":"https:\/\/divinewisdomministries.com\/ta\/wp-json\/wp\/v2\/media?parent=180"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}