aboutsummaryrefslogtreecommitdiff
path: root/src/StreamInfo.js
blob: 4b95e17f9e954167f471ee563e38a1ae7b95d3c4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import React from "react";
import { List } from "semantic-ui-react";
import Moment from "react-moment";
import "moment/locale/es";

const StreamInfo = props => {
  const { stream } = props;
  return (
    <>
      <List>
        <List.Item>
          <List.Icon name="users" />
          <List.Content>
            <List.Header>{`Usuarios escuchando: ${stream.listeners}`}</List.Header>
          </List.Content>
        </List.Item>
        <List.Item>
          <List.Icon name="clock" />
          <List.Content>
            <List.Header>
              Transmitiendo{" "}
              <Moment date={stream.stream_start} fromNow locale="es" />
            </List.Header>
          </List.Content>
        </List.Item>
        <List.Item>
          <List.Icon name="info" verticalAlign="middle" />
          <List.Content>
            <List.Header>{stream.server_name}</List.Header>
            {stream.server_description}
          </List.Content>
        </List.Item>
        <List.Item>
          <List.Icon name="file audio outline" verticalAlign="middle" />
          <List.Content>
            <List.Header>
              {stream["ice-channels"] === 2 ? "Stereo" : "Mono"}
            </List.Header>
            {`Bitrate: ${stream["ice-bitrate"]} kbps, ${stream["ice-samplerate"]} Hz`}
          </List.Content>
        </List.Item>
        <List.Item>
          <List.Icon name="sound" verticalAlign="middle" />
          <List.Content>
            <List.Header>Canción actual</List.Header>
            {`${stream.artist} - ${stream.title}`}
          </List.Content>
        </List.Item>
      </List>
      <a
        href={`${stream.listenurl.replace(
          "http://bienvenidoainternet.org:8000",
          "https://bienvenidoainternet.org:8443"
        )}.m3u`}
      >
        Descargar archivo m3u
      </a>
    </>
  );
};

export default StreamInfo;