กำลังโหลด JW Player ภายใน FancyBox

เพื่อนทั้งหลาย ฉันรู้สึกเหมือนฉันอยู่ใกล้แต่ไม่มีรางวัล นี่คือโค้ดที่ฉันใช้โหลด Fancybox และฉันกำลังพยายามโหลด JW Player

<script type="text/javascript">
      jQuery(window).load(function() {
        jQuery("a.fancybox").fancybox({
          'content':'<div id="mediaspace">Test</div>',
            maxWidth    : 800,
            maxHeight   : 600,
            fitToView   : false,
            width       : '70%',
            height      : '70%',
            autoSize    : false,
            closeClick  : false,
            openEffect  : 'none',
            closeEffect : 'none',
            afterLoad: function() {
                jwplayer('mediaspace').setup({
                    'flashplayer': '<?php bloginfo('template_directory'); ?>/lib/jw/player.swf',            
                    'file': 'LtGoBZ4D4_E', 
                    'image': 'http://img.youtube.com/vi/LtGoBZ4D4_E/0.jpg',
                    'provider': 'youtube',
                    'height': 400,
                    'width': 700,
                    'controlbar.position': 'bottom',
                    'youtube.quality': 'highres'
                });
          }
        });
      });
    </script>

โปรดยกโทษให้กับการจัดรูปแบบโค้ด ฉันได้ทดลองใช้ตัวเลือกต่างๆ มากมาย

JW Player ทำงาน ทำงานนอก fancybox มีแนวคิดหรือวิธีอื่นในการมองปัญหาหรือไม่?


person Jonathan Wold    schedule 22.11.2011    source แหล่งที่มา


คำตอบ (1)


การเรียกกลับ afterLoad ไม่ทำงานเนื่องจากไม่มีรูปภาพหรือวิดีโออยู่ในปลั๊กอิน fancybox ที่จะต้อง "โหลด" แทน:

    afterLoad: function() {

ใช้:

    afterShow: function() {

นั่นจะช่วยแก้ปัญหาของคุณได้

นี่คือลิงก์ไปยังเอกสารประกอบสำหรับการอ้างอิงเพิ่มเติมหรือการเปลี่ยนแปลง API ในอนาคต: http://fancyapps.com/fancybox/

person Nick Johnson    schedule 22.11.2011