ezuikit-js 8.0.10-alpha.3 → 8.0.11-alpha.1

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/CHANGELOG.md CHANGED
@@ -1,4 +1,16 @@
1
1
 
2
+ ## v8.0.9 (2024-08-15)
3
+
4
+ ### Feat
5
+
6
+ - 对讲新增API:
7
+ - setVolumeGain(麦克风增强)
8
+ - getMicrophonePermission(获取麦克风权限)
9
+ - getMicrophonesList(获取麦克风列表)
10
+ - setProfile(切换麦克风)
11
+ - 对讲新增事件监听:
12
+ - volumeChange(音量变化通知)
13
+
2
14
  ## v8.0.8 (2024-07-26)
3
15
 
4
16
  ### Feat
package/README.md CHANGED
@@ -413,6 +413,49 @@ themeData将主题数据本地化,设置本地数据,需要删除template参
413
413
  player.stopTalk();
414
414
  ```
415
415
 
416
+ #### 对讲设置麦克风增益
417
+
418
+ ```
419
+ // 设置音频增益系数 0 ~ 10
420
+ player.setVolumeGain(volume);
421
+ ```
422
+
423
+ #### 获取麦克风权限
424
+
425
+ ```
426
+ player.getMicrophonePermission().then(data => {
427
+ if (data.code === 0) {
428
+ // 成功....
429
+ }
430
+ })
431
+ ```
432
+
433
+ #### 获取麦克风列表
434
+
435
+ ```
436
+ // 需要在麦克风已授权的情况下调用,才能获取到麦克风列表,可以和getMicrophonePermission配合使用,或在初始化后先调用getMicrophonePermission获取授权
437
+ player.getMicrophonesList().then(data => {
438
+ if (data.code === 0) {
439
+ // 成功....
440
+ }
441
+ })
442
+ ```
443
+
444
+ #### 切换麦克风
445
+
446
+ ```
447
+ // microphoneId 为获取到的麦克风列表中的deviceId,如果当前处于对讲中,调用setProfile会先关闭,重新发起对讲
448
+ player.setProfile({ microphoneId })
449
+ ```
450
+
451
+ #### 监听麦克风音量变化
452
+ ```
453
+ player.eventEmitter.on('volumeChange', ({ data }) => {
454
+ // 动态显示音柱,100ms触发一次
455
+ console.log(`${data * 100}%`)
456
+ })
457
+ ```
458
+
416
459
  #### 全屏
417
460
 
418
461
  ```js