-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
33 lines (28 loc) · 1023 Bytes
/
Copy pathscript.js
File metadata and controls
33 lines (28 loc) · 1023 Bytes
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
$(function(){
$('#play-pause, #video').click(function(){
if (!$(event.target).is("#video-controls")) {
if($('#video').get(0).paused == true){
$('#video').get(0).play();
$('#play-pause').html("<i class='fa fa-play'></i>");
} else{
$('#video').get(0).pause();
$('#play-pause').html("<i class='fa fa-play'></i>");
}
}
});
$('#seek-bar').click(function(){
var video = document.getElementById("video");
var time = video.duration * (this.value / 100);
video.currentTime = time;
});
$('#video').bind('timeupdate', function(){
var value = (100 / this.duration) * this.currentTime;
$('#seek-bar').val(value);
if($('#video').get(0).paused == true){
$('#play-pause').html("<i class='fa fa-play'></i>");
}
})
$('#volume-bar').change(function(){
$('#video').prop('volume', $(this).val());
});
});