-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvideoLoader.js
36 lines (29 loc) · 852 Bytes
/
videoLoader.js
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
var originalUrl = document.location.href;
var getPos = originalUrl.lastIndexOf("=") + 1;
function loadVideo(movie)
{
video = $(".video");
$("#vimeo").attr('src','//player.vimeo.com/video/'+videos[movie].vimeocode);
$(video).css("display","inline-block");
legend = $(".legend");
legendCustomer = $(".legend .customer");
legendDesc = $(".legend .desc");
$(legendCustomer).html(videos[movie].head);
$(legendDesc).html(videos[movie].desc);
$(legend).css("display","inline-block");
window.history.pushState('page2', 'Title', '?video=' + movie);
for (i = 0; i < 20; i++) {
$("#movie"+i).show();
}
$("#"+movie).hide();
}
$(function() {
$('.mov').hammer().on("tap", function(event) {
loadVideo($( this ).attr('id'));
});
if(getPos != 0)
{
movieToLoad = originalUrl.substring(getPos);
loadVideo(movieToLoad);
}
});