Export (0) Print
Expand All

IWMSAdminArchiveSink.StopRecord (Visual Basic .NET)

The StopRecord method stops the archiving process.


IWMSAdminArchiveSink.StopRecord()

This method takes no parameters.

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.

The server does not raise a WMS_Publishing_Point_Event WMS_Publishing_Point_Event Class event when you call the StopRecord method.

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

Private Sub StopArchiving()

    ' 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()

    ' Archive for 10 seconds.
    System.Threading.Thread.Sleep(10000)
    AdminArchiveSink.StopRecord()

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


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.

Show:
© 2015 Microsoft