开发者

Can I use other video formats besides SWF in a feed post?

开发者 https://www.devze.com 2023-04-03 17:14 出处:网络
I have searched for two days on google trying to solve this problem.I have also searched this forum and read the FB Dev page till my eyes hurt.I asked this question two days ago and it got removed.I c

I have searched for two days on google trying to solve this problem. I have also searched this forum and read the FB Dev page till my eyes hurt. I asked this question two days ago and it got removed. I completely understand but if I am asking it incorrectly please, please, help me to ask correctly or point me in the right direction or tell me im an idiot, anything.

I am trying to use FB.UI to "Publish a story to the feed" from my site. That is working fine.

My problem is that I want to add a video instead of a photo. So based on the FB DEV docs, I am trying to use the "source" property to do this. But I have tried multiple video formats to no avail (avi, mp4, flv). The only thing that does seem to work is a SWF file but I do not have the video in that format. (tried to do that also but don't have the right tools)

Does anyone know if you have to use SWF or can you use another format and I am doing it wrong.

You can see my progress here http://www.thishope.org/facebook-tab.html (click on "get a free song" to get the dialog box.)

This is the code from my page

<html>
<head>
  <title>This Hope</title>
  <link href="http://www.thishope.org/this-hope-fb-style.css" rel="stylesheet" type="text/css" />
</head>
<body>


<div id="fb-root"></div>
<script src="h开发者_高级运维ttp://connect.facebook.net/en_US/all.js"></script>
<script>
 FB.init({
 appId  : '244237565620746',
 status : true, // check login status
 cookie : true, // enable cookies to allow the server to access the session
 xfbml  : true, // parse XFBML
 channelUrl : 'http://WWW.MYDOMAIN.COM/channel.html', // channel.html file
 oauth  : true // enable OAuth 2.0
 });
 </script>


<div id="fb-link">


<script type="text/javascript">
function newInvite(){
   FB.ui({  method: 'feed',
            message: 'Get A Free Song!',
    source:'http://www.thishope.org/FB-Only-One-Lord.mp4',
    name:'Get A Free Song By This Hope!',
    caption:'Only One Lord',
    description:'Click share to post on your wall and download the song',
    });
   }
 </script>
     <a href="#" onclick="newInvite(); return false;">Get A Free Song!</a>

</div>

  </body>
</html> 


Could you not host a flash video player like flowplayer? I know it supports FLV, not sure about other formats, you may need to convert to FLV server side first You can then attach the SWF URL to your post, which will have the advantage of the video being playable right inside Facebook's news feed

Check this sample page's source: http://sdoyle.fbdublin.com/tests/tasks/632942.html

The meta tags on this page, when detected by Facebook (via a share or Like), render the flowplayer video player right into the news feed post, and flowplayer knows which video to play via the configuration passed to it as a parameter. I know it's not exactly what you're trying to do, but should give you the right idea for your video.

You should be able to embed in the same manner by using the source parameter for the Feed Dialog to specify a flash player for your content

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号