WorkWithPlus for VideoCall on Native Mobile

Requirements

Before getting started, please check the VideoCall Native Mobile Requirements section.

Setup VideoCall in your knowledge base

To use video calls in a mobile environment, create a 'Panel', and then drag and drop the user control from the toolbox

videocall_toolbox_nm

The user control must be configured using the 'properties grid'

videocall_nm_properties

Properties

API Properties: Host, Secret, Key

This information must be obtained from the video call provider platform, once you register your app in their portal.

These properties can be modified on any event, at runtime, but they can only be modified before the 'initClient' method is used. 

Check Platform for more details.

Show Local Camera

Can be used to hide the local camera.

Remote Video Aspect

Defines how the remote video image will be scaled.

  • Fill
  • Fit 
  • Original: original aspect is used
  • Balanced. Scales the images but it will not crop as much fill. Works only in Android

Incoming calls Mode

Defines how the SDK will react when a call is received.

  • Notify: The 'CallReceived' event will be fired.
  • Ignore: The SDK will not receive calls.
  • Answer: The 'CallReceived' event will be fired, and then, the call will be automatically answered

Connection Timeout

In case the call stops receiving data, the SDK will wait a couple of seconds just in case the communication is restored.

This property defines the maximum amount of seconds that the SDK will wait before considering that the call was dropped. 

Methods

initClient

It must be used to initialize the Sinch SDK. It is recommended to be invoked in the 'ClientStart' event.

callTo

This method must be invoked to call the remote user. 

It can only be invoked if the Sinch SDK was correctly initialized. Use the event 'ClientDidStart' to ensure SDK initialized.

hangUp

Ends the video call.

Events

ClientDidStart

It is invoked if the Sinch SDK is correctly initialized after the 'initClient' method is used.

ClientDidFail

It is invoked if there is an error initializing the Sinch SDK after the 'initClient' method is used.

CallDidProgress

Raised when the call is correctly placed.

CallDidEstablish

Raised once the call is established.

CallDidAddVideoTrack

Raised if the remote vide stream is successfully received.

CallDidEnd

Raised when the call is finished by either the local or the remote client

Methods and Events example:

// SDK must be initialized as soon as possible. e.g. on the 'ClientStart' event
Event ClientStart
    Composite        
        &LocalClientId = !"SD1"
        DVSinchClient1.initClient(&LocalClientId)
        &VideConferenceStatus = !"Video call is initializing"
    Endcomposite
Endevent

// Once the client is ready, the call can be done automatically, or a "place call" button could be enabled
event DVSinchClient1.ClientDidStart
    Composite
        // In this sample, we place the call as soon as the sdk is ready        
        &VideConferenceStatus = !"Calling"
        DVSinchClient1.callTo(&CallSessionId)
    EndComposite
endevent

event DVSinchClient1.ClientDidFail
    Composite
        // Inform user of the error
        &VideConferenceStatus = !"Error initializing video call SDK"        
        msg(&VideConferenceStatus)
    EndComposite
endevent

event DVSinchClient1.CallDidEnd
    Composite
        // Call ended
        &VideConferenceStatus = !"Video call finished"        
        msg(&VideConferenceStatus)
        return
    EndComposite
endevent

Event DVSinchClient1.CallDidAddVideoTrack
    // This event is called as soon as the video stream is ready
    &VideConferenceStatus = !"Video call progressing"
Endevent

// User events pressed 
Event 'HangUp'
    Composite        
        DVSinchClient1.hangUp()    
    EndComposite
Endevent

Event 'PlaceCall'
    DVSinchClient1.callTo(&CallSessionId)
EndEvent

Event Back
    Composite
        DVSinchClient1.hangUp()
        return
    EndComposite
EndEvent