DVSinchClientWeb

To use video calls in a web environment, create a WebPanel, and then drag and drop the user control from the toolbox:

dvsinchclient_img_toolbox

User control must be configured using the 'Properties grid':

dvsinchclient_img_properties

Properties

Sinch Key

This property has to be obtained from Sinch portal.

Check Platform for more details.

Key

This property has to be obtained from WorkWithPlus support Team.

Check User control license for more details.

Call Mode

Define how the user control will behave.

  • Call: control only makes calls, it cannot receive calls.
  • Automatic Call: same as 'Call', but also, user control will automatically place the call as soon as it is ready.
  • Answer: control only receives calls.
  • Call and Answer: control can place and receive calls.

Is Voice Only

Define whether the user control will support video or voice-only calling.

Hide Built-In UI

Used to hide default UI. Can be used to create custom UI for the control.

Disable Built-In Sounds

This property can be used to disable the user control default sounds (the "ring tone" )

Local User

This property is used to define the local user ID, which is used to reference the current user. 

Remote User

This property is used to define the ID of the user that will be called. It is used when "Call Mode" Is set to "Automatic Call"

Recording Session

This property is used to configure the video call recording

Methods

callUser(remoteUserId)

The user control will try to call the indicated user.

If the remote user is valid and is currently initialized, it will fire the 'incomingCall' event on the remote client.

If the call can't be performed, or the remote user does not answer the call, the 'onCallended' event will be fired.

answer()

If the user has an incoming call, the 'answer' method will answer and establish the call.

StartRecording()/StopRecording()

These methods must be used in order to record the video call. Please check 'video call recording' for more details.

mute(boolean)

This method will mute or unmute the local call. Mute/unmute only applies to the local microphone, meaning, the remote client will not receive your audio, but the local user will receive the remote audio (unless the remote client also mutes its microphone).

By default, the local microphone is enabled (not muted).

shareLocalCamera(boolean)

This method will share or stop sharing the local video feed. As its name indicates, 'shareLocalCamera' only applies to the local video camera, meaning, the remote client will not receive your video images, but the local user will receive the remote video (unless the remote client also stops sharing its video camera)

By default, the local video camera is shared.

BuiltIn UI

The user control provides a built-in UI, which consists of a set of buttons and sounds, that can be used without further modifications.

This BuiltIn UI can not be modified.

dvsinchclient_img_buildinui

Custom UI

To customize the look & feel of the control, the user can disable BuildIn UI, and program any UI or behaviour that is required, using GeneXus buttons and controls, and interfacing with the user control using the user control "methods" and "events"

dvsinchclient_img_customui

 

Events:

Event Start
    // Remote Client identifier
    &ClientId = !"DVELOP_CLIENT"
    
    BtnAnswer.Visible = false
    BtnHangUp.Visible = false
    
    UCStatus.Caption = "Client is initializing"
EndEvent

Event DVSinchClientWeb1.onCallReceived
    UCStatus.Caption = "Incoming call received. Answer or hang up call"    
    
    BtnAnswer.Visible = true
    BtnHangUp.Visible = true
    BtnCall.Visible = false
EndEvent

Event DVSinchClientWeb1.onCallEnded
    UCStatus.Caption = format("Call finished '%1'", DVSinchClientWeb1.LastMessage)
    
    BtnAnswer.Visible = false
    BtnHangUp.Visible = false
    BtnCall.Visible = true
    
    Msg(format("Call finished %1", DVSinchClientWeb1.LastMessage))        
EndEvent

Event DVSinchClientWeb1.onCallEstablished
    UCStatus.Caption = "Video call established and started."
    
    BtnHangUp.Visible = true
    BtnCall.Visible = false    
EndEvent

Event DVSinchClientWeb1.onCallProgressing
    UCStatus.Caption = "Calling remote client"
    
    BtnHangUp.Visible = true
EndEvent

Event DVSinchClientWeb1.onClientStart
    UCStatus.Caption = "SDK is ready to receive or place calls"
EndEvent

Event DVSinchClientWeb1.onError
    Log.Error(DVSinchClientWeb1.LastMessage)
    UCStatus.Caption = format("ERROR %1", DVSinchClientWeb1.LastMessage)
EndEvent

Event 'Answer'
    DVSinchClientWeb1.answer()
Endevent

Event 'Hangup'
    DVsinchClientWeb1.hangup()
    
    BtnAnswer.Visible = false
    BtnHangUp.Visible = false
Endevent

Event 'PlaceCall'
    DVSinchClientWeb1.callUser(&ClientId)
Endevent