oembed service similar to oohembed (YouTube with JSONP)
What oembed provider would you recommend instead of the former oohembed? I’m wri开发者_JS百科ting a jQuery UI plugin that used oohembed to embed youtube and vimeo since YouTube doesn't support JSONP.
Now I don’t know what to do to embed YouTube – there is no problem with Vimeo. I don’t want to pay for embed.ly because I want to make my widget public.
youtube does support jsonp, try this url: http://gdata.youtube.com/feeds/api/standardfeeds/most_popular?v=2&alt=json&callback=foo
And, to embed a youtube video, you simply have an iframe with this as the source: http://www.youtube.com/embed/youtubeid
Edit(based on comments)
To get the title of the first entry in the link i posted above, you would use this:
success: function(json) {
alert(json.feed.entry[0].title.$t);
}
精彩评论