Constructor
new VideoCall(api, callReq, videoContaineropt)
Create a VideoCall
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
api |
Api | api instance |
|
callReq |
CallRequest | call request information |
|
videoContainer |
HTMLElement |
<optional> |
When the container is provided, it will hold the participants and their video/audio html5. If the container is not provided, the consumer of the SDK must add the participants manually by reacting to different events. |
Fires:
- VideoCall#event:callConnected
- VideoCall#event:callCompleted
- VideoCall#event:interlocutorInfo
- VideoCall#event:localAudioShared
- VideoCall#event:localVideoShared
- VideoCall#event:remoteAudioShared
- VideoCall#event:remoteVideoShared
- VideoCall#event:localAudioUnshared
- VideoCall#event:localVideoUnshared
- VideoCall#event:remoteAudioUnshared
- VideoCall#event:remoteVideoUnshared
- VideoCall#event:localAudioEnabled
- VideoCall#event:localVideoEnabled
- VideoCall#event:remoteAudioEnabled
- VideoCall#event:remoteVideoEnabled
- VideoCall#event:localAudioDisabled
- VideoCall#event:localVideoDisabled
- VideoCall#event:remoteAudioDisabled
- VideoCall#event:remoteVideoDisabled
- VideoCall#event:remoteParticipantAttachContainer
- VideoCall#event:remoteParticipantDetachContainer
- VideoCall#event:localParticipantAttachContainer
- VideoCall#event:localParticipantDetachContainer
Extends
Members
type
- Overrides:
Returns the type of this object
Methods
(protected) _attachLocalTracks(actor, tracks)
Attaches tracks in the tracks array to the DOM (optionally) and fires proper event
Parameters:
| Name | Type | Description |
|---|---|---|
actor |
Actors | |
tracks |
Array |
Fires:
- VideoCall#event:localVideoShared
- VideoCall#event:localAudioShared
(protected) _attachRemoteTracks(actor, tracks, remoteParticipant)
Attaches tracks for a remote participant to the DOM and fires proper events
Parameters:
| Name | Type | Description |
|---|---|---|
actor |
Actors | |
tracks |
Array | |
remoteParticipant |
RemoteParticipant |
Fires:
- VideoCall#event:remoteVideoShared
- VideoCall#event:remoteAudioShared
(protected) _callCompleted()
- Overrides:
Officially completes the call. This should be called by all derived classes
(protected) _callConnected()
- Overrides:
This override calls super, but also starts up the local tracks and publishes them when ready
(protected) _createLocalParticipantContainer() → {HTMLElement}
Creates a container for the local participant and optionally attaches it to the DOM
Fires:
- VideoCall#event:localParticipantAttachContainer
Returns:
- Type
- HTMLElement
(protected) _createRemoteParticipantContainer(remoteParticipant)
Creates a container for the remote participant and optionally attaches it to the DOM
Parameters:
| Name | Type | Description |
|---|---|---|
remoteParticipant |
RemoteParticipant |
Fires:
- VideoCall#event:remoteParticipantAttachContainer
(protected) _detachTracks(actor, tracks)
Detaches tracks in the tracks array from the DOM and fires proper event. Local tracks will also be stopped
Parameters:
| Name | Type | Description |
|---|---|---|
actor |
Actors | |
tracks |
Array |
Fires:
- VideoCall#event:remoteVideoUnshared
- VideoCall#event:remoteAudioUnshared
(protected) _removeLocalParticipantContainer(remoteParticipant)
Removes the container for the remote participant from the DOM
Parameters:
| Name | Type | Description |
|---|---|---|
remoteParticipant |
RemoteParticipant |
Fires:
- VideoCall#event:localParticipantDetachContainer
(protected) _removeRemoteParticipantContainer(remoteParticipant)
Removes the container for the remote participant from the DOM
Parameters:
| Name | Type | Description |
|---|---|---|
remoteParticipant |
RemoteParticipant |
Fires:
- VideoCall#event:remoteParticipantDetachContainer
disableAudio()
- Overrides:
Disables audio. Essentially a mute.
disableVideo()
Disables video. Essentially a pause.
enableAudio(enableopt)
Enables/disables audio. Essentially mute/unmute. With no param true is assumed, but boolean can be used to perform mute
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
enable |
boolean |
<optional> |
true
|
enableVideo(enableopt)
Enables/disables video. Essentially pause/unpause. With no param true is assumed, but boolean can be used to perform pause
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
enable |
boolean |
<optional> |
true
|
getInterlocutorInfo() → {InterlocutorInfo}
- Overrides:
Used for retrieving interlocutor info after event has already been fired. Will return null if information is not yet ready
Returns:
details on call participant
- Type
- InterlocutorInfo
hangup() → {Promise.<boolean>}
- Overrides:
Hangup the call by calling the proper API method
Returns:
- Type
- Promise.<boolean>
isVideo() → {boolean}
- Overrides:
Returns true if this is a video call, false otherwise
Returns:
- Type
- boolean
isVoice() → {boolean}
- Overrides:
Returns true if this is a voice call, false otherwise
Returns:
- Type
- boolean
start() → {Promise}
- Overrides:
Calls start from the super class, but then performs the video specific start.
Returns:
- Type
- Promise