-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplayer.html
More file actions
56 lines (44 loc) · 1.22 KB
/
player.html
File metadata and controls
56 lines (44 loc) · 1.22 KB
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
<!DOCTYPE html>
<html>
<body>
<style>
body{
width:60%;
margin-left:20%;
}
#vlcplayer {
text-align:center;
border:5px solid black;
}
#imgInp {}
h1 {
text-decoration: underline;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<div style="text-align:center;">
<h1 style="text-align:center;">Choose Files To Play</h1>
<div >
<input type='file' id="imgInp" style="border:5px solid red;" />
</div>
<hr>
<div id="vlcplayer"><p style="">Audio/Video Player</p><hr style="height:5px;background-color:black;">
<video id="vlc" src="" alt="Play Your Video" width="100%" height="300px" poster="https://i.imgur.com/Z4usRDz.jpg" controls autoplay/>
</div>
</div>
<script>
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('#vlc').attr('src', e.target.result);
}
reader.readAsDataURL(input.files[0]);
}
}
$("#imgInp").change(function(){
readURL(this);
});
</script>
</body>
</html>