-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathdemo.html
179 lines (168 loc) · 6.94 KB
/
demo.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Video Playlist Demo</title>
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1" /><link rel="shortcut icon" href="http://tv.sohu.com/favicon.ico">
<!-- JQUERY -->
<script type="text/javascript" src="./jquery.min.js"></script>
<!-- JPLAYER -->
<script type="text/javascript" src="./jquery.jplayer.min.js"></script>
<script type="text/javascript" src="./add-on/jplayer.playlist.min.js"></script>
<!-- JPLAYER THEME -->
<link rel="stylesheet" type="text/css" href="./theme-youtube/style.css" />
<style type="text/css" media="screen">
<!--
body{
margin:0;
padding:0;
background:#F1F1F1;
}
#jp_container_1{
width:100%;
margin:0 auto;
max-width:800px;
min-width:330px;
}
.jp-jplayer{
margin-bottom:-2px;
}
-->
</style>
</head>
<body>
<div id="content"><div class="container">
<!-- CONTENT -->
<script>
jQuery(document).ready(function(){
new jPlayerPlaylist({
jPlayer: "#jquery_jplayer_1",
cssSelectorAncestor: "#jp_container_1"
}, [
{
title:"Big Buck Bunny Trailer",
artist:"Blender Foundation",
free:true,
m4v: "http://www.jplayer.org/video/m4v/Big_Buck_Bunny_Trailer.m4v",
ogv: "http://www.jplayer.org/video/ogv/Big_Buck_Bunny_Trailer.ogv",
webmv: "http://www.jplayer.org/video/webm/Big_Buck_Bunny_Trailer.webm",
poster:"http://www.jplayer.org/video/poster/Big_Buck_Bunny_Trailer_480x270.png"
},
{
title: "Finding Nemo Teaser",
artist: "Pixar",
m4v: "http://www.jplayer.org/video/m4v/Finding_Nemo_Teaser.m4v",
ogv: "http://www.jplayer.org/video/ogv/Finding_Nemo_Teaser.ogv",
webmv: "http://www.jplayer.org/video/webm/Finding_Nemo_Teaser.webm",
poster: "http://www.jplayer.org/video/poster/Finding_Nemo_Teaser_640x352.png"
},
{
title: "Incredibles Teaser",
artist: "Pixar",
m4v: "http://www.jplayer.org/video/m4v/Incredibles_Teaser.m4v",
ogv: "http://www.jplayer.org/video/ogv/Incredibles_Teaser.ogv",
webmv: "http://www.jplayer.org/video/webm/Incredibles_Teaser.webm",
poster: "http://www.jplayer.org/video/poster/Incredibles_Teaser_640x272.png"
}
], {
ready: function(){
//单击播放/暂停
$(this).bind($.jPlayer.event.click, function(){
var isPaused = $(this).data().jPlayer.status.paused;
if(isPaused){ $(this).jPlayer("play"); }
else{ $(this).jPlayer("pause"); }
});
//双击全屏切换
$(this).dblclick(function(){
if($(".jp-video-full").length > 0){ $(".jp-restore-screen").click(); }
else{ $(".jp-full-screen").click(); }
});
},
swfPath: "assets/js/lib-jplayer/Jplayer.swf",
supplied: "webmv, ogv, m4v",
size:{
width: "100%",
height: "auto",
cssClass: "jp-video-360p"
}
});
$(document.documentElement).keydown(function(event) {
//空格暂停
if(event.which === 32){
if($(".jp-jplayer").data("jPlayer").status.paused){
$(".jp-jplayer").jPlayer("play");
}else{
$(".jp-jplayer").jPlayer("pause");
}
event.preventDefault();
}
//ESC取消全屏
if(event.which === 27){
$(".jp-video-full .jp-restore-screen").click();
event.preventDefault();
}
});
});
</script>
<div id="jp_container_1" class="jp-video jp-video-270p">
<div class="jp-type-playlist">
<div id="jquery_jplayer_1" class="jp-jplayer"></div>
<div class="jp-gui">
<div class="jp-video-play">
<a href="javascript:;" class="jp-video-play-icon" tabindex="1">播放</a>
</div>
<div class="jp-interface">
<div class="jp-controls-holder">
<ul class="jp-controls">
<li><a href="javascript:;" class="jp-previous" tabindex="1">上一个</a></li>
<li><a href="javascript:;" class="jp-play" tabindex="1">播放</a></li>
<li><a href="javascript:;" class="jp-pause" tabindex="1">暂停</a></li>
<li><a href="javascript:;" class="jp-next" tabindex="1">下一个</a></li>
<li><a href="javascript:;" class="jp-stop" tabindex="1">停止</a></li>
<li><a href="javascript:;" class="jp-mute" tabindex="1" title="静音">静音</a></li>
<li><a href="javascript:;" class="jp-unmute" tabindex="1" title="取消静音">取消静音</a></li>
<li><a href="javascript:;" class="jp-volume-max" tabindex="1" title="最大音量">最大音量</a></li>
</ul>
<div class="jp-volume-bar">
<div class="jp-volume-bar-value"></div>
</div>
<ul class="jp-toggles">
<li><a href="javascript:;" class="jp-full-screen" tabindex="1" title="全屏">全屏</a></li>
<li><a href="javascript:;" class="jp-restore-screen" tabindex="1" title="退出全屏">退出全屏</a></li>
<li><a href="javascript:;" class="jp-shuffle" tabindex="1" title="随机播放">随机播放</a></li>
<li><a href="javascript:;" class="jp-shuffle-off" tabindex="1" title="关闭随机">关闭随机</a></li>
<li><a href="javascript:;" class="jp-repeat" tabindex="1" title="重复播放">重复播放</a></li>
<li><a href="javascript:;" class="jp-repeat-off" tabindex="1" title="关闭重复">关闭重复</a></li>
</ul>
</div>
<div class="jp-progress">
<div class="jp-seek-bar">
<div class="jp-play-bar"><i></i></div>
</div>
</div>
<div class="jp-current-time"></div>
<div class="jp-duration"></div>
<div class="jp-title">
<ul>
<li></li>
</ul>
</div>
</div>
</div>
<div class="jp-playlist">
<ul>
<!-- The method Playlist.displayPlaylist() uses this unordered list -->
<li></li>
</ul>
</div>
<div class="jp-no-solution">
<span>Update Required</span>
To play the media you will need to either update your browser to a recent version or update your <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash plugin</a>.
</div>
</div>
</div>
<!-- END CONTENT -->
</div></div>
</body>
</html>