Setting Up Your Environment
Setting Up Your Environment
To follow this code walkthrough, you will need on_demand_player.zip, the sample file download that accompanies this article. Here’s what you should do with the contents of the ZIP archive:
- Place the FileObj and MyCollection folders in your Flash Media Server applications directory (by default, this is Flash Media Server 2applications).
- Put the OnDemandPlayer folder anywhere on your development machine.
- 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.
Comments