Skip to content

Commit d3f7287

Browse files
committed
Update README
1 parent c8ae202 commit d3f7287

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,42 @@ query.next((directCallLog) => {
431431
|params.myRole | Returns call logs of the specified role. (e.g. if myRole is `'dc_callee'`, query will return only the callee’s call logs.) |
432432
|params.endResults | Returns the call logs for specified results. If more than one result is specified, they are processed as `OR` condition and all call logs corresponding with the specified end results will be returned. For example, if endResults is `['NO_ANSWER'`, `'CANCELED']`, only the `NO_ANSWER` and `CANCELED` call logs will be returned.|
433433

434+
## Sound Effect
435+
### Sound types
436+
| Type | Description |
437+
|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------|
438+
| DIALING | Refers to a sound that is played on a caller’s side when the caller makes a call to a callee. |
439+
| RINGING | Refers to a sound that is played on a callee’s side when receiving a call. |
440+
| RECONNECTING | Refers to a sound that is played when a connection is lost, but immediately tries to reconnect. Users are also allowed to customize the ringtone. |
441+
| RECONNECTED | Refers to a sound that is played when a connection is re-established. |
442+
443+
### Add sound
444+
| Method | Description |
445+
|----------------------|---------------------------------------------------------------------------------------|
446+
| addDirectCallSound() | Adds a specific sound such as a ringtone and an alert tone with URL to a direct call. |
447+
##### Parameters
448+
| Parameter | Type | Description |
449+
|-----------|-----------|--------------------------------------------------------------------------------------------------------------------------------------|
450+
| type | SoundType | Specifies the sound type to be used according to the event. |
451+
| url | string | Specifies the URL of the sound file. You can use the URI of the asset on the server or ObjectURL created by `URL.createObjectURL()`. |
452+
453+
>Note: In modern web browsers, they have their own autoplay policies and can block the `addDirectCallSound()` method from being directly executed.
454+
To solve this problem, for Chrome and Firefox, the `addDirectCallSound()` method should be called after a user’s event such as clicking a button. For Safari, you have to call the `addDirectCallSound()` method in the event listener of a user’s event such as `onclick()` .
455+
```javascript
456+
document.querySelector('#yourButton').addEventListener('click', function() {
457+
SendBirdCall.addDirectCallSound(SendBirdCall.SoundType.DIALING, RESOURCE_URL);
458+
});
459+
```
460+
461+
### Remove sound
462+
| Method | Description |
463+
|----------------------------------------|----------------------------------------------|
464+
| removeDirectCallSound(type: SoundType) | Removes a specific sound from a direct call. |
465+
##### Parameters
466+
| Parameter | Type | Description |
467+
|-----------|-----------|----------------------------------------------------------------|
468+
| type | SoundType | Specifies the type of sound to be used according to the event. |
469+
434470
## Additional information: call results
435471
Information relating the end result of a call can be obtained at any time via the `directCall.endResult` property, best accessed within the `onEnded()` callback.
436472

0 commit comments

Comments
 (0)