HomeAboutDirectoryTutorialsNewsletterContact

Detecting A Connection From Flash Media Encoder


By Stefan Richter
Expert Author
Article Date: 2007-03-30

If you are using Flash Media Encoder to stream the live video portion of your application but you also need to accpt 'normal' user connections in the same app then this code snippet may be helpful to you.

This code checks the Client.agent property of a connecting client in serverside ActionScript (typically in your main.asc file) and determines if FME 1.0 connects.

You can base the rest of your connection logic around that.

Likewise if it's a normal user connecting you may run other logic.

Take for example a Peoplelist: you wouldn't want FME to show up in there as an undefined user would you?

application.onConnect = function(newClient)
{
   trace( "FME connects: " +(newClient.agent.indexOf("FME/1.0") == 0) );
}


This will trace either 'FME connects: true' or 'FME connects: false'.

Maybe this will help someone.

Comments

About the Author:
Stefan is a certified Flash Developer who has been involved with Flash Media Server since its very early days. From his home office in the UK he has handled a variety of projects, specializing in Flash Video and Rich Internet Applications for clients that include CNET, USA Network and Unilever. Stefan is the author of a series of Adobe Developer Center articles, has spoken at several industry events and contributes a regular column on Flash Video to Streaming Media Magazine. His site www.flashcomguru.com is one of the largest online resources on Flash Video.

Software
Download, Desktop...

Communities
Networking, Social...

Forums
Search, Learn...

Animation
Animate, Frames...

Resources
Programs, Podcasts...

Tools
Add-ons, Extras...

Tutorials
Design, ActionScript...

News
Technology, Business...


Submit your site for FREE