Thursday, March 24, 2011

Popcorn.js - Facebook plugin

I've been meaning to make this blog post for weeks now but kept putting it off. I made a facebook plugin :). This was pretty easy considering facebook provides a page full of plugins ( http://developers.facebook.com/docs/plugins/ ). In fact, it's so easy I'll do it right now



Now I know where all those blasted "like" buttons keep coming from...

Now we can put like buttons and all sorts of stuff around the Popcorn video player. But why hard code a plugin tag?
Why make an iframe with 10 attributes when I can do this?:

var p = Popcorn('#video')
.volume(0)
.play()
.facebook({
id: "fb-like",
type: "LIKE",
target: 'likediv'
} );

That is the code for a like button. I can add as many or as little options as I want. By default, the extra style options are set to false. I chose to do this because (unlike a certain piece of software I can mention) I think if the user wants extras, they should request extras. I think it's unfair for a user to be bombarded with useless crap they don't need (I love you too, Windows Messenger 2011 :P).

Anyway, as of now the plugin supports 4 social plugins: like button, like box, activity feed and facepile. The other ones require registration of some kind and I have yet to develop a workaround for that.

So yeah, take a look: https://github.com/DanVentura/popcorn-js/tree/t331/plugins/facebook

No comments:

Post a Comment