解析和显示来自不同站点的视频 - 就像 facebook 那样
我想知道 facebook 如何解析来自不同来源(youtube、dailymotion 以及其他较小的服务)的视频链接,并将它们显示在墙上自己的播放器中。
我实际上有一个项目的想法,但它涉及将视频链接传递给任何人的能力视频服务
知道它是如何完成的吗?
I wonder how does facebook parse video links from different sources (youtube, dailymotion but also other smaller services) and displays them in their own player on the wall
I actually have an idea for a project but it would involve ability to pass video link to any video service
Any idea how is it done?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
他们有一个站点列表以及将这些站点映射到各自嵌入式播放器的方法。
例如,如果您粘贴 YouTube 网址,例如 http://www.youtube.com/ watch?v=jCdtS8uTocM,Facebook 知道您可以使用以下方式嵌入视频:
真的就是这么简单。没有任何事情可以使其适用于任何视频服务。不可能。每个人都可以做一些不同的事情。
但是,如果需要,您可以解析并查找常见视频资源,例如 FLV。这可能带来的麻烦远大于其价值。如今,您必须执行 JavaScript 才能找到所有这些内容。
为 YouTube、Vimeo 和任何其他流行视频网站预构建模板,然后就可以了。
They have a list of sites and a way to map those sites to their respective embedded players.
For example, if you paste in a YouTube URL, such as http://www.youtube.com/watch?v=jCdtS8uTocM, Facebook knows that you can embed the video with:
It really is that simple. There is no such thing as making this work for any video service. Not possible. Everyone can do something different.
However, you could parse through and look for common video resources, such as FLV, if you wanted. This is likely much more trouble than it is worth. These days you'd have to be executing JavaScript to find them all.
Prebuild templates for YouTube, Vimeo, and any other popular video sites, and you're set.