-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvlc_test.html
38 lines (34 loc) · 1.46 KB
/
vlc_test.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
<!DOCTYPE html>
<html>
<body>
<!--video width="800" height="600" controls>
<source src="http://vlc.10.1.4.227.nip.io" type="video/WebM">
Your browser does not support the video tag.
</video-->
<!--img name="main" id="main" border="0" width="800" height="600" src="http://10.1.7.223/axis-cgi/mjpg/video.cgi?date=1&clock=1&resolution=800x600&chanel=quality">
<img name="main" id="main" border="0" width="800" height="600" src="http://vlc.10.1.4.227.nip.io">
<img name="main" id="main" border="0" width="800" height="600" src="http://localhost/"-->
<script src="hls.js"></script>
<video id="video"></video>
<script>
if(Hls.isSupported()) {
var video = document.getElementById('video');
var hls = new Hls();
hls.loadSource('http://vlc.10.1.4.227.nip.io:80');
hls.attachMedia(video);
hls.on(Hls.Events.MANIFEST_PARSED,function() {
video.play();
});
}
// hls.js is not supported on platforms that do not have Media Source Extensions (MSE) enabled.
// When the browser has built-in HLS support (check using `canPlayType`), we can provide an HLS manifest (i.e. .m3u8 URL) directly to the video element throught the `src` property.
// This is using the built-in support of the plain video element, without using hls.js.
else if (video.canPlayType('application/vnd.apple.mpegurl')) {
video.src = 'http://localhost/';
video.addEventListener('canplay',function() {
video.play();
});
}
</script>
</body>
</html>