php 如何在 Facebook 中嵌入我自己的视频播放器?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4591764/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 13:36:54  来源:igfitidea点击:

How to embed my own video player in Facebook?

phpjqueryflashfacebookvideo

提问by Simon Thomsen

Is it possible to embed my own video player in Facebook, so I can see the video directly in the timeline, like all the YouTube videos?

是否可以在 Facebook 中嵌入我自己的视频播放器,以便我可以像所有 YouTube 视频一样直接在时间轴中查看视频?

Are there any metatags I need to include in the <head> section of my site?

我需要在网站的 <head> 部分包含任何元标记吗?

采纳答案by larsen161

You must first get your Flash player approved by submitting a video embed whitelist request.

您必须首先通过提交视频嵌入白名单请求来获得您的 Flash 播放器的批准。

Once this is approved, which took 4 hours for me when I look back on emails from my request, your player will be able to be shown just as YouTube videos are. You can then use the Facebook Share help guide which firementioned in his reply. Also, another helpful thing is the URL Linterwhich tells you how Facebook is interpreting the metadata on your pages.

一旦获得批准(当我回顾我请求中的电子邮件时,我花了 4 个小时),您的播放器将能够像 YouTube 视频一样显示。然后您可以使用他的回复中提到的的 Facebook Share 帮助指南。此外,另一个有用的东西是URL Linter,它告诉你 Facebook 如何解释你页面上的元数据。

回答by Dave

To add to the other answers, a recent developer post from Facebook (which I can't seem to find at the moment) inferred that whitelisting was no longer necessary. I did it anyway. Takes about a week.

为了补充其他答案,最近来自 Facebook 的开发人员帖子(我目前似乎找不到)推断不再需要白名单。反正我做到了。大约需要一周时间。

You need to use the Open Graph protocol. Info on embedding video is at the bottom of this page: http://developers.facebook.com/docs/opengraph/

您需要使用 Open Graph 协议。有关嵌入视频的信息位于本页底部:http: //developers.facebook.com/docs/opengraph/

This is what we found through experimentation (which will certainly change in the future):

这是我们通过实验发现的(未来肯定会改变):

  • The player must be a flash player.
  • It must be an https link.
  • You can add optional flashvars as parameters.
  • 播放器必须是 Flash 播放器。
  • 它必须是一个 https 链接。
  • 您可以添加可选的 flashvars 作为参数。

An example og:video tag from our website:

我们网站上的一个 og:video 标签示例:

<meta property="og:video" content="https://indieflix.com/media/swf/player.swf?bufferlength=3&lightcolor=FFFFFF&autostart=true&file=http%3A%2F%2Findieflix.com%2Fstreamer%2Fhdtrailer%2F32310_320x180.mp4&provider=http&frontcolor=CCCCCC&image=http%3A%2F%2Fcdn.indieflix.com%2Ffilms%2Fimages%2Flarge%2F32310.jpg&backcolor=333333" />

回答by fire

Yes, there is a meta tag though I am not sure if your own Flash video player will get directly embedded. Take a look at the Sharing Rich Mediasection.

是的,有一个元标记,但我不确定您自己的 Flash 视频播放器是否会被直接嵌入。查看共享富媒体部分。

回答by Metacowboy

Nice Video embed works like a charm just saw a recent change how youtube embed. Previews it was a smals thumbnail with a play button , even when marked as favorite story. Now they embed video as featured story (the star) full Timeline cover sized Thumbnail with the play button .that is very interesting for any video or flash embed in facebook.

Nice Video embed 的效果就像一个魅力,刚刚看到 youtube 嵌入方式的最新变化。预览它是一个带有播放按钮的小缩略图,即使被标记为最喜欢的故事。现在,他们将视频嵌入为特色故事(明星)完整时间轴封面大小的缩略图,并带有播放按钮。这对于嵌入 facebook 的任何视频或 Flash 都非常有趣。