Thursday, March 27, 2008

Create a Poll application in Red5 and Flash

Red5 flash server is not just a server written to deliver the streaming of media.it's much more powerful server.
Here i am writing about how we can create a shared poll application using Red5 flash server which can be a part of Video conference application.

Note:-This article assumes that you have working knowledge of Red5 server and Flash.

Lets assume a typical video conference application , where a host and few other users are participating. Host has given access to create a poll.
As soon as host creates a poll, it will broadcast to every user including host in that conference and every user will participate in poll.

Flash Client Side Work:-

Create a user interface for creating the Poll.
A typical user interface for 3 kinds of Poll ( Single Answer, Multiple Answer and Free Text ) could be similar to the below diagrams.

Sample Poll creation window

When host click on next after selecting single answer or multiple answer. the screen may be like this.


For Free Text type, It may be like below screen.



All these screens will give the idea of a sample Poll user interface.

Now we move to second step, the XML representation of this UI. XML description of UI could be like this.


<poll polltype = "Single Answer">
<question text = "Will Red5 replace FMS in long run?">
<option id = "1" text = "Yes"/>
<option id = "2" text = "No"/>
<option id = "3" text = "Don't Know"/>
<option id = "4" text = "May be"/>
</question>

</poll>


The above XML will be created when host will select either Single Answer or Multiple Answer question. We will pass this XML String to Red5 server.

For Free text type question we can use the XML like below.

<poll polltype = "Single Answer">
<question text = "Explain Red5">
</question>

</poll>


Red5 server Side Work:-

Now we move to Red5 server side. Red5 side application will pick this XML and will
distribute this XML among all users including Host.

Flash Client Side Work:-

Once again this XML is on the flash client side with every user of the conference. Now client application will parse this application and build the user interface for participating in Poll based on type of question and number of options.
A sample poll participation screens for the above XML could be same as in below diagram.

Sample for Single answer type.

For Multiple answer type, we can replace the radio buttons with check boxes.

Sample for Free Text answer

For collecting the result data, we can use XML again. This way we can build a shared poll application with Red5 and Flash.

Note:- For distributing XML string to every user in conference, we can use the concept of shared object in Red5.


Interested to create a shared whiteboard application using Red5 and Flash? It is here

No comments:

Technology makes life easier

Daily Technology Tips

Open Source Flash Jobs

Adobe Flex Developer Center: Recent tutorials

Programming Discussion Forum