<p>We have YouTube videos on a site and want to detect if it is likely that they will not be able to view them due to (mostly likely) company policy or otherwise.</p>

<p>We have two sites:</p>

<p>1) Flex / Flash
2) HTML</p>

<p>I think with Flex I can attempt to download <a href="http://youtube.com/crossdomain.xml" rel="noreferrer">http://youtube.com/crossdomain.xml</a> and if it is valid XML assume the site is available</p>

<p>But with HTML I don't know how to do it. I can't even think of a 'nice hack'.</p>

This should work.  Basically, it loads a youtube.com javascript file, then checks if a function in that file exists.
```
```
<html>

<head>
    <script src="http://www.youtube.com/js/account.js"></script>
    <script>
        function has_you_tube()
        {
            if(typeof addVideosToQuicklist == 'function')
            {
                return true;
            }
            else
            {
                return false;
            }

        }
    </script>

</head>
<body>
    <script>alert( "has_youtube: " + has_you_tube() ); </script>
</body>

</html>
```
```