2020-09-22 20:08:14 +00:00
|
|
|
{{define "viewer"}}
|
|
|
|
<div class="container">
|
|
|
|
<div class="col-video">
|
|
|
|
<!-- Video -->
|
|
|
|
<div class="video-responsive">
|
2020-09-24 10:40:48 +00:00
|
|
|
<video id="viewer" poster="/static/img/no_stream.svg" muted controls autoplay></video>
|
2020-09-22 20:08:14 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- Links under video -->
|
|
|
|
<p>
|
2020-10-04 16:00:20 +00:00
|
|
|
<svg width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-box-arrow-up-right" fill="#d7d7d7" xmlns="http://www.w3.org/2000/svg">
|
2020-09-22 20:08:14 +00:00
|
|
|
<path fill-rule="evenodd"
|
|
|
|
d="M1.5 13A1.5 1.5 0 0 0 3 14.5h8a1.5 1.5 0 0 0 1.5-1.5V9a.5.5 0 0 0-1 0v4a.5.5 0 0 1-.5.5H3a.5.5 0 0 1-.5-.5V5a.5.5 0 0 1 .5-.5h4a.5.5 0 0 0 0-1H3A1.5 1.5 0 0 0 1.5 5v8zm7-11a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v5a.5.5 0 0 1-1 0V2.5H9a.5.5 0 0 1-.5-.5z" />
|
|
|
|
<path fill-rule="evenodd"
|
|
|
|
d="M14.354 1.646a.5.5 0 0 1 0 .708l-8 8a.5.5 0 0 1-.708-.708l8-8a.5.5 0 0 1 .708 0z" />
|
|
|
|
</svg>
|
2020-10-04 09:45:16 +00:00
|
|
|
<code>srt://{{.Cfg.Hostname}}:{{.Cfg.SRTServerPort}}?streamid={{.Path}}</code>
|
2020-09-24 10:40:48 +00:00
|
|
|
|
2020-10-04 09:45:16 +00:00
|
|
|
<svg class="ml-1" width="1em" height="1em" viewBox="0 0 20 20" fill="#d7d7d7" xmlns="http://www.w3.org/2000/svg">
|
2020-09-29 16:37:57 +00:00
|
|
|
<path d="M10 11c-5.92 0-8 3-8 5v3h16v-3c0-2-2.08-5-8-5z"/>
|
|
|
|
<circle cx="10" cy="5.5" r="4.5"/>
|
|
|
|
</svg>
|
|
|
|
<span id="connected-people">0</span>
|
2020-09-29 16:25:38 +00:00
|
|
|
|
2020-09-29 16:37:57 +00:00
|
|
|
<svg id="connectionIndicator" class="ml-1" width="1em" height="1em" viewBox="0 0 16 16" fill="#dc3545" xmlns="http://www.w3.org/2000/svg">
|
2020-09-24 10:40:48 +00:00
|
|
|
<rect width="4" height="5" x="1" y="10" rx="1"/>
|
|
|
|
<rect width="4" height="9" x="6" y="6" rx="1"/>
|
|
|
|
<rect width="4" height="14" x="11" y="1" rx="1"/>
|
|
|
|
</svg>
|
|
|
|
|
2020-10-04 09:57:42 +00:00
|
|
|
{{if .WidgetURL}}
|
2020-09-29 16:37:57 +00:00
|
|
|
<a href="#" id="sideWidgetToggle" class="ml-1" title="Cacher/Afficher le chat">»</a>
|
2020-10-04 09:57:42 +00:00
|
|
|
{{end}}
|
2020-09-22 20:08:14 +00:00
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
|
2020-10-04 09:57:42 +00:00
|
|
|
{{if .WidgetURL}}
|
2020-09-22 20:08:14 +00:00
|
|
|
<!-- Chat -->
|
|
|
|
<div class="col-chat" id="sideWidget">
|
2020-10-02 19:13:50 +00:00
|
|
|
<iframe src="{{.WidgetURL}}"
|
2020-09-29 15:47:36 +00:00
|
|
|
title="Chat" sandbox="allow-scripts allow-forms allow-same-origin"></iframe>
|
2020-09-22 20:08:14 +00:00
|
|
|
</div>
|
2020-10-04 09:57:42 +00:00
|
|
|
{{end}}
|
2020-09-22 20:08:14 +00:00
|
|
|
</div>
|
|
|
|
|
2020-10-04 15:51:44 +00:00
|
|
|
{{if .WidgetURL}}<script src="/static/js/sideWidget.js"></script>{{end}}
|
2020-09-22 20:08:14 +00:00
|
|
|
<script src="/static/js/viewer.js"></script>
|
2020-09-29 16:25:38 +00:00
|
|
|
<script src="/static/js/viewersCounter.js"></script>
|
2020-09-29 15:27:19 +00:00
|
|
|
<script>
|
|
|
|
const stunServers = [
|
|
|
|
{{range $id, $value := .Cfg.STUNServers}}
|
|
|
|
'{{$value}}',
|
|
|
|
{{end}}
|
|
|
|
]
|
|
|
|
startPeerConnection()
|
2020-09-29 16:44:32 +00:00
|
|
|
|
|
|
|
// Wait a bit before pulling viewers counter for the first time
|
|
|
|
setTimeout(() => {
|
|
|
|
refreshViewersCounter({{.Cfg.ViewersCounterRefreshPeriod}})
|
|
|
|
}, 1000)
|
2020-09-29 15:27:19 +00:00
|
|
|
</script>
|
2020-09-22 20:08:14 +00:00
|
|
|
{{end}}
|