-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
251 lines (230 loc) · 8.71 KB
/
index.html
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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
<!DOCTYPE HTML>
<!--
Overflow by HTML5 UP
html5up.net | @n33co
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
-->
<html>
<head>
<title>TranslateTube</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<!--[if lte IE 8]><script src="css/ie/html5shiv.js"></script><![endif]-->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/jquery.scrolly.min.js"></script>
<script src="assets/js/jquery.poptrox.min.js"></script>
<script src="assets/js/skel.min.js"></script>
<script src="assets/js/init.js"></script>
<noscript>
<link rel="stylesheet" href="assets/css/skel.css" />
<link rel="stylesheet" href="assets/css/style.css" />
</noscript>
<link rel="shortcut icon" href="assets/images/favicon.ico" type="image/x-icon">
<link rel="icon" href="assets/images/favicon.ico" type="image/x-icon">
<!--[if lte IE 8]><link rel="stylesheet" href="css/ie/v8.css" /><![endif]-->
<link href='http://fonts.googleapis.com/css?family=Lato:300,400,900|Montserrat:400,700' rel='stylesheet' type='text/css'>
<link href="assets/css/carousel.css" rel="stylesheet">
<script src="//connect.soundcloud.com/sdk.js"></script>
<script src="//cdn.firebase.com/js/client/2.2.3/firebase.js"></script>
<script src="../Backend/savedata.js"></script>
</head>
<body>
<!-- Header -->
<section id="header">
<header>
<h1>Translate Tube</h1>
<p>Watch videos in the language you like</p>
</header>
<footer>
<a href="#banner" class="button style2 scrolly-middle">Watch</a>
</footer>
</section>
<!-- Banner -->
<section id="banner">
<header>
<h2>COMEDY</h2>
</header>
<div id='comedy'>
<!-- Carousel 1-->
<div id="myCarousel1" class="carousel slide" data-ride="carousel" data-interval="false">
<div class="carousel-inner" role="listbox" id='cat1'>
</div>
<a class="left carousel-control" href="#myCarousel1" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel1" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
<!-- Carousel 1 end-->
</div>
<footer>
<a href="#banner2" class="scrolly-middle glyphicon glyphicon-triangle-bottom">
</a>
</footer>
</section>
<!-- Feature 1 -->
<section id="banner2">
<header>
<h2>EDUCATION</h2>
</header>
<div id='education'>
<!-- Carousel 2-->
<div id="myCarousel2" class="carousel slide" data-ride="carousel" data-interval="false">
<div class="carousel-inner" role="listbox" id='cat2'>
</div>
<a class="left carousel-control" href="#myCarousel2" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel2" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
<!-- Carousel 2 end-->
</div>
<footer>
<a href="#tech" class="scrolly-middle glyphicon glyphicon-triangle-bottom">
</a>
</footer>
</section>
<!-- Feature 2 -->
<section id="banner3">
<header>
<h2>TECHNOLOGY</h2>
</header>
<div id='tech'>
<!-- Carousel 3-->
<div id="myCarousel3" class="carousel slide" data-ride="carousel" data-interval="false">
<div class="carousel-inner" role="listbox" id='cat3'>
</div>
<a class="left carousel-control" href="#myCarousel3" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel3" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
<!-- Carousel 3 end-->
</div>
</section>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script type="text/javascript">$('.carousel').carousel()</script>
</body>
<script>
//Video Id
// var vidId="hmqguIFMC-Y";
var numberOfVideos = 0;
var vidIds = [];
var vidTokens = [];
var vidLangs = [];
var vidCats = [];
var vidTracks = [];
var vidTrackNumber = [];
var onReadys = [];
var count1 = false;
var count2 = false;
var count3 = false;
// 2. This code loads the IFrame Player API code asynchronously.
var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
// 3. This function creates an <iframe> (and YouTube player)
// after the API code downloads.
var players = [];
// 4. The API will call this function when the video player is ready.
function onPlayerReady(event) {
var iframeId = event.target.c.id;
var number = iframeId.substr(iframeId.length - 1);
event.target.mute();
SC.whenStreamingReady(function() {
onReadys[number] = true;
});
}
//Sound Cloud Code
SC.initialize({
client_id: '7a85853e93bad9e808b23f3ef4dd78ad'
});
//replace below with soundcloud track id
videosRef.on("value", function(snapshot) {
var videos = snapshot.val();
for (var key in videos) {
createYTObj(key, videos);
}
}, function (errorObject) {
console.log("The read failed: " + errorObject.code);
});
function createYTObj(key, videos) {
vidIds.push(videos[key].id);
vidTrackNumber.push(0);
vidTokens.push(videos[key].token);
vidCats.push(videos[key].cat);
vidLangs.push(videos[key].lang);
SC.stream(vidTokens[numberOfVideos][vidTrackNumber[numberOfVideos]], function(track){
vidTracks.push(track);
});
onReadys[numberOfVideos] = false;
var div1 = document.createElement('div');
div1.className = 'item';
var div2 = document.createElement('div');
div2.className = 'container';
div2.id = 'player'+numberOfVideos;
div1.appendChild(div2);
if (vidCats[numberOfVideos]=='comedy') {
if (!count1) {
div1.className = 'item active';
}
count1 = true;
document.getElementById('cat1').appendChild(div1);
} else if (vidCats[numberOfVideos]=='education') {
if (!count2) {
div1.className = 'item active';
}
count2 = true;
document.getElementById('cat2').appendChild(div1);
} else if (vidCats[numberOfVideos]=='tech') {
if (!count3) {
div1.className = 'item active';
}
count3 = true;
document.getElementById('cat3').appendChild(div1);
}
players[numberOfVideos] = new YT.Player('player'+numberOfVideos, {
height: '500px',
width: '100%',
videoId: vidIds[numberOfVideos],
playerVars:{
'controls': '0',
'autoplay': '0',
'disablekb': '0'
},
events: {
'onReady': onPlayerReady,
'onStateChange': onPlayerStateChange
}
});
numberOfVideos++;
}
// 5. The API calls this function when the player's state changes.
// The function indicates that when playing a video (state=1),
// the player should play for six seconds and then stop.
function onPlayerStateChange(event) {
var iframeId = event.target.c.id;
var number = iframeId.substr(iframeId.length - 1);
if (event.data == YT.PlayerState.PAUSED) {
vidTracks[number].pause();
}
if (event.data == YT.PlayerState.PLAYING && onReadys[number]) {
vidTracks[number].play();
}
if (event.data == YT.PlayerState.PLAYING && !onReadys[number]) {
event.target.pauseVideo();
}
}
</script>
</html>