Spending my days programming virtual worlds for The Electric Sheep Company. Spending nights and weekends on BlitzPick for Super + Fun. I also enjoy quilting, reading, and singing in the shower.

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

Things I fixed after upgrading to Snow Leopard

I finally installed Snow Leopard on my 3+ year old MacBook Pro and iMac this weekend. We’re updating to Java 1.6 at work and Snow Leopard was the best way to get that version on my old 32-bit machines. I’ve only found couple things that needed to be changed after the update.

Adium

My old Adium font settings were broken. It looked right in the settings, but chat I sent did not appear in the correct font. To fix, type cmd-T in any Adium window, choose your font, and click “Save This Setting As My Default Font”

Reference: http://trac.adium.im/ticket/12906


MySQL

MySQL is no longer found at /usr/local/mysql. Fix with a symlink.

$ sudo ln -s mysql-5.0.51a-osx10.5-x86 mysql
$ ls -ldt mysql*
lrwxr-xr-x   1 root  wheel   25 Nov  9 14:38 mysql -> mysql-5.0.51a-osx10.5-x86
drwxr-xr-x  19 root  wheel  646 Nov  8 21:40 mysql-5.0.51a-osx10.5-x86

Reference: http://planet-geek.com/archives/2009/09/osx-snow-leopar.html

Monday, November 9th, 2009

Wednesday, October 28th, 2009

Getting started with github

I’m hosting my facebook actionscript demo source code at github. I’ve never used git before, so it’s been a fun learning experience. I managed to get the demo running on a github project page instead of being hosted on an ESC server. I’m not certain I’m taking the best approach, but I have the project setup now with these branches:

becarella/fb_as_connect
|-> master (the demo source code)
|-> gh-pages (the demo project page)
         |-> demo (submodule that pulls from the master branch so I can display the web files hosted there)

I updated the canvas and connect pages for the demo facebook app to pull from the demo submodule.

This post was really helpful in getting the demo submodule setup: http://woss.name/2008/04/09/using-git-submodules-to-track-vendorrails/

I’m going to continue tweaking it and probably frequently break things as I continue to figure out the checkout/commit/merge/push process.

Wednesday, October 28th, 2009