Hello Burak,
Our alt=jsonc format seems to handle this scenario better:
http://gdata.youtube.com/feeds/api/videos/zkZBEnBjOjY?callback=jsonp1335008664915&alt=jsonc&v=2
Also, CORS/XMLHTTPRequest Level 2 support is just around the corner,
and that's a much cleaner way of doing this sort of thing:
https://code.google.com/p/gdata-issues/issues/detail?id=2233
Cheers,
-Jeff Posnick, YouTube API Team
groups.google.com/group/youtube-api-gdata | apiblog.youtube.com |
@YouTubeDev
On Apr 21, 8:43 am, Burak Emre Kabakcı <emrekaba...@gmail.com> wrote:
> One of the successful load is like that:
>
> http://gdata.youtube.com/feeds/api/videos/N7m86aMNjlQ?callback=jsonp1...
>
> However, when the video is private or doesn't exist, it returns just a
> message with an http error status code.
>
> http://gdata.youtube.com/feeds/api/videos/zkZBEnBjOjY?callback=jsonp1...
>
> I create an example unique callback function name like "jsonp1335008664824"
> and append the url as a script tag and catch the function when the script
> loaded. However if it returns an error, youtube doesn't return the content
> as a callback function and I can't catch any of them. Because script tag
> doesn't have "onerror" attribute, I don't even know whether it's loading or
> returned an error like 404 or 503 status codes.
>
> It seems the only whay to handle it is setting timeout function when I
> append script tag. However it's not a reliable way to do that so I'm
> looking for another option. I know that even I can catch the status code, I
> can't get error message but as I see, there's only two status code and two
> errors that are 404 for "Video not found" or 503 for "Video is private".
--
You received this message because you are subscribed to the Google Groups "YouTube APIs Developer Forum" group.
To post to this group, send email to youtube-api-gdata@googlegroups.com.
To unsubscribe from this group, send email to youtube-api-gdata+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/youtube-api-gdata?hl=en.
No comments:
Post a Comment