Mobile app version of vmapp.org
Login or Join
Sent6035632

: 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

@Sent6035632

Posted in: #Networking #Video

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.

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Sent6035632

3 Comments

Sorted by latest first Latest Oldest Best

 

@Ogunnowo487

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.

10% popularity Vote Up Vote Down


 

@Dunderdale272

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

10% popularity Vote Up Vote Down


 

@Ravi8258870

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

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme