Macromedia flash media server 2-developing media applications User Manual

Page of 114
Working with video
59
Consider the following example: a user wants to play a stream and has Flash Player 8 installed 
on their computer. Flash Player 8 is capable of playing On2 video. Flash Media Server 
requests the HappyStream.flv file. After contacting the server, Flash Player 8 determines the 
value of the server-side 
Client.virtualKey
 property. The 
virtualKey
 property maps to the 
On2 streams directory, instead of to the default streams directory and the HappyStream.flv 
stream encoded with the On2 codec is played. 
To create an automatic stream delivery mechanism based on Flash Player version, edit the 
vhost.xml file as follows:
<VirtualKeys>
<Key from="WIN 7,0,19,0" to="WIN 9,0,0,0">A</Key>
<Key from="WIN 6,0,0,0" to="WIN 7,0,18,0">B</Key>
<Key from="MAC 6,0,0,0" to="MAC 7,0,55,0">B</Key>
</VirtualKeys>
<VirtualDirectory>
<Streams key="A">foo;c:\streams\on2</Streams>
<Streams key="B">foo;c:\streams\sorenson</Streams>
<Streams key="">foo;c:\streams</Streams>
</VirtualDirectory>
For more information about editing the 
Key
 and 
Streams
 tags, see “Vhost.xml file” i
Managing Flash Media Server
Delivering video based on bandwidth
To deliver video to a client based on the client’s bandwidth, encode the video at different bit 
rates (and optionally using different codecs) and create directories in which to store the 
streams, as in the following example:
c:\streams\Sorenson22k\mystream.flv
c:\streams\Sorenson150k\mystream.flv
c:\streams\Sorenson300k\mystream.flv
c:\streams\Vp622k\mystream.flv
c:\streams\Vp6150k\mystream.flv
c:\streams\Vp6300k\mystream.flv