-
Notifications
You must be signed in to change notification settings - Fork 2
/
watch.php
50 lines (38 loc) · 1.45 KB
/
watch.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
<?php
$hideNav = true;
require_once("includes/header.php");
if(!isset($_GET["id"])) {
ErrorMessage::show("No ID passed into page");
}
$user = new User($con, $userLoggedIn);
if(!$user->getIsSubscribed()){
ErrorMessage::show("You must be subscribed to watch this!
<a href='profile.php'>Click here to subscribe.</a>");
}
$video = new Video($con, $_GET["id"]);
$video->incrementViews();
$upNextVideo = VideoProvider::getUpNext($con, $video);
?>
<div class="watchContainer">
<div class="videoControls watchNav">
<button onclick="goBack()"><i class="fas fa-arrow-left"></i></button>
<h1><?php echo $video->getTitle(); ?></h1>
</div>
<div class="videoControls upNext" style="display:none;">
<button onclick="restartVideo();"><i class="fas fa-redo"></i></button>
<div class="upNextContainer">
<h2>Up next:</h2>
<h3><?php echo $upNextVideo->getTitle(); ?></h3>
<h3><?php echo $upNextVideo->getSeasonAndEpisode(); ?></h3>
<button class="playNext" onclick="watchVideo(<?php echo $upNextVideo->getId(); ?>)">
<i class="fas fa-play"></i> Play
</button>
</div>
</div>
<video controls autoplay onended="showUpNext()">
<source src='<?php echo $video->getFilePath(); ?>' type="video/mp4">
</video>
</div>
<script>
initVideo("<?php echo $video->getId(); ?>", "<?php echo $userLoggedIn; ?>");
</script>