-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwatch.php
56 lines (39 loc) · 1.52 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
51
52
53
54
55
56
<?php
$dontShowNavbar=True;
require_once("include/header.php");
if(!isset($_GET["id"])){
ErrorMessage::show("No ID passed into this page");
}
$user=new User($con,$userLoggedin);
if(!$user->getIsSubscribed()){
ErrorMessage::show("You must be subscribed to see this.<a href='profile.php'>Click here to subscribe</a>");
}
$video=new Video($con,$_GET["id"]);
$video->incrementViews();
$upNextVideo=VideoProvider::getUpNext($con,$video);
?>
<!-- Chrome wont autoplay video if not muted if we diretly open the page with url -->
<div class="watchContainer">
<div class="videoControls watchNav">
<button class="watchBackButton"><i class="fas fa-arrow-left"></i></button>
<div>
<h1><?php echo $video->getTitle();?></h1>
<h3><?php echo $video->getSeasonAndEpisode();?></h3>
</div>
</div>
<div class="videoControls upNext" style="display: none;" >
<button class="replayButton"><i class="fas fa-redo"></i></button>
<div>
<h1><?php echo $upNextVideo->getTitle();?></h1>
<h3><?php echo $upNextVideo->getSeasonAndEpisode();?></h3>
<button class="playNextButton" onclick="watchVideo(<?php echo $upNextVideo->getId();?>)"><i class="fas fa-play"></i></button>
</div>
</div>
<video controls autoplay>
<source src="<?php echo $video->getFilePath(); ?>" type="video/mp4">
</video>
</div>
<script>
navAutoHide();
videoProgressTrack("<?php echo $video->getId(); ?>","<?php echo $userLoggedin; ?>");
</script>