<!DOCTYPE html>
<html>
<head>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' />
<title>{{ configuration['pagetitle'] }} - Stream Overview</title>
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='style.default.css') }}">
</head>
<body>
<header>
	<h1>{{ configuration["pagetitle"] }}</h1>
	<h2>{{ configuration["subtitle"] }}</h2>
</header>
<main>
{% if applications == [] %}
  <p style="margin-top: 20px; margin-bottom: 150px;">
    <span style="color: #888; font-size: 14pt;">There are currently no streams running</span>
  </p>
{% endif %}
{% for application in applications %}
<h1>{{ application[0] }}</h1>
    {% for stream in application[1] %}
    <article>
      <h2> stream {{ stream[0] }}</h2>
      <table>
        <tbody>
          <tr>
            <th>Protocol</th>
            <th>URL</th>
            <th></th>
          </tr>
          {% for substream in stream[1] %}
              <tr>
		<td>RTMP {{ substream }}</td>
		<td><em class="url">rtmp://{{ configuration["rtmp_base"] }}/{{ application[0] }}/{{ substream }}</em></td>
		<td class="btn"><a href="rtmp://{{ configuration['rtmp_base'] }}/{{ application[0] }}/{{ substream }}" class="btn btn-red">&#9654;<br/>RTMP</a></td>
              </tr>
          {% endfor %}
          <tr>
            <td>HLS m3u8</td>
            <td><em class="url">{{ configuration['web_proto'] }}://{{ configuration['base_url'] }}/hls/{{ stream[0] }}.m3u8</em></td>
            <td class="btn"><a href="{{ url_for('frontend.show_player', appname=application[0], stream=stream[0]) }}" class="btn btn-green">&#9654;<br/>HLS.js</a></td>
          </tr>
        </tbody>
      </table>
    </article>
{% endfor %}
{% endfor %}
</main>
<footer>
{{ configuration["footer"] }}
</footer>
</body>
</html>
