forked from forkiesassds/poktube
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplayer_vl.php
217 lines (202 loc) · 6.52 KB
/
player_vl.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
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
<?php
session_start();
include("db.php");
$link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . ":\/\/$_SERVER[HTTP_HOST]";
if(isset($_GET["v"])) {
$vid = htmlspecialchars($_GET["v"]);
}
//if $vid is null then dont show anything
if ($vid == null) {
die();
}
$vidfetch = mysqli_query($connect, "SELECT * FROM videodb WHERE VideoID='". $vid ."'");
$vdf = mysqli_fetch_assoc($vidfetch);
$Uploader = $vdf['Uploader'];
$isApproved = $vdf['isApproved'];
$VideoFile = $vdf['VideoFile'];
$HQVideoFile = $vdf['HQVideoFile'];
if ($isApproved != 1) {
if(isset($_SESSION["username"])) {
$result = mysqli_query($connect,"SELECT * FROM users WHERE `username` = '". $_SESSION["username"] ."'");
$adf = mysqli_fetch_assoc($result);
$admin = 0;
if($adf['is_admin'] == 1 || $Uploader == $_SESSION["username"]) { // is logged in?
$admin = 1;
} else {
include("header.php");
echo "<div class='tableSubTitle'>403</div>
Wow, just wow... Did you really try to bypass this video is private error by loading up the player directly?";
include("footer.php");
die();
}
} else {
include("header.php");
echo "<div class='tableSubTitle'>403</div>
Wow, just wow... Did you really try to bypass this video is private error by loading up the player directly?";
include("footer.php");
die();
}
}
$userfetch = mysqli_query($connect, "SELECT * FROM users WHERE username='". $Uploader ."'"); // calls for channel info
$udf = mysqli_fetch_assoc($userfetch);
if ($udf['isBanned'] == true AND $udf['bannedUntil'] > time()) {
if(isset($_SESSION["username"])) {
$result = mysqli_query($connect,"SELECT * FROM users WHERE `username` = '". $_SESSION["username"] ."'");
$adf = mysqli_fetch_assoc($result);
$admin = 0;
if($adf['is_admin'] == 1 || $Uploader == $_SESSION["username"]) // is logged in?
{
$admin = 1;
}
else
{
include("header.php");
echo "<div class='tableSubTitle'>403</div>
Wow, just wow... Did you really try to bypass this video is uploaded by banned user error by loading up the player directly?";
include("footer.php");
die();
}
} else {
include("header.php");
echo "<div class='tableSubTitle'>403</div>
Wow, just wow... Did you really try to bypass this video is uploaded by banned user error by loading up the player directly?";
include("footer.php");
die();
}
}
$image = "content/thumbs/". $vid .".png"; // set this for thumbnail
$name = ""; // self-explanatory
$vidfetch = mysqli_query($connect, "SELECT * FROM videodb WHERE VideoID='". $vid ."'");
$vdf = mysqli_fetch_assoc($vidfetch);
//do not show anything if the video-stream dosent exist
if (isset($vdf['VideoName'])) {
$name = $vdf['VideoName'];
} else {
$name = "PLACEHOLDER";
}
//vlplayer for the average site, made by icanttellyou.
//you can write your own code to fill in these values.
//customization guide:
// playerstlye: value must be either 2007HD, 2009HD or 2012,
// playerautoplay: boolian string, determins if player will autoplay.
// playerbuttoncolor: value must be either red, orange, gold, olive, green, teal, blue, violet, pink, magenta or white.
// playerbackgroundcolor: value must be either red, orange, gold, olive, green, teal, blue, violet, pink, magenta, white or black.
// videopath: path to your video.
// hdvideopath: path to hd quolity video, not nessecairy if $videoishd is false.
// thunb: thumbnail that will show before video will play.
// watchpagepath: path to your watch page.
// videoid: the video id your video is using.
// videoishd: determains if the video is hd.
// videolength: the length of your video.
$playerstyle = "2007HD";
$playerautoplay = "true";
$playerbuttoncolor = "teal";
$playerbackgroundcolor = "white";
$videopath = $link."/".$VideoFile;
$hdvideopath = $link."/".$HQVideoFile;
$thumb = $image;
$watchpagepath = "frontend/vidlii/watch.php?v=";
$videoid = $vid;
$videoishd = true;
$videolength = 0;
?>
<link rel="stylesheet" type="text/css" href="Dxba6_VY.css">
<script src="lib/jquery-3.6.0.min.js"></script>
<script src="vlPlayer/main15.js"></script>
<div id="vtbl_pl">
<script id="heightAdjust">
if (!window.videoInfo)
var videoInfo = {};
function adjustHeight(n) {
var height;
var par = $("#heightAdjust").parent();
if (par[0].style.height) {
height = par.height();
par.height(height+n);
}
}
// Easier way of setting cookies
function setCookie(name, value) {
var CookieDate = new Date;
CookieDate.setFullYear(CookieDate.getFullYear() + 10);
document.cookie = name+'='+value+'; expires=' + CookieDate.toGMTString( ) + '; path=/';
}
// Easier way of getting cookies
function getCookie(cname) {
var name = cname + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var ca = decodedCookie.split(';');
for(var i = 0; i <ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
function getTimeHash() {
var h = 0;
var st = 0;
if ((h = window.location.href.indexOf("#t=")) >= 0) {
st = window.location.href.substr(h+3);
return parseInt(st);
}
return 0;
}
var vlpColors = "<?php echo $playerbuttoncolor ?>,<?php echo $playerbackgroundcolor ?>";
vlpColors = vlpColors.split(",");
var viValues = {
variable: "vlp",
src: "<?php echo $videopath ?>",
hdsrc: "<?php echo $hdvideopath ?>",
img: "<?php echo $thumb ?>",
url: "<?php echo $videoid ?>",
duration: <?php echo $videolength ?>,
autoplay: <?php echo $playerautoplay ?>,
skin: "<?php echo $playerstyle ?>",
btcolor: vlpColors[0],
bgcolor: vlpColors[1],
adjust: true,
start: getTimeHash()
};
for (var i in viValues) {
if (videoInfo[i] === void(0)) {
videoInfo[i] = viValues[i];
}
}
</script>
<div class="vlPlayer">
<script>
window[videoInfo.variable] = new VLPlayer({
id: videoInfo.id,
src: videoInfo.src,
hdsrc: <?php if($videoishd == true) {
echo "videoInfo.hdsrc";
} else {
echo "null";
}?>,
preview: videoInfo.img,
videoUrl: "<?php echo $watchpagepath ?>"+videoInfo.url,
duration: videoInfo.duration,
autoplay: videoInfo.autoplay,
skin: "vlPlayer/skins/"+videoInfo.skin,
adjust: videoInfo.adjust,
btcolor: videoInfo.btcolor,
bgcolor: videoInfo.bgcolor,
start: videoInfo.start,
expand: videoInfo.expand,
complete: videoInfo.complete,
ended: videoInfo.ended
});
$(window).on('hashchange', function() {
var t = getTimeHash();
vlp.play();
vlp.seek(t);
$(window).scrollTop(0);
});
</script>
</div>
</div>