IWMSBroadcastPublishingPoint.AllowClientToStartAndStop (C#)
The AllowClientToStartandStop property specifies and retrieves a Boolean value that indicates whether a stopped publishing point can be started when a client tries to receive a broadcast from it.
BroadcastPublishingPoint.AllowClientToStartAndStop = bool;
bool = BroadcastPublishingPoint.AllowClientToStartAndStop;
A bool indicating whether the IWMSBroadcastPublishingPoint.Start method must be called when a client attempts to receive a broadcast.
If this property fails, it throws an exception.
Number |
Description |
---|---|
0xC00D145AL |
The publishing point has already been removed. |
The default value is true. The publishing point will not automatically stop if a broadcast data sink is enabled on that publishing point.
using Microsoft.WindowsMediaServices.Interop;
using System.Runtime.InteropServices;
// Declare variables.
WMSServer Server;
IWMSBroadcastPublishingPoint BCPubPoint;
IWMSPublishingPoints PubPoints;
IWMSPublishingPoint PubPoint;
bool bVal;
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 a Boolean value indicating whether the
// publishing point can be started when a client
// tries to receive a broadcast.
bVal = BCPubPoint.AllowClientToStartAndStop;
// Set the publishing point to begin broadcasting
// when the first client connects.
BCPubPoint.AllowClientToStartAndStop = true;
break;
}
}
}
catch (COMException comExc) {
// TODO: Handle COM exceptions.
}
catch (Exception e) {
// TODO: Handle exceptions.
}
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.