Compartir a través de


Configuring Your New Broadcast Publishing Point

After creating a new publishing point for your content, be sure that it is properly configured, based on your needs. Besides the normal publishing point configuration, a broadcast publishing point has some extra configuration options. The following Visual Basic .NET, C#, and C++ examples show how you might configure your publishing point. You can tailor the configuration to your needs.

Visual Basic .NET Example

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

' Declare variables.
Dim Server As WMSServer
Dim BCPubPoint As IWMSBroadcastPublishingPoint

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

    ' Retrieve a broadcast publishing point.
    BCPubPoint = Server.PublishingPoints.item ("NewPubPointVI")

    ' Set the publishing point to start broadcasting when
    ' the first client connects.
    BCPubPoint.AllowClientToStartAndStop = True

    ' Set the publishing point to allow splitting the stream.
    BCPubPoint.AllowStreamSplitting = True

    ' Set the buffer setting to minimize propagation latency.
    BCPubPoint.BufferSetting = _
       WMS_BUFFER_SETTING.WMS_BUFFER_SETTING_MINIMIZE_PROPAGATION_LATENCY

Catch errCom As COMException
    ' TODO: Handle COM exceptions.
Catch err As Exception
    ' TODO: Exception handler goes here.
Finally
    ' TODO: Clean-up code goes here.
End Try

C# Example

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

// Declare variables.
WMSServer Server;
IWMSBroadcastPublishingPoint BCPubPoint;

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

    // Retrieve a broadcast publishing point.
    BCPubPoint = 
(IWMSBroadcastPublishingPoint)Server.PublishingPoints["NewPubPointIV"];

    // Set the publishing point to start broadcasting when
    // the first client connects.
    BCPubPoint.AllowClientToStartAndStop = true;

    // Set the publishing point to allow splitting the stream.
    BCPubPoint.AllowStreamSplitting = true;

    // Set the buffer setting to minimize propagation latency.
    BCPubPoint.BufferSetting = 
WMS_BUFFER_SETTING.WMS_BUFFER_SETTING_MINIMIZE_PROPAGATION_LATENCY;
}
catch (COMException comExc)
{
    // TODO: Handle COM exceptions.
}
catch (Exception exc)
{
    // TODO: Exception handler goes here.
}
finally
{
    // TODO: Clean-up code goes here.
}

C++ Example

#include <windows.h>
#include <atlbase.h>    // Includes CComBSTR.
#include "wmsserver.h"

// Declare variables and interfaces.
IWMSServer                    *pServer;
IWMSPublishingPoints          *pPubPoints;
IWMSPublishingPoint           *pPubPoint;
IWMSBroadcastPublishingPoint  *pBCPubPoint;

HRESULT         hr;
CComVariant     varName;

// Initialize the COM library and retrieve a pointer
// to an IWMSServer interface.
hr = CoInitialize(NULL);
hr = CoCreateInstance(CLSID_WMSServer,
                      NULL,
                      CLSCTX_ALL,
                      IID_IWMSServer,
                      (void **)&pServer);
if (FAILED(hr)) goto EXIT;

// Retrieve a pointer to the IWMSPublishingPoints interface.
hr = pServer->get_PublishingPoints(&pPubPoints);
if (FAILED(hr)) goto EXIT;

// Retrieve a pointer to a publishing point.
varName = L"NewPubPoint";
hr = pPubPoints->get_Item(varName, &pPubPoint);
if (FAILED(hr)) goto EXIT;

// Query the IWMSBroadcastPublishingPoint interface from
// the publishing point.
hr = pPubPoint->QueryInterface(IID_IWMSBroadcastPublishingPoint,
                              (void **)&pBCPubPoint);
if (FAILED(hr)) goto EXIT;

// Set the publishing point to start broadcasting when
// the first client connects.
hr = pBCPubPoint->put_AllowClientToStartAndStop(VARIANT_TRUE);
if (FAILED(hr)) goto EXIT;

// Set the publishing point to allow splitting the stream.
hr = pBCPubPoint->put_AllowStreamSplitting(VARIANT_TRUE);
if (FAILED(hr)) goto EXIT;

// Set the buffer setting to minimize propagation latency.
hr = pBCPubPoint->put_BufferSetting(
                  WMS_BUFFER_SETTING_MINIMIZE_PROPAGATION_LATENCY);
if (FAILED(hr)) goto EXIT;

EXIT:
    // TODO: Release temporary COM objects and uninitialize COM.

See Also

Reference

IWMSBroadcastPublishingPoint Interface

IWMSBroadcastPublishingPoint Object (C#)

IWMSBroadcastPublishingPoint Object (Visual Basic .NET)

Concepts

Publishing Broadcast Content