我已下载文件并按照提供的步骤操作,但播放器无法正常工作。
<code>
<html>
<head>
<script type="text/javascript" src="/jwplayer.js"></script>
<script type="text/javascript" src="/jquery.js"></script>
</head>
<body>
<div id="container">Loading the player ...</div>
<script type="text/javascript">
jwplayer("container").setup({
flashplayer: "/player.swf",
file: "/video.mp4",
height: 270,
width: 480
});
</script>
</body>
</html>
</code>
所有显示的都是“加载播放器”。如您所见,我已经链接了JWplayer和jquery脚本。我错过了什么?任何帮助将不胜感激。我使用网络表达式...当我尝试按照jwplayer链接“jwplayer(容器)”时,我说无法找到链接。
答案 0 :(得分:6)
试试这段代码。有了相对地址,它对我有用!我希望这会对你有所帮助。
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jplayer/2.9.2/jplayer/jquery.jplayer.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js/jquery.js"></script>
</head>
<body>
<div id="container">Loading the player ...</div>
<script type="text/javascript">
jwplayer("container").setup({
flashplayer: "//cdnjs.cloudflare.com/ajax/libs/jplayer/2.9.2/jplayer/jquery.jplayer.swf",
file: "http://content.bitsontherun.com/videos/lWMJeVvV-364767.mp4",
height: 270,
width: 480
});
</script>
</body>
</html>
答案 1 :(得分:3)
删除代码中的/
,使其如下所示:
flashplayer: "player.swf"