0

我有以下服务器端视频剪辑变量:$fileName = "bin-debug/Video Source/Black Eyed Peas - The Time.flv";我正在使用以下 Javascript 使用此视频剪辑创建播放器(我正在使用 Flex 视频组件)

function createPlayer(videoSource){
    document.writeln("<div id=\"player\">");
    document.writeln("<object width=\"489\" height=\"414\" FlashVars=\""+videoSource+"\">");
    document.writeln("<param name=\"player\" value=\"bin-debug/FlexPlayer.swf\">");
    document.writeln("<embed src=\"bin-debug/FlexPlayer.swf\" name=\"player\" width=\"489\" height=\"414\" FlashVars=\""+videoSource+"\">");
    document.writeln("</embed>");
    document.writeln("</object>");
    document.writeln("</div>");               
}

函数调用就像

<script type="text/javascript">
var videoSource = "<?php echo $fileName; ?>";
    createPlayer(videoSource);
</script>

由于某种原因,播放器没有播放不同的视频。也许问题出在指定 videoSourcew 标记的 MXML 中?任何帮助将不胜感激。

4

1 回答 1

1

也许像这样

document.writeln("<param name=FlashVars value="+videoSource+">");

?

编辑

然后你已经定义了 FlashVars 参数,但它没有在嵌入中调用

在 height=\"414\" 之后的嵌入中添加这个

FlashVars=\""+videoSource+"\"

对于这个结果

document.writeln("<embed src=\"bin-debug/FlexPlayer.swf\" name=\"player\" width=\"489\" height=\"414\" FlashVars=\""+videoSource+"\">");
于 2011-07-24T18:04:06.583 回答