-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfrontend.html
104 lines (83 loc) · 2.98 KB
/
frontend.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
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<div class="h3" style="color: white;">VesitTube</div>
</div>
<ul class="nav navbar-nav">
<li class="active"><a href="./home.html">Home</a></li>
<li><a href="./upload.html">Upload</a></li>
</ul>
</div>
</nav>
<!--
<input type="text" id="path" placeholder="Enter file path">
<input type="text" id="name" placeholder="Enter file name">
<button id="submit">Upload</button>-->
<div class="row">
<div class="col-lg-8">
<div class="embed-responsive embed-responsive-16by9">
<iframe width="1000" height="450" id="someFrame" src="https://s3.eu-central-1.amazonaws.com/testabhijeetcoder/videoplayback.mp4" frameborder="1" allowfullscreen = "true"></iframe>
</div>
</div>
<div class="col-lg-4">
<h3>Videos</h3>
<div id="buttons">
</div>
</div>
</div>
<!-- BUTTon-->
<!-- BOOT-->
<!-- BOOT-->
<!-- BUTTon-->
</body>
<script type="text/javascript">
$(document).ready(function(){
$("a").click(function(e) {
e.preventDefault();
console.log("presedd"+$(this).attr("href"));
$("#someFrame").attr("src", $(this).attr("href"));
})
$("#buttons").bind('click',function(){
var play=event.target.value;
var new_link="https://s3.eu-central-1.amazonaws.com/testabhijeetcoder/"+play;
$("#someFrame").attr("src",new_link);
})
$('#submit').on('click',function(){
var path=$('#path').val();
var name=$('#name').val();
$('#path').val(' ');
$('#name').val(' ');
console.log("path is"+path);
//AJAX
$.ajax({
url:"http://localhost:8080/upload",
data:{'link':path,'name':name}, //Reference to count_current_record
success:function(result){
}
});
//AJAX
});
$.ajax({
url:"http://localhost:8080/list", //Reference to count_current_record
success:function(result){
var obj=JSON.parse(result);
//console.log(obj[0]['val'].split('/')[4])
for(var i=0;i<obj.length;i++){
var $something= $('<input/>').attr({ type: 'button', value:obj[i]['val'].split('/')[4],id:i,class:"btn btn-primary"});
var br='<br>';
$("#buttons").append(br);
$("#buttons").append($something);
}
}
});
});
</script>
</html>