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.
Example:
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:
Name | Type | Attribute | Description |
mediaStream | MediaStream | The media stream that is going to be recorded |