|
Flash Media Server Resources |
Creating clients for streaming servicesUsing the sample video playerThe Flash Media Server Start Screen includes an embedded video player. The video player lets you see video streaming from the server immediately after installation. Use the code provided on the Start Screen to embed the video player in your own application. You can examine the video player at RootInstall/samples/videoplayer and modify it as desired. Using the Flash FLVPlayback componentYou can use the FLVPlayback component, available since Flash 8, as a client for the vod and live services. Set the source parameter (or contentPath parameter in ActionScript 2.0) to the full URL of the stream. To connect to the live service, set the isLive parameter to true. You can set parameters in the Component inspector or in ActionScript. Set the source (or contentPath) parameter to the URL of the stream. Do not include the /media folder in the path. For example, the following is the path to a sample file: rtmp://localhost/vod/sample.flv. Using the Flex VideoDisplay componentYou can use the Flex VideoDisplay control to play an FLV or F4V file in a Flex application. The component supports progressive download over HTTP, streaming from Flash Media Server, and streaming from a Camera object. Set the source parameter to the full URL of the stream. Do not include the /media folder in the path. For example, the following is the path to a sample file: rtmp://localhost/vod/sample. To stream live video, set the live parameter to true. Connecting to a streaming serviceLike all Flash Media Server applications, streaming services expect the NetConnection.connect() URI to be in the following format: rtmp://hostName/serviceName/[formatType:][instanceName/]fileOrStreamName
Unsupported featuresClients for the vod and live services can use any Flash Player features except remote shared objects (SharedObject.getRemote()). You cannot edit the server-side code for streaming services. However, the services do have a custom API that lets you access information from the server. Call the NetConnection.call() method from client-side code and pass it the name of the API you want to call. For more information, see Streaming services API. Allow connections from specific domainsBy default, clients can connect to the live and vod services from any domain. You can limit the domains from which clients can connect. Navigate to the RootInstall/applications/live
or RootInstall/applications/vod folder and do one of the
following:
The TXT files contain detailed information about adding domains. Access raw audio and video data in the live serviceNote: Flash Media Streaming Server does not support this
feature.
Beginning with Flash Media Server 3 and Flash Player 9.0.115.0, you can access raw audio and video data in live streams. Use this data to create snapshots in your applications. To access the data, call the ActionScript 3.0 BitmapData.draw() and SoundMixer.computeSpectrum() methods. For more information, see ActionScript 3.0 Language and Components Reference at www.adobe.com/go/learn_fms_asdoc3_en. By default, Flash Media Server prevents you from accessing streams. To allow stream access, do the following:
|