gpt4 book ai didi

javascript - Jplayer 播放列表全屏不工作

转载 作者:行者123 更新时间:2023-11-30 06:25:44 25 4
gpt4 key购买 nike

我尝试将 JPlayer 播放列表中的视频放大到全屏(全尺寸)。但大小始终保持不变。

来源:

<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Test Playlist</title>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="jplayerd/js/jquery.jplayer.min.js"></script>
<script type="text/javascript" src="jplayerd/js/jplayer.playlist.min.js"></script>

<script type="text/javascript">
$(document).ready(function() {
var cssSelector = {
jPlayer: "#jquery_jplayer_1",
cssSelectorAncestor: "#jp_container_1"
};

$("#jquery_jplayer_1").jPlayer("option", {"fullScreen": true});

var playlist = [
{
title:"Big Buck Bunny Trailer",
artist:"Blender Foundation",
m4v:"http://www.jplayer.org/video/m4v/Big_Buck_Bunny_Trailer.m4v"
}
];

var options = {
playlistOptions: {
autoPlay: true,
enableRemoveControls: true
},
sizeFull: {
width: this.windowWidth,
height: this.windowHeight
},
swfPath: "jplayerd/js",
supplied: "m4v",
fullScreen: true
};

var myPlaylist = new jPlayerPlaylist(cssSelector, playlist, options);
});
</script>
</head>
<body>
<div id="jp_container_1" class="jp-video jp-video-full">
<div class="jp-type-playlist">
<div id="jquery_jplayer_1" class="jp-jplayer" style="width: 100%; height: 100%;"></div>
</div>

<div class="jp-playlist" style="display:none;">
<ul>
<!-- The method Playlist.displayPlaylist() uses this unordered list -->
<li></li>
</ul>
</div>

<div class="jp-no-solution">
<span>Unable to play your Video</span>
</div>
</div>
</body>
</html>

在 HTML 中,我看到元素上有一种样式始终保持不变。 480 像素 x 270 像素。我尝试添加不同尺寸的样式,但它似乎总是被覆盖。

<div id="jp_container_1" class="jp-video jp-video-full jp-video-270p">
<div class="jp-type-playlist">
<div id="jquery_jplayer_1" class="jp-jplayer" style="width: 480px; height: 270px;">
<img id="jp_poster_0" style="width: 480px; height: 270px; display: none;">
<object id="jp_flash_0" width="1" height="1" name="jp_flash_0" data="jplayerd/js/Jplayer.swf" type="application/x-shockwave-flash" tabindex="-1" style="width: 480px; height: 270px;">
</div>
</div>

如果我只使用没有播放列表的 Jplayer,下面的代码是有效的:

<html>
<head>
<meta charset=utf-8 />

<!-- Website Design By: www.happyworm.com -->
<title>Demo : jPlayer as a video player</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="jplayerd/skin/blue.monday/jplayer.blue.monday.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"> </script>
<script type="text/javascript" src="jplayerd/js/jquery.jplayer.min.js"></script>
<script type="text/javascript">
//<![CDATA[
$(document).ready(function(){

$("#jquery_jplayer_1").jPlayer({
ready: function () {
$(this).jPlayer("setMedia", {
m4v: "http://www.jplayer.org/video/m4v/Big_Buck_Bunny_Trailer.m4v",
poster: "http://www.jplayer.org/video/poster/Big_Buck_Bunny_Trailer_480x270.png"
})
.jPlayer("option", {"fullScreen": true})
.jPlayer("play");
},
swfPath: "jplayerd/js",
supplied: "m4v",
size: {
width: "640px",
height: "360px",
cssClass: "jp-video-360p"
},
sizeFull: {
width: this.windowWidth,
height: this.windowHeight
},
smoothPlayBar: true,
keyEnabled: true
});
});
//]]>
</script>
</head>
<body>
<div id="jp_container_1" class="jp-video jp-video-360">
<div class="jp-type-single">
<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">play</a>
</div>
<div class="jp-interface">
<div class="jp-progress">
<div class="jp-seek-bar">
<div class="jp-play-bar"></div>
</div>
</div>
</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>
</body>
</html>

全屏选项似乎没有正确解析给播放器。有人能告诉我如何使用播放列表插件来实现这一点吗?

我正在使用 JPlayer 2.5.0。

最佳答案

从您的选项变量中删除行 fullscreen: true

新代码

       var options = {
playlistOptions: {
autoPlay: true,
enableRemoveControls: true
},
sizeFull: {
width: this.windowWidth,
height: this.windowHeight
},
swfPath: "jplayerd/js",
supplied: "m4v"

};

Working Demo

引用更多来自 here对于 jplayer 播放列表

关于javascript - Jplayer 播放列表全屏不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21229218/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com