: Youtube embed is blocked by corporate network, how to detect and offer an alternate self hosted version? I have a youtube video embedded in a popup window, which works fine, but for some users
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.
More posts by @Sent6035632
3 Comments
Sorted by latest first Latest Oldest Best
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.
This answer on StackOverflow to "Detecting if YouTube is blocked by company ISP" provides a JavaScript solution for detection of a blocked YouTube situation.
I can't see a good solution for doing this programatically. Perhaps you should offer the user a button allowing them to self select?
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.