new videoMail(onEvents, domElements, options)
VideoMail usecase
Parameters:
Name | Type | Description |
---|---|---|
onEvents |
object | Event handlers: onRecording, onStopped |
domElements |
object | DOM elements: videomail |
options |
object | Available options: stream |
- Source:
Returns:
VideoMail methods: startRecording, stopRecording, toggleAudio, toggleVideo
- Type
- Promise
Example
var onEvents = { onRecording: function() { // Recording }, onStopped: function() { // Stopped } }; var domElements = { videomail: document.getElementById('videomail') }; var options = { stream: { audioEnabled: true, videoEnabled: true, aDeviceId: null, vDeviceId: null } }; usecases.videoMail(onEvents, domElements, options) .then(function(action) { // Use Case has been atacched succesfully ... }) .catch(function(cause) { // Error attaching the Use Case console.log("Error Attach " + cause ); })
Methods
-
<inner> closeUsecase()
-
Close the current UseCase. It's recommended combine with disconnect method
- Source:
Returns:
- Type
- nothing
Example
action.closeUsecase(); myVideoApp.disconnect(); // Recommended
-
<inner> startRecording(recordPrefix, name)
-
The User sends a request to start recording a Video message
Parameters:
Name Type Description recordPrefix
string Prefix record
name
string File name
- Source:
Returns:
- Type
- nothing
Example
action.startRecording('__default__', 'MyRecordMobile');
-
<inner> stopRecording()
-
The User sends a request to stop recording the current Video message
- Source:
Returns:
- Type
- nothing
Example
action.stopRecording();
-
<inner> toggleAudio()
-
Toggle Audio stream (Mute/Unmute)
- Source:
Returns:
Is audio muted?
- Type
- boolean
Example
action.toggleAudio(); // true or false
-
<inner> toggleVideo()
-
Toggle Video stream (Mute/Unmute)
- Source:
Returns:
Is video muted?
- Type
- boolean
Example
action.toggleVideo(); // true or false