Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<!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