2020-10-23 01:18:18 +02:00
|
|
|
import React, { useContext } from 'react';
|
2020-11-06 03:30:14 +01:00
|
|
|
import { ServerStatusContext } from '../utils/server-status-context';
|
2020-10-23 01:18:18 +02:00
|
|
|
|
|
|
|
|
|
|
|
export default function BroadcastInfo() {
|
2020-11-06 03:30:14 +01:00
|
|
|
const context = useContext(ServerStatusContext);
|
2020-10-23 01:18:18 +02:00
|
|
|
const { broadcaster } = context || {};
|
|
|
|
const { remoteAddr, time, streamDetails } = broadcaster || {};
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div style={{border: '1px solid green', width: '100%'}}>
|
|
|
|
<h2>Broadcast Info</h2>
|
|
|
|
<p>Remote Address: {remoteAddr}</p>
|
|
|
|
<p>Time: {(new Date(time)).toLocaleTimeString()}</p>
|
|
|
|
<p>Stream Details: {JSON.stringify(streamDetails)}</p>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|