new videoMail(onEvents, domElements, options)
VideoMail usecase
Parameters:
Name | Type | Description |
---|---|---|
onEvents |
object | Event handlers: onEvents |
domElements |
object | DOM elements: domElements |
options |
object | Available options: options |
Returns:
VideoMail actions
- Type
- Promise
Example
var onEvents = { onRecording: () => { // Started recording }, onStopped: () => { // Stopped recoding } }; var domElements = { videomail: document.getElementById('videomail') }; var options = { stream: { audioEnabled: true, videoEnabled: true, aDeviceId: null, vDeviceId: null, resolution: 'vga' // 'qvga', 'vga', 'hd', 'full-hd', '4k', '8k', frameRate: 30, }, account: "******" // Multiple mode }; usecases.videoMail(onEvents, domElements, options) .then(action => { // Use Case has been atacched succesfully ... }) .catch(cause => { // Error attaching the Use Case console.log("Error Attach " + cause ); })
Methods
-
closeUsecase()
-
Close the current UseCase. It's recommended combine with disconnect method
Returns:
- Type
- nothing
Example
action.closeUsecase(); myVideoApp.disconnect(); // Recommended
-
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
Returns:
- Type
- nothing
Example
action.startRecording('__default__', 'MyRecordMobile');
-
stopRecording()
-
The User sends a request to stop recording the current Video message
Returns:
- Type
- nothing
Example
action.stopRecording();
-
toggleAudio()
-
Toggle Audio stream (Mute/Unmute)
Returns:
Is audio muted?
- Type
- boolean
Example
action.toggleAudio(); // true or false
-
toggleVideo()
-
Toggle Video stream (Mute/Unmute)
Returns:
Is video muted?
- Type
- boolean
Example
action.toggleVideo(); // true or false