【问题标题】:Loading Youtube in a modal (possibly with swfobject?)以模式加载 Youtube(可能使用 swfobject?)
【发布时间】:2010-12-11 17:00:16
【问题描述】:

我在让 YouTube 视频在所有浏览器上以模式正确加载时遇到了很多问题。我刚刚找到了 swfobject,但找不到任何实现它的代码。

谁能告诉我如何使用 swfobject 动态加载 YouTube 视频?我还在网站上运行了 jQuery,如果这样可以使它的代码更优雅。

【问题讨论】:

    标签: javascript jquery youtube swfobject


    【解决方案1】:

    我想通了。这是我用来让它在模态中工作的代码:

    var atts = {};
    atts.id = "vid";
    $.modal('<div class="modal_container" style="background: transparent url(<?php echo $base_path . path_to_theme() ?>/images/bkgd_youtube_modal.png) no-repeat;"><div id="youtube_movie"></div></div>', options);
    
    swfobject.embedSWF('http://www.youtube.com/v/'+this.id+"&hl=en&fs=1&rel=0&color1=0x000000&color2=0x2d2d2d&enablejsapi=1&playerapiid=ytplayer",
    "youtube_movie", "460px", "280px", "9", null, null, atts);
    

    【讨论】:

      猜你喜欢
      • 2011-07-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-10
      • 2014-09-06
      • 2010-10-31
      • 2012-06-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多