zby-live-sdk 1.0.49-beta0927-1 → 1.0.49-beta1008-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-beta0927-1",
3
+ "version": "1.0.49-beta1008-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-beta0927-1';
16
+ export const version = '1.0.49-beta1008-1';
17
17
 
18
18
  export const liveExt = {
19
19
  name: 'live',
@@ -110,8 +110,8 @@ const apiChangeSdkUrl = {
110
110
 
111
111
  //开启混流
112
112
  const apiMixStreams = {
113
- test: 'https://tf-classroom-api-test.vdyoo.com',
114
- online: 'https://tf-classroom-api-online.vdyoo.com'
113
+ test: 'https://tf-classroom-test.vdyoo.com',
114
+ online: 'https://tf-classroom-online.vdyoo.com'
115
115
  };
116
116
 
117
117
  export const getApiCloudBaseUrl = () => {
@@ -21,8 +21,8 @@ const rtcReportUrl = {
21
21
  online: 'r.weclassroom.com'
22
22
  };
23
23
  const sdkVale = {
24
- zego: 8, //8代表zego采集麦克风+扬声器
25
- talrtc: 101, //101代表talrtc采集声音
24
+ zego: 4, //4代表zego采集麦克风+扬声器+拉流声音+外部混音
25
+ talrtc: 101, //101代表talrtc采集声音
26
26
  trtc: 102, //102代表trtc采集声音
27
27
  }
28
28
 
@@ -1797,6 +1797,21 @@ export const setAUXAudioType = (type) => {
1797
1797
  }
1798
1798
  };
1799
1799
 
1800
+ /**
1801
+ * @function 开启音频外部采集
1802
+ * @return: Promise
1803
+ */
1804
+ export const setThirdAudioType = (type) => {
1805
+ switch (window.zbyAVSDK_init_sdk_type) {
1806
+ case RTC:
1807
+ break;
1808
+ case ZEGO:
1809
+ return zegosdk.setThirdAudioType(type);
1810
+ default:
1811
+ break;
1812
+ }
1813
+ };
1814
+
1800
1815
  /**
1801
1816
  * @function 判断推流类型
1802
1817
  * @return: Promise
@@ -1817,9 +1832,9 @@ const setThirdAudioCallbackType = (sdkType) => {
1817
1832
  return zegosdk.setThirdAudioType(type);
1818
1833
  }
1819
1834
 
1820
- const startMixStreams = (urls) => {
1835
+ const startMixStreams = (srcStreamIds, urls) => {
1821
1836
  console.log('zego startmixStreams');
1822
- return zegosdk.startmixStreams(urls);
1837
+ return zegosdk.startmixStreams(srcStreamIds, urls);
1823
1838
  }
1824
1839
 
1825
1840
  const stopMixtStreams = (urls) => {
@@ -1801,7 +1801,12 @@ export const startPublish2 = async (streamid, idx, title, flag, seq) => {
1801
1801
  if (streamIdList.includes(streamId)) {
1802
1802
  console.log('streamIdList is including this streamid', streamIdList, streamId);
1803
1803
  } else {
1804
- streamIdList.push(streamId);
1804
+ if (idx === 1) {
1805
+ await callMethod('StartCapture',{publish_channel:idx});
1806
+ streamIdList.unshift(streamId);
1807
+ } else {
1808
+ streamIdList.push(streamId);
1809
+ }
1805
1810
  }
1806
1811
  if (typeof title === 'undefined') {
1807
1812
  title = 'none';
@@ -1864,6 +1869,9 @@ export const stopPublish = (idx, msg, flag) => {
1864
1869
  if (typeof idx === 'undefined') {
1865
1870
  idx = 0;
1866
1871
  }
1872
+ if (idx === 1) {
1873
+ callMethod('StopCapture',{publish_channel:idx});
1874
+ }
1867
1875
  // try {
1868
1876
  // dataReport.stopPublish({publish_streamid:window.zbyAVSDK_init_params.zego.streamId});
1869
1877
  // } catch (error) {}
@@ -2081,15 +2089,15 @@ export const mixStream = (type, args, seq) => {
2081
2089
 
2082
2090
  };
2083
2091
 
2084
- export const startmixStreams = async (targetUrl) => {
2092
+ export const startmixStreams = async (srcStreamIds, targetUrl) => {
2085
2093
  const zego = window.zbyAVSDK_init_params.zego;
2086
2094
 
2087
2095
  let rtcStreamId = `${zego.sid.slice(0,zego.sid.length-1)+2}` //'4000_345_123_2'
2088
2096
  let param = {
2089
- institutionId: zego.institutionId,
2097
+ institutionId: window.zby_sdk_init_params.institutionId,
2090
2098
  taskId: zego.sid,
2091
2099
  userId: zego.userId,
2092
- streamIds: streamIdList,
2100
+ streamIds: srcStreamIds, // 数组
2093
2101
  rtcStreamId,
2094
2102
  pushUrls: targetUrl //数组
2095
2103
  }
@@ -2104,15 +2112,15 @@ export const startmixStreams = async (targetUrl) => {
2104
2112
  nOutputFps: 15,
2105
2113
  nOutputBitrate: 512000,
2106
2114
  nOutputAudioBitrate: 48000,
2107
- nOutputWidth: 1280,
2108
- nOutputHeight: 720,
2115
+ nOutputWidth: 1200,
2116
+ nOutputHeight: 540,
2109
2117
  nOutputAudioConfig: 0,
2110
2118
  pUserData: '',
2111
2119
  nLenOfUserData: 0,
2112
2120
  pInputStreamList: [
2113
2121
  {
2114
2122
  szStreamID: streamIdList[1],//截屏窗
2115
- layout: { left: 0, top: 0, right: 1040, bottom: 720 },
2123
+ layout: { left: 0, top: 0, right: 960, bottom: 540 },
2116
2124
  uSoundLevelID: 1234,
2117
2125
  nContentControl: 0,
2118
2126
  nVolume: 100,
@@ -2122,7 +2130,7 @@ export const startmixStreams = async (targetUrl) => {
2122
2130
  },
2123
2131
  {
2124
2132
  szStreamID: streamIdList[0],//头像
2125
- layout: { left: 1040, top: 0, right: 1280, bottom: 180 },
2133
+ layout: { left: 1008, top: 0, right: 1152, bottom: 108 },
2126
2134
  uSoundLevelID: 3232,
2127
2135
  nContentControl: 0,
2128
2136
  nVolume: 100,
@@ -2151,7 +2159,7 @@ export const startmixStreams = async (targetUrl) => {
2151
2159
  // }
2152
2160
  ],
2153
2161
  nOutputStreamCount: 1,
2154
- pOutputBackgroundImage: '',
2162
+ pOutputBackgroundImage: 'preset-id://262148633_live_pink.png',
2155
2163
  }
2156
2164
  })
2157
2165
  }
@@ -282,6 +282,10 @@ const zbysdk = {
282
282
 
283
283
  // 结束设备检测
284
284
  stopCheckDevice() {
285
+ if (deviceCheckerInitStatus === -1) {
286
+ defaultApi.writeLog('please start check device first');
287
+ return 'please start check device first';
288
+ }
285
289
  deviceCheckerInitStatus = -1;
286
290
  defaultApi.writeLog('sdk stop check device');
287
291
  return zbyAVSDK.stopCheckDevice();
@@ -1514,15 +1518,21 @@ const zbysdk = {
1514
1518
  return zbyAVSDK.setAUXAudioType(type);
1515
1519
  },
1516
1520
 
1521
+ //RTC同屏 辅助通道音频类型
1522
+ setThirdAudioType(type) {
1523
+ defaultApi.writeLog('sdk action: setThirdAudioType');
1524
+ return zbyAVSDK.setThirdAudioType(type);
1525
+ },
1526
+
1517
1527
  //发送sei
1518
1528
  sendMediaSideInfo(info) {
1519
1529
  defaultApi.writeLog('sdk action: sendMediaSideInfo');
1520
1530
  return zbyAVSDK.sendMediaSideInfo(info);
1521
1531
  },
1522
1532
 
1523
- startMixStreams(urls) {
1533
+ startMixStreams(srcStreamIds, urls) {
1524
1534
  defaultApi.writeLog('sdk action: startMixStream');
1525
- return zbyAVSDK.startMixStreams(urls);
1535
+ return zbyAVSDK.startMixStreams(srcStreamIds, urls);
1526
1536
  },
1527
1537
 
1528
1538
  stopMixtStreams(urls) {