2021-01-04 12:28:09 -08:00
|
|
|
import Link from 'next/link';
|
2021-04-19 18:24:04 -07:00
|
|
|
import { Card, Row, Col, Input, Collapse, Typography } from 'antd';
|
2021-02-04 09:17:20 -08:00
|
|
|
import {
|
|
|
|
MessageTwoTone,
|
|
|
|
QuestionCircleTwoTone,
|
|
|
|
BookTwoTone,
|
|
|
|
PlaySquareTwoTone,
|
2021-02-17 11:40:22 -08:00
|
|
|
ProfileTwoTone,
|
2021-02-04 09:17:20 -08:00
|
|
|
} from '@ant-design/icons';
|
2021-02-06 22:38:58 -05:00
|
|
|
import OwncastLogo from '../components/logo';
|
|
|
|
import LogTable from '../components/log-table';
|
2021-04-03 21:25:21 -07:00
|
|
|
import NewsFeed from '../components/news-feed';
|
2021-04-09 04:22:46 +02:00
|
|
|
import { useContext } from 'react';
|
|
|
|
import { ServerStatusContext } from '../utils/server-status-context';
|
|
|
|
const { Paragraph, Text } = Typography;
|
2020-11-07 15:32:51 -08:00
|
|
|
|
2021-04-03 21:25:21 -07:00
|
|
|
const { Title } = Typography;
|
2020-11-13 03:43:28 -08:00
|
|
|
const { Meta } = Card;
|
2021-04-08 20:57:50 -07:00
|
|
|
const { Panel } = Collapse;
|
2020-11-13 03:43:28 -08:00
|
|
|
|
2021-04-09 04:22:46 +02:00
|
|
|
function generateStreamURL(serverURL) {
|
|
|
|
return `rtmp://${serverURL.replace(/(^\w+:|^)\/\//, '')}/live/`;
|
|
|
|
}
|
|
|
|
|
2021-02-17 19:41:04 +00:00
|
|
|
export default function Offline({ logs = [], config }) {
|
2021-04-09 04:22:46 +02:00
|
|
|
const serverStatusData = useContext(ServerStatusContext);
|
|
|
|
|
|
|
|
const { serverConfig } = serverStatusData || {};
|
2021-04-08 20:57:50 -07:00
|
|
|
const { streamKey } = serverConfig;
|
|
|
|
const instanceUrl = global.window?.location.hostname || '';
|
2021-04-09 04:22:46 +02:00
|
|
|
|
2020-11-07 15:32:51 -08:00
|
|
|
const data = [
|
|
|
|
{
|
2020-11-13 03:43:28 -08:00
|
|
|
icon: <BookTwoTone twoToneColor="#6f42c1" />,
|
2021-02-04 09:17:20 -08:00
|
|
|
title: 'Use your broadcasting software',
|
2020-11-07 15:32:51 -08:00
|
|
|
content: (
|
|
|
|
<div>
|
2021-02-26 14:38:55 -06:00
|
|
|
<a
|
2021-03-04 00:53:50 -08:00
|
|
|
href="https://owncast.online/docs/broadcasting/?source=admin"
|
2021-02-26 14:38:55 -06:00
|
|
|
target="_blank"
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
>
|
2021-02-04 09:17:20 -08:00
|
|
|
Learn how to point your existing software to your new server and start streaming your
|
|
|
|
content.
|
|
|
|
</a>
|
2021-04-08 20:57:50 -07:00
|
|
|
<Row align="middle">
|
|
|
|
<Col flex="none">
|
2021-04-19 18:24:04 -07:00
|
|
|
<Text>Streaming URL:</Text>
|
2021-04-08 20:57:50 -07:00
|
|
|
</Col>
|
|
|
|
<Col flex="auto">
|
|
|
|
<Paragraph className="stream-info-box" copyable>
|
|
|
|
{generateStreamURL(instanceUrl)}
|
|
|
|
</Paragraph>
|
|
|
|
</Col>
|
|
|
|
</Row>
|
|
|
|
|
|
|
|
<Row align="middle">
|
|
|
|
<Col flex="none">
|
2021-04-19 18:24:04 -07:00
|
|
|
<Text>Stream Key:</Text>
|
2021-04-08 20:57:50 -07:00
|
|
|
</Col>
|
|
|
|
<Col flex="auto">
|
|
|
|
<Paragraph className="stream-info-box" copyable={{ text: streamKey }}>
|
|
|
|
*********************
|
|
|
|
</Paragraph>
|
|
|
|
</Col>
|
|
|
|
</Row>
|
2020-11-07 15:32:51 -08:00
|
|
|
</div>
|
2021-02-04 09:17:20 -08:00
|
|
|
),
|
2020-11-07 15:32:51 -08:00
|
|
|
},
|
|
|
|
{
|
2020-11-13 03:43:28 -08:00
|
|
|
icon: <MessageTwoTone twoToneColor="#0366d6" />,
|
2021-02-04 09:17:20 -08:00
|
|
|
title: 'Chat is disabled',
|
|
|
|
content: 'Chat will continue to be disabled until you begin a live stream.',
|
2020-11-07 15:32:51 -08:00
|
|
|
},
|
2020-11-12 22:39:18 -08:00
|
|
|
{
|
2020-11-13 03:43:28 -08:00
|
|
|
icon: <PlaySquareTwoTone twoToneColor="#f9826c" />,
|
2021-02-04 09:17:20 -08:00
|
|
|
title: 'Embed your video onto other sites',
|
2020-11-12 22:39:18 -08:00
|
|
|
content: (
|
|
|
|
<div>
|
2021-03-04 08:54:26 +00:00
|
|
|
<a
|
|
|
|
href="https://owncast.online/docs/embed?source=admin"
|
|
|
|
target="_blank"
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
>
|
2021-02-04 09:17:20 -08:00
|
|
|
Learn how you can add your Owncast stream to other sites you control.
|
|
|
|
</a>
|
2020-11-12 22:39:18 -08:00
|
|
|
</div>
|
2021-02-04 09:17:20 -08:00
|
|
|
),
|
2020-12-22 17:54:32 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
icon: <QuestionCircleTwoTone twoToneColor="#ffd33d" />,
|
2021-02-04 09:17:20 -08:00
|
|
|
title: 'Not sure what to do next?',
|
2020-12-22 17:54:32 -08:00
|
|
|
content: (
|
|
|
|
<div>
|
2021-02-04 09:17:20 -08:00
|
|
|
If you're having issues or would like to know how to customize and configure your
|
|
|
|
Owncast server visit <Link href="/help">the help page.</Link>
|
2020-12-22 17:54:32 -08:00
|
|
|
</div>
|
|
|
|
),
|
2021-02-04 09:17:20 -08:00
|
|
|
},
|
2020-11-07 15:32:51 -08:00
|
|
|
];
|
2020-11-13 03:43:28 -08:00
|
|
|
|
2021-02-17 11:40:22 -08:00
|
|
|
if (!config?.yp?.enabled) {
|
|
|
|
data.push({
|
|
|
|
icon: <ProfileTwoTone twoToneColor="#D18BFE" />,
|
|
|
|
title: 'Find an audience on the Owncast Directory',
|
|
|
|
content: (
|
|
|
|
<div>
|
2021-02-17 19:41:04 +00:00
|
|
|
List yourself in the Owncast Directory and show off your stream. Enable it in{' '}
|
|
|
|
<Link href="/config-public-details">settings.</Link>
|
2021-02-17 11:40:22 -08:00
|
|
|
</div>
|
|
|
|
),
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2020-11-07 15:32:51 -08:00
|
|
|
return (
|
2020-12-03 22:55:04 -08:00
|
|
|
<>
|
2021-04-03 21:25:21 -07:00
|
|
|
<Row>
|
|
|
|
<Col span={12} offset={6}>
|
|
|
|
<div className="offline-intro">
|
|
|
|
<span className="logo">
|
|
|
|
<OwncastLogo />
|
|
|
|
</span>
|
|
|
|
<div>
|
|
|
|
<Title level={2}>No stream is active</Title>
|
|
|
|
<p>You should start one.</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-02-14 22:20:25 -08:00
|
|
|
</Col>
|
2021-04-03 21:25:21 -07:00
|
|
|
</Row>
|
|
|
|
<Row gutter={[16, 16]} className="offline-content">
|
2021-02-14 22:20:25 -08:00
|
|
|
<Col span={12} xs={24} sm={24} md={24} lg={12} className="list-section">
|
2021-02-04 09:17:20 -08:00
|
|
|
{data.map(item => (
|
2021-02-14 22:20:25 -08:00
|
|
|
<Card key={item.title} size="small" bordered={false}>
|
2021-02-04 09:17:20 -08:00
|
|
|
<Meta avatar={item.icon} title={item.title} description={item.content} />
|
|
|
|
</Card>
|
|
|
|
))}
|
2021-02-14 22:20:25 -08:00
|
|
|
</Col>
|
2021-04-03 21:25:21 -07:00
|
|
|
<Col span={12} xs={24} sm={24} md={24} lg={12}>
|
|
|
|
<NewsFeed />
|
|
|
|
</Col>
|
2021-02-14 22:20:25 -08:00
|
|
|
</Row>
|
2020-11-13 03:57:57 -08:00
|
|
|
<LogTable logs={logs} pageSize={5} />
|
2020-12-03 22:55:04 -08:00
|
|
|
</>
|
2020-11-07 15:32:51 -08:00
|
|
|
);
|
|
|
|
}
|