Skip to content

Commit

Permalink
Hls live check
Browse files Browse the repository at this point in the history
  • Loading branch information
P4likka committed Apr 19, 2024
1 parent 875c3b6 commit 802b3cc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down
4 changes: 3 additions & 1 deletion pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -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);
Expand Down

0 comments on commit 802b3cc

Please sign in to comment.