我在 onClick 上阅读了这个更改 JWPlayer 视频并尝试了它,但我在播放第二个视频时遇到了问题。每当我点击“播放视频 2”时,什么都没有发生!下面的代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>My JWPlayer</title>
<script type="text/javascript" src="jwplayer.js" ></script>
<script type="text/javascript">
function changeVideo(filename) {
jwplayer("video").setup({
file: filename,",
height: 360,
width: 640,
});
jwplayer('video').load();
}
</script>
</head>
<body>
<div id="video">Loading the player ...</div>
<script type="text/javascript">
jwplayer("video").setup({
file: "http://longtailvideo.com/jw/upload/bunny.flv",
height: 360,
width: 640
});
</script>
<p><a href="javascript:void();" onclick="javascript:changeVideo("http://www.auby.no/files/video_tests/h264_720p_mp_3.1_3mbps_aac_shrinkage.mp4");">Play Video 2</a></p>
</body>
</html>