[feat] Add LiveStreaming Support #5691

Merged
neb-b merged 35 commits from feat/go-live into master 2021-03-23 00:48:10 +01:00
Showing only changes of commit 816bd07570 - Show all commits

View file

@ -35,7 +35,7 @@ export default function LivestreamLink(props: Props) {
fetch(`${BITWAVE_API}/${livestreamChannelId}`) fetch(`${BITWAVE_API}/${livestreamChannelId}`)
.then((res) => res.json()) .then((res) => res.json())
.then((res) => { .then((res) => {
if (res && res.data && res.data.success && res.data.data && res.data.data.live) { if (res && res.success && res.data && res.data.live) {
setIsLivestreaming(true); setIsLivestreaming(true);
} else { } else {
setIsLivestreaming(false); setIsLivestreaming(false);
@ -45,7 +45,8 @@ export default function LivestreamLink(props: Props) {
} }
let interval; let interval;
if (livestreamChannelId) { if (livestreamChannelId) {
interval = setInterval(fetchIsStreaming, 5000); if (!interval) fetchIsStreaming();
interval = setInterval(fetchIsStreaming, 15 * 1000);
} }
return () => { return () => {
if (interval) { if (interval) {