views:

294

answers:

3

Given an Youtube video id how can I determine from JavaScript whether the video has embedding disabled?

+2  A: 

yt:noembed

The tag specifies that a video may not be embedded on other websites. This tag may be included in a request to upload or update a video's metadata. By default, videos can be embedded on other sites unless they are private videos. If a request does not include either the tag or the tag, a video will be embeddable on other websites.

Possibly of Interest:

Jonathan Sampson
Yeah, that was my question too. Turns out to be different though no event was fired regarding state change. But the js api has an onError callback that I can plug into.
Allain Lalonde
A: 

You'd have to use a server-side script for this, and use some AJAX to call it.

mgroves
A: 

FYI you can get GData responses in JSON format, so you could use javascript to check the embed status before you show the embed player.

If you prefer, you can hook into the onError callback in the player, but that's probably not as nice of a user experience as checking first.

Geoff