如何在YouTube等Facebook上分享我的网站上的视频



我有一个网站,有一个HTML5视频播放器。

我想在Facebook上分享链接(例如:http://site.com/video/example-2),用户在Facebook上单击该帖子的图像,它开始在那里播放视频。

就像YouTube视频和vimeo视频一样。

我该怎么做?

谢谢

我有一个网站有一个HTML5视频播放器。

你想找到一个好的SWF(*。SWF) 视频播放器,可以从url={video_Hot_link}流式传输视频(URL参数传递给SWF播放器)

现在,在您准备好SWF播放器流式传输某些视频后,请添加Facebook Open Graph到您的<head>标签,如下所示:

<meta property="og:type" content="video"> <!-- site/page type more information http://ogp.me/ -->
<meta property="og:video:type" content="application/x-shockwave-flash"> <!-- you need this because your player is a SWF player -->
<meta property="og:video:width" content="Width in Pixels"> <!-- player width -->
<meta property="og:video:height" content="Height in Pixels"> <!-- player height -->
<meta property="og:video" content="http://example.com/{path_to}/{swf_player}.swf?url={video_soure}"> <!-- You will need to echo/print the video source (*.mp4) with server-side code -->
<meta property="og:video:secure_url" content="https://example.com/{path_to}/{swf_player}.swf?url={video_soure}"> <!-- required for users whom use SSL (actually Facebook forces everyone to use SSL so you're required to use og:video:secure_url) so get a one -->

此外,您需要添加以下前缀以<html> likeso

<html prefix="og: http://ogp.me/ns#">

Facebook不再允许第三方播放器进行内联播放。Vimeo甚至在他们的文档中提到了这一点。

展望未来,如果您想在新闻源中内联播放视频,您将需要使用Facebook自己的视频托管平台。

我还使用 og:video 来共享视频,但在 https://developers.facebook.com/tools/debug/og/object/上调试它时,它给出了警告错误 应该显式提供"og:image"属性,即使可以从其他标签推断出值。

最新更新