oembed 服务类似于 oohembed(YouTube with JSONP)

发布于 2024-12-02 02:48:44 字数 184 浏览 2 评论 0原文

您会推荐哪家 oembed 提供商来代替之前的 oohembed?我正在编写一个 jQuery UI 插件,它使用 oohembed 嵌入 youtube 和 vimeo,因为 YouTube 不支持 JSONP。

现在我不知道如何嵌入 YouTube – Vimeo 没有问题。我不想为 embed.ly 付费,因为我想公开我的小部件。

What oembed provider would you recommend instead of the former oohembed? I’m writing 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

早乙女 2024-12-09 02:48:44

youtube 确实支持 jsonp,请尝试以下网址: http://gdata.youtube.com/feeds/api/standardfeeds/most_popular?v=2&alt=json&callback=foo

并且,嵌入YouTube 视频,您只需拥有一个以此为源的 iframe:http://www.youtube.com/ embed/youtubeid

编辑(基于评论)

要获取我上面发布的链接中第一个条目的标题,您可以使用以下命令:

success: function(json) {
    alert(json.feed.entry[0].title.$t);
}

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);
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文