From 2e2b730b850cd74b1652479f945567bcf68425dd Mon Sep 17 00:00:00 2001 From: Thilo Billerbeck Date: Fri, 9 Apr 2021 04:22:46 +0200 Subject: [PATCH] added stream conneciton info box to offline notice (#107) --- web/pages/offline-notice.tsx | 37 +++++++++++++++++++++++++++++++++++- web/styles/globals.scss | 22 ++++++++++++--------- 2 files changed, 49 insertions(+), 10 deletions(-) diff --git a/web/pages/offline-notice.tsx b/web/pages/offline-notice.tsx index b3e7004ec..a1634bf79 100644 --- a/web/pages/offline-notice.tsx +++ b/web/pages/offline-notice.tsx @@ -1,26 +1,61 @@ import Link from 'next/link'; -import { Typography, Card, Row, Col } from 'antd'; +import { Result, Card, Row, Col, Input, Form, Typography } from 'antd'; import { MessageTwoTone, QuestionCircleTwoTone, BookTwoTone, PlaySquareTwoTone, ProfileTwoTone, + CopyOutlined, } from '@ant-design/icons'; import OwncastLogo from '../components/logo'; import LogTable from '../components/log-table'; import NewsFeed from '../components/news-feed'; +import { useContext } from 'react'; +import { ServerStatusContext } from '../utils/server-status-context'; +const { Paragraph, Text } = Typography; const { Title } = Typography; const { Meta } = Card; +function generateStreamURL(serverURL) { + return `rtmp://${serverURL.replace(/(^\w+:|^)\/\//, '')}/live/`; +} + export default function Offline({ logs = [], config }) { + const serverStatusData = useContext(ServerStatusContext); + + const { serverConfig } = serverStatusData || {}; + const { streamKey, yp } = serverConfig; + let { instanceUrl } = yp; + const data = [ { icon: , title: 'Use your broadcasting software', content: (
+ + + Stream-URL: + + + + {generateStreamURL(instanceUrl)} + + + + + + + Stream-Key: + + + + ********************* + + +