【问题标题】:Why is the YouTube video content not populating?为什么没有填充 YouTube 视频内容?
【发布时间】:2011-04-20 23:28:15
【问题描述】:

我正在尝试让一个 youtube 视频在一个花哨的弹出窗口中播放。弹出窗口正常,但视频不播放。 Firebug 表明所有必要的元素都在加载,但没有视频。

this page 上一切正常。

this page 上会弹出窗口但没有视频。

这里是html:

<div id="play-btn">
   <a class="play-video" href="#flashArea1">Play Video</a>
</div>
<div style="display:none">
<div id="flashArea1" class="flashArea1" style="height:376;"><p>This content requires the Adobe Flash Player.<br /><a href="http://www.adobe.com/go/getflashplayer">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /><br />Get Flash</a></p>
</div>

<script type="text/javascript">
var mainswf = new SWFObject("youtube_player_standalone.swf", "main", "600", "250", "9", "#000000");
mainswf.addParam("scale", "noscale");
mainswf.addParam("wmode", "window");
mainswf.addParam("allowFullScreen", "true");
mainswf.addVariable("youtube_id", "_EC2tmFVNNE");
mainswf.addVariable("title", "Harry Potter and the Deathly Hallows");
mainswf.addVariable("controls_always_on", "false");
mainswf.addVariable("controls_fade_out_time", "5");
mainswf.addVariable("volume_cookie_on", "true");
mainswf.write("flashArea1");
</script>
</div><!-- end flash -->

这是弹出框的jQuery:

<script type="text/javascript">
$(document).ready(function() {
$("a.play-video").fancybox({
'hideOnContentClick': false
});
});
</script>

如有任何帮助,我将不胜感激。谢谢。

【问题讨论】:

    标签: jquery flash youtube-api


    【解决方案1】:

    尝试验证您的页面也出于某种原因您的源代码中显示了 php 代码我会先修复这些东西然后也许您的 youtube 会显示

    您的 html 中有两个相同 swf 代码的实例,尝试投放其中一个

    <div style="display:none">
    <div id="flashArea3" class="flashArea3" style="height:376;"><p>This content requires the Adobe Flash Player.<br /><a href="http://www.adobe.com/go/getflashplayer">
                            <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /><br />Get Flash</a></p>
    
        </div>
    
      <script type="text/javascript">
        var mainswf = new SWFObject("youtube_player_standalone.swf", "main", "600", "250", "9", "#000000");
        mainswf.addParam("scale", "noscale");
        mainswf.addParam("wmode", "window");
        mainswf.addParam("allowFullScreen", "true");
        mainswf.addVariable("youtube_id", "_EC2tmFVNNE");
        mainswf.addVariable("title", "Harry Potter and the Deathly Hallows");
        mainswf.addVariable("controls_always_on", "false");
        mainswf.addVariable("controls_fade_out_time", "5");
        mainswf.addVariable("volume_cookie_on", "true");
        mainswf.write("flashArea3");
      </script>
    

    【讨论】:

    • 我禁用了 php - 用于引入 Wordpress 博客提要。页面验证,但仍然没有视频。
    • 现在它们都引用同一个文件播放器 swf 文件,但所有实例都有唯一的 ID。
    • 是的,但是变量名和所有的代码都是一样的。。试试看能不能解决问题?
    • 我删除了它,问题仍然存在。感谢您的努力。
    • 嗯,好吧,您正在那里加载一个 Flash 项目,但加载时出错 theideapeople.com/projectpath/ideapeople-new/…
    猜你喜欢
    • 2013-03-07
    • 2013-11-18
    • 1970-01-01
    • 2020-04-28
    • 1970-01-01
    • 2017-12-29
    • 1970-01-01
    • 2017-01-18
    • 1970-01-01
    相关资源
    最近更新 更多