import { BookTwoTone, MessageTwoTone, PlaySquareTwoTone, ProfileTwoTone } from '@ant-design/icons'; import { Card, Col, Row, Typography } from 'antd'; import Link from 'next/link'; import { FC, useContext } from 'react'; import { LogTable } from './LogTable'; import { OwncastLogo } from './common/OwncastLogo/OwncastLogo'; import { NewsFeed } from './NewsFeed'; import { ConfigDetails } from '../types/config-section'; import { ServerStatusContext } from '../utils/server-status-context'; const { Paragraph, Text } = Typography; const { Title } = Typography; const { Meta } = Card; function generateStreamURL(serverURL, rtmpServerPort) { return `rtmp://${serverURL.replace(/(^\w+:|^)\/\//, '')}:${rtmpServerPort}/live`; } export type OfflineProps = { logs: any[]; config: ConfigDetails; }; export const Offline: FC = ({ logs = [], config }) => { const serverStatusData = useContext(ServerStatusContext); const { serverConfig } = serverStatusData || {}; const { streamKey, rtmpServerPort } = serverConfig; const instanceUrl = global.window?.location.hostname || ''; let rtmpURL; if (instanceUrl && rtmpServerPort) { rtmpURL = generateStreamURL(instanceUrl, rtmpServerPort); } const data = [ { icon: , title: 'Use your broadcasting software', content: (
Learn how to point your existing software to your new server and start streaming your content.
Streaming URL: {rtmpURL && ( {rtmpURL} )} Stream Key: *********************
), }, { icon: , title: 'Embed your video onto other sites', content: (
Learn how you can add your Owncast stream to other sites you control.
), }, ]; if (!config?.chatDisabled) { data.push({ icon: , title: 'Chat is disabled', content: Chat will continue to be disabled until you begin a live stream., }); } if (!config?.yp?.enabled) { data.push({ icon: , title: 'Find an audience on the Owncast Directory', content: (
List yourself in the Owncast Directory and show off your stream. Enable it in{' '} settings.
), }); } if (!config?.federation?.enabled) { data.push({ icon: fediverse, title: 'Add your Owncast instance to the Fediverse', content: (
Enable Owncast social features to have your instance join the Fediverse, allowing people to follow, share and engage with your live stream.
), }); } return ( <>
No stream is active

You should start one.

{data.map(item => ( ))} ); }; export default Offline;