-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
68 lines (58 loc) · 2.02 KB
/
index.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
<!DOCTYPE html>
<script>
var title = "Stream Site";
var rtmpPubAddr = "x.x.x.x/live";
var streamKey = "test";
var streamType = "rtmp/flv";
var picture = "stream.png";
</script>
<html>
<head>
<title>{#title#}</title>
<style>
#instructions { max-width: 1280px; text-align: left; margin: 30px auto; }
#instructions textarea { width: 100%; height: 100px; }
/* Show the controls (hidden at the start by default) */
.video-js .vjs-control-bar {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
/* Make the demo a little prettier */
body {
margin-top: 20px;
text-align: center;
color: #aaa;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
background: #000;
}
a, a:hover, a:visited { color: #76DAFF; }
</style>
<link href="video-js.css" rel="stylesheet" type="text/css">
<link href="player.css" rel="stylesheet" type="text/css">
<script src="video.js"></script>
<script>
videojs.options.flash.swf = "video-js.swf";
</script>
</head>
<body>
<div id="instructions">
<video id="myPlayer" class="video-js vjs-default-skin"
poster="{#picture#}"
controls preload="none" width="1280" height="720"
data-setup='{ "aspectRatio":"780:450" }'>
<source src="rtmp://{#rtmpPubAddr#}/{#streamKey#}" type='{#streamType#}' />
<p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a></p>
</video>
</div>
</body>
</html>
<script>
document.title = title;
var video = document.getElementsByTagName("video")[0];
video.setAttribute("poster", picture);
var source = document.getElementsByTagName("source")[0];
source.setAttribute("src", "rtmp://" + rtmpPubAddr + "/" + streamKey);
source.setAttribute("type", streamType);
</script>