Share via


IWMEncFileSet.SetInput

Windows Media Encoder SDK banner art

The SetInput method replaces an HTML file in the file set.

Syntax

void IWMEncFileSet.SetInput(
  int  lIndex,
  string  bstrFileName,
  string  bstrURL
);

Parameters

lIndex

[in]  Int32 specifying the index of the file to replace.

bstrFileName

[in]  String containing the file path and name.

bstrURL

[in]  String containing the file URL.

Return Values

This method does not return a value.

Remarks

Use the SetInput method to replace a file in the file set. To add a new item to the file set, use the Add method.

Example Code

using WMEncoderLib;

try
{
// Create a WMEncoder object.
  WMEncoder Encoder;
  Encoder = new WMEncoder();

// Retrieve the source group collection and add a source group.
  IWMEncSourceGroupCollection SrcGrpColl;
  IWMEncSourceGroup SrcGrp;
  SrcGrpColl = Encoder.SourceGroupCollection;
  SrcGrp = SrcGrpColl.Add("SG_1");

// Add an audio, video, and HTML source. 
  IWMEncSource SrcAud;
  IWMEncVideoSource SrcVid;
  IWMEncSource SrcHTML;
  SrcAud = SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_AUDIO);
  SrcVid = (IWMEncVideoSource)SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_VIDEO);
  SrcHTML = SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_FILETRANSFER);

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

// The HTML scheme is FileTransfer, and the resource string is not used. 
  SrcHTML.SetInput("Placeholdertext", "FileTransfer", "");

// 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. 
IWMEncFileTransferSource FileTransSrc; 
FileTransSrc = (IWMEncFileTransferSource)SrcHTML.GetSourcePlugin();

// Create a file set and add HTML content. 
  IWMEncFileSet FileSet;
  FileSet = FileTransSrc.Add();
  FileSet.Add("C:\\HTML\\imageA.jpg", "https://YourWebSite/imageA.jpg");
  FileSet.Add("C:\\HTML\\imageB.jpg", "https://YourWebSite/imageB.jpg");

// Replace imageA with imageC.
  FileSet.SetInput(0, "C:\\HTML\\imageC.jpg", "https://YourWebSite/imageC.jpg");
}

catch (Exception e)
{
     // TODO: Handle exceptions.
}

Requirements

Reference: Windows Media Encoder

Namespace: WMEncoderLib

Assembly: Interop.WMEncoderLib.dll

Library: WMEncoderLib.dll

See Also