Showcase and discover digital art at yex

Follow Design Stacks

Subscribe to our free newsletter to get all our latest tutorials and articles delivered directly to your inbox!

Setting Up Your Environment

Setting Up Your Environment

To follow this code walkthrough, you will need, the sample file download that accompanies this article. Here’s what you should do with the contents of the ZIP archive:

  1. Place the FileObj and MyCollection folders in your Flash Media Server applications directory (by default, this is Flash Media Server 2applications).
  2. Put the OnDemandPlayer folder anywhere on your development machine.
  3. Place the MP3s and FLVs that you want to stream into the MyCollection/streams/_definst_/ folder.

It’s easy to change your default applications folder. Open conf/fms.ini in a text editor and change the variable VHOST.APPSDIR.

Flash Media Server 2 has two applications that control the logic, FileObj and MyCollection (see Figure 1). When OnDemandPlayer.swf is instantiated, it accesses FileObj, which returns the content into a DataGrid. When the user clicks an object in the DataGrid, it calls the video based in MyCollection.

Connection between OnDemandPlayer.swf and Flash Media Server 2

Figure 1. Connection between OnDemandPlayer.swf and Flash Media Server 2