基于jPlayer三分屏的制作方法

2020-05-24 21:46:58易采站长站整理

<button class="jp-video-play-icon">play</button>
</div>

<!-- 控制面板 -->
<!-- width: 959px; margin-left: -320px; -->
<div id="controller" class="jp-interface" style="border: 1px solid #009be3;">
<div class="jp-progress">
<div class="jp-seek-bar">
<div class="jp-play-bar"></div>
</div>
</div>
<div class="jp-current-time"> </div>
<div class="jp-duration"> </div>
<div class="jp-controls-holder">
<div class="jp-controls">
<button class="jp-play">play</button>
<button class="jp-stop">stop</button>
</div>
<div class="jp-volume-controls">
<button class="jp-mute">mute</button>
<button class="jp-volume-max">max volume</button>
<div class="jp-volume-bar">
<div class="jp-volume-bar-value"></div>
</div>
</div>
<div class="jp-toggles">
<button class="jp-full-screen">full screen</button>
</div>
</div>
<div class="jp-details">
<div class="jp-title" aria-label="title"> </div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>

</html>

新建一个test.js文件,下面是代码:


var flag = false;
var isFull = false;

$(document).ready(function() {
// 实例化第一个视频
$("#jquery_jplayer_1").jPlayer({
ready: function() {
$(this).jPlayer("setMedia", {
title: "This is video Title",
m4v: "http://www.jplayer.org/video/m4v/Big_Buck_Bunny_Trailer.m4v",
/* m4v: "video/003.webm", */
poster: "http://www.jplayer.org/video/poster/Big_Buck_Bunny_Trailer_480x270.png"
});
},
swfPath: "../../dist/jplayer",
supplied: "m4v",
size: {
width: "640px",
height: "360px",
cssClass: "jp-video-360p"
},
useStateClassSkin: true,
autoBlur: false,
smoothPlayBar: true,
keyEnabled: true,
remainingDuration: true,
toggleDuration: true
});

// 实例化第二个视频
$("#jquery_jplayer_2").jPlayer({
ready: function() {
$(this).jPlayer("setMedia", {
title: "This is video Title",
m4v: "http://www.jplayer.org/video/m4v/Big_Buck_Bunny_Trailer.m4v",
/* m4v: "video/003.webm", */
poster: "http://www.jplayer.org/video/poster/Big_Buck_Bunny_Trailer_480x270.png"
});
},
swfPath: "../../dist/jplayer",