blob: b206d1d8c7eeb5351ffc48148c3603c0a128d0de (
plain)
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
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content=
"width=device-width, initial-scale=1">
<title>Streaaaaaaaaam</title>
<link rel="stylesheet" href="https://stream.vapor.systems/style.css">
<link href="https://vjs.zencdn.net/7.15.4/video-js.css" rel="stylesheet">
</head>
<body>
<style>
google-cast-launcher {
float: right;
width: 2rem;
height: 2rem;
display: inline-block;
margin: -0.3rem 0 -0.5rem 0;
}
</style>
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
<div class="col">
<div class="row">
<div class="embed-responsive embed-responsive-16by9">
<video class="embed-responsive-item" id="video" autoplay="" controls="" muted=""></video>
</div>
</div>
</div>
<script>
var video = document.getElementById('video');
var videoSrc = 'https://stream.vapor.systems/hls/stream.m3u8';
if (Hls.isSupported()) {
var hls = new Hls();
hls.loadSource(videoSrc);
hls.attachMedia(video);
}
else if (video.canPlayType('application/vnd.apple.mpegurl')) {
video.src = videoSrc;
}
</script>
<script>
window['__onGCastApiAvailable'] = function(isAvailable) {
if (isAvailable) {
var castContext = cast.framework.CastContext.getInstance();
castContext.setOptions({
receiverApplicationId: chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,
autoJoinPolicy: chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED
});
var stateChanged = cast.framework.CastContextEventType.CAST_STATE_CHANGED;
castContext.addEventListener(stateChanged, function(event) {
var castSession = castContext.getCurrentSession();
var media = new chrome.cast.media.MediaInfo('https://stream.vapor.systems/hls/stream.m3u8', 'application/vnd.apple.mpegurl');
var request = new chrome.cast.media.LoadRequest(media);
castSession && castSession
.loadMedia(request)
.then(function(){
console.log('Success');
})
.catch(function(error){
console.log('Error: ' + error);
});
});
} else {
console.log('Casting not avaible')
}
};
</script>
<script src="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1"></script>
</body>
</html>
|