hanc-webrtc-widgets 2.2.1 → 2.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +65 -0
- package/dist/hanc-webrtc-widgets.es.js +5821 -5011
- package/dist/hanc-webrtc-widgets.umd.js +263 -194
- package/dist/src/components/floating-call/floating-call.d.ts +37 -1
- package/dist/src/components/inline-call/inline-call.d.ts +37 -1
- package/dist/src/components/orb-widget.d.ts +5 -0
- package/dist/src/components/pill-call/pill-call.d.ts +37 -1
- package/dist/src/core/health-monitor.d.ts +27 -0
- package/dist/src/core/livekit-call-manager.d.ts +60 -0
- package/dist/src/core/orb/AudioAnalyzer.d.ts +6 -0
- package/dist/src/core/orb/OrbRenderer.d.ts +16 -0
- package/dist/src/core/orb/SharedAudioContext.d.ts +61 -0
- package/dist/src/core/orb/SoundManager.d.ts +22 -34
- package/dist/src/core/orb/index.d.ts +1 -1
- package/dist/src/orb/components/HancAiWidget.d.ts +11 -0
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -850,6 +850,71 @@ widget.addEventListener('call-end', () => {
|
|
|
850
850
|
|
|
851
851
|
---
|
|
852
852
|
|
|
853
|
+
## Sound Presets
|
|
854
|
+
|
|
855
|
+
Widgets play notification sounds when a call starts and ends. Four built-in sound presets are available, synthesized using Web Audio API for a professional feel.
|
|
856
|
+
|
|
857
|
+
### Using Sound Presets
|
|
858
|
+
|
|
859
|
+
```html
|
|
860
|
+
<!-- Set sound preset via attribute -->
|
|
861
|
+
<hanc-ai-inline-call
|
|
862
|
+
agent-id="YOUR_AGENT_ID"
|
|
863
|
+
sound-preset="1"
|
|
864
|
+
sound-volume="0.5"
|
|
865
|
+
></hanc-ai-inline-call>
|
|
866
|
+
|
|
867
|
+
<!-- Disable sounds -->
|
|
868
|
+
<hanc-ai-floating-call
|
|
869
|
+
agent-id="YOUR_AGENT_ID"
|
|
870
|
+
sound-preset="none"
|
|
871
|
+
></hanc-ai-floating-call>
|
|
872
|
+
```
|
|
873
|
+
|
|
874
|
+
### Available Presets
|
|
875
|
+
|
|
876
|
+
| Preset | Name | Description |
|
|
877
|
+
|--------|------|-------------|
|
|
878
|
+
| `1` | Drop | Water drop sound with pitch glide |
|
|
879
|
+
| `2` | Glass Tap | Crystal clear high-frequency tap |
|
|
880
|
+
| `3` | Soft Whoosh | Airy swoosh with noise texture |
|
|
881
|
+
| `4` | Gentle Note | Soft musical note with harmonics |
|
|
882
|
+
| `none` | Disabled | No notification sounds |
|
|
883
|
+
|
|
884
|
+
### Sound Attributes
|
|
885
|
+
|
|
886
|
+
| Attribute | Type | Default | Description |
|
|
887
|
+
|-----------|------|---------|-------------|
|
|
888
|
+
| `sound-preset` | string | `"1"` | Sound preset: `"1"`, `"2"`, `"3"`, `"4"`, or `"none"` |
|
|
889
|
+
| `sound-volume` | number | `0.3` | Volume level from 0.0 to 1.0 |
|
|
890
|
+
|
|
891
|
+
### Programmatic Control
|
|
892
|
+
|
|
893
|
+
```javascript
|
|
894
|
+
import { SoundManager } from 'hanc-webrtc-widgets';
|
|
895
|
+
|
|
896
|
+
// Create a standalone sound manager
|
|
897
|
+
const sound = new SoundManager({
|
|
898
|
+
preset: '3',
|
|
899
|
+
volume: 0.5,
|
|
900
|
+
enabled: true
|
|
901
|
+
});
|
|
902
|
+
|
|
903
|
+
// Play sounds manually
|
|
904
|
+
await sound.playCallStartSound();
|
|
905
|
+
await sound.playCallEndSound();
|
|
906
|
+
|
|
907
|
+
// Change settings
|
|
908
|
+
sound.setPreset('2');
|
|
909
|
+
sound.setVolume(0.7);
|
|
910
|
+
sound.setEnabled(false);
|
|
911
|
+
|
|
912
|
+
// Cleanup
|
|
913
|
+
sound.destroy();
|
|
914
|
+
```
|
|
915
|
+
|
|
916
|
+
---
|
|
917
|
+
|
|
853
918
|
## Browser Support
|
|
854
919
|
|
|
855
920
|
- ✅ Chrome/Edge 90+
|