IWMSAdminArchiveSink.StartRecord (Visual Basic .NET)
The StartRecord method starts the archiving process.
IWMSAdminArchiveSink.StartRecord
Arguments
This method takes no parameters.
Return Value
This method does not return a value.
If this method fails, it throws an exception.
Number |
Description |
---|---|
0x8000FFFF |
The WMS Archive Data Writer plug-in cannot be found. |
Remarks
If the publishing point is stopped, the StartRecord method does not start it. You must therefore call IWMSBroadcastPublishingPoint.Start before calling StartRecord. Alternately, you can call IWMSBroadcastPublishingPoint.StartArchive to start both the publishing point and the archiving process.
The server does not raise a WMS_Publishing_Point_Event WMS_Publishing_Point_Event Class event when you call the StartRecord method.
Example
Imports Microsoft.WindowsMediaServices.Interop
Imports System.Runtime.InteropServices
Private Sub StartArchiving()
' Declare variables.
Dim Server As WMSServer
Dim BCPubPoint As IWMSBroadcastPublishingPoint
Dim Plugin As IWMSPlugin
Dim AdminArchiveSink As IWMSAdminArchiveSink
Try
' Create the WMSServer object.
Server = New WMSServer()
' Retrieve the sample broadcast publishing point.
BCPubPoint = Server.PublishingPoints("Sample_Broadcast")
' Stop the publishing point.
BCPubPoint.Stop()
' Set the publishing point path.
BCPubPoint.Path = "C:\WMPub\WMRoot\Serverside_Playlist.wsx"
' Retrieve the WMS Archive Data Writer Plug-in.
Plugin = BCPubPoint.BroadcastDataSinks("WMS Archive Data Writer")
' Make sure the plug-in is enabled.
If Plugin.Enabled = False Then
Plugin.Enabled = True
End If
' Retrieve the administration interface for the plug-in.
AdminArchiveSink = Plugin.CustomInterface
' Turn off the automatic start property.
AdminArchiveSink.AutoStart() = False
' Specify the archive path template.
AdminArchiveSink.Path = "%SystemDrive%\WMPub\WMArchive\<V>\Archive_<Y><m><d>.wmv"
' Restart the publishing point and begin archiving.
BCPubPoint.Start()
AdminArchiveSink.StartRecord()
Catch excCom As COMException
' TODO: Handle COM exceptions.
Catch exc As Exception
' TODO: Handle errors.
Finally
' TODO: Clean-up code goes here.
End Try
End Sub
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.