Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3931596
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T23:22:01+00:00 2026-05-19T23:22:01+00:00

Using Fancybox to play youtube videos in a modal box . My Problem is

  • 0

Using Fancybox to play youtube videos in a modal box.

My Problem is that I keep getting “The requested content cannot be loaded. Please try again later.”

The modal box is popping up so I know the script is running, it might be a problem with my API call… here is my call:

<script type="text/javascript">
$(document).ready(function() {

            /* This is basic - uses default settings */

            $("a.fancybox").fancybox({
                'hideOnContentClick': true
            });

            /* This is a non-obtrustive method for youtube videos*/

            $("a[rel=fancyvideo]").fancybox({
                overlayShow: true,
                frameWidth:640,
                frameHeight:360,
            });
        });
</script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T23:22:01+00:00Added an answer on May 19, 2026 at 11:22 pm

    Do you have any <a>s with both class="fancybox" and rel="fancyvideo"? If you do then you’ll be binding Fancybox to those elements twice and Fancybox might not like that. Try taking out this one:

    $("a.fancybox").fancybox({
        'hideOnContentClick': true
    });
    

    And see what happens with just the second one in place.

    UPDATE: Strange. The demo (http://chadly.net/demos/video-lightbox.html) is producing different HTML than your page, the demo builds an <object data=...> but yours builds a <object><embed src="youtube-url"> thing. You’re saying:

    type: 'swf'
    

    in your Fancybox binding, that’s where the <object><embed>...</embed></object> stuff comes from. However, the href points at a plain old YouTube video viewing HTML page and that href ends up as the src attribute for the <embed>. The URL for embedding a YouTube video isn’t the same as the video’s HTML page and that’s probably the source of your problem.

    Try replacing the href that looks like this:

    http://www.youtube.com/watch?v=QmVvgSfdmJQ
    

    with one like this:

    http://www.youtube.com/embed/QmVvgSfdmJQ
    

    The first is the plain HTML page for YouTube, the second is the embeddable SWF.

    UPDATE 2: The example you’re working from is for Fancybox 1.0.0 but you’re using 1.3.4, 1.0.0 has some special checks for YouTube that aren’t present in later versions:

    //...
    } else if (url.match(/youtube\.com\/watch/i)) {
    //...
    

    That’s from 1.0.0 and the code after that else if rewrites the HTML page URL (e.g. http://www.youtube.com/watch?v=QmVvgSfdmJQ) to the older embeddable SWF URL (e.g. http://www.youtube.com/v/QmVvgSfdmJQ). This version problem also explains why the demo was producing different HTML than your’s.

    So, you have some version problems on top of everything else.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using FancyBox to display YouTube videos (using the YouTube embed link) with Fancy
I have a form in a modal iframe window that i create using fancybox.
I did video overlays using fancybox. but the problem is some of my videos
i am using fancybox function in jquery. i am opening loign box on click
i am using fancybox for displaying certain pages on my website. my problem is
I'm using Fancybox to display inline content (a div with an image linked to
I'm using Fancybox to load some content with AJAX. Content: <div class="container"> <h2>An image</h2>
I'm using fancybox 1.2.1 to open an iframe. My problem is my width, height
I've just started using fancybox. My client want's a popup box (using fancybox) with
I'm using Fancybox as a lightbox. I have videos set up in external html

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.