IWMEncFileSet.Item

Windows Media Encoder SDK banner art

The Item method retrieves a specific file from the file set.

Syntax

String = IWMEncFileSet.Item(lIndex, pvarFileName)

Parameters

lIndex

[in]  Long containing the index.

pvarFileName

[out]  Variant specifying the file name.

Return Values

This method returns a String specifying the file URL, and a Variant specifying the file name.

Example Code

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

' Retrieve the source group collection and add a source group.
  Dim SrcGrpColl As IWMEncSourceGroupCollection
  Dim SrcGrp As IWMEncSourceGroup2
  Set SrcGrpColl = Encoder.SourceGroupCollection
  Set SrcGrp = SrcGrpColl.Add("SG_1")

' Add an audio, video, and HTML source.
  Dim SrcAud As IWMEncAudioSource
  Dim SrcVid As IWMEncVideoSource
  Dim SrcHTML As IWMEncSource
  Set SrcAud = SrcGrp.AddSource(WMENC_AUDIO)
  Set SrcVid = SrcGrp.AddSource(WMENC_VIDEO)
  Set SrcHTML = SrcGrp.AddSource(WMENC_FILETRANSFER)

' Use the default audio and video devices.
  SrcAud.SetInput ("Device://Default_Audio_Device")
  SrcVid.SetInput ("Device://Default_Video_Device")

' The HTML scheme is FileTransfer, and the resource string is not used.
  SrcHTML.SetInput ("FileTransfer://placeholdertext")

' Set the HTML stream to repeat.
  SrcHTML.Repeat = True

' Continue configuring the encoding session, including the HTML profile
' and broadcast settings.

' Start encoding.
  Encoder.Start

' Retrieve the file transfer plug-in from the HTML source.
  Dim pUnkFileSrcPlugin As IUnknown
  Set pUnkFileSrcPlugin = SrcHTML.GetSourcePlugin
  Dim FileTransSrc As IWMEncFileTransferSource
  Set FileTransSrc = pUnkFileSrcPlugin

' Create a file set and add HTML content.
  Dim FileSet As IWMEncFileSet
  Set FileSet = FileTransSrc.Add
  FileSet.Add "C:\HTML\image.jpg", "https://YourWebSite/image.jpg"

' Retrieve the file.
  Dim sFileURL As String, vFileName As Variant
  sFileURL = FileSet.Item(0, vFileName)

Requirements

Reference: Windows Media Encoder

Library: wmenc.exe

See Also