Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I tell if a YouTube video is embeddable before I try and load it?
    primarykey
    data
    text
    <p>I've got a chromless YouTube player that I'm trying to load videos into, but only some videos work--not all. If I'm not mistaken, the ones that aren't loading are due to copyright infringement (e.g., some episode of a cartoon doesn't load, but a home movie of a kid doing a backflip does). What I'm trying to do is either find out whether or not these videos can load, either after we try to load them or before.</p> <p>As an example, here are two videos by Nataly Dawn. One loads, the other doesn't.</p> <pre><code>// loads and plays the video ytplayer.loadVideoById("GhDGdT33K0k"); // doesn't load/play the video ytplayer.loadVideoById("-KYUPJIzCyM"); </code></pre> <p>From looking at the data of both <a href="http://gdata.youtube.com/feeds/api/videos/GhDGdT33K0k" rel="nofollow noreferrer">the working video</a> and the <a href="http://gdata.youtube.com/feeds/api/videos/-KYUPJIzCyM" rel="nofollow noreferrer">non-working video</a>, I can't seem to see anything that would indicate that the latter is non-embeddable. [I'm looking for <code>&lt;yt:accessControl&gt;</code> tags or a missing <code>yt:format='5'</code> (cf. <a href="https://stackoverflow.com/questions/3899387/how-do-i-use-the-youtube-api-to-check-if-a-video-is-embeddable"><em>How do I use the Youtube API to check if a video is embeddable?</a></em>), but to no avail.]</p> <p>From what I've tried in the console, <code>loadVideoById</code> <em>always</em> returns <code>undefined</code>, regardless of whether or not the video actually loads. I can't seem to find an API method to determine whether or not the video has done so.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload