开发者

oEmbed with Mobile devices

开发者 https://www.devze.com 2023-01-18 14:17 出处:网络
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 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 fi开发者_如何学编程nd 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.


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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号