如何像 youtube 一样在 facebook 上分享我网站上的视频 [英] how to share a video from my website on facebook like youtube
问题描述
我有一个带有 HTML5 视频播放器的网站.
I have a website that has a HTML5 video player.
我想分享链接(例如:http://site.com/video/example-2)在 facebook 上,用户点击 facebook 上那个帖子的图片,它就会开始在那里播放视频.
I want to share the link ( ex: http://site.com/video/example-2 ) on facebook and one the users click on the image of that post on the facebook it starts playing the video there.
就像 YouTube 视频和 vimeo 视频一样.
Just like youtube videos and vimeo videos.
我该怎么做?
谢谢
推荐答案
我有一个带有 HTML5 视频播放器的网站.
I have a website that has a HTML5 video player.
您想找到一个好的 SWF (*.SWF) 视频播放器,它可以从 url={video_Hot_link}
流式传输视频(将 URL
参数传递给 SWF
播放器)
You want to find a good SWF (*.SWF) video player that can stream video from url={video_Hot_link}
(pass URL
parameter to the SWF
player)
现在,在您准备好您的 SWF 播放器以流式传输某些视频后,添加 Facebook Open Graph到您的 标签,如下所示:
Now after you got your SWF player ready for streaming some videos add Facebook Open Graph
to your <head>
tag like below:
<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
Additionally, you need to add the following prefix to <html>
likeso
<html prefix="og: http://ogp.me/ns#">
这篇关于如何像 youtube 一样在 facebook 上分享我网站上的视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!