Skip to content

Instantly share code, notes, and snippets.

@Keridos
Last active November 8, 2020 12:21
Show Gist options
  • Save Keridos/a049b521c3de6f1f6cf2f3dd78b09493 to your computer and use it in GitHub Desktop.
Save Keridos/a049b521c3de6f1f6cf2f3dd78b09493 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<title>title</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="container">
<div id="header">
<div class="spacer"></div>
<div class="header-image">
<img src="img/wusel_infos.png"/>
</div>
<div class="header-item" id="header-center">
<h1>Orientierungseinheit Informatik Uni Boon 2020</h1>
<div id="timetable">
<a href="https://oe.fachschaft.info/#stream" target="_blank">Zeitplan</a>
</div>
</div>
<div class="header-image">
<img src="img/wusel_lern.png"/>
</div>
<div class="spacer"></div>
</div>
<div id="main">
<div id="player"></div>
<iframe src="https://kiwiirc.com/client/chat.freenode.net/?&theme=relaxed#channel" id="chat"></iframe>
</div>
<p>Video-URL für externe Player: <a id="streamUrl" href="#"></a></p>
</div>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@clappr/player@latest/dist/clappr.min.js"></script>
<script type="text/javascript" src="level-selector.js"></script>
<script>
const urlParams = new URLSearchParams(window.location.search);
const availableMirrors = ['mirror1', 'mirror2'];
let mirror = urlParams.get('mirror');
if (!mirror) {
mirror = availableMirrors[Math.floor(Math.random() * availableMirrors.length)];
}
const streamUrl = `https://${mirror}.{{ netbase__domain }}/stream1.m3u8`;
const player = new Clappr.Player({
source: streamUrl,
autoPlay: false,
plugins: [LevelSelector],
levelSelectorConfig: {
title: 'Auflösung',
labels: {
1: '{{ stream_label_hd }}',
0: '{{ stream_label_sd }}',
}
},
parentId: "#player",
width: "100%",
height: "100%",
mediacontrol: {seekbar: "#2180BC", buttons: "#2180BC"},
hlsjsConfig: {
liveSyncDurationCount: 1,
liveMaxLatencyDurationCount: 5,
startFragPrefetch: true
}
});
let streamUrlElement = document.getElementById('streamUrl');
streamUrlElement.textContent = streamUrl;
streamUrlElement.href = streamUrl;
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment