-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathv.php
More file actions
executable file
·100 lines (92 loc) · 2.56 KB
/
Copy pathv.php
File metadata and controls
executable file
·100 lines (92 loc) · 2.56 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?php
include_once 'header.php';
?>
<!DOCTYPE html />
<html>
<head>
<?php
include_once 'default_head.php';
?>
<script src="<?php echo(VDX_HOME);?>/js/player.js"></script>
</head>
<body>
<?php
$slp = strrpos($_SERVER['REQUEST_URI'], '/');
$video_id = substr($_SERVER['REQUEST_URI'], $slp + 1);
if(strlen($video_id == 0)){
header('location: ' . VDX_HOME);
return;
}
$qry_res = $db->query("SELECT * FROM videos WHERE id='$video_id'");
?>
<script>
function search(){
var vl = $("#menu_src").val();
window.location.href = "<?php echo(VDX_HOME); ?>/?qry=" + vl;
}
var VDX_HOME = '<?php echo(VDX_HOME); ?>';
var video_id = <?php echo($video_id); ?>;
</script>
<?php
include_once 'menu.php';
?>
<?php
if(!$qry_res || $qry_res->num_rows != 1){
?>
<div class="playercontainer">
<?php
echo("<p style='color:red; text-align: center; width: 100%'>Video not found</p>");
if(!$qry_res){
echo("<br/><p style='color:red; text-align: center; width: 100%'>Error: " . mysqli_error($db) . '</p>');
}
$db->close();
?>
</div>
</body>
</html>
<?php
return;
}
$title = 'MISSING_TITLE';
$desc = 'MISSING_DESC';
$uploader_id = -1;
$uploader_name = "";
while($row = $qry_res->fetch_array()){
$title = $row['title'];
$desc = $row['description'];
$uploader_id = $row['user_id'];
$usr_res = $db->query("SELECT username FROM users WHERE id='$uploader_id'");
if(!$usr_res || $usr_res->num_rows != 1){
$uploader_name = "MISSING";
}else{
while($rw = $usr_res->fetch_array()){
$uploader_name = $rw['username'];
}
}
}
$db->close();
?>
<div class="playercontainer">
<div class="video_side">
<h2><?php echo($title); ?></h2>
<h3>Uploaded by: <?php echo($uploader_name); ?></h3>
<br />
<h4><?php echo($desc); ?></h4>
</div>
<div class="video_main">
<video id="vd1">
<source id="src0" />
</video>
<div class="playercontrols" id="ctrls">
<button id="play_pause_btn" class="playButton fa fa-play" onclick="playVideo(1)"></button>
<button id="volume_down_btn" class="volumeButton fa fa-volume-down"></button>
<button id="btn_240" class="qualitybutton selected">240</button>
<button id="btn_480" class="qualitybutton">480</button>
<button id="btn_orig" class="qualitybutton">original</button>
<button id="btn_fullscreen" class="qulaitybutton fa fa-expand"></button>
<progress id="progress" class="progress" min="0" max="100" value="0">0% progress</progress>
</div>
</div>
</div>
</body>
</html>