IWMEncBroadcast.PortNumber

Windows Media Encoder SDK banner art

The PortNumber property specifies and retrieves the port number used for broadcasting encoded content from the encoding application.

Syntax

IWMEncBroadcast.PortNumber(enumProtocol) = Long
Long = IWMEncBroadcast.PortNumber(enumProtocol)

Parameters

enumProtocol

[in]  Specifies a member of the WMENC_BROADCAST_PROTOCOL enumeration type indicating the protocol for transmitting encoded content.

Property Value

A Long containing the port number. If this property fails, it returns an error number.

Number Description
0x80070057 The protocol is not valid.
0xC00D1B66 You cannot set this property if the encoder engine is running.

Remarks

When broadcasting from the computer running the encoding application, PortNumber defaults to 0 so you must specify a value.

If you are pushing a broadcast to a Windows Media server, you can use this property to specify the server port number.

Example Code

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

' Create an IWMEncBroadcast object.
  Dim Brdcst As IWMEncBroadcast
  Set Brdcst = Encoder.Broadcast

' Retrieve the port number. The port number defaults to zero.
  Dim iPortNum As Integer
  iPortNum = Brdcst.PortNumber(WMENC_PROTOCOL_HTTP)

' Set the port number.
  Brdcst.PortNumber(WMENC_PROTOCOL_HTTP) = 2356

Requirements

Reference: Windows Media Encoder

Library: wmenc.exe

See Also