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

私はあなたができる方法を見つけました。あなたのリンクを食べるために unike 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 に答える
0

「autoplay」を「autostart」に置き換えて、「true」に設定してください。Flash Player は「自動再生」をコマンドとして認識しません。コードは次のようになります。

    $('#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

追加してみる

'swf' : {'allowfullscreen':'true', 'autoplay':'1'}
于 2010-12-10T10:28:58.103 に答える