IWMEncPushDistribution.ServerName

Windows Media Encoder SDK banner art

The ServerName property specifies and retrieves the name of the Windows Media server from which to broadcast content.

Syntax

IWMEncPushDistribution.ServerName = String
String = IWMEncPushDistribution.ServerName

Parameters

This property takes no parameters.

Property Value

A String that contains the name of the Windows Media server. This can be an alias, a fully qualified domain name, or an IP address.

If this property fails, it returns an error number.

Return code Number Description
NS_E_INVALIDCALL_WHILE_ENCODER_RUNNING 0xC00D1B66L This property cannot be set while the encoder engine is running.

Remarks

You can specify the port number on the Windows Media server by appending it to the server name as shown in the following code example, or you can use the IWMEncBroadcast.PortNumber property to set it.

Use the WMEncoder.OnAcquireCredentials event to specify whether to cache the user name and password used for authenticating to the Windows Media server.

For information about configuring the Windows Media server for push distribution, see Pushing a Stream to a Windows Media Server.

Example Code

' Create a WMEncoder object.
  Dim Encoder As WMEncoder
  Set Encoder = New WMEncoder

' Configure the encoding session including the input sources and profile.

' Create a push distribution object.
  Dim PushDist As IWMEncPushDistribution
  Set PushDist = Encoder.Broadcast

' Declare variables.
  Dim sServerName As String
  Dim sPubPoint As String
  Dim sPubTemplate As String
  Dim sMyNSCFile As String
  Dim sMyNSCURL As String
  Dim sMyASXFile As String
  Dim sBrdcstInfo As String

' Provide values for the following variables.
  sServerName = "YOURSERVERNAME:PORTNUMBER"
  sPubPoint = "PUBLISHING_POINT_NAME"
  sPubTemplate = "EXISTING_PUBLISHING_POINT_NAME"
  sMyNSCFile = "NAME OF THE NSC FILE TO CREATE"
  sMyNSCURL = "URL TO THE NSC FILE YOU CREATE"
  sMyASXFile = "NAME OF THE ANNOUNCMENT FILE"
  sBrdcstInfo = "NAME OF THE BROACAST INFORMATION FILE"

' Specify the server name, publishing point, and an existing publishing point,
' and then generate an .nsc file and announcement file.
  PushDist.ServerName = sServerName
  PushDist.PublishingPoint = sPubPoint
  PushDist.Template = sPubTemplate

' Specify whether to destroy the publishing point.
  PushDist.AutoRemovePublishingPoint = True

' Initialize the encoding session.
  Encoder.PrepareToEncode True

' Generate the announcement file.
  PushDist.GenerateMulticastInfoFile sMyNSCFile
  PushDist.GenerateAnnouncementFile sMyNSCURL, sMyASXFile

' Start encoding.
  Encoder.Start

Requirements

Reference: Windows Media Encoder

Library: wmenc.exe

See Also