V3 Developer notes
We need to add the following features:
- subscribe to events from calls and client.
- modify client and call parameters if dev needs to (eg: dev mode ...).
- more flexibility in how the widget is triggered (not just a call button id).
- a mode where it doesn't have a modal, just an element that exists within the page.
- incoming call handling (notification, accept/reject, trigger a call component with that call invite).
Current API for the call widget is lacking in a number of ways:
- user details collection at start, and survey prompt at the end are hardcoded and inflexible
- no proper way to hook into the lifecycle events of the client and the call.
and many more things that stem from not having a flexible API.
New API proposal
Modal use
<call-modal trigger="button-id" open="boolean">
<call-context token="string" destination="string" audio="boolean" video="boolean" ... other params>
<call-video/>
<call-transcript-viewer/>
</call-window>
</call-modal>
- the
<call-modal>
is optional. It just shows it's children in a modal context. - the
<call-context>
is the main component that contains the call logic. It sets up the client and provides methods to dial, hangup etc. - the
<call-context>
also emits events relating to the call state. - children of
<call-context>
inherit the client and the call object.