Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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
add comment

3 Answers

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
add comment

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
add comment

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
add comment

Your Answer

 
discard

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.