IWMEncFileTransferSource.UserDrivenMode

Windows Media Encoder SDK banner art

The UserDrivenMode property specifies and retrieves a value indicating how to send HTML file sets.

Syntax

bool = IWMEncFileTransferSource.UserDrivenMode;

Parameters

This property takes no parameters.

Property Value

A Boolean that indicates whether the IWMEncFileTransferSource object is in user-driven mode.

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

If the UserDrivenMode property is true, HTML file sets are sent when the Send method is called. 

If the UserDrivenMode property is false, HTML file sets are sent at specific times as specified in the IWMEncFileSet.Time property.

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.

// Initialize the encoding session. 
  Encoder.PrepareToEncode(true);

// Retrieve the file transfer plug-in from the HTML source. 
IWMEncFileTransferSource FileTransSrc; 
FileTransSrc = (IWMEncFileTransferSource)SrcHTML.GetSourcePlugin();

// Set user driven mode to false to send HTML file sets at specific times.
  FileTransSrc.UserDrivenMode = false;

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

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

Requirements

Reference: Windows Media Encoder

Namespace: WMEncoderLib

Assembly: Interop.WMEncoderLib.dll

Library: WMEncoderLib.dll

See Also