Share via


IWMSAnnouncementStreamFormats Object (Visual Basic .NET)

The IWMSAnnouncementStreamFormats object contains a collection of media file paths and URLs. The files contain format information used to configure a multicast broadcast. Format information includes the codecs, bit rate, screen size, and so on, contained in the file header. One file per format must be specified. For example, if the multicast is made up of three files encoded in one format and five files encoded in another format, only two file paths must be added to the IWMSAnnouncementStreamFormats object, one to represent each format.

If a file path is added to the collection, it must identify a Windows Media file, a multicast configuration (.nsc) file, or a stream format file from Windows Media Encoder. If a URL is added to the collection, it must identify a single source such as a live Windows Media Encoder stream or a Windows Media file on an upstream server. However, it is not recommended that you specify a server-side playlist. The format added to the collection will be that represented by only the first entry in the playlist.

When a path or URL is added to the collection, the associated file is parsed to extract the format that a player must use to receive and render the content. The IWMSBroadcastPublishingPoint.Announce method adds the parsed information to the multicast configuration for the broadcast publishing point, the IWMSBroadcastPublishingPoint.AnnounceToNSCFile method generates a multicast announcement (.nsc) file, and the IWMSBroadcastPublishingPoint.AnnounceToNSCStream method generates multicast announcement information in an IStream object.

Note

This object is available only on Windows Server 2003, Enterprise Edition; Windows Server 2003, Datacenter Edition; Windows Server 2008 Enterprise; and Windows Server 2008 Datacenter.

The IWMSAnnouncementStreamFormats object exposes the following properties and methods.

Property

Description

Count

Retrieves the number of file names in the IWMSAnnouncementStreamFormats collection.

Item

Retrieves a specific media file name, by index, from the IWMSAnnouncementStreamFormats collection.

length

Retrieves the number of file names in the IWMSAnnouncementStreamFormats collection. This property is provided for JScript compatibility.

Method

Description

Add

Adds a file name to the IWMSAnnouncementStreamFormats collection.

Remove

Removes a file name, by index, from the IWMSAnnouncementStreamFormats collection.

RemoveAll

Removes all file names from the IWMSAnnouncementStreamFormats collection.

Example

The following example illustrates how to retrieve an IWMSAnnouncementStreamFormats object.

Imports Microsoft.WindowsMediaServices.Interop
Imports System.Runtime.InteropServices

Private Sub RetrieveObj()

    ' Declare variables.
    Dim Server As WMSServer
    Dim PubPoints As IWMSPublishingPoints
    Dim PubPoint As IWMSPublishingPoint
    Dim BCPubPoint As IWMSBroadcastPublishingPoint
    Dim AnnounceStreamFormats As IWMSAnnouncementStreamFormats
    Dim i As Integer

Try
    ' Create the WMSServer object.
    Server = New WMSServer()

    ' Retrieve the IWMSPublishingPoints object.
    PubPoints = Server.PublishingPoints

    ' Retrieve each publishing point and retrieve the
    ' IWMSBroadcastPublishingPoint object.
    For i = 0 To Server.PublishingPoints.Count - 1
        PubPoint = PubPoints.Item(i)
        If PubPoint.Type = WMS_PUBLISHING_POINT_TYPE.WMS_PUBLISHING_POINT_TYPE_BROADCAST Then
            BCPubPoint = PubPoint
            Exit For
        End If
    Next i

    ' Retrieve the IWMSAnnouncementStreamFormats object.
    AnnounceStreamFormats = BCPubPoint.AnnouncementStreamFormats

Catch excCom As COMException
    ' TODO: Handle COM exceptions.
Catch exc As Exception
    ' TODO: Handle errors.
Finally
    ' TODO: Clean-up code goes here.
End Try

End Sub

See Also

Reference

IWMSBroadcastPublishingPoint.Announce (Visual Basic .NET)

Concepts

Server Object Model (Visual Basic .NET)