Sunday, January 24th, 2010

Tuesday, December 29th, 2009

Monday, December 21st, 2009

Friday, December 11th, 2009

Thursday, December 3rd, 2009

Overriding link_to in a Ruby on Rails/Facebooker iframe app

I’m working on a Facebook app using Ruby on Rails and Facebooker. The app works as a Connect site or in an iframe app. Navigation in iframe apps is trickier than in fbml apps because links with the default target change only the iframe address, not the page address (shown in the address bar). Furthermore, Facebook only adds the fb_sig_ params when the Facebook app page is loaded. When a user clicks a link that changes only the iframe url, the fb_sig_ params aren’t passed along automatically.

After reading this blog entry and its comments, I decided to get around the issue by overriding link_to to automatically set the target to _top for links in the iframe app. I’m using the absolute url for those links, which feels wrong but I’m not sure how else to make sure it sets the address to the Facebook page instead of the canvas url.

link_to in ApplicationHelper:

def link_to(name, options = {}, html_options = {})
  if params[:fb_sig_in_iframe]
    rel = url_for options
    url = "http://apps.facebook.com/" + FACEBOOKER['canvas_page_name'] + rel
    html_options[:href] = url
    html_options[:target] = "_top"
    super(name, {}, html_options)
  else 
    super(name, options, html_options)
  end
end

Maybe later I’ll handle passing the fb_sig_ params instead of changing the page address. Setting top.location.hash would still allow for direct links (with additional work) and would load faster.

Monday, November 30th, 2009

ccarella wrote:

Follow my latest project, @StreamJam, on Twitter. StreamJam is an Internet concert app on Facebook. Check out the Mike Doughty concert happening on 11/28. 

StreamJam, the project I’m working on at Electric Sheep Company, is currently in alpha testing.  Check out one of our live events!

ccarella wrote:

Follow my latest project, @StreamJam, on Twitter. StreamJam is an Internet concert app on Facebook. Check out the Mike Doughty concert happening on 11/28.

StreamJam, the project I’m working on at Electric Sheep Company, is currently in alpha testing. Check out one of our live events!

Tuesday, November 17th, 2009

reblogged from : ChrisCarella.Com

UStream Cube: An experiment with UStream video in native Flash 3D

I’m working on the Electric Sheep Company’s StreamJam application, a flash-based virtual world that plays streaming video for live events. The StreamJam environments are currently using Papervision3D, which does not yet take advantage of the new 3D features in Flash 10. Papervision materials require access to BitmapData.draw in order to render a texture in 3D. For live or on demand video, that means the flash media server must allow video sample access.

We decided to start off StreamJam using UStream’s video service since it has a flash library for client integration, an easy interface for broadcasting, and built-in metrics. UStream’s media server allows video sample access by default. However, their ad networks usually do not. Thus, when an ad appears on a UStream video playing on a Papervision3D plane, the video blacks out for the duration of the ad, though the audio continues to play. UStream’s paid white label service, Watershed, doesn’t have ads and works just fine.

Of course, we’d like to allow users to stream their own events for free in future. Happily, the native Flash 10 3D features don’t have the same security issues for live streams. To test out UStream in native Flash, I made a silly little app that renders UStream channels on the sides of a cube.

You can rotate the cube by clicking and dragging or right-click the cube and choose a channel. You can also double click on a side to have it straighten out and face forward.

Only the top-most layer plays video at any time. As the cube rotates, it automatically pauses the videos on the other planes and plays the top video.

The video cube isn’t exactly an awesome interface, but it demonstrates the advantage of using native Flash 10. The video is rendered smoothly on each side and the ads are interactive.

Acknowledgments

The ArcBall interface and SimpleZSorter for the cube are from Ralph Hauwert’s blog.

Source

Monday, November 16th, 2009

Monday, November 16th, 2009