I need to programmatically check if a user can access YouTube, as YouTube is blocked in some parts of the world. I need to be able to do this in JavaScript.
What I have tried: 1) Creating an image dynamically and setting the source to be a known image on the YouTube domain - I ran into CORS issues here 2) Creating a simple GET request using XMLHttpRequest (same problem) 3) Looking at the YouTube API.. it does not appear to expose a method which can tell me whether a GET request was successful.. and of course, all calls are routed through https://www.googleapis.com/youtube/v3 which is not, strictly speaking, exactly the same as a request to http://www.youtube.com
Is there something obvious I'm missing here? Would appreciate any and all insight..
Thanks!