IWMSBroadcastPublishingPoint.AllowClientToStartAndStop (C#)

banner art

Previous Next

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.

Syntax

  BroadcastPublishingPoint
  .AllowClientToStartAndStop
  
  =
  
  bool
  ;
  
  bool
  
  =
  
  BroadcastPublishingPoint
  .AllowClientToStartAndStop;

Property Value

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.

Remarks

The default value is true. The publishing point will not automatically stop if a broadcast data sink is enabled on that publishing point.

Example Code

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;
        }
    }







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