Claire
Claire

Reputation: 3773

Why isn't my youtube embed loading in fancybox?

Here is the link to the page, it's the last item on that page. Below is my html. The other fancyboxes are working, just seems to eb an issue with this one.

<a href='http://www.youtube.com/embed/NXzSX5Cbebw' class='fancybox everybody_is_smoking_video'>
     <img src='phpThumb/phpThumb.php?src=../images/smokingvideo_thumbnail.png&h=189&w=240' alt='thumbnail ofeverybody_is_smoking_video'/>
</a>

My js

$('.everybody_is_smoking_video').fancybox({
            'height': 423,
            'width':579, 
            'titlePosition': 'inside',
            'href' : this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
            'type'      : 'swf',
            'swf'       : {'wmode':'transparent','allowfullscreen':'true'}

        });

Upvotes: 0

Views: 169

Answers (1)

CastroXXL
CastroXXL

Reputation: 161

Its because it is a different domain.

Change the type to 'iframe'. That should do the trick. I went and did it with firebug and it worked fine.

Since I was just running it in the console, I had to remove the href part in the fancybox config. But without it it still worked fine.

Upvotes: 2

Related Questions