Methods
[Flix Publisher API Documentation]


Functions

void addFile (in string fileName)
 Sets the input file.
unsigned long getFileSize (in string file)
 Returns the size of file.
void checkInputFile ()
 validates the input file
unsigned long getInputFileSize ()
 Returns input file size.
void selectInputFileForPlayback ()
 selects the input file for playback
unsigned long getOutputFileSize ()
 Returms output file size.
void selectOutputFileForPlayback ()
 selects the output file for playback
void startPlayback ()
 play selected file
void stopPlayback ()
 stop playing selected file
void pause ()
 pauses capture or playback
void resume ()
 resumes capture or playback
void show_audio_capture_settings ()
 show audio device settings dialog
void show_video_capture_settings ()
 show video device settings dialog
void startCapturePreview ()
 start previewing
void stopCapturePreview ()
 stop previewing
void startCapture ()
 start capturing
void stopCapture ()
 stop capturing
void startFileEncode ()
 start transcoding
void stopFileEncode ()
 stop transcoding
void publishFile ()
 Deprecated. Uploads the output file.
void publishAbort ()
 cancels uploading of the output file
void setHttpVar (in string param, in string value)
 Deprecated. Add Form Variables to HTTP POST.
string getHttpVar (in string param)
 Deprecated. Returns value of named param.
long numAudioCaptureDevices ()
 Audio capture device count.
long numVideoCaptureDevices ()
 Video capture device count.
string audioCaptureDeviceName (in long index)
 Audio Capture name device at index.
string videoCaptureDeviceName (in long index)
 Video Capture name device at index.
void setHttpFormVar (in string name, in string value)
 Add/Update Form Variable.
string getHttpFormVar (in string name)
 Retrieve Form Variable.
void resetHttpFormVars ()
 Clears HTTP form variables.
void setHttpRequestHeader (in string name, in string value)
 Add/Update Request Header.
string getHttpRequestHeader (in string name)
 Retrieve HTTP Request Header.
void resetHttpRequestHeaders ()
 Clears HTTP Request Headers.
string getHttpResponse ()
 Retrieve HTTP upload server response.
string getMd5Checksum (in string file)
 Get File MD5 Checksum.
void uploadFile (in string file, in long mode)
 Upload a file.
void addFmsAuthArg (in string function_name, in string arg)
 Add a FMS AS function.
string getFmsAuthArgList (in string function_name)
 Get a FMS AS function call's argument list.
string getFmsAuthResponse (in string function_name)
 Get an FMS AS function call response.
void resetFmsAuthArgs ()
 Reset FMS authentication functions and arguments.
void setFmsPollFunction (in string func)
 Set FMS poll function name.
string getFmsPollFunction ()
 Get FMS poll function name.
void addFmsPollArg (in string arg)
 Add a FMS poll function argument.
string getFmsPollArgList ()
 Get FMS poll function argument list.
void resetFmsPollArgs ()
 Reset FMS poll function arguments.

Detailed Description

This section contains documentation for all methods exported by the On2 Publisher SDK.

Information About Errors

This information applies to all On2 Publisher methods.

For general information about errors, please consult the Error Values section.
When an error occurs, an error code will be thrown or returned by the method. Meanings of error values depend upon the context of the error and which method was called.
Each method lists errors likely to be returned if something goes wrong. For further information about any errors you encounter while implementing your Flix Publisher project, please contact support.


Function Documentation

void addFile ( in string  fileName  ) 

Sets input file used for playback and transcoding. Call addFile() with an empty string to display the open file dialog box and allow the user to select the input file.

Parameters:
[in] fileName full path to the input file. The path can be a local path or a network path. It cannot be a URL.
Precondition:
The client computer must have the necessary codecs installed for playing the selected file. This can be determined by calling checkInputFile().
Remarks:
addFile() will neither fail nor throw an exception if the input file cannot be decoded, developers must call checkInputFile().
See also:
checkInputFile()
InputFileName
fp_show_file_chooser()
Information About Errors
Mac Support: Yes.

unsigned long getFileSize ( in string  file  ) 

Returns the size of file, in bytes.

Remarks:
To get a file path, have the user select one by calling addFile with an empty string argument.
    // on2pub is the plug-in object
    fp_show_file_chooser(on2pub);

Exceptions:
FE_FILE - file doesn't exist
See also:
Error Values
uploadFile()
fp_show_file_chooser()
Mac Support: No.

void checkInputFile (  ) 

Determines whether or not the client computer can play and transcode the input file.

Precondition:
addFile() must be used to set the input file
Exceptions:
FE_FILE - file unplayable or addFile() not called
See also:
Error Values
addFile()
InputFileName
Mac Support: Yes.

unsigned long getInputFileSize (  ) 

Size of input file, in bytes.

Precondition:
checkInputFile() must be called to load the input file.
Exceptions:
FE_FILE - file doesn't exist or checkInputFile() not called
See also:
Error Values
checkInputFile()
getFileSize()
getOutputFileSize()
Mac Support: No.

void selectInputFileForPlayback (  ) 

selectInputFileForPlayback() causes a subsequent call to startPlayback() to play the input file.

Precondition:
addFile() must be used to set the input file, or a user must drag and drop a file on the publisher.
Remarks:
When addFile() is called, or when the filesDropped event is fired, the input file is automatically selected for playback.
See also:
addFile()
filesDropped
InputFileSelected
OutputFileSelected
selectOutputFileForPlayback()
startPlayback()
stopPlayback()
Mac Support: Yes.

unsigned long getOutputFileSize (  ) 

Size of output file, in bytes.

Precondition:
The fileEncoded() or captureCompleted() event must fire.
Exceptions:
FE_FILE - file doesn't exist or prerequisite event not fired.
See also:
Error Values
checkInputFile()
getFileSize()
getInputFileSize()
Mac Support: No.

void selectOutputFileForPlayback (  ) 

selectOutputFileForPlayback() causes a subsequent call to startPlayback() to play the output file.

Precondition:
The output file must be created by the plug-in, and cannot be set through the API.
Remarks:
startCapture() and startFileEncode() can be used to create files.
See also:
InputFileSelected
OutputFileSelected
selectInputFileForPlayback()
startCapture()
startFileEncode()
startPlayback()
stopPlayback()
Mac Support: Yes.

void startPlayback (  ) 

Starts playing the selected file. This method behaves differently depending upon calls to other publisher methods and user interaction:

Exceptions:
FE_FILE - could not play file.
Remarks:
Important: the following information applies only to playback.
  • When playback of the file is completed, the filePlayed event will be fired.
  • To suppress the filePlayed event when starting a new Flix Publisher operation:
    1. Call pause() to pause playback.
    2. Start your next operation without calling stopPlayback().
See also:
filePlayed
stopPlayback()
Mac Support: Yes.

void stopPlayback (  ) 

Asynchronously stops playback. The filePlayed event will be fired from the plug-in when stop completes.

Precondition:
startPlayback()
See also:
filePlayed
Mac Support: Yes.

void pause (  ) 

This method behaves differently depending on the publisher's current status:

Precondition:
A file must be playing or a capture must be in progress.
Exceptions:
FE_WRONG_STATE - can't pause when in the current State.
See also:
Flix Publisher API State documentation.
resume()
Mac Support: Yes.

void resume (  ) 

This method behaves differently depending on the publisher's current status:

Precondition:
Capture or Playback must be paused.
Exceptions:
FE_WRONG_STATE - not paused, can't resume.
See also:
State for publisher state documentation.

pause()

Mac Support: Yes.

void show_audio_capture_settings (  ) 

Displays a modal dialog box containing the settings supported by the audio capture device.

Precondition:
State must be FS_PREVIEW or FS_CAPTURE
Remarks:
If AudioCaptureDevice or VideoCaptureDevice is a DV device, show_audio_capture_settings() does nothing. You must call show_video_capture_settings() to display the DV device settings dialog.
See also:
AudioCaptureDevice
VideoCaptureDevice
Mac Support: No.

void show_video_capture_settings (  ) 

Displays a modal dialog box containing the settings supported by the video capture device.

Precondition:
State must be FS_PREVIEW or FS_CAPTURE
See also:
AudioCaptureDevice
VideoCaptureDevice
Mac Support: No.

void startCapturePreview (  ) 

Starts previewing video from the selected device.

Precondition:
The client system must have a Webcam or DV Camera connected.
See also:
AudioCaptureDevice
VideoCaptureDevice
Mac Support: Yes.

void stopCapturePreview (  ) 

Stops preview of capture input.

Precondition:
startCapturePreview()
See also:
startCapturePreview()
Mac Support: Yes.

void startCapture (  ) 

Starts encoding a FLV file using the data captured from the currently selected audio and video devices. The captureCompleted event will be automatically fired when MaximumDuration is non-zero, and EncodedDuration equals or exceeds the MaximumDuration value.

Precondition:
The client system must have a Webcam or DV Camera connected.
Exceptions:
FE_DIRECTSHOW - unexpected error during basic capture setup.
FE_CAPTURE_V - problem capturing from video device.
FE_CAPTURE_A - problem capturing from audio device.
FE_CAPTURE_DV - problem capturing from DV camera.
FE_IN_USE - capture device in use by some other application.
See also:
AudioCaptureDevice
VideoCaptureDevice
pause()
resume()
stopCapture()
Mac Support: Yes.

void stopCapture (  ) 

Asynchronously stops capture. The captureCompleted event will be fired from the plug-in when capture stop completes.

Precondition:
startCapture()
See also:
captureCompleted
pause()
resume()
startCapture()
Mac Support: Yes.

void startFileEncode (  ) 

Starts transcode of the input file. The fileEncoded event will be automatically fired as soon as one of the following conditions is true:

Precondition:
addFile() and checkInputFile() must be called before startFileEncode().
Exceptions:
FE_FILE - error specific to the format of the current file.
See also:
fileEncoded
stopFileEncode()
Mac Support: Yes.

void stopFileEncode (  ) 

Asynchronously stops the current transcode. The fileEncoded event will be fired when transcode stop completes.

Precondition:
startFileEncode()
See also:
fileEncoded
startFileEncode()
Mac Support: Yes.

void publishFile (  ) 

Deprecated:
Use uploadFile()
Since:
v3.0.1.2
Uploads the output file created by the Flix Publisher plug-in.

Precondition:
A file must be created first.
Remarks:
See also:
PublishMethod for additional information on uploading.
startCapture() and startFileEncode() to learn how to create files.
HTTP Upload Documentation
Mac Support: Yes.

void publishAbort (  ) 

Aborts the upload started by a call to publishFile().

Precondition:
An upload must be in progress.
See also:
publishFile()
PublishMethod
Mac Support: Yes.

void setHttpVar ( in string  param,
in string  value 
)

Deprecated:
Use setHttpFormVar()
Since:
Deprecated as of plug-in release v3.0.1.2.
Controls form variables in multipart/form-data HTTP POST.

Mac Support: Yes.

string getHttpVar ( in string  param  ) 

Deprecated:
Use getHttpFormVar()
Since:
Deprecated as of plug-in release v3.0.1.2.
Returns user specified value for param.

Mac Support: Yes.

long numAudioCaptureDevices (  ) 

Returns the number of audio input devices on the client system. Use with audioCaptureDeviceName() and AudioCaptureDevice to control which audio capture device the publisher will use.

Mac Support: Yes.

long numVideoCaptureDevices (  ) 

Returns the number of video input devices on the client system. Use with videoCaptureDeviceName() and VideoCaptureDevice to control which video capture device the publisher will use.

Mac Support: Yes.

string audioCaptureDeviceName ( in long  index  ) 

Returns the name of the audio capture device at the specified index. Use numAudioCaptureDevices() to determine the number of available devices.

Returns:
Audio device name and sets LastError to FE_SUCCESS upon success.
Empty string and sets LastError to FE_NO_CAPTURE_DEVICE when index out of range.
See also:
numAudioCaptureDevices()
Mac Support: Yes.

string videoCaptureDeviceName ( in long  index  ) 

Returns the name of the video capture device at the specified index. Use numVideoCaptureDevices() to determine the number of available devices.

Returns:
Video device name and sets LastError to FE_SUCCESS upon success.
Empty string and sets LastError to FE_NO_CAPTURE_DEVICE when index out of range.
See also:
numVideoCaptureDevices()
Mac Support: Yes.
Video Capture name device at index.

Returns the name of the video capture device at the specified index. Use numVideoCaptureDevices() to determine the number of available devices.

Returns:
Video device name and sets LastError to FE_SUCCESS upon success.
Empty string and sets LastError to FE_NO_CAPTURE_DEVICE when index out of range.
See also:
numVideoCaptureDevices()
Mac Support: Yes.

void setHttpFormVar ( in string  name,
in string  value 
)

Sets the form variable name to value. If a form variable of name already exists, it will be updated to the new value.

Since:
Available as of plug-in release v3.0.1.2.
Remarks:
See also:
getHttpFormVar(), resetHttpFormVars(), setHttpRequestHeader()
Mac Support: No.

string getHttpFormVar ( in string  name  ) 

Retreives the value of form variable name.

Since:
Available as of plug-in release v3.0.1.2.
Returns:
  • the value of name
  • empty string if variable name does not exist.
See also:
setHttpFormVar(), resetHttpFormVars()
Mac Support: No.

void resetHttpFormVars (  ) 

Call resetHttpFormVars() to clear the HTTP form variables.

See also:
getHttpFormVar(), setHttpFormVar()
Mac Support: No.

void setHttpRequestHeader ( in string  name,
in string  value 
)

Sets the request header name to value. If a request header named name already exists, it will be updated to the new value.

Since:
Available as of plug-in release v3.0.1.2.
Remarks:
See also:
getHttpRequestHeader(), resetHttpRequestHeaders(), setHttpFormVar()
Mac Support: No.

string getHttpRequestHeader ( in string  name  ) 

Retreives the value of the request header named name.

Since:
Available as of plug-in release v3.0.1.2.
Returns:
  • the value of name
  • empty string if header name does not exist.
See also:
setHttpRequestHeader(), resetHttpRequestHeaders()
Mac Support: No.

void resetHttpRequestHeaders (  ) 

Call resetHttpRequestHeaders() to clear the HTTP request headers.

Since:
Available as of plug-in release v3.0.1.2.
See also:
getHttpRequestHeader(), setHttpRequestHeader(), uploadFile()
Mac Support: No.

string getHttpResponse (  ) 

Call getHttpResponse from the uploadComplete() event handler function to retrieve the HTTP response in the form:

<HTTP response code> [printable response data]

Since:
Available as of plug-in release v3.0.1.2.
Returns:
HTTP response string.
See also:
uploadFile(), PublishMethod
Mac Support: No.

string getMd5Checksum ( in string  file  ) 

Returns:
Upon success, returns the MD5 checksum of the file.
Exceptions:
FE_READ_FAILED - couldn't open file.
See also:
uploadFile(), setHttpFormVar(), setHttpRequestHeader()
Mac Support: No.

void uploadFile ( in string  file,
in long  mode 
)

Uploads the file specified.

Remarks:
See also:
PublishMethod for additional information on uploading.
HTTP Upload Documentation
Exceptions:
FE_TRANSFER_FAILED - upload of file failed.
FE_READ_FAILED - couldn't open file.
See also:
getHttpRequestHeader(), setHttpRequestHeader(), PublishMethod
Mac Support: No.

void addFmsAuthArg ( in string  function_name,
in string  arg 
)

addFmsAuthArg() adds a FMS Action Script function call for use during authentication.

Precondition:
Remarks:
  • Always call resetFmsAuthArgs() before adding your first function.
  • Adds function_name to the plug-in's set of FMS AS functions and arguments.
  • Multiple addFmsAuthArg() calls with the same function_name add arguments to the function call.
  • Non-empty arg strings are stored and passed to FMS in the order in which they were added.
See also:
getFmsAuthArgList(), resetFmsAuthArgs(), FmsAuthenticationMode
Mac Support: No.

string getFmsAuthArgList ( in string  function_name  ) 

The getFmsAuthArgList() method is provided for debugging purposes only. This method should be used to inspect the functions and arguments you've passed to the plug-in. getFmsAuthArgList() returns the argument list for function_name as multi line string, with one argument per line.

Mac Support: No.

string getFmsAuthResponse ( in string  function_name  ) 

The getFmsAuthResponse() method is provided for debugging purposes only. This method should only be used to determine the reason for an authentication failure during connection to the remote FMS. getFmsAuthResponse() returns the responses for function_name as a multi line string, with one response per line.

To send responses to the plug-in from you FMS AS code, you use the clientObj.call() method, like this:

clientObj.call("name of your AS function", null, message_string);
// note, the second parameter MUST be null.

Mac Support: No.

void resetFmsAuthArgs (  ) 

Resets the plug-in's list of FMS functions and their arguments.

Mac Support: No.

void setFmsPollFunction ( in string  func  ) 

Sets the name of the server side action script function that will be polled to monitor the FMS connection status. See flixpub_conf.js for an example action script function.

Precondition:
State must be FS_STOP.
Mac Support: No.

string getFmsPollFunction (  ) 

Retrieves the name of the server side action script connection polling function.

Mac Support: No.

void addFmsPollArg ( in string  arg  ) 

Adds arguments for passing to the server side action script connection polling function.

Precondition:
State must be FS_STOP.
Mac Support: No.

string getFmsPollArgList (  ) 

Returns the argument list.

Mac Support: No.

void resetFmsPollArgs (  ) 

Resets the argument list.

Mac Support: No.


On2 Flix Publisher documentation, generated on Mon Jan 7 18:13:01 2008 by doxygen 1.5.4 On2 Technologies, Inc