-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.html
More file actions
50 lines (39 loc) · 1.12 KB
/
Copy pathindex.html
File metadata and controls
50 lines (39 loc) · 1.12 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
<!DOCTYPE HTML>
<html>
<head>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js'></script>
<script type="text/javascript" src="jwplayer.js"></script>
<script>
function play() {
try {
$('#stage').empty();
$('#stage').append("<div id='player'></player>");
var url = $('#url').val();
var stream = $('#stream').val();
var player = jwplayer('player');
player.setup({
'flashplayer': 'player.swf',
'id': 'player',
'width': 640,
'height': 360,
'autoplay': true,
'streamer': url,
'file': stream
});
} catch (err) {
console.log('oh oh');
console.log(err);
}
return false;
}
</script>
</head>
<body>
<form onsubmit="return play();">
<label for="url">url</label><input type="text" name="url" id="url" value="rtmp://my.web.server/live/tv"/>
<label for="stream">stream</label><input type="text" name="stream" id="stream" value="mp4:abcnews"/>
<input type="submit" value="play"/>
</form>
<div id='stage'></div>
</body>
</html>