diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index ba54ffb..4b33300 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -54,6 +54,7 @@ jobs: NEXT_PUBLIC_GOOGLE_CALENDAR_SHARE_URL: ${{ secrets.NEXT_PUBLIC_GOOGLE_CALENDAR_SHARE_URL }} NEXT_PUBLIC_METADATA_API: ${{ secrets.NEXT_PUBLIC_METADATA_API }} NEXT_PUBLIC_PLAYER_MODE: ${{ secrets.NEXT_PUBLIC_PLAYER_MODE_DEVELOP }} + NEXT_PUBLIC_HLS_MODE: ${{ secrets.NEXT_PUBLIC_HLS_MODE }} NEXT_PUBLIC_SHOUTBOX_SOURCE: ${{ secrets.NEXT_PUBLIC_SHOUTBOX_SOURCE }} NEXT_PUBLIC_SHOW_START_TIME: ${{ secrets.NEXT_PUBLIC_SHOW_START_TIME}} GA_API_KEY: ${{ secrets.GA_API_KEY}} diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml index 6ec9ff0..d3171b5 100644 --- a/.github/workflows/production.yml +++ b/.github/workflows/production.yml @@ -53,6 +53,7 @@ jobs: NEXT_PUBLIC_GOOGLE_CALENDAR_SHARE_URL: ${{ secrets.NEXT_PUBLIC_GOOGLE_CALENDAR_SHARE_URL }} NEXT_PUBLIC_METADATA_API: ${{ secrets.NEXT_PUBLIC_METADATA_API }} NEXT_PUBLIC_PLAYER_MODE: ${{ secrets.NEXT_PUBLIC_PLAYER_MODE_PROD }} + NEXT_PUBLIC_HLS_MODE: ${{ secrets.NEXT_PUBLIC_HLS_MODE }} NEXT_PUBLIC_SHOUTBOX_SOURCE: ${{ secrets.NEXT_PUBLIC_SHOUTBOX_SOURCE }} NEXT_PUBLIC_SHOW_START_TIME: ${{ secrets.NEXT_PUBLIC_SHOW_START_TIME}} GA_API_KEY: ${{ secrets.GA_API_KEY}} diff --git a/pages/_app.tsx b/pages/_app.tsx index 28a117c..42f9989 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -8,6 +8,8 @@ import { ChatWrapper } from '@/components/ShoutBox/shoutbox'; import VideoPlayer from '@/components/videoPlayer'; import { ShoutBoxAndVideoProvider } from '@/hooks/useShoutboxAndVideo'; +const isHlsLive = process.env.NEXT_PUBLIC_HLS_MODE === 'live'; + const AUDIO_STREAM_URL = 'https://player.turunwappuradio.com/wappuradio.mp3'; const HLS_STREAM_URL = 'https://stream.turunwappuradio.com/twr_chunklist.m3u8'; @@ -20,7 +22,7 @@ const MyApp = ({ Component, pageProps }: AppProps) => { const [playClicked, setPlayClicked] = useState(false); const loadAudioStream = () => { - if (Hls.isSupported()) { + if (Hls.isSupported() && isHlsLive) { hls.current = new Hls(); hls.current.loadSource(HLS_STREAM_URL); hls.current.attachMedia(audioEl.current);