This repository has been archived by the owner on Sep 21, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
watch.php
165 lines (138 loc) · 6.23 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
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
<?php
require('inc/lang.inc.php');
require('inc/functions.inc.php');
// File infos
$filePath = $_GET['file'];
$pathInfo = pathinfo($filePath);
// User OS
$detect_OS = detect_OS();
// Get the next and the previous video file if current file is a video too
if (isVideoFile($filePath)):
$listof_dir = array(); // Global used by get_nextnprev
$nextnprev = get_nextnprev($filePath);
$prev = $nextnprev['prev'];
$next = $nextnprev['next'];
else:
$prev = NULL;
$next = NULL;
endif;
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="robots" content="noindex" />
<title>CakeBox - <?php echo $lang[LOCAL_LANG]['watch_title']; ?></title>
<meta charset="utf-8">
<link rel="icon" type="image/ico" href="favicon.ico" />
<!-- Style & ergo -->
<link href='http://fonts.googleapis.com/css?family=Changa+One|Droid+Sans:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="ressources/style.css" type="text/css" media="screen">
<link rel="stylesheet" href="ressources/reset.css" type="text/css" media="screen">
<script lang="javascript">
var lang_ok_unmark = '<?php echo $lang[LOCAL_LANG]['ok_unmark']; ?>';
var lang_ok_mark = '<?php echo $lang[LOCAL_LANG]['ok_mark']; ?>';
</script>
<script src="ressources/oXHR.js"></script>
<!-- / Style & ergo -->
<?php if ($detect_OS == "Linux-Windows-others" && isVideoFile($filePath)): ?>
<!-- VLC Controls -->
<link rel="stylesheet" type="text/css" href="ressources/vlc-styles.css" />
<script language="javascript" src="ressources/jquery.min.js"></script>
<script language="javascript" src="ressources/jquery-vlc.js"></script>
<script language="javascript">
function play(instance, uri) {
VLCobject.getInstance(instance).play(uri);
}
var player = null;
$(document).ready(function() {
player = VLCobject.embedPlayer('vlc1', 600, 400, true);
});
</script>
<!-- / VLC Controls -->
<?php endif; ?>
</head>
<body <?php if ($detect_OS == "Linux-Windows-others" && isVideoFile($filePath)): ?> onload="play('vlc1', '<?php echo DOWNLOAD_LINK.addslashes($filePath); ?>')" <?php endif; ?>>
<header>
<div id="logo">
<a href="index.php">
<span class="first">Cake</span>
<span class="second">Box</span>
</a>
</div>
</header>
<section id="content">
<h2><?php echo $pathInfo['filename'] ?></h2>
<?php
if (isVideoFile($filePath)):
if (SEEN_MODE_ENABLE):
?>
<div id="popcorn" class="littleh2">
<?php
// If file is not marked as "already seen"
if (!file_exists("data/".$pathInfo['basename'])):
?>
<?php echo $lang[LOCAL_LANG]['have_you_finished']; ?>
<span class="mark" onclick="markfile('<?php echo addslashes($pathInfo['basename']); ?>');"><?php echo $lang[LOCAL_LANG]['click_remind']; ?></span>
<a href="#" class="tooltip" style="text-decoration: underline;">
<?php echo $lang[LOCAL_LANG]['what_zat']; ?>
<span><?php echo $lang[LOCAL_LANG]['popcorn_details']; ?></span>
</a>
<?php else: ?>
Hey, <span class="unmark"><?php echo $lang[LOCAL_LANG]['do_you_remember']; ?></span>
<span class="update_info" style="text-decoration: underline;cursor:pointer;" onclick="unmarkfile('<?php echo addslashes($pathInfo['basename']); ?>')"><?php echo $lang[LOCAL_LANG]['cancel_please']; ?></span>
<?php endif; ?>
</div>
<?php endif; //!SEEN_MODE_ENABLE ?>
<hr class="clear" />
<p style="text-align:center;margin-bottom:10px;">
<a href="https://github.com/MardamBeyK/Cakebox/wiki/Impossible-de-lire-une-vid%C3%A9o-en-streaming" target="_blank" class="help"><?php echo $lang[LOCAL_LANG]['help_watching']; ?></a>
</p>
<center>
<?php if ($detect_OS == "OSX" || USE_DIVX): ?>
<!-- Embed DivX Player (for OS X) -->
<object classid="clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616" width="<?php echo DIVX_WIDTH ?>" height="<?php echo DIVX_HEIGTH ?>" codebase="http://go.divx.com/plugin/DivXBrowserPlugin.cab">
<param name="custommode" value="none" />
<param name="autoPlay" value="<?php echo DIVX_AUTOPLAY ?>" />
<param name="src" value="<?php echo DOWNLOAD_LINK.$filePath; ?>" />
<embed type="video/divx" src="<?php echo DOWNLOAD_LINK.$filePath; ?>" custommode="none" width="<?php echo DIVX_WIDTH ?>" height="<?php echo DIVX_HEIGTH ?>" autoPlay="<?php echo DIVX_AUTOPLAY ?>" pluginspage="http://go.divx.com/plugin/download/"></embed>
</object>
<!-- / DivX -->
<?php else: ?>
<!-- Embed VLC (for Windows & Linux) -->
<div id="vlc1" style="margin-bottom:50px;">player 1</div>
<!-- / VLC -->
<?php endif; ?>
<?php
// Show the "previous" and "next" link under the player
if ($prev != NULL)
{
echo '<div style="margin:40px 0px 10px 0px;">';
echo '<a href="watch.php?file='.$prev.'" class="next_episode">';
echo "← ".$lang[LOCAL_LANG]['watch_previous'];
echo '</a></div>';
}
if ($next != NULL)
{
echo '<div style="margin:10px 0px 40px 0px;padding-left:30px;">';
echo '<a href="watch.php?file='.$next.'" class="next_episode">';
echo $lang[LOCAL_LANG]['watch_next']." →";
echo '</a></div>';
}
?>
</center>
<?php endif; //!Is video file ?>
<div class="download_button">
<a href="<?php echo DOWNLOAD_LINK.$filePath; ?>" download="<?php echo $pathInfo['basename']; ?>">
<img src="ressources/<?php echo $lang[LOCAL_LANG]['file_img_download']; ?>" />
</a><br/>
<?php echo $lang[LOCAL_LANG]['right_click']; ?><br/>
<strong><?php echo $lang[LOCAL_LANG]['size']; ?></strong> <?php echo getFileSize($filePath); ?>
</div>
<br />
<br />
</section>
<footer>
<div class="padding"></div>
</footer>
</body>
</html>