Mountain with antenna

Build P2P applications for Flash Player and AIR

Flash Player 10.1, which is available now on Adobe Labs, adds support for creating peer-to-peer groups. Flash Player 10 let you make peer-to-peer connections between 2 Flash Player clients, but now you can create an entire mesh. And share data, audio, and video streams directly between all peers in the mesh. Think scale… massive, massive scale, without thousands and thousands of Flash Media Server boxes or huge bandwidth pipes. Think cheap and big. Exciting, no?

All clients in the mesh must make a connection to Stratus (a hosted service available on Adobe Labs), but the data shared in the mesh doesn’t go through Stratus, it travels directly between the peers in the group. Stratus is a non-commercial server that lets Adobe preview technologies that will become available in future releases of Flash Media Server.  You can also use LiveCycle Collaboration Service to build commercial P2P apps. LCCS rolls the P2P functionality for you and falls back to hub and spoke if needed. Tom Krcha has a nice explanation of the difference between Stratus and LCCS.

The classes you need to build P2P apps are documented in the beta version of the unified ActionScript 3.0 Reference. (Yes, this means that from now on there will be one and only one version of the AS3R. No more special versions for Flex, AIR, etc etc. Get all your Flash Platform API information from a single source. Phew.) Where was I? Right… P2p…

  • Use the GroupSpecifier class to define a group and its options. This class creates the groupspec string which is the immutable identity of the group.
  • Use the NetGroup class to manage a group and get statistics about a group.
  • Use the NetStream class to multicast audio, video, and data. Just like you do with hub and spoke apps.
  • Use the NetConnection class to connect to Stratus (and in the future, FMS). For P2P apps, use the RTMFP protocol.

I’ll be writing more about P2P Flash apps (here and for the Adobe docs), but meanwhile, check out Tom’s MAX 2009 session.

0 comments

There are no comments yet...

Kick things off by filling out the form below.

Leave a Comment


Warning: main(/home/70767/etc/...) [function.main]: failed to open stream: Permission denied in /nfs/c05/h01/mnt/70767/domains/blog.flashvideoexamples.com/html/wp-content/themes/neoclassical/neoclassical/footer.php on line 10

Warning: main(/home/70767/etc/...) [function.main]: failed to open stream: Permission denied in /nfs/c05/h01/mnt/70767/domains/blog.flashvideoexamples.com/html/wp-content/themes/neoclassical/neoclassical/footer.php on line 10

Warning: main() [function.include]: Failed opening '/home/70767/etc/...' for inclusion (include_path='.:/usr/local/php-4.4.8-1/share/pear') in /nfs/c05/h01/mnt/70767/domains/blog.flashvideoexamples.com/html/wp-content/themes/neoclassical/neoclassical/footer.php on line 10