Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
TVHeadend/HTS Channels: Just a simple HTML-page with direct links to your HTS-setup. The added extension .m4v allows videoplay in Android. It's not great, but it should do it's job.
<?php
$url = 'http://username:password@tvheadend-address/ip:9981/stream/channelnumber/%d.m4v';
// Personal ZiggoNL channels
$array = [
1 => 'NPO1 HD',
2 => 'NPO2 HD',
3 => 'NPO3 HD',
6 => 'SBS6 HD',
7 => 'RTL7 HD',
8 => 'Veronica HD',
14 => 'Ziggo Sport HD',
17 => 'Discovery HD',
18 => 'National Geographic Channel HD',
20 => 'Eurosport 1 HD',
22 => 'BBC First HD',
30 => 'L1TV',
40 => 'TV Maastricht',
51 => 'één HD',
52 => 'Canvas HD',
61 => 'BBC One HD',
401 => 'Ziggo Sport Select HD',
402 => 'Ziggo Sport Voetbal HD',
403 => 'Ziggo Sport Golf',
404 => 'Ziggo Sport Racing',
405 => 'Ziggo Sport Extra1',
406 => 'Ziggo Sport Extra2',
421 => 'Fox Sports 1 HD',
422 => 'Fox Sports 2 HD',
423 => 'Fox Sports 3 HD',
424 => 'Fox Sports 4 HD',
425 => 'Fox Sports 5 HD',
426 => 'Fox Sports 6 HD',
504 => 'BBC World News',
802 => 'NPO Radio 2',
809 => 'Radio Veronica'
];
?>
<!DOCTYPE html>
<html lang="nl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTS/TVHeadend Channels</title>
<style>
*{margin:0;padding:0}
body{font:"Open Sans", Arial 12px}
div{width:100%;height:32px;border-bottom:1px solid #ddd}
a{width:100%;line-height:32px;color:#a0a0a0;text-decoration:none;padding:0 20px}
</style>
</head>
<body>
<?php foreach ($array as $num => $name): ?>
<div>
<a href="<?= sprintf($url, $num) ?>"><?= $name ?></a>
</div>
<?php endforeach; ?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment