-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
executable file
·202 lines (166 loc) · 8.54 KB
/
index.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
<?php
include('app.php');
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>FBWtube</title>
<link debug="false" href="./assets/css/application.css" media="all" rel="stylesheet"/>
<link debug="false" href="./assets/css/bootstrap.css" media="all" rel="stylesheet"/>
<script src="./assets/js/application.js"></script>
<link rel="stylesheet" href="./bower_components/material-design-lite/material.min.css">
<link href="https://fonts.googleapis.com/css?family=Roboto:regular,bold,italic,thin,light,bolditalic,black,medium&lang=en"
rel="stylesheet">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<!-- Color -->
<link rel="stylesheet" href="https://storage.googleapis.com/code.getmdl.io/1.0.2/material.grey-red.min.css"/>
<!-- <script src="//code.jquery.com/jquery-1.11.3.min.js"></script> -->
<link rel="stylesheet" href="assets/css/styles.css">
<link rel="stylesheet" href="assets/css/mooc.css">
<script src="./assets/js/webcomponents-bundle.js"></script>
<script src="./assets/js/video-player.js"></script>
<!--
<script src="node_modules/url-polyfill/url-polyfill.min.js"></script>
<script src="node_modules/babel-polyfill/dist/polyfill.min.js"></script>
<script src="node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
-->
</head>
<body>
<div class="demo-layout mdl-layout mdl-js-layout mdl-layout--fixed-header">
<main class="mdl-layout__content mdl-color--grey-200">
<div class="mdl-grid demo-content">
<?php
if (!isset($_GET['chapter'])) {
#include ('chapters.php');
$_GET['chapter'] = 0;
}
$chapterId = $_GET['chapter'];
$teacher = getVimeoIdFromUrl($chapters[$chapterId]->videos->url_teacher);
$presentation = getVimeoIdFromUrl($chapters[$chapterId]->videos->url_presentation);
$chapterTitle = $chapters[$chapterId]->title;
//$chapterdescription = $chapters[$chapterId]->description;
?>
<div class="mdl-cell mdl-cell--12-col mdl-cell--12-col-phone mdl-cell--12-col-tablet mdl-grid">
<div class="mooc-chapter-nav mdl-cell mdl-cell--12-col mdl-color--white mdl-shadow--2dp">
<?php
foreach ($chapters as $key => $chapter) {
$url = '?id=' . $lectureId . '&chapter=' . $key . '';
if ($key == $chapterId) {
$cssnav = 'mdl-button--raised mdl-button--accent';
} else {
$cssnav = '';
}
echo '
<a id="tt' . $key . '" href="' . $url . '" class="mdl-button mdl-js-button ' . $cssnav . '">
<i class="material-icons">ondemand_video</i>
</a>
<div class="mdl-tooltip" for="tt' . $key . '">
' . $chapter->title . '
</div>
';
}
?>
</div>
<div class="mooc-videoplayer mdl-cell mdl-cell--12-col mdl-color--white mdl-shadow--2dp mdl-card">
<div class="mdl-card__title">
<h2 class="mdl-card__title-text">
<?php echo $chapterTitle ?>
</h2>
</div>
<div class="mdl-card__supporting-text">
<?php
$teacherObj = callVimeoApiByVideoId($teacher);
$presentationObj = callVimeoApiByVideoId($presentation);
if (isset($teacherObj->message)) {
echo '<h2>' . $teacherObj->title . '</h2>';
echo $teacherObj->message;
} elseif (isset($presentationObj->message)) {
echo '<h2>' . $presentationObj->title . '</h2>';
echo $presentationObj->message;
} else {
if (strstr($_SERVER['HTTP_USER_AGENT'], 'iPhone') || strstr($_SERVER['HTTP_USER_AGENT'], 'iPad')) {
?>
<div class="televideoplayer" data-lanalytics-resource="uid" data-ratio="20"
data-speed="1"
data-subtitles="" data-transcript="" data-videodata='{
"hasLoadingOverlay":false,
"hasInteractiveTranscript":true,
"streams":
{
"left": <?php echo getValuesFromVimeo($teacherObj) ?>,
"right": <?php echo getValuesFromVimeo($presentationObj) ?>
}
}'
data-volume="0.9244186046511628"></div>
<script type="text/javascript">
new Html5Player.VideoPlayer($('.televideoplayer'), $('.televideoplayer').data('videodata'));
</script>
<?php
}
else { ?>
<video-player configuration='{
"streams" : [
<?php echo getValuesFromVimeo($teacherObj) ?>,
<?php echo getValuesFromVimeo($presentationObj) ?>
],
"initialState": {
"playState": "PLAYING"
},
"playlist": {
"autoPlay": true,
"currentPosition": <?php echo $chapterId ?>,
"entries": [
<?php
$entry = "";
foreach ($chapters as $key => $chapter) {
$url = '?id=' . $lectureId . '&chapter=' . $key . '';
$entry .= '{
"title" : "' . $chapter->title . '",
"url" : "http://univera.de/FHB/fbwTube/' . $url .'"
}, ';
}
echo substr($entry, 0, strlen($entry)-2);
?>
]
},
"theme" : "light-red",
"accentColor" : "#FF5252"
}'>
</video-player>
<?php
}
?>
<?php } ?>
</div>
</div>
<div class="mooc-description mdl-cell mdl-cell--12-col mdl-color--white mdl-shadow--2dp mdl-card">
<div class="mdl-card__title" style="display:block;">
<h2 class="mdl-card__title-text">
<?php echo $course->title; ?> - <?php echo $course->lectureTitle; ?>
</h2>
</div>
<div class="mdl-card__supporting-text">
<div class="mooc-lecture-description">
</div>
<div class="mooc-lecture-lecturer">
<div class="fhb-logo">
<img src="./assets/img/logo_fbw.jpg">
</div>
<div class="mooc-lecturer--contact">
<strong><?php echo $course->lecturer; ?> </strong><br/>
<a href="mailto:<?php echo $course->lecturerMail; ?>"><?php echo $course->lecturerMail; ?></a>
</div>
</div>
</div>
</div>
</div>
</main>
<script src="./bower_components/material-design-lite/material.min.js"></script>
<script src="./assets/js/jquery.truncate.min.js"></script>
<!-- <script src="./assets/js/custom.js"></script> -->
</body>
</html>