[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 ec996d8bf7 - Show all commits

View file

@ -15,20 +15,14 @@ type Props = {
};
export default function LivestreamPage(props: Props) {
const {
uri,
claim,
doSetPlayingUri,
isAuthenticated,
doUserSetReferrer,
channelClaim,
} = props;
const { uri, claim, doSetPlayingUri, isAuthenticated, doUserSetReferrer, channelClaim } = props;
const [activeViewers, setActiveViewers] = React.useState(0);
const [isLive, setIsLive] = React.useState(false);
const livestreamChannelId = channelClaim && channelClaim.signing_channel && channelClaim.signing_channel.claim_id;
React.useEffect(() => {
function checkIsLive() {
// $FlowFixMe Bitwave's API can handle garbage
fetch(`${BITWAVE_API}/${livestreamChannelId}`)
.then((res) => res.json())
.then((res) => {
@ -87,11 +81,7 @@ export default function LivestreamPage(props: Props) {
return (
<Page className="file-page" filePage livestream>
<LivestreamLayout
uri={uri}
activeViewers={activeViewers}
isLive={isLive}
/>
<LivestreamLayout uri={uri} activeViewers={activeViewers} isLive={isLive} />
</Page>
);
}