-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathplaylist.php
66 lines (64 loc) · 1.51 KB
/
playlist.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
require_once "hvp-settings.class.php";
require_once "hvp-playlist.class.php";
$settings = new Hvp\Settings ();
$playlist = new Hvp\Playlist ();
/* clear playlist */
if (isset ($_GET['action']) && $_GET['action'] == 'clear') {
$items = $playlist->get_playlist ();
foreach ($items as $item) {
$playlist->remove_item ($item['hash']);
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Playlist - <?php echo $settings->title ?></title>
<meta charset="utf-8" />
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" href="style-playlist.css" />
</head>
<body>
<header>
<h1>Home Video Player Administration</h1>
</header>
<div id="content-wrapper">
<div id="main-content">
<div id="playlist">
<p>Right click and copy the URL into your media player.</p>
<ol>
<?php
$items = $playlist->get_playlist ();
foreach ($items as $item) {
$name = "${item['name']}";
$filename = "media-files/${item['hash']}";
$filesize = filesize ($filename);
$filesize_h = ceil ($filesize / 1024 / 1024);
echo "<li>";
echo "<a href=\"${filename}\">${name}</a> ";
echo "${filesize_h} Mo";
echo "</li>";
}
?>
</ol>
</div>
</div>
<div id="side-panel-wrapper">
<div id="side-panel-inner">
<div id="action-panel">
<ul>
<li><a href="playlist-m3u.php">Export playlist</a></li>
<li><a href="playlist.php?action=clear">Clear playlist</a></li>
</ul>
</div>
</div>
</div>
</div>
<footer>
<?php
require "footer.php";
?>
</footer>
</body>
</html>