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.

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