-
Notifications
You must be signed in to change notification settings - Fork 0
/
main2.js
64 lines (39 loc) · 1.36 KB
/
main2.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
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
window.onload = function() {
var video = document.querySelector('video');
var video2 = $('.vjs-tech').get(0);
document.body.addEventListener('touchend', function(event){
if(event.target.className == 'vjs-tech' && ($('.vjs-control-bar').css( 'opacity' ) > 0)){
if(video2.paused){
video2.play();
} else if(!video2.paused){
video2.pause();
};
};
});
video2.addEventListener('pause', function(){
if (!video2.seeking){
$('.vjs-big-play-button').show();
$('.vjs-big-play-button').animate({opacity:1}, 200);
}
});
video2.addEventListener('seeking', function(){
//$('.vjs-big-play-button').animate({opacity:0}, 200);
$('.vjs-big-play-button').hide();
});
/*
video2.addEventListener('seeked', function(){
if(video.paused){
$('.vjs-big-play-button').show();
//$('.vjs-big-play-button').animate({opacity:1}, 200);
}
});
*/
video2.addEventListener('play', function(){
$('.vjs-big-play-button').animate({opacity:0}, 200);
setTimeout(function(){$('.vjs-big-play-button').hide()}, 200);
});
video2.addEventListener('ended', function(){
$('.vjs-big-play-button').show();
$('.vjs-big-play-button').animate({opacity:1}, 200);
});
};