且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在Facebook上嵌入自己的Flash视频播放器?

更新时间:2023-09-26 19:21:16



您希望SWF文件在Facebook中帖子如下: 示例



注意: Facebook只会显示从HTTPS服务器托管的SWF文件。如果你可以做那个部分,然后阅读..



1)你需要在你的网站上有一个HTML页面,然后发布为一个链接在你的Facebook状态。来自Facebook链接页面中包含的标签,Facebook将会读取并加载SWF数据。



2)将元标签放在<头> ....< / head>部分。



(注意:为了使上述示例工作,我使用旧样式嵌入,但您可以尝试更新的OG标签。好参考)。以下是您自己的html的示例(SWF进入video_src

 &LT;头> 
< meta name =titlecontent =我的视频SWF里面的FBook/>
< meta name =descriptioncontent =只是将SWF嵌入状态的测试/>
< meta name =mediumcontent =video/>

< link rel =image_srchref =https://website.com/files/test_Thumbnail.jpg/>
< link rel =video_srchref =https://website.com/files/test_VideoPlayer.swf/>

< meta name =video_widthcontent =504/>
< meta name =video_heightcontent =283/>
< meta name =video_typecontent =application / x-shockwave-flash/>
< /头>

3)目前最大宽度为504,高度为283.检查 此页面 ,当Facebook改变主意时,



您可以检查Facebook将如何使用他们的 调试器 工具。只需粘贴您的HTML页面链接,就像在墙上的信息一样,它将显示一个实时预览。



更新:对于HTML5视频 :我没有尝试这个部分我自己,但只是我的理解..)



假设你已经与 OG:标签,那么你可以放多个OG:视频链接(第一个应该是Flash,然后是后退到HTML5,这应该是直接链接到视频文件)。



我如果HTML5视频文件是由系统播放器(在弹出窗口中)播放,而不是使用您自己定制的JS / CSS界面,则不要感到惊讶。

 < meta property =og:videocontent =https://website.com/files/test_VideoPlayer.swf /&GT; 
< meta property =og:video:secure_urlcontent =https://server.com/files/test_VideoPlayer.swf/>
< meta property =og:video:typecontent =application / x-shockwave-flash/>

其次是...(非Flash)

 < meta property =og:videocontent =http://website.com/files/Video.mp4/> 
< meta property =og:video:secure_urlcontent =https://server.com/files/Video.mp4/>
< meta property =og:video:typecontent =video / mp4/>
< meta property =og:video:widthcontent =500/>
< meta property =og:video:heightcontent =280/>


I want to embed my flash video player on facebook so that when people share my videos on facebook, it will let them play the video on Facebook. I saw some posts here on *** about this topic and that a whitelisting wouldn't be required anymore, but i can't find any informations about it beyond December 2013.

Is it still possible? If yes, does it require a whitelisting?


You want your SWF file in a Facebook post like this: Example?

note: Facebook will only display SWF files that are hosted from an HTTPS server. If you can do that part then read on..

1) You need to have an HTML page on your site that is then posted as a link on your Facebook status. It's from the meta tags contained in that linked page that Facebook will read and load the SWF data.

2) Put the meta tags somewhere within the < head > .... < / head > section of your page's HTML.

(note: To make the above example work I had used old style embedding back then but you can try the newer OG tags. Good Reference). Below is an example for your own html (SWF goes in "video_src")

< head >
<meta name="title" content="My Video SWF inside FBook" />
<meta name="description" content="Just a test for embedding SWF in a status" />
<meta name="medium" content="video" />

<link rel="image_src" href="https://website.com/files/test_Thumbnail.jpg"/> 
<link rel="video_src" href="https://website.com/files/test_VideoPlayer.swf"/>

<meta name="video_width" content="504" />
<meta name="video_height" content="283" />
<meta name="video_type" content="application/x-shockwave-flash"/>
< /head >

3) Currently the maximum Width is 504 and Height is 283. Check this page for updates whenever Facebook changes its mind about those settings.

You can check how Facebook will "parse" your html link using their Debugger Tool. Just paste your html page link as you would in a wall post and it will show a live preview.

UPDATE: For HTML5 Video (note: I havent tried this part myself but just my understanding..)

Assuming you've gone with OG: tags then you can just put multiple OG:Video links (first one should be Flash followed by fallback to HTML5 which should be the direct link to video file).

I cant confirm this now but.. Don't be surprised if the HTML5 video file is played by a system player (in a pop-up window?) and not with your own custom-design JS/CSS interface.

<meta property="og:video" content="https://website.com/files/test_VideoPlayer.swf" />
<meta property="og:video:secure_url" content="https://server.com/files/test_VideoPlayer.swf" />
<meta property="og:video:type" content="application/x-shockwave-flash" />

followed by... (for non-Flash)

<meta property="og:video" content="http://website.com/files/Video.mp4" />
<meta property="og:video:secure_url" content="https://server.com/files/Video.mp4" /> 
<meta property="og:video:type"       content="video/mp4" /> 
<meta property="og:video:width"      content="500" /> 
<meta property="og:video:height"     content="280" />