开发者

How to post a slideshow in facebook?

开发者 https://www.devze.com 2023-03-23 01:49 出处:网络
Is it possible to post a slideshow in your facebook newsfeed only using HTML/Javascript/CSS ? I think it is possible to post a slideshow using flash. But I\'m hearing that FB is in the process of dep

Is it possible to post a slideshow in your facebook newsfeed only using HTML/Javascript/CSS ?

I think it is possible to post a slideshow using flash. But I'm hearing that FB is in the process of depreciating FBML, will this affect fl开发者_如何学运维ash content too?


Yes you can post using facebook's JavaScript SDK, facebook has new method called dialogs FB.ui and to post your flash content, you can use 'feed dialog' method, if you pass your SWF or video file URL to

source property

then it'll post your video.

Here's an example for posting youtube video using FB.ui feed method:

<script>
var publish = {
  method: 'feed',
  message: 'Wow, this music video is cool',
  name: 'Rihanna - Unfaithful',
  picture: 'http://i.ytimg.com/vi/rp4UwPZfRis/default.jpg',
  caption: 'www.youtube.com',
  description: (
      'Music Video by Rihanna performing Unfaithful.' +
      '(C) 2006 The Island Def Jam Music Group'
  ),
  link: 'http://fbrell.com/',
  source: 'https://www.youtube.com/v/rp4UwPZfRis',
  user_message_prompt: 'Share this music video with your friends'
};

FB.ui(publish, Log.info.bind('feed callback'));
</script>

If you go through the above codes, you'll notice it links to fbrell.com, the reason why it links to same site is because currently they've enabled Stream post URL security which doesn't allow you to post any other links other than their application or canvas url and if you add youtube link, then it'll give you an error which says:

The post's links must direct to the application's connect or canvas URL.

By default, that is not enabled, but if you enable it, then you won't be able to post external links.

You can test this code here: http://fbrell.com/fb.ui/feed or I've saved it at: http://fbrell.com/saved/3d5cc255bccdbde0cca29f8784e849ad

0

精彩评论

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

关注公众号