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 6b75452
Showing 1 changed file with 3 additions and 1 deletion.
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 6b75452

Please sign in to comment.