Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a youtube video embedded in a popup window, which works fine, but for some users within my network Youtube is blocked. What is the simplest method to offer them an alternate self hosted version on our server via a link.

share|improve this question
up vote 1 down vote accepted

I can't see a good solution for doing this programatically. Perhaps you should offer the user a button allowing them to self select?

share|improve this answer
Looks like my only option without getting too complicated, thanks. – Drai Feb 20 '12 at 22:16

This answer on StackOverflow to "Detecting if YouTube is blocked by company ISP" provides a JavaScript solution for detection of a blocked YouTube situation.

share|improve this answer

Alternatively, you could use the onload event handler on the YouTube embed iframe to check if it gets loaded or not. However, one drawback to this approach is that a firewall could replace the page instead of blocking the connection.

It's probably better to use the GData YouTube JSONP services to test if they're accessible and returning valid data. This would be a failsafe method perhaps slightly more accurate than Mike's suggestion—though that in itself should be pretty safe.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.