forked from Balajims88/balajims88.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhls.html
34 lines (31 loc) · 1.09 KB
/
hls.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
<!DOCTYPE html>
<html>
<body>
<script>
function playPause() {
var myVideo = document.getElementsByTagName('video')[0];
if (myVideo.paused)
myVideo.play();
else
myVideo.pause();
}
document.documentElement.addEventListener("keyup", function(e) {
var myVideo = document.getElementsByTagName('video')[0];
var ev = e || window.event; // window.event for IE fallback
if(ev.keyCode == 13) {
// toggle play/pause
if(myVideo.paused) { myVideo.play(); }
else { myVideo.pause(); }
}
});
</script>
<div style="border: 1px solid #333;">
<video id ="vid" autoplay="autoplay" style="height: 100%; width: 100%;">
<source src="http://html5-lh.akamaihd.net/i/html5_01@182967/master.m3u8">
</video>
</div>
<div style="font-size: 20pt;text-align: center;color: #00FF00; position: absolute; width: 100%; top: 20px;">
Press OK button to Play or Pause
</div>
</body>
</html>