IWMSBroadcastPublishingPoint.AnnouncementStreamFormats (C#)
Previous | Next |
IWMSBroadcastPublishingPoint.AnnouncementStreamFormats (C#)
The AnnouncementStreamFormats property retrieves an IWMSAnnouncementStreamFormats object containing a collection of names of media files whose formats are used in a multicast broadcast.
- Note This property is available only on Windows Server 2003, Enterprise Edition; Windows Server 2003, Datacenter Edition; and Windows Server 2008.
Syntax
IWMSAnnouncementStreamFormats = IWMSBroadcastPublishingPoint.AnnouncementStreamFormats;
Property Value
An IWMSAnnouncementStreamFormats object.
If this property fails, it throws an exception.
Number | Description |
0xC00D1459L | This feature is not supported on this operating system. |
0xC00D145AL | The publishing point has already been removed. |
Remarks
The IWMSAnnouncementStreamFormats object contains a collection of names of media files whose formats are used in a multicast broadcast. A format consists of the codecs, frame size, bit rates, and so on, specified in the file header. One file per format must be specified. For example, if you are broadcasting two files that were created using one format and five files created by using another format, only two file names are added to the IWMSAnnouncementStreamFormats object, one to represent each format. When a file name is added to the collection, the associated file is parsed to extract the format information 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 publishing point.
Example Code
using Microsoft.WindowsMediaServices.Interop; using System.Runtime.InteropServices; // Declare variables. WMSServer Server; IWMSAnnouncementStreamFormats AnnounceStreamFormats; IWMSBroadcastPublishingPoint BCPubPoint; IWMSPublishingPoints PubPoints; IWMSPublishingPoint PubPoint; string strFile; 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; // Retrieve the IWMSAnnouncementStreamFormats object. AnnounceStreamFormats = BCPubPoint.AnnouncementStreamFormats; // Add a file to the IWMSAnnoucementStreamFormats // object for multicast broadcasting. strFile = "file://c:\\wmpub\\wmroot\\welcome2.asf"; AnnounceStreamFormats.Add(strFile); 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
- IWMSAnnouncementStreamFormats Object (C#)
- IWMSBroadcastPublishingPoint Object (C#)
- IWMSBroadcastPublishingPoint.Announce (C#)
Previous | Next |