zby-live-sdk 1.0.49-beta1018-1 → 1.0.49-beta1130-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.49-beta1018-1",
3
+ "version": "1.0.49-beta1130-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.49-beta1018-1';
16
+ export const version = '1.0.49-beta1130-1';
17
17
 
18
18
  export const liveExt = {
19
19
  name: 'live',
@@ -1782,6 +1782,21 @@ export const startAudioExCapture = () => {
1782
1782
  }
1783
1783
  };
1784
1784
 
1785
+ /**
1786
+ * @function 设置授课嘉宾头像流id
1787
+ * @return: Promise
1788
+ */
1789
+ export const setCustomHeadStreamId = (headStreamID) => {
1790
+ switch (window.zbyAVSDK_init_sdk_type) {
1791
+ case RTC:
1792
+ break;
1793
+ case ZEGO:
1794
+ return zegosdk.setCustomHeadStreamId(headStreamID);
1795
+ default:
1796
+ break;
1797
+ }
1798
+ }
1799
+
1785
1800
  /**
1786
1801
  * @function 开启音频外部采集
1787
1802
  * @return: Promise
@@ -1919,6 +1934,7 @@ export default {
1919
1934
  startSoundLevelMonitor,
1920
1935
  sendMediaSideInfo,
1921
1936
  enableHighlight,
1937
+ setCustomHeadStreamId,
1922
1938
  setAUXAudioType,
1923
1939
  mixedstuVideo,
1924
1940
  setThirdAudioCallbackType,
@@ -56,6 +56,8 @@ let hasNetWrong = false;
56
56
  const classType = 0;
57
57
  // 监听id
58
58
  let EMListenerId = 0;
59
+ // 缓存上层传入的AppId
60
+ let cacheAppId = 0;
59
61
 
60
62
  //静音推流时,音量值是否上抛上层标志 false=没有声音不往上层通知/true=有声音有上层通知
61
63
  let isNoticeMicVolumeZego = false;
@@ -604,6 +606,7 @@ export const startEngine = (appId, appSignature, businessType) => {
604
606
  if (typeof businessType === 'undefined') {
605
607
  businessType = 0;
606
608
  }
609
+ cacheAppId = appId;
607
610
  defaultApi.writeLog('avsdk ZEGO::StartEngine');
608
611
  return callMethod('StartEngine', {
609
612
  appId,
@@ -2088,13 +2091,14 @@ export const mixStream = (type, args, seq) => {
2088
2091
  * @param extraStreamIds:Array 非(课件+老师头像流)流ID [{contentControl:2,streamId:'stream_1',left:10,top:10,right:170,bottom:100},{contentControl:0,streamId:'stream_2',left:10,top:110,right:170,bottom:200}]
2089
2092
  * @param targetRtcStreamId:String 混流输出流ID,必选
2090
2093
  * @param targetUrls:Array 转推RTMP流地址,必选
2091
- * @param backgroundImageId:Int 0默认,1上台,2关闭摄像头
2094
+ * @param backgroundImageId:Int 0默认,1上台,2关闭摄像头,3嘉宾未签到,4嘉宾离线
2092
2095
  * @param coursewareWidth: Int 课件区真实宽
2093
2096
  * @return Promise | void
2094
2097
  */
2095
2098
  export const startmixStreams = async (mixTaskId, mixType, srcStreamIds, targetRtcStreamId, targetUrls, backgroundImageId = 0, extraStreamIds=[], coursewareWidth = 1280) => {
2096
2099
  let srcStreamInfos = [];
2097
- let bkImage='preset-id://262148633_live_closeCamera.png';
2100
+ let bkImage='preset-id://'+cacheAppId+'_live_closeCamera.png';
2101
+ defaultApi.writeLog(`avsdk ZEGO::startmixStreams default bkImage: ${bkImage}`);
2098
2102
  if (mixType === 0 || mixType === 1) {
2099
2103
  for (let i = 0, len = srcStreamIds.length; i < len; i++) {
2100
2104
  if (srcStreamIds[i].contentControl === 1) {
@@ -2155,10 +2159,16 @@ export const startmixStreams = async (mixTaskId, mixType, srcStreamIds, targetRt
2155
2159
  case 0:
2156
2160
  break;
2157
2161
  case 1:
2158
- bkImage = 'preset-id://262148633_live_TeacherOnStage.png';
2162
+ bkImage = 'preset-id://'+cacheAppId+'_live_TeacherOnStage.png';
2159
2163
  break;
2160
2164
  case 2:
2161
- bkImage = 'preset-id://262148633_live_closeCamera.png';
2165
+ bkImage = 'preset-id://'+cacheAppId+'_live_closeCamera.png';
2166
+ break;
2167
+ case 3:
2168
+ bkImage = 'preset-id://'+cacheAppId+'_live_2022112202.png';
2169
+ break;
2170
+ case 4:
2171
+ bkImage = 'preset-id://'+cacheAppId+'_live_2022112201.png';
2162
2172
  break;
2163
2173
  default:
2164
2174
  break;
@@ -2641,7 +2651,15 @@ const setAudioAuxSource = (source) => {
2641
2651
  });
2642
2652
  }
2643
2653
 
2644
- //RTC同屏 辅助通道音频类型 0:静音 / 1:麦克风 / 2:拉流的声音 / 3:1+2 / 4:麦克风+扬声器 /5:扬声器(音乐)(没有拉流,没有外部混音没有调用,没有麦克风)
2654
+ //设置嘉宾头像流id,headStreamID 空字符串代表无嘉宾
2655
+ const setCustomHeadStreamId = (headStreamID) => {
2656
+ defaultApi.writeLog('info', 'avsdk ZEGO::setCustomHeadStreamId');
2657
+ return callMethod('SetCustomHeadStreamId', {
2658
+ headStreamID
2659
+ });
2660
+ }
2661
+
2662
+ //RTC同屏 辅助通道音频类型 0:静音 / 1:麦克风 / 2:拉流的声音 / 3:1+2 / 4:麦克风+扬声器+外部混音 /:8麦克风+扬声器(含拉流,没有外部混音) /:16扬声器(音乐)(没有拉流,没有外部混音没有调用,没有麦克风)
2645
2663
  const setAUXAudioType = (type) => {
2646
2664
  defaultApi.writeLog('info', 'avsdk ZEGO::SetAUXAudioType');
2647
2665
  return callMethod('SetAUXAudioType', {
@@ -3217,6 +3235,7 @@ export default {
3217
3235
  getAllChannelIndex,
3218
3236
  startAudioExCapture,
3219
3237
  sendMediaSideInfo,
3238
+ setCustomHeadStreamId,
3220
3239
  setAUXAudioType,
3221
3240
  loadCollectionInputEntry2,
3222
3241
  addListener,
@@ -1512,6 +1512,12 @@ const zbysdk = {
1512
1512
  return zbyAVSDK.startAudioExCapture();
1513
1513
  },
1514
1514
 
1515
+ //设置授课嘉宾头像流id
1516
+ setCustomHeadStreamId (headStreamID) {
1517
+ defaultApi.writeLog(`sdk action: setCustomHeadStreamId headStreamID:${headStreamID}`);
1518
+ return zbyAVSDK.setCustomHeadStreamId(headStreamID);
1519
+ },
1520
+
1515
1521
  //RTC同屏 辅助通道音频类型
1516
1522
  setAUXAudioType(type) {
1517
1523
  defaultApi.writeLog(`sdk action: setAUXAudioType type:${type}`);