{"id":178,"date":"2023-12-21T19:51:54","date_gmt":"2023-12-21T19:51:54","guid":{"rendered":"https:\/\/luvernecoc.com\/?page_id=178"},"modified":"2025-01-07T19:50:35","modified_gmt":"2025-01-08T01:50:35","slug":"live","status":"publish","type":"page","link":"https:\/\/luvernecoc.com\/?page_id=178","title":{"rendered":"Live"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"178\" class=\"elementor elementor-178\" data-elementor-post-type=\"page\">\n\t\t\t\t<div class=\"elementor-element elementor-element-06dc1a4 e-flex e-con-boxed e-con e-parent\" data-id=\"06dc1a4\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-a3f23a9 elementor-widget elementor-widget-html\" data-id=\"a3f23a9\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>Auto-Embedding YouTube Live Stream<\/title>\n    <style>\n        .container {\n            max-width: 800px;\n            margin: 0 auto;\n            padding: 20px;\n        }\n        #streamContainer {\n            position: relative;\n            width: 100%;\n            height: 0;\n            transition: padding-bottom 0.3s ease;\n        }\n        #streamContainer.active {\n            padding-bottom: 56.25%; \/* 16:9 aspect ratio *\/\n        }\n        #streamContainer iframe {\n            position: absolute;\n            top: 0;\n            left: 0;\n            width: 100%;\n            height: 100%;\n        }\n        .status {\n            text-align: center;\n            margin: 20px 0;\n            padding: 10px;\n            border-radius: 5px;\n        }\n        .offline {\n            background-color: #ffebee;\n            color: #c62828;\n        }\n        .online {\n            background-color: #e8f5e9;\n            color: #2e7d32;\n        }\n    <\/style>\n<\/head>\n<body>\n    <div class=\"container\">\n        <div id=\"status\" class=\"status offline\">Checking stream status...<\/div>\n        <div id=\"streamContainer\"><\/div>\n    <\/div>\n\n    <script>\n        \/\/ Configuration\n        const API_KEY = 'AIzaSyCeurFitoYeAqRZRWxfksTgcI_EM_sWgZo';\n        const CHANNEL_ID = 'UCyJNDkF0pgQdWrt7HKrZq6w';\n        const CHECK_INTERVAL = 600000; \/\/ Check every 10 minutes\n        let checkTimer = null;\n\n        async function checkLiveStatus() {\n            \/\/ Skip check if page is hidden\n            if (document.hidden) {\n                return;\n            }\n            try {\n                const response = await fetch(`https:\/\/www.googleapis.com\/youtube\/v3\/search?part=snippet&channelId=${CHANNEL_ID}&type=video&eventType=live&key=${API_KEY}`);\n                const data = await response.json();\n                \n                const statusElement = document.getElementById('status');\n                const streamContainer = document.getElementById('streamContainer');\n\n                if (data.items && data.items.length > 0) {\n                    \/\/ Channel is live\n                    const liveVideoId = data.items[0].id.videoId;\n                    statusElement.textContent = 'Channel is LIVE!';\n                    statusElement.className = 'status online';\n                    streamContainer.classList.add('active');\n                    \n                    streamContainer.innerHTML = `\n                        <iframe\n                            src=\"https:\/\/www.youtube.com\/embed\/${liveVideoId}?autoplay=1&rel=0&enablejsapi=1&mute=1\"\n                            frameborder=\"0\"\n                            allow=\"autoplay; encrypted-media\"\n                            allowfullscreen>\n                        <\/iframe>`;\n                } else {\n                    \/\/ Channel is not live\n                    statusElement.textContent = 'Channel is currently offline';\n                    statusElement.className = 'status offline';\n                    streamContainer.innerHTML = '';\n                    streamContainer.classList.remove('active');\n                }\n            } catch (error) {\n                console.error('Error checking live status:', error);\n                document.getElementById('status').textContent = 'Error checking stream status';\n            }\n        }\n\n        \/\/ Handle page visibility changes\n        document.addEventListener('visibilitychange', () => {\n            if (document.hidden) {\n                clearInterval(checkTimer);\n            } else {\n                checkLiveStatus();\n                checkTimer = setInterval(checkLiveStatus, CHECK_INTERVAL);\n            }\n        });\n\n        \/\/ Initial check and timer setup\n        checkLiveStatus();\n        checkTimer = setInterval(checkLiveStatus, CHECK_INTERVAL);\n    <\/script>\n<\/body>\n<\/html>\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-45f669f8 e-flex e-con-boxed e-con e-parent\" data-id=\"45f669f8\" data-element_type=\"container\" data-e-type=\"container\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t<div class=\"elementor-element elementor-element-2bf30ca1 e-con-full e-flex e-con e-child\" data-id=\"2bf30ca1\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-7c773430 elementor-widget elementor-widget-heading\" data-id=\"7c773430\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Live Events Schedule<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-52f370f4 e-con-full e-flex e-con e-child\" data-id=\"52f370f4\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-15d6e154 elementor-widget-tablet__width-initial elementor-widget-mobile__width-inherit elementor-widget__width-initial elementor-position-top elementor-widget elementor-widget-image-box\" data-id=\"15d6e154\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image-box.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-image-box-wrapper\"><figure class=\"elementor-image-box-img\"><a href=\"https:\/\/library.elementor.com\/local-services-wireframe-1-flexbox\/services\/#service_1\" tabindex=\"-1\"><img fetchpriority=\"high\" decoding=\"async\" width=\"500\" height=\"400\" src=\"https:\/\/luvernecoc.com\/wp-content\/uploads\/2024\/04\/1-e1714752266142.png\" class=\"elementor-animation-grow attachment-full size-full wp-image-358\" alt=\"\" srcset=\"https:\/\/luvernecoc.com\/wp-content\/uploads\/2024\/04\/1-e1714752266142.png 500w, https:\/\/luvernecoc.com\/wp-content\/uploads\/2024\/04\/1-e1714752266142-300x240.png 300w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><\/figure><div class=\"elementor-image-box-content\"><h4 class=\"elementor-image-box-title\"><a href=\"https:\/\/library.elementor.com\/local-services-wireframe-1-flexbox\/services\/#service_1\">7:00PM<\/a><\/h4><\/div><\/div>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-e8db17e elementor-widget-tablet__width-initial elementor-widget-mobile__width-inherit elementor-widget__width-initial elementor-position-top elementor-widget elementor-widget-image-box\" data-id=\"e8db17e\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image-box.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-image-box-wrapper\"><figure class=\"elementor-image-box-img\"><a href=\"https:\/\/library.elementor.com\/local-services-wireframe-1-flexbox\/services\/#service_2\" tabindex=\"-1\"><img decoding=\"async\" width=\"500\" height=\"400\" src=\"https:\/\/luvernecoc.com\/wp-content\/uploads\/2024\/04\/4-e1714752220383.png\" class=\"elementor-animation-grow attachment-full size-full wp-image-359\" alt=\"\" srcset=\"https:\/\/luvernecoc.com\/wp-content\/uploads\/2024\/04\/4-e1714752220383.png 500w, https:\/\/luvernecoc.com\/wp-content\/uploads\/2024\/04\/4-e1714752220383-300x240.png 300w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><\/figure><div class=\"elementor-image-box-content\"><h4 class=\"elementor-image-box-title\"><a href=\"https:\/\/library.elementor.com\/local-services-wireframe-1-flexbox\/services\/#service_2\">9:30AM<\/a><\/h4><\/div><\/div>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b2803cd elementor-widget-tablet__width-initial elementor-widget-mobile__width-inherit elementor-widget__width-initial elementor-position-top elementor-widget elementor-widget-image-box\" data-id=\"b2803cd\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image-box.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-image-box-wrapper\"><figure class=\"elementor-image-box-img\"><a href=\"https:\/\/library.elementor.com\/local-services-wireframe-1-flexbox\/services\/#service_3\" tabindex=\"-1\"><img decoding=\"async\" width=\"500\" height=\"400\" src=\"https:\/\/luvernecoc.com\/wp-content\/uploads\/2024\/04\/2-e1714751953117.png\" class=\"elementor-animation-grow attachment-full size-full wp-image-360\" alt=\"\" srcset=\"https:\/\/luvernecoc.com\/wp-content\/uploads\/2024\/04\/2-e1714751953117.png 500w, https:\/\/luvernecoc.com\/wp-content\/uploads\/2024\/04\/2-e1714751953117-300x240.png 300w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><\/figure><div class=\"elementor-image-box-content\"><h4 class=\"elementor-image-box-title\"><a href=\"https:\/\/library.elementor.com\/local-services-wireframe-1-flexbox\/services\/#service_3\">10:30AM<\/a><\/h4><\/div><\/div>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-58955eff elementor-widget-tablet__width-initial elementor-widget-mobile__width-inherit elementor-widget__width-initial elementor-position-top elementor-widget elementor-widget-image-box\" data-id=\"58955eff\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image-box.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-image-box-wrapper\"><figure class=\"elementor-image-box-img\"><a href=\"https:\/\/library.elementor.com\/local-services-wireframe-1-flexbox\/services\/#service_4\" tabindex=\"-1\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"400\" src=\"https:\/\/luvernecoc.com\/wp-content\/uploads\/2024\/04\/3-e1714752115882.png\" class=\"elementor-animation-grow attachment-full size-full wp-image-361\" alt=\"\" srcset=\"https:\/\/luvernecoc.com\/wp-content\/uploads\/2024\/04\/3-e1714752115882.png 500w, https:\/\/luvernecoc.com\/wp-content\/uploads\/2024\/04\/3-e1714752115882-300x240.png 300w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><\/figure><div class=\"elementor-image-box-content\"><h4 class=\"elementor-image-box-title\"><a href=\"https:\/\/library.elementor.com\/local-services-wireframe-1-flexbox\/services\/#service_4\">1:00PM<\/a><\/h4><\/div><\/div>\t\t\t\t<\/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<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Auto-Embedding YouTube Live Stream Checking stream status&#8230; Live Events Schedule 7:00PM 9:30AM 10:30AM 1:00PM<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-178","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/luvernecoc.com\/index.php?rest_route=\/wp\/v2\/pages\/178","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/luvernecoc.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/luvernecoc.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/luvernecoc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/luvernecoc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=178"}],"version-history":[{"count":110,"href":"https:\/\/luvernecoc.com\/index.php?rest_route=\/wp\/v2\/pages\/178\/revisions"}],"predecessor-version":[{"id":1480,"href":"https:\/\/luvernecoc.com\/index.php?rest_route=\/wp\/v2\/pages\/178\/revisions\/1480"}],"wp:attachment":[{"href":"https:\/\/luvernecoc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=178"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}