Javascript-创建Flash播放器

发布于 2024-11-26 14:29:03 字数 994 浏览 3 评论 0原文

我有以下服务器端视频剪辑变量: $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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

老娘不死你永远是小三 2024-12-03 14:29:03

也许像这样

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+"\">");

Maybe like this

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

?

EDIT

Then you have define the FlashVars param but it's not called in the embed

Add this in the embed after height=\"414\"

FlashVars=\""+videoSource+"\"

for this result

document.writeln("<embed src=\"bin-debug/FlexPlayer.swf\" name=\"player\" width=\"489\" height=\"414\" FlashVars=\""+videoSource+"\">");
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文