remove baresip for now, use ices2

This commit is contained in:
rdl technix 2021-09-03 19:08:48 +02:00
parent 3409fb8ab8
commit 333146a182
10 changed files with 123 additions and 20 deletions

View file

@ -14,7 +14,7 @@ function App () {
</div>
<div className='App-main'>
<StreamControl id='darkice' state={state} />
<StreamControl id='baresip' state={state} />
{/* <StreamControl id='baresip' state={state} /> */}
</div>
<div className='App-side'>
<Meters value={state.meter} />
@ -69,7 +69,9 @@ function Meters (props) {
function StreamControl (props = {}) {
const { id = 'darkice', state = {} } = props
const command = useCommand()
const status = (state && state.streams && state.streams[id]) ? state.streams[id].status : 'stopped'
const stream = state && state.streams && state.streams[id]
const status = (stream && stream.status) || 'stopped'
const url = (stream && stream.url) || JSON.stringify(stream)
const disabled = command.pending || status === 'unknown'
let label
switch (status) {
@ -84,6 +86,10 @@ function StreamControl (props = {}) {
<ToggleButton active={active} disabled={disabled} onClick={onClick}>
{label}
</ToggleButton>
<div className='StreamControl-url'>
<h4>Stream address</h4>
{url && <code>{url}</code>}
</div>
<Log messages={state.log[id]} />
</div>
)

View file

@ -50,7 +50,14 @@
.StreamControl {
display: flex;
flex-direction: column;
/* width: 200px; */
//width: 250px;
width: 100%;
.StreamControl-url {
code {
font-weight: bold;
}
margin: 1rem 0;
}
}
.Meters {
padding: 10px;
@ -94,6 +101,7 @@
.StatusBar {
display: flex;
padding: 1rem;
> * {
display: block;
margin-right: 1rem;

View file

@ -66,7 +66,6 @@ export function useRemoteState (opts = {}) {
dispatch(action)
}
eventSource.onerror = () => {
console.log('ONERROR!!')
dispatch(action(CONNECTION_STATE, { error: `Failed to connect to backend` }))
if (retryInterval) setTimeout(reconnect, retryInterval)
}