Share via


IWMSBroadcastPublishingPoint.StartArchive (C#)

banner art

Previous Next

IWMSBroadcastPublishingPoint.StartArchive (C#)

The StartArchive method begins saving the streamed content to a file.

Syntax

  IWMSBroadcastPublishingPoint
  .StartArchive();

Parameters

This method takes no parameters.

Return Values

This method does not return a value.

If this method fails, it throws an exception.

Number Description
0x8007000E The account that the WMS service is running under does not have access rights to the content requested.
0x00000002 The server was not able to find the file referenced by the Path property of the publishing point.
0x00000003 The server was not able to find the path referenced by the Path property of the publishing point.
0xC00D0006L The destination server indicated in the path property exists, but the server was unable to establish a connection to the destination server.
0xC00D14B5L The playlist that the server is attempting to stream does not reference any media streams or files.
0xC00D001AL The server was not able to find the file referenced by the Path property of the publishing point.
0xC00D2EE8L The server that the publishing point attempted to connect to does not support the requested action.
0xC00D1581L The server cannot stream the selected file because it is either damaged or corrupted.
0xC00D2EFAL The MMS protocol is not supported.
0xC00D14B6L The playlist that the server is attempting to parse contains a syntax error.
0xC00D157FL The server was not able to find a playlist parser plug-in to access the playlist referenced by the Path property of the publishing point.
0xC00D145AL The publishing point has already been removed.
0xC00D0035L The server was not able to find the server specified in the Path property of the publishing point.
0xC00D157EL The server was not able to find a data source plug-in to access the data referenced by the Path property of the publishing point.
0xC00D151EL The version of the playlist that the server is attempting to stream is either not supported by the server or is not valid. Version information in a playlist is indicated by the <WSX> element.
0x000D1519L At least one data sink started but one or more failed to start.
0x80004001 The default archiving plug-in is not enabled.

Remarks

If the broadcast publishing point is stopped and you call the StartArchive method before calling IWMSBroadcastPublishingPoint.Start, the server automatically starts the publishing point.

Example Code

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

// Declare variables.
WMSServer Server;
IWMSPlugin Plugin;
IWMSBroadcastPublishingPoint BCPubPoint; 

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

    // Retrieve the sample broadcast publishing point.
    BCPubPoint = (IWMSBroadcastPublishingPoint)Server.PublishingPoints["Sample_Broadcast"];

    // Stop the publishing point.
    BCPubPoint.Stop();

    // Specify the publishing point path.
    BCPubPoint.Path = "C:\\WMPub\\WMRoot\\Serverside_Playlist.wsx";

    // Retrieve the WMS Archive Data Writer plug-in. This is the
    // default archive plug-in for the publishing point.
    Plugin = BCPubPoint.BroadcastDataSinks["WMS Archive Data Writer"];

    // Make sure the plug-in is enabled. By default, it is 
    // not enabled.
    if (!Plugin.Enabled) Plugin.Enabled = true;

    // Begin archiving. This automatically starts the 
    // publishing point.
    BCPubPoint.StartArchive();

    // Record for 10 seconds.
    System.Threading.Thread.Sleep(10000);

    // Stop archiving. This does not stop the publishing
    // point.
    BCPubPoint.StopArchive();

}
catch (COMException comExc) {
    // TODO: Handle COM exceptions.
}
catch(Exception e)
{
    //TODO: Handle errors.
}
finally
{
    // TODO: Cleanup code goes here.
}

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