zby-live-sdk 1.0.49-beta1213 → 1.0.49-beta20221223
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 +9 -86
- package/dist/zby-live-sdk.cjs.js +3 -3
- package/dist/zby-live-sdk.esm.js +3 -3
- package/dist/zby-live-sdk.umd.js +3 -4
- package/package.json +1 -1
- package/src/config/config.js +1 -12
- package/src/network/api.js +1 -10
- package/src/zby-av-sdk/zby-av-sdk.js +5 -48
- package/src/zby-av-sdk/zego-sdk.js +7 -259
- package/src/zby-live-sdk.js +1 -27
- package/.vs/ProjectSettings.json +0 -3
- package/.vs/VSWorkspaceState.json +0 -6
- package/.vs/slnx.sqlite +0 -0
package/package.json
CHANGED
package/src/config/config.js
CHANGED
|
@@ -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-
|
|
16
|
+
export const version = '1.0.49-beta20221223';
|
|
17
17
|
|
|
18
18
|
export const liveExt = {
|
|
19
19
|
name: 'live',
|
|
@@ -108,22 +108,11 @@ const apiChangeSdkUrl = {
|
|
|
108
108
|
online: 'https://cloud-platform-live.speiyou.com/cloud-platform'
|
|
109
109
|
};
|
|
110
110
|
|
|
111
|
-
//开启混流
|
|
112
|
-
const apiMixStreams = {
|
|
113
|
-
test: 'https://tf-classroom-test.vdyoo.com',
|
|
114
|
-
online: 'https://tf-classroom-online.vdyoo.com'
|
|
115
|
-
};
|
|
116
|
-
|
|
117
111
|
export const getApiCloudBaseUrl = () => {
|
|
118
112
|
const {env} = config;
|
|
119
113
|
return apiCloudUrl[env];
|
|
120
114
|
};
|
|
121
115
|
|
|
122
|
-
export const getApiMixStreams = () => {
|
|
123
|
-
const {env} = config;
|
|
124
|
-
return apiMixStreams[env];
|
|
125
|
-
}
|
|
126
|
-
|
|
127
116
|
export const getApiChangeSdkUrl = () => {
|
|
128
117
|
const {env} = config;
|
|
129
118
|
return apiChangeSdkUrl[env];
|
package/src/network/api.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @FilePath: \1705\zby_live_sdk\src\network\api.js
|
|
8
8
|
*/
|
|
9
9
|
import commonFetch from './commonFetch.js';
|
|
10
|
-
import {getReportBaseUrl, getApiCloudBaseUrl, getCloudApiDomain, getApiChangeSdkUrl, timestampUrl
|
|
10
|
+
import {getReportBaseUrl, getApiCloudBaseUrl, getCloudApiDomain, getApiChangeSdkUrl, timestampUrl} from '../config/config.js';
|
|
11
11
|
import util from '../util/util';
|
|
12
12
|
|
|
13
13
|
//获取信道服务器地址
|
|
@@ -48,12 +48,3 @@ export function dabanDataReport(param){
|
|
|
48
48
|
export function changeSdkInRoom(param){
|
|
49
49
|
return commonFetch(`${getApiChangeSdkUrl()}/rtccloud/sdk/set/lecture/client`, param, 'FROMDATA');
|
|
50
50
|
}
|
|
51
|
-
|
|
52
|
-
//开始混流
|
|
53
|
-
export function mixStreamsStart(param) {
|
|
54
|
-
return commonFetch(`${getApiMixStreams()}/rtc-backend/mix/stream/start`, param, 'POST');
|
|
55
|
-
}
|
|
56
|
-
//结束混流
|
|
57
|
-
export function mixStreamsStop(param) {
|
|
58
|
-
return commonFetch(`${getApiMixStreams()}/rtc-backend/mix/stream/end`, param, 'POST');
|
|
59
|
-
}
|
|
@@ -21,8 +21,8 @@ const rtcReportUrl = {
|
|
|
21
21
|
online: 'r.weclassroom.com'
|
|
22
22
|
};
|
|
23
23
|
const sdkVale = {
|
|
24
|
-
zego:
|
|
25
|
-
talrtc: 101,
|
|
24
|
+
zego: 8, //8代表zego采集麦克风+扬声器
|
|
25
|
+
talrtc: 101, //101代表talrtc采集声音
|
|
26
26
|
trtc: 102, //102代表trtc采集声音
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -83,7 +83,7 @@ export const deviceCheckerInit = async (extension, env) => {
|
|
|
83
83
|
});
|
|
84
84
|
window.zbyAVSDK_init_sdk_type = 'zego';
|
|
85
85
|
}
|
|
86
|
-
defaultApi.writeLog('change zbyAVSDK_init_sdk_type to
|
|
86
|
+
defaultApi.writeLog('change zbyAVSDK_init_sdk_type to rtc , from avsdk device check init');
|
|
87
87
|
};
|
|
88
88
|
|
|
89
89
|
/**
|
|
@@ -1782,21 +1782,6 @@ 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
|
-
|
|
1800
1785
|
/**
|
|
1801
1786
|
* @function 开启音频外部采集
|
|
1802
1787
|
* @return: Promise
|
|
@@ -1812,21 +1797,6 @@ export const setAUXAudioType = (type) => {
|
|
|
1812
1797
|
}
|
|
1813
1798
|
};
|
|
1814
1799
|
|
|
1815
|
-
/**
|
|
1816
|
-
* @function 开启音频外部采集
|
|
1817
|
-
* @return: Promise
|
|
1818
|
-
*/
|
|
1819
|
-
export const setThirdAudioType = (type) => {
|
|
1820
|
-
switch (window.zbyAVSDK_init_sdk_type) {
|
|
1821
|
-
case RTC:
|
|
1822
|
-
break;
|
|
1823
|
-
case ZEGO:
|
|
1824
|
-
return zegosdk.setThirdAudioType(type);
|
|
1825
|
-
default:
|
|
1826
|
-
break;
|
|
1827
|
-
}
|
|
1828
|
-
};
|
|
1829
|
-
|
|
1830
1800
|
/**
|
|
1831
1801
|
* @function 判断推流类型
|
|
1832
1802
|
* @return: Promise
|
|
@@ -1845,17 +1815,7 @@ export const getStreamType_zego = () => {
|
|
|
1845
1815
|
const setThirdAudioCallbackType = (sdkType) => {
|
|
1846
1816
|
let type = sdkVale[sdkType];
|
|
1847
1817
|
return zegosdk.setThirdAudioType(type);
|
|
1848
|
-
}
|
|
1849
|
-
|
|
1850
|
-
const startMixStreams = (mixTaskId, mixType, srcStreamIds, targetRtcStreamId, targetUrls, backgroundImageId, extraStreamIds=[], coursewareWidth = 1280) => {
|
|
1851
|
-
console.log('zego startmixStreams');
|
|
1852
|
-
return zegosdk.startmixStreams(mixTaskId, mixType, srcStreamIds, targetRtcStreamId, targetUrls, backgroundImageId, extraStreamIds, coursewareWidth);
|
|
1853
|
-
};
|
|
1854
|
-
|
|
1855
|
-
const stopMixtStreams = (mixTaskId, targetUrls) => {
|
|
1856
|
-
console.log('zego stopMixtStreams');
|
|
1857
|
-
return zegosdk.stopMixtStreams(mixTaskId, targetUrls);
|
|
1858
|
-
};
|
|
1818
|
+
}
|
|
1859
1819
|
|
|
1860
1820
|
|
|
1861
1821
|
export default {
|
|
@@ -1934,11 +1894,8 @@ export default {
|
|
|
1934
1894
|
startSoundLevelMonitor,
|
|
1935
1895
|
sendMediaSideInfo,
|
|
1936
1896
|
enableHighlight,
|
|
1937
|
-
setCustomHeadStreamId,
|
|
1938
1897
|
setAUXAudioType,
|
|
1939
1898
|
mixedstuVideo,
|
|
1940
|
-
setThirdAudioCallbackType
|
|
1941
|
-
startMixStreams,
|
|
1942
|
-
stopMixtStreams
|
|
1899
|
+
setThirdAudioCallbackType
|
|
1943
1900
|
// getDeviceState
|
|
1944
1901
|
};
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
**/
|
|
7
7
|
import {dabanDataReport} from '../network/api.js';
|
|
8
8
|
import dataReport from '../network/dataReport.js';
|
|
9
|
-
import { mixStreamsStart,mixStreamsStop } from '../network/api';
|
|
10
9
|
import {
|
|
11
10
|
getS,
|
|
12
11
|
setS,
|
|
@@ -56,8 +55,6 @@ let hasNetWrong = false;
|
|
|
56
55
|
const classType = 0;
|
|
57
56
|
// 监听id
|
|
58
57
|
let EMListenerId = 0;
|
|
59
|
-
// 缓存上层传入的AppId
|
|
60
|
-
let cacheAppId = 0;
|
|
61
58
|
|
|
62
59
|
//静音推流时,音量值是否上抛上层标志 false=没有声音不往上层通知/true=有声音有上层通知
|
|
63
60
|
let isNoticeMicVolumeZego = false;
|
|
@@ -72,7 +69,6 @@ let currStreamIdRtcPlayerInfo ;
|
|
|
72
69
|
|
|
73
70
|
//记录底层推流回调的值
|
|
74
71
|
let dataZegoCapture = {};
|
|
75
|
-
|
|
76
72
|
/**
|
|
77
73
|
* @function 调用端提供的回调方法
|
|
78
74
|
* @param name:String 回调方法名
|
|
@@ -194,10 +190,7 @@ const addListener = (userId, userName, confId, nNetType, devices) => {
|
|
|
194
190
|
afterInitSDK(userId, userName, confId, nNetType, devices);
|
|
195
191
|
}
|
|
196
192
|
}
|
|
197
|
-
|
|
198
|
-
case 'OnMixStreamEx':
|
|
199
|
-
console.log('OnMixStreamEx',data)
|
|
200
|
-
break;
|
|
193
|
+
break;
|
|
201
194
|
case 'OnLoginChannel':
|
|
202
195
|
var status = JSON.parse(data).uiErrorCode;
|
|
203
196
|
defaultApi.writeLog(`ZEGO::addListener-- OnLoginChannel: ${status}`);
|
|
@@ -606,7 +599,6 @@ export const startEngine = (appId, appSignature, businessType) => {
|
|
|
606
599
|
if (typeof businessType === 'undefined') {
|
|
607
600
|
businessType = 0;
|
|
608
601
|
}
|
|
609
|
-
cacheAppId = appId;
|
|
610
602
|
defaultApi.writeLog('avsdk ZEGO::StartEngine');
|
|
611
603
|
return callMethod('StartEngine', {
|
|
612
604
|
appId,
|
|
@@ -753,7 +745,7 @@ export const stopCheckDevice = async() => {
|
|
|
753
745
|
removerListener();
|
|
754
746
|
await stopSoundLevelMonitor();
|
|
755
747
|
await stopPreview();
|
|
756
|
-
defaultApi.writeLog('
|
|
748
|
+
defaultApi.writeLog('rtc stopCheckDevice and removerListener and captureDestroy');
|
|
757
749
|
return callMethod('DestroyEngine', {});
|
|
758
750
|
};
|
|
759
751
|
|
|
@@ -1799,14 +1791,11 @@ export const setDefaultDevice = async (devices, operationType) => {
|
|
|
1799
1791
|
*/
|
|
1800
1792
|
export const startPublish2 = async (streamid, idx, title, flag, seq) => {
|
|
1801
1793
|
const streamId = streamid || window.zbyAVSDK_init_params.zego.streamId;
|
|
1802
|
-
if (idx === 1) {
|
|
1803
|
-
await callMethod("StartCapture", { publish_channel: idx });
|
|
1804
|
-
}
|
|
1805
1794
|
if (typeof title === 'undefined') {
|
|
1806
1795
|
title = 'none';
|
|
1807
1796
|
}
|
|
1808
1797
|
if (typeof flag === 'undefined') {
|
|
1809
|
-
flag =
|
|
1798
|
+
flag = 0;
|
|
1810
1799
|
}
|
|
1811
1800
|
if (typeof seq === 'undefined') {
|
|
1812
1801
|
seq = 0;
|
|
@@ -1863,9 +1852,6 @@ export const stopPublish = (idx, msg, flag) => {
|
|
|
1863
1852
|
if (typeof idx === 'undefined') {
|
|
1864
1853
|
idx = 0;
|
|
1865
1854
|
}
|
|
1866
|
-
if (idx === 1) {
|
|
1867
|
-
callMethod('StopCapture',{publish_channel:idx});
|
|
1868
|
-
}
|
|
1869
1855
|
// try {
|
|
1870
1856
|
// dataReport.stopPublish({publish_streamid:window.zbyAVSDK_init_params.zego.streamId});
|
|
1871
1857
|
// } catch (error) {}
|
|
@@ -1976,7 +1962,7 @@ export const playStream = (streamId, uiChnIndex, pInfo) => {
|
|
|
1976
1962
|
export const stopPlayStream = async (streamId, recovery) => {
|
|
1977
1963
|
const id = streamIdToPreviewId[streamId];
|
|
1978
1964
|
delete streamIdRtcPlayerInfo[streamId];
|
|
1979
|
-
if (recovery && id && !uiChnIndexs.includes(id)) {
|
|
1965
|
+
if (recovery && id != undefined && !uiChnIndexs.includes(id)) {
|
|
1980
1966
|
uiChnIndexs.push(id);
|
|
1981
1967
|
defaultApi.writeLog(`avsdk ZEGO::stopPlayStream streamId: ${streamId} id: ${id} uiChnIndexs: ${uiChnIndexs}`);
|
|
1982
1968
|
delete streamIdToPreviewId[streamId];
|
|
@@ -1996,7 +1982,7 @@ export const stopAllPlayStream = () => {
|
|
|
1996
1982
|
for (let streamId in streamIdToPreviewId) {
|
|
1997
1983
|
if (streamIdToPreviewId.hasOwnProperty(streamId)) {
|
|
1998
1984
|
const id = streamIdToPreviewId[streamId];
|
|
1999
|
-
if (id && !uiChnIndexs.includes(id)) {
|
|
1985
|
+
if (id != undefined && !uiChnIndexs.includes(id)) {
|
|
2000
1986
|
uiChnIndexs.push(id);
|
|
2001
1987
|
toRecoveryArr.push(callMethod('StopPlayStream', {
|
|
2002
1988
|
pszStreamID: streamId
|
|
@@ -2083,233 +2069,6 @@ export const mixStream = (type, args, seq) => {
|
|
|
2083
2069
|
|
|
2084
2070
|
};
|
|
2085
2071
|
|
|
2086
|
-
/**
|
|
2087
|
-
* @function 切换播放流
|
|
2088
|
-
* @param mixTaskId:String 任务ID,混流任务唯一标识 必选
|
|
2089
|
-
* @param mixType:Int 0-web, 1-record, 2-Chat, 3-H5 必选
|
|
2090
|
-
* @param srcStreamIds:Array 课件+老师头像流ID ['stream_1','stream_2'] 必选
|
|
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}]
|
|
2092
|
-
* @param targetRtcStreamId:String 混流输出流ID,必选
|
|
2093
|
-
* @param targetUrls:Array 转推RTMP流地址,必选
|
|
2094
|
-
* @param backgroundImageId:Int 0默认,1上台,2关闭摄像头,3嘉宾未签到,4嘉宾离线
|
|
2095
|
-
* @param coursewareWidth: Int 课件区真实宽
|
|
2096
|
-
* @return Promise | void
|
|
2097
|
-
*/
|
|
2098
|
-
export const startmixStreams = async (mixTaskId, mixType, srcStreamIds, targetRtcStreamId, targetUrls, backgroundImageId = 0, extraStreamIds=[], coursewareWidth = 1280) => {
|
|
2099
|
-
let srcStreamInfos = [];
|
|
2100
|
-
let bkImage='preset-id://'+cacheAppId+'_live_closeCamera.png';
|
|
2101
|
-
defaultApi.writeLog(`avsdk ZEGO::startmixStreams default bkImage: ${bkImage}`);
|
|
2102
|
-
if (mixType === 0 || mixType === 1) {
|
|
2103
|
-
for (let i = 0, len = srcStreamIds.length; i < len; i++) {
|
|
2104
|
-
if (srcStreamIds[i].contentControl === 1) {
|
|
2105
|
-
srcStreamInfos.push({
|
|
2106
|
-
streamId: srcStreamIds[i].streamId,
|
|
2107
|
-
left: null,
|
|
2108
|
-
top: null,
|
|
2109
|
-
right: null,
|
|
2110
|
-
bottom: null,
|
|
2111
|
-
contentControl: srcStreamIds[i].contentControl
|
|
2112
|
-
});
|
|
2113
|
-
} else {
|
|
2114
|
-
if (i === 0) {
|
|
2115
|
-
srcStreamInfos.push({
|
|
2116
|
-
streamId: srcStreamIds[i].streamId,
|
|
2117
|
-
left: 0,
|
|
2118
|
-
top: 0,
|
|
2119
|
-
right: 1280,
|
|
2120
|
-
bottom: 720,
|
|
2121
|
-
contentControl: srcStreamIds[i].contentControl
|
|
2122
|
-
});
|
|
2123
|
-
} else if (i === 1) {
|
|
2124
|
-
srcStreamInfos.push({
|
|
2125
|
-
streamId: srcStreamIds[i].streamId,
|
|
2126
|
-
left: 1344,
|
|
2127
|
-
top: 0,
|
|
2128
|
-
right: 1536,
|
|
2129
|
-
bottom: 144,
|
|
2130
|
-
contentControl: srcStreamIds[i].contentControl
|
|
2131
|
-
});
|
|
2132
|
-
}
|
|
2133
|
-
}
|
|
2134
|
-
}
|
|
2135
|
-
|
|
2136
|
-
let srcStreamInfos2 = [];
|
|
2137
|
-
Object.assign(srcStreamInfos2, extraStreamIds);
|
|
2138
|
-
if(srcStreamInfos2.length > 0) {
|
|
2139
|
-
let factor = 1280 / coursewareWidth;
|
|
2140
|
-
srcStreamInfos2.forEach( item => {
|
|
2141
|
-
item.left = parseInt(item.left * factor);
|
|
2142
|
-
item.top = parseInt(item.top * factor);
|
|
2143
|
-
item.right = parseInt(item.right * factor);
|
|
2144
|
-
item.bottom = parseInt(item.bottom * factor);
|
|
2145
|
-
if (((item.right - item.left) % 2) != 0) {
|
|
2146
|
-
item.right = item.right - 1;
|
|
2147
|
-
}
|
|
2148
|
-
if (((item.bottom - item.top) % 2) != 0) {
|
|
2149
|
-
item.bottom = item.bottom - 1;
|
|
2150
|
-
}
|
|
2151
|
-
});
|
|
2152
|
-
|
|
2153
|
-
srcStreamInfos = srcStreamInfos.concat(srcStreamInfos2);
|
|
2154
|
-
|
|
2155
|
-
defaultApi.writeLog(`srcStreamInfos---------- params:${JSON.stringify(srcStreamInfos)}`);
|
|
2156
|
-
}
|
|
2157
|
-
|
|
2158
|
-
switch (backgroundImageId) {
|
|
2159
|
-
case 0:
|
|
2160
|
-
break;
|
|
2161
|
-
case 1:
|
|
2162
|
-
bkImage = 'preset-id://'+cacheAppId+'_live_TeacherOnStage.png';
|
|
2163
|
-
break;
|
|
2164
|
-
case 2:
|
|
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';
|
|
2172
|
-
break;
|
|
2173
|
-
default:
|
|
2174
|
-
break;
|
|
2175
|
-
}
|
|
2176
|
-
}
|
|
2177
|
-
|
|
2178
|
-
const zego = window.zbyAVSDK_init_params.zego;
|
|
2179
|
-
let param = {
|
|
2180
|
-
institutionId: window.zby_sdk_init_params.institutionId,
|
|
2181
|
-
taskId: mixTaskId,
|
|
2182
|
-
userId: zego.userId,
|
|
2183
|
-
streamInfos: srcStreamInfos,
|
|
2184
|
-
rtcStreamId: targetRtcStreamId,
|
|
2185
|
-
pushUrls: targetUrls, //数组
|
|
2186
|
-
backgroundImage: bkImage,
|
|
2187
|
-
streamOutPut:{width:1600,height:720,videoBitrate:1500000,fps:20}
|
|
2188
|
-
};
|
|
2189
|
-
|
|
2190
|
-
defaultApi.writeLog(`startMixStreams params:${JSON.stringify(param)}`);
|
|
2191
|
-
|
|
2192
|
-
let res = await mixStreamsStart(param);
|
|
2193
|
-
if (res.code == 0) {
|
|
2194
|
-
console.log('混流成功:', res);
|
|
2195
|
-
} else {
|
|
2196
|
-
console.log('混流失败:', res);
|
|
2197
|
-
}
|
|
2198
|
-
// else {
|
|
2199
|
-
// console.log('startmixStream local start……');
|
|
2200
|
-
// return callMethod('MixStreamEx', {
|
|
2201
|
-
// mixstreamid: mixTaskId,
|
|
2202
|
-
// config: {
|
|
2203
|
-
// nOutputFps: 15,
|
|
2204
|
-
// nOutputBitrate: 512000,
|
|
2205
|
-
// nOutputAudioBitrate: 48000,
|
|
2206
|
-
// nOutputWidth: 1200,
|
|
2207
|
-
// nOutputHeight: 540,
|
|
2208
|
-
// nOutputAudioConfig: 0,
|
|
2209
|
-
// pUserData: '',
|
|
2210
|
-
// nLenOfUserData: 0,
|
|
2211
|
-
// pInputStreamList: [
|
|
2212
|
-
// {
|
|
2213
|
-
// szStreamID: streamIdList[1],//截屏窗
|
|
2214
|
-
// layout: { left: 0, top: 0, right: 960, bottom: 540 },
|
|
2215
|
-
// uSoundLevelID: 1234,
|
|
2216
|
-
// nContentControl: 0,
|
|
2217
|
-
// nVolume: 100,
|
|
2218
|
-
// bAudioFocus: false,
|
|
2219
|
-
// nAudioDirection: -1,
|
|
2220
|
-
// renderMode: 0
|
|
2221
|
-
// },
|
|
2222
|
-
// {
|
|
2223
|
-
// szStreamID: streamIdList[0],//头像
|
|
2224
|
-
// layout: { left: 1008, top: 0, right: 1152, bottom: 108 },
|
|
2225
|
-
// uSoundLevelID: 3232,
|
|
2226
|
-
// nContentControl: 0,
|
|
2227
|
-
// nVolume: 100,
|
|
2228
|
-
// bAudioFocus: false,
|
|
2229
|
-
// nAudioDirection: -1,
|
|
2230
|
-
// renderMode: 0
|
|
2231
|
-
// }
|
|
2232
|
-
// ],
|
|
2233
|
-
// nInputStreamCount: 2,
|
|
2234
|
-
// pOutputList: [
|
|
2235
|
-
// {
|
|
2236
|
-
// isUrl: true, // 输出是否为流名或URL
|
|
2237
|
-
// target: targetUrls[0], //isUrl=ture完整的RTMP URL,false是流名
|
|
2238
|
-
// videoCodec: 0,
|
|
2239
|
-
// videoBitrate: 0,
|
|
2240
|
-
// encodeProfile: 1,
|
|
2241
|
-
// encodeLatency: 0
|
|
2242
|
-
// }
|
|
2243
|
-
// // {
|
|
2244
|
-
// // isUrl: false,
|
|
2245
|
-
// // target: "streamId",
|
|
2246
|
-
// // videoCodec: 0,
|
|
2247
|
-
// // videoBitrate: 0,
|
|
2248
|
-
// // encodeProfile: 1,
|
|
2249
|
-
// // encodeLatency: 0
|
|
2250
|
-
// // }
|
|
2251
|
-
// ],
|
|
2252
|
-
// nOutputStreamCount: 1,
|
|
2253
|
-
// pOutputBackgroundImage: bkImage,
|
|
2254
|
-
// }
|
|
2255
|
-
// });
|
|
2256
|
-
// }
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
};
|
|
2260
|
-
|
|
2261
|
-
export const stopMixtStreams = async (mixTaskId, targetUrls) => {
|
|
2262
|
-
const zego = window.zbyAVSDK_init_params.zego;
|
|
2263
|
-
let param = {
|
|
2264
|
-
taskId: mixTaskId,
|
|
2265
|
-
userId: zego.userId
|
|
2266
|
-
};
|
|
2267
|
-
let res = await mixStreamsStop(param);
|
|
2268
|
-
if (res.code == 0) {
|
|
2269
|
-
console.log('停止混流成功:', res);
|
|
2270
|
-
} else {
|
|
2271
|
-
console.log('停止混流失败:', res);
|
|
2272
|
-
}
|
|
2273
|
-
// else {
|
|
2274
|
-
// return callMethod('MixStreamEx', {
|
|
2275
|
-
// mixstreamid: mixTaskId,
|
|
2276
|
-
// config: {
|
|
2277
|
-
// nOutputFps: 15,
|
|
2278
|
-
// nOutputBitrate: 512000,
|
|
2279
|
-
// nOutputAudioBitrate: 48000,
|
|
2280
|
-
// nOutputWidth: 1280,
|
|
2281
|
-
// nOutputHeight: 720,
|
|
2282
|
-
// nOutputAudioConfig: 0,
|
|
2283
|
-
// pUserData: '',
|
|
2284
|
-
// nLenOfUserData: 0,
|
|
2285
|
-
// pInputStreamList: [],
|
|
2286
|
-
// nInputStreamCount: 2,
|
|
2287
|
-
// pOutputList: [
|
|
2288
|
-
// {
|
|
2289
|
-
// isUrl: true, // 输出是否为流名或URL
|
|
2290
|
-
// target: targetUrls[0], //isUrl=ture完整的RTMP URL,false是流名
|
|
2291
|
-
// videoCodec: 0,
|
|
2292
|
-
// videoBitrate: 0,
|
|
2293
|
-
// encodeProfile: 1,
|
|
2294
|
-
// encodeLatency: 0
|
|
2295
|
-
// }
|
|
2296
|
-
// // {
|
|
2297
|
-
// // isUrl: false,
|
|
2298
|
-
// // target: "streamId",
|
|
2299
|
-
// // videoCodec: 0,
|
|
2300
|
-
// // videoBitrate: 0,
|
|
2301
|
-
// // encodeProfile: 1,
|
|
2302
|
-
// // encodeLatency: 0
|
|
2303
|
-
// // }
|
|
2304
|
-
// ],
|
|
2305
|
-
// nOutputStreamCount: 1,
|
|
2306
|
-
// pOutputBackgroundImage: '',
|
|
2307
|
-
// }
|
|
2308
|
-
// });
|
|
2309
|
-
// }
|
|
2310
|
-
};
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
2072
|
/**
|
|
2314
2073
|
* @function 是否拉取音频流--通过流id控制
|
|
2315
2074
|
* @param streamId:String 被拉取的流的 id,必选
|
|
@@ -2651,15 +2410,7 @@ const setAudioAuxSource = (source) => {
|
|
|
2651
2410
|
});
|
|
2652
2411
|
}
|
|
2653
2412
|
|
|
2654
|
-
|
|
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扬声器(音乐)(没有拉流,没有外部混音没有调用,没有麦克风)
|
|
2413
|
+
//RTC同屏 辅助通道音频类型 0:静音 / 1:麦克风 / 2:拉流的声音 / 3:1+2 / 4:麦克风+扬声器 /5:扬声器(音乐)(没有拉流,没有外部混音没有调用,没有麦克风)
|
|
2663
2414
|
const setAUXAudioType = (type) => {
|
|
2664
2415
|
defaultApi.writeLog('info', 'avsdk ZEGO::SetAUXAudioType');
|
|
2665
2416
|
return callMethod('SetAUXAudioType', {
|
|
@@ -3235,14 +2986,11 @@ export default {
|
|
|
3235
2986
|
getAllChannelIndex,
|
|
3236
2987
|
startAudioExCapture,
|
|
3237
2988
|
sendMediaSideInfo,
|
|
3238
|
-
setCustomHeadStreamId,
|
|
3239
2989
|
setAUXAudioType,
|
|
3240
2990
|
loadCollectionInputEntry2,
|
|
3241
2991
|
addListener,
|
|
3242
2992
|
stopCheckDevice,
|
|
3243
2993
|
getDeviceCheckInitStatus,
|
|
3244
2994
|
setDeviceCheckInitStatus,
|
|
3245
|
-
setThirdAudioType
|
|
3246
|
-
startmixStreams,
|
|
3247
|
-
stopMixtStreams
|
|
2995
|
+
setThirdAudioType
|
|
3248
2996
|
};
|
package/src/zby-live-sdk.js
CHANGED
|
@@ -282,10 +282,6 @@ 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
|
-
}
|
|
289
285
|
deviceCheckerInitStatus = -1;
|
|
290
286
|
defaultApi.writeLog('sdk stop check device');
|
|
291
287
|
return zbyAVSDK.stopCheckDevice();
|
|
@@ -1512,40 +1508,18 @@ const zbysdk = {
|
|
|
1512
1508
|
return zbyAVSDK.startAudioExCapture();
|
|
1513
1509
|
},
|
|
1514
1510
|
|
|
1515
|
-
//设置授课嘉宾头像流id
|
|
1516
|
-
setCustomHeadStreamId (headStreamID) {
|
|
1517
|
-
defaultApi.writeLog(`sdk action: setCustomHeadStreamId headStreamID:${headStreamID}`);
|
|
1518
|
-
return zbyAVSDK.setCustomHeadStreamId(headStreamID);
|
|
1519
|
-
},
|
|
1520
|
-
|
|
1521
1511
|
//RTC同屏 辅助通道音频类型
|
|
1522
1512
|
setAUXAudioType(type) {
|
|
1523
|
-
defaultApi.writeLog(
|
|
1513
|
+
defaultApi.writeLog('sdk action: setAUXAudioType');
|
|
1524
1514
|
return zbyAVSDK.setAUXAudioType(type);
|
|
1525
1515
|
},
|
|
1526
1516
|
|
|
1527
|
-
//RTC同屏 辅助通道音频类型
|
|
1528
|
-
setThirdAudioType(type) {
|
|
1529
|
-
defaultApi.writeLog(`sdk action: setThirdAudioType type:${type}`);
|
|
1530
|
-
return zbyAVSDK.setThirdAudioType(type);
|
|
1531
|
-
},
|
|
1532
|
-
|
|
1533
1517
|
//发送sei
|
|
1534
1518
|
sendMediaSideInfo(info) {
|
|
1535
1519
|
defaultApi.writeLog('sdk action: sendMediaSideInfo');
|
|
1536
1520
|
return zbyAVSDK.sendMediaSideInfo(info);
|
|
1537
1521
|
},
|
|
1538
1522
|
|
|
1539
|
-
startMixStreams(mixTaskId, mixType, srcStreamIds, targetRtcStreamId, targetUrls, backgroundImageId=0, extraStreamIds=[], coursewareWidth = 1280) {
|
|
1540
|
-
defaultApi.writeLog(`sdk action: startMixStreams mixTaskId:${mixTaskId} mixType:${mixType} srcStreamIds:${JSON.stringify(srcStreamIds)} targetRtcStreamId:${targetRtcStreamId} targetUrls:${JSON.stringify(targetUrls)} backgroundImageId:${backgroundImageId} extraStreamIds:${JSON.stringify(extraStreamIds)} coursewareWidth:${coursewareWidth}`);
|
|
1541
|
-
return zbyAVSDK.startMixStreams(mixTaskId, mixType, srcStreamIds, targetRtcStreamId, targetUrls, backgroundImageId, extraStreamIds, coursewareWidth);
|
|
1542
|
-
},
|
|
1543
|
-
|
|
1544
|
-
stopMixtStreams(mixTaskId, targetUrls) {
|
|
1545
|
-
defaultApi.writeLog(`sdk action: stopMixtStreams mixTaskId:${mixTaskId} targetUrls:${targetUrls}`);
|
|
1546
|
-
return zbyAVSDK.stopMixtStreams(mixTaskId, targetUrls);
|
|
1547
|
-
},
|
|
1548
|
-
|
|
1549
1523
|
/**
|
|
1550
1524
|
* @function 切换sdk类型
|
|
1551
1525
|
* @return: Promise
|
package/.vs/ProjectSettings.json
DELETED
package/.vs/slnx.sqlite
DELETED
|
Binary file
|