|
YOUR FEEDBACK
Did you read today's front page stories & breaking news?
SYS-CON.TV SYS-CON.TV WEBCASTS |
MXDJ TOP LINKS YOU MUST CLICK ON ! Flash Building a Simple Live Video Broadcaster and Receiver
Learn how to leverage the power of Flash Communication Server MX to add video and audio communications to your Flash apps
By: Stefan Richter
Oct. 12, 2005 03:00 PM
Macromedia Flash Communication Server MX (popularly referred to as Flashcom) is becoming an increasingly popular platform for the efficient delivery of streaming video to large audiences. Many content delivery networks such as Speedera and Vitalstream have teamed up with Macromedia to offer their clients a platform to stream prerecorded videos easily and efficiently. However, the Flash Communication Server capabilities do by no means end there. The platform is also an ideal choice to deliver live-event broadcasts in real time across the globe - all through a familiar and very accessible Macromedia Flash front end.
Note: The sample FLA files are not needed to complete this tutorial but are provided for reference in case of any problems.
Creating the Server-side Application To create your application, simply create a new folder inside your Flash Communication Server application directory, and call it livecast. On Windows, this folder's default location is C:\Program Files\Macromedia\Flash Communication Server MX\applications\. Note: There is no need to restart your server or vhost at this point. Remember, however, that every time you make changes to any server-side code you must restart the application that you have modified, or else you will not see your code changes reflected in your application logic.
Building the Live Video Broadcaster Building the live video broadcaster involves the following steps:
Open Flash MX 2004 and choose File > New or press Control+N to create a new FLA file. Rename your existing layer to UI. Create a new layer above your existing layer and name it actions. Save your FLA file in a directory of your choice and name it broadcaster.fla.
Step 2: Lay Out the User Interface
You will see a new symbol Embedded Video 1, in your library. Drag it onto the Stage and give it an instance name of myvid. Later you will display your local camera feed inside this video object. I also drew a thin outline around the video object in my application to make it visible before a video is being displayed. This border is optional. Name one of your buttons on the Stage connect_pb and give it a label of Connect. Name the second button startstop_pb and give this one a label of Start Broadcast. Give your label components the text properties of rtmp address for the first component, stream name for the second component, and status output for the third component. The label components simply clarify the purpose of your text input and text area components. You can omit the labels altogether if you want, because they play no significant role in the actual application logic. Give the two TextInput components instance names of rtmp_txt and streamname_txt, respectively. Name the text area component status_txt; you will be using it to output status and trace information. Align all these elements as you see fit, or use my layout (see Figure 2).
Step 3: Connect to Your Flash Communication Server Application
LATEST FLEX STORIES & POSTS
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
|
SYS-CON FEATURED WHITEPAPERS MOST READ THIS WEEK |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||