0
I have links with vimeo urls in them:

    <a class="video" href="http://vimeo.com/9532951">link 1</a>
    <a class="video" href="http://vimeo.com/8228482">link 2</a>

Then I have manual fancybox call that loads the video into a fancybox:

    <script>
 $("a.video").click(function() {
  $.fancybox({
   'padding'  : 0,
   'autoScale'  : false,
   'transitionIn' : 'none',
   'transitionOut' : 'none',
   'title'   : this.title,
   'width'   : 400,
   'height'  : 265,
   'href'   : this.href.replace(new RegExp("([0-9])","i"),'moogaloop.swf?clip_id=$1'),
   'type'   : 'swf'
  });

  return false;
 });
</script>

我一生无法弄清楚如何将参数传递给视频播放器...autoplay=1 或 fullscreen=1 等等。我尝试了几件事,但没有任何效果。认为这就像添加'swf' : 'autoplay=1',但没有奏效。无论如何,任何帮助将不胜感激

谢谢。

4

4 回答 4

1

这是另一个不需要唯一 ID 的工作解决方案:

$(".vimeo").click(function() {
    $.fancybox({
        'padding'       : 0,
        'overlayShow'   : true,
        'overlayOpacity': .85,
        'overlayColor'  : '#000',
        'autoScale'     : false,
        'transitionIn'  : 'elastic',
        'transitionOut' : 'elastic',
        'title'         : this.title,
        'width'         : 680,
        'height'        : 393,
        'href'          : this.href.replace(new RegExp("([0-9])","i"),'moogaloop.swf?clip_id=$1')+'&amp;autoplay=1',
        'type'          : 'swf'
    });
    return false;
});
于 2012-02-07T18:35:11.023 回答
0

尝试添加

'swf' : {'allowfullscreen':'true', 'autoplay':'1'}
于 2010-12-10T10:28:58.103 回答
0

只需确保将“autoplay”替换为“autostart”并将其设置为“true”即可。Flash 播放器不将“自动播放”理解为命令。代码将是这样的:

    $('#vimeo_video').click(function(){
    $.fancybox({
        'padding'       : 0,
        'autoScale'     : true,
        'transitionIn'  : 'elastic',
        'transitionOut' : 'elastic',
        'title'         : this.title,
        'width'         : 790,
        'height'        : 450,
        'href'          : this.href.replace(new RegExp("([0-9])","i"),'moogaloop.swf?clip_id=$1')+'&amp;autoplay=true',
        'type'          : 'swf',
        'swf'           : { 'wmode' : 'transparent', 'allowfullscreen' : 'true', 'autostart' : 'true' }
    });
    return false;
});

$("#vimeo_video").trigger('click');
于 2012-11-05T23:30:41.677 回答
0

我找到了一种方法可以做到这一点。添加一个独特的 ID 来获取您的链接并将它们的调用设置为

$("a.video").click(function() {
var video_fancybox = {
'padding' : 0,
'autoScale' : false,
'transitionIn' : 'none',
'transitionOut' : 'none',
'title' : this.title,
'width' : 400,
'height' : 265,
'href' : this.href.replace(new RegExp("([0-9])","i"),'moogaloop.swf?clip_id=$1'),
'type' : 'swf',
'swf' : {
'wmode' : 'transparent',
'allowfullscreen' : 'true'
}
};
$("#vimeo_test3").fancybox( // On for eatch link
$.extend(video_fancybox, {'href' : 'http://vimeo.com/moogaloop.swf?clip_id=3979490&amp;fullscreen=1'})
);
return false;
});

于 2010-12-13T13:02:59.910 回答