-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplayers.html
79 lines (66 loc) · 2.05 KB
/
players.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
69
70
71
72
73
74
75
76
77
78
79
<!DOCTYPE HTML>
<html>
<head>
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="jwplayer/jwplayer.js"></script>
<script type="text/javascript" src="flowplayer/flowplayer-3.2.6.min.js"></script>
<script>
function play() {
try {
$('#stage').empty();
var playerType = $('#playerType').val();
var w = $('#width').val();
var h = $('#height').val();
var s = $('#video').val();
window[playerType + "Play"](w, h, s);
} catch (err) {
console.log('oh oh');
console.log(err);
}
return false;
}
function jwplayerPlay(w, h, s) {
$('#stage').append("<div id='player'></player>");
var player = jwplayer('player');
player.setup({
'flashplayer': 'jwplayer/player.swf',
'id': 'player',
'width': w,
'height': h,
'autoplay': true,
'file': s
});
}
function flowplayerPlay(w, h, s) {
$('#stage').append("<div id='player'></player>");
$('#player').width(w);
$('#player').height(h);
flowplayer("player", "flowplayer/flowplayer-3.2.7.swf", {
clip: {
url: s,
autoPlay: true
}
});
}
function html5Play(w, h, s) {
var player = $('#stage');
player.append('<video width="' + w + '" height="' + h + '"><source src="' + s + '"/></video>');
}
</script>
</head>
<body>
<form onsubmit="return play();">
<label for="player">playerType</label>
<select name="playerType" id="playerType">
<option value="jwplayer">jwplayer</option>
<option value="flowplayer">flowplayer</option>
<!--<option value="html5">html5</option>-->
</select>
<label for="width">width</label><input type="text" name="width" id="width" value="320"/>
<label for="height">height</label><input type="text" name="height" id="height" value="240"/>
<label for="video">video</label><input type="text" name="video" id="video" value="video.mp4"/>
<input type="submit" value="play"/>
</form>
<div id='stage'></div>
</body>
</html>