我有一个带有 HTML5 视频播放器的网站。
我想在 Facebook 上分享链接(例如:http://site.com/video/example-2),当用户点击 Facebook 上该帖子的图片时,它就会开始在那里播放视频。
就像 youtube 视频和 vimeo 视频一样。
我该怎么做?
谢谢
最佳答案
I have a website that has a HTML5 video player.
您想找到一个可以从 url={video_Hot_link}
流式传输视频的优质 SWF (*.SWF) 视频播放器(将 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>
中添加以下前缀喜欢这样
<html prefix="og: http://ogp.me/ns#">
关于facebook - 如何像 youtube 一样在 Facebook 上分享我网站上的视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18903547/