-
Notifications
You must be signed in to change notification settings - Fork 0
/
watch.php
37 lines (31 loc) · 1.24 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
<?php
$hideNav = true;
require_once("includes/header.php");
if(!isset($_GET["id"])) {
ErrorMessage::show("No ID passed into page");
}
$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>