Section 2.5. Adding Audio and Video to the Chat Room

2.5. Adding Audio and Video to the Chat Room

To add audio/video streaming capabilities to the chat room, you can add the AudioConference, AVPresence, or VideoConference component to the Flash document you created in the last section. In the following steps, you will add two instances of the AVPresence component and an instance of the SetBandwidth component to the movie:

  1. Open the component_chat.fla from the last section. Resave this document as component_avchat.fla .

  2. Create two new layers , named av_1_mc and av_2_mc .

  3. On frame 1 of the av_1_mc layer, drag an instance of the AVPresence component from the Components panel to the Stage. Place the instance to the right of the ConnectionLight instance and above the Chat instance. In the Properties panel, name this instance av_1_mc .

  4. Repeat the previous step for another instance of the AVPresence component. Place the new instance on frame 1 of the av_2_mc layer, positioned to the right of the av_1_mc instance. Name the new instance av_2_mc .

  5. Create a new layer named bandwidth_mc . On frame 1 of this layer, drag an instance of the SetBandwidth component to the Stage. Place the instance below the userColor_mc instance. Name the new instance bandwidth_mc using the Properties panel. Your Stage should now resemble Figure 2-24.

    Figure 2-24. The new communication components added to the movie's Stage

  6. Select the connect_mc instance on the Stage, and double-click its Communication Components parameter in the Parameters tab of the Properties panel. In the Values list, add the instance names of the three additional communication components av_1_mc , av_2_mc , bandwidth_mc as shown in Figure 2-25.

    Figure 2-25. The updated Values list for the Communication Components parameter of the SimpleConnect component

  7. Save your document, and test the movie with both the Publish Preview and Test Movie commands. If you have a web cam and microphone connected to your computer, start streaming audio/video from one Flash movie's AVPresence instance. You should then see the same audio/video stream displayed in the other movie's AVPresence instance. (Be careful and wear headphones during these tests. If you use an open microphone and regular speakers , you'll likely experience harsh audio feedback.) Test different bit rate settings in the SetBandwidth component to see how the quality changes in both the video and audio output.



Programming Flash Communication Server
Programming Flash Communication Server
ISBN: 0596005040
EAN: 2147483647
Year: 2003
Pages: 203

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net