Creation of a Multicast Station Sample


This sample demonstrates how you can:

To run this sample

  1. In the Server name box, type the name of the server that is running Windows Media Services, and then click the Connect button. The connection status appears beside Status. The Stations box lists any existing stations, as well as the multicast IP address and port on the connected server.
    Server name:
    Action:
    Status:
    Stations:

  2. (Optional) In the Station box, type the station index number representing existing stations (0 for the first station, 1 for the second, and so forth, and -1 for all), and click the Close button to close any stations you specified.
    Station:
    Action:
  3. In the Station name box, type the name of the station you choose. This name must be unique.
    Station name:
  4. In the Access right list, click the appropriate access right.
    Access right:
  5. In the IP address box, type the unique multicast IP address. The recommended IP address is between 224.0.0.0 and 224.255.255.255.
    IP address:
  6. In the Port number box, type the port value. The recommended port value is between 32000 and 65000.
    Port number:
  7. In the Delivery mode list, click the appropriate delivery mode for configuring the station to multicast content to clients, to distribute content to other servers, or both.
    Delivery mode:
  8. In Format file box, type the name of the format file with full path.
    Format file:
  9. In Format type list, click the appropriate format type (for example, C:\ASFRoot\Welcome1.asf is of the .asf type).
    Format type:
  10. After you have completed steps 3 through 9, click the Create station button.
    Action:
  11. Manually create a publicly shared folder in which you put the .nsc file. In the NSF file path box, type the file name of the nsc type, with the full path for exporting the station and storing it on a public share. Then click the Publish station button. Any previously existing streams on this station appear in the Existing streams box.
    NSF file path:
    Action:
    Existing streams:
  12. (Optional) In the Stream box, enter the stream index representing existing stream(s) on the station (0 for the first stream, 1 for the second, and so forth, and -1 for all), and then click the Close streams button to close the stream(s) you specify.
    Stream:
    Action:
  13. (Optional) In the Alias box, type the alias representing a stream that exists on the station, and then click the Get stream button to retrieve it. The status of the stream appears beside Status.
    Alias:
    Action:
    Status:
  14. In the Alias box, enter the alias; in the Source URL box, type the source URL of the stream, and then click the Create stream button to create a stream. The status of the stream appears beside Status.
    Alias:
    Source URL:
    Action:
    Status:
  15. Click the Activate stream button to assign the stream to the station. The status of the stream appears beside Status.
    Action:
    Status:
  16. Click the Start stream button to start the multicast. A message indicates the status of the action.
    Action:
  17. Click the Stop stream button to stop a multicast stream. A message indicates the status of the action.
    Action:
  18. To test this new multicast station, open the stream in Windows Media Player. Enter the path to the station file (for example, \\localhost\ NSCfiles\myStation1.nsc, where localhost is the name of the server that is broadcasting the stream created in step 14).

Note The source code is available by right-clicking the sample page.