import { BookTwoTone, MessageTwoTone, PlaySquareTwoTone, ProfileTwoTone, QuestionCircleTwoTone, } from '@ant-design/icons'; import { Card, Col, Row, Typography } from 'antd'; import Link from 'next/link'; import { useContext } from 'react'; import LogTable from './log-table'; import OwncastLogo from './logo'; import NewsFeed from './news-feed'; 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`; } type OfflineProps = { logs: any[]; config: ConfigDetails; }; export default function Offline({ logs = [], config }: OfflineProps) { const serverStatusData = useContext(ServerStatusContext); const { serverConfig } = serverStatusData || {}; const { streamKey, rtmpServerPort } = serverConfig; const instanceUrl = global.window?.location.hostname || ''; 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: {generateStreamURL(instanceUrl, rtmpServerPort)} 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.
), }); } data.push({ icon: , title: 'Not sure what to do next?', content: (
If you're having issues or would like to know how to customize and configure your Owncast server visit the help page.
), }); return ( <>
No stream is active

You should start one.

{data.map(item => ( ))} ); }