Home Reference Source
import {StreamRecorder} from '@quobis/sippojs'
public class | source

StreamRecorder

This class allows to record a stream. Instances of this class are normally obtained using Call#createLocalStreamRecorders or Call#createRemoteStreamRecorders

Note that this class uses internally a MediaRecorder. According to its specification, there is not a list of supported container formats, audio codecs or video codecs that must be supported for every browser and the default value for them is platform-specific.

Events

This class contains an instance of {EventEmitter} that emits the next events:

  • start is emitted after the recording is started.
  • pause is emitted every time the recording is paused.
  • resume is emitted every time the recording is resumed.
  • stop is emitted after the recording is stoped. It contains a StopEvent

You can check EventEmitter2 documentation for additional information about adding and removing listeners for this events events.

See:

Example:

Basic usage
let streamRecorder = call.remoteStreams[0].createStreamRecorder();
streamRecorder.start();
streamRecorder.emitter.on('stop', (data) => {
  console.log(data);
  // Here you can download the data, upload to a server..
});
streamRecorder.stop();

Constructor Summary

Public Constructor
public

constructor(mediaStream: MediaStream)

Member Summary

Public Members
public

emitter: EventEmitter

public

Indicates if the audio of the call must be recorded

public

Indicates if the video of the call must be recorded

public get

Method Summary

Public Methods
public

Pauses the recording

public

Resumes the recording

public

Starts the recording

public

Stops the recording

Public Constructors

public constructor(mediaStream: MediaStream) source

Params:

NameTypeAttributeDescription
mediaStream MediaStream

The media stream that is going to be recorded

Public Members

public emitter: EventEmitter source

public isAudioRecordingEnabled: boolean source

Indicates if the audio of the call must be recorded

public isVideoRecordingEnabled: boolean source

Indicates if the video of the call must be recorded

public get status: StreamRecorderStatus source

Public Methods

public pause(): undefined source

Pauses the recording

Return:

undefined

public resume(): undefined source

Resumes the recording

Return:

undefined

public start(): undefined source

Starts the recording

Return:

undefined

public stop(): undefined source

Stops the recording

This method can only be called after the MediaStream#start method has between called. The stop event is received after calling this method with the recorded data.

Return:

undefined