我想在我的原始页面中使用 DIV 并包含并播放 FLV。我决定使用 INCLUDE 并引用“videoplayer.html”来播放文件,但它不起作用。注意:播放器使用 MIT Opensource SWFObject v2.2 文件,该文件在我的标题中名为 "lessonheader.php" 。
所以,这不起作用(只有一个空白的 DIV 区域):来自我的“lessonheader.php”文件
<head>...
<script type="text/javascript" src="swfobject.js"></script>
... </head>
...
从我的主页:
include("includes/lessonheader.php");
...
elseif ($answertype == "vid") {
include '.\videos\videoplayer.html';
echo '<p>Click next to proceed, or watch the video again.</p>
如果我使用简单的 iframe,它会:
elseif ($answertype == "vid") {
echo '<iframe src=".\videos\videoplayer.html"></iframe>';
echo '<p>Click next to proceed, or watch the video again.</p>
作为参考,这里是 videoplayer.html (放在顶部的注释脚本对包含不工作或 iframe 工作没有影响 - 只是测试一下):
<script type="text/javascript" src="swfobject.js"></script>
<div id="wb_FlashVideoPlayer1" style="margin:0;padding:0;position:relative;left:10px;top:10px;width:640px;height:480px;text-align:left;z-index:5;">
<p>This is before the player </p>
<div id="FlashVideoPlayer1"></div>
This is after the player
<script type="text/javascript">
var flashvars = {};
var params = {};
flashvars.videoPath = "addition1.f4v";
...
params.salign = "tl";
swfobject.embedSWF("wb.videoplayer.swf", "FlashVideoPlayer1", "640", "480", "9.0.0", false, flashvars, params);
</script>
</div>
想法?