o嵌入移动设备

发布于 2024-09-25 12:56:55 字数 251 浏览 1 评论 0原文

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

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

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

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

谢谢。

I've just found out about oEmbed and was wondering if there is a way to get a mobile link/embed code by sending the user-agent (or preferred format, like 3gp)?

I've might have missed something, but I can't find those options on the oEmbed website.

For example (Youtube), I would like to get the 3gp rtsp link for devices that supports that and flash embed for devices that supports that.

I know those links exists on youtube, because when I go to www.youtube.com with my mobile phone i get links to rtsp.

Thanks.

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

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

发布评论

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

评论(1

迷你仙 2024-10-02 12:56:56

不幸的是,对于您的用例来说,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

Unfortunately for your use case, the oembed spec doesn't make any mention of requesting different formats of the content at a given URL, so it's completely up to each provider to decide if & how they want to support mobile-friendly embed code in their responses.

For example, you can pass an iframe parameter to the YouTube oembed endpoint to either the Flash or the iframe version of their embed code. However, I don't think many other providers support this type of flag.

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