有一个问题/问题,我可以在以下方面使用您的帮助:
我调整了 flowplayer 3.2.15 的示例以引入动态 URL,并在每次调用该函数时为该视频创建一个新的 flowplayer。效果很好,代码如下:
<!doctype html>
<html>
<head>
<title>Flowplayer playlist API : Flowplayer</title>
<link rel="shortcut icon" href="http://flash.flowplayer.org/favicon.ico">
<style>
body{
width:982px;
margin:50px auto;
font-family:sans-serif;
}
a:active {
outline:none;
}
:focus { -moz-outline-style:none; }
.palert {
padding: 12px;
color: black;
background-color: #ededed;
box-shadow: none;
}
#player {
width:425px;
height:330px;
float:left;
margin:0 0 40px 20px;
}
</style>
<script src="http://releases.flowplayer.org/js/flowplayer-3.2.11.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js" type="text/javascript" charset="utf-8"></script>
<script src="http://releases.flowplayer.org/js/flowplayer.playlist-3.2.10.min.js" type="text/javascript" charset="utf-8"></script>
<script>
function showVideoPreview(videoUrl)
{
$(function()
{
flowplayer("player", "flowplayer-3.2.15.swf", {clip: { url: videoUrl, scaling: 'fit' }});
});
}
showVideoPreview('http://www.tools4movies.com/trailers/1012/A%20Good%20Day%20To%20Die%20Hard.mp4');
</script>
<link rel="stylesheet" type="text/css" href="playlist.css"/>
</head>
<body>
<button onClick="showVideoPreview('http://www.tools4movies.com/trailers/1012/Alex%20Cross.mp4');">Recreate</button>
<div id="player"></div>
<br clear="all"/>
</body>
</html>
但是,因为它是 3.2.15,它不适用于 HTML5。所以我想升级此代码以使用 5.2。我尝试采用 5.2 示例并应用相同的逻辑,但视频从未出现过,也没有显示任何 javascript 错误。谁能提供一些指导或帮助?这是我尝试过的:
<!doctype html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="skin/minimalist.css" />
<style>
body { font: 12px "Myriad Pro", "Lucida Grande", sans-serif; text-align: center; padding-top: 5%; }
#player {
width:425px;
height:330px;
float:left;
margin:0 0 40px 20px;
}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://releases.flowplayer.org/5.2.1/flowplayer.min.js"></script>
<script>
function showVideoPreview(videoUrl)
{
$(function()
{
flowplayer("player", "http://releases.flowplayer.org/5.2.1/flowplayer.swf", {clip: { url: videoUrl, scaling: 'fit' }});
});
}
showVideoPreview('http://stream.flowplayer.org/bauhaus/624x260.mp4');
</script>
</head>
<body>
<div class="flowplayer" id="player" data-swf="http://releases.flowplayer.org/5.2.1/flowplayer.swf"></div>
</body>
</html>
非常感谢你们,我很感激。