Share via


IWMSBroadcastPublishingPoint.Announce (C#)

banner art

Previous Next

IWMSBroadcastPublishingPoint.Announce (C#)

The Announce method updates the publishing points multicast configuration with data formats that have been added to the IWMSAnnouncementStreamFormats object.

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

Syntax

  IWMSBroadcastPublishingPoint
  .Announce();

Parameters

This method takes no parameters.

Return Values

If this method fails, it throws an exception.

Number Description
0xC00D1459L This feature is not supported on this operating system.
0xC00D1458L A multicast plug-in is not enabled on the publishing point.
0xC00D006BL The IWMSAnnouncementStreamFormats collection does not contain any stream format information.
0xC00D145AL The publishing point has already been removed.
0xC00D1456L More than one multicast plug-in is enabled on the publishing point. Only one multicast plug-in can be enabled per publishing point.

Remarks

The Announce method retrieves stream format data from the IWMSAnnouncementStreamFormats object and property data from an enabled multicast plug-in. Only one multicast plug-in can be enabled at a time. If no multicast plug-ins are enabled, the Announce method returns an error. If the file names in the IWMSAnnouncementStreamFormats collection reference media files that all use the same format, only one instance of the stream format information is used. After you have called the Announce method, you can call the IWMSBroadcastPublishingPoint.AnnounceToNSCFile method to create the file needed by the client to receive and render the broadcast. Call the Announce and the AnnounceToNSCFile methods whenever information included in the file is changed.

The Announce method is required for multicasting content from a broadcast publishing point, but it is not required for a unicast broadcast.

Example Code

using Microsoft.WindowsMediaServices.Interop;
using System.Runtime.InteropServices;

// Declare variables.
WMSServer                       Server;
IWMSBroadcastPublishingPoint    BCPubPoint;
IWMSPublishingPoints            PubPoints;
IWMSPublishingPoint             PubPoint;

try {
    // Create a new WMSServer object.
    Server = new WMSServerClass();

    // Retrieve the IWMSPublishingPoints object.
    PubPoints = Server.PublishingPoints;

    // Retrieve each publishing point and retrieve the
    // IWMSBroadcastPublishingPoint object.
    for (int i = 0; i < PubPoints.Count; i++)
    {
        PubPoint = PubPoints[i];

        if (PubPoint.Type == 
            WMS_PUBLISHING_POINT_TYPE.WMS_PUBLISHING_POINT_TYPE_BROADCAST)
        {
            BCPubPoint = (IWMSBroadcastPublishingPoint)PubPoint;

            // Prepare the publishing point configuration for
            // announcement to clients.
            BCPubPoint.Announce();
            break;
        }
    }
}
catch (COMException comExc) {
    // TODO: Handle COM exceptions.
}
catch (Exception e) {
    // TODO: Handle exceptions.
}

Requirements

Reference: Add a reference to Microsoft.WindowsMediaServices.

Namespace: Microsoft.WindowsMediaServices.Interop.

Assembly: Microsoft.WindowsMediaServices.dll.

Library: WMSServerTypeLib.dll.

Platform: Windows Server 2003 family, Windows Server 2008 family.

See Also

Previous Next