SIGN UP

Recorder

Methods

addEventListener

addEventListener(recorderevent: Function, handler: Function): void

Adds handler for specific event generated by Recorder. Use only functions as handlers; anything except a function leads to the error and scenario termination when a handler will be called.

Parameters

  • recorderevent:

    Function

    Event class (i.e., RecorderEvents.Stopped)

  • handler:

    Function

    Handler function. A single parameter is passed - object with event information

Returns

  • Return:

    void

Examples

request:

     require(Modules.Recorder);
     var recorder = VoxEngine.createRecorder(); // create Recorder instance
     recorder.addEventListener(RecorderEvents.Started, function (recevent) {
		Logger.write("Record URL: "+recevent.url);
	});

mute

mute(doMute: Boolean): void

Mute/unmute whole record without detaching media sources from it

Parameters

  • doMute:

    Boolean

    Mute/unmute switch

Returns

  • Return:

    void

Examples

request:

     require(Modules.Recorder);
     var recorder = VoxEngine.createRecorder(); // create Recorder instance
     call.sendMediaTo(recorder); // send call media to recorder
     setTimeout(function() {recorder.mute(true);}, 5000); // mute after 5 seconds
     setTimeout(function() {recorder.mute(false);}, 10000); // unmute after 10 seconds

removeEventListener

removeEventListener(recorderevent: Function, handler: Function): void

Removes handler for specific event generated by Recorder

Parameters

  • recorderevent:

    Function

    Event class (i.e., RecorderEvents.Stopped)

  • handler:

    Function
    Optional

    Handler function. If not specified, all event listeners are removed

Returns

  • Return:

    void

Examples

request:

     require(Modules.Recorder);
     var recorder = VoxEngine.createRecorder(); // create Recorder instance
     recorder.addEventListener(RecorderEvents.Started, handleRecorderStarted);
     function handleRecorderStarted(e) {
		Logger.write("Record URL: "+e.url);
	}
     if (somethingHappened) recorder.removeEventListener(RecorderEvents.Started, handleRecorderStarted);

stop

stop(): void

Stop recording and triggers the RecorderEvents.Stopped event.

Returns

  • Return:

    void

Examples

request:

     require(Modules.Recorder);
     var recorder = VoxEngine.createRecorder(); // create Recorder instance
     call.sendMediaTo(recorder); // send call media to recorder
     setTimeout(recorder.stop, 5000); // stop recording after 5 seconds