facebook - 如何像 youtube 一样在 Facebook 上分享我网站上的视频

标签 facebook html video youtube embed

我有一个带有 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/

相关文章:

video - 在 ffmpeg 中去隔行

c++ - 如何保存两台摄像机的数据而不影响它们的图像采集速度?

javascript - Facebook 链接预览生成

ios - 如何在没有登录的情况下在 ios 中显示 facebook 新闻提要?

php - 如何在 magento 网站上进行 facebook 登录集成?

html - 页脚 div 起作用

html - 使用 Selenium Webdriver 和 ruby​​ 使用<按钮类型 ="button"> 上传文件

javascript - 浏览器缩放时如何在打印时没有缩放内容?

audio - 如何使用具有多个音频流的 mpv 播放视频

php - 使用 PHP 获取 Facebook 元标记