zby-live-sdk 1.0.48-beta0831-1 → 1.0.49-beta0825-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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zby-live-sdk",
3
- "version": "1.0.48-beta0831-1",
3
+ "version": "1.0.49-beta0825-1",
4
4
  "main": "dist/zby-live-sdk.cjs.js",
5
5
  "module": "dist/zby-live-sdk.esm.js",
6
6
  "browsers": "dist/zby-live-sdk.umd.js",
@@ -13,7 +13,7 @@ const urls = {
13
13
  };
14
14
 
15
15
  // export const version = require('../../package.json').version;
16
- export const version = '1.0.48-beta0831-1';
16
+ export const version = '1.0.49-beta0825-1';
17
17
 
18
18
  export const liveExt = {
19
19
  name: 'live',
@@ -20,6 +20,11 @@ const rtcReportUrl = {
20
20
  test: 'test-r.weclassroom.com',
21
21
  online: 'r.weclassroom.com'
22
22
  };
23
+ const sdkVale = {
24
+ zego: 8, //8代表zego采集麦克风+扬声器
25
+ talrtc: 101, //101代表talrtc采集声音
26
+ trtc: 102, //102代表trtc采集声音
27
+ }
23
28
 
24
29
  /**
25
30
  * @function 设备检测初始化
@@ -1807,6 +1812,11 @@ export const getStreamType_zego = () => {
1807
1812
  }
1808
1813
  };
1809
1814
 
1815
+ const setThirdAudioCallbackType = (sdkType) => {
1816
+ let type = sdkVale[sdkType];
1817
+ return zegosdk.setThirdAudioType(type);
1818
+ }
1819
+
1810
1820
 
1811
1821
  export default {
1812
1822
  init,
@@ -1885,6 +1895,7 @@ export default {
1885
1895
  sendMediaSideInfo,
1886
1896
  enableHighlight,
1887
1897
  setAUXAudioType,
1888
- mixedstuVideo
1898
+ mixedstuVideo,
1899
+ setThirdAudioCallbackType
1889
1900
  // getDeviceState
1890
1901
  };
@@ -2410,7 +2410,7 @@ const setAudioAuxSource = (source) => {
2410
2410
  });
2411
2411
  }
2412
2412
 
2413
- //RTC同屏 辅助通道音频类型 0:静音 / 1:麦克风 / 2:拉流的声音 / 3:1+2 / 4:麦克风+扬声器
2413
+ //RTC同屏 辅助通道音频类型 0:静音 / 1:麦克风 / 2:拉流的声音 / 3:1+2 / 4:麦克风+扬声器 /5:扬声器(音乐)(没有拉流,没有外部混音没有调用,没有麦克风)
2414
2414
  const setAUXAudioType = (type) => {
2415
2415
  defaultApi.writeLog('info', 'avsdk ZEGO::SetAUXAudioType');
2416
2416
  return callMethod('SetAUXAudioType', {
@@ -2425,6 +2425,14 @@ const startAudioExCapture = (channel) => {
2425
2425
  channel
2426
2426
  });
2427
2427
  }
2428
+ /**
2429
+ * @function 设置第三路流音频类型
2430
+ * @param {number} type 音频类型 0:静音 / 1:麦克风 / 2:拉流的声音 / 3:1+2 / 4:麦克风+扬声器(音乐+拉流)(带外部混音) /8:麦克风+扬声器(音乐+拉流)(不带外部混音)/16:扬声器(音乐)(没有拉流,没有外部混音,没有麦克风)
2431
+ * @return: Promise
2432
+ */
2433
+ const setThirdAudioType = (type) => {
2434
+ return callMethod('SetThirdAudioType', { type })
2435
+ };
2428
2436
 
2429
2437
  //加载截屏插件
2430
2438
  const LoadCollectionOutputEntry2 = () => {
@@ -2983,5 +2991,6 @@ export default {
2983
2991
  addListener,
2984
2992
  stopCheckDevice,
2985
2993
  getDeviceCheckInitStatus,
2986
- setDeviceCheckInitStatus
2994
+ setDeviceCheckInitStatus,
2995
+ setThirdAudioType
2987
2996
  };
@@ -383,6 +383,7 @@ const zbysdk = {
383
383
  defaultApi.writeLog(`sdk status : setAudioCallbackType , sdk_type : ${sdk_type}`);
384
384
  try {
385
385
  await liveBaseApi.setAudioCallbackType(sdk_type);
386
+ await zbyAVSDK.setThirdAudioCallbackType(sdk_type);
386
387
  } catch (e) {
387
388
  defaultApi.writeLog(`sdk status : setAudioCallbackType , error : ${JSON.stringify(e)}`);
388
389
  };
@@ -575,7 +576,9 @@ const zbysdk = {
575
576
  }
576
577
 
577
578
  try {
579
+ console.log('开始设置rtmp声音回调',sdk_type);
578
580
  await liveBaseApi.setAudioCallbackType(sdk_type);
581
+ await zbyAVSDK.setThirdAudioCallbackType(sdk_type);
579
582
  } catch (error) {
580
583
  defaultApi.writeLog(`setAudioCallbackType error : ${JSON.stringify(error)}`);
581
584
  }