Javascript-创建Flash播放器
我有以下服务器端视频剪辑变量: $fileName = "bin-debug/Video Source/Black Eyed Peas - The Time.flv";
我正在使用以下 Javascript 来创建带有此视频剪辑的播放器(我正在使用 Flex Video 组件)
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 中?任何帮助将不胜感激。
I've got the following server-side videoclip variable: $fileName = "bin-debug/Video Source/Black Eyed Peas - The Time.flv";
I'm using the following Javascript to Create the Player with this videoclip(I'm using the Flex Video component)
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>");
}
The function call is like
<script type="text/javascript">
var videoSource = "<?php echo $fileName; ?>";
createPlayer(videoSource);
</script>
For some reason the Player isn't playing different videos. Maybe the problem is in the MXML where videoSourcew tag is specified? Any help will be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许像这样
?
编辑
然后您定义了 FlashVars 参数,但在嵌入中未调用它
添加到嵌入中的 height=\"414\" 之后
将此结果
Maybe like this
?
EDIT
Then you have define the FlashVars param but it's not called in the embed
Add this in the embed after height=\"414\"
for this result