1

我刚刚发现了 oEmbed,想知道是否有办法通过发送用户代理(或首选格式,如 3gp)来获取移动链接/嵌入代码?

我可能错过了一些东西,但我在 oEmbed 网站上找不到这些选项。

例如(Youtube),我想为支持它的设备获取 3gp rtsp 链接,并为支持它的设备获取闪存嵌入。

我知道这些链接存在于 youtube 上,因为当我用手机访问 www.youtube.com 时,我会获得指向 rtsp 的链接。

谢谢。

4

1 回答 1

0

不幸的是,对于您的用例,oembed 规范没有提及在给定 URL 处请求不同格式的内容,因此完全由每个提供商来决定他们是否以及如何在他们的回应。

例如,您可以将 iframe 参数传递给 YouTube oembed 端点,以使其嵌入代码的 Flash 或 iframe 版本。但是,我认为许多其他提供商不支持这种类型的标志。

# The URL for the Flash version of this video's embed code
http://www.youtube.com/oembed?iframe=0&url=http%3A//youtube.com/watch%3Fv%3DaWPoJ6sm8HU&format=json
# The URL for the iframe/mobile-friendly version of this video's embed code
http://www.youtube.com/oembed?iframe=1&url=http%3A//youtube.com/watch%3Fv%3DaWPoJ6sm8HU&format=json
于 2012-07-07T06:00:52.590 回答